-
I have a dataset that I would like to represent in a waffle-mark like way, but I would like each dot (or waffle "cell") to represent an individual datapoint, rather than a unit of a quantity. I think the solution would be to combine the dot mark with transforms or offsets to stack the dots in rows and columns to mimic the way that the waffle mark creates a grid. The motivation is so the user can interact with each datapoint. In the screenshot below, the user is only able to interact with the area of the waffle mark that represents each group of datapoints and not the individual datapoints themselves. I can see how I could use a Any suggestions greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
I have made some progress. The following gives me an arrangement of dot marks in a waffle-like grid, Plot.plot({
aspectRatio: 1,
marginLeft: 30,
inset: 10,
x: { axis: null },
y: {},
marks: [
Plot.dot(
data,
Plot.stackY2({
x: (d) => data.indexOf(d) % 50,
y: (d) => 1,
fill: "#ccc",
r: 5
})
)
]
}) |
Beta Was this translation helpful? Give feedback.
@Fil thanks
I have currently solved my tick mark issue with
tickFormat: (t) => (t - 1) * 50
. Your suggestion could also work, but I would also need to also adjust theaspectRatio
to1/50
.