Skip to content

Commit e17739e

Browse files
committed
Add zindex to all cartesian traces
1 parent 5dcf623 commit e17739e

File tree

24 files changed

+129
-6
lines changed

24 files changed

+129
-6
lines changed

src/traces/box/attributes.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,5 +451,15 @@ module.exports = {
451451
'Do the hover effects highlight individual boxes ',
452452
'or sample points or both?'
453453
].join(' ')
454+
},
455+
zindex: {
456+
valType: 'integer',
457+
dflt: 0,
458+
editType: 'calc',
459+
description: [
460+
'Sets the layer on which this trace is displayed, relative to ',
461+
'other traces on the same axes. Traces with higher `zindex` ',
462+
'appear in front of those with lower `zindex`.'
463+
].join(' ')
454464
}
455465
};

src/traces/box/defaults.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
6767
if(notched) coerce('notchwidth');
6868

6969
handlePointsDefaults(traceIn, traceOut, coerce, {prefix: 'box'});
70+
coerce('zindex');
7071
}
7172

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

src/traces/candlestick/attributes.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,14 @@ module.exports = {
5353
whiskerwidth: extendFlat({}, boxAttrs.whiskerwidth, { dflt: 0 }),
5454

5555
hoverlabel: OHLCattrs.hoverlabel,
56+
zindex: {
57+
valType: 'integer',
58+
dflt: 0,
59+
editType: 'calc',
60+
description: [
61+
'Sets the layer on which this trace is displayed, relative to ',
62+
'other traces on the same axes. Traces with higher `zindex` ',
63+
'appear in front of those with lower `zindex`.'
64+
].join(' ')
65+
}
5666
};

src/traces/candlestick/defaults.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
3131
coerce('whiskerwidth');
3232

3333
layout._requestRangeslider[traceOut.xaxis] = true;
34+
coerce('zindex');
3435
};
3536

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

src/traces/carpet/attributes.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,15 @@ module.exports = {
112112
'Individual pieces can override this.'
113113
].join(' ')
114114
},
115-
transforms: undefined
115+
transforms: undefined,
116+
zindex: {
117+
valType: 'integer',
118+
dflt: 0,
119+
editType: 'calc',
120+
description: [
121+
'Sets the layer on which this trace is displayed, relative to ',
122+
'other traces on the same axes. Traces with higher `zindex` ',
123+
'appear in front of those with lower `zindex`.'
124+
].join(' ')
125+
}
116126
};

src/traces/carpet/defaults.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@ module.exports = function supplyDefaults(traceIn, traceOut, dfltColor, fullLayou
4545
if(traceOut._cheater) {
4646
coerce('cheaterslope');
4747
}
48+
coerce('zindex');
4849
};

src/traces/contour/attributes.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,16 @@ module.exports = extendFlat({
265265
].join(' ')
266266
}),
267267
editType: 'plot'
268+
},
269+
zindex: {
270+
valType: 'integer',
271+
dflt: 0,
272+
editType: 'calc',
273+
description: [
274+
'Sets the layer on which this trace is displayed, relative to ',
275+
'other traces on the same axes. Traces with higher `zindex` ',
276+
'appear in front of those with lower `zindex`.'
277+
].join(' ')
268278
}
269279
},
270280
colorScaleAttrs('', {

src/traces/contour/defaults.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
5151
) {
5252
handleHeatmapLabelDefaults(coerce, layout);
5353
}
54+
coerce('zindex');
5455
};

src/traces/contourcarpet/attributes.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,17 @@ module.exports = extendFlat({
7070
editType: 'plot'
7171
},
7272

73-
transforms: undefined
73+
transforms: undefined,
74+
zindex: {
75+
valType: 'integer',
76+
dflt: 0,
77+
editType: 'calc',
78+
description: [
79+
'Sets the layer on which this trace is displayed, relative to ',
80+
'other traces on the same axes. Traces with higher `zindex` ',
81+
'appear in front of those with lower `zindex`.'
82+
].join(' ')
83+
}
7484
},
7585

7686
colorScaleAttrs('', {

src/traces/contourcarpet/defaults.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,5 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
5555
traceOut._defaultColor = defaultColor;
5656
traceOut._length = null;
5757
}
58+
coerce('zindex');
5859
};

src/traces/funnel/attributes.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,17 @@ module.exports = {
109109
},
110110

111111
offsetgroup: barAttrs.offsetgroup,
112-
alignmentgroup: barAttrs.alignmentgroup
112+
alignmentgroup: barAttrs.alignmentgroup,
113+
zindex: {
114+
valType: 'integer',
115+
dflt: 0,
116+
editType: 'calc',
117+
description: [
118+
'Sets the layer on which this trace is displayed, relative to ',
119+
'other traces on the same axes. Traces with higher `zindex` ',
120+
'appear in front of those with lower `zindex`.'
121+
].join(' ')
122+
}
113123
};
114124

