first tentative for a layouts option#691
Conversation
two layouts are available: - "darker" changes the fill channel - "collide" collides the x/y/r channels The layouts can be given as a function, which receives the *scaled* values, and returns a function of (index, dimensions), which is called for each facet. You can pass several layouts which will be called one after the other. (Very rough: no error checking, mutation of the values arrays… no options…)
mbostock
left a comment
There was a problem hiding this comment.
Quick thoughts:
-
I think we could get by with just a single mark.layout, rather than an array of layouts, and have layouts be responsible for composing (as we do with transforms).
-
I don’t think we’ll want named layouts because I expect that layouts will almost always want accompanying options.
-
I’d guess that the user would apply layouts the same way they apply transforms today, e.g.
Plot.dot(data, Plot.collide({…})), allowing layout options and assigning the layout option. While it would also be possible to set the layout option directly (again, as you can do with a transform), I think this is rare; by wrapping instead we can compose layouts and potentially a layout can change behavior based on shared options.
Yeah, I think we should only consider synchronous layouts to start. |
|
superseded by #648 |
two layouts are available:
The layouts can be given as a function, which receives the scaled values, and returns a function of (index, dimensions), which is called for each facet. You can pass several layouts which will be called one after the other.
(Very rough: no error checking, mutation of the values arrays… no options…)
testing: https://observablehq.com/@fil/plot-layouts-initial-tests
issues/questions: