@bicharts/chart-host 0.6.64 → 0.6.65
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.
|
@@ -1763,7 +1763,7 @@ function Fn(n, s2) {
|
|
|
1763
1763
|
return { iso: o4, unmatched: I2, matchedRows: N, totalRows: n.length };
|
|
1764
1764
|
}
|
|
1765
1765
|
|
|
1766
|
-
// ../shape-core/dist/chunk-
|
|
1766
|
+
// ../shape-core/dist/chunk-OPDY2YEA.mjs
|
|
1767
1767
|
var import_papaparse = __toESM(require_papaparse_min(), 1);
|
|
1768
1768
|
/*! @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. */
|
|
1769
1769
|
var ze = { "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" };
|
|
@@ -1869,7 +1869,7 @@ var Yt = new RegExp([String.raw`\bisMeasure\b`, String.raw`\bdataType\b`, String
|
|
|
1869
1869
|
/*! @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. */
|
|
1870
1870
|
var Z3 = 2;
|
|
1871
1871
|
var me2 = 400;
|
|
1872
|
-
function
|
|
1872
|
+
function te(t) {
|
|
1873
1873
|
return !!k(t);
|
|
1874
1874
|
}
|
|
1875
1875
|
function F3(t) {
|
|
@@ -1883,8 +1883,8 @@ function F3(t) {
|
|
|
1883
1883
|
}
|
|
1884
1884
|
function A2(t) {
|
|
1885
1885
|
let e = F3(t);
|
|
1886
|
-
if (e.length === 0 ||
|
|
1887
|
-
let n = e.filter((u4) =>
|
|
1886
|
+
if (e.length === 0 || ne2(t) < 95) return false;
|
|
1887
|
+
let n = e.filter((u4) => te(u4) && !t3(u4)).length, o4 = e.filter((u4) => !te(u4) && !!t3(u4)).length;
|
|
1888
1888
|
return n >= 1 && n >= o4;
|
|
1889
1889
|
}
|
|
1890
1890
|
function ce3(t, e) {
|
|
@@ -1892,11 +1892,11 @@ function ce3(t, e) {
|
|
|
1892
1892
|
let n = k(t);
|
|
1893
1893
|
return n ? e === "world" ? true : G3.has(n) : false;
|
|
1894
1894
|
}
|
|
1895
|
-
function
|
|
1895
|
+
function ne2(t) {
|
|
1896
1896
|
let e = F3(t);
|
|
1897
1897
|
if (e.length === 0) return 0;
|
|
1898
1898
|
let n = 0;
|
|
1899
|
-
for (let o4 of e)
|
|
1899
|
+
for (let o4 of e) te(o4) && n++;
|
|
1900
1900
|
return Math.round(n / e.length * 1e3) / 10;
|
|
1901
1901
|
}
|
|
1902
1902
|
function z2(t) {
|
|
@@ -1906,7 +1906,7 @@ function z2(t) {
|
|
|
1906
1906
|
for (let o4 of e) t3(o4) && n++;
|
|
1907
1907
|
return Math.round(n / e.length * 1e3) / 10;
|
|
1908
1908
|
}
|
|
1909
|
-
function
|
|
1909
|
+
function oe2(t) {
|
|
1910
1910
|
let e = /* @__PURE__ */ new Set();
|
|
1911
1911
|
for (let n of t) {
|
|
1912
1912
|
if (n == null) continue;
|
|
@@ -1915,15 +1915,15 @@ function re2(t) {
|
|
|
1915
1915
|
}
|
|
1916
1916
|
return Array.from(e);
|
|
1917
1917
|
}
|
|
1918
|
-
function
|
|
1919
|
-
let e =
|
|
1918
|
+
function re2(t) {
|
|
1919
|
+
let e = oe2(t);
|
|
1920
1920
|
if (e.length === 0) return 0;
|
|
1921
1921
|
let n = 0;
|
|
1922
1922
|
for (let o4 of e) r3(o4).length > 0 && n++;
|
|
1923
1923
|
return Math.round(n / e.length * 1e3) / 10;
|
|
1924
1924
|
}
|
|
1925
1925
|
function de(t, e) {
|
|
1926
|
-
return y(e, fn) ? true :
|
|
1926
|
+
return y(e, fn) ? true : oe2(t).some((n) => /^\d{5}(-\d{4})?$/.test(n.replace(/\.0+$/, "")));
|
|
1927
1927
|
}
|
|
1928
1928
|
function Bn2(t, e) {
|
|
1929
1929
|
let n = F3(t);
|
|
@@ -1932,54 +1932,54 @@ function Bn2(t, e) {
|
|
|
1932
1932
|
for (let u4 of n) j3(u4, e) && o4++;
|
|
1933
1933
|
return Math.round(o4 / n.length * 1e3) / 10;
|
|
1934
1934
|
}
|
|
1935
|
-
function
|
|
1935
|
+
function ee3(t, e) {
|
|
1936
1936
|
let n = 0;
|
|
1937
1937
|
for (let o4 of F3(t)) e(o4) && n++;
|
|
1938
1938
|
return n;
|
|
1939
1939
|
}
|
|
1940
1940
|
function jn(t, e) {
|
|
1941
1941
|
let n = 0;
|
|
1942
|
-
for (let o4 of
|
|
1942
|
+
for (let o4 of oe2(t)) e(o4) && n++;
|
|
1943
1943
|
return n;
|
|
1944
1944
|
}
|
|
1945
1945
|
function Yn3(t, e, n, o4, u4) {
|
|
1946
|
-
let l2 = [], a3 = [], i = {},
|
|
1946
|
+
let l2 = [], a3 = [], i = {}, h4 = {}, C2 = new Set(t), y2 = (s2) => e.map((d2) => d2[s2]);
|
|
1947
1947
|
for (let s2 of ["city", "country"]) {
|
|
1948
|
-
let
|
|
1949
|
-
|
|
1948
|
+
let d2 = n?.[s2];
|
|
1949
|
+
d2 && C2.has(d2) && (i[s2] = d2);
|
|
1950
1950
|
}
|
|
1951
1951
|
let g5 = new Set(u4 ?? t);
|
|
1952
1952
|
for (let s2 of ["lat", "lon"]) {
|
|
1953
|
-
let
|
|
1954
|
-
|
|
1953
|
+
let d2 = n?.[s2];
|
|
1954
|
+
d2 && g5.has(d2) && (i[s2] = d2);
|
|
1955
1955
|
}
|
|
1956
1956
|
let f4 = n?.zip;
|
|
1957
|
-
if (f4 &&
|
|
1958
|
-
let s2 = y2(f4),
|
|
1959
|
-
|
|
1957
|
+
if (f4 && C2.has(f4)) {
|
|
1958
|
+
let s2 = y2(f4), d2 = re2(s2);
|
|
1959
|
+
d2 < 95 ? a3.push(`zip=${f4} (only ${d2}% of values read as ZIPs)`) : de(s2, f4) ? i.zip = f4 : a3.push(`zip=${f4} (all values are 3-4 digits with nothing to say they are postal)`);
|
|
1960
1960
|
}
|
|
1961
|
-
let
|
|
1962
|
-
if (
|
|
1963
|
-
let s2 = y2(
|
|
1964
|
-
|
|
1961
|
+
let c2 = n?.state;
|
|
1962
|
+
if (c2 && C2.has(c2)) {
|
|
1963
|
+
let s2 = y2(c2), d2 = F3(s2);
|
|
1964
|
+
d2.length > 0 && d2.every((S2) => ce3(S2, o4)) ? a3.push(`state=${c2} (every value is "CA", which is both Canada and California)`) : A2(s2) ? (a3.push(`state=${c2} (every value is a country, not a state)`), i.country || (i.country = c2)) : z2(s2) < 95 ? a3.push(`state=${c2} (only ${z2(s2)}% of values are states/provinces)`) : i.state = c2;
|
|
1965
1965
|
}
|
|
1966
|
-
let p4 = new Set(Object.values(i).filter(Boolean)),
|
|
1966
|
+
let p4 = new Set(Object.values(i).filter(Boolean)), b4 = t.filter((s2) => !p4.has(s2) && !s2.startsWith("__"));
|
|
1967
1967
|
if (!i.state) {
|
|
1968
1968
|
let s2 = null;
|
|
1969
|
-
for (let
|
|
1970
|
-
let S2 = y2(
|
|
1969
|
+
for (let d2 of b4) {
|
|
1970
|
+
let S2 = y2(d2);
|
|
1971
1971
|
if (A2(S2)) continue;
|
|
1972
|
-
let
|
|
1973
|
-
if (
|
|
1974
|
-
let
|
|
1975
|
-
|
|
1972
|
+
let _4 = z2(S2);
|
|
1973
|
+
if (_4 < 95) continue;
|
|
1974
|
+
let H2 = ee3(S2, (D2) => !!t3(D2)), Ne = ee3(S2, (D2) => !!t3(D2) && !ce3(D2, o4));
|
|
1975
|
+
H2 < Z3 && Ne < 1 || (!s2 || _4 > s2.pct) && (s2 = { name: d2, pct: _4 });
|
|
1976
1976
|
}
|
|
1977
1977
|
s2 && (i.state = s2.name, p4.add(s2.name), l2.push(`state=${s2.name} (${s2.pct}% states/provinces)`));
|
|
1978
1978
|
}
|
|
1979
|
-
if (!i.zip) for (let s2 of
|
|
1979
|
+
if (!i.zip) for (let s2 of b4) {
|
|
1980
1980
|
if (p4.has(s2)) continue;
|
|
1981
|
-
let
|
|
1982
|
-
if (!(S2 < 95) && de(
|
|
1981
|
+
let d2 = y2(s2), S2 = re2(d2);
|
|
1982
|
+
if (!(S2 < 95) && de(d2, s2) && !(jn(d2, (_4) => r3(_4).length > 0) < Z3)) {
|
|
1983
1983
|
i.zip = s2, p4.add(s2), l2.push(`zip=${s2} (${S2}% ZIP codes)`);
|
|
1984
1984
|
break;
|
|
1985
1985
|
}
|
|
@@ -1987,31 +1987,31 @@ function Yn3(t, e, n, o4, u4) {
|
|
|
1987
1987
|
let T = i.country;
|
|
1988
1988
|
if (!T || !A2(y2(T))) {
|
|
1989
1989
|
let s2 = null;
|
|
1990
|
-
for (let
|
|
1991
|
-
if (p4.has(
|
|
1992
|
-
let S2 =
|
|
1993
|
-
(!s2 || S2 > s2.pct) && (s2 = { name:
|
|
1990
|
+
for (let d2 of b4) {
|
|
1991
|
+
if (p4.has(d2) || !A2(y2(d2))) continue;
|
|
1992
|
+
let S2 = ne2(y2(d2));
|
|
1993
|
+
(!s2 || S2 > s2.pct) && (s2 = { name: d2, pct: S2 });
|
|
1994
1994
|
}
|
|
1995
|
-
s2 && (T && (a3.push(`country=${T} (only ${
|
|
1995
|
+
s2 && (T && (a3.push(`country=${T} (only ${ne2(y2(T))}% of values are country identifiers; using ${s2.name} instead)`), h4.country = T), i.country = s2.name, p4.add(s2.name), l2.push(`country=${s2.name}`));
|
|
1996
1996
|
}
|
|
1997
1997
|
if (!i.city) {
|
|
1998
1998
|
let s2 = null;
|
|
1999
|
-
for (let
|
|
2000
|
-
if (p4.has(
|
|
2001
|
-
let S2 = y2(
|
|
2002
|
-
|
|
1999
|
+
for (let d2 of b4) {
|
|
2000
|
+
if (p4.has(d2)) continue;
|
|
2001
|
+
let S2 = y2(d2), _4 = Bn2(S2, o4);
|
|
2002
|
+
_4 < D3 || ee3(S2, (H2) => j3(H2, o4)) < Z3 || (!s2 || _4 > s2.pct) && (s2 = { name: d2, pct: _4 });
|
|
2003
2003
|
}
|
|
2004
2004
|
s2 && (i.city = s2.name, l2.push(`city=${s2.name} (${s2.pct}% known cities)`));
|
|
2005
2005
|
}
|
|
2006
2006
|
let L4 = i.country ? y2(i.country) : [], R4 = !!i.country && A2(L4), M2 = R4 ? new Set(L4.map((s2) => k(s2 == null ? null : String(s2))).filter(Boolean)).size : 0, x3 = R4 && M2 >= 2, w3 = !!(i.lat && i.lon) && e.some((s2) => {
|
|
2007
|
-
let
|
|
2008
|
-
return isFinite(
|
|
2007
|
+
let d2 = +String(s2[i.lat] ?? "").trim(), S2 = +String(s2[i.lon] ?? "").trim();
|
|
2008
|
+
return isFinite(d2) && isFinite(S2) && d2 >= -90 && d2 <= 90 && S2 >= -180 && S2 <= 180 && String(s2[i.lat] ?? "").trim() !== "" && String(s2[i.lon] ?? "").trim() !== "";
|
|
2009
2009
|
});
|
|
2010
|
-
return i.lat && i.lon && !w3 && a3.push(`lat/lon=${i.lat}/${i.lon} (no row holds a usable coordinate pair)`), i.country && !x3 && !(i.city || i.state || i.zip || w3) && a3.push(R4 ? `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 || w3) ? i : null, backfilled: l2, refused: a3, ...Object.keys(
|
|
2010
|
+
return i.lat && i.lon && !w3 && a3.push(`lat/lon=${i.lat}/${i.lon} (no row holds a usable coordinate pair)`), i.country && !x3 && !(i.city || i.state || i.zip || w3) && a3.push(R4 ? `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 || w3) ? i : null, backfilled: l2, refused: a3, ...Object.keys(h4).length ? { labelFallback: h4 } : {} };
|
|
2011
2011
|
}
|
|
2012
2012
|
var r = (t, ...e) => ({ part: t, langs: Object.freeze(e) });
|
|
2013
|
-
var
|
|
2014
|
-
var Qn2 = Object.freeze(Array.from(new Set(Object.values(
|
|
2013
|
+
var ie2 = 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") });
|
|
2014
|
+
var Qn2 = Object.freeze(Array.from(new Set(Object.values(ie2).flatMap((t) => t.langs))));
|
|
2015
2015
|
var fe = Object.freeze(["fa", "ar", "he", "th"]);
|
|
2016
2016
|
var Rr = Object.freeze({ integer: "number", decimal: "number", double: "number", datetime: "date", date: "date", boolean: "boolean", string: "text" });
|
|
2017
2017
|
var Or = Object.freeze({ RENDER_START: "render-start", RENDER_OK: "render-ok", RENDER_ERROR: "render-error", VIEW: "view", VIEW_VERDICT: "view-verdict" });
|
package/dist/index.mjs
CHANGED
|
@@ -122,7 +122,7 @@ import {
|
|
|
122
122
|
toSourceRows,
|
|
123
123
|
unpinScrolledAxis,
|
|
124
124
|
valuePlacementFlag
|
|
125
|
-
} from "./chunk-
|
|
125
|
+
} from "./chunk-3FNHUWNV.mjs";
|
|
126
126
|
import "./chunk-A2GMXZP7.mjs";
|
|
127
127
|
import {
|
|
128
128
|
ACTIVE_TICK_CLASS,
|
|
@@ -2661,13 +2661,13 @@ function latePickupKeepsMarker(outcome) {
|
|
|
2661
2661
|
return outcome === "transport";
|
|
2662
2662
|
}
|
|
2663
2663
|
function pollGiveUpKeepsMarker(outcome, m2) {
|
|
2664
|
-
return outcome === "window-closed" && !!m2 && !isBlindMarker(m2);
|
|
2664
|
+
return (outcome === "window-closed" || outcome === "unreachable") && !!m2 && !isBlindMarker(m2);
|
|
2665
2665
|
}
|
|
2666
2666
|
function pendingRecoveryRemainingMs(m2, nowMs) {
|
|
2667
2667
|
return Math.max(0, m2.t + PENDING_RECOVERY_WINDOW_MS - nowMs);
|
|
2668
2668
|
}
|
|
2669
|
-
function transportFailureShouldRecover(
|
|
2670
|
-
return
|
|
2669
|
+
function transportFailureShouldRecover(_headersReceived, genNew) {
|
|
2670
|
+
return genNew;
|
|
2671
2671
|
}
|
|
2672
2672
|
var TRANSPORT_LOST_CHECKING_MESSAGE = "The connection dropped while your chart was being generated - checking whether it finished on the server...";
|
|
2673
2673
|
var GENERATION_CANCELLED_MESSAGE = "The connection dropped before the chart finished - nothing was charged. Generate again.";
|
|
@@ -2678,6 +2678,37 @@ function generationCancelledMessage(serverMessage) {
|
|
|
2678
2678
|
const s2 = String(serverMessage ?? "").trim();
|
|
2679
2679
|
return s2 !== "" ? s2 : GENERATION_CANCELLED_MESSAGE;
|
|
2680
2680
|
}
|
|
2681
|
+
function recoveryFinalOutcome(r2) {
|
|
2682
|
+
if (!r2) return null;
|
|
2683
|
+
const o3 = String(r2.pollOutcome ?? "").trim().toLowerCase();
|
|
2684
|
+
if (r2.isGenerationCancelled === true || r2.isPollFinal === true && o3 === "cancelled") return "cancelled";
|
|
2685
|
+
if (r2.isPollFinal === true) return o3 === "not-received" ? "not-received" : "failed";
|
|
2686
|
+
if (r2.isPollFinal == null && r2.isVersionNotFound === true) {
|
|
2687
|
+
const c2 = String(r2.errorCode ?? "").trim().toUpperCase();
|
|
2688
|
+
if (c2 === "GENERATION_NOT_RECEIVED") return "not-received";
|
|
2689
|
+
if (c2 === "GENERATION_FAILED") return "failed";
|
|
2690
|
+
if (c2 === "GENERATION_CANCELLED") return "cancelled";
|
|
2691
|
+
}
|
|
2692
|
+
return null;
|
|
2693
|
+
}
|
|
2694
|
+
function recoveryProvesNothingCharged(o3) {
|
|
2695
|
+
return o3 === "cancelled" || o3 === "not-received";
|
|
2696
|
+
}
|
|
2697
|
+
function recoveryGiveUpRefunds(outcome) {
|
|
2698
|
+
return outcome === "window-closed" || outcome === "hard-error" || outcome === "unreachable";
|
|
2699
|
+
}
|
|
2700
|
+
var PENDING_RECOVERY_UNREACHABLE_POLLS = 3;
|
|
2701
|
+
function recoveryLooksUnreachable(transportFailuresInARow, everAnswered) {
|
|
2702
|
+
return !everAnswered && transportFailuresInARow >= PENDING_RECOVERY_UNREACHABLE_POLLS;
|
|
2703
|
+
}
|
|
2704
|
+
var GENERATION_NOT_RECEIVED_MESSAGE = "The charting service has no record of that request, so nothing was generated and nothing was charged. Generate again.";
|
|
2705
|
+
var GENERATION_FAILED_MESSAGE = "That chart didn't finish on the server, so there's nothing to show. Generate again.";
|
|
2706
|
+
var RECOVERY_UNREACHABLE_MESSAGE = "We couldn't reach the charting service to check on your chart - it may be offline, or blocked on this network. Try again in a moment.";
|
|
2707
|
+
function recoveryFinalMessage(o3, serverMessage) {
|
|
2708
|
+
const s2 = String(serverMessage ?? "").trim();
|
|
2709
|
+
if (s2 !== "") return s2;
|
|
2710
|
+
return o3 === "cancelled" ? GENERATION_CANCELLED_MESSAGE : o3 === "not-received" ? GENERATION_NOT_RECEIVED_MESSAGE : GENERATION_FAILED_MESSAGE;
|
|
2711
|
+
}
|
|
2681
2712
|
|
|
2682
2713
|
// src/chartPick.ts
|
|
2683
2714
|
function reconcileChartPick(pick, offered, autoLabel) {
|
|
@@ -2856,6 +2887,8 @@ export {
|
|
|
2856
2887
|
FLIP_INTERVAL_MIN_MS,
|
|
2857
2888
|
FLIP_MODE_DEFAULT,
|
|
2858
2889
|
GENERATION_CANCELLED_MESSAGE,
|
|
2890
|
+
GENERATION_FAILED_MESSAGE,
|
|
2891
|
+
GENERATION_NOT_RECEIVED_MESSAGE,
|
|
2859
2892
|
GEO_POINT_PRECISIONS,
|
|
2860
2893
|
GLYPH_SAMPLE_N,
|
|
2861
2894
|
HOST_CONTAINER_CLASS,
|
|
@@ -2889,6 +2922,7 @@ export {
|
|
|
2889
2922
|
PENDING_RECOVERY_POLL_MS,
|
|
2890
2923
|
PENDING_RECOVERY_SLOW_PHASE_MS,
|
|
2891
2924
|
PENDING_RECOVERY_SLOW_POLL_MS,
|
|
2925
|
+
PENDING_RECOVERY_UNREACHABLE_POLLS,
|
|
2892
2926
|
PENDING_RECOVERY_WINDOW_MS,
|
|
2893
2927
|
PHANTOM_FRACTION,
|
|
2894
2928
|
PILL_MIN_ALPHA,
|
|
@@ -2897,6 +2931,7 @@ export {
|
|
|
2897
2931
|
PRODUCT_FEEDBACK_MAX_CHARS,
|
|
2898
2932
|
PRODUCT_FEEDBACK_MIN_CHARS,
|
|
2899
2933
|
QUALIFY_REFUSAL_UNSPECIFIED,
|
|
2934
|
+
RECOVERY_UNREACHABLE_MESSAGE,
|
|
2900
2935
|
ROW_IDX_ATTR,
|
|
2901
2936
|
SAME_SHADE_DELTA_E,
|
|
2902
2937
|
SCROLL_SLACK_PX,
|
|
@@ -3049,8 +3084,13 @@ export {
|
|
|
3049
3084
|
reconcileChartPick,
|
|
3050
3085
|
reconcileModelPick,
|
|
3051
3086
|
recoveryAnswerIsCancelled,
|
|
3087
|
+
recoveryFinalMessage,
|
|
3088
|
+
recoveryFinalOutcome,
|
|
3089
|
+
recoveryGiveUpRefunds,
|
|
3090
|
+
recoveryLooksUnreachable,
|
|
3052
3091
|
recoveryOwnsTheSentence,
|
|
3053
3092
|
recoveryPollRunning,
|
|
3093
|
+
recoveryProvesNothingCharged,
|
|
3054
3094
|
refusalIsSelectable,
|
|
3055
3095
|
registerCityTable,
|
|
3056
3096
|
registerGeo,
|
package/dist/react.mjs
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export { pinScrolledAxis, unpinScrolledAxis, type AxisPinReport } from "./fitDom
|
|
|
41
41
|
export { MIN_DELTA_E, pickDistinctColorFromSeed, buildPalette, buildPaletteFromSeed, orderMostDistinct, LEGIBLE_LIGHTNESS, type PaletteResult, type SeedForSlot, type PaletteOptions, } from "./palette";
|
|
42
42
|
export { deltaEHex } from "./deltaE";
|
|
43
43
|
export { resolveAutoColorScale, autoRampMinStep, autoRampCanvas, AUTO_RAMP_CLASSES, AUTO_RAMP_DRAWN_OPACITY, AUTO_RAMP_MIN_STEP_DELTA_E, type AutoColorScale, type AutoColorScaleInput } from "./autoRamp";
|
|
44
|
-
export { PENDING_RECOVERY_WINDOW_MS, PENDING_RECOVERY_POLL_MS, PENDING_RECOVERY_FIRST_POLL_MS, PENDING_RECOVERY_FAST_PHASE_MS, PENDING_RECOVERY_MID_POLL_MS, PENDING_RECOVERY_SLOW_PHASE_MS, PENDING_RECOVERY_SLOW_POLL_MS, pendingRecoveryNextDelayMs, encodePendingGenerate, parsePendingGenerate, markerArmedBlind, isBlindMarker, servedCorrelationProves, sameMarker, decidePendingRecovery, recoveryPollRunning, recoveryOwnsTheSentence, latePickupAction, latePickupKeepsMarker, pollGiveUpKeepsMarker, pendingRecoveryRemainingMs, transportFailureShouldRecover, TRANSPORT_LOST_CHECKING_MESSAGE, GENERATION_CANCELLED_MESSAGE, recoveryAnswerIsCancelled, generationCancelledMessage, type PendingGenerateMarker, type PendingRecoveryDecision, type LatePickupAction, } from "./pendingGenerate";
|
|
44
|
+
export { PENDING_RECOVERY_WINDOW_MS, PENDING_RECOVERY_POLL_MS, PENDING_RECOVERY_FIRST_POLL_MS, PENDING_RECOVERY_FAST_PHASE_MS, PENDING_RECOVERY_MID_POLL_MS, PENDING_RECOVERY_SLOW_PHASE_MS, PENDING_RECOVERY_SLOW_POLL_MS, pendingRecoveryNextDelayMs, encodePendingGenerate, parsePendingGenerate, markerArmedBlind, isBlindMarker, servedCorrelationProves, sameMarker, decidePendingRecovery, recoveryPollRunning, recoveryOwnsTheSentence, latePickupAction, latePickupKeepsMarker, pollGiveUpKeepsMarker, pendingRecoveryRemainingMs, transportFailureShouldRecover, TRANSPORT_LOST_CHECKING_MESSAGE, GENERATION_CANCELLED_MESSAGE, recoveryAnswerIsCancelled, generationCancelledMessage, recoveryFinalOutcome, recoveryProvesNothingCharged, recoveryGiveUpRefunds, recoveryLooksUnreachable, recoveryFinalMessage, PENDING_RECOVERY_UNREACHABLE_POLLS, GENERATION_NOT_RECEIVED_MESSAGE, GENERATION_FAILED_MESSAGE, RECOVERY_UNREACHABLE_MESSAGE, type PendingGenerateMarker, type PendingRecoveryDecision, type LatePickupAction, type RecoveryFinalOutcome, } from "./pendingGenerate";
|
|
45
45
|
export { stripJsComments } from "./codeComments";
|
|
46
46
|
export { reconcileChartPick, type ChartPickReconciliation } from "./chartPick";
|
|
47
47
|
export { isDuplicateGenerate, armGenerateGuard, DUPLICATE_GENERATE_WINDOW_MS, type GenerateGuardKey, type GenerateGuardState, } from "./duplicateGenerateGuard";
|
|
@@ -147,20 +147,23 @@ export declare function latePickupAction(m: PendingGenerateMarker | null | undef
|
|
|
147
147
|
*/
|
|
148
148
|
export declare function latePickupKeepsMarker(outcome: "found" | "not-yet" | "hard-error" | "transport"): boolean;
|
|
149
149
|
/**
|
|
150
|
-
* When the 15-minute poll runs out ("window-closed"),
|
|
151
|
-
*
|
|
150
|
+
* When the 15-minute poll runs out ("window-closed"), or stops because no check could reach the
|
|
151
|
+
* service ("unreachable"), the marker STAYS for the next mount's late pickup, as long as it carries a
|
|
152
|
+
* correlation. A definitive refusal ("hard-error") or a final answer still clears it.
|
|
152
153
|
*/
|
|
153
154
|
export declare function pollGiveUpKeepsMarker(outcome: string, m: PendingGenerateMarker | null | undefined): boolean;
|
|
154
155
|
/** Milliseconds left in the recovery window from `nowMs`, floored at 0. */
|
|
155
156
|
export declare function pendingRecoveryRemainingMs(m: PendingGenerateMarker, nowMs: number): number;
|
|
156
157
|
/**
|
|
157
158
|
* Whether a transport failure on a generate should hand off to the recovery poll (true) or fall back
|
|
158
|
-
* to the ordinary retry (false).
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
159
|
+
* to the ordinary retry (false). A REAL GENERATE ALWAYS RECOVERS (2026-10-04). "No response headers"
|
|
160
|
+
* used to mean "the service never saw it", and behind a buffering proxy it never did: the proxy held
|
|
161
|
+
* the headers and the heartbeats while the service finished and charged (seen in production: every
|
|
162
|
+
* pre-header loss in a week had reached the server). A retry made a second chart; a
|
|
163
|
+
* poll by correlation costs nothing, and the server now says when nothing was received.
|
|
164
|
+
* `headersReceived` stays in the signature and decides nothing.
|
|
162
165
|
*/
|
|
163
|
-
export declare function transportFailureShouldRecover(
|
|
166
|
+
export declare function transportFailureShouldRecover(_headersReceived: boolean, genNew: boolean): boolean;
|
|
164
167
|
/**
|
|
165
168
|
* WHAT A HOST SAYS THE MOMENT A GENERATE'S CONNECTION DROPS - before it knows anything else.
|
|
166
169
|
*
|
|
@@ -189,3 +192,38 @@ export declare function recoveryAnswerIsCancelled(r: {
|
|
|
189
192
|
} | null | undefined): boolean;
|
|
190
193
|
/** The banner for a cancelled generation: the server's own sentence when it sent one, else the same words. */
|
|
191
194
|
export declare function generationCancelledMessage(serverMessage: string | null | undefined): string;
|
|
195
|
+
/**
|
|
196
|
+
* THE RECOVERY POLL'S FINAL ANSWERS (2026-10-04). A server that knows the generation ended without a
|
|
197
|
+
* chart says so with `isPollFinal` and names the ending in `pollOutcome`; isVersionNotFound rides
|
|
198
|
+
* beside it for older hosts, so this is read FIRST. null = not final. A final answer with an outcome
|
|
199
|
+
* this build does not know reads as "failed": it is final, and it claims nothing about charges.
|
|
200
|
+
*/
|
|
201
|
+
export type RecoveryFinalOutcome = "cancelled" | "failed" | "not-received";
|
|
202
|
+
export declare function recoveryFinalOutcome(r: {
|
|
203
|
+
isPollFinal?: boolean | null;
|
|
204
|
+
pollOutcome?: string | null;
|
|
205
|
+
isGenerationCancelled?: boolean | null;
|
|
206
|
+
isVersionNotFound?: boolean | null;
|
|
207
|
+
errorCode?: string | null;
|
|
208
|
+
} | null | undefined): RecoveryFinalOutcome | null;
|
|
209
|
+
/** Did the server PROVE nothing was charged? Only a cancel and a request it never received do; a
|
|
210
|
+
* failed generation's charge is its own, and a host claims nothing about it. */
|
|
211
|
+
export declare function recoveryProvesNothingCharged(o: string | null | undefined): boolean;
|
|
212
|
+
/** Does a recovery that ended this way send the refund? Only when it ended with NOTHING PAINTED and
|
|
213
|
+
* nothing proven - the window closed, the poll itself was refused, or the service could not be
|
|
214
|
+
* reached. The server holds the refund until the row exists and declines a painted chart (recover,
|
|
215
|
+
* then refund). Never for a final answer. */
|
|
216
|
+
export declare function recoveryGiveUpRefunds(outcome: string): boolean;
|
|
217
|
+
/** Polls in a row that could not reach the service, with no answer yet, that end the recovery as
|
|
218
|
+
* "unreachable" rather than waiting out the window (~32 s on the shared cadence). */
|
|
219
|
+
export declare const PENDING_RECOVERY_UNREACHABLE_POLLS = 3;
|
|
220
|
+
export declare function recoveryLooksUnreachable(transportFailuresInARow: number, everAnswered: boolean): boolean;
|
|
221
|
+
/** The server's words for the final answers, for a server that sent none and for a host that
|
|
222
|
+
* localises by code. */
|
|
223
|
+
export declare const GENERATION_NOT_RECEIVED_MESSAGE = "The charting service has no record of that request, so nothing was generated and nothing was charged. Generate again.";
|
|
224
|
+
export declare const GENERATION_FAILED_MESSAGE = "That chart didn't finish on the server, so there's nothing to show. Generate again.";
|
|
225
|
+
/** Neither the generate's answer nor any check reached us. Claims nothing about a charge: behind a
|
|
226
|
+
* proxy the generate may have arrived when the checks did not. */
|
|
227
|
+
export declare const RECOVERY_UNREACHABLE_MESSAGE = "We couldn't reach the charting service to check on your chart - it may be offline, or blocked on this network. Try again in a moment.";
|
|
228
|
+
/** The sentence for a final answer: the server's own when it sent one, else the same words. */
|
|
229
|
+
export declare function recoveryFinalMessage(o: RecoveryFinalOutcome, serverMessage: 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.65",
|
|
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",
|