@bicharts/chart-host 0.6.38 → 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.
- package/dist/{chunk-3OLKWWX5.mjs → chunk-ENE64U44.mjs} +117 -116
- 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-M7OKMBJS.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 we = { "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(we)) for (let n of we[e].split(/\s+/)) n && t.set(n, e);
|
|
1491
1491
|
return t;
|
|
1492
1492
|
})();
|
|
1493
|
-
function
|
|
1493
|
+
function lt2(t) {
|
|
1494
1494
|
for (let [e, n] of t) {
|
|
1495
1495
|
let r2 = J3.get(e);
|
|
1496
1496
|
r2 && !J3.has(n) && J3.set(n, r2);
|
|
1497
1497
|
}
|
|
1498
1498
|
}
|
|
1499
|
-
|
|
1500
|
-
var
|
|
1501
|
-
var
|
|
1502
|
-
var bt = ["latitude", "longitude"];
|
|
1499
|
+
lt2(N);
|
|
1500
|
+
var ht = ["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 bt = ["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 yt2 = ["latitude", "longitude"];
|
|
1503
|
+
var St2 = ["latitude", "longitude"];
|
|
1504
1504
|
function j3(t) {
|
|
1505
1505
|
return p(t);
|
|
1506
1506
|
}
|
|
1507
1507
|
var de = ["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
|
|
1508
|
+
function _t(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 Ge = new RegExp("^\\s*(?:(?:sum|count|count\\s+distinct|distinct\\s+count)\\s+of\\s+|(?:" + _t(de) + ")\\s+)", "i");
|
|
1512
|
+
var At = /(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Za-z])(?=[0-9])|(?<=[0-9])(?=[A-Za-z])/g;
|
|
1513
|
+
var Ct = new RegExp("\\b(" + ht.join("|") + ")\\b|(" + bt.join("|") + ")$", "i");
|
|
1514
|
+
var Mt2 = new RegExp("\\b(" + yt2.join("|") + ")\\b|(" + St2.join("|") + ")$", "i");
|
|
1515
|
+
function We(t) {
|
|
1516
1516
|
if (!t) return "";
|
|
1517
|
-
let e = String(t), n =
|
|
1517
|
+
let e = String(t), n = Ge.exec(j3(e));
|
|
1518
1518
|
return (n ? e.slice(n[0].length) : e).trim();
|
|
1519
1519
|
}
|
|
1520
|
-
function
|
|
1521
|
-
return !!t &&
|
|
1520
|
+
function xt(t) {
|
|
1521
|
+
return !!t && Ge.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 Rt = ["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 ke = new RegExp("^\\s*(" + [...Rt].sort((t, e) => e.length - t.length).map((t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+")).join("|") + ")\\s+of\\s+", "i");
|
|
1525
|
+
var ze = { 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 Tt = new RegExp("^(" + Object.keys(ze).join("|") + ")\\((.+)\\)$");
|
|
1527
|
+
function Nt(t) {
|
|
1528
|
+
let e = We(t);
|
|
1529
|
+
return e.length === 0 ? "" : e.replace(At, " ");
|
|
1530
1530
|
}
|
|
1531
|
-
function
|
|
1531
|
+
function Ue(t, e) {
|
|
1532
1532
|
if (!e) return false;
|
|
1533
|
-
let n =
|
|
1534
|
-
return t.test(j3(
|
|
1535
|
-
}
|
|
1536
|
-
function Ue(t) {
|
|
1537
|
-
return $e(Ct, t);
|
|
1533
|
+
let n = We(e);
|
|
1534
|
+
return t.test(j3(Nt(e))) || t.test(j3(n)) || t.test(j3(d(n).join(" ")));
|
|
1538
1535
|
}
|
|
1539
|
-
function
|
|
1540
|
-
return
|
|
1536
|
+
function Ve(t) {
|
|
1537
|
+
return Ue(Mt2, t);
|
|
1541
1538
|
}
|
|
1542
|
-
var Ve = /int|double|decimal|single|float|number|currency|money/i;
|
|
1543
1539
|
function Et(t) {
|
|
1544
|
-
|
|
1545
|
-
return e === "categorical" ? "Categorical" : e === "ordinal" ? "Ordinal" : e === "continuous" || t?.isMeasure === true || Ve.test(String(t?.dataType ?? "")) ? "Continuous" : "Categorical";
|
|
1540
|
+
return Ue(Ct, t) || Ve(t);
|
|
1546
1541
|
}
|
|
1542
|
+
var Ke = /int|double|decimal|single|float|number|currency|money/i;
|
|
1547
1543
|
function vt(t) {
|
|
1548
|
-
|
|
1544
|
+
let e = String(t?.valueNature ?? "").trim().toLowerCase();
|
|
1545
|
+
return e === "categorical" ? "Categorical" : e === "ordinal" ? "Ordinal" : e === "continuous" || t?.isMeasure === true || Ke.test(String(t?.dataType ?? "")) ? "Continuous" : "Categorical";
|
|
1546
|
+
}
|
|
1547
|
+
function It2(t) {
|
|
1548
|
+
return t?.isMeasure === true || Ke.test(String(t?.dataType ?? ""));
|
|
1549
1549
|
}
|
|
1550
|
-
function
|
|
1551
|
-
let e = t ?? {}, n =
|
|
1550
|
+
function Ye(t) {
|
|
1551
|
+
let e = t ?? {}, n = vt(e);
|
|
1552
1552
|
if (n !== "Continuous") return { nature: n, additivity: "unknown", basis: "role", suppressed: false };
|
|
1553
|
-
if (
|
|
1553
|
+
if (Ve(e.name)) return { nature: n, additivity: "positional", basis: "name", suppressed: true };
|
|
1554
1554
|
let r2 = String(e.additivity ?? "").trim().toLowerCase();
|
|
1555
|
-
if (!(r2 === "additive" &&
|
|
1555
|
+
if (!(r2 === "additive" && xt(e.name))) {
|
|
1556
1556
|
if (r2 === "additive") return { nature: n, additivity: "additive", basis: "measured", suppressed: false };
|
|
1557
1557
|
if (r2 === "part_of_whole") return { nature: n, additivity: "part_of_whole", basis: "measured", suppressed: false };
|
|
1558
1558
|
if (r2 === "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 } : Et(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 He(t) {
|
|
1563
|
+
let e = Ye(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 It2(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,16 +1572,16 @@ function Ye(t) {
|
|
|
1572
1572
|
return ["sum", "average", "median", "min", "max", "count", "distinctcount", "first"];
|
|
1573
1573
|
}
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1576
|
-
return
|
|
1575
|
+
function On(t) {
|
|
1576
|
+
return He(t)[0];
|
|
1577
1577
|
}
|
|
1578
|
-
function
|
|
1578
|
+
function kn(t, e) {
|
|
1579
1579
|
if (e !== "sum" && e !== "count") return false;
|
|
1580
1580
|
if (e === "count") return true;
|
|
1581
|
-
let n =
|
|
1581
|
+
let n = Ye(t);
|
|
1582
1582
|
return n.additivity === "additive" || n.additivity === "part_of_whole" || n.additivity === "unknown";
|
|
1583
1583
|
}
|
|
1584
|
-
var
|
|
1584
|
+
var Dt = 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. */
|
|
@@ -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 Mn2(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 Ln(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 _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
|
|
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 P4 = z3(
|
|
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
|
|
1693
|
-
|
|
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
|
-
|
|
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) && !(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
|
|
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
|
-
P4 < m3 || J4(
|
|
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
|
-
|
|
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 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
|
|
1735
|
-
var
|
|
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 =
|
|
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;
|
|
@@ -2069,9 +2070,9 @@ function createMarkResolver(env) {
|
|
|
2069
2070
|
let best = Number.MAX_VALUE;
|
|
2070
2071
|
const N2 = 64;
|
|
2071
2072
|
for (let i = 0; i <= N2; i++) {
|
|
2072
|
-
const
|
|
2073
|
-
const dx = m2.a *
|
|
2074
|
-
const dy = m2.b *
|
|
2073
|
+
const pt = el.getPointAtLength(L4 * i / N2);
|
|
2074
|
+
const dx = m2.a * pt.x + m2.c * pt.y + m2.e - x3;
|
|
2075
|
+
const dy = m2.b * pt.x + m2.d * pt.y + m2.f - y4;
|
|
2075
2076
|
const d2 = dx * dx + dy * dy;
|
|
2076
2077
|
if (d2 < best) best = d2;
|
|
2077
2078
|
}
|
|
@@ -3237,10 +3238,10 @@ function applyLabelContrast(container, opts = {}) {
|
|
|
3237
3238
|
for (let t = 0; t < texts.length; t++) {
|
|
3238
3239
|
const tx = texts[t];
|
|
3239
3240
|
if (tx.getAttribute(LABEL_CONTRAST_DONE_ATTR) === "1") continue;
|
|
3240
|
-
const
|
|
3241
|
-
if (
|
|
3242
|
-
const ovArea = (r2) => Math.max(0, Math.min(r2.right,
|
|
3243
|
-
const glyphArea =
|
|
3241
|
+
const tr = tx.getBoundingClientRect();
|
|
3242
|
+
if (tr.width <= 0 || tr.height <= 0) continue;
|
|
3243
|
+
const ovArea = (r2) => Math.max(0, Math.min(r2.right, tr.right) - Math.max(r2.left, tr.left)) * Math.max(0, Math.min(r2.bottom, tr.bottom) - Math.max(r2.top, tr.top));
|
|
3244
|
+
const glyphArea = tr.width * tr.height;
|
|
3244
3245
|
const txRoot = paintRoot(tx, container);
|
|
3245
3246
|
let over = 0;
|
|
3246
3247
|
const boxed = rects.map((mk) => ({ mk, ov: ovArea(mk.r) })).filter((x3) => {
|
|
@@ -3250,7 +3251,7 @@ function applyLabelContrast(container, opts = {}) {
|
|
|
3250
3251
|
return false;
|
|
3251
3252
|
});
|
|
3252
3253
|
if (over > 0) report.paintedOver++;
|
|
3253
|
-
const pts = glyphSampleGrid({ left:
|
|
3254
|
+
const pts = glyphSampleGrid({ left: tr.left, top: tr.top, width: tr.width, height: tr.height });
|
|
3254
3255
|
const painted = pts.map(() => false);
|
|
3255
3256
|
let unmeasured = 0;
|
|
3256
3257
|
const under = boxed.map((x3) => {
|
|
@@ -4051,10 +4052,10 @@ export {
|
|
|
4051
4052
|
le,
|
|
4052
4053
|
L2 as L,
|
|
4053
4054
|
L3,
|
|
4054
|
-
Ke,
|
|
4055
4055
|
Ye,
|
|
4056
|
-
|
|
4057
|
-
|
|
4056
|
+
He,
|
|
4057
|
+
On,
|
|
4058
|
+
kn,
|
|
4058
4059
|
buildRenderPayload,
|
|
4059
4060
|
stripJsComments,
|
|
4060
4061
|
isInsideControl,
|
package/dist/index.mjs
CHANGED
|
@@ -32,14 +32,13 @@ import {
|
|
|
32
32
|
DARK_TEXT,
|
|
33
33
|
DIM_OPACITY_DEFAULT,
|
|
34
34
|
DIM_OPACITY_VAR,
|
|
35
|
-
Dn,
|
|
36
35
|
FIT_CONTENT_SELECTOR,
|
|
37
36
|
FLIP_MODE_DEFAULT,
|
|
38
37
|
GEO_POINT_PRECISIONS,
|
|
39
38
|
GLYPH_SAMPLE_N,
|
|
40
39
|
HOST_CONTAINER_CLASS,
|
|
41
40
|
HOST_CONTRACT_VERSION,
|
|
42
|
-
|
|
41
|
+
He,
|
|
43
42
|
L,
|
|
44
43
|
L3,
|
|
45
44
|
LABEL_CONTRAST_CAP,
|
|
@@ -54,12 +53,12 @@ import {
|
|
|
54
53
|
MIN_CONTRAST,
|
|
55
54
|
MIN_HIT_BAND_PX,
|
|
56
55
|
MIN_RAMP_FILLS,
|
|
56
|
+
On,
|
|
57
57
|
PAGE_MATCH_TOLERANCE,
|
|
58
58
|
PHANTOM_FRACTION,
|
|
59
59
|
PILL_MIN_ALPHA,
|
|
60
60
|
PILL_MIN_COVERAGE,
|
|
61
61
|
PILL_OPAQUE_ALPHA,
|
|
62
|
-
Pn,
|
|
63
62
|
ROW_IDX_ATTR,
|
|
64
63
|
SAME_SHADE_DELTA_E,
|
|
65
64
|
SCROLL_SLACK_PX,
|
|
@@ -112,6 +111,7 @@ import {
|
|
|
112
111
|
isInvalidSentinelError,
|
|
113
112
|
isPhantomBox,
|
|
114
113
|
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-ENE64U44.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 Ye(col).suppressed;
|
|
1491
1491
|
}
|
|
1492
1492
|
function resolveAgg(col, requested, auto) {
|
|
1493
1493
|
const fallback = () => {
|
|
1494
|
-
const d2 =
|
|
1494
|
+
const d2 = On(col);
|
|
1495
1495
|
return d2 === "first" ? "count" : d2;
|
|
1496
1496
|
};
|
|
1497
1497
|
if (auto) return fallback();
|
|
1498
|
-
return
|
|
1498
|
+
return He(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 (kn(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.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",
|