Skip to content

Commit

Permalink
consider only splom dimensions on axis during axis autotype
Browse files Browse the repository at this point in the history
- using trace._diag, this allows to support multiple axis type
  in splom-generated axes
  • Loading branch information
etpinard committed Aug 13, 2018
1 parent def6aa5 commit dd563bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/plots/cartesian/type_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ function setAutoType(ax, data) {
}
else if(d0.type === 'splom') {
var dimensions = d0.dimensions;
var diag = d0._diag;
for(i = 0; i < dimensions.length; i++) {
var dim = dimensions[i];
if(dim.visible) {
if(dim.visible && (diag[i][0] === id || diag[i][1] === id)) {
ax.type = autoType(dim.values, calendar);
break;
}
Expand Down
6 changes: 4 additions & 2 deletions test/jasmine/tests/splom_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,10 @@ describe('Test splom trace defaults:', function() {
});

var fullLayout = gd._fullLayout;
expect(fullLayout.xaxis.type).toBe('date');
expect(fullLayout.yaxis.type).toBe('date');
expect(fullLayout.xaxis.type).toBe('linear', 'fallbacks to linear for visible:false traces');
expect(fullLayout.yaxis.type).toBe('linear', 'fallbacks to linear for visible:false traces');
expect(fullLayout.xaxis2.type).toBe('date');
expect(fullLayout.yaxis2.type).toBe('date');
});
});

Expand Down

0 comments on commit dd563bb

Please sign in to comment.