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
The area mark supports curve options to control interpolation between points. If any of the x1, y1, x2, or y2 values are invalid (undefined, null, or NaN), the baseline and topline will be interrupted, resulting in a break that divides the area shape into multiple segments. (See d3-shape’s area.defined for more.) 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 cardinal-open only render a visible segment if it contains multiple points.
Expected behavior
If my plot contains gaps which creates single points, I don't need to do anything else but define the mark option strokeLinecap: 'square' so that I still see an area rendered at this data point.
The documentation here is wrong because it was copied from the line mark; an area has no fill by default so setting the strokeLinecap has no effect by default. You need to set a stroke if you want a single-point area to be visible.
Describing the bug
As the title implies either I didn't understand the docs for this use case or there is a bug:
Excerpt from the API docs on area marks:
Expected behavior
If my plot contains gaps which creates single points, I don't need to do anything else but define the mark option
strokeLinecap: 'square'
so that I still see an area rendered at this data point.Steps how to reproduce
Here is my minimal working example in an Observable notebook
This is what it looks like at this point in time:
Only after adding styles to the area (SVG <path> Element) do I see the area for a single point. Is this the desired method?
The text was updated successfully, but these errors were encountered: