plot icon indicating copy to clipboard operation
plot copied to clipboard

a facet or facetAnchor: "all" option?

Open Fil opened this issue 1 year ago • 1 comments

In this Plot: facetAnchor

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")

Fil avatar Mar 08 '24 04:03 Fil

Same issue when you specify the facet domain, and want the frame (for example) to appear on all the facets irrespective of there being data in that facet.

Fil avatar Jun 18 '24 14:06 Fil