Plot.plot({
width: 520,
height: 260,
x: {type: "band"},
y: {type: "band"},
marks: [
Plot.frame(),
Plot.cell(
d3.cross([-1, 0, 1, 2, 3, 4, 5], [0, 1, 2, 3, 4]).map(([a, b]) => ({a, b})),
{
x: "a",
y: "b",
render: (index, {x, y}, { x: X, y: Y, channels: { x: {value: a}, y: {value: b} } }) =>
d3.create("svg:g")
.call((g) => g.selectAll()
.data(index)
.join("g")
.attr("transform", (i) => `translate(${X[i]},${Y[i]})`)
.append((i) => subPlot(a[i], b[i], x.bandwidth(), y.bandwidth()))
)
.node()
}
)
]
})