@orangecharts/wrun-chart-host 0.1.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 +72 -0
- package/dist/constants/governed-exchanges.constants.d.ts +11 -0
- package/dist/constants/governed-exchanges.constants.js +11 -0
- package/dist/constants/indicator-sets.constants.d.ts +8 -0
- package/dist/constants/indicator-sets.constants.js +8 -0
- package/dist/constants/interval.constants.d.ts +34 -0
- package/dist/constants/interval.constants.js +121 -0
- package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.d.ts +28 -0
- package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.js +65 -0
- package/dist/constants/tpo-color-schemes.constants.d.ts +30 -0
- package/dist/constants/tpo-color-schemes.constants.js +32 -0
- package/dist/host-env.d.ts +102 -0
- package/dist/host-env.js +26 -0
- package/dist/index.d.ts +93 -0
- package/dist/index.js +96 -0
- package/dist/indicators/controls/tpo-letter.util.d.ts +2 -0
- package/dist/indicators/controls/tpo-letter.util.js +13 -0
- package/dist/indicators/controls/tpo-session.util.d.ts +99 -0
- package/dist/indicators/controls/tpo-session.util.js +389 -0
- package/dist/interfaces/kscript-diagnostics.interface.d.ts +64 -0
- package/dist/interfaces/kscript-diagnostics.interface.js +1 -0
- package/dist/interfaces/om-panel-data.interface.d.ts +103 -0
- package/dist/interfaces/om-panel-data.interface.js +7 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +2659 -0
- package/dist/interfaces/wrun-runtime.interface.js +55 -0
- package/dist/utility/chart/calendar-interval.util.d.ts +24 -0
- package/dist/utility/chart/calendar-interval.util.js +81 -0
- package/dist/utility/chart/candle-bar-end.util.d.ts +15 -0
- package/dist/utility/chart/candle-bar-end.util.js +23 -0
- package/dist/utility/chart/cme-realtime.util.d.ts +24 -0
- package/dist/utility/chart/cme-realtime.util.js +53 -0
- package/dist/utility/chart/interval-ladder.util.d.ts +27 -0
- package/dist/utility/chart/interval-ladder.util.js +92 -0
- package/dist/utility/chart/kscript-drawing-prep.util.d.ts +40 -0
- package/dist/utility/chart/kscript-drawing-prep.util.js +184 -0
- package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +95 -0
- package/dist/utility/chart/kscript-drawing-safe-area.util.js +805 -0
- package/dist/utility/chart/kscript-legend-entries.util.d.ts +166 -0
- package/dist/utility/chart/kscript-legend-entries.util.js +538 -0
- package/dist/utility/chart/kscript-output-role.util.d.ts +32 -0
- package/dist/utility/chart/kscript-output-role.util.js +215 -0
- package/dist/utility/chart/kscript-provenance-keys.util.d.ts +22 -0
- package/dist/utility/chart/kscript-provenance-keys.util.js +56 -0
- package/dist/utility/chart/kscript-run-result-normalize.util.d.ts +53 -0
- package/dist/utility/chart/kscript-run-result-normalize.util.js +476 -0
- package/dist/utility/chart/kscript-run-result-shape.util.d.ts +14 -0
- package/dist/utility/chart/kscript-run-result-shape.util.js +66 -0
- package/dist/utility/chart/kscript-titancharts-container.util.d.ts +29 -0
- package/dist/utility/chart/kscript-titancharts-container.util.js +151 -0
- package/dist/utility/chart/kscript-viewport-overlays.util.d.ts +83 -0
- package/dist/utility/chart/kscript-viewport-overlays.util.js +443 -0
- package/dist/utility/chart/om-panel-push-style.util.d.ts +78 -0
- package/dist/utility/chart/om-panel-push-style.util.js +301 -0
- package/dist/utility/chart/om-panel.util.d.ts +166 -0
- package/dist/utility/chart/om-panel.util.js +815 -0
- package/dist/utility/chart/om-series.util.d.ts +42 -0
- package/dist/utility/chart/om-series.util.js +330 -0
- package/dist/utility/chart/om-target.util.d.ts +11 -0
- package/dist/utility/chart/om-target.util.js +24 -0
- package/dist/utility/chart/om-widget.util.d.ts +148 -0
- package/dist/utility/chart/om-widget.util.js +413 -0
- package/dist/utility/chart/overlay-output-budget.util.d.ts +16 -0
- package/dist/utility/chart/overlay-output-budget.util.js +109 -0
- package/dist/utility/chart/overlay-paint-flags.util.d.ts +24 -0
- package/dist/utility/chart/overlay-paint-flags.util.js +55 -0
- package/dist/utility/chart/profile-row-height.util.d.ts +21 -0
- package/dist/utility/chart/profile-row-height.util.js +110 -0
- package/dist/utility/chart/session-interval.util.d.ts +1 -0
- package/dist/utility/chart/session-interval.util.js +35 -0
- package/dist/utility/chart/technical-script-legend-value.util.d.ts +18 -0
- package/dist/utility/chart/technical-script-legend-value.util.js +53 -0
- package/dist/utility/chart/trading-day.util.d.ts +70 -0
- package/dist/utility/chart/trading-day.util.js +238 -0
- package/dist/utility/chart/wrun-legend-name.util.d.ts +25 -0
- package/dist/utility/chart/wrun-legend-name.util.js +87 -0
- package/dist/utility/chart/wrun-run-result.util.d.ts +977 -0
- package/dist/utility/chart/wrun-run-result.util.js +5179 -0
- package/dist/utility/chart/wrun-visibility-chart.util.d.ts +25 -0
- package/dist/utility/chart/wrun-visibility-chart.util.js +22 -0
- package/dist/utility/indicators/heatmap-sensitivity.util.d.ts +62 -0
- package/dist/utility/indicators/heatmap-sensitivity.util.js +82 -0
- package/dist/utility/number-format.util.d.ts +68 -0
- package/dist/utility/number-format.util.js +188 -0
- package/dist/utility/v2/opra-governed.util.d.ts +1 -0
- package/dist/utility/v2/opra-governed.util.js +13 -0
- package/dist/utility/wrun/wrun-auto-row.util.d.ts +54 -0
- package/dist/utility/wrun/wrun-auto-row.util.js +96 -0
- package/dist/utility/wrun/wrun-batched-marks.util.d.ts +341 -0
- package/dist/utility/wrun/wrun-batched-marks.util.js +938 -0
- package/dist/utility/wrun/wrun-batched-readout.util.d.ts +75 -0
- package/dist/utility/wrun/wrun-batched-readout.util.js +171 -0
- package/dist/utility/wrun/wrun-box-segment.util.d.ts +185 -0
- package/dist/utility/wrun/wrun-box-segment.util.js +570 -0
- package/dist/utility/wrun/wrun-build-memo.util.d.ts +133 -0
- package/dist/utility/wrun/wrun-build-memo.util.js +301 -0
- package/dist/utility/wrun/wrun-builtin-twin-ports.util.d.ts +25 -0
- package/dist/utility/wrun/wrun-builtin-twin-ports.util.js +75 -0
- package/dist/utility/wrun/wrun-builtin-twin.util.d.ts +9 -0
- package/dist/utility/wrun/wrun-builtin-twin.util.js +40 -0
- package/dist/utility/wrun/wrun-canvas-cache.util.d.ts +28 -0
- package/dist/utility/wrun/wrun-canvas-cache.util.js +56 -0
- package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +69 -0
- package/dist/utility/wrun/wrun-canvas-readout.util.js +53 -0
- package/dist/utility/wrun/wrun-canvases.util.d.ts +295 -0
- package/dist/utility/wrun/wrun-canvases.util.js +1432 -0
- package/dist/utility/wrun/wrun-cap-notice.util.d.ts +77 -0
- package/dist/utility/wrun/wrun-cap-notice.util.js +296 -0
- package/dist/utility/wrun/wrun-card-style.util.d.ts +154 -0
- package/dist/utility/wrun/wrun-card-style.util.js +539 -0
- package/dist/utility/wrun/wrun-chart-context.util.d.ts +89 -0
- package/dist/utility/wrun/wrun-chart-context.util.js +213 -0
- package/dist/utility/wrun/wrun-chart-names.util.d.ts +23 -0
- package/dist/utility/wrun/wrun-chart-names.util.js +33 -0
- package/dist/utility/wrun/wrun-chart-time.util.d.ts +12 -0
- package/dist/utility/wrun/wrun-chart-time.util.js +23 -0
- package/dist/utility/wrun/wrun-child-overlay-id.util.d.ts +13 -0
- package/dist/utility/wrun/wrun-child-overlay-id.util.js +44 -0
- package/dist/utility/wrun/wrun-color-facts.util.d.ts +40 -0
- package/dist/utility/wrun/wrun-color-facts.util.js +88 -0
- package/dist/utility/wrun/wrun-color-settings.lazy.d.ts +26 -0
- package/dist/utility/wrun/wrun-color-settings.lazy.js +9 -0
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +351 -0
- package/dist/utility/wrun/wrun-color-settings.util.js +1363 -0
- package/dist/utility/wrun/wrun-footprint-modes.util.d.ts +23 -0
- package/dist/utility/wrun/wrun-footprint-modes.util.js +24 -0
- package/dist/utility/wrun/wrun-frames.d.ts +217 -0
- package/dist/utility/wrun/wrun-frames.js +1021 -0
- package/dist/utility/wrun/wrun-handles.util.d.ts +792 -0
- package/dist/utility/wrun/wrun-handles.util.js +2050 -0
- package/dist/utility/wrun/wrun-heatmap-cell-budget.util.d.ts +156 -0
- package/dist/utility/wrun/wrun-heatmap-cell-budget.util.js +342 -0
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +218 -0
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +667 -0
- package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +40 -0
- package/dist/utility/wrun/wrun-hosted-wire.util.js +27 -0
- package/dist/utility/wrun/wrun-hover.util.d.ts +182 -0
- package/dist/utility/wrun/wrun-hover.util.js +534 -0
- package/dist/utility/wrun/wrun-hud-looks.util.d.ts +246 -0
- package/dist/utility/wrun/wrun-hud-looks.util.js +587 -0
- package/dist/utility/wrun/wrun-integration-budget.util.d.ts +47 -0
- package/dist/utility/wrun/wrun-integration-budget.util.js +122 -0
- package/dist/utility/wrun/wrun-latest-snapshot.d.ts +19 -0
- package/dist/utility/wrun/wrun-latest-snapshot.js +7 -0
- package/dist/utility/wrun/wrun-levels-child.util.d.ts +131 -0
- package/dist/utility/wrun/wrun-levels-child.util.js +514 -0
- package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +75 -0
- package/dist/utility/wrun/wrun-lifecycle.contract.js +9 -0
- package/dist/utility/wrun/wrun-market-facts.util.d.ts +116 -0
- package/dist/utility/wrun/wrun-market-facts.util.js +238 -0
- package/dist/utility/wrun/wrun-output-style.util.d.ts +344 -0
- package/dist/utility/wrun/wrun-output-style.util.js +1239 -0
- package/dist/utility/wrun/wrun-overlay-identity.util.d.ts +84 -0
- package/dist/utility/wrun/wrun-overlay-identity.util.js +142 -0
- package/dist/utility/wrun/wrun-overlay-result.util.d.ts +120 -0
- package/dist/utility/wrun/wrun-overlay-result.util.js +219 -0
- package/dist/utility/wrun/wrun-pack.util.d.ts +70 -0
- package/dist/utility/wrun/wrun-pack.util.js +301 -0
- package/dist/utility/wrun/wrun-pane-format.util.d.ts +180 -0
- package/dist/utility/wrun/wrun-pane-format.util.js +299 -0
- package/dist/utility/wrun/wrun-panel-style.lazy.d.ts +25 -0
- package/dist/utility/wrun/wrun-panel-style.lazy.js +15 -0
- package/dist/utility/wrun/wrun-panel-style.util.d.ts +174 -0
- package/dist/utility/wrun/wrun-panel-style.util.js +726 -0
- package/dist/utility/wrun/wrun-param-values.util.d.ts +69 -0
- package/dist/utility/wrun/wrun-param-values.util.js +230 -0
- package/dist/utility/wrun/wrun-refusal.util.d.ts +263 -0
- package/dist/utility/wrun/wrun-refusal.util.js +1259 -0
- package/dist/utility/wrun/wrun-registry-errors.util.d.ts +199 -0
- package/dist/utility/wrun/wrun-registry-errors.util.js +257 -0
- package/dist/utility/wrun/wrun-render-select.util.d.ts +336 -0
- package/dist/utility/wrun/wrun-render-select.util.js +1157 -0
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +434 -0
- package/dist/utility/wrun/wrun-script-inputs.util.js +1971 -0
- package/dist/utility/wrun/wrun-setting-words.lazy.d.ts +20 -0
- package/dist/utility/wrun/wrun-setting-words.lazy.js +9 -0
- package/dist/utility/wrun/wrun-setting-words.util.d.ts +79 -0
- package/dist/utility/wrun/wrun-setting-words.util.js +176 -0
- package/dist/utility/wrun/wrun-socket-row-store.d.ts +98 -0
- package/dist/utility/wrun/wrun-socket-row-store.js +417 -0
- package/dist/utility/wrun/wrun-style-flags.util.d.ts +18 -0
- package/dist/utility/wrun/wrun-style-flags.util.js +21 -0
- package/dist/utility/wrun/wrun-style-words.util.d.ts +148 -0
- package/dist/utility/wrun/wrun-style-words.util.js +439 -0
- package/dist/utility/wrun/wrun-table-look.util.d.ts +125 -0
- package/dist/utility/wrun/wrun-table-look.util.js +225 -0
- package/dist/utility/wrun/wrun-text-look.util.d.ts +51 -0
- package/dist/utility/wrun/wrun-text-look.util.js +227 -0
- package/dist/utility/wrun/wrun-text-params.util.d.ts +106 -0
- package/dist/utility/wrun/wrun-text-params.util.js +171 -0
- package/dist/utility/wrun/wrun-tpo-rows.util.d.ts +71 -0
- package/dist/utility/wrun/wrun-tpo-rows.util.js +438 -0
- package/dist/utility/wrun/wrun-twin-compute-inputs.util.d.ts +14 -0
- package/dist/utility/wrun/wrun-twin-compute-inputs.util.js +58 -0
- package/dist/utility/wrun/wrun-visibility-table.d.ts +437 -0
- package/dist/utility/wrun/wrun-visibility-table.js +237 -0
- package/dist/utility/wrun/wrun-volume-profile.util.d.ts +37 -0
- package/dist/utility/wrun/wrun-volume-profile.util.js +278 -0
- package/package.json +38 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The over-time plot looks of WRUN-STYLE group 5 (OT01..OT38) and the pane
|
|
3
|
+
* words (OT08 OT18 OT19 OT20 OT24, plus the DW25 widget routing): pure
|
|
4
|
+
* helpers the run-result adapter (wrun-run-result.util) merges into the
|
|
5
|
+
* outputs it mounts, the child-pane plan it splits a result by, the define
|
|
6
|
+
* a declared pane gives its child, and the mount settings the panel mount
|
|
7
|
+
* (wrun-panel-mount.util) gives a series child.
|
|
8
|
+
*
|
|
9
|
+
* Every word is opt-in: a helper answers an empty patch for an output that
|
|
10
|
+
* declares none of its words, so a sheet without them mounts byte-identical.
|
|
11
|
+
* Refusals read `WRUN <sheet>: output '<name>' <key> must ...`, the plain
|
|
12
|
+
* messages of the kit's area module (packages/sdk/src/wrun-style/outputs.ts
|
|
13
|
+
* and panes.ts), so a hand-written sheet fails here the way the kit would.
|
|
14
|
+
*
|
|
15
|
+
* Colours are never resolved here: a theme token (`theme.up`) rides the
|
|
16
|
+
* patch as written and `multiplyWrunOpacity` scales its alpha in the token's
|
|
17
|
+
* own `/aa` form; the mount doors resolve it against the chart's palette
|
|
18
|
+
* (wrun-style-words.util). Font words become CSS stacks here (X14: the
|
|
19
|
+
* engine never sees a font word).
|
|
20
|
+
*
|
|
21
|
+
* Imports no vue, no DOM, no titan and no kit: main-thread and worker safe.
|
|
22
|
+
*/
|
|
23
|
+
import type { WrunIndicatorMetadata, WrunMetadataOutput, WrunOutputRow, WrunPane, WrunRenderer, WrunSheetFill } from '../../interfaces/wrun-runtime.interface.js';
|
|
24
|
+
/** How a line splits its colour (OT14). */
|
|
25
|
+
export declare const WRUN_LINE_SPLIT_MODES: readonly ["level", "slope"];
|
|
26
|
+
/** A candle group's body style (OT17) and the engine plot kind it mounts as. */
|
|
27
|
+
export declare const WRUN_CANDLE_STYLES: readonly ["candle", "hollow", "ohlc", "high_low"];
|
|
28
|
+
/** Column alpha by magnitude (OT34). */
|
|
29
|
+
export declare const WRUN_BAR_GRADINGS: readonly ["linear", "square"];
|
|
30
|
+
/** The on-line label pill of a guide (OT10). */
|
|
31
|
+
export declare const WRUN_PILL_STYLES: readonly ["filled", "outlined"];
|
|
32
|
+
/** The pane's value scale (OT18) and the engine value mode it maps to. */
|
|
33
|
+
export declare const WRUN_PANE_SCALES: readonly ["linear", "log", "percent", "indexed"];
|
|
34
|
+
/** Where a pane sits (OT24). */
|
|
35
|
+
export declare const WRUN_PANE_PLACES: readonly ["below", "price"];
|
|
36
|
+
/** The name of the default pane below the chart (OT08): `pane("lower", ...)`
|
|
37
|
+
* styles it, `outputs[].pane: "lower"` names it. */
|
|
38
|
+
export declare const WRUN_DEFAULT_PANE_NAME = "lower";
|
|
39
|
+
export declare const WRUN_MIN_Z = -10;
|
|
40
|
+
export declare const WRUN_MAX_Z = 10;
|
|
41
|
+
/** Titan's own flat delta-fill alpha, the interior an area paints under its
|
|
42
|
+
* line when the sheet declares no `fill_opacity` (OT02, OT31). */
|
|
43
|
+
export declare const WRUN_AREA_FILL_ALPHA = 0.4;
|
|
44
|
+
/**
|
|
45
|
+
* The most glow a wrun output or drawing lands with (PLOTS-2): the engine
|
|
46
|
+
* writes glow to `ctx.shadowBlur` with no clamp, its cost grows with the
|
|
47
|
+
* radius, and a glowing mark, column or candle leaves its batch and blurs one
|
|
48
|
+
* primitive per bar on every full frame. It IS the handles' validation range
|
|
49
|
+
* (`WRUN3_MAX_GLOW_PX`, the kit's documented 0 to 32, pinned by the kit
|
|
50
|
+
* mirror), one constant so the two can never drift: no documented-legal
|
|
51
|
+
* script changes, only a value past it (a hand-written sheet the kit never
|
|
52
|
+
* validated) lands at the ceiling, and a negative one as none instead of
|
|
53
|
+
* refusing the run. `true` stays the engine's 12 px.
|
|
54
|
+
*/
|
|
55
|
+
export declare const WRUN_MAX_GLOW_PX = 32;
|
|
56
|
+
/** Kill switch for the host glow clamp: off restores today's glow exactly
|
|
57
|
+
* (any px >= 0, a negative refused; render.shape keeps the engine's 30). */
|
|
58
|
+
export declare function setWrunGlowClampDisabled(disabled: boolean): void;
|
|
59
|
+
export declare function isWrunGlowClampDisabled(): boolean;
|
|
60
|
+
/** A finite declared glow in px as it lands: inside 0..32 (a negative is
|
|
61
|
+
* none) while the clamp is on, as declared while it is off. */
|
|
62
|
+
export declare function landWrunGlowPx(px: number): number;
|
|
63
|
+
/** A finite plotShape glow in px as it lands: 0 or less is no glow (false),
|
|
64
|
+
* else at most the engine's clampGlow 30 (under the host's 32). */
|
|
65
|
+
export declare function landWrunShapeGlowPx(px: number): false | number;
|
|
66
|
+
/** MULTIPLIES a colour's own alpha by `opacity` (conventions 3, OT30): a
|
|
67
|
+
* colour without alpha comes back exactly as the adapter's `withOpacity`
|
|
68
|
+
* wrote it (`rgba(r, g, b, opacity)`), one with alpha at the product; a
|
|
69
|
+
* theme token keeps its word with its alpha scaled (`theme.up` at 0.5 is
|
|
70
|
+
* `theme.up/80`); `hsl()` / `hsla()` scale in place. An opacity that is
|
|
71
|
+
* absent, 1, out of 0..1 or not a number, and a colour the parser cannot
|
|
72
|
+
* read (a named colour), come back unchanged. */
|
|
73
|
+
export declare function multiplyWrunOpacity(color: string, opacity: number | undefined): string;
|
|
74
|
+
/** The format companions a surface declares beside `format` (conventions
|
|
75
|
+
* 8): the shape `formatOptions` rides a mounted output with and a pane
|
|
76
|
+
* axis prints with. */
|
|
77
|
+
export interface WrunFormatOptions {
|
|
78
|
+
decimals?: number;
|
|
79
|
+
signed?: boolean;
|
|
80
|
+
unit?: string;
|
|
81
|
+
}
|
|
82
|
+
/** The `formatOptions` an output's declaration stamps on the mounted output
|
|
83
|
+
* (OT32), beside its `format`, or a printed legacy unit alone without one
|
|
84
|
+
* (B15): undefined when it declares no companion. */
|
|
85
|
+
export declare function readWrunOutputFormatOptions(output: Pick<WrunMetadataOutput, 'name' | 'format' | 'decimals' | 'signed' | 'unit'>, sheetId?: string): WrunFormatOptions | undefined;
|
|
86
|
+
/** How an output mounts: the unit its look words are checked against. */
|
|
87
|
+
export type WrunOutputLookMount = 'line' | 'area' | 'bar' | 'shape' | 'candle';
|
|
88
|
+
export interface WrunOutputLookContext {
|
|
89
|
+
/** The sheet declares `price_display: "per_output"`: the kScript tag
|
|
90
|
+
* lineage is on, so a guide keeps the hline's own tag; off, a guide sends
|
|
91
|
+
* `showPriceDisplay: false` and no role (OT10). */
|
|
92
|
+
perOutputPriceDisplay: boolean;
|
|
93
|
+
/** The sheet id for refusals (absent: the message names the output only). */
|
|
94
|
+
sheetId?: string;
|
|
95
|
+
/** The output's resolved base colour before its opacity (the adapter's
|
|
96
|
+
* outputBaseColor): the flat area fill (OT02) falls back to it when the
|
|
97
|
+
* output declares `fill_opacity` without `fill_color`. */
|
|
98
|
+
baseColor?: string;
|
|
99
|
+
/** The per_output tag flag the adapter resolved for this output
|
|
100
|
+
* (`show_price_display_by`, then `show_price_display`); defined, it wins
|
|
101
|
+
* over `axis_label` (OT01 precedence), absent, `axis_label` applies. */
|
|
102
|
+
showPriceDisplay?: boolean;
|
|
103
|
+
}
|
|
104
|
+
/** The run-output fields an output's g5 look words add (OT01 OT02 OT04 OT07
|
|
105
|
+
* OT09 OT11 OT13 OT14 OT16 OT32 OT34 OT35), merged over the adapter's own
|
|
106
|
+
* fields by every mount branch: an output that declares none of them gets
|
|
107
|
+
* an empty patch. `mount` is how the adapter mounts the output; an area
|
|
108
|
+
* passed as a line is read as an area. */
|
|
109
|
+
export declare function wrunOutputLookPatch(output: WrunMetadataOutput, mount: WrunOutputLookMount, ctx: WrunOutputLookContext): Record<string, unknown>;
|
|
110
|
+
/** The hline fields a `role: "guide"` output adds (OT10): the on-line label
|
|
111
|
+
* (`align` places the output's `label`, `pill_style` and `font_size` dress
|
|
112
|
+
* it), the axis pill (`axis_label: true` puts value + label on the axis
|
|
113
|
+
* instead), the constant `value` and the paint order. `lastValue` is the
|
|
114
|
+
* output's last finite value (NaN when the run never gave one). */
|
|
115
|
+
export declare function wrunGuideLook(output: WrunMetadataOutput, lastValue: number, label: string): Record<string, unknown>;
|
|
116
|
+
/** The candle look a group's first output declares (OT17): the body style
|
|
117
|
+
* as the engine plot kind, the border and wick pairs (faded by the group's
|
|
118
|
+
* opacity, OT30) and the border width. */
|
|
119
|
+
export declare function wrunCandleLook(first: WrunMetadataOutput, sheetId: string): Record<string, unknown>;
|
|
120
|
+
/** Refuses the candle look keys on a group's second to fourth output by
|
|
121
|
+
* name (OT17): only the first output carries the group's look. */
|
|
122
|
+
export declare function assertWrunCandleMemberLook(member: WrunMetadataOutput, sheetId: string): void;
|
|
123
|
+
export interface WrunShapeLadderInput {
|
|
124
|
+
/** Each mark: its wire timestamp, its value and the run row it reads. */
|
|
125
|
+
records: ReadonlyArray<readonly [ts: number, value: number, rowAt: number]>;
|
|
126
|
+
/** The static mark colour (slot 0, what a non-finite rung draws), before opacity. */
|
|
127
|
+
staticColor: string;
|
|
128
|
+
/** The ladder table (the declared `colors`, or the packed palette), before opacity. */
|
|
129
|
+
ladder: ReadonlyArray<string>;
|
|
130
|
+
/** The table slot a run row's rung selects; undefined = the static colour. */
|
|
131
|
+
slotAt: (rowAt: number) => number | undefined;
|
|
132
|
+
/** The declared opacity (OT30), multiplied into every colour. */
|
|
133
|
+
opacity?: number;
|
|
134
|
+
/** The width slot of a run row (a `width_by` ladder); undefined = the def width. */
|
|
135
|
+
widthSlotAt?: (rowAt: number) => number | undefined;
|
|
136
|
+
/** The widths table (`width_by`), or `[width]` for a static width; absent
|
|
137
|
+
* = no table, so the engine keeps its own mark size. */
|
|
138
|
+
widths?: ReadonlyArray<number>;
|
|
139
|
+
}
|
|
140
|
+
export interface WrunShapeLadderOutput {
|
|
141
|
+
data: unknown[][];
|
|
142
|
+
colors: string[];
|
|
143
|
+
color: string[];
|
|
144
|
+
widths?: number[];
|
|
145
|
+
styleProperties: ['width', 'color'];
|
|
146
|
+
styleDataOffset: 2;
|
|
147
|
+
}
|
|
148
|
+
/** The plotShape wire of a shape output with a colour ladder (OT05): mark
|
|
149
|
+
* rows `[ts, value, widthSlot, colorSlot]` at styleDataOffset 2
|
|
150
|
+
* (styleProperties ['width', 'color']), the `color` table
|
|
151
|
+
* `[staticColor, ...ladder]` so a non-finite rung indexes slot 0 (the
|
|
152
|
+
* static colour, the output ladder rule), the `widths` table only when
|
|
153
|
+
* one is declared. */
|
|
154
|
+
export declare function wrunShapeLadderOutput(input: WrunShapeLadderInput): WrunShapeLadderOutput;
|
|
155
|
+
export interface WrunAreaFillLadderInput {
|
|
156
|
+
/** The area output's name and legend label. */
|
|
157
|
+
name: string;
|
|
158
|
+
label: string;
|
|
159
|
+
/** The line's own points, one per run row: [wire ts, value] (NaN = a gap). */
|
|
160
|
+
points: ReadonlyArray<readonly [ts: number, value: number]>;
|
|
161
|
+
/** The fill ladder's slot for a run row; undefined = no cells (the static fill). */
|
|
162
|
+
slotAt: (rowAt: number) => number | undefined;
|
|
163
|
+
/** The fill ladder table (`fill_colors`, or the packed palette), before alpha. */
|
|
164
|
+
ladder: ReadonlyArray<string>;
|
|
165
|
+
/** The static fill colour (`fill_color`, else the base colour), before alpha. */
|
|
166
|
+
staticColor: string;
|
|
167
|
+
/** `fill_opacity` (default 0.4) and the output's `opacity` (default 1). */
|
|
168
|
+
fillOpacity?: number;
|
|
169
|
+
opacity?: number;
|
|
170
|
+
z?: number;
|
|
171
|
+
smooth?: boolean;
|
|
172
|
+
forceOnChart?: boolean;
|
|
173
|
+
}
|
|
174
|
+
/** The output key an area's fill band mounts under (OT31): the band's own
|
|
175
|
+
* mount mints it, the pane routing and the visibility apply find it by it. */
|
|
176
|
+
export declare function wrunAreaFillKey(name: string): string;
|
|
177
|
+
/** The second output an area with a fill ladder mounts right after its line
|
|
178
|
+
* (OT31): `<name>__area_fill`, the engine's plotLine(value=[v, 0],
|
|
179
|
+
* fill=true) band with no edge lines (width 0), each bar's interior from
|
|
180
|
+
* the fill ladder at alpha own x (fill_opacity ?? 0.4) x (opacity ?? 1),
|
|
181
|
+
* never a legend line nor a tag, half a layer under the line. */
|
|
182
|
+
export declare function wrunAreaFillLadderOutput(input: WrunAreaFillLadderInput): {
|
|
183
|
+
key: string;
|
|
184
|
+
output: Record<string, unknown>;
|
|
185
|
+
};
|
|
186
|
+
/** One stacked member's span on a row: the column runs from `bottom` (the
|
|
187
|
+
* running sum before it) to `top` (the sum with it), positives above zero
|
|
188
|
+
* and negatives below; the legend reads top - bottom. */
|
|
189
|
+
export type WrunStackedSpan = readonly [top: number, bottom: number];
|
|
190
|
+
/** The spans of every stacked bar output (OT38), keyed by output name, one
|
|
191
|
+
* entry per run row (undefined where the row is not ready or the member's
|
|
192
|
+
* value is not finite: the member draws nothing that bar). Members sharing
|
|
193
|
+
* a `stack` name stack in declaration order; a `stack` off a bar or
|
|
194
|
+
* histogram output, beside `base`, or whose members sit on different panes
|
|
195
|
+
* refuses by name. */
|
|
196
|
+
export declare function wrunStackedRows(outputs: ReadonlyArray<Pick<WrunMetadataOutput, 'name' | 'index' | 'plot' | 'panel' | 'pane' | 'stack' | 'base'>>, rows: ReadonlyArray<WrunOutputRow>): Map<string, Array<WrunStackedSpan | undefined>>;
|
|
197
|
+
export interface WrunFillLadderRows {
|
|
198
|
+
/** The fillBetween `colors` table. */
|
|
199
|
+
colors: string[];
|
|
200
|
+
/** The fillBetween rows `[ts, colorSlot, opacity]`; a NaN slot fills nothing that bar. */
|
|
201
|
+
data: Array<[number, number, number]>;
|
|
202
|
+
zOrder?: number;
|
|
203
|
+
}
|
|
204
|
+
/** A fill row's opacity, the per-row cell of the engine's fillBetween wire
|
|
205
|
+
* (`[ts, colorSlot, opacity]`): the `opacity_by` output's value on the row
|
|
206
|
+
* when it is finite (clamped to 0..1, as titan paints it), else the fill's
|
|
207
|
+
* static `opacity`, else `fallback` (the host's own default; titan's is
|
|
208
|
+
* 0.25). Titan replaces each colour's alpha with it in every colour mode
|
|
209
|
+
* (static, `color_by`, `color_packed_by`), so every mode takes it. `row`
|
|
210
|
+
* is the run row's outputs (null on a row that was not ready). The kit's
|
|
211
|
+
* `wrunFillRowOpacity` (om scaffold 42, wrun-style/panes.ts), verbatim:
|
|
212
|
+
* wrun-fill-opacity.kit-mirror.spec.ts pins it to the kit's export. */
|
|
213
|
+
export declare function wrunFillRowOpacity(fill: {
|
|
214
|
+
opacity?: number | undefined;
|
|
215
|
+
opacity_by?: string | undefined;
|
|
216
|
+
}, row: ArrayLike<number> | null | undefined, outputIndex: ReadonlyMap<string, number>, fallback: number): number;
|
|
217
|
+
/** The engine's fillBetween colour wire of a sheet fill (OT03): a static
|
|
218
|
+
* colour (`color`, else `staticColor`) for every row; `color_by` + `colors`
|
|
219
|
+
* the ladder table with each row's slot (floor, out of range = slot 0, a
|
|
220
|
+
* non-finite rung = NaN: no fill that bar); `color_packed_by` a palette
|
|
221
|
+
* interned in row order (the static colour where a value does not decode,
|
|
222
|
+
* NaN when there is none); `z` the paint order (OT04). Each row's opacity
|
|
223
|
+
* is wrunFillRowOpacity's in every mode: the `opacity_by` output's value on
|
|
224
|
+
* the row, else the static `opacity`, else `options.opacity` (else 0.25). */
|
|
225
|
+
export declare function wrunFillLadderRows(fill: WrunSheetFill, rows: ReadonlyArray<WrunOutputRow>, outputIndex: ReadonlyMap<string, number>, options?: {
|
|
226
|
+
sheetId?: string;
|
|
227
|
+
staticColor?: string;
|
|
228
|
+
opacity?: number;
|
|
229
|
+
}): WrunFillLadderRows;
|
|
230
|
+
export interface WrunInsetLook {
|
|
231
|
+
settings: Record<string, unknown>;
|
|
232
|
+
/** With a `color_by` ladder: the strip rows `[ts, value, ladderSlot]` (no
|
|
233
|
+
* slot where the rung is not finite), one per ready row. */
|
|
234
|
+
data?: unknown[][];
|
|
235
|
+
}
|
|
236
|
+
/** The inset sender settings an inset output's colour words add (OT36):
|
|
237
|
+
* `colors` without `color_by` is the sign pair (`up_color` at or above 0,
|
|
238
|
+
* `down_color` below), `color_by` + `colors` the `palette` each row's
|
|
239
|
+
* ladder slot indexes, `opacity` the strip alpha. `rows` are the run rows
|
|
240
|
+
* (the strip reads every ready row); a `color_by` needs the declared
|
|
241
|
+
* outputs' indexes (`ctx.outputIndexByName`). */
|
|
242
|
+
export declare function wrunInsetLook(output: WrunMetadataOutput, rows: ReadonlyArray<WrunOutputRow>, ctx?: {
|
|
243
|
+
outputIndexByName?: ReadonlyMap<string, number>;
|
|
244
|
+
sheetId?: string;
|
|
245
|
+
}): WrunInsetLook;
|
|
246
|
+
type WrunShapeRenderer = Extract<WrunRenderer, {
|
|
247
|
+
kind: 'shape';
|
|
248
|
+
}>;
|
|
249
|
+
type WrunBgcolorRenderer = Extract<WrunRenderer, {
|
|
250
|
+
kind: 'bgcolor';
|
|
251
|
+
}>;
|
|
252
|
+
/** The mark look a render.shape declares (D5: OT07 OT16 OT35): placement,
|
|
253
|
+
* glow (through the engine's clamp, `shapeRendererGlow`), the char glyph
|
|
254
|
+
* and its font stack, the hollow (`fill: false`) and faded (`fillOpacity`)
|
|
255
|
+
* interior. `width` is the adapter's own field. */
|
|
256
|
+
export declare function wrunShapeRendererLook(renderer: WrunShapeRenderer, sheetId: string): Record<string, unknown>;
|
|
257
|
+
/** The vertical-line fields a render.bgcolor declares (OT38): `width` (px,
|
|
258
|
+
* 0.5..10) as `lineWidth`, `line_style` (needs `width`) as `lineStyle`;
|
|
259
|
+
* without them the renderer keeps painting a band. */
|
|
260
|
+
export declare function wrunBgcolorLineLook(renderer: WrunBgcolorRenderer): Record<string, unknown>;
|
|
261
|
+
/** The pane an output draws into: its declared `pane`, else the default
|
|
262
|
+
* lower pane when its panel is `lower`, else undefined (the price pane). */
|
|
263
|
+
export declare function wrunPaneOfOutput(output: Pick<WrunMetadataOutput, 'pane' | 'panel'>): string | undefined;
|
|
264
|
+
/** The series child's overlay id (`<parent>::series:<pane>`): the default
|
|
265
|
+
* pane keeps the "lower" child every on-price Indicator always had. */
|
|
266
|
+
export declare function wrunPaneChildId(overlayId: string, pane: string): string;
|
|
267
|
+
/** One child pane of a result (OT08 OT24): the pane's name and place, its
|
|
268
|
+
* declaration when the sheet declares it (title template, height share),
|
|
269
|
+
* and every visual that rides it, by key. */
|
|
270
|
+
export interface WrunPanePlanChild {
|
|
271
|
+
name: string;
|
|
272
|
+
place: 'below' | 'price';
|
|
273
|
+
/** The declaration behind the pane (absent on the undeclared default pane). */
|
|
274
|
+
declaration?: WrunPane;
|
|
275
|
+
/** The declared `title` template (`{{param}}` placeholders, unresolved). */
|
|
276
|
+
title?: string;
|
|
277
|
+
/** The declared `height_frac`. */
|
|
278
|
+
height?: number;
|
|
279
|
+
/** The drawn outputs (names) in the pane, in declaration order. */
|
|
280
|
+
outputs: string[];
|
|
281
|
+
/** The `ranges[]` indexes anchored in the pane (by their upper edge). */
|
|
282
|
+
ranges: number[];
|
|
283
|
+
/** The `fills[]` indexes anchored in the pane (by their first side). */
|
|
284
|
+
fills: number[];
|
|
285
|
+
/** The box and segment names, by their declared panel and top / y_from anchor. */
|
|
286
|
+
boxes: string[];
|
|
287
|
+
segments: string[];
|
|
288
|
+
/** The renderer names, by their panel and anchor output. */
|
|
289
|
+
renderers: string[];
|
|
290
|
+
/** The `drawings[]` indexes of the widgets routed into the pane (DW25). */
|
|
291
|
+
drawings: number[];
|
|
292
|
+
}
|
|
293
|
+
/** Where a result's visuals go (OT08 OT24, DW25): the pane the parent keeps,
|
|
294
|
+
* the child panes in mount order, and each drawn output's pane. */
|
|
295
|
+
export interface WrunPanePlan {
|
|
296
|
+
/** The pane the parent overlay holds: an Indicator that homes below the
|
|
297
|
+
* chart keeps its first drawn output's pane (absent = the price pane). */
|
|
298
|
+
home?: string;
|
|
299
|
+
/** The child panes, one series child each, in mount order: the undeclared
|
|
300
|
+
* default pane first, then the declared panes in `panes[]` order, then
|
|
301
|
+
* any other pane drawn into, the home pane left out. */
|
|
302
|
+
children: WrunPanePlanChild[];
|
|
303
|
+
/** Every drawn output's pane name (absent = the price pane). */
|
|
304
|
+
outputPane: Record<string, string>;
|
|
305
|
+
}
|
|
306
|
+
/** The pane a visual rides, by its declared panel and anchor output (OT08):
|
|
307
|
+
* `overlay` stays on price; otherwise the anchor's pane (a `lower` panel on
|
|
308
|
+
* a price anchor takes the default lower pane). Undefined = the parent
|
|
309
|
+
* (the price pane, or the home pane of an Indicator that homes below). */
|
|
310
|
+
export declare function wrunPaneOfVisual(plan: WrunPanePlan, panel: string | undefined, anchor: string | undefined): string | undefined;
|
|
311
|
+
/** The child-pane plan of a sheet (OT08 OT24, DW25): every pane a drawn
|
|
312
|
+
* output homes in is one series child named by the pane (the default keeps
|
|
313
|
+
* "lower"), in panes[] order with the undeclared default first; ranges,
|
|
314
|
+
* fills, boxes, segments and renderers follow their anchor output's pane
|
|
315
|
+
* and `panel: "lower"` widgets the lower pane (the default pane when drawn
|
|
316
|
+
* into, else the first pane placed below). `homesBelow` (the result's side
|
|
317
|
+
* is offchart) keeps the first drawn output's pane on the parent and splits
|
|
318
|
+
* the others; a sheet that pins `overlay: "onchart"` splits nothing. */
|
|
319
|
+
export declare function planWrunPanes(sheet: WrunIndicatorMetadata, homesBelow: boolean): WrunPanePlan;
|
|
320
|
+
/** The declared height share (`height_frac`) of the pane holding a sheet's
|
|
321
|
+
* first drawn output, when that output sits below the chart (OT20): what a
|
|
322
|
+
* NEW add of an Indicator that homes below mounts as its `gridHeight`.
|
|
323
|
+
* Undefined when the first drawn output is on price, the pane is not
|
|
324
|
+
* declared or declares no height. */
|
|
325
|
+
export declare function wrunHomePaneHeight(sheet: Pick<WrunIndicatorMetadata, 'id' | 'outputs' | 'panes'>): number | undefined;
|
|
326
|
+
/** A declared pane's define (OT18 OT19): `pane` is the scale look the engine
|
|
327
|
+
* applies (value mode, inversion, padding, held ends), always present for a
|
|
328
|
+
* declared pane; `paneAxis` the axis tick format (app-only, read by the
|
|
329
|
+
* pane formatter) only when the pane declares format words. */
|
|
330
|
+
export declare function wrunPaneDefine(pane: WrunPane): {
|
|
331
|
+
pane?: Record<string, unknown>;
|
|
332
|
+
paneAxis?: Record<string, unknown>;
|
|
333
|
+
};
|
|
334
|
+
/** The engine settings a series child takes from its pane (OT20 OT24): a
|
|
335
|
+
* pane placed on price mounts pinned over the candles on its own hidden
|
|
336
|
+
* scale (the pinned onchart flags, no main-pane fold); a pane below the
|
|
337
|
+
* chart carries its declared height share as `gridHeight` (absent = the
|
|
338
|
+
* mount's default share). Takes the child's pane info or a declaration. */
|
|
339
|
+
export declare function wrunPaneChildMountSettings(pane: {
|
|
340
|
+
place?: 'below' | 'price';
|
|
341
|
+
height?: number;
|
|
342
|
+
height_frac?: number;
|
|
343
|
+
} | undefined): Record<string, unknown>;
|
|
344
|
+
export {};
|