@dra2020/dra-types 1.4.7 → 1.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/all.d.ts CHANGED
@@ -1,3 +1,7 @@
1
1
  export * from './dra-types';
2
2
  export * from './schemas';
3
3
  export * from './bucketmap';
4
+ export * from './colordata';
5
+ export * from './gencolor';
6
+ export * from './vfeature';
7
+ export * from './csv';
@@ -0,0 +1,35 @@
1
+ export declare const DefaultColorNames: string[];
2
+ export interface ColorLookup {
3
+ [key: string]: string;
4
+ }
5
+ export declare const ColorValues: ColorLookup;
6
+ export declare const ColorBySolidWhite = 0;
7
+ export declare const ColorBySolidBlack = 1;
8
+ export declare const ColorBySolidHispanic = 2;
9
+ export declare const ColorBySolidAsian = 3;
10
+ export declare const ColorByMostlyWhite = 4;
11
+ export declare const ColorByMostlyBlack = 5;
12
+ export declare const ColorByMostlyHispanic = 6;
13
+ export declare const ColorByMostlyAsian = 7;
14
+ export declare const ColorByMostlyNative = 8;
15
+ export declare const ColorByMix = 9;
16
+ export declare const ColorByHispanicWhite = 10;
17
+ export declare const ColorByBlackWhite = 11;
18
+ export declare const ColorByHispanicBlack = 12;
19
+ export declare const ColorByAsianWhite = 13;
20
+ export declare const ColorByAsianHispanic = 14;
21
+ export declare const ColorByBlackAsian = 15;
22
+ export declare const EthnicBackgroundColor: string[];
23
+ export declare const EthnicTextColor: string[];
24
+ export declare const EthnicLabel: string[];
25
+ export declare const ColorByGreatR = 0;
26
+ export declare const ColorByGoodR = 1;
27
+ export declare const ColorByFairR = 2;
28
+ export declare const ColorByEven = 3;
29
+ export declare const ColorByFairD = 4;
30
+ export declare const ColorByGoodD = 5;
31
+ export declare const ColorByGreatD = 6;
32
+ export declare const ElectionBackgroundColor: string[];
33
+ export declare const ElectionTextColor: string[];
34
+ export declare const ElectionLabel: string[];
35
+ export declare let IntensityBackgroundColor: string[];
package/dist/csv.d.ts ADDED
@@ -0,0 +1,40 @@
1
+ import * as VF from './vfeature';
2
+ export declare type BlockMap = {
3
+ [id: string]: number;
4
+ };
5
+ export declare type BlockMapping = {
6
+ [id: string]: string;
7
+ };
8
+ export declare function canonicalDistrictID(districtID: string): string;
9
+ export declare function canonicalSortingDistrictID(districtID: string): string;
10
+ export declare function canonicalNumericFromDistrictID(districtID: string): number;
11
+ export declare function canonicalDistrictIDFromNumber(districtID: string, n: number): string;
12
+ export declare type DistrictOrder = {
13
+ [districtID: string]: number;
14
+ };
15
+ export declare function canonicalDistrictIDGapFill(keys: string[]): string[];
16
+ export declare function canonicalDistrictIDOrdering(order: DistrictOrder): DistrictOrder;
17
+ export interface OneCSVLine {
18
+ geoid: string;
19
+ districtID: string;
20
+ }
21
+ export declare function parseCSVLine(line: string): OneCSVLine;
22
+ export interface ConvertResult {
23
+ inBlockMap: BlockMapping;
24
+ inStateMap: BlockMapping;
25
+ outValid: boolean;
26
+ outState: string;
27
+ outMap: BlockMapping;
28
+ outOrder: DistrictOrder;
29
+ outDistrictToSplit: VF.DistrictToSplitBlock;
30
+ }
31
+ export declare function blockmapToState(blockMap: BlockMapping): string;
32
+ export declare function blockmapToVTDmap(blockMap: BlockMapping, stateMap: BlockMapping): ConvertResult;
33
+ export declare const GEOIDToState: any;
34
+ export declare const StateToGEOID: any;
35
+ export declare function geoidToState(geoid: string): string;
36
+ export declare type StateUrls = ('alabama' | 'alaska' | 'arizona' | 'arkansas' | 'california' | 'colorado' | 'connecticut' | 'delaware' | 'florida' | 'georgia' | 'hawaii' | 'idaho' | 'illinois' | 'indiana' | 'iowa' | 'kansas' | 'kentucky' | 'louisiana' | 'maine' | 'maryland' | 'massachusetts' | 'michigan' | 'minnesota' | 'mississippi' | 'missouri' | 'montana' | 'nebraska' | 'nevada' | 'new-hampshire' | 'new-jersey' | 'new-mexico' | 'new-york' | 'north-carolina' | 'north-dakota' | 'ohio' | 'oklahoma' | 'oregon' | 'pennsylvania' | 'rhode-island' | 'south-carolina' | 'south-dakota' | 'tennessee' | 'texas' | 'utah' | 'vermont' | 'virginia' | 'washington' | 'west-virginia' | 'wisconsin' | 'wyoming');
37
+ export declare type ValidStateUrlsType = {
38
+ readonly [stateUrl in StateUrls]: boolean;
39
+ };
40
+ export declare function isStateUrl(s: any): s is StateUrls;
@@ -1,9 +1,3 @@
1
- export declare type BlockMap = {
2
- [id: string]: number;
3
- };
4
- export declare type BlockMapping = {
5
- [id: string]: string;
6
- };
7
1
  export interface Comment {
8
2
  userid: string;
9
3
  text: string;
@@ -27,55 +21,3 @@ export interface UserLikes {
27
21
  id?: string;
28
22
  [aid: string]: Like | string;
29
23
  }
30
- export interface SplitBlock {
31
- id?: string;
32
- chunkKey?: string;
33
- chunk?: string;
34
- state: string;
35
- datasource: string;
36
- geoid: string;
37
- blocks: string[];
38
- }
39
- export declare type DistrictToSplitBlock = {
40
- [districtID: string]: SplitBlock[];
41
- };
42
- export declare function vgeoidToGeoid(vgeoid: string): string;
43
- export declare function vgeoidToChunk(vgeoid: string): string;
44
- export declare function vgeoidToHash(vgeoid: string): string;
45
- export declare function isVfeature(geoid: string): boolean;
46
- export declare function splitToCacheKey(s: SplitBlock): string;
47
- export declare function splitToChunkKey(s: SplitBlock): string;
48
- export declare function splitToPrefix(s: SplitBlock): string;
49
- export declare function cacheKeysToChunkHash(keys: string[]): string;
50
- export declare function canonicalDistrictID(districtID: string): string;
51
- export declare function canonicalSortingDistrictID(districtID: string): string;
52
- export declare function canonicalNumericFromDistrictID(districtID: string): number;
53
- export declare function canonicalDistrictIDFromNumber(districtID: string, n: number): string;
54
- export declare type DistrictOrder = {
55
- [districtID: string]: number;
56
- };
57
- export declare function canonicalDistrictIDOrdering(order: DistrictOrder): DistrictOrder;
58
- export interface OneCSVLine {
59
- geoid: string;
60
- districtID: string;
61
- }
62
- export declare function parseCSVLine(line: string): OneCSVLine;
63
- export interface ConvertResult {
64
- inBlockMap: BlockMapping;
65
- inStateMap: BlockMapping;
66
- outValid: boolean;
67
- outState: string;
68
- outMap: BlockMapping;
69
- outOrder: DistrictOrder;
70
- outDistrictToSplit: DistrictToSplitBlock;
71
- }
72
- export declare function blockmapToState(blockMap: BlockMapping): string;
73
- export declare function blockmapToVTDmap(blockMap: BlockMapping, stateMap: BlockMapping): ConvertResult;
74
- export declare const GEOIDToState: any;
75
- export declare const StateToGEOID: any;
76
- export declare function geoidToState(geoid: string): string;
77
- export declare type StateUrls = ('alabama' | 'alaska' | 'arizona' | 'arkansas' | 'california' | 'colorado' | 'connecticut' | 'delaware' | 'florida' | 'georgia' | 'hawaii' | 'idaho' | 'illinois' | 'indiana' | 'iowa' | 'kansas' | 'kentucky' | 'louisiana' | 'maine' | 'maryland' | 'massachusetts' | 'michigan' | 'minnesota' | 'mississippi' | 'missouri' | 'montana' | 'nebraska' | 'nevada' | 'new-hampshire' | 'new-jersey' | 'new-mexico' | 'new-york' | 'north-carolina' | 'north-dakota' | 'ohio' | 'oklahoma' | 'oregon' | 'pennsylvania' | 'rhode-island' | 'south-carolina' | 'south-dakota' | 'tennessee' | 'texas' | 'utah' | 'vermont' | 'virginia' | 'washington' | 'west-virginia' | 'wisconsin' | 'wyoming');
78
- export declare type ValidStateUrlsType = {
79
- readonly [stateUrl in StateUrls]: boolean;
80
- };
81
- export declare function isStateUrl(s: any): s is StateUrls;