Plot.plot({
marginLeft: "100",
height: 600,
width: width * 1,
x: {
tickFormat: (d) => "" + d
},
y: {
domain:
ordering !== "good ordering"
? states
: [...states].sort(
(a, b) =>
linear_us_state_order.indexOf(b) -
linear_us_state_order.indexOf(a)
)
},
marks: [
Plot.cell(reparse(datum.find((d) => d.title == disease).data.values.data), {
x: "year",
y: "state",
fill: "rate",
height: "3px"
}),
Plot.tip(
reparse(datum.find((d) => d.title == disease).data.values.data),
Plot.pointerX({ x: "year", y: "state" })
)
]
})