Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a facet or facetAnchor: "all" option? #2014

Open
Fil opened this issue Mar 8, 2024 · 1 comment
Open

a facet or facetAnchor: "all" option? #2014

Fil opened this issue Mar 8, 2024 · 1 comment

Comments

@Fil
Copy link
Contributor

Fil commented Mar 8, 2024

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:

(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 Fil changed the title a facet: "all" option? a facet or facetAnchor: "all" option? Mar 8, 2024
@Fil
Copy link
Contributor Author

Fil commented Jun 18, 2024

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 added a commit to observablehq/framework that referenced this issue Jun 18, 2024
allisonhorst added a commit to observablehq/framework that referenced this issue Jun 18, 2024
* update chart colors, add bubble, move reusables to components

* tooltips, chart color updates

* remove displays for troubleshooting

* edits

* save edits

* save changes

* format date in line chart

* reorder seasons in faceted histogram

* move data prep to loader

* minor data loader updates

* update readme and config file

* reorg code and add comments

* Move table prep to Inputs.table options

* line chart tooltip

* tooltip and chart tweaks

* spelling

* Update examples/hotel-bookings/README.md

Co-authored-by: Philippe Rivière <[email protected]>

* Update examples/hotel-bookings/observablehq.config.js

Co-authored-by: Philippe Rivière <[email protected]>

* update DonutChart API

* add to readme, config to match other examples, minor updates to dashboard

* examples readme

* add .webp assets

* remove duplicate input-2d in readme

* updates donut color and config file

* update line chart tip format

* testing text stroke in donuts

* update big number to html from Plot

* clean up donutChart component

* replace bubble grid with faceted bar chart room type

* update webp images to new version

* remove cruft

* no dot

* rename variables

* nicer

* variable color line (reflecting season)

* force the complete facet domain
ref. observablehq/plot#2014

* removes data loader, use static simplified file

* Clean up tooltip labels

* Update examples/hotel-bookings/src/components/donutChart.js

Co-authored-by: Philippe Rivière <[email protected]>

* updated webp thumbnails

* updates README

* resize dark thumbnail

* fix the color line when getting into empty bins.
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

No branches or pull requests

1 participant