# District Analytics

Analytics for scoring congressional and legislative district maps.

## Sample Code

```javascript
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['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 text: any;
let score: DA.GradedTest | DA.PassFailTest;
let s = new DA.AnalyticsSession(sr);

s.analyzePlan();
text = s.prepareScorecard();
text = s.prepareTestLog();

s.getTest(DA.Tests.Contiguous)
```

## License

Distributed under the [The MIT License (MIT)](https://github.com/alecramsay/district-analytics/blob/master/LICENSE) Copyright © 2019 Alec Ramsay
