plot icon indicating copy to clipboard operation
plot copied to clipboard

facet wrap

Open mbostock opened this issue 3 years ago • 4 comments

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 avatar May 31 '22 02:05 mbostock

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 avatar May 31 '22 12:05 Fil

lgtm

Fil avatar May 31 '22 12:05 Fil

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.

mbostock avatar May 31 '22 14:05 mbostock

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.

Fil avatar Sep 18 '22 14:09 Fil