@dra2020/district-analytics 16.1.14 → 17.0.1
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/README.md +1 -3
- package/dist/_api.d.ts +2 -0
- package/dist/data.d.ts +68 -0
- package/dist/district-analytics.js +1 -0
- package/dist/district-analytics.js.map +1 -1
- package/dist/rpv.d.ts +4 -0
- package/dist/src/_api.d.ts +2 -0
- package/dist/src/data.d.ts +68 -0
- package/dist/src/rpv.d.ts +4 -0
- package/dist/src/types.d.ts +2 -1
- package/dist/types.d.ts +2 -1
- package/package.json +2 -2
package/dist/rpv.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Types } from '@dra2020/dra-analytics';
|
|
2
|
+
import { AnalyticsSession } from './_api';
|
|
3
|
+
export declare function doRPV(s: AnalyticsSession, districtID: number, groups: Types.MinorityFilter, bLog?: boolean): Types.RPVAnalysis | undefined;
|
|
4
|
+
export declare function inferSelectedMinority(groups: Types.MinorityFilter): string;
|
package/dist/src/_api.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Types } from '@dra2020/dra-analytics';
|
|
2
|
+
import { PF } from '@dra2020/dra-types';
|
|
2
3
|
import { RequirementsChecklist } from './results';
|
|
3
4
|
import { DistrictStatistics } from './results';
|
|
4
5
|
import * as D from './_data';
|
|
@@ -20,6 +21,7 @@ export declare class AnalyticsSession {
|
|
|
20
21
|
features: D.Features;
|
|
21
22
|
plan: D.Plan;
|
|
22
23
|
districts: D.Districts;
|
|
24
|
+
aggregates: PF.PackedFields[];
|
|
23
25
|
repsByDistrict?: number[];
|
|
24
26
|
constructor(SessionRequest: T.SessionRequest);
|
|
25
27
|
processConfig(config: T.Dict): T.Dict;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as T from './types';
|
|
2
|
+
import { AnalyticsSession } from './_api';
|
|
3
|
+
export declare class Districts {
|
|
4
|
+
_session: AnalyticsSession;
|
|
5
|
+
_shapes: T.GeoFeatureCollection;
|
|
6
|
+
_geoProperties: T.DistrictProperties;
|
|
7
|
+
constructor(s: AnalyticsSession, ds: T.GeoFeatureCollection);
|
|
8
|
+
getDistrictShapes(): T.GeoFeatureCollection;
|
|
9
|
+
getDistrictShapeByID(id: number): T.GeoFeature | undefined;
|
|
10
|
+
getCountyIndex(geoID: string): number;
|
|
11
|
+
}
|
|
12
|
+
export declare class Features {
|
|
13
|
+
_session: AnalyticsSession;
|
|
14
|
+
_data: T.GeoFeatureCollection;
|
|
15
|
+
_keys: T.DatasetKeys;
|
|
16
|
+
_featureIDs: T.FeaturesByGeoID;
|
|
17
|
+
constructor(s: AnalyticsSession, data: T.GeoFeatureCollection, keys: T.DatasetKeys);
|
|
18
|
+
nFeatures(): number;
|
|
19
|
+
featureByIndex(i: number): T.GeoFeature;
|
|
20
|
+
resetDataset(d: T.Dataset, k: string): void;
|
|
21
|
+
mapGeoIDsToFeatureIDs(): void;
|
|
22
|
+
featureID(i: string): number;
|
|
23
|
+
}
|
|
24
|
+
export declare function geoIDForFeature(f: any): string;
|
|
25
|
+
export declare function fieldForFeature(f: any, dk: string, ff: T.FeatureField): any;
|
|
26
|
+
export declare class Counties {
|
|
27
|
+
_session: AnalyticsSession;
|
|
28
|
+
_data: T.GeoFeatureCollection;
|
|
29
|
+
_countyNameLookup: T.FIPSCodeToCountyNameMap;
|
|
30
|
+
nCounties: number;
|
|
31
|
+
index: T.FIPSToOrdinalMap;
|
|
32
|
+
fips: T.OrdinalToFIPSlMap;
|
|
33
|
+
totalPopulation: number[];
|
|
34
|
+
constructor(s: AnalyticsSession, data: T.GeoFeatureCollection);
|
|
35
|
+
countyByIndex(i: number): T.GeoFeature;
|
|
36
|
+
propertyForCounty(f: any, pk: string): any;
|
|
37
|
+
mapFIPSToName(fips: string, name: string): void;
|
|
38
|
+
nameFromFIPS(fips: string): string;
|
|
39
|
+
indexFromFIPS(fips: string): number;
|
|
40
|
+
}
|
|
41
|
+
export declare class State {
|
|
42
|
+
_session: AnalyticsSession;
|
|
43
|
+
xx: string;
|
|
44
|
+
nDistricts: number;
|
|
45
|
+
nReps: number;
|
|
46
|
+
totalPop: number;
|
|
47
|
+
targetSize: number;
|
|
48
|
+
tooBigFIPS: string[];
|
|
49
|
+
tooBigName: string[];
|
|
50
|
+
singleCountyDistrictMax: number;
|
|
51
|
+
expectedSplits: number;
|
|
52
|
+
expectedAffected: number;
|
|
53
|
+
constructor(s: AnalyticsSession, xx: string, n: number);
|
|
54
|
+
}
|
|
55
|
+
export declare class Plan {
|
|
56
|
+
_session: AnalyticsSession;
|
|
57
|
+
_planByGeoID: T.PlanByGeoID;
|
|
58
|
+
_planByDistrictID: T.PlanByDistrictID;
|
|
59
|
+
districtIDs: number[];
|
|
60
|
+
constructor(s: AnalyticsSession, p: T.PlanByGeoID);
|
|
61
|
+
invertPlan(bLog?: boolean): void;
|
|
62
|
+
initializeDistrict(i: number): void;
|
|
63
|
+
byGeoID(): T.PlanByGeoID;
|
|
64
|
+
byDistrictID(): T.PlanByDistrictID;
|
|
65
|
+
districtForGeoID(i: string): number;
|
|
66
|
+
geoIDsForDistrictID(i: number): Set<string>;
|
|
67
|
+
}
|
|
68
|
+
export declare function invertPlan(plan: T.PlanByGeoID, s?: AnalyticsSession, bLog?: boolean): T.PlanByDistrictID;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Types } from '@dra2020/dra-analytics';
|
|
2
|
+
import { AnalyticsSession } from './_api';
|
|
3
|
+
export declare function doRPV(s: AnalyticsSession, districtID: number, groups: Types.MinorityFilter, bLog?: boolean): Types.RPVAnalysis | undefined;
|
|
4
|
+
export declare function inferSelectedMinority(groups: Types.MinorityFilter): string;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as geojson from 'geojson';
|
|
2
|
-
import { DT } from '@dra2020/dra-types';
|
|
2
|
+
import { DT, PF } from '@dra2020/dra-types';
|
|
3
3
|
export type SessionRequest = {
|
|
4
4
|
title: string;
|
|
5
5
|
stateXX: string;
|
|
@@ -10,6 +10,7 @@ export type SessionRequest = {
|
|
|
10
10
|
plan: PlanByGeoID;
|
|
11
11
|
data: GeoFeatureCollection;
|
|
12
12
|
districtShapes: GeoFeatureCollection;
|
|
13
|
+
aggregates: PF.PackedFields[];
|
|
13
14
|
graph: ContiguityGraph;
|
|
14
15
|
counties: GeoFeatureCollection;
|
|
15
16
|
config: {};
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as geojson from 'geojson';
|
|
2
|
-
import { DT } from '@dra2020/dra-types';
|
|
2
|
+
import { DT, PF } from '@dra2020/dra-types';
|
|
3
3
|
export type SessionRequest = {
|
|
4
4
|
title: string;
|
|
5
5
|
stateXX: string;
|
|
@@ -10,6 +10,7 @@ export type SessionRequest = {
|
|
|
10
10
|
plan: PlanByGeoID;
|
|
11
11
|
data: GeoFeatureCollection;
|
|
12
12
|
districtShapes: GeoFeatureCollection;
|
|
13
|
+
aggregates: PF.PackedFields[];
|
|
13
14
|
graph: ContiguityGraph;
|
|
14
15
|
counties: GeoFeatureCollection;
|
|
15
16
|
config: {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dra2020/district-analytics",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.0.1",
|
|
4
4
|
"description": "District analytics TypeScript package",
|
|
5
5
|
"main": "dist/district-analytics.js",
|
|
6
6
|
"files": [
|
|
@@ -52,4 +52,4 @@
|
|
|
52
52
|
"@dra2020/dra-types": "^1.8.149",
|
|
53
53
|
"geojson": "^0.5.0"
|
|
54
54
|
}
|
|
55
|
-
}
|
|
55
|
+
}
|