@luxalgo/vela 0.6.4 → 0.6.5
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/dist/{chunk-6FA4TDUF.js → chunk-FQBT4NFM.js} +106 -7
- package/dist/{chunk-3QX6QOCX.js → chunk-N6MBJHMV.js} +50 -30
- package/dist/index.cjs +106 -7
- package/dist/index.d.cts +28 -1
- package/dist/index.d.ts +28 -1
- package/dist/index.js +1 -1
- package/dist/{plugin-BeCMF1VQ.d.ts → plugin-Bcone6Vh.d.ts} +6 -2
- package/dist/{plugin-CkiStRaI.d.cts → plugin-DO_DX0gp.d.cts} +6 -2
- package/dist/plugin.d.cts +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/vela.global.js +106 -7
- package/dist/vela.global.min.js +36 -36
- package/dist/widget.cjs +155 -36
- package/dist/widget.d.cts +5 -0
- package/dist/widget.d.ts +5 -0
- package/dist/widget.js +4 -4
- package/dist/workspace.cjs +155 -36
- package/dist/workspace.js +3 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { B as BarsChangeReason, C as ContextSelect, b as DataControl, c as Drawi
|
|
|
3
3
|
import { D as Drawing, S as SerializedDrawing, U as Unsubscribe, L as LineStyle, P as PriceStyle, I as IChartRenderer, R as RendererCapabilities, e as RendererDisplayOptions, f as IndicatorRenderHandle, g as IndicatorStatus, c as VelaTheme, O as OHLCV, h as Pane, i as PaneAction, j as MoveTarget, k as IndicatorModel, l as ScenePatch, m as InputValue, n as SymbolPickerFn, o as LegendActionView, p as InputChangeEvent, T as ThemeName, C as CrosshairEvent, q as ClickEvent, A as AxisLongPressEvent, a as VisibleRange, r as DataWindowReadout, s as IDrawingsRendererPort, t as Millis, u as SnapMode, v as DrawingTypeKey, w as ToolbarDefinition, M as MarketConfig } from './options-YdiaaVjt.js';
|
|
4
4
|
export { x as AddIndicatorOptions, B as Background, y as BoxFontFamily, z as BoxHAlign, E as BoxTextSize, F as BoxVAlign, G as CandleBarColor, H as CandleSeries, J as CandleStyle, K as DataWindowGroup, Q as DataWindowOHLC, W as DataWindowRow, X as DirtyRange, Y as DrawingBox, Z as DrawingExtend, _ as DrawingIntent, $ as DrawingLabel, a0 as DrawingLine, a1 as DrawingLinefill, a2 as DrawingMode, a3 as DrawingPoint, a4 as DrawingPolyline, a5 as DrawingStyle, a6 as DrawingTable, a7 as DrawingText, a8 as DrawingXLoc, a9 as DrawingsOption, aa as Fill, ab as FillGradientStop, ac as IndicatorMeta, ad as InputCondition, ae as InputSchema, af as InputType, ag as InputWhen, ah as LabelStyle, ai as LabelYLoc, aj as LineLikeKind, ak as LineLikeSeries, al as LineLikeStyle, am as MarkerPoint, an as MarkerSeries, ao as MarketSnapshot, ap as MarketSwitch, aq as PaneHint, ar as PaneKind, as as PolylinePoint, at as PriceLine, au as Projector, av as ProviderName, aw as RendererConstructor, ax as Scene, ay as SchemaPatch, az as SeriesKind, aA as SeriesPoint, aB as SeriesSpec, aC as SeriesValueDelta, aD as SettingsField, aE as SettingsSchema, aF as TableCell, aG as TableMerge, aH as TablePosition, aI as ToolbarGroupConfig, aJ as TradeExecution, aK as ValuePatch, b as VelaOptions, V as VisibleRangePreset, aL as buildToolbar, aM as defaultToolbar, aN as inputVisible } from './options-YdiaaVjt.js';
|
|
5
5
|
import { M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, S as SymbolInfo, b as ProviderCapabilities, B as BarRange } from './DataProvider-BmHkcwvJ.js';
|
|
6
|
-
export { A as ACCENT, a as ACCENT_BRIGHT, B as BEARISH, b as BULLISH, c as BarTransform, d as BasePaintingModulation, C as CATEGORICAL, e as CROSSHAIR, f as ChartTypeDefinition, g as ChartTypeSettingsInstance, h as ChartTypeSettingsSection, i as ChartTypeSettingsSubsection, D as DrawingTypeMeta, H as HIGHLIGHT, I as INFO, j as INVALID, k as IdentifiableKind, M as MARKER, N as NEUTRAL, l as NormalizedSettingsRow, R as RendererLayerArgs, m as RendererLayerDefinition, n as RendererLayerInstance, S as SERIES_LINE, o as SESSION_OFF, p as SESSION_POST, q as SESSION_PRE, r as SLATE, s as SLATE_DEEP, t as SeriesDataEngine, u as SeriesDataEngineHost, v as SettingsInlineControl, w as SettingsRowCondition, x as SettingsRowDescriptor, y as SettingsRowInlineNumber, z as SettingsRowSwatch, E as SettingsRowValueKey, F as SettingsRowWhen, G as SettingsRowWidth, J as SettingsSelectOption, K as SettingsValueRow, T as TRADE_EXIT, L as TRADE_LONG, O as TRADE_SHORT, V as VALID, W as WARNING, P as categoricalColor, Q as chartType, U as chartTypes, X as createDrawing, Y as deserializeDrawing, Z as drawingTypes, _ as getDrawingType, $ as normalizeSettingsRow, a0 as registerChartType, a1 as registerDrawingType, a2 as registerRendererDefaults, a3 as registerRendererLayer, a4 as rendererDefaults, a5 as rendererLayers, a6 as settingsRowValueKeys, a7 as stableSeriesId, a8 as tickerModifierIds, a9 as unregisterChartType, aa as unregisterRendererDefaults, ab as unregisterRendererLayer } from './plugin-
|
|
6
|
+
export { A as ACCENT, a as ACCENT_BRIGHT, B as BEARISH, b as BULLISH, c as BarTransform, d as BasePaintingModulation, C as CATEGORICAL, e as CROSSHAIR, f as ChartTypeDefinition, g as ChartTypeSettingsInstance, h as ChartTypeSettingsSection, i as ChartTypeSettingsSubsection, D as DrawingTypeMeta, H as HIGHLIGHT, I as INFO, j as INVALID, k as IdentifiableKind, M as MARKER, N as NEUTRAL, l as NormalizedSettingsRow, R as RendererLayerArgs, m as RendererLayerDefinition, n as RendererLayerInstance, S as SERIES_LINE, o as SESSION_OFF, p as SESSION_POST, q as SESSION_PRE, r as SLATE, s as SLATE_DEEP, t as SeriesDataEngine, u as SeriesDataEngineHost, v as SettingsInlineControl, w as SettingsRowCondition, x as SettingsRowDescriptor, y as SettingsRowInlineNumber, z as SettingsRowSwatch, E as SettingsRowValueKey, F as SettingsRowWhen, G as SettingsRowWidth, J as SettingsSelectOption, K as SettingsValueRow, T as TRADE_EXIT, L as TRADE_LONG, O as TRADE_SHORT, V as VALID, W as WARNING, P as categoricalColor, Q as chartType, U as chartTypes, X as createDrawing, Y as deserializeDrawing, Z as drawingTypes, _ as getDrawingType, $ as normalizeSettingsRow, a0 as registerChartType, a1 as registerDrawingType, a2 as registerRendererDefaults, a3 as registerRendererLayer, a4 as rendererDefaults, a5 as rendererLayers, a6 as settingsRowValueKeys, a7 as stableSeriesId, a8 as tickerModifierIds, a9 as unregisterChartType, aa as unregisterRendererDefaults, ab as unregisterRendererLayer } from './plugin-Bcone6Vh.js';
|
|
7
7
|
export { D as DEFAULT_PANEL_MAX_WIDTH, a as DEFAULT_PANEL_MIN_WIDTH, b as DEFAULT_PANEL_WIDTH, S as SidePanelOptions, c as clampPanelWidth } from './side-panel-CT9ZwIGz.js';
|
|
8
8
|
export { i as iconMarkup, r as registerIcon } from './icons-BZYbJXSV.js';
|
|
9
9
|
export { a as KeyBindingDescriptor, R as ResolvedBinding } from './keymap-CGOz5F5f.js';
|
|
@@ -342,6 +342,8 @@ declare class NativeRenderer implements IChartRenderer {
|
|
|
342
342
|
private readonly volumeRenderer;
|
|
343
343
|
/** SDK renderer layers instantiated at mount ({@link registerRendererLayer}). */
|
|
344
344
|
private extLayers;
|
|
345
|
+
/** Last applied layer-canvas order (ids below + above the data canvas) — re-slotted only on change. */
|
|
346
|
+
private layerOrderSig;
|
|
345
347
|
private attributionEl;
|
|
346
348
|
private attributionEnabled;
|
|
347
349
|
/** Host-supplied mark shown INSTEAD of the built-in one (`attribution: '<html>'`). */
|
|
@@ -800,6 +802,8 @@ declare class NativeRenderer implements IChartRenderer {
|
|
|
800
802
|
private renderFrame;
|
|
801
803
|
/** Repaint the SDK layers that opted into cursor tracking (their own canvas only). */
|
|
802
804
|
private repaintCursorLayers;
|
|
805
|
+
/** Blank one SDK layer canvas (a collapsed host pane suppresses the layer's painting). */
|
|
806
|
+
private clearLayerCanvas;
|
|
803
807
|
/** One frame's args for an SDK renderer layer (shared by the data + cursor paint paths). */
|
|
804
808
|
private extLayerArgs;
|
|
805
809
|
/** Paint the below-data (L-1) + geometry (L0) + chrome (L1) layers from the current scene/coords. */
|
|
@@ -857,10 +861,33 @@ declare class NativeRenderer implements IChartRenderer {
|
|
|
857
861
|
private paneMasterTitle;
|
|
858
862
|
/** The pane a bespoke-layer native indicator (volume/vpvr) currently lives in (null = not mounted). */
|
|
859
863
|
private nativeLayerPane;
|
|
864
|
+
/** The mounted native indicator that OWNS an SDK layer — the one whose type equals the
|
|
865
|
+
* layer id (the id doubles as the data channel, so the pairing is the SDK's own
|
|
866
|
+
* contract). Null for chart-type channels and while the owner is hidden (a hidden
|
|
867
|
+
* indicator leaves the scene; its cleared data channel paints nothing anyway). */
|
|
868
|
+
private layerOwner;
|
|
869
|
+
/** The pane an SDK layer paints on: its owner's pane, else the price pane. */
|
|
870
|
+
private layerPane;
|
|
871
|
+
/** The SDK layer canvases split around the data canvas, each side back-to-front:
|
|
872
|
+
* owned layers by their owner's z key against the candles' (an indicator restacked
|
|
873
|
+
* below the candles takes its layer canvas along), unowned by declared placement. */
|
|
874
|
+
private orderedLayerCanvases;
|
|
875
|
+
/** The full canvas pile in paint order (layers + data/volume/vpvr) — what the DOM
|
|
876
|
+
* stacking and the screenshot compositor must both follow. */
|
|
877
|
+
private canvasPile;
|
|
878
|
+
/** Re-slot the SDK layer canvases in the plot when the computed order changed (a z
|
|
879
|
+
* write, a restored config, an indicator mount/remove/restack). Runs at the top of
|
|
880
|
+
* every data frame; a no-op when the signature is unchanged. Re-inserting an
|
|
881
|
+
* absolutely-positioned, pointer-transparent canvas repaints nothing by itself. */
|
|
882
|
+
private syncLayerCanvasOrder;
|
|
860
883
|
/** True when an active volume layer is this study pane's ONLY content — so its scale should
|
|
861
884
|
* come from volume, not the empty {0,1} placeholder. (In the price pane, or alongside a real
|
|
862
885
|
* series, volume stays a bottom overlay and the master scale wins.) */
|
|
863
886
|
private volumeOwnsPane;
|
|
887
|
+
/** True when this study pane's master content is only SDK-layer natives (series-less
|
|
888
|
+
* models whose type names a mounted layer) — its scale then follows the visible bars
|
|
889
|
+
* (see the call site). Any real master series takes over the scale as usual. */
|
|
890
|
+
private layerNativesOwnPane;
|
|
864
891
|
/** Per-pane scale state for a host UI (e.g. a price-axis context menu): the pane's pixel
|
|
865
892
|
* band (`top`/`height`, so a click y maps to a pane) plus its current axis `mode`/`log`.
|
|
866
893
|
* Top-to-bottom order. Every pane is independent — the price pane from the scene setting,
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { stableSeriesId } from './chunk-AOGZBKUE.js';
|
|
2
|
-
export { BarStore, CachingDataFeed, DARK_THEME, DataControl, DrawingStore, DrawingToolbar, DrawingsControl, LIGHT_THEME, MultiProviderFeed, NativeRenderer, RendererControl, TypedEventBus, Vela, buildToolbar, defaultToolbar, resolveTheme, sharedBarStore, timeframeToMs } from './chunk-
|
|
2
|
+
export { BarStore, CachingDataFeed, DARK_THEME, DataControl, DrawingStore, DrawingToolbar, DrawingsControl, LIGHT_THEME, MultiProviderFeed, NativeRenderer, RendererControl, TypedEventBus, Vela, buildToolbar, defaultToolbar, resolveTheme, sharedBarStore, timeframeToMs } from './chunk-FQBT4NFM.js';
|
|
3
3
|
export { DEFAULT_PANEL_MAX_WIDTH, DEFAULT_PANEL_MIN_WIDTH, DEFAULT_PANEL_WIDTH, Drawing, chartType, chartTypes, clampPanelWidth, createDrawing, deserializeDrawing, drawingTypes, getDrawingType, getNativeIndicator, inputVisible, legendActions, nativeIndicatorDescriptors, nativeIndicatorTypes, normalizeSettingsRow, registerChartType, registerDefaultEngine, registerDrawingType, registerLegendAction, registerNativeIndicator, registerRendererDefaults, registerRendererLayer, registerSidePanel, registerWidgetAction, registerWidgetAttachment, rendererDefaults, rendererLayers, resolveEngines, settingsRowValueKeys, sidePanels, tickerModifierIds, unregisterChartType, unregisterDefaultEngine, unregisterLegendAction, unregisterNativeIndicator, unregisterRendererDefaults, unregisterRendererLayer, unregisterSidePanel, unregisterWidgetAction, unregisterWidgetAttachment, widgetActions, widgetAttachments } from './chunk-BEJ57HP4.js';
|
|
4
4
|
import './chunk-OICPLNU7.js';
|
|
5
5
|
export { ACCENT, ACCENT_BRIGHT, BEARISH, BULLISH, CATEGORICAL, CROSSHAIR, HIGHLIGHT, INFO, INVALID, MARKER, NEUTRAL, SERIES_LINE, SESSION_OFF, SESSION_POST, SESSION_PRE, SLATE, SLATE_DEEP, TRADE_EXIT, TRADE_LONG, TRADE_SHORT, VALID, WARNING, categoricalColor, iconMarkup, registerIcon } from './chunk-PN5KWFZ4.js';
|
|
@@ -588,7 +588,9 @@ interface RendererLayerArgs {
|
|
|
588
588
|
/** Time ranges still loading (`<id>-pending` channel) — skeleton/reveal UIs. */
|
|
589
589
|
pending: ReadonlyArray<readonly [number, number]>;
|
|
590
590
|
coords: CoordinateSystem;
|
|
591
|
-
/** The
|
|
591
|
+
/** The scale + bounds of the pane the layer paints on: the pane of the native
|
|
592
|
+
* indicator that owns this channel (its type equals the layer id), else the price
|
|
593
|
+
* pane — so a layer-backed indicator moved to its own pane takes its layer along. */
|
|
592
594
|
scale: PriceScale;
|
|
593
595
|
bounds: PaneBounds;
|
|
594
596
|
theme: VelaTheme;
|
|
@@ -639,7 +641,9 @@ interface RendererLayerDefinition {
|
|
|
639
641
|
/** The layer id — also its native-data channel (`setNativeData(id, …)` / `id + '-pending'`). */
|
|
640
642
|
id: string;
|
|
641
643
|
/** Stacking: `'below-data'` = behind the candles (reveal-under styles); `'above-data'` =
|
|
642
|
-
* over the candles, under the chrome/axes. Default `'above-data'`.
|
|
644
|
+
* over the candles, under the chrome/axes. Default `'above-data'`. A layer owned by a
|
|
645
|
+
* native indicator (its type equals the layer id) follows that indicator's z key in
|
|
646
|
+
* the pane stacking instead (`seriesOrder` / the object tree), mounting in front. */
|
|
643
647
|
placement?: 'below-data' | 'above-data';
|
|
644
648
|
/** Repaint this layer when the pointer moves (hover hit-testing UIs). Off by default:
|
|
645
649
|
* pointer moves normally repaint only the crosshair overlay, not the layers. */
|
|
@@ -588,7 +588,9 @@ interface RendererLayerArgs {
|
|
|
588
588
|
/** Time ranges still loading (`<id>-pending` channel) — skeleton/reveal UIs. */
|
|
589
589
|
pending: ReadonlyArray<readonly [number, number]>;
|
|
590
590
|
coords: CoordinateSystem;
|
|
591
|
-
/** The
|
|
591
|
+
/** The scale + bounds of the pane the layer paints on: the pane of the native
|
|
592
|
+
* indicator that owns this channel (its type equals the layer id), else the price
|
|
593
|
+
* pane — so a layer-backed indicator moved to its own pane takes its layer along. */
|
|
592
594
|
scale: PriceScale;
|
|
593
595
|
bounds: PaneBounds;
|
|
594
596
|
theme: VelaTheme;
|
|
@@ -639,7 +641,9 @@ interface RendererLayerDefinition {
|
|
|
639
641
|
/** The layer id — also its native-data channel (`setNativeData(id, …)` / `id + '-pending'`). */
|
|
640
642
|
id: string;
|
|
641
643
|
/** Stacking: `'below-data'` = behind the candles (reveal-under styles); `'above-data'` =
|
|
642
|
-
* over the candles, under the chrome/axes. Default `'above-data'`.
|
|
644
|
+
* over the candles, under the chrome/axes. Default `'above-data'`. A layer owned by a
|
|
645
|
+
* native indicator (its type equals the layer id) follows that indicator's z key in
|
|
646
|
+
* the pane stacking instead (`seriesOrder` / the object tree), mounting in front. */
|
|
643
647
|
placement?: 'below-data' | 'above-data';
|
|
644
648
|
/** Repaint this layer when the pointer moves (hover hit-testing UIs). Off by default:
|
|
645
649
|
* pointer moves normally repaint only the crosshair overlay, not the layers. */
|
package/dist/plugin.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ACCENT, a as ACCENT_BRIGHT, B as BEARISH, b as BULLISH, c as BarTransform, d as BasePaintingModulation, C as CATEGORICAL, e as CROSSHAIR, f as ChartTypeDefinition, g as ChartTypeSettingsInstance, h as ChartTypeSettingsSection, i as ChartTypeSettingsSubsection, D as DrawingTypeMeta, H as HIGHLIGHT, I as INFO, j as INVALID, k as IdentifiableKind, M as MARKER, N as NEUTRAL, l as NormalizedSettingsRow, R as RendererLayerArgs, m as RendererLayerDefinition, n as RendererLayerInstance, S as SERIES_LINE, o as SESSION_OFF, p as SESSION_POST, q as SESSION_PRE, r as SLATE, s as SLATE_DEEP, t as SeriesDataEngine, u as SeriesDataEngineHost, v as SettingsInlineControl, w as SettingsRowCondition, x as SettingsRowDescriptor, y as SettingsRowInlineNumber, z as SettingsRowSwatch, E as SettingsRowValueKey, F as SettingsRowWhen, G as SettingsRowWidth, J as SettingsSelectOption, K as SettingsValueRow, T as TRADE_EXIT, L as TRADE_LONG, O as TRADE_SHORT, V as VALID, W as WARNING, P as categoricalColor, Q as chartType, U as chartTypes, Z as drawingTypes, _ as getDrawingType, $ as normalizeSettingsRow, a0 as registerChartType, a2 as registerRendererDefaults, a3 as registerRendererLayer, a4 as rendererDefaults, a5 as rendererLayers, a6 as settingsRowValueKeys, a7 as stableSeriesId, a8 as tickerModifierIds, a9 as unregisterChartType, aa as unregisterRendererDefaults, ab as unregisterRendererLayer } from './plugin-
|
|
1
|
+
export { A as ACCENT, a as ACCENT_BRIGHT, B as BEARISH, b as BULLISH, c as BarTransform, d as BasePaintingModulation, C as CATEGORICAL, e as CROSSHAIR, f as ChartTypeDefinition, g as ChartTypeSettingsInstance, h as ChartTypeSettingsSection, i as ChartTypeSettingsSubsection, D as DrawingTypeMeta, H as HIGHLIGHT, I as INFO, j as INVALID, k as IdentifiableKind, M as MARKER, N as NEUTRAL, l as NormalizedSettingsRow, R as RendererLayerArgs, m as RendererLayerDefinition, n as RendererLayerInstance, S as SERIES_LINE, o as SESSION_OFF, p as SESSION_POST, q as SESSION_PRE, r as SLATE, s as SLATE_DEEP, t as SeriesDataEngine, u as SeriesDataEngineHost, v as SettingsInlineControl, w as SettingsRowCondition, x as SettingsRowDescriptor, y as SettingsRowInlineNumber, z as SettingsRowSwatch, E as SettingsRowValueKey, F as SettingsRowWhen, G as SettingsRowWidth, J as SettingsSelectOption, K as SettingsValueRow, T as TRADE_EXIT, L as TRADE_LONG, O as TRADE_SHORT, V as VALID, W as WARNING, P as categoricalColor, Q as chartType, U as chartTypes, Z as drawingTypes, _ as getDrawingType, $ as normalizeSettingsRow, a0 as registerChartType, a2 as registerRendererDefaults, a3 as registerRendererLayer, a4 as rendererDefaults, a5 as rendererLayers, a6 as settingsRowValueKeys, a7 as stableSeriesId, a8 as tickerModifierIds, a9 as unregisterChartType, aa as unregisterRendererDefaults, ab as unregisterRendererLayer } from './plugin-DO_DX0gp.cjs';
|
|
2
2
|
export { B as BarsChangeReason, C as ContextSelect, E as EngineAlert, d as EngineCapabilities, e as EngineContextSnapshot, f as EngineFactory, g as EngineWarning, h as ExecutionHandlers, i as ExecutionMarket, j as ExecutionRequest, k as ExecutionSession, F as FetchSeries, L as LegendActionDescriptor, n as LegendIndicatorInfo, N as NativeIndicator, o as NativeIndicatorContext, p as NativeIndicatorDescriptor, q as NativeIndicatorInfo, r as NativeIndicatorOutput, s as PreparedScript, a as ScriptRun, w as ScriptRunCause, x as ScriptRunResult, S as ScriptingEngine, y as SidePanelButton, z as SidePanelDescriptor, A as SidePanelHandle, G as SidePanelHeader, H as StrategyFill, J as StrategyState, K as StrategyTrade, Q as VisibleBarRange, U as WidgetActionDescriptor, X as WidgetActionTarget, Y as WidgetAttachment, W as WidgetContext, Z as getNativeIndicator, _ as legendActions, a0 as nativeIndicatorTypes, a1 as registerDefaultEngine, a2 as registerLegendAction, a3 as registerNativeIndicator, a4 as registerSidePanel, a5 as registerWidgetAction, a6 as registerWidgetAttachment, a7 as resolveEngines, a8 as sidePanels, a9 as unregisterDefaultEngine, aa as unregisterLegendAction, ab as unregisterNativeIndicator, ac as unregisterSidePanel, ad as unregisterWidgetAction, ae as unregisterWidgetAttachment, af as widgetActions, ag as widgetAttachments } from './contributions-2bEmCF9S.cjs';
|
|
3
3
|
export { D as DEFAULT_PANEL_MAX_WIDTH, a as DEFAULT_PANEL_MIN_WIDTH, b as DEFAULT_PANEL_WIDTH, S as SidePanelOptions, c as clampPanelWidth } from './side-panel-CT9ZwIGz.cjs';
|
|
4
4
|
export { B as Background, y as BoxFontFamily, z as BoxHAlign, E as BoxTextSize, F as BoxVAlign, G as CandleBarColor, H as CandleSeries, J as CandleStyle, X as DirtyRange, Y as DrawingBox, Z as DrawingExtend, $ as DrawingLabel, a0 as DrawingLine, a1 as DrawingLinefill, a4 as DrawingPolyline, a6 as DrawingTable, v as DrawingTypeKey, a8 as DrawingXLoc, aa as Fill, ab as FillGradientStop, ac as IndicatorMeta, k as IndicatorModel, ad as InputCondition, ae as InputSchema, af as InputType, m as InputValue, ag as InputWhen, ah as LabelStyle, ai as LabelYLoc, aj as LineLikeKind, ak as LineLikeSeries, al as LineLikeStyle, L as LineStyle, am as MarkerPoint, an as MarkerSeries, t as Millis, O as OHLCV, h as Pane, aq as PaneHint, ar as PaneKind, as as PolylinePoint, at as PriceLine, P as PriceStyle, ax as Scene, l as ScenePatch, ay as SchemaPatch, az as SeriesKind, aA as SeriesPoint, aB as SeriesSpec, aC as SeriesValueDelta, aF as TableCell, aG as TableMerge, aH as TablePosition, aJ as TradeExecution, aK as ValuePatch, aN as inputVisible } from './options-YdiaaVjt.cjs';
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ACCENT, a as ACCENT_BRIGHT, B as BEARISH, b as BULLISH, c as BarTransform, d as BasePaintingModulation, C as CATEGORICAL, e as CROSSHAIR, f as ChartTypeDefinition, g as ChartTypeSettingsInstance, h as ChartTypeSettingsSection, i as ChartTypeSettingsSubsection, D as DrawingTypeMeta, H as HIGHLIGHT, I as INFO, j as INVALID, k as IdentifiableKind, M as MARKER, N as NEUTRAL, l as NormalizedSettingsRow, R as RendererLayerArgs, m as RendererLayerDefinition, n as RendererLayerInstance, S as SERIES_LINE, o as SESSION_OFF, p as SESSION_POST, q as SESSION_PRE, r as SLATE, s as SLATE_DEEP, t as SeriesDataEngine, u as SeriesDataEngineHost, v as SettingsInlineControl, w as SettingsRowCondition, x as SettingsRowDescriptor, y as SettingsRowInlineNumber, z as SettingsRowSwatch, E as SettingsRowValueKey, F as SettingsRowWhen, G as SettingsRowWidth, J as SettingsSelectOption, K as SettingsValueRow, T as TRADE_EXIT, L as TRADE_LONG, O as TRADE_SHORT, V as VALID, W as WARNING, P as categoricalColor, Q as chartType, U as chartTypes, Z as drawingTypes, _ as getDrawingType, $ as normalizeSettingsRow, a0 as registerChartType, a2 as registerRendererDefaults, a3 as registerRendererLayer, a4 as rendererDefaults, a5 as rendererLayers, a6 as settingsRowValueKeys, a7 as stableSeriesId, a8 as tickerModifierIds, a9 as unregisterChartType, aa as unregisterRendererDefaults, ab as unregisterRendererLayer } from './plugin-
|
|
1
|
+
export { A as ACCENT, a as ACCENT_BRIGHT, B as BEARISH, b as BULLISH, c as BarTransform, d as BasePaintingModulation, C as CATEGORICAL, e as CROSSHAIR, f as ChartTypeDefinition, g as ChartTypeSettingsInstance, h as ChartTypeSettingsSection, i as ChartTypeSettingsSubsection, D as DrawingTypeMeta, H as HIGHLIGHT, I as INFO, j as INVALID, k as IdentifiableKind, M as MARKER, N as NEUTRAL, l as NormalizedSettingsRow, R as RendererLayerArgs, m as RendererLayerDefinition, n as RendererLayerInstance, S as SERIES_LINE, o as SESSION_OFF, p as SESSION_POST, q as SESSION_PRE, r as SLATE, s as SLATE_DEEP, t as SeriesDataEngine, u as SeriesDataEngineHost, v as SettingsInlineControl, w as SettingsRowCondition, x as SettingsRowDescriptor, y as SettingsRowInlineNumber, z as SettingsRowSwatch, E as SettingsRowValueKey, F as SettingsRowWhen, G as SettingsRowWidth, J as SettingsSelectOption, K as SettingsValueRow, T as TRADE_EXIT, L as TRADE_LONG, O as TRADE_SHORT, V as VALID, W as WARNING, P as categoricalColor, Q as chartType, U as chartTypes, Z as drawingTypes, _ as getDrawingType, $ as normalizeSettingsRow, a0 as registerChartType, a2 as registerRendererDefaults, a3 as registerRendererLayer, a4 as rendererDefaults, a5 as rendererLayers, a6 as settingsRowValueKeys, a7 as stableSeriesId, a8 as tickerModifierIds, a9 as unregisterChartType, aa as unregisterRendererDefaults, ab as unregisterRendererLayer } from './plugin-Bcone6Vh.js';
|
|
2
2
|
export { B as BarsChangeReason, C as ContextSelect, E as EngineAlert, d as EngineCapabilities, e as EngineContextSnapshot, f as EngineFactory, g as EngineWarning, h as ExecutionHandlers, i as ExecutionMarket, j as ExecutionRequest, k as ExecutionSession, F as FetchSeries, L as LegendActionDescriptor, n as LegendIndicatorInfo, N as NativeIndicator, o as NativeIndicatorContext, p as NativeIndicatorDescriptor, q as NativeIndicatorInfo, r as NativeIndicatorOutput, s as PreparedScript, a as ScriptRun, w as ScriptRunCause, x as ScriptRunResult, S as ScriptingEngine, y as SidePanelButton, z as SidePanelDescriptor, A as SidePanelHandle, G as SidePanelHeader, H as StrategyFill, J as StrategyState, K as StrategyTrade, Q as VisibleBarRange, U as WidgetActionDescriptor, X as WidgetActionTarget, Y as WidgetAttachment, W as WidgetContext, Z as getNativeIndicator, _ as legendActions, a0 as nativeIndicatorTypes, a1 as registerDefaultEngine, a2 as registerLegendAction, a3 as registerNativeIndicator, a4 as registerSidePanel, a5 as registerWidgetAction, a6 as registerWidgetAttachment, a7 as resolveEngines, a8 as sidePanels, a9 as unregisterDefaultEngine, aa as unregisterLegendAction, ab as unregisterNativeIndicator, ac as unregisterSidePanel, ad as unregisterWidgetAction, ae as unregisterWidgetAttachment, af as widgetActions, ag as widgetAttachments } from './contributions-DatoAzMx.js';
|
|
3
3
|
export { D as DEFAULT_PANEL_MAX_WIDTH, a as DEFAULT_PANEL_MIN_WIDTH, b as DEFAULT_PANEL_WIDTH, S as SidePanelOptions, c as clampPanelWidth } from './side-panel-CT9ZwIGz.js';
|
|
4
4
|
export { B as Background, y as BoxFontFamily, z as BoxHAlign, E as BoxTextSize, F as BoxVAlign, G as CandleBarColor, H as CandleSeries, J as CandleStyle, X as DirtyRange, Y as DrawingBox, Z as DrawingExtend, $ as DrawingLabel, a0 as DrawingLine, a1 as DrawingLinefill, a4 as DrawingPolyline, a6 as DrawingTable, v as DrawingTypeKey, a8 as DrawingXLoc, aa as Fill, ab as FillGradientStop, ac as IndicatorMeta, k as IndicatorModel, ad as InputCondition, ae as InputSchema, af as InputType, m as InputValue, ag as InputWhen, ah as LabelStyle, ai as LabelYLoc, aj as LineLikeKind, ak as LineLikeSeries, al as LineLikeStyle, L as LineStyle, am as MarkerPoint, an as MarkerSeries, t as Millis, O as OHLCV, h as Pane, aq as PaneHint, ar as PaneKind, as as PolylinePoint, at as PriceLine, P as PriceStyle, ax as Scene, l as ScenePatch, ay as SchemaPatch, az as SeriesKind, aA as SeriesPoint, aB as SeriesSpec, aC as SeriesValueDelta, aF as TableCell, aG as TableMerge, aH as TablePosition, aJ as TradeExecution, aK as ValuePatch, aN as inputVisible } from './options-YdiaaVjt.js';
|
package/dist/vela.global.js
CHANGED
|
@@ -22760,6 +22760,12 @@ ${overlayScrollbarCss(".vela-dialog.vela-ind-dialog *", 9)}
|
|
|
22760
22760
|
assignIndicatorZ(id) {
|
|
22761
22761
|
if (!this.seriesZ.has(id)) this.seriesZ.set(id, this.bottomZ() - 1);
|
|
22762
22762
|
}
|
|
22763
|
+
/** Mount-time default for a LAYER-BACKED native (it paints on a canvas stacked above the
|
|
22764
|
+
* data canvas by default): top of the stack, so the recorded order tells the truth from
|
|
22765
|
+
* the first frame. Keeps an existing key, so a restored stack survives the remount. */
|
|
22766
|
+
assignIndicatorZTop(id) {
|
|
22767
|
+
if (!this.seriesZ.has(id)) this.seriesZ.set(id, this.topZ() + 1);
|
|
22768
|
+
}
|
|
22763
22769
|
forgetIndicatorZ(id) {
|
|
22764
22770
|
this.seriesZ.delete(id);
|
|
22765
22771
|
}
|
|
@@ -32518,6 +32524,19 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
32518
32524
|
return [...registry3.values()];
|
|
32519
32525
|
}
|
|
32520
32526
|
|
|
32527
|
+
// src/renderers/native/core/layerStacking.ts
|
|
32528
|
+
function stackLayers(entries, candleZ) {
|
|
32529
|
+
const keyed = entries.map((e) => ({
|
|
32530
|
+
id: e.id,
|
|
32531
|
+
key: e.ownerZ ?? (e.placement === "below-data" ? -Infinity : candleZ)
|
|
32532
|
+
}));
|
|
32533
|
+
keyed.sort((a, b) => a.key - b.key);
|
|
32534
|
+
const below = [];
|
|
32535
|
+
const above = [];
|
|
32536
|
+
for (const k of keyed) (k.key < candleZ ? below : above).push(k.id);
|
|
32537
|
+
return { below, above };
|
|
32538
|
+
}
|
|
32539
|
+
|
|
32521
32540
|
// src/renderers/native/chrome/luxalgo-logos.ts
|
|
32522
32541
|
var LUXALGO_SYMBOL_SVG = '<svg viewBox="0 0 45 40" aria-hidden="true"><g fill="currentColor"><path d="m40.25 38 4.58-7.998L28.802 2l-16.03 28 9.16-.001 6.87-12z"/><path d="M34.525 32.002 9.33 31.997 27.655 0h-9.158L.18 31.993 4.759 40h34.347z"/></g></svg>';
|
|
32523
32542
|
var LUXALGO_WORDMARK_SVG = '<svg viewBox="0 0 964 252" aria-hidden="true"><path fill="currentColor" fill-rule="evenodd" d="M 614 94.500 L 614 189 633.500 189 L 653 189 653 94.500 L 653 0 633.500 0 L 614 0 614 94.500 M 0 97.500 L 0 189 63.023 189 L 126.045 189 125.773 170.750 L 125.500 152.500 84.250 152.239 L 43 151.978 43 78.989 L 43 6 21.500 6 L 0 6 0 97.500 M 450.387 96.451 C 421.871 146.253, 398.306 186.994, 398.020 186.987 C 397.423 186.972, 362 124.724, 362 123.691 C 362 123.316, 370.100 108.818, 380 91.472 C 389.900 74.127, 398 59.500, 398 58.968 C 398 58.380, 391.007 58, 380.210 58 L 362.420 58 348.060 83.138 C 334.400 107.052, 333.637 108.160, 332.399 105.888 C 331.682 104.575, 325.287 93.375, 318.187 81 L 305.277 58.500 287.139 58.227 C 277.162 58.078, 269 58.186, 269 58.469 C 269 58.751, 277.154 73.274, 287.120 90.741 C 297.086 108.209, 305.261 122.983, 305.287 123.574 C 305.312 124.164, 297.318 138.789, 287.522 156.074 C 277.725 173.358, 269.524 187.838, 269.296 188.250 C 269.068 188.662, 276.977 189, 286.870 189 L 304.859 189 319.163 163.959 C 331.321 142.674, 333.647 139.165, 334.670 140.563 C 335.331 141.468, 341.864 152.737, 349.186 165.606 L 362.500 189.003 402.442 188.752 L 442.384 188.500 472.080 136.695 C 488.413 108.203, 501.939 84.729, 502.138 84.531 C 502.337 84.333, 516 107.757, 532.500 136.583 L 562.500 188.994 584.750 188.997 C 596.987 188.999, 607 188.854, 607 188.675 C 607 188.319, 503.014 6.686, 502.532 6.201 C 502.369 6.037, 478.904 46.649, 450.387 96.451 M 717.500 55.017 C 697.175 57.389, 680.641 68.752, 672.036 86.264 C 665.866 98.818, 663.840 108.024, 663.840 123.500 C 663.840 133.409, 664.328 138.355, 665.892 144.300 C 672.076 167.810, 689.191 184.757, 711.529 189.489 C 730.549 193.518, 747.264 189.540, 761.282 177.648 C 764.944 174.542, 768.178 172, 768.470 172 C 769.345 172, 769.030 185.018, 767.979 192.285 C 765.618 208.613, 755.148 218.672, 738.473 220.632 C 732.586 221.324, 723.136 219.599, 717.709 216.843 C 712.693 214.295, 706.636 207.946, 703.972 202.443 C 702.789 199.999, 701.749 198, 701.661 198.001 C 700.201 198.007, 665.596 205.071, 665.230 205.437 C 664.326 206.341, 669.156 218.313, 672.607 223.721 C 682.146 238.672, 700.008 248.257, 723.500 251.033 C 758.132 255.124, 788.930 241.875, 800.287 218 C 806.923 204.047, 807 203.001, 807 126.542 L 807 58 788.500 58 L 770 58 770 66.500 C 770 71.175, 769.641 75, 769.203 75 C 768.765 75, 766.627 73.142, 764.453 70.872 C 752.805 58.708, 735.614 52.903, 717.500 55.017 M 878.500 55.031 C 850.107 59.412, 830.755 75.064, 822.285 100.500 C 819.905 107.644, 819.614 110.051, 819.565 123 C 819.501 139.581, 820.786 145.825, 826.763 158 C 832.104 168.880, 842.842 179.424, 854.077 184.822 C 867.651 191.343, 873.132 192.462, 891.500 192.462 C 909.868 192.462, 915.349 191.343, 928.923 184.822 C 944.653 177.265, 956.667 162.306, 961.710 144 C 963.074 139.048, 963.481 134.047, 963.418 123 C 963.346 110.140, 963.038 107.595, 960.694 100.500 C 953.325 78.193, 936.695 62.854, 913.500 56.969 C 904.262 54.625, 887.240 53.682, 878.500 55.031 M 134.015 102.750 C 134.027 139.250, 134.310 148.689, 135.549 153.947 C 141.139 177.663, 159.815 193, 183.105 193 C 196.453 193, 210.163 186.171, 217.936 175.650 C 219.826 173.093, 221.738 171, 222.186 171 C 222.634 171, 223 175.050, 223 180 L 223 189 242.507 189 L 262.014 189 261.757 123.750 L 261.500 58.500 242.500 58.500 L 223.500 58.500 223 99.500 C 222.513 139.406, 222.441 140.610, 220.289 144.634 C 209.729 164.377, 183.014 164.880, 174.299 145.500 C 172.677 141.895, 172.469 137.382, 172.190 99.750 L 171.880 58 152.940 58 L 134 58 134.015 102.750 M 729.932 87.998 C 719.311 89.821, 710.155 97.164, 705.141 107.880 C 702.851 112.772, 702.510 114.798, 702.505 123.521 C 702.500 132.834, 702.732 134.014, 705.787 140.218 C 709.761 148.290, 715.989 154.097, 723.853 157.063 C 731.409 159.912, 744.359 159.466, 750.795 156.136 C 767.289 147.601, 774.103 127.713, 767.019 108.780 C 761.433 93.851, 746.051 85.232, 729.932 87.998 M 883.972 88.348 C 865.749 92.310, 854.873 109.966, 858.119 130.316 C 860.933 147.963, 872.346 158.830, 889.084 159.799 C 900.714 160.472, 906.867 158.234, 914.650 150.497 C 919.856 145.323, 921.123 143.340, 922.900 137.587 C 925.412 129.456, 925.655 118.570, 923.489 111.275 C 918.479 94.405, 901.478 84.541, 883.972 88.348"/></svg>';
|
|
@@ -33018,6 +33037,8 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
33018
33037
|
this.volumeRenderer = new VolumeRenderer();
|
|
33019
33038
|
/** SDK renderer layers instantiated at mount ({@link registerRendererLayer}). */
|
|
33020
33039
|
this.extLayers = [];
|
|
33040
|
+
/** Last applied layer-canvas order (ids below + above the data canvas) — re-slotted only on change. */
|
|
33041
|
+
this.layerOrderSig = "";
|
|
33021
33042
|
// The attribution mark (see chrome/AttributionMark + the NOTICE file): default-on;
|
|
33022
33043
|
// disabling requires an equivalent visible attribution elsewhere in the host UI.
|
|
33023
33044
|
this.attributionEl = null;
|
|
@@ -33948,9 +33969,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
33948
33969
|
if (el.getAttribute("data-vela-screenshot") === "under") rasterizeOverlay(ctx, el, frame);
|
|
33949
33970
|
}
|
|
33950
33971
|
}
|
|
33951
|
-
const
|
|
33952
|
-
const above = this.extLayers.filter((l) => l.def.placement !== "below-data").map((l) => l.canvas);
|
|
33953
|
-
for (const canvas of [...below, this.dataCanvas, this.volumeCanvas, this.vpvrCanvas, ...above, this.chromeCanvas, this.drawingsCanvas]) {
|
|
33972
|
+
for (const canvas of [...this.canvasPile(), this.chromeCanvas, this.drawingsCanvas]) {
|
|
33954
33973
|
if (canvas && canvas.width > 0 && canvas.height > 0) ctx.drawImage(canvas, 0, 0);
|
|
33955
33974
|
}
|
|
33956
33975
|
if (frame) {
|
|
@@ -34084,6 +34103,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
34084
34103
|
const below = this.extLayers.filter((l) => l.def.placement === "below-data").map((l) => l.canvas);
|
|
34085
34104
|
const above = this.extLayers.filter((l) => l.def.placement !== "below-data").map((l) => l.canvas);
|
|
34086
34105
|
this.plot.append(...below, this.dataCanvas, this.volumeCanvas, this.vpvrCanvas, ...above, this.chromeCanvas, this.drawingsCanvas, this.cursorCanvas, this.overlayRoot);
|
|
34106
|
+
this.layerOrderSig = "";
|
|
34087
34107
|
this.wrapper.appendChild(this.plot);
|
|
34088
34108
|
this.factoryConfig = this.getConfig();
|
|
34089
34109
|
this.attributionEl = this.buildAttributionEl();
|
|
@@ -34612,7 +34632,8 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
34612
34632
|
mountIndicator(model) {
|
|
34613
34633
|
this.scene.indicators.set(model.id, model);
|
|
34614
34634
|
this.refreshAnchorOffset(model);
|
|
34615
|
-
this.scene.
|
|
34635
|
+
if (model.native && this.extLayers.some((l) => l.def.id === model.native.type)) this.scene.assignIndicatorZTop(model.id);
|
|
34636
|
+
else this.scene.assignIndicatorZ(model.id);
|
|
34616
34637
|
this.inputsUI.upsert(model.id, model.shorttitle ?? model.title, model.inputs, model.inputValues, model.paneId, {
|
|
34617
34638
|
native: !!model.native,
|
|
34618
34639
|
...model.shorttitle ? { settingsTitle: model.title } : {}
|
|
@@ -35431,10 +35452,17 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
35431
35452
|
const nowMs = typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
35432
35453
|
for (const l of this.extLayers) {
|
|
35433
35454
|
if (!l.def.repaintOnCursor) continue;
|
|
35434
|
-
|
|
35455
|
+
const lp = this.layerPane(l.def.id) ?? pane;
|
|
35456
|
+
if (lp.collapsed) continue;
|
|
35457
|
+
l.instance.render(this.extLayerArgs(l.def.id, lp.scale, lp.bounds, nowMs));
|
|
35435
35458
|
if (this.animZoom && l.instance.animating?.()) this.animator.start();
|
|
35436
35459
|
}
|
|
35437
35460
|
}
|
|
35461
|
+
/** Blank one SDK layer canvas (a collapsed host pane suppresses the layer's painting). */
|
|
35462
|
+
clearLayerCanvas(canvas) {
|
|
35463
|
+
if (canvas.width === 0 || canvas.height === 0) return;
|
|
35464
|
+
canvas.getContext("2d")?.clearRect(0, 0, canvas.width, canvas.height);
|
|
35465
|
+
}
|
|
35438
35466
|
/** One frame's args for an SDK renderer layer (shared by the data + cursor paint paths). */
|
|
35439
35467
|
extLayerArgs(id, scale, bounds, nowMs) {
|
|
35440
35468
|
return {
|
|
@@ -35453,6 +35481,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
35453
35481
|
}
|
|
35454
35482
|
/** Paint the below-data (L-1) + geometry (L0) + chrome (L1) layers from the current scene/coords. */
|
|
35455
35483
|
paintData() {
|
|
35484
|
+
this.syncLayerCanvasOrder();
|
|
35456
35485
|
this.stampScaleInvert();
|
|
35457
35486
|
this.backend.modelAlpha = this.modelAlpha;
|
|
35458
35487
|
this.backend.candleBodyAlpha = this.candleBodyAlpha;
|
|
@@ -35483,9 +35512,14 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
35483
35512
|
const nowMs = typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
35484
35513
|
let folded = null;
|
|
35485
35514
|
for (const l of this.extLayers) {
|
|
35486
|
-
const
|
|
35515
|
+
const lp = this.layerPane(l.def.id) ?? pane;
|
|
35516
|
+
if (lp.collapsed) {
|
|
35517
|
+
this.clearLayerCanvas(l.canvas);
|
|
35518
|
+
continue;
|
|
35519
|
+
}
|
|
35520
|
+
const args = this.extLayerArgs(l.def.id, lp.scale, lp.bounds, nowMs);
|
|
35487
35521
|
l.instance.render(args);
|
|
35488
|
-
folded = foldBaseModulation(folded, l.instance.modulateBase?.(args) ?? null);
|
|
35522
|
+
if (lp === pane) folded = foldBaseModulation(folded, l.instance.modulateBase?.(args) ?? null);
|
|
35489
35523
|
if (this.animZoom && l.instance.animating?.()) this.animator.start();
|
|
35490
35524
|
}
|
|
35491
35525
|
if (folded) {
|
|
@@ -35647,6 +35681,9 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
35647
35681
|
pane.scaleTarget = { min: 0, max: maxVol / VOLUME_PANE_FILL_FRAC };
|
|
35648
35682
|
pane.axisFormat = "volume";
|
|
35649
35683
|
}
|
|
35684
|
+
} else if (this.layerNativesOwnPane(pane, masterModels)) {
|
|
35685
|
+
pane.scaleTarget = computePaneScale([], this.bars, true, i0, i1, dr, paneLogScale(this.scene, pane), (id) => this.scene.offsetOf(id));
|
|
35686
|
+
pane.percentBaseline = this.bars[i0]?.close ?? 0;
|
|
35650
35687
|
}
|
|
35651
35688
|
if (pane === pricePane && this.scene.tradeMarkers.visible && pane.bounds.height > 0) {
|
|
35652
35689
|
const th = this.tradesScaleHints(vr);
|
|
@@ -35733,6 +35770,59 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
35733
35770
|
}
|
|
35734
35771
|
return null;
|
|
35735
35772
|
}
|
|
35773
|
+
/** The mounted native indicator that OWNS an SDK layer — the one whose type equals the
|
|
35774
|
+
* layer id (the id doubles as the data channel, so the pairing is the SDK's own
|
|
35775
|
+
* contract). Null for chart-type channels and while the owner is hidden (a hidden
|
|
35776
|
+
* indicator leaves the scene; its cleared data channel paints nothing anyway). */
|
|
35777
|
+
layerOwner(layerId) {
|
|
35778
|
+
for (const m of this.scene.indicators.values()) {
|
|
35779
|
+
if (m.native?.type === layerId) return m;
|
|
35780
|
+
}
|
|
35781
|
+
return null;
|
|
35782
|
+
}
|
|
35783
|
+
/** The pane an SDK layer paints on: its owner's pane, else the price pane. */
|
|
35784
|
+
layerPane(layerId) {
|
|
35785
|
+
const owner = this.layerOwner(layerId);
|
|
35786
|
+
const paneId = owner ? owner.paneId ?? PRICE_PANE_ID : PRICE_PANE_ID;
|
|
35787
|
+
return this.scene.panes.get(paneId) ?? null;
|
|
35788
|
+
}
|
|
35789
|
+
/** The SDK layer canvases split around the data canvas, each side back-to-front:
|
|
35790
|
+
* owned layers by their owner's z key against the candles' (an indicator restacked
|
|
35791
|
+
* below the candles takes its layer canvas along), unowned by declared placement. */
|
|
35792
|
+
orderedLayerCanvases() {
|
|
35793
|
+
const byId = new Map(this.extLayers.map((l) => [l.def.id, l.canvas]));
|
|
35794
|
+
const { below, above } = stackLayers(
|
|
35795
|
+
this.extLayers.map((l) => {
|
|
35796
|
+
const owner = this.layerOwner(l.def.id);
|
|
35797
|
+
return {
|
|
35798
|
+
id: l.def.id,
|
|
35799
|
+
placement: l.def.placement === "below-data" ? "below-data" : "above-data",
|
|
35800
|
+
ownerZ: owner ? this.scene.zOf(owner.id) : null
|
|
35801
|
+
};
|
|
35802
|
+
}),
|
|
35803
|
+
this.scene.candleZ
|
|
35804
|
+
);
|
|
35805
|
+
return { below: below.map((id) => byId.get(id)), above: above.map((id) => byId.get(id)) };
|
|
35806
|
+
}
|
|
35807
|
+
/** The full canvas pile in paint order (layers + data/volume/vpvr) — what the DOM
|
|
35808
|
+
* stacking and the screenshot compositor must both follow. */
|
|
35809
|
+
canvasPile() {
|
|
35810
|
+
const { below, above } = this.orderedLayerCanvases();
|
|
35811
|
+
return [...below, this.dataCanvas, this.volumeCanvas, this.vpvrCanvas, ...above];
|
|
35812
|
+
}
|
|
35813
|
+
/** Re-slot the SDK layer canvases in the plot when the computed order changed (a z
|
|
35814
|
+
* write, a restored config, an indicator mount/remove/restack). Runs at the top of
|
|
35815
|
+
* every data frame; a no-op when the signature is unchanged. Re-inserting an
|
|
35816
|
+
* absolutely-positioned, pointer-transparent canvas repaints nothing by itself. */
|
|
35817
|
+
syncLayerCanvasOrder() {
|
|
35818
|
+
if (this.extLayers.length === 0 || !this.plot) return;
|
|
35819
|
+
const { below, above } = this.orderedLayerCanvases();
|
|
35820
|
+
const sig = [...below.map((c) => this.extLayers.find((l) => l.canvas === c).def.id), "|", ...above.map((c) => this.extLayers.find((l) => l.canvas === c).def.id)].join(",");
|
|
35821
|
+
if (sig === this.layerOrderSig) return;
|
|
35822
|
+
this.layerOrderSig = sig;
|
|
35823
|
+
for (const c of below) this.plot.insertBefore(c, this.dataCanvas);
|
|
35824
|
+
for (const c of above) this.plot.insertBefore(c, this.chromeCanvas);
|
|
35825
|
+
}
|
|
35736
35826
|
/** True when an active volume layer is this study pane's ONLY content — so its scale should
|
|
35737
35827
|
* come from volume, not the empty {0,1} placeholder. (In the price pane, or alongside a real
|
|
35738
35828
|
* series, volume stays a bottom overlay and the master scale wins.) */
|
|
@@ -35742,6 +35832,15 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
35742
35832
|
if (this.nativeLayerPane("volume") !== pane) return false;
|
|
35743
35833
|
return masterModels.every((m) => m.native?.type === "volume");
|
|
35744
35834
|
}
|
|
35835
|
+
/** True when this study pane's master content is only SDK-layer natives (series-less
|
|
35836
|
+
* models whose type names a mounted layer) — its scale then follows the visible bars
|
|
35837
|
+
* (see the call site). Any real master series takes over the scale as usual. */
|
|
35838
|
+
layerNativesOwnPane(pane, masterModels) {
|
|
35839
|
+
if (pane.kind === "price" || masterModels.length === 0) return false;
|
|
35840
|
+
return masterModels.every(
|
|
35841
|
+
(m) => m.series.length === 0 && !!m.native && this.extLayers.some((l) => l.def.id === m.native.type)
|
|
35842
|
+
);
|
|
35843
|
+
}
|
|
35745
35844
|
/** Per-pane scale state for a host UI (e.g. a price-axis context menu): the pane's pixel
|
|
35746
35845
|
* band (`top`/`height`, so a click y maps to a pane) plus its current axis `mode`/`log`.
|
|
35747
35846
|
* Top-to-bottom order. Every pane is independent — the price pane from the scene setting,
|