@dra2020/dra-types 1.8.127 → 1.8.129
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/dra-types.js +9 -5
- package/dist/dra-types.js.map +1 -1
- package/lib/colormgr.ts +7 -5
- package/package.json +2 -2
- package/dist/colordata.d.ts +0 -35
- package/dist/gencolor.d.ts +0 -1
package/dist/dra-types.js
CHANGED
|
@@ -257,10 +257,12 @@ function ethnicBackgroundColor(index, pd) {
|
|
|
257
257
|
}
|
|
258
258
|
exports.ethnicBackgroundColor = ethnicBackgroundColor;
|
|
259
259
|
function ToAllEthnicColor(agg, dc, pd) {
|
|
260
|
+
var _a;
|
|
260
261
|
// Use VAP/CVAP if it exists
|
|
261
262
|
const dataset = dc.primeVDS ? dc.primeVDS : dc.primeDDS;
|
|
262
263
|
const did = PF.toDatasetID(dataset);
|
|
263
|
-
|
|
264
|
+
const builtin = ((_a = dc.dsMeta[did]) === null || _a === void 0 ? void 0 : _a.builtin) || dataset;
|
|
265
|
+
return AggregateEthnicColor(PF.ToGetter(agg, dc, did, dataset), pd, builtin.endsWith('NH'));
|
|
264
266
|
}
|
|
265
267
|
exports.ToAllEthnicColor = ToAllEthnicColor;
|
|
266
268
|
function ToPartisanColorStr(agg, dc, pd) {
|
|
@@ -308,11 +310,13 @@ function ToPartisanShiftColor(agg, dc, datasets, pd, isDistrict) {
|
|
|
308
310
|
}
|
|
309
311
|
exports.ToPartisanShiftColor = ToPartisanShiftColor;
|
|
310
312
|
function ToEthnicColorStr(agg, dc, pd, detail) {
|
|
313
|
+
var _a;
|
|
311
314
|
let ethnic = 'Wh';
|
|
312
315
|
let total = 'Tot';
|
|
313
316
|
let bInvert = false;
|
|
314
317
|
const dataset = dc.primeVDS ? dc.primeVDS : dc.primeDDS;
|
|
315
318
|
const did = PF.toDatasetID(dataset);
|
|
319
|
+
const builtin = ((_a = dc.dsMeta[did]) === null || _a === void 0 ? void 0 : _a.builtin) || dataset;
|
|
316
320
|
switch (detail) {
|
|
317
321
|
case null:
|
|
318
322
|
case '':
|
|
@@ -327,22 +331,22 @@ function ToEthnicColorStr(agg, dc, pd, detail) {
|
|
|
327
331
|
bInvert = true;
|
|
328
332
|
break;
|
|
329
333
|
case 'black':
|
|
330
|
-
ethnic =
|
|
334
|
+
ethnic = builtin.endsWith('NH') ? 'Bl' : 'BlC';
|
|
331
335
|
break;
|
|
332
336
|
case 'hisp':
|
|
333
337
|
ethnic = 'His';
|
|
334
338
|
break;
|
|
335
339
|
case 'native':
|
|
336
|
-
ethnic =
|
|
340
|
+
ethnic = builtin.endsWith('NH') ? 'Nat' : 'NatC';
|
|
337
341
|
break;
|
|
338
342
|
case 'asianpi':
|
|
339
343
|
ethnic = 'AsnPI';
|
|
340
344
|
break;
|
|
341
345
|
case 'asian':
|
|
342
|
-
ethnic =
|
|
346
|
+
ethnic = builtin.endsWith('NH') ? 'Asn' : 'AsnC';
|
|
343
347
|
break;
|
|
344
348
|
case 'pac':
|
|
345
|
-
ethnic =
|
|
349
|
+
ethnic = builtin.endsWith('NH') ? 'Pac' : 'PacC';
|
|
346
350
|
break;
|
|
347
351
|
case 'other':
|
|
348
352
|
ethnic = 'OthAl';
|