Skip to content

Commit c1bfd61

Browse files
committed
Add mocks for zindex
1 parent abfd1a8 commit c1bfd61

File tree

4 files changed

+110
-2
lines changed

4 files changed

+110
-2
lines changed

src/traces/funnel/style.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var resizeText = require('../bar/uniform_text').resizeText;
1010
var styleTextPoints = barStyle.styleTextPoints;
1111

1212
function style(gd, cd, sel) {
13-
var s = sel ? sel : d3.select(gd).selectAll('g.funnellayer').selectAll('g.trace');
13+
var s = sel ? sel : d3.select(gd).selectAll('g[class^="funnellayer"]').selectAll('g.trace');
1414
resizeText(gd, s, 'funnel');
1515

1616
s.style('opacity', function(d) { return d[0].trace.opacity; });

src/traces/waterfall/style.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var resizeText = require('../bar/uniform_text').resizeText;
1010
var styleTextPoints = barStyle.styleTextPoints;
1111

1212
function style(gd, cd, sel) {
13-
var s = sel ? sel : d3.select(gd).selectAll('g.waterfalllayer').selectAll('g.trace');
13+
var s = sel ? sel : d3.select(gd).selectAll('g[class^="waterfalllayer"]').selectAll('g.trace');
1414
resizeText(gd, s, 'waterfall');
1515

1616
s.style('opacity', function(d) { return d[0].trace.opacity; });
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"data": [
3+
{
4+
"x": [-3, -2, 4],
5+
"y": [2, 8, 2],
6+
"name": "scatter zindex=2",
7+
"type": "scatter",
8+
"marker": {"size": 20},
9+
"line": {"width": 6},
10+
"zindex": 2
11+
},
12+
{
13+
"x": [-3, -2, 2, 3],
14+
"y": [2, 5, -3, -1],
15+
"name": "waterfall zindex=3",
16+
"type": "waterfall",
17+
"zindex": 3
18+
},
19+
{
20+
"width": 0.7,
21+
"y": [4, 5, 6],
22+
"x": [7, 5, 7],
23+
"opacity": 1,
24+
"type": "funnel",
25+
"name": "funnel zindex=4",
26+
"zindex": 4
27+
},
28+
{
29+
"type": "scattercarpet",
30+
"a": [4, 4.5, 5, 6],
31+
"b": [2.5, 2.5, 2.5, 2.5],
32+
"line": {
33+
"shape": "spline",
34+
"smoothing": 1,
35+
"color": "orange"
36+
},
37+
"mode": "lines+markers",
38+
"marker": {
39+
"size": 15,
40+
"symbol": "arrow",
41+
"angleref": "previous"
42+
},
43+
"carpet": "c0",
44+
"name": "scattercarpet zindex=3",
45+
"zindex": 3
46+
},
47+
{
48+
"type": "carpet",
49+
"a": [4, 4, 5, 5, 5, 6, 6],
50+
"b": [2, 3, 2, 1, 3, 1, 2],
51+
"y": [3, 4, 5, 7, 8, 6, 8],
52+
"aaxis": {
53+
"smoothing": 1,
54+
"minorgridcount": 9
55+
},
56+
"baxis": {
57+
"smoothing": 1,
58+
"minorgridcount": 9
59+
},
60+
"color": "red",
61+
"zindex": 10,
62+
"carpet": "c0",
63+
"name": "carpet zindex=10"
64+
}
65+
],
66+
"layout": {
67+
"xaxis": {
68+
"title": {
69+
"text": "zindex stacking"
70+
}
71+
}
72+
}
73+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"data": [
3+
4+
{
5+
"type": "violin",
6+
"name": "violin",
7+
"y": 1,
8+
"fillcolor": "yellow",
9+
"x": [
10+
0.1, 0.3, 0.1, 0.9, 0.6, 0.6,
11+
0.9, 1, 0.3, 0.6, 0.8, 0.5
12+
]
13+
},
14+
{
15+
"type": "box",
16+
"name": "box no zindex",
17+
"x": 1,
18+
"y": [-1, 1]
19+
},
20+
{
21+
"type": "box",
22+
"name": "box below",
23+
"x": 2,
24+
"y": [-1, 1],
25+
"zindex": -100
26+
}
27+
],
28+
"layout": {
29+
"xaxis": {
30+
"title": {
31+
"text": "zindex stacking"
32+
}
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)