File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 11/* global Plotly:false Tabs:false */
22
3+ var Lib = require ( '@src/lib' ) ;
4+
35var plotlist = document . getElementById ( 'plot-list' ) ;
46var anchor = document . getElementById ( 'embedded-graph' ) ;
57var image = document . getElementById ( 'embedded-image' ) ;
@@ -40,9 +42,10 @@ function plotButtons(plots, figDir) {
4042 anchor . appendChild ( gd ) ;
4143
4244 var plot = plots [ plotname ] ;
43- Plotly . plot ( gd , plot . data , plot . layout ) ;
44-
45+ var data = Lib . extendDeep ( [ ] , plot . data ) ;
46+ var layout = Lib . extendDeep ( { } , plot . layout ) ;
4547
48+ Plotly . plot ( gd , data , layout ) ;
4649 } ) ;
4750 } ) ;
4851
Original file line number Diff line number Diff line change 2121
2222 <!-- helper functions to manipulate the graph div -->
2323 < script >
24+ var d3 = Plotly . d3 ;
25+
2426 var Tabs = {
2527 getGraph : function ( ) {
2628 return document . getElementById ( 'embedded-graph' ) . children [ 0 ] ;
3436 anchor . appendChild ( graphDiv ) ;
3537
3638 return graphDiv ;
39+ } ,
40+ plotMock : function ( mockName ) {
41+ var mockURL = '../../test/image/mocks/' + mockName + '.json' ;
42+
43+ d3 . json ( mockURL , function ( err , fig ) {
44+ Plotly . plot ( Tabs . fresh ( ) , fig . data , fig . layout ) ;
45+ } ) ;
3746 }
3847 } ;
39-
40- var d3 = Plotly . d3 ;
4148 </ script >
4249
4350</ body >
You can’t perform that action at this time.
0 commit comments