Plot.plot({
width: width,
x: {
type: "band",
inset: 10,
ticks: 2,
label: null
},
y: {
grid: false,
fill: "white",
stroke: "white",
label: null
},
facet: {
label: null
},
marginRight: 0,
marginLeft: 70,
symbol: { type: "categorical", legend: true },
marks: [
Plot.axisY({
anchor: "right",
label: null
}),
Plot.axisFy({
anchor: "left"
}),
Plot.frame({
render: (index, scales, values, dimensions, context, next) =>
index.fi % 2 ? next(index, scales, values, dimensions, context) : null,
fill: "rgb(250,250,250)"
}),
Plot.dot(
data,
scalefreeY({
x: "x",
y: "category",
fy: "id",
stroke: "category",
fill: "category",
symbol: "category",
r: 5
})
),
Plot.tip(
data,
Plot.pointer({
x: "x",
y: "category",
fy: "id",
title: (d) => d.tooltip
})
)
]
})