Plot.barY(data, Plot.binX({ y: "count" }, {
x: "date",
thresholds: d3.timeMonth.every(3),
fill: d => d["Board Disposition"].includes("Substantiated")
})).plot({
facet: {
data: data,
y: "Unique Id",
marginRight: 100
},
fy: {
domain: TopN(data, { groupby: "Unique Id", order: "count", n: 10 }),
tickFormat: d => officerUniqueIds.get(d),
},
x: { tickRotate: 90 },
color: { scheme: "reds" },
marginLeft: 50,
marginRight: 100,
marginBottom: 120,
width,
grid: true
})