Skip to content

Commit efcd49f

Browse files
committed
rename zindex to zorder
1 parent 2391afd commit efcd49f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+148
-148
lines changed

Diff for: draftlogs/6918_add.md

+1-1

Diff for: src/plots/cartesian/index.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -195,25 +195,25 @@ function plotOne(gd, plotinfo, cdSubplot, transitionOpts, makeOnCompleteCallback
195195
var modules = fullLayout._modules;
196196
var _module, cdModuleAndOthers, cdModule;
197197

198-
// Separate traces by zindex and plot each zindex group separately
198+
// Separate traces by zorder and plot each zorder group separately
199199
// TODO: Performance
200-
var traceZindexGroups = {};
200+
var traceZorderGroups = {};
201201
for(var t = 0; t < cdSubplot.length; t++) {
202202
var trace = cdSubplot[t][0].trace;
203-
var zi = trace.zindex || 0;
204-
if(!traceZindexGroups[zi]) traceZindexGroups[zi] = [];
205-
traceZindexGroups[zi].push(cdSubplot[t]);
203+
var zi = trace.zorder || 0;
204+
if(!traceZorderGroups[zi]) traceZorderGroups[zi] = [];
205+
traceZorderGroups[zi].push(cdSubplot[t]);
206206
}
207207

208208
var layerData = [];
209209
var zoomScaleQueryParts = [];
210210

211-
// Plot each zindex group in ascending order
212-
var zindices = Object.keys(traceZindexGroups)
211+
// Plot each zorder group in ascending order
212+
var zindices = Object.keys(traceZorderGroups)
213213
.map(Number)
214214
.sort(Lib.sorterAsc);
215215
for(var z = 0; z < zindices.length; z++) {
216-
var zindex = zindices[z];
216+
var zorder = zindices[z];
217217
// For each "module" (trace type)
218218
for(var i = 0; i < modules.length; i++) {
219219
_module = modules[i];
@@ -225,7 +225,7 @@ function plotOne(gd, plotinfo, cdSubplot, transitionOpts, makeOnCompleteCallback
225225
var plotMethod = _module.plot;
226226

227227
// plot all visible traces of this type on this subplot at once
228-
cdModuleAndOthers = getModuleCalcData(cdSubplot, plotMethod, zindex);
228+
cdModuleAndOthers = getModuleCalcData(cdSubplot, plotMethod, zorder);
229229
cdModule = cdModuleAndOthers[0];
230230
// don't need to search the found traces again - in fact we need to NOT
231231
// so that if two modules share the same plotter we don't double-plot
@@ -234,7 +234,7 @@ function plotOne(gd, plotinfo, cdSubplot, transitionOpts, makeOnCompleteCallback
234234
if(cdModule.length) {
235235
layerData.push({
236236
i: traceLayerClasses.indexOf(className),
237-
zindex: z,
237+
zorder: z,
238238
className: className,
239239
plotMethod: plotMethod,
240240
cdModule: cdModule
@@ -248,7 +248,7 @@ function plotOne(gd, plotinfo, cdSubplot, transitionOpts, makeOnCompleteCallback
248248
}
249249
}
250250
// Sort the layers primarily by z, then by i
251-
layerData.sort(function(a, b) { return (a.zindex || 0) - (b.zindex || 0) || a.i - b.i; });
251+
layerData.sort(function(a, b) { return (a.zorder || 0) - (b.zorder || 0) || a.i - b.i; });
252252

253253
var layers = plotinfo.plot.selectAll('g.mlayer')
254254
.data(layerData, function(d) { return d.className; });

Diff for: src/plots/get_data.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ exports.getSubplotCalcData = function(calcData, type, subplotId) {
3939
* @param {array} calcdata: as in gd.calcdata
4040
* @param {object|string|fn} arg1:
4141
* the plotting module, or its name, or its plot method
42-
* @param {int} arg2: (optional) zindex to filter on
42+
* @param {int} arg2: (optional) zorder to filter on
4343
* @return {array[array]} [foundCalcdata, remainingCalcdata]
4444
*/
4545
exports.getModuleCalcData = function(calcdata, arg1, arg2) {
@@ -57,12 +57,12 @@ exports.getModuleCalcData = function(calcdata, arg1, arg2) {
5757
if(!plotMethod) {
5858
return [moduleCalcData, calcdata];
5959
}
60-
var zindex = arg2;
60+
var zorder = arg2;
6161

6262
for(var i = 0; i < calcdata.length; i++) {
6363
var cd = calcdata[i];
6464
var trace = cd[0].trace;
65-
var filterByZ = (trace.zindex !== undefined);
65+
var filterByZ = (trace.zorder !== undefined);
6666
// N.B.
6767
// - 'legendonly' traces do not make it past here
6868
// - skip over 'visible' traces that got trimmed completely during calc transforms
@@ -72,7 +72,7 @@ exports.getModuleCalcData = function(calcdata, arg1, arg2) {
7272
// would suggest), but by 'module plot method' so that if some traces
7373
// share the same module plot method (e.g. bar and histogram), we
7474
// only call it one!
75-
if(trace._module && trace._module.plot === plotMethod && (!filterByZ || trace.zindex === zindex)) {
75+
if(trace._module && trace._module.plot === plotMethod && (!filterByZ || trace.zorder === zorder)) {
7676
moduleCalcData.push(cd);
7777
} else {
7878
remainingCalcData.push(cd);

Diff for: src/traces/bar/attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ module.exports = {
226226
textfont: scatterAttrs.unselected.textfont,
227227
editType: 'style'
228228
},
229-
zindex: scatterAttrs.zindex,
229+
zorder: scatterAttrs.zorder,
230230

231231
_deprecated: {
232232
bardir: {

Diff for: src/traces/bar/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
2929
coerce('xhoverformat');
3030
coerce('yhoverformat');
3131

32-
coerce('zindex');
32+
coerce('zorder');
3333

3434
coerce('orientation', (traceOut.x && !traceOut.y) ? 'h' : 'v');
3535
coerce('base');

Diff for: src/traces/box/attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -452,5 +452,5 @@ module.exports = {
452452
'or sample points or both?'
453453
].join(' ')
454454
},
455-
zindex: scatterAttrs.zindex
455+
zorder: scatterAttrs.zorder
456456
};

Diff for: src/traces/box/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
6767
if(notched) coerce('notchwidth');
6868

6969
handlePointsDefaults(traceIn, traceOut, coerce, {prefix: 'box'});
70-
coerce('zindex');
70+
coerce('zorder');
7171
}
7272

7373
function handleSampleDefaults(traceIn, traceOut, coerce, layout) {

Diff for: src/traces/candlestick/attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ module.exports = {
5353
whiskerwidth: extendFlat({}, boxAttrs.whiskerwidth, { dflt: 0 }),
5454

5555
hoverlabel: OHLCattrs.hoverlabel,
56-
zindex: boxAttrs.zindex
56+
zorder: boxAttrs.zorder
5757
};

Diff for: src/traces/candlestick/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
3131
coerce('whiskerwidth');
3232

3333
layout._requestRangeslider[traceOut.xaxis] = true;
34-
coerce('zindex');
34+
coerce('zorder');
3535
};
3636

3737
function handleDirection(traceIn, traceOut, coerce, direction) {

Diff for: src/traces/carpet/attributes.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var carpetFont = fontAttrs({
99
description: 'The default font used for axis & tick labels on this carpet'
1010
});
1111

12-
var zindex = require('../scatter/attributes').zindex;
12+
var zorder = require('../scatter/attributes').zorder;
1313

1414
// TODO: inherit from global font
1515
carpetFont.family.dflt = '"Open Sans", verdana, arial, sans-serif';
@@ -116,5 +116,5 @@ module.exports = {
116116
].join(' ')
117117
},
118118
transforms: undefined,
119-
zindex: zindex
119+
zorder: zorder
120120
};

Diff for: src/traces/carpet/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ module.exports = function supplyDefaults(traceIn, traceOut, dfltColor, fullLayou
4545
if(traceOut._cheater) {
4646
coerce('cheaterslope');
4747
}
48-
coerce('zindex');
48+
coerce('zorder');
4949
};

Diff for: src/traces/contour/attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ module.exports = extendFlat({
266266
}),
267267
editType: 'plot'
268268
},
269-
zindex: scatterAttrs.zindex
269+
zorder: scatterAttrs.zorder
270270
},
271271
colorScaleAttrs('', {
272272
cLetter: 'z',

Diff for: src/traces/contour/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
5151
) {
5252
handleHeatmapLabelDefaults(coerce, layout);
5353
}
54-
coerce('zindex');
54+
coerce('zorder');
5555
};

Diff for: src/traces/contourcarpet/attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ module.exports = extendFlat({
7070
editType: 'plot'
7171
},
7272

73-
zindex: contourAttrs.zindex,
73+
zorder: contourAttrs.zorder,
7474
transforms: undefined
7575
},
7676

Diff for: src/traces/contourcarpet/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
5555
traceOut._defaultColor = defaultColor;
5656
traceOut._length = null;
5757
}
58-
coerce('zindex');
58+
coerce('zorder');
5959
};

Diff for: src/traces/funnel/attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ module.exports = {
110110

111111
offsetgroup: barAttrs.offsetgroup,
112112
alignmentgroup: barAttrs.alignmentgroup,
113-
zindex: barAttrs.zindex
113+
zorder: barAttrs.zorder
114114
};
115115

116116
function funnelMarker() {

Diff for: src/traces/funnel/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
6161
coerce('connector.line.dash');
6262
}
6363
}
64-
coerce('zindex');
64+
coerce('zorder');
6565
}
6666

6767
function defaultFillColor(markerColor) {

Diff for: src/traces/heatmap/attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ module.exports = extendFlat({
133133
}),
134134

135135
showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false}),
136-
zindex: scatterAttrs.zindex
136+
zorder: scatterAttrs.zorder
137137
}, {
138138
transforms: undefined
139139
},

Diff for: src/traces/heatmap/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
3636
coerce('connectgaps', Lib.isArray1D(traceOut.z) && (traceOut.zsmooth !== false));
3737

3838
colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});
39-
coerce('zindex');
39+
coerce('zorder');
4040
};

Diff for: src/traces/histogram/attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,5 +250,5 @@ module.exports = {
250250
bardir: barAttrs._deprecated.bardir
251251
},
252252

253-
zindex: barAttrs.zindex
253+
zorder: barAttrs.zorder
254254
};

