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

draftlogs/6918_add.md

Lines changed: 1 addition & 1 deletion

src/plots/cartesian/index.js

Lines changed: 11 additions & 11 deletions
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; });

src/plots/get_data.js

Lines changed: 4 additions & 4 deletions
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);

src/traces/bar/attributes.js

Lines changed: 1 addition & 1 deletion
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: {

src/traces/bar/defaults.js

Lines changed: 1 addition & 1 deletion
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');

src/traces/box/attributes.js

Lines changed: 1 addition & 1 deletion
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
};

src/traces/box/defaults.js

Lines changed: 1 addition & 1 deletion
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) {

src/traces/candlestick/attributes.js

Lines changed: 1 addition & 1 deletion
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
};

src/traces/candlestick/defaults.js

Lines changed: 1 addition & 1 deletion
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) {

src/traces/carpet/attributes.js

Lines changed: 2 additions & 2 deletions
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
};

0 commit comments

Comments
 (0)