Plot.plot({
x: {
axis: null,
label: null,
padding: .12,
inset: 15
},
y: {
grid: true,
tickFormat: "s"
},
color: {
legend: true,
domain: crimea.cause,
},
fx: {
domain: d3.groupSort(crimea, v => d3.sum(v, d => -d.deaths), d => d.date).slice(0, 16),
label: null,
tickSize: 6,
tickFormat: d => d.toLocaleString("en", {month: "narrow"}),
padding: 0,
align: 0,
paddingOuter: .4,
tickPadding: 6,
},
facet: {
data: crimea,
x: "date",
label: null,
},
marks: [
Plot.barY(crimea, {x: "cause", y: "deaths", fill: "cause", title: d => d.cause + ": " + d.deaths}),
Plot.ruleY([0])
]
})