Skip to content

Commit 2cddc84

Browse files
committed
use 'exportedPlot' to determine if baseUrl is needed or not
... instead of 'staticPlot', which can conflict when users want to draw a 'static plot' in the browser.
1 parent d12b097 commit 2cddc84

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/components/drawing/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ drawing.setClipUrl = function(s, localId, gd) {
10121012
}
10131013

10141014
var context = gd._context;
1015-
var baseUrl = context.staticPlot ? '' : (context.baseUrl || '');
1015+
var baseUrl = context.exportedPlot ? '' : (context.baseUrl || '');
10161016

10171017
s.attr('clip-path', 'url(' + baseUrl + '#' + localId + ')');
10181018
};

src/plot_api/to_image.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ function toImage(gd, opts) {
138138
// extend config for static plot
139139
var configImage = Lib.extendFlat({}, config, {
140140
staticPlot: true,
141+
exportedPlot: true,
141142
setBackground: setBackground
142143
});
143144

test/jasmine/tests/snapshot_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ describe('Plotly.Snapshot', function() {
373373
.append('base')
374374
.attr('href', 'https://plot.ly');
375375

376-
Plotly.plot(gd, [{ y: [1, 2, 1] }], {}, {staticPlot: true})
376+
Plotly.plot(gd, [{ y: [1, 2, 1] }], {}, {exportedPlot: true})
377377
.then(function() { return Plotly.Snapshot.toSVG(gd); })
378378
.then(function(svg) {
379379
var svgDOM = parser.parseFromString(svg, 'image/svg+xml');

0 commit comments

Comments
 (0)