{
now;
updateCars();
const runningPlot = Plot.plot({
x: { nice: true, domain: [-1.1, 1.1] },
y: { nice: true, domain: [-1.1, 1.1] },
color: {
legend: true,
domain: [0, 1.0],
nice: true
},
aspectRatio: 1.0,
grid: true,
marks: [
Plot.frame(),
Plot.dot(cars, { x: "x", y: "y", fill: "speedInAng", r: 10 }),
Plot.text(cars, { x: "x", y: "y", text: "idx" }),
Plot.text(cars, { x: "x", y: "y", text: "speedInAng", dx: 10, dy: 10 })
]
});
const boxPlot = Plot.plot({
x: { nice: true },
y: { nice: true, domain: [0, 1.0] },
color: {
legend: true,
domain: [0, 1.0]
},
grid: true,
marks: [
Plot.frame(),
Plot.barY(cars, { x: "idx", y: "speedInAng", fill: "speedInAng" }),
Plot.ruleY([d3.mean(cars, (d) => d.speedInAng)])
]
});
return htl.html`
<div style="display: flex">
${runningPlot}
${boxPlot}
</div>
`;
}