@bicharts/chart-host 0.6.82 → 0.6.83
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/card.mjs +2 -2
- package/dist/{chunk-ZRSEKV4I.mjs → chunk-2XWE6YFO.mjs} +10 -10
- package/dist/{chunk-7HPVGRQ2.mjs → chunk-4KCSAHL5.mjs} +1 -1
- package/dist/{chunk-MP5S6MVW.mjs → chunk-CJNONH6V.mjs} +1 -1
- package/dist/index.mjs +14 -5
- package/dist/react.mjs +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/pendingGenerate.d.ts +18 -2
- package/package.json +1 -1
package/dist/card.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*! @bicharts/chart-host — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; Natural Earth and US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
2
|
import {
|
|
3
3
|
computeSelectionCard
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-4KCSAHL5.mjs";
|
|
5
|
+
import "./chunk-2XWE6YFO.mjs";
|
|
6
6
|
import "./chunk-GHODWOAL.mjs";
|
|
7
7
|
|
|
8
8
|
// src/selectionCardChrome.ts
|
|
@@ -1140,7 +1140,7 @@ function F3(e) {
|
|
|
1140
1140
|
function N2(e) {
|
|
1141
1141
|
let t = F3(e);
|
|
1142
1142
|
if (t.length === 0 || ne2(e) < 95) return false;
|
|
1143
|
-
let n = t.filter((
|
|
1143
|
+
let n = t.filter((u4) => te(u4) && !t3(u4)).length, o2 = t.filter((u4) => !te(u4) && !!t3(u4)).length;
|
|
1144
1144
|
return n >= 1 && n >= o2;
|
|
1145
1145
|
}
|
|
1146
1146
|
function ce(e, t) {
|
|
@@ -1185,7 +1185,7 @@ function Yn2(e, t) {
|
|
|
1185
1185
|
let n = F3(e);
|
|
1186
1186
|
if (n.length === 0) return 0;
|
|
1187
1187
|
let o2 = 0;
|
|
1188
|
-
for (let
|
|
1188
|
+
for (let u4 of n) j3(u4, t) && o2++;
|
|
1189
1189
|
return Math.round(o2 / n.length * 1e3) / 10;
|
|
1190
1190
|
}
|
|
1191
1191
|
function ee(e, t) {
|
|
@@ -1198,13 +1198,13 @@ function Qn(e, t) {
|
|
|
1198
1198
|
for (let o2 of oe(e)) t(o2) && n++;
|
|
1199
1199
|
return n;
|
|
1200
1200
|
}
|
|
1201
|
-
function Xn(e, t, n, o2,
|
|
1202
|
-
let
|
|
1201
|
+
function Xn(e, t, n, o2, u4) {
|
|
1202
|
+
let l2 = [], a3 = [], i = {}, h4 = {}, C = new Set(e), y2 = (s2) => t.map((d2) => d2[s2]);
|
|
1203
1203
|
for (let s2 of ["city", "country"]) {
|
|
1204
1204
|
let d2 = n?.[s2];
|
|
1205
1205
|
d2 && C.has(d2) && (i[s2] = d2);
|
|
1206
1206
|
}
|
|
1207
|
-
let g5 = new Set(
|
|
1207
|
+
let g5 = new Set(u4 ?? e);
|
|
1208
1208
|
for (let s2 of ["lat", "lon"]) {
|
|
1209
1209
|
let d2 = n?.[s2];
|
|
1210
1210
|
d2 && g5.has(d2) && (i[s2] = d2);
|
|
@@ -1230,13 +1230,13 @@ function Xn(e, t, n, o2, l2) {
|
|
|
1230
1230
|
let K3 = ee(S2, (G4) => !!t3(G4)), Ne2 = ee(S2, (G4) => !!t3(G4) && !ce(G4, o2));
|
|
1231
1231
|
K3 < Z2 && Ne2 < 1 || (!s2 || O4 > s2.pct) && (s2 = { name: d2, pct: O4 });
|
|
1232
1232
|
}
|
|
1233
|
-
s2 && (i.state = s2.name, p4.add(s2.name),
|
|
1233
|
+
s2 && (i.state = s2.name, p4.add(s2.name), l2.push(`state=${s2.name} (${s2.pct}% states/provinces)`));
|
|
1234
1234
|
}
|
|
1235
1235
|
if (!i.zip) for (let s2 of b4) {
|
|
1236
1236
|
if (p4.has(s2)) continue;
|
|
1237
1237
|
let d2 = y2(s2), S2 = re2(d2);
|
|
1238
1238
|
if (!(S2 < 95) && de(d2, s2) && !(Qn(d2, (O4) => r3(O4).length > 0) < Z2)) {
|
|
1239
|
-
i.zip = s2, p4.add(s2),
|
|
1239
|
+
i.zip = s2, p4.add(s2), l2.push(`zip=${s2} (${S2}% ZIP codes)`);
|
|
1240
1240
|
break;
|
|
1241
1241
|
}
|
|
1242
1242
|
}
|
|
@@ -1248,7 +1248,7 @@ function Xn(e, t, n, o2, l2) {
|
|
|
1248
1248
|
let S2 = ne2(y2(d2));
|
|
1249
1249
|
(!s2 || S2 > s2.pct) && (s2 = { name: d2, pct: S2 });
|
|
1250
1250
|
}
|
|
1251
|
-
s2 && (T2 && (a3.push(`country=${T2} (only ${ne2(y2(T2))}% of values are country identifiers; using ${s2.name} instead)`), h4.country = T2), i.country = s2.name, p4.add(s2.name),
|
|
1251
|
+
s2 && (T2 && (a3.push(`country=${T2} (only ${ne2(y2(T2))}% of values are country identifiers; using ${s2.name} instead)`), h4.country = T2), i.country = s2.name, p4.add(s2.name), l2.push(`country=${s2.name}`));
|
|
1252
1252
|
}
|
|
1253
1253
|
if (!i.city) {
|
|
1254
1254
|
let s2 = null;
|
|
@@ -1257,13 +1257,13 @@ function Xn(e, t, n, o2, l2) {
|
|
|
1257
1257
|
let S2 = y2(d2), O4 = Yn2(S2, o2);
|
|
1258
1258
|
O4 < D3 || ee(S2, (K3) => j3(K3, o2)) < Z2 || (!s2 || O4 > s2.pct) && (s2 = { name: d2, pct: O4 });
|
|
1259
1259
|
}
|
|
1260
|
-
s2 && (i.city = s2.name,
|
|
1260
|
+
s2 && (i.city = s2.name, l2.push(`city=${s2.name} (${s2.pct}% known cities)`));
|
|
1261
1261
|
}
|
|
1262
1262
|
let L4 = i.country ? y2(i.country) : [], R4 = !!i.country && N2(L4), A = R4 ? new Set(L4.map((s2) => k(s2 == null ? null : String(s2))).filter(Boolean)).size : 0, x3 = R4 && A >= 2, w4 = !!(i.lat && i.lon) && t.some((s2) => {
|
|
1263
1263
|
let d2 = +String(s2[i.lat] ?? "").trim(), S2 = +String(s2[i.lon] ?? "").trim();
|
|
1264
1264
|
return isFinite(d2) && isFinite(S2) && d2 >= -90 && d2 <= 90 && S2 >= -180 && S2 <= 180 && String(s2[i.lat] ?? "").trim() !== "" && String(s2[i.lon] ?? "").trim() !== "";
|
|
1265
1265
|
});
|
|
1266
|
-
return i.lat && i.lon && !w4 && a3.push(`lat/lon=${i.lat}/${i.lon} (no row holds a usable coordinate pair)`), i.country && !x3 && !(i.city || i.state || i.zip || w4) && 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 || w4) ? i : null, backfilled:
|
|
1266
|
+
return i.lat && i.lon && !w4 && a3.push(`lat/lon=${i.lat}/${i.lon} (no row holds a usable coordinate pair)`), i.country && !x3 && !(i.city || i.state || i.zip || w4) && 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 || w4) ? i : null, backfilled: l2, refused: a3, ...Object.keys(h4).length ? { labelFallback: h4 } : {} };
|
|
1267
1267
|
}
|
|
1268
1268
|
var r = (e, ...t) => ({ part: e, langs: Object.freeze(t) });
|
|
1269
1269
|
var ie = 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") });
|
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
formatSourceDateFor,
|
|
6
6
|
isExcelDateFormat,
|
|
7
7
|
normaliseAggregation
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-4KCSAHL5.mjs";
|
|
9
9
|
import {
|
|
10
10
|
ANNOTATION_CLASS,
|
|
11
11
|
ANNOTATION_LAYER_CLASS,
|
|
@@ -111,12 +111,12 @@ import {
|
|
|
111
111
|
toSourceRows,
|
|
112
112
|
unpinScrolledAxis,
|
|
113
113
|
valuePlacementFlag
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-CJNONH6V.mjs";
|
|
115
115
|
import {
|
|
116
116
|
_3,
|
|
117
117
|
l,
|
|
118
118
|
o
|
|
119
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-2XWE6YFO.mjs";
|
|
120
120
|
import {
|
|
121
121
|
MIN_HIT_BAND_PX,
|
|
122
122
|
SELECTION_GLYPH_CLASS,
|
|
@@ -2073,6 +2073,11 @@ function markerArmedBlind(m2) {
|
|
|
2073
2073
|
if (!m2) return false;
|
|
2074
2074
|
return (m2.h ?? m2.v - 1) <= 0;
|
|
2075
2075
|
}
|
|
2076
|
+
function markerArmedAtMs(m2) {
|
|
2077
|
+
if (!m2) return void 0;
|
|
2078
|
+
const t2 = Math.floor(m2.t);
|
|
2079
|
+
return Number.isFinite(t2) && t2 > 0 ? t2 : void 0;
|
|
2080
|
+
}
|
|
2076
2081
|
function isBlindMarker(m2) {
|
|
2077
2082
|
if (!m2) return false;
|
|
2078
2083
|
return typeof m2.c !== "string" || m2.c.trim() === "";
|
|
@@ -2131,10 +2136,11 @@ function recoveryFinalOutcome(r2) {
|
|
|
2131
2136
|
if (!r2) return null;
|
|
2132
2137
|
const o3 = String(r2.pollOutcome ?? "").trim().toLowerCase();
|
|
2133
2138
|
if (r2.isGenerationCancelled === true || r2.isPollFinal === true && o3 === "cancelled") return "cancelled";
|
|
2134
|
-
if (r2.isPollFinal === true) return o3 === "not-received" ? "not-received" : "failed";
|
|
2139
|
+
if (r2.isPollFinal === true) return o3 === "not-received" ? "not-received" : o3 === "lost-in-restart" ? "lost-in-restart" : "failed";
|
|
2135
2140
|
if (r2.isPollFinal == null && r2.isVersionNotFound === true) {
|
|
2136
2141
|
const c2 = String(r2.errorCode ?? "").trim().toUpperCase();
|
|
2137
2142
|
if (c2 === "GENERATION_NOT_RECEIVED") return "not-received";
|
|
2143
|
+
if (c2 === "GENERATION_LOST_IN_RESTART") return "lost-in-restart";
|
|
2138
2144
|
if (c2 === "GENERATION_FAILED") return "failed";
|
|
2139
2145
|
if (c2 === "GENERATION_CANCELLED") return "cancelled";
|
|
2140
2146
|
}
|
|
@@ -2152,11 +2158,12 @@ function recoveryLooksUnreachable(transportFailuresInARow, everAnswered) {
|
|
|
2152
2158
|
}
|
|
2153
2159
|
var GENERATION_NOT_RECEIVED_MESSAGE = "The charting service has no record of that request, so nothing was generated and nothing was charged. Generate again.";
|
|
2154
2160
|
var GENERATION_FAILED_MESSAGE = "That chart didn't finish on the server, so there's nothing to show. Generate again.";
|
|
2161
|
+
var GENERATION_LOST_IN_RESTART_MESSAGE = "The charting service restarted while your chart was being built, so nothing was delivered. Click Generate to build it again.";
|
|
2155
2162
|
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.";
|
|
2156
2163
|
function recoveryFinalMessage(o3, serverMessage) {
|
|
2157
2164
|
const s2 = String(serverMessage ?? "").trim();
|
|
2158
2165
|
if (s2 !== "") return s2;
|
|
2159
|
-
return o3 === "cancelled" ? GENERATION_CANCELLED_MESSAGE : o3 === "not-received" ? GENERATION_NOT_RECEIVED_MESSAGE : GENERATION_FAILED_MESSAGE;
|
|
2166
|
+
return o3 === "cancelled" ? GENERATION_CANCELLED_MESSAGE : o3 === "not-received" ? GENERATION_NOT_RECEIVED_MESSAGE : o3 === "lost-in-restart" ? GENERATION_LOST_IN_RESTART_MESSAGE : GENERATION_FAILED_MESSAGE;
|
|
2160
2167
|
}
|
|
2161
2168
|
|
|
2162
2169
|
// src/chartPick.ts
|
|
@@ -2339,6 +2346,7 @@ export {
|
|
|
2339
2346
|
FLIP_MODE_DEFAULT,
|
|
2340
2347
|
GENERATION_CANCELLED_MESSAGE,
|
|
2341
2348
|
GENERATION_FAILED_MESSAGE,
|
|
2349
|
+
GENERATION_LOST_IN_RESTART_MESSAGE,
|
|
2342
2350
|
GENERATION_NOT_RECEIVED_MESSAGE,
|
|
2343
2351
|
GEO_POINT_PRECISIONS,
|
|
2344
2352
|
GLYPH_SAMPLE_N,
|
|
@@ -2498,6 +2506,7 @@ export {
|
|
|
2498
2506
|
loadGeo,
|
|
2499
2507
|
markDefaultModel,
|
|
2500
2508
|
markKeyOf,
|
|
2509
|
+
markerArmedAtMs,
|
|
2501
2510
|
markerArmedBlind,
|
|
2502
2511
|
measureContainerBoxes,
|
|
2503
2512
|
minContrastOver,
|
package/dist/react.mjs
CHANGED
|
@@ -22,8 +22,8 @@ import {
|
|
|
22
22
|
loadGeo,
|
|
23
23
|
syncMemberSelection,
|
|
24
24
|
toSourceRows
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-CJNONH6V.mjs";
|
|
26
|
+
import "./chunk-2XWE6YFO.mjs";
|
|
27
27
|
import "./chunk-MGAO2DR7.mjs";
|
|
28
28
|
import "./chunk-A2GMXZP7.mjs";
|
|
29
29
|
import "./chunk-7JWL6LYE.mjs";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export { pinScrolledAxis, unpinScrolledAxis, type AxisPinReport } from "./fitDom
|
|
|
44
44
|
export { MIN_DELTA_E, pickDistinctColorFromSeed, buildPalette, buildPaletteFromSeed, orderMostDistinct, LEGIBLE_LIGHTNESS, type PaletteResult, type SeedForSlot, type PaletteOptions, } from "./palette";
|
|
45
45
|
export { deltaEHex } from "./deltaE";
|
|
46
46
|
export { resolveAutoColorScale, autoRampMinStep, autoRampCanvas, AUTO_RAMP_CLASSES, AUTO_RAMP_DRAWN_OPACITY, AUTO_RAMP_MIN_STEP_DELTA_E, type AutoColorScale, type AutoColorScaleInput } from "./autoRamp";
|
|
47
|
-
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";
|
|
47
|
+
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, markerArmedAtMs, 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, GENERATION_LOST_IN_RESTART_MESSAGE, RECOVERY_UNREACHABLE_MESSAGE, type PendingGenerateMarker, type PendingRecoveryDecision, type LatePickupAction, type RecoveryFinalOutcome, } from "./pendingGenerate";
|
|
48
48
|
export { stripJsComments } from "./codeComments";
|
|
49
49
|
export { reconcileChartPick, type ChartPickReconciliation } from "./chartPick";
|
|
50
50
|
export { isDuplicateGenerate, armGenerateGuard, DUPLICATE_GENERATE_WINDOW_MS, type GenerateGuardKey, type GenerateGuardState, } from "./duplicateGenerateGuard";
|
|
@@ -55,6 +55,17 @@ export type PendingRecoveryDecision = "none" | "delivered" | "expired" | "blind"
|
|
|
55
55
|
* `v - 1` fallback says the same thing for markers written by older builds.
|
|
56
56
|
*/
|
|
57
57
|
export declare function markerArmedBlind(m: PendingGenerateMarker | null | undefined): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* WHEN THIS MARKER'S GENERATE STARTED, as a recovery poll states it: the marker's own `t`, epoch milliseconds on
|
|
60
|
+
* this host's clock, as a whole number - the `fetchArmedAtMs` a poll by correlation passes to `fetchFields`.
|
|
61
|
+
*
|
|
62
|
+
* With it the server can tell a generate that died with a server restart (started before the running process,
|
|
63
|
+
* no record of it) from one still running, and say so at the first poll instead of after the whole window.
|
|
64
|
+
* Nothing is shifted or checked against the clock here: a slow or fast host clock is the server's margin to
|
|
65
|
+
* absorb, and a future time it reads as absent. undefined for no marker or a time that is not a positive
|
|
66
|
+
* number, so the poll sends exactly what it always sent.
|
|
67
|
+
*/
|
|
68
|
+
export declare function markerArmedAtMs(m: PendingGenerateMarker | null | undefined): number | undefined;
|
|
58
69
|
/**
|
|
59
70
|
* Can this marker be recovered AT ALL? Only by CORRELATION, so only if it carries one.
|
|
60
71
|
*
|
|
@@ -198,7 +209,7 @@ export declare function generationCancelledMessage(serverMessage: string | null
|
|
|
198
209
|
* beside it for older hosts, so this is read FIRST. null = not final. A final answer with an outcome
|
|
199
210
|
* this build does not know reads as "failed": it is final, and it claims nothing about charges.
|
|
200
211
|
*/
|
|
201
|
-
export type RecoveryFinalOutcome = "cancelled" | "failed" | "not-received";
|
|
212
|
+
export type RecoveryFinalOutcome = "cancelled" | "failed" | "not-received" | "lost-in-restart";
|
|
202
213
|
export declare function recoveryFinalOutcome(r: {
|
|
203
214
|
isPollFinal?: boolean | null;
|
|
204
215
|
pollOutcome?: string | null;
|
|
@@ -207,7 +218,8 @@ export declare function recoveryFinalOutcome(r: {
|
|
|
207
218
|
errorCode?: string | null;
|
|
208
219
|
} | null | undefined): RecoveryFinalOutcome | null;
|
|
209
220
|
/** 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
|
|
221
|
+
* failed generation's charge is its own, and a generate that died with a restart may have been charged
|
|
222
|
+
* before its record was written, so a host claims nothing about either. */
|
|
211
223
|
export declare function recoveryProvesNothingCharged(o: string | null | undefined): boolean;
|
|
212
224
|
/** Does a recovery that ended this way send the refund? Only when it ended with NOTHING PAINTED and
|
|
213
225
|
* nothing proven - the window closed, the poll itself was refused, or the service could not be
|
|
@@ -222,6 +234,10 @@ export declare function recoveryLooksUnreachable(transportFailuresInARow: number
|
|
|
222
234
|
* localises by code. */
|
|
223
235
|
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
236
|
export declare const GENERATION_FAILED_MESSAGE = "That chart didn't finish on the server, so there's nothing to show. Generate again.";
|
|
237
|
+
/** The process that was building the chart is gone, so nothing will arrive. Says what happened and what to
|
|
238
|
+
* do, and claims nothing about a charge: a free-tier meter can be charged before the generation's record
|
|
239
|
+
* exists, so a restart in between can leave a charge that no record shows. */
|
|
240
|
+
export declare const GENERATION_LOST_IN_RESTART_MESSAGE = "The charting service restarted while your chart was being built, so nothing was delivered. Click Generate to build it again.";
|
|
225
241
|
/** Neither the generate's answer nor any check reached us. Claims nothing about a charge: behind a
|
|
226
242
|
* proxy the generate may have arrived when the checks did not. */
|
|
227
243
|
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.";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/chart-host",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.83",
|
|
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",
|