observablehq / observablehq/plot
a facet or facetAnchor: "all" option?
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 5.4k
- Forks
- 244
- PR merge metrics
- No merged PRs in 30d
Description
In this Plot:
Plot.plot({
marginLeft: 60,
marks: [
Plot.frame({ fill: "silver" }),
Plot.barX(data, { x: "Cantidad", fx: "type", fy: "p28" })
]
})
we would like the silver frame to be present on all facets, including the empty ones (represented with an orange stroke). Should we add a facet: "all" or facetAnchor: "all" option?
(The orange stroke was added with Plot.frame({ stroke: "orange", facetAnchor: "empty" })).
The chart can be fixed currently by duplicating the mark:
[Plot.frame({ fill: "silver" }), Plot.frame({ fill: "silver",facetAnchor: "empty" })],
but it shows that something is missing.
Test & data: https://observablehq.com/d/faf63a6fe3950d75
(Feature request suggested by @rusosnith)
relevant links in the documentation:
- https://observablehq.com/plot/features/facets#mark-facet-options
- https://observablehq.com/plot/marks/axis
(there is a small error on the axis page, where it says "null - show on every facet" it should say "null - show on every non-empty facet")
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 with the facet mark options documentation and the linked Observable test and data to understand how empty facets and facetAnchor are currently handled. Compare the requested all-facet frame behavior with the existing duplicated-mark workaround, and update the relevant documentation example and tests so completion demonstrates the frame on both non-empty and empty facets.
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