Conversation
| .call(applyDirectStyles, this) | ||
| .call(applyGroupedChannelStyles, this, channels) | ||
| .attr("fill", "none") | ||
| .attr("transform", offset ? `translate(${offset},${offset})` : null) |
There was a problem hiding this comment.
It is a bit unfortunate that we have to care for offset here; reason is that the area mark doesn't have an offset, but the line mark has one.
| reduce: sum, | ||
| curve: "step" | ||
| }), | ||
| Plot.areaY(data, {x: "date", y: "value", interval: "day", curve: "step", fill: "#f2f2fe", line: true}), |
There was a problem hiding this comment.
this is even further simplification from #2389
There was a problem hiding this comment.
I like the feature, but it needs a little more work.
I’d like it to work “out of the box” if you add line: true to an area. Right now you also need to set fillOpacity: 0.3 or set fill to a different color than stroke (since both default to currentColor). Probably defaulting fillOpacity to 0.3 if line is true is simplest.
It makes sense that stroke is disabled on the area path when using the line option, but probably other stroke-related attributes should also not be set on the area path. (See “Some marks don’t support stroke (e.g., image)” in style.js.) Ideally we’d avoid setting these attributes, rather than setting them and then immediately setting them back to none.
It also makes sense that we don’t support projections here (auto curve; see the line mark). But what about applyGroupedMarkers? Should we accept marker options if you set the line option? Or maybe in all cases (but just shift the markers to the line if you set the line option)? Are there any other inconsistencies with the line mark implementation here?
|
I've started work on your review comments here #2405. More later. |
Adding a line option to the area mark makes it quite a bit more convenient to use than the areaY + lineY combo.
closes #1866 (line option on the area mark)
closes #2111 (The ridgeline plot example doesn’t handle overlapping correctly)
will need to update https://observablehq.com/@observablehq/plot-ridgeline
needs (and rebased on) #2390 (stack invalid values as NaN)