@bicharts/chart-host 0.6.14 → 0.6.15
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-4ZG5X2QP.mjs → chunk-HLNXKVQP.mjs} +104 -104
- package/dist/index.mjs +1 -1
- package/dist/react.mjs +1 -1
- package/package.json +1 -1
|
@@ -22,7 +22,7 @@ var require_papaparse_min = __commonJS({
|
|
|
22
22
|
"function" == typeof define && define.amd ? define([], t) : "object" == typeof module && "undefined" != typeof exports ? module.exports = t() : e.Papa = t();
|
|
23
23
|
})(exports, function r() {
|
|
24
24
|
var n = "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0 !== n ? n : {};
|
|
25
|
-
var d2, s = !n.document && !!n.postMessage, a4 = n.IS_PAPA_WORKER || false, o = {}, h3 = 0,
|
|
25
|
+
var d2, s = !n.document && !!n.postMessage, a4 = n.IS_PAPA_WORKER || false, o = {}, h3 = 0, v3 = {};
|
|
26
26
|
function P4(e) {
|
|
27
27
|
return 65279 === e.charCodeAt(0) ? e.slice(1) : e;
|
|
28
28
|
}
|
|
@@ -41,7 +41,7 @@ var require_papaparse_min = __commonJS({
|
|
|
41
41
|
var i2 = this._partialLine + t, r2 = (this._partialLine = "", this._handle.parse(i2, this._baseIndex, !this._finished));
|
|
42
42
|
if (!this._handle.paused() && !this._handle.aborted()) {
|
|
43
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 (a4) n.postMessage({ results: r2, workerId:
|
|
44
|
+
if (a4) n.postMessage({ results: r2, workerId: v3.WORKER_ID, finished: i2 });
|
|
45
45
|
else if (q3(this._config.chunk) && !e2) {
|
|
46
46
|
if (this._config.chunk(r2, this._handle), this._handle.paused() || this._handle.aborted()) return void (this._halted = true);
|
|
47
47
|
this._completeResults = r2 = void 0;
|
|
@@ -50,12 +50,12 @@ var require_papaparse_min = __commonJS({
|
|
|
50
50
|
}
|
|
51
51
|
this._halted = true;
|
|
52
52
|
}, this._sendError = function(e2) {
|
|
53
|
-
q3(this._config.error) ? this._config.error(e2) : a4 && this._config.error && n.postMessage({ workerId:
|
|
53
|
+
q3(this._config.error) ? this._config.error(e2) : a4 && this._config.error && n.postMessage({ workerId: v3.WORKER_ID, error: e2, finished: false });
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
function f4(e) {
|
|
57
57
|
var r2;
|
|
58
|
-
(e = e || {}).chunkSize || (e.chunkSize =
|
|
58
|
+
(e = e || {}).chunkSize || (e.chunkSize = v3.RemoteChunkSize), u2.call(this, e), this._nextChunk = s ? function() {
|
|
59
59
|
this._readChunk(), this._chunkLoaded();
|
|
60
60
|
} : function() {
|
|
61
61
|
this._readChunk();
|
|
@@ -85,7 +85,7 @@ var require_papaparse_min = __commonJS({
|
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
function l(e) {
|
|
88
|
-
(e = e || {}).chunkSize || (e.chunkSize =
|
|
88
|
+
(e = e || {}).chunkSize || (e.chunkSize = v3.LocalChunkSize), u2.call(this, e);
|
|
89
89
|
var i2, r2, n2 = "undefined" != typeof FileReader;
|
|
90
90
|
this.stream = function(e2) {
|
|
91
91
|
this._input = e2, r2 = e2.slice || e2.webkitSlice || e2.mozSlice, n2 ? ((i2 = new FileReader()).onload = y5(this._chunkLoaded, this), i2.onerror = y5(this._chunkError, this)) : i2 = new FileReaderSync(), this._nextChunk();
|
|
@@ -142,7 +142,7 @@ var require_papaparse_min = __commonJS({
|
|
|
142
142
|
return "greedy" === m2.skipEmptyLines ? "" === e2.join("").trim() : 1 === e2.length && 0 === e2[0].length;
|
|
143
143
|
}
|
|
144
144
|
function g4() {
|
|
145
|
-
if (p4 && a5 && (k3("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" +
|
|
145
|
+
if (p4 && a5 && (k3("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + v3.DefaultDelimiter + "'"), a5 = false), m2.skipEmptyLines && (p4.data = p4.data.filter(function(e4) {
|
|
146
146
|
return !y6(e4);
|
|
147
147
|
})), _3()) {
|
|
148
148
|
let t4 = function(e4, t5) {
|
|
@@ -181,13 +181,13 @@ var require_papaparse_min = __commonJS({
|
|
|
181
181
|
}), this.parse = function(e2, t2, i4) {
|
|
182
182
|
var r4 = m2.quoteChar || '"', r4 = (m2.newline || (m2.newline = this.guessLineEndings(e2, r4)), a5 = false, m2.delimiter ? q3(m2.delimiter) && (m2.delimiter = m2.delimiter(e2), p4.meta.delimiter = m2.delimiter) : ((r4 = ((e4, t4, i5, r5, n4) => {
|
|
183
183
|
var s4, a6, o4, h5;
|
|
184
|
-
n4 = n4 || [",", " ", "|", ";",
|
|
184
|
+
n4 = n4 || [",", " ", "|", ";", v3.RECORD_SEP, v3.UNIT_SEP];
|
|
185
185
|
for (var u5 = 0; u5 < n4.length; u5++) {
|
|
186
186
|
for (var d4, f6 = n4[u5], l3 = 0, c5 = 0, p5 = 0, g5 = (o4 = void 0, new E5({ 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 === a6 || l3 <= a6) && (void 0 === h5 || h5 < c5) && 1.99 < c5 && (a6 = l3, s4 = f6, h5 = c5);
|
|
188
188
|
}
|
|
189
189
|
return { successful: !!(m2.delimiter = s4), bestDelimiter: s4 };
|
|
190
|
-
})(e2, m2.newline, m2.skipEmptyLines, m2.comments, m2.delimitersToGuess)).successful ? m2.delimiter = r4.bestDelimiter : (a5 = true, m2.delimiter =
|
|
190
|
+
})(e2, m2.newline, m2.skipEmptyLines, m2.comments, m2.delimitersToGuess)).successful ? m2.delimiter = r4.bestDelimiter : (a5 = true, m2.delimiter = v3.DefaultDelimiter), p4.meta.delimiter = m2.delimiter), b4(m2));
|
|
191
191
|
return m2.preview && m2.header && r4.preview++, n2 = e2, s2 = new E5(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;
|
|
@@ -212,9 +212,9 @@ var require_papaparse_min = __commonJS({
|
|
|
212
212
|
}
|
|
213
213
|
function E5(C2) {
|
|
214
214
|
var S = (C2 = C2 || {}).delimiter, O3 = C2.newline, x2 = C2.comments, I4 = C2.step, A2 = C2.preview, T4 = C2.fastMode, D3 = null, L2 = false, F3 = null == C2.quoteChar ? '"' : C2.quoteChar, j3 = F3;
|
|
215
|
-
if (void 0 !== C2.escapeChar && (j3 = C2.escapeChar), ("string" != typeof S || -1 <
|
|
216
|
-
true === x2 ? x2 = "#" : ("string" != typeof x2 || -1 <
|
|
217
|
-
var z4 = 0,
|
|
215
|
+
if (void 0 !== C2.escapeChar && (j3 = C2.escapeChar), ("string" != typeof S || -1 < v3.BAD_DELIMITERS.indexOf(S)) && (S = ","), x2 === S) throw new Error("Comment character same as delimiter");
|
|
216
|
+
true === x2 ? x2 = "#" : ("string" != typeof x2 || -1 < v3.BAD_DELIMITERS.indexOf(x2)) && (x2 = false), "\n" !== O3 && "\r" !== O3 && "\r\n" !== O3 && (O3 = "\n");
|
|
217
|
+
var z4 = 0, M2 = false;
|
|
218
218
|
this.parse = function(i2, t, r2) {
|
|
219
219
|
if ("string" != typeof i2) throw new Error("Input must be a string");
|
|
220
220
|
var n2 = i2.length, e = S.length, s2 = O3.length, a5 = x2.length, o2 = q3(I4), h4 = [], u4 = [], d3 = [], f5 = z4 = 0;
|
|
@@ -225,7 +225,7 @@ var require_papaparse_min = __commonJS({
|
|
|
225
225
|
else if (r2) return w3();
|
|
226
226
|
if (!x2 || d3.substring(0, a5) !== x2) {
|
|
227
227
|
if (o2) {
|
|
228
|
-
if (h4 = [], k3(d3.split(S)), R2(),
|
|
228
|
+
if (h4 = [], k3(d3.split(S)), R2(), M2) return w3();
|
|
229
229
|
} else k3(d3.split(S));
|
|
230
230
|
if (A2 && A2 <= c4) return h4 = h4.slice(0, A2), w3(true);
|
|
231
231
|
}
|
|
@@ -238,14 +238,14 @@ var require_papaparse_min = __commonJS({
|
|
|
238
238
|
if (F3 === j3 && i2[m2 + 1] === j3) m2++;
|
|
239
239
|
else if (F3 === j3 || 0 === m2 || i2[m2 - 1] !== j3) {
|
|
240
240
|
-1 !== p4 && p4 < m2 + 1 && (p4 = i2.indexOf(S, m2 + 1));
|
|
241
|
-
var y6 =
|
|
241
|
+
var y6 = v4(-1 === (g4 = -1 !== g4 && g4 < m2 + 1 ? i2.indexOf(O3, m2 + 1) : g4) ? p4 : Math.min(p4, g4));
|
|
242
242
|
if (i2.substr(m2 + 1 + y6, e) === S) {
|
|
243
243
|
d3.push(i2.substring(z4, m2).replace(_3, F3)), i2[z4 = m2 + 1 + y6 + e] !== F3 && (m2 = i2.indexOf(F3, z4)), p4 = i2.indexOf(S, z4), g4 = i2.indexOf(O3, z4);
|
|
244
244
|
break;
|
|
245
245
|
}
|
|
246
|
-
y6 =
|
|
246
|
+
y6 = v4(g4);
|
|
247
247
|
if (i2.substring(m2 + 1 + y6, m2 + 1 + y6 + s2) === O3) {
|
|
248
|
-
if (d3.push(i2.substring(z4, m2).replace(_3, F3)), b5(m2 + 1 + y6 + s2), p4 = i2.indexOf(S, z4), m2 = i2.indexOf(F3, z4), o2 && (R2(),
|
|
248
|
+
if (d3.push(i2.substring(z4, m2).replace(_3, F3)), b5(m2 + 1 + y6 + s2), p4 = i2.indexOf(S, z4), m2 = i2.indexOf(F3, z4), o2 && (R2(), M2)) return w3();
|
|
249
249
|
if (A2 && h4.length >= A2) return w3(true);
|
|
250
250
|
break;
|
|
251
251
|
}
|
|
@@ -258,14 +258,14 @@ var require_papaparse_min = __commonJS({
|
|
|
258
258
|
} else if (-1 !== p4 && (p4 < g4 || -1 === g4)) d3.push(i2.substring(z4, p4)), z4 = p4 + e, p4 = i2.indexOf(S, z4);
|
|
259
259
|
else {
|
|
260
260
|
if (-1 === g4) break;
|
|
261
|
-
if (d3.push(i2.substring(z4, g4)), b5(g4 + s2), o2 && (R2(),
|
|
261
|
+
if (d3.push(i2.substring(z4, g4)), b5(g4 + s2), o2 && (R2(), M2)) return w3();
|
|
262
262
|
if (A2 && h4.length >= A2) return w3(true);
|
|
263
263
|
}
|
|
264
264
|
return E6();
|
|
265
265
|
function k3(e2) {
|
|
266
266
|
h4.push(e2), f5 = z4;
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function v4(e2) {
|
|
269
269
|
var t2 = 0;
|
|
270
270
|
return t2 = -1 !== e2 && (e2 = i2.substring(m2 + 1, e2)) && "" === e2.trim() ? e2.length : t2;
|
|
271
271
|
}
|
|
@@ -290,13 +290,13 @@ 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: u4, meta: { delimiter: S, linebreak: O3, aborted:
|
|
293
|
+
return { data: h4, errors: u4, meta: { delimiter: S, linebreak: O3, aborted: M2, truncated: !!e2, cursor: f5 + (t || 0), renamedHeaders: D3 } };
|
|
294
294
|
}
|
|
295
295
|
function R2() {
|
|
296
296
|
I4(w3()), h4 = [], u4 = [];
|
|
297
297
|
}
|
|
298
298
|
}, this.abort = function() {
|
|
299
|
-
|
|
299
|
+
M2 = true;
|
|
300
300
|
}, this.getCharIndex = function() {
|
|
301
301
|
return z4;
|
|
302
302
|
};
|
|
@@ -336,21 +336,21 @@ var require_papaparse_min = __commonJS({
|
|
|
336
336
|
function q3(e) {
|
|
337
337
|
return "function" == typeof e;
|
|
338
338
|
}
|
|
339
|
-
return
|
|
339
|
+
return v3.parse = function(e, t) {
|
|
340
340
|
var i2 = (t = t || {}).dynamicTyping || false;
|
|
341
341
|
q3(i2) && (t.dynamicTypingFunction = i2, i2 = {});
|
|
342
|
-
if (t.dynamicTyping = i2, t.transform = !!q3(t.transform) && t.transform, !t.worker || !
|
|
342
|
+
if (t.dynamicTyping = i2, t.transform = !!q3(t.transform) && t.transform, !t.worker || !v3.WORKERS_SUPPORTED) return i2 = null, v3.NODE_STREAM_INPUT, "string" == typeof e ? (e = P4(e), i2 = new (t.download ? f4 : c2)(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
343
|
(i2 = (() => {
|
|
344
344
|
var e2;
|
|
345
|
-
return !!
|
|
345
|
+
return !!v3.WORKERS_SUPPORTED && (e2 = (() => {
|
|
346
346
|
var e4 = n.URL || n.webkitURL || null, t2 = r.toString();
|
|
347
|
-
return
|
|
347
|
+
return v3.BLOB_URL || (v3.BLOB_URL = e4.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ", "(", t2, ")();"], { type: "text/javascript" })));
|
|
348
348
|
})(), (e2 = new n.Worker(e2)).onmessage = g3, e2.id = h3++, o[e2.id] = e2);
|
|
349
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
|
-
},
|
|
350
|
+
}, v3.unparse = function(e, t) {
|
|
351
351
|
var s2 = false, _3 = true, m2 = ",", y6 = "\r\n", a5 = '"', o2 = a5 + a5, i2 = false, r2 = null, h4 = false, u4 = ((() => {
|
|
352
352
|
if ("object" == typeof t) {
|
|
353
|
-
if ("string" != typeof t.delimiter ||
|
|
353
|
+
if ("string" != typeof t.delimiter || v3.BAD_DELIMITERS.filter(function(e2) {
|
|
354
354
|
return -1 !== t.delimiter.indexOf(e2);
|
|
355
355
|
}).length || (m2 = 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 && (y6 = t.newline), "string" == typeof t.quoteChar && (a5 = t.quoteChar, o2 = a5 + a5), "boolean" == typeof t.header && (_3 = t.header), Array.isArray(t.columns)) {
|
|
356
356
|
if (0 === t.columns.length) throw new Error("Option columns is empty");
|
|
@@ -396,9 +396,9 @@ var require_papaparse_min = __commonJS({
|
|
|
396
396
|
return null == e2 ? "" : e2.constructor === Date ? JSON.stringify(e2).slice(1, 25) : (n4 = false, h4 && "string" == typeof e2 && h4.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
397
|
for (var i5 = 0; i5 < t4.length; i5++) if (-1 < e4.indexOf(t4[i5])) return true;
|
|
398
398
|
return false;
|
|
399
|
-
})(r4,
|
|
399
|
+
})(r4, v3.BAD_DELIMITERS) || -1 < r4.indexOf(m2) || -1 < i4.indexOf(a5) || " " === r4.charAt(0) || " " === r4.charAt(r4.length - 1)) ? a5 + r4 + a5 : r4);
|
|
400
400
|
}
|
|
401
|
-
},
|
|
401
|
+
}, v3.RECORD_SEP = String.fromCharCode(30), v3.UNIT_SEP = String.fromCharCode(31), v3.BYTE_ORDER_MARK = "\uFEFF", v3.BAD_DELIMITERS = ["\r", "\n", '"', v3.BYTE_ORDER_MARK], v3.WORKERS_SUPPORTED = !s && !!n.Worker, v3.NODE_STREAM_INPUT = 1, v3.LocalChunkSize = 10485760, v3.RemoteChunkSize = 5242880, v3.DefaultDelimiter = ",", v3.Parser = E5, v3.ParserHandle = i, v3.NetworkStreamer = f4, v3.FileStreamer = l, v3.StringStreamer = c2, v3.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;
|
|
@@ -419,7 +419,7 @@ var require_papaparse_min = __commonJS({
|
|
|
419
419
|
var a5 = n2.instanceConfig.complete;
|
|
420
420
|
n2.instanceConfig.complete = function(e4) {
|
|
421
421
|
q3(a5) && a5(e4, n2.file, n2.inputElem), u4();
|
|
422
|
-
},
|
|
422
|
+
}, v3.parse(n2.file, n2.instanceConfig);
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
425
|
function u4() {
|
|
@@ -427,9 +427,9 @@ var require_papaparse_min = __commonJS({
|
|
|
427
427
|
}
|
|
428
428
|
}), a4 && (n.onmessage = function(e) {
|
|
429
429
|
e = e.data;
|
|
430
|
-
void 0 ===
|
|
431
|
-
"string" == typeof e.input ? n.postMessage({ workerId:
|
|
432
|
-
}), (f4.prototype = Object.create(u2.prototype)).constructor = f4, (l.prototype = Object.create(u2.prototype)).constructor = l, (c2.prototype = Object.create(c2.prototype)).constructor = c2, (p2.prototype = Object.create(u2.prototype)).constructor = p2,
|
|
430
|
+
void 0 === v3.WORKER_ID && e && (v3.WORKER_ID = e.workerId);
|
|
431
|
+
"string" == typeof e.input ? n.postMessage({ workerId: v3.WORKER_ID, results: v3.parse(e.input, e.config), finished: true }) : (n.File && e.input instanceof File || e.input instanceof Object) && (e = v3.parse(e.input, e.config)) && n.postMessage({ workerId: v3.WORKER_ID, results: e, finished: true });
|
|
432
|
+
}), (f4.prototype = Object.create(u2.prototype)).constructor = f4, (l.prototype = Object.create(u2.prototype)).constructor = l, (c2.prototype = Object.create(c2.prototype)).constructor = c2, (p2.prototype = Object.create(u2.prototype)).constructor = p2, v3;
|
|
433
433
|
});
|
|
434
434
|
}
|
|
435
435
|
});
|
|
@@ -496,8 +496,8 @@ var MAX_MAP_POINTS_DEFAULT = 2e3;
|
|
|
496
496
|
|
|
497
497
|
// src/deltaE.ts
|
|
498
498
|
function linearise(c2) {
|
|
499
|
-
const
|
|
500
|
-
return
|
|
499
|
+
const v3 = c2 / 255;
|
|
500
|
+
return v3 <= 0.04045 ? v3 / 12.92 : Math.pow((v3 + 0.055) / 1.055, 2.4);
|
|
501
501
|
}
|
|
502
502
|
var Xn = 0.95047;
|
|
503
503
|
var Yn = 1;
|
|
@@ -575,8 +575,8 @@ function labToHex(lab) {
|
|
|
575
575
|
-0.969266 * X4 + 1.8760108 * Y4 + 0.041556 * Z4,
|
|
576
576
|
0.0556434 * X4 - 0.2040259 * Y4 + 1.0572252 * Z4
|
|
577
577
|
];
|
|
578
|
-
return "#" + lin.map((
|
|
579
|
-
const c2 = Math.max(0, Math.min(1,
|
|
578
|
+
return "#" + lin.map((v3) => {
|
|
579
|
+
const c2 = Math.max(0, Math.min(1, v3));
|
|
580
580
|
const g3 = c2 <= 31308e-7 ? 12.92 * c2 : 1.055 * Math.pow(c2, 1 / 2.4) - 0.055;
|
|
581
581
|
return Math.round(g3 * 255).toString(16).padStart(2, "0");
|
|
582
582
|
}).join("");
|
|
@@ -635,7 +635,7 @@ function cellKey(rgb) {
|
|
|
635
635
|
].join(",");
|
|
636
636
|
}
|
|
637
637
|
function hex(rgb) {
|
|
638
|
-
return "#" + rgb.map((
|
|
638
|
+
return "#" + rgb.map((v3) => Math.max(0, Math.min(255, v3)).toString(16).padStart(2, "0")).join("");
|
|
639
639
|
}
|
|
640
640
|
function censusColourSpread(container, doc) {
|
|
641
641
|
if (!container || typeof container.querySelectorAll !== "function") return EMPTY;
|
|
@@ -679,11 +679,11 @@ function censusColourSpread(container, doc) {
|
|
|
679
679
|
let span = 0, lo = 0, hi = 1;
|
|
680
680
|
for (let i = 0; i < cs.length; i++) {
|
|
681
681
|
for (let j3 = i + 1; j3 < cs.length; j3++) {
|
|
682
|
-
const
|
|
683
|
-
d2[i][j3] =
|
|
684
|
-
d2[j3][i] =
|
|
685
|
-
if (
|
|
686
|
-
span =
|
|
682
|
+
const v3 = deltaE2000(cs[i], cs[j3]);
|
|
683
|
+
d2[i][j3] = v3;
|
|
684
|
+
d2[j3][i] = v3;
|
|
685
|
+
if (v3 > span) {
|
|
686
|
+
span = v3;
|
|
687
687
|
lo = i;
|
|
688
688
|
hi = j3;
|
|
689
689
|
}
|
|
@@ -740,7 +740,7 @@ function mixLab(a4, b4, t) {
|
|
|
740
740
|
function paintedOver(fg, canvas, alpha) {
|
|
741
741
|
const f4 = [1, 3, 5].map((i) => parseInt(fg.slice(i, i + 2), 16));
|
|
742
742
|
const c2 = [1, 3, 5].map((i) => parseInt(canvas.slice(i, i + 2), 16));
|
|
743
|
-
const mixed = f4.map((
|
|
743
|
+
const mixed = f4.map((v3, i) => Math.round(v3 * alpha + c2[i] * (1 - alpha))).map((v3) => v3.toString(16).padStart(2, "0"));
|
|
744
744
|
return hexToLab("#" + mixed.join(""));
|
|
745
745
|
}
|
|
746
746
|
function autoRampMinStep(low, high, canvas, classes = AUTO_RAMP_CLASSES, opacity = AUTO_RAMP_DRAWN_OPACITY) {
|
|
@@ -872,20 +872,20 @@ function resolveOptions(p2) {
|
|
|
872
872
|
// never reach a chart as a live mode. Both of these are read on EVERY render, so a
|
|
873
873
|
// reader can change their mind about a cached chart without regenerating it.
|
|
874
874
|
approximatePositions: (() => {
|
|
875
|
-
const
|
|
876
|
-
return
|
|
875
|
+
const v3 = (p2.approximatePositions == null ? "" : String(p2.approximatePositions)).toLowerCase();
|
|
876
|
+
return v3 === "mark" || v3 === "aggregate" || v3 === "skip" ? v3 : APPROXIMATE_POSITIONS_DEFAULT;
|
|
877
877
|
})(),
|
|
878
878
|
valueAxisBaseline: (() => {
|
|
879
|
-
const
|
|
880
|
-
return
|
|
879
|
+
const v3 = (p2.valueAxisBaseline == null ? "" : String(p2.valueAxisBaseline)).toLowerCase();
|
|
880
|
+
return v3 === "zero" || v3 === "fit" || v3 === "auto" ? v3 : VALUE_AXIS_BASELINE_DEFAULT;
|
|
881
881
|
})(),
|
|
882
882
|
// Same shape, and the same reason for it: an unrecognised string must never reach a chart
|
|
883
883
|
// as a live mode. Failing open to "auto" is the conservative direction here — "auto" is
|
|
884
884
|
// the setting that makes the chart PROVE the grid before it names a period, so a garbled
|
|
885
885
|
// value withdraws the claim rather than asserting one.
|
|
886
886
|
seasonalMarkers: (() => {
|
|
887
|
-
const
|
|
888
|
-
return
|
|
887
|
+
const v3 = (p2.seasonalMarkers == null ? "" : String(p2.seasonalMarkers)).toLowerCase();
|
|
888
|
+
return v3 === "auto" || v3 === "always" || v3 === "never" ? v3 : SEASONAL_MARKERS_DEFAULT;
|
|
889
889
|
})(),
|
|
890
890
|
// ---- animation: booleans, default+clamp numerics, "" default enum ----
|
|
891
891
|
animAutoPlay: !!p2.animAutoPlay,
|
|
@@ -1279,17 +1279,17 @@ function y3(n, e) {
|
|
|
1279
1279
|
let A2 = n[l], C2 = A3({ ...A2, mapKind: e });
|
|
1280
1280
|
if (S3(C2)) {
|
|
1281
1281
|
t[l] = null, o[l] = null, i[l] = null, m++;
|
|
1282
|
-
let
|
|
1283
|
-
|
|
1282
|
+
let M2 = K(A2);
|
|
1283
|
+
M2 && !d2.has(M2.toLowerCase()) && (d2.add(M2.toLowerCase()), R2.length < x && R2.push(M2));
|
|
1284
1284
|
} else if (C2) {
|
|
1285
1285
|
if (t[l] = C2.lat, o[l] = C2.lon, i[l] = C2.precision, S++, g3[C2.precision]++, (p2 === null || G[C2.precision] > G[p2]) && (p2 = C2.precision), G[C2.precision] > G.city) {
|
|
1286
|
-
let
|
|
1287
|
-
|
|
1286
|
+
let M2 = K(A2);
|
|
1287
|
+
M2 && !s.has(M2.toLowerCase()) && (s.add(M2.toLowerCase()), f4.length < x && f4.push(M2));
|
|
1288
1288
|
}
|
|
1289
1289
|
} else {
|
|
1290
1290
|
t[l] = null, o[l] = null, i[l] = null;
|
|
1291
|
-
let
|
|
1292
|
-
|
|
1291
|
+
let M2 = K(A2);
|
|
1292
|
+
M2 && !r.has(M2.toLowerCase()) && (r.add(M2.toLowerCase()), a4.push(M2));
|
|
1293
1293
|
}
|
|
1294
1294
|
}
|
|
1295
1295
|
let c2 = !n3() && n.some((l) => l.city !== null && l.city !== void 0 && String(l.city).trim() !== "");
|
|
@@ -1460,7 +1460,7 @@ function It(n, s) {
|
|
|
1460
1460
|
return s === "us-zip5" ? w.has(n.slice(0, 3)) : true;
|
|
1461
1461
|
}
|
|
1462
1462
|
function Wt(n, s) {
|
|
1463
|
-
let i = new Array(n.length), r = /* @__PURE__ */ new Set(),
|
|
1463
|
+
let i = new Array(n.length), r = /* @__PURE__ */ new Set(), M2 = [], h3 = 0;
|
|
1464
1464
|
for (let N3 = 0; N3 < n.length; ++N3) {
|
|
1465
1465
|
let I4 = Mt(n[N3], s), O3 = I4 !== null && It(I4, s) ? I4 : null;
|
|
1466
1466
|
if (i[N3] = O3, O3 !== null) h3++;
|
|
@@ -1470,12 +1470,12 @@ function Wt(n, s) {
|
|
|
1470
1470
|
let p2 = String(d2).trim();
|
|
1471
1471
|
if (p2.length > 0) {
|
|
1472
1472
|
let m = p2.toLowerCase();
|
|
1473
|
-
r.has(m) || (r.add(m),
|
|
1473
|
+
r.has(m) || (r.add(m), M2.push(p2));
|
|
1474
1474
|
}
|
|
1475
1475
|
}
|
|
1476
1476
|
}
|
|
1477
1477
|
}
|
|
1478
|
-
return { iso: i, unmatched:
|
|
1478
|
+
return { iso: i, unmatched: M2, matchedRows: h3, totalRows: n.length };
|
|
1479
1479
|
}
|
|
1480
1480
|
|
|
1481
1481
|
// ../shape-core/dist/chunk-ZVHCLXKO.mjs
|
|
@@ -1587,7 +1587,7 @@ var Y3 = 400;
|
|
|
1587
1587
|
function B3(n) {
|
|
1588
1588
|
return !!E(n);
|
|
1589
1589
|
}
|
|
1590
|
-
function
|
|
1590
|
+
function T3(n) {
|
|
1591
1591
|
let e = /* @__PURE__ */ new Set();
|
|
1592
1592
|
for (let t of n) {
|
|
1593
1593
|
if (t == null) continue;
|
|
@@ -1596,8 +1596,8 @@ function v3(n) {
|
|
|
1596
1596
|
}
|
|
1597
1597
|
return Array.from(e);
|
|
1598
1598
|
}
|
|
1599
|
-
function
|
|
1600
|
-
let e =
|
|
1599
|
+
function M(n) {
|
|
1600
|
+
let e = T3(n);
|
|
1601
1601
|
if (e.length === 0 || W2(n) < 95) return false;
|
|
1602
1602
|
let t = e.filter((c2) => B3(c2) && !Y(c2)).length, i = e.filter((c2) => !B3(c2) && !!Y(c2)).length;
|
|
1603
1603
|
return t >= 1 && t >= i;
|
|
@@ -1608,14 +1608,14 @@ function X3(n, e) {
|
|
|
1608
1608
|
return t ? e === "world" ? true : s3.has(t) : false;
|
|
1609
1609
|
}
|
|
1610
1610
|
function W2(n) {
|
|
1611
|
-
let e =
|
|
1611
|
+
let e = T3(n);
|
|
1612
1612
|
if (e.length === 0) return 0;
|
|
1613
1613
|
let t = 0;
|
|
1614
1614
|
for (let i of e) B3(i) && t++;
|
|
1615
1615
|
return Math.round(t / e.length * 1e3) / 10;
|
|
1616
1616
|
}
|
|
1617
1617
|
function E4(n) {
|
|
1618
|
-
let e =
|
|
1618
|
+
let e = T3(n);
|
|
1619
1619
|
if (e.length === 0) return 0;
|
|
1620
1620
|
let t = 0;
|
|
1621
1621
|
for (let i of e) Y(i) && t++;
|
|
@@ -1641,7 +1641,7 @@ function Z3(n, e) {
|
|
|
1641
1641
|
return y4(e, rt) ? true : $2(n).some((t) => /^\d{5}(-\d{4})?$/.test(t.replace(/\.0+$/, "")));
|
|
1642
1642
|
}
|
|
1643
1643
|
function et2(n, e) {
|
|
1644
|
-
let t =
|
|
1644
|
+
let t = T3(n);
|
|
1645
1645
|
if (t.length === 0) return 0;
|
|
1646
1646
|
let i = 0;
|
|
1647
1647
|
for (let c2 of t) p3(c2, e) && i++;
|
|
@@ -1649,7 +1649,7 @@ function et2(n, e) {
|
|
|
1649
1649
|
}
|
|
1650
1650
|
function V3(n, e) {
|
|
1651
1651
|
let t = 0;
|
|
1652
|
-
for (let i of
|
|
1652
|
+
for (let i of T3(n)) e(i) && t++;
|
|
1653
1653
|
return t;
|
|
1654
1654
|
}
|
|
1655
1655
|
function nt2(n, e) {
|
|
@@ -1675,23 +1675,23 @@ function tt2(n, e, t, i, c2) {
|
|
|
1675
1675
|
}
|
|
1676
1676
|
let g3 = t?.state;
|
|
1677
1677
|
if (g3 && x2.has(g3)) {
|
|
1678
|
-
let r = d2(g3), u2 =
|
|
1679
|
-
u2.length > 0 && u2.every((m) => X3(m, i)) ? s.push(`state=${g3} (every value is "CA", which is both Canada and California)`) :
|
|
1678
|
+
let r = d2(g3), u2 = T3(r);
|
|
1679
|
+
u2.length > 0 && u2.every((m) => X3(m, i)) ? s.push(`state=${g3} (every value is "CA", which is both Canada and California)`) : M(r) ? (s.push(`state=${g3} (every value is a country, not a state)`), o.country || (o.country = g3)) : E4(r) < 95 ? s.push(`state=${g3} (only ${E4(r)}% of values are states/provinces)`) : o.state = g3;
|
|
1680
1680
|
}
|
|
1681
|
-
let S = new Set(Object.values(o).filter(Boolean)),
|
|
1681
|
+
let S = new Set(Object.values(o).filter(Boolean)), w3 = n.filter((r) => !S.has(r) && !r.startsWith("__"));
|
|
1682
1682
|
if (!o.state) {
|
|
1683
1683
|
let r = null;
|
|
1684
|
-
for (let u2 of
|
|
1684
|
+
for (let u2 of w3) {
|
|
1685
1685
|
let m = d2(u2);
|
|
1686
|
-
if (
|
|
1686
|
+
if (M(m)) continue;
|
|
1687
1687
|
let p2 = E4(m);
|
|
1688
1688
|
if (p2 < 95) continue;
|
|
1689
|
-
let D3 = V3(m, (
|
|
1689
|
+
let D3 = V3(m, (N3) => !!Y(N3)), se = V3(m, (N3) => !!Y(N3) && !X3(N3, i));
|
|
1690
1690
|
D3 < z3 && se < 1 || (!r || p2 > r.pct) && (r = { name: u2, pct: p2 });
|
|
1691
1691
|
}
|
|
1692
1692
|
r && (o.state = r.name, S.add(r.name), a4.push(`state=${r.name} (${r.pct}% states/provinces)`));
|
|
1693
1693
|
}
|
|
1694
|
-
if (!o.zip) for (let r of
|
|
1694
|
+
if (!o.zip) for (let r of w3) {
|
|
1695
1695
|
if (S.has(r)) continue;
|
|
1696
1696
|
let u2 = d2(r), m = K3(u2);
|
|
1697
1697
|
if (!(m < 95) && Z3(u2, r) && !(nt2(u2, (p2) => Z(p2).length > 0) < z3)) {
|
|
@@ -1700,10 +1700,10 @@ function tt2(n, e, t, i, c2) {
|
|
|
1700
1700
|
}
|
|
1701
1701
|
}
|
|
1702
1702
|
let b4 = o.country;
|
|
1703
|
-
if (!b4 || !
|
|
1703
|
+
if (!b4 || !M(d2(b4))) {
|
|
1704
1704
|
let r = null;
|
|
1705
|
-
for (let u2 of
|
|
1706
|
-
if (S.has(u2) || !
|
|
1705
|
+
for (let u2 of w3) {
|
|
1706
|
+
if (S.has(u2) || !M(d2(u2))) continue;
|
|
1707
1707
|
let m = W2(d2(u2));
|
|
1708
1708
|
(!r || m > r.pct) && (r = { name: u2, pct: m });
|
|
1709
1709
|
}
|
|
@@ -1711,14 +1711,14 @@ function tt2(n, e, t, i, c2) {
|
|
|
1711
1711
|
}
|
|
1712
1712
|
if (!o.city) {
|
|
1713
1713
|
let r = null;
|
|
1714
|
-
for (let u2 of
|
|
1714
|
+
for (let u2 of w3) {
|
|
1715
1715
|
if (S.has(u2)) continue;
|
|
1716
1716
|
let m = d2(u2), p2 = et2(m, i);
|
|
1717
1717
|
p2 < m3 || V3(m, (D3) => p3(D3, i)) < z3 || (!r || p2 > r.pct) && (r = { name: u2, pct: p2 });
|
|
1718
1718
|
}
|
|
1719
1719
|
r && (o.city = r.name, a4.push(`city=${r.name} (${r.pct}% known cities)`));
|
|
1720
1720
|
}
|
|
1721
|
-
let U3 = o.country ? d2(o.country) : [], _2 = !!o.country &&
|
|
1721
|
+
let U3 = o.country ? d2(o.country) : [], _2 = !!o.country && M(U3), ie = _2 ? new Set(U3.map((r) => E(r == null ? null : String(r))).filter(Boolean)).size : 0, H3 = _2 && ie >= 2, F3 = !!(o.lat && o.lon) && e.some((r) => {
|
|
1722
1722
|
let u2 = +String(r[o.lat] ?? "").trim(), m = +String(r[o.lon] ?? "").trim();
|
|
1723
1723
|
return isFinite(u2) && isFinite(m) && u2 >= -90 && u2 <= 90 && m >= -180 && m <= 180 && String(r[o.lat] ?? "").trim() !== "" && String(r[o.lon] ?? "").trim() !== "";
|
|
1724
1724
|
});
|
|
@@ -1825,11 +1825,11 @@ function buildRenderPayload(cols, rowObjs, geo, point, destination, opts) {
|
|
|
1825
1825
|
const row = rowObjs[r];
|
|
1826
1826
|
const a4 = new Array(cols.length + extra);
|
|
1827
1827
|
for (let c2 = 0; c2 < cols.length; c2++) {
|
|
1828
|
-
const
|
|
1829
|
-
if (
|
|
1830
|
-
a4[c2] =
|
|
1828
|
+
const v3 = row[colNames[c2]];
|
|
1829
|
+
if (v3 instanceof Date) {
|
|
1830
|
+
a4[c2] = v3.toISOString();
|
|
1831
1831
|
} else {
|
|
1832
|
-
a4[c2] =
|
|
1832
|
+
a4[c2] = v3 ?? null;
|
|
1833
1833
|
}
|
|
1834
1834
|
}
|
|
1835
1835
|
let k3 = cols.length;
|
|
@@ -2377,9 +2377,9 @@ var VALUE_AXIS_MIN_FIT = 0.8;
|
|
|
2377
2377
|
var MIN_AXIS_SPAN_PX = 40;
|
|
2378
2378
|
var EMPTY4 = { marks: 0, axis: "", column: "", fit: 0, offShare: 0, medianOffRadii: 0 };
|
|
2379
2379
|
function num(el, name) {
|
|
2380
|
-
const
|
|
2381
|
-
if (
|
|
2382
|
-
return parseFloat(String(
|
|
2380
|
+
const v3 = el.getAttribute?.(name);
|
|
2381
|
+
if (v3 === null || v3 === void 0 || String(v3).trim() === "") return NaN;
|
|
2382
|
+
return parseFloat(String(v3));
|
|
2383
2383
|
}
|
|
2384
2384
|
function median(xs) {
|
|
2385
2385
|
if (!xs.length) return NaN;
|
|
@@ -2387,15 +2387,15 @@ function median(xs) {
|
|
|
2387
2387
|
const m = s.length >> 1;
|
|
2388
2388
|
return s.length % 2 ? s[m] : (s[m - 1] + s[m]) / 2;
|
|
2389
2389
|
}
|
|
2390
|
-
function robustLine(
|
|
2391
|
-
const n =
|
|
2390
|
+
function robustLine(v3, pos) {
|
|
2391
|
+
const n = v3.length;
|
|
2392
2392
|
const step = Math.max(1, Math.floor(n / FIT_SAMPLE));
|
|
2393
2393
|
const idx = [];
|
|
2394
2394
|
for (let i = 0; i < n; i += step) idx.push(i);
|
|
2395
2395
|
const slopes = [];
|
|
2396
2396
|
for (let p2 = 0; p2 < idx.length; p2++) {
|
|
2397
2397
|
for (let q3 = p2 + 1; q3 < idx.length; q3++) {
|
|
2398
|
-
const dv =
|
|
2398
|
+
const dv = v3[idx[q3]] - v3[idx[p2]];
|
|
2399
2399
|
if (Math.abs(dv) < 1e-12) continue;
|
|
2400
2400
|
slopes.push((pos[idx[q3]] - pos[idx[p2]]) / dv);
|
|
2401
2401
|
}
|
|
@@ -2403,7 +2403,7 @@ function robustLine(v4, pos) {
|
|
|
2403
2403
|
if (slopes.length < 3) return null;
|
|
2404
2404
|
const b4 = median(slopes);
|
|
2405
2405
|
if (!Number.isFinite(b4) || Math.abs(b4) < 1e-12) return null;
|
|
2406
|
-
const a4 = median(pos.map((y5, i) => y5 - b4 *
|
|
2406
|
+
const a4 = median(pos.map((y5, i) => y5 - b4 * v3[i]));
|
|
2407
2407
|
return Number.isFinite(a4) ? { a: a4, b: b4 } : null;
|
|
2408
2408
|
}
|
|
2409
2409
|
function censusValuePlacement(container, data) {
|
|
@@ -2431,30 +2431,30 @@ function censusValuePlacement(container, data) {
|
|
|
2431
2431
|
for (let c2 = 0; c2 < columns.length; c2++) {
|
|
2432
2432
|
if (/^__.*__$/.test(String(columns[c2]?.name ?? ""))) continue;
|
|
2433
2433
|
const vals = dots.map((d2) => {
|
|
2434
|
-
const
|
|
2435
|
-
return
|
|
2434
|
+
const v3 = d2.row[c2];
|
|
2435
|
+
return v3 === null || v3 === void 0 || v3 === "" ? NaN : typeof v3 === "number" ? v3 : Number(v3);
|
|
2436
2436
|
});
|
|
2437
2437
|
const finite = vals.filter(Number.isFinite);
|
|
2438
2438
|
if (finite.length < dots.length * 0.9 || new Set(finite).size < 8) continue;
|
|
2439
|
-
const logs = finite.every((
|
|
2439
|
+
const logs = finite.every((v3) => v3 > 0) ? [false, true] : [false];
|
|
2440
2440
|
for (const log of logs) {
|
|
2441
2441
|
for (const axis of ["x", "y"]) {
|
|
2442
2442
|
const keep = [];
|
|
2443
|
-
const
|
|
2443
|
+
const v3 = [], pos = [];
|
|
2444
2444
|
dots.forEach((d2, k3) => {
|
|
2445
2445
|
if (!Number.isFinite(vals[k3])) return;
|
|
2446
2446
|
keep.push(k3);
|
|
2447
|
-
|
|
2447
|
+
v3.push(log ? Math.log10(vals[k3]) : vals[k3]);
|
|
2448
2448
|
pos.push(axis === "x" ? d2.x : d2.y);
|
|
2449
2449
|
});
|
|
2450
|
-
const line = robustLine(
|
|
2450
|
+
const line = robustLine(v3, pos);
|
|
2451
2451
|
if (!line) continue;
|
|
2452
2452
|
const lo = Math.min(...pos), hi = Math.max(...pos);
|
|
2453
2453
|
if (hi - lo < MIN_AXIS_SPAN_PX) continue;
|
|
2454
2454
|
const mean = pos.reduce((s, p2) => s + p2, 0) / pos.length;
|
|
2455
2455
|
let ssRes = 0, ssTot = 0;
|
|
2456
2456
|
const res = pos.map((p2, k3) => {
|
|
2457
|
-
const e = p2 - (line.a + line.b *
|
|
2457
|
+
const e = p2 - (line.a + line.b * v3[k3]);
|
|
2458
2458
|
ssRes += e * e;
|
|
2459
2459
|
ssTot += (p2 - mean) ** 2;
|
|
2460
2460
|
return e;
|
|
@@ -2830,8 +2830,8 @@ function pinScrolledAxis(container, svg) {
|
|
|
2830
2830
|
}
|
|
2831
2831
|
const pinSvg = doc.createElementNS(SVG_NS2, "svg");
|
|
2832
2832
|
for (const a4 of ["font-family", "font-size", "font-weight", "font", "fill", "color", "text-rendering"]) {
|
|
2833
|
-
const
|
|
2834
|
-
if (
|
|
2833
|
+
const v3 = svg.getAttribute(a4);
|
|
2834
|
+
if (v3) pinSvg.setAttribute(a4, v3);
|
|
2835
2835
|
}
|
|
2836
2836
|
const styles = svg.querySelectorAll("style");
|
|
2837
2837
|
for (let i = 0; i < styles.length; i++) pinSvg.appendChild(styles[i].cloneNode(true));
|
|
@@ -3063,8 +3063,8 @@ function compositeOver(fg, bg) {
|
|
|
3063
3063
|
];
|
|
3064
3064
|
}
|
|
3065
3065
|
function relativeLuminance(rgb) {
|
|
3066
|
-
const lin = rgb.map((
|
|
3067
|
-
const s =
|
|
3066
|
+
const lin = rgb.map((v3) => {
|
|
3067
|
+
const s = v3 / 255;
|
|
3068
3068
|
return s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
|
|
3069
3069
|
});
|
|
3070
3070
|
return 0.2126 * lin[0] + 0.7152 * lin[1] + 0.0722 * lin[2];
|
|
@@ -3112,9 +3112,9 @@ function glyphSampleGrid(box, n = GLYPH_SAMPLE_N) {
|
|
|
3112
3112
|
}
|
|
3113
3113
|
return out;
|
|
3114
3114
|
}
|
|
3115
|
-
function clamp01(
|
|
3116
|
-
if (typeof
|
|
3117
|
-
return Math.max(0, Math.min(1,
|
|
3115
|
+
function clamp01(v3) {
|
|
3116
|
+
if (typeof v3 !== "number" || !isFinite(v3)) return 1;
|
|
3117
|
+
return Math.max(0, Math.min(1, v3));
|
|
3118
3118
|
}
|
|
3119
3119
|
function hexToRGB(hex2) {
|
|
3120
3120
|
const p2 = toRGBA(hex2);
|
|
@@ -3424,7 +3424,7 @@ function compileRenderFn(code, win, doc, d3) {
|
|
|
3424
3424
|
return fn;
|
|
3425
3425
|
}
|
|
3426
3426
|
var ASYNC_RENDER_TIMEOUT_MS = 15e3;
|
|
3427
|
-
var isThenable = (
|
|
3427
|
+
var isThenable = (v3) => !!v3 && (typeof v3 === "object" || typeof v3 === "function") && typeof v3.then === "function";
|
|
3428
3428
|
function createChartHost(container, config) {
|
|
3429
3429
|
const doc = container.ownerDocument;
|
|
3430
3430
|
const win = doc?.defaultView ?? globalThis;
|
|
@@ -3432,7 +3432,7 @@ function createChartHost(container, config) {
|
|
|
3432
3432
|
let data = config.data;
|
|
3433
3433
|
{
|
|
3434
3434
|
const stamped = config.data?.meta?.hostContract;
|
|
3435
|
-
const major = (
|
|
3435
|
+
const major = (v3) => (v3 || "").split(".")[0];
|
|
3436
3436
|
if (stamped && major(stamped) !== major(HOST_CONTRACT_VERSION)) {
|
|
3437
3437
|
try {
|
|
3438
3438
|
(win?.console ?? console)?.warn(
|
|
@@ -3858,7 +3858,7 @@ function toPayloadRows(rowMap, sourceRowIdxs) {
|
|
|
3858
3858
|
var sameRows = (a4, b4) => {
|
|
3859
3859
|
if (a4.length !== b4.length) return false;
|
|
3860
3860
|
const x2 = a4.slice().sort((p2, q3) => p2 - q3), y5 = b4.slice().sort((p2, q3) => p2 - q3);
|
|
3861
|
-
return x2.every((
|
|
3861
|
+
return x2.every((v3, i) => v3 === y5[i]);
|
|
3862
3862
|
};
|
|
3863
3863
|
function syncMemberSelection(host, selection, id, highlight, incoming, rowMap) {
|
|
3864
3864
|
const mine = selection.sourceId === id && selection.rows.length > 0;
|
package/dist/index.mjs
CHANGED
package/dist/react.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/chart-host",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.15",
|
|
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",
|