Facet with varying scales?
Currently faceting repeats scales. What if you want a scale that varies by facet, as in a SPLOM?
Related #149.
It would be great if this could be implemented. It's common to have a categorical scale where not all categories appear in all facets, so you want to hide the unused categories in some facets to save space.
Similarly would be nice to allow a projection to have a different domain for each facet.
related #501
Here's an initializer that rescales y on every facet. It doesn't really have access to the scale’s type yet, but it's a great use case to have the scale’s definition passed in properly here too (in #1263).
scalefreeY = (options) =>
Plot.initializer(options, (data, facets, channels, scales, dimensions) => {
const {y: { value: Y, scale }} = channels;
for (const index of facets) {
const y = d3.scalePoint(d3.sort(Array.from(index, (i) => Y[i])), [
dimensions.marginTop,
dimensions.height - dimensions.marginBottom
])
.padding(0.5);
for (const i of index) Y[i] = y(Y[i]);
}
return { data, facets, channels: { y: { value: Y } } };
})
suggested by @mayagans
This feature would be very helpful!
Please click the 👍 on the top post if you’re interested in this feature. +1 replies are not (explicitly) counted and generate noise for people who are subscribed to this issue. Thank you!