Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7839661

Browse files
committed
Fix scatter corner cases
1 parent e78ed04 commit 7839661

File tree

3 files changed

+30
-6
lines changed

3 files changed

+30
-6
lines changed

src/traces/scatter/plot.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
204204

205205
// initialize line join data / method
206206
var segments = [],
207-
lineSegments = [],
208207
makeUpdate = Lib.noop;
209208

210209
ownFillEl3 = trace._ownFill;
@@ -270,10 +269,6 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
270269
pt1 = lastSegment[lastSegment.length - 1];
271270
}
272271

273-
lineSegments = segments.filter(function(s) {
274-
return s.length > 1;
275-
});
276-
277272
makeUpdate = function(isEnter) {
278273
return function(pts) {
279274
thispath = pathfn(pts);
@@ -312,7 +307,7 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
312307
};
313308
}
314309

315-
var lineJoin = tr.selectAll('.js-line').data(lineSegments);
310+
var lineJoin = tr.selectAll('.js-line').data(segments);
316311

317312
transition(lineJoin.exit())
318313
.style('opacity', 0)
23.5 KB
Loading
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"data": [
3+
{
4+
"x": [1.5],
5+
"y": [1.75],
6+
"fill": "tozeroy"
7+
},
8+
{
9+
"x": [0, 1, 2, 3],
10+
"y": [1.5, null, 1.5, 1.5],
11+
"fill": "tozeroy"
12+
},
13+
{
14+
"x": [0, 1, 1.5, 2, 2.5, 3],
15+
"y": [1.25, 1.25, null, 1.35, null, 1.25, 1.25],
16+
"fill": "tozeroy"
17+
},
18+
{
19+
"x": [0, 1, 2, 3],
20+
"y": [1.0, 1.1, null, 1.0],
21+
"fill": "tozeroy"
22+
},
23+
{
24+
"x": [0, 1.5, 3],
25+
"y": [0.75, null, 0.75],
26+
"fill": "tozeroy"
27+
}
28+
]
29+
}

0 commit comments

Comments
 (0)