-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtypes.ts
78 lines (59 loc) · 1.53 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import * as geojson from "geojson";
export interface Properties {
name: string;
count: number;
exceedance?: number;
}
export interface Geometry {
coordinates: number[][][];
type: string;
}
export interface Feature {
properties: Properties;
geometry: Geometry;
id: string;
type: string;
}
export interface PolygonData extends geojson.GeoJsonObject {
// type: string;
features: Feature[];
}
export interface PolyLayers {
county: any;
coarse: any;
fine: any;
}
export interface NumberLayers {
"exceedance": any;
"count": any;
}
export interface RegionData<R, S, T> {
exceedance: R;
count: S;
embed?: T;
}
export interface ColorFunctionObject {
getColor();
getFeatureStyle(feature: geojson.Feature<geojson.GeometryObject, any>);
}
export type ColorFunctions = RegionData<ColorFunctionObject, ColorFunctionObject, ColorFunctionObject>;
export type ColorData = RegionData<{ colors: string[], values: number[] }, { colors: string[], values: number[] }, any>;
export interface ByRegionType<T> {
[index: string]: T;
}
export type Stats = ByRegionType<RegionData<any, any, any>>;
export type NumberLayerShortName = "exceedance" | "count";
export const numberLayerShortNames: NumberLayerShortName[] = ["exceedance", "count"];
export const COUNTY = "county";
// TODO: types for the data
export class TimeSlice {
[index: string]: any;
tweets: string[];
}
export class DateRangeSliderOptions {
min: number;
max: number;
startMin: number;
startMax: number;
now: number;
}