@bicharts/chart-host 0.6.28 → 0.6.30

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.
@@ -201,17 +201,17 @@ var require_papaparse_min = __commonJS({
201
201
  e = true, s2.abort(), p4.meta.aborted = true, q3(m2.complete) && m2.complete(p4), n2 = "";
202
202
  }, this.guessLineEndings = function(e2, t2) {
203
203
  e2 = e2.substring(0, 1048576);
204
- 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;
204
+ var t2 = new RegExp(U4(t2) + "([^]*?)" + U4(t2), "gm"), i4 = (e2 = e2.replace(t2, "")).split("\r"), t2 = e2.split("\n"), e2 = 1 < t2.length && t2[0].length < i4[0].length;
205
205
  if (1 === i4.length || e2) return "\n";
206
206
  for (var r4 = 0, n4 = 0; n4 < i4.length; n4++) "\n" === i4[n4][0] && r4++;
207
207
  return r4 >= i4.length / 2 ? "\r\n" : "\r";
208
208
  };
209
209
  }
210
- function U3(e) {
210
+ function U4(e) {
211
211
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
212
212
  }
213
213
  function E4(C2) {
214
- var S = (C2 = C2 || {}).delimiter, O3 = C2.newline, x2 = C2.comments, I4 = C2.step, A2 = C2.preview, T3 = C2.fastMode, D3 = null, L2 = false, F4 = null == C2.quoteChar ? '"' : C2.quoteChar, j3 = F4;
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
215
  if (void 0 !== C2.escapeChar && (j3 = C2.escapeChar), ("string" != typeof S || -1 < v4.BAD_DELIMITERS.indexOf(S)) && (S = ","), x2 === S) throw new Error("Comment character same as delimiter");
216
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
217
  var z4 = 0, M = false;
@@ -219,7 +219,7 @@ var require_papaparse_min = __commonJS({
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;
221
221
  if (!i2) return w3();
222
- if (T3 || false !== T3 && -1 === i2.indexOf(F4)) {
222
+ if (T4 || false !== T4 && -1 === i2.indexOf(F3)) {
223
223
  for (var l2 = i2.split(O3), c4 = 0; c4 < l2.length; c4++) {
224
224
  if (d3 = l2[c4], z4 += d3.length, c4 !== l2.length - 1) z4 += O3.length;
225
225
  else if (r2) return w3();
@@ -232,20 +232,20 @@ var require_papaparse_min = __commonJS({
232
232
  }
233
233
  return w3();
234
234
  }
235
- for (var p4 = i2.indexOf(S, z4), g4 = i2.indexOf(O3, z4), _3 = new RegExp(U3(j3) + U3(F4), "g"), m2 = i2.indexOf(F4, z4); ; ) if (i2[z4] === F4) for (m2 = z4, z4++; ; ) {
236
- if (-1 === (m2 = i2.indexOf(F4, 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, F4));
238
- if (F4 === j3 && i2[m2 + 1] === j3) m2++;
239
- else if (F4 === j3 || 0 === m2 || i2[m2 - 1] !== j3) {
235
+ for (var p4 = i2.indexOf(S, z4), g4 = i2.indexOf(O3, z4), _3 = new RegExp(U4(j3) + U4(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));
238
+ if (F3 === j3 && i2[m2 + 1] === j3) m2++;
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
241
  var y6 = v5(-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
- d3.push(i2.substring(z4, m2).replace(_3, F4)), i2[z4 = m2 + 1 + y6 + e] !== F4 && (m2 = i2.indexOf(F4, z4)), p4 = i2.indexOf(S, z4), g4 = i2.indexOf(O3, z4);
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
246
  y6 = v5(g4);
247
247
  if (i2.substring(m2 + 1 + y6, m2 + 1 + y6 + s2) === O3) {
248
- if (d3.push(i2.substring(z4, m2).replace(_3, F4)), b5(m2 + 1 + y6 + s2), p4 = i2.indexOf(S, z4), m2 = i2.indexOf(F4, 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(), M)) return w3();
249
249
  if (A2 && h4.length >= A2) return w3(true);
250
250
  break;
251
251
  }
@@ -358,7 +358,7 @@ var require_papaparse_min = __commonJS({
358
358
  }
359
359
  void 0 !== t.escapeChar && (o2 = t.escapeChar + a5), t.escapeFormulae instanceof RegExp ? h4 = t.escapeFormulae : "boolean" == typeof t.escapeFormulae && t.escapeFormulae && (h4 = /^[=+\-@\t\r].*$/);
360
360
  }
361
- })(), new RegExp(U3(a5), "g"));
361
+ })(), new RegExp(U4(a5), "g"));
362
362
  "string" == typeof e && (e = JSON.parse(e));
363
363
  if (Array.isArray(e)) {
364
364
  if (!e.length || Array.isArray(e[0])) return n2(null, e, i2);
@@ -549,7 +549,7 @@ function deltaE2000(c1, c2) {
549
549
  else if (Math.abs(h1p - h2p) <= 180) hbarp = (h1p + h2p) / 2;
550
550
  else if (h1p + h2p < 360) hbarp = (h1p + h2p + 360) / 2;
551
551
  else hbarp = (h1p + h2p - 360) / 2;
552
- const T3 = 1 - 0.17 * Math.cos((hbarp - 30) * RAD) + 0.24 * Math.cos(2 * hbarp * RAD) + 0.32 * Math.cos((3 * hbarp + 6) * RAD) - 0.2 * Math.cos((4 * hbarp - 63) * RAD);
552
+ const T4 = 1 - 0.17 * Math.cos((hbarp - 30) * RAD) + 0.24 * Math.cos(2 * hbarp * RAD) + 0.32 * Math.cos((3 * hbarp + 6) * RAD) - 0.2 * Math.cos((4 * hbarp - 63) * RAD);
553
553
  const dTheta = 30 * Math.exp(-Math.pow((hbarp - 275) / 25, 2));
554
554
  const Cbarp7 = Math.pow(Cbarp, 7);
555
555
  const RC = 2 * Math.sqrt(Cbarp7 / (Cbarp7 + Math.pow(25, 7)));
@@ -557,7 +557,7 @@ function deltaE2000(c1, c2) {
557
557
  const Lm50 = Math.pow(Lbarp - 50, 2);
558
558
  const SL = 1 + 0.015 * Lm50 / Math.sqrt(20 + Lm50);
559
559
  const SC = 1 + 0.045 * Cbarp;
560
- const SH = 1 + 0.015 * Cbarp * T3;
560
+ const SH = 1 + 0.015 * Cbarp * T4;
561
561
  const tL = dLp / SL, tC = dCp / SC, tH = dHp / SH;
562
562
  return Math.sqrt(tL * tL + tC * tC + tH * tH + RT * tC * tH);
563
563
  }
@@ -1587,7 +1587,7 @@ var J4 = 400;
1587
1587
  function B3(e) {
1588
1588
  return !!E(e);
1589
1589
  }
1590
- function F3(e) {
1590
+ function T3(e) {
1591
1591
  let n = /* @__PURE__ */ new Set();
1592
1592
  for (let t of e) {
1593
1593
  if (t == null) continue;
@@ -1597,7 +1597,7 @@ function F3(e) {
1597
1597
  return Array.from(n);
1598
1598
  }
1599
1599
  function v3(e) {
1600
- let n = F3(e);
1600
+ let n = T3(e);
1601
1601
  if (n.length === 0 || W2(e) < 95) return false;
1602
1602
  let t = n.filter((u2) => B3(u2) && !Y(u2)).length, o = n.filter((u2) => !B3(u2) && !!Y(u2)).length;
1603
1603
  return t >= 1 && t >= o;
@@ -1608,20 +1608,20 @@ function Y3(e, n) {
1608
1608
  return t ? n === "world" ? true : s3.has(t) : false;
1609
1609
  }
1610
1610
  function W2(e) {
1611
- let n = F3(e);
1611
+ let n = T3(e);
1612
1612
  if (n.length === 0) return 0;
1613
1613
  let t = 0;
1614
1614
  for (let o of n) B3(o) && t++;
1615
1615
  return Math.round(t / n.length * 1e3) / 10;
1616
1616
  }
1617
1617
  function k3(e) {
1618
- let n = F3(e);
1618
+ let n = T3(e);
1619
1619
  if (n.length === 0) return 0;
1620
1620
  let t = 0;
1621
1621
  for (let o of n) Y(o) && t++;
1622
1622
  return Math.round(t / n.length * 1e3) / 10;
1623
1623
  }
1624
- function H3(e) {
1624
+ function $2(e) {
1625
1625
  let n = /* @__PURE__ */ new Set();
1626
1626
  for (let t of e) {
1627
1627
  if (t == null) continue;
@@ -1630,18 +1630,18 @@ function H3(e) {
1630
1630
  }
1631
1631
  return Array.from(n);
1632
1632
  }
1633
- function $2(e) {
1634
- let n = H3(e);
1633
+ function U3(e) {
1634
+ let n = $2(e);
1635
1635
  if (n.length === 0) return 0;
1636
1636
  let t = 0;
1637
1637
  for (let o of n) Z(o).length > 0 && t++;
1638
1638
  return Math.round(t / n.length * 1e3) / 10;
1639
1639
  }
1640
1640
  function Z3(e, n) {
1641
- return y4(n, rt) ? true : H3(e).some((t) => /^\d{5}(-\d{4})?$/.test(t.replace(/\.0+$/, "")));
1641
+ return y4(n, rt) ? true : $2(e).some((t) => /^\d{5}(-\d{4})?$/.test(t.replace(/\.0+$/, "")));
1642
1642
  }
1643
1643
  function ot(e, n) {
1644
- let t = F3(e);
1644
+ let t = T3(e);
1645
1645
  if (t.length === 0) return 0;
1646
1646
  let o = 0;
1647
1647
  for (let u2 of t) p3(u2, n) && o++;
@@ -1649,12 +1649,12 @@ function ot(e, n) {
1649
1649
  }
1650
1650
  function z3(e, n) {
1651
1651
  let t = 0;
1652
- for (let o of F3(e)) n(o) && t++;
1652
+ for (let o of T3(e)) n(o) && t++;
1653
1653
  return t;
1654
1654
  }
1655
1655
  function it2(e, n) {
1656
1656
  let t = 0;
1657
- for (let o of H3(e)) n(o) && t++;
1657
+ for (let o of $2(e)) n(o) && t++;
1658
1658
  return t;
1659
1659
  }
1660
1660
  function st(e, n, t, o, u2) {
@@ -1670,18 +1670,18 @@ function st(e, n, t, o, u2) {
1670
1670
  }
1671
1671
  let C2 = t?.zip;
1672
1672
  if (C2 && R2.has(C2)) {
1673
- let r = f4(C2), l = $2(r);
1673
+ let r = f4(C2), l = U3(r);
1674
1674
  l < 95 ? s.push(`zip=${C2} (only ${l}% of values read as ZIPs)`) : Z3(r, C2) ? i.zip = C2 : s.push(`zip=${C2} (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 && R2.has(g3)) {
1678
- let r = f4(g3), l = F3(r);
1678
+ let r = f4(g3), l = T3(r);
1679
1679
  l.length > 0 && l.every((d2) => Y3(d2, o)) ? s.push(`state=${g3} (every value is "CA", which is both Canada and California)`) : v3(r) ? (s.push(`state=${g3} (every value is a country, not a state)`), i.country || (i.country = g3)) : k3(r) < 95 ? s.push(`state=${g3} (only ${k3(r)}% of values are states/provinces)`) : i.state = g3;
1680
1680
  }
1681
- let b4 = new Set(Object.values(i).filter(Boolean)), T3 = e.filter((r) => !b4.has(r) && !r.startsWith("__"));
1681
+ let b4 = new Set(Object.values(i).filter(Boolean)), M = e.filter((r) => !b4.has(r) && !r.startsWith("__"));
1682
1682
  if (!i.state) {
1683
1683
  let r = null;
1684
- for (let l of T3) {
1684
+ for (let l of M) {
1685
1685
  let d2 = f4(l);
1686
1686
  if (v3(d2)) continue;
1687
1687
  let p2 = k3(d2);
@@ -1691,9 +1691,9 @@ function st(e, n, t, o, u2) {
1691
1691
  }
1692
1692
  r && (i.state = r.name, b4.add(r.name), a4.push(`state=${r.name} (${r.pct}% states/provinces)`));
1693
1693
  }
1694
- if (!i.zip) for (let r of T3) {
1694
+ if (!i.zip) for (let r of M) {
1695
1695
  if (b4.has(r)) continue;
1696
- let l = f4(r), d2 = $2(l);
1696
+ let l = f4(r), d2 = U3(l);
1697
1697
  if (!(d2 < 95) && Z3(l, r) && !(it2(l, (p2) => Z(p2).length > 0) < K3)) {
1698
1698
  i.zip = r, b4.add(r), a4.push(`zip=${r} (${d2}% ZIP codes)`);
1699
1699
  break;
@@ -1702,7 +1702,7 @@ function st(e, n, t, o, u2) {
1702
1702
  let P4 = i.country;
1703
1703
  if (!P4 || !v3(f4(P4))) {
1704
1704
  let r = null;
1705
- for (let l of T3) {
1705
+ for (let l of M) {
1706
1706
  if (b4.has(l) || !v3(f4(l))) continue;
1707
1707
  let d2 = W2(f4(l));
1708
1708
  (!r || d2 > r.pct) && (r = { name: l, pct: d2 });
@@ -1711,14 +1711,14 @@ function st(e, n, t, o, u2) {
1711
1711
  }
1712
1712
  if (!i.city) {
1713
1713
  let r = null;
1714
- for (let l of T3) {
1714
+ for (let l of M) {
1715
1715
  if (b4.has(l)) continue;
1716
1716
  let d2 = f4(l), p2 = ot(d2, o);
1717
1717
  p2 < m3 || z3(d2, (_2) => p3(_2, o)) < K3 || (!r || p2 > r.pct) && (r = { name: l, pct: p2 });
1718
1718
  }
1719
1719
  r && (i.city = r.name, a4.push(`city=${r.name} (${r.pct}% known cities)`));
1720
1720
  }
1721
- let U3 = i.country ? f4(i.country) : [], E4 = !!i.country && v3(U3), ce = E4 ? new Set(U3.map((r) => E(r == null ? null : String(r))).filter(Boolean)).size : 0, j3 = E4 && ce >= 2, O3 = !!(i.lat && i.lon) && n.some((r) => {
1721
+ let H3 = i.country ? f4(i.country) : [], E4 = !!i.country && v3(H3), ce = E4 ? new Set(H3.map((r) => E(r == null ? null : String(r))).filter(Boolean)).size : 0, j3 = E4 && ce >= 2, O3 = !!(i.lat && i.lon) && n.some((r) => {
1722
1722
  let l = +String(r[i.lat] ?? "").trim(), d2 = +String(r[i.lon] ?? "").trim();
1723
1723
  return isFinite(l) && isFinite(d2) && l >= -90 && l <= 90 && d2 >= -180 && d2 <= 180 && String(r[i.lat] ?? "").trim() !== "" && String(r[i.lon] ?? "").trim() !== "";
1724
1724
  });
package/dist/index.mjs CHANGED
@@ -140,7 +140,7 @@ import {
140
140
  unpinScrolledAxis,
141
141
  valuePlacementFlag,
142
142
  withoutViewOnlyKeys
143
- } from "./chunk-VKFEN6MS.mjs";
143
+ } from "./chunk-KONJ3DXV.mjs";
144
144
  import "./chunk-A2GMXZP7.mjs";
145
145
  import "./chunk-GHODWOAL.mjs";
146
146
 
package/dist/react.mjs CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  loadGeo,
8
8
  syncMemberSelection,
9
9
  toSourceRows
10
- } from "./chunk-VKFEN6MS.mjs";
10
+ } from "./chunk-KONJ3DXV.mjs";
11
11
  import "./chunk-A2GMXZP7.mjs";
12
12
  import "./chunk-GHODWOAL.mjs";
13
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bicharts/chart-host",
3
- "version": "0.6.28",
3
+ "version": "0.6.30",
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",