@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.
package/dist/widget.cjs CHANGED
@@ -38379,7 +38379,7 @@ var NativeRenderer = class {
38379
38379
  for (const l of this.extLayers) {
38380
38380
  if (!l.def.repaintOnCursor) continue;
38381
38381
  const lp = this.layerPane(l) ?? pane;
38382
- if (lp.collapsed) continue;
38382
+ if (lp.collapsed || this.layerHiddenWithCandles(l)) continue;
38383
38383
  l.instance.render(this.extLayerArgs(l, lp.scale, lp.bounds, nowMs));
38384
38384
  if (this.animZoom.on && l.instance.animating?.()) this.animator.start();
38385
38385
  }
@@ -38441,7 +38441,7 @@ var NativeRenderer = class {
38441
38441
  let folded = null;
38442
38442
  for (const l of this.extLayers) {
38443
38443
  const lp = this.layerPane(l) ?? pane;
38444
- if (lp.collapsed) {
38444
+ if (lp.collapsed || this.layerHiddenWithCandles(l)) {
38445
38445
  this.clearLayerCanvas(l.canvas);
38446
38446
  continue;
38447
38447
  }
@@ -38609,7 +38609,7 @@ var NativeRenderer = class {
38609
38609
  const or = overlaySeriesRange(this.scene.indicators.values(), i0, i1, (id) => this.scene.offsetOf(id));
38610
38610
  if (or) dr = dr ? { min: Math.min(dr.min, or.min), max: Math.max(dr.max, or.max) } : or;
38611
38611
  }
38612
- const includeCandles = pane.kind === "price" && !this.scene.candlesHidden;
38612
+ const includeCandles = pane.kind === "price" && (!this.scene.candlesHidden || this.priceLayersAnchoredToBars(masterModels));
38613
38613
  pane.scaleTarget = computePaneScale(masterModels, this.bars, includeCandles, i0, i1, dr, paneLogScale(this.scene, pane), (id) => this.scene.offsetOf(id));
38614
38614
  pane.percentBaseline = pane.kind === "price" ? this.bars[i0]?.close ?? 0 : this.firstVisibleValue(masterModels, i0);
38615
38615
  pane.axisFormat = void 0;
@@ -38840,6 +38840,25 @@ var NativeRenderer = class {
38840
38840
  (m) => m.series.length === 0 && !!m.native && this.extLayers.some((l) => l.def.id === m.native.type)
38841
38841
  );
38842
38842
  }
38843
+ /**
38844
+ * True for the layer painting the ACTIVE chart type (the base entry whose id is the
38845
+ * current price style) while the price series is hidden. The chart type IS the price
38846
+ * series, so "hide chart" blanks its layer along with the bars; an indicator's layer
38847
+ * (an overlay layer native, on any pane) is independent content and keeps painting.
38848
+ */
38849
+ layerHiddenWithCandles(l) {
38850
+ return this.scene.candlesHidden && l.owner === null && l.def.id === this.scene.priceStyle;
38851
+ }
38852
+ /**
38853
+ * True when an overlay layer native (a series-less model whose type names a mounted
38854
+ * layer) sits on the price pane: it paints at BAR PRICES without contributing a series,
38855
+ * so hiding the candles must keep the bars in the price scale — with nothing else on the
38856
+ * pane the scale would fall to the {0,1} placeholder and the layer would paint off-screen
38857
+ * and vanish. The chart type's own layer does not count: it is blanked with the candles.
38858
+ */
38859
+ priceLayersAnchoredToBars(masterModels) {
38860
+ return masterModels.some((m) => m.series.length === 0 && !!m.native && this.extLayers.some((l) => l.def.id === m.native.type));
38861
+ }
38843
38862
  /** Per-pane scale state for a host UI (e.g. a price-axis context menu): the pane's pixel
38844
38863
  * band (`top`/`height`, so a click y maps to a pane) plus its current axis `mode`/`log`.
38845
38864
  * Top-to-bottom order. Every pane is independent — the price pane from the scene setting,
package/dist/widget.js CHANGED
@@ -1,6 +1,6 @@
1
- import { VelaWorkspace } from './chunk-QGVSNAX7.js';
2
- export { Bottombar, ChartContextMenu, DataWindow, IndicatorPicker, ObjectTree, PanelDock, RANGE_PRESETS, ShortcutsHelp, Statusline, SymbolPicker, TimeframeQuick, Topbar, Watermark, dataWindowSections, decimalsFor, decodeState, encodeState, filterSymbols, fmtChange, fmtPrice, localStorageAdapter, parseTimeframe, priceStyleLabel, resolveIndicators, sanitizeState, timeframeLabel, timeframeMs } from './chunk-QGVSNAX7.js';
3
- export { TIMEZONES, normalizeTimezone, tzButtonLabel, tzMenuLabel, tzOffset } from './chunk-5RQGCZTX.js';
1
+ import { VelaWorkspace } from './chunk-DH2VF5X7.js';
2
+ export { Bottombar, ChartContextMenu, DataWindow, IndicatorPicker, ObjectTree, PanelDock, RANGE_PRESETS, ShortcutsHelp, Statusline, SymbolPicker, TimeframeQuick, Topbar, Watermark, dataWindowSections, decimalsFor, decodeState, encodeState, filterSymbols, fmtChange, fmtPrice, localStorageAdapter, parseTimeframe, priceStyleLabel, resolveIndicators, sanitizeState, timeframeLabel, timeframeMs } from './chunk-DH2VF5X7.js';
3
+ export { TIMEZONES, normalizeTimezone, tzButtonLabel, tzMenuLabel, tzOffset } from './chunk-2EO74GIE.js';
4
4
  export { DEFAULT_PANEL_MAX_WIDTH, DEFAULT_PANEL_MIN_WIDTH, DEFAULT_PANEL_ORDER, DEFAULT_PANEL_WIDTH, OVERRIDABLE_TOPBAR_IDS, SidePanel, TOPBAR_BUILTIN_IDS, TOPBAR_DEFAULT_LEFT, TOPBAR_DEFAULT_RIGHT, clampPanelWidth, pinnedTopbarActionIds, registerSidePanel, registerStatePersistence, registerSymbolRanking, registerWidgetAction, registerWidgetAttachment, resolveTopbarComposition, sidePanels, statePersistenceHandlers, symbolRanking, topbarActionOverride, topbarHas, unregisterSidePanel, unregisterStatePersistence, unregisterWidgetAction, unregisterWidgetAttachment, widgetActions, widgetAttachments } from './chunk-BFA32GOU.js';
5
5
  import './chunk-ZADTVRUO.js';
6
6
  import './chunk-BKHSQ4YM.js';
@@ -38311,7 +38311,7 @@ var NativeRenderer = class {
38311
38311
  for (const l of this.extLayers) {
38312
38312
  if (!l.def.repaintOnCursor) continue;
38313
38313
  const lp = this.layerPane(l) ?? pane;
38314
- if (lp.collapsed) continue;
38314
+ if (lp.collapsed || this.layerHiddenWithCandles(l)) continue;
38315
38315
  l.instance.render(this.extLayerArgs(l, lp.scale, lp.bounds, nowMs));
38316
38316
  if (this.animZoom.on && l.instance.animating?.()) this.animator.start();
38317
38317
  }
@@ -38373,7 +38373,7 @@ var NativeRenderer = class {
38373
38373
  let folded = null;
38374
38374
  for (const l of this.extLayers) {
38375
38375
  const lp = this.layerPane(l) ?? pane;
38376
- if (lp.collapsed) {
38376
+ if (lp.collapsed || this.layerHiddenWithCandles(l)) {
38377
38377
  this.clearLayerCanvas(l.canvas);
38378
38378
  continue;
38379
38379
  }
@@ -38541,7 +38541,7 @@ var NativeRenderer = class {
38541
38541
  const or = overlaySeriesRange(this.scene.indicators.values(), i0, i1, (id) => this.scene.offsetOf(id));
38542
38542
  if (or) dr = dr ? { min: Math.min(dr.min, or.min), max: Math.max(dr.max, or.max) } : or;
38543
38543
  }
38544
- const includeCandles = pane.kind === "price" && !this.scene.candlesHidden;
38544
+ const includeCandles = pane.kind === "price" && (!this.scene.candlesHidden || this.priceLayersAnchoredToBars(masterModels));
38545
38545
  pane.scaleTarget = computePaneScale(masterModels, this.bars, includeCandles, i0, i1, dr, paneLogScale(this.scene, pane), (id) => this.scene.offsetOf(id));
38546
38546
  pane.percentBaseline = pane.kind === "price" ? this.bars[i0]?.close ?? 0 : this.firstVisibleValue(masterModels, i0);
38547
38547
  pane.axisFormat = void 0;
@@ -38772,6 +38772,25 @@ var NativeRenderer = class {
38772
38772
  (m) => m.series.length === 0 && !!m.native && this.extLayers.some((l) => l.def.id === m.native.type)
38773
38773
  );
38774
38774
  }
38775
+ /**
38776
+ * True for the layer painting the ACTIVE chart type (the base entry whose id is the
38777
+ * current price style) while the price series is hidden. The chart type IS the price
38778
+ * series, so "hide chart" blanks its layer along with the bars; an indicator's layer
38779
+ * (an overlay layer native, on any pane) is independent content and keeps painting.
38780
+ */
38781
+ layerHiddenWithCandles(l) {
38782
+ return this.scene.candlesHidden && l.owner === null && l.def.id === this.scene.priceStyle;
38783
+ }
38784
+ /**
38785
+ * True when an overlay layer native (a series-less model whose type names a mounted
38786
+ * layer) sits on the price pane: it paints at BAR PRICES without contributing a series,
38787
+ * so hiding the candles must keep the bars in the price scale — with nothing else on the
38788
+ * pane the scale would fall to the {0,1} placeholder and the layer would paint off-screen
38789
+ * and vanish. The chart type's own layer does not count: it is blanked with the candles.
38790
+ */
38791
+ priceLayersAnchoredToBars(masterModels) {
38792
+ return masterModels.some((m) => m.series.length === 0 && !!m.native && this.extLayers.some((l) => l.def.id === m.native.type));
38793
+ }
38775
38794
  /** Per-pane scale state for a host UI (e.g. a price-axis context menu): the pane's pixel
38776
38795
  * band (`top`/`height`, so a click y maps to a pane) plus its current axis `mode`/`log`.
38777
38796
  * Top-to-bottom order. Every pane is independent — the price pane from the scene setting,
package/dist/workspace.js CHANGED
@@ -1,5 +1,5 @@
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-QGVSNAX7.js';
2
- import './chunk-5RQGCZTX.js';
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-DH2VF5X7.js';
2
+ import './chunk-2EO74GIE.js';
3
3
  import './chunk-BFA32GOU.js';
4
4
  import './chunk-ZADTVRUO.js';
5
5
  import './chunk-BKHSQ4YM.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxalgo/vela",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "Open-source charting library with a native high-performance renderer, drawing tools, pluggable chart types and pluggable scripting engines.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://luxalgo.com/vela",