@dra2020/district-analytics 14.1.1 → 14.2.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.
- package/dist/district-analytics.js +591 -77
- package/dist/district-analytics.js.map +1 -1
- package/dist/node_modules/@dra2020/dra-analytics/lib/types/all.d.ts +22 -0
- package/dist/node_modules/@dra2020/dra-analytics/lib/types/compactness.d.ts +47 -0
- package/dist/node_modules/@dra2020/dra-analytics/lib/types/general.d.ts +11 -0
- package/dist/node_modules/@dra2020/dra-analytics/lib/types/graph.d.ts +14 -0
- package/dist/node_modules/@dra2020/dra-analytics/lib/types/minority.d.ts +90 -0
- package/dist/node_modules/@dra2020/dra-analytics/lib/types/partisan.d.ts +64 -0
- package/dist/node_modules/@dra2020/dra-analytics/lib/types/population.d.ts +7 -0
- package/dist/node_modules/@dra2020/dra-analytics/lib/types/splitting.d.ts +9 -0
- package/dist/src/_api.d.ts +3 -2
- package/dist/src/_data.d.ts +3 -3
- package/dist/src/index.d.ts +7 -6
- package/dist/src/legacy-types.d.ts +163 -0
- package/dist/src/minority.d.ts +2 -2
- package/dist/src/political.d.ts +1 -1
- package/dist/src/score.d.ts +7 -0
- package/dist/src/settings.d.ts +0 -4
- package/dist/src/types.d.ts +1 -6
- package/dist/src/utils.d.ts +0 -2
- package/package.json +2 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from './compactness';
|
|
2
|
+
export * from './general';
|
|
3
|
+
export * from './graph';
|
|
4
|
+
export * from './minority';
|
|
5
|
+
export * from './partisan';
|
|
6
|
+
export * from './population';
|
|
7
|
+
export * from './splitting';
|
|
8
|
+
import { PartisanScorecard } from './partisan';
|
|
9
|
+
import { MinorityScorecard } from './minority';
|
|
10
|
+
import { CompactnessScorecard } from './compactness';
|
|
11
|
+
import { SplittingScorecard } from './splitting';
|
|
12
|
+
import { PopulationScorecard } from './population';
|
|
13
|
+
import { Dict } from './general';
|
|
14
|
+
export declare type Scorecard = {
|
|
15
|
+
partisan: PartisanScorecard;
|
|
16
|
+
minority: MinorityScorecard;
|
|
17
|
+
compactness: CompactnessScorecard;
|
|
18
|
+
splitting: SplittingScorecard;
|
|
19
|
+
populationDeviation: PopulationScorecard;
|
|
20
|
+
details: Dict;
|
|
21
|
+
scratchpad: Dict;
|
|
22
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as T from './general';
|
|
2
|
+
export declare type arrPoint = [number, number];
|
|
3
|
+
export declare type CompactnessFeatures = {
|
|
4
|
+
sym_x: number;
|
|
5
|
+
sym_y: number;
|
|
6
|
+
reock: number;
|
|
7
|
+
bbox: number;
|
|
8
|
+
polsby: number;
|
|
9
|
+
hull: number;
|
|
10
|
+
schwartzberg: number;
|
|
11
|
+
reockFlat: number;
|
|
12
|
+
polsbyFlat: number;
|
|
13
|
+
};
|
|
14
|
+
export declare type FeaturesEntry = {
|
|
15
|
+
n: number;
|
|
16
|
+
features: CompactnessFeatures;
|
|
17
|
+
score: number;
|
|
18
|
+
};
|
|
19
|
+
export declare const enum PCAModel {
|
|
20
|
+
Revised = 0,
|
|
21
|
+
Original = 1
|
|
22
|
+
}
|
|
23
|
+
export declare type GeoProperties = {
|
|
24
|
+
area: number;
|
|
25
|
+
perimeter: number;
|
|
26
|
+
diameter: number;
|
|
27
|
+
};
|
|
28
|
+
export declare type CompactnessScorecard = {
|
|
29
|
+
avgReock: number;
|
|
30
|
+
avgPolsby: number;
|
|
31
|
+
avgKWIWYSI: number;
|
|
32
|
+
byDistrict: CompactnessByDistrict[];
|
|
33
|
+
details: T.Dict;
|
|
34
|
+
score?: number;
|
|
35
|
+
};
|
|
36
|
+
export declare type CompactnessByDistrict = {
|
|
37
|
+
rawReock: number;
|
|
38
|
+
normalizedReock: number;
|
|
39
|
+
rawPolsby: number;
|
|
40
|
+
normalizedPolsby: number;
|
|
41
|
+
kiwysiScore?: number;
|
|
42
|
+
};
|
|
43
|
+
export declare type Compactness = {
|
|
44
|
+
rawReock: number;
|
|
45
|
+
rawPolsby: number;
|
|
46
|
+
kiwysiRank: number;
|
|
47
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare type ContiguityGraph = {
|
|
2
|
+
[geoID: string]: UnweightedNeighbors | WeightedNeighbors;
|
|
3
|
+
};
|
|
4
|
+
export declare type WeightedNeighbors = {
|
|
5
|
+
[geoID: string]: number;
|
|
6
|
+
};
|
|
7
|
+
export declare type UnweightedNeighbors = string[];
|
|
8
|
+
export declare type PlanByGeoID = {
|
|
9
|
+
[geoID: string]: number;
|
|
10
|
+
};
|
|
11
|
+
export declare type PlanByDistrictID = {
|
|
12
|
+
[districtID: number]: Set<string>;
|
|
13
|
+
};
|
|
14
|
+
export declare type FeatureGroup = Set<string>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import * as T from './general';
|
|
2
|
+
export declare type MinorityFilter = {
|
|
3
|
+
white: boolean;
|
|
4
|
+
hispanic: boolean;
|
|
5
|
+
black: boolean;
|
|
6
|
+
pacific: boolean;
|
|
7
|
+
asian: boolean;
|
|
8
|
+
native: boolean;
|
|
9
|
+
minority: boolean;
|
|
10
|
+
invertSelection: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare type dictPoint = {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
};
|
|
16
|
+
export declare type DemographicVotingByFeature = {
|
|
17
|
+
ids: string[];
|
|
18
|
+
comparison: dictPoint[];
|
|
19
|
+
minority: dictPoint[];
|
|
20
|
+
black: dictPoint[];
|
|
21
|
+
hispanic: dictPoint[];
|
|
22
|
+
pacific: dictPoint[];
|
|
23
|
+
asian: dictPoint[];
|
|
24
|
+
native: dictPoint[];
|
|
25
|
+
};
|
|
26
|
+
export declare type LinearRegression = {
|
|
27
|
+
slope: number;
|
|
28
|
+
intercept: number;
|
|
29
|
+
r2: number;
|
|
30
|
+
sterrs: StErrs;
|
|
31
|
+
};
|
|
32
|
+
export declare type StErrs = {
|
|
33
|
+
slope: number;
|
|
34
|
+
intercept: number;
|
|
35
|
+
regression: number;
|
|
36
|
+
};
|
|
37
|
+
export declare type RPVFactor = {
|
|
38
|
+
slope: number;
|
|
39
|
+
intercept: number;
|
|
40
|
+
r2: number;
|
|
41
|
+
demPct: number;
|
|
42
|
+
sterr: number;
|
|
43
|
+
points: dictPoint[];
|
|
44
|
+
};
|
|
45
|
+
export declare type RPVAnalysis = {
|
|
46
|
+
ids: string[] | undefined;
|
|
47
|
+
comparison: RPVFactor | undefined;
|
|
48
|
+
minority: RPVFactor | undefined;
|
|
49
|
+
black: RPVFactor | undefined;
|
|
50
|
+
hispanic: RPVFactor | undefined;
|
|
51
|
+
pacific: RPVFactor | undefined;
|
|
52
|
+
asian: RPVFactor | undefined;
|
|
53
|
+
native: RPVFactor | undefined;
|
|
54
|
+
};
|
|
55
|
+
export declare type Demographics = {
|
|
56
|
+
white: number;
|
|
57
|
+
minority: number;
|
|
58
|
+
black: number;
|
|
59
|
+
hispanic: number;
|
|
60
|
+
pacific: number;
|
|
61
|
+
asian: number;
|
|
62
|
+
native: number;
|
|
63
|
+
};
|
|
64
|
+
export declare type DemoBreakdown = {
|
|
65
|
+
pct35_40: number;
|
|
66
|
+
pct40_45: number;
|
|
67
|
+
pct45_50: number;
|
|
68
|
+
pct50_55: number;
|
|
69
|
+
pct55_60: number;
|
|
70
|
+
pct60Plus: number;
|
|
71
|
+
vapPct: number;
|
|
72
|
+
propSeats: number;
|
|
73
|
+
};
|
|
74
|
+
export declare type DemographicPivot = {
|
|
75
|
+
minority: DemoBreakdown;
|
|
76
|
+
black: DemoBreakdown;
|
|
77
|
+
hispanic: DemoBreakdown;
|
|
78
|
+
pacific: DemoBreakdown;
|
|
79
|
+
asian: DemoBreakdown;
|
|
80
|
+
native: DemoBreakdown;
|
|
81
|
+
};
|
|
82
|
+
export declare type MinorityScorecard = {
|
|
83
|
+
pivotByDemographic: DemographicPivot;
|
|
84
|
+
opportunityDistricts: number;
|
|
85
|
+
coalitionDistricts: number;
|
|
86
|
+
proportionalOpportunities: number;
|
|
87
|
+
proportionalCoalitions: number;
|
|
88
|
+
details: T.Dict;
|
|
89
|
+
score?: number;
|
|
90
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as T from './general';
|
|
2
|
+
export declare type VfArray = number[];
|
|
3
|
+
export declare type SVpoint = {
|
|
4
|
+
v: number;
|
|
5
|
+
s: number;
|
|
6
|
+
};
|
|
7
|
+
export declare type rVpoints = {
|
|
8
|
+
Sb: number;
|
|
9
|
+
Ra: number;
|
|
10
|
+
Rb: number;
|
|
11
|
+
Va: number;
|
|
12
|
+
Vb: number;
|
|
13
|
+
};
|
|
14
|
+
export declare const enum Shift {
|
|
15
|
+
Proportional = 0,
|
|
16
|
+
Uniform = 1
|
|
17
|
+
}
|
|
18
|
+
export declare type Bias = {
|
|
19
|
+
bestS: number;
|
|
20
|
+
bestSf: number;
|
|
21
|
+
estS: number;
|
|
22
|
+
estSf: number;
|
|
23
|
+
deviation: number;
|
|
24
|
+
score?: number;
|
|
25
|
+
tOf: number;
|
|
26
|
+
fptpS: number;
|
|
27
|
+
bS50: number;
|
|
28
|
+
bV50?: number;
|
|
29
|
+
decl?: number | undefined;
|
|
30
|
+
rvPoints?: rVpoints;
|
|
31
|
+
gSym: number;
|
|
32
|
+
gamma?: number;
|
|
33
|
+
eG: number;
|
|
34
|
+
bSV?: number;
|
|
35
|
+
prop: number;
|
|
36
|
+
mMs: number;
|
|
37
|
+
mMd: number;
|
|
38
|
+
lO: number | undefined;
|
|
39
|
+
};
|
|
40
|
+
export declare type Impact = {
|
|
41
|
+
unearnedS: number;
|
|
42
|
+
score?: number;
|
|
43
|
+
};
|
|
44
|
+
export declare type Responsiveness = {
|
|
45
|
+
bigR?: number;
|
|
46
|
+
littleR?: number;
|
|
47
|
+
mIR?: number;
|
|
48
|
+
rD: number;
|
|
49
|
+
rDf: number;
|
|
50
|
+
cSimple: number;
|
|
51
|
+
cD: number;
|
|
52
|
+
cDf: number;
|
|
53
|
+
score?: number;
|
|
54
|
+
};
|
|
55
|
+
export declare type PartisanScorecard = {
|
|
56
|
+
bias: Bias;
|
|
57
|
+
impact: Impact;
|
|
58
|
+
responsiveness: Responsiveness;
|
|
59
|
+
dSVpoints: SVpoint[];
|
|
60
|
+
rSVpoints: SVpoint[];
|
|
61
|
+
averageDVf: number | undefined;
|
|
62
|
+
averageRVf: number | undefined;
|
|
63
|
+
details: T.Dict;
|
|
64
|
+
};
|
package/dist/src/_api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Score from '@dra2020/dra-score';
|
|
2
|
-
import {
|
|
2
|
+
import { Types } from '@dra2020/dra-analytics';
|
|
3
3
|
import { RequirementsChecklist } from './results';
|
|
4
4
|
import { DistrictStatistics } from './results';
|
|
5
5
|
import * as D from './_data';
|
|
@@ -23,7 +23,8 @@ export declare class AnalyticsSession {
|
|
|
23
23
|
constructor(SessionRequest: T.SessionRequest);
|
|
24
24
|
processConfig(config: T.Dict): T.Dict;
|
|
25
25
|
analyzePlan(bLog?: boolean, overridesJSON?: any): boolean;
|
|
26
|
-
|
|
26
|
+
getGoodShapes(): T.GeoFeatureCollection;
|
|
27
|
+
analyzeRacialPolarization(districtID: number, groups: Types.MinorityFilter, bLog?: boolean): Types.RPVAnalysis | undefined;
|
|
27
28
|
getDistrictStatistics(bLog?: boolean): DistrictStatistics;
|
|
28
29
|
getPlanProfile(bLog?: boolean): Score.Profile;
|
|
29
30
|
getPlanScorecard(bLog?: boolean): Score.Scorecard;
|
package/dist/src/_data.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Types } from '@dra2020/dra-analytics';
|
|
2
2
|
import * as T from './types';
|
|
3
3
|
import { AnalyticsSession } from './_api';
|
|
4
4
|
export declare type TransposedTable = {
|
|
@@ -48,9 +48,9 @@ export declare class Districts {
|
|
|
48
48
|
recalcStatistics(bLog?: boolean): void;
|
|
49
49
|
extractDistrictShapeProperties(bLog?: boolean): void;
|
|
50
50
|
getCountyIndex(geoID: string): number;
|
|
51
|
-
extractVotesByDemographic(districtID: number, groups:
|
|
51
|
+
extractVotesByDemographic(districtID: number, groups: Types.MinorityFilter, bLog?: boolean): Types.DemographicVotingByFeature | undefined;
|
|
52
52
|
}
|
|
53
|
-
export declare function inferSelectedMinority(groups:
|
|
53
|
+
export declare function inferSelectedMinority(groups: Types.MinorityFilter): string;
|
|
54
54
|
export declare class Features {
|
|
55
55
|
_session: AnalyticsSession;
|
|
56
56
|
_data: T.GeoFeatureCollection;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -3,12 +3,13 @@ export { geoIDForFeature, fieldForFeature, inferSelectedMinority } from './_data
|
|
|
3
3
|
export * from './results';
|
|
4
4
|
export * from './types';
|
|
5
5
|
export * from './utils';
|
|
6
|
-
import {
|
|
7
|
-
export declare type MinorityFilter =
|
|
8
|
-
export declare type Point =
|
|
9
|
-
export declare type DemographicVotingByFeature =
|
|
10
|
-
export declare type RPVFactor =
|
|
11
|
-
export declare type RPVAnalysis =
|
|
6
|
+
import { Partisan, Rate, Splitting, Types } from '@dra2020/dra-analytics';
|
|
7
|
+
export declare type MinorityFilter = Types.MinorityFilter;
|
|
8
|
+
export declare type Point = Types.dictPoint;
|
|
9
|
+
export declare type DemographicVotingByFeature = Types.DemographicVotingByFeature;
|
|
10
|
+
export declare type RPVFactor = Types.RPVFactor;
|
|
11
|
+
export declare type RPVAnalysis = Types.RPVAnalysis;
|
|
12
|
+
export declare const estSeatProbability: typeof Partisan.estSeatProbability;
|
|
12
13
|
export declare const ratePartisanBias: typeof Rate.ratePartisanBias;
|
|
13
14
|
export declare const isAntimajoritarian: typeof Rate.isAntimajoritarian;
|
|
14
15
|
export declare const avgSVError = 0.02;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
export declare type Profile = {
|
|
2
|
+
state: string;
|
|
3
|
+
name: string;
|
|
4
|
+
nDistricts: number;
|
|
5
|
+
nCounties: number;
|
|
6
|
+
bStateLeg: boolean;
|
|
7
|
+
population: PopulationProfile;
|
|
8
|
+
shapes: ShapeProfile;
|
|
9
|
+
counties: CountyProfile;
|
|
10
|
+
partisanship: PartisanProfile;
|
|
11
|
+
demographics: DemographicProfile;
|
|
12
|
+
};
|
|
13
|
+
export declare type Scorecard = {
|
|
14
|
+
partisan: PartisanScorecard;
|
|
15
|
+
minority: MinorityScorecard;
|
|
16
|
+
compactness: CompactnessScorecard;
|
|
17
|
+
splitting: SplittingScorecard;
|
|
18
|
+
populationDeviation: PopulationScorecard;
|
|
19
|
+
details: Dict;
|
|
20
|
+
};
|
|
21
|
+
export declare type PartisanProfile = {
|
|
22
|
+
statewide: number;
|
|
23
|
+
byDistrict: VfArray;
|
|
24
|
+
};
|
|
25
|
+
export declare type VfArray = number[];
|
|
26
|
+
export declare type PartisanScorecard = {
|
|
27
|
+
bias: Bias;
|
|
28
|
+
impact: Impact;
|
|
29
|
+
responsiveness: Responsiveness;
|
|
30
|
+
dSVpoints: SVpoint[];
|
|
31
|
+
rSVpoints: SVpoint[];
|
|
32
|
+
averageDVf: number | undefined;
|
|
33
|
+
averageRVf: number | undefined;
|
|
34
|
+
details: Dict;
|
|
35
|
+
};
|
|
36
|
+
export declare type rVpoints = {
|
|
37
|
+
Sb: number;
|
|
38
|
+
Ra: number;
|
|
39
|
+
Rb: number;
|
|
40
|
+
Va: number;
|
|
41
|
+
Vb: number;
|
|
42
|
+
};
|
|
43
|
+
export declare type Bias = {
|
|
44
|
+
bestS: number;
|
|
45
|
+
bestSf: number;
|
|
46
|
+
estS: number;
|
|
47
|
+
estSf: number;
|
|
48
|
+
deviation: number;
|
|
49
|
+
score: number;
|
|
50
|
+
tOf?: number;
|
|
51
|
+
fptpS?: number;
|
|
52
|
+
bS50?: number;
|
|
53
|
+
bV50?: number;
|
|
54
|
+
decl?: number | undefined;
|
|
55
|
+
rvPoints?: rVpoints;
|
|
56
|
+
gSym?: number;
|
|
57
|
+
gamma?: number;
|
|
58
|
+
eG?: number;
|
|
59
|
+
bSV?: number;
|
|
60
|
+
prop?: number;
|
|
61
|
+
mMs?: number;
|
|
62
|
+
mMd?: number;
|
|
63
|
+
lO?: number | undefined;
|
|
64
|
+
};
|
|
65
|
+
export declare type Impact = {
|
|
66
|
+
unearnedS: number;
|
|
67
|
+
score: number;
|
|
68
|
+
};
|
|
69
|
+
export declare type Responsiveness = {
|
|
70
|
+
bigR?: number | undefined;
|
|
71
|
+
littleR?: number | undefined;
|
|
72
|
+
mIR?: number | undefined;
|
|
73
|
+
rD?: number;
|
|
74
|
+
rDf?: number;
|
|
75
|
+
cSimple: number;
|
|
76
|
+
cD: number;
|
|
77
|
+
cDf: number;
|
|
78
|
+
score: number;
|
|
79
|
+
};
|
|
80
|
+
export declare type PopulationProfile = {
|
|
81
|
+
byDistrict: totalPopByDistrict;
|
|
82
|
+
targetSize: number;
|
|
83
|
+
};
|
|
84
|
+
export declare type totalPopByDistrict = number[];
|
|
85
|
+
export declare type PopulationScorecard = Measurement;
|
|
86
|
+
export declare type GeoProperties = {
|
|
87
|
+
area: number;
|
|
88
|
+
perimeter: number;
|
|
89
|
+
diameter: number;
|
|
90
|
+
};
|
|
91
|
+
export declare type ShapeProfile = GeoProperties[];
|
|
92
|
+
export declare type CompactnessScorecard = {
|
|
93
|
+
score: number;
|
|
94
|
+
reock: Measurement;
|
|
95
|
+
polsby: Measurement;
|
|
96
|
+
details: Dict;
|
|
97
|
+
};
|
|
98
|
+
export declare type CompactnessByDistrict = {
|
|
99
|
+
rawReock: number;
|
|
100
|
+
normalizedReock: number;
|
|
101
|
+
rawPolsby: number;
|
|
102
|
+
normalizedPolsby: number;
|
|
103
|
+
kiwysiScore?: number;
|
|
104
|
+
};
|
|
105
|
+
export declare type CountyProfile = CxD;
|
|
106
|
+
export declare type CxD = number[][];
|
|
107
|
+
export declare type SplittingScorecard = {
|
|
108
|
+
score: number;
|
|
109
|
+
county: Measurement;
|
|
110
|
+
district: Measurement;
|
|
111
|
+
details: Dict;
|
|
112
|
+
};
|
|
113
|
+
export declare type Demographics = {
|
|
114
|
+
white: number;
|
|
115
|
+
minority: number;
|
|
116
|
+
black: number;
|
|
117
|
+
hispanic: number;
|
|
118
|
+
pacific: number;
|
|
119
|
+
asian: number;
|
|
120
|
+
native: number;
|
|
121
|
+
};
|
|
122
|
+
export declare type DemographicProfile = {
|
|
123
|
+
statewide: Demographics;
|
|
124
|
+
byDistrict: Demographics[];
|
|
125
|
+
};
|
|
126
|
+
export declare type DemoBreakdown = {
|
|
127
|
+
pct35_40: number;
|
|
128
|
+
pct40_45: number;
|
|
129
|
+
pct45_50: number;
|
|
130
|
+
pct50_55: number;
|
|
131
|
+
pct55_60: number;
|
|
132
|
+
pct60Plus: number;
|
|
133
|
+
vapPct: number;
|
|
134
|
+
propSeats: number;
|
|
135
|
+
};
|
|
136
|
+
export declare type DemographicPivot = {
|
|
137
|
+
minority: DemoBreakdown;
|
|
138
|
+
black: DemoBreakdown;
|
|
139
|
+
hispanic: DemoBreakdown;
|
|
140
|
+
pacific: DemoBreakdown;
|
|
141
|
+
asian: DemoBreakdown;
|
|
142
|
+
native: DemoBreakdown;
|
|
143
|
+
};
|
|
144
|
+
export declare type MinorityScorecard = {
|
|
145
|
+
pivotByDemographic: DemographicPivot;
|
|
146
|
+
opportunityDistricts: number;
|
|
147
|
+
coalitionDistricts: number;
|
|
148
|
+
score: number;
|
|
149
|
+
details: Dict;
|
|
150
|
+
};
|
|
151
|
+
export declare type Measurement = {
|
|
152
|
+
raw: number;
|
|
153
|
+
normalized: number;
|
|
154
|
+
byDistrict?: any[];
|
|
155
|
+
notes: Dict;
|
|
156
|
+
};
|
|
157
|
+
export declare type SVpoint = {
|
|
158
|
+
v: number;
|
|
159
|
+
s: number;
|
|
160
|
+
};
|
|
161
|
+
export declare type Dict = {
|
|
162
|
+
[key: string]: any;
|
|
163
|
+
};
|
package/dist/src/minority.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Types } from '@dra2020/dra-analytics';
|
|
2
2
|
import * as T from './types';
|
|
3
3
|
import { AnalyticsSession } from './_api';
|
|
4
4
|
export declare function getMajorityMinority(s: AnalyticsSession): T.Dict;
|
|
5
5
|
export declare function getVRASection5(s: AnalyticsSession): string;
|
|
6
|
-
export declare function doAnalyzeRacialPolarization(s: AnalyticsSession, districtID: number, groups:
|
|
6
|
+
export declare function doAnalyzeRacialPolarization(s: AnalyticsSession, districtID: number, groups: Types.MinorityFilter, bLog?: boolean): Types.RPVAnalysis | undefined;
|
package/dist/src/political.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
package/dist/src/score.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import * as Score from '@dra2020/dra-score';
|
|
2
|
+
import * as T from './types';
|
|
2
3
|
import { AnalyticsSession } from './_api';
|
|
4
|
+
import { Types } from '@dra2020/dra-analytics';
|
|
5
|
+
import * as L from './legacy-types';
|
|
3
6
|
export declare function profilePlan(s: AnalyticsSession, bLog?: boolean): Score.Profile;
|
|
4
7
|
export declare function getStatewideDemographics(s: AnalyticsSession, bLog?: boolean): Score.Demographics;
|
|
5
8
|
export declare function scorePlan(s: AnalyticsSession, p: Score.Profile, bLog?: boolean, overridesJSON?: any): Score.Scorecard;
|
|
9
|
+
export declare function computeMetrics(p: Score.Profile, districtShapes: T.GeoFeatureCollection, bLog?: boolean): Types.Scorecard;
|
|
10
|
+
export declare function rateKeyDimensions(scorecard: Types.Scorecard, p: Score.Profile, bLog?: boolean): Types.Scorecard;
|
|
11
|
+
export declare function thunkScorecard(newScorecard: Types.Scorecard, bLog?: boolean): L.Scorecard;
|
|
12
|
+
export declare function compareScorecards(altLegacyScorecard: Score.Scorecard, legacyScorecard: Score.Scorecard, bLog?: boolean): void;
|
package/dist/src/settings.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
export declare const PRECISION: number;
|
|
2
|
-
export declare const NORMALIZED_RANGE: number;
|
|
3
2
|
export declare const NOT_ASSIGNED: number;
|
|
4
3
|
export declare const NUMBER_OF_ITEMS_TO_REPORT: number;
|
|
5
4
|
export declare const OUT_OF_STATE: string;
|
|
6
|
-
export declare const EQUAL_TOLERANCE: number;
|
|
7
|
-
export declare const COUNTY_SPLITTING_WEIGHT = 0.8;
|
|
8
|
-
export declare const DISTRICT_SPLITTING_WEIGHT: number;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -68,11 +68,6 @@ export declare type WeightedNeighbors = {
|
|
|
68
68
|
[geoID: string]: number;
|
|
69
69
|
};
|
|
70
70
|
export declare type UnweightedNeighbors = string[];
|
|
71
|
-
export declare type TestScale = {
|
|
72
|
-
scale: Array<number>;
|
|
73
|
-
bInvertRaw?: boolean;
|
|
74
|
-
bInvertScaled?: boolean;
|
|
75
|
-
};
|
|
76
71
|
export declare type TestEntry = {
|
|
77
72
|
score?: number | boolean;
|
|
78
73
|
details: Dict;
|
|
@@ -127,4 +122,4 @@ export declare type Ratings = {
|
|
|
127
122
|
compactness: number;
|
|
128
123
|
splitting: number;
|
|
129
124
|
};
|
|
130
|
-
export { Profile, Scorecard,
|
|
125
|
+
export { Profile, Scorecard, } from '@dra2020/dra-score';
|
package/dist/src/utils.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { AnalyticsSession } from './_api';
|
|
2
2
|
import * as T from './types';
|
|
3
|
-
export declare function isInState(geoID: string): boolean;
|
|
4
|
-
export declare function isOutOfState(geoID: string): boolean;
|
|
5
3
|
export declare function getDistrict(plan: T.PlanByGeoID, geoID: string): number | undefined;
|
|
6
4
|
export declare function parseGeoID(geoID: string): T.GeoIDParts;
|
|
7
5
|
export declare function isWaterOnly(geoID: string, s?: AnalyticsSession): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dra2020/district-analytics",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.2.0",
|
|
4
4
|
"description": "District analytics TypeScript package",
|
|
5
5
|
"main": "dist/district-analytics.js",
|
|
6
6
|
"files": [
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@dra2020/baseclient": "^1.0.38",
|
|
51
|
-
"@dra2020/dra-analytics": "^0.
|
|
51
|
+
"@dra2020/dra-analytics": "^0.6.0",
|
|
52
52
|
"@dra2020/dra-score": "^11.1.3",
|
|
53
53
|
"@dra2020/dra-types": "^1.8.28",
|
|
54
54
|
"geojson": "^0.5.0"
|