Diff for: src/traces/histogram/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,5 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
7575
errorBarsSupplyDefaults(traceIn, traceOut, lineColor || Color.defaultLine, {axis: 'y'});
7676
errorBarsSupplyDefaults(traceIn, traceOut, lineColor || Color.defaultLine, {axis: 'x', inherit: 'y'});
7777

78-
coerce('zindex');
78+
coerce('zorder');
7979
};

Diff for: src/traces/image/attributes.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
var baseAttrs = require('../../plots/attributes');
4-
var zindex = require('../scatter/attributes').zindex;
4+
var zorder = require('../scatter/attributes').zorder;
55
var hovertemplateAttrs = require('../../plots/template_attributes').hovertemplateAttrs;
66
var extendFlat = require('../../lib/extend').extendFlat;
77
var colormodel = require('./constants').colormodel;
@@ -134,6 +134,6 @@ module.exports = extendFlat({
134134
keys: ['z', 'color', 'colormodel']
135135
}),
136136

137-
zindex: zindex,
137+
zorder: zorder,
138138
transforms: undefined
139139
});

Diff for: src/traces/image/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ module.exports = function supplyDefaults(traceIn, traceOut) {
4646

4747
traceOut._length = null;
4848

49-
coerce('zindex');
49+
coerce('zorder');
5050
};

