@tradecanvas/chart 2.0.0-beta.6 → 2.0.0-beta.7
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 +1 -1
- package/dist/{LayoutSession-DQJfGsbB.cjs → LayoutSession-BUu4LoTv.cjs} +2 -2
- package/dist/LayoutSession-BUu4LoTv.cjs.map +1 -0
- package/dist/{LayoutSession-Cxugmqz-.js → LayoutSession-Bz7tzIRR.js} +2 -2
- package/dist/LayoutSession-Bz7tzIRR.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +80 -80
- package/dist/widget/index.cjs +2 -2
- package/dist/widget/index.cjs.map +1 -1
- package/dist/widget/index.js +1042 -1042
- package/dist/widget/index.js.map +1 -1
- package/dist/widget/widgetUI.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/LayoutSession-Cxugmqz-.js.map +0 -1
- package/dist/LayoutSession-DQJfGsbB.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as e, C as t, D as n, E as r, M as i, N as a, O as o, S as s, T as c, a as l, b as u, c as d, d as f, f as p, g as ee, h as m, i as te, j as ne, k as re, l as h, m as ie, n as ae, p as oe, r as se, s as g, t as ce, w as le, x as ue, y as de } from "./LayoutSession-
|
|
2
|
-
import { CHART_SPACING as fe, CHART_STYLE_KEYS as pe, DARK_PRICE_LIMITS as me, DARK_TERMINAL as he, DARK_THEME as ge, DEFAULT_DRAWING_STYLE as _e,
|
|
3
|
-
import { AlertManager as
|
|
1
|
+
import { A as e, C as t, D as n, E as r, M as i, N as a, O as o, S as s, T as c, a as l, b as u, c as d, d as f, f as p, g as ee, h as m, i as te, j as ne, k as re, l as h, m as ie, n as ae, p as oe, r as se, s as g, t as ce, w as le, x as ue, y as de } from "./LayoutSession-Bz7tzIRR.js";
|
|
2
|
+
import { CHART_SPACING as fe, CHART_STYLE_KEYS as pe, DARK_PRICE_LIMITS as me, DARK_TERMINAL as he, DARK_THEME as ge, DEFAULT_DRAWING_STYLE as _e, DEFAULT_RECONNECT as ve, DEFAULT_SIGNAL_STYLE as ye, DEFAULT_STREAM_CONFIG as be, DEFAULT_TIMEFRAME_FAVORITES as xe, DEFAULT_TRADE_ZONE_STYLE as Se, DEFAULT_TRADING_CONFIG as Ce, FIGURES_FONT_FAMILY as we, HNX_SESSIONS as Te, HOSE_SESSIONS as Ee, KRX_SESSIONS as De, KR_COLORS as Oe, LIGHT_PRICE_LIMITS as ke, LIGHT_THEME as Ae, MARKET_CRYPTO as je, MARKET_HNX as Me, MARKET_HOSE as Ne, MARKET_HOSE_ETF as Pe, MARKET_KRX as Fe, MARKET_NXT as Ie, MARKET_NYSE as Le, MARKET_UPBIT_KRW as Re, MARKET_UPCOM as ze, MARKET_VN30F as Be, MONO_FONT_FAMILY as Ve, MS_TIME_THRESHOLD as He, NXT_SESSIONS as Ue, PRICE_SOURCES as We, SANS_FONT_FAMILY as Ge, TC_PALETTE as Ke, TC_SERIES_COLORS as qe, TIMEFRAMES_CRYPTO as Je, TIMEFRAMES_FOREX as Ye, TIMEFRAMES_STOCK as Xe, UPCOM_SESSIONS as Ze, VN30F_SESSIONS as Qe, VN_COLORS as $e, VOLUME_ALPHA as et, barTimeUnit as tt, barsAreDaily as nt, computePriceLimits as rt, contrastRatio as it, createMarketTheme as at, createVNTheme as ot, formatFraction as st, formatNumber as ct, formatVND as lt, formatVolumeLoc as ut, fractionTick as dt, getCurrentSession as ft, getLocale as pt, indicatorSource as mt, inkOn as ht, isPriceSource as gt, isTimeFrame as _t, isValidTimeZone as vt, marketStatus as yt, normalizeBar as bt, normalizeBarTime as xt, offsetAt as St, parseIndicatorSource as Ct, parseTimeframe as wt, pickBaseTimeframe as Tt, priceFormatterFor as Et, priceStepAt as Dt, rankSymbols as Ot, readNews as kt, readQuote as At, readableOn as jt, registerLocale as Mt, resampleBars as Nt, roundToPriceStep as Pt, scaleMarketPrices as Ft, setLocale as It, sourcePrice as Lt, stepDecimals as Rt, symbolTimeZone as zt, t as Bt, tickBarCount as Vt, tickerOf as Ht, timeframeBucketStart as Ut, timeframeBucketStart as Wt, timeframeToMs as Gt, usesKoreanUnits as Kt, vn30fContracts as qt, vn30fLastTradingDay as Jt, volumeColor as Yt, wallToUtc as Xt, zoneOffsetMinutes as Zt } from "@tradecanvas/commons";
|
|
3
|
+
import { AlertManager as Qt, Animator as $t, BarCountdown as en, BaseFinanceChart as _, BinanceAdapter as tn, BybitAdapter as nn, CANDLE_PATTERNS as rn, ChartLegend as an, ChartStateManager as on, CoinbaseAdapter as sn, CompareRenderer as cn, CrosshairTooltip as ln, CurrentPriceLine as un, DEFAULT_LEGEND_CONFIG as dn, DEFAULT_MAX_WEBGL_CHARTS as fn, DEFAULT_SESSION_HOURS as pn, DataExporter as mn, DrawingBase as hn, Easing as gn, FinanceCrosshair as v, GROUP_HEADER as _n, INDICATOR_CATEGORIES as vn, IndicatorBase as yn, IndicatorValueMap as bn, KEPT_BUCKETS as xn, KeyboardHandler as Sn, KrakenAdapter as Cn, MAX_ALERT_BARS as wn, MIN_ALERT_BARS as Tn, ManualFeed as En, MockAdapter as Dn, PaperExecutionAdapter as On, PollingAdapter as kn, RANGE_PRESETS as An, ReconnectManager as jn, ReplayController as Mn, ReplayManager as Nn, ResamplingAdapter as Pn, ReshapeMemo as Fn, Screenshot as In, SessionBreaks as Ln, SessionShading as Rn, SignalMarkerManager as zn, StreamManager as Bn, TickAggregator as Vn, TickBarAdapter as Hn, TickBarBuilder as Un, TradeZoneManager as Wn, UndoRedoManager as Gn, UpbitAdapter as Kn, VolumeRenderer as qn, Watermark as Jn, WebSocketAdapter as Yn, adapterFromFeed as Xn, axisTimes as Zn, barIndexToTime as Qn, barIndexToX as $n, barIndexToX as y, canvasMeasure as er, computeBarLayout as tr, computeCalendarLayout as nr, computeCounterClockLayout as rr, computeDonutLayout as ir, computeHistogramLayout as ar, computeMatrixLayout as or, computeScatterLayout as sr, correlationMatrix as cr, counterClockPhase as lr, counterClockPhase as ur, counterClockPoints as dr, counterClockPoints as fr, describeInputs as pr, detectCandlePatterns as mr, feedFromAdapter as hr, financeTheme as b, formatTooltipTime as gr, histogramBins as _r, hitBar as x, hitDay as S, hitMatrixCell as C, hitSlice as w, indicatorCategory as vr, isDataFeed as yr, isDataFeed as br, isPriceLevelAlert as xr, layoutGroupedTreemap as Sr, layoutSquarifiedTreemap as Cr, layoutUniformGrid as wr, lttbDownsample as Tr, lttbVisibleIndices as Er, nearestCounterClockPoint as T, nearestPoint as E, niceScale as Dr, priceToY as Or, priceToYMapper as kr, priceToYMapper as Ar, rangePresetStart as jr, renderBarChart as Mr, renderCalendar as Nr, renderCounterClock as Pr, renderDepthChart as Fr, renderDonut as Ir, renderEquityCurve as Lr, renderGauge as Rr, renderHeatmap as zr, renderHistogram as Br, renderMatrix as Vr, renderScatter as Hr, renderSparkline as Ur, renderWaterfall as Wr, servesTimeframe as Gr, setMaxWebGLCharts as Kr, shownCount as qr, timeToX as Jr, timestampToBarIndex as Yr, timestampToBarIndex as Xr, toHeikinAshi as Zr, toKagi as Qr, toLineBreak as $r, toPointAndFigure as ei, toRangeBars as ti, toRenko as ni, withResampling as ri, withTickBars as ii, xToBarIndex as ai, xToBarIndex as D, xToTime as oi, yToPrice as si, yToPrice as ci } from "@tradecanvas/core";
|
|
4
4
|
//#region src/frameworks/syncIndicators.ts
|
|
5
|
-
function
|
|
5
|
+
function li(e) {
|
|
6
6
|
let { id: t, params: n = {}, position: r = null } = typeof e == "string" ? { id: e } : e;
|
|
7
7
|
return JSON.stringify([
|
|
8
8
|
t,
|
|
@@ -10,9 +10,9 @@ function ci(e) {
|
|
|
10
10
|
r
|
|
11
11
|
]);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function ui(e, t, n) {
|
|
14
14
|
let r = /* @__PURE__ */ new Map(), i = t.map((e) => {
|
|
15
|
-
let t =
|
|
15
|
+
let t = li(e), n = r.get(t) ?? 0;
|
|
16
16
|
return r.set(t, n + 1), {
|
|
17
17
|
spec: e,
|
|
18
18
|
key: `${t}#${n}`
|
|
@@ -27,7 +27,7 @@ function li(e, t, n) {
|
|
|
27
27
|
}
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region src/frameworks/feedBars.ts
|
|
30
|
-
var
|
|
30
|
+
var di = 3, O = (e) => ({
|
|
31
31
|
time: e.time,
|
|
32
32
|
open: e.open,
|
|
33
33
|
high: e.high,
|
|
@@ -35,16 +35,16 @@ var ui = 3, O = (e) => ({
|
|
|
35
35
|
close: e.close,
|
|
36
36
|
volume: e.volume
|
|
37
37
|
}), k = (e) => e.length > 0 ? e[e.length - 1] : null;
|
|
38
|
-
function
|
|
38
|
+
function fi(e, t, n) {
|
|
39
39
|
for (let r = 0; r < n; r++) if (!a(e[r], t[r])) return !1;
|
|
40
40
|
return !0;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function pi(e, t) {
|
|
43
43
|
if (e.isReplayActive()) return !0;
|
|
44
44
|
let n = k(e.getData());
|
|
45
45
|
return t.inReplay ? n?.time === t.last?.time : n === t.shownBar ? n?.time === t.last?.time || !e.isExtendedHoursVisible() : !1;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function mi(e, t, n) {
|
|
48
48
|
let r = [];
|
|
49
49
|
for (let o = 0; o < t.length; o++) {
|
|
50
50
|
let s = e[n + o];
|
|
@@ -55,16 +55,16 @@ function pi(e, t, n) {
|
|
|
55
55
|
}
|
|
56
56
|
return r;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function hi(e, t) {
|
|
59
59
|
if (t.length === 0) return !0;
|
|
60
60
|
if (!e.updateBar) return !1;
|
|
61
61
|
for (let n of t) if (!e.updateBar(n)) return !1;
|
|
62
62
|
return !0;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function gi(e) {
|
|
65
65
|
return e.slice(Math.max(1, e.length - 1 - 3), -1).map(O);
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function _i(e, t) {
|
|
68
68
|
let n = [];
|
|
69
69
|
for (let r = t; r < e.length; r++) {
|
|
70
70
|
if (!i(e[r]) || !(e[r].time > e[r - 1].time)) return null;
|
|
@@ -72,38 +72,38 @@ function gi(e, t) {
|
|
|
72
72
|
}
|
|
73
73
|
return n;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function vi(e, t, n) {
|
|
76
76
|
let r = n.length;
|
|
77
|
-
if (r === 0 || !n.last || !i(n.last) || t.length < r || !
|
|
77
|
+
if (r === 0 || !n.last || !i(n.last) || t.length < r || !pi(e, n)) return !1;
|
|
78
78
|
let o = n.recent ?? [], s = r - 1 - o.length;
|
|
79
|
-
if (t !== n.source && (n.source.length !== r || !
|
|
79
|
+
if (t !== n.source && (n.source.length !== r || !fi(n.source, t, s))) return !1;
|
|
80
80
|
let c = t[r - 1];
|
|
81
81
|
if (c.time !== n.last.time || !i(c)) return !1;
|
|
82
|
-
let l =
|
|
83
|
-
return !l || !u || !
|
|
82
|
+
let l = mi(t, o, s), u = _i(t, r);
|
|
83
|
+
return !l || !u || !hi(e, l) ? !1 : (a(c, n.last) || e.updateLastBar(O(c)), u.length === 1 ? e.appendBar(u[0]) : u.length > 1 && e.appendBars(u), !0);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
(!n || !
|
|
85
|
+
function yi(e, t, n) {
|
|
86
|
+
(!n || !vi(e, t, n)) && e.setData(t.map(O));
|
|
87
87
|
let r = t.length > 0 ? O(t[t.length - 1]) : null, i = e.isReplayActive();
|
|
88
88
|
return {
|
|
89
89
|
source: t,
|
|
90
90
|
length: t.length,
|
|
91
91
|
last: r,
|
|
92
|
-
recent:
|
|
92
|
+
recent: gi(t),
|
|
93
93
|
shownBar: i ? null : k(e.getData()),
|
|
94
94
|
inReplay: i
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
//#endregion
|
|
98
98
|
//#region src/brand/poweredBy.ts
|
|
99
|
-
var A = "https://tradecanvas.dev", j = "Powered by TradeCanvas", M = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 256\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M186 70A82 82 0 1 0 186 186\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"22\" stroke-linecap=\"round\"/><rect x=\"92\" y=\"74\" width=\"72\" height=\"20\" rx=\"10\" fill=\"currentColor\"/><path fill=\"#E8961E\" d=\"M119 94H137V108H144a10 10 0 0 1 10 10V164a10 10 0 0 1-10 10H137V190H119V174H112a10 10 0 0 1-10-10V118a10 10 0 0 1 10-10H119Z\"/></svg>", N = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 16 686 88\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" transform=\"translate(0 101.64)\" d=\"M27.24 0.00L27.24 -69.72L1.32 -69.72L1.32 -83.64L68.76 -83.64L68.76 -69.72L42.96 -69.72L42.96 0.00ZM70.90 0.00L70.90 -59.16L85.90 -59.16L85.90 -50.64Q86.26 -51.36 86.74 -51.96Q89.50 -55.92 93.52 -58.14Q97.54 -60.36 101.74 -60.36Q104.74 -60.36 107.44 -59.58Q110.14 -58.80 113.02 -57.00L105.82 -43.56Q104.50 -44.28 102.46 -44.88Q100.42 -45.48 98.38 -45.48Q95.98 -45.48 93.76 -44.64Q91.54 -43.80 89.80 -42.00Q88.06 -40.20 86.98 -37.20Q86.50 -35.52 86.20 -32.94Q85.90 -30.36 85.90 -25.44L85.90 0.00ZM156.44 0.00L155.36 -7.56Q155.00 -6.96 154.52 -6.36Q151.28 -2.40 147.20 -0.60Q143.12 1.20 138.56 1.20Q132.08 1.20 126.98 -1.20Q121.88 -3.60 118.94 -8.04Q116.00 -12.48 116.00 -18.24Q116.00 -23.40 118.10 -27.06Q120.20 -30.72 123.68 -32.64Q126.68 -34.44 130.34 -35.16Q134.00 -35.88 138.20 -35.88L155.24 -35.88L155.24 -37.32Q155.24 -42.60 151.94 -45.18Q148.64 -47.76 143.00 -47.76Q138.32 -47.76 133.46 -45.90Q128.60 -44.04 124.88 -40.68L117.32 -50.88Q123.56 -55.92 130.10 -58.14Q136.64 -60.36 144.20 -60.36Q156.44 -60.36 163.28 -54.24Q170.12 -48.12 170.12 -37.32L170.12 0.00ZM155.24 -24.84L140.36 -24.84Q138.44 -24.84 136.58 -24.54Q134.72 -24.24 133.40 -23.16Q132.20 -22.32 131.60 -21.06Q131.00 -19.80 131.00 -18.24Q131.00 -14.88 133.64 -12.84Q136.28 -10.80 140.72 -10.80Q144.68 -10.80 147.98 -12.54Q151.28 -14.28 153.26 -17.34Q155.24 -20.40 155.24 -24.36ZM202.98 1.20Q195.18 1.20 189.54 -2.82Q183.90 -6.84 180.84 -13.86Q177.78 -20.88 177.78 -29.64Q177.78 -39.36 181.20 -46.20Q184.62 -53.04 190.38 -56.70Q196.14 -60.36 202.98 -60.36Q207.78 -60.36 211.92 -58.38Q216.06 -56.40 219.06 -52.44Q219.54 -51.72 220.02 -51.00L220.02 -83.64L234.78 -83.64L234.78 0.00L220.02 0.00L220.02 -8.04Q219.54 -7.20 218.94 -6.48Q215.70 -2.28 211.56 -0.54Q207.42 1.20 202.98 1.20ZM207.06 -12.48Q211.50 -12.48 214.68 -14.64Q217.86 -16.80 219.60 -20.64Q221.34 -24.48 221.34 -29.64Q221.34 -34.80 219.60 -38.64Q217.86 -42.48 214.68 -44.58Q211.50 -46.68 207.06 -46.68Q202.74 -46.68 199.50 -44.58Q196.26 -42.48 194.52 -38.70Q192.78 -34.92 192.78 -29.64Q192.78 -24.36 194.52 -20.52Q196.26 -16.68 199.50 -14.58Q202.74 -12.48 207.06 -12.48ZM272.32 1.20Q264.64 1.20 259.12 -1.32Q253.60 -3.84 250.06 -8.10Q246.52 -12.36 244.84 -17.82Q243.16 -23.28 243.16 -29.28Q243.16 -35.04 244.84 -40.56Q246.52 -46.08 249.88 -50.52Q253.24 -54.96 258.58 -57.66Q263.92 -60.36 271.36 -60.36Q278.32 -60.36 283.48 -58.02Q288.64 -55.68 292.00 -51.54Q295.36 -47.40 297.10 -41.88Q298.84 -36.36 298.84 -30.12Q298.84 -29.28 298.78 -27.78Q298.72 -26.28 298.48 -24.60L258.04 -24.60Q258.64 -18.24 262.78 -15.00Q266.92 -11.76 273.16 -11.76Q277.72 -11.76 282.04 -13.38Q286.36 -15.00 289.72 -18.00L297.16 -7.92Q292.96 -4.68 289.24 -2.64Q285.52 -0.60 281.50 0.30Q277.48 1.20 272.32 1.20ZM284.68 -35.64Q284.68 -35.76 284.68 -35.76Q284.68 -38.28 283.72 -40.50Q282.76 -42.72 281.08 -44.40Q279.40 -46.08 277.06 -46.98Q274.72 -47.88 271.72 -47.88Q267.28 -47.88 264.28 -46.08Q261.28 -44.28 259.78 -41.46Q258.28 -38.64 257.92 -35.64ZM346.66 1.56Q335.02 1.56 326.20 -3.84Q317.38 -9.24 312.46 -19.08Q307.54 -28.92 307.54 -41.88Q307.54 -54.84 312.46 -64.62Q317.38 -74.40 326.20 -79.80Q335.02 -85.20 346.66 -85.20Q359.50 -85.20 368.92 -78.84Q378.34 -72.48 382.42 -61.20L371.02 -57.00Q368.02 -64.80 361.78 -69.18Q355.54 -73.56 346.66 -73.56Q338.50 -73.56 332.44 -69.66Q326.38 -65.76 323.08 -58.74Q319.78 -51.72 319.78 -41.88Q319.78 -32.04 323.08 -24.96Q326.38 -17.88 332.44 -13.98Q338.50 -10.08 346.66 -10.08Q355.54 -10.08 361.78 -14.46Q368.02 -18.84 371.02 -26.64L382.42 -22.56Q378.34 -11.40 368.92 -4.92Q359.50 1.56 346.66 1.56ZM429.04 0.00L428.32 -8.64Q428.20 -8.52 428.08 -8.40Q424.96 -3.72 420.34 -1.32Q415.72 1.08 409.96 1.08Q403.36 1.08 398.32 -1.32Q393.28 -3.72 390.52 -7.98Q387.76 -12.24 387.76 -17.88Q387.76 -22.80 389.80 -26.34Q391.84 -29.88 395.08 -31.80Q398.08 -33.72 401.98 -34.50Q405.88 -35.28 410.32 -35.28L428.08 -35.28L428.08 -37.20Q428.08 -43.44 424.48 -46.80Q420.88 -50.16 414.04 -50.16Q409.24 -50.16 404.86 -48.24Q400.48 -46.32 396.52 -42.00L389.20 -49.56Q394.48 -55.08 400.90 -57.66Q407.32 -60.24 414.88 -60.24Q426.76 -60.24 433.30 -54.18Q439.84 -48.12 439.84 -37.20L439.84 0.00ZM428.08 -26.40L412.00 -26.40Q409.60 -26.40 407.02 -25.98Q404.44 -25.56 402.64 -24.24Q401.20 -23.16 400.36 -21.54Q399.52 -19.92 399.52 -17.76Q399.52 -13.56 402.76 -11.04Q406.00 -8.52 411.40 -8.52Q415.96 -8.52 419.74 -10.62Q423.52 -12.72 425.80 -16.38Q428.08 -20.04 428.08 -24.72ZM451.94 0.00L451.94 -59.16L463.82 -59.16L463.82 -50.88Q464.78 -52.44 465.98 -53.76Q468.86 -56.88 472.88 -58.56Q476.90 -60.24 481.58 -60.24Q491.42 -60.24 497.00 -54.54Q502.58 -48.84 502.58 -37.92L502.58 0.00L490.82 0.00L490.82 -33.60Q490.82 -42.12 487.76 -46.08Q484.70 -50.04 478.34 -50.04Q473.54 -50.04 470.36 -47.88Q467.18 -45.72 465.50 -41.04Q463.82 -36.36 463.82 -29.16L463.82 0.00ZM533.28 0.00L509.04 -59.16L522.00 -59.16L538.08 -15.24L554.40 -59.16L567.12 -59.16L543.12 0.00ZM610.56 0.00L609.84 -8.64Q609.72 -8.52 609.60 -8.40Q606.48 -3.72 601.86 -1.32Q597.24 1.08 591.48 1.08Q584.88 1.08 579.84 -1.32Q574.80 -3.72 572.04 -7.98Q569.28 -12.24 569.28 -17.88Q569.28 -22.80 571.32 -26.34Q573.36 -29.88 576.60 -31.80Q579.60 -33.72 583.50 -34.50Q587.40 -35.28 591.84 -35.28L609.60 -35.28L609.60 -37.20Q609.60 -43.44 606.00 -46.80Q602.40 -50.16 595.56 -50.16Q590.76 -50.16 586.38 -48.24Q582.00 -46.32 578.04 -42.00L570.72 -49.56Q576.00 -55.08 582.42 -57.66Q588.84 -60.24 596.40 -60.24Q608.28 -60.24 614.82 -54.18Q621.36 -48.12 621.36 -37.20L621.36 0.00ZM609.60 -26.40L593.52 -26.40Q591.12 -26.40 588.54 -25.98Q585.96 -25.56 584.16 -24.24Q582.72 -23.16 581.88 -21.54Q581.04 -19.92 581.04 -17.76Q581.04 -13.56 584.28 -11.04Q587.52 -8.52 592.92 -8.52Q597.48 -8.52 601.26 -10.62Q605.04 -12.72 607.32 -16.38Q609.60 -20.04 609.60 -24.72ZM653.38 1.08Q647.14 1.08 642.34 -0.78Q637.54 -2.64 634.12 -5.58Q630.70 -8.52 628.66 -11.64L636.70 -18.60Q638.98 -14.52 643.24 -11.58Q647.50 -8.64 653.50 -8.64Q658.78 -8.64 661.84 -10.86Q664.90 -13.08 664.90 -16.68Q664.90 -19.56 662.98 -21.30Q661.06 -23.04 657.94 -24.18Q654.82 -25.32 651.10 -26.16Q647.74 -27.12 644.26 -28.32Q640.78 -29.52 637.96 -31.38Q635.14 -33.24 633.40 -36.18Q631.66 -39.12 631.66 -43.44Q631.66 -51.00 637.48 -55.62Q643.30 -60.24 652.90 -60.24Q659.74 -60.24 665.38 -57.42Q671.02 -54.60 674.14 -49.08L666.82 -43.44Q664.42 -47.40 660.64 -49.20Q656.86 -51.00 652.42 -51.00Q648.22 -51.00 645.40 -49.26Q642.58 -47.52 642.58 -44.52Q642.58 -42.36 643.84 -40.98Q645.10 -39.60 647.80 -38.58Q650.50 -37.56 654.46 -36.60Q658.18 -35.76 662.02 -34.56Q665.86 -33.36 669.10 -31.44Q672.34 -29.52 674.38 -26.28Q676.42 -23.04 676.42 -17.88Q676.42 -12.24 673.54 -7.98Q670.66 -3.72 665.50 -1.32Q660.34 1.08 653.38 1.08Z\"/></svg>",
|
|
99
|
+
var A = "https://tradecanvas.dev", j = "Powered by TradeCanvas", M = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 256\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M186 70A82 82 0 1 0 186 186\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"22\" stroke-linecap=\"round\"/><rect x=\"92\" y=\"74\" width=\"72\" height=\"20\" rx=\"10\" fill=\"currentColor\"/><path fill=\"#E8961E\" d=\"M119 94H137V108H144a10 10 0 0 1 10 10V164a10 10 0 0 1-10 10H137V190H119V174H112a10 10 0 0 1-10-10V118a10 10 0 0 1 10-10H119Z\"/></svg>", N = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 16 686 88\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" transform=\"translate(0 101.64)\" d=\"M27.24 0.00L27.24 -69.72L1.32 -69.72L1.32 -83.64L68.76 -83.64L68.76 -69.72L42.96 -69.72L42.96 0.00ZM70.90 0.00L70.90 -59.16L85.90 -59.16L85.90 -50.64Q86.26 -51.36 86.74 -51.96Q89.50 -55.92 93.52 -58.14Q97.54 -60.36 101.74 -60.36Q104.74 -60.36 107.44 -59.58Q110.14 -58.80 113.02 -57.00L105.82 -43.56Q104.50 -44.28 102.46 -44.88Q100.42 -45.48 98.38 -45.48Q95.98 -45.48 93.76 -44.64Q91.54 -43.80 89.80 -42.00Q88.06 -40.20 86.98 -37.20Q86.50 -35.52 86.20 -32.94Q85.90 -30.36 85.90 -25.44L85.90 0.00ZM156.44 0.00L155.36 -7.56Q155.00 -6.96 154.52 -6.36Q151.28 -2.40 147.20 -0.60Q143.12 1.20 138.56 1.20Q132.08 1.20 126.98 -1.20Q121.88 -3.60 118.94 -8.04Q116.00 -12.48 116.00 -18.24Q116.00 -23.40 118.10 -27.06Q120.20 -30.72 123.68 -32.64Q126.68 -34.44 130.34 -35.16Q134.00 -35.88 138.20 -35.88L155.24 -35.88L155.24 -37.32Q155.24 -42.60 151.94 -45.18Q148.64 -47.76 143.00 -47.76Q138.32 -47.76 133.46 -45.90Q128.60 -44.04 124.88 -40.68L117.32 -50.88Q123.56 -55.92 130.10 -58.14Q136.64 -60.36 144.20 -60.36Q156.44 -60.36 163.28 -54.24Q170.12 -48.12 170.12 -37.32L170.12 0.00ZM155.24 -24.84L140.36 -24.84Q138.44 -24.84 136.58 -24.54Q134.72 -24.24 133.40 -23.16Q132.20 -22.32 131.60 -21.06Q131.00 -19.80 131.00 -18.24Q131.00 -14.88 133.64 -12.84Q136.28 -10.80 140.72 -10.80Q144.68 -10.80 147.98 -12.54Q151.28 -14.28 153.26 -17.34Q155.24 -20.40 155.24 -24.36ZM202.98 1.20Q195.18 1.20 189.54 -2.82Q183.90 -6.84 180.84 -13.86Q177.78 -20.88 177.78 -29.64Q177.78 -39.36 181.20 -46.20Q184.62 -53.04 190.38 -56.70Q196.14 -60.36 202.98 -60.36Q207.78 -60.36 211.92 -58.38Q216.06 -56.40 219.06 -52.44Q219.54 -51.72 220.02 -51.00L220.02 -83.64L234.78 -83.64L234.78 0.00L220.02 0.00L220.02 -8.04Q219.54 -7.20 218.94 -6.48Q215.70 -2.28 211.56 -0.54Q207.42 1.20 202.98 1.20ZM207.06 -12.48Q211.50 -12.48 214.68 -14.64Q217.86 -16.80 219.60 -20.64Q221.34 -24.48 221.34 -29.64Q221.34 -34.80 219.60 -38.64Q217.86 -42.48 214.68 -44.58Q211.50 -46.68 207.06 -46.68Q202.74 -46.68 199.50 -44.58Q196.26 -42.48 194.52 -38.70Q192.78 -34.92 192.78 -29.64Q192.78 -24.36 194.52 -20.52Q196.26 -16.68 199.50 -14.58Q202.74 -12.48 207.06 -12.48ZM272.32 1.20Q264.64 1.20 259.12 -1.32Q253.60 -3.84 250.06 -8.10Q246.52 -12.36 244.84 -17.82Q243.16 -23.28 243.16 -29.28Q243.16 -35.04 244.84 -40.56Q246.52 -46.08 249.88 -50.52Q253.24 -54.96 258.58 -57.66Q263.92 -60.36 271.36 -60.36Q278.32 -60.36 283.48 -58.02Q288.64 -55.68 292.00 -51.54Q295.36 -47.40 297.10 -41.88Q298.84 -36.36 298.84 -30.12Q298.84 -29.28 298.78 -27.78Q298.72 -26.28 298.48 -24.60L258.04 -24.60Q258.64 -18.24 262.78 -15.00Q266.92 -11.76 273.16 -11.76Q277.72 -11.76 282.04 -13.38Q286.36 -15.00 289.72 -18.00L297.16 -7.92Q292.96 -4.68 289.24 -2.64Q285.52 -0.60 281.50 0.30Q277.48 1.20 272.32 1.20ZM284.68 -35.64Q284.68 -35.76 284.68 -35.76Q284.68 -38.28 283.72 -40.50Q282.76 -42.72 281.08 -44.40Q279.40 -46.08 277.06 -46.98Q274.72 -47.88 271.72 -47.88Q267.28 -47.88 264.28 -46.08Q261.28 -44.28 259.78 -41.46Q258.28 -38.64 257.92 -35.64ZM346.66 1.56Q335.02 1.56 326.20 -3.84Q317.38 -9.24 312.46 -19.08Q307.54 -28.92 307.54 -41.88Q307.54 -54.84 312.46 -64.62Q317.38 -74.40 326.20 -79.80Q335.02 -85.20 346.66 -85.20Q359.50 -85.20 368.92 -78.84Q378.34 -72.48 382.42 -61.20L371.02 -57.00Q368.02 -64.80 361.78 -69.18Q355.54 -73.56 346.66 -73.56Q338.50 -73.56 332.44 -69.66Q326.38 -65.76 323.08 -58.74Q319.78 -51.72 319.78 -41.88Q319.78 -32.04 323.08 -24.96Q326.38 -17.88 332.44 -13.98Q338.50 -10.08 346.66 -10.08Q355.54 -10.08 361.78 -14.46Q368.02 -18.84 371.02 -26.64L382.42 -22.56Q378.34 -11.40 368.92 -4.92Q359.50 1.56 346.66 1.56ZM429.04 0.00L428.32 -8.64Q428.20 -8.52 428.08 -8.40Q424.96 -3.72 420.34 -1.32Q415.72 1.08 409.96 1.08Q403.36 1.08 398.32 -1.32Q393.28 -3.72 390.52 -7.98Q387.76 -12.24 387.76 -17.88Q387.76 -22.80 389.80 -26.34Q391.84 -29.88 395.08 -31.80Q398.08 -33.72 401.98 -34.50Q405.88 -35.28 410.32 -35.28L428.08 -35.28L428.08 -37.20Q428.08 -43.44 424.48 -46.80Q420.88 -50.16 414.04 -50.16Q409.24 -50.16 404.86 -48.24Q400.48 -46.32 396.52 -42.00L389.20 -49.56Q394.48 -55.08 400.90 -57.66Q407.32 -60.24 414.88 -60.24Q426.76 -60.24 433.30 -54.18Q439.84 -48.12 439.84 -37.20L439.84 0.00ZM428.08 -26.40L412.00 -26.40Q409.60 -26.40 407.02 -25.98Q404.44 -25.56 402.64 -24.24Q401.20 -23.16 400.36 -21.54Q399.52 -19.92 399.52 -17.76Q399.52 -13.56 402.76 -11.04Q406.00 -8.52 411.40 -8.52Q415.96 -8.52 419.74 -10.62Q423.52 -12.72 425.80 -16.38Q428.08 -20.04 428.08 -24.72ZM451.94 0.00L451.94 -59.16L463.82 -59.16L463.82 -50.88Q464.78 -52.44 465.98 -53.76Q468.86 -56.88 472.88 -58.56Q476.90 -60.24 481.58 -60.24Q491.42 -60.24 497.00 -54.54Q502.58 -48.84 502.58 -37.92L502.58 0.00L490.82 0.00L490.82 -33.60Q490.82 -42.12 487.76 -46.08Q484.70 -50.04 478.34 -50.04Q473.54 -50.04 470.36 -47.88Q467.18 -45.72 465.50 -41.04Q463.82 -36.36 463.82 -29.16L463.82 0.00ZM533.28 0.00L509.04 -59.16L522.00 -59.16L538.08 -15.24L554.40 -59.16L567.12 -59.16L543.12 0.00ZM610.56 0.00L609.84 -8.64Q609.72 -8.52 609.60 -8.40Q606.48 -3.72 601.86 -1.32Q597.24 1.08 591.48 1.08Q584.88 1.08 579.84 -1.32Q574.80 -3.72 572.04 -7.98Q569.28 -12.24 569.28 -17.88Q569.28 -22.80 571.32 -26.34Q573.36 -29.88 576.60 -31.80Q579.60 -33.72 583.50 -34.50Q587.40 -35.28 591.84 -35.28L609.60 -35.28L609.60 -37.20Q609.60 -43.44 606.00 -46.80Q602.40 -50.16 595.56 -50.16Q590.76 -50.16 586.38 -48.24Q582.00 -46.32 578.04 -42.00L570.72 -49.56Q576.00 -55.08 582.42 -57.66Q588.84 -60.24 596.40 -60.24Q608.28 -60.24 614.82 -54.18Q621.36 -48.12 621.36 -37.20L621.36 0.00ZM609.60 -26.40L593.52 -26.40Q591.12 -26.40 588.54 -25.98Q585.96 -25.56 584.16 -24.24Q582.72 -23.16 581.88 -21.54Q581.04 -19.92 581.04 -17.76Q581.04 -13.56 584.28 -11.04Q587.52 -8.52 592.92 -8.52Q597.48 -8.52 601.26 -10.62Q605.04 -12.72 607.32 -16.38Q609.60 -20.04 609.60 -24.72ZM653.38 1.08Q647.14 1.08 642.34 -0.78Q637.54 -2.64 634.12 -5.58Q630.70 -8.52 628.66 -11.64L636.70 -18.60Q638.98 -14.52 643.24 -11.58Q647.50 -8.64 653.50 -8.64Q658.78 -8.64 661.84 -10.86Q664.90 -13.08 664.90 -16.68Q664.90 -19.56 662.98 -21.30Q661.06 -23.04 657.94 -24.18Q654.82 -25.32 651.10 -26.16Q647.74 -27.12 644.26 -28.32Q640.78 -29.52 637.96 -31.38Q635.14 -33.24 633.40 -36.18Q631.66 -39.12 631.66 -43.44Q631.66 -51.00 637.48 -55.62Q643.30 -60.24 652.90 -60.24Q659.74 -60.24 665.38 -57.42Q671.02 -54.60 674.14 -49.08L666.82 -43.44Q664.42 -47.40 660.64 -49.20Q656.86 -51.00 652.42 -51.00Q648.22 -51.00 645.40 -49.26Q642.58 -47.52 642.58 -44.52Q642.58 -42.36 643.84 -40.98Q645.10 -39.60 647.80 -38.58Q650.50 -37.56 654.46 -36.60Q658.18 -35.76 662.02 -34.56Q665.86 -33.36 669.10 -31.44Q672.34 -29.52 674.38 -26.28Q676.42 -23.04 676.42 -17.88Q676.42 -12.24 673.54 -7.98Q670.66 -3.72 665.50 -1.32Q660.34 1.08 653.38 1.08Z\"/></svg>", bi = 12, P = 16, xi = .58, Si = 10, Ci = .56, wi = 686 / 88, Ti = 83.64 / 88, Ei = .25;
|
|
100
100
|
function F(e = P) {
|
|
101
|
-
let t = Number.isFinite(e) ? Math.max(
|
|
101
|
+
let t = Number.isFinite(e) ? Math.max(bi, e) : P, n = I(t * Ci / Ti);
|
|
102
102
|
return {
|
|
103
103
|
height: t,
|
|
104
|
-
fontSize: I(Math.max(
|
|
105
|
-
gap: I(t *
|
|
106
|
-
wordmarkWidth: I(n *
|
|
104
|
+
fontSize: I(Math.max(Si, t * xi)),
|
|
105
|
+
gap: I(t * Ei),
|
|
106
|
+
wordmarkWidth: I(n * wi),
|
|
107
107
|
wordmarkHeight: n
|
|
108
108
|
};
|
|
109
109
|
}
|
|
@@ -126,24 +126,24 @@ function V(e = {}) {
|
|
|
126
126
|
let t = F(e.height), n = L(R(e.href)), r = e.target ?? "_blank";
|
|
127
127
|
return `<a class="tc-powered-by" href="${n}"${r ? ` target="${L(r)}"${z(r) ? " rel=\"noopener noreferrer\"" : ""}` : ""} aria-label="${j}" style="${`display:inline-flex;align-items:center;gap:${t.gap}px;height:${t.height}px;color:inherit;text-decoration:none;font-size:${t.fontSize}px;line-height:1;white-space:nowrap`}"><span aria-hidden="true">Powered by</span>` + B(M, t.height, t.height) + B(N, t.wordmarkWidth, t.wordmarkHeight) + "</a>";
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function Di(e = {}, t = document) {
|
|
130
130
|
let n = t.createElement("div");
|
|
131
131
|
return n.innerHTML = V(e), n.firstElementChild;
|
|
132
132
|
}
|
|
133
133
|
//#endregion
|
|
134
134
|
//#region src/plugins/overlayScale.ts
|
|
135
|
-
function
|
|
136
|
-
let { viewport: t, data: n } = e, r =
|
|
135
|
+
function Oi(e) {
|
|
136
|
+
let { viewport: t, data: n } = e, r = Ar(t), i = n.length - 1, a = Math.max(0, Math.floor(t.visibleRange.from)), o = Math.min(i, Math.ceil(t.visibleRange.to)), s = (e) => n.length > 0 ? Xr(e, n) : e;
|
|
137
137
|
return {
|
|
138
138
|
timeToX: (e) => y(s(e), t),
|
|
139
139
|
xToTime: (e) => {
|
|
140
140
|
let r = D(e, t);
|
|
141
|
-
return n.length > 0 ?
|
|
141
|
+
return n.length > 0 ? Qn(r, n) : r;
|
|
142
142
|
},
|
|
143
143
|
indexToX: (e) => y(e, t),
|
|
144
144
|
xToIndex: (e) => D(e, t),
|
|
145
145
|
priceToY: r,
|
|
146
|
-
yToPrice: (e) =>
|
|
146
|
+
yToPrice: (e) => ci(e, t),
|
|
147
147
|
barWidth: t.barWidth,
|
|
148
148
|
visible: o < a ? {
|
|
149
149
|
from: 0,
|
|
@@ -156,7 +156,7 @@ function Di(e) {
|
|
|
156
156
|
}
|
|
157
157
|
//#endregion
|
|
158
158
|
//#region src/grid/ChartGrid.ts
|
|
159
|
-
var
|
|
159
|
+
var ki = class {
|
|
160
160
|
root;
|
|
161
161
|
cells = [];
|
|
162
162
|
layout;
|
|
@@ -255,7 +255,7 @@ var Oi = class {
|
|
|
255
255
|
async connectAll(e, t, n, r = 500) {
|
|
256
256
|
let i = [];
|
|
257
257
|
for (let a = 0; a < this.cells.length && a < t.length; a++) i.push(this.connectCell(a, {
|
|
258
|
-
...typeof e == "function" ? { adapter: e(t[a], a) } :
|
|
258
|
+
...typeof e == "function" ? { adapter: e(t[a], a) } : br(e) ? { feed: e } : { adapter: e },
|
|
259
259
|
symbol: t[a],
|
|
260
260
|
timeframe: n,
|
|
261
261
|
historyLimit: r
|
|
@@ -272,7 +272,7 @@ var Oi = class {
|
|
|
272
272
|
this.cells = [], this.root.remove();
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
},
|
|
275
|
+
}, Ai = class extends _ {
|
|
276
276
|
options;
|
|
277
277
|
constructor(e, t) {
|
|
278
278
|
super(e, t.theme, t.font), this.options = t, this.applyLabel(), this.requestRender();
|
|
@@ -281,7 +281,7 @@ var Oi = class {
|
|
|
281
281
|
this.setLabel(this.options.ariaLabel ?? `Sparkline of ${this.options.data.length} points`);
|
|
282
282
|
}
|
|
283
283
|
renderChart(e, t, n, r) {
|
|
284
|
-
|
|
284
|
+
Ur(e, t, n, this.options, r);
|
|
285
285
|
}
|
|
286
286
|
update(e) {
|
|
287
287
|
this.options = {
|
|
@@ -298,7 +298,7 @@ var Oi = class {
|
|
|
298
298
|
ariaLabel: void 0
|
|
299
299
|
}), this.applyLabel(), this.requestRender();
|
|
300
300
|
}
|
|
301
|
-
},
|
|
301
|
+
}, ji = class extends _ {
|
|
302
302
|
options;
|
|
303
303
|
crosshair;
|
|
304
304
|
constructor(e, t) {
|
|
@@ -311,7 +311,7 @@ var Oi = class {
|
|
|
311
311
|
}
|
|
312
312
|
renderChart(e, t, n, r) {
|
|
313
313
|
let i = this.options.crosshair === !1 ? null : this.crosshair.getPosition();
|
|
314
|
-
|
|
314
|
+
Fr(e, t, n, this.options, r, i);
|
|
315
315
|
}
|
|
316
316
|
update(e) {
|
|
317
317
|
this.options = {
|
|
@@ -344,7 +344,7 @@ var Oi = class {
|
|
|
344
344
|
}
|
|
345
345
|
renderChart(e, t, n, r) {
|
|
346
346
|
let i = this.options.crosshair === !1 ? null : this.crosshair.getPosition();
|
|
347
|
-
|
|
347
|
+
Lr(e, t, n, this.options, r, i);
|
|
348
348
|
}
|
|
349
349
|
update(e, t) {
|
|
350
350
|
this.options = {
|
|
@@ -396,20 +396,20 @@ var Oi = class {
|
|
|
396
396
|
height: this.height
|
|
397
397
|
}, t = this.options.cellPadding ?? 2;
|
|
398
398
|
if (this.lastLayoutWidth = this.width, this.lastLayoutHeight = this.height, this.cachedGroups = [], this.options.grouped) {
|
|
399
|
-
let { groups: n, cells: r } =
|
|
399
|
+
let { groups: n, cells: r } = Sr(this.currentData.map((e) => ({
|
|
400
400
|
id: e.id,
|
|
401
401
|
weight: e.weight ?? (Math.abs(e.value) || 1),
|
|
402
402
|
group: e.group,
|
|
403
403
|
value: e.value
|
|
404
|
-
})), e, t,
|
|
404
|
+
})), e, t, _n);
|
|
405
405
|
this.cachedRects = r, this.cachedGroups = n;
|
|
406
406
|
} else if (this.options.weighted) {
|
|
407
407
|
let n = this.currentData.map((e) => ({
|
|
408
408
|
id: e.id,
|
|
409
409
|
weight: e.weight ?? (Math.abs(e.value) || 1)
|
|
410
410
|
}));
|
|
411
|
-
this.cachedRects =
|
|
412
|
-
} else this.cachedRects =
|
|
411
|
+
this.cachedRects = Cr(n, e, t);
|
|
412
|
+
} else this.cachedRects = wr(this.currentData.map((e) => ({ id: e.id })), e, t);
|
|
413
413
|
}
|
|
414
414
|
onCanvasClick(e, t) {
|
|
415
415
|
if (this.options.onCellClick) for (let n of this.cachedRects) {
|
|
@@ -424,7 +424,7 @@ var Oi = class {
|
|
|
424
424
|
renderChart(e, t, n, r) {
|
|
425
425
|
(t !== this.lastLayoutWidth || n !== this.lastLayoutHeight) && this.recomputeLayout();
|
|
426
426
|
let i = this.options.crosshair === !1 ? null : this.crosshair.getPosition();
|
|
427
|
-
|
|
427
|
+
zr(e, t, n, this.currentData, this.cachedRects, this.options, r, i, this.cachedGroups);
|
|
428
428
|
}
|
|
429
429
|
update(e) {
|
|
430
430
|
this.currentData = e, this.options = {
|
|
@@ -444,7 +444,7 @@ var Oi = class {
|
|
|
444
444
|
destroy() {
|
|
445
445
|
this.crosshair.destroy(), this.canvas.removeEventListener("click", this.handleClick), super.destroy();
|
|
446
446
|
}
|
|
447
|
-
},
|
|
447
|
+
}, Mi = class extends _ {
|
|
448
448
|
options;
|
|
449
449
|
crosshair;
|
|
450
450
|
constructor(e, t) {
|
|
@@ -457,7 +457,7 @@ var Oi = class {
|
|
|
457
457
|
}
|
|
458
458
|
renderChart(e, t, n, r) {
|
|
459
459
|
let i = this.options.crosshair === !1 ? null : this.crosshair.getPosition();
|
|
460
|
-
|
|
460
|
+
Wr(e, t, n, this.options, r, i);
|
|
461
461
|
}
|
|
462
462
|
update(e) {
|
|
463
463
|
this.options = {
|
|
@@ -477,12 +477,12 @@ var Oi = class {
|
|
|
477
477
|
destroy() {
|
|
478
478
|
this.crosshair.destroy(), super.destroy();
|
|
479
479
|
}
|
|
480
|
-
},
|
|
481
|
-
function
|
|
480
|
+
}, Ni = 500;
|
|
481
|
+
function Pi(e) {
|
|
482
482
|
let t = 1 - e;
|
|
483
483
|
return 1 - t * t * t;
|
|
484
484
|
}
|
|
485
|
-
var
|
|
485
|
+
var Fi = class extends _ {
|
|
486
486
|
options;
|
|
487
487
|
currentValue;
|
|
488
488
|
targetValue;
|
|
@@ -496,7 +496,7 @@ var Pi = class extends _ {
|
|
|
496
496
|
this.setLabel(this.options.ariaLabel ?? `Gauge at ${this.options.value}`);
|
|
497
497
|
}
|
|
498
498
|
renderChart(e, t, n, r) {
|
|
499
|
-
|
|
499
|
+
Rr(e, t, n, this.options, r, this.currentValue);
|
|
500
500
|
}
|
|
501
501
|
setValue(e) {
|
|
502
502
|
if (this.options.animate === !1) {
|
|
@@ -529,7 +529,7 @@ var Pi = class extends _ {
|
|
|
529
529
|
if (this.animationFrameId !== null) return;
|
|
530
530
|
let e = () => {
|
|
531
531
|
if (this.animationFrameId = null, this.animationStart === null) return;
|
|
532
|
-
let t = this.options.animationDuration ??
|
|
532
|
+
let t = this.options.animationDuration ?? Ni, n = performance.now() - this.animationStart, r = Math.min(1, n / Math.max(1, t)), i = Pi(r);
|
|
533
533
|
this.currentValue = this.animationFrom + (this.targetValue - this.animationFrom) * i, this.requestRender(), r < 1 ? this.animationFrameId = requestAnimationFrame(e) : (this.currentValue = this.targetValue, this.animationStart = null);
|
|
534
534
|
};
|
|
535
535
|
this.animationFrameId = requestAnimationFrame(e);
|
|
@@ -559,7 +559,7 @@ var Pi = class extends _ {
|
|
|
559
559
|
}
|
|
560
560
|
renderChart(e, t, n, r) {
|
|
561
561
|
let i = this.options.crosshair === !1 ? null : this.crosshair.getPosition(), a = this.layoutFor;
|
|
562
|
-
(!this.layout || !a || a.options !== this.options || a.width !== t || a.height !== n || a.theme !== r) && (this.layout = this.compute(t, n, r,
|
|
562
|
+
(!this.layout || !a || a.options !== this.options || a.width !== t || a.height !== n || a.theme !== r) && (this.layout = this.compute(t, n, r, er(e, r)), this.layoutFor = {
|
|
563
563
|
options: this.options,
|
|
564
564
|
width: t,
|
|
565
565
|
height: n,
|
|
@@ -581,12 +581,12 @@ var Pi = class extends _ {
|
|
|
581
581
|
destroy() {
|
|
582
582
|
this.crosshair.destroy(), this.canvas.removeEventListener("click", this.onClick), this.canvas.removeEventListener("pointermove", this.onMove), super.destroy();
|
|
583
583
|
}
|
|
584
|
-
},
|
|
584
|
+
}, Ii = class extends W {
|
|
585
585
|
compute(e, t, n, r) {
|
|
586
|
-
return
|
|
586
|
+
return tr(this.options, e, t, n, r);
|
|
587
587
|
}
|
|
588
588
|
draw(e, t, n, r, i, a) {
|
|
589
|
-
|
|
589
|
+
Mr(e, t, n, this.options, r, i, a);
|
|
590
590
|
}
|
|
591
591
|
describe() {
|
|
592
592
|
return `Bar chart of ${this.options.series.map((e) => e.name).join(", ")}, ${this.options.categories.length} categories`;
|
|
@@ -612,12 +612,12 @@ var Pi = class extends _ {
|
|
|
612
612
|
series: t
|
|
613
613
|
});
|
|
614
614
|
}
|
|
615
|
-
},
|
|
615
|
+
}, Li = class extends W {
|
|
616
616
|
compute(e, t, n, r) {
|
|
617
|
-
return
|
|
617
|
+
return ir(this.options, e, t, n, r);
|
|
618
618
|
}
|
|
619
619
|
draw(e, t, n, r, i, a) {
|
|
620
|
-
|
|
620
|
+
Ir(e, t, n, this.options, r, i, a);
|
|
621
621
|
}
|
|
622
622
|
describe() {
|
|
623
623
|
let e = this.options.data.filter((e) => Number.isFinite(e.value) && e.value > 0).map((e) => e.label).join(", ");
|
|
@@ -636,12 +636,12 @@ var Pi = class extends _ {
|
|
|
636
636
|
update(e) {
|
|
637
637
|
this.setOptions({ data: e });
|
|
638
638
|
}
|
|
639
|
-
},
|
|
639
|
+
}, Ri = class extends W {
|
|
640
640
|
compute(e, t, n, r) {
|
|
641
|
-
return
|
|
641
|
+
return sr(this.options, e, t, n, r);
|
|
642
642
|
}
|
|
643
643
|
draw(e, t, n, r, i, a) {
|
|
644
|
-
|
|
644
|
+
Hr(e, t, n, this.options, r, i, a);
|
|
645
645
|
}
|
|
646
646
|
describe() {
|
|
647
647
|
let e = this.options.series.reduce((e, t) => e + t.points.length, 0);
|
|
@@ -660,12 +660,12 @@ var Pi = class extends _ {
|
|
|
660
660
|
update(e) {
|
|
661
661
|
this.setOptions({ series: e });
|
|
662
662
|
}
|
|
663
|
-
},
|
|
663
|
+
}, zi = class extends W {
|
|
664
664
|
compute(e, t, n, r) {
|
|
665
|
-
return
|
|
665
|
+
return ar(this.options, e, t, n, r);
|
|
666
666
|
}
|
|
667
667
|
draw(e, t, n, r, i, a) {
|
|
668
|
-
|
|
668
|
+
Br(e, t, n, this.options, r, i, a);
|
|
669
669
|
}
|
|
670
670
|
describe() {
|
|
671
671
|
return `Histogram of ${this.options.values.length} values`;
|
|
@@ -680,12 +680,12 @@ var Pi = class extends _ {
|
|
|
680
680
|
update(e) {
|
|
681
681
|
this.setOptions({ values: e });
|
|
682
682
|
}
|
|
683
|
-
},
|
|
683
|
+
}, Bi = class extends W {
|
|
684
684
|
compute(e, t, n, r) {
|
|
685
|
-
return
|
|
685
|
+
return nr(this.options, e, t, n, r);
|
|
686
686
|
}
|
|
687
687
|
draw(e, t, n, r, i, a) {
|
|
688
|
-
|
|
688
|
+
Nr(e, t, n, this.options, r, i, a);
|
|
689
689
|
}
|
|
690
690
|
describe() {
|
|
691
691
|
let e = this.options.data.map((e) => e.date).filter((e) => /^\d{4}-\d{2}-\d{2}$/.test(e)).sort(), t = this.options.from ?? e[0], n = this.options.to ?? e[e.length - 1];
|
|
@@ -704,12 +704,12 @@ var Pi = class extends _ {
|
|
|
704
704
|
update(e) {
|
|
705
705
|
this.setOptions({ data: e });
|
|
706
706
|
}
|
|
707
|
-
}, G = 12,
|
|
707
|
+
}, G = 12, Vi = class extends W {
|
|
708
708
|
compute(e, t, n, r) {
|
|
709
|
-
return
|
|
709
|
+
return or(this.options, e, t, n, r);
|
|
710
710
|
}
|
|
711
711
|
draw(e, t, n, r, i, a) {
|
|
712
|
-
|
|
712
|
+
Vr(e, t, n, this.options, r, i, a);
|
|
713
713
|
}
|
|
714
714
|
describe() {
|
|
715
715
|
let { rows: e, columns: t } = this.options;
|
|
@@ -728,12 +728,12 @@ var Pi = class extends _ {
|
|
|
728
728
|
update(e) {
|
|
729
729
|
this.setOptions({ values: e });
|
|
730
730
|
}
|
|
731
|
-
},
|
|
731
|
+
}, Hi = class extends W {
|
|
732
732
|
compute(e, t, n, r) {
|
|
733
|
-
return
|
|
733
|
+
return rr(this.options, e, t, n, r);
|
|
734
734
|
}
|
|
735
735
|
draw(e, t, n, r, i, a) {
|
|
736
|
-
|
|
736
|
+
Pr(e, t, n, this.options, r, i, a);
|
|
737
737
|
}
|
|
738
738
|
describe() {
|
|
739
739
|
return `Counter-clock chart of price against volume, ${this.options.period ?? 25}-bar averages`;
|
|
@@ -749,7 +749,7 @@ var Pi = class extends _ {
|
|
|
749
749
|
r && this.options.onPointClick?.(r.point);
|
|
750
750
|
}
|
|
751
751
|
getPhase() {
|
|
752
|
-
return
|
|
752
|
+
return ur(fr(this.options.data, this.options.period ?? 25, qr(this.options)));
|
|
753
753
|
}
|
|
754
754
|
update(e) {
|
|
755
755
|
this.setOptions({ data: e });
|
|
@@ -767,7 +767,7 @@ var Pi = class extends _ {
|
|
|
767
767
|
profitFactor: "Profit Factor",
|
|
768
768
|
trades: "Trades"
|
|
769
769
|
});
|
|
770
|
-
function
|
|
770
|
+
function Ui(e) {
|
|
771
771
|
let t;
|
|
772
772
|
try {
|
|
773
773
|
t = new Intl.DateTimeFormat(e, {
|
|
@@ -801,9 +801,9 @@ function J(e) {
|
|
|
801
801
|
}
|
|
802
802
|
function Y(e, t) {
|
|
803
803
|
if (e.length === 0) return [];
|
|
804
|
-
let n =
|
|
804
|
+
let n = Ui(t), r = [];
|
|
805
805
|
for (let t of e) {
|
|
806
|
-
let e =
|
|
806
|
+
let e = Wt(t.time, "1M"), n = r[r.length - 1];
|
|
807
807
|
n && n.key === e ? n.close = t.equity : r.push({
|
|
808
808
|
key: e,
|
|
809
809
|
close: t.equity
|
|
@@ -837,7 +837,7 @@ function $(e = {}) {
|
|
|
837
837
|
...t
|
|
838
838
|
};
|
|
839
839
|
}
|
|
840
|
-
function
|
|
840
|
+
function Wi(e, t = {}) {
|
|
841
841
|
let n = $(t);
|
|
842
842
|
return [
|
|
843
843
|
{
|
|
@@ -884,7 +884,7 @@ function Ui(e, t = {}) {
|
|
|
884
884
|
}
|
|
885
885
|
//#endregion
|
|
886
886
|
//#region src/finance/PerformanceDashboard.ts
|
|
887
|
-
var
|
|
887
|
+
var Gi = class {
|
|
888
888
|
options;
|
|
889
889
|
theme;
|
|
890
890
|
root;
|
|
@@ -918,7 +918,7 @@ var Wi = class {
|
|
|
918
918
|
}
|
|
919
919
|
this.root.appendChild(t);
|
|
920
920
|
}
|
|
921
|
-
this.root.appendChild(this.buildStatsStrip(
|
|
921
|
+
this.root.appendChild(this.buildStatsStrip(Wi(t.metrics, a), s, c));
|
|
922
922
|
let l = document.createElement("div");
|
|
923
923
|
l.style.cssText = [
|
|
924
924
|
"display:grid",
|
|
@@ -1042,6 +1042,6 @@ var Wi = class {
|
|
|
1042
1042
|
}
|
|
1043
1043
|
};
|
|
1044
1044
|
//#endregion
|
|
1045
|
-
export {
|
|
1045
|
+
export { Qt as AlertManager, $t as Animator, Ii as BarChart, en as BarCountdown, tn as BinanceAdapter, nn as BybitAdapter, rn as CANDLE_PATTERNS, fe as CHART_SPACING, pe as CHART_STYLE_KEYS, di as CORRECTABLE_BARS, Bi as CalendarChart, m as Chart, ki as ChartGrid, an as ChartLegend, on as ChartStateManager, sn as CoinbaseAdapter, cn as CompareRenderer, Hi as CounterClockChart, ln as CrosshairTooltip, un as CurrentPriceLine, me as DARK_PRICE_LIMITS, he as DARK_TERMINAL, ge as DARK_THEME, K as DEFAULT_DASHBOARD_LABELS, _e as DEFAULT_DRAWING_STYLE, re as DEFAULT_HISTORY_PAGE_SIZE, dn as DEFAULT_LEGEND_CONFIG, fn as DEFAULT_MAX_WEBGL_CHARTS, ve as DEFAULT_RECONNECT, pn as DEFAULT_SESSION_HOURS, ye as DEFAULT_SIGNAL_STYLE, be as DEFAULT_STREAM_CONFIG, xe as DEFAULT_TIMEFRAME_FAVORITES, Se as DEFAULT_TRADE_ZONE_STYLE, Ce as DEFAULT_TRADING_CONFIG, mn as DataExporter, ne as DataManager, ji as DepthChart, Li as DonutChart, oe as DragDropImporter, hn as DrawingBase, ee as EXCHANGE_TIME_ZONE, gn as Easing, H as EquityCurveChart, we as FIGURES_FONT_FAMILY, Fi as GaugeChart, e as HISTORY_RETRY_MS, Te as HNX_SESSIONS, Ee as HOSE_SESSIONS, U as HeatmapChart, zi as HistogramChart, vn as INDICATOR_CATEGORIES, yn as IndicatorBase, bn as IndicatorValueMap, xn as KEPT_BUCKETS, De as KRX_SESSIONS, Oe as KR_COLORS, Sn as KeyboardHandler, Cn as KrakenAdapter, ke as LIGHT_PRICE_LIMITS, Ae as LIGHT_THEME, n as LayoutManager, ce as LayoutSession, je as MARKET_CRYPTO, Me as MARKET_HNX, Ne as MARKET_HOSE, Pe as MARKET_HOSE_ETF, Fe as MARKET_KRX, Ie as MARKET_NXT, Le as MARKET_NYSE, Re as MARKET_UPBIT_KRW, ze as MARKET_UPCOM, Be as MARKET_VN30F, wn as MAX_ALERT_BARS, ae as MAX_LAYOUT_NAME, Tn as MIN_ALERT_BARS, Ve as MONO_FONT_FAMILY, He as MS_TIME_THRESHOLD, En as ManualFeed, Vi as MatrixChart, Dn as MockAdapter, Ue as NXT_SESSIONS, le as PLUGIN_API_VERSION, j as POWERED_BY_LABEL, We as PRICE_SOURCES, On as PaperExecutionAdapter, Gi as PerformanceDashboard, de as PluginManager, kn as PollingAdapter, An as RANGE_PRESETS, jn as ReconnectManager, Mn as ReplayController, Nn as ReplayManager, Pn as ResamplingAdapter, Fn as ReshapeMemo, Ge as SANS_FONT_FAMILY, Ri as ScatterChart, In as Screenshot, Ln as SessionBreaks, Rn as SessionShading, zn as SignalMarkerManager, Ai as SparklineChart, Bn as StreamManager, Ke as TC_PALETTE, qe as TC_SERIES_COLORS, Je as TIMEFRAMES_CRYPTO, Ye as TIMEFRAMES_FOREX, Xe as TIMEFRAMES_STOCK, M as TRADECANVAS_MARK_SVG, A as TRADECANVAS_URL, N as TRADECANVAS_WORDMARK_SVG, o as ThemeManager, Vn as TickAggregator, Hn as TickBarAdapter, Un as TickBarBuilder, Wn as TradeZoneManager, Ze as UPCOM_SESSIONS, Gn as UndoRedoManager, Kn as UpbitAdapter, Qe as VN30F_SESSIONS, $e as VN_COLORS, et as VOLUME_ALPHA, qn as VolumeRenderer, Mi as WaterfallChart, Jn as Watermark, Yn as WebSocketAdapter, Xn as adapterFromFeed, Zn as axisTimes, $n as barIndexToX, tt as barTimeUnit, nt as barsAreDaily, se as cleanLayoutName, u as clearGlobalPlugins, J as computeDrawdownCurve, Y as computeMonthlyReturns, rt as computePriceLimits, it as contrastRatio, cr as correlationMatrix, lr as counterClockPhase, dr as counterClockPoints, at as createMarketTheme, Di as createPoweredBy, ot as createVNTheme, pr as describeInputs, mr as detectCandlePatterns, yi as feedBars, hr as feedFromAdapter, st as formatFraction, ct as formatNumber, gr as formatTooltipTime, lt as formatVND, ut as formatVolumeLoc, dt as fractionTick, ft as getCurrentSession, ue as getGlobalPlugins, pt as getLocale, _r as histogramBins, vr as indicatorCategory, mt as indicatorSource, ht as inkOn, yr as isDataFeed, xr as isPriceLevelAlert, gt as isPriceSource, _t as isTimeFrame, vt as isValidTimeZone, te as localStorageLayouts, Tr as lttbDownsample, Er as lttbVisibleIndices, yt as marketStatus, l as memoryLayouts, Dr as niceScale, bt as normalizeBar, xt as normalizeBarTime, St as offsetAt, z as opensElsewhere, Oi as overlayScale, c as overlaysForLayer, Ct as parseIndicatorSource, ie as parseOHLCV, wt as parseTimeframe, Tt as pickBaseTimeframe, r as pluginKey, V as poweredByHtml, F as poweredByLayout, Et as priceFormatterFor, Dt as priceStepAt, Or as priceToY, kr as priceToYMapper, jr as rangePresetStart, Ot as rankSymbols, kt as readNews, At as readQuote, jt as readableOn, Mt as registerLocale, s as registerPlugin, Nt as resampleBars, Pt as roundToPriceStep, R as safeBadgeHref, Ft as scaleMarketPrices, Wi as selectKeyStats, Gr as servesTimeframe, It as setLocale, Kr as setMaxWebGLCharts, Lt as sourcePrice, Rt as stepDecimals, zt as symbolTimeZone, ui as syncIndicators, Bt as t, Vt as tickBarCount, Ht as tickerOf, Jr as timeToX, Ut as timeframeBucketStart, Gt as timeframeToMs, Yr as timestampToBarIndex, q as toEquityPoints, Zr as toHeikinAshi, Qr as toKagi, $r as toLineBreak, ei as toPointAndFigure, ti as toRangeBars, ni as toRenko, t as unregisterPlugin, Kt as usesKoreanUnits, qt as vn30fContracts, Jt as vn30fLastTradingDay, Yt as volumeColor, Xt as wallToUtc, ri as withResampling, ii as withTickBars, ai as xToBarIndex, oi as xToTime, si as yToPrice, Zt as zoneOffsetMinutes };
|
|
1046
1046
|
|
|
1047
1047
|
//# sourceMappingURL=index.js.map
|