Skip to content

Devtool patch #516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion devtools/test_dashboard/devtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -24,7 +31,7 @@ var Tabs = {
var graphDiv = Tabs.getGraph(id);

if(graphDiv) {
graphDiv.remove();
graphDiv.parentNode.removeChild(graphDiv);
}

graphDiv = document.createElement('div');
Expand Down Expand Up @@ -110,6 +117,7 @@ var Tabs = {
var interval = setInterval(function() {
if(window.Plotly) {
clearInterval(interval);
Tabs.setPlotConfig();
Tabs.onReload();
}
}, 100);
Expand All @@ -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, {
Expand Down
3 changes: 2 additions & 1 deletion devtools/test_dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>
<head>
<title>Plotly.js Devtools</title>
<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"/>
<link rel="stylesheet" type="text/css" href="./style.css">
</head>
<body>
Expand All @@ -18,8 +19,8 @@
</div>
<div id="snapshot"></div>

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