observablehq / observablehq/plot
An easier facet frame label?
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- HTML
- Stars
- 5.4k
- Forks
- 244
- PR merge metrics
- No merged PRs in 30d
Description
It’d be nice when faceting to have an easier way to label the facet. I find myself using the selectFirst transform for this, but I think a singleton mark like the frame mark would be easier to use.
Plot.plot({
height: 720,
axis: null,
marks: [
Plot.areaY(industries, {x: "date", y: "unemployed", fy: "industry"}),
Plot.text(industries, Plot.selectFirst({text: "industry", fy: "industry", frameAnchor: "top-left", dx: 6, dy: 6})),
Plot.frame()
]
})
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 reading the Plot.plot example and the existing Plot.selectFirst and Plot.frame entry points shown in the issue; no source file or test is named. Define how a singleton mark would provide an easier facet label while retaining the demonstrated faceting and frame-anchor behavior, then verify the example works as intended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100