From 0ea1e376596a2e23e051184a32f1723ccde1540d Mon Sep 17 00:00:00 2001 From: Hugues Stefanski Date: Tue, 18 Sep 2018 19:08:31 +0200 Subject: [PATCH 1/2] #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. * From 8eeacf7fa956633eb4c0d7e8dcd07ab1e0427aa7 Mon Sep 17 00:00:00 2001 From: Hugues Stefanski Date: Tue, 18 Sep 2018 19:15:01 +0200 Subject: [PATCH 2/2] Update d3-scale-chromatic number --- types/d3-scale-chromatic/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/d3-scale-chromatic/index.d.ts b/types/d3-scale-chromatic/index.d.ts index 947b0c76a9..70d180420a 100644 --- a/types/d3-scale-chromatic/index.d.ts +++ b/types/d3-scale-chromatic/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for D3JS d3-scale-chromatic module 1.2 +// Type definitions for D3JS d3-scale-chromatic module 1.3 // Project: https://github.com/d3/d3-scale-chromatic/ // Definitions by: Hugues Stefanski , // Alex Ford , @@ -6,7 +6,7 @@ // Henrique Machado // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Last module patch version validated against: 1.2.0 +// Last module patch version validated against: 1.3.2 // ----------------------------------------------------------------------- // Categorical