Diff for: src/traces/ohlc/attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,5 @@ module.exports = {
134134
}
135135
}),
136136

137-
zindex: scatterAttrs.zindex
137+
zorder: scatterAttrs.zorder
138138
};

Diff for: src/traces/ohlc/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
3232

3333
layout._requestRangeslider[traceOut.xaxis] = true;
3434

35-
coerce('zindex');
35+
coerce('zorder');
3636
};
3737

3838
function handleDirection(traceIn, traceOut, coerce, direction) {

Diff for: src/traces/scatter/attributes.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -686,14 +686,14 @@ module.exports = {
686686
arrayOk: true,
687687
description: 'Sets the text font.'
688688
}),
689-
zindex: {
689+
zorder: {
690690
valType: 'integer',
691691
dflt: 0,
692692
editType: 'plot',
693693
description: [
694694
'Sets the layer on which this trace is displayed, relative to',
695-
'other SVG traces on the same subplot. SVG traces with higher `zindex`',
696-
'appear in front of those with lower `zindex`.'
695+
'other SVG traces on the same subplot. SVG traces with higher `zorder`',
696+
'appear in front of those with lower `zorder`.'
697697
].join(' ')
698698
}
699699
};

Diff for: src/traces/scatter/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
3030
coerce('xhoverformat');
3131
coerce('yhoverformat');
3232

