Skip to content

Commit 89e2321

Browse files
committed
remove _expandedIndex use index instead of _expandedIndex
1 parent 7e481e0 commit 89e2321

File tree

9 files changed

+9
-19
lines changed

9 files changed

+9
-19
lines changed

src/components/legend/draw.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ function clickOrDoubleClick(gd, legend, legendItem, numClicks, evt) {
484484
event: evt,
485485
node: legendItem.node(),
486486
curveNumber: trace.index,
487-
expandedIndex: trace._expandedIndex,
487+
expandedIndex: trace.index,
488488
data: gd.data,
489489
layout: gd.layout,
490490
frames: gd._transitionData._frames,

src/components/selections/select.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,8 @@ function newPointNumTester(pointSelectionDef) {
597597
ymax: 0,
598598
pts: [],
599599
contains: function(pt, omitFirstEdge, pointNumber, searchInfo) {
600-
var idxWantedTrace = pointSelectionDef.searchInfo.cd[0].trace._expandedIndex;
601-
var idxActualTrace = searchInfo.cd[0].trace._expandedIndex;
600+
var idxWantedTrace = pointSelectionDef.searchInfo.cd[0].trace.index;
601+
var idxActualTrace = searchInfo.cd[0].trace.index;
602602
return idxActualTrace === idxWantedTrace &&
603603
pointNumber === pointSelectionDef.pointNumber;
604604
},
@@ -844,7 +844,7 @@ function extractClickedPtInfo(hoverData, searchTraces) {
844844

845845
for(i = 0; i < searchTraces.length; i++) {
846846
searchInfo = searchTraces[i];
847-
if(hoverDatum.fullData._expandedIndex === searchInfo.cd[0].trace._expandedIndex) {
847+
if(hoverDatum.fullData.index === searchInfo.cd[0].trace.index) {
848848
// Special case for box (and violin)
849849
if(hoverDatum.hoverOnBox === true) {
850850
break;

src/plots/cartesian/layout_defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
143143

144144
function newAxLayoutOut() {
145145
var traces = ax2traces[axName] || [];
146-
axLayoutOut._traceIndices = traces.map(function(t) { return t._expandedIndex; });
146+
axLayoutOut._traceIndices = traces.map(function(t) { return t.index; });
147147
axLayoutOut._annIndices = [];
148148
axLayoutOut._shapeIndices = [];
149149
axLayoutOut._selectionIndices = [];

src/plots/geo/layout_defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
2121

2222
function handleGeoDefaults(geoLayoutIn, geoLayoutOut, coerce, opts) {
2323
var subplotData = getSubplotData(opts.fullData, 'geo', opts.id);
24-
var traceIndices = subplotData.map(function(t) { return t._expandedIndex; });
24+
var traceIndices = subplotData.map(function(t) { return t.index; });
2525

2626
var resolution = coerce('resolution');
2727
var scope = coerce('scope');

src/plots/plots.js

-4
Original file line numberDiff line numberDiff line change
@@ -1088,11 +1088,7 @@ plots.supplyDataDefaults = function(dataIn, dataOut, layout, fullLayout) {
10881088

10891089
fullTrace.index = i;
10901090
fullTrace._input = trace;
1091-
fullTrace._expandedIndex = cnt;
1092-
1093-
// add identify refs for consistency with transformed traces
10941091
fullTrace._fullInput = fullTrace;
1095-
fullTrace._expandedInput = fullTrace;
10961092

10971093
pushModule(fullTrace);
10981094

src/plots/polar/layout_defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function handleDefaults(contIn, contOut, coerce, opts) {
4848
var axOut = Template.newContainer(contOut, axName);
4949
axOut._id = axOut._name = axName;
5050
axOut._attr = opts.id + '.' + axName;
51-
axOut._traceIndices = subplotData.map(function(t) { return t._expandedIndex; });
51+
axOut._traceIndices = subplotData.map(function(t) { return t.index; });
5252

5353
var dataAttr = constants.axisName2dataArray[axName];
5454
var axType = handleAxisTypeDefaults(axIn, axOut, coerceAxis, subplotData, dataAttr, opts);

src/plots/smith/layout_defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function handleDefaults(contIn, contOut, coerce, opts) {
4848
var axOut = Template.newContainer(contOut, axName);
4949
axOut._id = axOut._name = axName;
5050
axOut._attr = opts.id + '.' + axName;
51-
axOut._traceIndices = subplotData.map(function(t) { return t._expandedIndex; });
51+
axOut._traceIndices = subplotData.map(function(t) { return t.index; });
5252

5353
var visible = coerceAxis('visible');
5454

src/traces/scatter/calc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function calc(gd, trace) {
3636
var yAttr = 'y';
3737
var posAttr;
3838
if(stackGroupOpts) {
39-
Lib.pushUnique(stackGroupOpts.traceIndices, trace._expandedIndex);
39+
Lib.pushUnique(stackGroupOpts.traceIndices, trace.index);
4040
isV = stackGroupOpts.orientation === 'v';
4141

4242
// size, like we use for bar

test/jasmine/tests/plots_test.js

-6
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,11 @@ describe('Test Plots', function() {
131131
expect(gd._fullData[0].index).toEqual(0);
132132
expect(gd._fullData[1].index).toEqual(1);
133133

134-
expect(gd._fullData[0]._expandedIndex).toEqual(0);
135-
expect(gd._fullData[1]._expandedIndex).toEqual(1);
136-
137134
expect(gd._fullData[0]._input).toBe(trace0);
138135
expect(gd._fullData[1]._input).toBe(trace1);
139136

140137
expect(gd._fullData[0]._fullInput).toBe(gd._fullData[0]);
141138
expect(gd._fullData[1]._fullInput).toBe(gd._fullData[1]);
142-
143-
expect(gd._fullData[0]._expandedInput).toBe(gd._fullData[0]);
144-
expect(gd._fullData[1]._expandedInput).toBe(gd._fullData[1]);
145139
});
146140

147141
function testSanitizeMarginsHasBeenCalledOnlyOnce(gd) {

0 commit comments

Comments
 (0)