Skip to content

Commit 3ad1021

Browse files
committed
skip over anchor less axes:
- in case some dummy axes were included in user layout. (e.g. someone layout = {xaxis: {}, scene: {xaxis: {}}} in a 3d-only graph.
1 parent 0ba34c3 commit 3ad1021

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/plots/cartesian/axes.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ axes.getSubplots = function(gd, ax) {
11711171
if(subplots.indexOf(sp) === -1) subplots.push(sp);
11721172
}
11731173

1174-
// look for subplots in the axes/anchors, so that we at least draw all axes
1174+
// look for subplots in the xes/anchors, so that we at least draw all axes
11751175
var axesList = axes.list(gd, '', true);
11761176

11771177
function hasAx2(sp, ax2) {
@@ -1186,23 +1186,20 @@ axes.getSubplots = function(gd, ax) {
11861186
ax2.anchor,
11871187
ax3 = axes.getFromId(gd, ax3Id);
11881188

1189-
// if a free axis is already represented in the data, ignore it
1189+
// look if ax2 is already represented in the data
11901190
var foundAx2 = false;
11911191
for(j = 0; j < subplots.length; j++) {
11921192
if(hasAx2(subplots[j], ax2)) {
11931193
foundAx2 = true;
11941194
break;
11951195
}
11961196
}
1197+
1198+
// ignore free axes that already represented in the data
11971199
if(ax2.anchor === 'free' && foundAx2) continue;
11981200

1199-
if(!ax3) {
1200-
console.log([
1201-
'Warning: couldnt find anchor', ax3Id,
1202-
'for axis', ax2._id
1203-
].join(' '));
1204-
return;
1205-
}
1201+
// ignore anchor-less axes
1202+
if(!ax3) continue;
12061203

12071204
sp = (ax2Letter === 'x') ?
12081205
ax2._id + ax3._id :

0 commit comments

Comments
 (0)