observablehq / observablehq/plot
An implicit group transform for z-less areas?
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 5.4k
- Forks
- 244
- PR merge metrics
- No merged PRs in 30d
Description
The areaY mark gets an implicit stack transform that works well when there’s a z channel:
Plot.areaY(industries, {x: "date", y: "unemployed", z: "industry"}).plot()
But when there isn’t a z channel, stacking doesn’t really help, because you’re still drawing a single shape for the entire dataset, resulting in zigzags:
Plot.areaY(industries, {x: "date", y: "unemployed"}).plot()
This is a little more visible when drawing a line:
Plot.lineY(industries, {x: "date", y: "unemployed"}).plot()
If you want to draw a single shape, you need the group transform:
Plot.areaY(industries, Plot.groupX({y: "sum"}, {x: "date", y: "unemployed"})).plot()
Maybe areaX and areaY could apply a group transform by default (using groupY and groupX respectively) when no fill, stroke, or z channel is present?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the areaY and areaX mark behavior with the existing Plot.groupX and Plot.groupY examples in the issue. Determine how the absence of fill, stroke, and z should affect the implicit transform, then verify the area and line examples produce a single shape without changing grouped cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- d3, javascript
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100