Skip to content

facet wrap - #892

Draft
mbostock wants to merge 2 commits into
mainfrom
mbostock/facet-wrap
Draft

mbostock wants to merge 2 commits into
mainfrom
mbostock/facet-wrap

Conversation

@mbostock

@mbostock mbostock commented May 31, 2022

Copy link
Copy Markdown
Member

Fixes #277.

Rebased #332 against main. Also avoided changing the exposed value of the fx and fy scales, though it still feels awkward to me. Like, when you turn on facet wrapping, you still want to specify fy options potentially, even though there isn’t really an fy scale…

@mbostock
mbostock requested a review from Fil May 31, 2022 02:47
- better text placement with frameAnchor
@Fil

Fil commented May 31, 2022

Copy link
Copy Markdown
Contributor

Thank you! Yes it's hard to decide if this should be represented externally by 1 scale (or projection: facet name to 2-d position), 2 scales (facet name to x, facet name to y), or three scales (facet name to rank, rank to x, rank to y). The main question is reusability (using the scales from one chart in another chart). I guess if we can only salvage the domain it should be fine?

@Fil Fil mentioned this pull request May 31, 2022
3 tasks
@Fil

Fil commented May 31, 2022

Copy link
Copy Markdown
Contributor

lgtm

@mbostock

Copy link
Copy Markdown
Member Author

2 scales (facet name to x, facet name to y)

Actually, that’s a thought. Maybe two scales fx and fy makes the most sense here. But I’d have two requirements:

  1. Both fx and fy should have the same domain (like fx does now in the working example).
  2. Neither fx nor fy is invertible (because they map multiple values to the same position).

This sort of scale would not be expressible as a band scale but would be expressible as an ordinal scale.

I still don’t know how this would be “round-trippable” as fx and fy scales though. This definitely isn’t ready to merge—there are some conceptual things to work out first about the meaning of the facet scales and where you can set options.

@Fil

Fil commented Sep 18, 2022

Copy link
Copy Markdown
Contributor

Note to self: another option would be to substitute the logic in facetTranslate(kx). There would be only one kx, but fx (or fxy) would affect both coordinates of the translate.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

Facet wrapping

2 participants