Skip to content

Commit 045a162

Browse files
committed
fix fill ordering
- regl-line2d "skips" over "undefined"s, not "null"s
1 parent ee17d2e commit 045a162

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

src/traces/scattergl/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ function plot(gd, subplot, cdata) {
431431
if(scene.fill2d) {
432432
scene.fillOptions = scene.fillOptions.map(function(fillOptions, i) {
433433
var cdscatter = cdata[i];
434-
if(!fillOptions || !cdscatter || !cdscatter[0] || !cdscatter[0].trace) return null;
434+
if(!fillOptions || !cdscatter || !cdscatter[0] || !cdscatter[0].trace) return;
435435
var cd = cdscatter[0];
436436
var trace = cd.trace;
437437
var stash = cd.t;
27.6 KB
Loading
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"data": [
3+
{
4+
"x": [1, 2, 3, 4, 5, 6],
5+
"y": [100, 100, 0, 0, 0, 0],
6+
"fill": "tozeroy",
7+
"type": "scattergl"
8+
},
9+
{
10+
"x": [1, 2, 3, 4, 5, 6],
11+
"y": [0, 0, 0, 100, 100, 0],
12+
"fill": "tozeroy",
13+
"type": "scattergl",
14+
"mode": "none"
15+
},
16+
{
17+
"x": [1, 2, 3, 4, 5, 6],
18+
"y": [99, 99, 99, 100, 100, 100],
19+
"type": "scattergl",
20+
"mode": "lines+markers"
21+
},
22+
{
23+
"x": [1, 2, 3, 4, 5, 6],
24+
"y": [0, 0, 0, null, 50, 50],
25+
"fill": "tozeroy",
26+
"type": "scattergl",
27+
"mode": "none"
28+
},
29+
{
30+
"x": [1, 2, 3, 4, 5, 6],
31+
"y": [100, 0, 0, 0, 0, 100],
32+
"type": "scattergl",
33+
"mode": "lines+markers"
34+
}
35+
],
36+
"layout": {
37+
"margin": {"l": 40, "r": 50, "b": 80, "t": 40},
38+
"legend": {"orientation": "h", "x": "0.5", "xanchor": "center"}
39+
}
40+
}

0 commit comments

Comments
 (0)