Skip to content

Commit

Permalink
Rename displayInd -> displayindex
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmmease committed Aug 8, 2018
1 parent d2c5ae8 commit a34dafa
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/traces/parcats/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ module.exports = {
'will be truncated). Each value must an element of `catValues`.'
].join(' ')
},
displayInd: {
displayindex: {
valType: 'integer',
role: 'info',
editType: 'calc',
Expand Down
6 changes: 3 additions & 3 deletions src/traces/parcats/calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ module.exports = function calc(gd, trace) {

// Array of DimensionModel objects
var dimensionModels = trace.dimensions.map(function(di, i) {
return createDimensionModel(i, di.displayInd, di.label, totalCount);
return createDimensionModel(i, di.displayindex, di.label, totalCount);
});


Expand Down Expand Up @@ -464,10 +464,10 @@ function getUniqueInfo(values, uniqueValues) {
* @param {Object} trace
*/
function validateDimensionDisplayInds(trace) {
var displayInds = trace.dimensions.map(function(dim) {return dim.displayInd;});
var displayInds = trace.dimensions.map(function(dim) {return dim.displayindex;});
if(!isRangePermutation(displayInds)) {
trace.dimensions.forEach(function(dim, i) {
dim.displayInd = i;
dim.displayindex = i;
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/traces/parcats/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function dimensionsDefaults(traceIn, traceOut) {
// Dimension level
coerce('values');
coerce('label');
coerce('displayInd', i);
coerce('displayindex', i);

// Category level
coerce('catDisplayInds');
Expand Down
2 changes: 1 addition & 1 deletion src/traces/parcats/parcats.js
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ function dragDimensionEnd(d) {

if(anyDimsReordered) {
finalDragDimensionDisplayInds.forEach(function(finalDimDisplay, dimInd) {
restyleData['dimensions[' + dimInd + '].displayInd'] = finalDimDisplay;
restyleData['dimensions[' + dimInd + '].displayindex'] = finalDimDisplay;
});
}

Expand Down
6 changes: 3 additions & 3 deletions test/image/mocks/parcats_reordered.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
{"type": "parcats",
"domain": {"x": [0.125, 0.625],"y": [0.25, 0.75]},
"dimensions": [
{"label": "One", "values": [1, 1, 2, 1, 2, 1, 1, 2, 1], "displayInd": 0},
{"label": "Two", "values": ["A", "B", "A", "B", "C", "C", "A", "B", "C"], "displayInd": 2,
{"label": "One", "values": [1, 1, 2, 1, 2, 1, 1, 2, 1], "displayindex": 0},
{"label": "Two", "values": ["A", "B", "A", "B", "C", "C", "A", "B", "C"], "displayindex": 2,
"catDisplayInds": [1, 2, 0], "CatValues": ["A", "B", "C"]},
{"label": "Three", "values": [11, 11, 11, 11, 11, 11, 11, 11, 11], "displayInd": 1}]}
{"label": "Three", "values": [11, 11, 11, 11, 11, 11, 11, 11, 11], "displayindex": 1}]}
],
"layout": {
"height": 602,
Expand Down

0 comments on commit a34dafa

Please sign in to comment.