doubleCheck = (
scales,
pl = Plot.dotX(data, { fill: "body_mass", x: "body_mass", r: 9 })
) => {
const plot = pl.plot(scales);
const plot2 = pl.plot({
fx: plot.scale("fx"),
fy: plot.scale("fy"),
x: plot.scale("x"),
y: plot.scale("y"),
color: plot.scale("color"),
r: plot.scale("r"),
opacity: plot.scale("opacity")
});
const plot3 = pl.plot({
fx: plot2.scale("fx"),
fy: plot2.scale("fy"),
x: plot2.scale("x"),
y: plot2.scale("y"),
color: plot2.scale("color"),
r: plot2.scale("r"),
opacity: plot2.scale("opacity")
});
if (plot3.innerHTML != plot.innerHTML)
return Object.assign(
html`<div style="border: solid brown 2px">${plot}${plot2}${plot3}`,
{ scale: plot.scale }
);
if (scales.color) {
scales.color.reverse = !scales.color.reverse;
{
const plot = pl.plot(scales);
const plot2 = pl.plot({
fx: plot.scale("fx"),
fy: plot.scale("fy"),
x: plot.scale("x"),
y: plot.scale("y"),
color: plot.scale("color"),
r: plot.scale("r"),
opacity: plot.scale("opacity")
});
const plot3 = pl.plot({
fx: plot2.scale("fx"),
fy: plot2.scale("fy"),
x: plot2.scale("x"),
y: plot2.scale("y"),
color: plot2.scale("color"),
r: plot2.scale("r"),
opacity: plot2.scale("opacity")
});
if (plot3.innerHTML != plot.innerHTML)
return Object.assign(
html`<div style="border: solid brown 2px">${plot}${plot2}${plot3}<div><em>Error on color {reverse: ${JSON.stringify(
scales.color.reverse
)}}</em>`,
{ scale: plot.scale }
);
}
}
return html`${plot}`;
}