@tradecanvas/chart 0.3.0 → 0.5.0

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
@@ -1,12 +1,12 @@
1
- import { DARK_THEME as e, DARK_THEME as t, DEFAULT_DRAWING_STYLE as n, DEFAULT_PANEL_HEIGHT as r, DEFAULT_RECONNECT as i, DEFAULT_STREAM_CONFIG as a, DEFAULT_TIMEFRAME_FAVORITES as o, DEFAULT_TRADING_CONFIG as s, LIGHT_THEME as c, LIGHT_THEME as l, LayerType as u, MARKET_CRYPTO as d, MARKET_HNX as f, MARKET_HOSE as ee, MARKET_NYSE as p, MARKET_UPCOM as te, MIN_PANEL_HEIGHT as m, PRICE_AXIS_WIDTH as h, TIMEFRAMES_CRYPTO as g, TIMEFRAMES_FOREX as _, TIMEFRAMES_STOCK as ne, TIME_AXIS_HEIGHT as v, VN_COLORS as re, computePriceLimits as ie, computePriceLimits as y, createVNTheme as ae, formatNumber as oe, formatVND as se, formatVolumeLoc as ce, getCurrentSession as le, getLocale as ue, mergeBar as de, registerLocale as fe, setLocale as pe, setLocale as me, t as b } from "@tradecanvas/commons";
2
- import { AlertManager as x, AlertManager as S, Animator as C, Animator as w, AreaRenderer as T, BarCountdown as E, BarCountdown as D, BarRenderer as O, BaseFinanceChart as k, BaselineRenderer as A, BinanceAdapter as j, CandlestickRenderer as M, ChartLegend as N, ChartLegend as P, ChartStateManager as F, ChartStateManager as I, CompareRenderer as L, CompareRenderer as R, CrosshairHandler as z, CrosshairTooltip as he, CrosshairTooltip as ge, CurrentPriceLine as _e, CurrentPriceLine as ve, DEFAULT_LEGEND_CONFIG as ye, DataExporter as be, DataExporter as B, DrawingBase as xe, DrawingManager as Se, DrawingRenderer as Ce, Easing as we, EventBus as Te, FinanceCrosshair as V, GridRenderer as Ee, HollowCandleRenderer as De, IndicatorBase as Oe, IndicatorEngine as H, InteractionManager as ke, KagiRenderer as Ae, KeyboardHandler as je, KeyboardHandler as Me, LineRenderer as Ne, MockAdapter as Pe, PanHandler as Fe, PointAndFigureRenderer as Ie, PriceAxis as Le, RenderEngine as Re, RenkoRenderer as ze, ReplayManager as Be, ReplayManager as Ve, Screenshot as He, Screenshot as U, SessionBreaks as Ue, SessionBreaks as We, StreamManager as Ge, StreamManager as Ke, TickAggregator as qe, TimeAxis as Je, TradingManager as Ye, TradingRenderer as Xe, UndoRedoManager as Ze, UndoRedoManager as Qe, Viewport as $e, VolumeRenderer as et, VolumeRenderer as tt, Watermark as nt, Watermark as rt, ZoomHandler as it, layoutSquarifiedTreemap as at, layoutUniformGrid as ot, registerBuiltInDrawingTools as st, registerBuiltInIndicators as W, renderDepthChart as ct, renderEquityCurve as lt, renderGauge as ut, renderHeatmap as dt, renderSparkline as ft, renderWaterfall as pt, toHeikinAshi as mt, toHeikinAshi as ht, toKagi as gt, toKagi as _t, toLineBreak as vt, toLineBreak as yt, toPointAndFigure as bt, toPointAndFigure as xt, toRenko as St, toRenko as Ct } from "@tradecanvas/core";
1
+ import { DARK_TERMINAL as e, DARK_THEME as t, DARK_THEME as n, DEFAULT_DRAWING_STYLE as r, DEFAULT_PANEL_HEIGHT as i, DEFAULT_RECONNECT as a, DEFAULT_STREAM_CONFIG as o, DEFAULT_TIMEFRAME_FAVORITES as s, DEFAULT_TRADING_CONFIG as c, LIGHT_THEME as l, LIGHT_THEME as u, LayerType as d, MARKET_CRYPTO as f, MARKET_HNX as ee, MARKET_HOSE as p, MARKET_NYSE as m, MARKET_UPCOM as h, MIN_PANEL_HEIGHT as g, PRICE_AXIS_WIDTH as _, TIMEFRAMES_CRYPTO as te, TIMEFRAMES_FOREX as ne, TIMEFRAMES_STOCK as re, TIME_AXIS_HEIGHT as v, VN_COLORS as ie, computePriceLimits as ae, computePriceLimits as y, createVNTheme as oe, formatNumber as se, formatVND as ce, formatVolumeLoc as le, getCurrentSession as ue, getLocale as de, mergeBar as fe, normalizeBar as pe, normalizeBarTime as me, registerLocale as b, setLocale as x, setLocale as S, t as C } from "@tradecanvas/commons";
2
+ import { AlertManager as w, AlertManager as T, Animator as E, Animator as D, AreaRenderer as O, BarCountdown as k, BarCountdown as A, BarRenderer as j, BaseFinanceChart as M, BaselineRenderer as N, BinanceAdapter as P, CandlestickRenderer as F, ChartLegend as I, ChartLegend as L, ChartStateManager as R, ChartStateManager as z, CompareRenderer as he, CompareRenderer as ge, CrosshairHandler as _e, CrosshairTooltip as ve, CrosshairTooltip as ye, CurrentPriceLine as be, CurrentPriceLine as xe, DEFAULT_LEGEND_CONFIG as Se, DataExporter as Ce, DataExporter as B, DrawingBase as we, DrawingManager as Te, DrawingRenderer as Ee, Easing as De, EventBus as Oe, FinanceCrosshair as V, GridRenderer as ke, HollowCandleRenderer as Ae, IndicatorBase as je, IndicatorEngine as H, InteractionManager as Me, KagiRenderer as Ne, KeyboardHandler as Pe, KeyboardHandler as Fe, LineRenderer as Ie, MockAdapter as Le, PanHandler as Re, PointAndFigureRenderer as ze, PriceAxis as Be, RenderEngine as Ve, RenkoRenderer as He, ReplayManager as Ue, ReplayManager as U, Screenshot as We, Screenshot as W, SessionBreaks as Ge, SessionBreaks as Ke, StreamManager as qe, StreamManager as Je, TickAggregator as Ye, TimeAxis as Xe, TradingManager as Ze, TradingRenderer as Qe, UndoRedoManager as $e, UndoRedoManager as et, Viewport as tt, VolumeRenderer as nt, VolumeRenderer as rt, Watermark as it, Watermark as at, ZoomHandler as ot, layoutSquarifiedTreemap as st, layoutUniformGrid as ct, registerBuiltInDrawingTools as lt, registerBuiltInIndicators as G, renderDepthChart as ut, renderEquityCurve as dt, renderGauge as ft, renderHeatmap as pt, renderSparkline as mt, renderWaterfall as ht, toHeikinAshi as gt, toHeikinAshi as _t, toKagi as vt, toKagi as yt, toLineBreak as bt, toLineBreak as xt, toPointAndFigure as St, toPointAndFigure as Ct, toRenko as wt, toRenko as Tt } from "@tradecanvas/core";
3
3
  //#region src/DataManager.ts
