@dra2020/district-analytics 7.1.7 → 8.1.0

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.
@@ -47,41 +47,17 @@ export declare class Districts {
47
47
  extractDistrictShapeProperties(bLog?: boolean): void;
48
48
  getCountyIndex(geoID: string): number;
49
49
  }
50
- export declare const enum Dataset {
51
- SHAPES = "SHAPES",
52
- CENSUS = "CENSUS",
53
- VAP = "VAP",
54
- ELECTION = "ELECTION"
55
- }
56
- export declare type DatasetKeys = {
57
- SHAPES: string;
58
- CENSUS: string;
59
- VAP: string;
60
- ELECTION: string;
61
- };
62
- export declare const enum FeatureField {
63
- TotalPop = "Tot",
64
- WhitePop = "Wh",
65
- BlackPop = "BlC",
66
- HispanicPop = "His",
67
- AsianPop = "AsnC",
68
- PacificPop = "PacC",
69
- NativePop = "NatC",
70
- DemVotes = "D",
71
- RepVotes = "R",
72
- TotalVotes = "Tot"
73
- }
74
50
  export declare class Features {
75
51
  _session: AnalyticsSession;
76
52
  _data: T.GeoFeatureCollection;
77
- _keys: DatasetKeys;
53
+ _keys: T.DatasetKeys;
78
54
  _featureIDs: T.FeaturesByGeoID;
79
- constructor(s: AnalyticsSession, data: T.GeoFeatureCollection, keys: DatasetKeys);
55
+ constructor(s: AnalyticsSession, data: T.GeoFeatureCollection, keys: T.DatasetKeys);
80
56
  nFeatures(): number;
81
57
  featureByIndex(i: number): T.GeoFeature;
82
58
  geoIDForFeature(f: any): string;
83
- fieldForFeature(f: any, dt: Dataset, fk: string): any;
84
- resetDataset(d: Dataset, k: string): void;
59
+ fieldForFeature(f: any, dt: T.Dataset, fk: string): any;
60
+ resetDataset(d: T.Dataset, k: string): void;
85
61
  mapGeoIDsToFeatureIDs(): void;
86
62
  featureID(i: string): number;
87
63
  }
@@ -16,6 +16,30 @@ export declare type SessionRequest = {
16
16
  counties: GeoFeatureCollection;
17
17
  config: {};
18
18
  };
19
+ export declare const enum Dataset {
20
+ SHAPES = "SHAPES",
21
+ CENSUS = "CENSUS",
22
+ VAP = "VAP",
23
+ ELECTION = "ELECTION"
24
+ }
25
+ export declare type DatasetKeys = {
26
+ SHAPES: string;
27
+ CENSUS: string;
28
+ VAP: string;
29
+ ELECTION: string;
30
+ };
31
+ export declare const enum FeatureField {
32
+ TotalPop = "Tot",
33
+ WhitePop = "Wh",
34
+ BlackPop = "BlC",
35
+ HispanicPop = "His",
36
+ AsianPop = "AsnC",
37
+ PacificPop = "PacC",
38
+ NativePop = "NatC",
39
+ DemVotes = "D",
40
+ RepVotes = "R",
41
+ TotalVotes = "Tot"
42
+ }
19
43
  export declare type PlanByGeoID = {
20
44
  [geoID: string]: number;
21
45
  };
@@ -114,4 +138,4 @@ export declare type Ratings = {
114
138
  compactness: number;
115
139
  splitting: number;
116
140
  };
117
- export { Profile, Scorecard, DemographicRow, PivotField, estSeatProbability } from '@dra2020/dra-score';
141
+ export { Profile, Scorecard, Demographic, PivotField, estSeatProbability } from '@dra2020/dra-score';
@@ -1,9 +1,11 @@
1
+ import { AnalyticsSession } from './_api';
1
2
  import * as T from './types';
2
3
  export declare function isInState(geoID: string): boolean;
3
4
  export declare function isOutOfState(geoID: string): boolean;
4
5
  export declare function getDistrict(plan: T.PlanByGeoID, geoID: string): number | undefined;
5
6
  export declare function parseGeoID(geoID: string): T.GeoIDParts;
6
- export declare function isWaterOnly(geoID: string): boolean;
7
+ export declare function isWaterOnly(geoID: string, s?: AnalyticsSession): boolean;
8
+ export declare function isUninhabited(geoID: string, s: AnalyticsSession): boolean;
7
9
  export declare function normalize(rawScore: number, testScale: T.TestScale): number;
8
10
  export declare function trim(fullFraction: number, digits?: number | undefined): number;
9
11
  export declare function sumArray(arr: number[]): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dra2020/district-analytics",
3
- "version": "7.1.7",
3
+ "version": "8.1.0",
4
4
  "description": "District analytics TypeScript package",
5
5
  "main": "dist/district-analytics.js",
6
6
  "files": [
@@ -49,7 +49,7 @@
49
49
  "yargs": "^12.0.5"
50
50
  },
51
51
  "dependencies": {
52
- "@dra2020/dra-score": "^8.1.2",
52
+ "@dra2020/dra-score": "^9.0.0",
53
53
  "@dra2020/dra-types": "^1.4.9",
54
54
  "@dra2020/poly": "^1.1.7",
55
55
  "@dra2020/util": "^1.0.50",