@luxalgo/vela 0.7.2 → 0.7.4

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.
Files changed (37) hide show
  1. package/dist/{DataProvider-BALR0qPq.d.ts → DataProvider-CVpN5sCq.d.ts} +1 -1
  2. package/dist/{DataProvider-D5uMiJYz.d.cts → DataProvider-RF1axuy1.d.cts} +1 -1
  3. package/dist/{chunk-QBWLINWL.js → chunk-CSFNKXUW.js} +1 -1
  4. package/dist/{chunk-PTNO3YK2.js → chunk-DUURH3RN.js} +51 -10
  5. package/dist/{contributions-BbhbZd3c.d.ts → contributions-CspPrMAJ.d.ts} +2 -2
  6. package/dist/{contributions-CcBFe-91.d.cts → contributions-DpZeu7KP.d.cts} +2 -2
  7. package/dist/index.cjs +51 -10
  8. package/dist/index.d.cts +22 -11
  9. package/dist/index.d.ts +22 -11
  10. package/dist/index.js +1 -1
  11. package/dist/{options-C7b_Qssu.d.cts → options-XVpfr9HV.d.cts} +2 -1
  12. package/dist/{options-C7b_Qssu.d.ts → options-XVpfr9HV.d.ts} +2 -1
  13. package/dist/{plugin-Cnix5ZBh.d.ts → plugin-BoLOkblF.d.ts} +3 -3
  14. package/dist/{plugin-D6MlX4--.d.cts → plugin-D07HD2GL.d.cts} +3 -3
  15. package/dist/plugin.d.cts +4 -4
  16. package/dist/plugin.d.ts +4 -4
  17. package/dist/providers/binance.d.cts +2 -2
  18. package/dist/providers/binance.d.ts +2 -2
  19. package/dist/providers/coinbase.d.cts +2 -2
  20. package/dist/providers/coinbase.d.ts +2 -2
  21. package/dist/providers/hyperliquid.d.cts +2 -2
  22. package/dist/providers/hyperliquid.d.ts +2 -2
  23. package/dist/{statusline-model-DUKt7_TQ.d.cts → statusline-model-Bd4qKuD6.d.cts} +3 -3
  24. package/dist/{statusline-model-D8NL7o4L.d.ts → statusline-model-CPa_hmhd.d.ts} +3 -3
  25. package/dist/ui.d.cts +1 -1
  26. package/dist/ui.d.ts +1 -1
  27. package/dist/vela.global.js +51 -10
  28. package/dist/vela.global.min.js +14 -14
  29. package/dist/widget.cjs +51 -10
  30. package/dist/widget.d.cts +6 -6
  31. package/dist/widget.d.ts +6 -6
  32. package/dist/widget.js +3 -3
  33. package/dist/workspace.cjs +51 -10
  34. package/dist/workspace.d.cts +5 -5
  35. package/dist/workspace.d.ts +5 -5
  36. package/dist/workspace.js +2 -2
  37. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
- import { D as DataProvider } from './DataProvider-D5uMiJYz.cjs';
2
- import { S as ScriptingEngine, V as Vela } from './contributions-CcBFe-91.cjs';
3
- import { W as WallClock, V as VisibleRangePreset } from './options-C7b_Qssu.cjs';
1
+ import { D as DataProvider } from './DataProvider-RF1axuy1.cjs';
2
+ import { S as ScriptingEngine, V as Vela } from './contributions-DpZeu7KP.cjs';
3
+ import { W as WallClock, V as VisibleRangePreset } from './options-XVpfr9HV.cjs';
4
4
 