4
- function G(e) {
4
+ function K(e) {
5
5
  if (!e || typeof e.time != "number") return !1;
6
6
  let { open: t, high: n, low: r, close: i } = e;
7
7
  return !(!isFinite(t) || !isFinite(n) || !isFinite(r) || !isFinite(i) || t < 0 || n < 0 || r < 0 || i < 0 || n < r || e.volume !== void 0 && (!isFinite(e.volume) || e.volume < 0));
8
8
  }
9
- function K(e) {
9
+ function q(e) {
10
10
  return {
11
11
  ...e,
12
12
  high: Math.max(e.open, e.high, e.low, e.close),
@@ -14,20 +14,20 @@ function K(e) {
14
14
  volume: e.volume === void 0 ? 0 : Math.max(0, e.volume)
15
15
  };
16
16
  }
17
- var q = class {
17
+ var J = class {
18
18
  data = [];
19
19
  getData() {
20
20
  return this.data;
21
21
  }
22
22
  setData(e) {
23
- this.data = e.filter(G).map(K);
23
+ this.data = e.filter(K).map(q);
24
24
  }
25
25
  appendBar(e) {
26
- G(e) && this.data.push(K(e));
26
+ K(e) && this.data.push(q(e));
27
27
  }
28
28
  updateLastBar(e) {
29
- if (!G(e)) return;
30
- let t = K(e);
29
+ if (!K(e)) return;
30
+ let t = q(e);
31
31
  if (this.data.length === 0) {
32
32
  this.data.push(t);
33
33
  return;
@@ -35,7 +35,7 @@ var q = class {
35
35
  this.data[this.data.length - 1] = t;
36
36
  }
37
37
  updateLastBarFromTick(e) {
38
- this.data.length !== 0 && (!isFinite(e.price) || e.price < 0 || e.volume !== void 0 && (!isFinite(e.volume) || e.volume < 0) || (this.data[this.data.length - 1] = de(this.data[this.data.length - 1], e)));
38
+ this.data.length !== 0 && (!isFinite(e.price) || e.price < 0 || e.volume !== void 0 && (!isFinite(e.volume) || e.volume < 0) || (this.data[this.data.length - 1] = fe(this.data[this.data.length - 1], e)));
39
39
  }
40
40
  getLength() {
41
41
  return this.data.length;
@@ -43,18 +43,18 @@ var q = class {
43
43
  clear() {
44
44
  this.data = [];
45
45
  }
46
- }, J = class {
46
+ }, Y = class {
47
47
  theme;
48
48
  constructor(e) {
49
- !e || e === "dark" ? this.theme = { ...t } : e === "light" ? this.theme = { ...l } : this.theme = { ...e };
49
+ !e || e === "dark" ? this.theme = { ...n } : e === "light" ? this.theme = { ...u } : this.theme = { ...e };
50
50
  }
51
51
  getTheme() {
52
52
  return this.theme;
53
53
  }
54
54
  setTheme(e) {
55
- e === "dark" ? this.theme = { ...t } : e === "light" ? this.theme = { ...l } : this.theme = { ...e };
55
+ e === "dark" ? this.theme = { ...n } : e === "light" ? this.theme = { ...u } : this.theme = { ...e };
56
56
  }
57
- }, Y = 200, X = 80, Z = class {
57
+ }, X = 200, Z = 80, Q = class {
58
58
  panels = [];
59
59
  containerWidth = 0;
60
60
  containerHeight = 0;
@@ -62,12 +62,12 @@ var q = class {
62
62
  this.containerWidth = e, this.containerHeight = t;
63
63
  }
64
64
  addPanel(e, t = "bottom", n) {
65
- let i = t === "left" || t === "right";
65
+ let r = t === "left" || t === "right";
66
66
  this.panels.push({
67
67
  id: e,
68
68
  position: t,
69
- size: n ?? (i ? Y : r),
70
- minSize: i ? X : m,
69
+ size: n ?? (r ? X : i),
70
+ minSize: r ? Z : g,
71
71
  content: {
72
72
  type: "indicator",
73
73
  indicatorInstanceId: e
@@ -80,8 +80,8 @@ var q = class {
80
80
  setPanelPosition(e, t) {
81
81
  let n = this.panels.find((t) => t.id === e);
82
82
  if (n) {
83
- let e = n.position === "left" || n.position === "right", i = t === "left" || t === "right";
84
- n.position = t, e !== i && (n.size = i ? Y : r, n.minSize = i ? X : m);
83
+ let e = n.position === "left" || n.position === "right", r = t === "left" || t === "right";
84
+ n.position = t, e !== r && (n.size = r ? X : i, n.minSize = r ? Z : g);
85
85
  }
86
86
  }
87
87
  setPanelSize(e, t) {
@@ -95,7 +95,7 @@ var q = class {
95
95
  let e = this.panels.filter((e) => e.position === "left"), t = this.panels.filter((e) => e.position === "right"), n = this.panels.filter((e) => e.position === "top"), r = this.panels.filter((e) => e.position === "bottom"), i = e.reduce((e, t) => e + t.size, 0), a = t.reduce((e, t) => e + t.size, 0), o = n.reduce((e, t) => e + t.size, 0), s = r.reduce((e, t) => e + t.size, 0), c = {
96
96
  x: i,
97
97
  y: o,
98
- width: Math.max(0, this.containerWidth - i - a - h),
98
+ width: Math.max(0, this.containerWidth - i - a - _),
99
99
  height: Math.max(0, this.containerHeight - o - s - v)
100
100
  }, l = [], u = [], d = 0;
101
101
  for (let t of e) l.push({
@@ -154,7 +154,7 @@ var q = class {
154
154
  },
155
155
  orientation: "horizontal"
156
156
  }), f += e.size;
157
- d = i + c.width + h;
157
+ d = i + c.width + _;
158
158
  for (let e of t) l.push({
159
159
  config: e,
160
160
  rect: {
@@ -182,14 +182,14 @@ var q = class {
182
182
  getMainChartRect() {
183
183
  return this.resolve().mainChartRect;
184
184
  }
185
- }, Q = class {
185
+ }, $ = class {
186
186
  constructor(e) {
187
187
  this.indicatorEngine = e;
188
188
  }
189
189
  registerIndicator(e) {
190
190
  this.indicatorEngine.register(e);
191
191
  }
192
- }, wt = class {
192
+ }, Et = class {
193
193
  static version = "0.3.0";
194
194
  engine;
195
195
  viewport;
@@ -237,8 +237,12 @@ var q = class {
237
237
  marketConfig = null;
238
238
  container;
239
239
  currentPriceLine;
240
+ numberLocale;
241
+ keyboardHandler = null;
242
+ onWindowKeyDown = null;
243
+ currentSymbol = "";
240
244
  constructor(e, t) {
241
- this.container = e, this.options = t;
245
+ this.container = e, this.options = t, this.numberLocale = t.numberLocale ?? "en-US";
242
246
  let n = t.features ?? {};
243
247
  this.features = {
244
248
  drawings: n.drawings ?? !0,
@@ -270,19 +274,19 @@ var q = class {
270
274
  logScale: n.logScale ?? !0,
271
275
  timeframes: n.timeframes ?? [],
272
276
  defaultTimeframeFavorites: n.defaultTimeframeFavorites ?? []
273
- }, e.style.position = "relative", e.style.overflow = "hidden", e.tabIndex = 0, e.style.outline = "none", this.dataManager = new q(), this.themeManager = new J(t.theme), this.layoutManager = new Z(), this.indicatorEngine = new H(), this.pluginManager = new Q(this.indicatorEngine), this.eventBus = new Te(), W(this.indicatorEngine), this.drawingManager = new Se(), st(this.drawingManager), this.drawingRenderer = new Ce(this.drawingManager), this.drawingManager.setRequestRender(() => {
274
- this.syncRenderContext(), this.engine.requestRender(u.Overlay), this.scheduleAutoSave();
277
+ }, e.style.position = "relative", e.style.overflow = "hidden", e.tabIndex = 0, e.style.outline = "none", this.dataManager = new J(), this.themeManager = new Y(t.theme), this.layoutManager = new Q(), this.indicatorEngine = new H(), this.pluginManager = new $(this.indicatorEngine), this.eventBus = new Oe(), G(this.indicatorEngine), this.drawingManager = new Te(), lt(this.drawingManager), this.drawingRenderer = new Ee(this.drawingManager), this.drawingManager.setRequestRender(() => {
278
+ this.syncRenderContext(), this.engine.requestRender(d.Overlay), this.scheduleAutoSave();
275
279
  }), this.drawingManager.setEventCallback((e, t) => {
276
280
  this.eventBus.emit(e, t);
277
- }), this.undoRedoManager = new Qe(), this.drawingManager.setUndoRedoManager(this.undoRedoManager), this.drawingManager.setDataGetter(() => this.dataManager.getData()), this.drawingManager.setDisplayDataGetter(() => this.getDisplayData()), t.crosshair?.mode === "magnet" && this.drawingManager.setMagnetMode("magnet"), this.tradingManager = new Ye(), this.tradingRenderer = new Xe(this.tradingManager), this.tradingManager.setContainer(e), this.tradingManager.setRequestRender(() => this.engine.requestRender(u.Overlay)), this.tradingManager.setEventCallback((e, t) => {
281
+ }), this.undoRedoManager = new et(), this.drawingManager.setUndoRedoManager(this.undoRedoManager), this.drawingManager.setDataGetter(() => this.dataManager.getData()), this.drawingManager.setDisplayDataGetter(() => this.getDisplayData()), t.crosshair?.mode === "magnet" && this.drawingManager.setMagnetMode("magnet"), this.tradingManager = new Ze(), this.tradingRenderer = new Qe(this.tradingManager), this.tradingManager.setContainer(e), this.tradingManager.setRequestRender(() => this.engine.requestRender(d.Overlay)), this.tradingManager.setEventCallback((e, t) => {
278
282
  this.eventBus.emit(e, t);
279
- }), this.engine = new Re(e);
283
+ }), this.engine = new Ve(e);
280
284
  let r = this.engine.dprManager.getContainerSize();
281
- this.viewport = new $e(r.width, r.height, t.minBarSpacing ?? 2, t.maxBarSpacing ?? 30, t.rightMargin ?? 5), this.layoutManager.resize(r.width, r.height), this.engine.onContainerResize = (e) => {
285
+ this.viewport = new tt(r.width, r.height, t.minBarSpacing ?? 2, t.maxBarSpacing ?? 30, t.rightMargin ?? 5), this.layoutManager.resize(r.width, r.height), this.engine.onContainerResize = (e) => {
282
286
  if (e.width <= 0 || e.height <= 0) return;
283
287
  let t = this.viewport.isAtEnd();
284
288
  this.viewport.resize(e.width, e.height), this.layoutManager.resize(e.width, e.height), this.updateViewportAndRender(t);
285
- }, this.chartRenderer = this.createChartRenderer(t.chartType), this.gridRenderer = new Ee(), t.grid?.visible === !1 && this.gridRenderer.setVisible(!1), this.priceAxis = new Le(), this.timeAxis = new Je(), this.crosshairHandler = new z(), t.crosshair?.mode && this.crosshairHandler.setMode(t.crosshair.mode), this.crosshairHandler.setCallback((e, t) => {
289
+ }, this.chartRenderer = this.createChartRenderer(t.chartType), this.gridRenderer = new ke(), t.grid?.visible === !1 && this.gridRenderer.setVisible(!1), this.priceAxis = new Be(), this.priceAxis.setLocale(this.numberLocale), this.timeAxis = new Xe(), this.crosshairHandler = new _e(), this.crosshairHandler.setLocale(this.numberLocale), t.crosshair?.mode && this.crosshairHandler.setMode(t.crosshair.mode), this.crosshairHandler.setCallback((e, t) => {
286
290
  if (e !== null && t) {
287
291
  let n = this.dataManager.getData(), r = e < n.length ? n[e] : void 0;
288
292
  this.chartLegend.setHoverBar(r ?? null), r && this.crosshairTooltip.show(t, r, this.themeManager.getTheme(), this.cachedContainerSize()), this.eventBus.emit("crosshairMove", {
@@ -291,12 +295,12 @@ var q = class {
291
295
  barIndex: e
292
296
  });
293
297
  } else this.crosshairTooltip.hide(), this.chartLegend.setHoverBar(null);
294
- }), this.chartLegend = new P(), this.chartLegend.setChartType(t.chartType), this.watermark = new rt(), t.watermark && this.watermark.setConfig(t.watermark), this.volumeRenderer = new tt(), this.barCountdown = new D(), this.sessionBreaks = new We(), this.compareRenderer = new R(), t.sessionBreaks ? this.sessionBreaks.setConfig({
298
+ }), this.chartLegend = new L(), this.chartLegend.setChartType(t.chartType), this.watermark = new at(), t.watermark && this.watermark.setConfig(t.watermark), this.volumeRenderer = new rt(), this.barCountdown = new A(), this.sessionBreaks = new Ke(), this.compareRenderer = new ge(), t.sessionBreaks ? this.sessionBreaks.setConfig({
295
299
  visible: t.sessionBreaks.visible ?? !0,
296
300
  color: t.sessionBreaks.color,
297
301
  lineStyle: t.sessionBreaks.lineStyle,
298
302
  lineWidth: t.sessionBreaks.lineWidth
299
- }) : t.features?.sessionBreaks !== !1 && this.sessionBreaks.setVisible(!0), t.logScale && this.viewport.setLogScale(!0), this.animator = new w(), this.crosshairTooltip = new ge(), this.crosshairTooltip.create(e), new Me({
303
+ }) : t.features?.sessionBreaks !== !1 && this.sessionBreaks.setVisible(!0), t.logScale && this.viewport.setLogScale(!0), this.animator = new D(), this.crosshairTooltip = new ye(), this.crosshairTooltip.create(e), this.keyboardHandler = new Fe({
300
304
  scrollBars: (e) => {
301
305
  let t = this.viewport.getState().barWidth + this.viewport.getState().barSpacing;
302
306
  this.viewport.scrollBy(e * t), this.updateViewportAndRender();
@@ -312,19 +316,23 @@ var q = class {
312
316
  this.viewport.scrollToEnd(), this.updateViewportAndRender();
313
317
  },
314
318
  fitContent: () => this.fitContent()
315
- }), this.currentPriceLine = new ve(), this.alertManager = new S(), this.alertManager.setRequestRender(() => this.engine.requestRender(u.Overlay)), this.alertManager.on("triggered", (e) => {
319
+ }), this.keyboardHandler.setEnabled(this.features.keyboard), this.onWindowKeyDown = (e) => {
320
+ if (!this.keyboardHandler) return;
321
+ let t = document.activeElement;
322
+ t && t !== this.container && !this.container.contains(t) || t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.isContentEditable) || this.keyboardHandler.handleKey(e) && e.preventDefault();
323
+ }, window.addEventListener("keydown", this.onWindowKeyDown), this.currentPriceLine = new xe(), this.alertManager = new T(), this.alertManager.setRequestRender(() => this.engine.requestRender(d.Overlay)), this.alertManager.on("triggered", (e) => {
316
324
  this.eventBus.emit("dataUpdate", {
317
325
  alert: "triggered",
318
326
  alertId: e.id,
319
327
  price: e.price,
320
328
  message: e.message
321
329
  });
322
- }), this.replayManager = new Ve(), this.interactionManager = new ke(e), this.features.panning && this.interactionManager.setPanHandler(new Fe((e) => {
330
+ }), this.replayManager = new U(), this.interactionManager = new Me(e), this.features.panning && this.interactionManager.setPanHandler(new Re((e) => {
323
331
  this.viewport.scrollBy(e), this.updateViewportAndRender();
324
- })), this.features.zooming && this.interactionManager.setZoomHandler(new it((e, t) => {
332
+ })), this.features.zooming && this.interactionManager.setZoomHandler(new ot((e, t) => {
325
333
  this.viewport.zoom(e, t), this.updateViewportAndRender();
326
334
  })), this.features.crosshair && this.interactionManager.setCrosshairHandler(this.crosshairHandler), this.features.drawings && this.interactionManager.setDrawingManager(this.drawingManager, () => this.viewport.getState()), this.features.trading && this.interactionManager.setTradingManager(this.tradingManager, () => this.viewport.getState()), this.interactionManager.setOverlayDirtyCallback(() => {
327
- this.engine.requestRender(u.Overlay), this.layoutManager.getPanels().length > 0 && this.engine.requestRender(u.UI);
335
+ this.engine.requestRender(d.Overlay), this.layoutManager.getPanels().length > 0 && this.engine.requestRender(d.UI);
328
336
  }), this.interactionManager.attach(), this.syncRenderContext(), this.engine.start();
329
337
  }
330
338
  setData(e) {
@@ -333,11 +341,17 @@ var q = class {
333
341
  appendBar(e) {
334
342
  this.dataManager.appendBar(e), this.crosshairHandler.setData(this.dataManager.getData()), this.displayDataCache = null, this.autoScrollOnNewBar && this.viewport.scrollToEnd(), this.indicatorEngine.recalculateAll(this.dataManager.getData()), this.updateViewportAndRender();
335
343
  }
344
+ appendBars(e) {
345
+ if (e.length !== 0) {
346
+ for (let t of e) this.dataManager.appendBar(t);
347
+ this.displayDataCache = null, this.indicatorEngine.recalculateAll(this.dataManager.getData()), this.crosshairHandler.setData(this.dataManager.getData()), this.updateViewportAndRender(this.viewport.isAtEnd());
348
+ }
349
+ }
336
350
  updateLastBar(e) {
337
- this.dataManager.updateLastBar(e), this.currentPriceLine.setPrice(e.close), this.options.chartType !== "candlestick" && this.options.chartType !== "line" && this.options.chartType !== "area" && this.options.chartType !== "bar" && this.options.chartType !== "hollowCandle" && (this.displayDataCache = null), this.scheduleRender();
351
+ this.dataManager.updateLastBar(e), this.currentPriceLine.setPrice(e.close), this.options.chartType !== "candlestick" && this.options.chartType !== "line" && this.options.chartType !== "area" && this.options.chartType !== "bar" && this.options.chartType !== "hollowCandle" && (this.displayDataCache = null), this.indicatorEngine.recalculateAll(this.dataManager.getData()), this.scheduleRender();
338
352
  }
339
353
  updateLastBarFromTick(e) {
340
- this.dataManager.updateLastBarFromTick(e), this.currentPriceLine.setPrice(e.price), this.options.chartType !== "candlestick" && this.options.chartType !== "line" && this.options.chartType !== "area" && this.options.chartType !== "bar" && this.options.chartType !== "hollowCandle" && (this.displayDataCache = null), this.scheduleRender();
354
+ this.dataManager.updateLastBarFromTick(e), this.currentPriceLine.setPrice(e.price), this.options.chartType !== "candlestick" && this.options.chartType !== "line" && this.options.chartType !== "area" && this.options.chartType !== "bar" && this.options.chartType !== "hollowCandle" && (this.displayDataCache = null), this.indicatorEngine.recalculateAll(this.dataManager.getData()), this.scheduleRender();
341
355
  }
342
356
  setChartType(e) {
343
357
  this.options.chartType = e, this.chartRenderer = this.createChartRenderer(e), this.chartLegend.setChartType(e), this.displayDataCache = null, this.updateViewportAndRender(!0);
@@ -365,7 +379,7 @@ var q = class {
365
379
  }
366
380
  static indicators() {
367
381
  let e = new H();
368
- return W(e), e.getAvailableIndicators();
382
+ return G(e), e.getAvailableIndicators();
369
383
  }
370
384
  setPanelPosition(e, t) {
371
385
  this.layoutManager.setPanelPosition(e, t), this.engine.requestRender();
@@ -491,42 +505,46 @@ var q = class {
491
505
  setDepthData(e) {
492
506
  this.features.trading && this.tradingManager.setDepthData(e);
493
507
  }
494
- setCurrentPrice(e) {
508
+ setCurrentPrice(e, t) {
495
509
  this.tradingManager.setCurrentPrice(e), this.currentPriceLine.setPrice(e), this.scheduleRender(), this.features.alerts && this.alertManager.checkPrice(e);
496
510
  }
497
511
  setTradingConfig(e) {
498
512
  this.features.trading && this.tradingManager.setConfig(e);
499
513
  }
500
514
  async connect(e) {
501
- this.disconnectStream(), this.streamManager = new Ke(), this.streamManager.on("snapshot", (e) => {
515
+ this.disconnectStream(), this.streamManager = new Je(), this.streamManager.on("snapshot", (e) => {
502
516
  this.setData(e);
503
517
  }), this.streamManager.on("barClose", (e) => {
504
518
  this.dataManager.appendBar(e), this.crosshairHandler.setData(this.dataManager.getData()), this.autoScrollOnNewBar && this.viewport.scrollToEnd(), this.indicatorEngine.recalculateAll(this.dataManager.getData()), this.updateViewportAndRender();
505
519
  }), this.streamManager.on("barUpdate", (e) => {
506
- this.dataManager.updateLastBar(e), this.currentPriceLine.setPrice(e.close), this.scheduleRender();
520
+ this.dataManager.updateLastBar(e), this.currentPriceLine.setPrice(e.close), this.indicatorEngine.recalculateAll(this.dataManager.getData()), this.scheduleRender();
507
521
  }), this.streamManager.on("priceChange", ({ price: e }) => {
508
- this.tradingManager.setCurrentPrice(e), this.currentPriceLine.setPrice(e), this.engine.requestRender(u.Overlay), this.engine.requestRender(u.UI);
522
+ this.tradingManager.setCurrentPrice(e), this.currentPriceLine.setPrice(e), this.engine.requestRender(d.Overlay), this.engine.requestRender(d.UI);
509
523
  }), this.streamManager.on("connectionChange", (e) => {
510
524
  this.eventBus.emit("dataUpdate", { connection: e });
511
525
  }), this.streamManager.on("error", (e) => {
512
526
  this.eventBus.emit("dataUpdate", { error: e.message });
513
- }), this.autoScrollOnNewBar = e.autoScroll !== !1, await this.streamManager.connect(e);
527
+ }), this.autoScrollOnNewBar = e.autoScroll !== !1, this.currentSymbol = e.symbol, await this.streamManager.connect(e);
514
528
  let t = this.timeframeToMs(e.timeframe);
515
529
  this.barCountdown.setTimeframeMs(t), this.countdownInterval && clearInterval(this.countdownInterval), this.countdownInterval = setInterval(() => {
516
- this.barCountdown.isVisible() && this.engine.requestRender(u.UI);
530
+ this.barCountdown.isVisible() && this.engine.requestRender(d.UI);
517
531
  }, 1e3);
518
532
  }
519
533
  async switchStream(e, t) {
520
- this.streamManager && await this.streamManager.switchTo(e, t);
534
+ this.streamManager && (this.currentSymbol = e, await this.streamManager.switchTo(e, t));
535
+ }
536
+ async setTimeframe(e) {
537
+ if (!this.streamManager) throw Error("No active stream. Call connect() first.");
538
+ await this.switchStream(this.currentSymbol, e);
521
539
  }
522
540
  disconnectStream() {
523
541
  this.streamManager &&= (this.streamManager.dispose(), null);
524
542
  }
525
543
  setBarCountdownVisible(e) {
526
- this.barCountdown.setVisible(e), this.engine.requestRender(u.UI);
544
+ this.barCountdown.setVisible(e), this.engine.requestRender(d.UI);
527
545
  }
528
546
  setSessionBreaksVisible(e) {
529
- this.sessionBreaks.setVisible(e), this.engine.requestRender(u.Background);
547
+ this.sessionBreaks.setVisible(e), this.engine.requestRender(d.Background);
530
548
  }
531
549
  addCompareSymbol(e, t, n, r) {
532
550
  this.compareRenderer.addSymbol({
@@ -535,19 +553,19 @@ var q = class {
535
553
  data: n,
536
554
  color: r,
537
555
  visible: !0
538
- }), this.engine.requestRender(u.Main);
556
+ }), this.engine.requestRender(d.Main);
539
557
  }
540
558
  removeCompareSymbol(e) {
541
- this.compareRenderer.removeSymbol(e), this.engine.requestRender(u.Main);
559
+ this.compareRenderer.removeSymbol(e), this.engine.requestRender(d.Main);
542
560
  }
543
561
  updateCompareData(e, t) {
544
- this.compareRenderer.setSymbolData(e, t), this.engine.requestRender(u.Main);
562
+ this.compareRenderer.setSymbolData(e, t), this.engine.requestRender(d.Main);
545
563
  }
546
564
  setCompareMode(e) {
547
- this.compareRenderer.setMode(e), this.engine.requestRender(u.Main);
565
+ this.compareRenderer.setMode(e), this.engine.requestRender(d.Main);
548
566
  }
549
567
  clearCompareSymbols() {
550
- this.compareRenderer.clear(), this.engine.requestRender(u.Main);
568
+ this.compareRenderer.clear(), this.engine.requestRender(d.Main);
551
569
  }
552
570
  setLogScale(e) {
553
571
  this.viewport.setLogScale(e), this.updateViewportAndRender();
@@ -556,7 +574,7 @@ var q = class {
556
574
  return this.viewport.isLogScale();
557
575
  }
558
576
  setSessionBreaksConfig(e) {
559
- this.sessionBreaks.setConfig(e), this.engine.requestRender(u.Background);
577
+ this.sessionBreaks.setConfig(e), this.engine.requestRender(d.Background);
560
578
  }
561
579
  getConnectionState() {
562
580
  return this.streamManager?.getConnectionState() ?? "disconnected";
@@ -632,7 +650,7 @@ var q = class {
632
650
  this.watermark.setConfig({
633
651
  text: e,
634
652
  ...t
635
- }), this.engine.requestRender(u.Background);
653
+ }), this.engine.requestRender(d.Background);
636
654
  }
637
655
  setAutoScale(e) {
638
656
  this.options.autoScale = e, this.updateViewportAndRender();
@@ -641,37 +659,40 @@ var q = class {
641
659
  return this.options.autoScale !== !1;
642
660
  }
643
661
  setCrosshairMode(e) {
644
- this.crosshairHandler.setMode(e), this.engine.requestRender(u.Overlay);
662
+ this.crosshairHandler.setMode(e), this.engine.requestRender(d.Overlay);
645
663
  }
646
664
  getCrosshairMode() {
647
665
  return this.crosshairHandler.getMode();
648
666
  }
649
667
  setGridVisible(e) {
650
- this.gridRenderer.setVisible(e), this.engine.requestRender(u.Background);
668
+ this.gridRenderer.setVisible(e), this.engine.requestRender(d.Background);
651
669
  }
652
670
  isGridVisible() {
653
671
  return this.gridRenderer.isVisible();
654
672
  }
655
673
  setVolumeVisible(e) {
656
- this.volumeRenderer.setVisible(e), this.engine.requestRender(u.Main);
674
+ this.volumeRenderer.setVisible(e), this.engine.requestRender(d.Main);
657
675
  }
658
676
  setTooltipVisible(e) {
659
677
  e || this.crosshairTooltip.hide();
660
678
  }
661
679
  setLegend(e) {
662
- this.chartLegend.setConfig(e), this.engine.requestRender(u.UI);
680
+ this.chartLegend.setConfig(e), this.engine.requestRender(d.UI);
663
681
  }
664
682
  setSymbolName(e) {
665
- this.chartLegend.setSymbol(e), this.engine.requestRender(u.UI);
683
+ this.chartLegend.setSymbol(e), this.engine.requestRender(d.UI);
684
+ }
685
+ setStatusText(e) {
686
+ this.chartLegend.setStatusText(e), this.engine.requestRender(d.UI);
666
687
  }
667
688
  screenshot(e) {
668
- this.features.screenshot && U.download(this.container, e, this.themeManager.getTheme().background);
689
+ this.features.screenshot && W.download(this.container, e, this.themeManager.getTheme().background);
669
690
  }
670
691
  screenshotDataURL() {
671
- return this.features.screenshot ? U.toDataURL(this.container, this.themeManager.getTheme().background) : null;
692
+ return this.features.screenshot ? W.toDataURL(this.container, this.themeManager.getTheme().background) : null;
672
693
  }
673
694
  async screenshotBlob() {
674
- return this.features.screenshot ? U.toBlob(this.container, this.themeManager.getTheme().background) : null;
695
+ return this.features.screenshot ? W.toBlob(this.container, this.themeManager.getTheme().background) : null;
675
696
  }
676
697
  addAlert(e, t = "crossing", n) {
677
698
  if (!this.features.alerts) return null;
@@ -691,7 +712,7 @@ var q = class {
691
712
  this.alertManager.saveToStorage(e);
692
713
  }
693
714
  loadAlerts(e) {
694
- this.alertManager.loadFromStorage(e), this.engine.requestRender(u.Overlay);
715
+ this.alertManager.loadFromStorage(e), this.engine.requestRender(d.Overlay);
695
716
  }
696
717
  replay(e) {
697
718
  if (!this.features.replay) return;
@@ -724,16 +745,16 @@ var q = class {
724
745
  }
725
746
  saveState(e) {
726
747
  if (!this.features.saveLoad) return null;
727
- let t = I.capture({
748
+ let t = z.capture({
728
749
  getDrawings: () => this.getDrawings(),
729
750
  getTheme: () => this.getTheme(),
730
751
  getAlerts: () => this.getAlerts()
731
- }, { chartType: this.options.chartType }), n = I.serialize(t);
732
- return e && I.saveToStorage(e, t), n;
752
+ }, { chartType: this.options.chartType }), n = z.serialize(t);
753
+ return e && z.saveToStorage(e, t), n;
733
754
  }
734
755
  loadState(e) {
735
756
  if (!this.features.saveLoad) return;
736
- let t = I.deserialize(e);
757
+ let t = z.deserialize(e);
737
758
  if (t.chartType && this.setChartType(t.chartType), t.drawings && this.setDrawings(t.drawings), t.theme && this.setTheme(t.theme), t.alerts) {
738
759
  this.clearAlerts();
739
760
  for (let e of t.alerts) this.addAlert(e.price, e.condition, e.message);
@@ -741,25 +762,31 @@ var q = class {
741
762
  }
742
763
  loadStateFromStorage(e) {
743
764
  if (!this.features.saveLoad) return !1;
744
- let t = I.loadFromStorage(e);
745
- return t ? (this.loadState(I.serialize(t)), !0) : !1;
765
+ let t = z.loadFromStorage(e);
766
+ return t ? (this.loadState(z.serialize(t)), !0) : !1;
746
767
  }
747
768
  downloadState(e) {
748
769
  if (!this.features.saveLoad) return;
749
- let t = I.capture({
770
+ let t = z.capture({
750
771
  getDrawings: () => this.getDrawings(),
751
772
  getTheme: () => this.getTheme(),
752
773
  getAlerts: () => this.getAlerts()
753
774
  }, { chartType: this.options.chartType });
754
- I.downloadFile(t, e);
775
+ z.downloadFile(t, e);
755
776
  }
756
777
  async loadStateFromFile() {
757
778
  if (!this.features.saveLoad) return;
758
- let e = await I.loadFromFile();
759
- this.loadState(I.serialize(e));
779
+ let e = await z.loadFromFile();
780
+ this.loadState(z.serialize(e));
760
781
  }
761
782
  setLocale(e) {
762
- me(e), this.engine.requestRender();
783
+ S(e), this.engine.requestRender();
784
+ }
785
+ setNumberLocale(e) {
786
+ this.numberLocale = e, this.priceAxis.setLocale(e), this.crosshairHandler.setLocale(e), this.syncRenderContext(), this.engine.requestRender();
787
+ }
788
+ getNumberLocale() {
789
+ return this.numberLocale;
763
790
  }
764
791
  setMarket(e) {
765
792
  if (this.marketConfig = e, e.colorScheme) {
@@ -789,7 +816,7 @@ var q = class {
789
816
  return this.features;
790
817
  }
791
818
  setFeatures(e) {
792
- Object.assign(this.features, e), e.crosshair === !1 && this.crosshairTooltip.hide(), e.grid !== void 0 && this.engine.requestRender(u.Background), e.volume !== void 0 && (this.volumeRenderer.setVisible(e.volume), this.engine.requestRender(u.Main)), e.drawings === !1 && this.drawingManager.setActiveTool(null), e.trading === !1 && (this.tradingManager.setOrders([]), this.tradingManager.setPositions([])), this.engine.requestRender();
819
+ Object.assign(this.features, e), e.crosshair === !1 && this.crosshairTooltip.hide(), e.grid !== void 0 && this.engine.requestRender(d.Background), e.volume !== void 0 && (this.volumeRenderer.setVisible(e.volume), this.engine.requestRender(d.Main)), e.drawings === !1 && this.drawingManager.setActiveTool(null), e.trading === !1 && (this.tradingManager.setOrders([]), this.tradingManager.setPositions([])), e.keyboard !== void 0 && this.keyboardHandler?.setEnabled(e.keyboard), this.engine.requestRender();
793
820
  }
794
821
  resize() {
795
822
  let e = this.engine.dprManager.readContainerSize();
@@ -801,22 +828,22 @@ var q = class {
801
828
  this.viewport.resize(e.width, e.height), this.layoutManager.resize(e.width, e.height), this.updateViewportAndRender(n), this.eventBus.emit("resize", e);
802
829
  }
803
830
  destroy() {
804
- this.countdownInterval && clearInterval(this.countdownInterval), this.disableAutoSave(), this.disconnectStream(), this.interactionManager.detach(), this.tradingManager.destroy(), this.animator.dispose(), this.crosshairTooltip.destroy(), this.replayManager.dispose(), this.undoRedoManager.clear(), this.engine.destroy(), this.eventBus.destroy(), this.container.innerHTML = "";
831
+ this.countdownInterval && clearInterval(this.countdownInterval), this.disableAutoSave(), this.disconnectStream(), this.onWindowKeyDown &&= (window.removeEventListener("keydown", this.onWindowKeyDown), null), this.keyboardHandler = null, this.interactionManager.detach(), this.tradingManager.destroy(), this.animator.dispose(), this.crosshairTooltip.destroy(), this.replayManager.dispose(), this.undoRedoManager.clear(), this.engine.destroy(), this.eventBus.destroy(), this.container.innerHTML = "";
805
832
  }
806
833
  createChartRenderer(e) {
807
834
  switch (e) {
808
- case "candlestick": return new M();
809
- case "heikinAshi": return new M();
810
- case "line": return new Ne();
811
- case "area": return new T();
812
- case "bar": return new O();
813
- case "hollowCandle": return new De();
814
- case "baseline": return new A();
815
- case "renko": return new ze();
816
- case "lineBreak": return new M();
817
- case "kagi": return new Ae();
818
- case "pointAndFigure": return new Ie();
819
- default: return new M();
835
+ case "candlestick": return new F();
836
+ case "heikinAshi": return new F();
837
+ case "line": return new Ie();
838
+ case "area": return new O();
839
+ case "bar": return new j();
840
+ case "hollowCandle": return new Ae();
841
+ case "baseline": return new N();
842
+ case "renko": return new He();
843
+ case "lineBreak": return new F();
844
+ case "kagi": return new Ne();
845
+ case "pointAndFigure": return new ze();
846
+ default: return new F();
820
847
  }
821
848
  }
822
849
  getDisplayData() {
@@ -826,23 +853,23 @@ var q = class {
826
853
  let t;
827
854
  switch (this.options.chartType) {
828
855
  case "heikinAshi":
829
- t = ht(e);
856
+ t = _t(e);
830
857
  break;
831
858
  case "renko":
832
- t = Ct(e, {
859
+ t = Tt(e, {
833
860
  brickSize: 0,
834
861
  useATR: !0,
835
862
  atrPeriod: 14
836
863
  });
837
864
  break;
838
865
  case "lineBreak":
839
- t = yt(e, 3);
866
+ t = xt(e, 3);
840
867
  break;
841
868
  case "kagi":
842
- t = _t(e, 4);
869
+ t = yt(e, 4);
843
870
  break;
844
871
  case "pointAndFigure":
845
- t = xt(e, e.reduce((e, t) => e + t.close, 0) / e.length * .01, 3);
872
+ t = Ct(e, e.reduce((e, t) => e + t.close, 0) / e.length * .01, 3);
846
873
  break;
847
874
  default: t = e;
848
875
  }
@@ -941,7 +968,8 @@ var q = class {
941
968
  timeAxisY: r,
942
969
  viewport: this.viewport.getState(),
943
970
  theme: this.themeManager.getTheme(),
944
- data: this.getDisplayData()
971
+ data: this.getDisplayData(),
972
+ numberLocale: this.numberLocale
945
973
  });
946
974
  }
947
975
  timeframeToMs(e) {
@@ -970,13 +998,13 @@ var q = class {
970
998
  } : void 0
971
999
  } : null;
972
1000
  }
973
- }, Tt = class extends k {
1001
+ }, Dt = class extends M {
974
1002
  options;
975
1003
  constructor(e, t) {
976
1004
  super(e, t.theme), this.options = t, this.requestRender();
977
1005
  }
978
1006
  renderChart(e, t, n, r) {
979
- ft(e, t, n, this.options, r);
1007
+ mt(e, t, n, this.options, r);
980
1008
  }
981
1009
  update(e) {
982
1010
  this.options = {
@@ -990,7 +1018,7 @@ var q = class {
990
1018
  ...e
991
1019
  }, this.requestRender();
992
1020
  }
993
- }, $ = class extends k {
1021
+ }, Ot = class extends M {
994
1022
  options;
995
1023
  crosshair = null;
996
1024
  constructor(e, t) {
@@ -998,7 +1026,7 @@ var q = class {
998
1026
  }
999
1027
  renderChart(e, t, n, r) {
1000
1028
  let i = this.crosshair?.getPosition() ?? null;
1001
- ct(e, t, n, this.options, r, i);
1029
+ ut(e, t, n, this.options, r, i);
1002
1030
  }
1003
1031
  update(e) {
1004
1032
  this.options = {
@@ -1015,7 +1043,7 @@ var q = class {
1015
1043
  destroy() {
1016
1044
  this.crosshair?.destroy(), super.destroy();
1017
1045
  }
1018
- }, Et = class extends k {
1046
+ }, kt = class extends M {
1019
1047
  options;
1020
1048
  crosshair = null;
1021
1049
  constructor(e, t) {
@@ -1023,7 +1051,7 @@ var q = class {
1023
1051
  }
1024
1052
  renderChart(e, t, n, r) {
1025
1053
  let i = this.crosshair?.getPosition() ?? null;
1026
- lt(e, t, n, this.options, r, i);
1054
+ dt(e, t, n, this.options, r, i);
1027
1055
  }
1028
1056
  update(e, t) {
1029
1057
  this.options = {
@@ -1043,7 +1071,7 @@ var q = class {
1043
1071
  destroy() {
1044
1072
  this.crosshair?.destroy(), super.destroy();
1045
1073
  }
1046
- }, Dt = class extends k {
1074
+ }, At = class extends M {
1047
1075
  options;
1048
1076
  crosshair = null;
1049
1077
  cachedRects = [];
@@ -1064,10 +1092,10 @@ var q = class {
1064
1092
  width: this.width,
1065
1093
  height: this.height
1066
1094
  }, t = this.options.cellPadding ?? 2;
1067
- this.lastLayoutWidth = this.width, this.lastLayoutHeight = this.height, this.options.weighted ? this.cachedRects = at(this.currentData.map((e) => ({
1095
+ this.lastLayoutWidth = this.width, this.lastLayoutHeight = this.height, this.options.weighted ? this.cachedRects = st(this.currentData.map((e) => ({
1068
1096
  id: e.id,
1069
1097
  weight: e.weight ?? (Math.abs(e.value) || 1)
1070
- })), e, t) : this.cachedRects = ot(this.currentData.map((e) => ({ id: e.id })), e, t);
1098
+ })), e, t) : this.cachedRects = ct(this.currentData.map((e) => ({ id: e.id })), e, t);
1071
1099
  }
1072
1100
  onCanvasClick(e, t) {
1073
1101
  if (this.options.onCellClick) for (let n of this.cachedRects) {
@@ -1082,7 +1110,7 @@ var q = class {
1082
1110
  renderChart(e, t, n, r) {
1083
1111
  (t !== this.lastLayoutWidth || n !== this.lastLayoutHeight) && this.recomputeLayout();
1084
1112
  let i = this.crosshair?.getPosition() ?? null;
1085
- dt(e, t, n, this.currentData, this.cachedRects, this.options, r, i);
1113
+ pt(e, t, n, this.currentData, this.cachedRects, this.options, r, i);
1086
1114
  }
1087
1115
  update(e) {
1088
1116
  this.currentData = e, this.options = {
@@ -1099,7 +1127,7 @@ var q = class {
1099
1127
  destroy() {
1100
1128
  this.crosshair?.destroy(), this.handleClick && this.canvas.removeEventListener("click", this.handleClick), super.destroy();
1101
1129
  }
1102
- }, Ot = class extends k {
1130
+ }, jt = class extends M {
1103
1131
  options;
1104
1132
  crosshair = null;
1105
1133
  constructor(e, t) {
@@ -1107,7 +1135,7 @@ var q = class {
1107
1135
  }
1108
1136
  renderChart(e, t, n, r) {
1109
1137
  let i = this.crosshair?.getPosition() ?? null;
1110
- pt(e, t, n, this.options, r, i);
1138
+ ht(e, t, n, this.options, r, i);
1111
1139
  }
1112
1140
  update(e) {
1113
1141
  this.options = {
@@ -1124,12 +1152,12 @@ var q = class {
1124
1152
  destroy() {
1125
1153
  this.crosshair?.destroy(), super.destroy();
1126
1154
  }
1127
- }, kt = 500;
1128
- function At(e) {
1155
+ }, Mt = 500;
1156
+ function Nt(e) {
1129
1157
  let t = 1 - e;
1130
1158
  return 1 - t * t * t;
1131
1159
  }
1132
- var jt = class extends k {
1160
+ var Pt = class extends M {
1133
1161
  options;
1134
1162
  currentValue;
1135
1163
  targetValue;
@@ -1140,7 +1168,7 @@ var jt = class extends k {
1140
1168
  super(e, t.theme), this.options = t, this.currentValue = t.value, this.targetValue = t.value, this.requestRender();
1141
1169
  }
1142
1170
  renderChart(e, t, n, r) {
1143
- ut(e, t, n, this.options, r, this.currentValue);
1171
+ ft(e, t, n, this.options, r, this.currentValue);
1144
1172
  }
1145
1173
  setValue(e) {
1146
1174
  if (this.options.animate === !1) {
@@ -1170,7 +1198,7 @@ var jt = class extends k {
1170
1198
  if (this.animationFrameId !== null) return;
1171
1199
  let e = () => {
1172
1200
  if (this.animationFrameId = null, this.animationStart === null) return;
1173
- let t = this.options.animationDuration ?? kt, n = performance.now() - this.animationStart, r = Math.min(1, n / Math.max(1, t)), i = At(r);
1201
+ let t = this.options.animationDuration ?? Mt, n = performance.now() - this.animationStart, r = Math.min(1, n / Math.max(1, t)), i = Nt(r);
1174
1202
  this.currentValue = this.animationFrom + (this.targetValue - this.animationFrom) * i, this.requestRender(), r < 1 ? this.animationFrameId = requestAnimationFrame(e) : (this.currentValue = this.targetValue, this.animationStart = null);
1175
1203
  };
1176
1204
  this.animationFrameId = requestAnimationFrame(e);
@@ -1183,6 +1211,6 @@ var jt = class extends k {
1183
1211
  }
1184
1212
  };
1185
1213
  //#endregion
1186
- export { x as AlertManager, C as Animator, E as BarCountdown, j as BinanceAdapter, wt as Chart, N as ChartLegend, F as ChartStateManager, L as CompareRenderer, he as CrosshairTooltip, _e as CurrentPriceLine, e as DARK_THEME, n as DEFAULT_DRAWING_STYLE, ye as DEFAULT_LEGEND_CONFIG, i as DEFAULT_RECONNECT, a as DEFAULT_STREAM_CONFIG, o as DEFAULT_TIMEFRAME_FAVORITES, s as DEFAULT_TRADING_CONFIG, be as DataExporter, q as DataManager, $ as DepthChart, xe as DrawingBase, we as Easing, Et as EquityCurveChart, jt as GaugeChart, Dt as HeatmapChart, Oe as IndicatorBase, je as KeyboardHandler, c as LIGHT_THEME, Z as LayoutManager, d as MARKET_CRYPTO, f as MARKET_HNX, ee as MARKET_HOSE, p as MARKET_NYSE, te as MARKET_UPCOM, Pe as MockAdapter, Q as PluginManager, Be as ReplayManager, He as Screenshot, Ue as SessionBreaks, Tt as SparklineChart, Ge as StreamManager, g as TIMEFRAMES_CRYPTO, _ as TIMEFRAMES_FOREX, ne as TIMEFRAMES_STOCK, J as ThemeManager, qe as TickAggregator, Ze as UndoRedoManager, re as VN_COLORS, et as VolumeRenderer, Ot as WaterfallChart, nt as Watermark, ie as computePriceLimits, ae as createVNTheme, oe as formatNumber, se as formatVND, ce as formatVolumeLoc, le as getCurrentSession, ue as getLocale, fe as registerLocale, pe as setLocale, b as t, mt as toHeikinAshi, gt as toKagi, vt as toLineBreak, bt as toPointAndFigure, St as toRenko };
1214
+ export { w as AlertManager, E as Animator, k as BarCountdown, P as BinanceAdapter, Et as Chart, I as ChartLegend, R as ChartStateManager, he as CompareRenderer, ve as CrosshairTooltip, be as CurrentPriceLine, e as DARK_TERMINAL, t as DARK_THEME, r as DEFAULT_DRAWING_STYLE, Se as DEFAULT_LEGEND_CONFIG, a as DEFAULT_RECONNECT, o as DEFAULT_STREAM_CONFIG, s as DEFAULT_TIMEFRAME_FAVORITES, c as DEFAULT_TRADING_CONFIG, Ce as DataExporter, J as DataManager, Ot as DepthChart, we as DrawingBase, De as Easing, kt as EquityCurveChart, Pt as GaugeChart, At as HeatmapChart, je as IndicatorBase, Pe as KeyboardHandler, l as LIGHT_THEME, Q as LayoutManager, f as MARKET_CRYPTO, ee as MARKET_HNX, p as MARKET_HOSE, m as MARKET_NYSE, h as MARKET_UPCOM, Le as MockAdapter, $ as PluginManager, Ue as ReplayManager, We as Screenshot, Ge as SessionBreaks, Dt as SparklineChart, qe as StreamManager, te as TIMEFRAMES_CRYPTO, ne as TIMEFRAMES_FOREX, re as TIMEFRAMES_STOCK, Y as ThemeManager, Ye as TickAggregator, $e as UndoRedoManager, ie as VN_COLORS, nt as VolumeRenderer, jt as WaterfallChart, it as Watermark, ae as computePriceLimits, oe as createVNTheme, se as formatNumber, ce as formatVND, le as formatVolumeLoc, ue as getCurrentSession, de as getLocale, pe as normalizeBar, me as normalizeBarTime, b as registerLocale, x as setLocale, C as t, gt as toHeikinAshi, vt as toKagi, bt as toLineBreak, St as toPointAndFigure, wt as toRenko };
1187
1215
 
1188
1216
  //# sourceMappingURL=index.js.map