@dra2020/district-analytics 10.1.2 → 10.2.2

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.
@@ -22,7 +22,7 @@ export declare class AnalyticsSession {
22
22
  constructor(SessionRequest: T.SessionRequest);
23
23
  processConfig(config: T.Dict): T.Dict;
24
24
  analyzePlan(bLog?: boolean, overridesJSON?: any): boolean;
25
- analyzeRacialPolarization(id: number, bLog?: boolean): D.Demographics | undefined;
25
+ analyzeRacialPolarization(districtID: number, groups?: T.MinorityFilter, bLog?: boolean): T.RPVAnalysis | undefined;
26
26
  getDistrictStatistics(bLog?: boolean): DistrictStatistics;
27
27
  getPlanProfile(bLog?: boolean): Score.Profile;
28
28
  getPlanScorecard(bLog?: boolean): Score.Scorecard;
@@ -31,15 +31,6 @@ export declare type TransposedTable = {
31
31
  asianPct: number[];
32
32
  nativePct: number[];
33
33
  };
34
- export declare type Demographics = {
35
- white: number | undefined;
36
- minority: number | undefined;
37
- black: number | undefined;
38
- hispanic: number | undefined;
39
- pacific: number | undefined;
40
- asian: number | undefined;
41
- native: number | undefined;
42
- };
43
34
  export declare type Point = {
44
35
  x: number;
45
36
  y: number;
@@ -69,7 +60,7 @@ export declare class Districts {
69
60
  recalcStatistics(bLog?: boolean): void;
70
61
  extractDistrictShapeProperties(bLog?: boolean): void;
71
62
  getCountyIndex(geoID: string): number;
72
- extractVotesByDemographic(districtID: number, bLog?: boolean): DemographicVotingByFeature | undefined;
63
+ extractVotesByDemographic(districtID: number, groups: T.MinorityFilter, bLog?: boolean): DemographicVotingByFeature | undefined;
73
64
  }
74
65
  export declare class Features {
75
66
  _session: AnalyticsSession;
@@ -1,4 +1,3 @@
1
1
  export * from './_api';
2
2
  export * from './results';
3
3
  export * from './types';
4
- export { Demographics } from './_data';
@@ -1,6 +1,5 @@
1
1
  import * as T from './types';
2
2
  import { AnalyticsSession } from './_api';
3
- import { Demographics } from './_data';
4
3
  export declare function getMajorityMinority(s: AnalyticsSession): T.Dict;
5
4
  export declare function getVRASection5(s: AnalyticsSession): string;
6
- export declare function doAnalyzeRacialPolarization(s: AnalyticsSession, districtID: number, bLog?: boolean): Demographics | undefined;
5
+ export declare function doAnalyzeRacialPolarization(s: AnalyticsSession, districtID: number, groups?: T.MinorityFilter, bLog?: boolean): T.RPVAnalysis | undefined;
@@ -63,6 +63,30 @@ 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 RPVLine = {
76
+ m: number;
77
+ b: number;
78
+ r2: number;
79
+ f1: number;
80
+ };
81
+ export declare type RPVAnalysis = {
82
+ white: RPVLine | undefined;
83
+ minority: RPVLine | undefined;
84
+ black: RPVLine | undefined;
85
+ hispanic: RPVLine | undefined;
86
+ pacific: RPVLine | undefined;
87
+ asian: RPVLine | undefined;
88
+ native: RPVLine | undefined;
89
+ };
66
90
  export declare type TestScale = {
67
91
  scale: Array<number>;
68
92
  bInvertRaw?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dra2020/district-analytics",
3
- "version": "10.1.2",
3
+ "version": "10.2.2",
4
4
  "description": "District analytics TypeScript package",
5
5
  "main": "dist/district-analytics.js",
6
6
  "files": [