Skip to content

Commit 13c313b

Browse files
committed
added new mock and fixed gl defaults in jasmine test files
1 parent 9ec9f06 commit 13c313b

File tree

3 files changed

+269
-7
lines changed

3 files changed

+269
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
{
2+
"data": [
3+
{
4+
"type": "isosurface",
5+
"colorscale": "Reds",
6+
"reversescale": true,
7+
"surface": { "show": true },
8+
"spaceframe": { "show": false },
9+
"slices": {
10+
"x": { "show": false },
11+
"y": { "show": false },
12+
"z": { "show": false }
13+
},
14+
"caps": {
15+
"x": { "show": true },
16+
"y": { "show": true },
17+
"z": { "show": true }
18+
},
19+
"contour": {
20+
"show": false,
21+
"width": 4
22+
},
23+
"x": [ 2, 1.875, 1.75, 1.625, 1.5, 1.375, 1.25, 1.125, 1 ],
24+
"y": [ 0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1 ],
25+
"z": [ 0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1 ],
26+
"isomin": 150,
27+
"isomax": 250,
28+
"value": [
29+
0, -125, -250, -375, -500, -625, -750, -875, -1000,
30+
-125, -250, -375, -500, -625, -750, -875, -1000, -1125,
31+
-250, -375, -500, -625, -750, -875, -1000, -1125, -1250,
32+
-375, -500, -625, -750, -875, -1000, -1125, -1250, -1375,
33+
-500, -625, -750, -875, -1000, -1125, -1250, -1375, -1500,
34+
-625, -750, -875, -1000, -1125, -1250, -1375, -1500, -1625,
35+
-750, -875, -1000, -1125, -1250, -1375, -1500, -1625, -1750,
36+
-875, -1000, -1125, -1250, -1375, -1500, -1625, -1750, -1875,
37+
-1000, -1125, -1250, -1375, -1500, -1625, -1750, -1875, -2000,
38+
39+
125, 0, -125, -250, -375, -500, -625, -750, -875,
40+
0, -121, -242, -363, -484, -605, -727, -848, -969,
41+
-125, -242, -359, -477, -594, -711, -828, -945, -1063,
42+
-250, -363, -477, -590, -703, -816, -930, -1043, -1156,
43+
-375, -484, -594, -703, -813, -922, -1031, -1141, -1250,
44+
-500, -605, -711, -816, -922, -1027, -1133, -1238, -1344,
45+
-625, -727, -828, -930, -1031, -1133, -1234, -1336, -1438,
46+
-750, -848, -945, -1043, -1141, -1238, -1336, -1434, -1531,
47+
-875, -969, -1063, -1156, -1250, -1344, -1438, -1531, -1625,
48+
49+
250, 125, 0, -125, -250, -375, -500, -625, -750,
50+
125, 8, -109, -227, -344, -461, -578, -695, -813,
51+
0, -109, -219, -328, -438, -547, -656, -766, -875,
52+
-125, -227, -328, -430, -531, -633, -734, -836, -938,
53+
-250, -344, -438, -531, -625, -719, -813, -906, -1000,
54+
-375, -461, -547, -633, -719, -805, -891, -977, -1063,
55+
-500, -578, -656, -734, -813, -891, -969, -1047, -1125,
56+
-625, -695, -766, -836, -906, -977, -1047, -1117, -1188,
57+
-750, -813, -875, -938, -1000, -1063, -1125, -1188, -1250,
58+
59+
375, 250, 125, 0, -125, -250, -375, -500, -625,
60+
250, 137, 23, -90, -203, -316, -430, -543, -656,
61+
125, 23, -78, -180, -281, -383, -484, -586, -688,
62+
0, -90, -180, -270, -359, -449, -539, -629, -719,
63+
-125, -203, -281, -359, -438, -516, -594, -672, -750,
64+
-250, -316, -383, -449, -516, -582, -648, -715, -781,
65+
-375, -430, -484, -539, -594, -648, -703, -758, -813,
66+
-500, -543, -586, -629, -672, -715, -758, -801, -844,
67+
-625, -656, -688, -719, -750, -781, -813, -844, -875,
68+
69+
500, 375, 250, 125, 0, -125, -250, -375, -500,
70+
375, 266, 156, 47, -63, -172, -281, -391, -500,
71+
250, 156, 63, -31, -125, -219, -313, -406, -500,
72+
125, 47, -31, -109, -188, -266, -344, -422, -500,
73+
0, -63, -125, -188, -250, -313, -375, -438, -500,
74+
-125, -172, -219, -266, -313, -359, -406, -453, -500,
75+
-250, -281, -313, -344, -375, -406, -438, -469, -500,
76+
-375, -391, -406, -422, -438, -453, -469, -484, -500,
77+
-500, -500, -500, -500, -500, -500, -500, -500, -500,
78+
79+
625, 500, 375, 250, 125, 0, -125, -250, -375,
80+
500, 395, 289, 184, 78, -27, -133, -238, -344,
81+
375, 289, 203, 117, 31, -55, -141, -227, -313,
82+
250, 184, 117, 51, -16, -82, -148, -215, -281,
83+
125, 78, 31, -16, -63, -109, -156, -203, -250,
84+
0, -27, -55, -82, -109, -137, -164, -191, -219,
85+
-125, -133, -141, -148, -156, -164, -172, -180, -188,
86+
-250, -238, -227, -215, -203, -191, -180, -168, -156,
87+
-375, -344, -313, -281, -250, -219, -188, -156, -125,
88+
89+
750, 625, 500, 375, 250, 125, 0, -125, -250,
90+
625, 523, 422, 320, 219, 117, 16, -86, -188,
91+
500, 422, 344, 266, 188, 109, 31, -47, -125,
92+
375, 320, 266, 211, 156, 102, 47, -8, -63,
93+
250, 219, 188, 156, 125, 94, 63, 31, 0,
94+
125, 117, 109, 102, 94, 86, 78, 70, 63,
95+
0, 16, 31, 47, 63, 78, 94, 109, 125,
96+
-125, -86, -47, -8, 31, 70, 109, 148, 188,
97+
-250, -188, -125, -63, 0, 63, 125, 188, 250,
98+
99+
875, 750, 625, 500, 375, 250, 125, 0, -125,
100+
750, 652, 555, 457, 359, 262, 164, 66, -31,
101+
625, 555, 484, 414, 344, 273, 203, 133, 63,
102+
500, 457, 414, 371, 328, 285, 242, 199, 156,
103+
375, 359, 344, 328, 313, 297, 281, 266, 250,
104+
250, 262, 273, 285, 297, 309, 320, 332, 344,
105+
125, 164, 203, 242, 281, 320, 359, 398, 438,
106+
0, 66, 133, 199, 266, 332, 398, 465, 531,
107+
-125, -31, 63, 156, 250, 344, 438, 531, 625,
108+
109+
1000, 875, 750, 625, 500, 375, 250, 125, 0,
110+
875, 781, 688, 594, 500, 406, 313, 219, 125,
111+
750, 688, 625, 563, 500, 438, 375, 313, 250,
112+
625, 594, 563, 531, 500, 469, 438, 406, 375,
113+
500, 500, 500, 500, 500, 500, 500, 500, 500,
114+
375, 406, 438, 469, 500, 531, 563, 594, 625,
115+
250, 313, 375, 438, 500, 563, 625, 688, 750,
116+
125, 219, 313, 406, 500, 594, 688, 781, 875,
117+
0, 125, 250, 375, 500, 625, 750, 875, 1000
118+
]
119+
}, {
120+
"type": "isosurface",
121+
"colorscale": "Reds",
122+
"reversescale": true,
123+
"surface": { "show": true },
124+
"spaceframe": { "show": false },
125+
"slices": {
126+
"x": { "show": false },
127+
"y": { "show": false },
128+
"z": { "show": false }
129+
},
130+
"caps": {
131+
"x": { "show": true },
132+
"y": { "show": true },
133+
"z": { "show": true }
134+
},
135+
"contour": {
136+
"show": false,
137+
"width": 4
138+
},
139+
"x": [ 0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1 ],
140+
"y": [ 0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1 ],
141+
"z": [ 0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1 ],
142+
"isomin": 150,
143+
"isomax": 250,
144+
"value": [
145+
0, 0, 0, 0, 0, 0, 0, 0, 0,
146+
0, 16, 31, 47, 63, 78, 94, 109, 125,
147+
0, 31, 63, 94, 125, 156, 188, 219, 250,
148+
0, 47, 94, 141, 188, 234, 281, 328, 375,
149+
0, 63, 125, 188, 250, 313, 375, 438, 500,
150+
0, 78, 156, 234, 313, 391, 469, 547, 625,
151+
0, 94, 188, 281, 375, 469, 563, 656, 750,
152+
0, 109, 219, 328, 438, 547, 656, 766, 875,
153+
0, 125, 250, 375, 500, 625, 750, 875, 1000,
154+
155+
0, 16, 31, 47, 63, 78, 94, 109, 125,
156+
16, 47, 78, 109, 141, 172, 203, 234, 266,
157+
31, 78, 125, 172, 219, 266, 313, 359, 406,
158+
47, 109, 172, 234, 297, 359, 422, 484, 547,
159+
63, 141, 219, 297, 375, 453, 531, 609, 688,
160+
78, 172, 266, 359, 453, 547, 641, 734, 828,
161+
94, 203, 313, 422, 531, 641, 750, 859, 969,
162+
109, 234, 359, 484, 609, 734, 859, 984, 1109,
163+
125, 266, 406, 547, 688, 828, 969, 1109, 1250,
164+
165+
0, 31, 63, 94, 125, 156, 188, 219, 250,
166+
31, 78, 125, 172, 219, 266, 313, 359, 406,
167+
63, 125, 188, 250, 313, 375, 438, 500, 563,
168+
94, 172, 250, 328, 406, 484, 563, 641, 719,
169+
125, 219, 313, 406, 500, 594, 688, 781, 875,
170+
156, 266, 375, 484, 594, 703, 813, 922, 1031,
171+
188, 313, 438, 563, 688, 813, 938, 1063, 1188,
172+
219, 359, 500, 641, 781, 922, 1063, 1203, 1344,
173+
250, 406, 563, 719, 875, 1031, 1188, 1344, 1500,
174+
175+
0, 47, 94, 141, 188, 234, 281, 328, 375,
176+
47, 109, 172, 234, 297, 359, 422, 484, 547,
177+
94, 172, 250, 328, 406, 484, 563, 641, 719,
178+
141, 234, 328, 422, 516, 609, 703, 797, 891,
179+
188, 297, 406, 516, 625, 734, 844, 953, 1063,
180+
234, 359, 484, 609, 734, 859, 984, 1109, 1234,
181+
281, 422, 563, 703, 844, 984, 1125, 1266, 1406,
182+
328, 484, 641, 797, 953, 1109, 1266, 1422, 1578,
183+
375, 547, 719, 891, 1063, 1234, 1406, 1578, 1750,
184+
185+
0, 63, 125, 188, 250, 313, 375, 438, 500,
186+
63, 141, 219, 297, 375, 453, 531, 609, 688,
187+
125, 219, 313, 406, 500, 594, 688, 781, 875,
188+
188, 297, 406, 516, 625, 734, 844, 953, 1063,
189+
250, 375, 500, 625, 750, 875, 1000, 1125, 1250,
190+
313, 453, 594, 734, 875, 1016, 1156, 1297, 1438,
191+
375, 531, 688, 844, 1000, 1156, 1313, 1469, 1625,
192+
438, 609, 781, 953, 1125, 1297, 1469, 1641, 1813,
193+
500, 688, 875, 1063, 1250, 1438, 1625, 1813, 2000,
194+
195+
0, 78, 156, 234, 313, 391, 469, 547, 625,
196+
78, 172, 266, 359, 453, 547, 641, 734, 828,
197+
156, 266, 375, 484, 594, 703, 813, 922, 1031,
198+
234, 359, 484, 609, 734, 859, 984, 1109, 1234,
199+
313, 453, 594, 734, 875, 1016, 1156, 1297, 1438,
200+
391, 547, 703, 859, 1016, 1172, 1328, 1484, 1641,
201+
469, 641, 813, 984, 1156, 1328, 1500, 1672, 1844,
202+
547, 734, 922, 1109, 1297, 1484, 1672, 1859, 2047,
203+
625, 828, 1031, 1234, 1438, 1641, 1844, 2047, 2250,
204+
205+
0, 94, 188, 281, 375, 469, 563, 656, 750,
206+
94, 203, 313, 422, 531, 641, 750, 859, 969,
207+
188, 313, 438, 563, 688, 813, 938, 1063, 1188,
208+
281, 422, 563, 703, 844, 984, 1125, 1266, 1406,
209+
375, 531, 688, 844, 1000, 1156, 1313, 1469, 1625,
210+
469, 641, 813, 984, 1156, 1328, 1500, 1672, 1844,
211+
563, 750, 938, 1125, 1313, 1500, 1688, 1875, 2063,
212+
656, 859, 1063, 1266, 1469, 1672, 1875, 2078, 2281,
213+
750, 969, 1188, 1406, 1625, 1844, 2063, 2281, 2500,
214+
215+
0, 109, 219, 328, 438, 547, 656, 766, 875,
216+
109, 234, 359, 484, 609, 734, 859, 984, 1109,
217+
219, 359, 500, 641, 781, 922, 1063, 1203, 1344,
218+
328, 484, 641, 797, 953, 1109, 1266, 1422, 1578,
219+
438, 609, 781, 953, 1125, 1297, 1469, 1641, 1813,
220+
547, 734, 922, 1109, 1297, 1484, 1672, 1859, 2047,
221+
656, 859, 1063, 1266, 1469, 1672, 1875, 2078, 2281,
222+
766, 984, 1203, 1422, 1641, 1859, 2078, 2297, 2516,
223+
875, 1109, 1344, 1578, 1813, 2047, 2281, 2516, 2750,
224+
225+
0, 125, 250, 375, 500, 625, 750, 875, 1000,
226+
125, 266, 406, 547, 688, 828, 969, 1109, 1250,
227+
250, 406, 563, 719, 875, 1031, 1188, 1344, 1500,
228+
375, 547, 719, 891, 1063, 1234, 1406, 1578, 1750,
229+
500, 688, 875, 1063, 1250, 1438, 1625, 1813, 2000,
230+
625, 828, 1031, 1234, 1438, 1641, 1844, 2047, 2250,
231+
750, 969, 1188, 1406, 1625, 1844, 2063, 2281, 2500,
232+
875, 1109, 1344, 1578, 1813, 2047, 2281, 2516, 2750,
233+
1000, 1250, 1500, 1750, 2000, 2250, 2500, 2750, 3000
234+
]
235+
}
236+
],
237+
"layout": {
238+
"title": {
239+
"text": "scene with multiple isosurface traces"
240+
},
241+
"width": 1200,
242+
"height": 900,
243+
"scene": {
244+
"aspectratio": {
245+
"x": 2,
246+
"y": 1,
247+
"z": 1
248+
},
249+
"xaxis": { "nticks": 10 },
250+
"yaxis": { "nticks": 10 },
251+
"zaxis": { "nticks": 10 },
252+
"camera": {
253+
"eye": {
254+
"x": 1,
255+
"y": 2,
256+
"z": 0.5
257+
}
258+
}
259+
}
260+
}
261+
}

