@dra2020/district-analytics
TypeScript icon, indicating that this package has built-in type declarations

16.1.4 • Public • Published

District Analytics

Type definitions and code used by dra-client and fn-all (lambdas), and which invokes dra-analytics

Build Status

CircleCI

Sample Code

import * as DA from 'district-analytics';

let sr = {} as DA.SessionRequest;
sr['title'] = "NC 2016 Contingent Corrected Map";
sr['stateXX'] = "NC";
sr['nDistricts'] = 13;
sr['planType'] = PlanType.congress;  // One or ...
sr['legislativeDistricts'] = false;  // ... the other
sr['data'] = data as T.GeoFeatureCollection;
sr['counties'] = counties as T.GeoFeatureCollection;
sr['graph'] = graph as T.ContiguityGraph;
sr['plan'] = planByGeoID as DA.PlanByGeoID;
sr['districtShapes'] = districtShapes as T.GeoFeatureCollection;
sr['config'] = config as T.Dict;

let s = new DA.AnalyticsSession(sr);

let bLog = false;
s.analyzePlan(bLog);

const statistics: DA.DistrictStatistics = s.getDistrictStatistics();
const requirements: DA.RequirementsChecklist = s.getRequirementsChecklist();
const scorecard: DA.Scorecard = s.getPlanScorecard();
const ratings: DA.Ratings = s.getRatings();

const discontiguous = DA.GeoFeatureCollection = s.getDiscontiguousDistrictFeatures();

License

Distributed under the The MIT License (MIT) Copyright © 2019 Alec Ramsay

Readme

Keywords

Package Sidebar

Install

npm i @dra2020/district-analytics

Weekly Downloads

4

Version

16.1.4

License

MIT

Unpacked Size

404 kB

Total Files

38

Last publish

Collaborators

  • alecramsay
  • terrencecrowley
  • davebradlee