Skip to content

Commit 67c7e73

Browse files
committed
Merge pull request #516 from plotly/devtool-patch
Devtool patch
2 parents 7191173 + 4063367 commit 67c7e73

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

devtools/test_dashboard/devtools.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ var d3 = window.d3 = Plotly.d3;
1111
// Our gracious testing object
1212
var Tabs = {
1313

14+
// Set plot config options
15+
setPlotConfig: function() {
16+
17+
// use local topojson files
18+
Plotly.setPlotConfig({ topojsonURL: '../../dist/topojson/' });
19+
},
20+
1421
// Return the specified plot container (or default one)
1522
getGraph: function(id) {
1623
id = id || 'graph';
@@ -24,7 +31,7 @@ var Tabs = {
2431
var graphDiv = Tabs.getGraph(id);
2532

2633
if(graphDiv) {
27-
graphDiv.remove();
34+
graphDiv.parentNode.removeChild(graphDiv);
2835
}
2936

3037
graphDiv = document.createElement('div');
@@ -110,6 +117,7 @@ var Tabs = {
110117
var interval = setInterval(function() {
111118
if(window.Plotly) {
112119
clearInterval(interval);
120+
Tabs.setPlotConfig();
113121
Tabs.onReload();
114122
}
115123
}, 100);
@@ -125,6 +133,8 @@ setInterval(function() {
125133
window.fullData = window.gd._fullData;
126134
}, 1000);
127135

136+
// Set plot config on first load
137+
Tabs.setPlotConfig();
128138

129139
// Mocks search and plotting
130140
var f = new Fuse(mocks, {

devtools/test_dashboard/index.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<html>
33
<head>
44
<title>Plotly.js Devtools</title>
5+
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:600,400,300,200|Droid+Sans|PT+Sans+Narrow|Gravitas+One|Droid+Sans+Mono|Droid+Serif|Raleway|Old+Standard+TT"/>
56
<link rel="stylesheet" type="text/css" href="./style.css">
67
</head>
78
<body>
@@ -18,8 +19,8 @@
1819
</div>
1920
<div id="snapshot"></div>
2021

22+
<script type="text/javascript" src="../../dist/extras/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
2123
<script id="source" type="text/javascript" src="../../build/plotly.js"></script>
2224
<script type="text/javascript" src="../../build/test_dashboard-bundle.js"></script>
2325
</body>
2426
</html>
25-

0 commit comments

Comments
 (0)