@bicharts/chart-host 0.6.39 → 0.6.40

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.
@@ -1643,7 +1643,7 @@ function te(t) {
1643
1643
  function ce2(t, e) {
1644
1644
  return y2(e, rt) ? true : ne2(t).some((n) => /^\d{5}(-\d{4})?$/.test(n.replace(/\.0+$/, "")));
1645
1645
  }
1646
- function Pn2(t, e) {
1646
+ function Mn2(t, e) {
1647
1647
  let n = F3(t);
1648
1648
  if (n.length === 0) return 0;
1649
1649
  let o2 = 0;
@@ -1660,79 +1660,80 @@ function Ln(t, e) {
1660
1660
  for (let o2 of ne2(t)) e(o2) && n++;
1661
1661
  return n;
1662
1662
  }
1663
- function Mn2(t, e, n, o2, u2) {
1664
- let l = [], a2 = [], i = {}, S2 = {}, T2 = new Set(t), b4 = (s) => e.map((d2) => d2[s]);
1665
- for (let s of ["city", "country"]) {
1666
- let d2 = n?.[s];
1667
- d2 && T2.has(d2) && (i[s] = d2);
1663
+ function _n(t, e, n, o2, u2) {
1664
+ let l = [], a2 = [], s = {}, b4 = {}, T2 = new Set(t), C2 = (i) => e.map((c2) => c2[i]);
1665
+ for (let i of ["city", "country"]) {
1666
+ let c2 = n?.[i];
1667
+ c2 && T2.has(c2) && (s[i] = c2);
1668
1668
  }
1669
1669
  let y4 = new Set(u2 ?? t);
1670
- for (let s of ["lat", "lon"]) {
1671
- let d2 = n?.[s];
1672
- d2 && y4.has(d2) && (i[s] = d2);
1670
+ for (let i of ["lat", "lon"]) {
1671
+ let c2 = n?.[i];
1672
+ c2 && y4.has(c2) && (s[i] = c2);
1673
1673
  }
1674
- let m2 = n?.zip;
1675
- if (m2 && T2.has(m2)) {
1676
- let s = b4(m2), d2 = te(s);
1677
- d2 < 95 ? a2.push(`zip=${m2} (only ${d2}% of values read as ZIPs)`) : ce2(s, m2) ? i.zip = m2 : a2.push(`zip=${m2} (all values are 3-4 digits with nothing to say they are postal)`);
1674
+ let f4 = n?.zip;
1675
+ if (f4 && T2.has(f4)) {
1676
+ let i = C2(f4), c2 = te(i);
1677
+ c2 < 95 ? a2.push(`zip=${f4} (only ${c2}% of values read as ZIPs)`) : ce2(i, f4) ? s.zip = f4 : a2.push(`zip=${f4} (all values are 3-4 digits with nothing to say they are postal)`);
1678
1678
  }
1679
- let p2 = n?.state;
1680
- if (p2 && T2.has(p2)) {
1681
- let s = b4(p2), d2 = F3(s);
1682
- d2.length > 0 && d2.every((E4) => ue2(E4, o2)) ? a2.push(`state=${p2} (every value is "CA", which is both Canada and California)`) : I4(s) ? (a2.push(`state=${p2} (every value is a country, not a state)`), i.country || (i.country = p2)) : z3(s) < 95 ? a2.push(`state=${p2} (only ${z3(s)}% of values are states/provinces)`) : i.state = p2;
1679
+ let d2 = n?.state;
1680
+ if (d2 && T2.has(d2)) {
1681
+ let i = C2(d2), c2 = F3(i);
1682
+ c2.length > 0 && c2.every((S2) => ue2(S2, o2)) ? a2.push(`state=${d2} (every value is "CA", which is both Canada and California)`) : I4(i) ? (a2.push(`state=${d2} (every value is a country, not a state)`), s.country || (s.country = d2)) : z3(i) < 95 ? a2.push(`state=${d2} (only ${z3(i)}% of values are states/provinces)`) : s.state = d2;
1683
1683
  }
1684
- let c2 = new Set(Object.values(i).filter(Boolean)), C2 = t.filter((s) => !c2.has(s) && !s.startsWith("__"));
1685
- if (!i.state) {
1686
- let s = null;
1687
- for (let d2 of C2) {
1688
- let E4 = b4(d2);
1689
- if (I4(E4)) continue;
1690
- let P4 = z3(E4);
1684
+ let p2 = new Set(Object.values(s).filter(Boolean)), g3 = t.filter((i) => !p2.has(i) && !i.startsWith("__"));
1685
+ if (!s.state) {
1686
+ let i = null;
1687
+ for (let c2 of g3) {
1688
+ let S2 = C2(c2);
1689
+ if (I4(S2)) continue;
1690
+ let P4 = z3(S2);
1691
1691
  if (P4 < 95) continue;
1692
- let K3 = J4(E4, (V3) => !!Y(V3)), Pe = J4(E4, (V3) => !!Y(V3) && !ue2(V3, o2));
1693
- K3 < X3 && Pe < 1 || (!s || P4 > s.pct) && (s = { name: d2, pct: P4 });
1692
+ let $3 = J4(S2, (V3) => !!Y(V3)), Me = J4(S2, (V3) => !!Y(V3) && !ue2(V3, o2));
1693
+ $3 < X3 && Me < 1 || (!i || P4 > i.pct) && (i = { name: c2, pct: P4 });
1694
1694
  }
1695
- s && (i.state = s.name, c2.add(s.name), l.push(`state=${s.name} (${s.pct}% states/provinces)`));
1695
+ i && (s.state = i.name, p2.add(i.name), l.push(`state=${i.name} (${i.pct}% states/provinces)`));
1696
1696
  }
1697
- if (!i.zip) for (let s of C2) {
1698
- if (c2.has(s)) continue;
1699
- let d2 = b4(s), E4 = te(d2);
1700
- if (!(E4 < 95) && ce2(d2, s) && !(Ln(d2, (P4) => Z(P4).length > 0) < X3)) {
1701
- i.zip = s, c2.add(s), l.push(`zip=${s} (${E4}% ZIP codes)`);
1697
+ if (!s.zip) for (let i of g3) {
1698
+ if (p2.has(i)) continue;
1699
+ let c2 = C2(i), S2 = te(c2);
1700
+ if (!(S2 < 95) && ce2(c2, i) && !(Ln(c2, (P4) => Z(P4).length > 0) < X3)) {
1701
+ s.zip = i, p2.add(i), l.push(`zip=${i} (${S2}% ZIP codes)`);
1702
1702
  break;
1703
1703
  }
1704
1704
  }
1705
- let R2 = i.country;
1706
- if (!R2 || !I4(b4(R2))) {
1707
- let s = null;
1708
- for (let d2 of C2) {
1709
- if (c2.has(d2) || !I4(b4(d2))) continue;
1710
- let E4 = ee3(b4(d2));
1711
- (!s || E4 > s.pct) && (s = { name: d2, pct: E4 });
1705
+ let E4 = s.country;
1706
+ if (!E4 || !I4(C2(E4))) {
1707
+ let i = null;
1708
+ for (let c2 of g3) {
1709
+ if (p2.has(c2) || !I4(C2(c2))) continue;
1710
+ let S2 = ee3(C2(c2));
1711
+ (!i || S2 > i.pct) && (i = { name: c2, pct: S2 });
1712
1712
  }
1713
- s && (R2 && (a2.push(`country=${R2} (only ${ee3(b4(R2))}% of values are country identifiers; using ${s.name} instead)`), S2.country = R2), i.country = s.name, c2.add(s.name), l.push(`country=${s.name}`));
1713
+ i && (E4 && (a2.push(`country=${E4} (only ${ee3(C2(E4))}% of values are country identifiers; using ${i.name} instead)`), b4.country = E4), s.country = i.name, p2.add(i.name), l.push(`country=${i.name}`));
1714
1714
  }
1715
- if (!i.city) {
1716
- let s = null;
1717
- for (let d2 of C2) {
1718
- if (c2.has(d2)) continue;
1719
- let E4 = b4(d2), P4 = Pn2(E4, o2);
1720
- P4 < m3 || J4(E4, (K3) => p3(K3, o2)) < X3 || (!s || P4 > s.pct) && (s = { name: d2, pct: P4 });
1715
+ if (!s.city) {
1716
+ let i = null;
1717
+ for (let c2 of g3) {
1718
+ if (p2.has(c2)) continue;
1719
+ let S2 = C2(c2), P4 = Mn2(S2, o2);
1720
+ P4 < m3 || J4(S2, ($3) => p3($3, o2)) < X3 || (!i || P4 > i.pct) && (i = { name: c2, pct: P4 });
1721
1721
  }
1722
- s && (i.city = s.name, l.push(`city=${s.name} (${s.pct}% known cities)`));
1722
+ i && (s.city = i.name, l.push(`city=${i.name} (${i.pct}% known cities)`));
1723
1723
  }
1724
- let w2 = i.country ? b4(i.country) : [], v2 = !!i.country && I4(w2), _3 = v2 ? new Set(w2.map((s) => E(s == null ? null : String(s))).filter(Boolean)).size : 0, x3 = v2 && _3 >= 2, g3 = !!(i.lat && i.lon) && e.some((s) => {
1725
- let d2 = +String(s[i.lat] ?? "").trim(), E4 = +String(s[i.lon] ?? "").trim();
1726
- return isFinite(d2) && isFinite(E4) && d2 >= -90 && d2 <= 90 && E4 >= -180 && E4 <= 180 && String(s[i.lat] ?? "").trim() !== "" && String(s[i.lon] ?? "").trim() !== "";
1724
+ let L4 = s.country ? C2(s.country) : [], R2 = !!s.country && I4(L4), _3 = R2 ? new Set(L4.map((i) => E(i == null ? null : String(i))).filter(Boolean)).size : 0, x3 = R2 && _3 >= 2, w2 = !!(s.lat && s.lon) && e.some((i) => {
1725
+ let c2 = +String(i[s.lat] ?? "").trim(), S2 = +String(i[s.lon] ?? "").trim();
1726
+ return isFinite(c2) && isFinite(S2) && c2 >= -90 && c2 <= 90 && S2 >= -180 && S2 <= 180 && String(i[s.lat] ?? "").trim() !== "" && String(i[s.lon] ?? "").trim() !== "";
1727
1727
  });
1728
- return i.lat && i.lon && !g3 && a2.push(`lat/lon=${i.lat}/${i.lon} (no row holds a usable coordinate pair)`), i.country && !x3 && !(i.city || i.state || i.zip || g3) && a2.push(v2 ? `country=${i.country} (every row resolves to the same country - nothing to place apart)` : `country=${i.country} (values are not country identifiers)`), { bind: !!(i.city || i.state || i.zip || x3 || g3) ? i : null, backfilled: l, refused: a2, ...Object.keys(S2).length ? { labelFallback: S2 } : {} };
1728
+ return s.lat && s.lon && !w2 && a2.push(`lat/lon=${s.lat}/${s.lon} (no row holds a usable coordinate pair)`), s.country && !x3 && !(s.city || s.state || s.zip || w2) && a2.push(R2 ? `country=${s.country} (every row resolves to the same country - nothing to place apart)` : `country=${s.country} (values are not country identifiers)`), { bind: !!(s.city || s.state || s.zip || x3 || w2) ? s : null, backfilled: l, refused: a2, ...Object.keys(b4).length ? { labelFallback: b4 } : {} };
1729
1729
  }
1730
1730
  var r = (t, ...e) => ({ part: t, langs: Object.freeze(e) });
1731
1731
  var re2 = Object.freeze({ jaar: r("year", "nl"), kwartaal: r("quarter", "nl"), maand: r("month", "nl"), dag: r("day", "nl", "sv", "da", "nb"), jahr: r("year", "de"), quartal: r("quarter", "de"), monat: r("month", "de"), tag: r("day", "de"), ann\u00E9e: r("year", "fr"), mois: r("month", "fr"), jour: r("day", "fr"), trimestre: r("quarter", "fr", "es", "pt", "it"), a\u00F1o: r("year", "es"), mes: r("month", "es"), d\u00EDa: r("day", "es"), ano: r("year", "pt"), m\u00EAs: r("month", "pt"), dia: r("day", "pt"), anno: r("year", "it"), mese: r("month", "it"), giorno: r("day", "it"), \u0433\u043E\u0434: r("year", "ru"), \u043C\u0435\u0441\u044F\u0446: r("month", "ru"), \u0440\u0456\u043A: r("year", "uk"), \u043C\u0456\u0441\u044F\u0446\u044C: r("month", "uk"), \u043A\u0432\u0430\u0440\u0442\u0430\u043B: r("quarter", "ru", "uk"), \u0434\u0435\u043D\u044C: r("day", "ru", "uk"), rok: r("year", "pl", "cs", "sk"), kwarta\u0142: r("quarter", "pl"), miesi\u0105c: r("month", "pl"), dzie\u0144: r("day", "pl"), \u010Dtvrtlet\u00ED: r("quarter", "cs"), m\u011Bs\u00EDc: r("month", "cs"), den: r("day", "cs"), \u0161tvr\u0165rok: r("quarter", "sk"), mesiac: r("month", "sk"), de\u0148: r("day", "sk"), \u00E5r: r("year", "sv", "da", "nb"), kvartal: r("quarter", "sv", "da", "nb"), m\u00E5nad: r("month", "sv"), m\u00E5ned: r("month", "da", "nb"), vuosi: r("year", "fi"), vuosinelj\u00E4nnes: r("quarter", "fi"), kuukausi: r("month", "fi"), p\u00E4iv\u00E4: r("day", "fi"), \u00E9v: r("year", "hu"), negyed\u00E9v: r("quarter", "hu"), h\u00F3nap: r("month", "hu"), nap: r("day", "hu"), y\u0131l: r("year", "tr"), \u00E7eyrek: r("quarter", "tr"), ay: r("month", "tr"), g\u00FCn: r("day", "tr"), \u03AD\u03C4\u03BF\u03C2: r("year", "el"), \u03C4\u03C1\u03AF\u03BC\u03B7\u03BD\u03BF: r("quarter", "el"), \u03BC\u03AE\u03BD\u03B1\u03C2: r("month", "el"), \u03B7\u03BC\u03AD\u03C1\u03B1: r("day", "el"), an: r("year", "ro"), trimestru: r("quarter", "ro"), lun\u0103: r("month", "ro"), zi: r("day", "ro"), godina: r("year", "hr"), tromjese\u010Dje: r("quarter", "hr"), mjesec: r("month", "hr"), dan: r("day", "hr"), \u5E74: r("year", "ja", "zh"), \u56DB\u534A\u671F: r("quarter", "ja"), \u5B63\u5EA6: r("quarter", "zh"), \u6708: r("month", "ja", "zh"), \u65E5: r("day", "ja", "zh"), \uC5F0\uB3C4: r("year", "ko"), \uBD84\uAE30: r("quarter", "ko"), \uC6D4: r("month", "ko"), \uC77C: r("day", "ko"), tahun: r("year", "id"), kuartal: r("quarter", "id"), triwulan: r("quarter", "id"), bulan: r("month", "id"), hari: r("day", "id"), n\u0103m: r("year", "vi"), qu\u00FD: r("quarter", "vi"), th\u00E1ng: r("month", "vi"), ng\u00E0y: r("day", "vi"), \u0E1B\u0E35: r("year", "th"), \u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A: r("quarter", "th"), \u0E40\u0E14\u0E37\u0E2D\u0E19: r("month", "th"), \u0E27\u0E31\u0E19: r("day", "th"), \u0627\u0644\u0633\u0646\u0629: r("year", "ar"), \u0633\u0646\u0629: r("year", "ar"), \u0627\u0644\u0639\u0627\u0645: r("year", "ar"), \u0639\u0627\u0645: r("year", "ar"), \u0627\u0644\u0631\u0628\u0639: r("quarter", "ar"), \u0631\u0628\u0639: r("quarter", "ar"), "\u0631\u0628\u0639 \u0627\u0644\u0633\u0646\u0629": r("quarter", "ar"), \u0627\u0644\u0634\u0647\u0631: r("month", "ar"), \u0634\u0647\u0631: r("month", "ar"), \u0627\u0644\u064A\u0648\u0645: r("day", "ar"), \u064A\u0648\u0645: r("day", "ar"), \u05E9\u05E0\u05D4: r("year", "he"), \u05E8\u05D1\u05E2\u05D5\u05DF: r("quarter", "he"), \u05D7\u05D5\u05D3\u05E9: r("month", "he"), \u05D9\u05D5\u05DD: r("day", "he"), \u0935\u0930\u094D\u0937: r("year", "hi"), \u0938\u093E\u0932: r("year", "hi"), \u0924\u093F\u092E\u093E\u0939\u0940: r("quarter", "hi"), \u092E\u0939\u0940\u0928\u093E: r("month", "hi"), \u092E\u093E\u0939: r("month", "hi"), \u0926\u093F\u0928: r("day", "hi"), \u0633\u0627\u0644: r("year", "fa"), \u0645\u0627\u0647: r("month", "fa"), \u0631\u0648\u0632: r("day", "fa") });
1732
- var _n = Object.freeze(Array.from(new Set(Object.values(re2).flatMap((t) => t.langs))));
1732
+ var An = Object.freeze(Array.from(new Set(Object.values(re2).flatMap((t) => t.langs))));
1733
1733
  var me = Object.freeze(["fa", "ar", "he", "th"]);
1734
- var Zn2 = Object.freeze({ integer: "number", decimal: "number", double: "number", datetime: "date", date: "date", boolean: "boolean", string: "text" });
1735
- var ar = Object.freeze({ RENDER_START: "render-start", RENDER_OK: "render-ok", RENDER_ERROR: "render-error", VIEW: "view", VIEW_VERDICT: "view-verdict" });
1734
+ var er = Object.freeze({ integer: "number", decimal: "number", double: "number", datetime: "date", date: "date", boolean: "boolean", string: "text" });
1735
+ var lr = Object.freeze({ RENDER_START: "render-start", RENDER_OK: "render-ok", RENDER_ERROR: "render-error", VIEW: "view", VIEW_VERDICT: "view-verdict" });
1736
+ var we2 = 2 ** 31 - 1;
1736
1737
 
1737
1738
  // src/payload.ts
1738
1739
  var ROW_IDX_COLUMN = "__rowIdx__";
@@ -1747,7 +1748,7 @@ function resolvePointChannel(cols, rowObjs, point) {
1747
1748
  let labelCol;
1748
1749
  if (bind) {
1749
1750
  const dims = cols.filter((c2) => !c2.isMeasure).map((c2) => c2.name);
1750
- const res = Mn2(dims, rowObjs, bind, point?.mapKind, cols.map((c2) => c2.name));
1751
+ const res = _n(dims, rowObjs, bind, point?.mapKind, cols.map((c2) => c2.name));
1751
1752
  bind = res.bind;
1752
1753
  rolesBackfilled = res.backfilled;
1753
1754
  rolesRefused = res.refused;
package/dist/index.mjs CHANGED
@@ -140,7 +140,7 @@ import {
140
140
  unpinScrolledAxis,
141
141
  valuePlacementFlag,
142
142
  withoutViewOnlyKeys
143
- } from "./chunk-XC527HDN.mjs";
143
+ } from "./chunk-ENE64U44.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-XC527HDN.mjs";
10
+ } from "./chunk-ENE64U44.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.39",
3
+ "version": "0.6.40",
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",