test/jasmine/assets/mock_lists.js

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ var glMockList = [
5858
['gl3d_cone-autorange', require('@mocks/gl3d_cone-autorange.json')],
5959
['gl3d_streamtube-simple', require('@mocks/gl3d_streamtube-simple.json')],
6060
['glpolar_style', require('@mocks/glpolar_style.json')],
61+
['gl3d_isosurface_multiple-traces', require('@mocks/gl3d_isosurface_multiple-traces.json')]
6162
];
6263

6364
var mapboxMockList = [

test/jasmine/tests/isosurface_test.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ describe('Test isosurface', function() {
6666
expect(gd._fullData[0].visible).toBe(exp, msg);
6767
}
6868

69-
it('@gl isosurface should not set `visible: false` for traces with x,y,z,value arrays', function() {
69+
it('isosurface should not set `visible: false` for traces with x,y,z,value arrays', function() {
7070
gd = createIsosurfaceFig();
7171

7272
supplyAllDefaults(gd);
7373
assertVisibility(true, 'to be visible');
7474
});
7575

76-
it('@gl isosurface should set `visible: false` for traces missing x,y,z,value arrays', function() {
76+
it('isosurface should set `visible: false` for traces missing x,y,z,value arrays', function() {
7777
var keysToChange = ['x', 'y', 'z', 'value'];
7878

7979
keysToChange.forEach(function(k) {
@@ -85,7 +85,7 @@ describe('Test isosurface', function() {
8585
});
8686
});
8787

88-
it('@gl isosurface should set `visible: false` for traces with empty x,y,z,value arrays', function() {
88+
it('isosurface should set `visible: false` for traces with empty x,y,z,value arrays', function() {
8989
var keysToChange = ['x', 'y', 'z', 'value'];
9090

9191
keysToChange.forEach(function(k) {
@@ -97,7 +97,7 @@ describe('Test isosurface', function() {
9797
});
9898
});
9999

100-
it('@gl isosurface should be invisible when the vertex arrays are not arrays', function() {
100+
it('isosurface should be invisible when the vertex arrays are not arrays', function() {
101101
var keysToChange = ['x', 'y', 'z', 'value'];
102102
var casesToCheck = [0, 1, true, false, NaN, Infinity, -Infinity, null, undefined, [], {}, '', 'text'];
103103

@@ -112,7 +112,7 @@ describe('Test isosurface', function() {
112112
});
113113
});
114114

115-
it('@gl isosurface should not set `visible: false` when isomin > isomax', function() {
115+
it('isosurface should not set `visible: false` when isomin > isomax', function() {
116116
gd = createIsosurfaceFig();
117117
gd.data[0].isomin = 0.9;
118118
gd.data[0].isomax = 0.1;
@@ -121,7 +121,7 @@ describe('Test isosurface', function() {
121121
assertVisibility(true, 'to be visible');
122122
});
123123

124-
it('@gl isosurface should set `isomin: null` and `isomax: null` when isomin > isomax', function() {
124+
it('isosurface should set `isomin: null` and `isomax: null` when isomin > isomax', function() {
125125
gd = createIsosurfaceFig();
126126
gd.data[0].isomin = 0.9;
127127
gd.data[0].isomax = 0.1;
@@ -131,7 +131,7 @@ describe('Test isosurface', function() {
131131
expect(gd._fullData[0].isomax).toBe(null, 'isomax not set to default');
132132
});
133133

134-
it('@gl isosurface should accept cases where isomin === isomax', function() {
134+
it('isosurface should accept cases where isomin === isomax', function() {
135135
gd = createIsosurfaceFig();
136136
gd.data[0].isomin = 1e-2;
137137
gd.data[0].isomax = 0.01;

0 commit comments

Comments
 (0)