@dra2020/district-analytics 1.0.10 → 2.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/dist/report.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import * as T from './types';
2
- import { AnalyticsSession } from './_api';
3
- export declare type Scorecard = {
4
- [category: number]: ScorecardCategoryEntry;
5
- };
6
- declare type ScorecardCategoryEntry = {
7
- catName: string;
8
- catScore?: number | boolean;
9
- catTests: T.TestEntries;
10
- };
11
- export declare function doConfigureScales(s: AnalyticsSession): void;
12
- export declare function doAnalyzePostProcessing(s: AnalyticsSession): void;
13
- export declare function doPrepareScorecard(s: AnalyticsSession): any;
14
- export declare function doPrepareTestLog(s: AnalyticsSession): any;
15
- export {};
@@ -1,5 +0,0 @@
1
- export declare const PRECISION: number;
2
- export declare const NORMALIZED_RANGE: number;
3
- export declare const NOT_ASSIGNED: number;
4
- export declare const NUMBER_OF_ITEMS_TO_REPORT: number;
5
- export declare const OUT_OF_STATE: string;
package/dist/types.d.ts DELETED
@@ -1,110 +0,0 @@
1
- import * as geojson from 'geojson';
2
- export declare const enum Suite {
3
- Legal = 0,
4
- Fair = 1,
5
- Best = 2
6
- }
7
- export declare type SessionRequest = {
8
- title: string;
9
- stateXX: string;
10
- nDistricts: number;
11
- legislativeDistricts: boolean;
12
- plan: PlanByGeoID;
13
- data: GeoFeatureCollection;
14
- districtShapes: GeoFeatureCollection;
15
- districtProperties: DistrictProperties;
16
- graph: ContiguityGraph;
17
- countyNameLookup: FIPSCodeToCountyNameMap;
18
- counties: GeoFeatureCollection;
19
- config: {};
20
- };
21
- export declare type PlanByGeoID = {
22
- [geoID: string]: number;
23
- };
24
- export declare type PlanByDistrictID = {
25
- [districtID: number]: Set<string>;
26
- };
27
- export declare type FeaturesByGeoID = {
28
- [geoID: string]: number;
29
- };
30
- export declare type FIPSCodeToCountyNameMap = {
31
- [FIPSCode: string]: string;
32
- };
33
- export declare type FIPSToOrdinalMap = {
34
- [FIPSCode: string]: number;
35
- };
36
- export declare type GeoFeature = geojson.Feature;
37
- export declare type GeoFeatureArray = GeoFeature[];
38
- export declare type GeoFeatureCollection = geojson.FeatureCollection;
39
- export interface GeoFeatureMap {
40
- [geoID: string]: GeoFeature;
41
- }
42
- export declare type ContiguityGraph = {
43
- [geoID: string]: Neighbors;
44
- };
45
- export declare type Neighbors = {
46
- [geoID: string]: number;
47
- };
48
- export declare type VoteTriple = [number, number, number];
49
- export declare const enum VoteType {
50
- Democratic = 0,
51
- Republican = 1,
52
- Total = 2
53
- }
54
- export declare type TestScale = {
55
- testScale: Array<number>;
56
- testInvertp: boolean;
57
- };
58
- export declare type TestScales = {
59
- [test: number]: TestScale;
60
- };
61
- export declare type TestEntry = {
62
- score?: number | boolean;
63
- details: Dict;
64
- normalizedScore?: number;
65
- };
66
- export declare type DistrictWIP = {
67
- [districtID: number]: any;
68
- };
69
- export declare const enum Test {
70
- Complete = 0,
71
- Contiguous = 1,
72
- FreeOfHoles = 2,
73
- EqualPopulation = 3,
74
- PopulationDeviation = 4,
75
- Reock = 5,
76
- PolsbyPopper = 6,
77
- CountySplits = 7,
78
- Complexity = 8,
79
- SeatsBias = 9,
80
- VotesBias = 10,
81
- Responsiveness = 11,
82
- ResponsiveDistricts = 12,
83
- EfficiencyGap = 13,
84
- MajorityMinorityDistricts = 14
85
- }
86
- export declare type TestEntries = {
87
- [test: number]: TestEntry;
88
- };
89
- export declare type DistrictProperties = {
90
- [districtID: number]: any;
91
- };
92
- export declare type DistrictShapeProperties = [number, number, number];
93
- export declare const enum DistrictShapeProperty {
94
- Area = 0,
95
- Diameter = 1,
96
- Perimeter = 2
97
- }
98
- export declare type GeoIDParts = {
99
- state?: string;
100
- county?: string;
101
- tract?: string;
102
- bg?: string;
103
- block?: string;
104
- };
105
- export declare type GeoIDTotal = {
106
- [geoID: string]: number;
107
- };
108
- export declare type Dict = {
109
- [key: string]: any;
110
- };
package/dist/utils.d.ts DELETED
@@ -1,28 +0,0 @@
1
- import * as T from './types';
2
- export declare function isInState(geoID: string): boolean;
3
- export declare function isOutOfState(geoID: string): boolean;
4
- export declare function getDistrict(plan: T.PlanByGeoID, geoID: string): number | undefined;
5
- export declare function invertPlan(plan: T.PlanByGeoID): T.PlanByDistrictID;
6
- export declare function parseGeoID(geoID: string): T.GeoIDParts;
7
- export declare function getFIPSFromCountyGeoID(geoID: string): string;
8
- export declare function normalize(rawScore: number, scale: Array<number>, invertp?: boolean): number;
9
- export declare function trim(fullFraction: number): number;
10
- export declare function sumArray(arr: number[]): number;
11
- export declare function avgArray(arr: number[]): number;
12
- export declare function minArray(arr: number[]): number;
13
- export declare function maxArray(arr: number[]): number;
14
- export declare function initArray(n: number, value: any): any[];
15
- export declare function andArray(arr: boolean[]): boolean;
16
- export declare function keyExists(k: string, o: object): boolean;
17
- export declare function isObjectEmpty(o: object): boolean;
18
- export declare function isSetEmpty(s: any): boolean;
19
- export declare function isArrayEmpty(a: any[]): boolean;
20
- export declare function getObjectKeys(o: object): string[];
21
- export declare function getNumericObjectKeys(o: object): number[];
22
- export declare function getSelectObjectKeys(o: T.Dict, v: any[]): string[];
23
- export declare function arrayContains(a: any[], item: any): boolean;
24
- export declare function objectContains(o: object, key: any): boolean;
25
- export declare function countEnumValues(enumName: any): number;
26
- export declare function shallowCopy(src: any): any;
27
- export declare function deepCopy(src: any): any;
28
- export { depthof } from '@dra2020/util';
package/dist/valid.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import * as T from './types';
2
- import * as D from './_data';
3
- import { AnalyticsSession } from './_api';
4
- export declare function doIsComplete(s: AnalyticsSession): T.TestEntry;
5
- export declare function doIsContiguous(s: AnalyticsSession): T.TestEntry;
6
- export declare function isConnected(districtGeos: Set<string>, graph: D.Graph): boolean;
7
- export declare function doIsFreeOfHoles(s: AnalyticsSession): T.TestEntry;
8
- export declare function isEmbedded(districtID: number, geoIDs: Set<string>, plan: D.Plan, graph: D.Graph): boolean;