@dra2020/district-analytics 14.1.1 → 14.1.2
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/district-analytics.js +9 -24
- package/dist/district-analytics.js.map +1 -1
- package/dist/node_modules/@dra2020/dra-analytics/lib/types/all.d.ts +7 -0
- package/dist/node_modules/@dra2020/dra-analytics/lib/types/compactness.d.ts +40 -0
- package/dist/node_modules/@dra2020/dra-analytics/lib/types/general.d.ts +17 -0
- package/dist/node_modules/@dra2020/dra-analytics/lib/types/graph.d.ts +14 -0
- package/dist/node_modules/@dra2020/dra-analytics/lib/types/minority.d.ts +90 -0
- package/dist/node_modules/@dra2020/dra-analytics/lib/types/partisan.d.ts +64 -0
- package/dist/node_modules/@dra2020/dra-analytics/lib/types/population.d.ts +7 -0
- package/dist/node_modules/@dra2020/dra-analytics/lib/types/splitting.d.ts +9 -0
- package/dist/src/_api.d.ts +2 -2
- package/dist/src/_data.d.ts +3 -3
- package/dist/src/index.d.ts +6 -6
- package/dist/src/minority.d.ts +2 -2
- package/dist/src/political.d.ts +1 -1
- package/package.json +2 -2
|
@@ -106,9 +106,15 @@ class AnalyticsSession {
|
|
|
106
106
|
return false;
|
|
107
107
|
(0, preprocess_1.doPreprocessData)(this, bLog);
|
|
108
108
|
(0, analyze_1.doAnalyzeDistricts)(this, bLog);
|
|
109
|
+
// This does a little stuff that didn't get factored out into dra-score and then dra-analytics
|
|
109
110
|
(0, analyze_1.doAnalyzePlan)(this, bLog);
|
|
111
|
+
// The main analytics are next
|
|
112
|
+
// Run legacy analytics
|
|
110
113
|
this._profile = (0, score_1.profilePlan)(this, bLog);
|
|
111
114
|
this._scorecard = (0, score_1.scorePlan)(this, this._profile, bLog, overridesJSON);
|
|
115
|
+
// TODO: Run new analytics
|
|
116
|
+
// TODO: Compare the new & legacy scorecards
|
|
117
|
+
// TODO: Set a scorecard
|
|
112
118
|
(0, results_1.doAnalyzePostProcessing)(this, bLog);
|
|
113
119
|
}
|
|
114
120
|
catch (e) {
|
|
@@ -238,7 +244,8 @@ const dra_analytics_1 = __webpack_require__(/*! @dra2020/dra-analytics */ "@dra2
|
|
|
238
244
|
const U = __importStar(__webpack_require__(/*! ./utils */ "./src/utils.ts"));
|
|
239
245
|
const S = __importStar(__webpack_require__(/*! ./settings */ "./src/settings.ts"));
|
|
240
246
|
const compact_1 = __webpack_require__(/*! ./compact */ "./src/compact.ts");
|
|
241
|
-
const
|
|
247
|
+
const dra_analytics_2 = __webpack_require__(/*! @dra2020/dra-analytics */ "@dra2020/dra-analytics");
|
|
248
|
+
// import { fptpWin } from './political'
|
|
242
249
|
// DEBUG COUNTERS
|
|
243
250
|
let nMissingDataset = 0;
|
|
244
251
|
let nMissingProperty = 0;
|
|
@@ -472,7 +479,7 @@ class Districts {
|
|
|
472
479
|
demPct = demVotes / totVotes;
|
|
473
480
|
repPct = repVotes / totVotes;
|
|
474
481
|
othPct = othVotes / totVotes;
|
|
475
|
-
DemSeat =
|
|
482
|
+
DemSeat = dra_analytics_2.Partisan.fptpWin(demPct);
|
|
476
483
|
}
|
|
477
484
|
// Total minority VAP
|
|
478
485
|
let minorityPop = totalVAP - whitePop;
|
|
@@ -1642,28 +1649,6 @@ exports.doAnalyzeRacialPolarization = doAnalyzeRacialPolarization;
|
|
|
1642
1649
|
// 11-18-2020 - Moved RPV to racial-voting package.
|
|
1643
1650
|
|
|
1644
1651
|
|
|
1645
|
-
/***/ }),
|
|
1646
|
-
|
|
1647
|
-
/***/ "./src/political.ts":
|
|
1648
|
-
/*!**************************!*\
|
|
1649
|
-
!*** ./src/political.ts ***!
|
|
1650
|
-
\**************************/
|
|
1651
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
//
|
|
1655
|
-
// FAIR/PROPORTIONAL
|
|
1656
|
-
//
|
|
1657
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1658
|
-
exports.fptpWin = void 0;
|
|
1659
|
-
function fptpWin(demPct) {
|
|
1660
|
-
// Vote shares should be fractions in the range [0.0 – 1.0]
|
|
1661
|
-
//assert((demPct <= 1.0) && (demPct >= 0.0));
|
|
1662
|
-
return ((demPct > 0.5) ? 1 : 0);
|
|
1663
|
-
}
|
|
1664
|
-
exports.fptpWin = fptpWin;
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
1652
|
/***/ }),
|
|
1668
1653
|
|
|
1669
1654
|
/***/ "./src/preprocess.ts":
|