@luxalgo/vela 0.7.8 → 0.8.1
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/NOTICE +28 -28
- package/README.md +15 -7
- package/dist/{DataProvider-CGa4KHRa.d.cts → DataProvider-BrlxntPN.d.cts} +1 -1
- package/dist/{DataProvider-CmWUtDVL.d.ts → DataProvider-DwFIoV4r.d.ts} +1 -1
- package/dist/{chunk-N4ZZYLMP.js → chunk-ATGTCWHJ.js} +726 -273
- package/dist/{chunk-CAFCLMPF.js → chunk-BZQM2XO7.js} +1 -0
- package/dist/{chunk-M6GP7DAX.js → chunk-DBDXKZUF.js} +474 -47
- package/dist/{chunk-BFA32GOU.js → chunk-EZ5FWVLA.js} +5 -2
- package/dist/{chunk-PVGWNF7V.js → chunk-LMBYEGUR.js} +2 -2
- package/dist/{chunk-WTWGEB7K.js → chunk-NELQJCGK.js} +298 -5
- package/dist/{contributions-DF_Ea07m.d.cts → contributions-CtlptxR8.d.cts} +187 -5
- package/dist/{contributions-nKOSeLy8.d.ts → contributions-tjNExo1o.d.ts} +187 -5
- package/dist/index.cjs +1044 -272
- package/dist/index.d.cts +24 -8
- package/dist/index.d.ts +24 -8
- package/dist/index.js +28 -4
- package/dist/{options-D1AJKsn_.d.ts → options-BnEPUuVV.d.cts} +1 -1
- package/dist/{options-D1AJKsn_.d.cts → options-BnEPUuVV.d.ts} +1 -1
- package/dist/{plugin-6F04gjQe.d.cts → plugin-BWxJRKzS.d.cts} +10 -4
- package/dist/{plugin-BLsNipkc.d.ts → plugin-e2WUEtiI.d.ts} +10 -4
- package/dist/plugin.cjs +1 -0
- package/dist/plugin.d.cts +4 -4
- package/dist/plugin.d.ts +4 -4
- package/dist/plugin.js +2 -2
- package/dist/providers/binance.d.cts +2 -2
- package/dist/providers/binance.d.ts +2 -2
- package/dist/providers/coinbase.d.cts +2 -2
- package/dist/providers/coinbase.d.ts +2 -2
- package/dist/providers/hyperliquid.d.cts +2 -2
- package/dist/providers/hyperliquid.d.ts +2 -2
- package/dist/{statusline-model-DAFyqVmR.d.ts → statusline-model-DFY7tuHj.d.cts} +5 -3
- package/dist/{statusline-model-BoWJ3cWQ.d.cts → statusline-model-zKXtGIjj.d.ts} +5 -3
- package/dist/ui.cjs +301 -3
- package/dist/ui.d.cts +75 -2
- package/dist/ui.d.ts +75 -2
- package/dist/ui.js +3 -3
- package/dist/vela.global.js +1046 -274
- package/dist/vela.global.min.js +82 -87
- package/dist/widget.cjs +1504 -327
- package/dist/widget.d.cts +26 -7
- package/dist/widget.d.ts +26 -7
- package/dist/widget.js +7 -7
- package/dist/workspace.cjs +1507 -327
- package/dist/workspace.d.cts +125 -7
- package/dist/workspace.d.ts +125 -7
- package/dist/workspace.js +6 -6
- package/package.json +2 -2
package/dist/workspace.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { O as OHLCV, V as VisibleRangePreset, a as VisibleRange, b as VelaOptions, I as InputValue, c as VelaTheme, N as NativeBackend, d as MarketSession } from './options-
|
|
2
|
-
import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as StatuslinePart, b as RangePreset, T as TrackSizes, c as VelaShellOptions, d as SyncOptions, e as SyncKind, f as WorkspaceState } from './statusline-model-
|
|
3
|
-
export { g as ChartState, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-model-
|
|
1
|
+
import { O as OHLCV, V as VisibleRangePreset, a as VisibleRange, b as VelaOptions, I as InputValue, c as VelaTheme, N as NativeBackend, d as MarketSession } from './options-BnEPUuVV.cjs';
|
|
2
|
+
import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as StatuslinePart, b as RangePreset, T as TrackSizes, c as VelaShellOptions, d as SyncOptions, e as SyncKind, f as WorkspaceState } from './statusline-model-DFY7tuHj.cjs';
|
|
3
|
+
export { g as ChartState, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-model-DFY7tuHj.cjs';
|
|
4
4
|
import { K as KeymapManager } from './keymap-CGOz5F5f.cjs';
|
|
5
|
-
import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, E as ExternalIndicatorEntry, a as ScriptRun } from './contributions-
|
|
6
|
-
import { M as MarketDataFeed } from './DataProvider-
|
|
5
|
+
import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, E as ExternalIndicatorEntry, R as ReplayState, a as ReplayBounds, b as VelaEventMap, c as ScriptRun } from './contributions-CtlptxR8.cjs';
|
|
6
|
+
import { M as MarketDataFeed } from './DataProvider-BrlxntPN.cjs';
|
|
7
7
|
|
|
8
8
|
/** The cells that follow `originId` under `setting` — PURE (never includes the origin). */
|
|
9
9
|
declare function syncTargets(originId: string, setting: SyncSetting | undefined, cellIds: readonly string[]): string[];
|
|
@@ -215,6 +215,7 @@ declare class ChartCell {
|
|
|
215
215
|
* verbatim, so a document never loses a plugin's state in the plugin's absence. */
|
|
216
216
|
private extState;
|
|
217
217
|
private watermarkOn;
|
|
218
|
+
private replayWatermarkOn;
|
|
218
219
|
/** Indicator titles (this cell's in-chart legend rows) shown. */
|
|
219
220
|
private indicatorTitlesOn;
|
|
220
221
|
/** Plot values beside this cell's legend titles shown. */
|
|
@@ -276,6 +277,8 @@ declare class ChartCell {
|
|
|
276
277
|
private pushSettingsSections;
|
|
277
278
|
/** Show/hide this cell's symbol watermark (persisted per cell). */
|
|
278
279
|
setWatermarkVisible(visible: boolean): void;
|
|
280
|
+
/** Show/hide the "Replay" line under this cell's watermark while it replays (persisted per cell). */
|
|
281
|
+
setReplayWatermarkVisible(visible: boolean): void;
|
|
279
282
|
/** Show/hide this cell's indicator titles — the in-chart legend rows (persisted per cell). */
|
|
280
283
|
setIndicatorTitlesVisible(visible: boolean): void;
|
|
281
284
|
/** Show/hide the plot values beside this cell's legend titles (persisted per cell). */
|
|
@@ -448,6 +451,113 @@ declare class ChartCell {
|
|
|
448
451
|
destroy(): void;
|
|
449
452
|
}
|
|
450
453
|
|
|
454
|
+
/** The workspace replay's events — the chart `replay:*` events, reported for the ACTIVE cell. */
|
|
455
|
+
interface WorkspaceReplayEventMap extends Record<string, unknown> {
|
|
456
|
+
'replay:start': VelaEventMap['replay:start'];
|
|
457
|
+
'replay:step': VelaEventMap['replay:step'];
|
|
458
|
+
'replay:tick': VelaEventMap['replay:tick'];
|
|
459
|
+
'replay:play': VelaEventMap['replay:play'];
|
|
460
|
+
'replay:pause': undefined;
|
|
461
|
+
'replay:end': VelaEventMap['replay:end'];
|
|
462
|
+
}
|
|
463
|
+
/** Options for {@link WorkspaceReplay.start}. */
|
|
464
|
+
interface WorkspaceReplayStartOptions {
|
|
465
|
+
/** Epoch ms, read on `cell`'s chart as `chart.replay.start({ from })` reads it: that chart
|
|
466
|
+
* keeps every bar opened at or before it. The close of its last kept bar becomes the
|
|
467
|
+
* shared replay time, and every other chart keeps the bars closed by then. */
|
|
468
|
+
from: number;
|
|
469
|
+
/** The cell `from` is read on (default: the active cell). */
|
|
470
|
+
cell?: string;
|
|
471
|
+
}
|
|
472
|
+
/** What the controller reads from its workspace. */
|
|
473
|
+
interface WorkspaceReplayHost {
|
|
474
|
+
cells(): ReadonlyArray<{
|
|
475
|
+
readonly id: string;
|
|
476
|
+
readonly chart: Vela;
|
|
477
|
+
}>;
|
|
478
|
+
activeId(): string | null;
|
|
479
|
+
onCells(handler: (e: {
|
|
480
|
+
kind: 'created' | 'destroyed' | 'active';
|
|
481
|
+
id: string;
|
|
482
|
+
}) => void): () => void;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* The workspace's bar-replay control surface (`workspace.replay`, `ctx.replay` for
|
|
486
|
+
* contributions): the same verbs as `chart.replay`, applied to every cell on a shared
|
|
487
|
+
* clock. A step moves the clock to the next bar close on ANY chart, and each chart reveals
|
|
488
|
+
* the bars closed by then — so the finest timeframe sets the pace and a coarser chart
|
|
489
|
+
* shows its bar when it completes. Cells added while replaying join at the shared time; a
|
|
490
|
+
* cell switching symbol rejoins once its new bars load; a timeframe switch keeps the
|
|
491
|
+
* cell's place. The replay ends on every chart together: `stop()`, or any chart reaching
|
|
492
|
+
* its last bar. In a multi-chart layout bars are revealed whole (tick replay needs a
|
|
493
|
+
* single-chart layout).
|
|
494
|
+
*/
|
|
495
|
+
declare class WorkspaceReplay {
|
|
496
|
+
private readonly host;
|
|
497
|
+
private readonly bus;
|
|
498
|
+
/** The running session: the shared replay time (every chart shows the bars closed by it). */
|
|
499
|
+
private session;
|
|
500
|
+
private playing;
|
|
501
|
+
private intervalMs;
|
|
502
|
+
private timer;
|
|
503
|
+
/** Cells whose replay a symbol switch ended — restarted at the shared time once their bars land. */
|
|
504
|
+
private readonly rejoining;
|
|
505
|
+
private readonly cellSubs;
|
|
506
|
+
private readonly offHost;
|
|
507
|
+
/** Inside a group step: chart events are the controller's own doing. */
|
|
508
|
+
private stepping;
|
|
509
|
+
/** Inside `finish`: the charts' `replay:end` events are the controller's own doing. */
|
|
510
|
+
private stopping;
|
|
511
|
+
/** Driving a chart's own timer: its play/pause events are not the user's. */
|
|
512
|
+
private muted;
|
|
513
|
+
/** A chart finished during a group step — the session ends right after it. */
|
|
514
|
+
private finishedDuringStep;
|
|
515
|
+
constructor(host: WorkspaceReplayHost);
|
|
516
|
+
/**
|
|
517
|
+
* Enter replay on every cell (or seek, when already replaying) — paused. Resolves once
|
|
518
|
+
* every chart shows its rewound history (a chart whose history does not reach that far
|
|
519
|
+
* loads older bars first). A chart with nothing to replay after the shared time stays
|
|
520
|
+
* as it is.
|
|
521
|
+
*/
|
|
522
|
+
start(opts: WorkspaceReplayStartOptions): Promise<void>;
|
|
523
|
+
/** Reveal the next bar(s): the clock moves to the next bar close on any chart. Returns false when nothing is left. */
|
|
524
|
+
step(): boolean;
|
|
525
|
+
/** Reveal the next update — in a single-chart layout, the chart's `stepUpdate()` (tick replay); otherwise {@link step}. */
|
|
526
|
+
stepUpdate(): boolean;
|
|
527
|
+
/** Advance one update every `intervalMs` (default: the last pace, initially 1000). Calling it again while playing changes the pace. */
|
|
528
|
+
play(intervalMs?: number): this;
|
|
529
|
+
pause(): this;
|
|
530
|
+
/** Leave replay on every chart: full history back, live updates resumed. */
|
|
531
|
+
stop(): this;
|
|
532
|
+
/** `active`/`playing`/`intervalMs` for the whole workspace; the cursor fields read the ACTIVE cell's chart. */
|
|
533
|
+
get state(): ReplayState;
|
|
534
|
+
/** The active cell's replayable history (`chart.replay.bounds`). */
|
|
535
|
+
get bounds(): ReplayBounds | null;
|
|
536
|
+
on<K extends keyof WorkspaceReplayEventMap>(event: K, handler: (payload: WorkspaceReplayEventMap[K]) => void): () => void;
|
|
537
|
+
destroy(): void;
|
|
538
|
+
/** The one chart of a single-chart layout — it replays on its own, tick replay included. */
|
|
539
|
+
private solo;
|
|
540
|
+
private activeChart;
|
|
541
|
+
/** Rewind one chart to the shared time: every bar that closed by `clock`, none after. */
|
|
542
|
+
private startCell;
|
|
543
|
+
/** Move the clock to the next bar close on any chart; each chart reveals what closed by then. */
|
|
544
|
+
private stepGroup;
|
|
545
|
+
/** Put the timers in the state `playing` asks for: a single chart runs its own (it paces
|
|
546
|
+
* ticks), several run on the controller's clock. */
|
|
547
|
+
private syncPlayback;
|
|
548
|
+
private schedule;
|
|
549
|
+
private clearTimer;
|
|
550
|
+
/** End the session on every chart (idempotent). */
|
|
551
|
+
private finish;
|
|
552
|
+
private watch;
|
|
553
|
+
private onCellCreated;
|
|
554
|
+
private onCellDestroyed;
|
|
555
|
+
}
|
|
556
|
+
/** When a bar opened at `open` closes on `timeframe` — calendar months for month-based ones. */
|
|
557
|
+
declare function barClose(open: number, timeframe: string | undefined): number;
|
|
558
|
+
/** The latest open whose bar has closed by `time` on `timeframe` (the inverse of {@link barClose}). */
|
|
559
|
+
declare function lastOpenClosedBy(time: number, timeframe: string | undefined): number;
|
|
560
|
+
|
|
451
561
|
/** The extended context a workspace hands to contributed actions/attachments. */
|
|
452
562
|
interface WorkspaceWidgetContext extends WidgetContext {
|
|
453
563
|
/** Every live cell (layout order) — id + LIVE chart + its market. A LIVE getter
|
|
@@ -461,6 +571,9 @@ interface WorkspaceWidgetContext extends WidgetContext {
|
|
|
461
571
|
/** LIVE getter — follows every active-cell switch. */
|
|
462
572
|
activeCellId: string;
|
|
463
573
|
setActiveCell(id: string): void;
|
|
574
|
+
/** Bar replay across every cell on one clock (`workspace.replay`) — drive this rather
|
|
575
|
+
* than one cell's `chart.replay`, so every chart replays together. */
|
|
576
|
+
replay: WorkspaceReplay;
|
|
464
577
|
}
|
|
465
578
|
|
|
466
579
|
/** One registered workspace layout. */
|
|
@@ -621,7 +734,10 @@ declare class VelaWorkspace {
|
|
|
621
734
|
readonly root: HTMLElement;
|
|
622
735
|
/** The shortcut system — one manager for the whole workspace, routed to the active cell. */
|
|
623
736
|
readonly keymap: KeymapManager;
|
|
737
|
+
/** Bar replay across every cell on one clock (see {@link WorkspaceReplay}). */
|
|
738
|
+
readonly replay: WorkspaceReplay;
|
|
624
739
|
private readonly gridEl;
|
|
740
|
+
private readonly stripsEl;
|
|
625
741
|
private readonly events;
|
|
626
742
|
private readonly feed;
|
|
627
743
|
private readonly cellsById;
|
|
@@ -1038,6 +1154,8 @@ declare class VelaWorkspace {
|
|
|
1038
1154
|
private openTimeframeDrawer;
|
|
1039
1155
|
private openDrawingsDrawer;
|
|
1040
1156
|
private openMoreDrawer;
|
|
1157
|
+
/** The contributed topbar actions the mobile menu lists, from one cluster. */
|
|
1158
|
+
private drawerActions;
|
|
1041
1159
|
private openTimezoneDrawer;
|
|
1042
1160
|
private openPriceScaleDrawer;
|
|
1043
1161
|
/** The aggregated alerts bell — entries carry their cell; selecting one activates it. */
|
|
@@ -1048,7 +1166,7 @@ declare class VelaWorkspace {
|
|
|
1048
1166
|
private runOverride;
|
|
1049
1167
|
/** The default shortcut set — every binding acts on the ACTIVE cell. */
|
|
1050
1168
|
private registerDefaultKeys;
|
|
1051
|
-
/** Bare-typing router: letters → symbol search (seeded), digits → timeframe entry. */
|
|
1169
|
+
/** Bare-typing router: letters and `0` → symbol search (seeded), digits 1–9 → timeframe entry. */
|
|
1052
1170
|
private routeTyping;
|
|
1053
1171
|
private trackDialog;
|
|
1054
1172
|
/** Pool a dehydrated slot state (bounded — oldest entries drop past the cap). */
|
|
@@ -1077,4 +1195,4 @@ declare function resizeTracks(weights: readonly number[], index: number, deltaPx
|
|
|
1077
1195
|
*/
|
|
1078
1196
|
declare function trackOffsets(weights: readonly number[], sizePx: number, gapPx: number): number[];
|
|
1079
1197
|
|
|
1080
|
-
export { type CellBoot, type CellChartDefaults, type CellNativeInfo, type CellSeed, CellState, ChartCell, GRID_PICKER_MAX, type LayoutDefinition, type LayoutShape, type PooledCellState, SyncKind, SyncOptions, SyncSetting, TrackSizes, VelaWorkspace, type VelaWorkspaceOptions, type WorkspaceEventMap, type WorkspaceScriptRun, WorkspaceState, type WorkspaceStorage, type WorkspaceWidgetContext, activeAfterLayout, ensureLayout, evenTracks, gridStyles, layoutDefinition, layoutForGrid, layoutShape, layouts, memoryStorageAdapter, rangesWithin, registerBuiltinLayouts, registerLayout, resizeTracks, syncTargets, trackOffsets, unregisterLayout };
|
|
1198
|
+
export { type CellBoot, type CellChartDefaults, type CellNativeInfo, type CellSeed, CellState, ChartCell, GRID_PICKER_MAX, type LayoutDefinition, type LayoutShape, type PooledCellState, SyncKind, SyncOptions, SyncSetting, TrackSizes, VelaWorkspace, type VelaWorkspaceOptions, type WorkspaceEventMap, WorkspaceReplay, type WorkspaceReplayEventMap, type WorkspaceReplayHost, type WorkspaceReplayStartOptions, type WorkspaceScriptRun, WorkspaceState, type WorkspaceStorage, type WorkspaceWidgetContext, activeAfterLayout, barClose, ensureLayout, evenTracks, gridStyles, lastOpenClosedBy, layoutDefinition, layoutForGrid, layoutShape, layouts, memoryStorageAdapter, rangesWithin, registerBuiltinLayouts, registerLayout, resizeTracks, syncTargets, trackOffsets, unregisterLayout };
|
package/dist/workspace.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { O as OHLCV, V as VisibleRangePreset, a as VisibleRange, b as VelaOptions, I as InputValue, c as VelaTheme, N as NativeBackend, d as MarketSession } from './options-
|
|
2
|
-
import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as StatuslinePart, b as RangePreset, T as TrackSizes, c as VelaShellOptions, d as SyncOptions, e as SyncKind, f as WorkspaceState } from './statusline-model-
|
|
3
|
-
export { g as ChartState, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-model-
|
|
1
|
+
import { O as OHLCV, V as VisibleRangePreset, a as VisibleRange, b as VelaOptions, I as InputValue, c as VelaTheme, N as NativeBackend, d as MarketSession } from './options-BnEPUuVV.js';
|
|
2
|
+
import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as StatuslinePart, b as RangePreset, T as TrackSizes, c as VelaShellOptions, d as SyncOptions, e as SyncKind, f as WorkspaceState } from './statusline-model-zKXtGIjj.js';
|
|
3
|
+
export { g as ChartState, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-model-zKXtGIjj.js';
|
|
4
4
|
import { K as KeymapManager } from './keymap-CGOz5F5f.js';
|
|
5
|
-
import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, E as ExternalIndicatorEntry, a as ScriptRun } from './contributions-
|
|
6
|
-
import { M as MarketDataFeed } from './DataProvider-
|
|
5
|
+
import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, E as ExternalIndicatorEntry, R as ReplayState, a as ReplayBounds, b as VelaEventMap, c as ScriptRun } from './contributions-tjNExo1o.js';
|
|
6
|
+
import { M as MarketDataFeed } from './DataProvider-DwFIoV4r.js';
|
|
7
7
|
|
|
8
8
|
/** The cells that follow `originId` under `setting` — PURE (never includes the origin). */
|
|
9
9
|
declare function syncTargets(originId: string, setting: SyncSetting | undefined, cellIds: readonly string[]): string[];
|
|
@@ -215,6 +215,7 @@ declare class ChartCell {
|
|
|
215
215
|
* verbatim, so a document never loses a plugin's state in the plugin's absence. */
|
|
216
216
|
private extState;
|
|
217
217
|
private watermarkOn;
|
|
218
|
+
private replayWatermarkOn;
|
|
218
219
|
/** Indicator titles (this cell's in-chart legend rows) shown. */
|
|
219
220
|
private indicatorTitlesOn;
|
|
220
221
|
/** Plot values beside this cell's legend titles shown. */
|
|
@@ -276,6 +277,8 @@ declare class ChartCell {
|
|
|
276
277
|
private pushSettingsSections;
|
|
277
278
|
/** Show/hide this cell's symbol watermark (persisted per cell). */
|
|
278
279
|
setWatermarkVisible(visible: boolean): void;
|
|
280
|
+
/** Show/hide the "Replay" line under this cell's watermark while it replays (persisted per cell). */
|
|
281
|
+
setReplayWatermarkVisible(visible: boolean): void;
|
|
279
282
|
/** Show/hide this cell's indicator titles — the in-chart legend rows (persisted per cell). */
|
|
280
283
|
setIndicatorTitlesVisible(visible: boolean): void;
|
|
281
284
|
/** Show/hide the plot values beside this cell's legend titles (persisted per cell). */
|
|
@@ -448,6 +451,113 @@ declare class ChartCell {
|
|
|
448
451
|
destroy(): void;
|
|
449
452
|
}
|
|
450
453
|
|
|
454
|
+
/** The workspace replay's events — the chart `replay:*` events, reported for the ACTIVE cell. */
|
|
455
|
+
interface WorkspaceReplayEventMap extends Record<string, unknown> {
|
|
456
|
+
'replay:start': VelaEventMap['replay:start'];
|
|
457
|
+
'replay:step': VelaEventMap['replay:step'];
|
|
458
|
+
'replay:tick': VelaEventMap['replay:tick'];
|
|
459
|
+
'replay:play': VelaEventMap['replay:play'];
|
|
460
|
+
'replay:pause': undefined;
|
|
461
|
+
'replay:end': VelaEventMap['replay:end'];
|
|
462
|
+
}
|
|
463
|
+
/** Options for {@link WorkspaceReplay.start}. */
|
|
464
|
+
interface WorkspaceReplayStartOptions {
|
|
465
|
+
/** Epoch ms, read on `cell`'s chart as `chart.replay.start({ from })` reads it: that chart
|
|
466
|
+
* keeps every bar opened at or before it. The close of its last kept bar becomes the
|
|
467
|
+
* shared replay time, and every other chart keeps the bars closed by then. */
|
|
468
|
+
from: number;
|
|
469
|
+
/** The cell `from` is read on (default: the active cell). */
|
|
470
|
+
cell?: string;
|
|
471
|
+
}
|
|
472
|
+
/** What the controller reads from its workspace. */
|
|
473
|
+
interface WorkspaceReplayHost {
|
|
474
|
+
cells(): ReadonlyArray<{
|
|
475
|
+
readonly id: string;
|
|
476
|
+
readonly chart: Vela;
|
|
477
|
+
}>;
|
|
478
|
+
activeId(): string | null;
|
|
479
|
+
onCells(handler: (e: {
|
|
480
|
+
kind: 'created' | 'destroyed' | 'active';
|
|
481
|
+
id: string;
|
|
482
|
+
}) => void): () => void;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* The workspace's bar-replay control surface (`workspace.replay`, `ctx.replay` for
|
|
486
|
+
* contributions): the same verbs as `chart.replay`, applied to every cell on a shared
|
|
487
|
+
* clock. A step moves the clock to the next bar close on ANY chart, and each chart reveals
|
|
488
|
+
* the bars closed by then — so the finest timeframe sets the pace and a coarser chart
|
|
489
|
+
* shows its bar when it completes. Cells added while replaying join at the shared time; a
|
|
490
|
+
* cell switching symbol rejoins once its new bars load; a timeframe switch keeps the
|
|
491
|
+
* cell's place. The replay ends on every chart together: `stop()`, or any chart reaching
|
|
492
|
+
* its last bar. In a multi-chart layout bars are revealed whole (tick replay needs a
|
|
493
|
+
* single-chart layout).
|
|
494
|
+
*/
|
|
495
|
+
declare class WorkspaceReplay {
|
|
496
|
+
private readonly host;
|
|
497
|
+
private readonly bus;
|
|
498
|
+
/** The running session: the shared replay time (every chart shows the bars closed by it). */
|
|
499
|
+
private session;
|
|
500
|
+
private playing;
|
|
501
|
+
private intervalMs;
|
|
502
|
+
private timer;
|
|
503
|
+
/** Cells whose replay a symbol switch ended — restarted at the shared time once their bars land. */
|
|
504
|
+
private readonly rejoining;
|
|
505
|
+
private readonly cellSubs;
|
|
506
|
+
private readonly offHost;
|
|
507
|
+
/** Inside a group step: chart events are the controller's own doing. */
|
|
508
|
+
private stepping;
|
|
509
|
+
/** Inside `finish`: the charts' `replay:end` events are the controller's own doing. */
|
|
510
|
+
private stopping;
|
|
511
|
+
/** Driving a chart's own timer: its play/pause events are not the user's. */
|
|
512
|
+
private muted;
|
|
513
|
+
/** A chart finished during a group step — the session ends right after it. */
|
|
514
|
+
private finishedDuringStep;
|
|
515
|
+
constructor(host: WorkspaceReplayHost);
|
|
516
|
+
/**
|
|
517
|
+
* Enter replay on every cell (or seek, when already replaying) — paused. Resolves once
|
|
518
|
+
* every chart shows its rewound history (a chart whose history does not reach that far
|
|
519
|
+
* loads older bars first). A chart with nothing to replay after the shared time stays
|
|
520
|
+
* as it is.
|
|
521
|
+
*/
|
|
522
|
+
start(opts: WorkspaceReplayStartOptions): Promise<void>;
|
|
523
|
+
/** Reveal the next bar(s): the clock moves to the next bar close on any chart. Returns false when nothing is left. */
|
|
524
|
+
step(): boolean;
|
|
525
|
+
/** Reveal the next update — in a single-chart layout, the chart's `stepUpdate()` (tick replay); otherwise {@link step}. */
|
|
526
|
+
stepUpdate(): boolean;
|
|
527
|
+
/** Advance one update every `intervalMs` (default: the last pace, initially 1000). Calling it again while playing changes the pace. */
|
|
528
|
+
play(intervalMs?: number): this;
|
|
529
|
+
pause(): this;
|
|
530
|
+
/** Leave replay on every chart: full history back, live updates resumed. */
|
|
531
|
+
stop(): this;
|
|
532
|
+
/** `active`/`playing`/`intervalMs` for the whole workspace; the cursor fields read the ACTIVE cell's chart. */
|
|
533
|
+
get state(): ReplayState;
|
|
534
|
+
/** The active cell's replayable history (`chart.replay.bounds`). */
|
|
535
|
+
get bounds(): ReplayBounds | null;
|
|
536
|
+
on<K extends keyof WorkspaceReplayEventMap>(event: K, handler: (payload: WorkspaceReplayEventMap[K]) => void): () => void;
|
|
537
|
+
destroy(): void;
|
|
538
|
+
/** The one chart of a single-chart layout — it replays on its own, tick replay included. */
|
|
539
|
+
private solo;
|
|
540
|
+
private activeChart;
|
|
541
|
+
/** Rewind one chart to the shared time: every bar that closed by `clock`, none after. */
|
|
542
|
+
private startCell;
|
|
543
|
+
/** Move the clock to the next bar close on any chart; each chart reveals what closed by then. */
|
|
544
|
+
private stepGroup;
|
|
545
|
+
/** Put the timers in the state `playing` asks for: a single chart runs its own (it paces
|
|
546
|
+
* ticks), several run on the controller's clock. */
|
|
547
|
+
private syncPlayback;
|
|
548
|
+
private schedule;
|
|
549
|
+
private clearTimer;
|
|
550
|
+
/** End the session on every chart (idempotent). */
|
|
551
|
+
private finish;
|
|
552
|
+
private watch;
|
|
553
|
+
private onCellCreated;
|
|
554
|
+
private onCellDestroyed;
|
|
555
|
+
}
|
|
556
|
+
/** When a bar opened at `open` closes on `timeframe` — calendar months for month-based ones. */
|
|
557
|
+
declare function barClose(open: number, timeframe: string | undefined): number;
|
|
558
|
+
/** The latest open whose bar has closed by `time` on `timeframe` (the inverse of {@link barClose}). */
|
|
559
|
+
declare function lastOpenClosedBy(time: number, timeframe: string | undefined): number;
|
|
560
|
+
|
|
451
561
|
/** The extended context a workspace hands to contributed actions/attachments. */
|
|
452
562
|
interface WorkspaceWidgetContext extends WidgetContext {
|
|
453
563
|
/** Every live cell (layout order) — id + LIVE chart + its market. A LIVE getter
|
|
@@ -461,6 +571,9 @@ interface WorkspaceWidgetContext extends WidgetContext {
|
|
|
461
571
|
/** LIVE getter — follows every active-cell switch. */
|
|
462
572
|
activeCellId: string;
|
|
463
573
|
setActiveCell(id: string): void;
|
|
574
|
+
/** Bar replay across every cell on one clock (`workspace.replay`) — drive this rather
|
|
575
|
+
* than one cell's `chart.replay`, so every chart replays together. */
|
|
576
|
+
replay: WorkspaceReplay;
|
|
464
577
|
}
|
|
465
578
|
|
|
466
579
|
/** One registered workspace layout. */
|
|
@@ -621,7 +734,10 @@ declare class VelaWorkspace {
|
|
|
621
734
|
readonly root: HTMLElement;
|
|
622
735
|
/** The shortcut system — one manager for the whole workspace, routed to the active cell. */
|
|
623
736
|
readonly keymap: KeymapManager;
|
|
737
|
+
/** Bar replay across every cell on one clock (see {@link WorkspaceReplay}). */
|
|
738
|
+
readonly replay: WorkspaceReplay;
|
|
624
739
|
private readonly gridEl;
|
|
740
|
+
private readonly stripsEl;
|
|
625
741
|
private readonly events;
|
|
626
742
|
private readonly feed;
|
|
627
743
|
private readonly cellsById;
|
|
@@ -1038,6 +1154,8 @@ declare class VelaWorkspace {
|
|
|
1038
1154
|
private openTimeframeDrawer;
|
|
1039
1155
|
private openDrawingsDrawer;
|
|
1040
1156
|
private openMoreDrawer;
|
|
1157
|
+
/** The contributed topbar actions the mobile menu lists, from one cluster. */
|
|
1158
|
+
private drawerActions;
|
|
1041
1159
|
private openTimezoneDrawer;
|
|
1042
1160
|
private openPriceScaleDrawer;
|
|
1043
1161
|
/** The aggregated alerts bell — entries carry their cell; selecting one activates it. */
|
|
@@ -1048,7 +1166,7 @@ declare class VelaWorkspace {
|
|
|
1048
1166
|
private runOverride;
|
|
1049
1167
|
/** The default shortcut set — every binding acts on the ACTIVE cell. */
|
|
1050
1168
|
private registerDefaultKeys;
|
|
1051
|
-
/** Bare-typing router: letters → symbol search (seeded), digits → timeframe entry. */
|
|
1169
|
+
/** Bare-typing router: letters and `0` → symbol search (seeded), digits 1–9 → timeframe entry. */
|
|
1052
1170
|
private routeTyping;
|
|
1053
1171
|
private trackDialog;
|
|
1054
1172
|
/** Pool a dehydrated slot state (bounded — oldest entries drop past the cap). */
|
|
@@ -1077,4 +1195,4 @@ declare function resizeTracks(weights: readonly number[], index: number, deltaPx
|
|
|
1077
1195
|
*/
|
|
1078
1196
|
declare function trackOffsets(weights: readonly number[], sizePx: number, gapPx: number): number[];
|
|
1079
1197
|
|
|
1080
|
-
export { type CellBoot, type CellChartDefaults, type CellNativeInfo, type CellSeed, CellState, ChartCell, GRID_PICKER_MAX, type LayoutDefinition, type LayoutShape, type PooledCellState, SyncKind, SyncOptions, SyncSetting, TrackSizes, VelaWorkspace, type VelaWorkspaceOptions, type WorkspaceEventMap, type WorkspaceScriptRun, WorkspaceState, type WorkspaceStorage, type WorkspaceWidgetContext, activeAfterLayout, ensureLayout, evenTracks, gridStyles, layoutDefinition, layoutForGrid, layoutShape, layouts, memoryStorageAdapter, rangesWithin, registerBuiltinLayouts, registerLayout, resizeTracks, syncTargets, trackOffsets, unregisterLayout };
|
|
1198
|
+
export { type CellBoot, type CellChartDefaults, type CellNativeInfo, type CellSeed, CellState, ChartCell, GRID_PICKER_MAX, type LayoutDefinition, type LayoutShape, type PooledCellState, SyncKind, SyncOptions, SyncSetting, TrackSizes, VelaWorkspace, type VelaWorkspaceOptions, type WorkspaceEventMap, WorkspaceReplay, type WorkspaceReplayEventMap, type WorkspaceReplayHost, type WorkspaceReplayStartOptions, type WorkspaceScriptRun, WorkspaceState, type WorkspaceStorage, type WorkspaceWidgetContext, activeAfterLayout, barClose, ensureLayout, evenTracks, gridStyles, lastOpenClosedBy, layoutDefinition, layoutForGrid, layoutShape, layouts, memoryStorageAdapter, rangesWithin, registerBuiltinLayouts, registerLayout, resizeTracks, syncTargets, trackOffsets, unregisterLayout };
|
package/dist/workspace.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { ChartCell, GRID_PICKER_MAX, VelaWorkspace, activeAfterLayout, decodeState, encodeState, ensureLayout, evenTracks, gridStyles, layoutDefinition, layoutForGrid, layoutShape, layouts, memoryStorageAdapter, rangesWithin, registerBuiltinLayouts, registerLayout, resizeTracks, sanitizeState, syncTargets, trackOffsets, unregisterLayout } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-
|
|
1
|
+
export { ChartCell, GRID_PICKER_MAX, VelaWorkspace, WorkspaceReplay, activeAfterLayout, barClose, decodeState, encodeState, ensureLayout, evenTracks, gridStyles, lastOpenClosedBy, layoutDefinition, layoutForGrid, layoutShape, layouts, memoryStorageAdapter, rangesWithin, registerBuiltinLayouts, registerLayout, resizeTracks, sanitizeState, syncTargets, trackOffsets, unregisterLayout } from './chunk-DBDXKZUF.js';
|
|
2
|
+
import './chunk-ATGTCWHJ.js';
|
|
3
|
+
import './chunk-EZ5FWVLA.js';
|
|
4
|
+
import './chunk-LMBYEGUR.js';
|
|
5
|
+
import './chunk-NELQJCGK.js';
|
|
6
|
+
import './chunk-BZQM2XO7.js';
|
|
7
7
|
import './chunk-W4EJWLEO.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luxalgo/vela",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Open-source charting library with a native high-performance renderer, drawing tools, pluggable chart types and pluggable scripting engines.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"charting library",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"vela"
|
|
24
24
|
],
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
|
-
"homepage": "https://
|
|
26
|
+
"homepage": "https://velacharts.dev",
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|
|
29
29
|
"url": "https://github.com/luxalgo/vela.git"
|