1+ 'use strict' ;
2+
3+ /* global Plotly:false */
4+
15var Fuse = require ( 'fuse.js' ) ;
26var mocks = require ( '../../build/test_dashboard_mocks.json' ) ;
37
@@ -37,8 +41,8 @@ var Tabs = {
3741 plotMock : function ( mockName , id ) {
3842 var mockURL = '/test/image/mocks/' + mockName + '.json' ;
3943
40- window . Plotly . d3 . json ( mockURL , function ( err , fig ) {
41- window . Plotly . plot ( Tabs . fresh ( id ) , fig . data , fig . layout ) ;
44+ d3 . json ( mockURL , function ( err , fig ) {
45+ Plotly . plot ( Tabs . fresh ( id ) , fig . data , fig . layout ) ;
4246
4347 console . warn ( 'Plotting:' , mockURL ) ;
4448 } ) ;
@@ -49,12 +53,13 @@ var Tabs = {
4953 var gd = Tabs . getGraph ( id ) ;
5054
5155 if ( ! gd . _fullLayout || ! gd . _fullData ) {
56+ console . error ( 'no graph with id ' + id + ' found.' ) ;
5257 return ;
5358 }
5459
5560 var image = new Image ( ) ;
5661
57- window . Plotly . Snapshot . toImage ( gd , { format : 'png' } ) . on ( 'success' , function ( img ) {
62+ Plotly . Snapshot . toImage ( gd , { format : 'png' } ) . on ( 'success' , function ( img ) {
5863 image . src = img ;
5964
6065 var imageDiv = document . getElementById ( 'snapshot' ) ;
@@ -74,7 +79,7 @@ var Tabs = {
7479 }
7580
7681 for ( var i = 0 ; i < plots . length ; i ++ ) {
77- window . Plotly . purge ( plots [ i ] ) ;
82+ Plotly . purge ( plots [ i ] ) ;
7883 }
7984 } ,
8085
0 commit comments