5
5
  /** The linkable dimensions. `crosshair` mirrors the pointer time onto same-group
6
6
  * cells as GHOST crosshairs (renderers without the optional `setExternalCrosshair`
@@ -1,6 +1,6 @@
1
- import { D as DataProvider } from './DataProvider-BALR0qPq.js';
2
- import { S as ScriptingEngine, V as Vela } from './contributions-BbhbZd3c.js';
3
- import { W as WallClock, V as VisibleRangePreset } from './options-C7b_Qssu.js';
1
+ import { D as DataProvider } from './DataProvider-CVpN5sCq.js';
2
+ import { S as ScriptingEngine, V as Vela } from './contributions-CspPrMAJ.js';
3
+ import { W as WallClock, V as VisibleRangePreset } from './options-XVpfr9HV.js';
4
4
 
5
5
  /** The linkable dimensions. `crosshair` mirrors the pointer time onto same-group
6
6
  * cells as GHOST crosshairs (renderers without the optional `setExternalCrosshair`
package/dist/ui.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { c as VelaTheme } from './options-C7b_Qssu.cjs';
1
+ import { c as VelaTheme } from './options-XVpfr9HV.cjs';
2
2
  import { MachineSchema, Service, Machine } from '@zag-js/core';
3
3
  export { a as KeyBindingDescriptor, K as KeymapManager, b as KeymapOptions, R as ResolvedBinding } from './keymap-CGOz5F5f.cjs';
4
4
  import * as tooltip from '@zag-js/tooltip';
package/dist/ui.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { c as VelaTheme } from './options-C7b_Qssu.js';
1
+ import { c as VelaTheme } from './options-XVpfr9HV.js';
2
2
  import { MachineSchema, Service, Machine } from '@zag-js/core';
3
3
  export { a as KeyBindingDescriptor, K as KeymapManager, b as KeymapOptions, R as ResolvedBinding } from './keymap-CGOz5F5f.js';
4
4
  import * as tooltip from '@zag-js/tooltip';
@@ -27865,6 +27865,32 @@ void main() {
27865
27865
  }
27866
27866
  return out;
27867
27867
  }
27868
+ function foldOverlappingClusters(clusters, xOf, bucketPx = MARK_CLUSTER_PX) {
27869
+ const byGroup = /* @__PURE__ */ new Map();
27870
+ for (const c of clusters) {
27871
+ const list = byGroup.get(c.group);
27872
+ if (list) list.push(c);
27873
+ else byGroup.set(c.group, [c]);
27874
+ }
27875
+ const out = [];
27876
+ for (const list of byGroup.values()) {
27877
+ list.sort((a, b) => a.bar - b.bar);
27878
+ const runs = [];
27879
+ let anchorX = Number.NaN;
27880
+ for (const c of list) {
27881
+ const x = xOf(c.bar);
27882
+ const run = runs[runs.length - 1];
27883
+ if (run && Number.isFinite(x) && Number.isFinite(anchorX) && x - anchorX < bucketPx) {
27884
+ run.marks.push(...c.marks);
27885
+ } else {
27886
+ runs.push({ key: c.key, bar: c.bar, group: c.group, marks: [...c.marks] });
27887
+ anchorX = x;
27888
+ }
27889
+ }
27890
+ out.push(...runs);
27891
+ }
27892
+ return out;
27893
+ }
27868
27894
  function groupRank(groups, clusters) {
27869
27895
  const rank = /* @__PURE__ */ new Map();
27870
27896
  groups.forEach((g, i) => rank.set(g.id, i));
@@ -27874,7 +27900,7 @@ void main() {
27874
27900
  return (group) => group === void 0 ? Number.MAX_SAFE_INTEGER : rank.get(group) ?? Number.MAX_SAFE_INTEGER - 1;
27875
27901
  }
27876
27902
  function layoutMarkLane(input) {
27877
- const clusters = clusterMarks(input.marks, input.barTimes, input.intervalMs, input.hidden);
27903
+ const clusters = foldOverlappingClusters(clusterMarks(input.marks, input.barTimes, input.intervalMs, input.hidden), input.xOf);
27878
27904
  const rankOf = groupRank(input.groups, clusters);
27879
27905
  const byBar = /* @__PURE__ */ new Map();
27880
27906
  for (const c of clusters) {
@@ -39376,7 +39402,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
39376
39402
  for (const l of this.extLayers) {
39377
39403
  if (!l.def.repaintOnCursor) continue;
39378
39404
  const lp = this.layerPane(l) ?? pane;
39379
- if (lp.collapsed) continue;
39405
+ if (lp.collapsed || this.layerHiddenWithCandles(l)) continue;
39380
39406
  l.instance.render(this.extLayerArgs(l, lp.scale, lp.bounds, nowMs));
39381
39407
  if (this.animZoom.on && l.instance.animating?.()) this.animator.start();
39382
39408
  }
@@ -39438,7 +39464,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
39438
39464
  let folded = null;
39439
39465
  for (const l of this.extLayers) {
39440
39466
  const lp = this.layerPane(l) ?? pane;
39441
- if (lp.collapsed) {
39467
+ if (lp.collapsed || this.layerHiddenWithCandles(l)) {
39442
39468
  this.clearLayerCanvas(l.canvas);
39443
39469
  continue;
39444
39470
  }
@@ -39606,7 +39632,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
39606
39632
  const or2 = overlaySeriesRange(this.scene.indicators.values(), i0, i1, (id) => this.scene.offsetOf(id));
39607
39633
  if (or2) dr = dr ? { min: Math.min(dr.min, or2.min), max: Math.max(dr.max, or2.max) } : or2;
39608
39634
  }
39609
- const includeCandles = pane.kind === "price" && (!this.scene.candlesHidden || this.priceLayersAnchoredToBars(masterModels));
39635
+ const includeCandles = pane.kind === "price" && (!this.scene.candlesHidden || this.priceLayersAnchoredToBars(masterModels) || !this.paneHasMeasurableContent(masterModels, dr));
39610
39636
  pane.scaleTarget = computePaneScale(masterModels, this.bars, includeCandles, i0, i1, dr, paneLogScale(this.scene, pane), (id) => this.scene.offsetOf(id));
39611
39637
  pane.percentBaseline = pane.kind === "price" ? this.bars[i0]?.close ?? 0 : this.firstVisibleValue(masterModels, i0);
39612
39638
  pane.axisFormat = void 0;
@@ -39838,16 +39864,31 @@ ${overlayScrollbarCss(".vela-sd-pane")}
39838
39864
  );
39839
39865
  }
39840
39866
  /**
39841
- * True when SDK-layer content on the price pane paints at BAR PRICES without
39842
- * contributing a series: the active chart type's own layer, or an overlay layer native
39843
- * (a series-less model whose type names a mounted layer). Hiding the candles must then
39844
- * keep the bars in the price scale with nothing else on the pane the scale would fall
39845
- * to the {0,1} placeholder and every such layer would paint off-screen and vanish.
39867
+ * True for the layer painting the ACTIVE chart type (the base entry whose id is the
39868
+ * current price style) while the price series is hidden. The chart type IS the price
39869
+ * series, so "hide chart" blanks its layer along with the bars; an indicator's layer
39870
+ * (an overlay layer native, on any pane) is independent content and keeps painting.
39871
+ */
39872
+ layerHiddenWithCandles(l) {
39873
+ return this.scene.candlesHidden && l.owner === null && l.def.id === this.scene.priceStyle;
39874
+ }
39875
+ /**
39876
+ * True when an overlay layer native (a series-less model whose type names a mounted
39877
+ * layer) sits on the price pane: it paints at BAR PRICES without contributing a series,
39878
+ * so hiding the candles must keep the bars in the price scale — with nothing else on the
39879
+ * pane the scale would fall to the {0,1} placeholder and the layer would paint off-screen
39880
+ * and vanish. The chart type's own layer does not count: it is blanked with the candles.
39846
39881
  */
39847
39882
  priceLayersAnchoredToBars(masterModels) {
39848
- if (this.extLayers.some((l) => l.owner === null && l.def.id === this.scene.priceStyle)) return true;
39849
39883
  return masterModels.some((m) => m.series.length === 0 && !!m.native && this.extLayers.some((l) => l.def.id === m.native.type));
39850
39884
  }
39885
+ /** True when the pane's master content contributes SOMETHING to its autoscale besides
39886
+ * the candles: a series painted on the pane (force_overlay ones scale elsewhere), a
39887
+ * price line, or a measured drawings range. Mirrors what `computePaneScale` considers. */
39888
+ paneHasMeasurableContent(masterModels, drawings) {
39889
+ if (drawings) return true;
39890
+ return masterModels.some((m) => m.priceLines.length > 0 || m.series.some((s) => s.overlay !== true));
39891
+ }
39851
39892
  /** Per-pane scale state for a host UI (e.g. a price-axis context menu): the pane's pixel
39852
39893
  * band (`top`/`height`, so a click y maps to a pane) plus its current axis `mode`/`log`.
39853
39894
  * Top-to-bottom order. Every pane is independent — the price pane from the scene setting,