@bicharts/chart-host 0.5.102 → 0.5.104
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-LYHB5MUX.mjs → chunk-VPCD6LVR.mjs} +123 -114
- package/dist/index.mjs +118 -14
- package/dist/react.mjs +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/pendingGenerate.d.ts +163 -0
- package/package.json +1 -1
|
@@ -183,12 +183,12 @@ var require_papaparse_min = __commonJS({
|
|
|
183
183
|
var s4, a5, o4, h5;
|
|
184
184
|
n4 = n4 || [",", " ", "|", ";", v2.RECORD_SEP, v2.UNIT_SEP];
|
|
185
185
|
for (var u6 = 0; u6 < n4.length; u6++) {
|
|
186
|
-
for (var d4, f6 = n4[u6], l3 = 0, c5 = 0, p5 = 0, g5 = (o4 = void 0, new
|
|
186
|
+
for (var d4, f6 = n4[u6], l3 = 0, c5 = 0, p5 = 0, g5 = (o4 = void 0, new E2({ comments: r5, delimiter: f6, newline: t4, preview: 10 }).parse(e4)), _4 = 0; _4 < g5.data.length; _4++) i5 && y6(g5.data[_4]) ? p5++ : (d4 = g5.data[_4].length, c5 += d4, void 0 === o4 ? o4 = d4 : 0 < d4 && (l3 += Math.abs(d4 - o4), o4 = d4));
|
|
187
187
|
0 < g5.data.length && (c5 /= g5.data.length - p5), (void 0 === a5 || l3 <= a5) && (void 0 === h5 || h5 < c5) && 1.99 < c5 && (a5 = l3, s4 = f6, h5 = c5);
|
|
188
188
|
}
|
|
189
189
|
return { successful: !!(m4.delimiter = s4), bestDelimiter: s4 };
|
|
190
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
|
|
191
|
+
return m4.preview && m4.header && r4.preview++, n2 = e2, s2 = new E2(r4), p4 = s2.parse(n2, t2, i4), g4(), l2 ? { meta: { paused: true } } : p4 || { meta: { paused: false } };
|
|
192
192
|
}, this.paused = function() {
|
|
193
193
|
return l2;
|
|
194
194
|
}, this.pause = function() {
|
|
@@ -210,43 +210,43 @@ var require_papaparse_min = __commonJS({
|
|
|
210
210
|
function U2(e) {
|
|
211
211
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
212
212
|
}
|
|
213
|
-
function
|
|
214
|
-
var S = (
|
|
215
|
-
if (void 0 !==
|
|
216
|
-
true === x3 ? x3 = "#" : ("string" != typeof x3 || -1 < v2.BAD_DELIMITERS.indexOf(x3)) && (x3 = false), "\n" !==
|
|
213
|
+
function E2(C) {
|
|
214
|
+
var S = (C = C || {}).delimiter, O3 = C.newline, x3 = C.comments, I2 = C.step, A2 = C.preview, T3 = C.fastMode, D4 = null, L2 = false, F4 = null == C.quoteChar ? '"' : C.quoteChar, j3 = F4;
|
|
215
|
+
if (void 0 !== C.escapeChar && (j3 = C.escapeChar), ("string" != typeof S || -1 < v2.BAD_DELIMITERS.indexOf(S)) && (S = ","), x3 === S) throw new Error("Comment character same as delimiter");
|
|
216
|
+
true === x3 ? x3 = "#" : ("string" != typeof x3 || -1 < v2.BAD_DELIMITERS.indexOf(x3)) && (x3 = false), "\n" !== O3 && "\r" !== O3 && "\r\n" !== O3 && (O3 = "\n");
|
|
217
217
|
var z3 = 0, M4 = false;
|
|
218
218
|
this.parse = function(i2, t, r2) {
|
|
219
219
|
if ("string" != typeof i2) throw new Error("Input must be a string");
|
|
220
|
-
var n2 = i2.length, e = S.length, s2 =
|
|
220
|
+
var n2 = i2.length, e = S.length, s2 = O3.length, a4 = x3.length, o2 = q3(I2), h4 = [], u5 = [], d3 = [], f5 = z3 = 0;
|
|
221
221
|
if (!i2) return w2();
|
|
222
222
|
if (T3 || false !== T3 && -1 === i2.indexOf(F4)) {
|
|
223
|
-
for (var l2 = i2.split(
|
|
224
|
-
if (d3 = l2[c4], z3 += d3.length, c4 !== l2.length - 1) z3 +=
|
|
223
|
+
for (var l2 = i2.split(O3), c4 = 0; c4 < l2.length; c4++) {
|
|
224
|
+
if (d3 = l2[c4], z3 += d3.length, c4 !== l2.length - 1) z3 += O3.length;
|
|
225
225
|
else if (r2) return w2();
|
|
226
226
|
if (!x3 || d3.substring(0, a4) !== x3) {
|
|
227
227
|
if (o2) {
|
|
228
|
-
if (h4 = [], k2(d3.split(S)),
|
|
228
|
+
if (h4 = [], k2(d3.split(S)), R2(), M4) return w2();
|
|
229
229
|
} else k2(d3.split(S));
|
|
230
|
-
if (
|
|
230
|
+
if (A2 && A2 <= c4) return h4 = h4.slice(0, A2), w2(true);
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
return w2();
|
|
234
234
|
}
|
|
235
|
-
for (var p4 = i2.indexOf(S, z3), g4 = i2.indexOf(
|
|
236
|
-
if (-1 === (m4 = i2.indexOf(F4, m4 + 1))) return r2 || u5.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: h4.length, index: z3 }),
|
|
237
|
-
if (m4 === n2 - 1) return
|
|
235
|
+
for (var p4 = i2.indexOf(S, z3), g4 = i2.indexOf(O3, z3), _3 = new RegExp(U2(j3) + U2(F4), "g"), m4 = i2.indexOf(F4, z3); ; ) if (i2[z3] === F4) for (m4 = z3, z3++; ; ) {
|
|
236
|
+
if (-1 === (m4 = i2.indexOf(F4, m4 + 1))) return r2 || u5.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: h4.length, index: z3 }), E4();
|
|
237
|
+
if (m4 === n2 - 1) return E4(i2.substring(z3, m4).replace(_3, F4));
|
|
238
238
|
if (F4 === j3 && i2[m4 + 1] === j3) m4++;
|
|
239
239
|
else if (F4 === j3 || 0 === m4 || i2[m4 - 1] !== j3) {
|
|
240
240
|
-1 !== p4 && p4 < m4 + 1 && (p4 = i2.indexOf(S, m4 + 1));
|
|
241
|
-
var y6 = v3(-1 === (g4 = -1 !== g4 && g4 < m4 + 1 ? i2.indexOf(
|
|
241
|
+
var y6 = v3(-1 === (g4 = -1 !== g4 && g4 < m4 + 1 ? i2.indexOf(O3, m4 + 1) : g4) ? p4 : Math.min(p4, g4));
|
|
242
242
|
if (i2.substr(m4 + 1 + y6, e) === S) {
|
|
243
|
-
d3.push(i2.substring(z3, m4).replace(_3, F4)), i2[z3 = m4 + 1 + y6 + e] !== F4 && (m4 = i2.indexOf(F4, z3)), p4 = i2.indexOf(S, z3), g4 = i2.indexOf(
|
|
243
|
+
d3.push(i2.substring(z3, m4).replace(_3, F4)), i2[z3 = m4 + 1 + y6 + e] !== F4 && (m4 = i2.indexOf(F4, z3)), p4 = i2.indexOf(S, z3), g4 = i2.indexOf(O3, z3);
|
|
244
244
|
break;
|
|
245
245
|
}
|
|
246
246
|
y6 = v3(g4);
|
|
247
|
-
if (i2.substring(m4 + 1 + y6, m4 + 1 + y6 + s2) ===
|
|
248
|
-
if (d3.push(i2.substring(z3, m4).replace(_3, F4)), b4(m4 + 1 + y6 + s2), p4 = i2.indexOf(S, z3), m4 = i2.indexOf(F4, z3), o2 && (
|
|
249
|
-
if (
|
|
247
|
+
if (i2.substring(m4 + 1 + y6, m4 + 1 + y6 + s2) === O3) {
|
|
248
|
+
if (d3.push(i2.substring(z3, m4).replace(_3, F4)), b4(m4 + 1 + y6 + s2), p4 = i2.indexOf(S, z3), m4 = i2.indexOf(F4, z3), o2 && (R2(), M4)) return w2();
|
|
249
|
+
if (A2 && h4.length >= A2) 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: h4.length, index: z3 }), m4++;
|
|
@@ -254,14 +254,14 @@ var require_papaparse_min = __commonJS({
|
|
|
254
254
|
}
|
|
255
255
|
else if (x3 && 0 === d3.length && i2.substring(z3, z3 + a4) === x3) {
|
|
256
256
|
if (-1 === g4) return w2();
|
|
257
|
-
z3 = g4 + s2, g4 = i2.indexOf(
|
|
257
|
+
z3 = g4 + s2, g4 = i2.indexOf(O3, z3), p4 = i2.indexOf(S, z3);
|
|
258
258
|
} else if (-1 !== p4 && (p4 < g4 || -1 === g4)) d3.push(i2.substring(z3, p4)), z3 = p4 + e, p4 = i2.indexOf(S, z3);
|
|
259
259
|
else {
|
|
260
260
|
if (-1 === g4) break;
|
|
261
|
-
if (d3.push(i2.substring(z3, g4)), b4(g4 + s2), o2 && (
|
|
262
|
-
if (
|
|
261
|
+
if (d3.push(i2.substring(z3, g4)), b4(g4 + s2), o2 && (R2(), M4)) return w2();
|
|
262
|
+
if (A2 && h4.length >= A2) return w2(true);
|
|
263
263
|
}
|
|
264
|
-
return
|
|
264
|
+
return E4();
|
|
265
265
|
function k2(e2) {
|
|
266
266
|
h4.push(e2), f5 = z3;
|
|
267
267
|
}
|
|
@@ -269,19 +269,19 @@ var require_papaparse_min = __commonJS({
|
|
|
269
269
|
var t2 = 0;
|
|
270
270
|
return t2 = -1 !== e2 && (e2 = i2.substring(m4 + 1, e2)) && "" === e2.trim() ? e2.length : t2;
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
return r2 || (void 0 === e2 && (e2 = i2.substring(z3)), d3.push(e2), z3 = n2, k2(d3), o2 &&
|
|
272
|
+
function E4(e2) {
|
|
273
|
+
return r2 || (void 0 === e2 && (e2 = i2.substring(z3)), d3.push(e2), z3 = n2, k2(d3), o2 && R2()), w2();
|
|
274
274
|
}
|
|
275
275
|
function b4(e2) {
|
|
276
|
-
z3 = e2, k2(d3), d3 = [], g4 = i2.indexOf(
|
|
276
|
+
z3 = e2, k2(d3), d3 = [], g4 = i2.indexOf(O3, z3);
|
|
277
277
|
}
|
|
278
278
|
function w2(e2) {
|
|
279
|
-
if (
|
|
279
|
+
if (C.header && !t && h4.length && !L2) {
|
|
280
280
|
var s4 = h4[0], a5 = /* @__PURE__ */ Object.create(null), o4 = new Set(s4);
|
|
281
281
|
let n4 = false;
|
|
282
282
|
for (let r4 = 0; r4 < s4.length; r4++) {
|
|
283
283
|
let i4 = P4(s4[r4]);
|
|
284
|
-
if (a5[i4 = q3(
|
|
284
|
+
if (a5[i4 = q3(C.transformHeader) ? C.transformHeader(i4, r4) : i4]) {
|
|
285
285
|
let e4, t2 = a5[i4];
|
|
286
286
|
for (; e4 = i4 + "_" + t2, t2++, o4.has(e4); ) ;
|
|
287
287
|
o4.add(e4), s4[r4] = e4, a5[i4]++, n4 = true, (D4 = null === D4 ? {} : D4)[e4] = i4;
|
|
@@ -290,9 +290,9 @@ var require_papaparse_min = __commonJS({
|
|
|
290
290
|
}
|
|
291
291
|
n4 && console.warn("Duplicate headers found and renamed."), L2 = true;
|
|
292
292
|
}
|
|
293
|
-
return { data: h4, errors: u5, meta: { delimiter: S, linebreak:
|
|
293
|
+
return { data: h4, errors: u5, meta: { delimiter: S, linebreak: O3, aborted: M4, truncated: !!e2, cursor: f5 + (t || 0), renamedHeaders: D4 } };
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function R2() {
|
|
296
296
|
I2(w2()), h4 = [], u5 = [];
|
|
297
297
|
}
|
|
298
298
|
}, this.abort = function() {
|
|
@@ -398,7 +398,7 @@ var require_papaparse_min = __commonJS({
|
|
|
398
398
|
return false;
|
|
399
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
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 =
|
|
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 = E2, v2.ParserHandle = i, v2.NetworkStreamer = f4, v2.FileStreamer = l, v2.StringStreamer = c2, v2.ReadableStreamStreamer = p2, n.jQuery && ((d2 = n.jQuery).fn.parse = function(o2) {
|
|
402
402
|
var i2 = o2.config || {}, h4 = [];
|
|
403
403
|
return this.each(function(e2) {
|
|
404
404
|
if (!("INPUT" === d2(this).prop("tagName").toUpperCase() && "file" === d2(this).attr("type").toLowerCase() && n.FileReader) || !this.files || 0 === this.files.length) return true;
|
|
@@ -499,10 +499,10 @@ function f(t) {
|
|
|
499
499
|
return t > EPS ? Math.cbrt(t) : (KAPPA * t + 16) / 116;
|
|
500
500
|
}
|
|
501
501
|
function rgbToLab(r, g3, b2) {
|
|
502
|
-
const
|
|
503
|
-
const X2 = 0.4124564 *
|
|
504
|
-
const Y2 = 0.2126729 *
|
|
505
|
-
const Z3 = 0.0193339 *
|
|
502
|
+
const R2 = linearise(r), G3 = linearise(g3), B2 = linearise(b2);
|
|
503
|
+
const X2 = 0.4124564 * R2 + 0.3575761 * G3 + 0.1804375 * B2;
|
|
504
|
+
const Y2 = 0.2126729 * R2 + 0.7151522 * G3 + 0.072175 * B2;
|
|
505
|
+
const Z3 = 0.0193339 * R2 + 0.119192 * G3 + 0.9503041 * B2;
|
|
506
506
|
const fx = f(X2 / Xn), fy = f(Y2 / Yn), fz = f(Z3 / Zn);
|
|
507
507
|
return { L: 116 * fy - 16, a: 500 * (fx - fy), b: 200 * (fy - fz) };
|
|
508
508
|
}
|
|
@@ -764,15 +764,15 @@ function resolveAutoColorScale(p2) {
|
|
|
764
764
|
};
|
|
765
765
|
const candidates = p2.isHighContrast ? [normHex(p2.themeAccent), normHex(p2.themeFg)] : [...palette.map(normHex), normHex(p2.themeAccent), normHex(p2.themeFg)];
|
|
766
766
|
const accent = candidates.find(usable) ?? FALLBACK_ACCENT;
|
|
767
|
-
const
|
|
767
|
+
const A2 = hexToLab(accent);
|
|
768
768
|
let t = 0.1;
|
|
769
|
-
let low = mixLab(bg,
|
|
769
|
+
let low = mixLab(bg, A2, t);
|
|
770
770
|
while (t < 0.6 && deltaE2000(paintedOver(labToHex(low), canvas, AUTO_RAMP_DRAWN_OPACITY), bg) < SAME_SHADE_DELTA_E) {
|
|
771
771
|
t += 0.02;
|
|
772
|
-
low = mixLab(bg,
|
|
772
|
+
low = mixLab(bg, A2, t);
|
|
773
773
|
}
|
|
774
774
|
const lowHex = labToHex(low);
|
|
775
|
-
let high = { ...
|
|
775
|
+
let high = { ...A2 };
|
|
776
776
|
let highHex = labToHex(high);
|
|
777
777
|
for (let step = 0; step < 80 && autoRampMinStep(lowHex, highHex, canvas) < AUTO_RAMP_MIN_STEP_DELTA_E; step++) {
|
|
778
778
|
const L2 = Math.max(4, Math.min(98, high.L + (darkCanvas ? 1 : -1)));
|
|
@@ -1226,14 +1226,14 @@ function A3(n) {
|
|
|
1226
1226
|
if (r && i && c3(r) !== i && (r = null), n.city !== void 0 && n.city !== null) {
|
|
1227
1227
|
let a2 = u(String(n.city)), s = O(a2), f4 = s ? F(s, n.mapKind) : null;
|
|
1228
1228
|
if (f4 && f4.length) {
|
|
1229
|
-
let d2 = n.state === void 0 || n.state === null ? "" : String(n.state).trim(),
|
|
1229
|
+
let d2 = n.state === void 0 || n.state === null ? "" : String(n.state).trim(), R2 = d2 ? u(d2) : "", g3 = d2 ? Y(d2) : null, S = [], m2 = -1;
|
|
1230
1230
|
for (let c2 of f4) {
|
|
1231
|
-
let l = c2.row,
|
|
1232
|
-
if (d2 && l.a1 !== "") if (g3 && l.a1 === g3 || u(l.a1) ===
|
|
1231
|
+
let l = c2.row, A2 = 0;
|
|
1232
|
+
if (d2 && l.a1 !== "") if (g3 && l.a1 === g3 || u(l.a1) === R2) A2++;
|
|
1233
1233
|
else continue;
|
|
1234
|
-
if (i) if (T(l.cc) === i)
|
|
1234
|
+
if (i) if (T(l.cc) === i) A2++;
|
|
1235
1235
|
else continue;
|
|
1236
|
-
|
|
1236
|
+
A2 > m2 ? (m2 = A2, S = [c2]) : A2 === m2 && S.push(c2);
|
|
1237
1237
|
}
|
|
1238
1238
|
S.some((c2) => c2.primary) && (S = S.filter((c2) => c2.primary));
|
|
1239
1239
|
let p2 = /* @__PURE__ */ new Map();
|
|
@@ -1262,26 +1262,26 @@ function A3(n) {
|
|
|
1262
1262
|
var G = { latlon: 0, city: 1, zip3: 2, state: 3, country: 4 };
|
|
1263
1263
|
var x = 8;
|
|
1264
1264
|
function y3(n, e) {
|
|
1265
|
-
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(), f4 = [], d2 = /* @__PURE__ */ new Set(),
|
|
1265
|
+
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(), f4 = [], d2 = /* @__PURE__ */ new Set(), R2 = [], g3 = { latlon: 0, city: 0, zip3: 0, state: 0, country: 0 }, S = 0, m2 = 0, p2 = null;
|
|
1266
1266
|
for (let l = 0; l < n.length; ++l) {
|
|
1267
|
-
let
|
|
1268
|
-
if (S3(
|
|
1267
|
+
let A2 = n[l], C = A3({ ...A2, mapKind: e });
|
|
1268
|
+
if (S3(C)) {
|
|
1269
1269
|
t[l] = null, o[l] = null, i[l] = null, m2++;
|
|
1270
|
-
let M4 = K(
|
|
1271
|
-
M4 && !d2.has(M4.toLowerCase()) && (d2.add(M4.toLowerCase()),
|
|
1272
|
-
} else if (
|
|
1273
|
-
if (t[l] =
|
|
1274
|
-
let M4 = K(
|
|
1270
|
+
let M4 = K(A2);
|
|
1271
|
+
M4 && !d2.has(M4.toLowerCase()) && (d2.add(M4.toLowerCase()), R2.length < x && R2.push(M4));
|
|
1272
|
+
} else if (C) {
|
|
1273
|
+
if (t[l] = C.lat, o[l] = C.lon, i[l] = C.precision, S++, g3[C.precision]++, (p2 === null || G[C.precision] > G[p2]) && (p2 = C.precision), G[C.precision] > G.city) {
|
|
1274
|
+
let M4 = K(A2);
|
|
1275
1275
|
M4 && !s.has(M4.toLowerCase()) && (s.add(M4.toLowerCase()), f4.length < x && f4.push(M4));
|
|
1276
1276
|
}
|
|
1277
1277
|
} else {
|
|
1278
1278
|
t[l] = null, o[l] = null, i[l] = null;
|
|
1279
|
-
let M4 = K(
|
|
1279
|
+
let M4 = K(A2);
|
|
1280
1280
|
M4 && !r.has(M4.toLowerCase()) && (r.add(M4.toLowerCase()), a2.push(M4));
|
|
1281
1281
|
}
|
|
1282
1282
|
}
|
|
1283
1283
|
let c2 = !n3() && n.some((l) => l.city !== null && l.city !== void 0 && String(l.city).trim() !== "");
|
|
1284
|
-
return { lat: t, lon: o, precisions: i, precision: p2, precisionCounts: g3, coarseExamples: f4, unmatched: a2, ambiguousRows: m2, ambiguousExamples:
|
|
1284
|
+
return { lat: t, lon: o, precisions: i, precision: p2, precisionCounts: g3, coarseExamples: f4, unmatched: a2, ambiguousRows: m2, ambiguousExamples: R2, matchedRows: S, totalRows: n.length, ...c2 ? { cityTableMissing: true } : {} };
|
|
1285
1285
|
}
|
|
1286
1286
|
function K(n) {
|
|
1287
1287
|
let e = [n.city, n.state, n.zip, n.country].filter((t) => t != null && String(t).trim() !== "").map((t) => String(t).trim()).join(", ");
|
|
@@ -1293,12 +1293,12 @@ function p3(n, e) {
|
|
|
1293
1293
|
return t ? F(t, e).length > 0 : false;
|
|
1294
1294
|
}
|
|
1295
1295
|
|
|
1296
|
-
// ../shape-core/dist/chunk-
|
|
1296
|
+
// ../shape-core/dist/chunk-GPX2G67N.mjs
|
|
1297
1297
|
/*! @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. */
|
|
1298
|
-
function
|
|
1298
|
+
function T2(t) {
|
|
1299
1299
|
return t ? t.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_\-./]+/g, " ").toLowerCase().split(/\s+/).filter((e) => e.length > 0) : [];
|
|
1300
1300
|
}
|
|
1301
|
-
function
|
|
1301
|
+
function R(t) {
|
|
1302
1302
|
let e = Date.parse(t);
|
|
1303
1303
|
if (isNaN(e)) return null;
|
|
1304
1304
|
let n = new Date(e);
|
|
@@ -1336,7 +1336,7 @@ function F2(t, e) {
|
|
|
1336
1336
|
}
|
|
1337
1337
|
return n;
|
|
1338
1338
|
}
|
|
1339
|
-
function
|
|
1339
|
+
function h2(t, e) {
|
|
1340
1340
|
let n = F2(t, e);
|
|
1341
1341
|
return n.length === 0 ? { rows: e, columns: n } : { rows: e.map((r) => {
|
|
1342
1342
|
if (!r) return r;
|
|
@@ -1352,7 +1352,7 @@ var f2 = /^\s*\d{4}(-\d{2}(-\d{2})?)?\s*$/;
|
|
|
1352
1352
|
var g = /(?:Z|[+-]\d{2}:?\d{2})$/i;
|
|
1353
1353
|
var d = /\b(?:GMT|UTC)\b/i;
|
|
1354
1354
|
|
|
1355
|
-
// ../shape-core/dist/chunk-
|
|
1355
|
+
// ../shape-core/dist/chunk-2AGC3A7S.mjs
|
|
1356
1356
|
/*! @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. */
|
|
1357
1357
|
var St = "006007008009010011012013014015016017018019020021022023024025026027028029030031032033034035036037038039040041042043044045046047048049050051052053054056057058059060061062063064065066067068069070071072073074075076077078079080081082083084085086087088089100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191193194195196197198199200201202203204205206207208209210211212214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310312313314315316317318319320321322323324325326327328329330331333334335336337338339341342344346347349350351352354355356357358359360361362363364365366367368369370371372373374376377378379380381382383384385386387388389390391392393394395396397398400401402403404405406407408409410411412413414415416417418420421422423424425426427430431432433434435436437438439440441442443444445446447448449450451452453454455456457458460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508510511512513514515516520521522523524525526527528530531532534535537538539540541542543544545546547548549550551553554556557558559560561562563564565566567570571572573574575576577580581582583584585586587588590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620622623624625626627628629630631633634635636637638639640641644645646647648650651652653654655656657658660661662664665666667668669670671672673674675676677678679680681683684685686687688689690691692693700701703704705706707708710711712713714716717718719720721722723724725726727728729730731734735736737738739740741743744745746747748749750751752753754755756757758759760761762763764765766767768769770772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816820821822823824825826827828829830831832833834835836837838840841843844845846847850851852853855856857859860863864865870871873874875877878879880881882883884890891893894895897898900902903904905906907908910911912913914915916917918919920921922923924925926927928930931932933934935936937939940941943944945946947948949950951952953954955956957958959960961967968969970971972973974975976977978979980981982983984985986988989990991992993994995996997998999";
|
|
1358
1358
|
var w = new Set(St.match(/.{3}/g) ?? []);
|
|
@@ -1377,9 +1377,9 @@ function g2(n) {
|
|
|
1377
1377
|
return u(n);
|
|
1378
1378
|
}
|
|
1379
1379
|
var rt = /* @__PURE__ */ new Set(["zip", "zipcode", "postal", "postcode", "plz"]);
|
|
1380
|
-
function
|
|
1380
|
+
function y2(n, s) {
|
|
1381
1381
|
if (!n) return false;
|
|
1382
|
-
for (let i of
|
|
1382
|
+
for (let i of T2(n)) if (s.has(i)) return true;
|
|
1383
1383
|
return false;
|
|
1384
1384
|
}
|
|
1385
1385
|
function Mt(n, s) {
|
|
@@ -1424,8 +1424,8 @@ function It(n, s) {
|
|
|
1424
1424
|
function Wt(n, s) {
|
|
1425
1425
|
let i = new Array(n.length), r = /* @__PURE__ */ new Set(), M4 = [], h3 = 0;
|
|
1426
1426
|
for (let N2 = 0; N2 < n.length; ++N2) {
|
|
1427
|
-
let I2 = Mt(n[N2], s),
|
|
1428
|
-
if (i[N2] =
|
|
1427
|
+
let I2 = Mt(n[N2], s), O3 = I2 !== null && It(I2, s) ? I2 : null;
|
|
1428
|
+
if (i[N2] = O3, O3 !== null) h3++;
|
|
1429
1429
|
else {
|
|
1430
1430
|
let d2 = n[N2];
|
|
1431
1431
|
if (d2 != null) {
|
|
@@ -1440,7 +1440,7 @@ function Wt(n, s) {
|
|
|
1440
1440
|
return { iso: i, unmatched: M4, matchedRows: h3, totalRows: n.length };
|
|
1441
1441
|
}
|
|
1442
1442
|
|
|
1443
|
-
// ../shape-core/dist/chunk-
|
|
1443
|
+
// ../shape-core/dist/chunk-BZVL57QR.mjs
|
|
1444
1444
|
var import_papaparse = __toESM(require_papaparse_min(), 1);
|
|
1445
1445
|
/*! @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. */
|
|
1446
1446
|
var Ae = { "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" };
|
|
@@ -1491,7 +1491,7 @@ function nt(n) {
|
|
|
1491
1491
|
function we(n, e) {
|
|
1492
1492
|
if (!e) return false;
|
|
1493
1493
|
let t = xe(e);
|
|
1494
|
-
return n.test(j2(nt(e))) || n.test(j2(t)) || n.test(j2(
|
|
1494
|
+
return n.test(j2(nt(e))) || n.test(j2(t)) || n.test(j2(T2(t).join(" ")));
|
|
1495
1495
|
}
|
|
1496
1496
|
function Ee(n) {
|
|
1497
1497
|
return we(Je, n);
|
|
@@ -1544,12 +1544,12 @@ function Kt(n, e) {
|
|
|
1544
1544
|
|
|
1545
1545
|
// ../shape-core/dist/index.mjs
|
|
1546
1546
|
/*! @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. */
|
|
1547
|
-
var
|
|
1547
|
+
var O2 = 2;
|
|
1548
1548
|
var Z2 = 400;
|
|
1549
|
-
function
|
|
1549
|
+
function z2(r) {
|
|
1550
1550
|
return !!E(r);
|
|
1551
1551
|
}
|
|
1552
|
-
function
|
|
1552
|
+
function A(r) {
|
|
1553
1553
|
let n = /* @__PURE__ */ new Set();
|
|
1554
1554
|
for (let e of r) {
|
|
1555
1555
|
if (e == null) continue;
|
|
@@ -1558,10 +1558,10 @@ function P2(r) {
|
|
|
1558
1558
|
}
|
|
1559
1559
|
return Array.from(n);
|
|
1560
1560
|
}
|
|
1561
|
-
function
|
|
1562
|
-
let n =
|
|
1561
|
+
function P2(r) {
|
|
1562
|
+
let n = A(r);
|
|
1563
1563
|
if (n.length === 0 || G2(r) < 95) return false;
|
|
1564
|
-
let e = n.filter((c2) =>
|
|
1564
|
+
let e = n.filter((c2) => z2(c2) && !Y(c2)).length, s = n.filter((c2) => !z2(c2) && !!Y(c2)).length;
|
|
1565
1565
|
return e >= 1 && e >= s;
|
|
1566
1566
|
}
|
|
1567
1567
|
function W2(r, n) {
|
|
@@ -1570,14 +1570,14 @@ function W2(r, n) {
|
|
|
1570
1570
|
return e ? n === "world" ? true : s3.has(e) : false;
|
|
1571
1571
|
}
|
|
1572
1572
|
function G2(r) {
|
|
1573
|
-
let n =
|
|
1573
|
+
let n = A(r);
|
|
1574
1574
|
if (n.length === 0) return 0;
|
|
1575
1575
|
let e = 0;
|
|
1576
|
-
for (let s of n)
|
|
1576
|
+
for (let s of n) z2(s) && e++;
|
|
1577
1577
|
return Math.round(e / n.length * 1e3) / 10;
|
|
1578
1578
|
}
|
|
1579
1579
|
function M2(r) {
|
|
1580
|
-
let n =
|
|
1580
|
+
let n = A(r);
|
|
1581
1581
|
if (n.length === 0) return 0;
|
|
1582
1582
|
let e = 0;
|
|
1583
1583
|
for (let s of n) Y(s) && e++;
|
|
@@ -1600,30 +1600,30 @@ function $2(r) {
|
|
|
1600
1600
|
return Math.round(e / n.length * 1e3) / 10;
|
|
1601
1601
|
}
|
|
1602
1602
|
function q2(r, n) {
|
|
1603
|
-
return
|
|
1603
|
+
return y2(n, rt) ? true : F3(r).some((e) => /^\d{5}(-\d{4})?$/.test(e.replace(/\.0+$/, "")));
|
|
1604
1604
|
}
|
|
1605
|
-
function
|
|
1606
|
-
let e =
|
|
1605
|
+
function ue(r, n) {
|
|
1606
|
+
let e = A(r);
|
|
1607
1607
|
if (e.length === 0) return 0;
|
|
1608
1608
|
let s = 0;
|
|
1609
1609
|
for (let c2 of e) p3(c2, n) && s++;
|
|
1610
1610
|
return Math.round(s / e.length * 1e3) / 10;
|
|
1611
1611
|
}
|
|
1612
|
-
function
|
|
1612
|
+
function D3(r, n) {
|
|
1613
1613
|
let e = 0;
|
|
1614
|
-
for (let s of
|
|
1614
|
+
for (let s of A(r)) n(s) && e++;
|
|
1615
1615
|
return e;
|
|
1616
1616
|
}
|
|
1617
|
-
function
|
|
1617
|
+
function fe(r, n) {
|
|
1618
1618
|
let e = 0;
|
|
1619
1619
|
for (let s of F3(r)) n(s) && e++;
|
|
1620
1620
|
return e;
|
|
1621
1621
|
}
|
|
1622
|
-
function
|
|
1623
|
-
let
|
|
1622
|
+
function pe(r, n, e, s, c2) {
|
|
1623
|
+
let C = [], u4 = [], o = {}, _2 = {}, v2 = new Set(r), l = (t) => n.map((i) => i[t]);
|
|
1624
1624
|
for (let t of ["city", "country"]) {
|
|
1625
1625
|
let i = e?.[t];
|
|
1626
|
-
i &&
|
|
1626
|
+
i && v2.has(i) && (o[t] = i);
|
|
1627
1627
|
}
|
|
1628
1628
|
let X2 = new Set(c2 ?? r);
|
|
1629
1629
|
for (let t of ["lat", "lon"]) {
|
|
@@ -1631,60 +1631,60 @@ function fe(r, n, e, s, c2) {
|
|
|
1631
1631
|
i && X2.has(i) && (o[t] = i);
|
|
1632
1632
|
}
|
|
1633
1633
|
let d2 = e?.zip;
|
|
1634
|
-
if (d2 &&
|
|
1634
|
+
if (d2 && v2.has(d2)) {
|
|
1635
1635
|
let t = l(d2), i = $2(t);
|
|
1636
1636
|
i < 95 ? u4.push(`zip=${d2} (only ${i}% of values read as ZIPs)`) : q2(t, d2) ? o.zip = d2 : u4.push(`zip=${d2} (all values are 3-4 digits with nothing to say they are postal)`);
|
|
1637
1637
|
}
|
|
1638
1638
|
let p2 = e?.state;
|
|
1639
|
-
if (p2 &&
|
|
1640
|
-
let t = l(p2), i =
|
|
1641
|
-
i.length > 0 && i.every((a2) => W2(a2, s)) ? u4.push(`state=${p2} (every value is "CA", which is both Canada and California)`) :
|
|
1639
|
+
if (p2 && v2.has(p2)) {
|
|
1640
|
+
let t = l(p2), i = A(t);
|
|
1641
|
+
i.length > 0 && i.every((a2) => W2(a2, s)) ? 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)) : M2(t) < 95 ? u4.push(`state=${p2} (only ${M2(t)}% of values are states/provinces)`) : o.state = p2;
|
|
1642
1642
|
}
|
|
1643
|
-
let g3 = new Set(Object.values(o).filter(Boolean)),
|
|
1643
|
+
let g3 = new Set(Object.values(o).filter(Boolean)), T3 = r.filter((t) => !g3.has(t) && !t.startsWith("__"));
|
|
1644
1644
|
if (!o.state) {
|
|
1645
1645
|
let t = null;
|
|
1646
|
-
for (let i of
|
|
1646
|
+
for (let i of T3) {
|
|
1647
1647
|
let a2 = l(i);
|
|
1648
|
-
if (
|
|
1648
|
+
if (P2(a2)) continue;
|
|
1649
1649
|
let f4 = M2(a2);
|
|
1650
1650
|
if (f4 < 95) continue;
|
|
1651
|
-
let k2 =
|
|
1652
|
-
k2 <
|
|
1651
|
+
let k2 = D3(a2, (x3) => !!Y(x3)), Y2 = D3(a2, (x3) => !!Y(x3) && !W2(x3, s));
|
|
1652
|
+
k2 < O2 && Y2 < 1 || (!t || f4 > t.pct) && (t = { name: i, pct: f4 });
|
|
1653
1653
|
}
|
|
1654
|
-
t && (o.state = t.name, g3.add(t.name),
|
|
1654
|
+
t && (o.state = t.name, g3.add(t.name), C.push(`state=${t.name} (${t.pct}% states/provinces)`));
|
|
1655
1655
|
}
|
|
1656
|
-
if (!o.zip) for (let t of
|
|
1656
|
+
if (!o.zip) for (let t of T3) {
|
|
1657
1657
|
if (g3.has(t)) continue;
|
|
1658
1658
|
let i = l(t), a2 = $2(i);
|
|
1659
|
-
if (!(a2 < 95) && q2(i, t) && !(
|
|
1660
|
-
o.zip = t, g3.add(t),
|
|
1659
|
+
if (!(a2 < 95) && q2(i, t) && !(fe(i, (f4) => Z(f4).length > 0) < O2)) {
|
|
1660
|
+
o.zip = t, g3.add(t), C.push(`zip=${t} (${a2}% ZIP codes)`);
|
|
1661
1661
|
break;
|
|
1662
1662
|
}
|
|
1663
1663
|
}
|
|
1664
1664
|
let h3 = o.country;
|
|
1665
|
-
if (!h3 || !
|
|
1665
|
+
if (!h3 || !P2(l(h3))) {
|
|
1666
1666
|
let t = null;
|
|
1667
|
-
for (let i of
|
|
1668
|
-
if (g3.has(i) || !
|
|
1667
|
+
for (let i of T3) {
|
|
1668
|
+
if (g3.has(i) || !P2(l(i))) continue;
|
|
1669
1669
|
let a2 = G2(l(i));
|
|
1670
1670
|
(!t || a2 > t.pct) && (t = { name: i, pct: a2 });
|
|
1671
1671
|
}
|
|
1672
|
-
t && (h3 && (u4.push(`country=${h3} (only ${G2(l(h3))}% of values are country identifiers; using ${t.name} instead)`),
|
|
1672
|
+
t && (h3 && (u4.push(`country=${h3} (only ${G2(l(h3))}% of values are country identifiers; using ${t.name} instead)`), _2.country = h3), o.country = t.name, g3.add(t.name), C.push(`country=${t.name}`));
|
|
1673
1673
|
}
|
|
1674
1674
|
if (!o.city) {
|
|
1675
1675
|
let t = null;
|
|
1676
|
-
for (let i of
|
|
1676
|
+
for (let i of T3) {
|
|
1677
1677
|
if (g3.has(i)) continue;
|
|
1678
|
-
let a2 = l(i), f4 =
|
|
1679
|
-
f4 < m3 ||
|
|
1678
|
+
let a2 = l(i), f4 = ue(a2, s);
|
|
1679
|
+
f4 < m3 || D3(a2, (k2) => p3(k2, s)) < O2 || (!t || f4 > t.pct) && (t = { name: i, pct: f4 });
|
|
1680
1680
|
}
|
|
1681
|
-
t && (o.city = t.name,
|
|
1681
|
+
t && (o.city = t.name, C.push(`city=${t.name} (${t.pct}% known cities)`));
|
|
1682
1682
|
}
|
|
1683
|
-
let B2 = o.country ? l(o.country) : [], L2 = !!o.country &&
|
|
1683
|
+
let B2 = o.country ? l(o.country) : [], L2 = !!o.country && P2(B2), j3 = L2 ? new Set(B2.map((t) => E(t == null ? null : String(t))).filter(Boolean)).size : 0, K2 = L2 && j3 >= 2, N2 = !!(o.lat && o.lon) && n.some((t) => {
|
|
1684
1684
|
let i = +String(t[o.lat] ?? "").trim(), a2 = +String(t[o.lon] ?? "").trim();
|
|
1685
1685
|
return isFinite(i) && isFinite(a2) && i >= -90 && i <= 90 && a2 >= -180 && a2 <= 180 && String(t[o.lat] ?? "").trim() !== "" && String(t[o.lon] ?? "").trim() !== "";
|
|
1686
1686
|
});
|
|
1687
|
-
return o.lat && o.lon && !N2 && u4.push(`lat/lon=${o.lat}/${o.lon} (no row holds a usable coordinate pair)`), o.country && !K2 && !(o.city || o.state || o.zip || N2) && u4.push(L2 ? `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 || N2) ? o : null, backfilled:
|
|
1687
|
+
return o.lat && o.lon && !N2 && u4.push(`lat/lon=${o.lat}/${o.lon} (no row holds a usable coordinate pair)`), o.country && !K2 && !(o.city || o.state || o.zip || N2) && u4.push(L2 ? `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 || N2) ? o : null, backfilled: C, refused: u4, ...Object.keys(_2).length ? { labelFallback: _2 } : {} };
|
|
1688
1688
|
}
|
|
1689
1689
|
|
|
1690
1690
|
// src/payload.ts
|
|
@@ -1699,7 +1699,7 @@ function resolvePointChannel(cols, rowObjs, point) {
|
|
|
1699
1699
|
let labelCol;
|
|
1700
1700
|
if (bind) {
|
|
1701
1701
|
const dims = cols.filter((c2) => !c2.isMeasure).map((c2) => c2.name);
|
|
1702
|
-
const res =
|
|
1702
|
+
const res = pe(dims, rowObjs, bind, point?.mapKind, cols.map((c2) => c2.name));
|
|
1703
1703
|
bind = res.bind;
|
|
1704
1704
|
rolesBackfilled = res.backfilled;
|
|
1705
1705
|
rolesRefused = res.refused;
|
|
@@ -1747,7 +1747,7 @@ function buildRenderPayload(cols, rowObjs, geo, point, destination, opts) {
|
|
|
1747
1747
|
const colNames = cols.map((c2) => c2.name);
|
|
1748
1748
|
let utcDayColumns = null;
|
|
1749
1749
|
if (opts?.utcDays) {
|
|
1750
|
-
const norm =
|
|
1750
|
+
const norm = h2(cols, rowObjs);
|
|
1751
1751
|
rowObjs = norm.rows;
|
|
1752
1752
|
utcDayColumns = norm.columns;
|
|
1753
1753
|
}
|
|
@@ -1830,8 +1830,8 @@ function buildRenderPayload(cols, rowObjs, geo, point, destination, opts) {
|
|
|
1830
1830
|
function createMarkResolver(env) {
|
|
1831
1831
|
const { root, doc, log } = env;
|
|
1832
1832
|
const isElement = (t) => {
|
|
1833
|
-
const
|
|
1834
|
-
if (
|
|
1833
|
+
const E2 = doc?.defaultView?.Element ?? globalThis.Element;
|
|
1834
|
+
if (E2 && t instanceof E2) return true;
|
|
1835
1835
|
return !!t && typeof t.closest === "function" && typeof t.getAttribute === "function";
|
|
1836
1836
|
};
|
|
1837
1837
|
const viewStyle = (n) => {
|
|
@@ -1957,8 +1957,8 @@ function createMarkResolver(env) {
|
|
|
1957
1957
|
for (const n of all) {
|
|
1958
1958
|
const tag = (n.tagName || "").toLowerCase();
|
|
1959
1959
|
if (!SHAPE.test(tag)) continue;
|
|
1960
|
-
const
|
|
1961
|
-
if (
|
|
1960
|
+
const pe2 = viewStyle(n);
|
|
1961
|
+
if (pe2 && pe2 !== "none") return true;
|
|
1962
1962
|
}
|
|
1963
1963
|
return false;
|
|
1964
1964
|
};
|
|
@@ -3338,7 +3338,16 @@ function createChartHost(container, config) {
|
|
|
3338
3338
|
if (!el) el = resolver.penetrateOverlayAt(e?.clientX, e?.clientY, clickSel);
|
|
3339
3339
|
if (!el) el = resolver.resolveByGeometry(e?.clientX, e?.clientY, clickSel);
|
|
3340
3340
|
if (!el) {
|
|
3341
|
-
if (current && current.length)
|
|
3341
|
+
if (current && current.length) {
|
|
3342
|
+
const slot = container[CONTAINER_SLOT_XF_CLEAR];
|
|
3343
|
+
if (typeof slot === "function") {
|
|
3344
|
+
try {
|
|
3345
|
+
slot();
|
|
3346
|
+
} catch {
|
|
3347
|
+
}
|
|
3348
|
+
}
|
|
3349
|
+
if (current && current.length) notify([], "user");
|
|
3350
|
+
}
|
|
3342
3351
|
return;
|
|
3343
3352
|
}
|
|
3344
3353
|
const rows = parseRowIdxs(el.getAttribute(ROW_IDX_ATTR));
|
|
@@ -3572,7 +3581,7 @@ export {
|
|
|
3572
3581
|
registerGeoAsset,
|
|
3573
3582
|
clearGeoCache,
|
|
3574
3583
|
L3,
|
|
3575
|
-
|
|
3584
|
+
R,
|
|
3576
3585
|
u2 as u,
|
|
3577
3586
|
Oe,
|
|
3578
3587
|
Le,
|
package/dist/index.mjs
CHANGED
|
@@ -57,6 +57,7 @@ import {
|
|
|
57
57
|
PILL_MIN_ALPHA,
|
|
58
58
|
PILL_MIN_COVERAGE,
|
|
59
59
|
PILL_OPAQUE_ALPHA,
|
|
60
|
+
R,
|
|
60
61
|
ROW_IDX_ATTR,
|
|
61
62
|
SAME_SHADE_DELTA_E,
|
|
62
63
|
SCROLL_SLACK_PX,
|
|
@@ -126,9 +127,8 @@ import {
|
|
|
126
127
|
toRGBA,
|
|
127
128
|
u,
|
|
128
129
|
unpinScrolledAxis,
|
|
129
|
-
valuePlacementFlag
|
|
130
|
-
|
|
131
|
-
} from "./chunk-LYHB5MUX.mjs";
|
|
130
|
+
valuePlacementFlag
|
|
131
|
+
} from "./chunk-VPCD6LVR.mjs";
|
|
132
132
|
import "./chunk-A2GMXZP7.mjs";
|
|
133
133
|
import "./chunk-GHODWOAL.mjs";
|
|
134
134
|
|
|
@@ -885,7 +885,7 @@ var ISO_LIKE_RE = /^\s*\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(
|
|
|
885
885
|
function toDate(raw) {
|
|
886
886
|
if (raw instanceof Date) return isNaN(raw.getTime()) ? null : raw;
|
|
887
887
|
if (typeof raw !== "string" || !ISO_LIKE_RE.test(raw)) return null;
|
|
888
|
-
const d2 =
|
|
888
|
+
const d2 = R(raw.trim());
|
|
889
889
|
return d2 && !isNaN(d2.getTime()) ? d2 : null;
|
|
890
890
|
}
|
|
891
891
|
function partsIn(d2, frame) {
|
|
@@ -1580,7 +1580,7 @@ function w(t2, r2, n2) {
|
|
|
1580
1580
|
}
|
|
1581
1581
|
var m = { x: [0.4124564, 0.3575761, 0.1804375], y: [0.2126729, 0.7151522, 0.072175], z: [0.0193339, 0.119192, 0.9503041] };
|
|
1582
1582
|
var M = { r: [3.2404542, -1.5371385, -0.4985314], g: [-0.969266, 1.8760108, 0.041556], b: [0.0556434, -0.2040259, 1.0572252] };
|
|
1583
|
-
var
|
|
1583
|
+
var x = 0.95047;
|
|
1584
1584
|
var _ = 1;
|
|
1585
1585
|
var C = 1.08883;
|
|
1586
1586
|
var I = 0.206896552;
|
|
@@ -1608,7 +1608,7 @@ var N = function(t2, r2, n2) {
|
|
|
1608
1608
|
};
|
|
1609
1609
|
var O = function(t2, r2, n2) {
|
|
1610
1610
|
var e2;
|
|
1611
|
-
return e2 = [t2 = t2 /
|
|
1611
|
+
return e2 = [t2 = t2 / x / 100, r2 = r2 / _ / 100, n2 = n2 / C / 100].map((function(t3) {
|
|
1612
1612
|
return t3 > k ? Math.pow(t3, 1 / 3) : (E * t3 + 16) / 116;
|
|
1613
1613
|
})), t2 = e2[0], r2 = e2[1], n2 = e2[2], [Math.max(0, 116 * r2 - 16), 500 * (t2 - r2), 200 * (r2 - n2)];
|
|
1614
1614
|
};
|
|
@@ -1616,7 +1616,7 @@ var P = function(t2, r2, n2) {
|
|
|
1616
1616
|
var e2, o2 = (t2 + 16) / 116, i2 = isNaN(r2) ? o2 : o2 + r2 / 500, a2 = isNaN(n2) ? o2 : o2 - n2 / 200;
|
|
1617
1617
|
return e2 = [i2, o2, a2].map((function(t3) {
|
|
1618
1618
|
return t3 > I ? Math.pow(t3, 3) : (116 * t3 - 16) / E;
|
|
1619
|
-
})), i2 = e2[0], o2 = e2[1], a2 = e2[2], [i2 *
|
|
1619
|
+
})), i2 = e2[0], o2 = e2[1], a2 = e2[2], [i2 * x * 100, o2 * _ * 100, a2 * C * 100];
|
|
1620
1620
|
};
|
|
1621
1621
|
var j = function(t2, r2, n2) {
|
|
1622
1622
|
return N.apply(void 0, P(t2, r2, n2));
|
|
@@ -1643,7 +1643,7 @@ var Y = Object.freeze({ __proto__: null, linear2rgb: e, rgb2linear: n, rgb2hex:
|
|
|
1643
1643
|
}, lch2xyz: L, xyY2xyz: function(t2, r2, n2) {
|
|
1644
1644
|
return 0 === r2 ? [0, 0, 0] : [t2 * (n2 / r2), n2, n2 / r2 * (1 - t2 - r2)];
|
|
1645
1645
|
}, xyz2xyY: H });
|
|
1646
|
-
function
|
|
1646
|
+
function R2(t2, n2) {
|
|
1647
1647
|
return void 0 === n2 && (n2 = false), function(e2, o2, i2) {
|
|
1648
1648
|
var a2 = i2.value;
|
|
1649
1649
|
i2.value = function() {
|
|
@@ -1714,8 +1714,8 @@ var et = function(t2, r2, n2, e2) {
|
|
|
1714
1714
|
var i2 = Object.assign({}, { l: 1, c: 1 }, e2);
|
|
1715
1715
|
return (function(t3, r3, n3, e3) {
|
|
1716
1716
|
void 0 === n3 && (n3 = 1), void 0 === e3 && (e3 = 1);
|
|
1717
|
-
var o3 = V(t3, true), i3 = o3[0], a3 = o3[1], u4 = o3[2], h3 = o3[3], c3 = o3[4], l2 = V(r3), p3 = l2[0], f2 = l2[1], s2 = l2[3], v2 = a3 - f2, b2 = i3 - p3, y2 = c3 - l2[4], d2 = F(U(h3 - s2, 2) + U(y2, 2) - U(v2, 2)), g2 = i3 < 16 ? 0.511 : 0.040975 * i3 / (1 + 0.01765 * i3), w2 = 0.0638 * a3 / (1 + 0.0131 * a3) + 0.638, m2 = 164 <= u4 && u4 <= 345 ? 0.56 + J(0.2 * $(Q(u4 + 168))) : 0.36 + J(0.4 * $(Q(u4 + 35))), M2 = F(U(a3, 4) / (U(a3, 4) + 1900)),
|
|
1718
|
-
return F(U(b2 / (n3 * g2), 2) + U(v2 / (e3 * w2), 2) + U(d2 /
|
|
1717
|
+
var o3 = V(t3, true), i3 = o3[0], a3 = o3[1], u4 = o3[2], h3 = o3[3], c3 = o3[4], l2 = V(r3), p3 = l2[0], f2 = l2[1], s2 = l2[3], v2 = a3 - f2, b2 = i3 - p3, y2 = c3 - l2[4], d2 = F(U(h3 - s2, 2) + U(y2, 2) - U(v2, 2)), g2 = i3 < 16 ? 0.511 : 0.040975 * i3 / (1 + 0.01765 * i3), w2 = 0.0638 * a3 / (1 + 0.0131 * a3) + 0.638, m2 = 164 <= u4 && u4 <= 345 ? 0.56 + J(0.2 * $(Q(u4 + 168))) : 0.36 + J(0.4 * $(Q(u4 + 35))), M2 = F(U(a3, 4) / (U(a3, 4) + 1900)), x2 = w2 * (M2 * m2 + 1 - M2);
|
|
1718
|
+
return F(U(b2 / (n3 * g2), 2) + U(v2 / (e3 * w2), 2) + U(d2 / x2, 2));
|
|
1719
1719
|
})(t2, r2, i2.l, i2.c);
|
|
1720
1720
|
}
|
|
1721
1721
|
if (o2 === rt) {
|
|
@@ -1724,8 +1724,8 @@ var et = function(t2, r2, n2, e2) {
|
|
|
1724
1724
|
void 0 === n3 && (n3 = 1), void 0 === e3 && (e3 = 1), void 0 === o3 && (o3 = 1), void 0 === i3 && (i3 = "graphic");
|
|
1725
1725
|
var a3 = "textiles" === i3 ? 0.048 : 0.045, u4 = "textiles" === i3 ? 0.014 : 0.015;
|
|
1726
1726
|
n3 = "textiles" === i3 ? 2 : n3;
|
|
1727
|
-
var h3 = V(t3), c3 = h3[0], l2 = h3[1], p3 = h3[3], f2 = h3[4], s2 = V(r3), v2 = s2[0], b2 = s2[1], y2 = s2[3], d2 = c3 - v2, g2 = l2 - b2, w2 = f2 - s2[4], m2 = 1 + a3 * l2, M2 = 1 + u4 * l2,
|
|
1728
|
-
return F(U(d2 / (1 * n3), 2) + U(g2 / (e3 * m2), 2) + U(
|
|
1727
|
+
var h3 = V(t3), c3 = h3[0], l2 = h3[1], p3 = h3[3], f2 = h3[4], s2 = V(r3), v2 = s2[0], b2 = s2[1], y2 = s2[3], d2 = c3 - v2, g2 = l2 - b2, w2 = f2 - s2[4], m2 = 1 + a3 * l2, M2 = 1 + u4 * l2, x2 = F(U(p3 - y2, 2) + U(w2, 2) - U(g2, 2));
|
|
1728
|
+
return F(U(d2 / (1 * n3), 2) + U(g2 / (e3 * m2), 2) + U(x2 / (o3 * M2), 2));
|
|
1729
1729
|
})(t2, r2, u3.kL, u3.kC, u3.kH, u3.cate);
|
|
1730
1730
|
}
|
|
1731
1731
|
if (o2 === nt) return (function(t3, r3) {
|
|
@@ -1735,7 +1735,7 @@ var et = function(t2, r2, n2, e2) {
|
|
|
1735
1735
|
var h2 = { kL: 1, kC: 1, kH: 1 }, c2 = Object.assign({}, h2, e2);
|
|
1736
1736
|
return (function(t3, r3, n3, e3, o3) {
|
|
1737
1737
|
void 0 === n3 && (n3 = 1), void 0 === e3 && (e3 = 1), void 0 === o3 && (o3 = 1);
|
|
1738
|
-
var i3 = V(t3), a3 = i3[0], u4 = i3[1], h3 = i3[3], c3 = i3[4], l2 = V(r3), p3 = l2[0], f2 = l2[1], s2 = l2[3], v2 = l2[4], b2 = (a3 + p3) / 2, y2 = (u4 + f2) / 2, d2 = (1 - F(U(y2, 7) / (U(y2, 7) + U(25, 7)))) / 2, g2 = h3 * (1 + d2), w2 = s2 * (1 + d2), m2 = F(U(g2, 2) + U(c3, 2)), M2 = F(U(w2, 2) + U(v2, 2)),
|
|
1738
|
+
var i3 = V(t3), a3 = i3[0], u4 = i3[1], h3 = i3[3], c3 = i3[4], l2 = V(r3), p3 = l2[0], f2 = l2[1], s2 = l2[3], v2 = l2[4], b2 = (a3 + p3) / 2, y2 = (u4 + f2) / 2, d2 = (1 - F(U(y2, 7) / (U(y2, 7) + U(25, 7)))) / 2, g2 = h3 * (1 + d2), w2 = s2 * (1 + d2), m2 = F(U(g2, 2) + U(c3, 2)), M2 = F(U(w2, 2) + U(v2, 2)), x2 = T(g2, c3, true), _2 = T(w2, v2, true), C2 = (m2 + M2) / 2, I2 = J(x2 - _2) > 180 ? (x2 + _2 + 360) / 2 : (x2 + _2) / 2, k2 = 1 - 0.17 * $(Q(I2 - 30)) + 0.24 * $(Q(2 * I2)) + 0.32 * $(Q(3 * I2 + 6)) - 0.2 * $(Q(4 * I2 - 63)), E2 = J(_2 - x2) <= 180 ? _2 - x2 : J(_2 - x2) > 180 && _2 <= x2 ? _2 - x2 + 360 : _2 - x2 - 360, z2 = p3 - a3, N2 = f2 - u4, O2 = 2 * F(m2 * M2) * Z(Q(E2) / 2), P2 = 1 + 0.015 * U(b2 - 50, 2) / F(20 + U(b2 - 50, 2)), j2 = 1 + 0.045 * C2, S2 = 1 + 0.015 * C2 * k2, A2 = 30 * B(-U((I2 - 275) / 25, 2)), L2 = -2 * F(U(C2, 7) / (U(C2, 7) + U(25, 7))) * Z(2 * Q(A2));
|
|
1739
1739
|
return F(U(z2 / (n3 * P2), 2) + U(N2 / (e3 * j2), 2) + U(O2 / (o3 * S2), 2) + L2 * (N2 / (e3 * j2)) * (O2 / (o3 * S2)));
|
|
1740
1740
|
})(t2, r2, c2.kL, c2.kC, c2.kH);
|
|
1741
1741
|
};
|
|
@@ -1925,7 +1925,7 @@ var ft = (function() {
|
|
|
1925
1925
|
return void 0 === r2 && (r2 = "CMC"), et(this, t2, r2, n3);
|
|
1926
1926
|
}, n2.prototype.visibility = function(t2, r2) {
|
|
1927
1927
|
return ot(this, t2, r2);
|
|
1928
|
-
}, t([q(0, 1, true, 0),
|
|
1928
|
+
}, t([q(0, 1, true, 0), R2("color:rgb")], n2.prototype, "rgb", null), t([q(0, 1, true, 0)], n2.prototype, "rgba", null), t([q(0, 1, true, 0), R2("color:cmyk")], n2.prototype, "cmyk", null), t([q(0, 1, true, 0), R2("color:hsl")], n2.prototype, "hsl", null), t([q(0, 1, true, 0)], n2.prototype, "hsla", null), t([q(0, 1, true, 0), R2("color:hsv")], n2.prototype, "hsv", null), t([q(0, 1, true, 0), R2("color:hsi")], n2.prototype, "hsi", null), t([q(0, 1, true, 0), R2("color: hwb")], n2.prototype, "hwb", null), t([q(2, 1, true, 0), R2("color:xyz")], n2.prototype, "xyz", null), t([q(2, 1, true, 0), R2("color:lab")], n2.prototype, "lab", null), t([q(2, 1, true, 0), R2("color:lch")], n2.prototype, "lch", null), t([q(2, 1, true, 0), R2("color:xyY")], n2.prototype, "xyY", null), t([R2("color:luma")], n2.prototype, "luma", null), n2;
|
|
1929
1929
|
})();
|
|
1930
1930
|
var st = function(t2, r2, n2, e2) {
|
|
1931
1931
|
return new ft([t2, r2, n2], e2);
|
|
@@ -2114,6 +2114,88 @@ function sweepCandidates(seedHex) {
|
|
|
2114
2114
|
return out;
|
|
2115
2115
|
}
|
|
2116
2116
|
|
|
2117
|
+
// src/pendingGenerate.ts
|
|
2118
|
+
var PENDING_RECOVERY_WINDOW_MS = 9e5;
|
|
2119
|
+
var PENDING_RECOVERY_POLL_MS = 15e3;
|
|
2120
|
+
var PENDING_RECOVERY_FIRST_POLL_MS = 2e3;
|
|
2121
|
+
var PENDING_RECOVERY_FAST_PHASE_MS = 12e4;
|
|
2122
|
+
var PENDING_RECOVERY_MID_POLL_MS = 3e4;
|
|
2123
|
+
var PENDING_RECOVERY_SLOW_PHASE_MS = 3e5;
|
|
2124
|
+
var PENDING_RECOVERY_SLOW_POLL_MS = 6e4;
|
|
2125
|
+
function pendingRecoveryNextDelayMs(elapsedMs) {
|
|
2126
|
+
if (elapsedMs < PENDING_RECOVERY_FAST_PHASE_MS) return PENDING_RECOVERY_POLL_MS;
|
|
2127
|
+
if (elapsedMs < PENDING_RECOVERY_SLOW_PHASE_MS) return PENDING_RECOVERY_MID_POLL_MS;
|
|
2128
|
+
return PENDING_RECOVERY_SLOW_POLL_MS;
|
|
2129
|
+
}
|
|
2130
|
+
function encodePendingGenerate(m2) {
|
|
2131
|
+
const o2 = { v: m2.v, t: m2.t, c: m2.c, p: m2.p ?? "" };
|
|
2132
|
+
if (Number.isFinite(m2.h)) o2.h = Math.max(0, Math.floor(m2.h));
|
|
2133
|
+
return JSON.stringify(o2);
|
|
2134
|
+
}
|
|
2135
|
+
function parsePendingGenerate(raw) {
|
|
2136
|
+
if (typeof raw !== "string" || raw.trim() === "") return null;
|
|
2137
|
+
try {
|
|
2138
|
+
const o2 = JSON.parse(raw);
|
|
2139
|
+
const v2 = Number(o2?.v), t2 = Number(o2?.t);
|
|
2140
|
+
if (!Number.isFinite(v2) || v2 <= 0 || !Number.isFinite(t2) || t2 <= 0) return null;
|
|
2141
|
+
const h2 = Number(o2?.h);
|
|
2142
|
+
const m2 = { v: Math.floor(v2), t: Math.floor(t2), c: typeof o2.c === "string" ? o2.c : "", p: typeof o2.p === "string" ? o2.p : "" };
|
|
2143
|
+
if (Number.isFinite(h2) && h2 >= 0) m2.h = Math.floor(h2);
|
|
2144
|
+
return m2;
|
|
2145
|
+
} catch {
|
|
2146
|
+
return null;
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
function markerArmedBlind(m2) {
|
|
2150
|
+
if (!m2) return false;
|
|
2151
|
+
return (m2.h ?? m2.v - 1) <= 0;
|
|
2152
|
+
}
|
|
2153
|
+
function isBlindMarker(m2) {
|
|
2154
|
+
if (!m2) return false;
|
|
2155
|
+
return typeof m2.c !== "string" || m2.c.trim() === "";
|
|
2156
|
+
}
|
|
2157
|
+
function servedCorrelationProves(m2, served) {
|
|
2158
|
+
if (!m2 || typeof m2.c !== "string" || m2.c.trim() === "") return false;
|
|
2159
|
+
if (typeof served !== "string" || served.trim() === "") return false;
|
|
2160
|
+
return served.trim().toLowerCase() === m2.c.trim().toLowerCase();
|
|
2161
|
+
}
|
|
2162
|
+
function sameMarker(a2, b2) {
|
|
2163
|
+
if (!a2 || !b2) return false;
|
|
2164
|
+
if (typeof a2.c !== "string" || typeof b2.c !== "string") return false;
|
|
2165
|
+
const ca = a2.c.trim().toLowerCase(), cb = b2.c.trim().toLowerCase();
|
|
2166
|
+
if (ca === "" || cb === "") return false;
|
|
2167
|
+
return ca === cb;
|
|
2168
|
+
}
|
|
2169
|
+
function decidePendingRecovery(m2, nowMs, persistedVersion) {
|
|
2170
|
+
if (!m2) return "none";
|
|
2171
|
+
if ((persistedVersion ?? 0) >= m2.v) return "delivered";
|
|
2172
|
+
if (nowMs - m2.t > PENDING_RECOVERY_WINDOW_MS) return "expired";
|
|
2173
|
+
if (isBlindMarker(m2)) return "blind";
|
|
2174
|
+
return "poll";
|
|
2175
|
+
}
|
|
2176
|
+
function recoveryPollRunning(d2) {
|
|
2177
|
+
return d2 === "poll";
|
|
2178
|
+
}
|
|
2179
|
+
function recoveryOwnsTheSentence(trigger) {
|
|
2180
|
+
return trigger !== "transport-lost";
|
|
2181
|
+
}
|
|
2182
|
+
function latePickupAction(m2, triedThisInstance) {
|
|
2183
|
+
if (!m2 || isBlindMarker(m2)) return "clear";
|
|
2184
|
+
return triedThisInstance ? "keep" : "fetch";
|
|
2185
|
+
}
|
|
2186
|
+
function latePickupKeepsMarker(outcome) {
|
|
2187
|
+
return outcome === "transport";
|
|
2188
|
+
}
|
|
2189
|
+
function pollGiveUpKeepsMarker(outcome, m2) {
|
|
2190
|
+
return outcome === "window-closed" && !!m2 && !isBlindMarker(m2);
|
|
2191
|
+
}
|
|
2192
|
+
function pendingRecoveryRemainingMs(m2, nowMs) {
|
|
2193
|
+
return Math.max(0, m2.t + PENDING_RECOVERY_WINDOW_MS - nowMs);
|
|
2194
|
+
}
|
|
2195
|
+
function transportFailureShouldRecover(headersReceived, genNew) {
|
|
2196
|
+
return headersReceived && genNew;
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2117
2199
|
// src/index.ts
|
|
2118
2200
|
function registerCityTable(packed) {
|
|
2119
2201
|
L3(packed);
|
|
@@ -2177,6 +2259,13 @@ export {
|
|
|
2177
2259
|
MIN_HIT_BAND_PX,
|
|
2178
2260
|
MIN_RAMP_FILLS,
|
|
2179
2261
|
PAGE_MATCH_TOLERANCE,
|
|
2262
|
+
PENDING_RECOVERY_FAST_PHASE_MS,
|
|
2263
|
+
PENDING_RECOVERY_FIRST_POLL_MS,
|
|
2264
|
+
PENDING_RECOVERY_MID_POLL_MS,
|
|
2265
|
+
PENDING_RECOVERY_POLL_MS,
|
|
2266
|
+
PENDING_RECOVERY_SLOW_PHASE_MS,
|
|
2267
|
+
PENDING_RECOVERY_SLOW_POLL_MS,
|
|
2268
|
+
PENDING_RECOVERY_WINDOW_MS,
|
|
2180
2269
|
PHANTOM_FRACTION,
|
|
2181
2270
|
PILL_MIN_ALPHA,
|
|
2182
2271
|
PILL_MIN_COVERAGE,
|
|
@@ -2229,7 +2318,9 @@ export {
|
|
|
2229
2318
|
createMarkResolver,
|
|
2230
2319
|
ctmScaleOf,
|
|
2231
2320
|
decideLabelColor,
|
|
2321
|
+
decidePendingRecovery,
|
|
2232
2322
|
deltaEHex,
|
|
2323
|
+
encodePendingGenerate,
|
|
2233
2324
|
ensureCrossfilterHitTargets,
|
|
2234
2325
|
explainRenderFailure,
|
|
2235
2326
|
filterFitsChooser,
|
|
@@ -2245,14 +2336,18 @@ export {
|
|
|
2245
2336
|
hitBandFlag,
|
|
2246
2337
|
inlineFilterGate,
|
|
2247
2338
|
isBlankRender,
|
|
2339
|
+
isBlindMarker,
|
|
2248
2340
|
isHorizontalLabelRow,
|
|
2249
2341
|
isPhantomBox,
|
|
2250
2342
|
isPillBackdropAlpha,
|
|
2251
2343
|
labelBand,
|
|
2344
|
+
latePickupAction,
|
|
2345
|
+
latePickupKeepsMarker,
|
|
2252
2346
|
launchFavorStyle,
|
|
2253
2347
|
launchGenerates,
|
|
2254
2348
|
listNeedsFilter,
|
|
2255
2349
|
loadGeo,
|
|
2350
|
+
markerArmedBlind,
|
|
2256
2351
|
measureContainerBoxes,
|
|
2257
2352
|
needsScroll,
|
|
2258
2353
|
newQualifyGroupState,
|
|
@@ -2262,6 +2357,9 @@ export {
|
|
|
2262
2357
|
normalizeFilterTerm,
|
|
2263
2358
|
orderMostDistinct,
|
|
2264
2359
|
orderRefusalsForDisplay,
|
|
2360
|
+
parsePendingGenerate,
|
|
2361
|
+
pendingRecoveryNextDelayMs,
|
|
2362
|
+
pendingRecoveryRemainingMs,
|
|
2265
2363
|
periodTickSuppressesFeedback,
|
|
2266
2364
|
pickDistinctColorFromSeed,
|
|
2267
2365
|
pillBacksGlyph,
|
|
@@ -2269,6 +2367,7 @@ export {
|
|
|
2269
2367
|
planAxisPin,
|
|
2270
2368
|
planFrameGrow,
|
|
2271
2369
|
planTrivialChart,
|
|
2370
|
+
pollGiveUpKeepsMarker,
|
|
2272
2371
|
qualifyAuto,
|
|
2273
2372
|
qualifyCancel,
|
|
2274
2373
|
qualifyFailureFallsOpen,
|
|
@@ -2281,6 +2380,8 @@ export {
|
|
|
2281
2380
|
rasterizeSvgToPngDataUrl,
|
|
2282
2381
|
readQualifyChartRow,
|
|
2283
2382
|
readQualifyRefusalRow,
|
|
2383
|
+
recoveryOwnsTheSentence,
|
|
2384
|
+
recoveryPollRunning,
|
|
2284
2385
|
refusalIsSelectable,
|
|
2285
2386
|
registerCityTable,
|
|
2286
2387
|
registerGeo,
|
|
@@ -2289,7 +2390,9 @@ export {
|
|
|
2289
2390
|
requiredD3Plugins,
|
|
2290
2391
|
resolveAutoColorScale,
|
|
2291
2392
|
resolveOptions,
|
|
2393
|
+
sameMarker,
|
|
2292
2394
|
scrollFitFor,
|
|
2395
|
+
servedCorrelationProves,
|
|
2293
2396
|
sessionViewStateProvider,
|
|
2294
2397
|
shouldOpenChooserOnGenerate,
|
|
2295
2398
|
shouldOpenInlineChooserOnGenerate,
|
|
@@ -2299,6 +2402,7 @@ export {
|
|
|
2299
2402
|
svgNaturalSize,
|
|
2300
2403
|
svgToDataUrl,
|
|
2301
2404
|
toRGBA,
|
|
2405
|
+
transportFailureShouldRecover,
|
|
2302
2406
|
unpinScrolledAxis,
|
|
2303
2407
|
valuePlacementFlag,
|
|
2304
2408
|
vegaSpecReadsDatesInLocalTime
|
package/dist/react.mjs
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -32,3 +32,4 @@ export { pinScrolledAxis, unpinScrolledAxis, type AxisPinReport } from "./fitDom
|
|
|
32
32
|
export { MIN_DELTA_E, pickDistinctColorFromSeed, buildPalette, buildPaletteFromSeed, orderMostDistinct, LEGIBLE_LIGHTNESS, type PaletteResult, type SeedForSlot, type PaletteOptions, } from "./palette";
|
|
33
33
|
export { deltaEHex } from "./deltaE";
|
|
34
34
|
export { resolveAutoColorScale, autoRampMinStep, autoRampCanvas, AUTO_RAMP_CLASSES, AUTO_RAMP_DRAWN_OPACITY, AUTO_RAMP_MIN_STEP_DELTA_E, type AutoColorScale, type AutoColorScaleInput } from "./autoRamp";
|
|
35
|
+
export { PENDING_RECOVERY_WINDOW_MS, PENDING_RECOVERY_POLL_MS, PENDING_RECOVERY_FIRST_POLL_MS, PENDING_RECOVERY_FAST_PHASE_MS, PENDING_RECOVERY_MID_POLL_MS, PENDING_RECOVERY_SLOW_PHASE_MS, PENDING_RECOVERY_SLOW_POLL_MS, pendingRecoveryNextDelayMs, encodePendingGenerate, parsePendingGenerate, markerArmedBlind, isBlindMarker, servedCorrelationProves, sameMarker, decidePendingRecovery, recoveryPollRunning, recoveryOwnsTheSentence, latePickupAction, latePickupKeepsMarker, pollGiveUpKeepsMarker, pendingRecoveryRemainingMs, transportFailureShouldRecover, type PendingGenerateMarker, type PendingRecoveryDecision, type LatePickupAction, } from "./pendingGenerate";
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
export interface PendingGenerateMarker {
|
|
2
|
+
/** The version this generate will produce: (version in hand || 0) + 1.
|
|
3
|
+
* Diagnostic only - see "WHY `v` IS NOT A PREDICTION" below before trusting it. */
|
|
4
|
+
v: number;
|
|
5
|
+
/** Epoch ms when the generate started (client clock). */
|
|
6
|
+
t: number;
|
|
7
|
+
/** Correlation id of the generate - the ONLY safe handle for recovering it. */
|
|
8
|
+
c: string;
|
|
9
|
+
/** The explicit chart-type pick the user made for this generate ("" = none). */
|
|
10
|
+
p: string;
|
|
11
|
+
/** The version the host actually HELD when the generate started (0 = none).
|
|
12
|
+
* Absent on markers written by older builds. Diagnostics, plus the blind test. */
|
|
13
|
+
h?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const PENDING_RECOVERY_WINDOW_MS = 900000;
|
|
16
|
+
/** Poll cadence for the first {@link PENDING_RECOVERY_FAST_PHASE_MS}. Each poll is one
|
|
17
|
+
* cheap fetch (and one server log row), so this is deliberately slow: the cost of finding the
|
|
18
|
+
* chart 15 s late is nothing next to the cost of a second generation. */
|
|
19
|
+
export declare const PENDING_RECOVERY_POLL_MS = 15000;
|
|
20
|
+
/** First poll after a re-mount fires quickly - the service may already be done. */
|
|
21
|
+
export declare const PENDING_RECOVERY_FIRST_POLL_MS = 2000;
|
|
22
|
+
/** Up to here the poll runs at {@link PENDING_RECOVERY_POLL_MS} - covers production's p50. */
|
|
23
|
+
export declare const PENDING_RECOVERY_FAST_PHASE_MS = 120000;
|
|
24
|
+
/** ...then at this cadence up to {@link PENDING_RECOVERY_SLOW_PHASE_MS}. */
|
|
25
|
+
export declare const PENDING_RECOVERY_MID_POLL_MS = 30000;
|
|
26
|
+
export declare const PENDING_RECOVERY_SLOW_PHASE_MS = 300000;
|
|
27
|
+
/** ...and at this one for the rest of the window. */
|
|
28
|
+
export declare const PENDING_RECOVERY_SLOW_POLL_MS = 60000;
|
|
29
|
+
/**
|
|
30
|
+
* How long to wait before the NEXT poll, given how long the generate has been running.
|
|
31
|
+
*
|
|
32
|
+
* Tripling the window would have tripled the poll count at a flat 15 s (60 requests, 60 server log
|
|
33
|
+
* rows), and every one of them after the first couple of minutes is asking about a generate that is
|
|
34
|
+
* plainly slow. So the cadence backs off with age while leaving the FAST phase exactly as it was - a
|
|
35
|
+
* chart that lands inside production's normal range is still picked up within 15 s of finishing,
|
|
36
|
+
* which is the case that actually happens.
|
|
37
|
+
*
|
|
38
|
+
* 0 - 2 min every 15 s (9 polls) production p50 82 s lands here
|
|
39
|
+
* 2 - 5 min every 30 s (6 polls) production p99 383 s lands here
|
|
40
|
+
* 5 - 15 min every 60 s (10 polls) the long tail
|
|
41
|
+
*
|
|
42
|
+
* ~25 polls across 15 minutes, against 60 for a flat cadence over the same window.
|
|
43
|
+
*/
|
|
44
|
+
export declare function pendingRecoveryNextDelayMs(elapsedMs: number): number;
|
|
45
|
+
export declare function encodePendingGenerate(m: PendingGenerateMarker): string;
|
|
46
|
+
export declare function parsePendingGenerate(raw: unknown): PendingGenerateMarker | null;
|
|
47
|
+
export type PendingRecoveryDecision = "none" | "delivered" | "expired" | "blind" | "poll";
|
|
48
|
+
/**
|
|
49
|
+
* What to do with a marker found at mount (or after a transport failure).
|
|
50
|
+
* @param persistedVersion the version the host HAS, 0/null = none
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* Was this marker armed holding NO version? If so its `v` is 1, which the service reads as "the
|
|
54
|
+
* shape's first chart" rather than "this host's first chart". `h` is the explicit signal; the
|
|
55
|
+
* `v - 1` fallback says the same thing for markers written by older builds.
|
|
56
|
+
*/
|
|
57
|
+
export declare function markerArmedBlind(m: PendingGenerateMarker | null | undefined): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Can this marker be recovered AT ALL? Only by CORRELATION, so only if it carries one.
|
|
60
|
+
*
|
|
61
|
+
* A version number is never a safe handle, not even when we held one: the number we hold came FROM
|
|
62
|
+
* the service and is therefore a shape version, so "mine + 1" is still a guess about what everyone
|
|
63
|
+
* else did next. The poll consequently asks by correlation ALONE and sends no version at all - which
|
|
64
|
+
* is also what makes this safe against a service too old to understand the field, because such a
|
|
65
|
+
* service refuses a fetchOnly request with no version and can serve nothing. A marker with no
|
|
66
|
+
* correlation (written by an older build) has no usable handle and is not polled.
|
|
67
|
+
*
|
|
68
|
+
* One definition, shared by the mount-time decision and the transport-lost message.
|
|
69
|
+
*/
|
|
70
|
+
export declare function isBlindMarker(m: PendingGenerateMarker | null | undefined): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Does `served` (the service's statement of whose generation it returned) prove this marker's
|
|
73
|
+
* chart? Absence is REFUSAL, not assent: an older service says nothing here, and a recovery that
|
|
74
|
+
* cannot tell your chart from a stranger's is worse than no recovery.
|
|
75
|
+
*/
|
|
76
|
+
export declare function servedCorrelationProves(m: PendingGenerateMarker | null | undefined, served: string | null | undefined): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Are these the SAME pending generate? By correlation, never by version.
|
|
79
|
+
*
|
|
80
|
+
* Found 2026-08-30, and the log showed the bug in two adjacent lines. A poll was running for one
|
|
81
|
+
* correlation when the user clicked Generate again, arming a second. The poll's "has the marker
|
|
82
|
+
* changed under me?" guard compared `m.v` - and EVERY marker armed by a host holding no chart is
|
|
83
|
+
* `v: 1`, so `1 !== 1` was false and the stale poll did not notice it had been superseded. Four
|
|
84
|
+
* minutes later its window closed and it cleared the marker belonging to the generate that was
|
|
85
|
+
* still running:
|
|
86
|
+
*
|
|
87
|
+
* pending-gen-poll-end {"outcome":"window-closed","c":"<the first correlation>"}
|
|
88
|
+
* pending-gen-cleared {"reason":"poll-window-closed","c":"<the second correlation>"}
|
|
89
|
+
*
|
|
90
|
+
* The live generate lost its recovery marker 35 s after starting, and the user was told "nothing
|
|
91
|
+
* was delivered" about a chart that was still being written. The same lesson as `v` above: a shape
|
|
92
|
+
* version that the whole account moves can never identify one host's request. The correlation can.
|
|
93
|
+
*
|
|
94
|
+
* Two markers with no correlation are never "the same" - there is nothing to compare, and a false
|
|
95
|
+
* match here is what clears a stranger's marker.
|
|
96
|
+
*/
|
|
97
|
+
export declare function sameMarker(a: PendingGenerateMarker | null | undefined, b: PendingGenerateMarker | null | undefined): boolean;
|
|
98
|
+
export declare function decidePendingRecovery(m: PendingGenerateMarker | null, nowMs: number, persistedVersion: number | null | undefined): PendingRecoveryDecision;
|
|
99
|
+
/**
|
|
100
|
+
* Did the recovery actually START A PICKUP? Only "poll" does - "expired", "delivered", "blind" and
|
|
101
|
+
* "none" all clear the marker and walk away.
|
|
102
|
+
*
|
|
103
|
+
* ONE definition, because the caller's SENTENCE has to agree with it. Found 2026-08-28: a generate
|
|
104
|
+
* ran nearly seventeen minutes, the transport died, and the transport-lost branch chose its wording
|
|
105
|
+
* from `isBlindMarker` alone - true enough on its own terms, the marker did carry a correlation -
|
|
106
|
+
* while the recovery had already returned "expired" against the window and polled for nothing. The
|
|
107
|
+
* user was told the chart was being checked for and would appear, with nothing checking for
|
|
108
|
+
* anything. A property of the MARKER cannot answer a question about the DECISION; only the decision
|
|
109
|
+
* can.
|
|
110
|
+
*/
|
|
111
|
+
export declare function recoveryPollRunning(d: PendingRecoveryDecision): boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Does the RECOVERY PATH own the sentence for this trigger, or does its caller?
|
|
114
|
+
*
|
|
115
|
+
* On "transport-lost" the host's retry loop is mid-render and already owns the message, which it
|
|
116
|
+
* words from the decision (recoveryPollRunning above). Anything the recovery says on top of that
|
|
117
|
+
* stacks a second sentence stating the same fact, and when both are painted the reader sees it twice
|
|
118
|
+
* in slightly different words - seen 2026-09-04, where the connection-dropped explanation appeared
|
|
119
|
+
* back to back with itself.
|
|
120
|
+
*
|
|
121
|
+
* On a MOUNT (or any other trigger) nothing else speaks, so the recovery must.
|
|
122
|
+
*/
|
|
123
|
+
export declare function recoveryOwnsTheSentence(trigger: string): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* THE ONE-SHOT LATE PICKUP.
|
|
126
|
+
*
|
|
127
|
+
* An EXPIRED marker used to be cleared on sight. But "expired" is a fact about the POLL WINDOW, not
|
|
128
|
+
* about the chart: the service writes the generation when it finishes and serves it by correlation
|
|
129
|
+
* for good. Seen in production: a corporate egress proxy cut the stream at 66 s, the poll armed, the
|
|
130
|
+
* host stopped reporting within seconds, the service finished at 75 s - and a reader who reopened
|
|
131
|
+
* the report later would have found the marker, called it expired, and cleared a finished, charged
|
|
132
|
+
* chart.
|
|
133
|
+
*
|
|
134
|
+
* So a MOUNT that finds an expired marker with a correlation fetches ONCE before letting go:
|
|
135
|
+
* "fetch" - a correlation to ask by, and this host instance has not asked for it yet;
|
|
136
|
+
* "keep" - this instance already asked (its own poll ran out, or a pickup already tried), so the
|
|
137
|
+
* marker waits for the NEXT mount - a data refresh seconds after the window closed must not
|
|
138
|
+
* spend the one fetch before a slow generate has finished;
|
|
139
|
+
* "clear" - no marker, or no correlation to ask by (a version is never a safe handle).
|
|
140
|
+
*/
|
|
141
|
+
export type LatePickupAction = "fetch" | "keep" | "clear";
|
|
142
|
+
export declare function latePickupAction(m: PendingGenerateMarker | null | undefined, triedThisInstance: boolean): LatePickupAction;
|
|
143
|
+
/**
|
|
144
|
+
* After the late pickup's one fetch: only a TRANSPORT failure keeps the marker - the question never
|
|
145
|
+
* reached the service, so a later mount may still ask. An answer of not-found, or a definitive
|
|
146
|
+
* refusal, is the service saying there is nothing to deliver, and the marker goes.
|
|
147
|
+
*/
|
|
148
|
+
export declare function latePickupKeepsMarker(outcome: "found" | "not-yet" | "hard-error" | "transport"): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* When the 15-minute poll runs out ("window-closed"), the marker STAYS for the next mount's late
|
|
151
|
+
* pickup, as long as it carries a correlation. A definitive refusal ("hard-error") still clears it.
|
|
152
|
+
*/
|
|
153
|
+
export declare function pollGiveUpKeepsMarker(outcome: string, m: PendingGenerateMarker | null | undefined): boolean;
|
|
154
|
+
/** Milliseconds left in the recovery window from `nowMs`, floored at 0. */
|
|
155
|
+
export declare function pendingRecoveryRemainingMs(m: PendingGenerateMarker, nowMs: number): number;
|
|
156
|
+
/**
|
|
157
|
+
* Whether a transport failure on a generate should hand off to the recovery poll (true) or fall back
|
|
158
|
+
* to the ordinary retry (false). The discriminator is whether the service ACCEPTED the request: a
|
|
159
|
+
* streaming endpoint commits its 200 headers the moment it starts, so headers-received plus a later
|
|
160
|
+
* failure means the generate is running server-side and a retry would make a SECOND chart. No
|
|
161
|
+
* headers means the service never saw it, and retrying is the right move.
|
|
162
|
+
*/
|
|
163
|
+
export declare function transportFailureShouldRecover(headersReceived: boolean, genNew: boolean): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/chart-host",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.104",
|
|
4
4
|
"description": "Run a BIC-generated D3 chart in any web host: compiles the generated render() function, applies the shared option defaults, resolves mark clicks (through tooltip overlays), owns the selection affordance, and translates row indices between cross-filtered charts. The same contract the BIC Power BI visual implements, minus Power BI. React bindings at @bicharts/chart-host/react.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|