Plot.plot({
axis: null,
x: {
axis: "bottom",
labelAnchor: "center"
},
marks: [
Plot.barX(dt, {
y: "label",
x: "value",
fill: (d) => d.value > 0,
sort: { y: "x" }
}),
d3
.groups(dt, (d) => d.value > 0)
.map(([posneg, dat]) => [
Plot.axisY({
x: 0,
ticks: dat.map((d) => d.label),
tickSize: 0,
anchor: posneg ? "left" : "right"
}),
]),
]}
)