From 621fbd3afe8fa085c4ffc95912a734909b03f6b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Wed, 17 Feb 2016 18:11:01 -0500 Subject: [PATCH 1/2] extend mock data and layout before plotting: - to start from fresh on every button click --- devtools/test_dashboard/buttons.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/devtools/test_dashboard/buttons.js b/devtools/test_dashboard/buttons.js index 7f9068298b0..c698982f121 100644 --- a/devtools/test_dashboard/buttons.js +++ b/devtools/test_dashboard/buttons.js @@ -1,5 +1,7 @@ /* global Plotly:false Tabs:false */ +var Lib = require('@src/lib'); + var plotlist = document.getElementById('plot-list'); var anchor = document.getElementById('embedded-graph'); var image = document.getElementById('embedded-image'); @@ -40,9 +42,10 @@ function plotButtons(plots, figDir) { anchor.appendChild(gd); var plot = plots[plotname]; - Plotly.plot(gd, plot.data, plot.layout); - + var data = Lib.extendDeep([], plot.data); + var layout = Lib.extendDeep({}, plot.layout); + Plotly.plot(gd, data, layout); }); }); From c1a22fbd71fefa0b8ea81c026ea73908e09519bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Wed, 17 Feb 2016 18:11:30 -0500 Subject: [PATCH 2/2] add Tabs.plotMock, - quick helper to plot a given mock json in ./test/image/mocks/ --- devtools/test_dashboard/index.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/devtools/test_dashboard/index.html b/devtools/test_dashboard/index.html index 5103afbd22b..9d1f78ef45a 100644 --- a/devtools/test_dashboard/index.html +++ b/devtools/test_dashboard/index.html @@ -21,6 +21,8 @@