@invinite-org/chartlang-adapter-kit 1.4.0 → 1.6.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/CHANGELOG.md +158 -0
- package/dist/base/bufferingAdapter.d.ts +1 -0
- package/dist/base/bufferingAdapter.d.ts.map +1 -1
- package/dist/base/bufferingAdapter.js +1 -0
- package/dist/base/bufferingAdapter.js.map +1 -1
- package/dist/base/passThroughAdapter.d.ts +1 -0
- package/dist/base/passThroughAdapter.d.ts.map +1 -1
- package/dist/base/passThroughAdapter.js +1 -0
- package/dist/base/passThroughAdapter.js.map +1 -1
- package/dist/canvas/glyphs.d.ts +209 -0
- package/dist/canvas/glyphs.d.ts.map +1 -0
- package/dist/canvas/glyphs.js +219 -0
- package/dist/canvas/glyphs.js.map +1 -0
- package/dist/canvas/index.d.ts +2 -0
- package/dist/canvas/index.d.ts.map +1 -1
- package/dist/canvas/index.js +1 -0
- package/dist/canvas/index.js.map +1 -1
- package/dist/canvas/mockContext.d.ts +42 -0
- package/dist/canvas/mockContext.d.ts.map +1 -1
- package/dist/canvas/mockContext.js +50 -0
- package/dist/canvas/mockContext.js.map +1 -1
- package/dist/canvas/renderCtx.d.ts +6 -0
- package/dist/canvas/renderCtx.d.ts.map +1 -1
- package/dist/canvas/renderCtx.js.map +1 -1
- package/dist/capabilities/capabilities.d.ts +16 -0
- package/dist/capabilities/capabilities.d.ts.map +1 -1
- package/dist/capabilities/capabilities.js +16 -0
- package/dist/capabilities/capabilities.js.map +1 -1
- package/dist/defineAdapter.d.ts +2 -0
- package/dist/defineAdapter.d.ts.map +1 -1
- package/dist/defineAdapter.js +1 -0
- package/dist/defineAdapter.js.map +1 -1
- package/dist/geometry/index.d.ts +3 -0
- package/dist/geometry/index.d.ts.map +1 -1
- package/dist/geometry/index.js +2 -0
- package/dist/geometry/index.js.map +1 -1
- package/dist/geometry/renderOrder.d.ts +52 -0
- package/dist/geometry/renderOrder.d.ts.map +1 -0
- package/dist/geometry/renderOrder.js +35 -0
- package/dist/geometry/renderOrder.js.map +1 -0
- package/dist/geometry/shift.d.ts +117 -0
- package/dist/geometry/shift.d.ts.map +1 -0
- package/dist/geometry/shift.js +141 -0
- package/dist/geometry/shift.js.map +1 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/interaction/domWiring.d.ts +90 -0
- package/dist/interaction/domWiring.d.ts.map +1 -0
- package/dist/interaction/domWiring.js +113 -0
- package/dist/interaction/domWiring.js.map +1 -0
- package/dist/interaction/index.d.ts +5 -0
- package/dist/interaction/index.d.ts.map +1 -0
- package/dist/interaction/index.js +5 -0
- package/dist/interaction/index.js.map +1 -0
- package/dist/interaction/viewController.d.ts +132 -0
- package/dist/interaction/viewController.d.ts.map +1 -0
- package/dist/interaction/viewController.js +133 -0
- package/dist/interaction/viewController.js.map +1 -0
- package/dist/mocks/mockCandleSource.d.ts +12 -0
- package/dist/mocks/mockCandleSource.d.ts.map +1 -1
- package/dist/mocks/mockCandleSource.js +13 -4
- package/dist/mocks/mockCandleSource.js.map +1 -1
- package/dist/types.d.ts +91 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/validation/validateEmission.d.ts.map +1 -1
- package/dist/validation/validateEmission.js +10 -0
- package/dist/validation/validateEmission.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// Copyright (c) 2026 Invinite. Licensed under the MIT License.
|
|
2
|
+
// See the LICENSE file in the repo root for full license text.
|
|
3
|
+
const DEFAULT_MIN_SPAN = 1;
|
|
4
|
+
const DEFAULT_MAX_SPAN_FACTOR = 1;
|
|
5
|
+
// Clamp a candidate window: bound its span to [minSpan, maxSpan] (maxSpan =
|
|
6
|
+
// dataSpan * maxSpanFactor), then shift it to sit inside [dataMin, dataMax]
|
|
7
|
+
// when it fits, or pin it to the full data range when it is at least as wide
|
|
8
|
+
// as the data. The single clamp shared by zoom / pan / resolve.
|
|
9
|
+
function clampWindow(win, dataMin, dataMax, minSpan, maxSpanFactor) {
|
|
10
|
+
const dataSpan = Math.max(0, dataMax - dataMin);
|
|
11
|
+
const maxSpan = dataSpan * maxSpanFactor;
|
|
12
|
+
let span = win.xMax - win.xMin;
|
|
13
|
+
if (maxSpan > 0 && span > maxSpan)
|
|
14
|
+
span = maxSpan;
|
|
15
|
+
if (span < minSpan)
|
|
16
|
+
span = minSpan;
|
|
17
|
+
const center = (win.xMin + win.xMax) / 2;
|
|
18
|
+
let xMin = center - span / 2;
|
|
19
|
+
let xMax = center + span / 2;
|
|
20
|
+
if (span <= dataSpan) {
|
|
21
|
+
if (xMin < dataMin) {
|
|
22
|
+
xMax += dataMin - xMin;
|
|
23
|
+
xMin = dataMin;
|
|
24
|
+
}
|
|
25
|
+
if (xMax > dataMax) {
|
|
26
|
+
xMin -= xMax - dataMax;
|
|
27
|
+
xMax = dataMax;
|
|
28
|
+
}
|
|
29
|
+
return { xMin, xMax };
|
|
30
|
+
}
|
|
31
|
+
return { xMin: dataMin, xMax: dataMax };
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Build a {@link ViewController}. Pass `opts` to tune the zoom-in floor
|
|
35
|
+
* (`minSpan`) and zoom-out ceiling (`maxSpanFactor`); both default to a
|
|
36
|
+
* "1 ms floor, all-data ceiling" policy.
|
|
37
|
+
*
|
|
38
|
+
* @since 1.6
|
|
39
|
+
* @stable
|
|
40
|
+
* @example
|
|
41
|
+
* const view = createViewController({ minSpan: 2, maxSpanFactor: 1 });
|
|
42
|
+
* view.zoomAt(50, 0.5, 0, 100); // zoom in 2× about x=50
|
|
43
|
+
* void view.resolveXWindow(0, 100);
|
|
44
|
+
*/
|
|
45
|
+
export function createViewController(opts) {
|
|
46
|
+
const minSpan = opts?.minSpan ?? DEFAULT_MIN_SPAN;
|
|
47
|
+
const maxSpanFactor = opts?.maxSpanFactor ?? DEFAULT_MAX_SPAN_FACTOR;
|
|
48
|
+
let held;
|
|
49
|
+
let interacted = false;
|
|
50
|
+
// The window most recently returned by `resolveXWindow` — i.e. what the
|
|
51
|
+
// user is currently looking at. The first `zoomAt`/`panBy` seeds from this
|
|
52
|
+
// so the transition out of auto-follow keeps the framed (`autoFollowXMin`)
|
|
53
|
+
// view instead of snapping to the full data range.
|
|
54
|
+
let lastResolved;
|
|
55
|
+
const base = (dataMin, dataMax) => held ?? lastResolved ?? { xMin: dataMin, xMax: dataMax };
|
|
56
|
+
return {
|
|
57
|
+
get userInteracted() {
|
|
58
|
+
return interacted;
|
|
59
|
+
},
|
|
60
|
+
resolveXWindow(dataMin, dataMax, autoFollowXMin) {
|
|
61
|
+
let win;
|
|
62
|
+
if (!interacted || held === undefined) {
|
|
63
|
+
// Auto-follow: optionally start the window at a windowed left
|
|
64
|
+
// edge (clamped into the data range) so the default view frames
|
|
65
|
+
// the most recent bars; new bars keep extending xMax.
|
|
66
|
+
const xMin = autoFollowXMin === undefined
|
|
67
|
+
? dataMin
|
|
68
|
+
: Math.min(Math.max(autoFollowXMin, dataMin), dataMax);
|
|
69
|
+
win = { xMin, xMax: dataMax };
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
win = clampWindow(held, dataMin, dataMax, minSpan, maxSpanFactor);
|
|
73
|
+
}
|
|
74
|
+
lastResolved = win;
|
|
75
|
+
return win;
|
|
76
|
+
},
|
|
77
|
+
zoomAt(pivotX, factor, dataMin, dataMax) {
|
|
78
|
+
interacted = true;
|
|
79
|
+
const b = base(dataMin, dataMax);
|
|
80
|
+
const span = b.xMax - b.xMin;
|
|
81
|
+
const frac = span === 0 ? 0.5 : (pivotX - b.xMin) / span;
|
|
82
|
+
const newSpan = span * factor;
|
|
83
|
+
const xMin = pivotX - frac * newSpan;
|
|
84
|
+
held = clampWindow({ xMin, xMax: xMin + newSpan }, dataMin, dataMax, minSpan, maxSpanFactor);
|
|
85
|
+
},
|
|
86
|
+
panBy(deltaWorldX, dataMin, dataMax) {
|
|
87
|
+
interacted = true;
|
|
88
|
+
const b = base(dataMin, dataMax);
|
|
89
|
+
held = clampWindow({ xMin: b.xMin + deltaWorldX, xMax: b.xMax + deltaWorldX }, dataMin, dataMax, minSpan, maxSpanFactor);
|
|
90
|
+
},
|
|
91
|
+
reset() {
|
|
92
|
+
held = undefined;
|
|
93
|
+
interacted = false;
|
|
94
|
+
// Drop the remembered framed window too, so an immediate post-reset
|
|
95
|
+
// zoom/pan (before the next `resolveXWindow`) seeds from the data
|
|
96
|
+
// bounds rather than a stale pre-reset view.
|
|
97
|
+
lastResolved = undefined;
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Fold the y range of every candidate whose `x` falls inside `win` — the
|
|
103
|
+
* shared "auto-fit the price scale to the visible window" helper (matching
|
|
104
|
+
* lightweight-charts' auto price scale). Non-finite `lo`/`hi` rows are
|
|
105
|
+
* skipped. Returns `undefined` when no finite in-window candidate is seen,
|
|
106
|
+
* so the caller keeps its own degenerate-range fallback. Horizontal lines
|
|
107
|
+
* (no `x`) are folded in by the caller, not here.
|
|
108
|
+
*
|
|
109
|
+
* @since 1.6
|
|
110
|
+
* @stable
|
|
111
|
+
* @example
|
|
112
|
+
* const r = yRangeInWindow([{ x: 5, lo: 1, hi: 3 }], { xMin: 0, xMax: 10 });
|
|
113
|
+
* // r === { yMin: 1, yMax: 3 }
|
|
114
|
+
* void r;
|
|
115
|
+
*/
|
|
116
|
+
export function yRangeInWindow(candidates, win) {
|
|
117
|
+
let yMin = Number.POSITIVE_INFINITY;
|
|
118
|
+
let yMax = Number.NEGATIVE_INFINITY;
|
|
119
|
+
for (const c of candidates) {
|
|
120
|
+
if (c.x < win.xMin || c.x > win.xMax)
|
|
121
|
+
continue;
|
|
122
|
+
if (!Number.isFinite(c.lo) || !Number.isFinite(c.hi))
|
|
123
|
+
continue;
|
|
124
|
+
if (c.lo < yMin)
|
|
125
|
+
yMin = c.lo;
|
|
126
|
+
if (c.hi > yMax)
|
|
127
|
+
yMax = c.hi;
|
|
128
|
+
}
|
|
129
|
+
if (!Number.isFinite(yMin) || !Number.isFinite(yMax))
|
|
130
|
+
return undefined;
|
|
131
|
+
return { yMin, yMax };
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=viewController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewController.js","sourceRoot":"","sources":["../../src/interaction/viewController.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAoF/D,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAElC,4EAA4E;AAC5E,4EAA4E;AAC5E,6EAA6E;AAC7E,gEAAgE;AAChE,SAAS,WAAW,CAChB,GAAY,EACZ,OAAe,EACf,OAAe,EACf,OAAe,EACf,aAAqB;IAErB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC;IAChD,MAAM,OAAO,GAAG,QAAQ,GAAG,aAAa,CAAC;IACzC,IAAI,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;IAC/B,IAAI,OAAO,GAAG,CAAC,IAAI,IAAI,GAAG,OAAO;QAAE,IAAI,GAAG,OAAO,CAAC;IAClD,IAAI,IAAI,GAAG,OAAO;QAAE,IAAI,GAAG,OAAO,CAAC;IACnC,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC;IAC7B,IAAI,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC;IAC7B,IAAI,IAAI,IAAI,QAAQ,EAAE,CAAC;QACnB,IAAI,IAAI,GAAG,OAAO,EAAE,CAAC;YACjB,IA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,OAAO,EACP,aAAa,CAChB,CAAC;QACN,CAAC;QACD,KAAK;YACD,IAAI,GAAG,SAAS,CAAC;YACjB,UAAU,GAAG,KAAK,CAAC;YACnB,oEAAoE;YACpE,kEAAkE;YAClE,6CAA6C;YAC7C,YAAY,GAAG,SAAS,CAAC;QAC7B,CAAC;KACJ,CAAC;AACN,CAAC;AAgBD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,cAAc,CAC1B,UAAkC,EAClC,GAAY;IAEZ,IAAI,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACpC,IAAI,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACpC,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;QACzB,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI;YAAE,SAAS;QAC/C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;YAAE,SAAS;QAC/D,IAAI,CAAC,CAAC,EAAE,GAAG,IAAI;YAAE,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC;QAC7B,IAAI,CAAC,CAAC,EAAE,GAAG,IAAI;YAAE,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC;IACjC,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC;IACvE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAC1B,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\n/**\n * A visible window into the world x axis (bar times in UTC ms). The two\n * self-scaled adapters (canvas2d, konva) resolve one per frame from a\n * {@link ViewController} and feed `xMin`/`xMax` into their `Viewport`.\n *\n * @since 1.6\n * @stable\n * @example\n * const win: XWindow = { xMin: 0, xMax: 100 };\n * void win;\n */\nexport type XWindow = { readonly xMin: number; readonly xMax: number };\n\n/**\n * Construction options for {@link createViewController}. `minSpan` is the\n * smallest world-x span a zoom-in can reach (so the window never collapses\n * to a point); `maxSpanFactor` is the largest span a zoom-out can reach as\n * a multiple of the current data span (default `1` ⇒ cannot zoom out past\n * \"all data visible\").\n *\n * @since 1.6\n * @stable\n * @example\n * const opts: ViewControllerOpts = { minSpan: 1, maxSpanFactor: 1 };\n * void opts;\n */\nexport type ViewControllerOpts = {\n readonly minSpan?: number;\n readonly maxSpanFactor?: number;\n};\n\n/**\n * Stateful, library-agnostic pan/zoom controller for an adapter that\n * computes its own x scale every frame. It holds a user x-window plus a\n * `userInteracted` flag: until the user wheels or drags, {@link\n * ViewController.resolveXWindow} returns the auto-follow window (the full\n * data range, or the framed `autoFollowXMin` window); after the first\n * interaction it returns the held window (re-clamped as data grows), so\n * live frames stop snapping the view back. The first {@link\n * ViewController.zoomAt}/{@link ViewController.panBy} seeds the held window\n * from the window last returned by {@link ViewController.resolveXWindow}\n * (what the user is currently looking at), so leaving auto-follow keeps the\n * framed view rather than jumping to the full data range.\n *\n * All transforms are pure functions of the current state + the supplied\n * data bounds — there is no DOM or library coupling. The example adapters\n * wire DOM events to {@link ViewController.zoomAt} / {@link\n * ViewController.panBy} / {@link ViewController.reset} via {@link\n * attachInteraction}.\n *\n * @since 1.6\n * @stable\n * @example\n * const view = createViewController();\n * view.resolveXWindow(0, 100); // { xMin: 0, xMax: 100 } (auto-follow)\n * view.panBy(10, 0, 100);\n * view.userInteracted; // true\n */\nexport type ViewController = {\n /** `true` once the user has zoomed or panned (auto-follow is paused). */\n readonly userInteracted: boolean;\n /**\n * The x-window to render this frame. While not interacted (auto-follow),\n * returns `[autoFollowXMin ?? dataXMin, dataXMax]` — pass `autoFollowXMin`\n * (e.g. the time of the Nth-from-last bar) to frame only the most recent\n * bars by default while keeping the full history scrollable; omit it to\n * fit all data. After the first interaction it returns the held window\n * clamped into the current data bounds (`autoFollowXMin` is then ignored).\n */\n resolveXWindow(dataXMin: number, dataXMax: number, autoFollowXMin?: number): XWindow;\n /**\n * Zoom by `factor` (`<1` in, `>1` out) about a world-x pivot. The first\n * call seeds the held window from the last resolved window (the current\n * view), falling back to the full data range if nothing has rendered yet.\n */\n zoomAt(pivotX: number, factor: number, dataXMin: number, dataXMax: number): void;\n /** Pan the window by a signed world-x delta. */\n panBy(deltaWorldX: number, dataXMin: number, dataXMax: number): void;\n /** Clear the held window + flag so the view auto-follows again. */\n reset(): void;\n};\n\nconst DEFAULT_MIN_SPAN = 1;\nconst DEFAULT_MAX_SPAN_FACTOR = 1;\n\n// Clamp a candidate window: bound its span to [minSpan, maxSpan] (maxSpan =\n// dataSpan * maxSpanFactor), then shift it to sit inside [dataMin, dataMax]\n// when it fits, or pin it to the full data range when it is at least as wide\n// as the data. The single clamp shared by zoom / pan / resolve.\nfunction clampWindow(\n win: XWindow,\n dataMin: number,\n dataMax: number,\n minSpan: number,\n maxSpanFactor: number,\n): XWindow {\n const dataSpan = Math.max(0, dataMax - dataMin);\n const maxSpan = dataSpan * maxSpanFactor;\n let span = win.xMax - win.xMin;\n if (maxSpan > 0 && span > maxSpan) span = maxSpan;\n if (span < minSpan) span = minSpan;\n const center = (win.xMin + win.xMax) / 2;\n let xMin = center - span / 2;\n let xMax = center + span / 2;\n if (span <= dataSpan) {\n if (xMin < dataMin) {\n xMax += dataMin - xMin;\n xMin = dataMin;\n }\n if (xMax > dataMax) {\n xMin -= xMax - dataMax;\n xMax = dataMax;\n }\n return { xMin, xMax };\n }\n return { xMin: dataMin, xMax: dataMax };\n}\n\n/**\n * Build a {@link ViewController}. Pass `opts` to tune the zoom-in floor\n * (`minSpan`) and zoom-out ceiling (`maxSpanFactor`); both default to a\n * \"1 ms floor, all-data ceiling\" policy.\n *\n * @since 1.6\n * @stable\n * @example\n * const view = createViewController({ minSpan: 2, maxSpanFactor: 1 });\n * view.zoomAt(50, 0.5, 0, 100); // zoom in 2× about x=50\n * void view.resolveXWindow(0, 100);\n */\nexport function createViewController(opts?: ViewControllerOpts): ViewController {\n const minSpan = opts?.minSpan ?? DEFAULT_MIN_SPAN;\n const maxSpanFactor = opts?.maxSpanFactor ?? DEFAULT_MAX_SPAN_FACTOR;\n let held: XWindow | undefined;\n let interacted = false;\n // The window most recently returned by `resolveXWindow` — i.e. what the\n // user is currently looking at. The first `zoomAt`/`panBy` seeds from this\n // so the transition out of auto-follow keeps the framed (`autoFollowXMin`)\n // view instead of snapping to the full data range.\n let lastResolved: XWindow | undefined;\n\n const base = (dataMin: number, dataMax: number): XWindow =>\n held ?? lastResolved ?? { xMin: dataMin, xMax: dataMax };\n\n return {\n get userInteracted(): boolean {\n return interacted;\n },\n resolveXWindow(dataMin: number, dataMax: number, autoFollowXMin?: number): XWindow {\n let win: XWindow;\n if (!interacted || held === undefined) {\n // Auto-follow: optionally start the window at a windowed left\n // edge (clamped into the data range) so the default view frames\n // the most recent bars; new bars keep extending xMax.\n const xMin =\n autoFollowXMin === undefined\n ? dataMin\n : Math.min(Math.max(autoFollowXMin, dataMin), dataMax);\n win = { xMin, xMax: dataMax };\n } else {\n win = clampWindow(held, dataMin, dataMax, minSpan, maxSpanFactor);\n }\n lastResolved = win;\n return win;\n },\n zoomAt(pivotX: number, factor: number, dataMin: number, dataMax: number): void {\n interacted = true;\n const b = base(dataMin, dataMax);\n const span = b.xMax - b.xMin;\n const frac = span === 0 ? 0.5 : (pivotX - b.xMin) / span;\n const newSpan = span * factor;\n const xMin = pivotX - frac * newSpan;\n held = clampWindow(\n { xMin, xMax: xMin + newSpan },\n dataMin,\n dataMax,\n minSpan,\n maxSpanFactor,\n );\n },\n panBy(deltaWorldX: number, dataMin: number, dataMax: number): void {\n interacted = true;\n const b = base(dataMin, dataMax);\n held = clampWindow(\n { xMin: b.xMin + deltaWorldX, xMax: b.xMax + deltaWorldX },\n dataMin,\n dataMax,\n minSpan,\n maxSpanFactor,\n );\n },\n reset(): void {\n held = undefined;\n interacted = false;\n // Drop the remembered framed window too, so an immediate post-reset\n // zoom/pan (before the next `resolveXWindow`) seeds from the data\n // bounds rather than a stale pre-reset view.\n lastResolved = undefined;\n },\n };\n}\n\n/**\n * One candidate row for {@link yRangeInWindow}: a world `x` (bar time) plus\n * the low / high values to fold into the y range when `x` is inside the\n * window. Bars pass `{ x: time, lo: low, hi: high }`; a scalar series point\n * passes `lo === hi === value`.\n *\n * @since 1.6\n * @stable\n * @example\n * const c: WindowYInput = { x: 10, lo: 99, hi: 101 };\n * void c;\n */\nexport type WindowYInput = { readonly x: number; readonly lo: number; readonly hi: number };\n\n/**\n * Fold the y range of every candidate whose `x` falls inside `win` — the\n * shared \"auto-fit the price scale to the visible window\" helper (matching\n * lightweight-charts' auto price scale). Non-finite `lo`/`hi` rows are\n * skipped. Returns `undefined` when no finite in-window candidate is seen,\n * so the caller keeps its own degenerate-range fallback. Horizontal lines\n * (no `x`) are folded in by the caller, not here.\n *\n * @since 1.6\n * @stable\n * @example\n * const r = yRangeInWindow([{ x: 5, lo: 1, hi: 3 }], { xMin: 0, xMax: 10 });\n * // r === { yMin: 1, yMax: 3 }\n * void r;\n */\nexport function yRangeInWindow(\n candidates: Iterable<WindowYInput>,\n win: XWindow,\n): { readonly yMin: number; readonly yMax: number } | undefined {\n let yMin = Number.POSITIVE_INFINITY;\n let yMax = Number.NEGATIVE_INFINITY;\n for (const c of candidates) {\n if (c.x < win.xMin || c.x > win.xMax) continue;\n if (!Number.isFinite(c.lo) || !Number.isFinite(c.hi)) continue;\n if (c.lo < yMin) yMin = c.lo;\n if (c.hi > yMax) yMax = c.hi;\n }\n if (!Number.isFinite(yMin) || !Number.isFinite(yMax)) return undefined;\n return { yMin, yMax };\n}\n"]}
|
|
@@ -24,6 +24,12 @@ export type MockCandleSourceMode = "history" | "stream" | "history-then-stream";
|
|
|
24
24
|
* stream after the warm-up batch. `streamTail` is clamped to
|
|
25
25
|
* `[0, bars.length]`.
|
|
26
26
|
*
|
|
27
|
+
* `symbol` drives the secondary-stream wire: when set, every emitted event
|
|
28
|
+
* is tagged with `streamKey: feedKey(symbol, interval)` so the mock can
|
|
29
|
+
* drive a different-symbol scenario through the standard wire. Omit it for
|
|
30
|
+
* the main stream — events then carry no `streamKey`, byte-identical to the
|
|
31
|
+
* single-symbol baseline.
|
|
32
|
+
*
|
|
27
33
|
* @since 0.5
|
|
28
34
|
* @stable
|
|
29
35
|
* @example
|
|
@@ -31,12 +37,14 @@ export type MockCandleSourceMode = "history" | "stream" | "history-then-stream";
|
|
|
31
37
|
* interval: "1D",
|
|
32
38
|
* mode: "history-then-stream",
|
|
33
39
|
* streamTail: 20,
|
|
40
|
+
* symbol: "AMEX:SPY",
|
|
34
41
|
* };
|
|
35
42
|
*/
|
|
36
43
|
export type MockCandleSourceOpts = {
|
|
37
44
|
readonly interval: string;
|
|
38
45
|
readonly mode?: MockCandleSourceMode;
|
|
39
46
|
readonly streamTail?: number;
|
|
47
|
+
readonly symbol?: string;
|
|
40
48
|
};
|
|
41
49
|
/**
|
|
42
50
|
* Wrap a static `Bar[]` array in an `AsyncIterable<CandleEvent>` the
|
|
@@ -54,6 +62,10 @@ export type MockCandleSourceOpts = {
|
|
|
54
62
|
* `streamTail >= bars.length` yields an empty history batch followed
|
|
55
63
|
* by a close-per-bar.
|
|
56
64
|
*
|
|
65
|
+
* A `symbol` opt tags every event with `streamKey: feedKey(symbol, interval)`
|
|
66
|
+
* so the mock can drive a different-symbol secondary stream. Omitting it
|
|
67
|
+
* leaves events untagged (main stream), byte-identical to the baseline.
|
|
68
|
+
*
|
|
57
69
|
* @since 0.1
|
|
58
70
|
* @stable
|
|
59
71
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockCandleSource.d.ts","sourceRoot":"","sources":["../../src/mocks/mockCandleSource.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mockCandleSource.d.ts","sourceRoot":"","sources":["../../src/mocks/mockCandleSource.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,QAAQ,GAAG,qBAAqB,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,oBAAoB,CAAC;IACrC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,gBAAgB,CAC5B,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,EACxB,IAAI,GAAE,oBAAyC,GAChD,aAAa,CAAC,WAAW,CAAC,CA4B5B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Copyright (c) 2026 Invinite. Licensed under the MIT License.
|
|
2
2
|
// See the LICENSE file in the repo root for full license text.
|
|
3
|
+
import { feedKey } from "@invinite-org/chartlang-core";
|
|
3
4
|
const DEFAULT_STREAM_TAIL = 1;
|
|
4
5
|
/**
|
|
5
6
|
* Wrap a static `Bar[]` array in an `AsyncIterable<CandleEvent>` the
|
|
@@ -17,6 +18,10 @@ const DEFAULT_STREAM_TAIL = 1;
|
|
|
17
18
|
* `streamTail >= bars.length` yields an empty history batch followed
|
|
18
19
|
* by a close-per-bar.
|
|
19
20
|
*
|
|
21
|
+
* A `symbol` opt tags every event with `streamKey: feedKey(symbol, interval)`
|
|
22
|
+
* so the mock can drive a different-symbol secondary stream. Omitting it
|
|
23
|
+
* leaves events untagged (main stream), byte-identical to the baseline.
|
|
24
|
+
*
|
|
20
25
|
* @since 0.1
|
|
21
26
|
* @stable
|
|
22
27
|
* @example
|
|
@@ -30,23 +35,27 @@ const DEFAULT_STREAM_TAIL = 1;
|
|
|
30
35
|
export function mockCandleSource(bars, opts = { interval: "1D" }) {
|
|
31
36
|
const mode = opts.mode ?? "history";
|
|
32
37
|
const streamTail = clampTail(opts.streamTail ?? DEFAULT_STREAM_TAIL, bars.length);
|
|
38
|
+
// Only a present symbol widens the wire to a secondary stream; an omitted
|
|
39
|
+
// symbol leaves `streamKey` off so the main-stream output stays
|
|
40
|
+
// byte-identical to the single-symbol baseline.
|
|
41
|
+
const tag = opts.symbol === undefined ? {} : { streamKey: feedKey(opts.symbol, opts.interval) };
|
|
33
42
|
return {
|
|
34
43
|
async *[Symbol.asyncIterator]() {
|
|
35
44
|
if (mode === "history") {
|
|
36
|
-
yield { kind: "history", bars };
|
|
45
|
+
yield { kind: "history", bars, ...tag };
|
|
37
46
|
return;
|
|
38
47
|
}
|
|
39
48
|
if (mode === "stream") {
|
|
40
49
|
for (const bar of bars) {
|
|
41
|
-
yield { kind: "close", bar };
|
|
50
|
+
yield { kind: "close", bar, ...tag };
|
|
42
51
|
}
|
|
43
52
|
return;
|
|
44
53
|
}
|
|
45
54
|
// history-then-stream
|
|
46
55
|
const splitAt = bars.length - streamTail;
|
|
47
|
-
yield { kind: "history", bars: bars.slice(0, splitAt) };
|
|
56
|
+
yield { kind: "history", bars: bars.slice(0, splitAt), ...tag };
|
|
48
57
|
for (let i = splitAt; i < bars.length; i += 1) {
|
|
49
|
-
yield { kind: "close", bar: bars[i] };
|
|
58
|
+
yield { kind: "close", bar: bars[i], ...tag };
|
|
50
59
|
}
|
|
51
60
|
},
|
|
52
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockCandleSource.js","sourceRoot":"","sources":["../../src/mocks/mockCandleSource.ts"],"names":[],"m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G,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;YACzC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC;YAChE,KAAK,IAAI,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC5C,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC;YAClD,CAAC;QACL,CAAC;KACJ,CAAC;AACN,CAAC;AAED,SAAS,SAAS,CAAC,KAAa,EAAE,KAAa;IAC3C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC;IACnD,IAAI,KAAK,GAAG,KAAK;QAAE,OAAO,KAAK,CAAC;IAChC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport { feedKey } from \"@invinite-org/chartlang-core\";\n\nimport type { Bar } from \"@invinite-org/chartlang-core\";\nimport type { CandleEvent } from \"../types.js\";\n\n/**\n * How a {@link mockCandleSource} surfaces the supplied bars:\n *\n * - `history` — yields one warm-up batch with every bar.\n * - `stream` — yields one `close` event per bar in array order.\n * - `history-then-stream` — yields one history batch containing all\n * but the last `streamTail` bars, then a `close` event per\n * remaining bar. Lets a consumer paint a chart instantly from\n * the warm-up batch and still receive per-bar ticks afterwards.\n *\n * @since 0.5\n * @stable\n * @example\n * const m: MockCandleSourceMode = \"history-then-stream\";\n */\nexport type MockCandleSourceMode = \"history\" | \"stream\" | \"history-then-stream\";\n\n/**\n * Options accepted by {@link mockCandleSource}. `interval` mirrors the\n * `Bar.interval` field; `mode` defaults to `\"history\"`. `streamTail`\n * applies only when `mode === \"history-then-stream\"` and defaults to\n * `1` — the smallest non-zero value, leaving a single tail bar to\n * stream after the warm-up batch. `streamTail` is clamped to\n * `[0, bars.length]`.\n *\n * `symbol` drives the secondary-stream wire: when set, every emitted event\n * is tagged with `streamKey: feedKey(symbol, interval)` so the mock can\n * drive a different-symbol scenario through the standard wire. Omit it for\n * the main stream — events then carry no `streamKey`, byte-identical to the\n * single-symbol baseline.\n *\n * @since 0.5\n * @stable\n * @example\n * const o: MockCandleSourceOpts = {\n * interval: \"1D\",\n * mode: \"history-then-stream\",\n * streamTail: 20,\n * symbol: \"AMEX:SPY\",\n * };\n */\nexport type MockCandleSourceOpts = {\n readonly interval: string;\n readonly mode?: MockCandleSourceMode;\n readonly streamTail?: number;\n readonly symbol?: string;\n};\n\nconst DEFAULT_STREAM_TAIL = 1;\n\n/**\n * Wrap a static `Bar[]` array in an `AsyncIterable<CandleEvent>` the\n * runtime + conformance tests can drive directly.\n *\n * - `\"history\"` (default) — yields exactly one\n * `{ kind: \"history\", bars }` event.\n * - `\"stream\"` — yields one `{ kind: \"close\", bar }` per bar in array\n * order.\n * - `\"history-then-stream\"` — yields a single\n * `{ kind: \"history\", bars }` event for all but the trailing\n * `streamTail` bars (default `1`), then one `{ kind: \"close\", bar }`\n * per remaining bar. With `streamTail` clamped to `[0, bars.length]`,\n * `streamTail === 0` degenerates to a pure history batch and\n * `streamTail >= bars.length` yields an empty history batch followed\n * by a close-per-bar.\n *\n * A `symbol` opt tags every event with `streamKey: feedKey(symbol, interval)`\n * so the mock can drive a different-symbol secondary stream. Omitting it\n * leaves events untagged (main stream), byte-identical to the baseline.\n *\n * @since 0.1\n * @stable\n * @example\n * import { mockCandleSource } from \"@invinite-org/chartlang-adapter-kit\";\n *\n * const source = mockCandleSource([], { interval: \"1D\" });\n * for await (const e of source) {\n * void e;\n * }\n */\nexport function mockCandleSource(\n bars: ReadonlyArray<Bar>,\n opts: MockCandleSourceOpts = { interval: \"1D\" },\n): AsyncIterable<CandleEvent> {\n const mode: MockCandleSourceMode = opts.mode ?? \"history\";\n const streamTail = clampTail(opts.streamTail ?? DEFAULT_STREAM_TAIL, bars.length);\n // Only a present symbol widens the wire to a secondary stream; an omitted\n // symbol leaves `streamKey` off so the main-stream output stays\n // byte-identical to the single-symbol baseline.\n const tag: { readonly streamKey?: string } =\n opts.symbol === undefined ? {} : { streamKey: feedKey(opts.symbol, opts.interval) };\n return {\n async *[Symbol.asyncIterator](): AsyncIterator<CandleEvent> {\n if (mode === \"history\") {\n yield { kind: \"history\", bars, ...tag };\n return;\n }\n if (mode === \"stream\") {\n for (const bar of bars) {\n yield { kind: \"close\", bar, ...tag };\n }\n return;\n }\n // history-then-stream\n const splitAt = bars.length - streamTail;\n yield { kind: \"history\", bars: bars.slice(0, splitAt), ...tag };\n for (let i = splitAt; i < bars.length; i += 1) {\n yield { kind: \"close\", bar: bars[i], ...tag };\n }\n },\n };\n}\n\nfunction clampTail(value: number, total: number): number {\n if (!Number.isFinite(value) || value < 0) return 0;\n if (value > total) return total;\n return Math.floor(value);\n}\n"]}
|
package/dist/types.d.ts
CHANGED
|
@@ -14,8 +14,12 @@ export type CandleEvent = {
|
|
|
14
14
|
readonly kind: "history";
|
|
15
15
|
readonly bars: ReadonlyArray<Bar>;
|
|
16
16
|
/**
|
|
17
|
-
* Secondary-stream key. Omit for the main stream; set
|
|
18
|
-
*
|
|
17
|
+
* Secondary-stream feed key. Omit for the main stream; otherwise set
|
|
18
|
+
* to the composite key built by core's `feedKey(symbol, interval)` —
|
|
19
|
+
* the bare interval (`"1D"`) for a higher-timeframe stream of the
|
|
20
|
+
* chart's own symbol, or `"<symbol>@<interval>"` (`"AMEX:SPY@1D"`)
|
|
21
|
+
* for a different-symbol stream. Must match the runtime's
|
|
22
|
+
* secondary-stream key byte-for-byte.
|
|
19
23
|
*
|
|
20
24
|
* @since 0.5
|
|
21
25
|
*/
|
|
@@ -24,8 +28,12 @@ export type CandleEvent = {
|
|
|
24
28
|
readonly kind: "close";
|
|
25
29
|
readonly bar: Bar;
|
|
26
30
|
/**
|
|
27
|
-
* Secondary-stream key. Omit for the main stream; set
|
|
28
|
-
*
|
|
31
|
+
* Secondary-stream feed key. Omit for the main stream; otherwise set
|
|
32
|
+
* to the composite key built by core's `feedKey(symbol, interval)` —
|
|
33
|
+
* the bare interval (`"1D"`) for a higher-timeframe stream of the
|
|
34
|
+
* chart's own symbol, or `"<symbol>@<interval>"` (`"AMEX:SPY@1D"`)
|
|
35
|
+
* for a different-symbol stream. Must match the runtime's
|
|
36
|
+
* secondary-stream key byte-for-byte.
|
|
29
37
|
*
|
|
30
38
|
* @since 0.5
|
|
31
39
|
*/
|
|
@@ -34,8 +42,12 @@ export type CandleEvent = {
|
|
|
34
42
|
readonly kind: "tick";
|
|
35
43
|
readonly bar: Bar;
|
|
36
44
|
/**
|
|
37
|
-
* Secondary-stream key. Omit for the main stream; set
|
|
38
|
-
*
|
|
45
|
+
* Secondary-stream feed key. Omit for the main stream; otherwise set
|
|
46
|
+
* to the composite key built by core's `feedKey(symbol, interval)` —
|
|
47
|
+
* the bare interval (`"1D"`) for a higher-timeframe stream of the
|
|
48
|
+
* chart's own symbol, or `"<symbol>@<interval>"` (`"AMEX:SPY@1D"`)
|
|
49
|
+
* for a different-symbol stream. Must match the runtime's
|
|
50
|
+
* secondary-stream key byte-for-byte.
|
|
39
51
|
*
|
|
40
52
|
* @since 0.5
|
|
41
53
|
*/
|
|
@@ -200,6 +212,7 @@ export type DrawingCounts = CoreDrawingCounts;
|
|
|
200
212
|
* inputs: new Set(),
|
|
201
213
|
* intervals: [],
|
|
202
214
|
* multiTimeframe: false,
|
|
215
|
+
* multiSymbol: false,
|
|
203
216
|
* subPanes: 0,
|
|
204
217
|
* symInfoFields: new Set(),
|
|
205
218
|
* maxDrawingsPerScript: {
|
|
@@ -260,6 +273,25 @@ export type Capabilities = {
|
|
|
260
273
|
* void enabled;
|
|
261
274
|
*/
|
|
262
275
|
readonly multiTimeframe: boolean;
|
|
276
|
+
/**
|
|
277
|
+
* Whether the adapter can deliver candle streams for a **different symbol**
|
|
278
|
+
* than the chart's own (e.g. a cross-instrument ratio). A strictly larger
|
|
279
|
+
* capability than {@link Capabilities.multiTimeframe} — an adapter can
|
|
280
|
+
* resample its own symbol to a higher timeframe without being able to fetch
|
|
281
|
+
* another instrument. `false` triggers the all-NaN fallback for any
|
|
282
|
+
* `request.security({ symbol })` whose symbol differs from the chart symbol
|
|
283
|
+
* (a chart-symbol / interval-only request stays gated only by
|
|
284
|
+
* `multiTimeframe`). Independent of `multiTimeframe` — the runtime gates
|
|
285
|
+
* per request (symbol differs ⇒ `multiSymbol`; interval differs ⇒
|
|
286
|
+
* `multiTimeframe`).
|
|
287
|
+
*
|
|
288
|
+
* @since 1.6
|
|
289
|
+
* @stable
|
|
290
|
+
* @example
|
|
291
|
+
* const enabled: Capabilities["multiSymbol"] = false;
|
|
292
|
+
* void enabled;
|
|
293
|
+
*/
|
|
294
|
+
readonly multiSymbol: boolean;
|
|
263
295
|
/**
|
|
264
296
|
* Max number of sub-panes the adapter can render for one script. Use
|
|
265
297
|
* `Number.MAX_SAFE_INTEGER` as the unlimited sentinel per PLAN §7.2.
|
|
@@ -417,7 +449,9 @@ export type PlotStyle = {
|
|
|
417
449
|
* A `plot()` / `hline()` emission the runtime sends to the adapter.
|
|
418
450
|
* Numeric `value: null` is the wire-level "skip this bar" — NaN/Infinity
|
|
419
451
|
* are forbidden in `value` and anywhere in `meta` (PLAN §7.3 universal
|
|
420
|
-
* payload rules).
|
|
452
|
+
* payload rules). The optional {@link PlotEmission.colorValue} carries a
|
|
453
|
+
* per-bar dynamic color that overrides the static `color` / `style.color`
|
|
454
|
+
* when present; omit it for the static-color baseline.
|
|
421
455
|
*
|
|
422
456
|
* @since 0.1
|
|
423
457
|
* @stable
|
|
@@ -492,6 +526,43 @@ export type PlotEmission = {
|
|
|
492
526
|
* void behind;
|
|
493
527
|
*/
|
|
494
528
|
readonly z?: number;
|
|
529
|
+
/**
|
|
530
|
+
* Per-bar dynamic color for this emission. **Omitted ⇒** the adapter uses
|
|
531
|
+
* the static color (the style's `color` for `bg-color`/`bar-color`, or the
|
|
532
|
+
* top-level {@link PlotEmission.color} for line-family plots), so a
|
|
533
|
+
* no-dynamic-color emission is byte-identical to the pre-feature wire and
|
|
534
|
+
* every pinned `plot-hash` (which hashes only `{ bar, value }`) is
|
|
535
|
+
* untouched. **Present ⇒** it OVERRIDES the static color for this
|
|
536
|
+
* `(slotId, bar)` at render time. Adapters MUST prefer `colorValue` over
|
|
537
|
+
* the static color when present (`colorValue` wins over `style.color` for
|
|
538
|
+
* `bg-color`/`bar-color`, and over the top-level `color` for line-family
|
|
539
|
+
* plots) — this is the normative precedence contract binding every
|
|
540
|
+
* conformant adapter. **`null` ⇒** an explicit "no color this bar" gap,
|
|
541
|
+
* which is DISTINCT from omitted (omitted falls back to the static color;
|
|
542
|
+
* `null` paints nothing). This
|
|
543
|
+
* channel is orthogonal to the numeric {@link PlotEmission.value}: a
|
|
544
|
+
* `bg-color` emission still carries `value: null` and rides its per-bar
|
|
545
|
+
* color here. Like {@link PlotEmission.xShift} / {@link PlotEmission.z} it
|
|
546
|
+
* is appended and omitted-when-absent, so the wire order stays additive.
|
|
547
|
+
*
|
|
548
|
+
* Rejected alternatives (recorded for future maintainers): (1) overloading
|
|
549
|
+
* `value` to `number | string | null` — `value` is load-bearing for alerts,
|
|
550
|
+
* y-scale inclusion, the NaN-forbidden rule, and the `plot-hash` tuple, so
|
|
551
|
+
* widening it poisons every numeric consumer and rebreaks every hash;
|
|
552
|
+
* (2) a new per-bar-color `PlotStyle` arm — color-per-bar is orthogonal to
|
|
553
|
+
* *style*, so encoding it as a style splits one concept across N arms and
|
|
554
|
+
* still cannot recolor a `line` plot per bar. The parallel optional channel
|
|
555
|
+
* avoids both.
|
|
556
|
+
*
|
|
557
|
+
* @since 1.5
|
|
558
|
+
* @stable
|
|
559
|
+
* @example
|
|
560
|
+
* const dyn: PlotEmission["colorValue"] = "#16a34a";
|
|
561
|
+
* const gap: PlotEmission["colorValue"] = null;
|
|
562
|
+
* void dyn;
|
|
563
|
+
* void gap;
|
|
564
|
+
*/
|
|
565
|
+
readonly colorValue?: Color | null;
|
|
495
566
|
};
|
|
496
567
|
/**
|
|
497
568
|
* An `alert()` emission. `dedupeKey` is computed by the runtime
|
|
@@ -654,6 +725,18 @@ export type DrawingEmission = {
|
|
|
654
725
|
* - `dep-output-not-titled` — producer's `plot(...)` has no `title`,
|
|
655
726
|
* so consumers cannot reference it by name.
|
|
656
727
|
*
|
|
728
|
+
* `multi-symbol-not-supported` — a `request.security` for a DIFFERENT symbol
|
|
729
|
+
* than the chart's against an adapter declaring `multiSymbol: false` degrades
|
|
730
|
+
* to all-NaN, mirroring `multi-timeframe-not-supported`. The runtime gates per
|
|
731
|
+
* request (symbol differs ⇒ this code; interval differs ⇒
|
|
732
|
+
* `multi-timeframe-not-supported`), and the symbol gate precedes the timeframe
|
|
733
|
+
* gate so a both-different request emits only this code.
|
|
734
|
+
*
|
|
735
|
+
* `tz-dst-unsupported` — a `time.*` / `session.*` accessor was passed a
|
|
736
|
+
* DST-bearing IANA timezone (e.g. `"America/New_York"`). The v1 calendar
|
|
737
|
+
* runtime resolves UTC + fixed offsets only (byte-reproducible, no `Intl`), so
|
|
738
|
+
* a DST zone falls back to UTC and warns once per distinct tz per mount.
|
|
739
|
+
*
|
|
657
740
|
* @since 0.1
|
|
658
741
|
* @stable
|
|
659
742
|
* @example
|
|
@@ -662,7 +745,7 @@ export type DrawingEmission = {
|
|
|
662
745
|
* void code;
|
|
663
746
|
* void dep;
|
|
664
747
|
*/
|
|
665
|
-
export type DiagnosticCode = "unsupported-plot-kind" | "unsupported-drawing-kind" | "unsupported-alert-channel" | "unsupported-pane" | "unsupported-interval" | "multi-timeframe-not-supported" | "unknown-secondary-stream" | "lookback-exceeded" | "drawing-budget-exceeded" | "dropped-by-policy" | "input-coercion-failed" | "alert-conditions-not-supported" | "unknown-alert-condition" | "alert-rate-limited" | "runtime-cpu-budget-exceeded" | "runtime-memory-budget-exceeded" | "runtime-log-budget-exceeded" | "malformed-log-meta" | "runtime-error-thrown" | "session-info-missing" | "fixed-range-inverted" | "state-snapshot-restored" | "state-snapshot-future-dated" | "state-snapshot-malformed" | "state-snapshot-save-failed" | "malformed-emission" | "dep-error" | "dep-cycle" | "dep-unknown-output" | "dep-invalid-input-override" | "dep-dynamic" | "dep-output-not-titled";
|
|
748
|
+
export type DiagnosticCode = "unsupported-plot-kind" | "unsupported-drawing-kind" | "unsupported-alert-channel" | "unsupported-pane" | "unsupported-interval" | "multi-timeframe-not-supported" | "multi-symbol-not-supported" | "unknown-secondary-stream" | "lookback-exceeded" | "drawing-budget-exceeded" | "dropped-by-policy" | "input-coercion-failed" | "alert-conditions-not-supported" | "unknown-alert-condition" | "alert-rate-limited" | "runtime-cpu-budget-exceeded" | "runtime-memory-budget-exceeded" | "runtime-log-budget-exceeded" | "malformed-log-meta" | "runtime-error-thrown" | "session-info-missing" | "tz-dst-unsupported" | "fixed-range-inverted" | "state-snapshot-restored" | "state-snapshot-future-dated" | "state-snapshot-malformed" | "state-snapshot-save-failed" | "malformed-emission" | "dep-error" | "dep-cycle" | "dep-unknown-output" | "dep-invalid-input-override" | "dep-dynamic" | "dep-output-not-titled";
|
|
666
749
|
/**
|
|
667
750
|
* A non-rendered diagnostic the runtime / host surfaces to the editor +
|
|
668
751
|
* error reporters. Never user-visible on its own.
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACR,aAAa,EACb,GAAG,EACH,KAAK,EACL,aAAa,IAAI,iBAAiB,EAClC,WAAW,IAAI,eAAe,EAC9B,SAAS,IAAI,aAAa,EAC1B,QAAQ,IAAI,YAAY,EACxB,YAAY,IAAI,gB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