Skip to content

Commit b93e3a5

Browse files
committed
default funnels to horizontal
1 parent 446bacc commit b93e3a5

10 files changed

+50
-79
lines changed

src/traces/funnel/defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
2727
return;
2828
}
2929

30-
coerce('orientation', (traceOut.x && !traceOut.y) ? 'h' : 'v');
30+
coerce('orientation', (traceOut.y && !traceOut.x) ? 'v' : 'h');
3131
coerce('offset');
3232
coerce('width');
3333

test/image/mocks/funnel-offsetgroups.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
11
{
22
"data": [
33
{
4-
"type": "funnel", "opacity": 0.8,
4+
"type": "funnel", "opacity": 0.8, "orientation": "v",
55
"x": [ "A", "B", "C", "D" ],
66
"y": [ 4, 3, 2, 1 ],
77
"offsetgroup": 1,
88
"hovertext": "offsetgroup: 1"
99
},
1010
{
11-
"type": "funnel", "opacity": 0.8,
11+
"type": "funnel", "opacity": 0.8, "orientation": "v",
1212
"x": [ "A", "B", "C", "D" ],
1313
"y": [ 3, 2, 1, 0 ],
1414
"offsetgroup": 2,
1515
"hovertext": "offsetgroup: 2"
1616
},
1717
{
18-
"type": "funnel", "opacity": 0.8,
18+
"type": "funnel", "opacity": 0.8, "orientation": "v",
1919
"x": [ "A", "B", "C", "D" ],
2020
"y": [ 4, 3, 2, 1 ],
2121
"yaxis": "y2",
2222
"offsetgroup": 1,
2323
"hovertext": "offsetgroup: 1"
2424
},
2525
{
26-
"type": "funnel", "opacity": 0.8,
26+
"type": "funnel", "opacity": 0.8, "orientation": "v",
2727
"x": [ "A", "B", "C", "D" ],
2828
"y": [ 3, 2, 1, 0 ],
2929
"yaxis": "y2",
3030
"offsetgroup": 2,
3131
"hovertext": "offsetgroup: 2"
3232
},
3333
{
34-
"type": "funnel", "opacity": 0.8,
34+
"type": "funnel", "opacity": 0.8, "orientation": "v",
3535
"x": [ "A", "B", "C", "D" ],
3636
"y": [ 4, 3, 2, 1 ],
3737
"offsetgroup": 1,
3838
"hovertext": "offsetgroup: 1",
3939
"xaxis": "x2"
4040
},
4141
{
42-
"type": "funnel", "opacity": 0.8,
42+
"type": "funnel", "opacity": 0.8, "orientation": "v",
4343
"x": [ "A", "B", "C", "D" ],
4444
"y": [ 3, 2, 1, 0 ],
4545
"offsetgroup": 2,
4646
"hovertext": "offsetgroup: 2",
4747
"xaxis": "x2"
4848
},
4949
{
50-
"type": "funnel", "opacity": 0.8,
50+
"type": "funnel", "opacity": 0.8, "orientation": "v",
5151
"x": [ "A", "B", "C", "D" ],
5252
"y": [ 4, 3, 2, 1 ],
5353
"yaxis": "y2",
@@ -56,7 +56,7 @@
5656
"xaxis": "x2"
5757
},
5858
{
59-
"type": "funnel", "opacity": 0.8,
59+
"type": "funnel", "opacity": 0.8, "orientation": "v",
6060
"x": [ "A", "B", "C", "D" ],
6161
"y": [ 3, 2, 1, 0 ],
6262
"yaxis": "y2",

test/image/mocks/funnel_11.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"marker": {
1616
"color": "rgb(255, 102, 97)"
1717
},
18-
"type": "funnel"
18+
"type": "funnel", "orientation": "v"
1919
},
2020
{
2121
"x": [
@@ -32,7 +32,7 @@
3232
"marker": {
3333
"color": "rgb(0, 196, 200)"
3434
},
35-
"type": "funnel"
35+
"type": "funnel", "orientation": "v"
3636
},
3737
{
3838
"x": [
@@ -47,7 +47,7 @@
4747
],
4848
"name": "Std Dev - OJ",
4949
"visible": false,
50-
"type": "funnel"
50+
"type": "funnel", "orientation": "v"
5151
},
5252
{
5353
"x": [
@@ -62,7 +62,7 @@
6262
],
6363
"name": "Std Dev - VC",
6464
"visible": false,
65-
"type": "funnel"
65+
"type": "funnel", "orientation": "v"
6666
}
6767
],
6868
"layout": {

test/image/mocks/funnel_attrs.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"marker": { "color": "Blue" },
1010
"opacity": 0.5,
1111
"connector": { "visible": false },
12-
"type": "funnel"
12+
"type": "funnel", "orientation": "v"
1313
}, {
1414
"width": [0.4, 0.6, 0.8, 1],
1515
"text": ["Three", 2, "inside text", 0],
@@ -19,7 +19,7 @@
1919
"marker": { "color": "Orange" },
2020
"opacity": 0.5,
2121
"connector": { "visible": false },
22-
"type": "funnel"
22+
"type": "funnel", "orientation": "v"
2323
}, {
2424
"width": 1,
2525
"text": [1, 3, 2, 4],
@@ -29,15 +29,15 @@
2929
"marker": { "color": "Green" },
3030
"opacity": 0.5,
3131
"connector": { "visible": false },
32-
"type": "funnel"
32+
"type": "funnel", "orientation": "v"
3333
}, {
3434
"text": [2, "outside text", 3, 2],
3535
"y": [2, 0.25, 3, 2],
3636
"x": [1, 2, 3, 4],
3737
"marker": { "color": "Red" },
3838
"opacity": 0.5,
3939
"connector": { "visible": false },
40-
"type": "funnel"
40+
"type": "funnel", "orientation": "v"
4141
}
4242
],
4343
"layout": {

test/image/mocks/funnel_axis_with_other_traces.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"insidetextanchor": "start",
66
"width": 0.6,
77
"opacity": 0.8,
8+
"orientation": "v",
89
"x": [
910
1,
1011
2,
@@ -27,6 +28,7 @@
2728
"insidetextanchor": "start",
2829
"width": 0.6,
2930
"opacity": 0.8,
31+
"orientation": "v",
3032
"x": [
3133
"A",
3234
"B",
@@ -61,7 +63,6 @@
6163
"insidetextanchor": "start",
6264
"width": 0.6,
6365
"opacity": 0.8,
64-
"orientation": "h",
6566
"x": [
6667
5,
6768
4,
@@ -117,7 +118,6 @@
117118
"type": "funnel",
118119
"width": 0.6,
119120
"opacity": 0.8,
120-
"orientation": "h",
121121
"x": [
122122
5,
123123
4,
@@ -135,7 +135,6 @@
135135
"type": "funnel",
136136
"width": 0.6,
137137
"opacity": 0.8,
138-
"orientation": "h",
139138
"x": [
140139
3,
141140
2,

test/image/mocks/funnel_cliponaxis-false.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"data": [
33
{
4-
"type": "funnel",
4+
"type": "funnel", "orientation": "v",
55
"name": "not clipped",
66
"x": ["apple", "banana", "clementine"],
77
"y": [3.8, 4, 4.2],
@@ -14,7 +14,7 @@
1414
}
1515
},
1616
{
17-
"type": "funnel",
17+
"type": "funnel", "orientation": "v",
1818
"name": "same but clipped",
1919
"x": ["apple", "banana", "clementine"],
2020
"y": [3.8, 4, 4.2],
@@ -29,7 +29,7 @@
2929
"yaxis": "y2"
3030
},
3131
{
32-
"type": "funnel",
32+
"type": "funnel", "orientation": "v",
3333
"name": "should <b>not</b> see text",
3434
"x": ["banana"],
3535
"y": [4],
@@ -41,7 +41,7 @@
4141
"marker": {"opacity": 0.3}
4242
},
4343
{
44-
"type": "funnel",
44+
"type": "funnel", "orientation": "v",
4545
"name": "should see text",
4646
"x": ["banana"],
4747
"y": [2],

test/image/mocks/funnel_gap0.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
10.001001,
1212
"05.0005"
1313
],
14-
"name": "SF Zoo",
1514
"type": "funnel",
15+
"orientation": "v",
1616
"textfont": { "size": 18 }
1717
}
1818
],

test/image/mocks/funnel_multicategory.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"data": [
33
{
4-
"type": "funnel", "opacity": 0.8, "offset": -0.5, "width": 0.5,
4+
"type": "funnel", "opacity": 0.8, "offset": -0.5, "width": 0.5, "orientation": "v",
55
"cliponaxis": false,
66
"textposition": "inside",
77
"textinfo": "value+percent initial",
@@ -13,7 +13,7 @@
1313
"y": [4000.004, 3000.003, 2000.002, 1000.001, 4000.004, 2000.002, 1000.001, 500.0005]
1414
},
1515
{
16-
"type": "funnel", "opacity": 0.8, "offset": -0.5, "width": 0.5,
16+
"type": "funnel", "opacity": 0.8, "offset": -0.5, "width": 0.5, "orientation": "v",
1717
"cliponaxis": false,
1818
"textposition": "outside",
1919
"textinfo": "text+value+percent initial",

test/image/mocks/funnel_nonnumeric_sizes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
0,
1818
1
1919
],
20-
"type": "funnel"
20+
"type": "funnel", "orientation": "v"
2121
}
2222
],
2323
"layout": {

0 commit comments

Comments
 (0)