@dra2020/district-analytics 11.5.2 → 12.1.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.
@@ -50,6 +50,7 @@ export declare class Districts {
50
50
  getCountyIndex(geoID: string): number;
51
51
  extractVotesByDemographic(districtID: number, groups: RPV.MinorityFilter, bLog?: boolean): RPV.DemographicVotingByFeature | undefined;
52
52
  }
53
+ export declare function inferSelectedMinority(groups: RPV.MinorityFilter): string;
53
54
  export declare class Features {
54
55
  _session: AnalyticsSession;
55
56
  _data: T.GeoFeatureCollection;
@@ -58,19 +59,19 @@ export declare class Features {
58
59
  constructor(s: AnalyticsSession, data: T.GeoFeatureCollection, keys: T.DatasetKeys);
59
60
  nFeatures(): number;
60
61
  featureByIndex(i: number): T.GeoFeature;
61
- geoIDForFeature(f: any): string;
62
- fieldForFeature(f: any, dt: T.Dataset, fk: string): any;
63
62
  resetDataset(d: T.Dataset, k: string): void;
64
63
  mapGeoIDsToFeatureIDs(): void;
65
64
  featureID(i: string): number;
66
65
  }
67
- export declare function inferSelectedMinority(groups: RPV.MinorityFilter): string;
66
+ export declare function geoIDForFeature(f: any): string;
67
+ export declare function fieldForFeature(f: any, dk: string, fk: string): any;
68
68
  export declare class Counties {
69
69
  _session: AnalyticsSession;
70
70
  _data: T.GeoFeatureCollection;
71
71
  _countyNameLookup: T.FIPSCodeToCountyNameMap;
72
72
  nCounties: number;
73
73
  index: T.FIPSToOrdinalMap;
74
+ fips: T.OrdinalToFIPSlMap;
74
75
  totalPopulation: number[];
75
76
  constructor(s: AnalyticsSession, data: T.GeoFeatureCollection);
76
77
  countyByIndex(i: number): T.GeoFeature;
@@ -1,5 +1,6 @@
1
1
  export * from './_api';
2
+ export { geoIDForFeature, fieldForFeature, inferSelectedMinority } from './_data';
2
3
  export * from './results';
3
4
  export * from './types';
4
- export { inferSelectedMinority } from './_data';
5
+ export * from './utils';
5
6
  export { MinorityFilter, Point, DemographicVotingByFeature, RPVFactor, RPVAnalysis } from '@dra2020/racial-voting';
@@ -0,0 +1,2 @@
1
+ import { AnalyticsSession } from './_api';
2
+ export declare function estimatePGBias(s: AnalyticsSession, bLog?: boolean): number;
@@ -52,6 +52,9 @@ export declare type FIPSCodeToCountyNameMap = {
52
52
  export declare type FIPSToOrdinalMap = {
53
53
  [FIPSCode: string]: number;
54
54
  };
55
+ export declare type OrdinalToFIPSlMap = {
56
+ [index: number]: string;
57
+ };
55
58
  export declare type GeoFeature = geojson.Feature;
56
59
  export declare type GeoFeatureArray = GeoFeature[];
57
60
  export declare type GeoFeatureCollection = geojson.FeatureCollection;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dra2020/district-analytics",
3
- "version": "11.5.2",
3
+ "version": "12.1.0",
4
4
  "description": "District analytics TypeScript package",
5
5
  "main": "dist/district-analytics.js",
6
6
  "files": [
@@ -48,11 +48,11 @@
48
48
  "yargs": "^12.0.5"
49
49
  },
50
50
  "dependencies": {
51
- "@dra2020/baseclient": "^1.0.0",
51
+ "@dra2020/baseclient": "^1.0.26",
52
52
  "@dra2020/compactness": "^3.0.1",
53
53
  "@dra2020/dra-graph": "^2.0.2",
54
- "@dra2020/dra-score": "^11.1.2",
55
- "@dra2020/dra-types": "^1.6.7",
54
+ "@dra2020/dra-score": "^11.1.3",
55
+ "@dra2020/dra-types": "^1.8.22",
56
56
  "@dra2020/racial-voting": "^3.1.0",
57
57
  "geojson": "^0.5.0"
58
58
  }