Skip to content

Shorthand syntax for d3.piecewise #1636

Closed
@Fil

Description

@Fil

as discussed in #1633 it would be nice to provide a shorthand syntax for piecewise/polylinear scales with a simple domain [min, max].

Instead of

  type: "log",
   domain: [1, 5, 21, 100],
   range: ["#d3e7fa", "#5784c5", "#fc004b", "#ffec44"],

or

    type: "log",
    domain: [1, 100],
    interpolate: d3.piecewise(["#d3e7fa", "#5784c5", "#fc004b", "#ffec44"]),

you would then just say

    type: "log",
    domain: [1, 100],
    range: ["#d3e7fa", "#5784c5", "#fc004b", "#ffec44"],
    something: something

something could be interpolate: "piecewise", maybe?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions