@dra2020/district-analytics 2.0.2 → 2.0.3

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.
@@ -429,8 +429,8 @@ class Districts {
429
429
  });
430
430
  // COMPUTE DERIVED VALUES
431
431
  // Population deviation % and equal population (boolean) by district.
432
- // Don't set the values for the dummy unassigned district.
433
- let popDevPct = null;
432
+ // Default the value for the dummy unassigned district to 0%.
433
+ let popDevPct = 0 / targetSize;
434
434
  if (i > 0) {
435
435
  popDevPct = (totalPop - targetSize) / targetSize;
436
436
  bEqualPop = (popDevPct <= deviationThreshold);
@@ -2455,8 +2455,10 @@ const testDefns = {
2455
2455
  // Raw numeric analytics, such as population deviation, compactness, etc. are
2456
2456
  // normalized as part of creating a scorecard, so the code to normalize results
2457
2457
  // is encapsulated here.
2458
- // Configure scale parameters for normalizing each raw test result
2459
- // This needs to be separate from the scorecard configuration info above,
2458
+ // Configure scale parameters for normalizing each raw test result.
2459
+ // Scales consist of a minimum & a maximum *raw* value. If the values get
2460
+ // inverted (to make bigger better), these will switch.
2461
+ // This process needs to be separate from the test configuration info above,
2460
2462
  // because some scales need access to the analytics session object.
2461
2463
  function doConfigureScales(s) {
2462
2464
  // Scale defn for PopulationDeviation