@bicharts/chart-host 0.5.85 → 0.5.87
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/{chunk-RD3DRWLL.mjs → chunk-NWMMNXH2.mjs} +538 -522
- package/dist/index.mjs +411 -42
- package/dist/react.mjs +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/selectionCard.d.ts +11 -0
- package/dist/types/sourceDateFormat.d.ts +30 -0
- package/package.json +1 -1
|
@@ -22,7 +22,7 @@ var require_papaparse_min = __commonJS({
|
|
|
22
22
|
"function" == typeof define && define.amd ? define([], t) : "object" == typeof module && "undefined" != typeof exports ? module.exports = t() : e.Papa = t();
|
|
23
23
|
})(exports, function r() {
|
|
24
24
|
var n = "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0 !== n ? n : {};
|
|
25
|
-
var d,
|
|
25
|
+
var d, s2 = !n.document && !!n.postMessage, a4 = n.IS_PAPA_WORKER || false, o = {}, h2 = 0, v3 = {};
|
|
26
26
|
function P4(e) {
|
|
27
27
|
return 65279 === e.charCodeAt(0) ? e.slice(1) : e;
|
|
28
28
|
}
|
|
@@ -41,7 +41,7 @@ var require_papaparse_min = __commonJS({
|
|
|
41
41
|
var i4 = this._partialLine + t, r2 = (this._partialLine = "", this._handle.parse(i4, this._baseIndex, !this._finished));
|
|
42
42
|
if (!this._handle.paused() && !this._handle.aborted()) {
|
|
43
43
|
t = r2.meta.cursor, i4 = (this._finished || (this._partialLine = i4.substring(t - this._baseIndex), this._baseIndex = t), r2 && r2.data && (this._rowCount += r2.data.length), this._finished || this._config.preview && this._rowCount >= this._config.preview);
|
|
44
|
-
if (
|
|
44
|
+
if (a4) n.postMessage({ results: r2, workerId: v3.WORKER_ID, finished: i4 });
|
|
45
45
|
else if (q3(this._config.chunk) && !e2) {
|
|
46
46
|
if (this._config.chunk(r2, this._handle), this._handle.paused() || this._handle.aborted()) return void (this._halted = true);
|
|
47
47
|
this._completeResults = r2 = void 0;
|
|
@@ -50,12 +50,12 @@ var require_papaparse_min = __commonJS({
|
|
|
50
50
|
}
|
|
51
51
|
this._halted = true;
|
|
52
52
|
}, this._sendError = function(e2) {
|
|
53
|
-
q3(this._config.error) ? this._config.error(e2) :
|
|
53
|
+
q3(this._config.error) ? this._config.error(e2) : a4 && this._config.error && n.postMessage({ workerId: v3.WORKER_ID, error: e2, finished: false });
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function f2(e) {
|
|
57
57
|
var r2;
|
|
58
|
-
(e = e || {}).chunkSize || (e.chunkSize = v3.RemoteChunkSize), u4.call(this, e), this._nextChunk =
|
|
58
|
+
(e = e || {}).chunkSize || (e.chunkSize = v3.RemoteChunkSize), u4.call(this, e), this._nextChunk = s2 ? function() {
|
|
59
59
|
this._readChunk(), this._chunkLoaded();
|
|
60
60
|
} : function() {
|
|
61
61
|
this._readChunk();
|
|
@@ -64,7 +64,7 @@ var require_papaparse_min = __commonJS({
|
|
|
64
64
|
}, this._readChunk = function() {
|
|
65
65
|
if (this._finished) this._chunkLoaded();
|
|
66
66
|
else {
|
|
67
|
-
if (r2 = new XMLHttpRequest(), this._config.withCredentials && (r2.withCredentials = this._config.withCredentials),
|
|
67
|
+
if (r2 = new XMLHttpRequest(), this._config.withCredentials && (r2.withCredentials = this._config.withCredentials), s2 || (r2.onload = y4(this._chunkLoaded, this), r2.onerror = y4(this._chunkError, this)), r2.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !s2), this._config.downloadRequestHeaders) {
|
|
68
68
|
var e2, t = this._config.downloadRequestHeaders;
|
|
69
69
|
for (e2 in t) r2.setRequestHeader(e2, t[e2]);
|
|
70
70
|
}
|
|
@@ -75,7 +75,7 @@ var require_papaparse_min = __commonJS({
|
|
|
75
75
|
} catch (e4) {
|
|
76
76
|
this._chunkError(e4.message);
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
s2 && 0 === r2.status && this._chunkError();
|
|
79
79
|
}
|
|
80
80
|
}, this._chunkLoaded = function() {
|
|
81
81
|
4 === r2.readyState && (r2.status < 200 || 400 <= r2.status ? this._chunkError() : (this._start += this._config.chunkSize || r2.responseText.length, this._finished = !this._config.chunkSize || this._start >= ((e2) => null !== (e2 = e2.getResponseHeader("Content-Range")) ? parseInt(e2.substring(e2.lastIndexOf("/") + 1)) : -1)(r2), this.parseChunk(r2.responseText)));
|
|
@@ -100,7 +100,7 @@ var require_papaparse_min = __commonJS({
|
|
|
100
100
|
this._sendError(i4.error);
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function c2(e) {
|
|
104
104
|
var i4;
|
|
105
105
|
u4.call(this, e = e || {}), this.stream = function(e2) {
|
|
106
106
|
return i4 = e2, this._nextChunk();
|
|
@@ -109,7 +109,7 @@ var require_papaparse_min = __commonJS({
|
|
|
109
109
|
if (!this._finished) return e2 = this._config.chunkSize, i4 = e2 ? (t = i4.substring(0, e2), i4.substring(e2)) : (t = i4, ""), this._finished = !i4, this.parseChunk(t);
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function p2(e) {
|
|
113
113
|
u4.call(this, e = e || {});
|
|
114
114
|
var t = [], i4 = true, r2 = false;
|
|
115
115
|
this.pause = function() {
|
|
@@ -137,68 +137,68 @@ var require_papaparse_min = __commonJS({
|
|
|
137
137
|
}, this);
|
|
138
138
|
}
|
|
139
139
|
function i2(m2) {
|
|
140
|
-
var n2,
|
|
140
|
+
var n2, s4, a5, t, o2 = Math.pow(2, 53), h3 = -o2, u5 = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/, d2 = /^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/, i4 = this, r2 = 0, f4 = 0, l3 = false, e = false, c4 = [], p4 = { data: [], errors: [], meta: {} };
|
|
141
141
|
function y5(e2) {
|
|
142
142
|
return "greedy" === m2.skipEmptyLines ? "" === e2.join("").trim() : 1 === e2.length && 0 === e2[0].length;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
if (
|
|
144
|
+
function g4() {
|
|
145
|
+
if (p4 && a5 && (k2("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + v3.DefaultDelimiter + "'"), a5 = false), m2.skipEmptyLines && (p4.data = p4.data.filter(function(e4) {
|
|
146
146
|
return !y5(e4);
|
|
147
147
|
})), _3()) {
|
|
148
148
|
let t4 = function(e4, t5) {
|
|
149
|
-
e4 = P4(e4), q3(m2.transformHeader) && (e4 = m2.transformHeader(e4, t5)),
|
|
149
|
+
e4 = P4(e4), q3(m2.transformHeader) && (e4 = m2.transformHeader(e4, t5)), c4.push(e4);
|
|
150
150
|
};
|
|
151
151
|
var t2 = t4;
|
|
152
|
-
if (
|
|
153
|
-
for (var e2 = 0; _3() && e2 <
|
|
154
|
-
|
|
155
|
-
} else
|
|
152
|
+
if (p4) if (Array.isArray(p4.data[0])) {
|
|
153
|
+
for (var e2 = 0; _3() && e2 < p4.data.length; e2++) p4.data[e2].forEach(t4);
|
|
154
|
+
p4.data.splice(0, 1);
|
|
155
|
+
} else p4.data.forEach(t4);
|
|
156
156
|
}
|
|
157
157
|
function i5(e4, t4) {
|
|
158
158
|
for (var i6 = m2.header ? {} : [], r5 = 0; r5 < e4.length; r5++) {
|
|
159
|
-
var n4 = r5,
|
|
159
|
+
var n4 = r5, s5 = e4[r5], s5 = ((e5, t5) => ((e6) => (m2.dynamicTypingFunction && void 0 === m2.dynamicTyping[e6] && (m2.dynamicTyping[e6] = m2.dynamicTypingFunction(e6)), true === (m2.dynamicTyping[e6] || m2.dynamicTyping)))(e5) ? "true" === t5 || "TRUE" === t5 || "false" !== t5 && "FALSE" !== t5 && (((e6) => {
|
|
160
160
|
if (u5.test(e6)) {
|
|
161
161
|
e6 = parseFloat(e6);
|
|
162
|
-
if (h3 < e6 && e6 <
|
|
162
|
+
if (h3 < e6 && e6 < o2) return 1;
|
|
163
163
|
}
|
|
164
|
-
})(t5) ? parseFloat(t5) : d2.test(t5) ? new Date(t5) : "" === t5 ? null : t5) : t5)(n4 = m2.header ? r5 >=
|
|
165
|
-
"__parsed_extra" === n4 ? (i6[n4] = i6[n4] || [], i6[n4].push(
|
|
164
|
+
})(t5) ? parseFloat(t5) : d2.test(t5) ? new Date(t5) : "" === t5 ? null : t5) : t5)(n4 = m2.header ? r5 >= c4.length ? "__parsed_extra" : c4[r5] : n4, s5 = m2.transform ? m2.transform(s5, n4) : s5);
|
|
165
|
+
"__parsed_extra" === n4 ? (i6[n4] = i6[n4] || [], i6[n4].push(s5)) : i6[n4] = s5;
|
|
166
166
|
}
|
|
167
|
-
return m2.header && (r5 >
|
|
167
|
+
return m2.header && (r5 > c4.length ? k2("FieldMismatch", "TooManyFields", "Too many fields: expected " + c4.length + " fields but parsed " + r5, f4 + t4) : r5 < c4.length && k2("FieldMismatch", "TooFewFields", "Too few fields: expected " + c4.length + " fields but parsed " + r5, f4 + t4)), i6;
|
|
168
168
|
}
|
|
169
169
|
var r4;
|
|
170
|
-
|
|
170
|
+
p4 && (m2.header || m2.dynamicTyping || m2.transform) && (r4 = 1, !p4.data.length || Array.isArray(p4.data[0]) ? (p4.data = p4.data.map(i5), r4 = p4.data.length) : p4.data = i5(p4.data, 0), m2.header && p4.meta && (p4.meta.fields = c4), f4 += r4);
|
|
171
171
|
}
|
|
172
172
|
function _3() {
|
|
173
|
-
return m2.header && 0 ===
|
|
173
|
+
return m2.header && 0 === c4.length;
|
|
174
174
|
}
|
|
175
175
|
function k2(e2, t2, i5, r4) {
|
|
176
176
|
e2 = { type: e2, code: t2, message: i5 };
|
|
177
|
-
void 0 !== r4 && (e2.row = r4),
|
|
177
|
+
void 0 !== r4 && (e2.row = r4), p4.errors.push(e2);
|
|
178
178
|
}
|
|
179
179
|
q3(m2.step) && (t = m2.step, m2.step = function(e2) {
|
|
180
|
-
|
|
180
|
+
p4 = e2, _3() ? g4() : (g4(), 0 !== p4.data.length && (r2 += e2.data.length, m2.preview && r2 > m2.preview ? s4.abort() : (p4.data = p4.data[0], t(p4, i4))));
|
|
181
181
|
}), this.parse = function(e2, t2, i5) {
|
|
182
|
-
var r4 = m2.quoteChar || '"', r4 = (m2.newline || (m2.newline = this.guessLineEndings(e2, r4)),
|
|
183
|
-
var
|
|
182
|
+
var r4 = m2.quoteChar || '"', r4 = (m2.newline || (m2.newline = this.guessLineEndings(e2, r4)), a5 = false, m2.delimiter ? q3(m2.delimiter) && (m2.delimiter = m2.delimiter(e2), p4.meta.delimiter = m2.delimiter) : ((r4 = ((e4, t4, i6, r5, n4) => {
|
|
183
|
+
var s5, a6, o4, h4;
|
|
184
184
|
n4 = n4 || [",", " ", "|", ";", v3.RECORD_SEP, v3.UNIT_SEP];
|
|
185
185
|
for (var u6 = 0; u6 < n4.length; u6++) {
|
|
186
|
-
for (var d3,
|
|
187
|
-
0 <
|
|
186
|
+
for (var d3, f5 = n4[u6], l4 = 0, c5 = 0, p5 = 0, g5 = (o4 = void 0, new E4({ comments: r5, delimiter: f5, newline: t4, preview: 10 }).parse(e4)), _4 = 0; _4 < g5.data.length; _4++) i6 && y5(g5.data[_4]) ? p5++ : (d3 = g5.data[_4].length, c5 += d3, void 0 === o4 ? o4 = d3 : 0 < d3 && (l4 += Math.abs(d3 - o4), o4 = d3));
|
|
187
|
+
0 < g5.data.length && (c5 /= g5.data.length - p5), (void 0 === a6 || l4 <= a6) && (void 0 === h4 || h4 < c5) && 1.99 < c5 && (a6 = l4, s5 = f5, h4 = c5);
|
|
188
188
|
}
|
|
189
|
-
return { successful: !!(m2.delimiter =
|
|
190
|
-
})(e2, m2.newline, m2.skipEmptyLines, m2.comments, m2.delimitersToGuess)).successful ? m2.delimiter = r4.bestDelimiter : (
|
|
191
|
-
return m2.preview && m2.header && r4.preview++, n2 = e2,
|
|
189
|
+
return { successful: !!(m2.delimiter = s5), bestDelimiter: s5 };
|
|
190
|
+
})(e2, m2.newline, m2.skipEmptyLines, m2.comments, m2.delimitersToGuess)).successful ? m2.delimiter = r4.bestDelimiter : (a5 = true, m2.delimiter = v3.DefaultDelimiter), p4.meta.delimiter = m2.delimiter), b2(m2));
|
|
191
|
+
return m2.preview && m2.header && r4.preview++, n2 = e2, s4 = new E4(r4), p4 = s4.parse(n2, t2, i5), g4(), l3 ? { meta: { paused: true } } : p4 || { meta: { paused: false } };
|
|
192
192
|
}, this.paused = function() {
|
|
193
193
|
return l3;
|
|
194
194
|
}, this.pause = function() {
|
|
195
|
-
l3 = true,
|
|
195
|
+
l3 = true, s4.abort(), n2 = q3(m2.chunk) ? "" : n2.substring(s4.getCharIndex());
|
|
196
196
|
}, this.resume = function() {
|
|
197
197
|
i4.streamer._halted ? (l3 = false, i4.streamer.parseChunk(n2, true)) : setTimeout(i4.resume, 3);
|
|
198
198
|
}, this.aborted = function() {
|
|
199
199
|
return e;
|
|
200
200
|
}, this.abort = function() {
|
|
201
|
-
e = true,
|
|
201
|
+
e = true, s4.abort(), p4.meta.aborted = true, q3(m2.complete) && m2.complete(p4), n2 = "";
|
|
202
202
|
}, this.guessLineEndings = function(e2, t2) {
|
|
203
203
|
e2 = e2.substring(0, 1048576);
|
|
204
204
|
var t2 = new RegExp(U3(t2) + "([^]*?)" + U3(t2), "gm"), i5 = (e2 = e2.replace(t2, "")).split("\r"), t2 = e2.split("\n"), e2 = 1 < t2.length && t2[0].length < i5[0].length;
|
|
@@ -211,86 +211,86 @@ var require_papaparse_min = __commonJS({
|
|
|
211
211
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
212
212
|
}
|
|
213
213
|
function E4(C2) {
|
|
214
|
-
var S = (C2 = C2 || {}).delimiter, O2 = C2.newline, x2 = C2.comments, I2 = C2.step, A = C2.preview,
|
|
214
|
+
var S = (C2 = C2 || {}).delimiter, O2 = C2.newline, x2 = C2.comments, I2 = C2.step, A = C2.preview, T3 = C2.fastMode, D3 = null, L2 = false, F4 = null == C2.quoteChar ? '"' : C2.quoteChar, j3 = F4;
|
|
215
215
|
if (void 0 !== C2.escapeChar && (j3 = C2.escapeChar), ("string" != typeof S || -1 < v3.BAD_DELIMITERS.indexOf(S)) && (S = ","), x2 === S) throw new Error("Comment character same as delimiter");
|
|
216
216
|
true === x2 ? x2 = "#" : ("string" != typeof x2 || -1 < v3.BAD_DELIMITERS.indexOf(x2)) && (x2 = false), "\n" !== O2 && "\r" !== O2 && "\r\n" !== O2 && (O2 = "\n");
|
|
217
217
|
var z3 = 0, M = false;
|
|
218
218
|
this.parse = function(i4, t, r2) {
|
|
219
219
|
if ("string" != typeof i4) throw new Error("Input must be a string");
|
|
220
|
-
var n2 = i4.length, e = S.length,
|
|
220
|
+
var n2 = i4.length, e = S.length, s4 = O2.length, a5 = x2.length, o2 = q3(I2), h3 = [], u5 = [], d2 = [], f4 = z3 = 0;
|
|
221
221
|
if (!i4) return w2();
|
|
222
|
-
if (
|
|
223
|
-
for (var l3 = i4.split(O2),
|
|
224
|
-
if (d2 = l3[
|
|
222
|
+
if (T3 || false !== T3 && -1 === i4.indexOf(F4)) {
|
|
223
|
+
for (var l3 = i4.split(O2), c4 = 0; c4 < l3.length; c4++) {
|
|
224
|
+
if (d2 = l3[c4], z3 += d2.length, c4 !== l3.length - 1) z3 += O2.length;
|
|
225
225
|
else if (r2) return w2();
|
|
226
|
-
if (!x2 || d2.substring(0,
|
|
227
|
-
if (
|
|
226
|
+
if (!x2 || d2.substring(0, a5) !== x2) {
|
|
227
|
+
if (o2) {
|
|
228
228
|
if (h3 = [], k2(d2.split(S)), R(), M) return w2();
|
|
229
229
|
} else k2(d2.split(S));
|
|
230
|
-
if (A && A <=
|
|
230
|
+
if (A && A <= c4) return h3 = h3.slice(0, A), w2(true);
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
return w2();
|
|
234
234
|
}
|
|
235
|
-
for (var
|
|
236
|
-
if (-1 === (m2 = i4.indexOf(
|
|
237
|
-
if (m2 === n2 - 1) return E5(i4.substring(z3, m2).replace(_3,
|
|
238
|
-
if (
|
|
239
|
-
else if (
|
|
240
|
-
-1 !==
|
|
241
|
-
var y5 = v4(-1 === (
|
|
235
|
+
for (var p4 = i4.indexOf(S, z3), g4 = i4.indexOf(O2, z3), _3 = new RegExp(U3(j3) + U3(F4), "g"), m2 = i4.indexOf(F4, z3); ; ) if (i4[z3] === F4) for (m2 = z3, z3++; ; ) {
|
|
236
|
+
if (-1 === (m2 = i4.indexOf(F4, m2 + 1))) return r2 || u5.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: h3.length, index: z3 }), E5();
|
|
237
|
+
if (m2 === n2 - 1) return E5(i4.substring(z3, m2).replace(_3, F4));
|
|
238
|
+
if (F4 === j3 && i4[m2 + 1] === j3) m2++;
|
|
239
|
+
else if (F4 === j3 || 0 === m2 || i4[m2 - 1] !== j3) {
|
|
240
|
+
-1 !== p4 && p4 < m2 + 1 && (p4 = i4.indexOf(S, m2 + 1));
|
|
241
|
+
var y5 = v4(-1 === (g4 = -1 !== g4 && g4 < m2 + 1 ? i4.indexOf(O2, m2 + 1) : g4) ? p4 : Math.min(p4, g4));
|
|
242
242
|
if (i4.substr(m2 + 1 + y5, e) === S) {
|
|
243
|
-
d2.push(i4.substring(z3, m2).replace(_3,
|
|
243
|
+
d2.push(i4.substring(z3, m2).replace(_3, F4)), i4[z3 = m2 + 1 + y5 + e] !== F4 && (m2 = i4.indexOf(F4, z3)), p4 = i4.indexOf(S, z3), g4 = i4.indexOf(O2, z3);
|
|
244
244
|
break;
|
|
245
245
|
}
|
|
246
|
-
y5 = v4(
|
|
247
|
-
if (i4.substring(m2 + 1 + y5, m2 + 1 + y5 +
|
|
248
|
-
if (d2.push(i4.substring(z3, m2).replace(_3,
|
|
246
|
+
y5 = v4(g4);
|
|
247
|
+
if (i4.substring(m2 + 1 + y5, m2 + 1 + y5 + s4) === O2) {
|
|
248
|
+
if (d2.push(i4.substring(z3, m2).replace(_3, F4)), b4(m2 + 1 + y5 + s4), p4 = i4.indexOf(S, z3), m2 = i4.indexOf(F4, z3), o2 && (R(), M)) return w2();
|
|
249
249
|
if (A && h3.length >= A) return w2(true);
|
|
250
250
|
break;
|
|
251
251
|
}
|
|
252
252
|
u5.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: h3.length, index: z3 }), m2++;
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
else if (x2 && 0 === d2.length && i4.substring(z3, z3 +
|
|
256
|
-
if (-1 ===
|
|
257
|
-
z3 =
|
|
258
|
-
} else if (-1 !==
|
|
255
|
+
else if (x2 && 0 === d2.length && i4.substring(z3, z3 + a5) === x2) {
|
|
256
|
+
if (-1 === g4) return w2();
|
|
257
|
+
z3 = g4 + s4, g4 = i4.indexOf(O2, z3), p4 = i4.indexOf(S, z3);
|
|
258
|
+
} else if (-1 !== p4 && (p4 < g4 || -1 === g4)) d2.push(i4.substring(z3, p4)), z3 = p4 + e, p4 = i4.indexOf(S, z3);
|
|
259
259
|
else {
|
|
260
|
-
if (-1 ===
|
|
261
|
-
if (d2.push(i4.substring(z3,
|
|
260
|
+
if (-1 === g4) break;
|
|
261
|
+
if (d2.push(i4.substring(z3, g4)), b4(g4 + s4), o2 && (R(), M)) return w2();
|
|
262
262
|
if (A && h3.length >= A) return w2(true);
|
|
263
263
|
}
|
|
264
264
|
return E5();
|
|
265
265
|
function k2(e2) {
|
|
266
|
-
h3.push(e2),
|
|
266
|
+
h3.push(e2), f4 = z3;
|
|
267
267
|
}
|
|
268
268
|
function v4(e2) {
|
|
269
269
|
var t2 = 0;
|
|
270
270
|
return t2 = -1 !== e2 && (e2 = i4.substring(m2 + 1, e2)) && "" === e2.trim() ? e2.length : t2;
|
|
271
271
|
}
|
|
272
272
|
function E5(e2) {
|
|
273
|
-
return r2 || (void 0 === e2 && (e2 = i4.substring(z3)), d2.push(e2), z3 = n2, k2(d2),
|
|
273
|
+
return r2 || (void 0 === e2 && (e2 = i4.substring(z3)), d2.push(e2), z3 = n2, k2(d2), o2 && R()), w2();
|
|
274
274
|
}
|
|
275
275
|
function b4(e2) {
|
|
276
|
-
z3 = e2, k2(d2), d2 = [],
|
|
276
|
+
z3 = e2, k2(d2), d2 = [], g4 = i4.indexOf(O2, z3);
|
|
277
277
|
}
|
|
278
278
|
function w2(e2) {
|
|
279
279
|
if (C2.header && !t && h3.length && !L2) {
|
|
280
|
-
var
|
|
280
|
+
var s5 = h3[0], a6 = /* @__PURE__ */ Object.create(null), o4 = new Set(s5);
|
|
281
281
|
let n4 = false;
|
|
282
|
-
for (let r4 = 0; r4 <
|
|
283
|
-
let i5 = P4(
|
|
284
|
-
if (
|
|
285
|
-
let e4, t2 =
|
|
286
|
-
for (; e4 = i5 + "_" + t2, t2++,
|
|
287
|
-
|
|
288
|
-
} else
|
|
289
|
-
|
|
282
|
+
for (let r4 = 0; r4 < s5.length; r4++) {
|
|
283
|
+
let i5 = P4(s5[r4]);
|
|
284
|
+
if (a6[i5 = q3(C2.transformHeader) ? C2.transformHeader(i5, r4) : i5]) {
|
|
285
|
+
let e4, t2 = a6[i5];
|
|
286
|
+
for (; e4 = i5 + "_" + t2, t2++, o4.has(e4); ) ;
|
|
287
|
+
o4.add(e4), s5[r4] = e4, a6[i5]++, n4 = true, (D3 = null === D3 ? {} : D3)[e4] = i5;
|
|
288
|
+
} else a6[i5] = 1, s5[r4] = i5;
|
|
289
|
+
o4.add(i5);
|
|
290
290
|
}
|
|
291
291
|
n4 && console.warn("Duplicate headers found and renamed."), L2 = true;
|
|
292
292
|
}
|
|
293
|
-
return { data: h3, errors: u5, meta: { delimiter: S, linebreak: O2, aborted: M, truncated: !!e2, cursor:
|
|
293
|
+
return { data: h3, errors: u5, meta: { delimiter: S, linebreak: O2, aborted: M, truncated: !!e2, cursor: f4 + (t || 0), renamedHeaders: D3 } };
|
|
294
294
|
}
|
|
295
295
|
function R() {
|
|
296
296
|
I2(w2()), h3 = [], u5 = [];
|
|
@@ -301,23 +301,23 @@ var require_papaparse_min = __commonJS({
|
|
|
301
301
|
return z3;
|
|
302
302
|
};
|
|
303
303
|
}
|
|
304
|
-
function
|
|
305
|
-
var t = e.data, i4 =
|
|
304
|
+
function g3(e) {
|
|
305
|
+
var t = e.data, i4 = o[t.workerId], r2 = false;
|
|
306
306
|
if (t.error) i4.userError(t.error, t.file);
|
|
307
307
|
else if (t.results && t.results.data) {
|
|
308
308
|
var n2 = { abort: function() {
|
|
309
309
|
r2 = true, _2(t.workerId, { data: [], errors: [], meta: { aborted: true } });
|
|
310
310
|
}, pause: m, resume: m };
|
|
311
311
|
if (q3(i4.userStep)) {
|
|
312
|
-
for (var
|
|
312
|
+
for (var s4 = 0; s4 < t.results.data.length && (i4.userStep({ data: t.results.data[s4], errors: t.results.errors, meta: t.results.meta }, n2), !r2); s4++) ;
|
|
313
313
|
delete t.results;
|
|
314
314
|
} else q3(i4.userChunk) && (i4.userChunk(t.results, n2, t.file), delete t.results);
|
|
315
315
|
}
|
|
316
316
|
t.finished && !r2 && _2(t.workerId, t.results);
|
|
317
317
|
}
|
|
318
318
|
function _2(e, t) {
|
|
319
|
-
var i4 =
|
|
320
|
-
q3(i4.userComplete) && i4.userComplete(t), i4.terminate(), delete
|
|
319
|
+
var i4 = o[e];
|
|
320
|
+
q3(i4.userComplete) && i4.userComplete(t), i4.terminate(), delete o[e];
|
|
321
321
|
}
|
|
322
322
|
function m() {
|
|
323
323
|
throw new Error("Not implemented.");
|
|
@@ -339,26 +339,26 @@ var require_papaparse_min = __commonJS({
|
|
|
339
339
|
return v3.parse = function(e, t) {
|
|
340
340
|
var i4 = (t = t || {}).dynamicTyping || false;
|
|
341
341
|
q3(i4) && (t.dynamicTypingFunction = i4, i4 = {});
|
|
342
|
-
if (t.dynamicTyping = i4, t.transform = !!q3(t.transform) && t.transform, !t.worker || !v3.WORKERS_SUPPORTED) return i4 = null, v3.NODE_STREAM_INPUT, "string" == typeof e ? (e = P4(e), i4 = new (t.download ?
|
|
342
|
+
if (t.dynamicTyping = i4, t.transform = !!q3(t.transform) && t.transform, !t.worker || !v3.WORKERS_SUPPORTED) return i4 = null, v3.NODE_STREAM_INPUT, "string" == typeof e ? (e = P4(e), i4 = new (t.download ? f2 : c2)(t)) : true === e.readable && q3(e.read) && q3(e.on) ? i4 = new p2(t) : (n.File && e instanceof File || e instanceof Object) && (i4 = new l2(t)), i4.stream(e);
|
|
343
343
|
(i4 = (() => {
|
|
344
344
|
var e2;
|
|
345
345
|
return !!v3.WORKERS_SUPPORTED && (e2 = (() => {
|
|
346
346
|
var e4 = n.URL || n.webkitURL || null, t2 = r.toString();
|
|
347
347
|
return v3.BLOB_URL || (v3.BLOB_URL = e4.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ", "(", t2, ")();"], { type: "text/javascript" })));
|
|
348
|
-
})(), (e2 = new n.Worker(e2)).onmessage =
|
|
348
|
+
})(), (e2 = new n.Worker(e2)).onmessage = g3, e2.id = h2++, o[e2.id] = e2);
|
|
349
349
|
})()).userStep = t.step, i4.userChunk = t.chunk, i4.userComplete = t.complete, i4.userError = t.error, t.step = q3(t.step), t.chunk = q3(t.chunk), t.complete = q3(t.complete), t.error = q3(t.error), delete t.worker, i4.postMessage({ input: e, config: t, workerId: i4.id });
|
|
350
350
|
}, v3.unparse = function(e, t) {
|
|
351
|
-
var
|
|
351
|
+
var s4 = false, _3 = true, m2 = ",", y5 = "\r\n", a5 = '"', o2 = a5 + a5, i4 = false, r2 = null, h3 = false, u5 = ((() => {
|
|
352
352
|
if ("object" == typeof t) {
|
|
353
353
|
if ("string" != typeof t.delimiter || v3.BAD_DELIMITERS.filter(function(e2) {
|
|
354
354
|
return -1 !== t.delimiter.indexOf(e2);
|
|
355
|
-
}).length || (m2 = t.delimiter), "boolean" != typeof t.quotes && "function" != typeof t.quotes && !Array.isArray(t.quotes) || (
|
|
355
|
+
}).length || (m2 = t.delimiter), "boolean" != typeof t.quotes && "function" != typeof t.quotes && !Array.isArray(t.quotes) || (s4 = t.quotes), "boolean" != typeof t.skipEmptyLines && "string" != typeof t.skipEmptyLines || (i4 = t.skipEmptyLines), "string" == typeof t.newline && (y5 = t.newline), "string" == typeof t.quoteChar && (a5 = t.quoteChar, o2 = a5 + a5), "boolean" == typeof t.header && (_3 = t.header), Array.isArray(t.columns)) {
|
|
356
356
|
if (0 === t.columns.length) throw new Error("Option columns is empty");
|
|
357
357
|
r2 = t.columns;
|
|
358
358
|
}
|
|
359
|
-
void 0 !== t.escapeChar && (
|
|
359
|
+
void 0 !== t.escapeChar && (o2 = t.escapeChar + a5), t.escapeFormulae instanceof RegExp ? h3 = t.escapeFormulae : "boolean" == typeof t.escapeFormulae && t.escapeFormulae && (h3 = /^[=+\-@\t\r].*$/);
|
|
360
360
|
}
|
|
361
|
-
})(), new RegExp(U3(
|
|
361
|
+
})(), new RegExp(U3(a5), "g"));
|
|
362
362
|
"string" == typeof e && (e = JSON.parse(e));
|
|
363
363
|
if (Array.isArray(e)) {
|
|
364
364
|
if (!e.length || Array.isArray(e[0])) return n2(null, e, i4);
|
|
@@ -366,70 +366,70 @@ var require_papaparse_min = __commonJS({
|
|
|
366
366
|
} else if ("object" == typeof e) return "string" == typeof e.data && (e.data = JSON.parse(e.data)), Array.isArray(e.data) && (e.fields || (e.fields = e.meta && e.meta.fields || r2), e.fields || (e.fields = Array.isArray(e.data[0]) ? e.fields : "object" == typeof e.data[0] ? Object.keys(e.data[0]) : []), Array.isArray(e.data[0]) || "object" == typeof e.data[0] || (e.data = [e.data])), n2(e.fields || [], e.data || [], i4);
|
|
367
367
|
throw new Error("Unable to serialize unrecognized input");
|
|
368
368
|
function n2(e2, t2, i5) {
|
|
369
|
-
var r4 = "", n4 = ("string" == typeof e2 && (e2 = JSON.parse(e2)), "string" == typeof t2 && (t2 = JSON.parse(t2)), Array.isArray(e2) && 0 < e2.length),
|
|
369
|
+
var r4 = "", n4 = ("string" == typeof e2 && (e2 = JSON.parse(e2)), "string" == typeof t2 && (t2 = JSON.parse(t2)), Array.isArray(e2) && 0 < e2.length), s5 = !Array.isArray(t2[0]);
|
|
370
370
|
if (n4 && _3) {
|
|
371
|
-
for (var
|
|
371
|
+
for (var a6 = 0; a6 < e2.length; a6++) 0 < a6 && (r4 += m2), r4 += k2(e2[a6], a6);
|
|
372
372
|
0 < t2.length && (r4 += y5);
|
|
373
373
|
}
|
|
374
|
-
for (var
|
|
375
|
-
var h4 = (n4 ? e2 : t2[
|
|
376
|
-
if (i5 && !n4 && (u6 = "greedy" === i5 ? "" === t2[
|
|
377
|
-
for (var
|
|
378
|
-
var
|
|
379
|
-
|
|
374
|
+
for (var o4 = 0; o4 < t2.length; o4++) {
|
|
375
|
+
var h4 = (n4 ? e2 : t2[o4]).length, u6 = false, d2 = n4 ? 0 === Object.keys(t2[o4]).length : 0 === t2[o4].length;
|
|
376
|
+
if (i5 && !n4 && (u6 = "greedy" === i5 ? "" === t2[o4].join("").trim() : 1 === t2[o4].length && 0 === t2[o4][0].length), "greedy" === i5 && n4) {
|
|
377
|
+
for (var f4 = [], l3 = 0; l3 < h4; l3++) {
|
|
378
|
+
var c4 = s5 ? e2[l3] : l3;
|
|
379
|
+
f4.push(t2[o4][c4]);
|
|
380
380
|
}
|
|
381
|
-
u6 = "" ===
|
|
381
|
+
u6 = "" === f4.join("").trim();
|
|
382
382
|
}
|
|
383
383
|
if (!u6) {
|
|
384
|
-
for (var
|
|
385
|
-
0 <
|
|
386
|
-
var
|
|
387
|
-
r4 += k2(t2[
|
|
384
|
+
for (var p4 = 0; p4 < h4; p4++) {
|
|
385
|
+
0 < p4 && !d2 && (r4 += m2);
|
|
386
|
+
var g4 = n4 && s5 ? e2[p4] : p4;
|
|
387
|
+
r4 += k2(t2[o4][g4], p4);
|
|
388
388
|
}
|
|
389
|
-
|
|
389
|
+
o4 < t2.length - 1 && (!i5 || 0 < h4 && !d2) && (r4 += y5);
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
return r4;
|
|
393
393
|
}
|
|
394
394
|
function k2(e2, t2) {
|
|
395
395
|
var i5, r4, n4;
|
|
396
|
-
return null == e2 ? "" : e2.constructor === Date ? JSON.stringify(e2).slice(1, 25) : (n4 = false, h3 && "string" == typeof e2 && h3.test(e2) && (e2 = "'" + e2, n4 = true), r4 = (i5 = e2.toString()).replace(u5,
|
|
396
|
+
return null == e2 ? "" : e2.constructor === Date ? JSON.stringify(e2).slice(1, 25) : (n4 = false, h3 && "string" == typeof e2 && h3.test(e2) && (e2 = "'" + e2, n4 = true), r4 = (i5 = e2.toString()).replace(u5, o2), (n4 = n4 || true === s4 || "function" == typeof s4 && s4(e2, t2) || Array.isArray(s4) && s4[t2] || ((e4, t4) => {
|
|
397
397
|
for (var i6 = 0; i6 < t4.length; i6++) if (-1 < e4.indexOf(t4[i6])) return true;
|
|
398
398
|
return false;
|
|
399
|
-
})(r4, v3.BAD_DELIMITERS) || -1 < r4.indexOf(m2) || -1 < i5.indexOf(
|
|
399
|
+
})(r4, v3.BAD_DELIMITERS) || -1 < r4.indexOf(m2) || -1 < i5.indexOf(a5) || " " === r4.charAt(0) || " " === r4.charAt(r4.length - 1)) ? a5 + r4 + a5 : r4);
|
|
400
400
|
}
|
|
401
|
-
}, v3.RECORD_SEP = String.fromCharCode(30), v3.UNIT_SEP = String.fromCharCode(31), v3.BYTE_ORDER_MARK = "\uFEFF", v3.BAD_DELIMITERS = ["\r", "\n", '"', v3.BYTE_ORDER_MARK], v3.WORKERS_SUPPORTED = !
|
|
402
|
-
var i4 =
|
|
401
|
+
}, v3.RECORD_SEP = String.fromCharCode(30), v3.UNIT_SEP = String.fromCharCode(31), v3.BYTE_ORDER_MARK = "\uFEFF", v3.BAD_DELIMITERS = ["\r", "\n", '"', v3.BYTE_ORDER_MARK], v3.WORKERS_SUPPORTED = !s2 && !!n.Worker, v3.NODE_STREAM_INPUT = 1, v3.LocalChunkSize = 10485760, v3.RemoteChunkSize = 5242880, v3.DefaultDelimiter = ",", v3.Parser = E4, v3.ParserHandle = i2, v3.NetworkStreamer = f2, v3.FileStreamer = l2, v3.StringStreamer = c2, v3.ReadableStreamStreamer = p2, n.jQuery && ((d = n.jQuery).fn.parse = function(o2) {
|
|
402
|
+
var i4 = o2.config || {}, h3 = [];
|
|
403
403
|
return this.each(function(e2) {
|
|
404
404
|
if (!("INPUT" === d(this).prop("tagName").toUpperCase() && "file" === d(this).attr("type").toLowerCase() && n.FileReader) || !this.files || 0 === this.files.length) return true;
|
|
405
405
|
for (var t = 0; t < this.files.length; t++) h3.push({ file: this.files[t], inputElem: this, instanceConfig: d.extend({}, i4) });
|
|
406
406
|
}), e(), this;
|
|
407
407
|
function e() {
|
|
408
|
-
if (0 === h3.length) q3(
|
|
408
|
+
if (0 === h3.length) q3(o2.complete) && o2.complete();
|
|
409
409
|
else {
|
|
410
410
|
var e2, t, i5, r2, n2 = h3[0];
|
|
411
|
-
if (q3(
|
|
412
|
-
var
|
|
413
|
-
if ("object" == typeof
|
|
414
|
-
if ("abort" ===
|
|
415
|
-
if ("skip" ===
|
|
416
|
-
"object" == typeof
|
|
417
|
-
} else if ("skip" ===
|
|
411
|
+
if (q3(o2.before)) {
|
|
412
|
+
var s4 = o2.before(n2.file, n2.inputElem);
|
|
413
|
+
if ("object" == typeof s4) {
|
|
414
|
+
if ("abort" === s4.action) return e2 = "AbortError", t = n2.file, i5 = n2.inputElem, r2 = s4.reason, void (q3(o2.error) && o2.error({ name: e2 }, t, i5, r2));
|
|
415
|
+
if ("skip" === s4.action) return void u5();
|
|
416
|
+
"object" == typeof s4.config && (n2.instanceConfig = d.extend(n2.instanceConfig, s4.config));
|
|
417
|
+
} else if ("skip" === s4) return void u5();
|
|
418
418
|
}
|
|
419
|
-
var
|
|
419
|
+
var a5 = n2.instanceConfig.complete;
|
|
420
420
|
n2.instanceConfig.complete = function(e4) {
|
|
421
|
-
q3(
|
|
421
|
+
q3(a5) && a5(e4, n2.file, n2.inputElem), u5();
|
|
422
422
|
}, v3.parse(n2.file, n2.instanceConfig);
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
425
|
function u5() {
|
|
426
426
|
h3.splice(0, 1), e();
|
|
427
427
|
}
|
|
428
|
-
}),
|
|
428
|
+
}), a4 && (n.onmessage = function(e) {
|
|
429
429
|
e = e.data;
|
|
430
430
|
void 0 === v3.WORKER_ID && e && (v3.WORKER_ID = e.workerId);
|
|
431
431
|
"string" == typeof e.input ? n.postMessage({ workerId: v3.WORKER_ID, results: v3.parse(e.input, e.config), finished: true }) : (n.File && e.input instanceof File || e.input instanceof Object) && (e = v3.parse(e.input, e.config)) && n.postMessage({ workerId: v3.WORKER_ID, results: e, finished: true });
|
|
432
|
-
}), (
|
|
432
|
+
}), (f2.prototype = Object.create(u4.prototype)).constructor = f2, (l2.prototype = Object.create(u4.prototype)).constructor = l2, (c2.prototype = Object.create(c2.prototype)).constructor = c2, (p2.prototype = Object.create(u4.prototype)).constructor = p2, v3;
|
|
433
433
|
});
|
|
434
434
|
}
|
|
435
435
|
});
|
|
@@ -481,15 +481,15 @@ var numberOr = (raw, dflt) => {
|
|
|
481
481
|
const n = raw == null || raw === "" ? NaN : Number(raw);
|
|
482
482
|
return Number.isFinite(n) ? n : dflt;
|
|
483
483
|
};
|
|
484
|
-
function resolveOptions(
|
|
484
|
+
function resolveOptions(p2) {
|
|
485
485
|
return {
|
|
486
486
|
// ---- host fields: pass through exactly as supplied ----
|
|
487
|
-
width:
|
|
488
|
-
height:
|
|
489
|
-
palette:
|
|
490
|
-
geoUnmatched:
|
|
491
|
-
geo:
|
|
492
|
-
geoPoint:
|
|
487
|
+
width: p2.width,
|
|
488
|
+
height: p2.height,
|
|
489
|
+
palette: p2.palette,
|
|
490
|
+
geoUnmatched: p2.geoUnmatched,
|
|
491
|
+
geo: p2.geo,
|
|
492
|
+
geoPoint: p2.geoPoint,
|
|
493
493
|
// THIRD AND FOURTH OCCURRENCES OF THE animLoopDelaySec OMISSION, found together by
|
|
494
494
|
// reading the contract against this list rather than by a bug report. geoPointDest is
|
|
495
495
|
// declared on RenderOptions, passed by the visual and read by the route archetypes, and
|
|
@@ -497,8 +497,8 @@ function resolveOptions(p) {
|
|
|
497
497
|
// endpoint" never saw the destination end at all. The guard test at the bottom of
|
|
498
498
|
// tests/defaults.test.ts now compares the two lists, because four instances of one
|
|
499
499
|
// omission is a missing check, not four mistakes.
|
|
500
|
-
geoPointDest:
|
|
501
|
-
maxMapPoints:
|
|
500
|
+
geoPointDest: p2.geoPointDest,
|
|
501
|
+
maxMapPoints: p2.maxMapPoints,
|
|
502
502
|
// FIFTH AND SIXTH OCCURRENCES, and the two that argue hardest for the guard test: both
|
|
503
503
|
// were passed by the visual AND read by the charts, and neither was ever declared here or
|
|
504
504
|
// in the contract - so the contract-vs-whitelist check could not see them either. What
|
|
@@ -506,41 +506,41 @@ function resolveOptions(p) {
|
|
|
506
506
|
// 0 is MEANINGFUL for both ("let the chart choose", "no paging"), so numberOr rather than
|
|
507
507
|
// `|| DEFAULT`, which would turn an explicit 0 into something else. Clamping stays
|
|
508
508
|
// chart-side for the same reason it does for flipIntervalMs.
|
|
509
|
-
geoPointRadiusPx: Math.max(0, numberOr(
|
|
510
|
-
pageSize: Math.max(0, numberOr(
|
|
511
|
-
uiState:
|
|
512
|
-
setUiState:
|
|
513
|
-
backgroundColor:
|
|
514
|
-
themeBg:
|
|
515
|
-
themeFg:
|
|
516
|
-
isHighContrast:
|
|
517
|
-
themeAccent:
|
|
518
|
-
cultureCode:
|
|
519
|
-
allowTooltips:
|
|
520
|
-
noDataText:
|
|
521
|
-
onSelect:
|
|
509
|
+
geoPointRadiusPx: Math.max(0, numberOr(p2.geoPointRadiusPx, 0)),
|
|
510
|
+
pageSize: Math.max(0, numberOr(p2.pageSize, 0)),
|
|
511
|
+
uiState: p2.uiState,
|
|
512
|
+
setUiState: p2.setUiState,
|
|
513
|
+
backgroundColor: p2.backgroundColor,
|
|
514
|
+
themeBg: p2.themeBg,
|
|
515
|
+
themeFg: p2.themeFg,
|
|
516
|
+
isHighContrast: p2.isHighContrast,
|
|
517
|
+
themeAccent: p2.themeAccent,
|
|
518
|
+
cultureCode: p2.cultureCode,
|
|
519
|
+
allowTooltips: p2.allowTooltips,
|
|
520
|
+
noDataText: p2.noDataText,
|
|
521
|
+
onSelect: p2.onSelect,
|
|
522
522
|
// ---- live-restyle knobs: `raw || undefined` / `.toString() || undefined` ----
|
|
523
|
-
colorScaleLow:
|
|
524
|
-
colorScaleHigh:
|
|
523
|
+
colorScaleLow: p2.colorScaleLow || void 0,
|
|
524
|
+
colorScaleHigh: p2.colorScaleHigh || void 0,
|
|
525
525
|
// "" (global, the default), "frame", or "self"; anything else fails open to global.
|
|
526
|
-
colorScaleScope:
|
|
526
|
+
colorScaleScope: p2.colorScaleScope === "frame" || p2.colorScaleScope === "self" ? p2.colorScaleScope : "",
|
|
527
527
|
// Math.max(50, Math.min(100, Number(raw) || 95)) — only meaningful under "self".
|
|
528
|
-
colorScaleSelfClampPct: clamp(Number(
|
|
528
|
+
colorScaleSelfClampPct: clamp(Number(p2.colorScaleSelfClampPct) || COLOR_SCALE_SELF_CLAMP_PCT_DEFAULT, COLOR_SCALE_SELF_CLAMP_PCT_MIN, COLOR_SCALE_SELF_CLAMP_PCT_MAX),
|
|
529
529
|
// Map fills: `raw || undefined` like the colour-scale endpoints. The no-data ->
|
|
530
530
|
// land cascade is left to the chart (so the fallback chain is visible in the
|
|
531
531
|
// generated code); HC substitution has already happened in the caller.
|
|
532
|
-
geoLandColor:
|
|
533
|
-
geoNoDataColor:
|
|
534
|
-
aggregation: (
|
|
532
|
+
geoLandColor: p2.geoLandColor || void 0,
|
|
533
|
+
geoNoDataColor: p2.geoNoDataColor || void 0,
|
|
534
|
+
aggregation: (p2.aggregation == null ? "" : String(p2.aggregation)) || void 0,
|
|
535
535
|
// A recognised value wins, anything else falls to the default: an unknown string must
|
|
536
536
|
// never reach a chart as a live mode. Both of these are read on EVERY render, so a
|
|
537
537
|
// reader can change their mind about a cached chart without regenerating it.
|
|
538
538
|
approximatePositions: (() => {
|
|
539
|
-
const v3 = (
|
|
539
|
+
const v3 = (p2.approximatePositions == null ? "" : String(p2.approximatePositions)).toLowerCase();
|
|
540
540
|
return v3 === "mark" || v3 === "aggregate" || v3 === "skip" ? v3 : APPROXIMATE_POSITIONS_DEFAULT;
|
|
541
541
|
})(),
|
|
542
542
|
valueAxisBaseline: (() => {
|
|
543
|
-
const v3 = (
|
|
543
|
+
const v3 = (p2.valueAxisBaseline == null ? "" : String(p2.valueAxisBaseline)).toLowerCase();
|
|
544
544
|
return v3 === "zero" || v3 === "fit" || v3 === "auto" ? v3 : VALUE_AXIS_BASELINE_DEFAULT;
|
|
545
545
|
})(),
|
|
546
546
|
// Same shape, and the same reason for it: an unrecognised string must never reach a chart
|
|
@@ -548,25 +548,25 @@ function resolveOptions(p) {
|
|
|
548
548
|
// the setting that makes the chart PROVE the grid before it names a period, so a garbled
|
|
549
549
|
// value withdraws the claim rather than asserting one.
|
|
550
550
|
seasonalMarkers: (() => {
|
|
551
|
-
const v3 = (
|
|
551
|
+
const v3 = (p2.seasonalMarkers == null ? "" : String(p2.seasonalMarkers)).toLowerCase();
|
|
552
552
|
return v3 === "auto" || v3 === "always" || v3 === "never" ? v3 : SEASONAL_MARKERS_DEFAULT;
|
|
553
553
|
})(),
|
|
554
554
|
// ---- animation: booleans, default+clamp numerics, "" default enum ----
|
|
555
|
-
animAutoPlay: !!
|
|
555
|
+
animAutoPlay: !!p2.animAutoPlay,
|
|
556
556
|
// Math.max(250, Math.min(5000, Number(raw) || 1000))
|
|
557
|
-
animPlaySpeedMs: clamp(Number(
|
|
557
|
+
animPlaySpeedMs: clamp(Number(p2.animPlaySpeedMs) || ANIM_PLAY_SPEED_DEFAULT, ANIM_PLAY_SPEED_MIN, ANIM_PLAY_SPEED_MAX),
|
|
558
558
|
// Loop-restart delay (seconds on the overview between auto-play passes).
|
|
559
559
|
// Floored at 0, deliberately NO upper clamp (huge = play once per viewing),
|
|
560
560
|
// and 0 must survive as 0 — hence numberOr, not `|| DEFAULT`. This field was
|
|
561
561
|
// MISSING from the resolve list when the assembly moved here, so callers
|
|
562
562
|
// that passed it saw it dropped: the scrubber read undefined -> 0 -> every
|
|
563
563
|
// pass restarted instantly and resumed-state auto-play lost its pacing.
|
|
564
|
-
animLoopDelaySec: Math.max(ANIM_LOOP_DELAY_MIN, numberOr(
|
|
564
|
+
animLoopDelaySec: Math.max(ANIM_LOOP_DELAY_MIN, numberOr(p2.animLoopDelaySec, ANIM_LOOP_DELAY_DEFAULT)),
|
|
565
565
|
// Math.max(3, Math.min(500, Number(raw) || 60))
|
|
566
|
-
animMaxIdealFrames: clamp(Number(
|
|
567
|
-
animStopAtEnd: !!
|
|
568
|
-
filtersDuringPlay: !!
|
|
569
|
-
animTimelineStyle: (
|
|
566
|
+
animMaxIdealFrames: clamp(Number(p2.animMaxIdealFrames) || ANIM_MAX_IDEAL_FRAMES_DEFAULT, ANIM_MAX_IDEAL_FRAMES_MIN, ANIM_MAX_IDEAL_FRAMES_MAX),
|
|
567
|
+
animStopAtEnd: !!p2.animStopAtEnd,
|
|
568
|
+
filtersDuringPlay: !!p2.filtersDuringPlay,
|
|
569
|
+
animTimelineStyle: (p2.animTimelineStyle || "").toString(),
|
|
570
570
|
// ---- card deck ----
|
|
571
571
|
// SECOND OCCURRENCE OF THE animLoopDelaySec BUG, six lines above (2026-08-13). The
|
|
572
572
|
// visual passed both of these, the generated code read both correctly, and this
|
|
@@ -579,7 +579,7 @@ function resolveOptions(p) {
|
|
|
579
579
|
// flipSync DEFAULTS TRUE, so it cannot use `!!p.flipSync` — that would read a missing
|
|
580
580
|
// value as "independent" and hand every deck twelve control strips. Absent means
|
|
581
581
|
// synced; only an explicit false switches it.
|
|
582
|
-
flipSync:
|
|
582
|
+
flipSync: p2.flipSync === void 0 || p2.flipSync === null ? true : !!p2.flipSync,
|
|
583
583
|
// WHERE the controls live, which is a different question from whether the cards move
|
|
584
584
|
// together (2026-08-13: "the ability to flip individual cards shouldn't necessarily
|
|
585
585
|
// stop being able to flip all together too"). Resolution order matters and is the whole
|
|
@@ -592,22 +592,22 @@ function resolveOptions(p) {
|
|
|
592
592
|
// because a newer client shipped, and "both" would have done exactly that to every deck
|
|
593
593
|
// already in a report.
|
|
594
594
|
flipMode: (() => {
|
|
595
|
-
const m = (
|
|
595
|
+
const m = (p2.flipMode == null ? "" : String(p2.flipMode)).toLowerCase();
|
|
596
596
|
if (m === "single" || m === "all" || m === "both") return m;
|
|
597
|
-
if (
|
|
598
|
-
if (
|
|
597
|
+
if (p2.flipSync === false) return "single";
|
|
598
|
+
if (p2.flipSync === true) return "all";
|
|
599
599
|
return FLIP_MODE_DEFAULT;
|
|
600
600
|
})(),
|
|
601
601
|
// 0 is MEANINGFUL here (manual only) and is the default, so numberOr — not
|
|
602
602
|
// `|| DEFAULT` — for the same reason animLoopDelaySec uses it. Clamping stays
|
|
603
603
|
// chart-side: the archetype already clamps 500..120000 and two clamps in two
|
|
604
604
|
// repositories is how they end up disagreeing.
|
|
605
|
-
flipIntervalMs: Math.max(0, numberOr(
|
|
605
|
+
flipIntervalMs: Math.max(0, numberOr(p2.flipIntervalMs, 0)),
|
|
606
606
|
// `raw || undefined`, the same idiom as the colour-scale endpoints and the map fills:
|
|
607
607
|
// blank must arrive as ABSENT, not as an empty string, because the chart's fallback is
|
|
608
608
|
// `options.cardBackgroundColor || <its own choice>` and "" would satisfy a truthiness
|
|
609
609
|
// test in some hands while painting nothing in others.
|
|
610
|
-
cardBackgroundColor:
|
|
610
|
+
cardBackgroundColor: p2.cardBackgroundColor || void 0
|
|
611
611
|
};
|
|
612
612
|
}
|
|
613
613
|
|
|
@@ -630,7 +630,7 @@ function worldBasemap(world) {
|
|
|
630
630
|
if (!_worldBase) {
|
|
631
631
|
_worldBase = {
|
|
632
632
|
type: "FeatureCollection",
|
|
633
|
-
features: world.features.filter((
|
|
633
|
+
features: world.features.filter((f2) => f2?.geometry && f2.geometry.type !== "Point")
|
|
634
634
|
};
|
|
635
635
|
}
|
|
636
636
|
return _worldBase;
|
|
@@ -639,7 +639,7 @@ function northAmerica(world) {
|
|
|
639
639
|
if (!_na) {
|
|
640
640
|
_na = {
|
|
641
641
|
type: "FeatureCollection",
|
|
642
|
-
features: world.features.filter((
|
|
642
|
+
features: world.features.filter((f2) => NA_ISO3.has(f2?.id) && f2?.geometry && f2.geometry.type !== "Point").map((f2) => clipFeatureToLat(f2, NA_LAT_MAX)).filter((f2) => f2 !== null)
|
|
643
643
|
};
|
|
644
644
|
}
|
|
645
645
|
return _na;
|
|
@@ -709,8 +709,8 @@ var _ = "AD AND,AE ARE,AF AFG,AG ATG,AI AIA,AL ALB,AM ARM,AO AGO,AQ ATA,AR ARG,A
|
|
|
709
709
|
var N = (() => {
|
|
710
710
|
let n = /* @__PURE__ */ new Map();
|
|
711
711
|
for (let e of _.split(",")) {
|
|
712
|
-
let [t,
|
|
713
|
-
t &&
|
|
712
|
+
let [t, o] = e.split(" ");
|
|
713
|
+
t && o && n.set(t, o);
|
|
714
714
|
}
|
|
715
715
|
return n;
|
|
716
716
|
})();
|
|
@@ -723,27 +723,27 @@ function j() {
|
|
|
723
723
|
if (b) return b;
|
|
724
724
|
let n = /* @__PURE__ */ new Map(), e = ["en", ...v.filter((t) => t !== "en")];
|
|
725
725
|
for (let t of e) {
|
|
726
|
-
let
|
|
726
|
+
let o = null;
|
|
727
727
|
try {
|
|
728
|
-
|
|
728
|
+
o = new Intl.DisplayNames([t], { type: "region" });
|
|
729
729
|
} catch {
|
|
730
730
|
continue;
|
|
731
731
|
}
|
|
732
732
|
for (let [i2, r] of N) {
|
|
733
|
-
let
|
|
733
|
+
let a4;
|
|
734
734
|
try {
|
|
735
|
-
|
|
735
|
+
a4 = o.of(i2);
|
|
736
736
|
} catch {
|
|
737
|
-
|
|
737
|
+
a4 = void 0;
|
|
738
738
|
}
|
|
739
|
-
if (!
|
|
740
|
-
let
|
|
741
|
-
|
|
739
|
+
if (!a4 || a4 === i2) continue;
|
|
740
|
+
let s2 = u(a4);
|
|
741
|
+
s2 && !n.has(s2) && n.set(s2, r);
|
|
742
742
|
}
|
|
743
743
|
}
|
|
744
|
-
for (let [t,
|
|
744
|
+
for (let [t, o] of Object.entries(Q)) {
|
|
745
745
|
let i2 = u(t);
|
|
746
|
-
i2 && n.set(i2,
|
|
746
|
+
i2 && n.set(i2, o);
|
|
747
747
|
}
|
|
748
748
|
return b = n, n;
|
|
749
749
|
}
|
|
@@ -764,7 +764,7 @@ function V(n) {
|
|
|
764
764
|
var m3 = 80;
|
|
765
765
|
var q = { "north-america": "N", world: "W" };
|
|
766
766
|
function F(n, e) {
|
|
767
|
-
let t = n.filter((
|
|
767
|
+
let t = n.filter((o) => o.row.kinds.includes(q[e || "north-america"]));
|
|
768
768
|
return t.length ? t : (e || "north-america") === "world" ? n : t;
|
|
769
769
|
}
|
|
770
770
|
var P = a;
|
|
@@ -778,20 +778,20 @@ var t3 = { US: "washington", CA: "ottawa", MX: "mexico city", GB: "london", FR:
|
|
|
778
778
|
var U = null;
|
|
779
779
|
function y() {
|
|
780
780
|
if (U) return U;
|
|
781
|
-
let n = /* @__PURE__ */ new Map(), e = P, t = (
|
|
782
|
-
if (!
|
|
783
|
-
let
|
|
784
|
-
|
|
781
|
+
let n = /* @__PURE__ */ new Map(), e = P, t = (o, i2, r) => {
|
|
782
|
+
if (!o) return;
|
|
783
|
+
let a4 = n.get(o);
|
|
784
|
+
a4 ? a4.some((s2) => s2.row === i2) || a4.push({ row: i2, primary: r }) : n.set(o, [{ row: i2, primary: r }]);
|
|
785
785
|
};
|
|
786
|
-
for (let
|
|
787
|
-
let i2 =
|
|
786
|
+
for (let o of e.split(",")) {
|
|
787
|
+
let i2 = o.split("|");
|
|
788
788
|
if (i2.length < 7) continue;
|
|
789
789
|
let r = { a1: i2[1], cc: i2[2], lon: +i2[3], lat: +i2[4], pop: +i2[5], kinds: i2[6] || "N" };
|
|
790
790
|
i2.length > 8 && i2[8] && (r.tags = i2[8].split(";").filter(Boolean));
|
|
791
|
-
let
|
|
792
|
-
if (
|
|
791
|
+
let a4 = t3[r.cc];
|
|
792
|
+
if (a4 && u(i2[0]) === a4 && (r.tags || (r.tags = []), r.tags.includes("capital") || r.tags.push("capital")), t(u(i2[0]), r, true), i2.length > 7 && i2[7]) for (let s2 of i2[7].split(";")) t(u(s2), r, false);
|
|
793
793
|
}
|
|
794
|
-
for (let
|
|
794
|
+
for (let o of n.values()) o.sort((i2, r) => r.row.pop - i2.row.pop);
|
|
795
795
|
return U = n, n;
|
|
796
796
|
}
|
|
797
797
|
var e3 = 200;
|
|
@@ -801,8 +801,8 @@ function i3() {
|
|
|
801
801
|
let n = /* @__PURE__ */ new Map();
|
|
802
802
|
for (let [e, t] of y()) {
|
|
803
803
|
if (!e.endsWith(" city")) continue;
|
|
804
|
-
let
|
|
805
|
-
!
|
|
804
|
+
let o = e.slice(0, -5);
|
|
805
|
+
!o || y().get(o)?.some((i2) => i2.primary) || t[0].row.pop < e3 || n.set(o, t);
|
|
806
806
|
}
|
|
807
807
|
return L = n, n;
|
|
808
808
|
}
|
|
@@ -812,23 +812,23 @@ function O(n) {
|
|
|
812
812
|
if (e?.some((i2) => i2.primary)) return e;
|
|
813
813
|
let t = i3().get(n);
|
|
814
814
|
if (!t) return e;
|
|
815
|
-
let
|
|
816
|
-
return e ? [...
|
|
815
|
+
let o = t.map((i2) => ({ row: i2.row, primary: true }));
|
|
816
|
+
return e ? [...o, ...e] : o;
|
|
817
817
|
}
|
|
818
818
|
var I = null;
|
|
819
819
|
function o3() {
|
|
820
820
|
if (I) return I;
|
|
821
821
|
let n = /* @__PURE__ */ new Map();
|
|
822
822
|
for (let t of k.split(",")) {
|
|
823
|
-
let
|
|
824
|
-
|
|
823
|
+
let o = t.split("|");
|
|
824
|
+
o.length < 3 || n.set(o[0], { lon: +o[1], lat: +o[2] });
|
|
825
825
|
}
|
|
826
826
|
let e = /* @__PURE__ */ new Map();
|
|
827
|
-
for (let t of y().values()) for (let
|
|
828
|
-
let i2 = T(
|
|
827
|
+
for (let t of y().values()) for (let o of t) {
|
|
828
|
+
let i2 = T(o.row.cc);
|
|
829
829
|
if (!i2) continue;
|
|
830
830
|
let r = e.get(i2);
|
|
831
|
-
(r === void 0 ||
|
|
831
|
+
(r === void 0 || o.row.pop > r) && (e.set(i2, o.row.pop), n.set(i2, { lon: o.row.lon, lat: o.row.lat }));
|
|
832
832
|
}
|
|
833
833
|
return I = n, n;
|
|
834
834
|
}
|
|
@@ -839,10 +839,10 @@ function D() {
|
|
|
839
839
|
for (let e of H.split(",")) {
|
|
840
840
|
let t = e.split("|");
|
|
841
841
|
if (t.length < 5) continue;
|
|
842
|
-
let
|
|
843
|
-
n.set(u(
|
|
844
|
-
let i2 = u(
|
|
845
|
-
i2 === "mexico" &&
|
|
842
|
+
let o = { key: t[0], cc: t[1], name: t[2], lon: +t[3], lat: +t[4] };
|
|
843
|
+
n.set(u(o.key), o);
|
|
844
|
+
let i2 = u(o.name);
|
|
845
|
+
i2 === "mexico" && o.cc === "MX" ? (n.set("estado de mexico", o), n.set("edomex", o)) : n.set(i2, o);
|
|
846
846
|
}
|
|
847
847
|
return B = n, n;
|
|
848
848
|
}
|
|
@@ -882,8 +882,8 @@ function Z(n) {
|
|
|
882
882
|
let e = String(n).trim().replace(/\.0+$/, "");
|
|
883
883
|
if (!e) return [];
|
|
884
884
|
if (/^\d{3}$/.test(e)) {
|
|
885
|
-
let
|
|
886
|
-
return
|
|
885
|
+
let o = e.padStart(5, "0").slice(0, 3);
|
|
886
|
+
return o === e ? [e] : [e, o];
|
|
887
887
|
}
|
|
888
888
|
let t = M3(e);
|
|
889
889
|
return t ? [t.slice(0, 3)] : [];
|
|
@@ -892,72 +892,72 @@ function S3(n) {
|
|
|
892
892
|
return !!n && n.ambiguous === true && !("precision" in n);
|
|
893
893
|
}
|
|
894
894
|
function A3(n) {
|
|
895
|
-
let e = null, t = typeof n.lat == "string" ? n.lat.trim() : n.lat,
|
|
896
|
-
if (t != null && t !== "" &&
|
|
897
|
-
let
|
|
898
|
-
if (isFinite(
|
|
899
|
-
else return { lat:
|
|
895
|
+
let e = null, t = typeof n.lat == "string" ? n.lat.trim() : n.lat, o = typeof n.lon == "string" ? n.lon.trim() : n.lon;
|
|
896
|
+
if (t != null && t !== "" && o !== void 0 && o !== null && o !== "") {
|
|
897
|
+
let a4 = +t, s2 = +o;
|
|
898
|
+
if (isFinite(a4) && isFinite(s2) && a4 >= -90 && a4 <= 90 && s2 >= -180 && s2 <= 180) if (a4 === 0 && s2 === 0) e = { lat: 0, lon: 0, precision: "latlon" };
|
|
899
|
+
else return { lat: a4, lon: s2, precision: "latlon" };
|
|
900
900
|
}
|
|
901
901
|
let i2 = E(n.country), r = Y(n.state);
|
|
902
902
|
if (r && i2 && c3(r) !== i2 && (r = null), n.city !== void 0 && n.city !== null) {
|
|
903
|
-
let
|
|
904
|
-
if (
|
|
905
|
-
let d = n.state === void 0 || n.state === null ? "" : String(n.state).trim(), R = d ? u(d) : "",
|
|
906
|
-
for (let
|
|
907
|
-
let l2 =
|
|
908
|
-
if (d && l2.a1 !== "") if (
|
|
903
|
+
let a4 = u(String(n.city)), s2 = O(a4), f2 = s2 ? F(s2, n.mapKind) : null;
|
|
904
|
+
if (f2 && f2.length) {
|
|
905
|
+
let d = n.state === void 0 || n.state === null ? "" : String(n.state).trim(), R = d ? u(d) : "", g3 = d ? Y(d) : null, S = [], m = -1;
|
|
906
|
+
for (let c2 of f2) {
|
|
907
|
+
let l2 = c2.row, A = 0;
|
|
908
|
+
if (d && l2.a1 !== "") if (g3 && l2.a1 === g3 || u(l2.a1) === R) A++;
|
|
909
909
|
else continue;
|
|
910
910
|
if (i2) if (T(l2.cc) === i2) A++;
|
|
911
911
|
else continue;
|
|
912
|
-
A > m ? (m = A, S = [
|
|
912
|
+
A > m ? (m = A, S = [c2]) : A === m && S.push(c2);
|
|
913
913
|
}
|
|
914
|
-
S.some((
|
|
915
|
-
let
|
|
916
|
-
for (let
|
|
917
|
-
if (
|
|
918
|
-
let
|
|
919
|
-
return { lat:
|
|
914
|
+
S.some((c2) => c2.primary) && (S = S.filter((c2) => c2.primary));
|
|
915
|
+
let p2 = /* @__PURE__ */ new Map();
|
|
916
|
+
for (let c2 of S) p2.set(c2.row.lon.toFixed(2) + "," + c2.row.lat.toFixed(2), c2.row);
|
|
917
|
+
if (p2.size === 1) {
|
|
918
|
+
let c2 = S[0].row;
|
|
919
|
+
return { lat: c2.lat, lon: c2.lon, precision: "city" };
|
|
920
920
|
}
|
|
921
|
-
if (
|
|
921
|
+
if (p2.size > 1) return { ambiguous: true, matches: p2.size };
|
|
922
922
|
}
|
|
923
923
|
}
|
|
924
|
-
if (!i2 || r3.has(i2)) for (let
|
|
925
|
-
let
|
|
926
|
-
if (
|
|
924
|
+
if (!i2 || r3.has(i2)) for (let a4 of Z(n.zip)) {
|
|
925
|
+
let s2 = a3().get(a4);
|
|
926
|
+
if (s2) return { lat: s2.lat, lon: s2.lon, precision: "zip3" };
|
|
927
927
|
}
|
|
928
928
|
if (r) {
|
|
929
|
-
let
|
|
930
|
-
if (
|
|
929
|
+
let a4 = D().get(u(r));
|
|
930
|
+
if (a4) return { lat: a4.lat, lon: a4.lon, precision: "state" };
|
|
931
931
|
}
|
|
932
932
|
if (i2 && (n.mapKind !== "north-america" || s3.has(i2))) {
|
|
933
|
-
let
|
|
934
|
-
if (
|
|
933
|
+
let a4 = o3().get(i2);
|
|
934
|
+
if (a4) return { lat: a4.lat, lon: a4.lon, precision: "country" };
|
|
935
935
|
}
|
|
936
936
|
return e;
|
|
937
937
|
}
|
|
938
938
|
var G = { latlon: 0, city: 1, zip3: 2, state: 3, country: 4 };
|
|
939
939
|
var x = 8;
|
|
940
940
|
function y3(n, e) {
|
|
941
|
-
let t = new Array(n.length),
|
|
941
|
+
let t = new Array(n.length), o = new Array(n.length), i2 = new Array(n.length), r = /* @__PURE__ */ new Set(), a4 = [], s2 = /* @__PURE__ */ new Set(), f2 = [], d = /* @__PURE__ */ new Set(), R = [], g3 = { latlon: 0, city: 0, zip3: 0, state: 0, country: 0 }, S = 0, m = 0, p2 = null;
|
|
942
942
|
for (let l2 = 0; l2 < n.length; ++l2) {
|
|
943
943
|
let A = n[l2], C2 = A3({ ...A, mapKind: e });
|
|
944
944
|
if (S3(C2)) {
|
|
945
|
-
t[l2] = null,
|
|
945
|
+
t[l2] = null, o[l2] = null, i2[l2] = null, m++;
|
|
946
946
|
let M = K(A);
|
|
947
947
|
M && !d.has(M.toLowerCase()) && (d.add(M.toLowerCase()), R.length < x && R.push(M));
|
|
948
948
|
} else if (C2) {
|
|
949
|
-
if (t[l2] = C2.lat,
|
|
949
|
+
if (t[l2] = C2.lat, o[l2] = C2.lon, i2[l2] = C2.precision, S++, g3[C2.precision]++, (p2 === null || G[C2.precision] > G[p2]) && (p2 = C2.precision), G[C2.precision] > G.city) {
|
|
950
950
|
let M = K(A);
|
|
951
|
-
M && !
|
|
951
|
+
M && !s2.has(M.toLowerCase()) && (s2.add(M.toLowerCase()), f2.length < x && f2.push(M));
|
|
952
952
|
}
|
|
953
953
|
} else {
|
|
954
|
-
t[l2] = null,
|
|
954
|
+
t[l2] = null, o[l2] = null, i2[l2] = null;
|
|
955
955
|
let M = K(A);
|
|
956
|
-
M && !r.has(M.toLowerCase()) && (r.add(M.toLowerCase()),
|
|
956
|
+
M && !r.has(M.toLowerCase()) && (r.add(M.toLowerCase()), a4.push(M));
|
|
957
957
|
}
|
|
958
958
|
}
|
|
959
|
-
let
|
|
960
|
-
return { lat: t, lon:
|
|
959
|
+
let c2 = !n3() && n.some((l2) => l2.city !== null && l2.city !== void 0 && String(l2.city).trim() !== "");
|
|
960
|
+
return { lat: t, lon: o, precisions: i2, precision: p2, precisionCounts: g3, coarseExamples: f2, unmatched: a4, ambiguousRows: m, ambiguousExamples: R, matchedRows: S, totalRows: n.length, ...c2 ? { cityTableMissing: true } : {} };
|
|
961
961
|
}
|
|
962
962
|
function K(n) {
|
|
963
963
|
let e = [n.city, n.state, n.zip, n.country].filter((t) => t != null && String(t).trim() !== "").map((t) => String(t).trim()).join(", ");
|
|
@@ -969,13 +969,27 @@ function p3(n, e) {
|
|
|
969
969
|
return t ? F(t, e).length > 0 : false;
|
|
970
970
|
}
|
|
971
971
|
|
|
972
|
-
// ../shape-core/dist/chunk-
|
|
972
|
+
// ../shape-core/dist/chunk-6NQENOVB.mjs
|
|
973
973
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
974
|
-
function
|
|
975
|
-
return
|
|
976
|
-
}
|
|
974
|
+
function s(t) {
|
|
975
|
+
return t ? t.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_\-./]+/g, " ").toLowerCase().split(/\s+/).filter((n) => n.length > 0) : [];
|
|
976
|
+
}
|
|
977
|
+
function p(t) {
|
|
978
|
+
let n = Date.parse(t);
|
|
979
|
+
if (isNaN(n)) return null;
|
|
980
|
+
let e = new Date(n);
|
|
981
|
+
if (F2.test(t) || i.test(t.trim()) || l.test(t)) return e;
|
|
982
|
+
let r = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds())), o = e.getFullYear();
|
|
983
|
+
return o >= 0 && o < 100 && r.setUTCFullYear(o), r;
|
|
984
|
+
}
|
|
985
|
+
function u2(t) {
|
|
986
|
+
return !(t instanceof Date) || isNaN(t.getTime()) ? null : t.getUTCHours() === 0 && t.getUTCMinutes() === 0 && t.getUTCSeconds() === 0 && t.getUTCMilliseconds() === 0 ? "utc" : t.getHours() === 0 && t.getMinutes() === 0 && t.getSeconds() === 0 && t.getMilliseconds() === 0 ? "local" : null;
|
|
987
|
+
}
|
|
988
|
+
var F2 = /^\s*\d{4}(-\d{2}(-\d{2})?)?\s*$/;
|
|
989
|
+
var i = /(?:Z|[+-]\d{2}:?\d{2})$/i;
|
|
990
|
+
var l = /\b(?:GMT|UTC)\b/i;
|
|
977
991
|
|
|
978
|
-
// ../shape-core/dist/chunk-
|
|
992
|
+
// ../shape-core/dist/chunk-RC567DAC.mjs
|
|
979
993
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
980
994
|
var St = "006007008009010011012013014015016017018019020021022023024025026027028029030031032033034035036037038039040041042043044045046047048049050051052053054056057058059060061062063064065066067068069070071072073074075076077078079080081082083084085086087088089100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191193194195196197198199200201202203204205206207208209210211212214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310312313314315316317318319320321322323324325326327328329330331333334335336337338339341342344346347349350351352354355356357358359360361362363364365366367368369370371372373374376377378379380381382383384385386387388389390391392393394395396397398400401402403404405406407408409410411412413414415416417418420421422423424425426427430431432433434435436437438439440441442443444445446447448449450451452453454455456457458460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508510511512513514515516520521522523524525526527528530531532534535537538539540541542543544545546547548549550551553554556557558559560561562563564565566567570571572573574575576577580581582583584585586587588590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620622623624625626627628629630631633634635636637638639640641644645646647648650651652653654655656657658660661662664665666667668669670671672673674675676677678679680681683684685686687688689690691692693700701703704705706707708710711712713714716717718719720721722723724725726727728729730731734735736737738739740741743744745746747748749750751752753754755756757758759760761762763764765766767768769770772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816820821822823824825826827828829830831832833834835836837838840841843844845846847850851852853855856857859860863864865870871873874875877878879880881882883884890891893894895897898900902903904905906907908910911912913914915916917918919920921922923924925926927928930931932933934935936937939940941943944945946947948949950951952953954955956957958959960961967968969970971972973974975976977978979980981982983984985986988989990991992993994995996997998999";
|
|
981
995
|
var w = new Set(St.match(/.{3}/g) ?? []);
|
|
@@ -984,10 +998,10 @@ var ct = new Set(at.map((n) => n[0]));
|
|
|
984
998
|
var yt = { "Ala.": "AL", "Alab.": "AL", "Ariz.": "AZ", "Ark.": "AR", "Calif.": "CA", "Cal.": "CA", "Colo.": "CO", "Col.": "CO", "Conn.": "CT", "Del.": "DE", "Fla.": "FL", "Flor.": "FL", "Ga.": "GA", "Ill.": "IL", "Ind.": "IN", "Kan.": "KS", "Kans.": "KS", "Ky.": "KY", "La.": "LA", "Md.": "MD", "Mass.": "MA", "Mich.": "MI", "Minn.": "MN", "Miss.": "MS", "Mo.": "MO", "Mont.": "MT", "Neb.": "NE", "Nebr.": "NE", "Nev.": "NV", "N.H.": "NH", "N.J.": "NJ", "N.M.": "NM", "N.Mex.": "NM", "N. Mex.": "NM", "N.Y.": "NY", "N.C.": "NC", "N.D.": "ND", "N.Dak.": "ND", "N. Dak.": "ND", "Okla.": "OK", "Ore.": "OR", "Oreg.": "OR", "Pa.": "PA", "Penn.": "PA", "Penna.": "PA", "R.I.": "RI", "S.C.": "SC", "S.D.": "SD", "S.Dak.": "SD", "S. Dak.": "SD", "Tenn.": "TN", "Tex.": "TX", "Vt.": "VT", "Va.": "VA", "Wash.": "WA", "W.Va.": "WV", "W. Va.": "WV", "Wis.": "WI", "Wisc.": "WI", "Wyo.": "WY", "D.C.": "DC", "Wash. D.C.": "DC", "Wash., D.C.": "DC", "P.R.": "PR", "V.I.": "VI" };
|
|
985
999
|
var ut = (() => {
|
|
986
1000
|
let n = /* @__PURE__ */ new Map();
|
|
987
|
-
for (let [
|
|
1001
|
+
for (let [s2, i2] of at) n.set(g(i2), s2);
|
|
988
1002
|
n.set(g("Washington DC"), "DC"), n.set(g("Washington D.C."), "DC"), n.set(g("US Virgin Islands"), "VI");
|
|
989
|
-
for (let [
|
|
990
|
-
let r = g(
|
|
1003
|
+
for (let [s2, i2] of Object.entries(yt)) {
|
|
1004
|
+
let r = g(s2);
|
|
991
1005
|
r && !n.has(r) && n.set(r, i2);
|
|
992
1006
|
}
|
|
993
1007
|
return n;
|
|
@@ -1000,16 +1014,16 @@ function g(n) {
|
|
|
1000
1014
|
return u(n);
|
|
1001
1015
|
}
|
|
1002
1016
|
var rt = /* @__PURE__ */ new Set(["zip", "zipcode", "postal", "postcode", "plz"]);
|
|
1003
|
-
function y2(n,
|
|
1017
|
+
function y2(n, s2) {
|
|
1004
1018
|
if (!n) return false;
|
|
1005
|
-
for (let i2 of
|
|
1019
|
+
for (let i2 of s(n)) if (s2.has(i2)) return true;
|
|
1006
1020
|
return false;
|
|
1007
1021
|
}
|
|
1008
|
-
function Mt(n,
|
|
1022
|
+
function Mt(n, s2) {
|
|
1009
1023
|
if (n == null) return null;
|
|
1010
1024
|
let i2 = String(n).trim();
|
|
1011
1025
|
if (i2.length === 0) return null;
|
|
1012
|
-
switch (
|
|
1026
|
+
switch (s2) {
|
|
1013
1027
|
case "country-iso3":
|
|
1014
1028
|
case "country-iso2":
|
|
1015
1029
|
case "country-name":
|
|
@@ -1041,21 +1055,21 @@ function Gt(n) {
|
|
|
1041
1055
|
return false;
|
|
1042
1056
|
}
|
|
1043
1057
|
}
|
|
1044
|
-
function It(n,
|
|
1045
|
-
return
|
|
1058
|
+
function It(n, s2) {
|
|
1059
|
+
return s2 === "us-zip5" ? w.has(n.slice(0, 3)) : true;
|
|
1046
1060
|
}
|
|
1047
|
-
function Wt(n,
|
|
1061
|
+
function Wt(n, s2) {
|
|
1048
1062
|
let i2 = new Array(n.length), r = /* @__PURE__ */ new Set(), M = [], h2 = 0;
|
|
1049
1063
|
for (let N2 = 0; N2 < n.length; ++N2) {
|
|
1050
|
-
let I2 = Mt(n[N2],
|
|
1064
|
+
let I2 = Mt(n[N2], s2), O2 = I2 !== null && It(I2, s2) ? I2 : null;
|
|
1051
1065
|
if (i2[N2] = O2, O2 !== null) h2++;
|
|
1052
1066
|
else {
|
|
1053
1067
|
let d = n[N2];
|
|
1054
1068
|
if (d != null) {
|
|
1055
|
-
let
|
|
1056
|
-
if (
|
|
1057
|
-
let m =
|
|
1058
|
-
r.has(m) || (r.add(m), M.push(
|
|
1069
|
+
let p2 = String(d).trim();
|
|
1070
|
+
if (p2.length > 0) {
|
|
1071
|
+
let m = p2.toLowerCase();
|
|
1072
|
+
r.has(m) || (r.add(m), M.push(p2));
|
|
1059
1073
|
}
|
|
1060
1074
|
}
|
|
1061
1075
|
}
|
|
@@ -1063,77 +1077,77 @@ function Wt(n, s) {
|
|
|
1063
1077
|
return { iso: i2, unmatched: M, matchedRows: h2, totalRows: n.length };
|
|
1064
1078
|
}
|
|
1065
1079
|
|
|
1066
|
-
// ../shape-core/dist/chunk-
|
|
1080
|
+
// ../shape-core/dist/chunk-6W2GOB6U.mjs
|
|
1067
1081
|
var import_papaparse = __toESM(require_papaparse_min(), 1);
|
|
1068
1082
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
1069
|
-
var
|
|
1083
|
+
var yt2 = { "north-america": "AG AI AW BB BL BM BQ BS BZ CA CR CU CW DM DO GD GL GP GT HN HT JM KN KY LC MF MQ MS MX NI PA PM PR SV SX TC TT US VC VG VI", "south-america": "AR BO BR CL CO EC FK GF GY PE PY SR UY VE", europe: "AD AL AT AX BA BE BG BY CH CY CZ DE DK EE ES FI FO FR GB GG GI GR HR HU IE IM IS IT JE LI LT LU LV MC MD ME MK MT NL NO PL PT RO RS RU SE SI SJ SK SM UA VA", africa: "AO BF BI BJ BW CD CF CG CI CM CV DJ DZ EG EH ER ET GA GH GM GN GQ GW KE KM LR LS LY MA MG ML MR MU MW MZ NA NE NG RE RW SC SD SH SL SN SO SS ST SZ TD TG TN TZ UG YT ZA ZM ZW", asia: "AE AF AM AZ BD BH BN BT CC CN CX GE HK ID IL IN IO IQ IR JO JP KG KH KP KR KW KZ LA LB LK MM MN MO MV MY NP OM PH PK PS QA SA SG SY TH TJ TL TM TR TW UZ VN YE", oceania: "AS AU CK FJ FM GU KI MH MP NC NF NR NU NZ PF PG PN PW SB TK TO TV UM VU WF WS", antarctica: "AQ BV GS HM TF" };
|
|
1070
1084
|
var j2 = (() => {
|
|
1071
1085
|
let n = /* @__PURE__ */ new Map();
|
|
1072
|
-
for (let t of Object.keys(
|
|
1086
|
+
for (let t of Object.keys(yt2)) for (let e of yt2[t].split(/\s+/)) e && n.set(e, t);
|
|
1073
1087
|
return n;
|
|
1074
1088
|
})();
|
|
1075
|
-
function
|
|
1089
|
+
function Pt(n) {
|
|
1076
1090
|
for (let [t, e] of n) {
|
|
1077
1091
|
let r = j2.get(t);
|
|
1078
1092
|
r && !j2.has(e) && j2.set(e, r);
|
|
1079
1093
|
}
|
|
1080
1094
|
}
|
|
1081
|
-
|
|
1082
|
-
var
|
|
1083
|
-
var
|
|
1084
|
-
var
|
|
1085
|
-
var
|
|
1086
|
-
var
|
|
1087
|
-
var
|
|
1088
|
-
var
|
|
1089
|
-
var
|
|
1090
|
-
function
|
|
1091
|
-
return n ? String(n).replace(
|
|
1095
|
+
Pt(N);
|
|
1096
|
+
var Gt2 = ["rate", "ratio", "pct", "percent", "percentage", "rating", "share", "score", "index", "nps", "csat", "margin", "yield", "coverage", "utilization", "z[_-]?score", "average", "avg", "mean", "median", "stddev", "variance", "gpa", "percentile", "quantile", "efficiency", "accuracy", "probability", "multiplier", "coefficient", "correlation", "occupancy", "age", "bmi", "temperature", "density", "pressure", "humidity", "ph", "velocity", "speed", "elevation", "altitude", "latency", "throughput", "bandwidth", "iops"];
|
|
1097
|
+
var Wt2 = ["pct", "percent", "percentage", "rate", "ratio", "rating", "share", "score", "index", "nps", "csat", "margin", "yield", "coverage", "utilization", "gpa", "percentile", "quantile", "bmi", "density", "pressure", "humidity", "velocity", "efficiency", "occupancy", "latency", "throughput", "bandwidth", "iops"];
|
|
1098
|
+
var Ft = ["latitude", "longitude"];
|
|
1099
|
+
var Vt = ["latitude", "longitude"];
|
|
1100
|
+
var Ct = /^\s*(sum|count|count\s+distinct|distinct\s+count)\s+of\s+/i;
|
|
1101
|
+
var kt = /(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Za-z])(?=[0-9])|(?<=[0-9])(?=[A-Za-z])/g;
|
|
1102
|
+
var Bt = new RegExp("\\b(" + Gt2.join("|") + ")\\b|(" + Wt2.join("|") + ")$", "i");
|
|
1103
|
+
var zt = new RegExp("\\b(" + Ft.join("|") + ")\\b|(" + Vt.join("|") + ")$", "i");
|
|
1104
|
+
function Mt2(n) {
|
|
1105
|
+
return n ? String(n).replace(Ct, "").trim() : "";
|
|
1092
1106
|
}
|
|
1093
1107
|
function Ut(n) {
|
|
1094
|
-
return !!n &&
|
|
1108
|
+
return !!n && Ct.test(String(n));
|
|
1095
1109
|
}
|
|
1096
|
-
var
|
|
1097
|
-
var
|
|
1098
|
-
function
|
|
1099
|
-
let t =
|
|
1100
|
-
return t.length === 0 ? "" : t.replace(
|
|
1110
|
+
var Kt = ["count (distinct)", "count distinct", "distinct count", "standard deviation", "average", "variance", "median", "product", "stddev", "std dev", "count", "sum", "avg", "min", "minimum", "max", "maximum", "var"];
|
|
1111
|
+
var St2 = new RegExp("^\\s*(" + [...Kt].sort((n, t) => t.length - n.length).map((n) => n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+")).join("|") + ")\\s+of\\s+", "i");
|
|
1112
|
+
function Ht(n) {
|
|
1113
|
+
let t = Mt2(n);
|
|
1114
|
+
return t.length === 0 ? "" : t.replace(kt, " ");
|
|
1101
1115
|
}
|
|
1102
|
-
function
|
|
1116
|
+
function Tt(n, t) {
|
|
1103
1117
|
if (!t) return false;
|
|
1104
|
-
let e =
|
|
1105
|
-
return n.test(
|
|
1118
|
+
let e = Mt2(t);
|
|
1119
|
+
return n.test(Ht(t)) || n.test(e) || n.test(s(e).join(" "));
|
|
1106
1120
|
}
|
|
1107
|
-
function
|
|
1108
|
-
return
|
|
1121
|
+
function Nt(n) {
|
|
1122
|
+
return Tt(zt, n);
|
|
1109
1123
|
}
|
|
1110
|
-
function
|
|
1111
|
-
return
|
|
1124
|
+
function Yt(n) {
|
|
1125
|
+
return Tt(Bt, n) || Nt(n);
|
|
1112
1126
|
}
|
|
1113
|
-
var
|
|
1114
|
-
function
|
|
1127
|
+
var Rt = /int|double|decimal|single|float|number|currency|money/i;
|
|
1128
|
+
function Zt(n) {
|
|
1115
1129
|
let t = String(n?.valueNature ?? "").trim().toLowerCase();
|
|
1116
|
-
return t === "categorical" ? "Categorical" : t === "ordinal" ? "Ordinal" : t === "continuous" || n?.isMeasure === true ||
|
|
1130
|
+
return t === "categorical" ? "Categorical" : t === "ordinal" ? "Ordinal" : t === "continuous" || n?.isMeasure === true || Rt.test(String(n?.dataType ?? "")) ? "Continuous" : "Categorical";
|
|
1117
1131
|
}
|
|
1118
|
-
function
|
|
1119
|
-
return n?.isMeasure === true ||
|
|
1132
|
+
function Xt(n) {
|
|
1133
|
+
return n?.isMeasure === true || Rt.test(String(n?.dataType ?? ""));
|
|
1120
1134
|
}
|
|
1121
|
-
function
|
|
1122
|
-
let t = n ?? {}, e =
|
|
1135
|
+
function vt(n) {
|
|
1136
|
+
let t = n ?? {}, e = Zt(t);
|
|
1123
1137
|
if (e !== "Continuous") return { nature: e, additivity: "unknown", basis: "role", suppressed: false };
|
|
1124
|
-
if (
|
|
1138
|
+
if (Nt(t.name)) return { nature: e, additivity: "positional", basis: "name", suppressed: true };
|
|
1125
1139
|
let r = String(t.additivity ?? "").trim().toLowerCase();
|
|
1126
1140
|
if (!(r === "additive" && Ut(t.name))) {
|
|
1127
1141
|
if (r === "additive") return { nature: e, additivity: "additive", basis: "measured", suppressed: false };
|
|
1128
1142
|
if (r === "part_of_whole") return { nature: e, additivity: "part_of_whole", basis: "measured", suppressed: false };
|
|
1129
1143
|
if (r === "intensive_rate") return { nature: e, additivity: "intensive_rate", basis: "measured", suppressed: false };
|
|
1130
1144
|
}
|
|
1131
|
-
return t.discourageAggregationAcrossGroups === true ? { nature: e, additivity: "intensive_rate", basis: "host-flag", suppressed: false } :
|
|
1145
|
+
return t.discourageAggregationAcrossGroups === true ? { nature: e, additivity: "intensive_rate", basis: "host-flag", suppressed: false } : Yt(t.name) ? { nature: e, additivity: "intensive_rate", basis: "name", suppressed: false } : { nature: e, additivity: "additive", basis: "default", suppressed: false };
|
|
1132
1146
|
}
|
|
1133
|
-
function
|
|
1134
|
-
let t =
|
|
1147
|
+
function It2(n) {
|
|
1148
|
+
let t = vt(n), e = n ?? {};
|
|
1135
1149
|
if (t.nature === "Categorical") return ["first", "distinctcount", "count"];
|
|
1136
|
-
if (t.nature === "Ordinal") return
|
|
1150
|
+
if (t.nature === "Ordinal") return Xt(e) ? ["median", "average", "min", "max", "first", "distinctcount", "count"] : ["first", "distinctcount", "count"];
|
|
1137
1151
|
switch (t.additivity) {
|
|
1138
1152
|
case "positional":
|
|
1139
1153
|
return ["min", "max", "count", "distinctcount", "first"];
|
|
@@ -1143,13 +1157,13 @@ function Rt(n) {
|
|
|
1143
1157
|
return ["sum", "average", "median", "min", "max", "count", "distinctcount", "first"];
|
|
1144
1158
|
}
|
|
1145
1159
|
}
|
|
1146
|
-
function
|
|
1147
|
-
return
|
|
1160
|
+
function Me(n) {
|
|
1161
|
+
return It2(n)[0];
|
|
1148
1162
|
}
|
|
1149
|
-
function
|
|
1163
|
+
function Te(n, t) {
|
|
1150
1164
|
if (t !== "sum" && t !== "count") return false;
|
|
1151
1165
|
if (t === "count") return true;
|
|
1152
|
-
let e =
|
|
1166
|
+
let e = vt(n);
|
|
1153
1167
|
return e.additivity === "additive" || e.additivity === "part_of_whole" || e.additivity === "unknown";
|
|
1154
1168
|
}
|
|
1155
1169
|
|
|
@@ -1161,141 +1175,141 @@ function G2(r) {
|
|
|
1161
1175
|
return !!E(r);
|
|
1162
1176
|
}
|
|
1163
1177
|
function C(r) {
|
|
1164
|
-
let
|
|
1165
|
-
for (let
|
|
1166
|
-
if (
|
|
1167
|
-
let
|
|
1168
|
-
if (!V(
|
|
1178
|
+
let n = /* @__PURE__ */ new Set();
|
|
1179
|
+
for (let e of r) {
|
|
1180
|
+
if (e == null) continue;
|
|
1181
|
+
let s2 = u(String(e));
|
|
1182
|
+
if (!V(s2) && !n.has(s2) && (n.add(s2), n.size >= U2)) break;
|
|
1169
1183
|
}
|
|
1170
|
-
return Array.from(
|
|
1184
|
+
return Array.from(n);
|
|
1171
1185
|
}
|
|
1172
1186
|
function P2(r) {
|
|
1173
|
-
let
|
|
1174
|
-
if (
|
|
1175
|
-
let
|
|
1176
|
-
return
|
|
1187
|
+
let n = C(r);
|
|
1188
|
+
if (n.length === 0 || $2(r) < 95) return false;
|
|
1189
|
+
let e = n.filter((c2) => G2(c2) && !Y(c2)).length, s2 = n.filter((c2) => !G2(c2) && !!Y(c2)).length;
|
|
1190
|
+
return e >= 1 && e >= s2;
|
|
1177
1191
|
}
|
|
1178
|
-
function q2(r,
|
|
1192
|
+
function q2(r, n) {
|
|
1179
1193
|
if (!Y(r)) return false;
|
|
1180
|
-
let
|
|
1181
|
-
return
|
|
1194
|
+
let e = E(r);
|
|
1195
|
+
return e ? n === "world" ? true : s3.has(e) : false;
|
|
1182
1196
|
}
|
|
1183
1197
|
function $2(r) {
|
|
1184
|
-
let
|
|
1185
|
-
if (
|
|
1186
|
-
let
|
|
1187
|
-
for (let
|
|
1188
|
-
return Math.round(
|
|
1198
|
+
let n = C(r);
|
|
1199
|
+
if (n.length === 0) return 0;
|
|
1200
|
+
let e = 0;
|
|
1201
|
+
for (let s2 of n) G2(s2) && e++;
|
|
1202
|
+
return Math.round(e / n.length * 1e3) / 10;
|
|
1189
1203
|
}
|
|
1190
1204
|
function v2(r) {
|
|
1191
|
-
let
|
|
1192
|
-
if (
|
|
1193
|
-
let
|
|
1194
|
-
for (let
|
|
1195
|
-
return Math.round(
|
|
1205
|
+
let n = C(r);
|
|
1206
|
+
if (n.length === 0) return 0;
|
|
1207
|
+
let e = 0;
|
|
1208
|
+
for (let s2 of n) Y(s2) && e++;
|
|
1209
|
+
return Math.round(e / n.length * 1e3) / 10;
|
|
1196
1210
|
}
|
|
1197
|
-
function
|
|
1198
|
-
let
|
|
1199
|
-
for (let
|
|
1200
|
-
if (
|
|
1201
|
-
let
|
|
1202
|
-
if (!V(u(
|
|
1211
|
+
function F3(r) {
|
|
1212
|
+
let n = /* @__PURE__ */ new Set();
|
|
1213
|
+
for (let e of r) {
|
|
1214
|
+
if (e == null) continue;
|
|
1215
|
+
let s2 = String(e).trim();
|
|
1216
|
+
if (!V(u(s2)) && !n.has(s2) && (n.add(s2), n.size >= U2)) break;
|
|
1203
1217
|
}
|
|
1204
|
-
return Array.from(
|
|
1218
|
+
return Array.from(n);
|
|
1205
1219
|
}
|
|
1206
1220
|
function D2(r) {
|
|
1207
|
-
let
|
|
1208
|
-
if (
|
|
1209
|
-
let
|
|
1210
|
-
for (let
|
|
1211
|
-
return Math.round(
|
|
1221
|
+
let n = F3(r);
|
|
1222
|
+
if (n.length === 0) return 0;
|
|
1223
|
+
let e = 0;
|
|
1224
|
+
for (let s2 of n) Z(s2).length > 0 && e++;
|
|
1225
|
+
return Math.round(e / n.length * 1e3) / 10;
|
|
1212
1226
|
}
|
|
1213
|
-
function Z2(r,
|
|
1214
|
-
return y2(
|
|
1227
|
+
function Z2(r, n) {
|
|
1228
|
+
return y2(n, rt) ? true : F3(r).some((e) => /^\d{5}(-\d{4})?$/.test(e.replace(/\.0+$/, "")));
|
|
1215
1229
|
}
|
|
1216
|
-
function
|
|
1217
|
-
let
|
|
1218
|
-
if (
|
|
1219
|
-
let
|
|
1220
|
-
for (let
|
|
1221
|
-
return Math.round(
|
|
1230
|
+
function ne(r, n) {
|
|
1231
|
+
let e = C(r);
|
|
1232
|
+
if (e.length === 0) return 0;
|
|
1233
|
+
let s2 = 0;
|
|
1234
|
+
for (let c2 of e) p3(c2, n) && s2++;
|
|
1235
|
+
return Math.round(s2 / e.length * 1e3) / 10;
|
|
1222
1236
|
}
|
|
1223
|
-
function z2(r,
|
|
1224
|
-
let
|
|
1225
|
-
for (let
|
|
1226
|
-
return
|
|
1237
|
+
function z2(r, n) {
|
|
1238
|
+
let e = 0;
|
|
1239
|
+
for (let s2 of C(r)) n(s2) && e++;
|
|
1240
|
+
return e;
|
|
1227
1241
|
}
|
|
1228
|
-
function
|
|
1229
|
-
let
|
|
1230
|
-
for (let
|
|
1231
|
-
return
|
|
1242
|
+
function oe(r, n) {
|
|
1243
|
+
let e = 0;
|
|
1244
|
+
for (let s2 of F3(r)) n(s2) && e++;
|
|
1245
|
+
return e;
|
|
1232
1246
|
}
|
|
1233
|
-
function
|
|
1234
|
-
let A = [], u4 = [],
|
|
1247
|
+
function ie(r, n, e, s2, c2) {
|
|
1248
|
+
let A = [], u4 = [], o = {}, M = {}, _2 = new Set(r), l2 = (t) => n.map((i2) => i2[t]);
|
|
1235
1249
|
for (let t of ["city", "country"]) {
|
|
1236
|
-
let i2 =
|
|
1237
|
-
i2 && _2.has(i2) && (
|
|
1250
|
+
let i2 = e?.[t];
|
|
1251
|
+
i2 && _2.has(i2) && (o[t] = i2);
|
|
1238
1252
|
}
|
|
1239
|
-
let X2 = new Set(
|
|
1253
|
+
let X2 = new Set(c2 ?? r);
|
|
1240
1254
|
for (let t of ["lat", "lon"]) {
|
|
1241
|
-
let i2 =
|
|
1242
|
-
i2 && X2.has(i2) && (
|
|
1255
|
+
let i2 = e?.[t];
|
|
1256
|
+
i2 && X2.has(i2) && (o[t] = i2);
|
|
1243
1257
|
}
|
|
1244
|
-
let
|
|
1245
|
-
if (
|
|
1246
|
-
let t = l2(
|
|
1247
|
-
i2 < 95 ? u4.push(`zip=${
|
|
1258
|
+
let g3 = e?.zip;
|
|
1259
|
+
if (g3 && _2.has(g3)) {
|
|
1260
|
+
let t = l2(g3), i2 = D2(t);
|
|
1261
|
+
i2 < 95 ? u4.push(`zip=${g3} (only ${i2}% of values read as ZIPs)`) : Z2(t, g3) ? o.zip = g3 : u4.push(`zip=${g3} (all values are 3-4 digits with nothing to say they are postal)`);
|
|
1248
1262
|
}
|
|
1249
|
-
let
|
|
1250
|
-
if (
|
|
1251
|
-
let t = l2(
|
|
1252
|
-
i2.length > 0 && i2.every((
|
|
1263
|
+
let p2 = e?.state;
|
|
1264
|
+
if (p2 && _2.has(p2)) {
|
|
1265
|
+
let t = l2(p2), i2 = C(t);
|
|
1266
|
+
i2.length > 0 && i2.every((a4) => q2(a4, s2)) ? u4.push(`state=${p2} (every value is "CA", which is both Canada and California)`) : P2(t) ? (u4.push(`state=${p2} (every value is a country, not a state)`), o.country || (o.country = p2)) : v2(t) < 95 ? u4.push(`state=${p2} (only ${v2(t)}% of values are states/provinces)`) : o.state = p2;
|
|
1253
1267
|
}
|
|
1254
|
-
let d = new Set(Object.values(
|
|
1255
|
-
if (!
|
|
1268
|
+
let d = new Set(Object.values(o).filter(Boolean)), x2 = r.filter((t) => !d.has(t) && !t.startsWith("__"));
|
|
1269
|
+
if (!o.state) {
|
|
1256
1270
|
let t = null;
|
|
1257
1271
|
for (let i2 of x2) {
|
|
1258
|
-
let
|
|
1259
|
-
if (P2(
|
|
1260
|
-
let
|
|
1261
|
-
if (
|
|
1262
|
-
let N2 = z2(
|
|
1263
|
-
N2 < E2 && Y2 < 1 || (!t ||
|
|
1272
|
+
let a4 = l2(i2);
|
|
1273
|
+
if (P2(a4)) continue;
|
|
1274
|
+
let f2 = v2(a4);
|
|
1275
|
+
if (f2 < 95) continue;
|
|
1276
|
+
let N2 = z2(a4, (S) => !!Y(S)), Y2 = z2(a4, (S) => !!Y(S) && !q2(S, s2));
|
|
1277
|
+
N2 < E2 && Y2 < 1 || (!t || f2 > t.pct) && (t = { name: i2, pct: f2 });
|
|
1264
1278
|
}
|
|
1265
|
-
t && (
|
|
1279
|
+
t && (o.state = t.name, d.add(t.name), A.push(`state=${t.name} (${t.pct}% states/provinces)`));
|
|
1266
1280
|
}
|
|
1267
|
-
if (!
|
|
1281
|
+
if (!o.zip) for (let t of x2) {
|
|
1268
1282
|
if (d.has(t)) continue;
|
|
1269
|
-
let i2 = l2(t),
|
|
1270
|
-
if (!(
|
|
1271
|
-
|
|
1283
|
+
let i2 = l2(t), a4 = D2(i2);
|
|
1284
|
+
if (!(a4 < 95) && Z2(i2, t) && !(oe(i2, (f2) => Z(f2).length > 0) < E2)) {
|
|
1285
|
+
o.zip = t, d.add(t), A.push(`zip=${t} (${a4}% ZIP codes)`);
|
|
1272
1286
|
break;
|
|
1273
1287
|
}
|
|
1274
1288
|
}
|
|
1275
|
-
let h2 =
|
|
1289
|
+
let h2 = o.country;
|
|
1276
1290
|
if (!h2 || !P2(l2(h2))) {
|
|
1277
1291
|
let t = null;
|
|
1278
1292
|
for (let i2 of x2) {
|
|
1279
1293
|
if (d.has(i2) || !P2(l2(i2))) continue;
|
|
1280
|
-
let
|
|
1281
|
-
(!t ||
|
|
1294
|
+
let a4 = $2(l2(i2));
|
|
1295
|
+
(!t || a4 > t.pct) && (t = { name: i2, pct: a4 });
|
|
1282
1296
|
}
|
|
1283
|
-
t && (h2 && (u4.push(`country=${h2} (only ${$2(l2(h2))}% of values are country identifiers; using ${t.name} instead)`), M.country = h2),
|
|
1297
|
+
t && (h2 && (u4.push(`country=${h2} (only ${$2(l2(h2))}% of values are country identifiers; using ${t.name} instead)`), M.country = h2), o.country = t.name, d.add(t.name), A.push(`country=${t.name}`));
|
|
1284
1298
|
}
|
|
1285
|
-
if (!
|
|
1299
|
+
if (!o.city) {
|
|
1286
1300
|
let t = null;
|
|
1287
1301
|
for (let i2 of x2) {
|
|
1288
1302
|
if (d.has(i2)) continue;
|
|
1289
|
-
let
|
|
1290
|
-
|
|
1303
|
+
let a4 = l2(i2), f2 = ne(a4, s2);
|
|
1304
|
+
f2 < m3 || z2(a4, (N2) => p3(N2, s2)) < E2 || (!t || f2 > t.pct) && (t = { name: i2, pct: f2 });
|
|
1291
1305
|
}
|
|
1292
|
-
t && (
|
|
1306
|
+
t && (o.city = t.name, A.push(`city=${t.name} (${t.pct}% known cities)`));
|
|
1293
1307
|
}
|
|
1294
|
-
let B2 =
|
|
1295
|
-
let i2 = +String(t[
|
|
1296
|
-
return isFinite(i2) && isFinite(
|
|
1308
|
+
let B2 = o.country ? l2(o.country) : [], k2 = !!o.country && P2(B2), j3 = k2 ? new Set(B2.map((t) => E(t == null ? null : String(t))).filter(Boolean)).size : 0, K2 = k2 && j3 >= 2, L2 = !!(o.lat && o.lon) && n.some((t) => {
|
|
1309
|
+
let i2 = +String(t[o.lat] ?? "").trim(), a4 = +String(t[o.lon] ?? "").trim();
|
|
1310
|
+
return isFinite(i2) && isFinite(a4) && i2 >= -90 && i2 <= 90 && a4 >= -180 && a4 <= 180 && String(t[o.lat] ?? "").trim() !== "" && String(t[o.lon] ?? "").trim() !== "";
|
|
1297
1311
|
});
|
|
1298
|
-
return
|
|
1312
|
+
return o.lat && o.lon && !L2 && u4.push(`lat/lon=${o.lat}/${o.lon} (no row holds a usable coordinate pair)`), o.country && !K2 && !(o.city || o.state || o.zip || L2) && u4.push(k2 ? `country=${o.country} (every row resolves to the same country - nothing to place apart)` : `country=${o.country} (values are not country identifiers)`), { bind: !!(o.city || o.state || o.zip || K2 || L2) ? o : null, backfilled: A, refused: u4, ...Object.keys(M).length ? { labelFallback: M } : {} };
|
|
1299
1313
|
}
|
|
1300
1314
|
|
|
1301
1315
|
// src/payload.ts
|
|
@@ -1309,8 +1323,8 @@ function resolvePointChannel(cols, rowObjs, point) {
|
|
|
1309
1323
|
let rolesRefused = [];
|
|
1310
1324
|
let labelCol;
|
|
1311
1325
|
if (bind) {
|
|
1312
|
-
const dims = cols.filter((
|
|
1313
|
-
const res =
|
|
1326
|
+
const dims = cols.filter((c2) => !c2.isMeasure).map((c2) => c2.name);
|
|
1327
|
+
const res = ie(dims, rowObjs, bind, point?.mapKind, cols.map((c2) => c2.name));
|
|
1314
1328
|
bind = res.bind;
|
|
1315
1329
|
rolesBackfilled = res.backfilled;
|
|
1316
1330
|
rolesRefused = res.refused;
|
|
@@ -1319,14 +1333,14 @@ function resolvePointChannel(cols, rowObjs, point) {
|
|
|
1319
1333
|
}
|
|
1320
1334
|
const hasPointBind = !!bind && !!(bind.city || bind.state || bind.zip || bind.country || bind.lat && bind.lon);
|
|
1321
1335
|
if (hasPointBind) {
|
|
1322
|
-
const
|
|
1336
|
+
const p2 = bind;
|
|
1323
1337
|
const built = y3(rowObjs.map((r) => ({
|
|
1324
|
-
lat:
|
|
1325
|
-
lon:
|
|
1326
|
-
city:
|
|
1327
|
-
state:
|
|
1328
|
-
zip:
|
|
1329
|
-
country:
|
|
1338
|
+
lat: p2.lat ? r[p2.lat] : null,
|
|
1339
|
+
lon: p2.lon ? r[p2.lon] : null,
|
|
1340
|
+
city: p2.city ? r[p2.city] : null,
|
|
1341
|
+
state: p2.state ? r[p2.state] : null,
|
|
1342
|
+
zip: p2.zip ? r[p2.zip] : null,
|
|
1343
|
+
country: p2.country ? r[p2.country] : null,
|
|
1330
1344
|
label: labelCol ? r[labelCol] : null
|
|
1331
1345
|
})), point?.mapKind);
|
|
1332
1346
|
pLat = built.lat;
|
|
@@ -1355,14 +1369,14 @@ function resolvePointChannel(cols, rowObjs, point) {
|
|
|
1355
1369
|
return { lat: pLat, lon: pLon, prec: pPrec, geoPoint, rolesRefused };
|
|
1356
1370
|
}
|
|
1357
1371
|
function buildRenderPayload(cols, rowObjs, geo, point, destination) {
|
|
1358
|
-
const colNames = cols.map((
|
|
1359
|
-
const
|
|
1372
|
+
const colNames = cols.map((c2) => c2.name);
|
|
1373
|
+
const o = resolvePointChannel(cols, rowObjs, point);
|
|
1360
1374
|
const d = resolvePointChannel(cols, rowObjs, destination);
|
|
1361
|
-
const pLat =
|
|
1375
|
+
const pLat = o.lat, pLon = o.lon, pPrec = o.prec;
|
|
1362
1376
|
const dLat = d.lat, dLon = d.lon, dPrec = d.prec;
|
|
1363
|
-
const geoPoint =
|
|
1377
|
+
const geoPoint = o.geoPoint;
|
|
1364
1378
|
const geoPointDest = d.geoPoint;
|
|
1365
|
-
const rolesRefused = [...
|
|
1379
|
+
const rolesRefused = [...o.rolesRefused, ...d.rolesRefused.map((s2) => `destination: ${s2}`)];
|
|
1366
1380
|
let geoIso = null;
|
|
1367
1381
|
let geoUnmatched;
|
|
1368
1382
|
let geoUnmatchedDistinct;
|
|
@@ -1376,29 +1390,29 @@ function buildRenderPayload(cols, rowObjs, geo, point, destination) {
|
|
|
1376
1390
|
const out = new Array(rowObjs.length);
|
|
1377
1391
|
for (let r = 0; r < rowObjs.length; r++) {
|
|
1378
1392
|
const row = rowObjs[r];
|
|
1379
|
-
const
|
|
1380
|
-
for (let
|
|
1381
|
-
const v3 = row[colNames[
|
|
1393
|
+
const a4 = new Array(cols.length + extra);
|
|
1394
|
+
for (let c2 = 0; c2 < cols.length; c2++) {
|
|
1395
|
+
const v3 = row[colNames[c2]];
|
|
1382
1396
|
if (v3 instanceof Date) {
|
|
1383
|
-
|
|
1397
|
+
a4[c2] = v3.toISOString();
|
|
1384
1398
|
} else {
|
|
1385
|
-
|
|
1399
|
+
a4[c2] = v3 ?? null;
|
|
1386
1400
|
}
|
|
1387
1401
|
}
|
|
1388
1402
|
let k2 = cols.length;
|
|
1389
|
-
|
|
1390
|
-
if (geoIso)
|
|
1403
|
+
a4[k2++] = r;
|
|
1404
|
+
if (geoIso) a4[k2++] = geoIso[r];
|
|
1391
1405
|
if (pLat && pLon) {
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1406
|
+
a4[k2++] = pLat[r];
|
|
1407
|
+
a4[k2++] = pLon[r];
|
|
1408
|
+
a4[k2++] = pPrec ? pPrec[r] : null;
|
|
1395
1409
|
}
|
|
1396
1410
|
if (dLat && dLon) {
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1411
|
+
a4[k2++] = dLat[r];
|
|
1412
|
+
a4[k2++] = dLon[r];
|
|
1413
|
+
a4[k2++] = dPrec ? dPrec[r] : null;
|
|
1400
1414
|
}
|
|
1401
|
-
out[r] =
|
|
1415
|
+
out[r] = a4;
|
|
1402
1416
|
}
|
|
1403
1417
|
const colsOut = [...cols, { name: "__rowIdx__", dataType: "Integer", isMeasure: false, modelDesc: "" }];
|
|
1404
1418
|
if (geoIso) colsOut.push({ name: "__geoIso__", dataType: "String", isMeasure: false, modelDesc: "" });
|
|
@@ -1448,11 +1462,11 @@ function createMarkResolver(env) {
|
|
|
1448
1462
|
};
|
|
1449
1463
|
const isInvisibleStrokePath = (el) => {
|
|
1450
1464
|
if (el.tagName.toLowerCase() !== "path") return false;
|
|
1451
|
-
const
|
|
1452
|
-
if (
|
|
1453
|
-
const
|
|
1465
|
+
const f2 = el.getAttribute("fill");
|
|
1466
|
+
if (f2 !== null && f2 !== "" && f2 !== "none" && f2 !== "transparent") return false;
|
|
1467
|
+
const s2 = (el.getAttribute("stroke") || "").trim().toLowerCase();
|
|
1454
1468
|
const so = parseFloat(el.getAttribute("stroke-opacity") || "1");
|
|
1455
|
-
return
|
|
1469
|
+
return s2 === "transparent" || s2 === "none" || so <= 0.01;
|
|
1456
1470
|
};
|
|
1457
1471
|
const distToPathCenterline = (el, x2, y4) => {
|
|
1458
1472
|
const L2 = el.getTotalLength();
|
|
@@ -1462,9 +1476,9 @@ function createMarkResolver(env) {
|
|
|
1462
1476
|
let best = Number.MAX_VALUE;
|
|
1463
1477
|
const N2 = 64;
|
|
1464
1478
|
for (let i2 = 0; i2 <= N2; i2++) {
|
|
1465
|
-
const
|
|
1466
|
-
const dx = m.a *
|
|
1467
|
-
const dy = m.b *
|
|
1479
|
+
const pt = el.getPointAtLength(L2 * i2 / N2);
|
|
1480
|
+
const dx = m.a * pt.x + m.c * pt.y + m.e - x2;
|
|
1481
|
+
const dy = m.b * pt.x + m.d * pt.y + m.f - y4;
|
|
1468
1482
|
const d = dx * dx + dy * dy;
|
|
1469
1483
|
if (d < best) best = d;
|
|
1470
1484
|
}
|
|
@@ -1690,7 +1704,7 @@ function isBlankRender(i2) {
|
|
|
1690
1704
|
return i2.markCount === 0;
|
|
1691
1705
|
}
|
|
1692
1706
|
function blankRenderFlag(lang, cause) {
|
|
1693
|
-
const clean = (
|
|
1707
|
+
const clean = (s2) => String(s2 || "unknown").toLowerCase().replace(/[^a-z0-9-]+/g, "-");
|
|
1694
1708
|
return `blankrender:${clean(lang)}:${clean(cause)}`;
|
|
1695
1709
|
}
|
|
1696
1710
|
|
|
@@ -1714,14 +1728,14 @@ function styleOf(el, doc) {
|
|
|
1714
1728
|
}
|
|
1715
1729
|
}
|
|
1716
1730
|
function attrOrComputed(el, name, cs) {
|
|
1717
|
-
const
|
|
1718
|
-
if (
|
|
1719
|
-
const
|
|
1720
|
-
return
|
|
1731
|
+
const a4 = el.getAttribute?.(name);
|
|
1732
|
+
if (a4 !== null && a4 !== void 0 && String(a4).trim() !== "") return String(a4).trim();
|
|
1733
|
+
const c2 = cs?.[name === "stroke-width" ? "strokeWidth" : name];
|
|
1734
|
+
return c2 === null || c2 === void 0 ? "" : String(c2).trim();
|
|
1721
1735
|
}
|
|
1722
1736
|
function isUnfilled(fill) {
|
|
1723
|
-
const
|
|
1724
|
-
return
|
|
1737
|
+
const f2 = fill.toLowerCase();
|
|
1738
|
+
return f2 === "none" || f2 === "transparent" || f2 === "rgba(0, 0, 0, 0)" || f2 === "rgba(0,0,0,0)";
|
|
1725
1739
|
}
|
|
1726
1740
|
function widthPx(raw) {
|
|
1727
1741
|
const m = /^(-?\d+(?:\.\d+)?)\s*(px)?$/i.exec(raw);
|
|
@@ -1770,9 +1784,9 @@ function censusHitBands(container, doc) {
|
|
|
1770
1784
|
return EMPTY2;
|
|
1771
1785
|
}
|
|
1772
1786
|
}
|
|
1773
|
-
function hitBandFlag(
|
|
1774
|
-
if (
|
|
1775
|
-
return
|
|
1787
|
+
function hitBandFlag(c2) {
|
|
1788
|
+
if (c2.interactive === 0) return "";
|
|
1789
|
+
return c2.uncovered > 0 ? "hitband:d3:thin" : "hitband:d3:ok";
|
|
1776
1790
|
}
|
|
1777
1791
|
|
|
1778
1792
|
// src/fit.ts
|
|
@@ -1857,11 +1871,11 @@ function planAxisPin(candidates, viewportH, minLabels = AXIS_PIN_MIN_LABELS, max
|
|
|
1857
1871
|
const none = (reason) => ({ pin: false, index: -1, band: null, reason });
|
|
1858
1872
|
if (!isFinite(viewportH) || viewportH <= 0) return none("unmeasurable");
|
|
1859
1873
|
let sawAxis = false, best = null;
|
|
1860
|
-
for (const
|
|
1861
|
-
if (!
|
|
1874
|
+
for (const c2 of candidates || []) {
|
|
1875
|
+
if (!c2 || !c2.labels || c2.labels.length < minLabels) continue;
|
|
1862
1876
|
sawAxis = true;
|
|
1863
|
-
if (!isHorizontalLabelRow(
|
|
1864
|
-
if (!best ||
|
|
1877
|
+
if (!isHorizontalLabelRow(c2.labels)) continue;
|
|
1878
|
+
if (!best || c2.labels.length > best.labels.length) best = c2;
|
|
1865
1879
|
}
|
|
1866
1880
|
if (!best) return none(sawAxis ? "vertical-only" : "no-axis");
|
|
1867
1881
|
const band = labelBand(best.labels, best.tracks || []);
|
|
@@ -1881,8 +1895,8 @@ function axisPinPlacement(band, scrollTop, viewportH) {
|
|
|
1881
1895
|
var FIT_WALK_CAP = 8e3;
|
|
1882
1896
|
function ctmScaleOf(m) {
|
|
1883
1897
|
if (!m) return 0;
|
|
1884
|
-
const
|
|
1885
|
-
return isFinite(
|
|
1898
|
+
const s2 = Math.hypot(m.a, m.b);
|
|
1899
|
+
return isFinite(s2) && s2 > 0 ? s2 : 0;
|
|
1886
1900
|
}
|
|
1887
1901
|
function svgInkReach(svg) {
|
|
1888
1902
|
try {
|
|
@@ -1904,13 +1918,13 @@ function svgInkReach(svg) {
|
|
|
1904
1918
|
return null;
|
|
1905
1919
|
}
|
|
1906
1920
|
}
|
|
1907
|
-
function measureContainerBoxes(
|
|
1921
|
+
function measureContainerBoxes(c2, inkOf) {
|
|
1908
1922
|
const boxes = [];
|
|
1909
|
-
if (!
|
|
1910
|
-
const view =
|
|
1911
|
-
const cRect =
|
|
1912
|
-
for (let i2 = 0; i2 <
|
|
1913
|
-
const el =
|
|
1923
|
+
if (!c2 || !c2.children) return boxes;
|
|
1924
|
+
const view = c2.ownerDocument && c2.ownerDocument.defaultView || globalThis;
|
|
1925
|
+
const cRect = c2.getBoundingClientRect();
|
|
1926
|
+
for (let i2 = 0; i2 < c2.children.length; i2++) {
|
|
1927
|
+
const el = c2.children[i2];
|
|
1914
1928
|
let floating = false;
|
|
1915
1929
|
try {
|
|
1916
1930
|
const cs = view.getComputedStyle(el);
|
|
@@ -1919,14 +1933,14 @@ function measureContainerBoxes(c, inkOf) {
|
|
|
1919
1933
|
} catch {
|
|
1920
1934
|
}
|
|
1921
1935
|
const r = el.getBoundingClientRect();
|
|
1922
|
-
let right = r.right - cRect.left -
|
|
1923
|
-
let bottom = r.bottom - cRect.top -
|
|
1936
|
+
let right = r.right - cRect.left - c2.clientLeft + c2.scrollLeft;
|
|
1937
|
+
let bottom = r.bottom - cRect.top - c2.clientTop + c2.scrollTop;
|
|
1924
1938
|
if (inkOf) {
|
|
1925
1939
|
try {
|
|
1926
1940
|
const ink = inkOf(el);
|
|
1927
1941
|
if (ink) {
|
|
1928
|
-
const originX = r.left - cRect.left -
|
|
1929
|
-
const originY = r.top - cRect.top -
|
|
1942
|
+
const originX = r.left - cRect.left - c2.clientLeft + c2.scrollLeft;
|
|
1943
|
+
const originY = r.top - cRect.top - c2.clientTop + c2.scrollTop;
|
|
1930
1944
|
if (isFinite(ink.right)) right = Math.max(right, originX + ink.right);
|
|
1931
1945
|
if (isFinite(ink.bottom)) bottom = Math.max(bottom, originY + ink.bottom);
|
|
1932
1946
|
}
|
|
@@ -1937,14 +1951,14 @@ function measureContainerBoxes(c, inkOf) {
|
|
|
1937
1951
|
}
|
|
1938
1952
|
return boxes;
|
|
1939
1953
|
}
|
|
1940
|
-
function fitReadingFor(lane,
|
|
1941
|
-
if (!
|
|
1942
|
-
const viewW =
|
|
1954
|
+
function fitReadingFor(lane, c2, slackPx = SCROLL_SLACK_PX, inkOf) {
|
|
1955
|
+
if (!c2) return null;
|
|
1956
|
+
const viewW = c2.clientWidth, viewH = c2.clientHeight;
|
|
1943
1957
|
if (!(viewW > 0) || !(viewH > 0)) return null;
|
|
1944
|
-
const boxes = measureContainerBoxes(
|
|
1958
|
+
const boxes = measureContainerBoxes(c2, inkOf);
|
|
1945
1959
|
const extent = contentExtentOf(boxes);
|
|
1946
|
-
const contentW = extent.source === "none" ?
|
|
1947
|
-
const contentH = extent.source === "none" ?
|
|
1960
|
+
const contentW = extent.source === "none" ? c2.scrollWidth : extent.w;
|
|
1961
|
+
const contentH = extent.source === "none" ? c2.scrollHeight : extent.h;
|
|
1948
1962
|
if (!isFinite(contentW) || !isFinite(contentH)) return null;
|
|
1949
1963
|
return {
|
|
1950
1964
|
lane,
|
|
@@ -1957,8 +1971,8 @@ function fitReadingFor(lane, c, slackPx = SCROLL_SLACK_PX, inkOf) {
|
|
|
1957
1971
|
extentSource: extent.source,
|
|
1958
1972
|
boxes: boxes.length,
|
|
1959
1973
|
floating: boxes.filter((b2) => b2.floating).length,
|
|
1960
|
-
scrollW:
|
|
1961
|
-
scrollH:
|
|
1974
|
+
scrollW: c2.scrollWidth,
|
|
1975
|
+
scrollH: c2.scrollHeight
|
|
1962
1976
|
};
|
|
1963
1977
|
}
|
|
1964
1978
|
var noPin = (reason) => ({ pinned: false, reason, bandPx: 0, axisAt: "", labels: 0, carried: 0, edge: null });
|
|
@@ -2030,9 +2044,9 @@ function cloneWithChain(el, svg, root) {
|
|
|
2030
2044
|
}
|
|
2031
2045
|
let parent = root;
|
|
2032
2046
|
for (const anc of chain) {
|
|
2033
|
-
const
|
|
2034
|
-
parent.appendChild(
|
|
2035
|
-
parent =
|
|
2047
|
+
const c2 = anc.cloneNode(false);
|
|
2048
|
+
parent.appendChild(c2);
|
|
2049
|
+
parent = c2;
|
|
2036
2050
|
}
|
|
2037
2051
|
parent.appendChild(el.cloneNode(true));
|
|
2038
2052
|
const ids = root.querySelectorAll("[id]");
|
|
@@ -2057,11 +2071,11 @@ function pinScrolledAxis(container, svg) {
|
|
|
2057
2071
|
for (let i2 = 0; i2 < ticks.length; i2++) {
|
|
2058
2072
|
const t = ticks[i2];
|
|
2059
2073
|
if (t.closest("svg") !== svg) continue;
|
|
2060
|
-
const
|
|
2061
|
-
if (!
|
|
2062
|
-
const list = byAxis.get(
|
|
2074
|
+
const p2 = t.parentElement;
|
|
2075
|
+
if (!p2) continue;
|
|
2076
|
+
const list = byAxis.get(p2);
|
|
2063
2077
|
if (list) list.push(t);
|
|
2064
|
-
else byAxis.set(
|
|
2078
|
+
else byAxis.set(p2, [t]);
|
|
2065
2079
|
}
|
|
2066
2080
|
const axes = [];
|
|
2067
2081
|
const cands = [];
|
|
@@ -2102,9 +2116,9 @@ function pinScrolledAxis(container, svg) {
|
|
|
2102
2116
|
if (r.top >= band.top && r.bottom <= band.bottom) carried.push(t);
|
|
2103
2117
|
}
|
|
2104
2118
|
const pinSvg = doc.createElementNS(SVG_NS2, "svg");
|
|
2105
|
-
for (const
|
|
2106
|
-
const v3 = svg.getAttribute(
|
|
2107
|
-
if (v3) pinSvg.setAttribute(
|
|
2119
|
+
for (const a4 of ["font-family", "font-size", "font-weight", "font", "fill", "color", "text-rendering"]) {
|
|
2120
|
+
const v3 = svg.getAttribute(a4);
|
|
2121
|
+
if (v3) pinSvg.setAttribute(a4, v3);
|
|
2108
2122
|
}
|
|
2109
2123
|
const styles = svg.querySelectorAll("style");
|
|
2110
2124
|
for (let i2 = 0; i2 < styles.length; i2++) pinSvg.appendChild(styles[i2].cloneNode(true));
|
|
@@ -2128,17 +2142,17 @@ function pinScrolledAxis(container, svg) {
|
|
|
2128
2142
|
for (const t of carried) cloneWithChain(t, svg, pinSvg);
|
|
2129
2143
|
const overlay = doc.createElement("div");
|
|
2130
2144
|
overlay.setAttribute("data-bic-axis-pin", "1");
|
|
2131
|
-
const
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2145
|
+
const o = overlay.style;
|
|
2146
|
+
o.position = "absolute";
|
|
2147
|
+
o.margin = "0";
|
|
2148
|
+
o.padding = "0";
|
|
2149
|
+
o.border = "0";
|
|
2150
|
+
o.width = `${svgBox.width}px`;
|
|
2151
|
+
o.height = `${bandPx}px`;
|
|
2152
|
+
o.overflow = "hidden";
|
|
2153
|
+
o.pointerEvents = "none";
|
|
2154
|
+
o.zIndex = "3";
|
|
2155
|
+
o.display = "none";
|
|
2142
2156
|
overlay.appendChild(pinSvg);
|
|
2143
2157
|
try {
|
|
2144
2158
|
const cs = view.getComputedStyle(container);
|
|
@@ -2155,12 +2169,12 @@ function pinScrolledAxis(container, svg) {
|
|
|
2155
2169
|
const st = container.scrollTop, vh = container.clientHeight;
|
|
2156
2170
|
const edge2 = axisPinPlacement(contentBand, st, vh);
|
|
2157
2171
|
if (!edge2) {
|
|
2158
|
-
|
|
2172
|
+
o.display = "none";
|
|
2159
2173
|
return null;
|
|
2160
2174
|
}
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2175
|
+
o.display = "block";
|
|
2176
|
+
o.left = `${svgLeft}px`;
|
|
2177
|
+
o.top = `${edge2 === "top" ? st : st + vh - bandPx}px`;
|
|
2164
2178
|
return edge2;
|
|
2165
2179
|
};
|
|
2166
2180
|
const onScroll = () => {
|
|
@@ -2280,12 +2294,12 @@ function fitRenderedChart(container, opts = {}) {
|
|
|
2280
2294
|
}
|
|
2281
2295
|
|
|
2282
2296
|
// src/labelContrast.ts
|
|
2283
|
-
function parseRGBA(
|
|
2284
|
-
if (typeof
|
|
2285
|
-
const
|
|
2286
|
-
const m =
|
|
2297
|
+
function parseRGBA(c2) {
|
|
2298
|
+
if (typeof c2 !== "string") return null;
|
|
2299
|
+
const s2 = c2.trim();
|
|
2300
|
+
const m = s2.match(/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*(?:,\s*([\d.]+)\s*)?\)$/i);
|
|
2287
2301
|
if (m) return [parseFloat(m[1]), parseFloat(m[2]), parseFloat(m[3]), m[4] !== void 0 ? parseFloat(m[4]) : 1];
|
|
2288
|
-
let h2 =
|
|
2302
|
+
let h2 = s2.replace(/^#/, "");
|
|
2289
2303
|
if (h2.length === 3) h2 = h2.split("").map((ch) => ch + ch).join("");
|
|
2290
2304
|
if (h2.length === 6 && /^[0-9a-fA-F]{6}$/.test(h2)) {
|
|
2291
2305
|
return [parseInt(h2.slice(0, 2), 16), parseInt(h2.slice(2, 4), 16), parseInt(h2.slice(4, 6), 16), 1];
|
|
@@ -2299,8 +2313,8 @@ var WHITE_TEXT_BG_LUM = 0.5;
|
|
|
2299
2313
|
var PILL_MIN_ALPHA = 0.05;
|
|
2300
2314
|
var PILL_OPAQUE_ALPHA = 0.85;
|
|
2301
2315
|
var PAGE_MATCH_TOLERANCE = 2;
|
|
2302
|
-
function isPillBackdropAlpha(
|
|
2303
|
-
return
|
|
2316
|
+
function isPillBackdropAlpha(a4) {
|
|
2317
|
+
return a4 >= PILL_MIN_ALPHA && a4 < PILL_OPAQUE_ALPHA;
|
|
2304
2318
|
}
|
|
2305
2319
|
var PILL_MIN_COVERAGE = 0.6;
|
|
2306
2320
|
function pillBacksGlyph(overlapArea, glyphArea) {
|
|
@@ -2321,24 +2335,24 @@ var NAMED = {
|
|
|
2321
2335
|
none: [0, 0, 0, 0],
|
|
2322
2336
|
transparent: [0, 0, 0, 0]
|
|
2323
2337
|
};
|
|
2324
|
-
function toRGBA(
|
|
2325
|
-
if (typeof
|
|
2326
|
-
const k2 =
|
|
2338
|
+
function toRGBA(c2) {
|
|
2339
|
+
if (typeof c2 !== "string") return null;
|
|
2340
|
+
const k2 = c2.trim().toLowerCase();
|
|
2327
2341
|
if (k2 in NAMED) return NAMED[k2];
|
|
2328
|
-
return parseRGBA(
|
|
2342
|
+
return parseRGBA(c2);
|
|
2329
2343
|
}
|
|
2330
2344
|
function compositeOver(fg, bg) {
|
|
2331
|
-
const
|
|
2345
|
+
const a4 = Math.max(0, Math.min(1, fg[3]));
|
|
2332
2346
|
return [
|
|
2333
|
-
Math.round(fg[0] *
|
|
2334
|
-
Math.round(fg[1] *
|
|
2335
|
-
Math.round(fg[2] *
|
|
2347
|
+
Math.round(fg[0] * a4 + bg[0] * (1 - a4)),
|
|
2348
|
+
Math.round(fg[1] * a4 + bg[1] * (1 - a4)),
|
|
2349
|
+
Math.round(fg[2] * a4 + bg[2] * (1 - a4))
|
|
2336
2350
|
];
|
|
2337
2351
|
}
|
|
2338
2352
|
function relativeLuminance(rgb) {
|
|
2339
2353
|
const lin = rgb.map((v3) => {
|
|
2340
|
-
const
|
|
2341
|
-
return
|
|
2354
|
+
const s2 = v3 / 255;
|
|
2355
|
+
return s2 <= 0.03928 ? s2 / 12.92 : Math.pow((s2 + 0.055) / 1.055, 2.4);
|
|
2342
2356
|
});
|
|
2343
2357
|
return 0.2126 * lin[0] + 0.7152 * lin[1] + 0.0722 * lin[2];
|
|
2344
2358
|
}
|
|
@@ -2390,8 +2404,8 @@ function clamp01(v3) {
|
|
|
2390
2404
|
return Math.max(0, Math.min(1, v3));
|
|
2391
2405
|
}
|
|
2392
2406
|
function hexToRGB(hex) {
|
|
2393
|
-
const
|
|
2394
|
-
return [
|
|
2407
|
+
const p2 = toRGBA(hex);
|
|
2408
|
+
return [p2[0], p2[1], p2[2]];
|
|
2395
2409
|
}
|
|
2396
2410
|
|
|
2397
2411
|
// src/labelContrastDom.ts
|
|
@@ -2409,10 +2423,10 @@ function backedSamples(el, pts) {
|
|
|
2409
2423
|
const inv = m.inverse();
|
|
2410
2424
|
const hit = [];
|
|
2411
2425
|
for (let i2 = 0; i2 < pts.length; i2++) {
|
|
2412
|
-
const
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
hit.push(ge2.isPointInFill(
|
|
2426
|
+
const p2 = svg.createSVGPoint();
|
|
2427
|
+
p2.x = pts[i2].x;
|
|
2428
|
+
p2.y = pts[i2].y;
|
|
2429
|
+
hit.push(ge2.isPointInFill(p2.matrixTransform(inv)));
|
|
2416
2430
|
}
|
|
2417
2431
|
return hit;
|
|
2418
2432
|
} catch {
|
|
@@ -2463,8 +2477,8 @@ function applyLabelContrast(container, opts = {}) {
|
|
|
2463
2477
|
const pageRGBA = toRGBA(pageBg) || [255, 255, 255, 1];
|
|
2464
2478
|
const pageRGB = [pageRGBA[0], pageRGBA[1], pageRGBA[2]];
|
|
2465
2479
|
const effAlpha = (mk) => {
|
|
2466
|
-
const
|
|
2467
|
-
return (
|
|
2480
|
+
const c2 = toRGBA(mk.fill);
|
|
2481
|
+
return (c2 ? c2[3] : 1) * mk.op;
|
|
2468
2482
|
};
|
|
2469
2483
|
const texts = container.querySelectorAll("text");
|
|
2470
2484
|
if (texts.length > CAP) {
|
|
@@ -2510,7 +2524,7 @@ function applyLabelContrast(container, opts = {}) {
|
|
|
2510
2524
|
}
|
|
2511
2525
|
report.scanned++;
|
|
2512
2526
|
const opaqueUnder = under.filter((x2) => effAlpha(x2.mk) >= PILL_OPAQUE_ALPHA);
|
|
2513
|
-
const cellEntry = (opaqueUnder.length ? opaqueUnder : under).reduce((
|
|
2527
|
+
const cellEntry = (opaqueUnder.length ? opaqueUnder : under).reduce((a4, b2) => b2.ov > a4.ov || b2.ov === a4.ov && b2.mk.ord > a4.mk.ord ? b2 : a4);
|
|
2514
2528
|
const cell = cellEntry.mk;
|
|
2515
2529
|
const pill = under.find((x2) => x2.mk !== cell && isPillBackdropAlpha(effAlpha(x2.mk)) && x2.mk.ord > cell.ord && pillBacksGlyph(x2.ov, glyphArea))?.mk;
|
|
2516
2530
|
const cellRGBA = toRGBA(cell.fill);
|
|
@@ -2558,7 +2572,7 @@ function noopViewStateProvider() {
|
|
|
2558
2572
|
return { load: () => ({}), save: () => {
|
|
2559
2573
|
} };
|
|
2560
2574
|
}
|
|
2561
|
-
var parseRowIdxs = (
|
|
2575
|
+
var parseRowIdxs = (s2) => (s2 || "").split(",").map((x2) => parseInt(x2, 10)).filter((n) => Number.isFinite(n));
|
|
2562
2576
|
var D3_PLUGIN_PACKAGES = {
|
|
2563
2577
|
sankey: "d3-sankey",
|
|
2564
2578
|
sankeyLinkHorizontal: "d3-sankey",
|
|
@@ -2651,10 +2665,10 @@ function createChartHost(container, config) {
|
|
|
2651
2665
|
if (raw.uiState && typeof raw.uiState === "object" && Object.keys(bag).length === 0)
|
|
2652
2666
|
Object.assign(bag, raw.uiState);
|
|
2653
2667
|
raw.uiState = bag;
|
|
2654
|
-
raw.setUiState = (
|
|
2655
|
-
if (!
|
|
2668
|
+
raw.setUiState = (s2) => {
|
|
2669
|
+
if (!s2 || typeof s2 !== "object") return;
|
|
2656
2670
|
try {
|
|
2657
|
-
provider.save(
|
|
2671
|
+
provider.save(s2);
|
|
2658
2672
|
} catch {
|
|
2659
2673
|
}
|
|
2660
2674
|
};
|
|
@@ -2804,10 +2818,10 @@ function createChartHost(container, config) {
|
|
|
2804
2818
|
const fitOpts = config.fit ?? true;
|
|
2805
2819
|
const labelContrastOpts = config.labelContrast ?? true;
|
|
2806
2820
|
const stopAnim = () => {
|
|
2807
|
-
const
|
|
2808
|
-
if (typeof
|
|
2821
|
+
const s2 = container[CONTAINER_SLOT_ANIM_STOP];
|
|
2822
|
+
if (typeof s2 === "function") {
|
|
2809
2823
|
try {
|
|
2810
|
-
|
|
2824
|
+
s2();
|
|
2811
2825
|
} catch {
|
|
2812
2826
|
}
|
|
2813
2827
|
}
|
|
@@ -2822,8 +2836,8 @@ function createChartHost(container, config) {
|
|
|
2822
2836
|
renderFn = compileRenderFn(config.code, win, doc, d3);
|
|
2823
2837
|
}
|
|
2824
2838
|
if (resolved.geo === void 0 && config.geoKind) {
|
|
2825
|
-
const
|
|
2826
|
-
if (
|
|
2839
|
+
const g3 = config.geoProvider?.(config.geoKind) ?? geoFromCache(config.geoKind);
|
|
2840
|
+
if (g3) resolved = { ...resolved, geo: g3 };
|
|
2827
2841
|
else if (!warnedGeo) {
|
|
2828
2842
|
warnedGeo = true;
|
|
2829
2843
|
try {
|
|
@@ -2909,10 +2923,10 @@ function createChartHost(container, config) {
|
|
|
2909
2923
|
return () => subs.delete(cb);
|
|
2910
2924
|
},
|
|
2911
2925
|
clear() {
|
|
2912
|
-
const
|
|
2913
|
-
if (typeof
|
|
2926
|
+
const s2 = container[CONTAINER_SLOT_XF_CLEAR];
|
|
2927
|
+
if (typeof s2 === "function") {
|
|
2914
2928
|
try {
|
|
2915
|
-
|
|
2929
|
+
s2();
|
|
2916
2930
|
} catch {
|
|
2917
2931
|
}
|
|
2918
2932
|
}
|
|
@@ -2987,10 +3001,12 @@ export {
|
|
|
2987
3001
|
registerGeoAsset,
|
|
2988
3002
|
clearGeoCache,
|
|
2989
3003
|
L3,
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
3004
|
+
p,
|
|
3005
|
+
u2 as u,
|
|
3006
|
+
vt,
|
|
3007
|
+
It2 as It,
|
|
2993
3008
|
Me,
|
|
3009
|
+
Te,
|
|
2994
3010
|
buildRenderPayload,
|
|
2995
3011
|
createMarkResolver,
|
|
2996
3012
|
ensureCrossfilterHitTargets,
|