1
0
mirror of https://github.com/d3/d3.git synced 2026-02-01 16:41:44 +00:00
d3/docs/d3-scale-chromatic/cyclical.md
Philippe Rivière 0eb853b642
a few links to notebooks that have been refreshed (#3698)
* a few links to notebooks that have been refreshed

* more deprecated links

* blocks

closes #3696
2023-07-29 12:44:36 -04:00

1.2 KiB

Cyclical schemes

To create a cyclical continuous color scale using the Rainbow color scheme:

const color = d3.scaleSequential(d3.interpolateRainbow);

interpolateRainbow(t)

Source · Given a number t in the range [0,1], returns the corresponding color from d3.interpolateWarm scale from [0.0, 0.5] followed by the d3.interpolateCool scale from [0.5, 1.0], thus implementing the cyclical less-angry rainbow color scheme.

interpolateSinebow(t)

Source · Given a number t in the range [0,1], returns the corresponding color from the “sinebow” color scheme by Jim Bumgardner and Charlie Loyd.