@tradecanvas/chart 1.75.0 → 1.77.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/{LayoutSession-Ds8eBT3q.js → LayoutSession-B2mZsibG.js} +2 -2
- package/dist/{LayoutSession-Ds8eBT3q.js.map → LayoutSession-B2mZsibG.js.map} +1 -1
- package/dist/{LayoutSession-DK0-RkCh.cjs → LayoutSession-CLQydl3X.cjs} +2 -2
- package/dist/{LayoutSession-DK0-RkCh.cjs.map → LayoutSession-CLQydl3X.cjs.map} +1 -1
- package/dist/brand/poweredBy.d.ts +44 -0
- package/dist/brand/poweredBy.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 +140 -104
- package/dist/index.js.map +1 -1
- package/dist/widget/index.cjs +1 -1
- package/dist/widget/index.js +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as e, D as t, E as n, S as r, T as i, _ as a, a as o, b as s, c, g as l, h as u, i as ee, l as te, m as ne, n as re, o as ie, p as ae, r as oe, s as se, t as ce, u as le, v as ue, w as de, x as fe, y as pe } from "./LayoutSession-
|
|
2
|
-
import { CHART_STYLE_KEYS as me, DARK_PRICE_LIMITS as he, DARK_TERMINAL as ge, DARK_THEME as _e, DARK_THEME as ve, DEFAULT_DRAWING_STYLE as ye, DEFAULT_FONT_FAMILY as be, DEFAULT_RECONNECT as xe, DEFAULT_SIGNAL_STYLE as Se, DEFAULT_STREAM_CONFIG as Ce, DEFAULT_TIMEFRAME_FAVORITES as we, DEFAULT_TRADE_ZONE_STYLE as Te, DEFAULT_TRADING_CONFIG as Ee, HNX_SESSIONS as
|
|
3
|
-
import { AlertManager as
|
|
1
|
+
import { C as e, D as t, E as n, S as r, T as i, _ as a, a as o, b as s, c, g as l, h as u, i as ee, l as te, m as ne, n as re, o as ie, p as ae, r as oe, s as se, t as ce, u as le, v as ue, w as de, x as fe, y as pe } from "./LayoutSession-B2mZsibG.js";
|
|
2
|
+
import { CHART_STYLE_KEYS as me, DARK_PRICE_LIMITS as he, DARK_TERMINAL as ge, DARK_THEME as _e, DARK_THEME as ve, DEFAULT_DRAWING_STYLE as ye, DEFAULT_FONT_FAMILY as be, DEFAULT_RECONNECT as xe, DEFAULT_SIGNAL_STYLE as Se, DEFAULT_STREAM_CONFIG as Ce, DEFAULT_TIMEFRAME_FAVORITES as we, DEFAULT_TRADE_ZONE_STYLE as Te, DEFAULT_TRADING_CONFIG as Ee, HNX_SESSIONS as De, HOSE_SESSIONS as Oe, KRX_SESSIONS as ke, KR_COLORS as Ae, LIGHT_PRICE_LIMITS as je, LIGHT_THEME as Me, LIGHT_THEME as Ne, MARKET_CRYPTO as Pe, MARKET_HNX as Fe, MARKET_HOSE as Ie, MARKET_HOSE_ETF as Le, MARKET_KRX as Re, MARKET_NXT as d, MARKET_NYSE as f, MARKET_UPBIT_KRW as p, MARKET_UPCOM as m, MARKET_VN30F as h, MS_TIME_THRESHOLD as ze, NXT_SESSIONS as Be, PRICE_SOURCES as Ve, SANS_FONT_FAMILY as He, TC_PALETTE as Ue, TC_SERIES_COLORS as We, TIMEFRAMES_CRYPTO as Ge, TIMEFRAMES_FOREX as Ke, TIMEFRAMES_STOCK as qe, UPCOM_SESSIONS as Je, VN30F_SESSIONS as Ye, VN_COLORS as Xe, VOLUME_ALPHA as Ze, barTimeUnit as Qe, barsAreDaily as $e, computePriceLimits as et, contrastRatio as tt, createMarketTheme as nt, createVNTheme as rt, formatFraction as it, formatNumber as at, formatVND as ot, formatVolumeLoc as st, fractionTick as ct, getCurrentSession as lt, getLocale as ut, indicatorSource as dt, inkOn as ft, isPriceSource as pt, isTimeFrame as mt, isValidTimeZone as ht, marketStatus as gt, normalizeBar as _t, normalizeBarTime as vt, offsetAt as yt, parseIndicatorSource as bt, parseTimeframe as xt, pickBaseTimeframe as St, priceFormatterFor as Ct, priceStepAt as wt, rankSymbols as Tt, readNews as Et, readQuote as Dt, readableOn as Ot, registerLocale as kt, resampleBars as At, roundToPriceStep as jt, scaleMarketPrices as Mt, setLocale as Nt, sourcePrice as Pt, stepDecimals as Ft, symbolTimeZone as It, t as Lt, tickBarCount as Rt, timeframeBucketStart as zt, timeframeBucketStart as Bt, timeframeToMs as Vt, usesKoreanUnits as Ht, vn30fContracts as Ut, vn30fLastTradingDay as Wt, volumeColor as Gt, wallToUtc as Kt, zoneOffsetMinutes as qt } from "@tradecanvas/commons";
|
|
3
|
+
import { AlertManager as Jt, Animator as Yt, BarCountdown as Xt, BaseFinanceChart as g, BinanceAdapter as Zt, BybitAdapter as Qt, CANDLE_PATTERNS as $t, ChartLegend as en, ChartStateManager as tn, CoinbaseAdapter as nn, CompareRenderer as rn, CrosshairTooltip as an, CurrentPriceLine as on, DEFAULT_LEGEND_CONFIG as sn, DEFAULT_MAX_WEBGL_CHARTS as cn, DEFAULT_SESSION_HOURS as ln, DataExporter as un, DrawingBase as dn, Easing as fn, FinanceCrosshair as _, GROUP_HEADER as pn, INDICATOR_CATEGORIES as mn, IndicatorBase as hn, IndicatorValueMap as gn, KEPT_BUCKETS as _n, KeyboardHandler as vn, KrakenAdapter as yn, MAX_ALERT_BARS as bn, MIN_ALERT_BARS as xn, ManualFeed as Sn, MockAdapter as Cn, PaperExecutionAdapter as wn, PollingAdapter as Tn, RANGE_PRESETS as En, ReconnectManager as Dn, ReplayController as On, ReplayManager as kn, ResamplingAdapter as An, ReshapeMemo as jn, Screenshot as Mn, SessionBreaks as Nn, SessionShading as Pn, SignalMarkerManager as Fn, StreamManager as In, TickAggregator as Ln, TickBarAdapter as Rn, TickBarBuilder as zn, TradeZoneManager as Bn, UndoRedoManager as Vn, UpbitAdapter as Hn, VolumeRenderer as v, Watermark as Un, WebSocketAdapter as Wn, adapterFromFeed as Gn, axisTimes as Kn, barIndexToTime as qn, barIndexToX as Jn, barIndexToX as y, canvasMeasure as Yn, computeBarLayout as Xn, computeCalendarLayout as Zn, computeCounterClockLayout as Qn, computeDonutLayout as $n, computeHistogramLayout as er, computeMatrixLayout as tr, computeScatterLayout as nr, correlationMatrix as rr, counterClockPhase as ir, counterClockPhase as ar, counterClockPoints as or, counterClockPoints as sr, describeInputs as cr, detectCandlePatterns as lr, feedFromAdapter as ur, formatTooltipTime as dr, histogramBins as fr, hitBar as b, hitDay as x, hitMatrixCell as S, hitSlice as C, indicatorCategory as pr, isDataFeed as mr, isDataFeed as hr, isPriceLevelAlert as gr, layoutGroupedTreemap as _r, layoutSquarifiedTreemap as vr, layoutUniformGrid as yr, lttbDownsample as br, lttbVisibleIndices as xr, nearestCounterClockPoint as w, nearestPoint as T, niceScale as Sr, priceToY as Cr, priceToYMapper as wr, priceToYMapper as Tr, rangePresetStart as Er, renderBarChart as Dr, renderCalendar as Or, renderCounterClock as kr, renderDepthChart as Ar, renderDonut as jr, renderEquityCurve as Mr, renderGauge as Nr, renderHeatmap as Pr, renderHistogram as Fr, renderMatrix as Ir, renderScatter as Lr, renderSparkline as Rr, renderWaterfall as zr, servesTimeframe as Br, setMaxWebGLCharts as Vr, shownCount as Hr, timeToX as Ur, timestampToBarIndex as Wr, timestampToBarIndex as Gr, toHeikinAshi as Kr, toKagi as qr, toLineBreak as Jr, toPointAndFigure as Yr, toRangeBars as Xr, toRenko as Zr, withResampling as Qr, withTickBars as $r, xToBarIndex as ei, xToBarIndex as E, xToTime as ti, yToPrice as ni, yToPrice as ri } from "@tradecanvas/core";
|
|
4
4
|
//#region src/frameworks/syncIndicators.ts
|
|
5
|
-
function
|
|
5
|
+
function ii(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 Kr(e) {
|
|
|
10
10
|
r
|
|
11
11
|
]);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function ai(e, t, n) {
|
|
14
14
|
let r = /* @__PURE__ */ new Map(), i = t.map((e) => {
|
|
15
|
-
let t =
|
|
15
|
+
let t = ii(e), n = r.get(t) ?? 0;
|
|
16
16
|
return r.set(t, n + 1), {
|
|
17
17
|
spec: e,
|
|
18
18
|
key: `${t}#${n}`
|
|
@@ -27,87 +27,123 @@ function qr(e, t, n) {
|
|
|
27
27
|
}
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region src/frameworks/feedBars.ts
|
|
30
|
-
var
|
|
30
|
+
var oi = 3, D = (e) => ({
|
|
31
31
|
time: e.time,
|
|
32
32
|
open: e.open,
|
|
33
33
|
high: e.high,
|
|
34
34
|
low: e.low,
|
|
35
35
|
close: e.close,
|
|
36
36
|
volume: e.volume
|
|
37
|
-
}),
|
|
38
|
-
function
|
|
37
|
+
}), O = (e) => e.length > 0 ? e[e.length - 1] : null;
|
|
38
|
+
function si(e, n, r) {
|
|
39
39
|
for (let i = 0; i < r; i++) if (!t(e[i], n[i])) return !1;
|
|
40
40
|
return !0;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function ci(e, t) {
|
|
43
43
|
if (e.isReplayActive()) return !0;
|
|
44
|
-
let n =
|
|
44
|
+
let n = O(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 li(e, r, i) {
|
|
48
48
|
let a = [];
|
|
49
49
|
for (let o = 0; o < r.length; o++) {
|
|
50
50
|
let s = e[i + o];
|
|
51
51
|
if (!t(s, r[o])) {
|
|
52
52
|
if (s.time !== r[o].time || !n(s)) return null;
|
|
53
|
-
a.push(
|
|
53
|
+
a.push(D(s));
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
return a;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function ui(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
|
|
65
|
-
return e.slice(Math.max(1, e.length - 1 - 3), -1).map(
|
|
64
|
+
function di(e) {
|
|
65
|
+
return e.slice(Math.max(1, e.length - 1 - 3), -1).map(D);
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function fi(e, t) {
|
|
68
68
|
let r = [];
|
|
69
69
|
for (let i = t; i < e.length; i++) {
|
|
70
70
|
if (!n(e[i]) || !(e[i].time > e[i - 1].time)) return null;
|
|
71
|
-
r.push(
|
|
71
|
+
r.push(D(e[i]));
|
|
72
72
|
}
|
|
73
73
|
return r;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function pi(e, r, i) {
|
|
76
76
|
let a = i.length;
|
|
77
|
-
if (a === 0 || !i.last || !n(i.last) || r.length < a || !
|
|
77
|
+
if (a === 0 || !i.last || !n(i.last) || r.length < a || !ci(e, i)) return !1;
|
|
78
78
|
let o = i.recent ?? [], s = a - 1 - o.length;
|
|
79
|
-
if (r !== i.source && (i.source.length !== a || !
|
|
79
|
+
if (r !== i.source && (i.source.length !== a || !si(i.source, r, s))) return !1;
|
|
80
80
|
let c = r[a - 1];
|
|
81
81
|
if (c.time !== i.last.time || !n(c)) return !1;
|
|
82
|
-
let l =
|
|
83
|
-
return !l || !u || !
|
|
82
|
+
let l = li(r, o, s), u = fi(r, a);
|
|
83
|
+
return !l || !u || !ui(e, l) ? !1 : (t(c, i.last) || e.updateLastBar(D(c)), u.length === 1 ? e.appendBar(u[0]) : u.length > 1 && e.appendBars(u), !0);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
(!n || !
|
|
87
|
-
let r = t.length > 0 ?
|
|
85
|
+
function mi(e, t, n) {
|
|
86
|
+
(!n || !pi(e, t, n)) && e.setData(t.map(D));
|
|
87
|
+
let r = t.length > 0 ? D(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:
|
|
93
|
-
shownBar: i ? null :
|
|
92
|
+
recent: di(t),
|
|
93
|
+
shownBar: i ? null : O(e.getData()),
|
|
94
94
|
inReplay: i
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
//#endregion
|
|
98
|
+
//#region src/brand/poweredBy.ts
|
|
99
|
+
var k = "https://tradecanvas.dev", A = "Powered by TradeCanvas", j = "<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>", M = "<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>", hi = 12, N = 16, gi = .58, _i = 10, vi = .56, yi = 686 / 88, bi = 83.64 / 88, xi = .25;
|
|
100
|
+
function P(e = N) {
|
|
101
|
+
let t = Number.isFinite(e) ? Math.max(hi, e) : N, n = F(t * vi / bi);
|
|
102
|
+
return {
|
|
103
|
+
height: t,
|
|
104
|
+
fontSize: F(Math.max(_i, t * gi)),
|
|
105
|
+
gap: F(t * xi),
|
|
106
|
+
wordmarkWidth: F(n * yi),
|
|
107
|
+
wordmarkHeight: n
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
function F(e) {
|
|
111
|
+
return Math.round(e * 10) / 10;
|
|
112
|
+
}
|
|
113
|
+
function I(e) {
|
|
114
|
+
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<");
|
|
115
|
+
}
|
|
116
|
+
function L(e) {
|
|
117
|
+
return e && (/^(https?:)?\/\//i.test(e) || e.startsWith("/")) ? e : k;
|
|
118
|
+
}
|
|
119
|
+
function R(e) {
|
|
120
|
+
return !!e && !/^_(self|parent|top)$/i.test(e);
|
|
121
|
+
}
|
|
122
|
+
function z(e, t, n) {
|
|
123
|
+
return e.replace("<svg ", `<svg width="${t}" height="${n}" style="display:block;flex:none" `);
|
|
124
|
+
}
|
|
125
|
+
function B(e = {}) {
|
|
126
|
+
let t = P(e.height), n = I(L(e.href)), r = e.target ?? "_blank";
|
|
127
|
+
return `<a class="tc-powered-by" href="${n}"${r ? ` target="${I(r)}"${R(r) ? " rel=\"noopener noreferrer\"" : ""}` : ""} aria-label="${A}" 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>` + z(j, t.height, t.height) + z(M, t.wordmarkWidth, t.wordmarkHeight) + "</a>";
|
|
128
|
+
}
|
|
129
|
+
function Si(e = {}, t = document) {
|
|
130
|
+
let n = t.createElement("div");
|
|
131
|
+
return n.innerHTML = B(e), n.firstElementChild;
|
|
132
|
+
}
|
|
133
|
+
//#endregion
|
|
98
134
|
//#region src/plugins/overlayScale.ts
|
|
99
|
-
function
|
|
100
|
-
let { viewport: t, data: n } = e, r =
|
|
135
|
+
function Ci(e) {
|
|
136
|
+
let { viewport: t, data: n } = e, r = Tr(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 ? Gr(e, n) : e;
|
|
101
137
|
return {
|
|
102
|
-
timeToX: (e) =>
|
|
138
|
+
timeToX: (e) => y(s(e), t),
|
|
103
139
|
xToTime: (e) => {
|
|
104
|
-
let r =
|
|
105
|
-
return n.length > 0 ?
|
|
140
|
+
let r = E(e, t);
|
|
141
|
+
return n.length > 0 ? qn(r, n) : r;
|
|
106
142
|
},
|
|
107
|
-
indexToX: (e) =>
|
|
108
|
-
xToIndex: (e) =>
|
|
143
|
+
indexToX: (e) => y(e, t),
|
|
144
|
+
xToIndex: (e) => E(e, t),
|
|
109
145
|
priceToY: r,
|
|
110
|
-
yToPrice: (e) =>
|
|
146
|
+
yToPrice: (e) => ri(e, t),
|
|
111
147
|
barWidth: t.barWidth,
|
|
112
148
|
visible: o < a ? {
|
|
113
149
|
from: 0,
|
|
@@ -153,7 +189,7 @@ var V = {
|
|
|
153
189
|
cols: 2,
|
|
154
190
|
rows: 3
|
|
155
191
|
}
|
|
156
|
-
},
|
|
192
|
+
}, wi = class {
|
|
157
193
|
root;
|
|
158
194
|
cells = [];
|
|
159
195
|
layout;
|
|
@@ -243,7 +279,7 @@ var V = {
|
|
|
243
279
|
async connectAll(e, t, n, r = 500) {
|
|
244
280
|
let i = [];
|
|
245
281
|
for (let a = 0; a < this.cells.length && a < t.length; a++) i.push(this.connectCell(a, {
|
|
246
|
-
...typeof e == "function" ? { adapter: e(t[a], a) } :
|
|
282
|
+
...typeof e == "function" ? { adapter: e(t[a], a) } : hr(e) ? { feed: e } : { adapter: e },
|
|
247
283
|
symbol: t[a],
|
|
248
284
|
timeframe: n,
|
|
249
285
|
historyLimit: r
|
|
@@ -260,13 +296,13 @@ var V = {
|
|
|
260
296
|
this.cells = [], this.root.remove();
|
|
261
297
|
}
|
|
262
298
|
}
|
|
263
|
-
},
|
|
299
|
+
}, Ti = class extends g {
|
|
264
300
|
options;
|
|
265
301
|
constructor(e, t) {
|
|
266
302
|
super(e, t.theme), this.options = t, this.requestRender();
|
|
267
303
|
}
|
|
268
304
|
renderChart(e, t, n, r) {
|
|
269
|
-
|
|
305
|
+
Rr(e, t, n, this.options, r);
|
|
270
306
|
}
|
|
271
307
|
update(e) {
|
|
272
308
|
this.options = {
|
|
@@ -280,15 +316,15 @@ var V = {
|
|
|
280
316
|
...e
|
|
281
317
|
}, this.requestRender();
|
|
282
318
|
}
|
|
283
|
-
},
|
|
319
|
+
}, Ei = class extends g {
|
|
284
320
|
options;
|
|
285
321
|
crosshair = null;
|
|
286
322
|
constructor(e, t) {
|
|
287
|
-
super(e, t.theme), this.options = t, t.crosshair !== !1 && (this.crosshair = new
|
|
323
|
+
super(e, t.theme), this.options = t, t.crosshair !== !1 && (this.crosshair = new _(this.canvas, () => this.requestRender())), this.requestRender();
|
|
288
324
|
}
|
|
289
325
|
renderChart(e, t, n, r) {
|
|
290
326
|
let i = this.crosshair?.getPosition() ?? null;
|
|
291
|
-
|
|
327
|
+
Ar(e, t, n, this.options, r, i);
|
|
292
328
|
}
|
|
293
329
|
update(e) {
|
|
294
330
|
this.options = {
|
|
@@ -305,15 +341,15 @@ var V = {
|
|
|
305
341
|
destroy() {
|
|
306
342
|
this.crosshair?.destroy(), super.destroy();
|
|
307
343
|
}
|
|
308
|
-
}, H = class extends
|
|
344
|
+
}, H = class extends g {
|
|
309
345
|
options;
|
|
310
346
|
crosshair = null;
|
|
311
347
|
constructor(e, t) {
|
|
312
|
-
super(e, t.theme), this.options = t, t.crosshair !== !1 && (this.crosshair = new
|
|
348
|
+
super(e, t.theme), this.options = t, t.crosshair !== !1 && (this.crosshair = new _(this.canvas, () => this.requestRender())), this.requestRender();
|
|
313
349
|
}
|
|
314
350
|
renderChart(e, t, n, r) {
|
|
315
351
|
let i = this.crosshair?.getPosition() ?? null;
|
|
316
|
-
|
|
352
|
+
Mr(e, t, n, this.options, r, i);
|
|
317
353
|
}
|
|
318
354
|
update(e, t) {
|
|
319
355
|
this.options = {
|
|
@@ -333,7 +369,7 @@ var V = {
|
|
|
333
369
|
destroy() {
|
|
334
370
|
this.crosshair?.destroy(), super.destroy();
|
|
335
371
|
}
|
|
336
|
-
}, U = class extends
|
|
372
|
+
}, U = class extends g {
|
|
337
373
|
options;
|
|
338
374
|
crosshair = null;
|
|
339
375
|
cachedRects = [];
|
|
@@ -343,7 +379,7 @@ var V = {
|
|
|
343
379
|
lastLayoutHeight = 0;
|
|
344
380
|
handleClick = null;
|
|
345
381
|
constructor(e, t) {
|
|
346
|
-
super(e, t.theme), this.options = t, this.currentData = t.data ?? [], t.crosshair !== !1 && (this.crosshair = new
|
|
382
|
+
super(e, t.theme), this.options = t, this.currentData = t.data ?? [], t.crosshair !== !1 && (this.crosshair = new _(this.canvas, () => this.requestRender())), t.onCellClick && (this.handleClick = (e) => {
|
|
347
383
|
let t = this.canvas.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top;
|
|
348
384
|
this.onCanvasClick(n, r);
|
|
349
385
|
}, this.canvas.addEventListener("click", this.handleClick)), this.applyLabel(), this.recomputeLayout(), this.requestRender();
|
|
@@ -360,20 +396,20 @@ var V = {
|
|
|
360
396
|
height: this.height
|
|
361
397
|
}, t = this.options.cellPadding ?? 2;
|
|
362
398
|
if (this.lastLayoutWidth = this.width, this.lastLayoutHeight = this.height, this.cachedGroups = [], this.options.grouped) {
|
|
363
|
-
let { groups: n, cells: r } =
|
|
399
|
+
let { groups: n, cells: r } = _r(this.currentData.map((e) => ({
|
|
364
400
|
id: e.id,
|
|
365
401
|
weight: e.weight ?? (Math.abs(e.value) || 1),
|
|
366
402
|
group: e.group,
|
|
367
403
|
value: e.value
|
|
368
|
-
})), e, t,
|
|
404
|
+
})), e, t, pn);
|
|
369
405
|
this.cachedRects = r, this.cachedGroups = n;
|
|
370
406
|
} else if (this.options.weighted) {
|
|
371
407
|
let n = this.currentData.map((e) => ({
|
|
372
408
|
id: e.id,
|
|
373
409
|
weight: e.weight ?? (Math.abs(e.value) || 1)
|
|
374
410
|
}));
|
|
375
|
-
this.cachedRects =
|
|
376
|
-
} else this.cachedRects =
|
|
411
|
+
this.cachedRects = vr(n, e, t);
|
|
412
|
+
} else this.cachedRects = yr(this.currentData.map((e) => ({ id: e.id })), e, t);
|
|
377
413
|
}
|
|
378
414
|
onCanvasClick(e, t) {
|
|
379
415
|
if (this.options.onCellClick) for (let n of this.cachedRects) {
|
|
@@ -388,7 +424,7 @@ var V = {
|
|
|
388
424
|
renderChart(e, t, n, r) {
|
|
389
425
|
(t !== this.lastLayoutWidth || n !== this.lastLayoutHeight) && this.recomputeLayout();
|
|
390
426
|
let i = this.crosshair?.getPosition() ?? null;
|
|
391
|
-
|
|
427
|
+
Pr(e, t, n, this.currentData, this.cachedRects, this.options, r, i, this.cachedGroups);
|
|
392
428
|
}
|
|
393
429
|
update(e) {
|
|
394
430
|
this.currentData = e, this.options = {
|
|
@@ -405,15 +441,15 @@ var V = {
|
|
|
405
441
|
destroy() {
|
|
406
442
|
this.crosshair?.destroy(), this.handleClick && this.canvas.removeEventListener("click", this.handleClick), super.destroy();
|
|
407
443
|
}
|
|
408
|
-
},
|
|
444
|
+
}, Di = class extends g {
|
|
409
445
|
options;
|
|
410
446
|
crosshair = null;
|
|
411
447
|
constructor(e, t) {
|
|
412
|
-
super(e, t.theme), this.options = t, t.crosshair !== !1 && (this.crosshair = new
|
|
448
|
+
super(e, t.theme), this.options = t, t.crosshair !== !1 && (this.crosshair = new _(this.canvas, () => this.requestRender())), this.requestRender();
|
|
413
449
|
}
|
|
414
450
|
renderChart(e, t, n, r) {
|
|
415
451
|
let i = this.crosshair?.getPosition() ?? null;
|
|
416
|
-
|
|
452
|
+
zr(e, t, n, this.options, r, i);
|
|
417
453
|
}
|
|
418
454
|
update(e) {
|
|
419
455
|
this.options = {
|
|
@@ -430,12 +466,12 @@ var V = {
|
|
|
430
466
|
destroy() {
|
|
431
467
|
this.crosshair?.destroy(), super.destroy();
|
|
432
468
|
}
|
|
433
|
-
},
|
|
434
|
-
function
|
|
469
|
+
}, Oi = 500;
|
|
470
|
+
function ki(e) {
|
|
435
471
|
let t = 1 - e;
|
|
436
472
|
return 1 - t * t * t;
|
|
437
473
|
}
|
|
438
|
-
var
|
|
474
|
+
var Ai = class extends g {
|
|
439
475
|
options;
|
|
440
476
|
currentValue;
|
|
441
477
|
targetValue;
|
|
@@ -446,7 +482,7 @@ var ui = class extends O {
|
|
|
446
482
|
super(e, t.theme), this.options = t, this.currentValue = t.value, this.targetValue = t.value, this.requestRender();
|
|
447
483
|
}
|
|
448
484
|
renderChart(e, t, n, r) {
|
|
449
|
-
|
|
485
|
+
Nr(e, t, n, this.options, r, this.currentValue);
|
|
450
486
|
}
|
|
451
487
|
setValue(e) {
|
|
452
488
|
if (this.options.animate === !1) {
|
|
@@ -476,7 +512,7 @@ var ui = class extends O {
|
|
|
476
512
|
if (this.animationFrameId !== null) return;
|
|
477
513
|
let e = () => {
|
|
478
514
|
if (this.animationFrameId = null, this.animationStart === null) return;
|
|
479
|
-
let t = this.options.animationDuration ??
|
|
515
|
+
let t = this.options.animationDuration ?? Oi, n = performance.now() - this.animationStart, r = Math.min(1, n / Math.max(1, t)), i = ki(r);
|
|
480
516
|
this.currentValue = this.animationFrom + (this.targetValue - this.animationFrom) * i, this.requestRender(), r < 1 ? this.animationFrameId = requestAnimationFrame(e) : (this.currentValue = this.targetValue, this.animationStart = null);
|
|
481
517
|
};
|
|
482
518
|
this.animationFrameId = requestAnimationFrame(e);
|
|
@@ -487,7 +523,7 @@ var ui = class extends O {
|
|
|
487
523
|
destroy() {
|
|
488
524
|
this.cancelAnimation(), super.destroy();
|
|
489
525
|
}
|
|
490
|
-
}, W = class extends
|
|
526
|
+
}, W = class extends g {
|
|
491
527
|
options;
|
|
492
528
|
layout = null;
|
|
493
529
|
layoutFor = null;
|
|
@@ -502,11 +538,11 @@ var ui = class extends O {
|
|
|
502
538
|
this.canvas.style.cursor = this.hits(this.layout, e.clientX - t.left, e.clientY - t.top) ? "pointer" : "";
|
|
503
539
|
};
|
|
504
540
|
constructor(e, t) {
|
|
505
|
-
super(e, t.theme), this.options = t, this.crosshair = new
|
|
541
|
+
super(e, t.theme), this.options = t, this.crosshair = new _(this.canvas, () => this.requestRender()), this.canvas.addEventListener("click", this.onClick), this.canvas.addEventListener("pointermove", this.onMove), this.applyLabel(), this.requestRender();
|
|
506
542
|
}
|
|
507
543
|
renderChart(e, t, n, r) {
|
|
508
544
|
let i = this.options.crosshair === !1 ? null : this.crosshair.getPosition(), a = this.layoutFor;
|
|
509
|
-
(!this.layout || !a || a.options !== this.options || a.width !== t || a.height !== n || a.theme !== r) && (this.layout = this.compute(t, n, r,
|
|
545
|
+
(!this.layout || !a || a.options !== this.options || a.width !== t || a.height !== n || a.theme !== r) && (this.layout = this.compute(t, n, r, Yn(e, r)), this.layoutFor = {
|
|
510
546
|
options: this.options,
|
|
511
547
|
width: t,
|
|
512
548
|
height: n,
|
|
@@ -525,12 +561,12 @@ var ui = class extends O {
|
|
|
525
561
|
destroy() {
|
|
526
562
|
this.crosshair.destroy(), this.canvas.removeEventListener("click", this.onClick), this.canvas.removeEventListener("pointermove", this.onMove), super.destroy();
|
|
527
563
|
}
|
|
528
|
-
},
|
|
564
|
+
}, ji = class extends W {
|
|
529
565
|
compute(e, t, n, r) {
|
|
530
|
-
return
|
|
566
|
+
return Xn(this.options, e, t, n, r);
|
|
531
567
|
}
|
|
532
568
|
draw(e, t, n, r, i, a) {
|
|
533
|
-
|
|
569
|
+
Dr(e, t, n, this.options, r, i, a);
|
|
534
570
|
}
|
|
535
571
|
describe() {
|
|
536
572
|
return `Bar chart of ${this.options.series.map((e) => e.name).join(", ")}, ${this.options.categories.length} categories`;
|
|
@@ -539,10 +575,10 @@ var ui = class extends O {
|
|
|
539
575
|
return this.options.onBarClick !== void 0;
|
|
540
576
|
}
|
|
541
577
|
hits(e, t, n) {
|
|
542
|
-
return
|
|
578
|
+
return b(e, t, n) !== null;
|
|
543
579
|
}
|
|
544
580
|
clickAt(e, t, n) {
|
|
545
|
-
let r =
|
|
581
|
+
let r = b(e, t, n);
|
|
546
582
|
r && this.options.onBarClick?.({
|
|
547
583
|
category: r.category,
|
|
548
584
|
series: r.series,
|
|
@@ -556,12 +592,12 @@ var ui = class extends O {
|
|
|
556
592
|
series: t
|
|
557
593
|
});
|
|
558
594
|
}
|
|
559
|
-
},
|
|
595
|
+
}, Mi = class extends W {
|
|
560
596
|
compute(e, t, n, r) {
|
|
561
|
-
return
|
|
597
|
+
return $n(this.options, e, t, n, r);
|
|
562
598
|
}
|
|
563
599
|
draw(e, t, n, r, i, a) {
|
|
564
|
-
|
|
600
|
+
jr(e, t, n, this.options, r, i, a);
|
|
565
601
|
}
|
|
566
602
|
describe() {
|
|
567
603
|
let e = this.options.data.filter((e) => Number.isFinite(e.value) && e.value > 0).map((e) => e.label).join(", ");
|
|
@@ -571,21 +607,21 @@ var ui = class extends O {
|
|
|
571
607
|
return this.options.onSliceClick !== void 0;
|
|
572
608
|
}
|
|
573
609
|
hits(e, t, n) {
|
|
574
|
-
return
|
|
610
|
+
return C(e, t, n) !== null;
|
|
575
611
|
}
|
|
576
612
|
clickAt(e, t, n) {
|
|
577
|
-
let r =
|
|
613
|
+
let r = C(e, t, n);
|
|
578
614
|
r && this.options.onSliceClick?.(r.slice);
|
|
579
615
|
}
|
|
580
616
|
update(e) {
|
|
581
617
|
this.setOptions({ data: e });
|
|
582
618
|
}
|
|
583
|
-
},
|
|
619
|
+
}, Ni = class extends W {
|
|
584
620
|
compute(e, t, n, r) {
|
|
585
|
-
return
|
|
621
|
+
return nr(this.options, e, t, n, r);
|
|
586
622
|
}
|
|
587
623
|
draw(e, t, n, r, i, a) {
|
|
588
|
-
|
|
624
|
+
Lr(e, t, n, this.options, r, i, a);
|
|
589
625
|
}
|
|
590
626
|
describe() {
|
|
591
627
|
let e = this.options.series.reduce((e, t) => e + t.points.length, 0);
|
|
@@ -595,21 +631,21 @@ var ui = class extends O {
|
|
|
595
631
|
return this.options.onPointClick !== void 0;
|
|
596
632
|
}
|
|
597
633
|
hits(e, t, n) {
|
|
598
|
-
return
|
|
634
|
+
return T(e, t, n) !== null;
|
|
599
635
|
}
|
|
600
636
|
clickAt(e, t, n) {
|
|
601
|
-
let r =
|
|
637
|
+
let r = T(e, t, n);
|
|
602
638
|
r && this.options.onPointClick?.(r.point, r.series);
|
|
603
639
|
}
|
|
604
640
|
update(e) {
|
|
605
641
|
this.setOptions({ series: e });
|
|
606
642
|
}
|
|
607
|
-
},
|
|
643
|
+
}, Pi = class extends W {
|
|
608
644
|
compute(e, t, n, r) {
|
|
609
|
-
return
|
|
645
|
+
return er(this.options, e, t, n, r);
|
|
610
646
|
}
|
|
611
647
|
draw(e, t, n, r, i, a) {
|
|
612
|
-
|
|
648
|
+
Fr(e, t, n, this.options, r, i, a);
|
|
613
649
|
}
|
|
614
650
|
describe() {
|
|
615
651
|
return `Histogram of ${this.options.values.length} values`;
|
|
@@ -624,12 +660,12 @@ var ui = class extends O {
|
|
|
624
660
|
update(e) {
|
|
625
661
|
this.setOptions({ values: e });
|
|
626
662
|
}
|
|
627
|
-
},
|
|
663
|
+
}, Fi = class extends W {
|
|
628
664
|
compute(e, t, n, r) {
|
|
629
|
-
return
|
|
665
|
+
return Zn(this.options, e, t, n, r);
|
|
630
666
|
}
|
|
631
667
|
draw(e, t, n, r, i, a) {
|
|
632
|
-
|
|
668
|
+
Or(e, t, n, this.options, r, i, a);
|
|
633
669
|
}
|
|
634
670
|
describe() {
|
|
635
671
|
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];
|
|
@@ -639,21 +675,21 @@ var ui = class extends O {
|
|
|
639
675
|
return this.options.onDayClick !== void 0;
|
|
640
676
|
}
|
|
641
677
|
hits(e, t, n) {
|
|
642
|
-
return
|
|
678
|
+
return x(e, t, n)?.day !== void 0;
|
|
643
679
|
}
|
|
644
680
|
clickAt(e, t, n) {
|
|
645
|
-
let r =
|
|
681
|
+
let r = x(e, t, n)?.day;
|
|
646
682
|
r && this.options.onDayClick?.(r);
|
|
647
683
|
}
|
|
648
684
|
update(e) {
|
|
649
685
|
this.setOptions({ data: e });
|
|
650
686
|
}
|
|
651
|
-
}, G = 12,
|
|
687
|
+
}, G = 12, Ii = class extends W {
|
|
652
688
|
compute(e, t, n, r) {
|
|
653
|
-
return
|
|
689
|
+
return tr(this.options, e, t, n, r);
|
|
654
690
|
}
|
|
655
691
|
draw(e, t, n, r, i, a) {
|
|
656
|
-
|
|
692
|
+
Ir(e, t, n, this.options, r, i, a);
|
|
657
693
|
}
|
|
658
694
|
describe() {
|
|
659
695
|
let { rows: e, columns: t } = this.options;
|
|
@@ -663,21 +699,21 @@ var ui = class extends O {
|
|
|
663
699
|
return this.options.onCellClick !== void 0;
|
|
664
700
|
}
|
|
665
701
|
hits(e, t, n) {
|
|
666
|
-
return
|
|
702
|
+
return S(e, t, n) !== null;
|
|
667
703
|
}
|
|
668
704
|
clickAt(e, t, n) {
|
|
669
|
-
let r =
|
|
705
|
+
let r = S(e, t, n);
|
|
670
706
|
r && this.options.onCellClick?.(r.cell);
|
|
671
707
|
}
|
|
672
708
|
update(e) {
|
|
673
709
|
this.setOptions({ values: e });
|
|
674
710
|
}
|
|
675
|
-
},
|
|
711
|
+
}, Li = class extends W {
|
|
676
712
|
compute(e, t, n, r) {
|
|
677
|
-
return
|
|
713
|
+
return Qn(this.options, e, t, n, r);
|
|
678
714
|
}
|
|
679
715
|
draw(e, t, n, r, i, a) {
|
|
680
|
-
|
|
716
|
+
kr(e, t, n, this.options, r, i, a);
|
|
681
717
|
}
|
|
682
718
|
describe() {
|
|
683
719
|
return `Counter-clock chart of price against volume, ${this.options.period ?? 25}-bar averages`;
|
|
@@ -686,19 +722,19 @@ var ui = class extends O {
|
|
|
686
722
|
return this.options.onPointClick !== void 0;
|
|
687
723
|
}
|
|
688
724
|
hits(e, t, n) {
|
|
689
|
-
return
|
|
725
|
+
return w(e, t, n) !== null;
|
|
690
726
|
}
|
|
691
727
|
clickAt(e, t, n) {
|
|
692
|
-
let r =
|
|
728
|
+
let r = w(e, t, n);
|
|
693
729
|
r && this.options.onPointClick?.(r.point);
|
|
694
730
|
}
|
|
695
731
|
getPhase() {
|
|
696
|
-
return
|
|
732
|
+
return ar(sr(this.options.data, this.options.period ?? 25, Hr(this.options)));
|
|
697
733
|
}
|
|
698
734
|
update(e) {
|
|
699
735
|
this.setOptions({ data: e });
|
|
700
736
|
}
|
|
701
|
-
},
|
|
737
|
+
}, Ri = [
|
|
702
738
|
"Jan",
|
|
703
739
|
"Feb",
|
|
704
740
|
"Mar",
|
|
@@ -733,7 +769,7 @@ function J(e) {
|
|
|
733
769
|
if (e.length === 0) return [];
|
|
734
770
|
let t = [];
|
|
735
771
|
for (let n of e) {
|
|
736
|
-
let e =
|
|
772
|
+
let e = Bt(n.time, "1M"), r = t[t.length - 1];
|
|
737
773
|
r && r.key === e ? r.close = n.equity : t.push({
|
|
738
774
|
key: e,
|
|
739
775
|
close: n.equity
|
|
@@ -746,7 +782,7 @@ function J(e) {
|
|
|
746
782
|
let a = new Date(e.key), o = a.getUTCFullYear(), s = a.getUTCMonth();
|
|
747
783
|
r.push({
|
|
748
784
|
id: `${o}-${String(s + 1).padStart(2, "0")}`,
|
|
749
|
-
label:
|
|
785
|
+
label: Ri[s],
|
|
750
786
|
group: String(o),
|
|
751
787
|
value: i
|
|
752
788
|
});
|
|
@@ -807,9 +843,9 @@ function Q(e) {
|
|
|
807
843
|
//#endregion
|
|
808
844
|
//#region src/finance/PerformanceDashboard.ts
|
|
809
845
|
function $(e) {
|
|
810
|
-
return !e || e === "dark" ? ve : e === "light" ?
|
|
846
|
+
return !e || e === "dark" ? ve : e === "light" ? Ne : e;
|
|
811
847
|
}
|
|
812
|
-
var
|
|
848
|
+
var zi = class {
|
|
813
849
|
options;
|
|
814
850
|
theme;
|
|
815
851
|
root;
|
|
@@ -958,6 +994,6 @@ var yi = class {
|
|
|
958
994
|
}
|
|
959
995
|
};
|
|
960
996
|
//#endregion
|
|
961
|
-
export {
|
|
997
|
+
export { Jt as AlertManager, Yt as Animator, ji as BarChart, Xt as BarCountdown, Zt as BinanceAdapter, Qt as BybitAdapter, $t as CANDLE_PATTERNS, me as CHART_STYLE_KEYS, oi as CORRECTABLE_BARS, Fi as CalendarChart, c as Chart, wi as ChartGrid, en as ChartLegend, tn as ChartStateManager, nn as CoinbaseAdapter, rn as CompareRenderer, Li as CounterClockChart, an as CrosshairTooltip, on as CurrentPriceLine, he as DARK_PRICE_LIMITS, ge as DARK_TERMINAL, _e as DARK_THEME, ye as DEFAULT_DRAWING_STYLE, be as DEFAULT_FONT_FAMILY, e as DEFAULT_HISTORY_PAGE_SIZE, sn as DEFAULT_LEGEND_CONFIG, cn as DEFAULT_MAX_WEBGL_CHARTS, xe as DEFAULT_RECONNECT, ln as DEFAULT_SESSION_HOURS, Se as DEFAULT_SIGNAL_STYLE, Ce as DEFAULT_STREAM_CONFIG, we as DEFAULT_TIMEFRAME_FAVORITES, Te as DEFAULT_TRADE_ZONE_STYLE, Ee as DEFAULT_TRADING_CONFIG, un as DataExporter, i as DataManager, Ei as DepthChart, Mi as DonutChart, ie as DragDropImporter, dn as DrawingBase, te as EXCHANGE_TIMEZONE, le as EXCHANGE_TIME_ZONE, fn as Easing, H as EquityCurveChart, Ai as GaugeChart, de as HISTORY_RETRY_MS, De as HNX_SESSIONS, Oe as HOSE_SESSIONS, U as HeatmapChart, Pi as HistogramChart, mn as INDICATOR_CATEGORIES, hn as IndicatorBase, gn as IndicatorValueMap, _n as KEPT_BUCKETS, ke as KRX_SESSIONS, Ae as KR_COLORS, vn as KeyboardHandler, yn as KrakenAdapter, je as LIGHT_PRICE_LIMITS, Me as LIGHT_THEME, fe as LayoutManager, ce as LayoutSession, Pe as MARKET_CRYPTO, Fe as MARKET_HNX, Ie as MARKET_HOSE, Le as MARKET_HOSE_ETF, Re as MARKET_KRX, d as MARKET_NXT, f as MARKET_NYSE, p as MARKET_UPBIT_KRW, m as MARKET_UPCOM, h as MARKET_VN30F, bn as MAX_ALERT_BARS, re as MAX_LAYOUT_NAME, xn as MIN_ALERT_BARS, ze as MS_TIME_THRESHOLD, Sn as ManualFeed, Ii as MatrixChart, Cn as MockAdapter, Be as NXT_SESSIONS, ue as PLUGIN_API_VERSION, A as POWERED_BY_LABEL, Ve as PRICE_SOURCES, wn as PaperExecutionAdapter, zi as PerformanceDashboard, ae as PluginManager, Tn as PollingAdapter, En as RANGE_PRESETS, Dn as ReconnectManager, On as ReplayController, kn as ReplayManager, An as ResamplingAdapter, jn as ReshapeMemo, He as SANS_FONT_FAMILY, Ni as ScatterChart, Mn as Screenshot, Nn as SessionBreaks, Pn as SessionShading, Fn as SignalMarkerManager, Ti as SparklineChart, In as StreamManager, Ue as TC_PALETTE, We as TC_SERIES_COLORS, Ge as TIMEFRAMES_CRYPTO, Ke as TIMEFRAMES_FOREX, qe as TIMEFRAMES_STOCK, j as TRADECANVAS_MARK_SVG, k as TRADECANVAS_URL, M as TRADECANVAS_WORDMARK_SVG, r as ThemeManager, Ln as TickAggregator, Rn as TickBarAdapter, zn as TickBarBuilder, Bn as TradeZoneManager, Je as UPCOM_SESSIONS, Vn as UndoRedoManager, Hn as UpbitAdapter, Ye as VN30F_SESSIONS, Xe as VN_COLORS, Ze as VOLUME_ALPHA, v as VolumeRenderer, Di as WaterfallChart, Un as Watermark, Wn as WebSocketAdapter, Gn as adapterFromFeed, Kn as axisTimes, Jn as barIndexToX, Qe as barTimeUnit, $e as barsAreDaily, oe as cleanLayoutName, ne as clearGlobalPlugins, q as computeDrawdownCurve, J as computeMonthlyReturns, et as computePriceLimits, tt as contrastRatio, rr as correlationMatrix, ir as counterClockPhase, or as counterClockPoints, nt as createMarketTheme, Si as createPoweredBy, rt as createVNTheme, cr as describeInputs, lr as detectCandlePatterns, mi as feedBars, ur as feedFromAdapter, it as formatFraction, at as formatNumber, dr as formatTooltipTime, ot as formatVND, st as formatVolumeLoc, ct as fractionTick, lt as getCurrentSession, u as getGlobalPlugins, ut as getLocale, fr as histogramBins, pr as indicatorCategory, dt as indicatorSource, ft as inkOn, mr as isDataFeed, gr as isPriceLevelAlert, pt as isPriceSource, mt as isTimeFrame, ht as isValidTimeZone, ee as localStorageLayouts, br as lttbDownsample, xr as lttbVisibleIndices, gt as marketStatus, o as memoryLayouts, Sr as niceScale, _t as normalizeBar, vt as normalizeBarTime, yt as offsetAt, R as opensElsewhere, Ci as overlayScale, pe as overlaysForLayer, bt as parseIndicatorSource, se as parseOHLCV, xt as parseTimeframe, St as pickBaseTimeframe, s as pluginKey, B as poweredByHtml, P as poweredByLayout, Ct as priceFormatterFor, wt as priceStepAt, Cr as priceToY, wr as priceToYMapper, Er as rangePresetStart, Tt as rankSymbols, Et as readNews, Dt as readQuote, Ot as readableOn, kt as registerLocale, l as registerPlugin, At as resampleBars, jt as roundToPriceStep, L as safeBadgeHref, Mt as scaleMarketPrices, Q as selectKeyStats, Br as servesTimeframe, Nt as setLocale, Vr as setMaxWebGLCharts, Pt as sourcePrice, Ft as stepDecimals, It as symbolTimeZone, ai as syncIndicators, Lt as t, Rt as tickBarCount, Ur as timeToX, zt as timeframeBucketStart, Vt as timeframeToMs, Wr as timestampToBarIndex, K as toEquityPoints, Kr as toHeikinAshi, qr as toKagi, Jr as toLineBreak, Yr as toPointAndFigure, Xr as toRangeBars, Zr as toRenko, a as unregisterPlugin, Ht as usesKoreanUnits, Ut as vn30fContracts, Wt as vn30fLastTradingDay, Gt as volumeColor, Kt as wallToUtc, Qr as withResampling, $r as withTickBars, ei as xToBarIndex, ti as xToTime, ni as yToPrice, qt as zoneOffsetMinutes };
|
|
962
998
|
|
|
963
999
|
//# sourceMappingURL=index.js.map
|