-
Notifications
You must be signed in to change notification settings - Fork 173
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 wrapping #277
Labels
enhancement
New feature or request
Comments
Fil
added a commit
that referenced
this issue
Apr 2, 2021
We still have to struggle a bit to remove the automatic (and now meaningless) facet labels, and position our own facet labels in each frame.
Fil
added a commit
that referenced
this issue
Apr 13, 2021
We still have to struggle a bit to remove the automatic (and now meaningless) facet labels, and position our own facet labels in each frame.
Closed
Draft
I almost wonder if this should be an fz channel, since it uses both x and y? Hm… but I guess it still has a directional bias because it either goes left-right before wrapping or top-down before wrapping. |
Here is a new example. https://observablehq.com/@observablehq/plot-facet-wrap Plot.plot((() => {
const n = 3; // number of facet columns
const keys = Array.from(d3.union(industries.map((d) => d.industry)));
const index = new Map(keys.map((key, i) => [key, i]));
const fx = (key) => index.get(key) % n;
const fy = (key) => Math.floor(index.get(key) / n);
return {
height: 300,
axis: null,
y: {insetTop: 10},
fx: {padding: 0.03},
marks: [
Plot.areaY(industries, Plot.normalizeY("extent", {
x: "date",
y: "unemployed",
fx: (d) => fx(d.industry),
fy: (d) => fy(d.industry)
})),
Plot.text(keys, {fx, fy, frameAnchor: "top-left", dx: 6, dy: 6}),
Plot.frame()
]
};
})()) |
i'd really appreciate if the wrap columns could adjust based on the width of the viewport |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We can create a grid facet with:
where f returns an integer, maybe
d => groups.indexOf(d.group)
.Can we make it easier to compute the gridded facet, and to draw its mark)? (In this case we can't use fx/fy for the facet ticks, and also need a way to draw the facet's tick inside or below the frame at a fixed point.)
Examples:
https://observablehq.com/d/61ca1967e419b882
https://observablehq.com/@data-workflows/geofacet & #101
The text was updated successfully, but these errors were encountered: