UNPKG

25 kBTypeScriptView Raw
1// Type definitions for D3JS d3-scale-chromatic module 3.0
2// Project: https://github.com/d3/d3-scale-chromatic/, https://d3js.org/d3-scale-chromatic
3// Definitions by: Hugues Stefanski <https://github.com/Ledragon>
4// Alex Ford <https://github.com/gustavderdrache>
5// Boris Yankov <https://github.com/borisyankov>
6// Henrique Machado <https://github.com/henriquefm>
7// Nathan Bierema <https://github.com/Methuselah96>
8// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
9
10// Last module patch version validated against: 3.0.0
11
12// -----------------------------------------------------------------------
13// Categorical
14// -----------------------------------------------------------------------
15/**
16 * An array of ten categorical colors represented as RGB hexadecimal strings.
17 */
18export const schemeCategory10: ReadonlyArray<string>;
19/**
20 * An array of eight categorical colors represented as RGB hexadecimal strings.
21 */
22export const schemeAccent: ReadonlyArray<string>;
23/**
24 * An array of eight categorical colors represented as RGB hexadecimal strings.
25 */
26export const schemeDark2: ReadonlyArray<string>;
27/**
28 * An array of twelve categorical colors represented as RGB hexadecimal strings.
29 */
30export const schemePaired: ReadonlyArray<string>;
31/**
32 * An array of nine categorical colors represented as RGB hexadecimal strings.
33 */
34export const schemePastel1: ReadonlyArray<string>;
35/**
36 * An array of eight categorical colors represented as RGB hexadecimal strings.
37 */
38export const schemePastel2: ReadonlyArray<string>;
39/**
40 * An array of nine categorical colors represented as RGB hexadecimal strings.
41 */
42export const schemeSet1: ReadonlyArray<string>;
43/**
44 * An array of eight categorical colors represented as RGB hexadecimal strings.
45 */
46export const schemeSet2: ReadonlyArray<string>;
47/**
48 * An array of twelve categorical colors represented as RGB hexadecimal strings.
49 */
50export const schemeSet3: ReadonlyArray<string>;
51/**
52 * An array of ten categorical colors authored by Tableau as part of Tableau 10 represented as RGB hexadecimal strings.
53 */
54export const schemeTableau10: ReadonlyArray<string>;
55
56// -----------------------------------------------------------------------
57// Diverging
58// -----------------------------------------------------------------------
59/**
60 * Given a number t in the range [0,1], returns the corresponding color from the “BrBG” diverging color scheme represented as an RGB string.
61 *
62 * @param t Number in the range [0, 1].
63 */
64export function interpolateBrBG(t: number): string;
65
66/**
67 * An array of arrays of hexadecimal color strings from the “BrBG” diverging color scheme. The kth element of this array contains
68 * the color scheme of size k; for example, d3.schemeBrBG[9] contains an array of nine strings representing the nine colors of the
69 * brown-blue-green diverging color scheme. Diverging color schemes support a size k ranging from 3 to 11.
70 */
71export const schemeBrBG: ReadonlyArray<ReadonlyArray<string>>;
72
73/**
74 * Given a number t in the range [0,1], returns the corresponding color from the “PRGn” diverging color scheme represented as an RGB string.
75 *
76 * @param t Number in the range [0, 1].
77 */
78export function interpolatePRGn(t: number): string;
79
80/**
81 * An array of arrays of hexadecimal color strings from the “PRGn” diverging color scheme. The kth element of this array contains
82 * the color scheme of size k; for example, d3.schemePRGn[9] contains an array of nine strings representing the nine colors of the
83 * purple-green diverging color scheme. Diverging color schemes support a size k ranging from 3 to 11.
84 */
85export const schemePRGn: ReadonlyArray<ReadonlyArray<string>>;
86
87/**
88 * Given a number t in the range [0,1], returns the corresponding color from the “PiYG” diverging color scheme represented as an RGB string.
89 *
90 * @param t Number in the range [0, 1].
91 */
92export function interpolatePiYG(t: number): string;
93
94/**
95 * An array of arrays of hexadecimal color strings from the “PiYG” diverging color scheme. The kth element of this array contains
96 * the color scheme of size k; for example, d3.schemePiYG[9] contains an array of nine strings representing the nine colors of the
97 * pink-yellow-green diverging color scheme. Diverging color schemes support a size k ranging from 3 to 11.
98 */
99export const schemePiYG: ReadonlyArray<ReadonlyArray<string>>;
100
101/**
102 * Given a number t in the range [0,1], returns the corresponding color from the “PuOr” diverging color scheme represented as an RGB string.
103 *
104 * @param t Number in the range [0, 1].
105 */
106export function interpolatePuOr(t: number): string;
107
108/**
109 * An array of arrays of hexadecimal color strings from the “PuOr” diverging color scheme. The kth element of this array contains
110 * the color scheme of size k; for example, d3.schemePuOr[9] contains an array of nine strings representing the nine colors of the
111 * purple-orange diverging color scheme. Diverging color schemes support a size k ranging from 3 to 11.
112 */
113export const schemePuOr: ReadonlyArray<ReadonlyArray<string>>;
114
115/**
116 * Given a number t in the range [0,1], returns the corresponding color from the “RdBu” diverging color scheme represented as an RGB string.
117 *
118 * @param t Number in the range [0, 1].
119 */
120export function interpolateRdBu(t: number): string;
121
122/**
123 * An array of arrays of hexadecimal color strings from the “RdBu” diverging color scheme. The kth element of this array contains
124 * the color scheme of size k; for example, d3.schemeRdBu[9] contains an array of nine strings representing the nine colors of the
125 * red-blue diverging color scheme. Diverging color schemes support a size k ranging from 3 to 11.
126 */
127export const schemeRdBu: ReadonlyArray<ReadonlyArray<string>>;
128
129/**
130 * Given a number t in the range [0,1], returns the corresponding color from the “RdGy” diverging color scheme represented as an RGB string.
131 *
132 * @param t Number in the range [0, 1].
133 */
134export function interpolateRdGy(t: number): string;
135
136/**
137 * An array of arrays of hexadecimal color strings from the “RdGy” diverging color scheme. The kth element of this array contains
138 * the color scheme of size k; for example, d3.schemeRdGy[9] contains an array of nine strings representing the nine colors of the
139 * red-grey diverging color scheme. Diverging color schemes support a size k ranging from 3 to 11.
140 */
141export const schemeRdGy: ReadonlyArray<ReadonlyArray<string>>;
142
143/**
144 * Given a number t in the range [0,1], returns the corresponding color from the “RdYlBu” diverging color scheme represented as an RGB string.
145 *
146 * @param t Number in the range [0, 1].
147 */
148export function interpolateRdYlBu(t: number): string;
149
150/**
151 * An array of arrays of hexadecimal color strings from the “RdYlBu” diverging color scheme. The kth element of this array contains
152 * the color scheme of size k; for example, d3.schemeRdYlBu[9] contains an array of nine strings representing the nine colors of the
153 * red-yellow-blue diverging color scheme. Diverging color schemes support a size k ranging from 3 to 11.
154 */
155export const schemeRdYlBu: ReadonlyArray<ReadonlyArray<string>>;
156
157/**
158 * Given a number t in the range [0,1], returns the corresponding color from the “RdYlGn” diverging color scheme represented as an RGB string.
159 *
160 * @param t Number in the range [0, 1].
161 */
162export function interpolateRdYlGn(t: number): string;
163
164/**
165 * An array of arrays of hexadecimal color strings from the “RdYlGn” diverging color scheme. The kth element of this array contains
166 * the color scheme of size k; for example, d3.schemeRdYlGn[9] contains an array of nine strings representing the nine colors of the
167 * red-yellow-green diverging color scheme. Diverging color schemes support a size k ranging from 3 to 11.
168 */
169export const schemeRdYlGn: ReadonlyArray<ReadonlyArray<string>>;
170
171/**
172 * Given a number t in the range [0,1], returns the corresponding color from the “Spectral” diverging color scheme represented as an RGB string.
173 *
174 * @param t Number in the range [0, 1].
175 */
176export function interpolateSpectral(t: number): string;
177
178/**
179 * An array of arrays of hexadecimal color strings from the “Spectral” diverging color scheme. The kth element of this array contains
180 * the color scheme of size k; for example, d3.schemeSpectral[9] contains an array of nine strings representing the nine colors of the
181 * spectral diverging color scheme. Diverging color schemes support a size k ranging from 3 to 11.
182 */
183export const schemeSpectral: ReadonlyArray<ReadonlyArray<string>>;
184
185// -----------------------------------------------------------------------
186// Sequential
187// -----------------------------------------------------------------------
188/**
189 * Given a number t in the range [0,1], returns the corresponding color from the “Blues” sequential color scheme represented as an RGB string.
190 *
191 * @param t Number in the range [0, 1].
192 */
193export function interpolateBlues(t: number): string;
194
195/**
196 * An array of arrays of hexadecimal color strings from the “Blues” sequential color scheme. The kth element of this array contains
197 * the color scheme of size k; for example, d3.schemeBlues[9] contains an array of nine strings representing the nine colors of the
198 * blue sequential color scheme. Sequential, single-hue color schemes support a size k ranging from 3 to 9.
199 */
200export const schemeBlues: ReadonlyArray<ReadonlyArray<string>>;
201
202/**
203 * Given a number t in the range [0,1], returns the corresponding color from the “Greens” sequential color scheme represented as an RGB string.
204 *
205 * @param t Number in the range [0, 1].
206 */
207export function interpolateGreens(t: number): string;
208
209/**
210 * An array of arrays of hexadecimal color strings from the “Greens” sequential color scheme. The kth element of this array contains
211 * the color scheme of size k; for example, d3.schemeGreens[9] contains an array of nine strings representing the nine colors of the
212 * green sequential color scheme. Sequential, single-hue color schemes support a size k ranging from 3 to 9.
213 */
214export const schemeGreens: ReadonlyArray<ReadonlyArray<string>>;
215
216/**
217 * Given a number t in the range [0,1], returns the corresponding color from the “Greys” sequential color scheme represented as an RGB string.
218 *
219 * @param t Number in the range [0, 1].
220 */
221export function interpolateGreys(t: number): string;
222
223/**
224 * An array of arrays of hexadecimal color strings from the “Greys” sequential color scheme. The kth element of this array contains
225 * the color scheme of size k; for example, d3.schemeGreys[9] contains an array of nine strings representing the nine colors of the
226 * grey sequential color scheme. Sequential, single-hue color schemes support a size k ranging from 3 to 9.
227 */
228export const schemeGreys: ReadonlyArray<ReadonlyArray<string>>;
229
230/**
231 * Given a number t in the range [0,1], returns the corresponding color from the “Oranges” sequential color scheme represented as an RGB string.
232 *
233 * @param t Number in the range [0, 1].
234 */
235export function interpolateOranges(t: number): string;
236
237/**
238 * An array of arrays of hexadecimal color strings from the “Oranges” sequential color scheme. The kth element of this array contains
239 * the color scheme of size k; for example, d3.schemeOranges[9] contains an array of nine strings representing the nine colors of the
240 * orange sequential color scheme. Sequential, single-hue color schemes support a size k ranging from 3 to 9.
241 */
242export const schemeOranges: ReadonlyArray<ReadonlyArray<string>>;
243
244/**
245 * Given a number t in the range [0,1], returns the corresponding color from the “Purples” sequential color scheme represented as an RGB string.
246 *
247 * @param t Number in the range [0, 1].
248 */
249export function interpolatePurples(t: number): string;
250
251/**
252 * An array of arrays of hexadecimal color strings from the “Purples” sequential color scheme. The kth element of this array contains
253 * the color scheme of size k; for example, d3.schemePurples[9] contains an array of nine strings representing the nine colors of the
254 * purple sequential color scheme. Sequential, single-hue color schemes support a size k ranging from 3 to 9.
255 */
256export const schemePurples: ReadonlyArray<ReadonlyArray<string>>;
257
258/**
259 * Given a number t in the range [0,1], returns the corresponding color from the “Reds” sequential color scheme represented as an RGB string.
260 *
261 * @param t Number in the range [0, 1].
262 */
263export function interpolateReds(t: number): string;
264
265/**
266 * An array of arrays of hexadecimal color strings from the “Reds” sequential color scheme. The kth element of this array contains
267 * the color scheme of size k; for example, d3.schemeReds[9] contains an array of nine strings representing the nine colors of the
268 * red sequential color scheme. Sequential, single-hue color schemes support a size k ranging from 3 to 9.
269 */
270export const schemeReds: ReadonlyArray<ReadonlyArray<string>>;
271
272// -----------------------------------------------------------------------
273// Sequential(Multi-Hue)
274// -----------------------------------------------------------------------
275
276/**
277 * Given a number t in the range [0,1], returns the corresponding color from the “turbo” color scheme by Anton Mikhailov.
278 *
279 * @param t A number in the interval [0, 1].
280 */
281export function interpolateTurbo(t: number): string;
282
283/**
284 * Given a number t in the range [0,1], returns the corresponding color from the “viridis” perceptually-uniform color scheme designed by van der Walt, Smith and Firing for matplotlib,
285 * represented as an RGB string.
286 *
287 * @param t A number in the interval [0, 1].
288 */
289export function interpolateViridis(t: number): string;
290
291/**
292 * Given a number t in the range [0,1], returns the corresponding color from the “inferno” perceptually-uniform color scheme designed by van der Walt and Smith for matplotlib,
293 * represented as an RGB string.
294 *
295 * @param t A number in the interval [0, 1].
296 */
297export function interpolateInferno(t: number): string;
298
299/**
300 * Given a number t in the range [0,1], returns the corresponding color from the “magma” perceptually-uniform color scheme designed by van der Walt and Smith for matplotlib,
301 * represented as an RGB string.
302 *
303 * @param t A number in the interval [0, 1].
304 */
305export function interpolateMagma(t: number): string;
306
307/**
308 * Given a number t in the range [0,1], returns the corresponding color from the “plasma” perceptually-uniform color scheme designed by van der Walt and Smith for matplotlib,
309 * represented as an RGB string.
310 *
311 * @param t A number in the interval [0, 1].
312 */
313export function interpolatePlasma(t: number): string;
314
315/**
316 * Given a number t in the range [0,1], returns the corresponding color from the “plasma” perceptually-uniform color scheme designed by van der Walt and Smith for matplotlib,
317 * represented as an RGB string.
318 *
319 * @param t A number in the interval [0, 1].
320 */
321export function interpolateCividis(t: number): string;
322
323/**
324 * Given a number t in the range [0,1], returns the corresponding color from a 180° rotation of Niccoli’s perceptual rainbow, represented as an RGB string.
325 *
326 * @param t A number in the interval [0, 1].
327 */
328export function interpolateWarm(t: number): string;
329
330/**
331 * Given a number t in the range [0,1], returns the corresponding color from Niccoli’s perceptual rainbow, represented as an RGB string.
332 *
333 * @param t A number in the interval [0, 1].
334 */
335export function interpolateCool(t: number): string;
336
337/**
338 * 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],
339 * thus implementing the cyclical less-angry rainbow color scheme.
340 *
341 * @param t A number in the interval [0, 1].
342 */
343export function interpolateRainbow(t: number): string;
344
345/**
346 * Given a number t in the range [0,1], returns the corresponding color from the “sinebow” color scheme by Jim Bumgardner and Charlie Loyd.
347 *
348 * @param t A number in the interval [0, 1].
349 */
350export function interpolateSinebow(t: number): string;
351
352/**
353 * Given a number t in the range [0,1], returns the corresponding color from Green’s default Cubehelix represented as an RGB string.
354 *
355 * @param t A number in the interval [0, 1].
356 */
357export function interpolateCubehelixDefault(t: number): string;
358
359/**
360 * Given a number t in the range [0,1], returns the corresponding color from the “BuGn” sequential color scheme represented as an RGB string.
361 *
362 * @param t Number in the range [0, 1].
363 */
364export function interpolateBuGn(t: number): string;
365
366/**
367 * An array of arrays of hexadecimal color strings from the “BuGn” sequential color scheme. The kth element of this array contains
368 * the color scheme of size k; for example, d3.schemeBuGn[9] contains an array of nine strings representing the nine colors of the
369 * blue-green sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
370 */
371export const schemeBuGn: ReadonlyArray<ReadonlyArray<string>>;
372
373/**
374 * Given a number t in the range [0,1], returns the corresponding color from the “BuPu” sequential color scheme represented as an RGB string.
375 *
376 * @param t Number in the range [0, 1].
377 */
378export function interpolateBuPu(t: number): string;
379
380/**
381 * An array of arrays of hexadecimal color strings from the “BuPu” sequential color scheme. The kth element of this array contains
382 * the color scheme of size k; for example, d3.schemeBuPu[9] contains an array of nine strings representing the nine colors of the
383 * blue-purple sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
384 */
385export const schemeBuPu: ReadonlyArray<ReadonlyArray<string>>;
386
387/**
388 * Given a number t in the range [0,1], returns the corresponding color from the “GnBu” sequential color scheme represented as an RGB string.
389 *
390 * @param t Number in the range [0, 1].
391 */
392export function interpolateGnBu(t: number): string;
393
394/**
395 * An array of arrays of hexadecimal color strings from the “GnBu” sequential color scheme. The kth element of this array contains
396 * the color scheme of size k; for example, d3.schemeGnBu[9] contains an array of nine strings representing the nine colors of the
397 * green-blue sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
398 */
399export const schemeGnBu: ReadonlyArray<ReadonlyArray<string>>;
400
401/**
402 * Given a number t in the range [0,1], returns the corresponding color from the “OrRd” sequential color scheme represented as an RGB string.
403 *
404 * @param t Number in the range [0, 1].
405 */
406export function interpolateOrRd(t: number): string;
407
408/**
409 * An array of arrays of hexadecimal color strings from the “OrRd” sequential color scheme. The kth element of this array contains
410 * the color scheme of size k; for example, d3.schemeOrRd[9] contains an array of nine strings representing the nine colors of the
411 * orange-red sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
412 */
413export const schemeOrRd: ReadonlyArray<ReadonlyArray<string>>;
414
415/**
416 * Given a number t in the range [0,1], returns the corresponding color from the “PuBuGn” sequential color scheme represented as an RGB string.
417 *
418 * @param t Number in the range [0, 1].
419 */
420export function interpolatePuBuGn(t: number): string;
421
422/**
423 * An array of arrays of hexadecimal color strings from the “PuBuGn” sequential color scheme. The kth element of this array contains
424 * the color scheme of size k; for example, d3.schemePuBuGn[9] contains an array of nine strings representing the nine colors of the
425 * purple-blue-green sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
426 */
427export const schemePuBuGn: ReadonlyArray<ReadonlyArray<string>>;
428
429/**
430 * Given a number t in the range [0,1], returns the corresponding color from the “PuBu” sequential color scheme represented as an RGB string.
431 *
432 * @param t Number in the range [0, 1].
433 */
434export function interpolatePuBu(t: number): string;
435
436/**
437 * An array of arrays of hexadecimal color strings from the “PuBu” sequential color scheme. The kth element of this array contains
438 * the color scheme of size k; for example, d3.schemePuBu[9] contains an array of nine strings representing the nine colors of the
439 * purple-blue sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
440 */
441export const schemePuBu: ReadonlyArray<ReadonlyArray<string>>;
442
443/**
444 * Given a number t in the range [0,1], returns the corresponding color from the “PuRd” sequential color scheme represented as an RGB string.
445 *
446 * @param t Number in the range [0, 1].
447 */
448export function interpolatePuRd(t: number): string;
449
450/**
451 * An array of arrays of hexadecimal color strings from the “PuRd” sequential color scheme. The kth element of this array contains
452 * the color scheme of size k; for example, d3.schemePuRd[9] contains an array of nine strings representing the nine colors of the
453 * purple-red sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
454 */
455export const schemePuRd: ReadonlyArray<ReadonlyArray<string>>;
456
457/**
458 * Given a number t in the range [0,1], returns the corresponding color from the “RdPu” sequential color scheme represented as an RGB string.
459 *
460 * @param t Number in the range [0, 1].
461 */
462export function interpolateRdPu(t: number): string;
463
464/**
465 * An array of arrays of hexadecimal color strings from the “RdPu” sequential color scheme. The kth element of this array contains
466 * the color scheme of size k; for example, d3.schemeRdPu[9] contains an array of nine strings representing the nine colors of the
467 * red-purple sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
468 */
469export const schemeRdPu: ReadonlyArray<ReadonlyArray<string>>;
470
471/**
472 * Given a number t in the range [0,1], returns the corresponding color from the “YlGnBu” sequential color scheme represented as an RGB string.
473 *
474 * @param t Number in the range [0, 1].
475 */
476export function interpolateYlGnBu(t: number): string;
477
478/**
479 * An array of arrays of hexadecimal color strings from the “YlGnBu” sequential color scheme. The kth element of this array contains
480 * the color scheme of size k; for example, d3.schemeYlGnBu[9] contains an array of nine strings representing the nine colors of the
481 * yellow-green-blue sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
482 */
483export const schemeYlGnBu: ReadonlyArray<ReadonlyArray<string>>;
484
485/**
486 * Given a number t in the range [0,1], returns the corresponding color from the “YlGn” sequential color scheme represented as an RGB string.
487 *
488 * @param t Number in the range [0, 1].
489 */
490export function interpolateYlGn(t: number): string;
491
492/**
493 * An array of arrays of hexadecimal color strings from the “YlGn” sequential color scheme. The kth element of this array contains
494 * the color scheme of size k; for example, d3.schemeYlGn[9] contains an array of nine strings representing the nine colors of the
495 * yellow-green sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
496 */
497export const schemeYlGn: ReadonlyArray<ReadonlyArray<string>>;
498
499/**
500 * Given a number t in the range [0,1], returns the corresponding color from the “YlOrBr” sequential color scheme represented as an RGB string.
501 *
502 * @param t Number in the range [0, 1].
503 */
504export function interpolateYlOrBr(t: number): string;
505
506/**
507 * An array of arrays of hexadecimal color strings from the “YlOrBr” sequential color scheme. The kth element of this array contains
508 * the color scheme of size k; for example, d3.schemeYlOrBr[9] contains an array of nine strings representing the nine colors of the
509 * yellow-orange-brown sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
510 */
511export const schemeYlOrBr: ReadonlyArray<ReadonlyArray<string>>;
512
513/**
514 * Given a number t in the range [0,1], returns the corresponding color from the “YlOrRd” sequential color scheme represented as an RGB string.
515 *
516 * @param t Number in the range [0, 1].
517 */
518export function interpolateYlOrRd(t: number): string;
519
520/**
521 * An array of arrays of hexadecimal color strings from the “YlOrRd” sequential color scheme. The kth element of this array contains
522 * the color scheme of size k; for example, d3.schemeYlOrRd[9] contains an array of nine strings representing the nine colors of the
523 * yellow-orange-red sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
524 */
525export const schemeYlOrRd: ReadonlyArray<ReadonlyArray<string>>;