@tradecanvas/core 0.1.1 → 0.1.2

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/index.js CHANGED
@@ -374,6 +374,12 @@ var w = class {
374
374
  updateData(e, t) {
375
375
  this.dataLength = e.length, this.dataLength !== 0 && (this.clampOffset(), this.updateVisibleRange(), t && (this.state.priceRange = l(e, this.state.visibleRange.from, Math.min(this.state.visibleRange.to, this.dataLength - 1), .08)));
376
376
  }
377
+ setPriceRange(e, t) {
378
+ this.state.priceRange = {
379
+ min: e,
380
+ max: t
381
+ };
382
+ }
377
383
  scrollBy(e) {
378
384
  this.state.offset += e, this.clampOffset(), this.updateVisibleRange();
379
385
  }
@@ -925,6 +931,24 @@ var k = class {
925
931
  let n = this.instances.get(e);
926
932
  n && Object.assign(n.style, t);
927
933
  }
934
+ getOverlayPriceRange(e, t) {
935
+ let n = Infinity, r = -Infinity;
936
+ for (let i of this.instances.values()) {
937
+ if (!i.output || !i.config.visible || i.plugin.descriptor.placement !== "overlay") continue;
938
+ let a = 0;
939
+ for (let [, o] of i.output.values) {
940
+ if (a >= e && a <= t) for (let e in o) {
941
+ let t = o[e];
942
+ t !== void 0 && isFinite(t) && (t < n && (n = t), t > r && (r = t));
943
+ }
944
+ a++;
945
+ }
946
+ }
947
+ return n === Infinity ? null : {
948
+ min: n,
949
+ max: r
950
+ };
951
+ }
928
952
  getPanelIndicators() {
929
953
  let e = [];
930
954
  for (let [t, n] of this.instances) n.plugin.descriptor.placement === "panel" && e.push({