@dra2020/district-analytics 5.0.1 → 5.0.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/cli.js CHANGED
@@ -91185,7 +91185,7 @@ function calcMinimalInverseResponsiveness(Vf, r) {
91185
91185
  const bBalanced = isBalanced(Vf);
91186
91186
  const ideal = bBalanced ? 0.1 : 0.2;
91187
91187
  MIR = (1 / r) - ideal;
91188
- MIR = U.trim(MIR);
91188
+ MIR = U.trim(Math.max(MIR, 0.0));
91189
91189
  }
91190
91190
  return MIR;
91191
91191
  }
@@ -102571,6 +102571,49 @@ function gfDiameter(poly) {
102571
102571
  exports.gfDiameter = gfDiameter;
102572
102572
 
102573
102573
 
102574
+ /***/ }),
102575
+
102576
+ /***/ "./src/minority.ts":
102577
+ /*!*************************!*\
102578
+ !*** ./src/minority.ts ***!
102579
+ \*************************/
102580
+ /*! no static exports found */
102581
+ /***/ (function(module, exports, __webpack_require__) {
102582
+
102583
+ "use strict";
102584
+
102585
+ //
102586
+ // PROTECTS MINORITIES
102587
+ //
102588
+ var __importDefault = (this && this.__importDefault) || function (mod) {
102589
+ return (mod && mod.__esModule) ? mod : { "default": mod };
102590
+ };
102591
+ Object.defineProperty(exports, "__esModule", { value: true });
102592
+ const majority_minority_json_1 = __importDefault(__webpack_require__(/*! ../static/majority-minority.json */ "./static/majority-minority.json"));
102593
+ const vra5_preclearance_json_1 = __importDefault(__webpack_require__(/*! ../static/vra5-preclearance.json */ "./static/vra5-preclearance.json"));
102594
+ // import stateContacts from '../static/state-contacts.json';
102595
+ // import demographicDefs from '../static/demographic-defns.json';
102596
+ // TODO - 2020: Update/revise this, when the update comes out in September:
102597
+ // Sources for majority-minority info:
102598
+ // - https://en.wikipedia.org/wiki/List_of_majority-minority_United_States_congressional_districts
102599
+ // - http://www.ncsl.org/Portals/1/Documents/Redistricting/Redistricting_2010.pdf (PP. 80–84)
102600
+ // - https://www.justice.gov/crt/jurisdictions-previously-covered-section-5
102601
+ function getMajorityMinority(s) {
102602
+ const xx = s.state.xx;
102603
+ const mMDict = majority_minority_json_1.default;
102604
+ const stateMM = mMDict[xx];
102605
+ return stateMM;
102606
+ }
102607
+ exports.getMajorityMinority = getMajorityMinority;
102608
+ function getVRASection5(s) {
102609
+ const xx = s.state.xx;
102610
+ const vraPreDict = vra5_preclearance_json_1.default;
102611
+ const stateVRAPre = vraPreDict[xx];
102612
+ return stateVRAPre;
102613
+ }
102614
+ exports.getVRASection5 = getVRASection5;
102615
+
102616
+
102574
102617
  /***/ }),
102575
102618
 
102576
102619
  /***/ "./src/political.ts":
@@ -103035,6 +103078,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
103035
103078
  const Score = __importStar(__webpack_require__(/*! @dra2020/dra-score */ "./node_modules/@dra2020/dra-score/dist/dra-score.bundle.js"));
103036
103079
  const U = __importStar(__webpack_require__(/*! ./utils */ "./src/utils.ts"));
103037
103080
  const D = __importStar(__webpack_require__(/*! ./_data */ "./src/_data.ts"));
103081
+ const M = __importStar(__webpack_require__(/*! ./minority */ "./src/minority.ts"));
103038
103082
  // PROFILE A PLAN
