call the layout once with all the frame indices#712
Conversation
test the dodge layout with a channel r
note: the custom layout example will change a little if we do #712
|
As you point out, there is a cost to doing this: an increase in the complexity of every layout. Therefore we should be confident that the added expressiveness (or performance) is worth the added complexity. In the case of transforms, we knew that transforms had to be facet-aware e.g. so that the same set of bins would be used across facets. It is not clear to me that the same is true of layouts: none of the current or proposed layouts appear to require knowledge of facets. Also it is not clear that the performance cost of the current approach is appreciable. Even if we want facet-aware layouts in the future, it seems likely that non-facet-aware layouts will be the common case. I expect we could design a mechanism to opt-in to (more complex) facet-aware layouts, while being backwards-compatible for non-facet-aware layouts, letting most layouts remain simple |
implements my comment #648 (comment)
The layout is called once, with an index that is an array of arrays, one for each facet.
this addresses two concerns:
the cost is a slightly more complex function to write, because it needs to iterate on the arrays in index; but this is consistent with what we do in transforms.