@domoinc/image-svg
v1.1.0
Published
ImageSVG - Domo Widget
Downloads
7
Readme
ImageSVG
Configuration Options
chartName
Type: string
Default: "Image"
Name of chart for Reporting.
height
Type: number
Default: 250
Units: px
isOnMobile
Type: boolean
Default: false
If true, it signals to the widget that it is running on a mobile device. Should be called before draw and then NEVER changed.
shouldValidate
Type: boolean
Default: true
Flag for turning off data validation
showErrorMessage
Type: boolean
Default: true
undefined
updateSizeableConfigs
Type: boolean
Default: true
Flag for turning off the mimic of illustrator's scale functionality
width
Type: number
Default: 250
Units: px
Data Definition
ImageURL
Type: string
Default validate:
function (d) { return true; }
Default accessor:
function (line) { return String(line[1]); }
Name
Type: string
Default validate:
function (d) { return this.accessor(d) !== undefined; }
Default accessor:
function (line) { return String(line[0]); }
Events
Dispatch Events
External Events
Example
/*----------------------------------------------------------------------------------
Create Widget -> index.html
© 2011 - 2015 DOMO, INC.
----------------------------------------------------------------------------------*/
//Setup some fake data
var data = [
['Moe Rogerson', 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD84QzQ5OjcBCgoKDQwNGg8PGjclHyU3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3N//AABEIATkAPgMBIgACEQEDEQH/xAAcAAACAwEBAQEAAAAAAAAAAAAAAgMEBQEGBwj/xAAwEAABBAAFAwMCBgMBAQAAAAABAAIDEQQFEiExQVFhEyJxBoEUI0JSkaEyweEzFf/EABcBAQEBAQAAAAAAAAAAAAAAAAABAgP/xAAeEQEAAwACAwEBAAAAAAAAAAAAAQIRAyESMUEyBP/aAAwDAQACEQMRAD8A+2IQhAIQhAIQhAIQhAITV4RXhAqE1eEV4QKhNXhFeECoTV4RXhA9oWa6eZ42dXwuCV9e55+5U0aaFmepI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e46b72paHz9kBl8OIRSAeV0X2XAE7gSFUQ2KNd+yaM3/1RSOpwA6p22PKKlGyYBpVf1C6xsCmY4jbhBPoaOb/lRud22TElw3Slo7j+UR1ulxvhvTyjcDcqFhDXab9vS0xf+mwR0KKjmb72v2DRz4XA69tQHm1Yiy+bGCmnRHe7z/oKpmOV43BWWXNAOHAe4DyoaU1rdpr5TxvdXurblZ7Xt0gbk9aU7JQB2TRe9ToF3frSonE6dxt8qH8dI9xEQsDqVBvty3EyBusMZXFm1cgyuJlGVznuv4CvotbxnTBoAAAoBcIXLKLKqK02WYKd2qTDsLu4FH+lEMlwAP8A4n41lXrKLKmQKoyvAiMx/ho9J7ts/wArNd9Nxtkc6CZzGn9JF0tyyhPFdKhCFUCEIQCEIQCEIQCEIQCEIQCEIQCEIQf/2Q=='],
];
//Initialze the widget
var chart = d3.select('#vis')
.append('svg')
.attr({
height: '500px',
width: '500px'
})
.append('g')
.attr('transform', 'translate(150, 150)')
.chart('ImageSVG')
.c({
width: 200,
height: 500
});
//Render the chart with data
chart._notifier.showMessage(true);
chart.draw(data);