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

facet wrap #892

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

facet wrap #892

wants to merge 2 commits into from

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented May 31, 2022

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
Copy link
Contributor

Fil commented May 31, 2022

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
Copy link
Contributor

Fil commented May 31, 2022

lgtm

@mbostock
Copy link
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
Copy link
Contributor

Fil commented Sep 18, 2022

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.

@mbostock mbostock mentioned this pull request Dec 2, 2022
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