@dra2020/district-analytics 10.2.7 → 10.3.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/dist/district-analytics.js +146 -76
- package/dist/district-analytics.js.map +1 -1
- package/dist/src/_api.d.ts +2 -1
- package/dist/src/_data.d.ts +2 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/minority.d.ts +2 -1
- package/dist/src/types.d.ts +0 -40
- package/package.json +2 -1
package/dist/src/_api.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as Score from '@dra2020/dra-score';
|
|
2
|
+
import * as RPV from '@dra2020/racial-voting';
|
|
2
3
|
import { RequirementsChecklist } from './results';
|
|
3
4
|
import { DistrictStatistics } from './results';
|
|
4
5
|
import * as D from './_data';
|
|
@@ -22,7 +23,7 @@ export declare class AnalyticsSession {
|
|
|
22
23
|
constructor(SessionRequest: T.SessionRequest);
|
|
23
24
|
processConfig(config: T.Dict): T.Dict;
|
|
24
25
|
analyzePlan(bLog?: boolean, overridesJSON?: any): boolean;
|
|
25
|
-
analyzeRacialPolarization(districtID: number, groups
|
|
26
|
+
analyzeRacialPolarization(districtID: number, groups: RPV.MinorityFilter, bLog?: boolean): RPV.RPVAnalysis | undefined;
|
|
26
27
|
getDistrictStatistics(bLog?: boolean): DistrictStatistics;
|
|
27
28
|
getPlanProfile(bLog?: boolean): Score.Profile;
|
|
28
29
|
getPlanScorecard(bLog?: boolean): Score.Scorecard;
|
package/dist/src/_data.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as RPV from '@dra2020/racial-voting';
|
|
1
2
|
import * as T from './types';
|
|
2
3
|
import { AnalyticsSession } from './_api';
|
|
3
4
|
export declare type TransposedTable = {
|
|
@@ -47,7 +48,7 @@ export declare class Districts {
|
|
|
47
48
|
recalcStatistics(bLog?: boolean): void;
|
|
48
49
|
extractDistrictShapeProperties(bLog?: boolean): void;
|
|
49
50
|
getCountyIndex(geoID: string): number;
|
|
50
|
-
extractVotesByDemographic(districtID: number, groups:
|
|
51
|
+
extractVotesByDemographic(districtID: number, groups: RPV.MinorityFilter, bLog?: boolean): RPV.DemographicVotingByFeature | undefined;
|
|
51
52
|
}
|
|
52
53
|
export declare class Features {
|
|
53
54
|
_session: AnalyticsSession;
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/minority.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import * as RPV from '@dra2020/racial-voting';
|
|
1
2
|
import * as T from './types';
|
|
2
3
|
import { AnalyticsSession } from './_api';
|
|
3
4
|
export declare function getMajorityMinority(s: AnalyticsSession): T.Dict;
|
|
4
5
|
export declare function getVRASection5(s: AnalyticsSession): string;
|
|
5
|
-
export declare function doAnalyzeRacialPolarization(s: AnalyticsSession, districtID: number, groups
|
|
6
|
+
export declare function doAnalyzeRacialPolarization(s: AnalyticsSession, districtID: number, groups: RPV.MinorityFilter, bLog?: boolean): RPV.RPVAnalysis | undefined;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -63,46 +63,6 @@ export declare type WeightedNeighbors = {
|
|
|
63
63
|
[geoID: string]: number;
|
|
64
64
|
};
|
|
65
65
|
export declare type UnweightedNeighbors = string[];
|
|
66
|
-
export declare type MinorityFilter = {
|
|
67
|
-
white: boolean;
|
|
68
|
-
minority: boolean;
|
|
69
|
-
black: boolean;
|
|
70
|
-
hispanic: boolean;
|
|
71
|
-
pacific: boolean;
|
|
72
|
-
asian: boolean;
|
|
73
|
-
native: boolean;
|
|
74
|
-
};
|
|
75
|
-
export declare type Point = {
|
|
76
|
-
x: number;
|
|
77
|
-
y: number;
|
|
78
|
-
};
|
|
79
|
-
export declare type DemographicVotingByFeature = {
|
|
80
|
-
ids: string[];
|
|
81
|
-
white: Point[];
|
|
82
|
-
minority: Point[];
|
|
83
|
-
black: Point[];
|
|
84
|
-
hispanic: Point[];
|
|
85
|
-
pacific: Point[];
|
|
86
|
-
asian: Point[];
|
|
87
|
-
native: Point[];
|
|
88
|
-
};
|
|
89
|
-
export declare type RPVLine = {
|
|
90
|
-
m: number;
|
|
91
|
-
b: number;
|
|
92
|
-
r2: number;
|
|
93
|
-
f1: number;
|
|
94
|
-
points: Point[];
|
|
95
|
-
};
|
|
96
|
-
export declare type RPVAnalysis = {
|
|
97
|
-
ids: string[] | undefined;
|
|
98
|
-
white: RPVLine | undefined;
|
|
99
|
-
minority: RPVLine | undefined;
|
|
100
|
-
black: RPVLine | undefined;
|
|
101
|
-
hispanic: RPVLine | undefined;
|
|
102
|
-
pacific: RPVLine | undefined;
|
|
103
|
-
asian: RPVLine | undefined;
|
|
104
|
-
native: RPVLine | undefined;
|
|
105
|
-
};
|
|
106
66
|
export declare type TestScale = {
|
|
107
67
|
scale: Array<number>;
|
|
108
68
|
bInvertRaw?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dra2020/district-analytics",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.3.1",
|
|
4
4
|
"description": "District analytics TypeScript package",
|
|
5
5
|
"main": "dist/district-analytics.js",
|
|
6
6
|
"files": [
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"@dra2020/dra-score": "^10.0.8",
|
|
54
54
|
"@dra2020/dra-types": "^1.6.1",
|
|
55
55
|
"@dra2020/poly": "^1.5.0",
|
|
56
|
+
"@dra2020/racial-voting": "^1.0.0",
|
|
56
57
|
"@dra2020/util": "^1.0.54",
|
|
57
58
|
"geojson": "^0.5.0"
|
|
58
59
|
}
|