Type definitions and code used by dra-client and fn-all (lambdas), and which invokes dra-analytics
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();
Distributed under the The MIT License (MIT) Copyright © 2019 Alec Ramsay