plot icon indicating copy to clipboard operation
plot copied to clipboard

Plot.scale(…) ignores the transform option

Open mbostock opened this issue 9 months ago • 0 comments

E.g., the transform option is ignored here:

Plot.scale({
  color: {
    domain: d3.range(9),
    range: scheme,
    transform: ([a, b]) => 3 * a + b,
    unknown: "#ccc"
  }
})

This produces a different result than:

Plot.plot({
  color: {
    domain: d3.range(9),
    range: scheme,
    transform: ([a, b]) => 3 * a + b,
    unknown: "#ccc"
  }
}).scale("color")

Ref. https://observablehq.com/@observablehq/plot-bivariate-choropleth

mbostock avatar May 23 '25 03:05 mbostock