@bicharts/chart-host 0.6.8 → 0.6.10

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.
@@ -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, v4 = {};
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
  }
@@ -37,25 +37,25 @@ var require_papaparse_min = __commonJS({
37
37
  let e4 = this._config.newline;
38
38
  e4 || (r2 = this._config.quoteChar || '"', e4 = this._handle.guessLineEndings(t, r2)), t = [...t.split(e4).slice(i2)].join(e4);
39
39
  }
40
- this.isFirstChunk && q3(this._config.beforeFirstChunk) && void 0 !== (r2 = this._config.beforeFirstChunk(t)) && (t = r2), this.isFirstChunk = false, this._halted = false;
40
+ this.isFirstChunk && q4(this._config.beforeFirstChunk) && void 0 !== (r2 = this._config.beforeFirstChunk(t)) && (t = r2), this.isFirstChunk = false, this._halted = false;
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: v4.WORKER_ID, finished: i2 });
45
- else if (q3(this._config.chunk) && !e2) {
44
+ if (a4) n.postMessage({ results: r2, workerId: v3.WORKER_ID, finished: i2 });
45
+ else if (q4(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;
48
48
  }
49
- return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(r2.data), this._completeResults.errors = this._completeResults.errors.concat(r2.errors), this._completeResults.meta = r2.meta), this._completed || !i2 || !q3(this._config.complete) || r2 && r2.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = true), i2 || r2 && r2.meta.paused || this._nextChunk(), r2;
49
+ return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(r2.data), this._completeResults.errors = this._completeResults.errors.concat(r2.errors), this._completeResults.meta = r2.meta), this._completed || !i2 || !q4(this._config.complete) || r2 && r2.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = true), i2 || r2 && r2.meta.paused || this._nextChunk(), r2;
50
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: v4.WORKER_ID, error: e2, finished: false });
53
+ q4(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 = v4.RemoteChunkSize), u2.call(this, e), this._nextChunk = s ? function() {
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 = v4.LocalChunkSize), u2.call(this, e);
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,11 +142,11 @@ 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 '" + v4.DefaultDelimiter + "'"), a5 = false), m2.skipEmptyLines && (p4.data = p4.data.filter(function(e4) {
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) {
149
- e4 = P4(e4), q3(m2.transformHeader) && (e4 = m2.transformHeader(e4, t5)), c4.push(e4);
149
+ e4 = P4(e4), q4(m2.transformHeader) && (e4 = m2.transformHeader(e4, t5)), c4.push(e4);
150
150
  };
151
151
  var t2 = t4;