103039
103083
  function profilePlan(s, bLog = false) {
103040
103084
  const state = s.state.xx;
@@ -103154,7 +103198,9 @@ function scorePlan(s, p, bLog = false, overridesJSON) {
103154
103198
  let summaryRow = s.districts.numberOfRows() - 1;
103155
103199
  totalPop[summaryRow] = p.populationProfile.targetSize;
103156
103200
  popDevPct[summaryRow] = popDev;
103157
- //
103201
+ // Add minority notes
103202
+ scorecard.minority.details['majorityMinority'] = M.getMajorityMinority(s);
103203
+ scorecard.minority.details['vraPreclearance'] = M.getVRASection5(s);
103158
103204
  return scorecard;
103159
103205
  }
103160
103206
  exports.scorePlan = scorePlan;
@@ -103688,6 +103734,17 @@ function isEmbedded(districtID, geoIDs, plan, graph) {
103688
103734
  exports.isEmbedded = isEmbedded;
103689
103735
 
103690
103736
 
103737
+ /***/ }),
103738
+
103739
+ /***/ "./static/majority-minority.json":
103740
+ /*!***************************************!*\
103741
+ !*** ./static/majority-minority.json ***!
103742
+ \***************************************/
103743
+ /*! exports provided: AL, AK, AZ, AR, CA, CO, CT, DE, FL, GA, HI, ID, IL, IN, IA, KS, KY, LA, ME, MD, MA, MI, MN, MS, MO, MT, NE, NV, NH, NJ, NM, NY, NC, ND, OH, OK, OR, PA, RI, SC, SD, TN, TX, UT, VT, VA, WA, WV, WI, WY, default */
103744
+ /***/ (function(module) {
103745
+
103746
+ module.exports = JSON.parse("{\"AL\":{\"Black\":[7],\"Hispanic\":[],\"Pacific\":[]},\"AK\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"AZ\":{\"Black\":[],\"Hispanic\":[2,4,7],\"Pacific\":[]},\"AR\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"CA\":{\"Black\":[13,37,43],\"Hispanic\":[17,18,20,21,28,31,32,34,35,38,39,43,45,47,51],\"Pacific\":[12,13,14,15,17,18,19,27,34,39,45,47,52]},\"CO\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"CT\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"DE\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"FL\":{\"Black\":[5,20,24],\"Hispanic\":[18,21,25],\"Pacific\":[]},\"GA\":{\"Black\":[2,4,5,13],\"Hispanic\":[],\"Pacific\":[]},\"HI\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[2]},\"ID\":{\"Black\":[],\"Hispanic\":[1],\"Pacific\":[]},\"IL\":{\"Black\":[1,2,7],\"Hispanic\":[4],\"Pacific\":[]},\"IN\":{\"Black\":[7],\"Hispanic\":[],\"Pacific\":[]},\"IA\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"KS\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"KY\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"LA\":{\"Black\":[2],\"Hispanic\":[],\"Pacific\":[]},\"ME\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"MD\":{\"Black\":[4,7],\"Hispanic\":[],\"Pacific\":[]},\"MA\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"MI\":{\"Black\":[13,14],\"Hispanic\":[],\"Pacific\":[]},\"MN\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"MS\":{\"Black\":[2],\"Hispanic\":[],\"Pacific\":[]},\"MO\":{\"Black\":[1,5],\"Hispanic\":[],\"Pacific\":[]},\"MT\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"NE\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"NV\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"NH\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"NJ\":{\"Black\":[10,12],\"Hispanic\":[13],\"Pacific\":[6]},\"NM\":{\"Black\":[],\"Hispanic\":[2,13],\"Pacific\":[]},\"NY\":{\"Black\":[5,8,9,13],\"Hispanic\":[12,16],\"Pacific\":[6,7,10]},\"NC\":{\"Black\":[1,12],\"Hispanic\":[],\"Pacific\":[]},\"ND\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"OH\":{\"Black\":[3,11],\"Hispanic\":[],\"Pacific\":[]},\"OK\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"OR\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"PA\":{\"Black\":[2],\"Hispanic\":[],\"Pacific\":[]},\"RI\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"SC\":{\"Black\":[6],\"Hispanic\":[],\"Pacific\":[]},\"SD\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"TN\":{\"Black\":[9],\"Hispanic\":[],\"Pacific\":[]},\"TX\":{\"Black\":[9,18,33],\"Hispanic\":[15,16,19,20,23,27,28,29,32],\"Pacific\":[]},\"UT\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"VT\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"VA\":{\"Black\":[3],\"Hispanic\":[],\"Pacific\":[]},\"WA\":{\"Black\":[],\"Hispanic\":[3],\"Pacific\":[9]},\"WV\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]},\"WI\":{\"Black\":[4],\"Hispanic\":[],\"Pacific\":[]},\"WY\":{\"Black\":[],\"Hispanic\":[],\"Pacific\":[]}}");
103747
+
103691
103748
  /***/ }),
103692
103749
 
103693
103750
  /***/ "./static/state-reqs.json":
@@ -103701,6 +103758,17 @@ module.exports = JSON.parse("{\"AL\":\"https://www.brennancenter.org/sites/defau
103701
103758
 
103702
103759
  /***/ }),
103703
103760
 
103761
+ /***/ "./static/vra5-preclearance.json":
103762
+ /*!***************************************!*\
103763
+ !*** ./static/vra5-preclearance.json ***!
103764
+ \***************************************/
103765
+ /*! exports provided: AL, AK, AZ, CA, FL, GA, LA, MI, MS, NY, NC, SC, SD, TX, VA, default */
103766
+ /***/ (function(module) {
103767
+
103768
+ module.exports = JSON.parse("{\"AL\":\"all\",\"AK\":\"all\",\"AZ\":\"all\",\"CA\":\"parts\",\"FL\":\"parts\",\"GA\":\"all\",\"LA\":\"all\",\"MI\":\"parts\",\"MS\":\"all\",\"NY\":\"parts\",\"NC\":\"parts\",\"SC\":\"all\",\"SD\":\"parts\",\"TX\":\"all\",\"VA\":\"all\"}");
103769
+
103770
+ /***/ }),
103771
+
103704
103772
  /***/ "./test/_cli.ts":
103705
103773
  /*!**********************!*\
103706
103774
  !*** ./test/_cli.ts ***!