Changes for version 0.23 - 2026-10-17

  • Enhancements
    • The chart snippets inline each categorical scheme's colours as a literal hex array, taken from the one definition that palette() and colour_at() also read, instead of naming a d3.scheme* expression for the browser to look up. A page and a map colouring the same categories therefore draw the same numbers, and an upgrade of d3 cannot move a chart's colours: the page no longer asks d3 for a palette at all This affects the SCHEMES lookup table the pie, stacked bar and treemap snippets emit, the direct scaleOrdinal() calls of the multi-series line, scatter and binned histogram snippets, and the full-page charts that draw category10 or the default tableau10 palette. The scheme options and the fallback for an unknown name are unchanged, and both are still resolved from the definition, so an unknown name draws the default rather than an invented d3.schemeNonsense
    • The d3 scheme each palette transcribes is recorded beside the definition (and in t/palette.t), so it can still be checked against the library, but it is no longer emitted into the page. t/d3-schemes.t continues to check palette() against d3 itself when Node and d3 are installed
  • Tests
    • t/palette.t now asserts the inlined arrays rather than d3.scheme* expressions: the SCHEMES table must hold exactly the colours palette() returns for each scheme, the snippets that draw their colours directly must inline the requested scheme's array, and the module's code must hold no d3.scheme* expression at all. The tests that asserted the old expressions in snippet output were updated to the hex arrays (the key lookups they also asserted are unchanged)

Documentation

Modules

A simple Perl module for generating charts using D3.js.