@luxalgo/vela 0.7.1 → 0.7.3

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.
@@ -20622,7 +20622,7 @@ var NativeRenderer = class {
20622
20622
  for (const l of this.extLayers) {
20623
20623
  if (!l.def.repaintOnCursor) continue;
20624
20624
  const lp = this.layerPane(l) ?? pane;
20625
- if (lp.collapsed) continue;
20625
+ if (lp.collapsed || this.layerHiddenWithCandles(l)) continue;
20626
20626
  l.instance.render(this.extLayerArgs(l, lp.scale, lp.bounds, nowMs));
20627
20627
  if (this.animZoom.on && l.instance.animating?.()) this.animator.start();
20628
20628
  }
@@ -20684,7 +20684,7 @@ var NativeRenderer = class {
20684
20684
  let folded = null;
20685
20685
  for (const l of this.extLayers) {
20686
20686
  const lp = this.layerPane(l) ?? pane;
20687
- if (lp.collapsed) {
20687
+ if (lp.collapsed || this.layerHiddenWithCandles(l)) {
20688
20688
  this.clearLayerCanvas(l.canvas);
20689
20689
  continue;
20690
20690
  }
@@ -20852,7 +20852,7 @@ var NativeRenderer = class {
20852
20852
  const or = overlaySeriesRange(this.scene.indicators.values(), i0, i1, (id) => this.scene.offsetOf(id));
20853
20853
  if (or) dr = dr ? { min: Math.min(dr.min, or.min), max: Math.max(dr.max, or.max) } : or;
20854
20854
  }
20855
- const includeCandles = pane.kind === "price" && !this.scene.candlesHidden;
20855
+ const includeCandles = pane.kind === "price" && (!this.scene.candlesHidden || this.priceLayersAnchoredToBars(masterModels));
20856
20856
  pane.scaleTarget = computePaneScale(masterModels, this.bars, includeCandles, i0, i1, dr, paneLogScale(this.scene, pane), (id) => this.scene.offsetOf(id));
20857
20857
  pane.percentBaseline = pane.kind === "price" ? this.bars[i0]?.close ?? 0 : this.firstVisibleValue(masterModels, i0);
20858
20858
  pane.axisFormat = void 0;
@@ -21083,6 +21083,25 @@ var NativeRenderer = class {
21083
21083
  (m) => m.series.length === 0 && !!m.native && this.extLayers.some((l) => l.def.id === m.native.type)
21084
21084
  );
21085
21085
  }
21086
+ /**
21087
+ * True for the layer painting the ACTIVE chart type (the base entry whose id is the
21088
+ * current price style) while the price series is hidden. The chart type IS the price
21089
+ * series, so "hide chart" blanks its layer along with the bars; an indicator's layer
21090
+ * (an overlay layer native, on any pane) is independent content and keeps painting.
21091
+ */
21092
+ layerHiddenWithCandles(l) {
21093
+ return this.scene.candlesHidden && l.owner === null && l.def.id === this.scene.priceStyle;
21094
+ }
21095
+ /**
21096
+ * True when an overlay layer native (a series-less model whose type names a mounted
21097
+ * layer) sits on the price pane: it paints at BAR PRICES without contributing a series,
21098
+ * so hiding the candles must keep the bars in the price scale — with nothing else on the
21099
+ * pane the scale would fall to the {0,1} placeholder and the layer would paint off-screen
21100
+ * and vanish. The chart type's own layer does not count: it is blanked with the candles.
21101
+ */
21102
+ priceLayersAnchoredToBars(masterModels) {
21103
+ return masterModels.some((m) => m.series.length === 0 && !!m.native && this.extLayers.some((l) => l.def.id === m.native.type));
21104
+ }
21086
21105
  /** Per-pane scale state for a host UI (e.g. a price-axis context menu): the pane's pixel
21087
21106
  * band (`top`/`height`, so a click y maps to a pane) plus its current axis `mode`/`log`.
21088
21107
  * Top-to-bottom order. Every pane is independent — the price pane from the scene setting,
@@ -1,4 +1,4 @@
1
- import { parseSymbol, priceStyleIds, BUILTIN_PRICE_STYLES, tzButtonLabel, SecondClock, TIMEZONES, normalizeTimezone, tzMenuLabel, isGroupRow, defaultMemberOf, groupKeyOf, groupMembers, LEGEND_AT_TOP_ATTR, normalizeSession, Vela, TypedEventBus, MultiProviderFeed, registerBuiltinChartTypes, resolveTheme, buildToolbar, createCustomMark, createAttributionMark, DrawingToolbar, applyAttributionMarkTheme, sharedBarStore, timeframeToMs } from './chunk-5RQGCZTX.js';
1
+ import { parseSymbol, priceStyleIds, BUILTIN_PRICE_STYLES, tzButtonLabel, SecondClock, TIMEZONES, normalizeTimezone, tzMenuLabel, isGroupRow, defaultMemberOf, groupKeyOf, groupMembers, LEGEND_AT_TOP_ATTR, normalizeSession, Vela, TypedEventBus, MultiProviderFeed, registerBuiltinChartTypes, resolveTheme, buildToolbar, createCustomMark, createAttributionMark, DrawingToolbar, applyAttributionMarkTheme, sharedBarStore, timeframeToMs } from './chunk-2EO74GIE.js';
2
2
  import { chartType, resolveTopbarComposition, topbarActionOverride, TOPBAR_BUILTIN_IDS, widgetActions, SidePanel, sidePanels, DEFAULT_PANEL_ORDER, symbolRanking, resolveEngines, legendActionsProviderFor, legendCalloutsProviderFor, statePersistenceHandlers, topbarHas, rendererDefaults, widgetAttachments, getDrawingType, inputDeltas } from './chunk-BFA32GOU.js';
3
3
  import { Tooltip, KeymapManager, isEditableTarget, Drawer } from './chunk-ZADTVRUO.js';
4
4
  import { Menu, Dialog, CalloutBubble, applyPlotOverlayTokens, ensureUIHost } from './chunk-BKHSQ4YM.js';
package/dist/index.cjs CHANGED
@@ -31960,7 +31960,7 @@ var NativeRenderer = class {
31960
31960
  for (const l of this.extLayers) {
31961
31961
  if (!l.def.repaintOnCursor) continue;
31962
31962
  const lp = this.layerPane(l) ?? pane;
31963
- if (lp.collapsed) continue;
31963
+ if (lp.collapsed || this.layerHiddenWithCandles(l)) continue;
31964
31964
  l.instance.render(this.extLayerArgs(l, lp.scale, lp.bounds, nowMs));
31965
31965
  if (this.animZoom.on && l.instance.animating?.()) this.animator.start();
31966
31966
  }
@@ -32022,7 +32022,7 @@ var NativeRenderer = class {
32022
32022
  let folded = null;
32023
32023
  for (const l of this.extLayers) {
32024
32024
  const lp = this.layerPane(l) ?? pane;
32025
- if (lp.collapsed) {
32025
+ if (lp.collapsed || this.layerHiddenWithCandles(l)) {
32026
32026
  this.clearLayerCanvas(l.canvas);
32027
32027
  continue;
32028
32028
  }
@@ -32190,7 +32190,7 @@ var NativeRenderer = class {
32190
32190
  const or = overlaySeriesRange(this.scene.indicators.values(), i0, i1, (id) => this.scene.offsetOf(id));
32191
32191
  if (or) dr = dr ? { min: Math.min(dr.min, or.min), max: Math.max(dr.max, or.max) } : or;
32192
32192
  }
32193
- const includeCandles = pane.kind === "price" && !this.scene.candlesHidden;
32193
+ const includeCandles = pane.kind === "price" && (!this.scene.candlesHidden || this.priceLayersAnchoredToBars(masterModels));
32194
32194
  pane.scaleTarget = computePaneScale(masterModels, this.bars, includeCandles, i0, i1, dr, paneLogScale(this.scene, pane), (id) => this.scene.offsetOf(id));
32195
32195
  pane.percentBaseline = pane.kind === "price" ? this.bars[i0]?.close ?? 0 : this.firstVisibleValue(masterModels, i0);
32196
32196
  pane.axisFormat = void 0;
@@ -32421,6 +32421,25 @@ var NativeRenderer = class {
32421
32421
  (m) => m.series.length === 0 && !!m.native && this.extLayers.some((l) => l.def.id === m.native.type)
32422
32422
  );
32423
32423
  }
32424
+ /**
32425
+ * True for the layer painting the ACTIVE chart type (the base entry whose id is the
32426
+ * current price style) while the price series is hidden. The chart type IS the price
32427
+ * series, so "hide chart" blanks its layer along with the bars; an indicator's layer
32428
+ * (an overlay layer native, on any pane) is independent content and keeps painting.
32429
+ */
32430
+ layerHiddenWithCandles(l) {
32431
+ return this.scene.candlesHidden && l.owner === null && l.def.id === this.scene.priceStyle;
32432
+ }
32433
+ /**
32434
+ * True when an overlay layer native (a series-less model whose type names a mounted
32435
+ * layer) sits on the price pane: it paints at BAR PRICES without contributing a series,
32436
+ * so hiding the candles must keep the bars in the price scale — with nothing else on the
32437
+ * pane the scale would fall to the {0,1} placeholder and the layer would paint off-screen
32438
+ * and vanish. The chart type's own layer does not count: it is blanked with the candles.
32439
+ */
32440
+ priceLayersAnchoredToBars(masterModels) {
32441
+ return masterModels.some((m) => m.series.length === 0 && !!m.native && this.extLayers.some((l) => l.def.id === m.native.type));
32442
+ }
32424
32443
  /** Per-pane scale state for a host UI (e.g. a price-axis context menu): the pane's pixel
32425
32444
  * band (`top`/`height`, so a click y maps to a pane) plus its current axis `mode`/`log`.
32426
32445
  * Top-to-bottom order. Every pane is independent — the price pane from the scene setting,
package/dist/index.d.cts CHANGED
@@ -1022,6 +1022,21 @@ declare class NativeRenderer implements IChartRenderer {
1022
1022
  * models whose type names a mounted layer) — its scale then follows the visible bars
1023
1023
  * (see the call site). Any real master series takes over the scale as usual. */
1024
1024
  private layerNativesOwnPane;
1025
+ /**
1026
+ * True for the layer painting the ACTIVE chart type (the base entry whose id is the
1027
+ * current price style) while the price series is hidden. The chart type IS the price
1028
+ * series, so "hide chart" blanks its layer along with the bars; an indicator's layer
1029
+ * (an overlay layer native, on any pane) is independent content and keeps painting.
1030
+ */
1031
+ private layerHiddenWithCandles;
1032
+ /**
1033
+ * True when an overlay layer native (a series-less model whose type names a mounted
1034
+ * layer) sits on the price pane: it paints at BAR PRICES without contributing a series,
1035
+ * so hiding the candles must keep the bars in the price scale — with nothing else on the
1036
+ * pane the scale would fall to the {0,1} placeholder and the layer would paint off-screen
1037
+ * and vanish. The chart type's own layer does not count: it is blanked with the candles.
1038
+ */
1039
+ private priceLayersAnchoredToBars;
1025
1040
  /** Per-pane scale state for a host UI (e.g. a price-axis context menu): the pane's pixel
1026
1041
  * band (`top`/`height`, so a click y maps to a pane) plus its current axis `mode`/`log`.
1027
1042
  * Top-to-bottom order. Every pane is independent — the price pane from the scene setting,
package/dist/index.d.ts CHANGED
@@ -1022,6 +1022,21 @@ declare class NativeRenderer implements IChartRenderer {
1022
1022
  * models whose type names a mounted layer) — its scale then follows the visible bars
1023
1023
  * (see the call site). Any real master series takes over the scale as usual. */
1024
1024
  private layerNativesOwnPane;
1025
+ /**
1026
+ * True for the layer painting the ACTIVE chart type (the base entry whose id is the
1027
+ * current price style) while the price series is hidden. The chart type IS the price
1028
+ * series, so "hide chart" blanks its layer along with the bars; an indicator's layer
1029
+ * (an overlay layer native, on any pane) is independent content and keeps painting.
1030
+ */
1031
+ private layerHiddenWithCandles;
1032
+ /**
1033
+ * True when an overlay layer native (a series-less model whose type names a mounted
1034
+ * layer) sits on the price pane: it paints at BAR PRICES without contributing a series,
1035
+ * so hiding the candles must keep the bars in the price scale — with nothing else on the
1036
+ * pane the scale would fall to the {0,1} placeholder and the layer would paint off-screen
1037
+ * and vanish. The chart type's own layer does not count: it is blanked with the candles.
1038
+ */
1039
+ private priceLayersAnchoredToBars;
1025
1040
  /** Per-pane scale state for a host UI (e.g. a price-axis context menu): the pane's pixel
1026
1041
  * band (`top`/`height`, so a click y maps to a pane) plus its current axis `mode`/`log`.
1027
1042
  * 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
  import './chunk-JU4CWEBF.js';
2
- export { BarStore, CachingDataFeed, DARK_THEME, DataControl, DrawingStore, DrawingToolbar, DrawingsControl, LIGHT_THEME, MarksControl, MultiProviderFeed, NativeRenderer, RendererControl, SecondClock, TypedEventBus, Vela, buildToolbar, defaultToolbar, resolveTheme, sharedBarStore, timeframeToMs } from './chunk-5RQGCZTX.js';
2
+ export { BarStore, CachingDataFeed, DARK_THEME, DataControl, DrawingStore, DrawingToolbar, DrawingsControl, LIGHT_THEME, MarksControl, MultiProviderFeed, NativeRenderer, RendererControl, SecondClock, TypedEventBus, Vela, buildToolbar, defaultToolbar, resolveTheme, sharedBarStore, timeframeToMs } from './chunk-2EO74GIE.js';
3
3
  export { DEFAULT_PANEL_MAX_WIDTH, DEFAULT_PANEL_MIN_WIDTH, DEFAULT_PANEL_WIDTH, Drawing, OVERRIDABLE_TOPBAR_IDS, chartType, chartTypes, clampPanelWidth, createDrawing, deserializeDrawing, drawingTypes, getDrawingType, getNativeIndicator, inputDeltas, inputVisible, legendActions, legendCallouts, nativeIndicatorDescriptors, nativeIndicatorTypes, normalizeSettingsRow, registerChartType, registerDefaultEngine, registerDrawingType, registerLegendAction, registerLegendCallout, registerNativeIndicator, registerRendererDefaults, registerRendererLayer, registerSidePanel, registerStatePersistence, registerSymbolRanking, registerWidgetAction, registerWidgetAttachment, rendererDefaults, rendererLayers, resolveEngines, seriesInScale, seriesShownOn, settingsRowValueKeys, sidePanels, stableSeriesId, statePersistenceHandlers, symbolRanking, tickerModifierIds, topbarActionOverride, unregisterChartType, unregisterDefaultEngine, unregisterLegendAction, unregisterLegendCallout, unregisterNativeIndicator, unregisterRendererDefaults, unregisterRendererLayer, unregisterSidePanel, unregisterStatePersistence, unregisterWidgetAction, unregisterWidgetAttachment, widgetActions, widgetAttachments } from './chunk-BFA32GOU.js';
4
4
  import './chunk-BKHSQ4YM.js';
5
5
  export { ACCENT, ACCENT_BRIGHT, BEARISH, BULLISH, CATEGORICAL, CHIP_PLATE, 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-CAFCLMPF.js';
@@ -39376,7 +39376,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
39376
39376
  for (const l of this.extLayers) {
39377
39377
  if (!l.def.repaintOnCursor) continue;
39378
39378
  const lp = this.layerPane(l) ?? pane;
39379
- if (lp.collapsed) continue;
39379
+ if (lp.collapsed || this.layerHiddenWithCandles(l)) continue;
39380
39380
  l.instance.render(this.extLayerArgs(l, lp.scale, lp.bounds, nowMs));
39381
39381
  if (this.animZoom.on && l.instance.animating?.()) this.animator.start();
39382
39382
  }
@@ -39438,7 +39438,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
39438
39438
  let folded = null;
39439
39439
  for (const l of this.extLayers) {
39440
39440
  const lp = this.layerPane(l) ?? pane;
39441
- if (lp.collapsed) {
39441
+ if (lp.collapsed || this.layerHiddenWithCandles(l)) {
39442
39442
  this.clearLayerCanvas(l.canvas);
39443
39443
  continue;
39444
39444
  }
@@ -39606,7 +39606,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
39606
39606
  const or2 = overlaySeriesRange(this.scene.indicators.values(), i0, i1, (id) => this.scene.offsetOf(id));
39607
39607
  if (or2) dr = dr ? { min: Math.min(dr.min, or2.min), max: Math.max(dr.max, or2.max) } : or2;
39608
39608
  }
39609
- const includeCandles = pane.kind === "price" && !this.scene.candlesHidden;
39609
+ const includeCandles = pane.kind === "price" && (!this.scene.candlesHidden || this.priceLayersAnchoredToBars(masterModels));
39610
39610
  pane.scaleTarget = computePaneScale(masterModels, this.bars, includeCandles, i0, i1, dr, paneLogScale(this.scene, pane), (id) => this.scene.offsetOf(id));
39611
39611
  pane.percentBaseline = pane.kind === "price" ? this.bars[i0]?.close ?? 0 : this.firstVisibleValue(masterModels, i0);
39612
39612
  pane.axisFormat = void 0;
@@ -39837,6 +39837,25 @@ ${overlayScrollbarCss(".vela-sd-pane")}
39837
39837
  (m) => m.series.length === 0 && !!m.native && this.extLayers.some((l) => l.def.id === m.native.type)
39838
39838
  );
39839
39839
  }
39840
+ /**
39841
+ * True for the layer painting the ACTIVE chart type (the base entry whose id is the
39842
+ * current price style) while the price series is hidden. The chart type IS the price
39843
+ * series, so "hide chart" blanks its layer along with the bars; an indicator's layer
39844
+ * (an overlay layer native, on any pane) is independent content and keeps painting.
39845
+ */
39846
+ layerHiddenWithCandles(l) {
39847
+ return this.scene.candlesHidden && l.owner === null && l.def.id === this.scene.priceStyle;
39848
+ }
39849
+ /**
39850
+ * True when an overlay layer native (a series-less model whose type names a mounted
39851
+ * layer) sits on the price pane: it paints at BAR PRICES without contributing a series,
39852
+ * so hiding the candles must keep the bars in the price scale — with nothing else on the
39853
+ * pane the scale would fall to the {0,1} placeholder and the layer would paint off-screen
39854
+ * and vanish. The chart type's own layer does not count: it is blanked with the candles.
39855
+ */
39856
+ priceLayersAnchoredToBars(masterModels) {
39857
+ return masterModels.some((m) => m.series.length === 0 && !!m.native && this.extLayers.some((l) => l.def.id === m.native.type));
39858
+ }
39840
39859
  /** Per-pane scale state for a host UI (e.g. a price-axis context menu): the pane's pixel
39841
39860
  * band (`top`/`height`, so a click y maps to a pane) plus its current axis `mode`/`log`.
39842
39861
  * Top-to-bottom order. Every pane is independent — the price pane from the scene setting,