Skip to content

Commit 0b44789

Browse files
committed
indicator: tests
1 parent 0741f9e commit 0b44789

13 files changed

+1320
-0
lines changed

Diff for: test/image/baselines/indicator_bignumber.png

59 KB
Loading

Diff for: test/image/baselines/indicator_bullet.png

18.4 KB
Loading

Diff for: test/image/baselines/indicator_datacard.png

23.8 KB
Loading

Diff for: test/image/baselines/indicator_datacard2.png

9.21 KB
Loading

Diff for: test/image/baselines/indicator_gauge.png

106 KB
Loading

Diff for: test/image/baselines/indicator_scatter.png

28 KB
Loading

Diff for: test/image/mocks/indicator_bignumber.json

+197
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
{
2+
"data": [{
3+
"domain": {
4+
"x": [0, 0.33],
5+
"y": [0, 0.33]
6+
},
7+
"title": {"text": "Accounts"},
8+
"type": "indicator",
9+
"mode": "number+delta",
10+
"delta": {
11+
"increasing": {
12+
"color": "green",
13+
"symbol": "+"
14+
},
15+
"valueformat": ".1%",
16+
"reference": 400,
17+
"relative": true
18+
},
19+
"gauge": {
20+
"bgcolor": "rgba(255, 255, 255, 0.25)"
21+
},
22+
"max": 500,
23+
"value": 450
24+
}, {
25+
"domain": {
26+
"x": [0, 0.33],
27+
"y": [0.33, 0.66]
28+
},
29+
"title": {"text": "Accounts"},
30+
"type": "indicator",
31+
"mode": "delta",
32+
"delta": {
33+
"reference": 400,
34+
"relative": true
35+
},
36+
"gauge": {
37+
"bgcolor": "rgba(255, 255, 255, 0.25)"
38+
},
39+
"max": 500,
40+
"value": 350
41+
}, {
42+
"domain": {
43+
"x": [0, 0.33],
44+
"y": [0.66, 1.0]
45+
},
46+
"title": {"text": "Accounts"},
47+
"type": "indicator",
48+
"mode": "number",
49+
"delta": {
50+
"reference": 400,
51+
"relative": true
52+
},
53+
"gauge": {
54+
"bgcolor": "rgba(255, 255, 255, 0.25)"
55+
},
56+
"max": 500,
57+
"value": 430
58+
}, {
59+
"domain": {
60+
"x": [0.33, 0.66],
61+
"y": [0, 0.66]
62+
},
63+
"title": {"text": "Accounts"},
64+
"type": "indicator",
65+
"mode": "number+delta",
66+
"delta": {
67+
"reference": 400,
68+
"relative": true,
69+
"position": "top"
70+
},
71+
"gauge": {
72+
"bgcolor": "rgba(255, 255, 255, 0.25)"
73+
},
74+
"max": 500,
75+
"value": 450
76+
}, {
77+
"domain": {
78+
"x": [0.33, 0.66],
79+
"y": [0.66, 1.0]
80+
},
81+
"title": {"text": "Accounts"},
82+
"type": "indicator",
83+
"mode": "number+delta",
84+
"delta": {
85+
"reference": 400,
86+
"relative": true
87+
},
88+
"gauge": {
89+
"bgcolor": "rgba(255, 255, 255, 0.25)"
90+
},
91+
"max": 500,
92+
"value": 350
93+
}, {
94+
"domain": {
95+
"x": [0.66, 1],
96+
"y": [0, 1]
97+
},
98+
"title": {"text": "Accounts<br><span style='font-size:0.8em;color:gray'>Subtitle</span><br><span style='font-size:0.8em;color:gray'>Subsubtitle</span>"},
99+
"type": "indicator",
100+
"mode": "number+delta",
101+
"delta": {
102+
"reference": 400,
103+
"relative": true
104+
},
105+
"gauge": {
106+
"bgcolor": "rgba(255, 255, 255, 0.25)"
107+
},
108+
"max": 500,
109+
"value": 450
110+
}
111+
],
112+
"layout": {
113+
"width": 750,
114+
"height": 500,
115+
"paper_bgcolor": "black",
116+
"font": {
117+
"color": "white",
118+
"family": "Dosis"
119+
},
120+
"margin": {
121+
"t": 25,
122+
"r": 25,
123+
"l": 25,
124+
"b": 25
125+
},
126+
"shapes": [{
127+
"type": "rect",
128+
"x0": 0,
129+
"x1": 0.33,
130+
"y0": 0.66,
131+
"y1": 1,
132+
"line": {
133+
"color": "rgba(255, 255, 255, 0.35)",
134+
"width": 1
135+
},
136+
"fill": "rgba(0,0,0,0)"
137+
}, {
138+
"type": "rect",
139+
"x0": 0,
140+
"x1": 0.33,
141+
"y0": 0.33,
142+
"y1": 0.66,
143+
"line": {
144+
"color": "rgba(255, 255, 255, 0.35)",
145+
"width": 1
146+
},
147+
"fill": "rgba(0,0,0,0)"
148+
}, {
149+
"type": "rect",
150+
"x0": 0,
151+
"x1": 0.33,
152+
"y0": 0,
153+
"y1": 0.33,
154+
"line": {
155+
"color": "rgba(255, 255, 255, 0.35)",
156+
"width": 1
157+
},
158+
"fill": "rgba(0,0,0,0)"
159+
}, {
160+
"type": "rect",
161+
"x0": 0.33,
162+
"x1": 0.66,
163+
"y0": 0.66,
164+
"y1": 1,
165+
"line": {
166+
"color": "rgba(255, 255, 255, 0.35)",
167+
"width": 1
168+
},
169+
"fill": "rgba(0,0,0,0)"
170+
}, {
171+
"type": "rect",
172+
"x0": 0.33,
173+
"x1": 0.66,
174+
"y0": 0,
175+
"y1": 0.66,
176+
"line": {
177+
"color": "rgba(255, 255, 255, 0.35)",
178+
"width": 1
179+
},
180+
"fill": "rgba(0,0,0,0)"
181+
}, {
182+
"type": "rect",
183+
"x0": 0.66,
184+
"x1": 1.0,
185+
"y0": 0,
186+
"y1": 1,
187+
"line": {
188+
"color": "rgba(255, 255, 255, 0.35)",
189+
"width": 1
190+
},
191+
"fill": "rgba(0,0,0,0)"
192+
}]
193+
},
194+
"config": {
195+
"responsive": true
196+
}
197+
}

