@orangecharts/wrun-chart-host 0.3.0 → 0.4.0
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/README.md +11 -5
- package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +133 -0
- package/dist/constants/scriptEditor/builtin-script-snippets.js +451 -0
- package/dist/host-env.d.ts +8 -6
- package/dist/host-ports.types.d.ts +7 -22
- package/dist/index.d.ts +10 -0
- package/dist/index.js +10 -0
- package/dist/utility/chart/date-labelled-interval.leaf.d.ts +15 -0
- package/dist/utility/chart/date-labelled-interval.leaf.js +19 -0
- package/dist/utility/chart/indicator-run-interval.util.d.ts +130 -0
- package/dist/utility/chart/indicator-run-interval.util.js +268 -0
- package/dist/utility/chart/window-geometry.leaf.d.ts +119 -0
- package/dist/utility/chart/window-geometry.leaf.js +391 -0
- package/dist/utility/chart/window-owner.leaf.d.ts +19 -0
- package/dist/utility/chart/window-owner.leaf.js +24 -0
- package/dist/utility/html-escape.leaf.d.ts +11 -0
- package/dist/utility/html-escape.leaf.js +20 -0
- package/dist/utility/wrun/sources/lanes/option_daily.d.ts +43 -15
- package/dist/utility/wrun/sources/lanes/option_daily.js +78 -20
- package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +14 -10
- package/dist/utility/wrun/sources/lanes/option_stats_10m.js +5 -4
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +22 -3
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +38 -7
- package/dist/utility/wrun/sources/registry.js +31 -1
- package/dist/utility/wrun/sources/row-lane-registry.js +5 -5
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +49 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +74 -18
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +49 -0
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +57 -47
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +36 -4
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +6 -12
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +37 -3
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +128 -2
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +233 -51
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +0 -8
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +26 -24
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +85 -104
- package/dist/utility/wrun/wrun-opra-stats.leaf.d.ts +29 -10
- package/dist/utility/wrun/wrun-opra-stats.leaf.js +29 -10
- package/dist/utility/wrun/wrun-panel-mount.lazy.d.ts +10 -0
- package/dist/utility/wrun/wrun-panel-mount.lazy.js +68 -0
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +377 -0
- package/dist/utility/wrun/wrun-panel-mount.util.js +2251 -0
- package/dist/utility/wrun/wrun-pause-dim.util.d.ts +52 -0
- package/dist/utility/wrun/wrun-pause-dim.util.js +153 -0
- package/dist/utility/wrun/wrun-plot-gate.types.d.ts +23 -0
- package/dist/utility/wrun/wrun-plot-gate.types.js +7 -0
- package/dist/utility/wrun/wrun-run-interval-projection.types.d.ts +14 -0
- package/dist/utility/wrun/wrun-run-interval-projection.types.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
import { type KScriptLegendEntry } from '../chart/kscript-legend-entries.util.js';
|
|
2
|
+
import { type EnginePanelHooks } from '../chart/om-panel.util.js';
|
|
3
|
+
import { wrunSeriesChildId, type WrunRunResult } from '../chart/wrun-run-result.util.js';
|
|
4
|
+
import { type WrunBuiltinTwin, type WrunPaneFormatChart } from './wrun-pane-format.util.js';
|
|
5
|
+
import type { WrunRunIntervalProjection } from './wrun-run-interval-projection.types.js';
|
|
6
|
+
interface WrunOverlayConfig {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
plot: string;
|
|
10
|
+
type: 'onchart' | 'offchart';
|
|
11
|
+
interval: number;
|
|
12
|
+
data: unknown[][];
|
|
13
|
+
/** The meta-level axis label formatter (titan consults it before its own
|
|
14
|
+
* digit default): the lower pane prints K/M/B from 1K and its own step
|
|
15
|
+
* digits below (wrun-pane-format.util); a panel with a declared format
|
|
16
|
+
* prints its ticks through its own formatter (SC08). */
|
|
17
|
+
getYLabel?: (price: number) => string;
|
|
18
|
+
/** A panel's number formatter for every value the pane prints (SC08):
|
|
19
|
+
* the engine reads it off the meta. */
|
|
20
|
+
formatDomainValue?: EnginePanelHooks['formatDomainValue'];
|
|
21
|
+
/** The dynamic legend readout (the store stamps the technical-script
|
|
22
|
+
* control's on every indicator overlay; the lower pane brings its own,
|
|
23
|
+
* wrunSeriesChildLegendText). */
|
|
24
|
+
getLegendText?: (point: number[] | undefined, meta: unknown) => KScriptLegendEntry[];
|
|
25
|
+
/** The static legend content: titan creates one span per entry at
|
|
26
|
+
* addOverlay time and drops updates for ids it never created, so every
|
|
27
|
+
* slot getLegendText may address is born here (the parent's rule). */
|
|
28
|
+
initLegendText?: () => Array<KScriptLegendEntry & {
|
|
29
|
+
isStatic: boolean;
|
|
30
|
+
}>;
|
|
31
|
+
/** The pane's y bounds come from its OWN rows only (the flag the store
|
|
32
|
+
* stamps on every indicator overlay); without it titan also walks the
|
|
33
|
+
* main series through the pane's extractors and an RSI pane scales to
|
|
34
|
+
* the price. */
|
|
35
|
+
isIndependentSubsetRange?: boolean;
|
|
36
|
+
/** An own price scale with axis labels (titan builds it only when truthy). */
|
|
37
|
+
showIndependentYAxis?: boolean;
|
|
38
|
+
/** A table pane owns no value axis, and a rich line draws its own left
|
|
39
|
+
* axis (C4): the scale cell stays blank instead of echoing the chart's
|
|
40
|
+
* prices. */
|
|
41
|
+
hidePriceScale?: boolean;
|
|
42
|
+
/** A pane pinned over the candles on its own hidden scale (OT24): the
|
|
43
|
+
* nested plots draw on the parent's scale, never folded into the main
|
|
44
|
+
* pane's range. */
|
|
45
|
+
isPinnedToChart?: boolean;
|
|
46
|
+
shouldAdjustMainGridRange?: boolean;
|
|
47
|
+
/** A price canvas's row readers (the native profile extractor) and live
|
|
48
|
+
* merge (wrun-canvases.util). */
|
|
49
|
+
extractors?: unknown;
|
|
50
|
+
mergeLiveDataPoint?: unknown;
|
|
51
|
+
/** A tick's heatmap tail (wrun-canvases.util `tailOnly`): the newest rows
|
|
52
|
+
* without a colour scale, never the canvas's rows (never added, never
|
|
53
|
+
* swapped in, never the mounted record). */
|
|
54
|
+
tailOnly?: true;
|
|
55
|
+
settings: Record<string, unknown>;
|
|
56
|
+
}
|
|
57
|
+
export interface WrunChildOverlayChart extends WrunPaneFormatChart {
|
|
58
|
+
metadata: ReadonlyArray<{
|
|
59
|
+
id: string;
|
|
60
|
+
name?: string;
|
|
61
|
+
interval?: number;
|
|
62
|
+
isHidden?: boolean;
|
|
63
|
+
/** The parent's side: an offchart parent docks its lower-pane levels on
|
|
64
|
+
* itself (DL-lower-pane); also the first of the pane fields the window
|
|
65
|
+
* geometry reads (window-geometry.util). */
|
|
66
|
+
type?: string;
|
|
67
|
+
plot?: string;
|
|
68
|
+
gridHeight?: number;
|
|
69
|
+
isPaneHidden?: boolean;
|
|
70
|
+
hostPaneId?: string;
|
|
71
|
+
settings?: Record<string, unknown>;
|
|
72
|
+
rawData?: unknown;
|
|
73
|
+
data?: unknown;
|
|
74
|
+
}>;
|
|
75
|
+
isDestroyed?: boolean;
|
|
76
|
+
/** The chart canvas in CSS px sizes a table pane to its rows. */
|
|
77
|
+
canvasChartController?: {
|
|
78
|
+
canvasElement?: {
|
|
79
|
+
clientHeight?: number;
|
|
80
|
+
} | null;
|
|
81
|
+
} | null;
|
|
82
|
+
addOverlay(config: WrunOverlayConfig): void;
|
|
83
|
+
removeOverlay(id: string): void;
|
|
84
|
+
/** The engine's in-place row swap (rawData, process, render); a panel
|
|
85
|
+
* child rides it on a rerun so its pane keeps its place in the stack, a
|
|
86
|
+
* row-backed canvas on a full run. */
|
|
87
|
+
updateData?(id: string, data: unknown[][], options?: {
|
|
88
|
+
shouldResetRange?: boolean;
|
|
89
|
+
}): void;
|
|
90
|
+
/** The engine's live row merge (the forming row replaced, a newer one
|
|
91
|
+
* appended through the overlay's `mergeLiveDataPoint`): a row-backed
|
|
92
|
+
* canvas rides it on a tick. */
|
|
93
|
+
liveUpdateData?(id: string, row: unknown): void;
|
|
94
|
+
changeVisibilityOverlay?(id: string, isVisible: boolean): void;
|
|
95
|
+
/** The engine gate of a batched child (titan): true once a pack is registered on this chart, and
|
|
96
|
+
* true when a renderer exists for a plot type (false also for a known type no pack registered). */
|
|
97
|
+
hasFeaturePack?(name: string): boolean;
|
|
98
|
+
hasPlotRenderer?(type: string): boolean;
|
|
99
|
+
/** The engine's note that a host mutated an overlay's rows in place (a replay cut): it bumps the
|
|
100
|
+
* overlay's data version so a pack's cached geometry is read again, and paints once. */
|
|
101
|
+
notifyLiveDataMutated?(id: string): void;
|
|
102
|
+
/** Titan's object events; a `reset` (pane regroup, swap, order) carries no refs. */
|
|
103
|
+
on?(event: 'objects', listener: (event: {
|
|
104
|
+
type: string;
|
|
105
|
+
refs?: ReadonlyArray<{
|
|
106
|
+
id: string;
|
|
107
|
+
}>;
|
|
108
|
+
}) => void): () => void;
|
|
109
|
+
processData?(): void;
|
|
110
|
+
renderService?: {
|
|
111
|
+
renderOnce?(): void;
|
|
112
|
+
};
|
|
113
|
+
/** The offchart height path a window's planned weights ride (window-geometry.util). */
|
|
114
|
+
updateSettings?(id: string, payload: Record<string, unknown>): unknown;
|
|
115
|
+
resizeCanvasOnce?(): void;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* The cell a mount lands on. On a WINDOW (the parent is the flagged owner,
|
|
119
|
+
* window-cell.util) the children take the window plan's weights at their
|
|
120
|
+
* first mount instead of the shared 0.22, so a window never flashes a chart
|
|
121
|
+
* layout, and the plan is reconciled onto the mounted panes when the mount
|
|
122
|
+
* settles. Absent, the parent's engine settings decide (the owner flag rides
|
|
123
|
+
* them); a parent without the flag is a normal cell, whose configs are byte
|
|
124
|
+
* for byte today's.
|
|
125
|
+
*/
|
|
126
|
+
export interface WrunMountCell {
|
|
127
|
+
window: boolean;
|
|
128
|
+
/** The chart canvas in CSS px (read from the engine when absent). */
|
|
129
|
+
canvasHeightPx?: number;
|
|
130
|
+
/** A precomputed plan (child id to gridHeight); planned from the run's children when absent. */
|
|
131
|
+
planned?: ReadonlyMap<string, number>;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Every child kind and its legend row, decided here once (the legend guard in
|
|
135
|
+
* the mount spec mounts one of each kind listed). The `own` kinds are the
|
|
136
|
+
* allowlist that keeps a row by design: a panel (a side panel too) and a
|
|
137
|
+
* series pane own a pane, a title and controls, and an inset's row carries its
|
|
138
|
+
* latest value. Every other kind folds into the parent's row: `childConfig`
|
|
139
|
+
* sends it `hideLegend: true`, so the engine builds no row, the parent's row
|
|
140
|
+
* carries the Indicator and the parent's eye still governs the child
|
|
141
|
+
* (`syncChildVisibility`). A kind missing here gets no row either, and the
|
|
142
|
+
* typecheck refuses the table until it is decided. Each kind used to opt out
|
|
143
|
+
* on its own, and the levels child that forgot printed a second row titled
|
|
144
|
+
* "gex_by_strike".
|
|
145
|
+
*/
|
|
146
|
+
export declare const WRUN_CHILD_LEGEND_ROW: {
|
|
147
|
+
readonly panel: "own";
|
|
148
|
+
readonly series: "own";
|
|
149
|
+
readonly inset: "own";
|
|
150
|
+
readonly levels: "parent";
|
|
151
|
+
readonly heatmap: "parent";
|
|
152
|
+
readonly profile: "parent";
|
|
153
|
+
readonly matrix: "parent";
|
|
154
|
+
readonly marks: "parent";
|
|
155
|
+
readonly spans: "parent";
|
|
156
|
+
readonly rays: "parent";
|
|
157
|
+
};
|
|
158
|
+
/** A save of the package overlay: every mounted series child takes the chart switches it carries,
|
|
159
|
+
* its container through the engine's settings door and its plots' price markers through the
|
|
160
|
+
* adapter's own stamp (the one the parent's plots take). */
|
|
161
|
+
export declare function syncWrunSeriesChildChartSettings(tc: WrunChildOverlayChart, overlayId: string, settings: Record<string, unknown> | undefined): void;
|
|
162
|
+
/** The lower pane's legend readout, the parent's own rule brought to its
|
|
163
|
+
* child: every value line of the pane's nested plots at the hovered bar,
|
|
164
|
+
* named by its output's `labels` column (kScriptLegendEntries, the same
|
|
165
|
+
* entries the technical-script control prints for the parent) and printed
|
|
166
|
+
* by its output's declared `format` word and companions (OT32), else by the
|
|
167
|
+
* lower-pane legend rule (K/M/B from 1K, the built-in legend decimals below,
|
|
168
|
+
* never the axis step: formatWrunLegendValue); "price" prints at the chart's
|
|
169
|
+
* price digits (OT29, the provider). A candle group reads its four values
|
|
170
|
+
* after the legend's O / H / L / C markers (OT28); every dot shows the
|
|
171
|
+
* colour the hovered bar is drawn in (OT27). A single line keeps the
|
|
172
|
+
* unlabelled single-slot readout, like the parent. An output with
|
|
173
|
+
* `legend: false` is never a line (kScriptLegendLines). A proven twin's pane
|
|
174
|
+
* (`builtinTwin`) prints by its built-in's legend rule instead. */
|
|
175
|
+
export declare function wrunSeriesChildLegendText(builtinTwin?: WrunBuiltinTwin, priceDigits?: () => number): (point: number[] | undefined, meta: unknown) => KScriptLegendEntry[];
|
|
176
|
+
/** The lower pane's static legend: the slot pool the dynamic readout
|
|
177
|
+
* addresses (one labelled span per slot, born empty, the parent's rule:
|
|
178
|
+
* titan creates legend spans only from this list and drops updates for ids
|
|
179
|
+
* it never created). The palette now rides each update's swatch, so the
|
|
180
|
+
* slots start in the value ink; the argument stays for the callers. */
|
|
181
|
+
export declare function wrunSeriesChildLegendSlots(_palette?: ReadonlyArray<string>): Array<KScriptLegendEntry & {
|
|
182
|
+
isStatic: boolean;
|
|
183
|
+
}>;
|
|
184
|
+
/** The series child's overlay id (`<parent>::series:<name>`), defined by the
|
|
185
|
+
* adapter (the visibility apply reads it there) and re-exported here. */
|
|
186
|
+
export { wrunSeriesChildId };
|
|
187
|
+
/**
|
|
188
|
+
* True while the engine gate refuses the batched child `childId` of `overlayId` (the last pass that
|
|
189
|
+
* judged it): a child the chart cannot draw is never mounted, so the live tick leaves it out of its
|
|
190
|
+
* changed-tail decision (wrun-live-tick.util) instead of rebuilding every section's whole window on
|
|
191
|
+
* every tick for as long as the refusal holds. A tick still carries its tail and the gate judges it
|
|
192
|
+
* again: one the chart draws again stops reading as refused, and the next tick mounts it. A layout
|
|
193
|
+
* refusal (a section or a retained record newer than this chart) is not the tail's to lift: it holds
|
|
194
|
+
* until a full build (a run, a reseed, a whole-window tick) judges the child again.
|
|
195
|
+
*/
|
|
196
|
+
export declare function isWrunBatchedChildRefused(tc: WrunChildOverlayChart, overlayId: string, childId: string): boolean;
|
|
197
|
+
/** A run's history window: the span the run recomputed (a pan wave's window, clamped or the whole
|
|
198
|
+
* loaded range), epoch ms, both ends inclusive. */
|
|
199
|
+
export interface WrunChildHistoryWindow {
|
|
200
|
+
fromMs: number;
|
|
201
|
+
toMs: number;
|
|
202
|
+
}
|
|
203
|
+
/** Why a prepared landing no longer applies (`WrunStaleLandingError.reason`): `chart` the chart index names
|
|
204
|
+
* another chart now (or it was destroyed); `mount` the Indicator's mount moved on (another mount pass, an
|
|
205
|
+
* unmount); `parent` the parent overlay is not the one mounted; `child` the heatmap is no longer a mounted
|
|
206
|
+
* heatmap (it left the chart), or holds none to keep a scale from; `paused` the Indicator is paused;
|
|
207
|
+
* `rolled-back` another landing of the same run failed and the run's landings were rolled back; `spent` the
|
|
208
|
+
* landing already committed, failed or was discarded. */
|
|
209
|
+
export type WrunStaleLandingReason = 'chart' | 'mount' | 'parent' | 'child' | 'paused' | 'rolled-back' | 'spent';
|
|
210
|
+
/** A prepared heatmap landing that can no longer land (C6): nothing of it is applied. */
|
|
211
|
+
export declare class WrunStaleLandingError extends Error {
|
|
212
|
+
readonly childId: string;
|
|
213
|
+
readonly reason: WrunStaleLandingReason;
|
|
214
|
+
constructor(childId: string, reason: WrunStaleLandingReason);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* A heatmap child's rows for a history window, prepared to land (C6, a prefix run's child): every await
|
|
218
|
+
* done (the chart, the packs, the pause lookup), the rows merged into the child's mounted rows and the cell
|
|
219
|
+
* budget planned, nothing applied yet. The counts read the plan (the commit's own once it landed).
|
|
220
|
+
*/
|
|
221
|
+
export interface PreparedWrunWindowLanding {
|
|
222
|
+
readonly childId: string;
|
|
223
|
+
/** Pass rows the child holds once the landing commits: the window's rows the cell budget kept. */
|
|
224
|
+
readonly landedRows: number;
|
|
225
|
+
/** Mounted rows outside the window the child keeps, the same row objects (C3). */
|
|
226
|
+
readonly keptRows: number;
|
|
227
|
+
/** Merged rows the cell budget drops, the oldest bars first. */
|
|
228
|
+
readonly trimmedRows: number;
|
|
229
|
+
/** Land the rows, with no await. The mount token, the chart object, the parent, the child and the pause are
|
|
230
|
+
* checked first, and a change throws `WrunStaleLandingError` with nothing applied. Rows the child gained or
|
|
231
|
+
* lost since the prepare (a tick that was already on its way, a rebuild) are merged again from what it
|
|
232
|
+
* holds now; a sibling landing of the same run never cuts it before its own commit. The rows reach the
|
|
233
|
+
* engine through its row swap, the mount record and the cell ledger follow, and the ring logs
|
|
234
|
+
* `wrun-heatmap-prefix-landed`. The landings one run prepared for an Indicator land as one transaction: a
|
|
235
|
+
* commit that throws rolls back the run's landings that already landed (their rows, records and ledger
|
|
236
|
+
* entries, a sibling trim included). A second commit throws (`spent`). */
|
|
237
|
+
commit(): void;
|
|
238
|
+
/** Release the prepared rows; a commit afterwards throws (`spent`). Dropping a landing that never landed
|
|
239
|
+
* while another landing of the same run did leaves the run partial, so the landed ones roll back. After its
|
|
240
|
+
* own commit (or a failed one) a discard does nothing. */
|
|
241
|
+
discard(): void;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Prepare a mounted heatmap child's landing of `rows` inside `historyWindow` (both ends inclusive, epoch ms):
|
|
245
|
+
* the C6 seam a prefix run lands its heatmap children through, as an asynchronous prepare and a synchronous
|
|
246
|
+
* commit under the run's own lock. Every await is here: the chart the index names, the child's packs, the
|
|
247
|
+
* pause lookup. Then, with no await, the rows merge into the rows the mount record holds (the rows outside the
|
|
248
|
+
* window kept by identity, C3), the cell budget is planned from the merged rows and the ledger as it stands
|
|
249
|
+
* (no whole-run skip: the budget only cuts the oldest bars), and the mounted scale is kept: a windowed landing
|
|
250
|
+
* never samples colour bounds, a full run does. Rejects with `WrunStaleLandingError` when the mount holds no
|
|
251
|
+
* such child to land into, and with the pack error when a pack failed.
|
|
252
|
+
*
|
|
253
|
+
* A batched child (WRUN-BATCHED-MARKS: marks, spans, rays) lands through the same seam (round-2 fold 10:
|
|
254
|
+
* the row-backed canvas kinds prepend rows): its merged rows are budgeted on the batched ledger, each pass
|
|
255
|
+
* row that replaces a mounted bar charged its old copy too, and the ring logs `wrun-batched-prefix-landed`;
|
|
256
|
+
* a run's heatmap and batched landings commit as one transaction. `prepareWrunChildWindowLanding` names
|
|
257
|
+
* the generalized seam.
|
|
258
|
+
*/
|
|
259
|
+
export declare function prepareWrunHeatmapWindowLanding(input: {
|
|
260
|
+
chartIndex: number;
|
|
261
|
+
indicatorId: string;
|
|
262
|
+
childId: string;
|
|
263
|
+
rows: ReadonlyArray<ReadonlyArray<number>>;
|
|
264
|
+
historyWindow: {
|
|
265
|
+
fromTs: number;
|
|
266
|
+
toTs: number;
|
|
267
|
+
};
|
|
268
|
+
}): Promise<PreparedWrunWindowLanding>;
|
|
269
|
+
/** The window landing of any row-backed canvas child (a heatmap or a batched child), the generalized name. */
|
|
270
|
+
export declare const prepareWrunChildWindowLanding: typeof prepareWrunHeatmapWindowLanding;
|
|
271
|
+
/** Mount a run snapshot after every required pack has settled.
|
|
272
|
+
* The parent remains the canonical numeric-output container. A panel child
|
|
273
|
+
* the run still declares in the same pane takes the new rows in place; one
|
|
274
|
+
* whose pane changed (side, species, axis, chrome, carved height) or that
|
|
275
|
+
* the run dropped is replaced or removed. A heatmap or profile that stays
|
|
276
|
+
* the same canvas, and an inset that stays the same strip (sameInset), takes
|
|
277
|
+
* the run's rows in place too; a levels or matrix child in the same pane
|
|
278
|
+
* and kind refreshes in place when its frame signature changed (one that
|
|
279
|
+
* moved pane or kind is replaced). A tick
|
|
280
|
+
* without frames touches only the row-backed kinds: an inset takes its rows
|
|
281
|
+
* in place (a moved strip is replaced, one the tick dropped removed),
|
|
282
|
+
* heatmaps and profiles their newest row (every row from `canvasRowsFromTs`
|
|
283
|
+
* on when the tick added bars; all their rows and settings when
|
|
284
|
+
* the row grid moved), and the series child is refreshed in place; a series
|
|
285
|
+
* child is never removed while the run still declares it in the same pane (a
|
|
286
|
+
* pane moved onto the price or given another height is re-carved). Every
|
|
287
|
+
* child mounts with the parent's eye, a child the reader hid on its own row
|
|
288
|
+
* hidden (syncChildVisibility). `priceDigits` is the chart's price
|
|
289
|
+
* precision (OT29, X7): the panels' formatters and the lower pane's legend
|
|
290
|
+
* print "price" values with it. A tick's heatmap tail (`tailOnly`) only
|
|
291
|
+
* ever merges its rows into a mounted canvas. */
|
|
292
|
+
export declare function mountWrunChildOverlays({ tc, overlayId, runResult, replaceFrames, swapCanvasRows, canvasRowsFromTs, historyWindow, projection, cell, priceDigits, onMainThreadMs, chartIndex, }: {
|
|
293
|
+
tc: WrunChildOverlayChart;
|
|
294
|
+
overlayId: string;
|
|
295
|
+
runResult: WrunRunResult;
|
|
296
|
+
/** The parent's chart: a mount whose packs loaded after the parent was paused applies nothing
|
|
297
|
+
* (the retained picture stays; Resume reruns). Without it the mount cannot recheck the pause. */
|
|
298
|
+
chartIndex?: number;
|
|
299
|
+
replaceFrames?: boolean;
|
|
300
|
+
/** A mounted heatmap or profile takes the pass's rows whole, never only its newest row, while
|
|
301
|
+
* frame-backed children still follow `replaceFrames`: the hosted path's pass, whose rows are the
|
|
302
|
+
* whole session (a pan-back page adds rows on the left). Absent, a pass without frames merges the
|
|
303
|
+
* newest row as before. */
|
|
304
|
+
swapCanvasRows?: boolean;
|
|
305
|
+
/** A live tick that added bars since the canvases last painted (the live tick's
|
|
306
|
+
* `paintedThroughTs`, wrun-live-tick.util `wrunLiveCanvasPass`): a mounted heatmap (its tail
|
|
307
|
+
* included) or profile that takes the live merge merges the pass's row holding this bar and every
|
|
308
|
+
* row after it, oldest first (`liveCanvasRows`), never only the newest, which would leave a roll's
|
|
309
|
+
* closed bar as the last drain before the close drew it and skip the bars between. Absent, the
|
|
310
|
+
* newest row as before; `swapCanvasRows` wins over it. */
|
|
311
|
+
canvasRowsFromTs?: number;
|
|
312
|
+
/** A run's history window (WrunChildHistoryWindow): a mounted heatmap holding rows takes the pass's
|
|
313
|
+
* rows inside it, merged into the rows its record holds (`heatmapRowsWithWindow`), budgeted with
|
|
314
|
+
* its earlier demand carried (`landHeatmapWindow`, the landing a prefix run's prepared child takes
|
|
315
|
+
* too), and keeps the rows outside it and the settings it was drawn with (a clamped page's colour
|
|
316
|
+
* bounds were sampled on the page alone; the Sensitivity sample stays the mounted one), on
|
|
317
|
+
* a frameless pass (the merge route, any window) and on a run (the remount a refused merge falls
|
|
318
|
+
* back to, a partial window) alike. A heatmap the pass omits is left to the pass's own rule.
|
|
319
|
+
* Absent, a frameless pass merges a heatmap's newest row and a run swaps its rows whole, as
|
|
320
|
+
* before; `swapCanvasRows` wins over it. */
|
|
321
|
+
historyWindow?: WrunChildHistoryWindow;
|
|
322
|
+
/** The parent ran at another interval: its series child projects the same way. */
|
|
323
|
+
projection?: WrunRunIntervalProjection;
|
|
324
|
+
/** The cell the mount lands on (WrunMountCell); the parent's owner flag decides when absent. */
|
|
325
|
+
cell?: WrunMountCell;
|
|
326
|
+
/** The chart's price digits, read per call (the symbol may change). */
|
|
327
|
+
priceDigits?: () => number;
|
|
328
|
+
/** Hears the main-thread ms the mount spends applying the children once their packs load
|
|
329
|
+
* (installs, row refreshes): work that lands after the caller stopped its own clock for the
|
|
330
|
+
* wait. The config build before the wait runs inside the caller's call. The engine pass the
|
|
331
|
+
* mount asks for runs after it, on the engine's frame, and is charged by the engine's own prep
|
|
332
|
+
* clock (scheduleKScriptChartPaint); only a chart that cannot defer keeps that pass in here. */
|
|
333
|
+
onMainThreadMs?: (ms: number) => void;
|
|
334
|
+
}): Promise<boolean>;
|
|
335
|
+
/** Re-resolve every mounted child of every Indicator on the chart against
|
|
336
|
+
* the chart's current palette, theme name and display timezone, without a
|
|
337
|
+
* rerun (X13; hosted runs follow too): a panel takes its retranslated rows
|
|
338
|
+
* and settings in place (its pane keeps its place in the stack and the
|
|
339
|
+
* height the run carved it at), a levels, inset or canvas child is rebuilt
|
|
340
|
+
* from its unresolved input under the same id, in the chart's own order so
|
|
341
|
+
* the rebuilt ones keep their stacking. The series child's colours ride
|
|
342
|
+
* the adapter's own theme reguard. Called by the theme rerun when a packed
|
|
343
|
+
* colour moved and by the timezone sync per chart. */
|
|
344
|
+
export declare function retranslateWrunChildOverlays(tc: WrunChildOverlayChart): void;
|
|
345
|
+
/**
|
|
346
|
+
* Re-pick the colour bounds of an Indicator's mounted heatmaps for the
|
|
347
|
+
* viewer's Sensitivity, with no run. With `preview` the named heatmap holds
|
|
348
|
+
* the slider's drag value (ahead of the saved row, for every mount until a
|
|
349
|
+
* commit); without one the call commits: held values drop and every heatmap
|
|
350
|
+
* takes its saved row (`heatmap:<name>:sensitivity` on the parent's engine
|
|
351
|
+
* settings; none draws the author's bounds). Only `min` and `max` move on the
|
|
352
|
+
* engine meta: titan reads meta.settings on every draw and keys its colour
|
|
353
|
+
* table on the bounds, so there is no row swap and no remount. The bounds go
|
|
354
|
+
* through the engine's settings door (`updateSettings`), which also commits a
|
|
355
|
+
* content mutation, so the 2D strip cache of the canvas fallback never blits
|
|
356
|
+
* pixels drawn with the old bounds back on a live-edge sliver. The mounted
|
|
357
|
+
* record keeps the config with the bounds it now holds, so the next run
|
|
358
|
+
* diffs against them. Returns whether a bound moved.
|
|
359
|
+
*/
|
|
360
|
+
export declare function rescaleWrunHeatmapChildren(tc: WrunChildOverlayChart, overlayId: string, preview?: {
|
|
361
|
+
name: string;
|
|
362
|
+
value: number;
|
|
363
|
+
}): boolean;
|
|
364
|
+
/**
|
|
365
|
+
* A replay cut of an Indicator's batched children (WRUN-BATCHED-MARKS, round-2 fold 9), synchronous with
|
|
366
|
+
* the cut of the engine rows (wrun-replay-rows.util, which also tells the engine the rows moved in place so
|
|
367
|
+
* a pack's cached geometry is read again): each mounted batched child's record (the input a retranslate
|
|
368
|
+
* rebuilds from and the config) keeps the rows inside [fromTs, toTs] (fromTs NaN keeps every row through
|
|
369
|
+
* toTs) and its cell ledger follows. A theme or timezone switch while the replay holds its reseed then
|
|
370
|
+
* rebuilds the cut rows, never the rows the step took away. Returns the child ids whose records were cut.
|
|
371
|
+
*/
|
|
372
|
+
export declare function cutWrunBatchedChildRecords(tc: WrunChildOverlayChart, overlayId: string, fromTs: number, toTs: number): string[];
|
|
373
|
+
/** Full compute runs await the async work started by the synchronous
|
|
374
|
+
* integration seam. A failed pack never becomes a successful full run. */
|
|
375
|
+
export declare function awaitWrunChildOverlays(tc: WrunChildOverlayChart, overlayId: string): Promise<boolean>;
|
|
376
|
+
/** Explicit teardown is also used by the engine's post-removal object event. */
|
|
377
|
+
export declare function unmountWrunChildOverlays(tc: WrunChildOverlayChart, overlayId: string): void;
|