152
152
  if (p4) if (Array.isArray(p4.data[0])) {
@@ -176,29 +176,29 @@ var require_papaparse_min = __commonJS({
176
176
  e2 = { type: e2, code: t2, message: i4 };
177
177
  void 0 !== r4 && (e2.row = r4), p4.errors.push(e2);
178
178
  }
179
- q3(m2.step) && (t = m2.step, m2.step = function(e2) {
179
+ q4(m2.step) && (t = m2.step, m2.step = function(e2) {
180
180
  p4 = e2, _3() ? g4() : (g4(), 0 !== p4.data.length && (r2 += e2.data.length, m2.preview && r2 > m2.preview ? s2.abort() : (p4.data = p4.data[0], t(p4, i2))));
181
181
  }), this.parse = function(e2, t2, i4) {
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) => {
182
+ var r4 = m2.quoteChar || '"', r4 = (m2.newline || (m2.newline = this.guessLineEndings(e2, r4)), a5 = false, m2.delimiter ? q4(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 || [",", " ", "|", ";", v4.RECORD_SEP, v4.UNIT_SEP];
184
+ n4 = n4 || [",", " ", "|", ";", v3.RECORD_SEP, v3.UNIT_SEP];
185
185
  for (var u5 = 0; u5 < n4.length; u5++) {
186
- for (var d4, f6 = n4[u5], l3 = 0, c5 = 0, p5 = 0, g5 = (o4 = void 0, new E4({ 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));
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 = v4.DefaultDelimiter), p4.meta.delimiter = m2.delimiter), b4(m2));
191
- return m2.preview && m2.header && r4.preview++, n2 = e2, s2 = new E4(r4), p4 = s2.parse(n2, t2, i4), g4(), l2 ? { meta: { paused: true } } : p4 || { meta: { paused: false } };
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
+ 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;
194
194
  }, this.pause = function() {
195
- l2 = true, s2.abort(), n2 = q3(m2.chunk) ? "" : n2.substring(s2.getCharIndex());
195
+ l2 = true, s2.abort(), n2 = q4(m2.chunk) ? "" : n2.substring(s2.getCharIndex());
196
196
  }, this.resume = function() {
197
197
  i2.streamer._halted ? (l2 = false, i2.streamer.parseChunk(n2, true)) : setTimeout(i2.resume, 3);
198
198
  }, this.aborted = function() {
199
199
  return e;
200
200
  }, this.abort = function() {
201
- e = true, s2.abort(), p4.meta.aborted = true, q3(m2.complete) && m2.complete(p4), n2 = "";
201
+ e = true, s2.abort(), p4.meta.aborted = true, q4(m2.complete) && m2.complete(p4), n2 = "";
202
202
  }, this.guessLineEndings = function(e2, t2) {
203
203
  e2 = e2.substring(0, 1048576);
204
204
  var t2 = new RegExp(U3(t2) + "([^]*?)" + U3(t2), "gm"), i4 = (e2 = e2.replace(t2, "")).split("\r"), t2 = e2.split("\n"), e2 = 1 < t2.length && t2[0].length < i4[0].length;
@@ -210,14 +210,14 @@ var require_papaparse_min = __commonJS({
210
210
  function U3(e) {
211
211
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
212
212
  }
213
- function E4(C2) {
214
- var S = (C2 = C2 || {}).delimiter, O3 = C2.newline, x2 = C2.comments, I4 = C2.step, A2 = C2.preview, T4 = C2.fastMode, D4 = null, L2 = false, F3 = null == C2.quoteChar ? '"' : C2.quoteChar, j2 = F3;
215
- if (void 0 !== C2.escapeChar && (j2 = C2.escapeChar), ("string" != typeof S || -1 < v4.BAD_DELIMITERS.indexOf(S)) && (S = ","), x2 === S) throw new Error("Comment character same as delimiter");
216
- true === x2 ? x2 = "#" : ("string" != typeof x2 || -1 < v4.BAD_DELIMITERS.indexOf(x2)) && (x2 = false), "\n" !== O3 && "\r" !== O3 && "\r\n" !== O3 && (O3 = "\n");
217
- var z4 = 0, M = false;
213
+ function E5(C2) {
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, j2 = F3;
215
+ if (void 0 !== C2.escapeChar && (j2 = 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
- var n2 = i2.length, e = S.length, s2 = O3.length, a5 = x2.length, o2 = q3(I4), h4 = [], u4 = [], d3 = [], f5 = z4 = 0;
220
+ var n2 = i2.length, e = S.length, s2 = O3.length, a5 = x2.length, o2 = q4(I4), h4 = [], u4 = [], d3 = [], f5 = z4 = 0;
221
221
  if (!i2) return w3();
222
222
  if (T4 || false !== T4 && -1 === i2.indexOf(F3)) {
223
223
  for (var l2 = i2.split(O3), c4 = 0; c4 < l2.length; c4++) {
@@ -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(), M) return w3();
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
  }
@@ -233,19 +233,19 @@ var require_papaparse_min = __commonJS({
233
233
  return w3();
234
234
  }
235
235
  for (var p4 = i2.indexOf(S, z4), g4 = i2.indexOf(O3, z4), _3 = new RegExp(U3(j2) + U3(F3), "g"), m2 = i2.indexOf(F3, z4); ; ) if (i2[z4] === F3) for (m2 = z4, z4++; ; ) {
236
- if (-1 === (m2 = i2.indexOf(F3, m2 + 1))) return r2 || u4.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: h4.length, index: z4 }), E5();
237
- if (m2 === n2 - 1) return E5(i2.substring(z4, m2).replace(_3, F3));
236
+ if (-1 === (m2 = i2.indexOf(F3, m2 + 1))) return r2 || u4.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: h4.length, index: z4 }), E6();
237
+ if (m2 === n2 - 1) return E6(i2.substring(z4, m2).replace(_3, F3));
238
238
  if (F3 === j2 && i2[m2 + 1] === j2) m2++;
239
239
  else if (F3 === j2 || 0 === m2 || i2[m2 - 1] !== j2) {
240
240
  -1 !== p4 && p4 < m2 + 1 && (p4 = i2.indexOf(S, m2 + 1));
241
- var y6 = v5(-1 === (g4 = -1 !== g4 && g4 < m2 + 1 ? i2.indexOf(O3, m2 + 1) : g4) ? p4 : Math.min(p4, g4));
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 = v5(g4);
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(), M)) return w3();
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,18 +258,18 @@ 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(), M)) return w3();
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
- return E5();
264
+ return E6();
265
265
  function k3(e2) {
266
266
  h4.push(e2), f5 = z4;
267
267
  }
268
- function v5(e2) {
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
  }
272
- function E5(e2) {
272
+ function E6(e2) {
273
273
  return r2 || (void 0 === e2 && (e2 = i2.substring(z4)), d3.push(e2), z4 = n2, k3(d3), o2 && R2()), w3();
274
274
  }
275
275
  function b5(e2) {
@@ -281,22 +281,22 @@ var require_papaparse_min = __commonJS({
281
281
  let n4 = false;
282
282
  for (let r4 = 0; r4 < s4.length; r4++) {
283
283
  let i4 = P4(s4[r4]);
284
- if (a6[i4 = q3(C2.transformHeader) ? C2.transformHeader(i4, r4) : i4]) {
284
+ if (a6[i4 = q4(C2.transformHeader) ? C2.transformHeader(i4, r4) : i4]) {
285
285
  let e4, t2 = a6[i4];
286
286
  for (; e4 = i4 + "_" + t2, t2++, o4.has(e4); ) ;
287
- o4.add(e4), s4[r4] = e4, a6[i4]++, n4 = true, (D4 = null === D4 ? {} : D4)[e4] = i4;
287
+ o4.add(e4), s4[r4] = e4, a6[i4]++, n4 = true, (D3 = null === D3 ? {} : D3)[e4] = i4;
288
288
  } else a6[i4] = 1, s4[r4] = i4;
289
289
  o4.add(i4);
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: M, truncated: !!e2, cursor: f5 + (t || 0), renamedHeaders: D4 } };
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
- M = true;
299
+ M2 = true;
300
300
  }, this.getCharIndex = function() {
301
301
  return z4;
302
302
  };
@@ -308,16 +308,16 @@ var require_papaparse_min = __commonJS({
308
308
  var n2 = { abort: function() {
309
309
  r2 = true, _2(t.workerId, { data: [], errors: [], meta: { aborted: true } });
310
310
  }, pause: m, resume: m };
311
- if (q3(i2.userStep)) {
311
+ if (q4(i2.userStep)) {
312
312
  for (var s2 = 0; s2 < t.results.data.length && (i2.userStep({ data: t.results.data[s2], errors: t.results.errors, meta: t.results.meta }, n2), !r2); s2++) ;
313
313
  delete t.results;
314
- } else q3(i2.userChunk) && (i2.userChunk(t.results, n2, t.file), delete t.results);
314
+ } else q4(i2.userChunk) && (i2.userChunk(t.results, n2, t.file), delete t.results);
315
315
  }
316
316
  t.finished && !r2 && _2(t.workerId, t.results);
317
317
  }
318
318
  function _2(e, t) {
319
319
  var i2 = o[e];
320
- q3(i2.userComplete) && i2.userComplete(t), i2.terminate(), delete o[e];
320
+ q4(i2.userComplete) && i2.userComplete(t), i2.terminate(), delete o[e];
321
321
  }
322
322
  function m() {
323
323
  throw new Error("Not implemented.");
@@ -333,24 +333,24 @@ var require_papaparse_min = __commonJS({
333
333
  e.apply(t, arguments);
334
334
  };
335
335
  }
336
- function q3(e) {
336
+ function q4(e) {
337
337
  return "function" == typeof e;
338
338
  }
339
- return v4.parse = function(e, t) {
339
+ return v3.parse = function(e, t) {
340
340
  var i2 = (t = t || {}).dynamicTyping || false;
341
- q3(i2) && (t.dynamicTypingFunction = i2, i2 = {});
342
- if (t.dynamicTyping = i2, t.transform = !!q3(t.transform) && t.transform, !t.worker || !v4.WORKERS_SUPPORTED) return i2 = null, v4.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);
341
+ q4(i2) && (t.dynamicTypingFunction = i2, i2 = {});
342
+ if (t.dynamicTyping = i2, t.transform = !!q4(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 && q4(e.read) && q4(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 !!v4.WORKERS_SUPPORTED && (e2 = (() => {
345
+ return !!v3.WORKERS_SUPPORTED && (e2 = (() => {
346
346
  var e4 = n.URL || n.webkitURL || null, t2 = r.toString();
347
- return v4.BLOB_URL || (v4.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" })));
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
- })()).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
- }, v4.unparse = function(e, t) {
349
+ })()).userStep = t.step, i2.userChunk = t.chunk, i2.userComplete = t.complete, i2.userError = t.error, t.step = q4(t.step), t.chunk = q4(t.chunk), t.complete = q4(t.complete), t.error = q4(t.error), delete t.worker, i2.postMessage({ input: e, config: t, workerId: i2.id });
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 || v4.BAD_DELIMITERS.filter(function(e2) {
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,30 +396,30 @@ 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, v4.BAD_DELIMITERS) || -1 < r4.indexOf(m2) || -1 < i4.indexOf(a5) || " " === r4.charAt(0) || " " === r4.charAt(r4.length - 1)) ? a5 + r4 + a5 : 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
- }, v4.RECORD_SEP = String.fromCharCode(30), v4.UNIT_SEP = String.fromCharCode(31), v4.BYTE_ORDER_MARK = "\uFEFF", v4.BAD_DELIMITERS = ["\r", "\n", '"', v4.BYTE_ORDER_MARK], v4.WORKERS_SUPPORTED = !s && !!n.Worker, v4.NODE_STREAM_INPUT = 1, v4.LocalChunkSize = 10485760, v4.RemoteChunkSize = 5242880, v4.DefaultDelimiter = ",", v4.Parser = E4, v4.ParserHandle = i, v4.NetworkStreamer = f4, v4.FileStreamer = l, v4.StringStreamer = c2, v4.ReadableStreamStreamer = p2, n.jQuery && ((d2 = n.jQuery).fn.parse = function(o2) {
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;
405
405
  for (var t = 0; t < this.files.length; t++) h4.push({ file: this.files[t], inputElem: this, instanceConfig: d2.extend({}, i2) });
406
406
  }), e(), this;
407
407
  function e() {
408
- if (0 === h4.length) q3(o2.complete) && o2.complete();
408
+ if (0 === h4.length) q4(o2.complete) && o2.complete();
409
409
  else {
410
410
  var e2, t, i4, r2, n2 = h4[0];
411
- if (q3(o2.before)) {
411
+ if (q4(o2.before)) {
412
412
  var s2 = o2.before(n2.file, n2.inputElem);
413
413
  if ("object" == typeof s2) {
414
- if ("abort" === s2.action) return e2 = "AbortError", t = n2.file, i4 = n2.inputElem, r2 = s2.reason, void (q3(o2.error) && o2.error({ name: e2 }, t, i4, r2));
414
+ if ("abort" === s2.action) return e2 = "AbortError", t = n2.file, i4 = n2.inputElem, r2 = s2.reason, void (q4(o2.error) && o2.error({ name: e2 }, t, i4, r2));
415
415
  if ("skip" === s2.action) return void u4();
416
416
  "object" == typeof s2.config && (n2.instanceConfig = d2.extend(n2.instanceConfig, s2.config));
417
417
  } else if ("skip" === s2) return void u4();
418
418
  }
419
419
  var a5 = n2.instanceConfig.complete;
420
420
  n2.instanceConfig.complete = function(e4) {
421
- q3(a5) && a5(e4, n2.file, n2.inputElem), u4();
422
- }, v4.parse(n2.file, n2.instanceConfig);
421
+ q4(a5) && a5(e4, n2.file, n2.inputElem), u4();
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 === v4.WORKER_ID && e && (v4.WORKER_ID = e.workerId);
431
- "string" == typeof e.input ? n.postMessage({ workerId: v4.WORKER_ID, results: v4.parse(e.input, e.config), finished: true }) : (n.File && e.input instanceof File || e.input instanceof Object) && (e = v4.parse(e.input, e.config)) && n.postMessage({ workerId: v4.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, v4;
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 v4 = c2 / 255;
500
- return v4 <= 0.04045 ? v4 / 12.92 : Math.pow((v4 + 0.055) / 1.055, 2.4);
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 * X5 + 1.8760108 * Y4 + 0.041556 * Z4,
576
576
  0.0556434 * X5 - 0.2040259 * Y4 + 1.0572252 * Z4
577
577
  ];
578
- return "#" + lin.map((v4) => {
579
- const c2 = Math.max(0, Math.min(1, v4));
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((v4) => Math.max(0, Math.min(255, v4)).toString(16).padStart(2, "0")).join("");
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 j2 = i + 1; j2 < cs.length; j2++) {
682
- const v4 = deltaE2000(cs[i], cs[j2]);
683
- d2[i][j2] = v4;
684
- d2[j2][i] = v4;
685
- if (v4 > span) {
686
- span = v4;
682
+ const v3 = deltaE2000(cs[i], cs[j2]);
683
+ d2[i][j2] = v3;
684
+ d2[j2][i] = v3;
685
+ if (v3 > span) {
686
+ span = v3;
687
687
  lo = i;
688
688
  hi = j2;
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((v4, i) => Math.round(v4 * alpha + c2[i] * (1 - alpha))).map((v4) => v4.toString(16).padStart(2, "0"));
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 v4 = (p2.approximatePositions == null ? "" : String(p2.approximatePositions)).toLowerCase();
876
- return v4 === "mark" || v4 === "aggregate" || v4 === "skip" ? v4 : APPROXIMATE_POSITIONS_DEFAULT;
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 v4 = (p2.valueAxisBaseline == null ? "" : String(p2.valueAxisBaseline)).toLowerCase();
880
- return v4 === "zero" || v4 === "fit" || v4 === "auto" ? v4 : VALUE_AXIS_BASELINE_DEFAULT;
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 v4 = (p2.seasonalMarkers == null ? "" : String(p2.seasonalMarkers)).toLowerCase();
888
- return v4 === "auto" || v4 === "always" || v4 === "never" ? v4 : SEASONAL_MARKERS_DEFAULT;
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 M = K(A2);
1283
- M && !d2.has(M.toLowerCase()) && (d2.add(M.toLowerCase()), R2.length < x && R2.push(M));
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 M = K(A2);
1287
- M && !s.has(M.toLowerCase()) && (s.add(M.toLowerCase()), f4.length < x && f4.push(M));
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 M = K(A2);
1292
- M && !r.has(M.toLowerCase()) && (r.add(M.toLowerCase()), a4.push(M));
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(), M = [], h3 = 0;
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,96 +1470,96 @@ 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), M.push(p2));
1473
+ r.has(m) || (r.add(m), M2.push(p2));
1474
1474
  }
1475
1475
  }
1476
1476
  }
1477
1477
  }
1478
- return { iso: i, unmatched: M, matchedRows: h3, totalRows: n.length };
1478
+ return { iso: i, unmatched: M2, matchedRows: h3, totalRows: n.length };
1479
1479
  }
1480
1480
 
1481
- // ../shape-core/dist/chunk-PFCJESUQ.mjs
1481
+ // ../shape-core/dist/chunk-WG6XYZLU.mjs
1482
1482
  var import_papaparse = __toESM(require_papaparse_min(), 1);
1483
1483
  /*! @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. */
1484
- var xe = { "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" };
1485
- var X3 = (() => {
1486
- let n = /* @__PURE__ */ new Map();
1487
- for (let e of Object.keys(xe)) for (let t of xe[e].split(/\s+/)) t && n.set(t, e);
1488
- return n;
1484
+ var ve = { "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" };
1485
+ var q3 = (() => {
1486
+ let t = /* @__PURE__ */ new Map();
1487
+ for (let e of Object.keys(ve)) for (let n of ve[e].split(/\s+/)) n && t.set(n, e);
1488
+ return t;
1489
1489
  })();
1490
- function qe(n) {
1491
- for (let [e, t] of n) {
1492
- let i = X3.get(e);
1493
- i && !X3.has(t) && X3.set(t, i);
1490
+ function at2(t) {
1491
+ for (let [e, n] of t) {
1492
+ let r = q3.get(e);
1493
+ r && !q3.has(n) && q3.set(n, r);
1494
1494
  }
1495
1495
  }
1496
- qe(N);
1497
- var rt2 = ["rate", "ratio", "pct", "percent", "percentage", "rating", "share", "score", "index", "nps", "csat", "margin", "yield", "coverage", "utilization", "utilisation", "z[_-]?score", "average", "avg", "mean", "median", "stddev", "variance", "gpa", "percentile", "quantile", "efficiency", "accuracy", "probability", "multiplier", "coefficient", "correlation", "occupancy", "age", "bmi", "temperature", "density", "pressure", "humidity", "ph", "velocity", "speed", "elevation", "altitude", "latency", "throughput", "bandwidth", "iops", "ppm", "ppb", "dpmo", "bps", "temperatuur", "temperatur", "temperatura", "teplota", "lampotila", "homerseklet", "sicaklik", "pression", "presion", "pressao", "pressione", "druck", "tryck", "tlak", "paine", "nyomas", "presiune", "humidite", "humedad", "umidade", "umidita", "feuchtigkeit", "vochtigheid", "kosteus", "vlhkost", "vitesse", "velocidad", "velocidade", "velocita", "geschwindigkeit", "snelheid", "hastighet", "hastighed", "rychlost", "nopeus", "sebesseg", "brzina", "predkosc", "densite", "densidad", "densidade", "densita", "dichte", "dichtheid", "hustota", "tiheys", "gustoca", "moyenne", "mediane", "promedio", "mediana", "gemiddelde", "durchschnitt", "mittelwert", "genomsnitt", "gennemsnit", "gjennomsnitt", "keskiarvo", "atlag", "ortalama", "prosjek", "srednia", "prumer", "priemer", "medie", "taux", "tasa", "taxa", "tasso", "verhaltnis", "verhouding", "aandeel", "anteil", "andel", "osuus", "podil", "udzial", "udio", "pourcentage", "porcentaje", "percentual", "prozent", "procent", "prosentti", "szazalek", "yuzde", "participacion", "participacao", "pondere", "omjer", "arany", "oran", "rata", "leeftijd", "edad", "idade", "wiek", "eletkor", "varsta", "puntuacion", "pontuacao", "punteggio", "betyg", "ocena", "indice", "indeks", "wskaznik", "puan"];
1498
- var ot = ["pct", "percent", "percentage", "rate", "ratio", "rating", "share", "score", "index", "nps", "csat", "margin", "yield", "coverage", "utilization", "utilisation", "gpa", "percentile", "quantile", "bmi", "density", "pressure", "humidity", "velocity", "efficiency", "occupancy", "latency", "throughput", "bandwidth", "iops", "ppm", "ppb", "dpmo", "bps"];
1499
- var at2 = ["latitude", "longitude"];
1500
- var ut2 = ["latitude", "longitude"];
1501
- function K2(n) {
1502
- return f2(n);
1503
- }
1504
- var re = ["somme de", "suma de", "soma de", "summe von", "som van", "somma di", "summa av", "sum av", "sum af", "soucet z", "suma z", "totaal van", "total de", "toplam", "osszeg", "nombre de", "recuento de", "contagem de", "anzahl von", "aantal van", "conteggio di", "antal av", "lukumaara", "pocet z"];
1505
- function lt2(n) {
1506
- return [...n].sort((e, t) => t.length - e.length).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+")).join("|");
1507
- }
1508
- var Ie = new RegExp("^\\s*(?:(?:sum|count|count\\s+distinct|distinct\\s+count)\\s+of\\s+|(?:" + lt2(re) + ")\\s+)", "i");
1509
- var ct2 = /(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Za-z])(?=[0-9])|(?<=[0-9])(?=[A-Za-z])/g;
1510
- var mt = new RegExp("\\b(" + rt2.join("|") + ")\\b|(" + ot.join("|") + ")$", "i");
1511
- var dt = new RegExp("\\b(" + at2.join("|") + ")\\b|(" + ut2.join("|") + ")$", "i");
1512
- function Le(n) {
1513
- if (!n) return "";
1514
- let e = String(n), t = Ie.exec(K2(e));
1515
- return (t ? e.slice(t[0].length) : e).trim();
1516
- }
1517
- function ft2(n) {
1518
- return !!n && Ie.test(K2(String(n)));
1519
- }
1520
- var gt = ["count (distinct)", "count distinct", "distinct count", "standard deviation", "average", "variance", "median", "product", "stddev", "std dev", "count", "sum", "avg", "min", "minimum", "max", "maximum", "var"];
1521
- var Ee = new RegExp("^\\s*(" + [...gt].sort((n, e) => e.length - n.length).map((n) => n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+")).join("|") + ")\\s+of\\s+", "i");
1522
- var Oe = { Sum: ["Sum of "], Avg: ["Average of "], Average: ["Average of "], Count: ["Count of "], CountNonNull: ["Count of "], Min: ["Min of ", "First ", "Earliest "], Max: ["Max of ", "Last ", "Latest "], Median: ["Median of "], StandardDeviation: ["Standard deviation of "], Variance: ["Variance of "] };
1523
- var pt = new RegExp("^(" + Object.keys(Oe).join("|") + ")\\((.+)\\)$");
1524
- function ht(n) {
1525
- let e = Le(n);
1526
- return e.length === 0 ? "" : e.replace(ct2, " ");
1527
- }
1528
- function ke(n, e) {
1496
+ at2(N);
1497
+ var gt = ["rate", "ratio", "pct", "percent", "percentage", "rating", "share", "score", "index", "nps", "csat", "margin", "yield", "coverage", "utilization", "utilisation", "z[_-]?score", "average", "avg", "mean", "median", "stddev", "variance", "gpa", "percentile", "quantile", "efficiency", "accuracy", "probability", "multiplier", "coefficient", "correlation", "occupancy", "age", "bmi", "temperature", "density", "pressure", "humidity", "ph", "velocity", "speed", "elevation", "altitude", "latency", "throughput", "bandwidth", "iops", "ppm", "ppb", "dpmo", "bps", "temperatuur", "temperatur", "temperatura", "teplota", "lampotila", "homerseklet", "sicaklik", "pression", "presion", "pressao", "pressione", "druck", "tryck", "tlak", "paine", "nyomas", "presiune", "humidite", "humedad", "umidade", "umidita", "feuchtigkeit", "vochtigheid", "kosteus", "vlhkost", "vitesse", "velocidad", "velocidade", "velocita", "geschwindigkeit", "snelheid", "hastighet", "hastighed", "rychlost", "nopeus", "sebesseg", "brzina", "predkosc", "densite", "densidad", "densidade", "densita", "dichte", "dichtheid", "hustota", "tiheys", "gustoca", "moyenne", "mediane", "promedio", "mediana", "gemiddelde", "durchschnitt", "mittelwert", "genomsnitt", "gennemsnit", "gjennomsnitt", "keskiarvo", "atlag", "ortalama", "prosjek", "srednia", "prumer", "priemer", "medie", "taux", "tasa", "taxa", "tasso", "verhaltnis", "verhouding", "aandeel", "anteil", "andel", "osuus", "podil", "udzial", "udio", "pourcentage", "porcentaje", "percentual", "prozent", "procent", "prosentti", "szazalek", "yuzde", "participacion", "participacao", "pondere", "omjer", "arany", "oran", "rata", "leeftijd", "edad", "idade", "wiek", "eletkor", "varsta", "puntuacion", "pontuacao", "punteggio", "betyg", "ocena", "indice", "indeks", "wskaznik", "puan"];
1498
+ var pt = ["pct", "percent", "percentage", "rate", "ratio", "rating", "share", "score", "index", "nps", "csat", "margin", "yield", "coverage", "utilization", "utilisation", "gpa", "percentile", "quantile", "bmi", "density", "pressure", "humidity", "velocity", "efficiency", "occupancy", "latency", "throughput", "bandwidth", "iops", "ppm", "ppb", "dpmo", "bps"];
1499
+ var ht = ["latitude", "longitude"];
1500
+ var bt = ["latitude", "longitude"];
1501
+ function X3(t) {
1502
+ return f2(t);
1503
+ }
1504
+ var de = ["somme de", "suma de", "soma de", "summe von", "som van", "somma di", "summa av", "sum av", "sum af", "soucet z", "suma z", "totaal van", "total de", "toplam", "osszeg", "nombre de", "recuento de", "contagem de", "anzahl von", "aantal van", "conteggio di", "antal av", "lukumaara", "pocet z"];
1505
+ function yt2(t) {
1506
+ return [...t].sort((e, n) => n.length - e.length).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+")).join("|");
1507
+ }
1508
+ var ke = new RegExp("^\\s*(?:(?:sum|count|count\\s+distinct|distinct\\s+count)\\s+of\\s+|(?:" + yt2(de) + ")\\s+)", "i");
1509
+ var St2 = /(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Za-z])(?=[0-9])|(?<=[0-9])(?=[A-Za-z])/g;
1510
+ var _t = new RegExp("\\b(" + gt.join("|") + ")\\b|(" + pt.join("|") + ")$", "i");
1511
+ var At = new RegExp("\\b(" + ht.join("|") + ")\\b|(" + bt.join("|") + ")$", "i");
1512
+ function Fe(t) {
1513
+ if (!t) return "";
1514
+ let e = String(t), n = ke.exec(X3(e));
1515
+ return (n ? e.slice(n[0].length) : e).trim();
1516
+ }
1517
+ function Ct(t) {
1518
+ return !!t && ke.test(X3(String(t)));
1519
+ }
1520
+ var Mt2 = ["count (distinct)", "count distinct", "distinct count", "standard deviation", "average", "variance", "median", "product", "stddev", "std dev", "count", "sum", "avg", "min", "minimum", "max", "maximum", "var"];
1521
+ var Oe = new RegExp("^\\s*(" + [...Mt2].sort((t, e) => e.length - t.length).map((t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+")).join("|") + ")\\s+of\\s+", "i");
1522
+ var We = { Sum: ["Sum of "], Avg: ["Average of "], Average: ["Average of "], Count: ["Count of "], CountNonNull: ["Count of "], Min: ["Min of ", "First ", "Earliest "], Max: ["Max of ", "Last ", "Latest "], Median: ["Median of "], StandardDeviation: ["Standard deviation of "], Variance: ["Variance of "] };
1523
+ var xt = new RegExp("^(" + Object.keys(We).join("|") + ")\\((.+)\\)$");
1524
+ function Rt(t) {
1525
+ let e = Fe(t);
1526
+ return e.length === 0 ? "" : e.replace(St2, " ");
1527
+ }
1528
+ function ze(t, e) {
1529
1529
  if (!e) return false;
1530
- let t = Le(e);
1531
- return n.test(K2(ht(e))) || n.test(K2(t)) || n.test(K2(d(t).join(" ")));
1532
- }
1533
- function Fe(n) {
1534
- return ke(dt, n);
1535
- }
1536
- function bt(n) {
1537
- return ke(mt, n) || Fe(n);
1538
- }
1539
- var Ge = /int|double|decimal|single|float|number|currency|money/i;
1540
- function yt2(n) {
1541
- let e = String(n?.valueNature ?? "").trim().toLowerCase();
1542
- return e === "categorical" ? "Categorical" : e === "ordinal" ? "Ordinal" : e === "continuous" || n?.isMeasure === true || Ge.test(String(n?.dataType ?? "")) ? "Continuous" : "Categorical";
1543
- }
1544
- function _t(n) {
1545
- return n?.isMeasure === true || Ge.test(String(n?.dataType ?? ""));
1546
- }
1547
- function We(n) {
1548
- let e = n ?? {}, t = yt2(e);
1549
- if (t !== "Continuous") return { nature: t, additivity: "unknown", basis: "role", suppressed: false };
1550
- if (Fe(e.name)) return { nature: t, additivity: "positional", basis: "name", suppressed: true };
1551
- let i = String(e.additivity ?? "").trim().toLowerCase();
1552
- if (!(i === "additive" && ft2(e.name))) {
1553
- if (i === "additive") return { nature: t, additivity: "additive", basis: "measured", suppressed: false };
1554
- if (i === "part_of_whole") return { nature: t, additivity: "part_of_whole", basis: "measured", suppressed: false };
1555
- if (i === "intensive_rate") return { nature: t, additivity: "intensive_rate", basis: "measured", suppressed: false };
1530
+ let n = Fe(e);
1531
+ return t.test(X3(Rt(e))) || t.test(X3(n)) || t.test(X3(d(n).join(" ")));
1532
+ }
1533
+ function $e(t) {
1534
+ return ze(At, t);
1535
+ }
1536
+ function Tt(t) {
1537
+ return ze(_t, t) || $e(t);
1538
+ }
1539
+ var Ue = /int|double|decimal|single|float|number|currency|money/i;
1540
+ function Nt(t) {
1541
+ let e = String(t?.valueNature ?? "").trim().toLowerCase();
1542
+ return e === "categorical" ? "Categorical" : e === "ordinal" ? "Ordinal" : e === "continuous" || t?.isMeasure === true || Ue.test(String(t?.dataType ?? "")) ? "Continuous" : "Categorical";
1543
+ }
1544
+ function Et(t) {
1545
+ return t?.isMeasure === true || Ue.test(String(t?.dataType ?? ""));
1546
+ }
1547
+ function Ve(t) {
1548
+ let e = t ?? {}, n = Nt(e);
1549
+ if (n !== "Continuous") return { nature: n, additivity: "unknown", basis: "role", suppressed: false };
1550
+ if ($e(e.name)) return { nature: n, additivity: "positional", basis: "name", suppressed: true };
1551
+ let r = String(e.additivity ?? "").trim().toLowerCase();
1552
+ if (!(r === "additive" && Ct(e.name))) {
1553
+ if (r === "additive") return { nature: n, additivity: "additive", basis: "measured", suppressed: false };
1554
+ if (r === "part_of_whole") return { nature: n, additivity: "part_of_whole", basis: "measured", suppressed: false };
1555
+ if (r === "intensive_rate") return { nature: n, additivity: "intensive_rate", basis: "measured", suppressed: false };
1556
1556
  }
1557
- return e.discourageAggregationAcrossGroups === true ? { nature: t, additivity: "intensive_rate", basis: "host-flag", suppressed: false } : bt(e.name) ? { nature: t, additivity: "intensive_rate", basis: "name", suppressed: false } : { nature: t, additivity: "additive", basis: "default", suppressed: false };
1557
+ return e.discourageAggregationAcrossGroups === true ? { nature: n, additivity: "intensive_rate", basis: "host-flag", suppressed: false } : Tt(e.name) ? { nature: n, additivity: "intensive_rate", basis: "name", suppressed: false } : { nature: n, additivity: "additive", basis: "default", suppressed: false };
1558
1558
  }
1559
- function Be(n) {
1560
- let e = We(n), t = n ?? {};
1559
+ function Ke(t) {
1560
+ let e = Ve(t), n = t ?? {};
1561
1561
  if (e.nature === "Categorical") return ["first", "distinctcount", "count"];
1562
- if (e.nature === "Ordinal") return _t(t) ? ["median", "average", "min", "max", "first", "distinctcount", "count"] : ["first", "distinctcount", "count"];
1562
+ if (e.nature === "Ordinal") return Et(n) ? ["median", "average", "min", "max", "first", "distinctcount", "count"] : ["first", "distinctcount", "count"];
1563
1563
  switch (e.additivity) {
1564
1564
  case "positional":
1565
1565
  return ["min", "max", "count", "distinctcount", "first"];
@@ -1569,25 +1569,25 @@ function Be(n) {
1569
1569
  return ["sum", "average", "median", "min", "max", "count", "distinctcount", "first"];
1570
1570
  }
1571
1571
  }
1572
- function dn(n) {
1573
- return Be(n)[0];
1572
+ function Ln(t) {
1573
+ return Ke(t)[0];
1574
1574
  }
1575
- function gn(n, e) {
1575
+ function On(t, e) {
1576
1576
  if (e !== "sum" && e !== "count") return false;
1577
1577
  if (e === "count") return true;
1578
- let t = We(n);
1579
- return t.additivity === "additive" || t.additivity === "part_of_whole" || t.additivity === "unknown";
1578
+ let n = Ve(t);
1579
+ return n.additivity === "additive" || n.additivity === "part_of_whole" || n.additivity === "unknown";
1580
1580
  }
1581
- var Ct = new RegExp([String.raw`\bisMeasure\b`, String.raw`\bdataType\b`, String.raw`\bcolumns\s*\[\s*-?\d`, String.raw`\.iloc\s*\[[^\]]*,`, String.raw`\.iat\s*\[`, String.raw`\bselect_dtypes\b`, String.raw`\b_get_numeric_data\b`, String.raw`\bis_numeric_dtype\b`, String.raw`\bfor\s+\w+\s+in\s+(?:list\s*\(\s*)?df\.columns\b`, String.raw`\bdf\.columns\s*\.\s*(?:tolist|to_list|difference|drop)\b`, String.raw`\bdf\.dtypes\b`, String.raw`\bObject\s*\.\s*(?:keys|values|entries)\s*\(\s*(?:rows|data|df)?\s*\[\s*0\s*\]`, String.raw`\b(?:row|rw|r)\s*\[\s*\d+\s*\]`].join("|"));
1581
+ var wt = new RegExp([String.raw`\bisMeasure\b`, String.raw`\bdataType\b`, String.raw`\bcolumns\s*\[\s*-?\d`, String.raw`\.iloc\s*\[[^\]]*,`, String.raw`\.iat\s*\[`, String.raw`\bselect_dtypes\b`, String.raw`\b_get_numeric_data\b`, String.raw`\bis_numeric_dtype\b`, String.raw`\bfor\s+\w+\s+in\s+(?:list\s*\(\s*)?df\.columns\b`, String.raw`\bdf\.columns\s*\.\s*(?:tolist|to_list|difference|drop)\b`, String.raw`\bdf\.dtypes\b`, String.raw`\bObject\s*\.\s*(?:keys|values|entries)\s*\(\s*(?:rows|data|df)?\s*\[\s*0\s*\]`, String.raw`\b(?:row|rw|r)\s*\[\s*\d+\s*\]`].join("|"));
1582
1582
 
1583
1583
  // ../shape-core/dist/index.mjs
1584
1584
  /*! @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. */
1585
1585
  var z3 = 2;
1586
1586
  var Y3 = 400;
1587
- function W2(n) {
1587
+ function K3(n) {
1588
1588
  return !!E(n);
1589
1589
  }
1590
- function v3(n) {
1590
+ function M(n) {
1591
1591
  let e = /* @__PURE__ */ new Set();
1592
1592
  for (let t of n) {
1593
1593
  if (t == null) continue;
@@ -1597,25 +1597,25 @@ function v3(n) {
1597
1597
  return Array.from(e);
1598
1598
  }
1599
1599
  function T3(n) {
1600
- let e = v3(n);
1601
- if (e.length === 0 || $2(n) < 95) return false;
1602
- let t = e.filter((c2) => W2(c2) && !Y(c2)).length, i = e.filter((c2) => !W2(c2) && !!Y(c2)).length;
1600
+ let e = M(n);
1601
+ if (e.length === 0 || W2(n) < 95) return false;
1602
+ let t = e.filter((c2) => K3(c2) && !Y(c2)).length, i = e.filter((c2) => !K3(c2) && !!Y(c2)).length;
1603
1603
  return t >= 1 && t >= i;
1604
1604
  }
1605
- function Z3(n, e) {
1605
+ function X4(n, e) {
1606
1606
  if (!Y(n)) return false;
1607
1607
  let t = E(n);
1608
1608
  return t ? e === "world" ? true : s3.has(t) : false;
1609
1609
  }
1610
- function $2(n) {
1611
- let e = v3(n);
1610
+ function W2(n) {
1611
+ let e = M(n);
1612
1612
  if (e.length === 0) return 0;
1613
1613
  let t = 0;
1614
- for (let i of e) W2(i) && t++;
1614
+ for (let i of e) K3(i) && t++;
1615
1615
  return Math.round(t / e.length * 1e3) / 10;
1616
1616
  }
1617
- function D3(n) {
1618
- let e = v3(n);
1617
+ function E4(n) {
1618
+ let e = M(n);
1619
1619
  if (e.length === 0) return 0;
1620
1620
  let t = 0;
1621
1621
  for (let i of e) Y(i) && t++;
@@ -1630,18 +1630,18 @@ function V3(n) {
1630
1630
  }
1631
1631
  return Array.from(e);
1632
1632
  }
1633
- function K4(n) {
1633
+ function $2(n) {
1634
1634
  let e = V3(n);
1635
1635
  if (e.length === 0) return 0;
1636
1636
  let t = 0;
1637
1637
  for (let i of e) Z(i).length > 0 && t++;
1638
1638
  return Math.round(t / e.length * 1e3) / 10;
1639
1639
  }
1640
- function X4(n, e) {
1640
+ function Z3(n, e) {
1641
1641
  return y4(e, rt) ? true : V3(n).some((t) => /^\d{5}(-\d{4})?$/.test(t.replace(/\.0+$/, "")));
1642
1642
  }
1643
- function jn(n, e) {
1644
- let t = v3(n);
1643
+ function et2(n, e) {
1644
+ let t = M(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,53 +1649,53 @@ function jn(n, e) {
1649
1649
  }
1650
1650
  function B3(n, e) {
1651
1651
  let t = 0;
1652
- for (let i of v3(n)) e(i) && t++;
1652
+ for (let i of M(n)) e(i) && t++;
1653
1653
  return t;
1654
1654
  }
1655
- function qn(n, e) {
1655
+ function nt2(n, e) {
1656
1656
  let t = 0;
1657
1657
  for (let i of V3(n)) e(i) && t++;
1658
1658
  return t;
1659
1659
  }
1660
- function Zn2(n, e, t, i, c2) {
1660
+ function tt2(n, e, t, i, c2) {
1661
1661
  let a4 = [], s = [], r = {}, C2 = {}, x2 = new Set(n), d2 = (o) => e.map((u2) => u2[o]);
1662
1662
  for (let o of ["city", "country"]) {
1663
1663
  let u2 = t?.[o];
1664
1664
  u2 && x2.has(u2) && (r[o] = u2);
1665
1665
  }
1666
- let re2 = new Set(c2 ?? n);
1666
+ let re = new Set(c2 ?? n);
1667
1667
  for (let o of ["lat", "lon"]) {
1668
1668
  let u2 = t?.[o];
1669
- u2 && re2.has(u2) && (r[o] = u2);
1669
+ u2 && re.has(u2) && (r[o] = u2);
1670
1670
  }
1671
1671
  let P4 = t?.zip;
1672
1672
  if (P4 && x2.has(P4)) {
1673
- let o = d2(P4), u2 = K4(o);
1674
- u2 < 95 ? s.push(`zip=${P4} (only ${u2}% of values read as ZIPs)`) : X4(o, P4) ? r.zip = P4 : s.push(`zip=${P4} (all values are 3-4 digits with nothing to say they are postal)`);
1673
+ let o = d2(P4), u2 = $2(o);
1674
+ u2 < 95 ? s.push(`zip=${P4} (only ${u2}% of values read as ZIPs)`) : Z3(o, P4) ? r.zip = P4 : s.push(`zip=${P4} (all values are 3-4 digits with nothing to say they are postal)`);
1675
1675
  }
1676
1676
  let g3 = t?.state;
1677
1677
  if (g3 && x2.has(g3)) {
1678
- let o = d2(g3), u2 = v3(o);
1679
- u2.length > 0 && u2.every((m) => Z3(m, i)) ? s.push(`state=${g3} (every value is "CA", which is both Canada and California)`) : T3(o) ? (s.push(`state=${g3} (every value is a country, not a state)`), r.country || (r.country = g3)) : D3(o) < 95 ? s.push(`state=${g3} (only ${D3(o)}% of values are states/provinces)`) : r.state = g3;
1678
+ let o = d2(g3), u2 = M(o);
1679
+ u2.length > 0 && u2.every((m) => X4(m, i)) ? s.push(`state=${g3} (every value is "CA", which is both Canada and California)`) : T3(o) ? (s.push(`state=${g3} (every value is a country, not a state)`), r.country || (r.country = g3)) : E4(o) < 95 ? s.push(`state=${g3} (only ${E4(o)}% of values are states/provinces)`) : r.state = g3;
1680
1680
  }
1681
- let h3 = new Set(Object.values(r).filter(Boolean)), A2 = n.filter((o) => !h3.has(o) && !o.startsWith("__"));
1681
+ let S = new Set(Object.values(r).filter(Boolean)), A2 = n.filter((o) => !S.has(o) && !o.startsWith("__"));
1682
1682
  if (!r.state) {
1683
1683
  let o = null;
1684
1684
  for (let u2 of A2) {
1685
1685
  let m = d2(u2);
1686
1686
  if (T3(m)) continue;
1687
- let p2 = D3(m);
1687
+ let p2 = E4(m);
1688
1688
  if (p2 < 95) continue;
1689
- let _2 = B3(m, (N3) => !!Y(N3)), se = B3(m, (N3) => !!Y(N3) && !Z3(N3, i));
1690
- _2 < z3 && se < 1 || (!o || p2 > o.pct) && (o = { name: u2, pct: p2 });
1689
+ let O3 = B3(m, (N3) => !!Y(N3)), se = B3(m, (N3) => !!Y(N3) && !X4(N3, i));
1690
+ O3 < z3 && se < 1 || (!o || p2 > o.pct) && (o = { name: u2, pct: p2 });
1691
1691
  }
1692
- o && (r.state = o.name, h3.add(o.name), a4.push(`state=${o.name} (${o.pct}% states/provinces)`));
1692
+ o && (r.state = o.name, S.add(o.name), a4.push(`state=${o.name} (${o.pct}% states/provinces)`));
1693
1693
  }
1694
1694
  if (!r.zip) for (let o of A2) {
1695
- if (h3.has(o)) continue;
1696
- let u2 = d2(o), m = K4(u2);
1697
- if (!(m < 95) && X4(u2, o) && !(qn(u2, (p2) => Z(p2).length > 0) < z3)) {
1698
- r.zip = o, h3.add(o), a4.push(`zip=${o} (${m}% ZIP codes)`);
1695
+ if (S.has(o)) continue;
1696
+ let u2 = d2(o), m = $2(u2);
1697
+ if (!(m < 95) && Z3(u2, o) && !(nt2(u2, (p2) => Z(p2).length > 0) < z3)) {
1698
+ r.zip = o, S.add(o), a4.push(`zip=${o} (${m}% ZIP codes)`);
1699
1699
  break;
1700
1700
  }
1701
1701
  }
@@ -1703,26 +1703,26 @@ function Zn2(n, e, t, i, c2) {
1703
1703
  if (!b4 || !T3(d2(b4))) {
1704
1704
  let o = null;
1705
1705
  for (let u2 of A2) {
1706
- if (h3.has(u2) || !T3(d2(u2))) continue;
1707
- let m = $2(d2(u2));
1706
+ if (S.has(u2) || !T3(d2(u2))) continue;
1707
+ let m = W2(d2(u2));
1708
1708
  (!o || m > o.pct) && (o = { name: u2, pct: m });
1709
1709
  }
1710
- o && (b4 && (s.push(`country=${b4} (only ${$2(d2(b4))}% of values are country identifiers; using ${o.name} instead)`), C2.country = b4), r.country = o.name, h3.add(o.name), a4.push(`country=${o.name}`));
1710
+ o && (b4 && (s.push(`country=${b4} (only ${W2(d2(b4))}% of values are country identifiers; using ${o.name} instead)`), C2.country = b4), r.country = o.name, S.add(o.name), a4.push(`country=${o.name}`));
1711
1711
  }
1712
1712
  if (!r.city) {
1713
1713
  let o = null;
1714
1714
  for (let u2 of A2) {
1715
- if (h3.has(u2)) continue;
1716
- let m = d2(u2), p2 = jn(m, i);
1717
- p2 < m3 || B3(m, (_2) => p3(_2, i)) < z3 || (!o || p2 > o.pct) && (o = { name: u2, pct: p2 });
1715
+ if (S.has(u2)) continue;
1716
+ let m = d2(u2), p2 = et2(m, i);
1717
+ p2 < m3 || B3(m, (O3) => p3(O3, i)) < z3 || (!o || p2 > o.pct) && (o = { name: u2, pct: p2 });
1718
1718
  }
1719
1719
  o && (r.city = o.name, a4.push(`city=${o.name} (${o.pct}% known cities)`));
1720
1720
  }
1721
- let U3 = r.country ? d2(r.country) : [], G3 = !!r.country && T3(U3), ie = G3 ? new Set(U3.map((o) => E(o == null ? null : String(o))).filter(Boolean)).size : 0, H3 = G3 && ie >= 2, O3 = !!(r.lat && r.lon) && e.some((o) => {
1721
+ let U3 = r.country ? d2(r.country) : [], _2 = !!r.country && T3(U3), ie = _2 ? new Set(U3.map((o) => E(o == null ? null : String(o))).filter(Boolean)).size : 0, H3 = _2 && ie >= 2, D3 = !!(r.lat && r.lon) && e.some((o) => {
1722
1722
  let u2 = +String(o[r.lat] ?? "").trim(), m = +String(o[r.lon] ?? "").trim();
1723
1723
  return isFinite(u2) && isFinite(m) && u2 >= -90 && u2 <= 90 && m >= -180 && m <= 180 && String(o[r.lat] ?? "").trim() !== "" && String(o[r.lon] ?? "").trim() !== "";
1724
1724
  });
1725
- return r.lat && r.lon && !O3 && s.push(`lat/lon=${r.lat}/${r.lon} (no row holds a usable coordinate pair)`), r.country && !H3 && !(r.city || r.state || r.zip || O3) && s.push(G3 ? `country=${r.country} (every row resolves to the same country - nothing to place apart)` : `country=${r.country} (values are not country identifiers)`), { bind: !!(r.city || r.state || r.zip || H3 || O3) ? r : null, backfilled: a4, refused: s, ...Object.keys(C2).length ? { labelFallback: C2 } : {} };
1725
+ return r.lat && r.lon && !D3 && s.push(`lat/lon=${r.lat}/${r.lon} (no row holds a usable coordinate pair)`), r.country && !H3 && !(r.city || r.state || r.zip || D3) && s.push(_2 ? `country=${r.country} (every row resolves to the same country - nothing to place apart)` : `country=${r.country} (values are not country identifiers)`), { bind: !!(r.city || r.state || r.zip || H3 || D3) ? r : null, backfilled: a4, refused: s, ...Object.keys(C2).length ? { labelFallback: C2 } : {} };
1726
1726
  }
1727
1727
 
1728
1728
  // src/payload.ts
@@ -1737,7 +1737,7 @@ function resolvePointChannel(cols, rowObjs, point) {
1737
1737
  let labelCol;
1738
1738
  if (bind) {
1739
1739
  const dims = cols.filter((c2) => !c2.isMeasure).map((c2) => c2.name);
1740
- const res = Zn2(dims, rowObjs, bind, point?.mapKind, cols.map((c2) => c2.name));
1740
+ const res = tt2(dims, rowObjs, bind, point?.mapKind, cols.map((c2) => c2.name));
1741
1741
  bind = res.bind;
1742
1742
  rolesBackfilled = res.backfilled;
1743
1743
  rolesRefused = res.refused;
@@ -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 v4 = row[colNames[c2]];
1829
- if (v4 instanceof Date) {
1830
- a4[c2] = v4.toISOString();
1828
+ const v3 = row[colNames[c2]];
1829
+ if (v3 instanceof Date) {
1830
+ a4[c2] = v3.toISOString();
1831
1831
  } else {
1832
- a4[c2] = v4 ?? null;
1832
+ a4[c2] = v3 ?? null;
1833
1833
  }
1834
1834
  }
1835
1835
  let k3 = cols.length;
@@ -2028,8 +2028,8 @@ function isInsideControl(target, container) {
2028
2028
  function createMarkResolver(env) {
2029
2029
  const { root, doc, log } = env;
2030
2030
  const isElement = (t) => {
2031
- const E4 = doc?.defaultView?.Element ?? globalThis.Element;
2032
- if (E4 && t instanceof E4) return true;
2031
+ const E5 = doc?.defaultView?.Element ?? globalThis.Element;
2032
+ if (E5 && t instanceof E5) return true;
2033
2033
  return !!t && typeof t.closest === "function" && typeof t.getAttribute === "function";
2034
2034
  };
2035
2035
  const viewStyle = (n) => {
@@ -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 v4 = el.getAttribute?.(name);
2381
- if (v4 === null || v4 === void 0 || String(v4).trim() === "") return NaN;
2382
- return parseFloat(String(v4));
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,23 +2387,23 @@ 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(v4, pos) {
2391
- const n = v4.length;
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
- for (let q3 = p2 + 1; q3 < idx.length; q3++) {
2398
- const dv = v4[idx[q3]] - v4[idx[p2]];
2397
+ for (let q4 = p2 + 1; q4 < idx.length; q4++) {
2398
+ const dv = v3[idx[q4]] - v3[idx[p2]];
2399
2399
  if (Math.abs(dv) < 1e-12) continue;
2400
- slopes.push((pos[idx[q3]] - pos[idx[p2]]) / dv);
2400
+ slopes.push((pos[idx[q4]] - pos[idx[p2]]) / dv);
2401
2401
  }
2402
2402
  }
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 * v4[i]));
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 v4 = d2.row[c2];
2435
- return v4 === null || v4 === void 0 || v4 === "" ? NaN : typeof v4 === "number" ? v4 : Number(v4);
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((v4) => v4 > 0) ? [false, true] : [false];
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 v4 = [], pos = [];
2443
+ const v3 = [], pos = [];
2444
2444
  dots.forEach((d2, k3) => {
2445
2445
  if (!Number.isFinite(vals[k3])) return;
2446
2446
  keep.push(k3);
2447
- v4.push(log ? Math.log10(vals[k3]) : vals[k3]);
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(v4, pos);
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 * v4[k3]);
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 v4 = svg.getAttribute(a4);
2834
- if (v4) pinSvg.setAttribute(a4, v4);
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((v4) => {
3067
- const s = v4 / 255;
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(v4) {
3116
- if (typeof v4 !== "number" || !isFinite(v4)) return 1;
3117
- return Math.max(0, Math.min(1, v4));
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);
@@ -3127,10 +3127,10 @@ var LABEL_CONTRAST_CAP = 2e3;
3127
3127
  var EMPTY5 = { rects: 0, scanned: 0, fixed: 0, pillsBoosted: 0, offFill: 0, pageMajority: 0, paintedOver: 0 };
3128
3128
  function backedSamples(el, pts) {
3129
3129
  try {
3130
- const ge = el;
3131
- if (typeof ge.isPointInFill !== "function" || typeof ge.getScreenCTM !== "function") return null;
3132
- const m = ge.getScreenCTM();
3133
- const svg = ge.ownerSVGElement;
3130
+ const ge2 = el;
3131
+ if (typeof ge2.isPointInFill !== "function" || typeof ge2.getScreenCTM !== "function") return null;
3132
+ const m = ge2.getScreenCTM();
3133
+ const svg = ge2.ownerSVGElement;
3134
3134
  if (!m || !svg || typeof svg.createSVGPoint !== "function") return null;
3135
3135
  if (pts.length === 0) return null;
3136
3136
  const inv = m.inverse();
@@ -3139,7 +3139,7 @@ function backedSamples(el, pts) {
3139
3139
  const p2 = svg.createSVGPoint();
3140
3140
  p2.x = pts[i].x;
3141
3141
  p2.y = pts[i].y;
3142
- hit.push(ge.isPointInFill(p2.matrixTransform(inv)));
3142
+ hit.push(ge2.isPointInFill(p2.matrixTransform(inv)));
3143
3143
  }
3144
3144
  return hit;
3145
3145
  } catch {
@@ -3419,12 +3419,12 @@ function compileRenderFn(code, win, doc, d3) {
3419
3419
  "[@bicharts/chart-host] the generated code could not be COMPILED, so nothing was drawn. This path evaluates the chart as a code string, which cannot contain ES-module syntax" + (modular ? " \u2014 and this code still has `import`/`export` in it after the export clause was stripped. Either request the plain form from the generator, or `import` the module yourself and pass the render function directly." : ".") + " Original error: " + msg
3420
3420
  );
3421
3421
  }
3422
- const fn2 = factory.call(null, null, null, null, win, doc, writableD3(d3));
3423
- if (typeof fn2 !== "function") throw new Error("generated code did not define render(container, data, options)");
3424
- return fn2;
3422
+ const fn = factory.call(null, null, null, null, win, doc, writableD3(d3));
3423
+ if (typeof fn !== "function") throw new Error("generated code did not define render(container, data, options)");
3424
+ return fn;
3425
3425
  }
3426
3426
  var ASYNC_RENDER_TIMEOUT_MS = 15e3;
3427
- var isThenable = (v4) => !!v4 && (typeof v4 === "object" || typeof v4 === "function") && typeof v4.then === "function";
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 = (v4) => (v4 || "").split(".")[0];
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(
@@ -3760,9 +3760,9 @@ function createChartHost(container, config) {
3760
3760
  `[@bicharts/chart-host] the chart did not finish drawing within ${Math.round(ASYNC_RENDER_TIMEOUT_MS / 1e3)}s, so the host stopped waiting for it. Nothing past that point ran: no label-contrast pass, no hit-target heal, no census, no fit. A render() that returns a promise has to settle it.`
3761
3761
  ));
3762
3762
  }, ASYNC_RENDER_TIMEOUT_MS);
3763
- const done = (fn2) => {
3763
+ const done = (fn) => {
3764
3764
  clearTimeout(timer);
3765
- fn2();
3765
+ fn();
3766
3766
  };
3767
3767
  Promise.resolve(outcome).then(
3768
3768
  () => done(() => {
@@ -3857,8 +3857,8 @@ function toPayloadRows(rowMap, sourceRowIdxs) {
3857
3857
  }
3858
3858
  var sameRows = (a4, b4) => {
3859
3859
  if (a4.length !== b4.length) return false;
3860
- const x2 = a4.slice().sort((p2, q3) => p2 - q3), y5 = b4.slice().sort((p2, q3) => p2 - q3);
3861
- return x2.every((v4, i) => v4 === y5[i]);
3860
+ const x2 = a4.slice().sort((p2, q4) => p2 - q4), y5 = b4.slice().sort((p2, q4) => p2 - q4);
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;
@@ -3936,17 +3936,23 @@ function createChartGroup(columns, rows, opts = {}) {
3936
3936
  attach(id, host, o = {}) {
3937
3937
  const highlight = o.respondsWith === "highlight";
3938
3938
  let rowMap = memberPayload(id, o).rowMap;
3939
+ const filterKey = (incoming) => highlight || !incoming ? "*" : incoming.join(",");
3940
+ let drawnUnder = filterKey(incomingFor(id, o.filteredBy));
3939
3941
  const offHost = host.selection.onChange((payloadIdxs, source) => {
3940
3942
  if (source === "host") return;
3941
3943
  const sourceIdxs = toSourceRows(rowMap, payloadIdxs);
3942
3944
  if (id) group.publish(id, sourceIdxs);
3943
3945
  o.onSelect?.(sourceIdxs);
3944
3946
  });
3945
- const offGroup = group.onChange((sel) => {
3947
+ const offGroup = group.onChange((sel, change) => {
3946
3948
  const incoming = incomingFor(id, o.filteredBy);
3947
- const next = payloadFor(highlight ? null : incoming);
3948
- rowMap = next.rowMap;
3949
- host.setData(next.payload);
3949
+ const key = filterKey(incoming);
3950
+ if (change === "source" || key !== drawnUnder) {
3951
+ const next = payloadFor(highlight ? null : incoming);
3952
+ rowMap = next.rowMap;
3953
+ drawnUnder = key;
3954
+ host.setData(next.payload);
3955
+ }
3950
3956
  syncMemberSelection(host, sel, id, highlight, incoming, rowMap);
3951
3957
  });
3952
3958
  const member = {
@@ -4032,10 +4038,10 @@ export {
4032
4038
  en,
4033
4039
  F2 as F,
4034
4040
  L3,
4035
- We,
4036
- Be,
4037
- dn,
4038
- gn,
4041
+ Ve,
4042
+ Ke,
4043
+ Ln,
4044
+ On,
4039
4045
  buildRenderPayload,
4040
4046
  stripJsComments,
4041
4047
  isInsideControl,
package/dist/index.mjs CHANGED
@@ -20,7 +20,6 @@ import {
20
20
  AXIS_PIN_MIN_LABELS,
21
21
  AXIS_PIN_TRACK_REACH_PX,
22
22
  BACKING_MAJORITY,
23
- Be,
24
23
  COLOR_SCALE_SELF_CLAMP_PCT_DEFAULT,
25
24
  COLOR_SCALE_SELF_CLAMP_PCT_MAX,
26
25
  COLOR_SCALE_SELF_CLAMP_PCT_MIN,
@@ -39,12 +38,14 @@ import {
39
38
  GLYPH_SAMPLE_N,
40
39
  HOST_CONTAINER_CLASS,
41
40
  HOST_CONTRACT_VERSION,
41
+ Ke,
42
42
  L3,
43
43
  LABEL_CONTRAST_CAP,
44
44
  LABEL_CONTRAST_DONE_ATTR,
45
45
  LEGEND_MARK_CLASS,
46
46
  LIFT_SELECTED_CLASS,
47
47
  LIGHT_TEXT,
48
+ Ln,
48
49
  MARK_CLASS,
49
50
  MARK_SELECTED_CLASS,
50
51
  MAX_FRAME_GROW_FACTOR,
@@ -52,6 +53,7 @@ import {
52
53
  MIN_CONTRAST,
53
54
  MIN_HIT_BAND_PX,
54
55
  MIN_RAMP_FILLS,
56
+ On,
55
57
  PAGE_MATCH_TOLERANCE,
56
58
  PHANTOM_FRACTION,
57
59
  PILL_MIN_ALPHA,
@@ -65,8 +67,8 @@ import {
65
67
  VALUE_AXIS_BASELINE_DEFAULT,
66
68
  VALUE_AXIS_MIN_FIT,
67
69
  VIEW_ONLY_UI_STATE_KEYS,
70
+ Ve,
68
71
  WHITE_TEXT_BG_LUM,
69
- We,
70
72
  XFILTER_REFRESH_EVENT,
71
73
  applyLabelContrast,
72
74
  assembleD3,
@@ -94,7 +96,6 @@ import {
94
96
  ctmScaleOf,
95
97
  decideLabelColor,
96
98
  deltaEHex,
97
- dn,
98
99
  en,
99
100
  ensureCrossfilterHitTargets,
100
101
  explainRenderFailure,
@@ -103,7 +104,6 @@ import {
103
104
  geoAssetFor,
104
105
  geoFromCache,
105
106
  glyphSampleGrid,
106
- gn,
107
107
  hitBandFlag,
108
108
  invalidSentinelReason,
109
109
  isBlankRender,
@@ -139,7 +139,7 @@ import {
139
139
  unpinScrolledAxis,
140
140
  valuePlacementFlag,
141
141
  withoutViewOnlyKeys
142
- } from "./chunk-EPEVGRL6.mjs";
142
+ } from "./chunk-M7KJHGZS.mjs";
143
143
  import "./chunk-A2GMXZP7.mjs";
144
144
  import "./chunk-GHODWOAL.mjs";
145
145
 
@@ -1432,15 +1432,15 @@ function displayText(col, raw, opts) {
1432
1432
  return String(raw);
1433
1433
  }
1434
1434
  function isSuppressed(col) {
1435
- return We(col).suppressed;
1435
+ return Ve(col).suppressed;
1436
1436
  }
1437
1437
  function resolveAgg(col, requested, auto) {
1438
1438
  const fallback = () => {
1439
- const d2 = dn(col);
1439
+ const d2 = Ln(col);
1440
1440
  return d2 === "first" ? "count" : d2;
1441
1441
  };
1442
1442
  if (auto) return fallback();
1443
- return Be(col).indexOf(requested) >= 0 ? requested : fallback();
1443
+ return Ke(col).indexOf(requested) >= 0 ? requested : fallback();
1444
1444
  }
1445
1445
  function toNumber(v2) {
1446
1446
  if (v2 == null || v2 === "") return null;
@@ -1543,7 +1543,7 @@ function computeSelectionCard(payload, selectedRowIdxs, opts = {}) {
1543
1543
  }
1544
1544
  const value = reduce(selVals, colAgg, selRaw);
1545
1545
  let sharePct = null;
1546
- if (gn(col, colAgg) && value != null) {
1546
+ if (On(col, colAgg) && value != null) {
1547
1547
  const allVals = [];
1548
1548
  const allRaw = [];
1549
1549
  for (let r2 = 0; r2 < rows.length; r2++) {
package/dist/react.mjs CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  loadGeo,
8
8
  syncMemberSelection,
9
9
  toSourceRows
10
- } from "./chunk-EPEVGRL6.mjs";
10
+ } from "./chunk-M7KJHGZS.mjs";
11
11
  import "./chunk-A2GMXZP7.mjs";
12
12
  import "./chunk-GHODWOAL.mjs";
13
13
 
@@ -35,11 +35,7 @@ function BicChartGroup({ rows, columns, geo, point, children }) {
35
35
  useEffect(() => group.onChange((s, change) => {
36
36
  if (change !== "source") setSel(s);
37
37
  }), [group]);
38
- const value = useMemo(
39
- () => ({ group, selection: sel }),
40
- // eslint-disable-next-line react-hooks/exhaustive-deps
41
- [group, sel, source]
42
- );
38
+ const value = useMemo(() => ({ group, selection: sel, source }), [group, sel, source]);
43
39
  return /* @__PURE__ */ jsx(Ctx.Provider, { value, children });
44
40
  }
45
41
  function BicChart(props) {
@@ -71,9 +67,11 @@ function BicChart(props) {
71
67
  const built = useMemo(() => {
72
68
  if (!group) return null;
73
69
  return group.payloadFor(filterSel);
74
- }, [ctx, filterSel && filterSel.join(",")]);
70
+ }, [group, ctx?.source, filterSel && filterSel.join(",")]);
75
71
  const data = built ? built.payload : props.data;
76
72
  rowMapRef.current = built ? built.rowMap : null;
73
+ const optKey = useMemo(() => JSON.stringify(options ?? {}), [options]);
74
+ const builtWithRef = useRef(null);
77
75
  const onSelectRef = useRef(onSelect);
78
76
  onSelectRef.current = onSelect;
79
77
  const onLabelContrastRef = useRef(onLabelContrast);
@@ -124,18 +122,24 @@ function BicChart(props) {
124
122
  onSelectRef.current?.(sourceIdxs);
125
123
  });
126
124
  host.render();
125
+ builtWithRef.current = { data, optKey };
127
126
  return () => {
128
127
  off();
129
128
  host.destroy();
130
129
  hostRef.current = null;
131
130
  };
132
131
  }, [code, renderFn, d3, geoKind, labelContrast]);
133
- const optKey = useMemo(() => JSON.stringify(options ?? {}), [options]);
134
132
  useEffect(() => {
135
- if (hostRef.current && options) hostRef.current.setOptions(options);
133
+ if (!hostRef.current || !options) return;
134
+ if (builtWithRef.current?.optKey === optKey) return;
135
+ builtWithRef.current = { ...builtWithRef.current, optKey };
136
+ hostRef.current.setOptions(options);
136
137
  }, [optKey]);
137
138
  useEffect(() => {
138
- if (hostRef.current && data) hostRef.current.setData(data);
139
+ if (!hostRef.current || !data) return;
140
+ if (builtWithRef.current?.data === data) return;
141
+ builtWithRef.current = { ...builtWithRef.current, data };
142
+ hostRef.current.setData(data);
139
143
  }, [data]);
140
144
  useEffect(() => {
141
145
  const host = hostRef.current;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bicharts/chart-host",
3
- "version": "0.6.8",
3
+ "version": "0.6.10",
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",