115125
function funnelMarker() {

src/traces/funnel/defaults.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
6161
coerce('connector.line.dash');
6262
}
6363
}
64+
coerce('zindex');
6465
}
6566

6667
function defaultFillColor(markerColor) {

src/traces/funnelarea/attributes.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,15 @@ module.exports = {
9898
description: [
9999
'Sets the ratio between bottom length and maximum top length.'
100100
].join(' ')
101+
},
102+
zindex: {
103+
valType: 'integer',
104+
dflt: 0,
105+
editType: 'calc',
106+
description: [
107+
'Sets the layer on which this trace is displayed, relative to ',
108+
'other traces on the same axes. Traces with higher `zindex` ',
109+
'appear in front of those with lower `zindex`.'
110+
].join(' ')
101111
}
102112
};

src/traces/funnelarea/defaults.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,5 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
6969

7070
coerce('aspectratio');
7171
coerce('baseratio');
72+
coerce('zindex');
7273
};

src/traces/heatmap/attributes.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,17 @@ module.exports = extendFlat({
132132
description: 'Sets the text font.'
133133
}),
134134

135-
showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})
135+
showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false}),
136+
zindex: {
137+
valType: 'integer',
138+
dflt: 0,
139+
editType: 'calc',
140+
description: [
141+
'Sets the layer on which this trace is displayed, relative to ',
142+
'other traces on the same axes. Traces with higher `zindex` ',
143+
'appear in front of those with lower `zindex`.'
144+
].join(' ')
145+
}
136146
}, {
137147
transforms: undefined
138148
},

src/traces/heatmap/defaults.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +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');
3940
};

src/traces/scattercarpet/attributes.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,15 @@ module.exports = {
118118
flags: ['a', 'b', 'text', 'name']
119119
}),
120120
hoveron: scatterAttrs.hoveron,
121-
hovertemplate: hovertemplateAttrs()
121+
hovertemplate: hovertemplateAttrs(),
122+
zindex: {
123+
valType: 'integer',
124+
dflt: 0,
125+
editType: 'calc',
126+
description: [
127+
'Sets the layer on which this trace is displayed, relative to ',
128+
'other traces on the same axes. Traces with higher `zindex` ',
129+
'appear in front of those with lower `zindex`.'
130+
].join(' ')
131+
}
122132
};

src/traces/scattercarpet/defaults.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +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');
7879
Lib.coerceSelectionMarkerOpacity(traceOut, coerce);
7980
};

src/traces/scattergl/attributes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ var attrs = module.exports = overrideAll({
8282
connectgaps: scatterAttrs.connectgaps,
8383
fill: extendFlat({}, scatterAttrs.fill, {dflt: 'none'}),
8484
fillcolor: makeFillcolorAttr(),
85+
zindex: scatterAttrs.zindex,
8586

8687
// no hoveron
8788

src/traces/scattergl/defaults.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,6 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
6767
errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y'});
6868
errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'y'});
6969

70+
coerce('zindex');
7071
Lib.coerceSelectionMarkerOpacity(traceOut, coerce);
7172
};

src/traces/violin/attributes.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,5 +254,15 @@ module.exports = {
254254
'Do the hover effects highlight individual violins',
255255
'or sample points or the kernel density estimate or any combination of them?'
256256
].join(' ')
257+
},
258+
zindex: {
259+
valType: 'integer',
260+
dflt: 0,
261+
editType: 'calc',
262+
description: [
263+
'Sets the layer on which this trace is displayed, relative to ',
264+
'other traces on the same axes. Traces with higher `zindex` ',
265+
'appear in front of those with lower `zindex`.'
266+
].join(' ')
257267
}
258268
};

src/traces/violin/defaults.js

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

5252
coerce('quartilemethod');
53+
coerce('zindex');
5354
};

src/traces/waterfall/attributes.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,5 +151,15 @@ module.exports = {
151151
},
152152

153153
offsetgroup: barAttrs.offsetgroup,
154-
alignmentgroup: barAttrs.alignmentgroup
154+
alignmentgroup: barAttrs.alignmentgroup,
155+
zindex: {
156+
valType: 'integer',
157+
dflt: 0,
158+
editType: 'calc',
159+
description: [
160+
'Sets the layer on which this trace is displayed, relative to ',
161+
'other traces on the same axes. Traces with higher `zindex` ',
162+
'appear in front of those with lower `zindex`.'
163+
].join(' ')
164+
}
155165
};

src/traces/waterfall/defaults.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
7676
coerce('connector.line.dash');
7777
}
7878
}
79+
coerce('zindex');
7980
}
8081

8182
function crossTraceDefaults(fullData, fullLayout) {

0 commit comments

Comments
 (0)