@bicharts/chart-host 0.6.3 → 0.6.4
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.
|
@@ -1629,12 +1629,12 @@ function N2(i, n) {
|
|
|
1629
1629
|
for (let r of S(i)) n(r) && t++;
|
|
1630
1630
|
return t;
|
|
1631
1631
|
}
|
|
1632
|
-
function
|
|
1632
|
+
function bt(i, n) {
|
|
1633
1633
|
let t = 0;
|
|
1634
1634
|
for (let r of $2(i)) n(r) && t++;
|
|
1635
1635
|
return t;
|
|
1636
1636
|
}
|
|
1637
|
-
function
|
|
1637
|
+
function Mt2(i, n, t, r, c2) {
|
|
1638
1638
|
let l = [], a4 = [], o = {}, R2 = {}, h3 = new Set(i), f4 = (e) => n.map((s) => s[e]);
|
|
1639
1639
|
for (let e of ["city", "country"]) {
|
|
1640
1640
|
let s = t?.[e];
|
|
@@ -1655,23 +1655,23 @@ function bt(i, n, t, r, c2) {
|
|
|
1655
1655
|
let e = f4(p2), s = S(e);
|
|
1656
1656
|
s.length > 0 && s.every((u2) => V2(u2, r)) ? a4.push(`state=${p2} (every value is "CA", which is both Canada and California)`) : P2(e) ? (a4.push(`state=${p2} (every value is a country, not a state)`), o.country || (o.country = p2)) : D3(e) < 95 ? a4.push(`state=${p2} (only ${D3(e)}% of values are states/provinces)`) : o.state = p2;
|
|
1657
1657
|
}
|
|
1658
|
-
let y5 = new Set(Object.values(o).filter(Boolean)),
|
|
1658
|
+
let y5 = new Set(Object.values(o).filter(Boolean)), T3 = i.filter((e) => !y5.has(e) && !e.startsWith("__"));
|
|
1659
1659
|
if (!o.state) {
|
|
1660
1660
|
let e = null;
|
|
1661
|
-
for (let s of
|
|
1661
|
+
for (let s of T3) {
|
|
1662
1662
|
let u2 = f4(s);
|
|
1663
1663
|
if (P2(u2)) continue;
|
|
1664
1664
|
let m2 = D3(u2);
|
|
1665
1665
|
if (m2 < 95) continue;
|
|
1666
|
-
let F3 = N2(u2, (
|
|
1666
|
+
let F3 = N2(u2, (A) => !!Y(A)), Q3 = N2(u2, (A) => !!Y(A) && !V2(A, r));
|
|
1667
1667
|
F3 < G2 && Q3 < 1 || (!e || m2 > e.pct) && (e = { name: s, pct: m2 });
|
|
1668
1668
|
}
|
|
1669
1669
|
e && (o.state = e.name, y5.add(e.name), l.push(`state=${e.name} (${e.pct}% states/provinces)`));
|
|
1670
1670
|
}
|
|
1671
|
-
if (!o.zip) for (let e of
|
|
1671
|
+
if (!o.zip) for (let e of T3) {
|
|
1672
1672
|
if (y5.has(e)) continue;
|
|
1673
1673
|
let s = f4(e), u2 = z2(s);
|
|
1674
|
-
if (!(u2 < 95) && j2(s, e) && !(
|
|
1674
|
+
if (!(u2 < 95) && j2(s, e) && !(bt(s, (m2) => Z(m2).length > 0) < G2)) {
|
|
1675
1675
|
o.zip = e, y5.add(e), l.push(`zip=${e} (${u2}% ZIP codes)`);
|
|
1676
1676
|
break;
|
|
1677
1677
|
}
|
|
@@ -1679,7 +1679,7 @@ function bt(i, n, t, r, c2) {
|
|
|
1679
1679
|
let x3 = o.country;
|
|
1680
1680
|
if (!x3 || !P2(f4(x3))) {
|
|
1681
1681
|
let e = null;
|
|
1682
|
-
for (let s of
|
|
1682
|
+
for (let s of T3) {
|
|
1683
1683
|
if (y5.has(s) || !P2(f4(s))) continue;
|
|
1684
1684
|
let u2 = O2(f4(s));
|
|
1685
1685
|
(!e || u2 > e.pct) && (e = { name: s, pct: u2 });
|
|
@@ -1688,7 +1688,7 @@ function bt(i, n, t, r, c2) {
|
|
|
1688
1688
|
}
|
|
1689
1689
|
if (!o.city) {
|
|
1690
1690
|
let e = null;
|
|
1691
|
-
for (let s of
|
|
1691
|
+
for (let s of T3) {
|
|
1692
1692
|
if (y5.has(s)) continue;
|
|
1693
1693
|
let u2 = f4(s), m2 = At2(u2, r);
|
|
1694
1694
|
m2 < m3 || N2(u2, (F3) => p3(F3, r)) < G2 || (!e || m2 > e.pct) && (e = { name: s, pct: m2 });
|
|
@@ -1714,7 +1714,7 @@ function resolvePointChannel(cols, rowObjs, point) {
|
|
|
1714
1714
|
let labelCol;
|
|
1715
1715
|
if (bind) {
|
|
1716
1716
|
const dims = cols.filter((c2) => !c2.isMeasure).map((c2) => c2.name);
|
|
1717
|
-
const res =
|
|
1717
|
+
const res = Mt2(dims, rowObjs, bind, point?.mapKind, cols.map((c2) => c2.name));
|
|
1718
1718
|
bind = res.bind;
|
|
1719
1719
|
rolesBackfilled = res.backfilled;
|
|
1720
1720
|
rolesRefused = res.refused;
|
package/dist/index.mjs
CHANGED
package/dist/react.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/chart-host",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
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",
|