@dra2020/dra-types 1.8.55 → 1.8.58
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/all.d.ts +0 -2
- package/dist/csv.d.ts +2 -0
- package/dist/dra-types.js +29 -367
- package/dist/dra-types.js.map +1 -1
- package/lib/all.ts +0 -2
- package/lib/csv.ts +11 -1
- package/package.json +11 -11
- package/lib/colordata.ts +0 -321
- package/lib/gencolor.ts +0 -26
package/dist/all.d.ts
CHANGED
package/dist/csv.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Util } from '@dra2020/baseclient';
|
|
1
2
|
import * as VF from './vfeature';
|
|
2
3
|
export declare type BlockMap = {
|
|
3
4
|
[id: string]: number;
|
|
@@ -27,6 +28,7 @@ export interface OneCSVLine {
|
|
|
27
28
|
districtID: string;
|
|
28
29
|
}
|
|
29
30
|
export declare function parseCSVLine(line: string): OneCSVLine;
|
|
31
|
+
export declare function csvLine(coder: Util.Coder, line: string): OneCSVLine;
|
|
30
32
|
export interface ConvertResult {
|
|
31
33
|
inBlockMap: BlockMapping;
|
|
32
34
|
inStateMap: BlockMapping;
|
package/dist/dra-types.js
CHANGED
|
@@ -33,8 +33,6 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
33
33
|
__exportStar(__webpack_require__(/*! ./dra-types */ "./lib/dra-types.ts"), exports);
|
|
34
34
|
__exportStar(__webpack_require__(/*! ./schemas */ "./lib/schemas.ts"), exports);
|
|
35
35
|
__exportStar(__webpack_require__(/*! ./bucketmap */ "./lib/bucketmap.ts"), exports);
|
|
36
|
-
__exportStar(__webpack_require__(/*! ./colordata */ "./lib/colordata.ts"), exports);
|
|
37
|
-
__exportStar(__webpack_require__(/*! ./gencolor */ "./lib/gencolor.ts"), exports);
|
|
38
36
|
__exportStar(__webpack_require__(/*! ./vfeature */ "./lib/vfeature.ts"), exports);
|
|
39
37
|
__exportStar(__webpack_require__(/*! ./csv */ "./lib/csv.ts"), exports);
|
|
40
38
|
__exportStar(__webpack_require__(/*! ./stats */ "./lib/stats.ts"), exports);
|
|
@@ -89,326 +87,6 @@ exports.BucketMap = {
|
|
|
89
87
|
};
|
|
90
88
|
|
|
91
89
|
|
|
92
|
-
/***/ }),
|
|
93
|
-
|
|
94
|
-
/***/ "./lib/colordata.ts":
|
|
95
|
-
/*!**************************!*\
|
|
96
|
-
!*** ./lib/colordata.ts ***!
|
|
97
|
-
\**************************/
|
|
98
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
102
|
-
exports.IntensityBackgroundColor = exports.ElectionLabel = exports.ElectionTextColor = exports.ElectionBackgroundColor = exports.ColorByGreatD = exports.ColorByGoodD = exports.ColorByFairD = exports.ColorByEven = exports.ColorByFairR = exports.ColorByGoodR = exports.ColorByGreatR = exports.EthnicLabel = exports.EthnicTextColor = exports.EthnicBackgroundColor = exports.ColorByBlackAsian = exports.ColorByAsianHispanic = exports.ColorByAsianWhite = exports.ColorByHispanicBlack = exports.ColorByBlackWhite = exports.ColorByHispanicWhite = exports.ColorByMix = exports.ColorByMostlyNative = exports.ColorByMostlyAsian = exports.ColorByMostlyHispanic = exports.ColorByMostlyBlack = exports.ColorByMostlyWhite = exports.ColorBySolidAsian = exports.ColorBySolidHispanic = exports.ColorBySolidBlack = exports.ColorBySolidWhite = exports.ColorValues = exports.DefaultColorNames = void 0;
|
|
103
|
-
exports.DefaultColorNames = [
|
|
104
|
-
'GhostWhite',
|
|
105
|
-
'Blue',
|
|
106
|
-
'Green',
|
|
107
|
-
'DarkMagenta',
|
|
108
|
-
'Red',
|
|
109
|
-
'Gold',
|
|
110
|
-
'Teal',
|
|
111
|
-
'Chocolate',
|
|
112
|
-
'SlateBlue',
|
|
113
|
-
'Cyan',
|
|
114
|
-
'DeepPink',
|
|
115
|
-
'Chartreuse',
|
|
116
|
-
'CornflowerBlue',
|
|
117
|
-
'DarkSalmon',
|
|
118
|
-
'Olive',
|
|
119
|
-
'DarkOrange',
|
|
120
|
-
'Lime',
|
|
121
|
-
'DarkSlateBlue',
|
|
122
|
-
'Yellow',
|
|
123
|
-
'YellowGreen',
|
|
124
|
-
'Pink',
|
|
125
|
-
'Maroon',
|
|
126
|
-
'Sienna',
|
|
127
|
-
'Aquamarine',
|
|
128
|
-
'Indigo',
|
|
129
|
-
'PaleVioletRed',
|
|
130
|
-
'Navy',
|
|
131
|
-
'SpringGreen',
|
|
132
|
-
'Plum',
|
|
133
|
-
'DarkSeaGreen',
|
|
134
|
-
'LightCoral',
|
|
135
|
-
'Khaki',
|
|
136
|
-
'OrangeRed',
|
|
137
|
-
'RoyalBlue',
|
|
138
|
-
'LimeGreen',
|
|
139
|
-
'DarkOrchid',
|
|
140
|
-
'Orange',
|
|
141
|
-
'DodgerBlue',
|
|
142
|
-
'MediumAquamarine',
|
|
143
|
-
'Moccasin',
|
|
144
|
-
'Firebrick',
|
|
145
|
-
'LightSteelBlue',
|
|
146
|
-
'LawnGreen',
|
|
147
|
-
'Magenta',
|
|
148
|
-
'MediumVioletRed',
|
|
149
|
-
'Turquoise',
|
|
150
|
-
'Tomato',
|
|
151
|
-
'Thistle',
|
|
152
|
-
'SandyBrown',
|
|
153
|
-
'IndianRed',
|
|
154
|
-
'PowderBlue',
|
|
155
|
-
'SaddleBrown',
|
|
156
|
-
'OliveDrab',
|
|
157
|
-
'Fuchsia',
|
|
158
|
-
'PeachPuff',
|
|
159
|
-
'RosyBrown',
|
|
160
|
-
];
|
|
161
|
-
exports.ColorValues = {
|
|
162
|
-
'AliceBlue': '#F0F8FF',
|
|
163
|
-
'AntiqueWhite': '#FAEBD7',
|
|
164
|
-
'Aqua': '#00FFFF',
|
|
165
|
-
'Aquamarine': '#7FFFD4',
|
|
166
|
-
'Azure': '#F0FFFF',
|
|
167
|
-
'Beige': '#F5F5DC',
|
|
168
|
-
'Bisque': '#FFE4C4',
|
|
169
|
-
'Black': '#000000',
|
|
170
|
-
'BlanchedAlmond': '#FFEBCD',
|
|
171
|
-
'Blue': '#0000FF',
|
|
172
|
-
'BlueViolet': '#8A2BE2',
|
|
173
|
-
'Brown': '#A52A2A',
|
|
174
|
-
'BurlyWood': '#DEB887',
|
|
175
|
-
'CadetBlue': '#5F9EA0',
|
|
176
|
-
'Chartreuse': '#7FFF00',
|
|
177
|
-
'Chocolate': '#D2691E',
|
|
178
|
-
'Coral': '#FF7F50',
|
|
179
|
-
'CornflowerBlue': '#6495ED',
|
|
180
|
-
'Cornsilk': '#FFF8DC',
|
|
181
|
-
'Crimson': '#DC143C',
|
|
182
|
-
'Cyan': '#00FFFF',
|
|
183
|
-
'DarkBlue': '#00008B',
|
|
184
|
-
'DarkCyan': '#008B8B',
|
|
185
|
-
'DarkGoldenrod': '#B8860B',
|
|
186
|
-
'DarkGray': '#A9A9A9',
|
|
187
|
-
'DarkGreen': '#006400',
|
|
188
|
-
'DarkKhaki': '#BDB76B',
|
|
189
|
-
'DarkMagenta': '#8B008B',
|
|
190
|
-
'DarkOliveGreen': '#556B2F',
|
|
191
|
-
'DarkOrange': '#FF8C00',
|
|
192
|
-
'DarkOrchid': '#9932CC',
|
|
193
|
-
'DarkRed': '#8B0000',
|
|
194
|
-
'DarkSalmon': '#E9967A',
|
|
195
|
-
'DarkSeaGreen': '#8FBC8F',
|
|
196
|
-
'DarkSlateBlue': '#483D8B',
|
|
197
|
-
'DarkSlateGray': '#2F4F4F',
|
|
198
|
-
'DarkTurquoise': '#00CED1',
|
|
199
|
-
'DarkViolet': '#9400D3',
|
|
200
|
-
'DeepPink': '#FF1493',
|
|
201
|
-
'DeepSkyBlue': '#00BFFF',
|
|
202
|
-
'DimGray': '#696969',
|
|
203
|
-
'DodgerBlue': '#1E90FF',
|
|
204
|
-
'Firebrick': '#B22222',
|
|
205
|
-
'FloralWhite': '#FFFAF0',
|
|
206
|
-
'ForestGreen': '#228B22',
|
|
207
|
-
'Fuchsia': '#FF00FF',
|
|
208
|
-
'Gainsboro': '#DCDCDC',
|
|
209
|
-
'GhostWhite': '#F8F8FF',
|
|
210
|
-
'Gold': '#FFD700',
|
|
211
|
-
'Goldenrod': '#DAA520',
|
|
212
|
-
'Gray': '#808080',
|
|
213
|
-
'Green': '#008000',
|
|
214
|
-
'GreenYellow': '#ADFF2F',
|
|
215
|
-
'Honeydew': '#F0FFF0',
|
|
216
|
-
'HotPink': '#FF69B4',
|
|
217
|
-
'IndianRed': '#CD5C5C',
|
|
218
|
-
'Indigo': '#4B0082',
|
|
219
|
-
'Ivory': '#FFFFF0',
|
|
220
|
-
'Khaki': '#F0E68C',
|
|
221
|
-
'Lavender': '#E6E6FA',
|
|
222
|
-
'LavenderBlush': '#FFF0F5',
|
|
223
|
-
'LawnGreen': '#7CFC00',
|
|
224
|
-
'LemonChiffon': '#FFFACD',
|
|
225
|
-
'LightBlue': '#ADD8E6',
|
|
226
|
-
'LightCoral': '#F08080',
|
|
227
|
-
'LightCyan': '#E0FFFF',
|
|
228
|
-
'LightGoldenrodYellow': '#FAFAD2',
|
|
229
|
-
'LightGray': '#D3D3D3',
|
|
230
|
-
'LightGreen': '#90EE90',
|
|
231
|
-
'LightPink': '#FFB6C1',
|
|
232
|
-
'LightSalmon': '#FFA07A',
|
|
233
|
-
'LightSeaGreen': '#20B2AA',
|
|
234
|
-
'LightSkyBlue': '#87CEFA',
|
|
235
|
-
'LightSlateGray': '#778899',
|
|
236
|
-
'LightSteelBlue': '#B0C4DE',
|
|
237
|
-
'LightYellow': '#FFFFE0',
|
|
238
|
-
'Lime': '#00FF00',
|
|
239
|
-
'LimeGreen': '#32CD32',
|
|
240
|
-
'Linen': '#FAF0E6',
|
|
241
|
-
'Magenta': '#FF00FF',
|
|
242
|
-
'Maroon': '#800000',
|
|
243
|
-
'MediumAquamarine': '#66CDAA',
|
|
244
|
-
'MediumBlue': '#0000CD',
|
|
245
|
-
'MediumOrchid': '#BA55D3',
|
|
246
|
-
'MediumPurple': '#9370DB',
|
|
247
|
-
'MediumSeaGreen': '#3CB371',
|
|
248
|
-
'MediumSlateBlue': '#7B68EE',
|
|
249
|
-
'MediumSpringGreen': '#00FA9A',
|
|
250
|
-
'MediumTurquoise': '#48D1CC',
|
|
251
|
-
'MediumVioletRed': '#C71585',
|
|
252
|
-
'MidnightBlue': '#191970',
|
|
253
|
-
'MintCream': '#F5FFFA',
|
|
254
|
-
'MistyRose': '#FFE4E1',
|
|
255
|
-
'Moccasin': '#FFE4B5',
|
|
256
|
-
'NavajoWhite': '#FFDEAD',
|
|
257
|
-
'Navy': '#000080',
|
|
258
|
-
'OldLace': '#FDF5E6',
|
|
259
|
-
'Olive': '#808000',
|
|
260
|
-
'OliveDrab': '#6B8E23',
|
|
261
|
-
'Orange': '#FFA500',
|
|
262
|
-
'OrangeRed': '#FF4500',
|
|
263
|
-
'Orchid': '#DA70D6',
|
|
264
|
-
'PaleGoldenrod': '#EEE8AA',
|
|
265
|
-
'PaleGreen': '#98FB98',
|
|
266
|
-
'PaleTurquoise': '#AFEEEE',
|
|
267
|
-
'PaleVioletRed': '#DB7093',
|
|
268
|
-
'PapayaWhip': '#FFEFD5',
|
|
269
|
-
'PeachPuff': '#FFDAB9',
|
|
270
|
-
'Peru': '#CD853F',
|
|
271
|
-
'Pink': '#FFC0CB',
|
|
272
|
-
'Plum': '#DDA0DD',
|
|
273
|
-
'PowderBlue': '#B0E0E6',
|
|
274
|
-
'Purple': '#800080',
|
|
275
|
-
'Red': '#FF0000',
|
|
276
|
-
'RosyBrown': '#BC8F8F',
|
|
277
|
-
'RoyalBlue': '#4169E1',
|
|
278
|
-
'SaddleBrown': '#8B4513',
|
|
279
|
-
'Salmon': '#FA8072',
|
|
280
|
-
'SandyBrown': '#F4A460',
|
|
281
|
-
'SeaGreen': '#2E8B57',
|
|
282
|
-
'SeaShell': '#FFF5EE',
|
|
283
|
-
'Sienna': '#A0522D',
|
|
284
|
-
'Silver': '#C0C0C0',
|
|
285
|
-
'SkyBlue': '#87CEEB',
|
|
286
|
-
'SlateBlue': '#6A5ACD',
|
|
287
|
-
'SlateGray': '#708090',
|
|
288
|
-
'Snow': '#FFFAFA',
|
|
289
|
-
'SpringGreen': '#00FF7F',
|
|
290
|
-
'SteelBlue': '#4682B4',
|
|
291
|
-
'Tan': '#D2B48C',
|
|
292
|
-
'Teal': '#008080',
|
|
293
|
-
'Thistle': '#D8BFD8',
|
|
294
|
-
'Tomato': '#FF6347',
|
|
295
|
-
'Turquoise': '#40E0D0',
|
|
296
|
-
'Violet': '#EE82EE',
|
|
297
|
-
'Wheat': '#F5DEB3',
|
|
298
|
-
'White': '#FFFFFF',
|
|
299
|
-
'WhiteSmoke': '#F5F5F5',
|
|
300
|
-
'Yellow': '#FFFF00',
|
|
301
|
-
'YellowGreen': '#9ACD32',
|
|
302
|
-
};
|
|
303
|
-
exports.ColorBySolidWhite = 0;
|
|
304
|
-
exports.ColorBySolidBlack = 1;
|
|
305
|
-
exports.ColorBySolidHispanic = 2;
|
|
306
|
-
exports.ColorBySolidAsian = 3;
|
|
307
|
-
exports.ColorByMostlyWhite = 4;
|
|
308
|
-
exports.ColorByMostlyBlack = 5;
|
|
309
|
-
exports.ColorByMostlyHispanic = 6;
|
|
310
|
-
exports.ColorByMostlyAsian = 7;
|
|
311
|
-
exports.ColorByMostlyNative = 8;
|
|
312
|
-
exports.ColorByMix = 9;
|
|
313
|
-
exports.ColorByHispanicWhite = 10;
|
|
314
|
-
exports.ColorByBlackWhite = 11;
|
|
315
|
-
exports.ColorByHispanicBlack = 12;
|
|
316
|
-
exports.ColorByAsianWhite = 13;
|
|
317
|
-
exports.ColorByAsianHispanic = 14;
|
|
318
|
-
exports.ColorByBlackAsian = 15;
|
|
319
|
-
exports.EthnicBackgroundColor = [
|
|
320
|
-
'#c0392b',
|
|
321
|
-
'#3498db',
|
|
322
|
-
'#2ecc71',
|
|
323
|
-
'#9b59b6',
|
|
324
|
-
'#d98880',
|
|
325
|
-
'#aed6f1',
|
|
326
|
-
'#abebc6',
|
|
327
|
-
'#bb8fce',
|
|
328
|
-
'#f1c40f',
|
|
329
|
-
'#aab7b8',
|
|
330
|
-
'#d5f5e3',
|
|
331
|
-
'#d6eaf8',
|
|
332
|
-
'#186a3b',
|
|
333
|
-
'#e8daef',
|
|
334
|
-
'#45b39d',
|
|
335
|
-
'#4a235a',
|
|
336
|
-
];
|
|
337
|
-
exports.EthnicTextColor = [
|
|
338
|
-
'#ffffff',
|
|
339
|
-
'#ffffff',
|
|
340
|
-
'#ffffff',
|
|
341
|
-
'#ffffff',
|
|
342
|
-
'#000000',
|
|
343
|
-
'#000000',
|
|
344
|
-
'#000000',
|
|
345
|
-
'#000000',
|
|
346
|
-
'#000000',
|
|
347
|
-
'#000000',
|
|
348
|
-
'#000000',
|
|
349
|
-
'#000000',
|
|
350
|
-
'#ffffff',
|
|
351
|
-
'#000000',
|
|
352
|
-
'#000000',
|
|
353
|
-
'#ffffff',
|
|
354
|
-
];
|
|
355
|
-
exports.EthnicLabel = [
|
|
356
|
-
'Solid White',
|
|
357
|
-
'Solid Black',
|
|
358
|
-
'Solid Hispanic',
|
|
359
|
-
'Solid Asian',
|
|
360
|
-
'Mostly White',
|
|
361
|
-
'Mostly Black',
|
|
362
|
-
'Mostly Hispanic',
|
|
363
|
-
'Mostly Asian',
|
|
364
|
-
'Mostly Native',
|
|
365
|
-
'Mixed',
|
|
366
|
-
'Hispanic / White Mix',
|
|
367
|
-
'Black / White Mix',
|
|
368
|
-
'Hispanic / Black Mix',
|
|
369
|
-
'Asian / White Mix',
|
|
370
|
-
'Asian / Hispanic Mix',
|
|
371
|
-
'Black / Asian Mix'
|
|
372
|
-
];
|
|
373
|
-
exports.ColorByGreatR = 0;
|
|
374
|
-
exports.ColorByGoodR = 1;
|
|
375
|
-
exports.ColorByFairR = 2;
|
|
376
|
-
exports.ColorByEven = 3;
|
|
377
|
-
exports.ColorByFairD = 4;
|
|
378
|
-
exports.ColorByGoodD = 5;
|
|
379
|
-
exports.ColorByGreatD = 6;
|
|
380
|
-
exports.ElectionBackgroundColor = [
|
|
381
|
-
'#CF0000',
|
|
382
|
-
'#FF4555',
|
|
383
|
-
'#FFB0CB',
|
|
384
|
-
'#9932CC',
|
|
385
|
-
'#87CEEB',
|
|
386
|
-
'#1E90FF',
|
|
387
|
-
'#0000CF',
|
|
388
|
-
];
|
|
389
|
-
exports.ElectionTextColor = [
|
|
390
|
-
'#ffffff',
|
|
391
|
-
'#000000',
|
|
392
|
-
'#000000',
|
|
393
|
-
'#ffffff',
|
|
394
|
-
'#000000',
|
|
395
|
-
'#000000',
|
|
396
|
-
'#ffffff',
|
|
397
|
-
];
|
|
398
|
-
exports.ElectionLabel = [
|
|
399
|
-
'Great Republican',
|
|
400
|
-
'Good Republican',
|
|
401
|
-
'Fair Republican',
|
|
402
|
-
'Even',
|
|
403
|
-
'Fair Democrat',
|
|
404
|
-
'Good Democrat',
|
|
405
|
-
'Great Democrat'
|
|
406
|
-
];
|
|
407
|
-
const lum = [0, 25, 50, 75, 100, 125, 150, 175, 200, 225, 255];
|
|
408
|
-
exports.IntensityBackgroundColor = [];
|
|
409
|
-
lum.forEach((n) => { exports.IntensityBackgroundColor.push(`rgba(${n}, ${n}, ${n}, 1.0)`); });
|
|
410
|
-
|
|
411
|
-
|
|
412
90
|
/***/ }),
|
|
413
91
|
|
|
414
92
|
/***/ "./lib/csv.ts":
|
|
@@ -419,7 +97,7 @@ lum.forEach((n) => { exports.IntensityBackgroundColor.push(`rgba(${n}, ${n}, ${n
|
|
|
419
97
|
|
|
420
98
|
|
|
421
99
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
422
|
-
exports.StateNameMap = exports.StateCodesOrdered = exports.isValidStateNameForUrl = exports.geoidToState = exports.StateCodeToStateId = exports.StateIdToStateCode = exports.blockmapToVTDmap = exports.blockmapToState = exports.parseCSVLine = exports.canonicalDistrictIDOrdering = exports.canonicalDistrictIDGapFill = exports.canonicalDistrictIDFromNumber = exports.canonicalNumericFromDistrictID = exports.canonicalSortingDistrictID = exports.canonicalDistrictID = void 0;
|
|
100
|
+
exports.StateNameMap = exports.StateCodesOrdered = exports.isValidStateNameForUrl = exports.geoidToState = exports.StateCodeToStateId = exports.StateIdToStateCode = exports.blockmapToVTDmap = exports.blockmapToState = exports.csvLine = exports.parseCSVLine = exports.canonicalDistrictIDOrdering = exports.canonicalDistrictIDGapFill = exports.canonicalDistrictIDFromNumber = exports.canonicalNumericFromDistrictID = exports.canonicalSortingDistrictID = exports.canonicalDistrictID = void 0;
|
|
423
101
|
// Public libraries
|
|
424
102
|
const baseclient_1 = __webpack_require__(/*! @dra2020/baseclient */ "@dra2020/baseclient");
|
|
425
103
|
const reverse_1 = __webpack_require__(/*! ./reverse */ "./lib/reverse.ts");
|
|
@@ -570,6 +248,18 @@ function parseCSVLine(line) {
|
|
|
570
248
|
return null;
|
|
571
249
|
}
|
|
572
250
|
exports.parseCSVLine = parseCSVLine;
|
|
251
|
+
function csvLine(coder, line) {
|
|
252
|
+
if (!coder || !line)
|
|
253
|
+
return null;
|
|
254
|
+
let parse = new baseclient_1.CSV.ParseOne(coder, line);
|
|
255
|
+
if (parse.length != 2)
|
|
256
|
+
return null;
|
|
257
|
+
let re = /^\d\d/;
|
|
258
|
+
if (!re.exec(parse.fields[0]))
|
|
259
|
+
return null;
|
|
260
|
+
return { geoid: parse.fields[0], districtID: parse.fields[1] };
|
|
261
|
+
}
|
|
262
|
+
exports.csvLine = csvLine;
|
|
573
263
|
function blockmapToState(blockMap) {
|
|
574
264
|
for (var id in blockMap)
|
|
575
265
|
if (blockMap.hasOwnProperty(id))
|
|
@@ -602,7 +292,7 @@ function blockmapToVTDmap(revMap, blockMap, stateMap, altBlocks) {
|
|
|
602
292
|
nSplitBlocks: 0,
|
|
603
293
|
};
|
|
604
294
|
let bmGather = {};
|
|
605
|
-
revMap = revMap || reverse_1.reverseBlockMapping(stateMap);
|
|
295
|
+
revMap = revMap || (0, reverse_1.reverseBlockMapping)(stateMap);
|
|
606
296
|
let revBG; // lazy create on demand
|
|
607
297
|
if (altBlocks) {
|
|
608
298
|
// Create reverse of altBlocks if they exist {altBlockid: {stdBlockid, pop}, ...}
|
|
@@ -665,7 +355,7 @@ function blockmapToVTDmap(revMap, blockMap, stateMap, altBlocks) {
|
|
|
665
355
|
}
|
|
666
356
|
else if (n == 12) {
|
|
667
357
|
if (!revBG)
|
|
668
|
-
revBG = reverse_1.reverseBlockgroupMapping(stateMap);
|
|
358
|
+
revBG = (0, reverse_1.reverseBlockgroupMapping)(stateMap);
|
|
669
359
|
if (revBG[id]) {
|
|
670
360
|
ids = revBG[id];
|
|
671
361
|
geoids = ids.map(id => stateMap[id]);
|
|
@@ -1026,39 +716,6 @@ exports.StateNameMap = {
|
|
|
1026
716
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1027
717
|
|
|
1028
718
|
|
|
1029
|
-
/***/ }),
|
|
1030
|
-
|
|
1031
|
-
/***/ "./lib/gencolor.ts":
|
|
1032
|
-
/*!*************************!*\
|
|
1033
|
-
!*** ./lib/gencolor.ts ***!
|
|
1034
|
-
\*************************/
|
|
1035
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1039
|
-
exports.genColor = void 0;
|
|
1040
|
-
const ColorData = __webpack_require__(/*! ./colordata */ "./lib/colordata.ts");
|
|
1041
|
-
let ColorTable = null;
|
|
1042
|
-
const MaxColors = 100;
|
|
1043
|
-
function genColor(i, useFirstColor) {
|
|
1044
|
-
// i is district number, 0 => District[0] (unassigned), so subtract 1 to access ColorTable
|
|
1045
|
-
function gen_table() {
|
|
1046
|
-
ColorTable = [];
|
|
1047
|
-
for (let i = 0; i < MaxColors; i++) {
|
|
1048
|
-
// A little funky math below to skip the first (white) color
|
|
1049
|
-
let j = (i % (ColorData.DefaultColorNames.length - 1)) + 1;
|
|
1050
|
-
ColorTable.push(ColorData.ColorValues[ColorData.DefaultColorNames[j]]);
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
if (ColorTable == null)
|
|
1054
|
-
gen_table();
|
|
1055
|
-
if (i == 0)
|
|
1056
|
-
return ColorData.ColorValues[ColorData.DefaultColorNames[0]];
|
|
1057
|
-
return ColorTable[((i - 1) + (useFirstColor ? 0 : 1)) % MaxColors];
|
|
1058
|
-
}
|
|
1059
|
-
exports.genColor = genColor;
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
719
|
/***/ }),
|
|
1063
720
|
|
|
1064
721
|
/***/ "./lib/groups.ts":
|
|
@@ -1265,7 +922,7 @@ exports.Schemas = {
|
|
|
1265
922
|
{ published: 'HASH' },
|
|
1266
923
|
{ xid: 'HASH' },
|
|
1267
924
|
{ id: 'HASH' }
|
|
1268
|
-
],
|
|
925
|
+
], // sparse
|
|
1269
926
|
},
|
|
1270
927
|
'expungestate': {
|
|
1271
928
|
FileOptions: { version: 7, name: 'sessions', map: true },
|
|
@@ -1346,6 +1003,7 @@ exports.Schemas = {
|
|
|
1346
1003
|
Schema: {
|
|
1347
1004
|
id: 'S',
|
|
1348
1005
|
lastModified: 'S',
|
|
1006
|
+
/* ... others */
|
|
1349
1007
|
},
|
|
1350
1008
|
KeySchema: { id: 'HASH' }
|
|
1351
1009
|
},
|
|
@@ -1405,7 +1063,7 @@ exports.Schemas = {
|
|
|
1405
1063
|
GlobalSecondaryIndexes: [
|
|
1406
1064
|
{ published: 'HASH' },
|
|
1407
1065
|
{ id: 'HASH' }
|
|
1408
|
-
],
|
|
1066
|
+
], // sparse
|
|
1409
1067
|
},
|
|
1410
1068
|
'groups': {
|
|
1411
1069
|
FileOptions: { map: true },
|
|
@@ -1787,7 +1445,7 @@ const Hash = __webpack_require__(/*! object-hash */ "object-hash");
|
|
|
1787
1445
|
function vhash(o) {
|
|
1788
1446
|
return Hash(o, { respectType: false,
|
|
1789
1447
|
unorderedArrays: true,
|
|
1790
|
-
unorderedObjects: true,
|
|
1448
|
+
unorderedObjects: true,
|
|
1791
1449
|
// basically, include (state,datasource,geoid,blocks[])
|
|
1792
1450
|
excludeKeys: (k) => (k === 'id' || k === 'chunk' || k === 'chunkList' || k === 'chunkKey')
|
|
1793
1451
|
});
|
|
@@ -1925,7 +1583,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1925
1583
|
\**************************************/
|
|
1926
1584
|
/***/ ((module) => {
|
|
1927
1585
|
|
|
1928
|
-
module.exports = require("@dra2020/baseclient")
|
|
1586
|
+
module.exports = require("@dra2020/baseclient");
|
|
1929
1587
|
|
|
1930
1588
|
/***/ }),
|
|
1931
1589
|
|
|
@@ -1935,7 +1593,7 @@ module.exports = require("@dra2020/baseclient");;
|
|
|
1935
1593
|
\******************************/
|
|
1936
1594
|
/***/ ((module) => {
|
|
1937
1595
|
|
|
1938
|
-
module.exports = require("object-hash")
|
|
1596
|
+
module.exports = require("object-hash");
|
|
1939
1597
|
|
|
1940
1598
|
/***/ })
|
|
1941
1599
|
|
|
@@ -1947,8 +1605,9 @@ module.exports = require("object-hash");;
|
|
|
1947
1605
|
/******/ // The require function
|
|
1948
1606
|
/******/ function __webpack_require__(moduleId) {
|
|
1949
1607
|
/******/ // Check if module is in cache
|
|
1950
|
-
/******/
|
|
1951
|
-
/******/
|
|
1608
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
1609
|
+
/******/ if (cachedModule !== undefined) {
|
|
1610
|
+
/******/ return cachedModule.exports;
|
|
1952
1611
|
/******/ }
|
|
1953
1612
|
/******/ // Create a new module (and put it into the cache)
|
|
1954
1613
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
@@ -1965,10 +1624,13 @@ module.exports = require("object-hash");;
|
|
|
1965
1624
|
/******/ }
|
|
1966
1625
|
/******/
|
|
1967
1626
|
/************************************************************************/
|
|
1968
|
-
/******/
|
|
1627
|
+
/******/
|
|
1969
1628
|
/******/ // startup
|
|
1970
1629
|
/******/ // Load entry module and return exports
|
|
1971
|
-
/******/
|
|
1630
|
+
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
1631
|
+
/******/ var __webpack_exports__ = __webpack_require__("./lib/all.ts");
|
|
1632
|
+
/******/
|
|
1633
|
+
/******/ return __webpack_exports__;
|
|
1972
1634
|
/******/ })()
|
|
1973
1635
|
;
|
|
1974
1636
|
});
|