Plot.plot({
height: 100,
x: {percent: true},
marks: [
Plot.barX(
olympians,
Plot.stackX(
{order: "x", reverse: true},
Plot.groupZ(
{x: "proportion"},
{z: "sport", fillOpacity: 0.2, inset: 0.5}
)
)
),
Plot.text(
olympians,
Plot.filter(
(D) => D.length > 200,
Plot.stackX(
{order: "x", reverse: true},
Plot.groupZ(
{x: "proportion", text: "first"},
{z: "sport", text: "sport", rotate: 90}
)
)
)
),
Plot.ruleX([0, 1])
]
})