Plot.plot({
color: { legend: true },
marginLeft: 50,
marks: [
Plot.barX(items, {
filter: f => brands.includes(f.brand),
tip: true,
title: "name",
order: "category",
x: "revenue",
y: d => d.category === "Apparel" ? "Apparel" : "Other",
fill: "category",
opacity: (d) =>
d.name.toLowerCase().includes(hlt.toLowerCase()) ? 1 : 0.4,
sort: { y: "x", reverse: true, limit: numItems }
}),
Plot.ruleX([0])
]
})