Skip to content

Commit 7cf69e2

Browse files
committed
pass context mapbox access token during cloneplot
- so that toImage works when token is set in config argument.
1 parent b32c21d commit 7cf69e2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/snapshot/cloneplot.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ module.exports = function clonePlot(graphObj, options) {
7070
var oldLayout = graphObj.layout;
7171
var newData = extendDeep([], oldData);
7272
var newLayout = extendDeep({}, oldLayout, cloneLayoutOverride(options.tileClass));
73+
var context = graphObj._context || {};
7374

7475
if(options.width) newLayout.width = options.width;
7576
if(options.height) newLayout.height = options.height;
@@ -153,7 +154,8 @@ module.exports = function clonePlot(graphObj, options) {
153154
options.plotGlPixelRatio,
154155
displaylogo: options.displaylogo || false,
155156
showLink: options.showLink || false,
156-
showTips: options.showTips || false
157+
showTips: options.showTips || false,
158+
mapboxAccessToken: context.mapboxAccessToken
157159
}
158160
};
159161

test/jasmine/tests/snapshot_test.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ describe('Plotly.Snapshot', function() {
8080
displaylogo: false,
8181
showLink: false,
8282
showTips: false,
83-
setBackground: 'opaque'
83+
setBackground: 'opaque',
84+
mapboxAccessToken: undefined
8485
};
8586

8687
var themeTile = Plotly.Snapshot.clone(dummyGraphObj, themeOptions);

0 commit comments

Comments
 (0)