Plot.plot((() => {
const n = 1;
const keys = Array.from(d3.union(chine_bourse.map((d) => d.Name)));
const index = new Map(keys.map((key, i) => [key, i]));
const fx = (key) => index.get(key) % n;
const fy = (key) => Math.floor(index.get(key) / n);
return {
height: 200,
axis: null,
grid:false,
y: {insetTop: 10},
fx: {padding: 0.50},
marks: [
Plot.lineY(chine_bourse, Plot.normalizeY("extent" , {
x: "Date",
y: "Close",
fx: (d) => fx(d.Name),
fy: (d) => fy(d.Name)
})),
Plot.text(keys, {fx, fy, frameAnchor: "top-left", dx: -120, dy: 6}),
Plot.frame()
]
};
})())