@tradecanvas/chart 1.47.0 → 1.48.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/Chart.d.ts.map +1 -1
- package/dist/{LayoutSession-Ccv3vSuZ.js → LayoutSession-DSoR1CO8.js} +4 -4
- package/dist/LayoutSession-DSoR1CO8.js.map +1 -0
- package/dist/LayoutSession-axKXx35N.cjs +2 -0
- package/dist/LayoutSession-axKXx35N.cjs.map +1 -0
- package/dist/frameworks/feedBars.d.ts +37 -0
- package/dist/frameworks/feedBars.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +127 -81
- package/dist/index.js.map +1 -1
- package/dist/widget/index.cjs +2 -2
- package/dist/widget/index.js +81 -81
- package/package.json +3 -3
- package/dist/LayoutSession-Ccv3vSuZ.js.map +0 -1
- package/dist/LayoutSession-DNkU8T33.cjs +0 -2
- package/dist/LayoutSession-DNkU8T33.cjs.map +0 -1
package/dist/widget/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { T as e, a as t, c as n, i as r, n as i, o as a, r as o, t as s } from "../LayoutSession-DSoR1CO8.js";
|
|
2
2
|
import { a as c, c as l, i as u, n as d, o as f, r as p, s as m, t as h } from "../i18n-DjzoHpMJ.js";
|
|
3
3
|
import { CHART_STYLE_KEYS as g, CHART_TYPE_ICONS as _, DARK_THEME as v, DEFAULT_SIGNAL_STYLE as y, DEFAULT_TRADE_ZONE_STYLE as b, DEFAULT_TRADING_CONFIG as x, DRAWING_TOOL_ICONS as ee, LIGHT_THEME as te, PHI as ne, PRICE_SOURCES as re, UI_ICONS as ie, barTimeUnit as ae, formatPrice as oe, iconSvg as se, indicatorSource as ce, isTimeFrame as le, isValidTimeZone as ue, marketStatus as de, offsetAt as fe, parseIndicatorSource as pe, phiStep as me, readChartStyleOverrides as he, readChartTypeOptions as ge, readIndicatorPlotStyles as _e, readNews as ve, readQuote as ye, sanitizeDrawingOptions as be, sanitizeDrawingStyle as xe, stepDecimals as Se, symbolTimeZone as Ce, tickBarCount as we, timeParts as Te, timeframeBucketStart as Ee, timeframeToMs as S, tzLabel as De, wallToUtc as Oe, zoneOffsetMinutes as ke } from "@tradecanvas/commons";
|
|
4
4
|
import { ChartStateManager as Ae, INDICATOR_CATEGORIES as je, INTERVAL_LIMITS as Me, INTERVAL_UNITS as Ne, MAX_ALERT_BARS as Pe, MIN_ALERT_BARS as Fe, RANGE_PRESETS as Ie, SYMBOL_INDICATOR_IDS as Le, indicatorCategory as Re, indicatorValuePrecision as ze, isSeriesPalette as Be, plotColor as Ve, plotShown as He, rangePresetStart as Ue, servesTimeframe as We, sourceParam as Ge, withResampling as Ke } from "@tradecanvas/core";
|
|
@@ -8503,10 +8503,10 @@ var Ms = 0, Ns = class {
|
|
|
8503
8503
|
this.close(), this.backdrop.remove();
|
|
8504
8504
|
}
|
|
8505
8505
|
check() {
|
|
8506
|
-
this.submit.disabled = this.busy ||
|
|
8506
|
+
this.submit.disabled = this.busy || o(this.input.value) === null;
|
|
8507
8507
|
}
|
|
8508
8508
|
async done() {
|
|
8509
|
-
let e = this.request, t =
|
|
8509
|
+
let e = this.request, t = o(this.input.value);
|
|
8510
8510
|
if (!(!e || t === null || this.busy)) {
|
|
8511
8511
|
this.busy = !0, this.check();
|
|
8512
8512
|
try {
|
|
@@ -10442,9 +10442,9 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
|
|
|
10442
10442
|
hostMenus = /* @__PURE__ */ new Set();
|
|
10443
10443
|
hostLayer = null;
|
|
10444
10444
|
priceAxisAddDefault = !1;
|
|
10445
|
-
constructor(e,
|
|
10446
|
-
this.options =
|
|
10447
|
-
let r =
|
|
10445
|
+
constructor(e, t = {}) {
|
|
10446
|
+
this.options = t, this.symbols = t.symbols ?? St;
|
|
10447
|
+
let r = t.chartOptions;
|
|
10448
10448
|
if (this.settingsState = {
|
|
10449
10449
|
...Ct,
|
|
10450
10450
|
...r?.numberLocale ? { numberLocale: r.numberLocale } : {},
|
|
@@ -10453,23 +10453,23 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
|
|
|
10453
10453
|
...r?.highLowLines === void 0 ? {} : { highLowLines: r.highLowLines },
|
|
10454
10454
|
...r?.extendedHours === void 0 ? {} : { extendedHours: r.extendedHours },
|
|
10455
10455
|
...r?.chartTypeOptions ? { chartTypeOptions: ge(r.chartTypeOptions) } : {}
|
|
10456
|
-
}, this.t = d(f(
|
|
10457
|
-
let e =
|
|
10456
|
+
}, this.t = d(f(t.locale, t.messages)), this.featureState = qt(t), t.persistLayouts) {
|
|
10457
|
+
let e = t.persistLayouts === !0 ? {} : t.persistLayouts;
|
|
10458
10458
|
this.layoutKeyPrefix = e.keyPrefix ?? "tcw:layout:", this.layoutDebounceMs = e.debounceMs ?? 1500;
|
|
10459
10459
|
}
|
|
10460
|
-
let
|
|
10460
|
+
let i = this.resolveIsDark(t.theme), o = this.resolveTheme(t.theme);
|
|
10461
10461
|
this.themeOf = {
|
|
10462
10462
|
...this.themeOf,
|
|
10463
|
-
[
|
|
10463
|
+
[i ? "dark" : "light"]: o
|
|
10464
10464
|
};
|
|
10465
10465
|
let s = {
|
|
10466
10466
|
drawings: !0,
|
|
10467
10467
|
drawingMagnet: !0,
|
|
10468
10468
|
drawingUndoRedo: !0,
|
|
10469
10469
|
indicators: !0,
|
|
10470
|
-
trading:
|
|
10470
|
+
trading: t.trading !== !1,
|
|
10471
10471
|
tradingContextMenu: !1,
|
|
10472
|
-
priceAxisAddButton: this.featureState.alerts ||
|
|
10472
|
+
priceAxisAddButton: this.featureState.alerts || t.trading !== !1 || this.featureState.sidebar,
|
|
10473
10473
|
volume: !0,
|
|
10474
10474
|
legend: !0,
|
|
10475
10475
|
crosshair: !0,
|
|
@@ -10480,7 +10480,7 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
|
|
|
10480
10480
|
barCountdown: !0,
|
|
10481
10481
|
logScale: !0,
|
|
10482
10482
|
watermark: !0,
|
|
10483
|
-
...
|
|
10483
|
+
...t.chartOptions?.features
|
|
10484
10484
|
};
|
|
10485
10485
|
this.priceAxisAddDefault = s.priceAxisAddButton === !0;
|
|
10486
10486
|
let c = {
|
|
@@ -10492,16 +10492,16 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
|
|
|
10492
10492
|
legendVisible: s.legend !== !1,
|
|
10493
10493
|
barCountdown: s.barCountdown !== !1,
|
|
10494
10494
|
indicatorValueLabels: s.indicatorValueLabels === !0
|
|
10495
|
-
}, this.settingsState = { ...this.settingsDefaults }, this.timeframes = Ln(jn(
|
|
10496
|
-
let e = Mn(this.timeframes, s.defaultTimeframeFavorites, !!
|
|
10495
|
+
}, this.settingsState = { ...this.settingsDefaults }, this.timeframes = Ln(jn(t.timeframes, s.timeframes), this.customTimeframes.list(), s.timeframes), !this.timeframes.some((e) => this.timeframeFavorites.has(e))) {
|
|
10496
|
+
let e = Mn(this.timeframes, s.defaultTimeframeFavorites, !!t.timeframes?.length);
|
|
10497
10497
|
for (let t of e) this.timeframeFavorites.add(t);
|
|
10498
10498
|
}
|
|
10499
|
-
let l =
|
|
10499
|
+
let l = t.timeframe ?? "5m", u = !s.timeframes?.length || s.timeframes.includes(l) ? l : this.timeframes[0] ?? l;
|
|
10500
10500
|
this.state = {
|
|
10501
|
-
symbol:
|
|
10501
|
+
symbol: t.symbol ?? this.symbols[0] ?? "BTCUSDT",
|
|
10502
10502
|
timeframe: u,
|
|
10503
|
-
chartType:
|
|
10504
|
-
isDark:
|
|
10503
|
+
chartType: t.chartOptions?.chartType ?? "candlestick",
|
|
10504
|
+
isDark: i,
|
|
10505
10505
|
activeIndicators: /* @__PURE__ */ new Map(),
|
|
10506
10506
|
activeTool: null,
|
|
10507
10507
|
magnetEnabled: s.drawingMagnet !== !1,
|
|
@@ -10509,14 +10509,14 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
|
|
|
10509
10509
|
eraser: !1,
|
|
10510
10510
|
zoomArea: !1,
|
|
10511
10511
|
stayInDrawing: !1,
|
|
10512
|
-
connectionState:
|
|
10513
|
-
connectionMessage:
|
|
10514
|
-
}, an(), this.root = document.createElement("div"), this.root.className = "tcw-root", this.root.dataset.tcwTheme =
|
|
10515
|
-
let m =
|
|
10512
|
+
connectionState: t.adapter ? "connecting" : "disconnected",
|
|
10513
|
+
connectionMessage: t.adapter ? this.t("status.connecting") : ""
|
|
10514
|
+
}, an(), this.root = document.createElement("div"), this.root.className = "tcw-root", this.root.dataset.tcwTheme = i ? "dark" : "light";
|
|
10515
|
+
let m = t.dir === "ltr" || t.dir === "rtl" ? t.dir : ql(t.locale) ? "rtl" : "ltr";
|
|
10516
10516
|
this.root.dir = m, this.portal.dir = m, e.appendChild(this.root), this.tooltip = new yc(this.root), this.portal.className = "tcw-root tcw-portal", this.portal.dataset.tcwTheme = this.root.dataset.tcwTheme, this.stopKeyboardInset = $s([this.root, this.portal]), this.stopNarrow = ec(this.root, (e) => {
|
|
10517
10517
|
this.toolbar?.fit(), e || this.sidebar?.closeOverlay(), this.syncRail();
|
|
10518
|
-
}), this.ui = G(
|
|
10519
|
-
let h =
|
|
10518
|
+
}), this.ui = G(t.ui);
|
|
10519
|
+
let h = t.ui !== void 0;
|
|
10520
10520
|
K(this.root, this.ui, { variables: h }), K(this.portal, this.ui, { variables: h }), this.markSwitchedOff(), this.stopFormControls = yt([this.root, this.portal], {
|
|
10521
10521
|
layer: this.overlayHost,
|
|
10522
10522
|
labels: () => ({
|
|
@@ -10529,7 +10529,7 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
|
|
|
10529
10529
|
symbols: this.symbols,
|
|
10530
10530
|
timeframes: this.timeframeMenu(),
|
|
10531
10531
|
timeframeFavorites: this.pinnedTimeframes(),
|
|
10532
|
-
chartTypes:
|
|
10532
|
+
chartTypes: t.chartTypes ? bt.filter((e) => t.chartTypes.includes(e.value)) : bt
|
|
10533
10533
|
}, {
|
|
10534
10534
|
onSymbolClick: () => this.handleSymbolClick(),
|
|
10535
10535
|
onSymbolInfo: () => this.toggleSymbolInfo(),
|
|
@@ -10545,18 +10545,18 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
|
|
|
10545
10545
|
onToggleReplay: () => this.toggleReplay(),
|
|
10546
10546
|
onToggleAlerts: () => this.toggleAlerts(),
|
|
10547
10547
|
onToggleObjects: () => this.toggleObjects(),
|
|
10548
|
-
onToggleAccount:
|
|
10549
|
-
onLayouts:
|
|
10550
|
-
onBracket:
|
|
10551
|
-
onToggleLadder:
|
|
10552
|
-
onOrderTicket:
|
|
10553
|
-
onCompare:
|
|
10548
|
+
onToggleAccount: t.trading === !1 ? void 0 : () => this.toggleAccountPanel(),
|
|
10549
|
+
onLayouts: t.layouts === !1 ? void 0 : (e) => void this.layoutsUI?.openMenu(e),
|
|
10550
|
+
onBracket: t.trading === !1 ? void 0 : (e) => this.startBracket(e),
|
|
10551
|
+
onToggleLadder: t.trading !== !1 && t.depthLadder ? () => this.toggleLadder() : void 0,
|
|
10552
|
+
onOrderTicket: t.trading === !1 ? void 0 : () => this.openOrderTicket(),
|
|
10553
|
+
onCompare: t.adapter && s.compareSymbols !== !1 ? () => this.handleAddCompare() : void 0,
|
|
10554
10554
|
onUndo: () => this.chart.undo(),
|
|
10555
10555
|
onRedo: () => this.chart.redo(),
|
|
10556
10556
|
onToggleFullscreen: typeof document < "u" && document.fullscreenEnabled ? () => this.toggleFullscreen() : void 0
|
|
10557
10557
|
}, this.t, this.overlayHost);
|
|
10558
10558
|
let g = document.createElement("div");
|
|
10559
|
-
g.className = "tcw-body",
|
|
10559
|
+
g.className = "tcw-body", t.drawingFavorites && this.favoritesStore.seedDefaults(t.drawingFavorites), this.sidebar = new ar(g, {
|
|
10560
10560
|
drawingToolGroups: wn(xt, this.t),
|
|
10561
10561
|
favorites: this.favoritesStore.list(),
|
|
10562
10562
|
shortcuts: ki()
|
|
@@ -10594,9 +10594,9 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
|
|
|
10594
10594
|
railShown: () => this.railShown(),
|
|
10595
10595
|
focusAfterClose: (e) => this.panelFocusTarget(e),
|
|
10596
10596
|
room: () => g.clientWidth
|
|
10597
|
-
}),
|
|
10597
|
+
}), t.watchlist && this.createWatchlist(g, t.watchlist === !0 ? {} : t.watchlist), this.root.appendChild(g);
|
|
10598
10598
|
let _ = document.createElement("div");
|
|
10599
|
-
_.className = "tcw-account-dock", k(_, "accountPanel"), this.root.appendChild(_), this.chart = new
|
|
10599
|
+
_.className = "tcw-account-dock", k(_, "accountPanel"), this.root.appendChild(_), this.chart = new n(this.chartContainer, {
|
|
10600
10600
|
chartType: this.state.chartType,
|
|
10601
10601
|
theme: o,
|
|
10602
10602
|
autoScale: !0,
|
|
@@ -10613,9 +10613,9 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
|
|
|
10613
10613
|
return n === t ? e : n;
|
|
10614
10614
|
}
|
|
10615
10615
|
} },
|
|
10616
|
-
...
|
|
10616
|
+
...t.chartOptions,
|
|
10617
10617
|
features: c
|
|
10618
|
-
}),
|
|
10618
|
+
}), t.chartOptions?.shapes || this.applyChartShapes(), this.applyLegendFont();
|
|
10619
10619
|
for (let [e, t] of this.indicatorDefaults.all()) this.chart.setIndicatorDefaults(e, t.style);
|
|
10620
10620
|
this.chart.on("visibleRangeChange", (e) => {
|
|
10621
10621
|
let { from: t, to: n } = e.payload;
|
|
@@ -10636,7 +10636,7 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
|
|
|
10636
10636
|
}
|
|
10637
10637
|
}), this.marketTimer = setInterval(() => this.refreshMarket(), 3e4), this.onPageShown = () => {
|
|
10638
10638
|
Pl() || this.refreshMarket();
|
|
10639
|
-
}, document.addEventListener("visibilitychange", this.onPageShown), this.dragDrop = new
|
|
10639
|
+
}, document.addEventListener("visibilitychange", this.onPageShown), this.dragDrop = new a(this.chartContainer, {
|
|
10640
10640
|
onData: (e, t, n) => {
|
|
10641
10641
|
this.setData(e);
|
|
10642
10642
|
let r = p(this.t("toast.fileLoaded"), {
|
|
@@ -10902,7 +10902,7 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
|
|
|
10902
10902
|
title: this.t("interval.title"),
|
|
10903
10903
|
hint: this.t("interval.hint"),
|
|
10904
10904
|
invalid: this.t("interval.invalid")
|
|
10905
|
-
}, (e) => this.selectTypedTimeframe(e)),
|
|
10905
|
+
}, (e) => this.selectTypedTimeframe(e)), t.layouts !== !1 && this.setupLayouts(t.layouts === !0 || t.layouts === void 0 ? {} : t.layouts), t.trading !== !1) {
|
|
10906
10906
|
this.orderTicket = new Os(this.root, {
|
|
10907
10907
|
onSubmit: (e) => {
|
|
10908
10908
|
this.chart.placeOrderIntent(e), this.say(p(this.t("ticket.sent"), {
|
|
@@ -10938,7 +10938,7 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
|
|
|
10938
10938
|
"indicatorUpdate"
|
|
10939
10939
|
]) this.chart.on(e, () => this.refreshAccountSoon());
|
|
10940
10940
|
}
|
|
10941
|
-
if (
|
|
10941
|
+
if (t.trading !== !1) {
|
|
10942
10942
|
if (this.bracketBar = new Nc(this.chartContainer, {
|
|
10943
10943
|
onConfirm: () => this.chart.confirmBracket(),
|
|
10944
10944
|
onCancel: () => {
|
|
@@ -10947,7 +10947,7 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
|
|
|
10947
10947
|
}, this.t), this.chart.on("bracketPlace", (e) => {
|
|
10948
10948
|
let t = e.payload;
|
|
10949
10949
|
this.bracketBar?.hide(), this.say(p(this.t(t.side === "buy" ? "bracket.longPlaced" : "bracket.shortPlaced"), { rr: t.riskReward.toFixed(2) }));
|
|
10950
|
-
}),
|
|
10950
|
+
}), t.depthLadder) {
|
|
10951
10951
|
this.depthLadder = new Lc(this.root, {
|
|
10952
10952
|
onTrade: (e, t) => {
|
|
10953
10953
|
this.chart.placeOrderIntent({
|
|
@@ -10988,7 +10988,7 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
|
|
|
10988
10988
|
}, this.t), this.chart.on("alertAdd", () => this.refreshAlerts()), this.chart.on("alertRemove", () => this.refreshAlerts()), this.chart.on("alertUpdate", () => this.refreshAlerts()), this.chart.on("alertExpired", (e) => {
|
|
10989
10989
|
let t = e.payload;
|
|
10990
10990
|
this.refreshAlerts(), this.featureState.alerts && this.say(p(this.t("alerts.expiredToast"), { text: t.message ?? this.alertText(t) }));
|
|
10991
|
-
}),
|
|
10991
|
+
}), t.alertNotifications && (this.alertNotifier = new Pc(t.alertNotifications)), this.chart.on("alertTriggered", (e) => {
|
|
10992
10992
|
let t = e.payload;
|
|
10993
10993
|
if (this.refreshAlerts(), !this.featureState.alerts) return;
|
|
10994
10994
|
let n = `${this.alertText(t)}${t.message ? ` — ${t.message}` : ""}`;
|
|
@@ -11107,11 +11107,11 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
|
|
|
11107
11107
|
if (X() || !t || !n("hotkeys.help") || !this.featureState.hotkeySheet) return;
|
|
11108
11108
|
e.preventDefault(), this.openHotkeySheet();
|
|
11109
11109
|
}
|
|
11110
|
-
}, document.addEventListener("keydown", this.boundGlobalKeydown), document.addEventListener("fullscreenchange", this.onFullscreenChange), this.unregisterKeys = Ws(this.root, [this.portal]),
|
|
11110
|
+
}, document.addEventListener("keydown", this.boundGlobalKeydown), document.addEventListener("fullscreenchange", this.onFullscreenChange), this.unregisterKeys = Ws(this.root, [this.portal]), t.adapter ? (this.adapter = t.adapter, this.connectStream()) : this.chart.setDataTimeframe(this.state.timeframe), this.watchlist && (this.watchlistInterval = setInterval(() => this.tickWatchlist(), 1e3)), this.markSwitchedOff(), requestAnimationFrame(() => {
|
|
11111
11111
|
this.destroyed || (this.toolbar?.tidy(), this.sidebar?.tidy());
|
|
11112
11112
|
}), this.refreshMarket(), this.updateUI(), queueMicrotask(() => {
|
|
11113
11113
|
if (!this.destroyed) try {
|
|
11114
|
-
|
|
11114
|
+
t.onReady?.(this.chart, this);
|
|
11115
11115
|
} finally {
|
|
11116
11116
|
this.destroyed || this.restoreSharedView();
|
|
11117
11117
|
}
|
|
@@ -12923,7 +12923,7 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
|
|
|
12923
12923
|
return t ? (await this.restoreLayout(t), !0) : !1;
|
|
12924
12924
|
}
|
|
12925
12925
|
setupLayouts(e) {
|
|
12926
|
-
let t = new
|
|
12926
|
+
let t = new s(e.storage ?? r(), {
|
|
12927
12927
|
capture: () => ({
|
|
12928
12928
|
content: this.getLayoutContent(),
|
|
12929
12929
|
symbol: this.state.symbol,
|
|
@@ -12980,14 +12980,14 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
|
|
|
12980
12980
|
}
|
|
12981
12981
|
}
|
|
12982
12982
|
syncIndicatorsFromChart() {
|
|
12983
|
-
let
|
|
12984
|
-
for (let
|
|
12985
|
-
id:
|
|
12986
|
-
label:
|
|
12983
|
+
let t = /* @__PURE__ */ new Map();
|
|
12984
|
+
for (let n of this.chart.getActiveIndicators()) t.set(n.instanceId, {
|
|
12985
|
+
id: n.id,
|
|
12986
|
+
label: e(n.id, n.params, n.descriptor.defaultConfig, n.descriptor.shortName)
|
|
12987
12987
|
});
|
|
12988
12988
|
this.state = {
|
|
12989
12989
|
...this.state,
|
|
12990
|
-
activeIndicators:
|
|
12990
|
+
activeIndicators: t
|
|
12991
12991
|
}, this.updateUI(), this.indicatorPicker?.setCounts(this.indicatorCounts());
|
|
12992
12992
|
}
|
|
12993
12993
|
toggleIndicatorPicker() {
|
|
@@ -13287,29 +13287,29 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
|
|
|
13287
13287
|
}
|
|
13288
13288
|
renderLegend() {
|
|
13289
13289
|
if (!this.indicatorLegend || this.destroyed) return;
|
|
13290
|
-
let
|
|
13291
|
-
for (let e of this.chart.getIndicatorPanes()) (e.instanceIds ?? [e.instanceId]).forEach((t, n) =>
|
|
13290
|
+
let t = this.chart.getData().length - 1, n = this.chart.isTimeAligned() ? this.legendHoverIndex : null, r = n === null ? t : Math.min(Math.max(n, 0), t), i = /* @__PURE__ */ new Map();
|
|
13291
|
+
for (let e of this.chart.getIndicatorPanes()) (e.instanceIds ?? [e.instanceId]).forEach((t, n) => i.set(t, {
|
|
13292
13292
|
...e.rect,
|
|
13293
13293
|
row: n
|
|
13294
13294
|
}));
|
|
13295
|
-
let
|
|
13296
|
-
let
|
|
13295
|
+
let a = this.settingsState.numberLocale || "en-US", o = this.chart.getActiveIndicators().map((t) => {
|
|
13296
|
+
let n = i.get(t.instanceId) ?? null, o = r >= 0 ? this.chart.getIndicatorOutput(t.instanceId)?.series?.[r] : null, s = this.chart.getIndicatorStyle(t.instanceId), c = t.visible && t.shown === !1, l = c ? [] : kc(t.descriptor, o, s?.colors ?? [], s?.plots);
|
|
13297
13297
|
return {
|
|
13298
|
-
instanceId:
|
|
13299
|
-
label:
|
|
13300
|
-
visible:
|
|
13298
|
+
instanceId: t.instanceId,
|
|
13299
|
+
label: e(t.id, t.params, t.descriptor.defaultConfig, t.descriptor.shortName),
|
|
13300
|
+
visible: t.visible,
|
|
13301
13301
|
offInterval: c,
|
|
13302
13302
|
values: l.map((e) => ({
|
|
13303
|
-
text:
|
|
13303
|
+
text: n ? Mc(e.value, a) : this.chart.formatPrice(e.value),
|
|
13304
13304
|
color: e.color
|
|
13305
13305
|
})),
|
|
13306
|
-
pane:
|
|
13307
|
-
x:
|
|
13308
|
-
y:
|
|
13309
|
-
width:
|
|
13306
|
+
pane: n ? {
|
|
13307
|
+
x: n.x + wl,
|
|
13308
|
+
y: n.y + Math.min(Tl + n.row * El, Math.max(Tl, n.height - El)),
|
|
13309
|
+
width: n.width - 2 * wl
|
|
13310
13310
|
} : null
|
|
13311
13311
|
};
|
|
13312
|
-
}),
|
|
13312
|
+
}), s = this.chart.getPlotRect(), c = this.chart.getMaximizedPane(), l = (e) => o.find((t) => t.instanceId === e)?.label ?? "", u = this.chart.getIndicatorPanes().map((e) => ({
|
|
13313
13313
|
instanceId: e.instanceId,
|
|
13314
13314
|
x: e.rect.x + e.rect.width - wl,
|
|
13315
13315
|
y: e.rect.y + Dl,
|
|
@@ -13319,8 +13319,8 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
|
|
|
13319
13319
|
canMoveUp: this.chart.canMovePane(e.instanceId, -1),
|
|
13320
13320
|
canMoveDown: this.chart.canMovePane(e.instanceId, 1)
|
|
13321
13321
|
}));
|
|
13322
|
-
this.indicatorLegend.update(
|
|
13323
|
-
left:
|
|
13322
|
+
this.indicatorLegend.update(o, {
|
|
13323
|
+
left: s.x + wl,
|
|
13324
13324
|
top: this.chart.getLegendBottom() + 1
|
|
13325
13325
|
}, u);
|
|
13326
13326
|
}
|
|
@@ -13395,28 +13395,28 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
|
|
|
13395
13395
|
return !0;
|
|
13396
13396
|
}
|
|
13397
13397
|
};
|
|
13398
|
-
function Ll(
|
|
13399
|
-
let
|
|
13398
|
+
function Ll(t, n) {
|
|
13399
|
+
let r = (e) => {
|
|
13400
13400
|
let t = Ge(e.descriptor);
|
|
13401
13401
|
return t && pe(e.params[t])?.instanceId || null;
|
|
13402
|
-
},
|
|
13402
|
+
}, i = new Set([t]);
|
|
13403
13403
|
for (let e = !0; e;) {
|
|
13404
13404
|
e = !1;
|
|
13405
|
-
for (let
|
|
13406
|
-
let
|
|
13407
|
-
|
|
13405
|
+
for (let t of n) {
|
|
13406
|
+
let n = r(t);
|
|
13407
|
+
n && i.has(n) && !i.has(t.instanceId) && (i.add(t.instanceId), e = !0);
|
|
13408
13408
|
}
|
|
13409
13409
|
}
|
|
13410
|
-
let
|
|
13411
|
-
for (let
|
|
13412
|
-
if (
|
|
13413
|
-
let
|
|
13414
|
-
for (let
|
|
13415
|
-
value: ce(
|
|
13416
|
-
label: `${
|
|
13410
|
+
let a = [];
|
|
13411
|
+
for (let t of n) {
|
|
13412
|
+
if (i.has(t.instanceId)) continue;
|
|
13413
|
+
let n = e(t.id, t.params, t.descriptor.defaultConfig, t.descriptor.shortName);
|
|
13414
|
+
for (let e of t.descriptor.plots ?? []) a.push({
|
|
13415
|
+
value: ce(t.instanceId, e.key),
|
|
13416
|
+
label: `${n}: ${e.title}`
|
|
13417
13417
|
});
|
|
13418
13418
|
}
|
|
13419
|
-
return
|
|
13419
|
+
return a;
|
|
13420
13420
|
}
|
|
13421
13421
|
var Rl = "tcw:recentCommands", zl = 10;
|
|
13422
13422
|
function Bl() {
|
|
@@ -13913,7 +13913,7 @@ var tu = class {
|
|
|
13913
13913
|
e.innerHTML = `${A("save", 14)}<span class="tcw-layouts-label">${j(t)}</span>` + (n ? "<span class=\"tcw-layouts-dirty\" aria-hidden=\"true\"></span>" : "") + A("chevronDown", 12), e.title = r, e.setAttribute("aria-label", r);
|
|
13914
13914
|
}
|
|
13915
13915
|
setupLayouts(e) {
|
|
13916
|
-
let t = new
|
|
13916
|
+
let t = new s(e.storage ?? r("tcw:grid-layouts:"), {
|
|
13917
13917
|
capture: () => {
|
|
13918
13918
|
let e = this.cells[this.active].widget;
|
|
13919
13919
|
return {
|
|
@@ -13952,6 +13952,6 @@ function nu(e, t) {
|
|
|
13952
13952
|
return n;
|
|
13953
13953
|
}
|
|
13954
13954
|
//#endregion
|
|
13955
|
-
export { _ as CHART_TYPE_ICONS, Il as ChartWidget, tu as ChartWidgetGrid, Jl as DEFAULT_GRID_SYNC, ee as DRAWING_TOOL_ICONS, l as EN_MESSAGES, Xl as GRID_SHAPES,
|
|
13955
|
+
export { _ as CHART_TYPE_ICONS, Il as ChartWidget, tu as ChartWidgetGrid, Jl as DEFAULT_GRID_SYNC, ee as DRAWING_TOOL_ICONS, l as EN_MESSAGES, Xl as GRID_SHAPES, s as LayoutSession, i as MAX_LAYOUT_NAME, ie as UI_ICONS, m as VI_MESSAGES, Bt as WIDGET_FEATURES, $i as WIDGET_UI_PRESETS, K as applyWidgetUI, o as cleanLayoutName, ln as createChartTypeIcon, A as createIcon, cn as createToolIcon, u as findWidgetLocale, se as iconSvg, r as localStorageLayouts, t as memoryLayouts, eu as readGridLayout, hi as readWatchlists, Ys as readWidgetLayout, c as registerWidgetLocale, G as resolveWidgetUI, sa as widgetUIVariables };
|
|
13956
13956
|
|
|
13957
13957
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tradecanvas/chart",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.48.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "High-performance canvas trading chart with built-in indicators, drawing tools, and real-time streaming. Zero external dependencies.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"README.md"
|
|
59
59
|
],
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@tradecanvas/commons": "1.
|
|
62
|
-
"@tradecanvas/core": "1.
|
|
61
|
+
"@tradecanvas/commons": "1.48.0",
|
|
62
|
+
"@tradecanvas/core": "1.48.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"jsdom": "^25.0.1",
|