Skip to content

Commit f23f84c

Browse files
authored
Merge pull request #3171 from plotly/issue-704_fetch-master
Finalist - Fix to remove webgl warnings resulted from blank texts in scatter3d
2 parents aea6b8d + 513461a commit f23f84c

File tree

5 files changed

+96
-8
lines changed

5 files changed

+96
-8
lines changed

package-lock.json

+14-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"d3-force": "^1.0.6",
6969
"delaunay-triangulate": "^1.1.6",
7070
"es6-promise": "^3.0.2",
71-
"fast-isnumeric": "^1.1.1",
71+
"fast-isnumeric": "^1.1.2",
7272
"font-atlas-sdf": "^1.3.3",
7373
"gl-cone3d": "^1.2.0",
7474
"gl-contour2d": "^1.1.4",
@@ -80,7 +80,7 @@
8080
"gl-plot2d": "^1.3.1",
8181
"gl-plot3d": "^1.5.10",
8282
"gl-pointcloud2d": "^1.0.1",
83-
"gl-scatter3d": "^1.0.12",
83+
"gl-scatter3d": "^1.0.13",
8484
"gl-select-box": "^1.0.2",
8585
"gl-spikes2d": "^1.0.1",
8686
"gl-streamtube3d": "^1.1.0",
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"data": [
3+
{
4+
"x": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],
5+
"y": [0,0,0,0,0,0,0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
6+
"z": [0,1,0,2,0,3,0,4,0,5,0, 6, 0, 7, 0, 8, 0, 9, 0, 10],
7+
8+
"type": "scatter3d",
9+
"mode":"lines+text",
10+
"line":{ "width": 5 }
11+
},
12+
{
13+
"x": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],
14+
"y": [1,1,1,1,1,1,1,1,1,1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
15+
"z": [0,1,0,2,0,3,0,4,0,5,0, 6, 0, 7, 0, 8, 0, 9, 0, 10],
16+
17+
"text": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],
18+
19+
"type": "scatter3d",
20+
"mode":"lines+text",
21+
"line":{ "width": 5 }
22+
},
23+
{
24+
"x": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],
25+
"y": [2,2,2,2,2,2,2,2,2,2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
26+
"z": [0,1,0,2,0,3,0,4,0,5,0, 6, 0, 7, 0, 8, 0, 9, 0, 10],
27+
28+
"text": [0,1e-3,0.1,"A","B","C","D","E","F","G",null,"I",null,"K","L","M","N",{"text":"X", "value":10.01},"Y","Zzz"],
29+
30+
"type": "scatter3d",
31+
"mode":"lines+text",
32+
"line":{ "width": 5 }
33+
},
34+
{
35+
"x": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],
36+
"y": [3,3,3,3,3,3,3,3,3,3,3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
37+
"z": [0,1,0,2,0,3,0,4,0,5,0, 6, 0, 7, 0, 8, 0, 9, 0, 10],
38+
39+
"text": [0,0.0,-0,-0.0,"","0"," ","E","\n","G",null,"I",null,"K",null,null,null,"X"],
40+
41+
"type": "scatter3d",
42+
"mode":"lines+text",
43+
"line":{ "width": 5 }
44+
}
45+
46+
],
47+
"layout": {
48+
"title":"scatter3d lines with good/bad/no input texts (including undefined, null & blank variations) should be displayed well on WEBGL",
49+
"width": 1200,
50+
"height": 900,
51+
"scene":{
52+
"camera":{
53+
"eye":{"x":-1.25,"y":1.25,"z":1.25},
54+
"center":{"x":0,"y":0,"z":0},
55+
"up":{"x":0,"y":0,"z":1}
56+
}
57+
}
58+
}
59+
}

test/jasmine/tests/gl3d_plot_interact_test.js

+21
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,27 @@ describe('Test gl3d plots', function() {
510510
.then(done);
511511
});
512512

513+
514+
it('@gl should avoid passing blank texts to webgl', function(done) {
515+
function assertIsFilled(msg) {
516+
var fullLayout = gd._fullLayout;
517+
expect(fullLayout.scene._scene.glplot.objects[0].glyphBuffer.length).not.toBe(0, msg);
518+
}
519+
520+
Plotly.plot(gd, [{
521+
type: 'scatter3d',
522+
mode: 'text',
523+
x: [1, 2, 3],
524+
y: [2, 3, 1],
525+
z: [3, 1, 2]
526+
}])
527+
.then(function() {
528+
assertIsFilled('not to be empty text');
529+
})
530+
.catch(failTest)
531+
.then(done);
532+
});
533+
513534
});
514535

515536
describe('Test gl3d modebar handlers', function() {

0 commit comments

Comments
 (0)