@dra2020/district-analytics 15.2.1 → 15.3.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.
@@ -1054,7 +1054,11 @@ class Counties {
1054
1054
  this.nCounties = this._data.features.length;
1055
1055
  }
1056
1056
  countyByIndex(i) { return this._data.features[i]; }
1057
- propertyForCounty(f, pk) { return f.properties[pk]; }
1057
+ // 10-16-21 - Analyze view crashing because county names were undefined in the lookup table.
1058
+ // Property had changed from 'NAME' to 'name' for *some* states.
1059
+ propertyForCounty(f, pk) {
1060
+ return f.properties[pk] ? f.properties[pk] : f.properties[pk.toLowerCase()];
1061
+ }
1058
1062
  mapFIPSToName(fips, name) { this._countyNameLookup[fips] = name; }
1059
1063
  nameFromFIPS(fips) { return this._countyNameLookup[fips]; }
1060
1064
  indexFromFIPS(fips) { return this.index[fips]; }
@@ -1605,7 +1609,7 @@ const dra_analytics_1 = __webpack_require__(/*! @dra2020/dra-analytics */ "@dra2
1605
1609
  exports.estSeatProbability = dra_analytics_1.Partisan.estSeatProbability;
1606
1610
  exports.ratePartisanBias = dra_analytics_1.Rate.ratePartisanBias;
1607
1611
  exports.isAntimajoritarian = dra_analytics_1.Rate.isAntimajoritarian;
1608
- exports.avgSVError = dra_analytics_1.Rate.avgSVError;
1612
+ exports.avgSVError = dra_analytics_1.Partisan.avgSVError;
1609
1613
  exports.effectiveSplits = dra_analytics_1.Splitting.effectiveSplits;
1610
1614
  exports.uncertaintyOfMembership = dra_analytics_1.Splitting.uncertaintyOfMembership;
1611
1615
 
@@ -2287,6 +2291,10 @@ function thunkScorecard(newScorecard, bLog = false) {
2287
2291
  const scratchpad = newScorecard.scratchpad;
2288
2292
  // Partisan scorecard
2289
2293
  const pS = U.deepCopy(newScorecard.partisan);
2294
+ // EXPERIMENTAL
2295
+ const lPropAlt = newScorecard.partisan.experimental.lProp;
2296
+ if (lPropAlt)
2297
+ pS.details['lProp'] = lPropAlt;
2290
2298
  // Minority scorecard
2291
2299
  const mS = U.deepCopy(newScorecard.minority);
2292
2300
  // Compactness scorecard