Skip to content

Commit 7892b10

Browse files
committed
collapse parcoords fullIndices and inputIndices into a single traceIndices map
1 parent 24cb998 commit 7892b10

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

src/traces/parcoords/plot.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,15 @@ var exports = module.exports = function plot(gd, cdModule) {
3232

3333
var currentDims = {};
3434
var initialDims = {};
35-
var fullIndices = {};
36-
var inputIndices = {};
35+
var traceIndices = {};
3736

3837
var size = fullLayout._size;
3938

4039
cdModule.forEach(function(d, i) {
4140
var trace = d[0].trace;
42-
fullIndices[i] = trace.index;
43-
var iIn = inputIndices[i] = trace.index;
44-
currentDims[i] = gd.data[iIn].dimensions;
45-
initialDims[i] = gd.data[iIn].dimensions.slice();
41+
var ind = traceIndices[i] = trace.index;
42+
currentDims[i] = gd.data[ind].dimensions;
43+
initialDims[i] = gd.data[ind].dimensions.slice();
4644
});
4745

4846
var filterChanged = function(i, initialDimIndex, newRanges) {
@@ -57,13 +55,13 @@ var exports = module.exports = function plot(gd, cdModule) {
5755
// because it's an array of variable dimensionality. So store the whole
5856
// thing at once manually.
5957
var aStr = 'dimensions[' + initialDimIndex + '].constraintrange';
60-
var preGUI = fullLayout._tracePreGUI[gd._fullData[fullIndices[i]].uid];
58+
var preGUI = fullLayout._tracePreGUI[gd._fullData[traceIndices[i]].uid];
6159
if(preGUI[aStr] === undefined) {
6260
var initialVal = dim.constraintrange;
6361
preGUI[aStr] = initialVal || null;
6462
}
6563

66-
var fullDimension = gd._fullData[fullIndices[i]].dimensions[initialDimIndex];
64+
var fullDimension = gd._fullData[traceIndices[i]].dimensions[initialDimIndex];
6765

6866
if(!newConstraints.length) {
6967
delete dim.constraintrange;
@@ -79,7 +77,7 @@ var exports = module.exports = function plot(gd, cdModule) {
7977

8078
var restyleData = {};
8179
restyleData[aStr] = newConstraints;
82-
gd.emit('plotly_restyle', [restyleData, [inputIndices[i]]]);
80+
gd.emit('plotly_restyle', [restyleData, [traceIndices[i]]]);
8381
};
8482

8583
var hover = function(eventData) {
@@ -115,12 +113,12 @@ var exports = module.exports = function plot(gd, cdModule) {
115113
// persist column order we may have to do something special for this
116114
// case to just store the order itself.
117115
// Registry.call('_storeDirectGUIEdit',
118-
// gd.data[inputIndices[i]],
119-
// fullLayout._tracePreGUI[gd._fullData[fullIndices[i]].uid],
116+
// gd.data[traceIndices[i]],
117+
// fullLayout._tracePreGUI[gd._fullData[traceIndices[i]].uid],
120118
// {dimensions: currentDims[i]}
121119
// );
122120

123-
gd.emit('plotly_restyle', [{dimensions: [currentDims[i]]}, [inputIndices[i]]]);
121+
gd.emit('plotly_restyle', [{dimensions: [currentDims[i]]}, [traceIndices[i]]]);
124122
};
125123

126124
parcoords(

0 commit comments

Comments
 (0)