Plot.dot(
cars,
Plot.map(
{
fill: Plot.normalize("deviation")
},
{
x: "economy (mpg)",
y: "weight (lb)",
fill: "power (hp)",
z: null,
tip: true,
channels: Object.fromEntries(
aspects.map((key) => {
const V = Plot.valueof(cars, key);
const M = d3.mean(V);
const D = d3.deviation(V);
return [key, { value: V.map((d) => (d - M) / D), scale: "color" }];
})
)
}
)
).plot({
color: {
domain: [-2, 2],
scheme: "RdYlBu",
label: null
}
})