33-
coerce('zindex');
33+
coerce('zorder');
3434

3535
var stackGroupOpts = handleStackDefaults(traceIn, traceOut, layout, coerce);
3636
if(

Diff for: src/traces/scattercarpet/attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,5 @@ module.exports = {
119119
}),
120120
hoveron: scatterAttrs.hoveron,
121121
hovertemplate: hovertemplateAttrs(),
122-
zindex: scatterAttrs.zindex
122+
zorder: scatterAttrs.zorder
123123
};

Diff for: src/traces/scattercarpet/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,6 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
7575
var hoverOn = coerce('hoveron', dfltHoverOn.join('+') || 'points');
7676
if(hoverOn !== 'fills') coerce('hovertemplate');
7777

78-
coerce('zindex');
78+
coerce('zorder');
7979
Lib.coerceSelectionMarkerOpacity(traceOut, coerce);
8080
};

Diff for: src/traces/violin/attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,5 +255,5 @@ module.exports = {
255255
'or sample points or the kernel density estimate or any combination of them?'
256256
].join(' ')
257257
},
258-
zindex: boxAttrs.zindex
258+
zorder: boxAttrs.zorder
259259
};

Diff for: src/traces/violin/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
5050
if(!meanLineVisible) traceOut.meanline = {visible: false};
5151

5252
coerce('quartilemethod');
53-
coerce('zindex');
53+
coerce('zorder');
5454
};

Diff for: src/traces/waterfall/attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,5 @@ module.exports = {
152152

153153
offsetgroup: barAttrs.offsetgroup,
154154
alignmentgroup: barAttrs.alignmentgroup,
155-
zindex: barAttrs.zindex
155+
zorder: barAttrs.zorder
156156
};

Diff for: src/traces/waterfall/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
7676
coerce('connector.line.dash');
7777
}
7878
}
79-
coerce('zindex');
79+
coerce('zorder');
8080
}
8181

8282
function crossTraceDefaults(fullData, fullLayout) {
-40.6 KB
Binary file not shown.

Diff for: test/image/baselines/zindex_violin_box.png

-22.1 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.
40.4 KB

Diff for: test/image/baselines/zz-zorder_violin_box.png

22.1 KB

Diff for: test/image/mocks/funnel_axis_with_other_traces.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"x": [
2323
1, 1, 1, 2, 2, 3
2424
],
25-
"zindex": -10
25+
"zorder": -10
2626
},
2727
{
2828
"type": "funnel",
@@ -42,7 +42,7 @@
4242
],
4343
"xaxis": "x2",
4444
"yaxis": "y2",
45-
"zindex": 10
45+
"zorder": 10
4646
},
4747
{
4848
"type": "bar",

Diff for: test/image/mocks/zindex-contour.json renamed to test/image/mocks/zz-zorder-contour.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
"name": "scatter",
66
"y": [-1,0,1,2,3],
77
"x": [-1,0,1,2,3],
8-
"zindex": 1
8+
"zorder": 1
99
}, {
1010
"type": "contour",
1111
"z": [
1212
[1, 2, 3],
1313
[2, 0, 0],
1414
[3, 0, 3]
1515
],
16-
"zindex": 10
16+
"zorder": 10
1717
}
1818
],
1919
"layout": {

0 commit comments

Comments
 (0)