From 0ea1e376596a2e23e051184a32f1723ccde1540d Mon Sep 17 00:00:00 2001 From: Hugues Stefanski Date: Tue, 18 Sep 2018 19:08:31 +0200 Subject: [PATCH] #28134 : added InterpolateSineBow Added tests --- types/d3-scale-chromatic/d3-scale-chromatic-tests.ts | 12 ++++++++++++ types/d3-scale-chromatic/index.d.ts | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/types/d3-scale-chromatic/d3-scale-chromatic-tests.ts b/types/d3-scale-chromatic/d3-scale-chromatic-tests.ts index c6ff839994..18b26b01d6 100644 --- a/types/d3-scale-chromatic/d3-scale-chromatic-tests.ts +++ b/types/d3-scale-chromatic/d3-scale-chromatic-tests.ts @@ -125,9 +125,21 @@ colorInterpolator = d3ScaleChromatic.interpolateMagma; colorInterpolator = d3ScaleChromatic.interpolateInferno; colorInterpolator = d3ScaleChromatic.interpolatePlasma; colorInterpolator = d3ScaleChromatic.interpolateRainbow; +colorInterpolator = d3ScaleChromatic.interpolateSinebow; colorInterpolator = d3ScaleChromatic.interpolateWarm; colorInterpolator = d3ScaleChromatic.interpolateCool; colorInterpolator = d3ScaleChromatic.interpolateCubehelixDefault; + +const Viridis: string = d3ScaleChromatic.interpolateViridis(0.7); +const Magma: string = d3ScaleChromatic.interpolateMagma(0.7); +const Inferno: string = d3ScaleChromatic.interpolateInferno(0.7); +const Plasma: string = d3ScaleChromatic.interpolatePlasma(0.7); +const Rainbow: string = d3ScaleChromatic.interpolateRainbow(0.7); +const Sinebow: string = d3ScaleChromatic.interpolateSinebow(0.7); +const Warm: string = d3ScaleChromatic.interpolateWarm(0.7); +const Cool: string = d3ScaleChromatic.interpolateCool(0.7); +const CubehelixDefault: string = d3ScaleChromatic.interpolateCubehelixDefault(0.7); + colorInterpolator = d3ScaleChromatic.interpolateBuGn; colorInterpolator = d3ScaleChromatic.interpolateBuPu; colorInterpolator = d3ScaleChromatic.interpolateGnBu; diff --git a/types/d3-scale-chromatic/index.d.ts b/types/d3-scale-chromatic/index.d.ts index 93c0285a17..947b0c76a9 100644 --- a/types/d3-scale-chromatic/index.d.ts +++ b/types/d3-scale-chromatic/index.d.ts @@ -322,6 +322,13 @@ export function interpolateCool(t: number): string; */ export function interpolateRainbow(t: number): string; +/** + * Given a number t in the range [0,1], returns the corresponding color from the “sinebow” color scheme by Jim Bumgardner and Charlie Loyd. + * + * @param t A number in the interval [0, 1]. + */ +export function interpolateSinebow(t: number): string; + /** * Given a number t in the range [0,1], returns the corresponding color from Green’s default Cubehelix represented as an RGB string. *