/
types.ts
44 lines (36 loc) · 1.01 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import {
ScaleBand,
ScaleDiverging,
ScaleSequential,
ScaleOrdinal,
ScaleQuantile,
ScaleQuantize,
ScaleThreshold,
ScaleLinear,
} from "d3-scale";
export {
ScaleSequential,
ScaleQuantile,
ScaleQuantize,
ScaleThreshold,
ScaleDiverging,
ScaleOrdinal,
ScaleLinear,
ScaleBand,
};
export type ColorScale =
| ScaleLinear<number | string, string>
| ScaleSequential<string>
| ScaleDiverging<string>
| ScaleQuantile<string>
| ScaleQuantize<number>
| ScaleThreshold<number, string>
| ScaleOrdinal<string | number, string>;
export type XScale = ScaleLinear<number, number, unknown>;
export type Interpolator<T> = (t: number) => T;
export type TickFormatter = (d: number) => string;
/** the type of shape rendered when ScaleType is "categorical" */
export type MarkType = "rect" | "circle" | "line";
/** available scales, similar to those of d3-scale */
export type ScaleType = "categorical" | "continuous" | "discrete" | "threshold";
export type ChangedProps = Map<string, number | string>;