@dra2020/district-analytics 5.7.0 → 6.0.0

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
@@ -89884,9 +89884,10 @@ function scoreImpact(rawUE, Vf, Sf, N) {
89884
89884
  }
89885
89885
  }
89886
89886
  exports.scoreImpact = scoreImpact;
89887
+ const avgSVError = 0.02;
89887
89888
  function isAntimajoritarian(Vf, Sf) {
89888
- const bDem = ((Vf < 0.5) && (Sf > 0.5)) ? true : false;
89889
- const bRep = (((1 - Vf) < 0.5) && ((1 - Sf) > 0.5)) ? true : false;
89889
+ const bDem = ((Vf < (0.5 - avgSVError)) && (Sf > 0.5)) ? true : false;
89890
+ const bRep = (((1 - Vf) < (0.5 - avgSVError)) && ((1 - Sf) > 0.5)) ? true : false;
89890
89891
  return bDem || bRep;
89891
89892
  }
89892
89893
  exports.isAntimajoritarian = isAntimajoritarian;
@@ -104547,9 +104548,11 @@ function scorePlan(s, p, bLog = false, overridesJSON) {
104547
104548
  // Populate the N+1 summary "district" in district.statistics
104548
104549
  let totalPop = s.districts.statistics[D.DistrictField.TotalPop];
104549
104550
  let popDevPct = s.districts.statistics[D.DistrictField.PopDevPct];
104550
- let summaryRow = s.districts.numberOfRows() - 1;
104551
+ let totalVAP = s.districts.statistics[D.DistrictField.TotalVAP];
104552
+ const summaryRow = s.districts.numberOfRows() - 1;
104551
104553
  totalPop[summaryRow] = p.populationProfile.targetSize;
104552
104554
  popDevPct[summaryRow] = popDev;
104555
+ totalVAP[summaryRow] = Math.round(totalVAP[summaryRow] / p.nDistricts);
104553
104556
  // Add minority notes
104554
104557
  scorecard.minority.details['majorityMinority'] = M.getMajorityMinority(s);
104555
104558
  scorecard.minority.details['vraPreclearance'] = M.getVRASection5(s);