@bicharts/chart-host 0.5.118 → 0.5.120
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-2UU3N4AG.mjs → chunk-CNFVXCOY.mjs} +472 -320
- package/dist/index.mjs +44 -4
- package/dist/react.mjs +1 -1
- package/dist/types/chartPick.d.ts +28 -0
- package/dist/types/codeComments.d.ts +27 -0
- package/dist/types/contract.d.ts +5 -1
- package/dist/types/index.d.ts +4 -2
- package/dist/types/pendingGenerate.d.ts +28 -0
- package/dist/types/selectionCard.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -64,6 +64,7 @@ import {
|
|
|
64
64
|
SELECTION_ACTIVE_CLASS,
|
|
65
65
|
VALUE_AXIS_BASELINE_DEFAULT,
|
|
66
66
|
VALUE_AXIS_MIN_FIT,
|
|
67
|
+
VIEW_ONLY_UI_STATE_KEYS,
|
|
67
68
|
WHITE_TEXT_BG_LUM,
|
|
68
69
|
XFILTER_REFRESH_EVENT,
|
|
69
70
|
Xt,
|
|
@@ -126,11 +127,13 @@ import {
|
|
|
126
127
|
scrollFitFor,
|
|
127
128
|
sessionViewStateProvider,
|
|
128
129
|
stripEsmExports,
|
|
130
|
+
stripJsComments,
|
|
129
131
|
svgInkReach,
|
|
130
132
|
toRGBA,
|
|
131
133
|
unpinScrolledAxis,
|
|
132
|
-
valuePlacementFlag
|
|
133
|
-
|
|
134
|
+
valuePlacementFlag,
|
|
135
|
+
withoutViewOnlyKeys
|
|
136
|
+
} from "./chunk-CNFVXCOY.mjs";
|
|
134
137
|
import "./chunk-A2GMXZP7.mjs";
|
|
135
138
|
import "./chunk-GHODWOAL.mjs";
|
|
136
139
|
|
|
@@ -1391,6 +1394,11 @@ function aggLabel(agg) {
|
|
|
1391
1394
|
return "Sum";
|
|
1392
1395
|
}
|
|
1393
1396
|
}
|
|
1397
|
+
function measureLineLabel(agg, name2) {
|
|
1398
|
+
const col = String(name2 ?? "");
|
|
1399
|
+
const prefix = aggLabel(agg) + " of ";
|
|
1400
|
+
return col.trim().toLowerCase().startsWith(prefix.toLowerCase()) ? col.trim() : prefix + col;
|
|
1401
|
+
}
|
|
1394
1402
|
function isSynthetic(name2) {
|
|
1395
1403
|
return String(name2 ?? "").startsWith(SYNTHETIC_PREFIX);
|
|
1396
1404
|
}
|
|
@@ -1542,7 +1550,7 @@ function computeSelectionCard(payload, selectedRowIdxs, opts = {}) {
|
|
|
1542
1550
|
}
|
|
1543
1551
|
lines.push({
|
|
1544
1552
|
column: String(col?.name ?? ""),
|
|
1545
|
-
label:
|
|
1553
|
+
label: measureLineLabel(colAgg, String(col?.name ?? "")),
|
|
1546
1554
|
value,
|
|
1547
1555
|
valueText: value == null ? "\u2014" : fmtNumber(value, opts.cultureCode),
|
|
1548
1556
|
sharePct,
|
|
@@ -2343,6 +2351,30 @@ function pendingRecoveryRemainingMs(m2, nowMs) {
|
|
|
2343
2351
|
function transportFailureShouldRecover(headersReceived, genNew) {
|
|
2344
2352
|
return headersReceived && genNew;
|
|
2345
2353
|
}
|
|
2354
|
+
var TRANSPORT_LOST_CHECKING_MESSAGE = "The connection dropped while your chart was being generated - checking whether it finished on the server...";
|
|
2355
|
+
var GENERATION_CANCELLED_MESSAGE = "The connection dropped before the chart finished - nothing was charged. Generate again.";
|
|
2356
|
+
function recoveryAnswerIsCancelled(r2) {
|
|
2357
|
+
return !!r2 && r2.isGenerationCancelled === true;
|
|
2358
|
+
}
|
|
2359
|
+
function generationCancelledMessage(serverMessage) {
|
|
2360
|
+
const s2 = String(serverMessage ?? "").trim();
|
|
2361
|
+
return s2 !== "" ? s2 : GENERATION_CANCELLED_MESSAGE;
|
|
2362
|
+
}
|
|
2363
|
+
|
|
2364
|
+
// src/chartPick.ts
|
|
2365
|
+
function reconcileChartPick(pick, offered, autoLabel) {
|
|
2366
|
+
const want = String(pick ?? "").trim();
|
|
2367
|
+
if (!want) return { pick: "", dropped: false, message: "" };
|
|
2368
|
+
const names = (offered || []).map((n2) => String(n2 ?? "").trim()).filter((n2) => n2 !== "");
|
|
2369
|
+
if (names.length === 0) return { pick: want, dropped: false, message: "" };
|
|
2370
|
+
const key = want.toLowerCase();
|
|
2371
|
+
if (names.some((n2) => n2.toLowerCase() === key)) return { pick: want, dropped: false, message: "" };
|
|
2372
|
+
return {
|
|
2373
|
+
pick: "",
|
|
2374
|
+
dropped: true,
|
|
2375
|
+
message: `${want} no longer fits this selection, so the chart type is back to "${autoLabel}". Pick another from the list if you want to force one.`
|
|
2376
|
+
};
|
|
2377
|
+
}
|
|
2346
2378
|
|
|
2347
2379
|
// src/index.ts
|
|
2348
2380
|
function registerCityTable(packed) {
|
|
@@ -2387,6 +2419,7 @@ export {
|
|
|
2387
2419
|
FILTER_ROW_PX,
|
|
2388
2420
|
FIT_CONTENT_SELECTOR,
|
|
2389
2421
|
FLIP_MODE_DEFAULT,
|
|
2422
|
+
GENERATION_CANCELLED_MESSAGE,
|
|
2390
2423
|
GEO_POINT_PRECISIONS,
|
|
2391
2424
|
GLYPH_SAMPLE_N,
|
|
2392
2425
|
HOST_CONTAINER_CLASS,
|
|
@@ -2426,8 +2459,10 @@ export {
|
|
|
2426
2459
|
SCROLL_SLACK_PX,
|
|
2427
2460
|
SEASONAL_MARKERS_DEFAULT,
|
|
2428
2461
|
SELECTION_ACTIVE_CLASS,
|
|
2462
|
+
TRANSPORT_LOST_CHECKING_MESSAGE,
|
|
2429
2463
|
VALUE_AXIS_BASELINE_DEFAULT,
|
|
2430
2464
|
VALUE_AXIS_MIN_FIT,
|
|
2465
|
+
VIEW_ONLY_UI_STATE_KEYS,
|
|
2431
2466
|
WHITE_TEXT_BG_LUM,
|
|
2432
2467
|
XFILTER_REFRESH_EVENT,
|
|
2433
2468
|
actionFor,
|
|
@@ -2480,6 +2515,7 @@ export {
|
|
|
2480
2515
|
fitRenderedChart,
|
|
2481
2516
|
formatSourceDate,
|
|
2482
2517
|
formatSourceDateFor,
|
|
2518
|
+
generationCancelledMessage,
|
|
2483
2519
|
geoAssetFor,
|
|
2484
2520
|
geoFromCache,
|
|
2485
2521
|
glyphSampleGrid,
|
|
@@ -2537,6 +2573,8 @@ export {
|
|
|
2537
2573
|
rasterizeSvgToPngDataUrl,
|
|
2538
2574
|
readQualifyChartRow,
|
|
2539
2575
|
readQualifyRefusalRow,
|
|
2576
|
+
reconcileChartPick,
|
|
2577
|
+
recoveryAnswerIsCancelled,
|
|
2540
2578
|
recoveryOwnsTheSentence,
|
|
2541
2579
|
recoveryPollRunning,
|
|
2542
2580
|
refusalIsSelectable,
|
|
@@ -2555,6 +2593,7 @@ export {
|
|
|
2555
2593
|
shouldOpenInlineChooserOnGenerate,
|
|
2556
2594
|
shouldReview,
|
|
2557
2595
|
stripEsmExports,
|
|
2596
|
+
stripJsComments,
|
|
2558
2597
|
svgInkReach,
|
|
2559
2598
|
svgNaturalSize,
|
|
2560
2599
|
svgToDataUrl,
|
|
@@ -2562,5 +2601,6 @@ export {
|
|
|
2562
2601
|
transportFailureShouldRecover,
|
|
2563
2602
|
unpinScrolledAxis,
|
|
2564
2603
|
valuePlacementFlag,
|
|
2565
|
-
vegaSpecReadsDatesInLocalTime
|
|
2604
|
+
vegaSpecReadsDatesInLocalTime,
|
|
2605
|
+
withoutViewOnlyKeys
|
|
2566
2606
|
};
|
package/dist/react.mjs
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A standing chart-type pick, checked against a FRESH qualify list.
|
|
3
|
+
*
|
|
4
|
+
* A reader's explicit pick can outlive the generate it was made for - a host that keeps it across a
|
|
5
|
+
* refusal that spent nothing, or one whose pick is a standing control by design. Either way the fields
|
|
6
|
+
* can change underneath it, and a pick the data no longer supports would otherwise cost a generate to
|
|
7
|
+
* discover: the substitution warning arrives after the credit, not before it.
|
|
8
|
+
*
|
|
9
|
+
* ONLY AGAINST A FRESH LIST, and only against the server's own answer. The list is what the qualify
|
|
10
|
+
* endpoint says fits the data as it is now; checking the pick against a client-side re-implementation of
|
|
11
|
+
* the shape gates would be a second opinion quietly disagreeing with the engine.
|
|
12
|
+
*
|
|
13
|
+
* AN EMPTY LIST IS NOT EVIDENCE THE PICK DIED. It is the shape qualifying for nothing, which has its own
|
|
14
|
+
* message and its own fix; dropping the pick there would add a second, misleading sentence.
|
|
15
|
+
*
|
|
16
|
+
* A DROP IS ALWAYS SAID. The message names the type and what the pick went back to, so a pick never
|
|
17
|
+
* disappears silently. `offered` is every name the host would let the reader pick right now - a host whose
|
|
18
|
+
* list also offers poor-fit types to pick anyway passes those too, because the pick is still choosable.
|
|
19
|
+
*/
|
|
20
|
+
export interface ChartPickReconciliation {
|
|
21
|
+
/** The pick after reconciling: the original (trimmed) when still offered, else "" (no pick). */
|
|
22
|
+
pick: string;
|
|
23
|
+
/** True when a pick was dropped because the fresh list no longer offers it. */
|
|
24
|
+
dropped: boolean;
|
|
25
|
+
/** What to tell the reader when `dropped`; "" otherwise. */
|
|
26
|
+
message: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function reconcileChartPick(pick: string | null | undefined, offered: readonly (string | null | undefined)[], autoLabel: string): ChartPickReconciliation;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated chart code with its JavaScript COMMENTS removed, and nothing else.
|
|
3
|
+
*
|
|
4
|
+
* WHY A HOST NEEDS THIS. A host decides from the code which optional libraries a chart needs before
|
|
5
|
+
* running it (see `requiredD3Plugins`), and a word in a comment is not a call. The helpers a generator
|
|
6
|
+
* prepends to every chart are documented in prose, and prose names things: one helper's comment listed the
|
|
7
|
+
* chart types it serves, "Basic Sankey" among them, so every chart carrying it - bar charts, cards,
|
|
8
|
+
* tables - read as needing the Sankey plugin, and a host fetched a library it would never call on every
|
|
9
|
+
* render.
|
|
10
|
+
*
|
|
11
|
+
* NOT THE NAIVE STRIP, ON PURPOSE. A regex that deletes from `//` to the end of the line also deletes from
|
|
12
|
+
* the `//` inside "https://..." to the end of that line - taking any real code after the string with it.
|
|
13
|
+
* For a check that can only ever REMOVE evidence, over-stripping is the dangerous direction: a plugin name
|
|
14
|
+
* lost that way is a chart failing several frames deep. So this walks the code once, tracking the three
|
|
15
|
+
* places a comment marker is not a comment - a string, a template literal (including code inside its
|
|
16
|
+
* `${...}`), and a regular-expression literal - and removes only what is genuinely a comment.
|
|
17
|
+
*
|
|
18
|
+
* THE ONE AMBIGUITY - is a `/` a division or the start of a regex? - is settled by the usual rule: what
|
|
19
|
+
* came before it. A division misread as a regex only keeps text (the comments after it, up to the next `/`
|
|
20
|
+
* on that line, stay in the output). The reverse - a regex literal that opens a statement right after `)`
|
|
21
|
+
* or `}` - is read as a division, and would lose text only if that regex itself contained `//` or `/*`.
|
|
22
|
+
* Generated chart code does not write that form; it is named here so nobody has to rediscover it.
|
|
23
|
+
*
|
|
24
|
+
* A removed comment is replaced by a single space, keeping any newlines a block comment spanned, so tokens
|
|
25
|
+
* either side never fuse and line numbers are preserved.
|
|
26
|
+
*/
|
|
27
|
+
export declare function stripJsComments(code: string): string;
|
package/dist/types/contract.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const HOST_CONTRACT_VERSION = "1.
|
|
1
|
+
export declare const HOST_CONTRACT_VERSION = "1.11.0";
|
|
2
2
|
export type GeoPointPrecision = "latlon" | "city" | "zip3" | "state" | "country";
|
|
3
3
|
/** Every valid tier, ordered most precise → coarsest. Runtime form of GeoPointPrecision. */
|
|
4
4
|
export declare const GEO_POINT_PRECISIONS: readonly GeoPointPrecision[];
|
|
@@ -17,6 +17,10 @@ export declare const CONTAINER_SLOT_ANIM_STOP = "__llmAnimStop";
|
|
|
17
17
|
export declare const CONTAINER_SLOT_XF_CLEAR = "__llmXfClear";
|
|
18
18
|
export declare const CONTAINER_SLOT_INITIAL_XF_MARK = "__llmInitialXfMark";
|
|
19
19
|
export declare const CONTAINER_SLOT_UI_STATE = "__lchUiState";
|
|
20
|
+
export declare const VIEW_ONLY_UI_STATE_KEYS: readonly string[];
|
|
21
|
+
/** The bag with every view-only key removed: what a host persists when the reader has not asked
|
|
22
|
+
* for their view to be remembered. Returns the SAME object when there was nothing to remove. */
|
|
23
|
+
export declare function withoutViewOnlyKeys<T extends Record<string, unknown>>(bag: T): T;
|
|
20
24
|
/**
|
|
21
25
|
* WHERE A CHART'S RESTING VIEW-STATE LIVES between draws (contract 1.6.0).
|
|
22
26
|
*
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { HOST_CONTRACT_VERSION, GEO_POINT_PRECISIONS, MARK_CLASS, LEGEND_MARK_CLASS, AXIS_FILTER_CLASS, ROW_IDX_ATTR, LIFT_SELECTED_CLASS, XFILTER_REFRESH_EVENT, CONTAINER_SLOT_ANIM_STOP, CONTAINER_SLOT_XF_CLEAR, CONTAINER_SLOT_INITIAL_XF_MARK, CONTAINER_SLOT_UI_STATE, HOST_CONTAINER_CLASS, SELECTION_ACTIVE_CLASS, MARK_SELECTED_CLASS, ACTIVE_TICK_CLASS, DIM_OPACITY_VAR, DIM_OPACITY_DEFAULT, chartOwnsTimeline, periodTickSuppressesFeedback, ANIM_PLAY_SPEED_DEFAULT, ANIM_PLAY_SPEED_MIN, ANIM_PLAY_SPEED_MAX, ANIM_LOOP_DELAY_DEFAULT, ANIM_LOOP_DELAY_MIN, ANIM_MAX_IDEAL_FRAMES_DEFAULT, ANIM_MAX_IDEAL_FRAMES_MIN, ANIM_MAX_IDEAL_FRAMES_MAX, ANIMATION_OPTION_KEYS, COLOR_SCALE_SELF_CLAMP_PCT_DEFAULT, COLOR_SCALE_SELF_CLAMP_PCT_MIN, COLOR_SCALE_SELF_CLAMP_PCT_MAX, FLIP_MODE_DEFAULT, APPROXIMATE_POSITIONS_DEFAULT, VALUE_AXIS_BASELINE_DEFAULT, SEASONAL_MARKERS_DEFAULT, MAX_MAP_POINTS_DEFAULT, type GeoPointPrecision, type GeoMapKind, type TimelineStyle, type FlipMode, type ApproximatePositions, type ValueAxisBaseline, type SeasonalMarkers, type ColorScaleScope, type RenderOptions, type ViewStateProvider, type ChartControlChange, } from "./contract";
|
|
1
|
+
export { HOST_CONTRACT_VERSION, GEO_POINT_PRECISIONS, MARK_CLASS, LEGEND_MARK_CLASS, AXIS_FILTER_CLASS, ROW_IDX_ATTR, LIFT_SELECTED_CLASS, XFILTER_REFRESH_EVENT, CONTAINER_SLOT_ANIM_STOP, CONTAINER_SLOT_XF_CLEAR, CONTAINER_SLOT_INITIAL_XF_MARK, CONTAINER_SLOT_UI_STATE, VIEW_ONLY_UI_STATE_KEYS, withoutViewOnlyKeys, HOST_CONTAINER_CLASS, SELECTION_ACTIVE_CLASS, MARK_SELECTED_CLASS, ACTIVE_TICK_CLASS, DIM_OPACITY_VAR, DIM_OPACITY_DEFAULT, chartOwnsTimeline, periodTickSuppressesFeedback, ANIM_PLAY_SPEED_DEFAULT, ANIM_PLAY_SPEED_MIN, ANIM_PLAY_SPEED_MAX, ANIM_LOOP_DELAY_DEFAULT, ANIM_LOOP_DELAY_MIN, ANIM_MAX_IDEAL_FRAMES_DEFAULT, ANIM_MAX_IDEAL_FRAMES_MIN, ANIM_MAX_IDEAL_FRAMES_MAX, ANIMATION_OPTION_KEYS, COLOR_SCALE_SELF_CLAMP_PCT_DEFAULT, COLOR_SCALE_SELF_CLAMP_PCT_MIN, COLOR_SCALE_SELF_CLAMP_PCT_MAX, FLIP_MODE_DEFAULT, APPROXIMATE_POSITIONS_DEFAULT, VALUE_AXIS_BASELINE_DEFAULT, SEASONAL_MARKERS_DEFAULT, MAX_MAP_POINTS_DEFAULT, type GeoPointPrecision, type GeoMapKind, type TimelineStyle, type FlipMode, type ApproximatePositions, type ValueAxisBaseline, type SeasonalMarkers, type ColorScaleScope, type RenderOptions, type ViewStateProvider, type ChartControlChange, } from "./contract";
|
|
2
2
|
export { resolveOptions, type ResolveOptionsInput } from "./defaults";
|
|
3
3
|
export { loadGeo, geoFromCache, registerGeo, registerGeoAsset, geoAssetFor, clearGeoCache, type GeoAssetName, } from "./geoLazy";
|
|
4
4
|
/** REPLACE the bundled city gazetteer with another packed table. Rarely needed — see the
|
|
@@ -34,4 +34,6 @@ export { pinScrolledAxis, unpinScrolledAxis, type AxisPinReport } from "./fitDom
|
|
|
34
34
|
export { MIN_DELTA_E, pickDistinctColorFromSeed, buildPalette, buildPaletteFromSeed, orderMostDistinct, LEGIBLE_LIGHTNESS, type PaletteResult, type SeedForSlot, type PaletteOptions, } from "./palette";
|
|
35
35
|
export { deltaEHex } from "./deltaE";
|
|
36
36
|
export { resolveAutoColorScale, autoRampMinStep, autoRampCanvas, AUTO_RAMP_CLASSES, AUTO_RAMP_DRAWN_OPACITY, AUTO_RAMP_MIN_STEP_DELTA_E, type AutoColorScale, type AutoColorScaleInput } from "./autoRamp";
|
|
37
|
-
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, type PendingGenerateMarker, type PendingRecoveryDecision, type LatePickupAction, } from "./pendingGenerate";
|
|
37
|
+
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";
|
|
38
|
+
export { stripJsComments } from "./codeComments";
|
|
39
|
+
export { reconcileChartPick, type ChartPickReconciliation } from "./chartPick";
|
|
@@ -161,3 +161,31 @@ export declare function pendingRecoveryRemainingMs(m: PendingGenerateMarker, now
|
|
|
161
161
|
* headers means the service never saw it, and retrying is the right move.
|
|
162
162
|
*/
|
|
163
163
|
export declare function transportFailureShouldRecover(headersReceived: boolean, genNew: boolean): boolean;
|
|
164
|
+
/**
|
|
165
|
+
* WHAT A HOST SAYS THE MOMENT A GENERATE'S CONNECTION DROPS - before it knows anything else.
|
|
166
|
+
*
|
|
167
|
+
* It used to promise the chart ("it is still being built on the server ... will show it when it lands").
|
|
168
|
+
* That was never something the host had observed: the server takes a dropped connection as a cancel at its
|
|
169
|
+
* next safe boundary, charges nothing and hands the slot back, so the chart the reader was promised was
|
|
170
|
+
* frequently never going to arrive - and a poll then waited out its whole window for it. The honest sentence
|
|
171
|
+
* is the one that names only what is known: the connection dropped, and the host is checking.
|
|
172
|
+
*/
|
|
173
|
+
export declare const TRANSPORT_LOST_CHECKING_MESSAGE = "The connection dropped while your chart was being generated - checking whether it finished on the server...";
|
|
174
|
+
/**
|
|
175
|
+
* The words for a recovery answer that says the generation was cancelled, when the server sent none of its
|
|
176
|
+
* own. The server's errorMessage is preferred - it is the one author of the sentence - and this is the same
|
|
177
|
+
* sentence, for a server that set the flag and left the message blank.
|
|
178
|
+
*/
|
|
179
|
+
export declare const GENERATION_CANCELLED_MESSAGE = "The connection dropped before the chart finished - nothing was charged. Generate again.";
|
|
180
|
+
/**
|
|
181
|
+
* Is this recovery answer the server saying the generation was CANCELLED - so nothing will ever be ready?
|
|
182
|
+
*
|
|
183
|
+
* A terminal answer, not a "not yet": the poll stops, the reader is told, and Generate is theirs again. A
|
|
184
|
+
* server that predates the field sends only isVersionNotFound for the same row, which keeps a host polling
|
|
185
|
+
* until its window closes - the old behaviour, no worse. The field's presence is the capability.
|
|
186
|
+
*/
|
|
187
|
+
export declare function recoveryAnswerIsCancelled(r: {
|
|
188
|
+
isGenerationCancelled?: boolean | null;
|
|
189
|
+
} | null | undefined): boolean;
|
|
190
|
+
/** The banner for a cancelled generation: the server's own sentence when it sent one, else the same words. */
|
|
191
|
+
export declare function generationCancelledMessage(serverMessage: string | null | undefined): string;
|
|
@@ -84,6 +84,13 @@ type Agg = "sum" | "average" | "min" | "max" | "count" | "median" | "distinctcou
|
|
|
84
84
|
* spellings fall back to sum rather than throwing: a card is a courtesy, and refusing to draw
|
|
85
85
|
* one because a host wrote "Total" is a worse outcome than summing. */
|
|
86
86
|
export declare function normaliseAggregation(raw: string | undefined | null): Agg;
|
|
87
|
+
/** THE LINE'S LABEL: "<aggregation> of <column>", unless the column's name already says it.
|
|
88
|
+
* An Excel table copied from a pivot, or a Power BI implicit measure, arrives with a column
|
|
89
|
+
* named "Sum of Orders"; composing onto that printed "Sum of Sum of Orders" (dev, Excel add-in
|
|
90
|
+
* 1.0.0.47, a click on the order-fulfilment chart). Only the SAME aggregation's words are
|
|
91
|
+
* dropped: "Average of Sum of Orders" is a true statement - it averages per-row sums - and
|
|
92
|
+
* stays composed. */
|
|
93
|
+
export declare function measureLineLabel(agg: Agg, name: string): string;
|
|
87
94
|
/**
|
|
88
95
|
* The card for a selection, or NULL when there is nothing to say.
|
|
89
96
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/chart-host",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.120",
|
|
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",
|