Diff for: test/image/mocks/indicator_bullet.json

+165
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
{
2+
"data": [{
3+
"domain": {
4+
"x": [0.25, 1],
5+
"y": [0.0833, 0.25]
6+
},
7+
"title": {
8+
"text": "<b>Revenue</b><br><span style='color: gray; font-size:0.8em'>U.S. $ (1,000s)</span>",
9+
"font": {"size": 14}
10+
},
11+
"type": "indicator",
12+
"mode": "number+gauge+delta",
13+
"vmax": 300,
14+
"delta": {"reference": 200, "position": "right"},
15+
"gauge": {
16+
"shape": "bullet",
17+
"threshold": {
18+
"line": {
19+
"color": "black",
20+
"width": 2
21+
},
22+
"thickness": 0.75,
23+
"value": 170
24+
},
25+
"bgcolor": "rgba(0, 0, 0, 0.1)",
26+
"borderwidth": 2,
27+
"bordercolor": "rgba(0, 0, 0, 0.1)",
28+
"steps": [{
29+
"range": [0, 150],
30+
"color": "rgba(0, 0, 0, 0.5)"
31+
}, {
32+
"range": [150, 250],
33+
"color": "rgba(0, 0, 0, 0.25)"
34+
}],
35+
"value": {
36+
"color": "rgba(0, 0, 0, 1)"
37+
}
38+
},
39+
"value": 180
40+
}, {
41+
"domain": {
42+
"x": [0.25, 1],
43+
"y": [0.4166, 0.5833]
44+
},
45+
"title": {"text": "<b>Profit</b>", "font": {"size": 14}},
46+
"type": "indicator",
47+
"mode": "number+gauge+delta",
48+
"vmax": 100,
49+
"delta": {"reference": 200, "position": "bottom"},
50+
"target": 75,
51+
"gauge": {
52+
"shape": "bullet",
53+
"threshold": {
54+
"line": {
55+
"color": "black",
56+
"width": 2
57+
},
58+
"thickness": 0.75,
59+
"value": 50
60+
},
61+
"bgcolor": "rgba(0, 0, 0, 0.1)",
62+
"borderwidth": 2,
63+
"bordercolor": "rgba(0, 0, 0, 0.1)",
64+
"steps": [{
65+
"range": [0, 25],
66+
"color": "rgba(0, 0, 0, 0.5)"
67+
}, {
68+
"range": [25, 75],
69+
"color": "rgba(0, 0, 0, 0.25)"
70+
}],
71+
"value": {
72+
"color": "rgba(0, 0, 0, 1)"
73+
}
74+
},
75+
"value": 35,
76+
"number": {
77+
"valueformat": "0"
78+
}
79+
}, {
80+
"domain": {
81+
"x": [0.25, 1],
82+
"y": [0.7499, 0.9166]
83+
},
84+
"title": {
85+
"text" :"<b>Avg Order Size</b><br><span style='color: gray; font-size:0.8em'>U.S. $</span>",
86+
"font": {"size": 14}
87+
},
88+
"type": "indicator",
89+
"mode": "number+gauge+delta",
90+
"vmax": 300,
91+
"delta": {"reference": 200, "position": "top"},
92+
"gauge": {
93+
"shape": "bullet",
94+
"threshold": {
95+
"line": {
96+
"color": "black",
97+
"width": 2
98+
},
99+
"thickness": 0.75,
100+
"value": 210
101+
},
102+
"bgcolor": "rgba(0, 0, 0, 0.1)",
103+
"borderwidth": 2,
104+
"bordercolor": "rgba(0, 0, 0, 0.1)",
105+
"steps": [{
106+
"range": [0, 150],
107+
"color": "rgba(0, 0, 0, 0.5)"
108+
}, {
109+
"range": [150, 250],
110+
"color": "rgba(0, 0, 0, 0.25)"
111+
}],
112+
"value": {
113+
"color": "rgba(0, 0, 0, 1)"
114+
}
115+
},
116+
"value": 220
117+
}],
118+
"layout": {
119+
"width": 600,
120+
"height": 250,
121+
"margin": {
122+
"t": 10,
123+
"r": 25,
124+
"l": 25,
125+
"b": 10
126+
},
127+
"shapes": [{
128+
"type": "rect",
129+
"x0": 0.25,
130+
"x1": 1,
131+
"y0": 0.0833,
132+
"y1": 0.25,
133+
"line": {
134+
"color": "rgba(0, 0, 0, 0.25)",
135+
"width": 1
136+
},
137+
"fill": "rgba(0,0,0,0)"
138+
}, {
139+
"type": "rect",
140+
"x0": 0.25,
141+
"x1": 1,
142+
"y0": 0.4166,
143+
"y1": 0.5833,
144+
"line": {
145+
"color": "rgba(0, 0, 0, 0.25)",
146+
"width": 1
147+
},
148+
"fill": "rgba(0,0,0,0)"
149+
}, {
150+
"type": "rect",
151+
"x0": 0.25,
152+
"x1": 1,
153+
"y0": 0.7499,
154+
"y1": 0.9166,
155+
"line": {
156+
"color": "rgba(0, 0, 0, 0.25)",
157+
"width": 1
158+
},
159+
"fill": "rgba(0,0,0,0)"
160+
}]
161+
},
162+
"config": {
163+
"responsive": true
164+
}
165+
}

0 commit comments

Comments
 (0)