MCPcopy Index your code
hub / github.com/plotly/plotly.js / run

Function run

test/jasmine/tests/splom_test.js:1288–1330  ·  view source on GitHub ↗
(s, done)

Source from the content-addressed store, hash-verified

1286 });
1287
1288 function run(s, done) {
1289 gd = createGraphDiv();
1290
1291 var fig = Lib.extendDeep({},
1292 s.mock || require('../../image/mocks/splom_iris.json')
1293 );
1294
1295 if(s.patch) {
1296 fig = s.patch(fig);
1297 }
1298
1299 var pos = s.pos || [200, 100];
1300
1301 return _newPlot(gd, fig).then(function() {
1302 var to = setTimeout(function() {
1303 failTest('no event data received');
1304 done();
1305 }, 100);
1306
1307 gd.on('plotly_hover', function(d) {
1308 clearTimeout(to);
1309 assertHoverLabelContent(s);
1310
1311 var msg = ' - event data ' + s.desc;
1312 var actual = d.points || [];
1313 var exp = s.evtPts;
1314 expect(actual.length).toBe(exp.length, 'pt length' + msg);
1315 for(var i = 0; i < exp.length; i++) {
1316 for(var k in exp[i]) {
1317 var m = 'key ' + k + ' in pt ' + i + msg;
1318 expect(actual[i][k]).toBe(exp[i][k], m);
1319 }
1320 }
1321
1322 // w/o this purge gets called before
1323 // hover throttle is complete
1324 setTimeout(done, 0);
1325 });
1326
1327 mouseEvent('mousemove', pos[0], pos[1]);
1328 })
1329 .catch(failTest);
1330 }
1331
1332 var specs = [{
1333 desc: 'basic',

Callers 1

splom_test.jsFile · 0.70

Calls 3

doneFunction · 0.85
mouseEventFunction · 0.85
_newPlotFunction · 0.70

Tested by

no test coverage detected