d3 / d3-shape

Graphical primitives for visualization, such as lines and areas.
https://d3js.org/d3-shape
ISC License
2.47k stars 305 forks source link

Area and Line not showing when there is a single value #138

Closed nitely closed 5 years ago

nitely commented 5 years ago

The area (same for line) is not draw when there is a single value or when there are null values around the value and there is a defined(...) (i.e with missing data). This is important when only area/line are draw without a dot, since nothing will be displayed.

I would expect a single 1px vertical line to be draw.

Example https://bl.ocks.org/nitely/dbccca96bfca68447582ee08de665b61

Edit: I just found it's the same when there are two or more values that are too close together, so I guess the area is just too thin to get draw. I wonder if there is a work around this, to make it of at least 1px.

nitely commented 5 years ago

Note that if an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points.