Skip to content

Commit bf586d4

Browse files
committed
add more legend mocks (with 1.49.4 baselines)
- mocks with negative x with orientation h - mock with small viewports - mock with legend beyond plotarea + scrollbox - mock with long item leading to x margin push
1 parent 51df66d commit bf586d4

12 files changed

+433
-0
lines changed
28.1 KB
Loading
26.7 KB
Loading
Loading
35.3 KB
Loading
29.5 KB
Loading
Loading
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"data": [{
3+
"x": [0, 1, 2, 3, 4, 5, 6, 7, 8],
4+
"y": [0, 3, 6, 4, 5, 2, 3, 5, 4],
5+
"type": "scatter"
6+
},
7+
{
8+
"x": [0, 1, 2, 3, 4, 5, 6, 7, 8],
9+
"y": [0, 4, 7, 8, 3, 6, 3, 3, 4],
10+
"type": "scatter"
11+
},
12+
{
13+
"x": [0, 1, 2, 3, 4, 5, 6, 7, 8],
14+
"y": [0, 4, 7, 8, 3, 6, 3, 3, 4],
15+
"type": "scatter"
16+
},
17+
{
18+
"x": [0, 1, 2, 3, 4, 5, 6, 7, 8],
19+
"y": [0, 4, 7, 8, 3, 6, 3, 3, 4],
20+
"type": "scatter"
21+
},
22+
{
23+
"x": [0, 1, 2, 3, 4, 5, 6, 7, 8],
24+
"y": [0, 4, 7, 8, 3, 6, 3, 3, 4],
25+
"type": "scatter"
26+
},
27+
{
28+
"x": [0, 1, 2, 3, 4, 5, 6, 7, 8],
29+
"y": [0, 4, 7, 8, 3, 6, 3, 3, 4],
30+
"type": "scatter"
31+
}
32+
],
33+
"layout": {
34+
"showlegend": true,
35+
"legend": {
36+
"orientation": "h",
37+
"traceorder": "reversed",
38+
"x": -0.5,
39+
"y": 1.2
40+
},
41+
"margin": {
42+
"l": 125,
43+
"r": 5,
44+
"b": 30,
45+
"t": 20,
46+
"pad": 0
47+
},
48+
"height": 350,
49+
"width": 700
50+
}
51+
}
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"data": [
3+
{
4+
"x": [0, 1, 2, 3, 4, 5, 6, 7, 8],
5+
"y": [0, 3, 6, 4, 5, 2, 3, 5, 4],
6+
"name": "Plot"
7+
},
8+
{
9+
"x": [0, 1, 2, 3, 4, 5, 6, 7, 8],
10+
"y": [0, 4, 7, 8, 3, 6, 3, 3, 4],
11+
"name": "Plot Plot"
12+
},
13+
{
14+
"x": [0, 1, 2, 3, 4, 5, 6, 7, 8],
15+
"y": [0, 5, 3, 10, 5.33, 2.24, 4.4, 5.1, 7.2],
16+
"name": "Plot Plot Plot"
17+
}
18+
],
19+
"layout": {
20+
"paper_bgcolor": "pink",
21+
"legend": {
22+
"orientation": "h",
23+
"x": -0.4,
24+
"y": -0.1
25+
},
26+
"width": 400
27+
}
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
{
2+
"data": [
3+
{
4+
"x": [1, 2, 3],
5+
"y": [44, 88, 132],
6+
"name": "trace with wide trace name 0"
7+
},
8+
{
9+
"x": [1, 2, 3],
10+
"y": [88, 176, 264],
11+
"name": "trace with wide trace name 1",
12+
"yaxis": "y2"
13+
},
14+
{
15+
"x": [1, 2, 3],
16+
"y": [132, 264, 396.00000000000006],
17+
"name": "trace with wide trace name 2"
18+
},
19+
{
20+
"x": [1, 2, 3],
21+
"y": [176, 352, 528],
22+
"name": "trace with wide trace name 3",
23+
"yaxis": "y2",
24+
"visible": "legendonly"
25+
},
26+
{
27+
"x": [1, 2, 3],
28+
"y": [220, 440, 660],
29+
"name": "trace with wide trace name 4",
30+
"visible": "legendonly"
31+
},
32+
{
33+
"x": [1, 2, 3],
34+
"y": [264, 528, 792],
35+
"name": "trace with wide trace name 5",
36+
"yaxis": "y2",
37+
"visible": "legendonly"
38+
},
39+
{
40+
"x": [1, 2, 3],
41+
"y": [308, 616, 923.9999999999999],
42+
"name": "trace with wide trace name 6",
43+
"visible": "legendonly"
44+
},
45+
{
46+
"x": [1, 2, 3],
47+
"y": [351.99999999999994, 703.9999999999999, 1055.9999999999998],
48+
"name": "trace with wide trace name 7",
49+
"yaxis": "y2",
50+
"visible": "legendonly"
51+
},
52+
{
53+
"x": [1, 2, 3],
54+
"y": [395.99999999999994, 791.9999999999999, 1187.9999999999998],
55+
"name": "trace with wide trace name 8",
56+
"visible": "legendonly"
57+
},
58+
{
59+
"x": [1, 2, 3],
60+
"y": [439.99999999999994, 879.9999999999999, 1319.9999999999998],
61+
"name": "trace with wide trace name 9",
62+
"yaxis": "y2",
63+
"visible": "legendonly"
64+
},
65+
{
66+
"x": [1, 2, 3],
67+
"y": [483.9999999999999, 967.9999999999998, 1451.9999999999998],
68+
"name": "trace with wide trace name 10",
69+
"visible": "legendonly"
70+
},
71+
{
72+
"x": [1, 2, 3],
73+
"y": [527.9999999999999, 1055.9999999999998, 1583.9999999999998],
74+
"name": "trace with wide trace name 11",
75+
"yaxis": "y2",
76+
"visible": "legendonly"
77+
},
78+
{
79+
"x": [1, 2, 3],
80+
"y": [571.9999999999999, 1143.9999999999998, 1715.9999999999995],
81+
"name": "trace with wide trace name 12",
82+
"visible": "legendonly"
83+
},
84+
{
85+
"x": [1, 2, 3],
86+
"y": [615.9999999999999, 1231.9999999999998, 1847.9999999999995],
87+
"name": "trace with wide trace name 13",
88+
"yaxis": "y2",
89+
"visible": "legendonly"
90+
},
91+
{
92+
"x": [1, 2, 3],
93+
"y": [659.9999999999999, 1319.9999999999998, 1979.9999999999995],
94+
"name": "trace with wide trace name 14",
95+
"visible": "legendonly"
96+
},
97+
{
98+
"x": [1, 2, 3],
99+
"y": [703.9999999999999, 1407.9999999999998, 2111.9999999999995],
100+
"name": "trace with wide trace name 15",
101+
"yaxis": "y2",
102+
"visible": "legendonly"
103+
}
104+
],
105+
"layout": {
106+
"legend": {
107+
"xanchor": "left",
108+
"yanchor": "top",
109+
"y": 0,
110+
"x": 2,
111+
"orientation": "h",
112+
"bgcolor": "rgb(200, 200, 200)"
113+
},
114+
"xaxis": {
115+
"title": { "text": "X Axis" }
116+
},
117+
"yaxis": {
118+
"title": { "text": "Count#" }
119+
},
120+
"yaxis2": {
121+
"title": { "text": "Y-2Axis" },
122+
"overlaying": "y",
123+
"side": "right"
124+
}
125+
}
126+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
"layout": {
3+
"legend": {
4+
"orientation": "h",
5+
"bordercolor": "#000000",
6+
"borderwidth": 1,
7+
"bgcolor": "#ffffff00"
8+
},
9+
"margin": {
10+
"t": 25,
11+
"b": 25,
12+
"r": 25,
13+
"l": 25
14+
},
15+
"width":500,
16+
"height":200
17+
},
18+
"data": [
19+
{
20+
"x": [1, 2, 3, 4],
21+
"y": [63.69, 62.55, 61.64, 61.39]
22+
}, {
23+
"x": [1, 2, 3, 4],
24+
"y": [58.24, 54.93, 42.11, 50.75]
25+
}, {
26+
"x": [1, 2, 3, 4],
27+
"y": [51.49, 49.59, 37.12, 31.45]
28+
}, {
29+
"x": [1, 2, 3, 4],
30+
"y": [49.09, 58.54, 53.91, 43.12]
31+
}, {
32+
"x": [1, 2, 3, 4],
33+
"y": [70.53, 72.51, 72.28, 78.65]
34+
}, {
35+
"x": [1, 2, 3, 4],
36+
"y": [62.69, 59.09, 63.82, 62]
37+
}, {
38+
"x": [1, 2, 3, 4],
39+
"y": [76.27, 71.43, 59.83, 64.34]
40+
}, {
41+
"x": [1, 2, 3, 4],
42+
"y": [71.15, 81.82, 88.46, 74.29]
43+
}, {
44+
"x": [1, 2, 3, 4],
45+
"y": [57.89, 57.38, 52.08, 63.83]
46+
}, {
47+
"x": [1, 2, 3, 4],
48+
"y": [65.4, 63.27, 65.78, 64.03]
49+
}, {
50+
"x": [1, 2, 3, 4],
51+
"y": [58.24, 54.93, 42.11, 50.75]
52+
}, {
53+
"x": [1, 2, 3, 4],
54+
"y": [51.49, 49.59, 37.12, 31.45]
55+
}, {
56+
"x": [1, 2, 3, 4],
57+
"y": [49.09, 58.54, 53.91, 43.12]
58+
}, {
59+
"x": [1, 2, 3, 4],
60+
"y": [70.53, 72.51, 72.28, 78.65]
61+
}, {
62+
"x": [1, 2, 3, 4],
63+
"y": [62.69, 59.09, 63.82, 62]
64+
}, {
65+
"x": [1, 2, 3, 4],
66+
"y": [76.27, 71.43, 59.83, 64.34]
67+
}, {
68+
"x": [1, 2, 3, 4],
69+
"y": [71.15, 81.82, 88.46, 74.29]
70+
}, {
71+
"x": [1, 2, 3, 4],
72+
"y": [57.89, 57.38, 52.08, 63.83]
73+
}, {
74+
"x": [1, 2, 3, 4],
75+
"y": [65.4, 63.27, 65.78, 64.03]
76+
}, {
77+
"x": [1, 2, 3, 4],
78+
"y": [58.24, 54.93, 42.11, 50.75]
79+
}, {
80+
"x": [1, 2, 3, 4],
81+
"y": [51.49, 49.59, 37.12, 31.45]
82+
}, {
83+
"x": [1, 2, 3, 4],
84+
"y": [49.09, 58.54, 53.91, 43.12]
85+
}, {
86+
"x": [1, 2, 3, 4],
87+
"y": [70.53, 72.51, 72.28, 78.65]
88+
}, {
89+
"x": [1, 2, 3, 4],
90+
"y": [62.69, 59.09, 63.82, 62]
91+
}, {
92+
"x": [1, 2, 3, 4],
93+
"y": [76.27, 71.43, 59.83, 64.34]
94+
}, {
95+
"x": [1, 2, 3, 4],
96+
"y": [71.15, 81.82, 88.46, 74.29]
97+
}, {
98+
"x": [1, 2, 3, 4],
99+
"y": [57.89, 57.38, 52.08, 63.83]
100+
}, {
101+
"x": [1, 2, 3, 4],
102+
"y": [65.4, 63.27, 65.78, 64.03]
103+
}]
104+
}

0 commit comments

Comments
 (0)