@dra2020/dra-types 1.8.128 → 1.8.130

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.
@@ -80,6 +80,9 @@ export interface Dataset {
80
80
  meta?: DatasetsMeta;
81
81
  groups?: G.GroupMapIndex;
82
82
  labels?: string[];
83
+ labelupdate?: {
84
+ [name: string]: boolean | null;
85
+ };
83
86
  }
84
87
  export declare function datasetRestrict(ds: Dataset): {
85
88
  [key: string]: boolean;
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
- return AggregateEthnicColor(PF.ToGetter(agg, dc, did, dataset), pd, dataset.endsWith('NH'));
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 = dataset.endsWith('NH') ? 'Bl' : 'BlC';
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 = dataset.endsWith('NH') ? 'Nat' : 'NatC';
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 = dataset.endsWith('NH') ? 'Asn' : 'AsnC';
346
+ ethnic = builtin.endsWith('NH') ? 'Asn' : 'AsnC';
343
347
  break;
344
348
  case 'pac':
345
- ethnic = dataset.endsWith('NH') ? 'Pac' : 'PacC';
349
+ ethnic = builtin.endsWith('NH') ? 'Pac' : 'PacC';
346
350
  break;
347
351
  case 'other':
348
352
  ethnic = 'OthAl';