Skip to content

Commit 96c0157

Browse files
committed
Merge pull request #531 from plotly/devtools-mocks
Devtools: Add `getMock` method
2 parents 5940dd1 + 10a9dd5 commit 96c0157

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

devtools/test_dashboard/devtools.js

+12
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ var Tabs = {
5555
});
5656
},
5757

58+
getMock: function(mockName, callback) {
59+
var mockURL = '/test/image/mocks/' + mockName + '.json';
60+
61+
d3.json(mockURL, function(err, fig) {
62+
if(typeof callback !== 'function') {
63+
window.mock = fig;
64+
} else {
65+
callback(err, fig);
66+
}
67+
});
68+
},
69+
5870
// Save a png snapshot and display it below the plot
5971
snapshot: function(id) {
6072
var gd = Tabs.getGraph(id);

0 commit comments

Comments
 (0)