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

Skip to content
This repository was archived by the owner on Oct 6, 2022. It is now read-only.

Commit c74a012

Browse files
committed
Don't filter single-point first/last line segments from path
1 parent 7839661 commit c74a012

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/traces/scatter/plot.js

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

205205
// initialize line join data / method
206206
var segments = [],
207+
lineSegments = [],
207208
makeUpdate = Lib.noop;
208209

209210
ownFillEl3 = trace._ownFill;
@@ -269,6 +270,10 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
269270
pt1 = lastSegment[lastSegment.length - 1];
270271
}
271272

273+
lineSegments = segments.filter(function(s, i) {
274+
return s.length > 1 || i === segments.length - 1 || i === 0;
275+
});
276+
272277
makeUpdate = function(isEnter) {
273278
return function(pts) {
274279
thispath = pathfn(pts);
@@ -307,7 +312,7 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
307312
};
308313
}
309314

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

312317
transition(lineJoin.exit())
313318
.style('opacity', 0)
-292 Bytes
Loading

0 commit comments

Comments
 (0)