Skip to content

Commit 621fbd3

Browse files
committed
extend mock data and layout before plotting:
- to start from fresh on every button click
1 parent b11c365 commit 621fbd3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

devtools/test_dashboard/buttons.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/* global Plotly:false Tabs:false */
22

3+
var Lib = require('@src/lib');
4+
35
var plotlist = document.getElementById('plot-list');
46
var anchor = document.getElementById('embedded-graph');
57
var 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

0 commit comments

Comments
 (0)