@dra2020/dra-analytics 4.1.2 → 4.1.4
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/LICENSE +1 -1
- package/README.md +2 -0
- package/dist/dra-analytics.js +6 -6
- package/dist/dra-analytics.js.map +1 -1
- package/dist/lib/types/compactness.d.ts +3 -3
- package/docs/types.md +1 -1
- package/lib/compactness/compactness.ts +4 -4
- package/lib/compactness/kiwysi.ts +2 -2
- package/lib/types/compactness.ts +3 -3
- package/package.json +16 -15
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2021-
|
|
3
|
+
Copyright (c) 2021-2024 Social Good Fund for Dave's Redistricting.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
package/dist/dra-analytics.js
CHANGED
|
@@ -344,11 +344,11 @@ function makeCompactnessScorecard(shapes, bLog = false) {
|
|
|
344
344
|
}
|
|
345
345
|
const avgReock = totReock / shapes.features.length;
|
|
346
346
|
const avgPolsby = totPolsby / shapes.features.length;
|
|
347
|
-
const
|
|
347
|
+
const avgKIWYSI = Math.round(totKIWYSI / shapes.features.length);
|
|
348
348
|
const s = {
|
|
349
349
|
avgReock: avgReock,
|
|
350
350
|
avgPolsby: avgPolsby,
|
|
351
|
-
|
|
351
|
+
avgKIWYSI: avgKIWYSI,
|
|
352
352
|
byDistrict: byDistrict,
|
|
353
353
|
details: {}, // None
|
|
354
354
|
// score?:
|
|
@@ -387,11 +387,11 @@ function calcCompactness(shapes) {
|
|
|
387
387
|
}
|
|
388
388
|
const avgReock = totReock / shapes.features.length;
|
|
389
389
|
const avgPolsby = totPolsby / shapes.features.length;
|
|
390
|
-
const
|
|
390
|
+
const avgKIWYSI = Math.round(totKIWYSI / shapes.features.length);
|
|
391
391
|
const out = {
|
|
392
392
|
avgReock: avgReock,
|
|
393
393
|
avgPolsby: avgPolsby,
|
|
394
|
-
|
|
394
|
+
avgKIWYSI: avgKIWYSI,
|
|
395
395
|
byDistrict: byDistrict
|
|
396
396
|
};
|
|
397
397
|
return out;
|
|
@@ -709,9 +709,9 @@ function calcKIWYSICompactness(shapes) {
|
|
|
709
709
|
};
|
|
710
710
|
byDistrict.push(entry);
|
|
711
711
|
}
|
|
712
|
-
const
|
|
712
|
+
const avgKIWYSI = Math.round(totKIWYSI / shapes.features.length);
|
|
713
713
|
const out = {
|
|
714
|
-
|
|
714
|
+
avgKIWYSI: avgKIWYSI,
|
|
715
715
|
byDistrict: byDistrict
|
|
716
716
|
};
|
|
717
717
|
return out;
|