@bicharts/chart-host 0.6.39 → 0.6.41
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.
- package/dist/{chunk-XC527HDN.mjs → chunk-NMEXSUOR.mjs} +131 -130
- package/dist/index.mjs +8 -8
- package/dist/react.mjs +1 -1
- package/package.json +1 -1
|
@@ -1481,88 +1481,88 @@ function Wt(n, s) {
|
|
|
1481
1481
|
return { iso: i, unmatched: M2, matchedRows: h3, totalRows: n.length };
|
|
1482
1482
|
}
|
|
1483
1483
|
|
|
1484
|
-
// ../shape-core/dist/chunk-
|
|
1484
|
+
// ../shape-core/dist/chunk-QKBGASBP.mjs
|
|
1485
1485
|
var import_papaparse = __toESM(require_papaparse_min(), 1);
|
|
1486
1486
|
/*! @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. */
|
|
1487
|
-
var
|
|
1487
|
+
var Le = { "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" };
|
|
1488
1488
|
var J3 = (() => {
|
|
1489
1489
|
let t = /* @__PURE__ */ new Map();
|
|
1490
|
-
for (let e of Object.keys(
|
|
1490
|
+
for (let e of Object.keys(Le)) for (let n of Le[e].split(/\s+/)) n && t.set(n, e);
|
|
1491
1491
|
return t;
|
|
1492
1492
|
})();
|
|
1493
|
-
function
|
|
1493
|
+
function ct2(t) {
|
|
1494
1494
|
for (let [e, n] of t) {
|
|
1495
|
-
let
|
|
1496
|
-
|
|
1495
|
+
let i = J3.get(e);
|
|
1496
|
+
i && !J3.has(n) && J3.set(n, i);
|
|
1497
1497
|
}
|
|
1498
1498
|
}
|
|
1499
|
-
|
|
1500
|
-
var
|
|
1501
|
-
var
|
|
1502
|
-
var yt2 = ["latitude", "longitude"];
|
|
1499
|
+
ct2(N);
|
|
1500
|
+
var bt = ["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"];
|
|
1501
|
+
var yt2 = ["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"];
|
|
1503
1502
|
var St2 = ["latitude", "longitude"];
|
|
1503
|
+
var _t = ["latitude", "longitude"];
|
|
1504
1504
|
function j3(t) {
|
|
1505
1505
|
return p(t);
|
|
1506
1506
|
}
|
|
1507
|
-
var
|
|
1508
|
-
function
|
|
1507
|
+
var ge2 = ["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"];
|
|
1508
|
+
function At(t) {
|
|
1509
1509
|
return [...t].sort((e, n) => n.length - e.length).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+")).join("|");
|
|
1510
1510
|
}
|
|
1511
|
-
var
|
|
1512
|
-
var
|
|
1513
|
-
var
|
|
1514
|
-
var
|
|
1515
|
-
function
|
|
1511
|
+
var We = new RegExp("^\\s*(?:(?:sum|count|count\\s+distinct|distinct\\s+count)\\s+of\\s+|(?:" + At(ge2) + ")\\s+)", "i");
|
|
1512
|
+
var Ct = /(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Za-z])(?=[0-9])|(?<=[0-9])(?=[A-Za-z])/g;
|
|
1513
|
+
var Mt2 = new RegExp("\\b(" + bt.join("|") + ")\\b|(" + yt2.join("|") + ")$", "i");
|
|
1514
|
+
var xt = new RegExp("\\b(" + St2.join("|") + ")\\b|(" + _t.join("|") + ")$", "i");
|
|
1515
|
+
function Be(t) {
|
|
1516
1516
|
if (!t) return "";
|
|
1517
|
-
let e = String(t), n =
|
|
1517
|
+
let e = String(t), n = We.exec(j3(e));
|
|
1518
1518
|
return (n ? e.slice(n[0].length) : e).trim();
|
|
1519
1519
|
}
|
|
1520
|
-
function
|
|
1521
|
-
return !!t &&
|
|
1520
|
+
function Rt(t) {
|
|
1521
|
+
return !!t && We.test(j3(String(t)));
|
|
1522
1522
|
}
|
|
1523
|
-
var
|
|
1524
|
-
var
|
|
1525
|
-
var
|
|
1526
|
-
var
|
|
1527
|
-
function
|
|
1528
|
-
let e =
|
|
1529
|
-
return e.length === 0 ? "" : e.replace(
|
|
1523
|
+
var Tt = ["count (distinct)", "count distinct", "distinct count", "standard deviation", "average", "variance", "median", "product", "stddev", "std dev", "count", "sum", "avg", "min", "minimum", "max", "maximum", "var"];
|
|
1524
|
+
var Fe = new RegExp("^\\s*(" + [...Tt].sort((t, e) => e.length - t.length).map((t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+")).join("|") + ")\\s+of\\s+", "i");
|
|
1525
|
+
var $e = { 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 "] };
|
|
1526
|
+
var Nt = new RegExp("^(" + Object.keys($e).join("|") + ")\\((.+)\\)$");
|
|
1527
|
+
function Et(t) {
|
|
1528
|
+
let e = Be(t);
|
|
1529
|
+
return e.length === 0 ? "" : e.replace(Ct, " ");
|
|
1530
1530
|
}
|
|
1531
|
-
function
|
|
1531
|
+
function Ve(t, e) {
|
|
1532
1532
|
if (!e) return false;
|
|
1533
|
-
let n =
|
|
1534
|
-
return t.test(j3(
|
|
1535
|
-
}
|
|
1536
|
-
function Ve(t) {
|
|
1537
|
-
return Ue(Mt2, t);
|
|
1533
|
+
let n = Be(e);
|
|
1534
|
+
return t.test(j3(Et(e))) || t.test(j3(n)) || t.test(j3(d(n).join(" ")));
|
|
1538
1535
|
}
|
|
1539
|
-
function
|
|
1540
|
-
return
|
|
1536
|
+
function Ke(t) {
|
|
1537
|
+
return Ve(xt, t);
|
|
1541
1538
|
}
|
|
1542
|
-
var Ke = /int|double|decimal|single|float|number|currency|money/i;
|
|
1543
1539
|
function vt(t) {
|
|
1544
|
-
|
|
1545
|
-
return e === "categorical" ? "Categorical" : e === "ordinal" ? "Ordinal" : e === "continuous" || t?.isMeasure === true || Ke.test(String(t?.dataType ?? "")) ? "Continuous" : "Categorical";
|
|
1540
|
+
return Ve(Mt2, t) || Ke(t);
|
|
1546
1541
|
}
|
|
1542
|
+
var Ye = /int|double|decimal|single|float|number|currency|money/i;
|
|
1547
1543
|
function It2(t) {
|
|
1548
|
-
|
|
1544
|
+
let e = String(t?.valueNature ?? "").trim().toLowerCase();
|
|
1545
|
+
return e === "categorical" ? "Categorical" : e === "ordinal" ? "Ordinal" : e === "continuous" || t?.isMeasure === true || Ye.test(String(t?.dataType ?? "")) ? "Continuous" : "Categorical";
|
|
1546
|
+
}
|
|
1547
|
+
function wt(t) {
|
|
1548
|
+
return t?.isMeasure === true || Ye.test(String(t?.dataType ?? ""));
|
|
1549
1549
|
}
|
|
1550
|
-
function
|
|
1551
|
-
let e = t ?? {}, n =
|
|
1550
|
+
function He(t) {
|
|
1551
|
+
let e = t ?? {}, n = It2(e);
|
|
1552
1552
|
if (n !== "Continuous") return { nature: n, additivity: "unknown", basis: "role", suppressed: false };
|
|
1553
|
-
if (
|
|
1554
|
-
let
|
|
1555
|
-
if (!(
|
|
1556
|
-
if (
|
|
1557
|
-
if (
|
|
1558
|
-
if (
|
|
1553
|
+
if (Ke(e.name)) return { nature: n, additivity: "positional", basis: "name", suppressed: true };
|
|
1554
|
+
let i = String(e.additivity ?? "").trim().toLowerCase();
|
|
1555
|
+
if (!(i === "additive" && Rt(e.name))) {
|
|
1556
|
+
if (i === "additive") return { nature: n, additivity: "additive", basis: "measured", suppressed: false };
|
|
1557
|
+
if (i === "part_of_whole") return { nature: n, additivity: "part_of_whole", basis: "measured", suppressed: false };
|
|
1558
|
+
if (i === "intensive_rate") return { nature: n, additivity: "intensive_rate", basis: "measured", suppressed: false };
|
|
1559
1559
|
}
|
|
1560
|
-
return e.discourageAggregationAcrossGroups === true ? { nature: n, additivity: "intensive_rate", basis: "host-flag", suppressed: false } :
|
|
1560
|
+
return e.discourageAggregationAcrossGroups === true ? { nature: n, additivity: "intensive_rate", basis: "host-flag", suppressed: false } : vt(e.name) ? { nature: n, additivity: "intensive_rate", basis: "name", suppressed: false } : { nature: n, additivity: "additive", basis: "default", suppressed: false };
|
|
1561
1561
|
}
|
|
1562
|
-
function
|
|
1563
|
-
let e =
|
|
1562
|
+
function Xe(t) {
|
|
1563
|
+
let e = He(t), n = t ?? {};
|
|
1564
1564
|
if (e.nature === "Categorical") return ["first", "distinctcount", "count"];
|
|
1565
|
-
if (e.nature === "Ordinal") return
|
|
1565
|
+
if (e.nature === "Ordinal") return wt(n) ? ["median", "average", "min", "max", "first", "distinctcount", "count"] : ["first", "distinctcount", "count"];
|
|
1566
1566
|
switch (e.additivity) {
|
|
1567
1567
|
case "positional":
|
|
1568
1568
|
return ["min", "max", "count", "distinctcount", "first"];
|
|
@@ -1572,21 +1572,21 @@ function He(t) {
|
|
|
1572
1572
|
return ["sum", "average", "median", "min", "max", "count", "distinctcount", "first"];
|
|
1573
1573
|
}
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1576
|
-
return
|
|
1575
|
+
function Gn(t) {
|
|
1576
|
+
return Xe(t)[0];
|
|
1577
1577
|
}
|
|
1578
|
-
function
|
|
1578
|
+
function Bn(t, e) {
|
|
1579
1579
|
if (e !== "sum" && e !== "count") return false;
|
|
1580
1580
|
if (e === "count") return true;
|
|
1581
|
-
let n =
|
|
1581
|
+
let n = He(t);
|
|
1582
1582
|
return n.additivity === "additive" || n.additivity === "part_of_whole" || n.additivity === "unknown";
|
|
1583
1583
|
}
|
|
1584
|
-
var
|
|
1584
|
+
var Ot = 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("|"));
|
|
1585
1585
|
|
|
1586
1586
|
// ../shape-core/dist/index.mjs
|
|
1587
1587
|
/*! @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. */
|
|
1588
1588
|
var X3 = 2;
|
|
1589
|
-
var
|
|
1589
|
+
var de = 400;
|
|
1590
1590
|
function Z3(t) {
|
|
1591
1591
|
return !!E(t);
|
|
1592
1592
|
}
|
|
@@ -1595,7 +1595,7 @@ function F3(t) {
|
|
|
1595
1595
|
for (let n of t) {
|
|
1596
1596
|
if (n == null) continue;
|
|
1597
1597
|
let o2 = u(String(n));
|
|
1598
|
-
if (!V(o2) && !e.has(o2) && (e.add(o2), e.size >=
|
|
1598
|
+
if (!V(o2) && !e.has(o2) && (e.add(o2), e.size >= de)) break;
|
|
1599
1599
|
}
|
|
1600
1600
|
return Array.from(e);
|
|
1601
1601
|
}
|
|
@@ -1629,7 +1629,7 @@ function ne2(t) {
|
|
|
1629
1629
|
for (let n of t) {
|
|
1630
1630
|
if (n == null) continue;
|
|
1631
1631
|
let o2 = String(n).trim();
|
|
1632
|
-
if (!V(u(o2)) && !e.has(o2) && (e.add(o2), e.size >=
|
|
1632
|
+
if (!V(u(o2)) && !e.has(o2) && (e.add(o2), e.size >= de)) break;
|
|
1633
1633
|
}
|
|
1634
1634
|
return Array.from(e);
|
|
1635
1635
|
}
|
|
@@ -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
|
|
1646
|
+
function In(t, e) {
|
|
1647
1647
|
let n = F3(t);
|
|
1648
1648
|
if (n.length === 0) return 0;
|
|
1649
1649
|
let o2 = 0;
|
|
@@ -1655,84 +1655,85 @@ function J4(t, e) {
|
|
|
1655
1655
|
for (let o2 of F3(t)) e(o2) && n++;
|
|
1656
1656
|
return n;
|
|
1657
1657
|
}
|
|
1658
|
-
function
|
|
1658
|
+
function Fn(t, e) {
|
|
1659
1659
|
let n = 0;
|
|
1660
1660
|
for (let o2 of ne2(t)) e(o2) && n++;
|
|
1661
1661
|
return n;
|
|
1662
1662
|
}
|
|
1663
|
-
function
|
|
1664
|
-
let l = [], a2 = [],
|
|
1665
|
-
for (let
|
|
1666
|
-
let
|
|
1667
|
-
|
|
1663
|
+
function kn(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
|
|
1671
|
-
let
|
|
1672
|
-
|
|
1670
|
+
for (let i of ["lat", "lon"]) {
|
|
1671
|
+
let c2 = n?.[i];
|
|
1672
|
+
c2 && y4.has(c2) && (s[i] = c2);
|
|
1673
1673
|
}
|
|
1674
|
-
let
|
|
1675
|
-
if (
|
|
1676
|
-
let
|
|
1677
|
-
|
|
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
|
|
1680
|
-
if (
|
|
1681
|
-
let
|
|
1682
|
-
|
|
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
|
|
1685
|
-
if (!
|
|
1686
|
-
let
|
|
1687
|
-
for (let
|
|
1688
|
-
let
|
|
1689
|
-
if (I4(
|
|
1690
|
-
let
|
|
1691
|
-
if (
|
|
1692
|
-
let
|
|
1693
|
-
|
|
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 v2 = z3(S2);
|
|
1691
|
+
if (v2 < 95) continue;
|
|
1692
|
+
let $3 = J4(S2, (D2) => !!Y(D2)), Me = J4(S2, (D2) => !!Y(D2) && !ue2(D2, o2));
|
|
1693
|
+
$3 < X3 && Me < 1 || (!i || v2 > i.pct) && (i = { name: c2, pct: v2 });
|
|
1694
1694
|
}
|
|
1695
|
-
|
|
1695
|
+
i && (s.state = i.name, p2.add(i.name), l.push(`state=${i.name} (${i.pct}% states/provinces)`));
|
|
1696
1696
|
}
|
|
1697
|
-
if (!
|
|
1698
|
-
if (
|
|
1699
|
-
let
|
|
1700
|
-
if (!(
|
|
1701
|
-
|
|
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) && !(Fn(c2, (v2) => Z(v2).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
|
|
1706
|
-
if (!
|
|
1707
|
-
let
|
|
1708
|
-
for (let
|
|
1709
|
-
if (
|
|
1710
|
-
let
|
|
1711
|
-
(!
|
|
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
|
-
|
|
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 (!
|
|
1716
|
-
let
|
|
1717
|
-
for (let
|
|
1718
|
-
if (
|
|
1719
|
-
let
|
|
1720
|
-
|
|
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), v2 = In(S2, o2);
|
|
1720
|
+
v2 < m3 || J4(S2, ($3) => p3($3, o2)) < X3 || (!i || v2 > i.pct) && (i = { name: c2, pct: v2 });
|
|
1721
1721
|
}
|
|
1722
|
-
|
|
1722
|
+
i && (s.city = i.name, l.push(`city=${i.name} (${i.pct}% known cities)`));
|
|
1723
1723
|
}
|
|
1724
|
-
let
|
|
1725
|
-
let
|
|
1726
|
-
return isFinite(
|
|
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
|
|
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
|
|
1732
|
+
var Gn2 = 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
|
|
1735
|
-
var
|
|
1734
|
+
var sr = Object.freeze({ integer: "number", decimal: "number", double: "number", datetime: "date", date: "date", boolean: "boolean", string: "text" });
|
|
1735
|
+
var pr = Object.freeze({ RENDER_START: "render-start", RENDER_OK: "render-ok", RENDER_ERROR: "render-error", VIEW: "view", VIEW_VERDICT: "view-verdict" });
|
|
1736
|
+
var we = 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 =
|
|
1751
|
+
const res = kn(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;
|
|
@@ -2168,8 +2169,8 @@ function createMarkResolver(env) {
|
|
|
2168
2169
|
for (const n of all) {
|
|
2169
2170
|
const tag = (n.tagName || "").toLowerCase();
|
|
2170
2171
|
if (!SHAPE.test(tag)) continue;
|
|
2171
|
-
const
|
|
2172
|
-
if (
|
|
2172
|
+
const pe2 = viewStyle(n);
|
|
2173
|
+
if (pe2 && pe2 !== "none") return true;
|
|
2173
2174
|
}
|
|
2174
2175
|
return false;
|
|
2175
2176
|
};
|
|
@@ -3286,10 +3287,10 @@ function applyLabelContrast(container, opts = {}) {
|
|
|
3286
3287
|
const cellRGBA = toRGBA(cell.fill);
|
|
3287
3288
|
let bgRGB = cellRGBA ? compositeOver([cellRGBA[0], cellRGBA[1], cellRGBA[2], cellRGBA[3] * cell.op], pageRGB) : pageRGB;
|
|
3288
3289
|
if (pill) {
|
|
3289
|
-
const
|
|
3290
|
-
if (
|
|
3291
|
-
bgRGB = compositeOver([
|
|
3292
|
-
pill.el.setAttribute("fill", `rgb(${
|
|
3290
|
+
const pr2 = toRGBA(pill.fill);
|
|
3291
|
+
if (pr2) {
|
|
3292
|
+
bgRGB = compositeOver([pr2[0], pr2[1], pr2[2], 0.9], bgRGB);
|
|
3293
|
+
pill.el.setAttribute("fill", `rgb(${pr2[0]}, ${pr2[1]}, ${pr2[2]})`);
|
|
3293
3294
|
pill.el.setAttribute("fill-opacity", "0.9");
|
|
3294
3295
|
report.pillsBoosted++;
|
|
3295
3296
|
}
|
|
@@ -3568,8 +3569,8 @@ function createChartHost(container, config) {
|
|
|
3568
3569
|
const marks = container.querySelectorAll(`.${MARK_CLASS}[${ROW_IDX_ATTR}], .${LEGEND_MARK_CLASS}[${ROW_IDX_ATTR}]`);
|
|
3569
3570
|
for (const m2 of Array.from(marks)) {
|
|
3570
3571
|
const rows = parseRowIdxs(m2.getAttribute(ROW_IDX_ATTR));
|
|
3571
|
-
const
|
|
3572
|
-
m2.classList?.[
|
|
3572
|
+
const on2 = active && rows.some((r2) => wanted.has(r2));
|
|
3573
|
+
m2.classList?.[on2 ? "add" : "remove"](MARK_SELECTED_CLASS);
|
|
3573
3574
|
}
|
|
3574
3575
|
} catch {
|
|
3575
3576
|
}
|
|
@@ -3862,11 +3863,11 @@ function toSourceRows(rowMap, payloadRowIdxs) {
|
|
|
3862
3863
|
return payloadRowIdxs.map((i) => rowMap[i]).filter((i) => i !== void 0);
|
|
3863
3864
|
}
|
|
3864
3865
|
function toPayloadRows(rowMap, sourceRowIdxs) {
|
|
3865
|
-
const
|
|
3866
|
+
const at3 = /* @__PURE__ */ new Map();
|
|
3866
3867
|
rowMap.forEach((src, k3) => {
|
|
3867
|
-
if (!
|
|
3868
|
+
if (!at3.has(src)) at3.set(src, k3);
|
|
3868
3869
|
});
|
|
3869
|
-
return sourceRowIdxs.map((s) =>
|
|
3870
|
+
return sourceRowIdxs.map((s) => at3.get(s)).filter((k3) => k3 !== void 0);
|
|
3870
3871
|
}
|
|
3871
3872
|
var sameRows = (a2, b4) => {
|
|
3872
3873
|
if (a2.length !== b4.length) return false;
|
|
@@ -4051,10 +4052,10 @@ export {
|
|
|
4051
4052
|
le,
|
|
4052
4053
|
L2 as L,
|
|
4053
4054
|
L3,
|
|
4054
|
-
Ye,
|
|
4055
4055
|
He,
|
|
4056
|
-
|
|
4057
|
-
|
|
4056
|
+
Xe,
|
|
4057
|
+
Gn,
|
|
4058
|
+
Bn,
|
|
4058
4059
|
buildRenderPayload,
|
|
4059
4060
|
stripJsComments,
|
|
4060
4061
|
isInsideControl,
|
package/dist/index.mjs
CHANGED
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
AXIS_PIN_MIN_LABELS,
|
|
21
21
|
AXIS_PIN_TRACK_REACH_PX,
|
|
22
22
|
BACKING_MAJORITY,
|
|
23
|
+
Bn,
|
|
23
24
|
COLOR_SCALE_SELF_CLAMP_PCT_DEFAULT,
|
|
24
25
|
COLOR_SCALE_SELF_CLAMP_PCT_MAX,
|
|
25
26
|
COLOR_SCALE_SELF_CLAMP_PCT_MIN,
|
|
@@ -36,6 +37,7 @@ import {
|
|
|
36
37
|
FLIP_MODE_DEFAULT,
|
|
37
38
|
GEO_POINT_PRECISIONS,
|
|
38
39
|
GLYPH_SAMPLE_N,
|
|
40
|
+
Gn,
|
|
39
41
|
HOST_CONTAINER_CLASS,
|
|
40
42
|
HOST_CONTRACT_VERSION,
|
|
41
43
|
He,
|
|
@@ -53,7 +55,6 @@ import {
|
|
|
53
55
|
MIN_CONTRAST,
|
|
54
56
|
MIN_HIT_BAND_PX,
|
|
55
57
|
MIN_RAMP_FILLS,
|
|
56
|
-
On,
|
|
57
58
|
PAGE_MATCH_TOLERANCE,
|
|
58
59
|
PHANTOM_FRACTION,
|
|
59
60
|
PILL_MIN_ALPHA,
|
|
@@ -69,7 +70,7 @@ import {
|
|
|
69
70
|
VIEW_ONLY_UI_STATE_KEYS,
|
|
70
71
|
WHITE_TEXT_BG_LUM,
|
|
71
72
|
XFILTER_REFRESH_EVENT,
|
|
72
|
-
|
|
73
|
+
Xe,
|
|
73
74
|
applyLabelContrast,
|
|
74
75
|
assembleD3,
|
|
75
76
|
autoRampCanvas,
|
|
@@ -111,7 +112,6 @@ import {
|
|
|
111
112
|
isInvalidSentinelError,
|
|
112
113
|
isPhantomBox,
|
|
113
114
|
isPillBackdropAlpha,
|
|
114
|
-
kn,
|
|
115
115
|
labelBand,
|
|
116
116
|
le,
|
|
117
117
|
loadGeo,
|
|
@@ -140,7 +140,7 @@ import {
|
|
|
140
140
|
unpinScrolledAxis,
|
|
141
141
|
valuePlacementFlag,
|
|
142
142
|
withoutViewOnlyKeys
|
|
143
|
-
} from "./chunk-
|
|
143
|
+
} from "./chunk-NMEXSUOR.mjs";
|
|
144
144
|
import "./chunk-A2GMXZP7.mjs";
|
|
145
145
|
import "./chunk-GHODWOAL.mjs";
|
|
146
146
|
|
|
@@ -1487,15 +1487,15 @@ function displayText(col, raw, opts) {
|
|
|
1487
1487
|
return String(raw);
|
|
1488
1488
|
}
|
|
1489
1489
|
function isSuppressed(col) {
|
|
1490
|
-
return
|
|
1490
|
+
return He(col).suppressed;
|
|
1491
1491
|
}
|
|
1492
1492
|
function resolveAgg(col, requested, auto) {
|
|
1493
1493
|
const fallback = () => {
|
|
1494
|
-
const d2 =
|
|
1494
|
+
const d2 = Gn(col);
|
|
1495
1495
|
return d2 === "first" ? "count" : d2;
|
|
1496
1496
|
};
|
|
1497
1497
|
if (auto) return fallback();
|
|
1498
|
-
return
|
|
1498
|
+
return Xe(col).indexOf(requested) >= 0 ? requested : fallback();
|
|
1499
1499
|
}
|
|
1500
1500
|
function toNumber(v2) {
|
|
1501
1501
|
if (v2 == null || v2 === "") return null;
|
|
@@ -1598,7 +1598,7 @@ function computeSelectionCard(payload, selectedRowIdxs, opts = {}) {
|
|
|
1598
1598
|
}
|
|
1599
1599
|
const value = reduce(selVals, colAgg, selRaw);
|
|
1600
1600
|
let sharePct = null;
|
|
1601
|
-
if (
|
|
1601
|
+
if (Bn(col, colAgg) && value != null) {
|
|
1602
1602
|
const allVals = [];
|
|
1603
1603
|
const allRaw = [];
|
|
1604
1604
|
for (let r2 = 0; r2 < rows.length; r2++) {
|
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.41",
|
|
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",
|