@orangecharts/wrun-chart-host 0.14.0 → 0.16.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 +1 -0
- package/dist/constants/economic.constants.d.ts +2 -0
- package/dist/constants/economic.constants.js +2 -0
- package/dist/constants/feature-flags.constants.d.ts +11 -0
- package/dist/constants/feature-flags.constants.js +56 -4
- package/dist/constants/feature-limits.constants.d.ts +72 -4
- package/dist/constants/feature-limits.constants.js +98 -20
- package/dist/constants/interval.constants.js +5 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.d.ts +12 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.js +14 -0
- package/dist/constants/typed-width-fold.leaf.d.ts +50 -0
- package/dist/constants/typed-width-fold.leaf.js +99 -0
- package/dist/constants/typed-width-source.leaf.d.ts +24 -0
- package/dist/constants/typed-width-source.leaf.js +126 -0
- package/dist/constants/typed-width.leaf.d.ts +57 -0
- package/dist/constants/typed-width.leaf.js +78 -0
- package/dist/host-env.d.ts +24 -0
- package/dist/host-env.js +22 -0
- package/dist/host-ports.types.d.ts +11 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/interfaces/kscript-diagnostics.interface.d.ts +28 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +107 -4
- package/dist/interfaces/wrun-runtime.interface.js +11 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +13 -0
- package/dist/kscript-data/controls/live-trades-merge.util.js +16 -1
- package/dist/market-data/billing.interface.d.ts +12 -45
- package/dist/market-data/billing.interface.js +2 -2
- package/dist/market-data/venues/index.d.ts +2 -2
- package/dist/market-data/venues/opra.js +3 -3
- package/dist/market-data/venues/stocks.contract.copy.json +3 -2
- package/dist/market-data/venues/stocks.d.ts +2 -2
- package/dist/market-data/venues/stocks.js +10 -9
- package/dist/replay/replayLadder.js +7 -4
- package/dist/settings-templates/footprint-rows.d.ts +6 -0
- package/dist/settings-templates/footprint-rows.js +6 -0
- package/dist/settings-templates/frvp-fields.js +14 -0
- package/dist/settings-templates/indicator-fields.js +46 -0
- package/dist/settings-templates/tool-tables.generated.js +19 -1
- package/dist/utility/chart/__fixtures__/live-bucket-regular-golden.json +1706 -0
- package/dist/utility/chart/cache-alignment.util.d.ts +65 -0
- package/dist/utility/chart/cache-alignment.util.js +124 -24
- package/dist/utility/chart/calendar-interval.util.d.ts +83 -1
- package/dist/utility/chart/calendar-interval.util.js +152 -4
- package/dist/utility/chart/candle-bar-end.util.d.ts +11 -4
- package/dist/utility/chart/candle-bar-end.util.js +17 -6
- package/dist/utility/chart/chart-time-domain.util.d.ts +3 -0
- package/dist/utility/chart/chart-time-domain.util.js +13 -4
- package/dist/utility/chart/feed-interval.util.d.ts +4 -2
- package/dist/utility/chart/feed-interval.util.js +5 -2
- package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +3 -1
- package/dist/utility/chart/fetch-dedupe-policy.util.js +19 -1
- package/dist/utility/chart/footprint-band.util.d.ts +21 -5
- package/dist/utility/chart/footprint-band.util.js +53 -14
- package/dist/utility/chart/footprint-display-mode.util.d.ts +2 -0
- package/dist/utility/chart/footprint-display-mode.util.js +5 -0
- package/dist/utility/chart/governed-lanes-gate.util.d.ts +46 -0
- package/dist/utility/chart/governed-lanes-gate.util.js +71 -0
- package/dist/utility/chart/governed-lanes-reader-seat.d.ts +14 -0
- package/dist/utility/chart/governed-lanes-reader-seat.js +14 -0
- package/dist/utility/chart/history-wall.util.d.ts +13 -2
- package/dist/utility/chart/history-wall.util.js +11 -4
- package/dist/utility/chart/interval-ladder.util.d.ts +5 -2
- package/dist/utility/chart/interval-ladder.util.js +44 -4
- package/dist/utility/chart/interval-registry.util.d.ts +22 -1
- package/dist/utility/chart/interval-registry.util.js +50 -2
- package/dist/utility/chart/kscript-data-interval-restriction.leaf.d.ts +32 -4
- package/dist/utility/chart/kscript-data-interval-restriction.leaf.js +22 -5
- package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +10 -0
- package/dist/utility/chart/kscript-drawing-safe-area.util.js +30 -3
- package/dist/utility/chart/kscript-legend-entries.util.d.ts +21 -4
- package/dist/utility/chart/kscript-legend-entries.util.js +27 -5
- package/dist/utility/chart/kscript-main-grid-stages.util.js +74 -24
- package/dist/utility/chart/kscript-row-name.leaf.d.ts +13 -0
- package/dist/utility/chart/kscript-row-name.leaf.js +18 -0
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +61 -26
- package/dist/utility/chart/kscript-venue-policy.util.js +138 -37
- package/dist/utility/chart/live-bucket.util.d.ts +29 -4
- package/dist/utility/chart/live-bucket.util.js +45 -12
- package/dist/utility/chart/market-session.util.d.ts +62 -10
- package/dist/utility/chart/market-session.util.js +93 -13
- package/dist/utility/chart/marketKind.util.d.ts +1 -7
- package/dist/utility/chart/marketKind.util.js +6 -8
- package/dist/utility/chart/mixed-mode.util.d.ts +17 -0
- package/dist/utility/chart/om-target.util.js +6 -4
- package/dist/utility/chart/price-precision.util.d.ts +20 -6
- package/dist/utility/chart/price-precision.util.js +34 -7
- package/dist/utility/chart/profile-frame-window.util.d.ts +15 -0
- package/dist/utility/chart/profile-frame-window.util.js +12 -0
- package/dist/utility/chart/rth-session.util.d.ts +3 -1
- package/dist/utility/chart/rth-session.util.js +3 -1
- package/dist/utility/chart/script-source-session.util.d.ts +43 -0
- package/dist/utility/chart/script-source-session.util.js +61 -0
- package/dist/utility/chart/typed-width-grid.util.d.ts +23 -0
- package/dist/utility/chart/typed-width-grid.util.js +203 -0
- package/dist/utility/chart/wrun-run-result.util.d.ts +9 -1
- package/dist/utility/chart/wrun-run-result.util.js +8 -2
- package/dist/utility/common/transformations.util.d.ts +6 -0
- package/dist/utility/common/transformations.util.js +28 -4
- package/dist/utility/number-format.util.d.ts +14 -1
- package/dist/utility/number-format.util.js +22 -4
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.d.ts +24 -1
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +113 -0
- package/dist/utility/v2/v2-enums.leaf.js +3 -0
- package/dist/utility/wrun/wrun-batched-marks.util.d.ts +15 -5
- package/dist/utility/wrun/wrun-batched-marks.util.js +70 -20
- package/dist/utility/wrun/wrun-canvases.util.d.ts +28 -9
- package/dist/utility/wrun/wrun-canvases.util.js +99 -39
- package/dist/utility/wrun/wrun-cap-notice.util.d.ts +5 -0
- package/dist/utility/wrun/wrun-cap-notice.util.js +23 -0
- package/dist/utility/wrun/wrun-card-style.util.d.ts +1 -1
- package/dist/utility/wrun/wrun-card-style.util.js +2 -2
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +8 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +13 -1
- package/dist/utility/wrun/wrun-child-overlay-id.util.d.ts +10 -0
- package/dist/utility/wrun/wrun-child-overlay-id.util.js +24 -0
- package/dist/utility/wrun/wrun-cloud-cme-stamp.util.d.ts +72 -0
- package/dist/utility/wrun/wrun-cloud-cme-stamp.util.js +151 -0
- package/dist/utility/wrun/wrun-color-facts.util.d.ts +3 -3
- package/dist/utility/wrun/wrun-color-facts.util.js +8 -5
- package/dist/utility/wrun/wrun-colour-tone.lazy.d.ts +20 -0
- package/dist/utility/wrun/wrun-colour-tone.lazy.js +23 -0
- package/dist/utility/wrun/wrun-colour-tone.util.d.ts +14 -0
- package/dist/utility/wrun/wrun-colour-tone.util.js +119 -0
- package/dist/utility/wrun/wrun-dark-pool.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-dark-pool.util.js +5 -4
- package/dist/utility/wrun/wrun-frames.d.ts +1 -1
- package/dist/utility/wrun/wrun-frames.js +2 -2
- package/dist/utility/wrun/wrun-handles.util.d.ts +1 -1
- package/dist/utility/wrun/wrun-handles.util.js +1 -1
- package/dist/utility/wrun/wrun-host.service.d.ts +32 -2
- package/dist/utility/wrun/wrun-host.service.js +44 -2
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +20 -0
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +85 -2
- package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +37 -0
- package/dist/utility/wrun/wrun-hosted-wire.util.js +54 -0
- package/dist/utility/wrun/wrun-hover.util.d.ts +8 -2
- package/dist/utility/wrun/wrun-hover.util.js +24 -13
- package/dist/utility/wrun/wrun-hud-looks.util.d.ts +1 -0
- package/dist/utility/wrun/wrun-hud-looks.util.js +6 -11
- package/dist/utility/wrun/wrun-integration-route.util.d.ts +24 -0
- package/dist/utility/wrun/wrun-integration-route.util.js +19 -0
- package/dist/utility/wrun/wrun-live-intake.util.js +17 -1
- package/dist/utility/wrun/wrun-live-patch.util.d.ts +6 -1
- package/dist/utility/wrun/wrun-live-patch.util.js +10 -4
- package/dist/utility/wrun/wrun-live-tick.util.js +81 -19
- package/dist/utility/wrun/wrun-output-words.util.d.ts +14 -0
- package/dist/utility/wrun/wrun-output-words.util.js +51 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +41 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +35 -0
- package/dist/utility/wrun/wrun-overlay-result.util.d.ts +6 -1
- package/dist/utility/wrun/wrun-overlay-result.util.js +2 -0
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +23 -2
- package/dist/utility/wrun/wrun-overlay-run.util.js +305 -51
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +10 -2
- package/dist/utility/wrun/wrun-panel-mount.util.js +144 -18
- package/dist/utility/wrun/wrun-pin-venues.util.js +5 -1
- package/dist/utility/wrun/wrun-refusal.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-refusal.util.js +102 -13
- package/dist/utility/wrun/wrun-registry-errors.util.d.ts +5 -3
- package/dist/utility/wrun/wrun-registry-errors.util.js +5 -3
- package/dist/utility/wrun/wrun-row-source-factory.js +17 -1
- package/dist/utility/wrun/wrun-row-source.d.ts +8 -1
- package/dist/utility/wrun/wrun-run-health.util.d.ts +6 -3
- package/dist/utility/wrun/wrun-run-health.util.js +5 -2
- package/dist/utility/wrun/wrun-sandbox-row-source.d.ts +1 -1
- package/dist/utility/wrun/wrun-sandbox-row-source.js +9 -0
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +25 -8
- package/dist/utility/wrun/wrun-script-inputs.util.js +145 -45
- package/dist/utility/wrun/wrun-setting-words.util.d.ts +12 -5
- package/dist/utility/wrun/wrun-setting-words.util.js +25 -8
- package/dist/utility/wrun/wrun-socket-row-source.d.ts +26 -1
- package/dist/utility/wrun/wrun-socket-row-source.js +125 -12
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +3 -3
- package/dist/utility/wrun/wrun-source-rows.util.js +8 -7
- package/dist/utility/wrun/wrun-style-names.util.d.ts +23 -0
- package/dist/utility/wrun/wrun-style-names.util.js +74 -0
- package/dist/utility/wrun/wrun-style-words.util.d.ts +31 -9
- package/dist/utility/wrun/wrun-style-words.util.js +46 -15
- package/dist/utility/wrun/wrun-trades-lane.util.js +2 -1
- package/dist/utility/wrun/wrun-trap-replay.util.d.ts +42 -0
- package/dist/utility/wrun/wrun-trap-replay.util.js +63 -0
- package/dist/utility/wrun/wrun-volume-profile.util.js +6 -5
- package/dist/utility/wrun-display-name.util.d.ts +10 -0
- package/dist/utility/wrun-display-name.util.js +21 -0
- package/dist/utils/replay/replay-buffer-math.d.ts +2 -0
- package/dist/utils/replay/replay-buffer-math.js +2 -0
- package/dist/workers/constants/socket-slots.d.ts +1 -1
- package/dist/workers/utils/time.worker.util.js +2 -2
- package/dist/workers/utils/volume-profile.worker.util.d.ts +9 -0
- package/dist/workers/utils/volume-profile.worker.util.js +20 -0
- package/dist/workers/wrun/wrun-abi-host.d.ts +3 -0
- package/dist/workers/wrun/wrun-abi-host.js +82 -5
- package/dist/workers/wrun/wrun-engine-handler.js +53 -4
- package/dist/workers/wrun/wrun-trap-frames.leaf.d.ts +28 -0
- package/dist/workers/wrun/wrun-trap-frames.leaf.js +108 -0
- package/package.json +11 -11
|
@@ -207,6 +207,119 @@ export function wrunRunFailureRuntimeDiagnostic(message, context = {}) {
|
|
|
207
207
|
}
|
|
208
208
|
return null;
|
|
209
209
|
}
|
|
210
|
+
/** The std-lib abort messages the row names in plain words (AssemblyScript's `~lib/util/error.ts`), read only from an
|
|
211
|
+
* abort whose path is the std lib: the author's own abort("Index out of range") stays the author's words. */
|
|
212
|
+
const WRUN_STD_LIB_ABORT_REASONS = {
|
|
213
|
+
'Index out of range': 'index-out-of-range',
|
|
214
|
+
'Key does not exist': 'key-not-found',
|
|
215
|
+
'Array is empty': 'array-empty',
|
|
216
|
+
};
|
|
217
|
+
/** The locale key of each reason the row names in plain words (`scriptEditor.shellConsole.trap.what.*`). */
|
|
218
|
+
const WRUN_TRAP_WHAT_KEYS = {
|
|
219
|
+
'index-out-of-range': 'indexOutOfRange',
|
|
220
|
+
'key-not-found': 'keyNotFound',
|
|
221
|
+
'array-empty': 'arrayEmpty',
|
|
222
|
+
unreachable: 'unreachable',
|
|
223
|
+
};
|
|
224
|
+
/** What failed, in plain words: a std-lib check by name, the engine's `unreachable`, else the guest's own abort words,
|
|
225
|
+
* else that it called abort(); empty for a record no words name (another engine trap, a host refusal). */
|
|
226
|
+
export function wrunTrapWhat(trap, translate) {
|
|
227
|
+
const reason = wrunTrapReasonOf(trap);
|
|
228
|
+
const whatKey = WRUN_TRAP_WHAT_KEYS[reason];
|
|
229
|
+
if (whatKey !== undefined)
|
|
230
|
+
return translate(`${WRUN_TRAP_LOCALE_PREFIX}.what.${whatKey}`);
|
|
231
|
+
if (trap.kind !== 'abort')
|
|
232
|
+
return '';
|
|
233
|
+
const words = trap.abort?.message?.trim().replace(/\.+$/, '') ?? '';
|
|
234
|
+
return words !== '' ? words : translate(`${WRUN_TRAP_LOCALE_PREFIX}.what.abort`);
|
|
235
|
+
}
|
|
236
|
+
export const WRUN_TRAP_LOCALE_PREFIX = 'scriptEditor.shellConsole.trap';
|
|
237
|
+
/** What failed, decided from the record alone (never from a message text). */
|
|
238
|
+
export function wrunTrapReasonOf(trap) {
|
|
239
|
+
if (trap.kind === 'abort') {
|
|
240
|
+
const path = trap.abort?.path ?? '';
|
|
241
|
+
const message = trap.abort?.message?.trim() ?? '';
|
|
242
|
+
return (path.startsWith('~lib/') ? WRUN_STD_LIB_ABORT_REASONS[message] : undefined) ?? 'abort';
|
|
243
|
+
}
|
|
244
|
+
if (trap.kind === 'native')
|
|
245
|
+
return WRUN_UNREACHABLE_TRAP_RE.test(trap.native?.message.trim() ?? '') ? 'unreachable' : 'native';
|
|
246
|
+
return 'host';
|
|
247
|
+
}
|
|
248
|
+
/** `2026-11-14 10:00` for an epoch-ms time (UTC: the sentence says so), the number itself for a time that is none. */
|
|
249
|
+
function wrunTrapBarTime(ts) {
|
|
250
|
+
if (!Number.isFinite(ts))
|
|
251
|
+
return String(ts);
|
|
252
|
+
const date = new Date(ts);
|
|
253
|
+
return Number.isNaN(date.getTime()) ? String(ts) : date.toISOString().slice(0, 16).replace('T', ' ');
|
|
254
|
+
}
|
|
255
|
+
/** Where the trap happened: the bar (1-based, as the row's `barIndex`) and its time, or before the first bar. */
|
|
256
|
+
export function wrunTrapWhere(trap, translate) {
|
|
257
|
+
return trap.bar
|
|
258
|
+
? translate(`${WRUN_TRAP_LOCALE_PREFIX}.onBar`, { bar: trap.bar.index + 1, time: wrunTrapBarTime(trap.bar.ts) })
|
|
259
|
+
: translate(`${WRUN_TRAP_LOCALE_PREFIX}.beforeBars`);
|
|
260
|
+
}
|
|
261
|
+
/** The fields every trap row carries: the 1-based bar (the normalizer drops a 0), the host's words and the record. */
|
|
262
|
+
function wrunTrapRowFields(trap, reason, hostMessage, libSite) {
|
|
263
|
+
const details = {
|
|
264
|
+
kind: trap.kind,
|
|
265
|
+
phase: trap.phase,
|
|
266
|
+
reason,
|
|
267
|
+
...(trap.bar ? { barTs: trap.bar.ts } : {}),
|
|
268
|
+
...(libSite !== undefined ? { libSite } : {}),
|
|
269
|
+
};
|
|
270
|
+
return {
|
|
271
|
+
...(trap.bar ? { barIndex: trap.bar.index + 1 } : {}),
|
|
272
|
+
details: { hostMessage: hostMessage.trim(), trap: details },
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* The trap row built from the ABI host's record (`WrunTrapContext`, captured at the guest-call boundary): `code`,
|
|
277
|
+
* `stage` and `reason` are decided from the record first, then the words. An abort says what failed in plain words
|
|
278
|
+
* (a std-lib check by name, else the guest's own words, else that it called abort()) and on which bar, without the
|
|
279
|
+
* library path; the row keeps the line and column only when the abort names src/indicator.ts. An `unreachable` keeps
|
|
280
|
+
* today's memory sentence plus the bar. A host failure keeps today's row and words. Every row carries `barIndex`
|
|
281
|
+
* (1-based), `details.hostMessage` (the sandbox's words, untouched) and `details.trap`. Null for a record no row
|
|
282
|
+
* speaks for (another engine trap, a host refusal outside the run failure rows): today's surface.
|
|
283
|
+
*/
|
|
284
|
+
export function wrunTrapRuntimeDiagnostic(trap, hostMessage, translate, context = {}) {
|
|
285
|
+
const reason = wrunTrapReasonOf(trap);
|
|
286
|
+
if (trap.kind === 'abort') {
|
|
287
|
+
const abort = trap.abort ?? { message: null, path: null, line: 0, column: 0 };
|
|
288
|
+
const anchored = abort.path === WRUN_ABORT_ENTRY_FILE && abort.line > 0;
|
|
289
|
+
const words = abort.message?.trim().replace(/\.+$/, '') ?? '';
|
|
290
|
+
const kitClass = anchored ? undefined : WRUN_KIT_ABORT_CLASS.exec(words)?.groups?.name;
|
|
291
|
+
const libSite = abort.path !== null && abort.path !== WRUN_ABORT_ENTRY_FILE
|
|
292
|
+
? abort.line > 0
|
|
293
|
+
? `${abort.path}:${abort.line}:${abort.column}`
|
|
294
|
+
: abort.path
|
|
295
|
+
: undefined;
|
|
296
|
+
const what = wrunTrapWhat(trap, translate);
|
|
297
|
+
const fields = wrunTrapRowFields(trap, reason, hostMessage, libSite);
|
|
298
|
+
return {
|
|
299
|
+
stage: 'compute',
|
|
300
|
+
severity: 'error',
|
|
301
|
+
code: WRUN_ABORT_DIAGNOSTIC_CODE,
|
|
302
|
+
message: translate(`${WRUN_TRAP_LOCALE_PREFIX}.plain`, { what, where: wrunTrapWhere(trap, translate) }),
|
|
303
|
+
type: 'execution',
|
|
304
|
+
...(anchored ? { line: abort.line, ...(abort.column > 0 ? { column: abort.column } : {}) } : {}),
|
|
305
|
+
...(fields.barIndex !== undefined ? { barIndex: fields.barIndex } : {}),
|
|
306
|
+
details: { ...(kitClass !== undefined ? { anchorClass: kitClass } : {}), ...fields.details },
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
// Another engine trap keeps today's surface (no row).
|
|
310
|
+
if (reason === 'native')
|
|
311
|
+
return null;
|
|
312
|
+
const row = wrunRunFailureRuntimeDiagnostic(hostMessage, context);
|
|
313
|
+
if (row === null)
|
|
314
|
+
return null;
|
|
315
|
+
const fields = wrunTrapRowFields(trap, reason, hostMessage, undefined);
|
|
316
|
+
return {
|
|
317
|
+
...row,
|
|
318
|
+
...(reason === 'unreachable' ? { message: `${row.message} ${wrunTrapWhere(trap, translate)}` } : {}),
|
|
319
|
+
...(fields.barIndex !== undefined ? { barIndex: fields.barIndex } : {}),
|
|
320
|
+
details: { ...row.details, ...fields.details },
|
|
321
|
+
};
|
|
322
|
+
}
|
|
210
323
|
function isObject(value) {
|
|
211
324
|
return typeof value === 'object' && value !== null;
|
|
212
325
|
}
|
|
@@ -46,6 +46,7 @@ export const AssetClass = numericEnum({
|
|
|
46
46
|
ASSET_CLASS_INDEX: 7,
|
|
47
47
|
ASSET_CLASS_PREDICTION: 8,
|
|
48
48
|
ASSET_CLASS_ECONOMIC: 9,
|
|
49
|
+
ASSET_CLASS_FIXED_INCOME: 10,
|
|
49
50
|
});
|
|
50
51
|
export const Category = numericEnum({
|
|
51
52
|
UNKNOWN_CATEGORY: 0,
|
|
@@ -207,6 +208,8 @@ export const Exchange = numericEnum({
|
|
|
207
208
|
LIGHTER: 177,
|
|
208
209
|
VARIATIONAL: 178,
|
|
209
210
|
VARIATIONAL_SWAP: 179,
|
|
211
|
+
FRED: 180,
|
|
212
|
+
CFTC: 181,
|
|
210
213
|
});
|
|
211
214
|
export const Representation = numericEnum({
|
|
212
215
|
UNKNOWN_REPRESENTATION: 0,
|
|
@@ -66,6 +66,7 @@ import type { DisplayOffset } from '../chart/display-offset.leaf.js';
|
|
|
66
66
|
import { type WrunCellsCapSummary } from './wrun-cap-notice.util.js';
|
|
67
67
|
import { type WrunCanvasReadout } from './wrun-canvas-readout.util.js';
|
|
68
68
|
import { wrunCanvasMergeLive } from './wrun-canvases.util.js';
|
|
69
|
+
import './wrun-colour-tone.util.js';
|
|
69
70
|
import { type WrunColorTheme } from './wrun-style-words.util.js';
|
|
70
71
|
export { decodeWrunFlagMeta, decodeWrunMarkMeta, decodeWrunSpanMeta, formatWrunBatchedNumber, isWrunBatchedNumberFormat, WRUN_BATCHED_NUMBER_FORMATS, wrunBatchedReadoutText, wrunMarkQtyInUnits, WRUN_MARK_META_MAX_OFFSET_MS, type WrunBatchedNumberFormat, type WrunFlagMeta, type WrunMarkMeta, type WrunSpanMeta, } from './wrun-batched-readout.util.js';
|
|
71
72
|
export type { WrunBatchedHoverRecord } from './wrun-canvas-readout.util.js';
|
|
@@ -111,14 +112,18 @@ export interface WrunBatchedSectionSpec {
|
|
|
111
112
|
firstOutput: number;
|
|
112
113
|
stride: number;
|
|
113
114
|
declaration: WrunBatchedSection;
|
|
115
|
+
/** The section's title, the one order every surface titles it in (wrun-style-names.util wrunStyleTitle): the
|
|
116
|
+
* sheet's `style_names` label, else its own readout `label`, else its name read as words. Its hover readout
|
|
117
|
+
* carries it (`{{label}}` prints it). */
|
|
118
|
+
title: string;
|
|
114
119
|
/** Why this chart cannot draw the section (its declaration names a layout newer than this build:
|
|
115
120
|
* a stride, a key or an option value the gate does not know), absent when it can. Its child is
|
|
116
121
|
* refused by name ("Needs a newer chart") and the rest of the Indicator runs; the geometry above
|
|
117
122
|
* is then a placeholder (the section's outputs are never read). */
|
|
118
123
|
newer?: string;
|
|
119
124
|
}
|
|
120
|
-
/** The sheet slice the sections are read from. */
|
|
121
|
-
export type WrunBatchedSheet = Pick<WrunIndicatorMetadata, 'id' | 'outputs'> & Partial<Pick<WrunIndicatorMetadata, WrunBatchedMarksKind>>;
|
|
125
|
+
/** The sheet slice the sections are read from (`style_names`: the words their titles read first). */
|
|
126
|
+
export type WrunBatchedSheet = Pick<WrunIndicatorMetadata, 'id' | 'outputs'> & Partial<Pick<WrunIndicatorMetadata, WrunBatchedMarksKind | 'style_names'>>;
|
|
122
127
|
/** The cells one kept bar of a section costs: its child row, the timestamp and every field of every
|
|
123
128
|
* slot (`1 + slots * stride`), and nothing else (the parent run's columns and a replace's old copy
|
|
124
129
|
* are not charged; the header says why). Empty slots count: the row is as wide as the section. */
|
|
@@ -243,15 +248,20 @@ export declare function wrunBatchedMarksChildren(sheet: WrunBatchedSheet, output
|
|
|
243
248
|
* number decoded (a packed theme token through its word, the existing packed-colour decode for the
|
|
244
249
|
* rest); undefined when it is neither. */
|
|
245
250
|
export declare function resolveWrunBatchedColor(value: unknown, theme: WrunColorTheme): string | undefined;
|
|
251
|
+
/** The batched marks level a chart's engine draws (`tc.packHooks.batchedMarksLevel`, set by its batchedMarks pack):
|
|
252
|
+
* 0 when the chart carries none (an engine before the Big Trades looks round). */
|
|
253
|
+
export declare function wrunBatchedMarksLevelOf(tc: unknown): number;
|
|
246
254
|
/**
|
|
247
255
|
* Why the chart's engine cannot draw a batched child its kind's renderer draws, null when it can: the mount asks it
|
|
248
256
|
* once the engine gate passed the kind (the pack settled and registered, `hasPlotRenderer` the engine's own answer).
|
|
249
257
|
* A marks child whose look needs the dark pool round's engine (look 4, the `log` law, a `min_px` or `max_px` bound)
|
|
250
258
|
* on an engine without that release's `flags` renderer is refused by name ("Needs a newer chart"), as an unknown
|
|
251
|
-
* look is by the layout gate, never drawn as another look.
|
|
252
|
-
*
|
|
259
|
+
* look is by the layout gate, never drawn as another look. So is one that needs the Big Trades looks round's engine
|
|
260
|
+
* (look 5 Glass, look 6 Solid, or the size beside the mark, `text.place` 1) on an engine whose marks pack reads below
|
|
261
|
+
* level 2 (`marksLevel`, `wrunBatchedMarksLevelOf`; 0 when the caller passes none). A flags child is never judged
|
|
262
|
+
* here: the gate already asked the engine for its kind. The reason is diagnostic text, never copy.
|
|
253
263
|
*/
|
|
254
|
-
export declare function wrunBatchedEngineVerdict(child: Pick<WrunBatchedChildOverlay, 'kind' | 'settings'>, hasPlotRenderer: (type: string) => boolean): string | null;
|
|
264
|
+
export declare function wrunBatchedEngineVerdict(child: Pick<WrunBatchedChildOverlay, 'kind' | 'settings'>, hasPlotRenderer: (type: string) => boolean, marksLevel?: number): string | null;
|
|
255
265
|
export interface WrunBatchedChildConfig {
|
|
256
266
|
id: string;
|
|
257
267
|
plot: WrunBatchedMarksKind;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { WRUN_BATCHED_MARKS_KINDS } from './wrun-batched-kinds.leaf.js';
|
|
2
2
|
import { WRUN_BATCHED_MARKS_CELL_BUDGET } from '../chart/overlay-output-budget.util.js';
|
|
3
|
-
import {
|
|
3
|
+
import { wrunStyleTitle } from './wrun-style-names.util.js';
|
|
4
4
|
import { scheduleWrunCellsCapNotice } from './wrun-cap-notice.util.js';
|
|
5
5
|
import { forgetWrunCanvasReadout, rememberWrunCanvasReadout } from './wrun-canvas-readout.util.js';
|
|
6
6
|
import { wrunCanvasMergeLive } from './wrun-canvases.util.js';
|
|
7
7
|
import { decodeWrunPackedColor, isWrunStyleTargetHidden, wrunPaintedDeclarationOf } from './wrun-color-settings.util.js';
|
|
8
8
|
import { WRUN_HEATMAP_TRIM_WATERMARK, wrunHeatmapCellShares, wrunHeatmapTrimTarget, } from './wrun-heatmap-cell-budget.util.js';
|
|
9
|
+
// The mark colours (`theme.up_mark`, `theme.down_mark`) a marks child resolves: bound here, off the boot path.
|
|
10
|
+
import './wrun-colour-tone.util.js';
|
|
9
11
|
import { resolveWrunColorWord, wrunThemeTokenOfPacked, wrunThemeTokenWord, } from './wrun-style-words.util.js';
|
|
10
12
|
import { decodeWrunMarkMeta, decodeWrunSpanMeta, isWrunBatchedNumberFormat, WRUN_BATCHED_NUMBER_FORMATS, wrunBatchedReadoutText, wrunMarkUnitValue, } from './wrun-batched-readout.util.js';
|
|
11
13
|
export { decodeWrunFlagMeta, decodeWrunMarkMeta, decodeWrunSpanMeta, formatWrunBatchedNumber, isWrunBatchedNumberFormat, WRUN_BATCHED_NUMBER_FORMATS, wrunBatchedReadoutText, wrunMarkQtyInUnits, WRUN_MARK_META_MAX_OFFSET_MS, } from './wrun-batched-readout.util.js';
|
|
@@ -91,7 +93,7 @@ const LOOK_DEFAULTS = {
|
|
|
91
93
|
size: { law: 'sqrt', unit: 1, scale: 5 },
|
|
92
94
|
opacity_pct: 30,
|
|
93
95
|
look: 0,
|
|
94
|
-
text: { mode: 1, field: 'qty', format: 'compact', min_px: 22 },
|
|
96
|
+
text: { mode: 1, field: 'qty', format: 'compact', min_px: 22, place: 0 },
|
|
95
97
|
x: 0,
|
|
96
98
|
colors: ['theme.down', 'theme.up'],
|
|
97
99
|
tooltip: null,
|
|
@@ -202,6 +204,7 @@ export function readWrunBatchedSections(sheet) {
|
|
|
202
204
|
if (names.has(name))
|
|
203
205
|
throw sectionRefusal(sheetId, subject, 'the name is taken by another batched section');
|
|
204
206
|
names.add(name);
|
|
207
|
+
const title = wrunStyleTitle(sheet, `${kind}:${name}`, name, entry.label);
|
|
205
208
|
// A layout newer than this chart (the gate, cached per declaration): its child alone is refused, by
|
|
206
209
|
// name, at the mount; the rules below are this layout's and never judge a newer one.
|
|
207
210
|
const newer = wrunBatchedLayoutVerdict(kind, entry);
|
|
@@ -213,6 +216,7 @@ export function readWrunBatchedSections(sheet) {
|
|
|
213
216
|
firstOutput: 0,
|
|
214
217
|
stride: WRUN_BATCHED_STRIDE[kind],
|
|
215
218
|
declaration: entry,
|
|
219
|
+
title,
|
|
216
220
|
newer,
|
|
217
221
|
});
|
|
218
222
|
return;
|
|
@@ -267,6 +271,7 @@ export function readWrunBatchedSections(sheet) {
|
|
|
267
271
|
firstOutput: first,
|
|
268
272
|
stride,
|
|
269
273
|
declaration: entry,
|
|
274
|
+
title,
|
|
270
275
|
});
|
|
271
276
|
});
|
|
272
277
|
}
|
|
@@ -346,20 +351,31 @@ function wholeIn(value, min, max, fallback) {
|
|
|
346
351
|
function clampTo(value, min, max, fallback) {
|
|
347
352
|
return finite(value) ? Math.min(max, Math.max(min, value)) : fallback;
|
|
348
353
|
}
|
|
349
|
-
/** A word among `words` (its index), a whole number among the indexes, else
|
|
350
|
-
|
|
354
|
+
/** A word among `words` (its index) or among `aliases` (the index it names), a whole number among the indexes, else
|
|
355
|
+
* `fallback`. */
|
|
356
|
+
function wordIndex(value, words, fallback, aliases = {}) {
|
|
351
357
|
if (typeof value === 'string') {
|
|
352
358
|
const at = words.indexOf(value);
|
|
353
|
-
return at
|
|
359
|
+
return at !== -1 ? at : Object.hasOwn(aliases, value) ? aliases[value] : fallback;
|
|
354
360
|
}
|
|
355
361
|
return wholeIn(value, 0, words.length - 1, fallback);
|
|
356
362
|
}
|
|
357
|
-
/** The marks look words (round-2 fold 1), the numbers canonical; the first contract's words read too,
|
|
358
|
-
* word `diamond` (the dark pool round). */
|
|
359
|
-
const MARK_LOOKS = ['circle', 'dot', 'ring', 'square', 'diamond'];
|
|
363
|
+
/** The marks look words (round-2 fold 1), the numbers canonical; the first contract's words read too, look 4's
|
|
364
|
+
* word `diamond` (the dark pool round), and looks 5 and 6, `glass` and `solid` (the Big Trades looks round). */
|
|
365
|
+
const MARK_LOOKS = ['circle', 'dot', 'ring', 'square', 'diamond', 'glass', 'solid'];
|
|
366
|
+
/** The kit's own words for looks 0 and 1 (`WRUN_MARK_LOOKS`): a select bound to `look` through `style_values`
|
|
367
|
+
* paints these words, so they read as the looks they name. */
|
|
368
|
+
const MARK_LOOK_KIT_WORDS = { bubble: 0, soft_dot: 1 };
|
|
360
369
|
/** The diamond's index: a look an engine before the dark pool round's draws as another (`wrunBatchedEngineVerdict`). */
|
|
361
370
|
const DIAMOND_LOOK = MARK_LOOKS.indexOf('diamond');
|
|
371
|
+
/** Glass and Solid: looks an engine before the Big Trades looks round draws as another (`wrunBatchedEngineVerdict`). */
|
|
372
|
+
const GLASS_LOOK = MARK_LOOKS.indexOf('glass');
|
|
373
|
+
const SOLID_LOOK = MARK_LOOKS.indexOf('solid');
|
|
362
374
|
const MARK_TEXT_MODES = ['off', 'largest', 'all'];
|
|
375
|
+
/** Where a mark's size is written (`text.place`, the Big Trades looks round): 0 inside the mark (today's drawing),
|
|
376
|
+
* 1 beside it. */
|
|
377
|
+
const MARK_TEXT_PLACES = ['inside', 'beside'];
|
|
378
|
+
const BESIDE_PLACE = MARK_TEXT_PLACES.indexOf('beside');
|
|
363
379
|
const MARK_X_WORDS = ['bar', 'offset'];
|
|
364
380
|
/** The size laws: sqrt and linear, and log (the dark pool round's, with the `min_px` / `max_px` bounds). */
|
|
365
381
|
const MARK_SIZE_LAWS = ['sqrt', 'linear', 'log'];
|
|
@@ -388,9 +404,13 @@ const KNOWN_STRIDES = {
|
|
|
388
404
|
/** An option's values: its indexes, then its words (what the look readers take). */
|
|
389
405
|
const optionValues = (words) => [...words.keys(), ...words];
|
|
390
406
|
/** The marks options by index, or by the first contract's words (what the look readers take). */
|
|
391
|
-
const MARK_LOOK_VALUES =
|
|
407
|
+
const MARK_LOOK_VALUES = [
|
|
408
|
+
...optionValues(MARK_LOOKS),
|
|
409
|
+
...Object.keys(MARK_LOOK_KIT_WORDS),
|
|
410
|
+
];
|
|
392
411
|
const MARK_X_VALUES = optionValues(MARK_X_WORDS);
|
|
393
412
|
const MARK_TEXT_MODE_VALUES = optionValues(MARK_TEXT_MODES);
|
|
413
|
+
const MARK_TEXT_PLACE_VALUES = optionValues(MARK_TEXT_PLACES);
|
|
394
414
|
/** The size keys marks and flags read (`min_px` and `max_px` the dark pool round's). */
|
|
395
415
|
const MARK_SIZE_VOCABULARY = {
|
|
396
416
|
law: MARK_SIZE_LAWS,
|
|
@@ -417,7 +437,13 @@ const SECTION_VOCABULARY = {
|
|
|
417
437
|
size: MARK_SIZE_VOCABULARY,
|
|
418
438
|
opacity_pct: ANY,
|
|
419
439
|
look: MARK_LOOK_VALUES,
|
|
420
|
-
text: {
|
|
440
|
+
text: {
|
|
441
|
+
mode: MARK_TEXT_MODE_VALUES,
|
|
442
|
+
field: ['qty'],
|
|
443
|
+
format: WRUN_BATCHED_NUMBER_FORMATS,
|
|
444
|
+
min_px: ANY,
|
|
445
|
+
place: MARK_TEXT_PLACE_VALUES,
|
|
446
|
+
},
|
|
421
447
|
x: MARK_X_VALUES,
|
|
422
448
|
colors: ANY,
|
|
423
449
|
tooltip: ANY,
|
|
@@ -596,13 +622,14 @@ function markCaptionFloorPx(declaredPx, scale) {
|
|
|
596
622
|
const scaled = Math.round((declaredPx * markSizeK(scale)) / markSizeK(LOOK_DEFAULTS.marks.size.scale));
|
|
597
623
|
return Math.min(scaled, markMaxDiameterPx(scale));
|
|
598
624
|
}
|
|
599
|
-
/** The marks look the engine draws (r6 parity): `look` 0..
|
|
625
|
+
/** The marks look the engine draws (r6 parity): `look` 0..6 (Bubble, Soft dot, Ring, Square, Diamond, Glass,
|
|
626
|
+
* Solid; by number, by word, or by the kit's words `bubble` and `soft_dot`), the
|
|
600
627
|
* size law over the quantity (`unit` the Min size, `scale` the Bubble size 1..10; `log` and the `min_px` /
|
|
601
628
|
* `max_px` bounds when declared, `markSizeOf`), `x` 0..1
|
|
602
629
|
* (Candle center, Trade time), `opacity_pct` 10..80, the caption (`text.mode` 0 Off, 1 Big
|
|
603
|
-
* bubbles, 2 All; its format, a word of the one list,
|
|
604
|
-
* at the default Bubble size, handed scaled to this one). A key
|
|
605
|
-
* left out, or an option that is none of its values (look, x, law, the caption's mode and
|
|
630
|
+
* bubbles, 2 All; its format, a word of the one list, the smallest bubble that holds one: declared
|
|
631
|
+
* at the default Bubble size, handed scaled to this one; and `place`, 0 inside the mark or 1 beside it). A key
|
|
632
|
+
* left out, or an option that is none of its values (look, x, law, the caption's mode, format and place),
|
|
606
633
|
* takes the kit's default (LOOK_DEFAULTS.marks); a number past its range is clamped. The market's
|
|
607
634
|
* dollar unit (`valuePerUnit`, proven: finite and above zero) rides at the top for the `units`
|
|
608
635
|
* caption; without one, `units` is handed to the engine as `usd`. */
|
|
@@ -617,7 +644,7 @@ function marksSettings(section, valuePerUnit) {
|
|
|
617
644
|
const format = written === 'units' && valuePerUnit === undefined ? 'usd' : written;
|
|
618
645
|
const scale = size.scale;
|
|
619
646
|
return {
|
|
620
|
-
look: wordIndex(section.look ?? legacyShape, MARK_LOOKS, defaults.look),
|
|
647
|
+
look: wordIndex(section.look ?? legacyShape, MARK_LOOKS, defaults.look, MARK_LOOK_KIT_WORDS),
|
|
621
648
|
size,
|
|
622
649
|
x: wordIndex(section.x, MARK_X_WORDS, defaults.x),
|
|
623
650
|
colors: [...(section.colors ?? defaults.colors)],
|
|
@@ -627,6 +654,7 @@ function marksSettings(section, valuePerUnit) {
|
|
|
627
654
|
field: defaults.text.field,
|
|
628
655
|
format,
|
|
629
656
|
min_px: markCaptionFloorPx(clampTo(text.min_px, 0, 64, defaults.text.min_px), scale),
|
|
657
|
+
place: wordIndex(text.place, MARK_TEXT_PLACES, defaults.text.place),
|
|
630
658
|
},
|
|
631
659
|
...(valuePerUnit !== undefined ? { valuePerUnit } : {}),
|
|
632
660
|
};
|
|
@@ -717,7 +745,6 @@ function readoutOf(spec, valuePerUnit) {
|
|
|
717
745
|
const tooltip = tooltipOf(spec.declaration);
|
|
718
746
|
if (tooltip === null)
|
|
719
747
|
return undefined;
|
|
720
|
-
const label = spec.declaration.label;
|
|
721
748
|
const words = spec.kind === 'marks'
|
|
722
749
|
? []
|
|
723
750
|
: spec.kind === 'flags'
|
|
@@ -726,7 +753,7 @@ function readoutOf(spec, valuePerUnit) {
|
|
|
726
753
|
const timed = isWrunBatchedTimedLayout(spec.kind, spec.stride);
|
|
727
754
|
const readout = {
|
|
728
755
|
kind: spec.kind,
|
|
729
|
-
label:
|
|
756
|
+
label: spec.title,
|
|
730
757
|
tooltip,
|
|
731
758
|
format: {},
|
|
732
759
|
...(words.length > 0 ? { words } : {}),
|
|
@@ -869,17 +896,40 @@ function fallbackColor(kind, at, theme) {
|
|
|
869
896
|
* contract). An engine before it has no `flags` renderer, clamps the look to 0..3 and reads only the sqrt and
|
|
870
897
|
* linear laws, so it would draw another look or size than the declared one, silently. */
|
|
871
898
|
const DIAMOND_ENGINE_PLOT = 'flags';
|
|
899
|
+
/** The marks pack level that draws Glass (look 5), Solid (look 6) and the size beside the mark (`text.place` 1):
|
|
900
|
+
* the engine's batchedMarks pack sets `packHooks.batchedMarksLevel` to it; an older engine leaves it absent. */
|
|
901
|
+
const BIG_TRADES_LOOKS_LEVEL = 2;
|
|
902
|
+
/** The batched marks level a chart's engine draws (`tc.packHooks.batchedMarksLevel`, set by its batchedMarks pack):
|
|
903
|
+
* 0 when the chart carries none (an engine before the Big Trades looks round). */
|
|
904
|
+
export function wrunBatchedMarksLevelOf(tc) {
|
|
905
|
+
const hooks = isRecord(tc) ? tc.packHooks : undefined;
|
|
906
|
+
const level = isRecord(hooks) ? hooks.batchedMarksLevel : undefined;
|
|
907
|
+
return finite(level) ? level : 0;
|
|
908
|
+
}
|
|
872
909
|
/**
|
|
873
910
|
* Why the chart's engine cannot draw a batched child its kind's renderer draws, null when it can: the mount asks it
|
|
874
911
|
* once the engine gate passed the kind (the pack settled and registered, `hasPlotRenderer` the engine's own answer).
|
|
875
912
|
* A marks child whose look needs the dark pool round's engine (look 4, the `log` law, a `min_px` or `max_px` bound)
|
|
876
913
|
* on an engine without that release's `flags` renderer is refused by name ("Needs a newer chart"), as an unknown
|
|
877
|
-
* look is by the layout gate, never drawn as another look.
|
|
878
|
-
*
|
|
914
|
+
* look is by the layout gate, never drawn as another look. So is one that needs the Big Trades looks round's engine
|
|
915
|
+
* (look 5 Glass, look 6 Solid, or the size beside the mark, `text.place` 1) on an engine whose marks pack reads below
|
|
916
|
+
* level 2 (`marksLevel`, `wrunBatchedMarksLevelOf`; 0 when the caller passes none). A flags child is never judged
|
|
917
|
+
* here: the gate already asked the engine for its kind. The reason is diagnostic text, never copy.
|
|
879
918
|
*/
|
|
880
|
-
export function wrunBatchedEngineVerdict(child, hasPlotRenderer) {
|
|
919
|
+
export function wrunBatchedEngineVerdict(child, hasPlotRenderer, marksLevel = 0) {
|
|
881
920
|
if (child.kind !== 'marks')
|
|
882
921
|
return null;
|
|
922
|
+
const text = isRecord(child.settings.text) ? child.settings.text : {};
|
|
923
|
+
const looksNeed = child.settings.look === GLASS_LOOK
|
|
924
|
+
? 'look 5 (glass)'
|
|
925
|
+
: child.settings.look === SOLID_LOOK
|
|
926
|
+
? 'look 6 (solid)'
|
|
927
|
+
: text.place === BESIDE_PLACE
|
|
928
|
+
? 'text.place 1 (beside)'
|
|
929
|
+
: null;
|
|
930
|
+
if (looksNeed !== null && marksLevel < BIG_TRADES_LOOKS_LEVEL) {
|
|
931
|
+
return `${looksNeed} needs the chart engine whose marks pack draws level ${BIG_TRADES_LOOKS_LEVEL}`;
|
|
932
|
+
}
|
|
883
933
|
const size = isRecord(child.settings.size) ? child.settings.size : {};
|
|
884
934
|
const needs = child.settings.look === DIAMOND_LOOK
|
|
885
935
|
? 'look 4 (diamond)'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RuntimeDiagnostic } from '../../interfaces/kscript-diagnostics.interface.js';
|
|
2
2
|
import type { WrunHeatmap, WrunIndicatorMetadata, WrunMatrix, WrunOutputRow, WrunPanel } from '../../interfaces/wrun-runtime.interface.js';
|
|
3
|
+
import './wrun-colour-tone.util.js';
|
|
3
4
|
import { type WrunColorTheme, type WrunNumberFormatSpec } from './wrun-style-words.util.js';
|
|
4
5
|
import { type WrunMatrixFrame } from './wrun-frames.js';
|
|
5
6
|
import { type WrunCanvasReadout } from './wrun-canvas-readout.util.js';
|
|
@@ -104,8 +105,9 @@ export interface WrunCanvasChildConfig {
|
|
|
104
105
|
* (wins over the child's own rows). */
|
|
105
106
|
data?: unknown[];
|
|
106
107
|
}
|
|
107
|
-
/** The default dark palette (wrun-style-words.util 2.3
|
|
108
|
-
*
|
|
108
|
+
/** The default dark palette (wrun-style-words.util 2.3, the palette a chart
|
|
109
|
+
* without a theme answers): what a child's own rows resolve against before
|
|
110
|
+
* the mount hands the chart's theme over. */
|
|
109
111
|
export declare const WRUN_CANVAS_FALLBACK_THEME: Readonly<WrunColorTheme>;
|
|
110
112
|
/** The colour-scale defaults (PT-heatmap): the sequential ramp, the
|
|
111
113
|
* diverging ramp around a centre, the quantile of the auto bounds. */
|
|
@@ -176,13 +178,28 @@ export declare function wrunCellRowsOf(metadata: Pick<WrunIndicatorMetadata, 'in
|
|
|
176
178
|
inputIndexes: ReadonlyArray<number>;
|
|
177
179
|
}>): WrunCellRows;
|
|
178
180
|
/**
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
181
|
+
* The colour scale a heatmap child was decided with, carried onto another child: `to` takes the sample `from`'s
|
|
182
|
+
* bounds were picked from, so a Sensitivity re-pick on `to` reads that sample instead of walking `to`'s rows into
|
|
183
|
+
* another basis. The mount's scale hold calls it when a pass of the same picture brings new rows
|
|
184
|
+
* (wrun-panel-mount.util `carryHeatmapScale`: the held child is the pass's own with the decided bounds). A child
|
|
185
|
+
* with no kept sample (one that crossed a copy) still walks its rows on the next re-pick, as before.
|
|
184
186
|
*/
|
|
185
|
-
export declare function keepWrunHeatmapScaleSample(from:
|
|
187
|
+
export declare function keepWrunHeatmapScaleSample(from: Pick<WrunCanvasChildOverlay, 'settings'>, to: Pick<WrunCanvasChildOverlay, 'settings'>): void;
|
|
188
|
+
/** Whether a heatmap child's colour bounds were picked from a sample kept beside it (`heatmapSamples`), whatever it
|
|
189
|
+
* gave: false for a child whose bounds were all declared and for one that crossed a copy. A mount's merge keeps
|
|
190
|
+
* such a scale on its record, as the engine keeps it on screen. */
|
|
191
|
+
export declare function wrunHeatmapScaleKept(child: Pick<WrunCanvasChildOverlay, 'settings'>): boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Whether the colour bounds a heatmap child shows were given by its kept sample, judged on the sample at the
|
|
194
|
+
* quantile they are read at (`pickCanvasScale`'s `spread`, never the bound numbers): its own bounds at the
|
|
195
|
+
* author's quantile, or, with the viewer's Sensitivity on a child with scale words, the re-pick at that position's
|
|
196
|
+
* quantile. False for a sample with no finite cell, one whose cells all sit at the zero floor, a declared bound or
|
|
197
|
+
* the centre (a grid writing 0 until a late input lands, a window of zero-volume buckets), one where at least the
|
|
198
|
+
* quantile's share of them does, a child with no kept sample, and one whose bounds were all declared: the bounds
|
|
199
|
+
* are then stand-ins or the author's, never a scale the cells chose. The mount holds a scale only when this is true
|
|
200
|
+
* (wrun-panel-mount.util `holdsHeatmapScale`); anything else is decided again by the next pass.
|
|
201
|
+
*/
|
|
202
|
+
export declare function wrunHeatmapScaleDecided(child: WrunCanvasChildOverlay, sensitivity: number | undefined): boolean;
|
|
186
203
|
/** A canvas row as the engine reads it: a plain array. The live book lane
|
|
187
204
|
* hands typed rows (`Float64Array`, wrunLiveBookRows) the worker run wants,
|
|
188
205
|
* which the engine's row readers and live merge skip, so the bars fed live
|
|
@@ -213,7 +230,9 @@ export declare function wrunHeatmapSensitivityRows(sheet: Pick<WrunIndicatorMeta
|
|
|
213
230
|
* re-picked from the child's own scale sample at the position's quantile
|
|
214
231
|
* (the options heatmap's map); the child's own bounds, the author's exactly,
|
|
215
232
|
* when no position is set or the child carries no scale words. The centre
|
|
216
|
-
* never depends on the quantile, so only `min` and `max` move.
|
|
233
|
+
* never depends on the quantile, so only `min` and `max` move. A mounted
|
|
234
|
+
* record's own bounds and sample are its decided scale's (the mount's scale
|
|
235
|
+
* hold), so a re-pick never reads the rows the canvas holds now.
|
|
217
236
|
*/
|
|
218
237
|
export declare function wrunHeatmapSensitivityBounds(child: WrunCanvasChildOverlay, sensitivity: number | undefined): {
|
|
219
238
|
min: number;
|