From a6160bf44e6cdbf0ecd5633ef4e6d720782a0162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Thu, 5 May 2016 17:55:52 -0400 Subject: [PATCH 1/4] add Tabs.setPlotConfig : - to so that local topojson files are used while dev'ing in the test dashboard - make sure that setPlotConfig is called on reload too --- devtools/test_dashboard/devtools.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/devtools/test_dashboard/devtools.js b/devtools/test_dashboard/devtools.js index 76db3eb1e50..6ec1acdb5e1 100644 --- a/devtools/test_dashboard/devtools.js +++ b/devtools/test_dashboard/devtools.js @@ -11,6 +11,13 @@ var d3 = window.d3 = Plotly.d3; // Our gracious testing object var Tabs = { + // Set plot config options + setPlotConfig: function() { + + // use local topojson files + Plotly.setPlotConfig({ topojsonURL: '../../dist/topojson/' }); + }, + // Return the specified plot container (or default one) getGraph: function(id) { id = id || 'graph'; @@ -110,6 +117,7 @@ var Tabs = { var interval = setInterval(function() { if(window.Plotly) { clearInterval(interval); + Tabs.setPlotConfig(); Tabs.onReload(); } }, 100); @@ -125,6 +133,8 @@ setInterval(function() { window.fullData = window.gd._fullData; }, 1000); +// Set plot config on first load +Tabs.setPlotConfig(); // Mocks search and plotting var f = new Fuse(mocks, { From ffa59d81d6226bf3c13d31c9f6043aede2ab5b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Thu, 5 May 2016 17:56:26 -0400 Subject: [PATCH 2/4] add google fonts to test dashboard --- devtools/test_dashboard/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/devtools/test_dashboard/index.html b/devtools/test_dashboard/index.html index 1972b481951..f5888535d89 100644 --- a/devtools/test_dashboard/index.html +++ b/devtools/test_dashboard/index.html @@ -2,6 +2,7 @@ Plotly.js Devtools + From 18d234c58589c227e65fac5fe3ad1a898af2189e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Thu, 5 May 2016 17:56:41 -0400 Subject: [PATCH 3/4] add MathJax to test dashboard --- devtools/test_dashboard/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devtools/test_dashboard/index.html b/devtools/test_dashboard/index.html index f5888535d89..f553c983514 100644 --- a/devtools/test_dashboard/index.html +++ b/devtools/test_dashboard/index.html @@ -19,8 +19,8 @@
+ - From 406336703526a4578517b5e6ba1588326869abfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Thu, 5 May 2016 17:57:02 -0400 Subject: [PATCH 4/4] use removeChild instead of .remove() (for IE compatibility) --- devtools/test_dashboard/devtools.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devtools/test_dashboard/devtools.js b/devtools/test_dashboard/devtools.js index 6ec1acdb5e1..38aeba4198a 100644 --- a/devtools/test_dashboard/devtools.js +++ b/devtools/test_dashboard/devtools.js @@ -31,7 +31,7 @@ var Tabs = { var graphDiv = Tabs.getGraph(id); if(graphDiv) { - graphDiv.remove(); + graphDiv.parentNode.removeChild(graphDiv); } graphDiv = document.createElement('div');