|
6 | 6 | * LICENSE file in the root directory of this source tree.
|
7 | 7 | */
|
8 | 8 |
|
9 |
| - |
10 | 9 | 'use strict';
|
11 | 10 |
|
12 | 11 | var Registry = require('../../registry');
|
13 | 12 | var autoType = require('./axis_autotype');
|
14 |
| -var name2id = require('./axis_ids').name2id; |
15 | 13 |
|
16 | 14 | /*
|
17 | 15 | * data: the plot data to use in choosing auto type
|
18 | 16 | * name: axis object name (ie 'xaxis') if one should be stored
|
19 | 17 | */
|
20 |
| -module.exports = function handleTypeDefaults(containerIn, containerOut, coerce, data, name) { |
21 |
| - // set up some private properties |
22 |
| - if(name) { |
23 |
| - containerOut._name = name; |
24 |
| - containerOut._id = name2id(name); |
25 |
| - } |
| 18 | +module.exports = function handleTypeDefaults(containerIn, containerOut, coerce, options) { |
| 19 | + var axType = coerce('type', (options.splomStash || {}).type); |
26 | 20 |
|
27 |
| - var axType = coerce('type'); |
28 | 21 | if(axType === '-') {
|
29 |
| - setAutoType(containerOut, data); |
| 22 | + setAutoType(containerOut, options.data); |
30 | 23 |
|
31 | 24 | if(containerOut.type === '-') {
|
32 | 25 | containerOut.type = 'linear';
|
33 |
| - } |
34 |
| - else { |
| 26 | + } else { |
35 | 27 | // copy autoType back to input axis
|
36 | 28 | // note that if this object didn't exist
|
37 | 29 | // in the input layout, we have to put it in
|
@@ -89,9 +81,10 @@ function setAutoType(ax, data) {
|
89 | 81 | }
|
90 | 82 | else if(d0.type === 'splom') {
|
91 | 83 | var dimensions = d0.dimensions;
|
| 84 | + var diag = d0._diag; |
92 | 85 | for(i = 0; i < dimensions.length; i++) {
|
93 | 86 | var dim = dimensions[i];
|
94 |
| - if(dim.visible) { |
| 87 | + if(dim.visible && (diag[i][0] === id || diag[i][1] === id)) { |
95 | 88 | ax.type = autoType(dim.values, calendar);
|
96 | 89 | break;
|
97 | 90 | }
|
|
0 commit comments