Skip to content

Commit 61d066f

Browse files
committedApr 25, 2015
Merge pull request DefinitelyTyped#4189 from mtraynham/colorbrewer
Colorbrewer definition
2 parents b18e9cb + ffc6161 commit 61d066f

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed
 

‎colorbrewer/colorbrewer-tests.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/// <reference path="./colorbrewer.d.ts" />
2+
3+
var accent3: string[] = colorbrewer.Accent[3];
4+
var accent4: string[] = colorbrewer.Accent[4];
5+
var accent5: string[] = colorbrewer.Accent[5];
6+
var accent6: string[] = colorbrewer.Accent[6];
7+
var accent7: string[] = colorbrewer.Accent[7];
8+
var accent8: string[] = colorbrewer.Accent[8];

‎colorbrewer/colorbrewer.d.ts

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// Type definitions for colorbrewer v1.0.0
2+
// Project: https://github.com/jeanlauliac/colorbrewer
3+
// Definitions by: Matt Traynham <https://github.com/mtraynham>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
declare var colorbrewer: ColorBrewer.Base;
7+
8+
declare module ColorBrewer {
9+
interface ColorScheme {
10+
[n: number]: string[];
11+
}
12+
13+
interface EightColorScheme extends ColorScheme {
14+
3: [string, string, string];
15+
4: [string, string, string, string];
16+
5: [string, string, string, string, string];
17+
6: [string, string, string, string, string, string];
18+
7: [string, string, string, string, string, string, string];
19+
8: [string, string, string, string, string, string, string, string];
20+
}
21+
22+
interface NineColorScheme extends EightColorScheme {
23+
9: [string, string, string, string, string, string, string, string, string];
24+
}
25+
26+
interface ElevenColorScheme extends NineColorScheme {
27+
10: [string, string, string, string, string, string, string, string, string, string];
28+
11: [string, string, string, string, string, string, string, string, string, string, string];
29+
}
30+
31+
interface TwelveColorScheme extends ElevenColorScheme {
32+
12: [string, string, string, string, string, string, string, string, string, string, string, string];
33+
}
34+
35+
interface Base {
36+
YlGn: NineColorScheme;
37+
YlGnBu: NineColorScheme;
38+
GnBu: NineColorScheme;
39+
BuGn: NineColorScheme;
40+
PuBuGn: NineColorScheme;
41+
PuBu: NineColorScheme;
42+
BuPu: NineColorScheme;
43+
RdPu: NineColorScheme;
44+
PuRd: NineColorScheme;
45+
OrRd: NineColorScheme;
46+
YlOrRd: NineColorScheme;
47+
YlOrBr: NineColorScheme;
48+
Purples: NineColorScheme;
49+
Blues: NineColorScheme;
50+
Greens: NineColorScheme;
51+
Oranges: NineColorScheme;
52+
Reds: NineColorScheme;
53+
Greys: NineColorScheme;
54+
PuOr: ElevenColorScheme;
55+
BrBG: ElevenColorScheme;
56+
PRGn: ElevenColorScheme;
57+
PiYG: ElevenColorScheme;
58+
RdBu: ElevenColorScheme;
59+
RdGy: ElevenColorScheme;
60+
RdYlBu: ElevenColorScheme;
61+
Spectral: ElevenColorScheme;
62+
RdYlGn: ElevenColorScheme;
63+
Accent: EightColorScheme;
64+
Dark2: EightColorScheme;
65+
Paired: TwelveColorScheme;
66+
Pastel1: NineColorScheme;
67+
Pastel2: EightColorScheme;
68+
Set1: NineColorScheme;
69+
Set2: EightColorScheme;
70+
Set3: TwelveColorScheme;
71+
}
72+
}
73+
74+
declare module 'colorbrewer' {
75+
export = colorbrewer;
76+
}

0 commit comments

Comments
 (0)