joy = Plot.plot({
marks: profiles.map((record) => {
const [lineId, arr] = record;
const line = arr.map(d => d.Z > 100 ? 0 : d.Z);
const index = lineId * 20;
const dx = index / 8;
const dy = -50 + index / 4;
return [
Plot.barY(line, {
x: (d, i) => i,
dx,
dy,
fill: (d) => d,
fillOpacity: 0.3,
}),
Plot.lineY(line, {
dx,
dy,
strokeWidth: 0.75,
curve: "step",
})
];
}),
x: { axis: null },
y: { axis: null },
marginTop: 50,
marginBottom: 200,
marginRight: 150,
width: 1000,
height: 300,
color: {
scheme: "warm",
type: "diverging",
legend: true,
label: "Sea Surface Temperature Anomaly (°C)"
},
})