@bicharts/chart-host 0.6.26 → 0.6.28
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.
|
@@ -509,10 +509,10 @@ function f(t) {
|
|
|
509
509
|
}
|
|
510
510
|
function rgbToLab(r, g3, b4) {
|
|
511
511
|
const R2 = linearise(r), G3 = linearise(g3), B4 = linearise(b4);
|
|
512
|
-
const
|
|
512
|
+
const X3 = 0.4124564 * R2 + 0.3575761 * G3 + 0.1804375 * B4;
|
|
513
513
|
const Y4 = 0.2126729 * R2 + 0.7151522 * G3 + 0.072175 * B4;
|
|
514
514
|
const Z4 = 0.0193339 * R2 + 0.119192 * G3 + 0.9503041 * B4;
|
|
515
|
-
const fx = f(
|
|
515
|
+
const fx = f(X3 / Xn), fy = f(Y4 / Yn), fz = f(Z4 / Zn);
|
|
516
516
|
return { L: 116 * fy - 16, a: 500 * (fx - fy), b: 200 * (fy - fz) };
|
|
517
517
|
}
|
|
518
518
|
function hexToLab(hex2) {
|
|
@@ -567,13 +567,13 @@ function labToHex(lab) {
|
|
|
567
567
|
return t32 > EPS ? t32 : (116 * t - 16) / KAPPA;
|
|
568
568
|
};
|
|
569
569
|
const fy = (lab.L + 16) / 116, fx = fy + lab.a / 500, fz = fy - lab.b / 200;
|
|
570
|
-
const
|
|
570
|
+
const X3 = Xn * finv(fx);
|
|
571
571
|
const Y4 = Yn * (lab.L > KAPPA * EPS ? fy * fy * fy : lab.L / KAPPA);
|
|
572
572
|
const Z4 = Zn * finv(fz);
|
|
573
573
|
const lin = [
|
|
574
|
-
3.2404542 *
|
|
575
|
-
-0.969266 *
|
|
576
|
-
0.0556434 *
|
|
574
|
+
3.2404542 * X3 - 1.5371385 * Y4 - 0.4985314 * Z4,
|
|
575
|
+
-0.969266 * X3 + 1.8760108 * Y4 + 0.041556 * Z4,
|
|
576
|
+
0.0556434 * X3 - 0.2040259 * Y4 + 1.0572252 * Z4
|
|
577
577
|
];
|
|
578
578
|
return "#" + lin.map((v4) => {
|
|
579
579
|
const c2 = Math.max(0, Math.min(1, v4));
|
|
@@ -1582,9 +1582,9 @@ var wt = new RegExp([String.raw`\bisMeasure\b`, String.raw`\bdataType\b`, String
|
|
|
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
|
-
var
|
|
1586
|
-
var
|
|
1587
|
-
function
|
|
1585
|
+
var K3 = 2;
|
|
1586
|
+
var J4 = 400;
|
|
1587
|
+
function B3(e) {
|
|
1588
1588
|
return !!E(e);
|
|
1589
1589
|
}
|
|
1590
1590
|
function F3(e) {
|
|
@@ -1592,26 +1592,26 @@ function F3(e) {
|
|
|
1592
1592
|
for (let t of e) {
|
|
1593
1593
|
if (t == null) continue;
|
|
1594
1594
|
let o = u(String(t));
|
|
1595
|
-
if (!V(o) && !n.has(o) && (n.add(o), n.size >=
|
|
1595
|
+
if (!V(o) && !n.has(o) && (n.add(o), n.size >= J4)) break;
|
|
1596
1596
|
}
|
|
1597
1597
|
return Array.from(n);
|
|
1598
1598
|
}
|
|
1599
1599
|
function v3(e) {
|
|
1600
1600
|
let n = F3(e);
|
|
1601
|
-
if (n.length === 0 ||
|
|
1602
|
-
let t = n.filter((u2) =>
|
|
1601
|
+
if (n.length === 0 || W2(e) < 95) return false;
|
|
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;
|
|
1604
1604
|
}
|
|
1605
|
-
function
|
|
1605
|
+
function Y3(e, n) {
|
|
1606
1606
|
if (!Y(e)) return false;
|
|
1607
1607
|
let t = E(e);
|
|
1608
1608
|
return t ? n === "world" ? true : s3.has(t) : false;
|
|
1609
1609
|
}
|
|
1610
|
-
function
|
|
1610
|
+
function W2(e) {
|
|
1611
1611
|
let n = F3(e);
|
|
1612
1612
|
if (n.length === 0) return 0;
|
|
1613
1613
|
let t = 0;
|
|
1614
|
-
for (let o of n)
|
|
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) {
|
|
@@ -1621,109 +1621,110 @@ function k3(e) {
|
|
|
1621
1621
|
for (let o of n) Y(o) && t++;
|
|
1622
1622
|
return Math.round(t / n.length * 1e3) / 10;
|
|
1623
1623
|
}
|
|
1624
|
-
function
|
|
1624
|
+
function H3(e) {
|
|
1625
1625
|
let n = /* @__PURE__ */ new Set();
|
|
1626
1626
|
for (let t of e) {
|
|
1627
1627
|
if (t == null) continue;
|
|
1628
1628
|
let o = String(t).trim();
|
|
1629
|
-
if (!V(u(o)) && !n.has(o) && (n.add(o), n.size >=
|
|
1629
|
+
if (!V(u(o)) && !n.has(o) && (n.add(o), n.size >= J4)) break;
|
|
1630
1630
|
}
|
|
1631
1631
|
return Array.from(n);
|
|
1632
1632
|
}
|
|
1633
|
-
function
|
|
1634
|
-
let n =
|
|
1633
|
+
function $2(e) {
|
|
1634
|
+
let n = H3(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 :
|
|
1641
|
+
return y4(n, rt) ? true : H3(e).some((t) => /^\d{5}(-\d{4})?$/.test(t.replace(/\.0+$/, "")));
|
|
1642
1642
|
}
|
|
1643
|
-
function
|
|
1643
|
+
function ot(e, n) {
|
|
1644
1644
|
let t = F3(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++;
|
|
1648
1648
|
return Math.round(o / t.length * 1e3) / 10;
|
|
1649
1649
|
}
|
|
1650
|
-
function
|
|
1650
|
+
function z3(e, n) {
|
|
1651
1651
|
let t = 0;
|
|
1652
1652
|
for (let o of F3(e)) n(o) && t++;
|
|
1653
1653
|
return t;
|
|
1654
1654
|
}
|
|
1655
|
-
function
|
|
1655
|
+
function it2(e, n) {
|
|
1656
1656
|
let t = 0;
|
|
1657
|
-
for (let o of
|
|
1657
|
+
for (let o of H3(e)) n(o) && t++;
|
|
1658
1658
|
return t;
|
|
1659
1659
|
}
|
|
1660
|
-
function
|
|
1661
|
-
let a4 = [], s = [], i = {},
|
|
1660
|
+
function st(e, n, t, o, u2) {
|
|
1661
|
+
let a4 = [], s = [], i = {}, h3 = {}, R2 = new Set(e), f4 = (r) => n.map((l) => l[r]);
|
|
1662
1662
|
for (let r of ["city", "country"]) {
|
|
1663
1663
|
let l = t?.[r];
|
|
1664
|
-
l &&
|
|
1664
|
+
l && R2.has(l) && (i[r] = l);
|
|
1665
1665
|
}
|
|
1666
|
-
let
|
|
1666
|
+
let ue = new Set(u2 ?? e);
|
|
1667
1667
|
for (let r of ["lat", "lon"]) {
|
|
1668
1668
|
let l = t?.[r];
|
|
1669
|
-
l &&
|
|
1669
|
+
l && ue.has(l) && (i[r] = l);
|
|
1670
1670
|
}
|
|
1671
|
-
let
|
|
1672
|
-
if (
|
|
1673
|
-
let r =
|
|
1674
|
-
l < 95 ? s.push(`zip=${
|
|
1671
|
+
let C2 = t?.zip;
|
|
1672
|
+
if (C2 && R2.has(C2)) {
|
|
1673
|
+
let r = f4(C2), l = $2(r);
|
|
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
|
-
if (g3 &&
|
|
1678
|
-
let r =
|
|
1679
|
-
l.length > 0 && l.every((d2) =>
|
|
1677
|
+
if (g3 && R2.has(g3)) {
|
|
1678
|
+
let r = f4(g3), l = F3(r);
|
|
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)),
|
|
1681
|
+
let b4 = new Set(Object.values(i).filter(Boolean)), T3 = e.filter((r) => !b4.has(r) && !r.startsWith("__"));
|
|
1682
1682
|
if (!i.state) {
|
|
1683
1683
|
let r = null;
|
|
1684
|
-
for (let l of
|
|
1685
|
-
let d2 =
|
|
1684
|
+
for (let l of T3) {
|
|
1685
|
+
let d2 = f4(l);
|
|
1686
1686
|
if (v3(d2)) continue;
|
|
1687
1687
|
let p2 = k3(d2);
|
|
1688
1688
|
if (p2 < 95) continue;
|
|
1689
|
-
let _2 =
|
|
1690
|
-
_2 <
|
|
1689
|
+
let _2 = z3(d2, (w3) => !!Y(w3)), de2 = z3(d2, (w3) => !!Y(w3) && !Y3(w3, o));
|
|
1690
|
+
_2 < K3 && de2 < 1 || (!r || p2 > r.pct) && (r = { name: l, pct: p2 });
|
|
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
|
|
1694
|
+
if (!i.zip) for (let r of T3) {
|
|
1695
1695
|
if (b4.has(r)) continue;
|
|
1696
|
-
let l =
|
|
1697
|
-
if (!(d2 < 95) && Z3(l, r) && !(
|
|
1696
|
+
let l = f4(r), d2 = $2(l);
|
|
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;
|
|
1700
1700
|
}
|
|
1701
1701
|
}
|
|
1702
|
-
let
|
|
1703
|
-
if (!
|
|
1702
|
+
let P4 = i.country;
|
|
1703
|
+
if (!P4 || !v3(f4(P4))) {
|
|
1704
1704
|
let r = null;
|
|
1705
|
-
for (let l of
|
|
1706
|
-
if (b4.has(l) || !v3(
|
|
1707
|
-
let d2 =
|
|
1705
|
+
for (let l of T3) {
|
|
1706
|
+
if (b4.has(l) || !v3(f4(l))) continue;
|
|
1707
|
+
let d2 = W2(f4(l));
|
|
1708
1708
|
(!r || d2 > r.pct) && (r = { name: l, pct: d2 });
|
|
1709
1709
|
}
|
|
1710
|
-
r && (
|
|
1710
|
+
r && (P4 && (s.push(`country=${P4} (only ${W2(f4(P4))}% of values are country identifiers; using ${r.name} instead)`), h3.country = P4), i.country = r.name, b4.add(r.name), a4.push(`country=${r.name}`));
|
|
1711
1711
|
}
|
|
1712
1712
|
if (!i.city) {
|
|
1713
1713
|
let r = null;
|
|
1714
|
-
for (let l of
|
|
1714
|
+
for (let l of T3) {
|
|
1715
1715
|
if (b4.has(l)) continue;
|
|
1716
|
-
let d2 =
|
|
1717
|
-
p2 < m3 ||
|
|
1716
|
+
let d2 = f4(l), p2 = ot(d2, o);
|
|
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
|
|
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) => {
|
|
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
|
});
|
|
1725
|
-
return i.lat && i.lon && !O3 && s.push(`lat/lon=${i.lat}/${i.lon} (no row holds a usable coordinate pair)`), i.country && !
|
|
1725
|
+
return i.lat && i.lon && !O3 && s.push(`lat/lon=${i.lat}/${i.lon} (no row holds a usable coordinate pair)`), i.country && !j3 && !(i.city || i.state || i.zip || O3) && s.push(E4 ? `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 || j3 || O3) ? i : null, backfilled: a4, refused: s, ...Object.keys(h3).length ? { labelFallback: h3 } : {} };
|
|
1726
1726
|
}
|
|
1727
|
+
var St3 = Object.freeze({ integer: "number", decimal: "number", double: "number", datetime: "date", date: "date", boolean: "boolean", string: "text" });
|
|
1727
1728
|
|
|
1728
1729
|
// src/payload.ts
|
|
1729
1730
|
function resolvePointChannel(cols, rowObjs, point) {
|
|
@@ -1737,7 +1738,7 @@ function resolvePointChannel(cols, rowObjs, point) {
|
|
|
1737
1738
|
let labelCol;
|
|
1738
1739
|
if (bind) {
|
|
1739
1740
|
const dims = cols.filter((c2) => !c2.isMeasure).map((c2) => c2.name);
|
|
1740
|
-
const res =
|
|
1741
|
+
const res = st(dims, rowObjs, bind, point?.mapKind, cols.map((c2) => c2.name));
|
|
1741
1742
|
bind = res.bind;
|
|
1742
1743
|
rolesBackfilled = res.backfilled;
|
|
1743
1744
|
rolesRefused = res.refused;
|
|
@@ -2694,14 +2695,14 @@ var SVG_NS2 = "http://www.w3.org/2000/svg";
|
|
|
2694
2695
|
var AXIS_PIN_MAX_CARRIED = 12;
|
|
2695
2696
|
function unpinScrolledAxis(container) {
|
|
2696
2697
|
if (!container) return;
|
|
2697
|
-
const
|
|
2698
|
-
if (!
|
|
2698
|
+
const st2 = container[CONTAINER_SLOT_AXIS_PIN];
|
|
2699
|
+
if (!st2) return;
|
|
2699
2700
|
try {
|
|
2700
|
-
container.removeEventListener("scroll",
|
|
2701
|
+
container.removeEventListener("scroll", st2.onScroll);
|
|
2701
2702
|
} catch {
|
|
2702
2703
|
}
|
|
2703
2704
|
try {
|
|
2704
|
-
if (
|
|
2705
|
+
if (st2.overlay.parentNode) st2.overlay.parentNode.removeChild(st2.overlay);
|
|
2705
2706
|
} catch {
|
|
2706
2707
|
}
|
|
2707
2708
|
try {
|
|
@@ -2879,15 +2880,15 @@ function pinScrolledAxis(container, svg) {
|
|
|
2879
2880
|
const svgTop = svgBox.top - cRect.top - container.clientTop + container.scrollTop;
|
|
2880
2881
|
const contentBand = { top: svgTop + band.top, bottom: svgTop + band.bottom };
|
|
2881
2882
|
const place = () => {
|
|
2882
|
-
const
|
|
2883
|
-
const edge2 = axisPinPlacement(contentBand,
|
|
2883
|
+
const st2 = container.scrollTop, vh = container.clientHeight;
|
|
2884
|
+
const edge2 = axisPinPlacement(contentBand, st2, vh);
|
|
2884
2885
|
if (!edge2) {
|
|
2885
2886
|
o.display = "none";
|
|
2886
2887
|
return null;
|
|
2887
2888
|
}
|
|
2888
2889
|
o.display = "block";
|
|
2889
2890
|
o.left = `${svgLeft}px`;
|
|
2890
|
-
o.top = `${edge2 === "top" ?
|
|
2891
|
+
o.top = `${edge2 === "top" ? st2 : st2 + vh - bandPx}px`;
|
|
2891
2892
|
return edge2;
|
|
2892
2893
|
};
|
|
2893
2894
|
const onScroll = () => {
|
|
@@ -3486,9 +3487,9 @@ function createChartHost(container, config) {
|
|
|
3486
3487
|
const ensureAffordanceStyles = () => {
|
|
3487
3488
|
try {
|
|
3488
3489
|
if (!doc || doc.getElementById("bic-chart-host-affordances")) return;
|
|
3489
|
-
const
|
|
3490
|
-
|
|
3491
|
-
|
|
3490
|
+
const st2 = doc.createElement("style");
|
|
3491
|
+
st2.id = "bic-chart-host-affordances";
|
|
3492
|
+
st2.textContent = `
|
|
3492
3493
|
/* TYPOGRAPHY FIREWALL. Generated charts set font-size but almost never line-height or
|
|
3493
3494
|
letter-spacing, so they INHERIT whatever the host page cascades in. A page with
|
|
3494
3495
|
\`:root { font: 18px/145% }\` (the stock Vite template does exactly this) hands every
|
|
@@ -3537,7 +3538,7 @@ function createChartHost(container, config) {
|
|
|
3537
3538
|
font-weight: 700 !important;
|
|
3538
3539
|
text-decoration: underline !important;
|
|
3539
3540
|
}`;
|
|
3540
|
-
(doc.head || doc.documentElement)?.appendChild(
|
|
3541
|
+
(doc.head || doc.documentElement)?.appendChild(st2);
|
|
3541
3542
|
} catch {
|
|
3542
3543
|
}
|
|
3543
3544
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -140,7 +140,7 @@ import {
|
|
|
140
140
|
unpinScrolledAxis,
|
|
141
141
|
valuePlacementFlag,
|
|
142
142
|
withoutViewOnlyKeys
|
|
143
|
-
} from "./chunk-
|
|
143
|
+
} from "./chunk-VKFEN6MS.mjs";
|
|
144
144
|
import "./chunk-A2GMXZP7.mjs";
|
|
145
145
|
import "./chunk-GHODWOAL.mjs";
|
|
146
146
|
|
|
@@ -2433,6 +2433,28 @@ function shouldCaptureThumbnail(g2) {
|
|
|
2433
2433
|
return { capture, consent: g2.consented };
|
|
2434
2434
|
}
|
|
2435
2435
|
|
|
2436
|
+
// src/modelPicker.ts
|
|
2437
|
+
var DEFAULT_MODEL_SUFFIX = " \u2014 default";
|
|
2438
|
+
function isPickableModelCode(code) {
|
|
2439
|
+
const c2 = String(code ?? "");
|
|
2440
|
+
return c2 !== "" && !c2.startsWith("BYO");
|
|
2441
|
+
}
|
|
2442
|
+
function markDefaultModel(label, code, defaultCode) {
|
|
2443
|
+
return defaultCode && code === defaultCode ? label + DEFAULT_MODEL_SUFFIX : label;
|
|
2444
|
+
}
|
|
2445
|
+
function defaultModelFirst(rows, defaultCode) {
|
|
2446
|
+
if (!defaultCode) return rows.slice();
|
|
2447
|
+
const first = rows.filter((r2) => r2.value === defaultCode);
|
|
2448
|
+
return first.concat(rows.filter((r2) => r2.value !== defaultCode));
|
|
2449
|
+
}
|
|
2450
|
+
function reconcileModelPick(saved, offered, fallback) {
|
|
2451
|
+
const s2 = String(saved ?? "");
|
|
2452
|
+
if (offered.includes(s2)) return s2;
|
|
2453
|
+
const f2 = String(fallback ?? "");
|
|
2454
|
+
if (offered.includes(f2)) return f2;
|
|
2455
|
+
return offered.length ? offered[0] : "";
|
|
2456
|
+
}
|
|
2457
|
+
|
|
2436
2458
|
// src/clientIdentity.ts
|
|
2437
2459
|
function stableFingerprintOptions() {
|
|
2438
2460
|
return { exclude: ["fonts", "system.useragent", "system.browser.version"], logging: false };
|
|
@@ -2498,6 +2520,7 @@ export {
|
|
|
2498
2520
|
CONTROL_CLASS,
|
|
2499
2521
|
D3_PLUGIN_PACKAGES,
|
|
2500
2522
|
DARK_TEXT,
|
|
2523
|
+
DEFAULT_MODEL_SUFFIX,
|
|
2501
2524
|
DIM_OPACITY_DEFAULT,
|
|
2502
2525
|
DIM_OPACITY_VAR,
|
|
2503
2526
|
DUPLICATE_GENERATE_WINDOW_MS,
|
|
@@ -2597,6 +2620,7 @@ export {
|
|
|
2597
2620
|
ctmScaleOf,
|
|
2598
2621
|
decideLabelColor,
|
|
2599
2622
|
decidePendingRecovery,
|
|
2623
|
+
defaultModelFirst,
|
|
2600
2624
|
deltaEHex,
|
|
2601
2625
|
encodePendingGenerate,
|
|
2602
2626
|
ensureCrossfilterHitTargets,
|
|
@@ -2626,6 +2650,7 @@ export {
|
|
|
2626
2650
|
isInvalidSentinelError,
|
|
2627
2651
|
isNarrowedByFilter,
|
|
2628
2652
|
isPhantomBox,
|
|
2653
|
+
isPickableModelCode,
|
|
2629
2654
|
isPillBackdropAlpha,
|
|
2630
2655
|
labelBand,
|
|
2631
2656
|
latePickupAction,
|
|
@@ -2634,6 +2659,7 @@ export {
|
|
|
2634
2659
|
launchGenerates,
|
|
2635
2660
|
listNeedsFilter,
|
|
2636
2661
|
loadGeo,
|
|
2662
|
+
markDefaultModel,
|
|
2637
2663
|
markerArmedBlind,
|
|
2638
2664
|
measureContainerBoxes,
|
|
2639
2665
|
mountProductFeedbackBox,
|
|
@@ -2671,6 +2697,7 @@ export {
|
|
|
2671
2697
|
readQualifyChartRow,
|
|
2672
2698
|
readQualifyRefusalRow,
|
|
2673
2699
|
reconcileChartPick,
|
|
2700
|
+
reconcileModelPick,
|
|
2674
2701
|
recoveryAnswerIsCancelled,
|
|
2675
2702
|
recoveryOwnsTheSentence,
|
|
2676
2703
|
recoveryPollRunning,
|
package/dist/react.mjs
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -42,5 +42,6 @@ export { isDuplicateGenerate, armGenerateGuard, DUPLICATE_GENERATE_WINDOW_MS, ty
|
|
|
42
42
|
export { canShowLastChart, shouldRestoreVersionAfterLicenseSave } from "./lastChart";
|
|
43
43
|
export { isNarrowedByFilter, isEmptiedByFilter, updateRowHighWater, type NarrowingState, } from "./filterNarrowing";
|
|
44
44
|
export { shouldCaptureThumbnail, type ThumbnailGate, type ThumbnailDecision } from "./thumbnailPolicy";
|
|
45
|
+
export { isPickableModelCode, markDefaultModel, defaultModelFirst, reconcileModelPick, DEFAULT_MODEL_SUFFIX, } from "./modelPicker";
|
|
45
46
|
export { stableFingerprintOptions, fingerprintComponentDigest, type ClientIdSource } from "./clientIdentity";
|
|
46
47
|
export type { HostServices, MarkerStore, PreferenceSource, HostTheme, ThemeSource, ThumbnailConsent, SnapshotTarget, WireSigner, WireTransport, WireResponse, CredentialTriple, CredentialSource, ViewportSource, Clock, DiagnosticEntry, DiagnosticsSink, RendererId, } from "./host/services";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** The suffix that marks the default model's row, after its cost. */
|
|
2
|
+
export declare const DEFAULT_MODEL_SUFFIX = " \u2014 default";
|
|
3
|
+
/** Whether a catalogue code may appear in the open list: not empty, and not a bring-your-own-key code. */
|
|
4
|
+
export declare function isPickableModelCode(code: string | null | undefined): boolean;
|
|
5
|
+
/** The label with the default marker appended when `code` is the (non-empty) default. */
|
|
6
|
+
export declare function markDefaultModel(label: string, code: string, defaultCode: string | null | undefined): string;
|
|
7
|
+
/** A copy of `rows` with the default model's row first and every other row in its original order. */
|
|
8
|
+
export declare function defaultModelFirst<T extends {
|
|
9
|
+
value: string;
|
|
10
|
+
}>(rows: readonly T[], defaultCode: string | null | undefined): T[];
|
|
11
|
+
/**
|
|
12
|
+
* The pick to show: `saved` when the list still offers it; otherwise `fallback` (the host's default -
|
|
13
|
+
* the default model's code, or the host's own "service default" row) when the list offers that;
|
|
14
|
+
* otherwise the list's first row; "" only for an empty list.
|
|
15
|
+
*/
|
|
16
|
+
export declare function reconcileModelPick(saved: string | null | undefined, offered: readonly string[], fallback: string | null | undefined): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/chart-host",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.28",
|
|
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",
|