Skip to content

area line option#2133

Open
Fil wants to merge 7 commits intofil/stack-nanfrom
fil/area-line
Open

area line option#2133
Fil wants to merge 7 commits intofil/stack-nanfrom
fil/area-line

Conversation

@Fil
Copy link
Contributor

@Fil Fil commented Aug 12, 2024

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)

fy: "location",
curve: "basis",
sort: "date",
fill: "color-mix(in oklab, var(--plot-background), currentColor 20%)",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #2006

@Fil Fil changed the base branch from main to fil/stack-nan March 19, 2026 13:04
.call(applyDirectStyles, this)
.call(applyGroupedChannelStyles, this, channels)
.attr("fill", "none")
.attr("transform", offset ? `translate(${offset},${offset})` : null)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is even further simplification from #2389

@Fil Fil requested a review from mbostock March 19, 2026 13:14
@Fil Fil marked this pull request as ready for review March 19, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The ridgeline plot example doesn’t handle overlapping correctly Add a line option to the area mark

1 participant