Skip to content

Plot.scale(…) ignores the transform option #2325

@mbostock

Description

@mbostock

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn’t working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions