Skip to content

Commit dd563bb

Browse files
committed
consider only splom dimensions on axis during axis autotype
- using trace._diag, this allows to support multiple axis type in splom-generated axes
1 parent def6aa5 commit dd563bb

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/plots/cartesian/type_defaults.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,10 @@ function setAutoType(ax, data) {
8989
}
9090
else if(d0.type === 'splom') {
9191
var dimensions = d0.dimensions;
92+
var diag = d0._diag;
9293
for(i = 0; i < dimensions.length; i++) {
9394
var dim = dimensions[i];
94-
if(dim.visible) {
95+
if(dim.visible && (diag[i][0] === id || diag[i][1] === id)) {
9596
ax.type = autoType(dim.values, calendar);
9697
break;
9798
}

test/jasmine/tests/splom_test.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,10 @@ describe('Test splom trace defaults:', function() {
352352
});
353353

354354
var fullLayout = gd._fullLayout;
355-
expect(fullLayout.xaxis.type).toBe('date');
356-
expect(fullLayout.yaxis.type).toBe('date');
355+
expect(fullLayout.xaxis.type).toBe('linear', 'fallbacks to linear for visible:false traces');
356+
expect(fullLayout.yaxis.type).toBe('linear', 'fallbacks to linear for visible:false traces');
357+
expect(fullLayout.xaxis2.type).toBe('date');
358+
expect(fullLayout.yaxis2.type).toBe('date');
357359
});
358360
});
359361

0 commit comments

Comments
 (0)