@bicharts/chart-host 0.5.65 → 0.5.67
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-GHODWOAL.mjs +35 -0
- package/dist/{chunk-YDFJF2UG.mjs → chunk-ZEEMF4A4.mjs} +676 -228
- package/dist/geo-us-states.mjs +1 -0
- package/dist/geo-us-zip3.mjs +1 -0
- package/dist/geo-world.mjs +1 -0
- package/dist/geo.mjs +1 -0
- package/dist/{geoUsStates.generated-RDB4Y3WQ.mjs → geoUsStates.generated-JEFM6OHO.mjs} +1 -0
- package/dist/{geoUsZip3.generated-HUXUVEQG.mjs → geoUsZip3.generated-VSWL7D6F.mjs} +1 -0
- package/dist/{geoWorld110m.generated-F2NDEZYL.mjs → geoWorld110m.generated-TD2TA7S7.mjs} +1 -0
- package/dist/index.mjs +10 -9
- package/dist/react.mjs +2 -1
- package/package.json +1 -1
|
@@ -4,6 +4,435 @@ import {
|
|
|
4
4
|
NA_LAT_MAX,
|
|
5
5
|
clipFeatureToLat
|
|
6
6
|
} from "./chunk-A2GMXZP7.mjs";
|
|
7
|
+
import {
|
|
8
|
+
__commonJS,
|
|
9
|
+
__toESM
|
|
10
|
+
} from "./chunk-GHODWOAL.mjs";
|
|
11
|
+
|
|
12
|
+
// ../../node_modules/papaparse/papaparse.min.js
|
|
13
|
+
var require_papaparse_min = __commonJS({
|
|
14
|
+
"../../node_modules/papaparse/papaparse.min.js"(exports, module) {
|
|
15
|
+
/* @license
|
|
16
|
+
Papa Parse
|
|
17
|
+
v5.5.4
|
|
18
|
+
https://github.com/mholt/PapaParse
|
|
19
|
+
License: MIT
|
|
20
|
+
*/
|
|
21
|
+
((e, t) => {
|
|
22
|
+
"function" == typeof define && define.amd ? define([], t) : "object" == typeof module && "undefined" != typeof exports ? module.exports = t() : e.Papa = t();
|
|
23
|
+
})(exports, function r() {
|
|
24
|
+
var n = "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0 !== n ? n : {};
|
|
25
|
+
var d, s = !n.document && !!n.postMessage, a2 = n.IS_PAPA_WORKER || false, o = {}, h2 = 0, v2 = {};
|
|
26
|
+
function P2(e) {
|
|
27
|
+
return 65279 === e.charCodeAt(0) ? e.slice(1) : e;
|
|
28
|
+
}
|
|
29
|
+
function u2(e) {
|
|
30
|
+
this._handle = null, this._finished = false, this._completed = false, this._halted = false, this._input = null, this._baseIndex = 0, this._partialLine = "", this._rowCount = 0, this._start = 0, this._nextChunk = null, this.isFirstChunk = true, this._completeResults = { data: [], errors: [], meta: {} }, function(e2) {
|
|
31
|
+
var t = b2(e2);
|
|
32
|
+
t.chunkSize = parseInt(t.chunkSize), e2.step || e2.chunk || (t.chunkSize = null);
|
|
33
|
+
this._handle = new i(t), (this._handle.streamer = this)._config = t;
|
|
34
|
+
}.call(this, e), this.parseChunk = function(t, e2) {
|
|
35
|
+
var i2 = parseInt(this._config.skipFirstNLines) || 0;
|
|
36
|
+
if (this.isFirstChunk && 0 < i2) {
|
|
37
|
+
let e4 = this._config.newline;
|
|
38
|
+
e4 || (r2 = this._config.quoteChar || '"', e4 = this._handle.guessLineEndings(t, r2)), t = [...t.split(e4).slice(i2)].join(e4);
|
|
39
|
+
}
|
|
40
|
+
this.isFirstChunk && q3(this._config.beforeFirstChunk) && void 0 !== (r2 = this._config.beforeFirstChunk(t)) && (t = r2), this.isFirstChunk = false, this._halted = false;
|
|
41
|
+
var i2 = this._partialLine + t, r2 = (this._partialLine = "", this._handle.parse(i2, this._baseIndex, !this._finished));
|
|
42
|
+
if (!this._handle.paused() && !this._handle.aborted()) {
|
|
43
|
+
t = r2.meta.cursor, i2 = (this._finished || (this._partialLine = i2.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 (a2) n.postMessage({ results: r2, workerId: v2.WORKER_ID, finished: i2 });
|
|
45
|
+
else if (q3(this._config.chunk) && !e2) {
|
|
46
|
+
if (this._config.chunk(r2, this._handle), this._handle.paused() || this._handle.aborted()) return void (this._halted = true);
|
|
47
|
+
this._completeResults = r2 = void 0;
|
|
48
|
+
}
|
|
49
|
+
return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(r2.data), this._completeResults.errors = this._completeResults.errors.concat(r2.errors), this._completeResults.meta = r2.meta), this._completed || !i2 || !q3(this._config.complete) || r2 && r2.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = true), i2 || r2 && r2.meta.paused || this._nextChunk(), r2;
|
|
50
|
+
}
|
|
51
|
+
this._halted = true;
|
|
52
|
+
}, this._sendError = function(e2) {
|
|
53
|
+
q3(this._config.error) ? this._config.error(e2) : a2 && this._config.error && n.postMessage({ workerId: v2.WORKER_ID, error: e2, finished: false });
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function f(e) {
|
|
57
|
+
var r2;
|
|
58
|
+
(e = e || {}).chunkSize || (e.chunkSize = v2.RemoteChunkSize), u2.call(this, e), this._nextChunk = s ? function() {
|
|
59
|
+
this._readChunk(), this._chunkLoaded();
|
|
60
|
+
} : function() {
|
|
61
|
+
this._readChunk();
|
|
62
|
+
}, this.stream = function(e2) {
|
|
63
|
+
this._input = e2, this._nextChunk();
|
|
64
|
+
}, this._readChunk = function() {
|
|
65
|
+
if (this._finished) this._chunkLoaded();
|
|
66
|
+
else {
|
|
67
|
+
if (r2 = new XMLHttpRequest(), this._config.withCredentials && (r2.withCredentials = this._config.withCredentials), s || (r2.onload = y2(this._chunkLoaded, this), r2.onerror = y2(this._chunkError, this)), r2.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !s), this._config.downloadRequestHeaders) {
|
|
68
|
+
var e2, t = this._config.downloadRequestHeaders;
|
|
69
|
+
for (e2 in t) r2.setRequestHeader(e2, t[e2]);
|
|
70
|
+
}
|
|
71
|
+
var i2;
|
|
72
|
+
this._config.chunkSize && (i2 = this._start + this._config.chunkSize - 1, r2.setRequestHeader("Range", "bytes=" + this._start + "-" + i2));
|
|
73
|
+
try {
|
|
74
|
+
r2.send(this._config.downloadRequestBody);
|
|
75
|
+
} catch (e4) {
|
|
76
|
+
this._chunkError(e4.message);
|
|
77
|
+
}
|
|
78
|
+
s && 0 === r2.status && this._chunkError();
|
|
79
|
+
}
|
|
80
|
+
}, this._chunkLoaded = function() {
|
|
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)));
|
|
82
|
+
}, this._chunkError = function(e2) {
|
|
83
|
+
e2 = r2.statusText || e2;
|
|
84
|
+
this._sendError(new Error(e2));
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function l(e) {
|
|
88
|
+
(e = e || {}).chunkSize || (e.chunkSize = v2.LocalChunkSize), u2.call(this, e);
|
|
89
|
+
var i2, r2, n2 = "undefined" != typeof FileReader;
|
|
90
|
+
this.stream = function(e2) {
|
|
91
|
+
this._input = e2, r2 = e2.slice || e2.webkitSlice || e2.mozSlice, n2 ? ((i2 = new FileReader()).onload = y2(this._chunkLoaded, this), i2.onerror = y2(this._chunkError, this)) : i2 = new FileReaderSync(), this._nextChunk();
|
|
92
|
+
}, this._nextChunk = function() {
|
|
93
|
+
this._finished || this._config.preview && !(this._rowCount < this._config.preview) || this._readChunk();
|
|
94
|
+
}, this._readChunk = function() {
|
|
95
|
+
var e2 = this._input, t = (this._config.chunkSize && (t = Math.min(this._start + this._config.chunkSize, this._input.size), e2 = r2.call(e2, this._start, t)), i2.readAsText(e2, this._config.encoding));
|
|
96
|
+
n2 || this._chunkLoaded({ target: { result: t } });
|
|
97
|
+
}, this._chunkLoaded = function(e2) {
|
|
98
|
+
this._start += this._config.chunkSize, this._finished = !this._config.chunkSize || this._start >= this._input.size, this.parseChunk(e2.target.result);
|
|
99
|
+
}, this._chunkError = function() {
|
|
100
|
+
this._sendError(i2.error);
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function c(e) {
|
|
104
|
+
var i2;
|
|
105
|
+
u2.call(this, e = e || {}), this.stream = function(e2) {
|
|
106
|
+
return i2 = e2, this._nextChunk();
|
|
107
|
+
}, this._nextChunk = function() {
|
|
108
|
+
var e2, t;
|
|
109
|
+
if (!this._finished) return e2 = this._config.chunkSize, i2 = e2 ? (t = i2.substring(0, e2), i2.substring(e2)) : (t = i2, ""), this._finished = !i2, this.parseChunk(t);
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function p2(e) {
|
|
113
|
+
u2.call(this, e = e || {});
|
|
114
|
+
var t = [], i2 = true, r2 = false;
|
|
115
|
+
this.pause = function() {
|
|
116
|
+
u2.prototype.pause.apply(this, arguments), this._input.pause();
|
|
117
|
+
}, this.resume = function() {
|
|
118
|
+
u2.prototype.resume.apply(this, arguments), this._input.resume();
|
|
119
|
+
}, this.stream = function(e2) {
|
|
120
|
+
this._input = e2, this._input.on("data", this._streamData), this._input.on("end", this._streamEnd), this._input.on("error", this._streamError);
|
|
121
|
+
}, this._checkIsFinished = function() {
|
|
122
|
+
r2 && 1 === t.length && (this._finished = true);
|
|
123
|
+
}, this._nextChunk = function() {
|
|
124
|
+
this._checkIsFinished(), t.length ? this.parseChunk(t.shift()) : i2 = true;
|
|
125
|
+
}, this._streamData = y2(function(e2) {
|
|
126
|
+
try {
|
|
127
|
+
t.push("string" == typeof e2 ? e2 : e2.toString(this._config.encoding)), i2 && (i2 = false, this._checkIsFinished(), this.parseChunk(t.shift()));
|
|
128
|
+
} catch (e4) {
|
|
129
|
+
this._streamError(e4);
|
|
130
|
+
}
|
|
131
|
+
}, this), this._streamError = y2(function(e2) {
|
|
132
|
+
this._streamCleanUp(), this._sendError(e2);
|
|
133
|
+
}, this), this._streamEnd = y2(function() {
|
|
134
|
+
this._streamCleanUp(), r2 = true, this._streamData("");
|
|
135
|
+
}, this), this._streamCleanUp = y2(function() {
|
|
136
|
+
this._input.removeListener("data", this._streamData), this._input.removeListener("end", this._streamEnd), this._input.removeListener("error", this._streamError);
|
|
137
|
+
}, this);
|
|
138
|
+
}
|
|
139
|
+
function i(m4) {
|
|
140
|
+
var n2, s2, a4, t, o2 = Math.pow(2, 53), h3 = -o2, u4 = /^\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)))$/, i2 = this, r2 = 0, f2 = 0, l2 = false, e = false, c2 = [], p4 = { data: [], errors: [], meta: {} };
|
|
141
|
+
function y4(e2) {
|
|
142
|
+
return "greedy" === m4.skipEmptyLines ? "" === e2.join("").trim() : 1 === e2.length && 0 === e2[0].length;
|
|
143
|
+
}
|
|
144
|
+
function g2() {
|
|
145
|
+
if (p4 && a4 && (k2("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + v2.DefaultDelimiter + "'"), a4 = false), m4.skipEmptyLines && (p4.data = p4.data.filter(function(e4) {
|
|
146
|
+
return !y4(e4);
|
|
147
|
+
})), _3()) {
|
|
148
|
+
let t4 = function(e4, t5) {
|
|
149
|
+
e4 = P2(e4), q3(m4.transformHeader) && (e4 = m4.transformHeader(e4, t5)), c2.push(e4);
|
|
150
|
+
};
|
|
151
|
+
var t2 = t4;
|
|
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
|
+
}
|
|
157
|
+
function i4(e4, t4) {
|
|
158
|
+
for (var i5 = m4.header ? {} : [], r5 = 0; r5 < e4.length; r5++) {
|
|
159
|
+
var n4 = r5, s4 = e4[r5], s4 = ((e5, t5) => ((e6) => (m4.dynamicTypingFunction && void 0 === m4.dynamicTyping[e6] && (m4.dynamicTyping[e6] = m4.dynamicTypingFunction(e6)), true === (m4.dynamicTyping[e6] || m4.dynamicTyping)))(e5) ? "true" === t5 || "TRUE" === t5 || "false" !== t5 && "FALSE" !== t5 && (((e6) => {
|
|
160
|
+
if (u4.test(e6)) {
|
|
161
|
+
e6 = parseFloat(e6);
|
|
162
|
+
if (h3 < e6 && e6 < o2) return 1;
|
|
163
|
+
}
|
|
164
|
+
})(t5) ? parseFloat(t5) : d2.test(t5) ? new Date(t5) : "" === t5 ? null : t5) : t5)(n4 = m4.header ? r5 >= c2.length ? "__parsed_extra" : c2[r5] : n4, s4 = m4.transform ? m4.transform(s4, n4) : s4);
|
|
165
|
+
"__parsed_extra" === n4 ? (i5[n4] = i5[n4] || [], i5[n4].push(s4)) : i5[n4] = s4;
|
|
166
|
+
}
|
|
167
|
+
return m4.header && (r5 > c2.length ? k2("FieldMismatch", "TooManyFields", "Too many fields: expected " + c2.length + " fields but parsed " + r5, f2 + t4) : r5 < c2.length && k2("FieldMismatch", "TooFewFields", "Too few fields: expected " + c2.length + " fields but parsed " + r5, f2 + t4)), i5;
|
|
168
|
+
}
|
|
169
|
+
var r4;
|
|
170
|
+
p4 && (m4.header || m4.dynamicTyping || m4.transform) && (r4 = 1, !p4.data.length || Array.isArray(p4.data[0]) ? (p4.data = p4.data.map(i4), r4 = p4.data.length) : p4.data = i4(p4.data, 0), m4.header && p4.meta && (p4.meta.fields = c2), f2 += r4);
|
|
171
|
+
}
|
|
172
|
+
function _3() {
|
|
173
|
+
return m4.header && 0 === c2.length;
|
|
174
|
+
}
|
|
175
|
+
function k2(e2, t2, i4, r4) {
|
|
176
|
+
e2 = { type: e2, code: t2, message: i4 };
|
|
177
|
+
void 0 !== r4 && (e2.row = r4), p4.errors.push(e2);
|
|
178
|
+
}
|
|
179
|
+
q3(m4.step) && (t = m4.step, m4.step = function(e2) {
|
|
180
|
+
p4 = e2, _3() ? g2() : (g2(), 0 !== p4.data.length && (r2 += e2.data.length, m4.preview && r2 > m4.preview ? s2.abort() : (p4.data = p4.data[0], t(p4, i2))));
|
|
181
|
+
}), this.parse = function(e2, t2, i4) {
|
|
182
|
+
var r4 = m4.quoteChar || '"', r4 = (m4.newline || (m4.newline = this.guessLineEndings(e2, r4)), a4 = false, m4.delimiter ? q3(m4.delimiter) && (m4.delimiter = m4.delimiter(e2), p4.meta.delimiter = m4.delimiter) : ((r4 = ((e4, t4, i5, r5, n4) => {
|
|
183
|
+
var s4, a5, o4, h4;
|
|
184
|
+
n4 = n4 || [",", " ", "|", ";", v2.RECORD_SEP, v2.UNIT_SEP];
|
|
185
|
+
for (var u5 = 0; u5 < n4.length; u5++) {
|
|
186
|
+
for (var d3, f4 = n4[u5], l3 = 0, c4 = 0, p5 = 0, g3 = (o4 = void 0, new E4({ comments: r5, delimiter: f4, newline: t4, preview: 10 }).parse(e4)), _4 = 0; _4 < g3.data.length; _4++) i5 && y4(g3.data[_4]) ? p5++ : (d3 = g3.data[_4].length, c4 += d3, void 0 === o4 ? o4 = d3 : 0 < d3 && (l3 += Math.abs(d3 - o4), o4 = d3));
|
|
187
|
+
0 < g3.data.length && (c4 /= g3.data.length - p5), (void 0 === a5 || l3 <= a5) && (void 0 === h4 || h4 < c4) && 1.99 < c4 && (a5 = l3, s4 = f4, h4 = c4);
|
|
188
|
+
}
|
|
189
|
+
return { successful: !!(m4.delimiter = s4), bestDelimiter: s4 };
|
|
190
|
+
})(e2, m4.newline, m4.skipEmptyLines, m4.comments, m4.delimitersToGuess)).successful ? m4.delimiter = r4.bestDelimiter : (a4 = true, m4.delimiter = v2.DefaultDelimiter), p4.meta.delimiter = m4.delimiter), b2(m4));
|
|
191
|
+
return m4.preview && m4.header && r4.preview++, n2 = e2, s2 = new E4(r4), p4 = s2.parse(n2, t2, i4), g2(), l2 ? { meta: { paused: true } } : p4 || { meta: { paused: false } };
|
|
192
|
+
}, this.paused = function() {
|
|
193
|
+
return l2;
|
|
194
|
+
}, this.pause = function() {
|
|
195
|
+
l2 = true, s2.abort(), n2 = q3(m4.chunk) ? "" : n2.substring(s2.getCharIndex());
|
|
196
|
+
}, this.resume = function() {
|
|
197
|
+
i2.streamer._halted ? (l2 = false, i2.streamer.parseChunk(n2, true)) : setTimeout(i2.resume, 3);
|
|
198
|
+
}, this.aborted = function() {
|
|
199
|
+
return e;
|
|
200
|
+
}, this.abort = function() {
|
|
201
|
+
e = true, s2.abort(), p4.meta.aborted = true, q3(m4.complete) && m4.complete(p4), n2 = "";
|
|
202
|
+
}, this.guessLineEndings = function(e2, t2) {
|
|
203
|
+
e2 = e2.substring(0, 1048576);
|
|
204
|
+
var t2 = new RegExp(U3(t2) + "([^]*?)" + U3(t2), "gm"), i4 = (e2 = e2.replace(t2, "")).split("\r"), t2 = e2.split("\n"), e2 = 1 < t2.length && t2[0].length < i4[0].length;
|
|
205
|
+
if (1 === i4.length || e2) return "\n";
|
|
206
|
+
for (var r4 = 0, n4 = 0; n4 < i4.length; n4++) "\n" === i4[n4][0] && r4++;
|
|
207
|
+
return r4 >= i4.length / 2 ? "\r\n" : "\r";
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function U3(e) {
|
|
211
|
+
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
212
|
+
}
|
|
213
|
+
function E4(C2) {
|
|
214
|
+
var S = (C2 = C2 || {}).delimiter, O2 = C2.newline, x2 = C2.comments, I2 = C2.step, A2 = C2.preview, T2 = C2.fastMode, D3 = null, L2 = false, F3 = null == C2.quoteChar ? '"' : C2.quoteChar, j2 = F3;
|
|
215
|
+
if (void 0 !== C2.escapeChar && (j2 = C2.escapeChar), ("string" != typeof S || -1 < v2.BAD_DELIMITERS.indexOf(S)) && (S = ","), x2 === S) throw new Error("Comment character same as delimiter");
|
|
216
|
+
true === x2 ? x2 = "#" : ("string" != typeof x2 || -1 < v2.BAD_DELIMITERS.indexOf(x2)) && (x2 = false), "\n" !== O2 && "\r" !== O2 && "\r\n" !== O2 && (O2 = "\n");
|
|
217
|
+
var z3 = 0, M2 = false;
|
|
218
|
+
this.parse = function(i2, t, r2) {
|
|
219
|
+
if ("string" != typeof i2) throw new Error("Input must be a string");
|
|
220
|
+
var n2 = i2.length, e = S.length, s2 = O2.length, a4 = x2.length, o2 = q3(I2), h3 = [], u4 = [], d2 = [], f2 = z3 = 0;
|
|
221
|
+
if (!i2) return w();
|
|
222
|
+
if (T2 || false !== T2 && -1 === i2.indexOf(F3)) {
|
|
223
|
+
for (var l2 = i2.split(O2), c2 = 0; c2 < l2.length; c2++) {
|
|
224
|
+
if (d2 = l2[c2], z3 += d2.length, c2 !== l2.length - 1) z3 += O2.length;
|
|
225
|
+
else if (r2) return w();
|
|
226
|
+
if (!x2 || d2.substring(0, a4) !== x2) {
|
|
227
|
+
if (o2) {
|
|
228
|
+
if (h3 = [], k2(d2.split(S)), R(), M2) return w();
|
|
229
|
+
} else k2(d2.split(S));
|
|
230
|
+
if (A2 && A2 <= c2) return h3 = h3.slice(0, A2), w(true);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
return w();
|
|
234
|
+
}
|
|
235
|
+
for (var p4 = i2.indexOf(S, z3), g2 = i2.indexOf(O2, z3), _3 = new RegExp(U3(j2) + U3(F3), "g"), m4 = i2.indexOf(F3, z3); ; ) if (i2[z3] === F3) for (m4 = z3, z3++; ; ) {
|
|
236
|
+
if (-1 === (m4 = i2.indexOf(F3, m4 + 1))) return r2 || u4.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: h3.length, index: z3 }), E5();
|
|
237
|
+
if (m4 === n2 - 1) return E5(i2.substring(z3, m4).replace(_3, F3));
|
|
238
|
+
if (F3 === j2 && i2[m4 + 1] === j2) m4++;
|
|
239
|
+
else if (F3 === j2 || 0 === m4 || i2[m4 - 1] !== j2) {
|
|
240
|
+
-1 !== p4 && p4 < m4 + 1 && (p4 = i2.indexOf(S, m4 + 1));
|
|
241
|
+
var y4 = v3(-1 === (g2 = -1 !== g2 && g2 < m4 + 1 ? i2.indexOf(O2, m4 + 1) : g2) ? p4 : Math.min(p4, g2));
|
|
242
|
+
if (i2.substr(m4 + 1 + y4, e) === S) {
|
|
243
|
+
d2.push(i2.substring(z3, m4).replace(_3, F3)), i2[z3 = m4 + 1 + y4 + e] !== F3 && (m4 = i2.indexOf(F3, z3)), p4 = i2.indexOf(S, z3), g2 = i2.indexOf(O2, z3);
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
y4 = v3(g2);
|
|
247
|
+
if (i2.substring(m4 + 1 + y4, m4 + 1 + y4 + s2) === O2) {
|
|
248
|
+
if (d2.push(i2.substring(z3, m4).replace(_3, F3)), b4(m4 + 1 + y4 + s2), p4 = i2.indexOf(S, z3), m4 = i2.indexOf(F3, z3), o2 && (R(), M2)) return w();
|
|
249
|
+
if (A2 && h3.length >= A2) return w(true);
|
|
250
|
+
break;
|
|
251
|
+
}
|
|
252
|
+
u4.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: h3.length, index: z3 }), m4++;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
else if (x2 && 0 === d2.length && i2.substring(z3, z3 + a4) === x2) {
|
|
256
|
+
if (-1 === g2) return w();
|
|
257
|
+
z3 = g2 + s2, g2 = i2.indexOf(O2, z3), p4 = i2.indexOf(S, z3);
|
|
258
|
+
} else if (-1 !== p4 && (p4 < g2 || -1 === g2)) d2.push(i2.substring(z3, p4)), z3 = p4 + e, p4 = i2.indexOf(S, z3);
|
|
259
|
+
else {
|
|
260
|
+
if (-1 === g2) break;
|
|
261
|
+
if (d2.push(i2.substring(z3, g2)), b4(g2 + s2), o2 && (R(), M2)) return w();
|
|
262
|
+
if (A2 && h3.length >= A2) return w(true);
|
|
263
|
+
}
|
|
264
|
+
return E5();
|
|
265
|
+
function k2(e2) {
|
|
266
|
+
h3.push(e2), f2 = z3;
|
|
267
|
+
}
|
|
268
|
+
function v3(e2) {
|
|
269
|
+
var t2 = 0;
|
|
270
|
+
return t2 = -1 !== e2 && (e2 = i2.substring(m4 + 1, e2)) && "" === e2.trim() ? e2.length : t2;
|
|
271
|
+
}
|
|
272
|
+
function E5(e2) {
|
|
273
|
+
return r2 || (void 0 === e2 && (e2 = i2.substring(z3)), d2.push(e2), z3 = n2, k2(d2), o2 && R()), w();
|
|
274
|
+
}
|
|
275
|
+
function b4(e2) {
|
|
276
|
+
z3 = e2, k2(d2), d2 = [], g2 = i2.indexOf(O2, z3);
|
|
277
|
+
}
|
|
278
|
+
function w(e2) {
|
|
279
|
+
if (C2.header && !t && h3.length && !L2) {
|
|
280
|
+
var s4 = h3[0], a5 = /* @__PURE__ */ Object.create(null), o4 = new Set(s4);
|
|
281
|
+
let n4 = false;
|
|
282
|
+
for (let r4 = 0; r4 < s4.length; r4++) {
|
|
283
|
+
let i4 = P2(s4[r4]);
|
|
284
|
+
if (a5[i4 = q3(C2.transformHeader) ? C2.transformHeader(i4, r4) : i4]) {
|
|
285
|
+
let e4, t2 = a5[i4];
|
|
286
|
+
for (; e4 = i4 + "_" + t2, t2++, o4.has(e4); ) ;
|
|
287
|
+
o4.add(e4), s4[r4] = e4, a5[i4]++, n4 = true, (D3 = null === D3 ? {} : D3)[e4] = i4;
|
|
288
|
+
} else a5[i4] = 1, s4[r4] = i4;
|
|
289
|
+
o4.add(i4);
|
|
290
|
+
}
|
|
291
|
+
n4 && console.warn("Duplicate headers found and renamed."), L2 = true;
|
|
292
|
+
}
|
|
293
|
+
return { data: h3, errors: u4, meta: { delimiter: S, linebreak: O2, aborted: M2, truncated: !!e2, cursor: f2 + (t || 0), renamedHeaders: D3 } };
|
|
294
|
+
}
|
|
295
|
+
function R() {
|
|
296
|
+
I2(w()), h3 = [], u4 = [];
|
|
297
|
+
}
|
|
298
|
+
}, this.abort = function() {
|
|
299
|
+
M2 = true;
|
|
300
|
+
}, this.getCharIndex = function() {
|
|
301
|
+
return z3;
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
function g(e) {
|
|
305
|
+
var t = e.data, i2 = o[t.workerId], r2 = false;
|
|
306
|
+
if (t.error) i2.userError(t.error, t.file);
|
|
307
|
+
else if (t.results && t.results.data) {
|
|
308
|
+
var n2 = { abort: function() {
|
|
309
|
+
r2 = true, _2(t.workerId, { data: [], errors: [], meta: { aborted: true } });
|
|
310
|
+
}, pause: m2, resume: m2 };
|
|
311
|
+
if (q3(i2.userStep)) {
|
|
312
|
+
for (var s2 = 0; s2 < t.results.data.length && (i2.userStep({ data: t.results.data[s2], errors: t.results.errors, meta: t.results.meta }, n2), !r2); s2++) ;
|
|
313
|
+
delete t.results;
|
|
314
|
+
} else q3(i2.userChunk) && (i2.userChunk(t.results, n2, t.file), delete t.results);
|
|
315
|
+
}
|
|
316
|
+
t.finished && !r2 && _2(t.workerId, t.results);
|
|
317
|
+
}
|
|
318
|
+
function _2(e, t) {
|
|
319
|
+
var i2 = o[e];
|
|
320
|
+
q3(i2.userComplete) && i2.userComplete(t), i2.terminate(), delete o[e];
|
|
321
|
+
}
|
|
322
|
+
function m2() {
|
|
323
|
+
throw new Error("Not implemented.");
|
|
324
|
+
}
|
|
325
|
+
function b2(e) {
|
|
326
|
+
if ("object" != typeof e || null === e) return e;
|
|
327
|
+
var t, i2 = Array.isArray(e) ? [] : {};
|
|
328
|
+
for (t in e) i2[t] = b2(e[t]);
|
|
329
|
+
return i2;
|
|
330
|
+
}
|
|
331
|
+
function y2(e, t) {
|
|
332
|
+
return function() {
|
|
333
|
+
e.apply(t, arguments);
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
function q3(e) {
|
|
337
|
+
return "function" == typeof e;
|
|
338
|
+
}
|
|
339
|
+
return v2.parse = function(e, t) {
|
|
340
|
+
var i2 = (t = t || {}).dynamicTyping || false;
|
|
341
|
+
q3(i2) && (t.dynamicTypingFunction = i2, i2 = {});
|
|
342
|
+
if (t.dynamicTyping = i2, t.transform = !!q3(t.transform) && t.transform, !t.worker || !v2.WORKERS_SUPPORTED) return i2 = null, v2.NODE_STREAM_INPUT, "string" == typeof e ? (e = P2(e), i2 = new (t.download ? f : c)(t)) : true === e.readable && q3(e.read) && q3(e.on) ? i2 = new p2(t) : (n.File && e instanceof File || e instanceof Object) && (i2 = new l(t)), i2.stream(e);
|
|
343
|
+
(i2 = (() => {
|
|
344
|
+
var e2;
|
|
345
|
+
return !!v2.WORKERS_SUPPORTED && (e2 = (() => {
|
|
346
|
+
var e4 = n.URL || n.webkitURL || null, t2 = r.toString();
|
|
347
|
+
return v2.BLOB_URL || (v2.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 = g, e2.id = h2++, o[e2.id] = e2);
|
|
349
|
+
})()).userStep = t.step, i2.userChunk = t.chunk, i2.userComplete = t.complete, i2.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, i2.postMessage({ input: e, config: t, workerId: i2.id });
|
|
350
|
+
}, v2.unparse = function(e, t) {
|
|
351
|
+
var s2 = false, _3 = true, m4 = ",", y4 = "\r\n", a4 = '"', o2 = a4 + a4, i2 = false, r2 = null, h3 = false, u4 = ((() => {
|
|
352
|
+
if ("object" == typeof t) {
|
|
353
|
+
if ("string" != typeof t.delimiter || v2.BAD_DELIMITERS.filter(function(e2) {
|
|
354
|
+
return -1 !== t.delimiter.indexOf(e2);
|
|
355
|
+
}).length || (m4 = t.delimiter), "boolean" != typeof t.quotes && "function" != typeof t.quotes && !Array.isArray(t.quotes) || (s2 = t.quotes), "boolean" != typeof t.skipEmptyLines && "string" != typeof t.skipEmptyLines || (i2 = t.skipEmptyLines), "string" == typeof t.newline && (y4 = t.newline), "string" == typeof t.quoteChar && (a4 = t.quoteChar, o2 = a4 + a4), "boolean" == typeof t.header && (_3 = t.header), Array.isArray(t.columns)) {
|
|
356
|
+
if (0 === t.columns.length) throw new Error("Option columns is empty");
|
|
357
|
+
r2 = t.columns;
|
|
358
|
+
}
|
|
359
|
+
void 0 !== t.escapeChar && (o2 = t.escapeChar + a4), t.escapeFormulae instanceof RegExp ? h3 = t.escapeFormulae : "boolean" == typeof t.escapeFormulae && t.escapeFormulae && (h3 = /^[=+\-@\t\r].*$/);
|
|
360
|
+
}
|
|
361
|
+
})(), new RegExp(U3(a4), "g"));
|
|
362
|
+
"string" == typeof e && (e = JSON.parse(e));
|
|
363
|
+
if (Array.isArray(e)) {
|
|
364
|
+
if (!e.length || Array.isArray(e[0])) return n2(null, e, i2);
|
|
365
|
+
if ("object" == typeof e[0]) return n2(r2 || Object.keys(e[0]), e, i2);
|
|
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 || [], i2);
|
|
367
|
+
throw new Error("Unable to serialize unrecognized input");
|
|
368
|
+
function n2(e2, t2, i4) {
|
|
369
|
+
var r4 = "", n4 = ("string" == typeof e2 && (e2 = JSON.parse(e2)), "string" == typeof t2 && (t2 = JSON.parse(t2)), Array.isArray(e2) && 0 < e2.length), s4 = !Array.isArray(t2[0]);
|
|
370
|
+
if (n4 && _3) {
|
|
371
|
+
for (var a5 = 0; a5 < e2.length; a5++) 0 < a5 && (r4 += m4), r4 += k2(e2[a5], a5);
|
|
372
|
+
0 < t2.length && (r4 += y4);
|
|
373
|
+
}
|
|
374
|
+
for (var o4 = 0; o4 < t2.length; o4++) {
|
|
375
|
+
var h4 = (n4 ? e2 : t2[o4]).length, u5 = false, d2 = n4 ? 0 === Object.keys(t2[o4]).length : 0 === t2[o4].length;
|
|
376
|
+
if (i4 && !n4 && (u5 = "greedy" === i4 ? "" === t2[o4].join("").trim() : 1 === t2[o4].length && 0 === t2[o4][0].length), "greedy" === i4 && n4) {
|
|
377
|
+
for (var f2 = [], l2 = 0; l2 < h4; l2++) {
|
|
378
|
+
var c2 = s4 ? e2[l2] : l2;
|
|
379
|
+
f2.push(t2[o4][c2]);
|
|
380
|
+
}
|
|
381
|
+
u5 = "" === f2.join("").trim();
|
|
382
|
+
}
|
|
383
|
+
if (!u5) {
|
|
384
|
+
for (var p4 = 0; p4 < h4; p4++) {
|
|
385
|
+
0 < p4 && !d2 && (r4 += m4);
|
|
386
|
+
var g2 = n4 && s4 ? e2[p4] : p4;
|
|
387
|
+
r4 += k2(t2[o4][g2], p4);
|
|
388
|
+
}
|
|
389
|
+
o4 < t2.length - 1 && (!i4 || 0 < h4 && !d2) && (r4 += y4);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return r4;
|
|
393
|
+
}
|
|
394
|
+
function k2(e2, t2) {
|
|
395
|
+
var i4, 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 = (i4 = e2.toString()).replace(u4, o2), (n4 = n4 || true === s2 || "function" == typeof s2 && s2(e2, t2) || Array.isArray(s2) && s2[t2] || ((e4, t4) => {
|
|
397
|
+
for (var i5 = 0; i5 < t4.length; i5++) if (-1 < e4.indexOf(t4[i5])) return true;
|
|
398
|
+
return false;
|
|
399
|
+
})(r4, v2.BAD_DELIMITERS) || -1 < r4.indexOf(m4) || -1 < i4.indexOf(a4) || " " === r4.charAt(0) || " " === r4.charAt(r4.length - 1)) ? a4 + r4 + a4 : r4);
|
|
400
|
+
}
|
|
401
|
+
}, v2.RECORD_SEP = String.fromCharCode(30), v2.UNIT_SEP = String.fromCharCode(31), v2.BYTE_ORDER_MARK = "\uFEFF", v2.BAD_DELIMITERS = ["\r", "\n", '"', v2.BYTE_ORDER_MARK], v2.WORKERS_SUPPORTED = !s && !!n.Worker, v2.NODE_STREAM_INPUT = 1, v2.LocalChunkSize = 10485760, v2.RemoteChunkSize = 5242880, v2.DefaultDelimiter = ",", v2.Parser = E4, v2.ParserHandle = i, v2.NetworkStreamer = f, v2.FileStreamer = l, v2.StringStreamer = c, v2.ReadableStreamStreamer = p2, n.jQuery && ((d = n.jQuery).fn.parse = function(o2) {
|
|
402
|
+
var i2 = o2.config || {}, h3 = [];
|
|
403
|
+
return this.each(function(e2) {
|
|
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
|
+
for (var t = 0; t < this.files.length; t++) h3.push({ file: this.files[t], inputElem: this, instanceConfig: d.extend({}, i2) });
|
|
406
|
+
}), e(), this;
|
|
407
|
+
function e() {
|
|
408
|
+
if (0 === h3.length) q3(o2.complete) && o2.complete();
|
|
409
|
+
else {
|
|
410
|
+
var e2, t, i4, r2, n2 = h3[0];
|
|
411
|
+
if (q3(o2.before)) {
|
|
412
|
+
var s2 = o2.before(n2.file, n2.inputElem);
|
|
413
|
+
if ("object" == typeof s2) {
|
|
414
|
+
if ("abort" === s2.action) return e2 = "AbortError", t = n2.file, i4 = n2.inputElem, r2 = s2.reason, void (q3(o2.error) && o2.error({ name: e2 }, t, i4, r2));
|
|
415
|
+
if ("skip" === s2.action) return void u4();
|
|
416
|
+
"object" == typeof s2.config && (n2.instanceConfig = d.extend(n2.instanceConfig, s2.config));
|
|
417
|
+
} else if ("skip" === s2) return void u4();
|
|
418
|
+
}
|
|
419
|
+
var a4 = n2.instanceConfig.complete;
|
|
420
|
+
n2.instanceConfig.complete = function(e4) {
|
|
421
|
+
q3(a4) && a4(e4, n2.file, n2.inputElem), u4();
|
|
422
|
+
}, v2.parse(n2.file, n2.instanceConfig);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
function u4() {
|
|
426
|
+
h3.splice(0, 1), e();
|
|
427
|
+
}
|
|
428
|
+
}), a2 && (n.onmessage = function(e) {
|
|
429
|
+
e = e.data;
|
|
430
|
+
void 0 === v2.WORKER_ID && e && (v2.WORKER_ID = e.workerId);
|
|
431
|
+
"string" == typeof e.input ? n.postMessage({ workerId: v2.WORKER_ID, results: v2.parse(e.input, e.config), finished: true }) : (n.File && e.input instanceof File || e.input instanceof Object) && (e = v2.parse(e.input, e.config)) && n.postMessage({ workerId: v2.WORKER_ID, results: e, finished: true });
|
|
432
|
+
}), (f.prototype = Object.create(u2.prototype)).constructor = f, (l.prototype = Object.create(u2.prototype)).constructor = l, (c.prototype = Object.create(c.prototype)).constructor = c, (p2.prototype = Object.create(u2.prototype)).constructor = p2, v2;
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
});
|
|
7
436
|
|
|
8
437
|
// src/contract.ts
|
|
9
438
|
var HOST_CONTRACT_VERSION = "1.7.0";
|
|
@@ -106,12 +535,12 @@ function resolveOptions(p2) {
|
|
|
106
535
|
// never reach a chart as a live mode. Both of these are read on EVERY render, so a
|
|
107
536
|
// reader can change their mind about a cached chart without regenerating it.
|
|
108
537
|
approximatePositions: (() => {
|
|
109
|
-
const
|
|
110
|
-
return
|
|
538
|
+
const v2 = (p2.approximatePositions == null ? "" : String(p2.approximatePositions)).toLowerCase();
|
|
539
|
+
return v2 === "mark" || v2 === "aggregate" || v2 === "skip" ? v2 : APPROXIMATE_POSITIONS_DEFAULT;
|
|
111
540
|
})(),
|
|
112
541
|
valueAxisBaseline: (() => {
|
|
113
|
-
const
|
|
114
|
-
return
|
|
542
|
+
const v2 = (p2.valueAxisBaseline == null ? "" : String(p2.valueAxisBaseline)).toLowerCase();
|
|
543
|
+
return v2 === "zero" || v2 === "fit" || v2 === "auto" ? v2 : VALUE_AXIS_BASELINE_DEFAULT;
|
|
115
544
|
})(),
|
|
116
545
|
// ---- animation: booleans, default+clamp numerics, "" default enum ----
|
|
117
546
|
animAutoPlay: !!p2.animAutoPlay,
|
|
@@ -223,11 +652,11 @@ async function loadGeo(geoKind) {
|
|
|
223
652
|
const asset = geoAssetFor(key);
|
|
224
653
|
if (!asset) return void 0;
|
|
225
654
|
if (asset === "us-states") {
|
|
226
|
-
byAsset.set(asset, (await import("./geoUsStates.generated-
|
|
655
|
+
byAsset.set(asset, (await import("./geoUsStates.generated-JEFM6OHO.mjs")).US_STATES);
|
|
227
656
|
} else if (asset === "us-zip3") {
|
|
228
|
-
byAsset.set(asset, (await import("./geoUsZip3.generated-
|
|
657
|
+
byAsset.set(asset, (await import("./geoUsZip3.generated-VSWL7D6F.mjs")).US_ZIP3);
|
|
229
658
|
} else {
|
|
230
|
-
byAsset.set(asset, (await import("./geoWorld110m.generated-
|
|
659
|
+
byAsset.set(asset, (await import("./geoWorld110m.generated-TD2TA7S7.mjs")).WORLD_110M);
|
|
231
660
|
}
|
|
232
661
|
return fromAssets(key);
|
|
233
662
|
}
|
|
@@ -466,12 +895,12 @@ function A3(n) {
|
|
|
466
895
|
if (f && f.length) {
|
|
467
896
|
let d = n.state === void 0 || n.state === null ? "" : String(n.state).trim(), R = d ? u(d) : "", g = d ? Y(d) : null, S = [], m2 = -1;
|
|
468
897
|
for (let c of f) {
|
|
469
|
-
let l = c.row,
|
|
470
|
-
if (d && l.a1 !== "") if (g && l.a1 === g || u(l.a1) === R)
|
|
898
|
+
let l = c.row, A2 = 0;
|
|
899
|
+
if (d && l.a1 !== "") if (g && l.a1 === g || u(l.a1) === R) A2++;
|
|
471
900
|
else continue;
|
|
472
|
-
if (i) if (T(l.cc) === i)
|
|
901
|
+
if (i) if (T(l.cc) === i) A2++;
|
|
473
902
|
else continue;
|
|
474
|
-
|
|
903
|
+
A2 > m2 ? (m2 = A2, S = [c]) : A2 === m2 && S.push(c);
|
|
475
904
|
}
|
|
476
905
|
S.some((c) => c.primary) && (S = S.filter((c) => c.primary));
|
|
477
906
|
let p2 = /* @__PURE__ */ new Map();
|
|
@@ -502,20 +931,20 @@ var x = 8;
|
|
|
502
931
|
function y3(n, e) {
|
|
503
932
|
let t = new Array(n.length), o = new Array(n.length), i = new Array(n.length), r = /* @__PURE__ */ new Set(), a2 = [], s = /* @__PURE__ */ new Set(), f = [], d = /* @__PURE__ */ new Set(), R = [], g = { latlon: 0, city: 0, zip3: 0, state: 0, country: 0 }, S = 0, m2 = 0, p2 = null;
|
|
504
933
|
for (let l = 0; l < n.length; ++l) {
|
|
505
|
-
let
|
|
506
|
-
if (S3(
|
|
934
|
+
let A2 = n[l], C2 = A3({ ...A2, mapKind: e });
|
|
935
|
+
if (S3(C2)) {
|
|
507
936
|
t[l] = null, o[l] = null, i[l] = null, m2++;
|
|
508
|
-
let
|
|
509
|
-
|
|
510
|
-
} else if (
|
|
511
|
-
if (t[l] =
|
|
512
|
-
let
|
|
513
|
-
|
|
937
|
+
let M2 = K(A2);
|
|
938
|
+
M2 && !d.has(M2.toLowerCase()) && (d.add(M2.toLowerCase()), R.length < x && R.push(M2));
|
|
939
|
+
} else if (C2) {
|
|
940
|
+
if (t[l] = C2.lat, o[l] = C2.lon, i[l] = C2.precision, S++, g[C2.precision]++, (p2 === null || G[C2.precision] > G[p2]) && (p2 = C2.precision), G[C2.precision] > G.city) {
|
|
941
|
+
let M2 = K(A2);
|
|
942
|
+
M2 && !s.has(M2.toLowerCase()) && (s.add(M2.toLowerCase()), f.length < x && f.push(M2));
|
|
514
943
|
}
|
|
515
944
|
} else {
|
|
516
945
|
t[l] = null, o[l] = null, i[l] = null;
|
|
517
|
-
let
|
|
518
|
-
|
|
946
|
+
let M2 = K(A2);
|
|
947
|
+
M2 && !r.has(M2.toLowerCase()) && (r.add(M2.toLowerCase()), a2.push(M2));
|
|
519
948
|
}
|
|
520
949
|
}
|
|
521
950
|
let c = !n3() && n.some((l) => l.city !== null && l.city !== void 0 && String(l.city).trim() !== "");
|
|
@@ -599,77 +1028,93 @@ function wn(n) {
|
|
|
599
1028
|
}
|
|
600
1029
|
}
|
|
601
1030
|
function Kn(n, s) {
|
|
602
|
-
let i = new Array(n.length), r = /* @__PURE__ */ new Set(),
|
|
1031
|
+
let i = new Array(n.length), r = /* @__PURE__ */ new Set(), A2 = [], y2 = 0;
|
|
603
1032
|
for (let S = 0; S < n.length; ++S) {
|
|
604
1033
|
let O2 = hn(n[S], s);
|
|
605
1034
|
if (i[S] = O2, O2 !== null) y2++;
|
|
606
1035
|
else {
|
|
607
|
-
let
|
|
608
|
-
if (
|
|
609
|
-
let d = String(
|
|
1036
|
+
let C2 = n[S];
|
|
1037
|
+
if (C2 != null) {
|
|
1038
|
+
let d = String(C2).trim();
|
|
610
1039
|
if (d.length > 0) {
|
|
611
1040
|
let g = d.toLowerCase();
|
|
612
|
-
r.has(g) || (r.add(g),
|
|
1041
|
+
r.has(g) || (r.add(g), A2.push(d));
|
|
613
1042
|
}
|
|
614
1043
|
}
|
|
615
1044
|
}
|
|
616
1045
|
}
|
|
617
|
-
return { iso: i, unmatched:
|
|
1046
|
+
return { iso: i, unmatched: A2, matchedRows: y2, totalRows: n.length };
|
|
618
1047
|
}
|
|
619
1048
|
|
|
620
|
-
// ../shape-core/dist/
|
|
1049
|
+
// ../shape-core/dist/chunk-FJ7CUT3Q.mjs
|
|
1050
|
+
var import_papaparse = __toESM(require_papaparse_min(), 1);
|
|
621
1051
|
/*! @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. */
|
|
622
|
-
var
|
|
623
|
-
var
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
function
|
|
644
|
-
return
|
|
645
|
-
}
|
|
646
|
-
function
|
|
647
|
-
return
|
|
648
|
-
}
|
|
649
|
-
var
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
1052
|
+
var gt = { "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" };
|
|
1053
|
+
var X2 = (() => {
|
|
1054
|
+
let n = /* @__PURE__ */ new Map();
|
|
1055
|
+
for (let t of Object.keys(gt)) for (let e of gt[t].split(/\s+/)) e && n.set(e, t);
|
|
1056
|
+
return n;
|
|
1057
|
+
})();
|
|
1058
|
+
function Et(n) {
|
|
1059
|
+
for (let [t, e] of n) {
|
|
1060
|
+
let s = X2.get(t);
|
|
1061
|
+
s && !X2.has(e) && X2.set(e, s);
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
Et(N);
|
|
1065
|
+
var Dt = ["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"];
|
|
1066
|
+
var Ot = ["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"];
|
|
1067
|
+
var Lt = ["latitude", "longitude"];
|
|
1068
|
+
var Pt = ["latitude", "longitude"];
|
|
1069
|
+
var bt = /^\s*(sum|count|count\s+distinct|distinct\s+count)\s+of\s+/i;
|
|
1070
|
+
var Gt = /(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Za-z])(?=[0-9])|(?<=[0-9])(?=[A-Za-z])/g;
|
|
1071
|
+
var Ft = new RegExp("\\b(" + Dt.join("|") + ")\\b|(" + Ot.join("|") + ")$", "i");
|
|
1072
|
+
var Wt = new RegExp("\\b(" + Lt.join("|") + ")\\b|(" + Pt.join("|") + ")$", "i");
|
|
1073
|
+
function yt(n) {
|
|
1074
|
+
return n ? String(n).replace(bt, "").trim() : "";
|
|
1075
|
+
}
|
|
1076
|
+
function Vt(n) {
|
|
1077
|
+
return !!n && bt.test(String(n));
|
|
1078
|
+
}
|
|
1079
|
+
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"];
|
|
1080
|
+
var ht = 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");
|
|
1081
|
+
function zt(n) {
|
|
1082
|
+
let t = yt(n);
|
|
1083
|
+
return t.length === 0 ? "" : t.replace(Gt, " ");
|
|
1084
|
+
}
|
|
1085
|
+
function St(n, t) {
|
|
1086
|
+
return t ? n.test(zt(t)) || n.test(yt(t)) : false;
|
|
1087
|
+
}
|
|
1088
|
+
function Ct(n) {
|
|
1089
|
+
return St(Wt, n);
|
|
1090
|
+
}
|
|
1091
|
+
function Ut(n) {
|
|
1092
|
+
return St(Ft, n) || Ct(n);
|
|
1093
|
+
}
|
|
1094
|
+
var Mt = /int|double|decimal|single|float|number|currency|money/i;
|
|
1095
|
+
function Bt(n) {
|
|
1096
|
+
let t = String(n?.valueNature ?? "").trim().toLowerCase();
|
|
1097
|
+
return t === "categorical" ? "Categorical" : t === "ordinal" ? "Ordinal" : t === "continuous" || n?.isMeasure === true || Mt.test(String(n?.dataType ?? "")) ? "Continuous" : "Categorical";
|
|
1098
|
+
}
|
|
1099
|
+
function Ht(n) {
|
|
1100
|
+
return n?.isMeasure === true || Mt.test(String(n?.dataType ?? ""));
|
|
1101
|
+
}
|
|
1102
|
+
function At(n) {
|
|
1103
|
+
let t = n ?? {}, e = Bt(t);
|
|
1104
|
+
if (e !== "Continuous") return { nature: e, additivity: "unknown", basis: "role", suppressed: false };
|
|
1105
|
+
if (Ct(t.name)) return { nature: e, additivity: "positional", basis: "name", suppressed: true };
|
|
661
1106
|
let s = String(t.additivity ?? "").trim().toLowerCase();
|
|
662
|
-
if (!(s === "additive" &&
|
|
663
|
-
if (s === "additive") return { nature:
|
|
664
|
-
if (s === "part_of_whole") return { nature:
|
|
665
|
-
if (s === "intensive_rate") return { nature:
|
|
1107
|
+
if (!(s === "additive" && Vt(t.name))) {
|
|
1108
|
+
if (s === "additive") return { nature: e, additivity: "additive", basis: "measured", suppressed: false };
|
|
1109
|
+
if (s === "part_of_whole") return { nature: e, additivity: "part_of_whole", basis: "measured", suppressed: false };
|
|
1110
|
+
if (s === "intensive_rate") return { nature: e, additivity: "intensive_rate", basis: "measured", suppressed: false };
|
|
666
1111
|
}
|
|
667
|
-
return t.discourageAggregationAcrossGroups === true ? { nature:
|
|
1112
|
+
return t.discourageAggregationAcrossGroups === true ? { nature: e, additivity: "intensive_rate", basis: "host-flag", suppressed: false } : Ut(t.name) ? { nature: e, additivity: "intensive_rate", basis: "name", suppressed: false } : { nature: e, additivity: "additive", basis: "default", suppressed: false };
|
|
668
1113
|
}
|
|
669
|
-
function
|
|
670
|
-
let t =
|
|
1114
|
+
function Tt(n) {
|
|
1115
|
+
let t = At(n), e = n ?? {};
|
|
671
1116
|
if (t.nature === "Categorical") return ["first", "distinctcount", "count"];
|
|
672
|
-
if (t.nature === "Ordinal") return
|
|
1117
|
+
if (t.nature === "Ordinal") return Ht(e) ? ["median", "average", "min", "max", "first", "distinctcount", "count"] : ["first", "distinctcount", "count"];
|
|
673
1118
|
switch (t.additivity) {
|
|
674
1119
|
case "positional":
|
|
675
1120
|
return ["min", "max", "count", "distinctcount", "first"];
|
|
@@ -679,156 +1124,159 @@ function D2(e) {
|
|
|
679
1124
|
return ["sum", "average", "median", "min", "max", "count", "distinctcount", "first"];
|
|
680
1125
|
}
|
|
681
1126
|
}
|
|
682
|
-
function
|
|
683
|
-
return
|
|
1127
|
+
function he(n) {
|
|
1128
|
+
return Tt(n)[0];
|
|
684
1129
|
}
|
|
685
|
-
function
|
|
1130
|
+
function ye(n, t) {
|
|
686
1131
|
if (t !== "sum" && t !== "count") return false;
|
|
687
1132
|
if (t === "count") return true;
|
|
688
|
-
let
|
|
689
|
-
return
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
function
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
1133
|
+
let e = At(n);
|
|
1134
|
+
return e.additivity === "additive" || e.additivity === "part_of_whole" || e.additivity === "unknown";
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
// ../shape-core/dist/index.mjs
|
|
1138
|
+
/*! @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. */
|
|
1139
|
+
var z2 = 2;
|
|
1140
|
+
var W2 = 400;
|
|
1141
|
+
function E2(r) {
|
|
1142
|
+
return !!E(r);
|
|
1143
|
+
}
|
|
1144
|
+
function A(r) {
|
|
1145
|
+
let e = /* @__PURE__ */ new Set();
|
|
1146
|
+
for (let n of r) {
|
|
1147
|
+
if (n == null) continue;
|
|
1148
|
+
let s = u(String(n));
|
|
1149
|
+
if (!V(s) && !e.has(s) && (e.add(s), e.size >= W2)) break;
|
|
702
1150
|
}
|
|
703
|
-
return Array.from(
|
|
704
|
-
}
|
|
705
|
-
function
|
|
706
|
-
let
|
|
707
|
-
if (
|
|
708
|
-
let
|
|
709
|
-
return
|
|
710
|
-
}
|
|
711
|
-
function
|
|
712
|
-
if (!Y(
|
|
713
|
-
let
|
|
714
|
-
return
|
|
715
|
-
}
|
|
716
|
-
function
|
|
717
|
-
let
|
|
718
|
-
if (
|
|
719
|
-
let
|
|
720
|
-
for (let s of
|
|
721
|
-
return Math.round(
|
|
722
|
-
}
|
|
723
|
-
function
|
|
724
|
-
let
|
|
725
|
-
if (
|
|
726
|
-
let
|
|
727
|
-
for (let s of
|
|
728
|
-
return Math.round(
|
|
729
|
-
}
|
|
730
|
-
function
|
|
731
|
-
let
|
|
732
|
-
for (let
|
|
733
|
-
if (
|
|
734
|
-
let s = String(
|
|
735
|
-
if (!V(u(s)) && !
|
|
1151
|
+
return Array.from(e);
|
|
1152
|
+
}
|
|
1153
|
+
function C(r) {
|
|
1154
|
+
let e = A(r);
|
|
1155
|
+
if (e.length === 0 || $2(r) < 95) return false;
|
|
1156
|
+
let n = e.filter((c) => E2(c) && !Y(c)).length, s = e.filter((c) => !E2(c) && !!Y(c)).length;
|
|
1157
|
+
return n >= 1 && n >= s;
|
|
1158
|
+
}
|
|
1159
|
+
function Z2(r, e) {
|
|
1160
|
+
if (!Y(r)) return false;
|
|
1161
|
+
let n = E(r);
|
|
1162
|
+
return n ? e === "world" ? true : s3.has(n) : false;
|
|
1163
|
+
}
|
|
1164
|
+
function $2(r) {
|
|
1165
|
+
let e = A(r);
|
|
1166
|
+
if (e.length === 0) return 0;
|
|
1167
|
+
let n = 0;
|
|
1168
|
+
for (let s of e) E2(s) && n++;
|
|
1169
|
+
return Math.round(n / e.length * 1e3) / 10;
|
|
1170
|
+
}
|
|
1171
|
+
function M(r) {
|
|
1172
|
+
let e = A(r);
|
|
1173
|
+
if (e.length === 0) return 0;
|
|
1174
|
+
let n = 0;
|
|
1175
|
+
for (let s of e) Y(s) && n++;
|
|
1176
|
+
return Math.round(n / e.length * 1e3) / 10;
|
|
1177
|
+
}
|
|
1178
|
+
function F2(r) {
|
|
1179
|
+
let e = /* @__PURE__ */ new Set();
|
|
1180
|
+
for (let n of r) {
|
|
1181
|
+
if (n == null) continue;
|
|
1182
|
+
let s = String(n).trim();
|
|
1183
|
+
if (!V(u(s)) && !e.has(s) && (e.add(s), e.size >= W2)) break;
|
|
736
1184
|
}
|
|
737
|
-
return Array.from(
|
|
1185
|
+
return Array.from(e);
|
|
738
1186
|
}
|
|
739
|
-
function
|
|
740
|
-
let
|
|
741
|
-
if (
|
|
742
|
-
let
|
|
743
|
-
for (let s of
|
|
744
|
-
return Math.round(
|
|
1187
|
+
function D2(r) {
|
|
1188
|
+
let e = F2(r);
|
|
1189
|
+
if (e.length === 0) return 0;
|
|
1190
|
+
let n = 0;
|
|
1191
|
+
for (let s of e) Z(s).length > 0 && n++;
|
|
1192
|
+
return Math.round(n / e.length * 1e3) / 10;
|
|
745
1193
|
}
|
|
746
|
-
function
|
|
747
|
-
return p(
|
|
1194
|
+
function U2(r, e) {
|
|
1195
|
+
return p(e, en) ? true : F2(r).some((n) => /^\d{5}(-\d{4})?$/.test(n.replace(/\.0+$/, "")));
|
|
748
1196
|
}
|
|
749
|
-
function
|
|
750
|
-
let
|
|
751
|
-
if (
|
|
1197
|
+
function jt(r, e) {
|
|
1198
|
+
let n = A(r);
|
|
1199
|
+
if (n.length === 0) return 0;
|
|
752
1200
|
let s = 0;
|
|
753
|
-
for (let
|
|
754
|
-
return Math.round(s /
|
|
755
|
-
}
|
|
756
|
-
function
|
|
757
|
-
let
|
|
758
|
-
for (let s of
|
|
759
|
-
return
|
|
760
|
-
}
|
|
761
|
-
function
|
|
762
|
-
let
|
|
763
|
-
for (let s of
|
|
764
|
-
return
|
|
765
|
-
}
|
|
766
|
-
function
|
|
767
|
-
let
|
|
768
|
-
for (let
|
|
769
|
-
let
|
|
770
|
-
|
|
1201
|
+
for (let c of n) p3(c, e) && s++;
|
|
1202
|
+
return Math.round(s / n.length * 1e3) / 10;
|
|
1203
|
+
}
|
|
1204
|
+
function G2(r, e) {
|
|
1205
|
+
let n = 0;
|
|
1206
|
+
for (let s of A(r)) e(s) && n++;
|
|
1207
|
+
return n;
|
|
1208
|
+
}
|
|
1209
|
+
function Yt(r, e) {
|
|
1210
|
+
let n = 0;
|
|
1211
|
+
for (let s of F2(r)) e(s) && n++;
|
|
1212
|
+
return n;
|
|
1213
|
+
}
|
|
1214
|
+
function Jt(r, e, n, s, c) {
|
|
1215
|
+
let P2 = [], u2 = [], o = {}, v2 = {}, k2 = new Set(r), l = (t) => e.map((i) => i[t]);
|
|
1216
|
+
for (let t of ["city", "country"]) {
|
|
1217
|
+
let i = n?.[t];
|
|
1218
|
+
i && k2.has(i) && (o[t] = i);
|
|
771
1219
|
}
|
|
772
|
-
let
|
|
773
|
-
for (let
|
|
774
|
-
let
|
|
775
|
-
|
|
1220
|
+
let X3 = new Set(c ?? r);
|
|
1221
|
+
for (let t of ["lat", "lon"]) {
|
|
1222
|
+
let i = n?.[t];
|
|
1223
|
+
i && X3.has(i) && (o[t] = i);
|
|
776
1224
|
}
|
|
777
|
-
let p2 =
|
|
778
|
-
if (p2 &&
|
|
779
|
-
let
|
|
780
|
-
|
|
1225
|
+
let p2 = n?.zip;
|
|
1226
|
+
if (p2 && k2.has(p2)) {
|
|
1227
|
+
let t = l(p2), i = D2(t);
|
|
1228
|
+
i < 95 ? u2.push(`zip=${p2} (only ${i}% of values read as ZIPs)`) : U2(t, p2) ? o.zip = p2 : u2.push(`zip=${p2} (all values are 3-4 digits with nothing to say they are postal)`);
|
|
781
1229
|
}
|
|
782
|
-
let
|
|
783
|
-
if (
|
|
784
|
-
let
|
|
785
|
-
|
|
1230
|
+
let g = n?.state;
|
|
1231
|
+
if (g && k2.has(g)) {
|
|
1232
|
+
let t = l(g), i = A(t);
|
|
1233
|
+
i.length > 0 && i.every((a2) => Z2(a2, s)) ? u2.push(`state=${g} (every value is "CA", which is both Canada and California)`) : C(t) ? (u2.push(`state=${g} (every value is a country, not a state)`), o.country || (o.country = g)) : M(t) < 95 ? u2.push(`state=${g} (only ${M(t)}% of values are states/provinces)`) : o.state = g;
|
|
786
1234
|
}
|
|
787
|
-
let
|
|
1235
|
+
let d = new Set(Object.values(o).filter(Boolean)), x2 = r.filter((t) => !d.has(t) && !t.startsWith("__"));
|
|
788
1236
|
if (!o.state) {
|
|
789
|
-
let
|
|
790
|
-
for (let
|
|
791
|
-
let a2 = l(
|
|
792
|
-
if (
|
|
793
|
-
let
|
|
794
|
-
if (
|
|
795
|
-
let
|
|
796
|
-
|
|
1237
|
+
let t = null;
|
|
1238
|
+
for (let i of x2) {
|
|
1239
|
+
let a2 = l(i);
|
|
1240
|
+
if (C(a2)) continue;
|
|
1241
|
+
let f = M(a2);
|
|
1242
|
+
if (f < 95) continue;
|
|
1243
|
+
let N2 = G2(a2, (S) => !!Y(S)), Y2 = G2(a2, (S) => !!Y(S) && !Z2(S, s));
|
|
1244
|
+
N2 < z2 && Y2 < 1 || (!t || f > t.pct) && (t = { name: i, pct: f });
|
|
797
1245
|
}
|
|
798
|
-
|
|
1246
|
+
t && (o.state = t.name, d.add(t.name), P2.push(`state=${t.name} (${t.pct}% states/provinces)`));
|
|
799
1247
|
}
|
|
800
|
-
if (!o.zip) for (let
|
|
801
|
-
if (
|
|
802
|
-
let
|
|
803
|
-
if (!(a2 < 95) &&
|
|
804
|
-
o.zip =
|
|
1248
|
+
if (!o.zip) for (let t of x2) {
|
|
1249
|
+
if (d.has(t)) continue;
|
|
1250
|
+
let i = l(t), a2 = D2(i);
|
|
1251
|
+
if (!(a2 < 95) && U2(i, t) && !(Yt(i, (f) => Z(f).length > 0) < z2)) {
|
|
1252
|
+
o.zip = t, d.add(t), P2.push(`zip=${t} (${a2}% ZIP codes)`);
|
|
805
1253
|
break;
|
|
806
1254
|
}
|
|
807
1255
|
}
|
|
808
|
-
let
|
|
809
|
-
if (!
|
|
810
|
-
let
|
|
811
|
-
for (let
|
|
812
|
-
if (
|
|
813
|
-
let a2 =
|
|
814
|
-
(!
|
|
1256
|
+
let h2 = o.country;
|
|
1257
|
+
if (!h2 || !C(l(h2))) {
|
|
1258
|
+
let t = null;
|
|
1259
|
+
for (let i of x2) {
|
|
1260
|
+
if (d.has(i) || !C(l(i))) continue;
|
|
1261
|
+
let a2 = $2(l(i));
|
|
1262
|
+
(!t || a2 > t.pct) && (t = { name: i, pct: a2 });
|
|
815
1263
|
}
|
|
816
|
-
|
|
1264
|
+
t && (h2 && (u2.push(`country=${h2} (only ${$2(l(h2))}% of values are country identifiers; using ${t.name} instead)`), v2.country = h2), o.country = t.name, d.add(t.name), P2.push(`country=${t.name}`));
|
|
817
1265
|
}
|
|
818
1266
|
if (!o.city) {
|
|
819
|
-
let
|
|
820
|
-
for (let
|
|
821
|
-
if (
|
|
822
|
-
let a2 = l(
|
|
823
|
-
|
|
1267
|
+
let t = null;
|
|
1268
|
+
for (let i of x2) {
|
|
1269
|
+
if (d.has(i)) continue;
|
|
1270
|
+
let a2 = l(i), f = jt(a2, s);
|
|
1271
|
+
f < m3 || G2(a2, (N2) => p3(N2, s)) < z2 || (!t || f > t.pct) && (t = { name: i, pct: f });
|
|
824
1272
|
}
|
|
825
|
-
|
|
1273
|
+
t && (o.city = t.name, P2.push(`city=${t.name} (${t.pct}% known cities)`));
|
|
826
1274
|
}
|
|
827
|
-
let
|
|
828
|
-
let
|
|
829
|
-
return isFinite(
|
|
1275
|
+
let B2 = o.country ? l(o.country) : [], _2 = !!o.country && C(B2), j2 = _2 ? new Set(B2.map((t) => E(t == null ? null : String(t))).filter(Boolean)).size : 0, K2 = _2 && j2 >= 2, L2 = !!(o.lat && o.lon) && e.some((t) => {
|
|
1276
|
+
let i = +String(t[o.lat] ?? "").trim(), a2 = +String(t[o.lon] ?? "").trim();
|
|
1277
|
+
return isFinite(i) && isFinite(a2) && i >= -90 && i <= 90 && a2 >= -180 && a2 <= 180 && String(t[o.lat] ?? "").trim() !== "" && String(t[o.lon] ?? "").trim() !== "";
|
|
830
1278
|
});
|
|
831
|
-
return o.lat && o.lon && !
|
|
1279
|
+
return o.lat && o.lon && !L2 && u2.push(`lat/lon=${o.lat}/${o.lon} (no row holds a usable coordinate pair)`), o.country && !K2 && !(o.city || o.state || o.zip || L2) && u2.push(_2 ? `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: P2, refused: u2, ...Object.keys(v2).length ? { labelFallback: v2 } : {} };
|
|
832
1280
|
}
|
|
833
1281
|
|
|
834
1282
|
// src/payload.ts
|
|
@@ -843,7 +1291,7 @@ function resolvePointChannel(cols, rowObjs, point) {
|
|
|
843
1291
|
let labelCol;
|
|
844
1292
|
if (bind) {
|
|
845
1293
|
const dims = cols.filter((c) => !c.isMeasure).map((c) => c.name);
|
|
846
|
-
const res =
|
|
1294
|
+
const res = Jt(dims, rowObjs, bind, point?.mapKind, cols.map((c) => c.name));
|
|
847
1295
|
bind = res.bind;
|
|
848
1296
|
rolesBackfilled = res.backfilled;
|
|
849
1297
|
rolesRefused = res.refused;
|
|
@@ -911,11 +1359,11 @@ function buildRenderPayload(cols, rowObjs, geo, point, destination) {
|
|
|
911
1359
|
const row = rowObjs[r];
|
|
912
1360
|
const a2 = new Array(cols.length + extra);
|
|
913
1361
|
for (let c = 0; c < cols.length; c++) {
|
|
914
|
-
const
|
|
915
|
-
if (
|
|
916
|
-
a2[c] =
|
|
1362
|
+
const v2 = row[colNames[c]];
|
|
1363
|
+
if (v2 instanceof Date) {
|
|
1364
|
+
a2[c] = v2.toISOString();
|
|
917
1365
|
} else {
|
|
918
|
-
a2[c] =
|
|
1366
|
+
a2[c] = v2 ?? null;
|
|
919
1367
|
}
|
|
920
1368
|
}
|
|
921
1369
|
let k2 = cols.length;
|
|
@@ -967,8 +1415,8 @@ function buildRenderPayload(cols, rowObjs, geo, point, destination) {
|
|
|
967
1415
|
function createMarkResolver(env) {
|
|
968
1416
|
const { root, doc, log } = env;
|
|
969
1417
|
const isElement = (t) => {
|
|
970
|
-
const
|
|
971
|
-
if (
|
|
1418
|
+
const E4 = doc?.defaultView?.Element ?? globalThis.Element;
|
|
1419
|
+
if (E4 && t instanceof E4) return true;
|
|
972
1420
|
return !!t && typeof t.closest === "function" && typeof t.getAttribute === "function";
|
|
973
1421
|
};
|
|
974
1422
|
const viewStyle = (n) => {
|
|
@@ -988,16 +1436,16 @@ function createMarkResolver(env) {
|
|
|
988
1436
|
return s === "transparent" || s === "none" || so <= 0.01;
|
|
989
1437
|
};
|
|
990
1438
|
const distToPathCenterline = (el, x2, y2) => {
|
|
991
|
-
const
|
|
992
|
-
if (!(
|
|
1439
|
+
const L2 = el.getTotalLength();
|
|
1440
|
+
if (!(L2 > 0)) return Number.MAX_VALUE;
|
|
993
1441
|
const m2 = el.getScreenCTM();
|
|
994
1442
|
if (!m2) return Number.MAX_VALUE;
|
|
995
1443
|
let best = Number.MAX_VALUE;
|
|
996
1444
|
const N2 = 64;
|
|
997
1445
|
for (let i = 0; i <= N2; i++) {
|
|
998
|
-
const
|
|
999
|
-
const dx = m2.a *
|
|
1000
|
-
const dy = m2.b *
|
|
1446
|
+
const pt2 = el.getPointAtLength(L2 * i / N2);
|
|
1447
|
+
const dx = m2.a * pt2.x + m2.c * pt2.y + m2.e - x2;
|
|
1448
|
+
const dy = m2.b * pt2.x + m2.d * pt2.y + m2.f - y2;
|
|
1001
1449
|
const d = dx * dx + dy * dy;
|
|
1002
1450
|
if (d < best) best = d;
|
|
1003
1451
|
}
|
|
@@ -1094,8 +1542,8 @@ function createMarkResolver(env) {
|
|
|
1094
1542
|
for (const n of all) {
|
|
1095
1543
|
const tag = (n.tagName || "").toLowerCase();
|
|
1096
1544
|
if (!SHAPE.test(tag)) continue;
|
|
1097
|
-
const
|
|
1098
|
-
if (
|
|
1545
|
+
const pe2 = viewStyle(n);
|
|
1546
|
+
if (pe2 && pe2 !== "none") return true;
|
|
1099
1547
|
}
|
|
1100
1548
|
return false;
|
|
1101
1549
|
};
|
|
@@ -1321,12 +1769,12 @@ function contentExtentOf(boxes) {
|
|
|
1321
1769
|
if (usable.length === 0) return { w: 0, h: 0, source: "none" };
|
|
1322
1770
|
const inFlow = usable.filter((b2) => !b2.floating);
|
|
1323
1771
|
const counted = inFlow.length > 0 ? inFlow : usable;
|
|
1324
|
-
let w = 0,
|
|
1772
|
+
let w = 0, h2 = 0;
|
|
1325
1773
|
for (const b2 of counted) {
|
|
1326
1774
|
if (b2.right > w) w = b2.right;
|
|
1327
|
-
if (b2.bottom >
|
|
1775
|
+
if (b2.bottom > h2) h2 = b2.bottom;
|
|
1328
1776
|
}
|
|
1329
|
-
return { w, h:
|
|
1777
|
+
return { w, h: h2, source: inFlow.length > 0 ? "in-flow" : "all-floating" };
|
|
1330
1778
|
}
|
|
1331
1779
|
function scrollFitFor(contentW, contentH, viewportW, viewportH, slackPx = SCROLL_SLACK_PX) {
|
|
1332
1780
|
return {
|
|
@@ -1336,8 +1784,8 @@ function scrollFitFor(contentW, contentH, viewportW, viewportH, slackPx = SCROLL
|
|
|
1336
1784
|
}
|
|
1337
1785
|
var FIT_CONTENT_SELECTOR = "text, .d3-mark, .d3-legend-mark";
|
|
1338
1786
|
var PHANTOM_FRACTION = 0.95;
|
|
1339
|
-
function isPhantomBox(w,
|
|
1340
|
-
return w > refW * PHANTOM_FRACTION ||
|
|
1787
|
+
function isPhantomBox(w, h2, refW, refH) {
|
|
1788
|
+
return w > refW * PHANTOM_FRACTION || h2 > refH * PHANTOM_FRACTION;
|
|
1341
1789
|
}
|
|
1342
1790
|
var MAX_FRAME_GROW_FACTOR = 20;
|
|
1343
1791
|
function planFrameGrow(inkBottomPx, elHeightPx, viewBoxH, ctmScale, slackPx = SCROLL_SLACK_PX, maxFactor = MAX_FRAME_GROW_FACTOR) {
|
|
@@ -1601,7 +2049,7 @@ function createChartHost(container, config) {
|
|
|
1601
2049
|
let data = config.data;
|
|
1602
2050
|
{
|
|
1603
2051
|
const stamped = config.data?.meta?.hostContract;
|
|
1604
|
-
const major = (
|
|
2052
|
+
const major = (v2) => (v2 || "").split(".")[0];
|
|
1605
2053
|
if (stamped && major(stamped) !== major(HOST_CONTRACT_VERSION)) {
|
|
1606
2054
|
try {
|
|
1607
2055
|
(win?.console ?? console)?.warn(
|
|
@@ -1643,9 +2091,9 @@ function createChartHost(container, config) {
|
|
|
1643
2091
|
const ensureAffordanceStyles = () => {
|
|
1644
2092
|
try {
|
|
1645
2093
|
if (!doc || doc.getElementById("bic-chart-host-affordances")) return;
|
|
1646
|
-
const
|
|
1647
|
-
|
|
1648
|
-
|
|
2094
|
+
const st = doc.createElement("style");
|
|
2095
|
+
st.id = "bic-chart-host-affordances";
|
|
2096
|
+
st.textContent = `
|
|
1649
2097
|
/* TYPOGRAPHY FIREWALL. Generated charts set font-size but almost never line-height or
|
|
1650
2098
|
letter-spacing, so they INHERIT whatever the host page cascades in. A page with
|
|
1651
2099
|
\`:root { font: 18px/145% }\` (the stock Vite template does exactly this) hands every
|
|
@@ -1694,7 +2142,7 @@ function createChartHost(container, config) {
|
|
|
1694
2142
|
font-weight: 700 !important;
|
|
1695
2143
|
text-decoration: underline !important;
|
|
1696
2144
|
}`;
|
|
1697
|
-
(doc.head || doc.documentElement)?.appendChild(
|
|
2145
|
+
(doc.head || doc.documentElement)?.appendChild(st);
|
|
1698
2146
|
} catch {
|
|
1699
2147
|
}
|
|
1700
2148
|
};
|
|
@@ -1944,10 +2392,10 @@ export {
|
|
|
1944
2392
|
registerGeoAsset,
|
|
1945
2393
|
clearGeoCache,
|
|
1946
2394
|
L3,
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
2395
|
+
At,
|
|
2396
|
+
Tt,
|
|
2397
|
+
he,
|
|
2398
|
+
ye,
|
|
1951
2399
|
buildRenderPayload,
|
|
1952
2400
|
createMarkResolver,
|
|
1953
2401
|
ensureCrossfilterHitTargets,
|