Skip to content

Commit b50b7e9

Browse files
committed
update scene2d ref to fullLayout in Plots.linkSubplots
- (which is called in Plots.supplyDefaults) - don't forget to update refs to xaxis and yaxis too!
1 parent 631d7a4 commit b50b7e9

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

Diff for: src/plots/gl2d/scene2d.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ function Scene2D(options, fullLayout) {
3636

3737
this.fullLayout = fullLayout;
3838
this.fullData = null;
39-
this.updateAxes(fullLayout);
39+
this.xaxis = null;
40+
this.yaxis = null;
41+
this.updateAxes();
4042

4143
this.makeFramework();
4244

@@ -278,22 +280,20 @@ function compareTicks(a, b) {
278280
return false;
279281
}
280282

281-
proto.updateAxes = function(options) {
283+
proto.updateAxes = function() {
282284
var spmatch = Axes.subplotMatch,
283285
xaxisName = 'xaxis' + this.id.match(spmatch)[1],
284286
yaxisName = 'yaxis' + this.id.match(spmatch)[2];
285287

286-
this.xaxis = options[xaxisName];
287-
this.yaxis = options[yaxisName];
288+
this.xaxis = this.fullLayout[xaxisName];
289+
this.yaxis = this.fullLayout[yaxisName];
288290
};
289291

290292
proto.updateFx = function(options) {
291293
var fullLayout = this.fullLayout;
292294

293295
fullLayout.dragmode = options.dragmode;
294296
fullLayout.hovermode = options.hovermode;
295-
296-
this.graphDiv._fullLayout = fullLayout;
297297
};
298298

299299
function relayoutCallback(scene) {
@@ -375,7 +375,7 @@ proto.plot = function(fullData, calcData, fullLayout) {
375375
var glplot = this.glplot;
376376

377377
this.fullLayout = fullLayout;
378-
this.updateAxes(fullLayout);
378+
this.updateAxes();
379379
this.updateTraces(fullData, calcData);
380380

381381
var width = fullLayout.width,

Diff for: src/plots/plots.js

+5
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,11 @@ plots.linkSubplots = function(newFullData, newFullLayout, oldFullData, oldFullLa
630630

631631
if(oldSubplot) {
632632
plotinfo = newSubplots[id] = oldSubplot;
633+
634+
if(plotinfo._scene2d) {
635+
plotinfo._scene2d.fullLayout = newFullLayout;
636+
plotinfo._scene2d.updateAxes();
637+
}
633638
}
634639
else {
635640
plotinfo = newSubplots[id] = {};

0 commit comments

Comments
 (0)