You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Empty line segments not displayed in d3.svg.line. #2061
This causes d3.svg.line to use "z" for empty segments, producing a zero-length line, rather than a bare "M" command which draws nothing. This is probably the right fix, although perhaps not the optimal one.
But this fix would still require you to use stroke-linecap: round or stroke-linecap: square, and the dots would still be pretty small (dependent on the stroke-width). You might consider rendering each data point explicitly, say as circles on top of the line, so that you have more control over how they are displayed.
Activity
mbostock commentedon Oct 17, 2014
This is probably a bug (and I don’t think we’d need a new API to fix it). One simple fix is to patch this code in svg/line.js:
This causes d3.svg.line to use "z" for empty segments, producing a zero-length line, rather than a bare "M" command which draws nothing. This is probably the right fix, although perhaps not the optimal one.
But this fix would still require you to use stroke-linecap: round or stroke-linecap: square, and the dots would still be pretty small (dependent on the stroke-width). You might consider rendering each data point explicitly, say as circles on top of the line, so that you have more control over how they are displayed.
[-]Single points not being displayed in path[/-][+]Empty line segments not displayed in d3.svg.line.[/+]jasondavies commentedon Oct 17, 2014
Sounds reasonable.
mbostock commentedon Nov 13, 2014
A workaround for the time-being:
Render line segments with a single point.
mbostock commentedon Nov 9, 2015
Fix staged in #2591 for 3.5.7.
mbostock commentedon Nov 9, 2015
http://bl.ocks.org/mbostock/bbbe5171af94cc4b18c1