@domoinc/image-tooltip
Version:
ImageTooltip - Domo Widget
44 lines (38 loc) • 1.11 kB
JavaScript
/*----------------------------------------------------------------------------------
Create Widget -> index.html
© 2011 - 2015 DOMO, INC.
----------------------------------------------------------------------------------*/
//Setup some fake data
var imageUrl = 'http://s3.amazonaws.com/Domo_infographic/fauxmosapiens/fauxmosapien-male-15-90.jpg';
var bodyText = 'Moe Rogerson is the sales leader of the month, bringing in $54,842 from sales!';
var sampleData = [
['Moe Rogerson', bodyText, imageUrl, 'https://www.domo.com/']
];
//Initialze the widget
var chartGroup = d3.select('#vis')
.append('svg')
.attr({
height: '500px',
width: '500px'
})
.append('g');
chartGroup
// .attr('transform', 'translate(125, 125)')
.append('rect')
.style({
stroke: '#000000',
fill: 'none',
})
.attr({
width: 500,
height: 500,
});
var chart = new ImageTooltip(chartGroup)
.c({
width: 250,
height: 250
});
d3.select('.layer-group').attr('transform', 'translate(125, 125)');
//Render the chart with data
chart._notifier.showMessage(true);
chart.draw(sampleData);