@tradecanvas/chart 1.12.0 → 1.13.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/README.md +45 -1
- package/dist/Chart.d.ts +66 -7
- package/dist/Chart.d.ts.map +1 -1
- package/dist/LayoutSession-BOUFA2gH.cjs +2 -0
- package/dist/LayoutSession-BOUFA2gH.cjs.map +1 -0
- package/dist/{LayoutSession-2yRujs2S.js → LayoutSession-CiDh-H9-.js} +473 -322
- package/dist/LayoutSession-CiDh-H9-.js.map +1 -0
- package/dist/ThemeManager.d.ts +36 -2
- package/dist/ThemeManager.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -25
- package/dist/index.js.map +1 -1
- package/dist/style/styleOptions.d.ts +8 -0
- package/dist/style/styleOptions.d.ts.map +1 -0
- package/dist/widget/ChartWidget.d.ts +58 -1
- package/dist/widget/ChartWidget.d.ts.map +1 -1
- package/dist/widget/ChartWidgetGrid.d.ts +16 -1
- package/dist/widget/ChartWidgetGrid.d.ts.map +1 -1
- package/dist/widget/WidgetAccountPanel.d.ts.map +1 -1
- package/dist/widget/WidgetAlertsPanel.d.ts.map +1 -1
- package/dist/widget/WidgetChartNav.d.ts.map +1 -1
- package/dist/widget/WidgetContextMenu.d.ts.map +1 -1
- package/dist/widget/WidgetDataWindow.d.ts.map +1 -1
- package/dist/widget/WidgetDepthLadder.d.ts.map +1 -1
- package/dist/widget/WidgetDrawingSettings.d.ts.map +1 -1
- package/dist/widget/WidgetDrawingSidebar.d.ts +9 -1
- package/dist/widget/WidgetDrawingSidebar.d.ts.map +1 -1
- package/dist/widget/WidgetGoToDate.d.ts.map +1 -1
- package/dist/widget/WidgetIndicatorLegend.d.ts.map +1 -1
- package/dist/widget/WidgetObjectTree.d.ts.map +1 -1
- package/dist/widget/WidgetReplayBar.d.ts.map +1 -1
- package/dist/widget/WidgetStatusBar.d.ts +10 -1
- package/dist/widget/WidgetStatusBar.d.ts.map +1 -1
- package/dist/widget/WidgetStyles.d.ts.map +1 -1
- package/dist/widget/WidgetSymbolInfo.d.ts.map +1 -1
- package/dist/widget/WidgetToolbar.d.ts +6 -0
- package/dist/widget/WidgetToolbar.d.ts.map +1 -1
- package/dist/widget/hostButtons.d.ts +5 -0
- package/dist/widget/hostButtons.d.ts.map +1 -0
- package/dist/widget/hostMenus.d.ts +7 -0
- package/dist/widget/hostMenus.d.ts.map +1 -0
- package/dist/widget/index.cjs +45 -12
- package/dist/widget/index.cjs.map +1 -1
- package/dist/widget/index.d.ts +3 -1
- package/dist/widget/index.d.ts.map +1 -1
- package/dist/widget/index.js +1584 -1137
- package/dist/widget/index.js.map +1 -1
- package/dist/widget/legendValues.d.ts +4 -2
- package/dist/widget/legendValues.d.ts.map +1 -1
- package/dist/widget/types.d.ts +90 -0
- package/dist/widget/types.d.ts.map +1 -1
- package/dist/widget/widgetConfig.d.ts +12 -0
- package/dist/widget/widgetConfig.d.ts.map +1 -1
- package/dist/widget/widgetFeatures.d.ts +74 -0
- package/dist/widget/widgetFeatures.d.ts.map +1 -0
- package/package.json +3 -3
- package/dist/LayoutSession-1uhJw0L7.cjs +0 -2
- package/dist/LayoutSession-1uhJw0L7.cjs.map +0 -1
- package/dist/LayoutSession-2yRujs2S.js.map +0 -1
package/dist/ThemeManager.d.ts
CHANGED
|
@@ -1,12 +1,46 @@
|
|
|
1
|
-
import { ShapeConfig, Theme, ThemeName } from '@tradecanvas/commons';
|
|
1
|
+
import { ChartStyleKey, ChartStyleOverrides, ChartStyleOverridesPatch, ChartType, ShapeConfig, StyleLayer, Theme, ThemeName } from '@tradecanvas/commons';
|
|
2
|
+
/**
|
|
3
|
+
* The chart's theme and its style overrides. The theme drawn with
|
|
4
|
+
* (`getTheme`) is the base theme with the overrides on it, worked out once
|
|
5
|
+
* per change: the host's layer, then the user's for the base theme's name
|
|
6
|
+
* (what someone chose for the dark theme stays with the dark theme).
|
|
7
|
+
*/
|
|
2
8
|
export declare class ThemeManager {
|
|
3
|
-
private
|
|
9
|
+
private base;
|
|
4
10
|
/** Shapes set apart from the theme (`setShapes`): they stay through theme switches. */
|
|
5
11
|
private shape;
|
|
12
|
+
private chartType;
|
|
13
|
+
private host;
|
|
14
|
+
/** The user's overrides, by the name of the theme they were made on. */
|
|
15
|
+
private user;
|
|
16
|
+
private effective;
|
|
6
17
|
constructor(themeOrName?: ThemeName | Theme);
|
|
18
|
+
private static read;
|
|
19
|
+
/** The theme as drawn: the base with the overrides on it. */
|
|
7
20
|
getTheme(): Theme;
|
|
21
|
+
/** The theme as set, without the overrides. */
|
|
22
|
+
getBaseTheme(): Theme;
|
|
8
23
|
setTheme(themeOrName: ThemeName | Theme): void;
|
|
9
24
|
/** Shapes over every theme from now on (null: each theme's own). */
|
|
10
25
|
setShape(shape: ShapeConfig | null): void;
|
|
26
|
+
/** The main series' type: its `series.<type>.*` keys apply. */
|
|
27
|
+
setChartType(type: ChartType): void;
|
|
28
|
+
/** Set (a value) or take away (`null`) overrides on a layer; true when that changed anything. */
|
|
29
|
+
applyOverrides(patch: ChartStyleOverridesPatch, layer: StyleLayer): boolean;
|
|
30
|
+
/** `overrides` in place of a layer's; true when that changed anything. */
|
|
31
|
+
setOverrides(overrides: ChartStyleOverrides, layer: StyleLayer): boolean;
|
|
32
|
+
/** Take away `keys` (all of them without) from a layer; true when that changed anything. */
|
|
33
|
+
resetOverrides(layer: StyleLayer, keys?: readonly ChartStyleKey[]): boolean;
|
|
34
|
+
/** A layer's overrides (the user's for the current theme). */
|
|
35
|
+
getOverrides(layer: StyleLayer): ChartStyleOverrides;
|
|
36
|
+
/** The user's overrides on every theme, by theme name, for saving. */
|
|
37
|
+
getUserOverrides(): Record<string, ChartStyleOverrides>;
|
|
38
|
+
/** The user's overrides in place of theirs, by theme name (a layout loaded); true when that changed anything. */
|
|
39
|
+
setUserOverrides(byTheme: Record<string, ChartStyleOverrides>): boolean;
|
|
40
|
+
/** What `key` resolves to now. */
|
|
41
|
+
getStyleValue(key: ChartStyleKey): string | number | boolean | null;
|
|
42
|
+
private layer;
|
|
43
|
+
private setLayer;
|
|
44
|
+
private merged;
|
|
11
45
|
}
|
|
12
46
|
//# sourceMappingURL=ThemeManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeManager.d.ts","sourceRoot":"","sources":["../src/ThemeManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ThemeManager.d.ts","sourceRoot":"","sources":["../src/ThemeManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,wBAAwB,EACxB,SAAS,EACT,WAAW,EACX,UAAU,EACV,KAAK,EACL,SAAS,EACV,MAAM,sBAAsB,CAAC;AAG9B;;;;;GAKG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,IAAI,CAAQ;IACpB,uFAAuF;IACvF,OAAO,CAAC,KAAK,CAA4B;IACzC,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,IAAI,CAA2B;IACvC,wEAAwE;IACxE,OAAO,CAAC,IAAI,CAA0C;IACtD,OAAO,CAAC,SAAS,CAAsB;gBAE3B,WAAW,CAAC,EAAE,SAAS,GAAG,KAAK;IAI3C,OAAO,CAAC,MAAM,CAAC,IAAI;IAQnB,6DAA6D;IAC7D,QAAQ,IAAI,KAAK;IAKjB,+CAA+C;IAC/C,YAAY,IAAI,KAAK;IAIrB,QAAQ,CAAC,WAAW,EAAE,SAAS,GAAG,KAAK,GAAG,IAAI;IAM9C,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI;IAMzC,+DAA+D;IAC/D,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;IAMnC,iGAAiG;IACjG,cAAc,CAAC,KAAK,EAAE,wBAAwB,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO;IAU3E,0EAA0E;IAC1E,YAAY,CAAC,SAAS,EAAE,mBAAmB,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO;IAIxE,4FAA4F;IAC5F,cAAc,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,SAAS,aAAa,EAAE,GAAG,OAAO;IAO3E,8DAA8D;IAC9D,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB;IAIpD,sEAAsE;IACtE,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC;IAMvD,iHAAiH;IACjH,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAAG,OAAO;IAOvE,kCAAkC;IAClC,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI;IAInE,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,MAAM;CAGf"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./LayoutSession-1uhJw0L7.cjs`);let t=require(`@tradecanvas/commons`),n=require(`@tradecanvas/core`);var r={"1x1":{cols:1,rows:1},"1x2":{cols:2,rows:1},"2x1":{cols:1,rows:2},"2x2":{cols:2,rows:2},"1x3":{cols:3,rows:1},"3x1":{cols:1,rows:3},"2x3":{cols:3,rows:2},"3x2":{cols:2,rows:3}},i=class{root;cells=[];layout;options;destroyed=!1;syncing=!1;constructor(e,t={}){this.options=t,this.layout=t.layout??`2x2`,this.root=document.createElement(`div`),this.root.style.cssText=`display:grid;width:100%;height:100%;overflow:hidden;`,e.appendChild(this.root),this.applyLayout(),this.createCells()}applyLayout(){let{cols:e,rows:t}=r[this.layout],n=this.options.gap??1;this.root.style.gridTemplateColumns=`repeat(${e}, 1fr)`,this.root.style.gridTemplateRows=`repeat(${t}, 1fr)`,this.root.style.gap=`${n}px`}createCells(){let{cols:e,rows:t}=r[this.layout],n=e*t;for(let e=0;e<n;e++)this.cells.push(this.createCell(e))}createCell(t){let n=this.options.cells?.[t]??{},r=document.createElement(`div`);r.style.cssText=`position:relative;overflow:hidden;min-width:0;min-height:0;`,this.root.appendChild(r);let i=new e.c(r,{chartType:`candlestick`,autoScale:!0,features:{crosshair:!0,keyboard:!0,volume:!0,legend:!0,priceAxis:!0,timeAxis:!0,grid:!0},...this.options.chartOptions,...n.chartOptions,theme:this.options.theme}),a={container:r,chart:i,symbol:n.symbol??`Chart ${t+1}`,timeframe:n.timeframe??`5m`};return this.options.syncCrosshair!==!1&&(i.on(`crosshairMove`,e=>{let t=e.payload.bar?.time;if(t!==void 0)for(let e of this.cells)e.chart!==i&&e.chart.setCrosshairTime(t)}),i.on(`crosshairLeave`,()=>{for(let e of this.cells)e.chart!==i&&e.chart.setCrosshairTime(null)})),this.options.syncTimeAxis!==!1&&i.on(`visibleRangeChange`,e=>{if(this.syncing)return;this.syncing=!0;let{from:t,to:n}=e.payload,r=i.getData();if(r.length>0&&t>=0&&n<r.length){let e=r[t]?.time,a=r[n]?.time;if(e&&a)for(let t of this.cells)t.chart!==i&&t.chart.setVisibleRange(e,a)}this.syncing=!1}),a}setLayout(e){if(e===this.layout)return;let t=this.cells.length,{cols:n,rows:i}=r[e],a=n*i;if(a<t)for(let e=t-1;e>=a;e--){let t=this.cells[e];t.chart.destroy(),t.container.remove(),this.cells.pop()}this.layout=e,this.applyLayout();for(let e=t;e<a;e++)this.cells.push(this.createCell(e))}getChart(e){return this.cells[e]?.chart??null}getCharts(){return this.cells.map(e=>e.chart)}getCellCount(){return this.cells.length}setData(e,t){this.cells[e]?.chart.setData(t)}setAllData(e){for(let t of this.cells)t.chart.setData(e)}async connectCell(e,t){let n=this.cells[e];n&&(n.symbol=t.symbol,n.timeframe=t.timeframe,await n.chart.connect(t))}async connectAll(e,t,n,r=500){let i=[];for(let a=0;a<this.cells.length&&a<t.length;a++)i.push(this.connectCell(a,{adapter:typeof e==`function`?e(t[a],a):e,symbol:t[a],timeframe:n,historyLimit:r}));await Promise.all(i)}setTheme(e){for(let t of this.cells)t.chart.setTheme(e)}destroy(){if(!this.destroyed){this.destroyed=!0;for(let e of this.cells)e.chart.destroy(),e.container.remove();this.cells=[],this.root.remove()}}},a=class extends n.BaseFinanceChart{options;constructor(e,t){super(e,t.theme),this.options=t,this.requestRender()}renderChart(e,t,r,i){(0,n.renderSparkline)(e,t,r,this.options,i)}update(e){this.options={...this.options,data:e},this.requestRender()}setOptions(e){this.options={...this.options,...e},this.requestRender()}},o=class extends n.BaseFinanceChart{options;crosshair=null;constructor(e,t){super(e,t.theme),this.options=t,t.crosshair!==!1&&(this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender())),this.requestRender()}renderChart(e,t,r,i){let a=this.crosshair?.getPosition()??null;(0,n.renderDepthChart)(e,t,r,this.options,i,a)}update(e){this.options={...this.options,data:e},this.requestRender()}setOptions(e){this.options={...this.options,...e},this.requestRender()}destroy(){this.crosshair?.destroy(),super.destroy()}},s=class extends n.BaseFinanceChart{options;crosshair=null;constructor(e,t){super(e,t.theme),this.options=t,t.crosshair!==!1&&(this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender())),this.requestRender()}renderChart(e,t,r,i){let a=this.crosshair?.getPosition()??null;(0,n.renderEquityCurve)(e,t,r,this.options,i,a)}update(e,t){this.options={...this.options,data:e},t!==void 0&&(this.options={...this.options,benchmark:t}),this.requestRender()}setOptions(e){this.options={...this.options,...e},this.requestRender()}destroy(){this.crosshair?.destroy(),super.destroy()}},c=class extends n.BaseFinanceChart{options;crosshair=null;cachedRects=[];currentData=[];lastLayoutWidth=0;lastLayoutHeight=0;handleClick=null;constructor(e,t){super(e,t.theme),this.options=t,this.currentData=t.data??[],t.crosshair!==!1&&(this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender())),t.onCellClick&&(this.handleClick=e=>{let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;this.onCanvasClick(n,r)},this.canvas.addEventListener(`click`,this.handleClick)),this.recomputeLayout(),this.requestRender()}recomputeLayout(){let e={x:0,y:0,width:this.width,height:this.height},t=this.options.cellPadding??2;if(this.lastLayoutWidth=this.width,this.lastLayoutHeight=this.height,this.options.weighted){let r=this.currentData.map(e=>({id:e.id,weight:e.weight??(Math.abs(e.value)||1)}));this.cachedRects=(0,n.layoutSquarifiedTreemap)(r,e,t)}else this.cachedRects=(0,n.layoutUniformGrid)(this.currentData.map(e=>({id:e.id})),e,t)}onCanvasClick(e,t){if(this.options.onCellClick)for(let n of this.cachedRects){let r=n.rect;if(e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height){let e=this.currentData.find(e=>e.id===n.id);e&&this.options.onCellClick(e);return}}}renderChart(e,t,r,i){(t!==this.lastLayoutWidth||r!==this.lastLayoutHeight)&&this.recomputeLayout();let a=this.crosshair?.getPosition()??null;(0,n.renderHeatmap)(e,t,r,this.currentData,this.cachedRects,this.options,i,a)}update(e){this.currentData=e,this.options={...this.options,data:e},this.recomputeLayout(),this.requestRender()}setOptions(e){this.options={...this.options,...e},e.data&&(this.currentData=e.data),this.recomputeLayout(),this.requestRender()}destroy(){this.crosshair?.destroy(),this.handleClick&&this.canvas.removeEventListener(`click`,this.handleClick),super.destroy()}},l=class extends n.BaseFinanceChart{options;crosshair=null;constructor(e,t){super(e,t.theme),this.options=t,t.crosshair!==!1&&(this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender())),this.requestRender()}renderChart(e,t,r,i){let a=this.crosshair?.getPosition()??null;(0,n.renderWaterfall)(e,t,r,this.options,i,a)}update(e){this.options={...this.options,data:e},this.requestRender()}setOptions(e){this.options={...this.options,...e},this.requestRender()}destroy(){this.crosshair?.destroy(),super.destroy()}},u=500;function d(e){let t=1-e;return 1-t*t*t}var f=class extends n.BaseFinanceChart{options;currentValue;targetValue;animationStart=null;animationFrom=0;animationFrameId=null;constructor(e,t){super(e,t.theme),this.options=t,this.currentValue=t.value,this.targetValue=t.value,this.requestRender()}renderChart(e,t,r,i){(0,n.renderGauge)(e,t,r,this.options,i,this.currentValue)}setValue(e){if(this.options.animate===!1){this.cancelAnimation(),this.currentValue=e,this.targetValue=e,this.options={...this.options,value:e},this.requestRender();return}this.targetValue=e,this.animationFrom=this.currentValue,this.animationStart=performance.now(),this.options={...this.options,value:e},this.startAnimationLoop()}setOptions(e){let t={...this.options,...e};if(e.value!==void 0&&e.value!==this.targetValue){this.options=t,this.setValue(e.value);return}this.options=t,this.requestRender()}startAnimationLoop(){if(this.animationFrameId!==null)return;let e=()=>{if(this.animationFrameId=null,this.animationStart===null)return;let t=this.options.animationDuration??u,n=performance.now()-this.animationStart,r=Math.min(1,n/Math.max(1,t)),i=d(r);this.currentValue=this.animationFrom+(this.targetValue-this.animationFrom)*i,this.requestRender(),r<1?this.animationFrameId=requestAnimationFrame(e):(this.currentValue=this.targetValue,this.animationStart=null)};this.animationFrameId=requestAnimationFrame(e)}cancelAnimation(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null),this.animationStart=null}destroy(){this.cancelAnimation(),super.destroy()}},p=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function m(e){return e.map(e=>({time:e.time,value:e.equity}))}function h(e){let t=-1/0;return e.map(e=>{e.equity>t&&(t=e.equity);let n=t>0?(e.equity/t-1)*100:0;return{time:e.time,value:n}})}function g(e){if(e.length===0)return[];let n=[];for(let r of e){let e=(0,t.timeframeBucketStart)(r.time,`1M`),i=n[n.length-1];i&&i.key===e?i.close=r.equity:n.push({key:e,close:r.equity})}let r=e[0].equity,i=[];for(let e of n){let t=r===0?1:r,n=(e.close/t-1)*100;r=e.close;let a=new Date(e.key),o=a.getUTCFullYear(),s=a.getUTCMonth();i.push({id:`${o}-${String(s+1).padStart(2,`0`)}`,label:p[s],group:String(o),value:n})}return i}function _(e){return`${e>0?`+`:``}${e.toFixed(2)}%`}function v(e){return e>0?`positive`:e<0?`negative`:`neutral`}function y(e){return[{label:`Total Return`,value:_(e.totalReturnPct),tone:v(e.totalReturnPct)},{label:`CAGR`,value:_(e.cagr*100),tone:v(e.cagr)},{label:`Sharpe`,value:e.sharpe.toFixed(2),tone:v(e.sharpe)},{label:`Sortino`,value:e.sortino.toFixed(2),tone:v(e.sortino)},{label:`Max Drawdown`,value:_(e.maxDrawdownPct),tone:`negative`},{label:`Win Rate`,value:`${(e.winRate*100).toFixed(1)}%`,tone:`neutral`},{label:`Profit Factor`,value:Number.isFinite(e.profitFactor)?e.profitFactor.toFixed(2):`∞`,tone:v(e.profitFactor-1)},{label:`Trades`,value:String(e.trades),tone:`neutral`}]}function b(e){return!e||e===`dark`?t.DARK_THEME:e===`light`?t.LIGHT_THEME:e}var x=class{options;theme;root;equityChart=null;drawdownChart=null;heatmap=null;constructor(e,t){this.options=t,this.theme=b(t.theme),this.root=document.createElement(`div`),this.build(),e.appendChild(this.root)}build(){let e=this.theme,{result:t,title:n,subtitle:r}=this.options,i=this.panelBackground(),a=e.grid;if(this.root.style.cssText=[`display:flex`,`flex-direction:column`,`gap:14px`,`width:100%`,`box-sizing:border-box`,`padding:16px`,`background:${e.background}`,`color:${e.text}`,`font-family:${e.font.family}`].join(`;`),n||r){let t=document.createElement(`div`);if(n){let r=document.createElement(`div`);r.textContent=n,r.style.cssText=`font-size:${e.font.sizeLarge}px;font-weight:600;letter-spacing:-0.01em;`,t.appendChild(r)}if(r){let n=document.createElement(`div`);n.textContent=r,n.style.cssText=`font-size:${e.font.sizeSmall}px;color:${e.textSecondary};margin-top:2px;`,t.appendChild(n)}this.root.appendChild(t)}this.root.appendChild(this.buildStatsStrip(y(t.metrics),i,a));let o=document.createElement(`div`);o.style.cssText=[`display:grid`,`grid-template-columns:repeat(auto-fit, minmax(280px, 1fr))`,`grid-auto-rows:220px`,`gap:14px`].join(`;`),this.root.appendChild(o);let l=this.buildPanel(`Equity Curve`,i,a);l.wrap.style.gridColumn=`1 / -1`,o.appendChild(l.wrap),this.equityChart=new s(l.body,{data:m(t.equityCurve),theme:e,lineColor:e.candleUp,fillArea:!0,crosshair:!0});let u=this.buildPanel(`Drawdown`,i,a);o.appendChild(u.wrap),this.drawdownChart=new s(u.body,{data:h(t.equityCurve),theme:e,lineColor:e.candleDown,fillArea:!0,crosshair:!0,valueFormat:e=>`${e.toFixed(1)}%`});let d=g(t.equityCurve),f=this.buildPanel(`Monthly Returns`,i,a);o.appendChild(f.wrap),this.heatmap=new c(f.body,{data:d,theme:e,showValues:!0,valueFormat:e=>`${e>=0?`+`:``}${e.toFixed(1)}`,colorScale:{negative:e.candleDown,zero:i,positive:e.candleUp}})}buildStatsStrip(e,t,n){let r=document.createElement(`div`);r.style.cssText=[`display:grid`,`grid-template-columns:repeat(auto-fit, minmax(120px, 1fr))`,`gap:10px`].join(`;`);let i=this.theme;for(let a of e){let e=document.createElement(`div`);e.style.cssText=[`background:${t}`,`border:1px solid ${n}`,`border-radius:10px`,`padding:10px 12px`,`display:flex`,`flex-direction:column`,`gap:4px`].join(`;`);let o=document.createElement(`div`);o.textContent=a.label,o.style.cssText=`font-size:${i.font.sizeSmall}px;color:${i.textSecondary};text-transform:uppercase;letter-spacing:0.04em;`;let s=document.createElement(`div`);s.textContent=a.value;let c=a.tone===`positive`?i.candleUp:a.tone===`negative`?i.candleDown:i.text;s.style.cssText=`font-size:${i.font.sizeLarge}px;font-weight:600;color:${c};font-variant-numeric:tabular-nums;`,e.appendChild(o),e.appendChild(s),r.appendChild(e)}return r}buildPanel(e,t,n){let r=this.theme,i=document.createElement(`div`);i.style.cssText=[`background:${t}`,`border:1px solid ${n}`,`border-radius:10px`,`overflow:hidden`,`display:flex`,`flex-direction:column`].join(`;`);let a=document.createElement(`div`);a.textContent=e,a.style.cssText=[`font-size:${r.font.sizeSmall}px`,`font-weight:600`,`color:${r.textSecondary}`,`padding:8px 12px`,`border-bottom:1px solid ${n}`,`text-transform:uppercase`,`letter-spacing:0.04em`].join(`;`);let o=document.createElement(`div`);return o.style.cssText=`flex:1;min-height:0;position:relative;`,i.appendChild(a),i.appendChild(o),{wrap:i,body:o}}panelBackground(){return this.theme.name===`light`?`rgba(0,0,0,0.02)`:`rgba(255,255,255,0.03)`}update(e){this.options={...this.options,result:e},this.destroyCharts(),this.root.replaceChildren(),this.build()}setTheme(e){this.theme=b(e),this.options={...this.options,theme:e},this.destroyCharts(),this.root.replaceChildren(),this.build()}destroyCharts(){this.equityChart?.destroy(),this.drawdownChart?.destroy(),this.heatmap?.destroy(),this.equityChart=null,this.drawdownChart=null,this.heatmap=null}destroy(){this.destroyCharts(),this.root.remove()}};Object.defineProperty(exports,`AlertManager`,{enumerable:!0,get:function(){return n.AlertManager}}),Object.defineProperty(exports,`Animator`,{enumerable:!0,get:function(){return n.Animator}}),Object.defineProperty(exports,`BarCountdown`,{enumerable:!0,get:function(){return n.BarCountdown}}),Object.defineProperty(exports,`BinanceAdapter`,{enumerable:!0,get:function(){return n.BinanceAdapter}}),Object.defineProperty(exports,`BybitAdapter`,{enumerable:!0,get:function(){return n.BybitAdapter}}),exports.Chart=e.c,exports.ChartGrid=i,Object.defineProperty(exports,`ChartLegend`,{enumerable:!0,get:function(){return n.ChartLegend}}),Object.defineProperty(exports,`ChartStateManager`,{enumerable:!0,get:function(){return n.ChartStateManager}}),Object.defineProperty(exports,`CoinbaseAdapter`,{enumerable:!0,get:function(){return n.CoinbaseAdapter}}),Object.defineProperty(exports,`CompareRenderer`,{enumerable:!0,get:function(){return n.CompareRenderer}}),Object.defineProperty(exports,`CrosshairTooltip`,{enumerable:!0,get:function(){return n.CrosshairTooltip}}),Object.defineProperty(exports,`CurrentPriceLine`,{enumerable:!0,get:function(){return n.CurrentPriceLine}}),Object.defineProperty(exports,`DARK_TERMINAL`,{enumerable:!0,get:function(){return t.DARK_TERMINAL}}),Object.defineProperty(exports,`DARK_THEME`,{enumerable:!0,get:function(){return t.DARK_THEME}}),Object.defineProperty(exports,`DEFAULT_DRAWING_STYLE`,{enumerable:!0,get:function(){return t.DEFAULT_DRAWING_STYLE}}),exports.DEFAULT_HISTORY_PAGE_SIZE=e.b,Object.defineProperty(exports,`DEFAULT_LEGEND_CONFIG`,{enumerable:!0,get:function(){return n.DEFAULT_LEGEND_CONFIG}}),Object.defineProperty(exports,`DEFAULT_MAX_WEBGL_CHARTS`,{enumerable:!0,get:function(){return n.DEFAULT_MAX_WEBGL_CHARTS}}),Object.defineProperty(exports,`DEFAULT_RECONNECT`,{enumerable:!0,get:function(){return t.DEFAULT_RECONNECT}}),Object.defineProperty(exports,`DEFAULT_SESSION_HOURS`,{enumerable:!0,get:function(){return n.DEFAULT_SESSION_HOURS}}),Object.defineProperty(exports,`DEFAULT_SIGNAL_STYLE`,{enumerable:!0,get:function(){return t.DEFAULT_SIGNAL_STYLE}}),Object.defineProperty(exports,`DEFAULT_STREAM_CONFIG`,{enumerable:!0,get:function(){return t.DEFAULT_STREAM_CONFIG}}),Object.defineProperty(exports,`DEFAULT_TIMEFRAME_FAVORITES`,{enumerable:!0,get:function(){return t.DEFAULT_TIMEFRAME_FAVORITES}}),Object.defineProperty(exports,`DEFAULT_TRADE_ZONE_STYLE`,{enumerable:!0,get:function(){return t.DEFAULT_TRADE_ZONE_STYLE}}),Object.defineProperty(exports,`DEFAULT_TRADING_CONFIG`,{enumerable:!0,get:function(){return t.DEFAULT_TRADING_CONFIG}}),Object.defineProperty(exports,`DataExporter`,{enumerable:!0,get:function(){return n.DataExporter}}),exports.DataManager=e.S,exports.DepthChart=o,exports.DragDropImporter=e.o,Object.defineProperty(exports,`DrawingBase`,{enumerable:!0,get:function(){return n.DrawingBase}}),exports.EXCHANGE_TIMEZONE=e.l,Object.defineProperty(exports,`Easing`,{enumerable:!0,get:function(){return n.Easing}}),exports.EquityCurveChart=s,exports.GaugeChart=f,exports.HISTORY_RETRY_MS=e.x,exports.HeatmapChart=c,Object.defineProperty(exports,`IndicatorBase`,{enumerable:!0,get:function(){return n.IndicatorBase}}),Object.defineProperty(exports,`IndicatorValueMap`,{enumerable:!0,get:function(){return n.IndicatorValueMap}}),Object.defineProperty(exports,`KeyboardHandler`,{enumerable:!0,get:function(){return n.KeyboardHandler}}),Object.defineProperty(exports,`KrakenAdapter`,{enumerable:!0,get:function(){return n.KrakenAdapter}}),Object.defineProperty(exports,`LIGHT_THEME`,{enumerable:!0,get:function(){return t.LIGHT_THEME}}),exports.LayoutManager=e.v,exports.LayoutSession=e.t,Object.defineProperty(exports,`MARKET_CRYPTO`,{enumerable:!0,get:function(){return t.MARKET_CRYPTO}}),Object.defineProperty(exports,`MARKET_HNX`,{enumerable:!0,get:function(){return t.MARKET_HNX}}),Object.defineProperty(exports,`MARKET_HOSE`,{enumerable:!0,get:function(){return t.MARKET_HOSE}}),Object.defineProperty(exports,`MARKET_NYSE`,{enumerable:!0,get:function(){return t.MARKET_NYSE}}),Object.defineProperty(exports,`MARKET_UPCOM`,{enumerable:!0,get:function(){return t.MARKET_UPCOM}}),Object.defineProperty(exports,`MAX_ALERT_BARS`,{enumerable:!0,get:function(){return n.MAX_ALERT_BARS}}),exports.MAX_LAYOUT_NAME=e.n,Object.defineProperty(exports,`MIN_ALERT_BARS`,{enumerable:!0,get:function(){return n.MIN_ALERT_BARS}}),Object.defineProperty(exports,`MockAdapter`,{enumerable:!0,get:function(){return n.MockAdapter}}),exports.PLUGIN_API_VERSION=e.h,Object.defineProperty(exports,`PRICE_SOURCES`,{enumerable:!0,get:function(){return t.PRICE_SOURCES}}),Object.defineProperty(exports,`PaperExecutionAdapter`,{enumerable:!0,get:function(){return n.PaperExecutionAdapter}}),exports.PerformanceDashboard=x,exports.PluginManager=e.u,Object.defineProperty(exports,`PollingAdapter`,{enumerable:!0,get:function(){return n.PollingAdapter}}),Object.defineProperty(exports,`RANGE_PRESETS`,{enumerable:!0,get:function(){return n.RANGE_PRESETS}}),Object.defineProperty(exports,`ReplayManager`,{enumerable:!0,get:function(){return n.ReplayManager}}),Object.defineProperty(exports,`ResamplingAdapter`,{enumerable:!0,get:function(){return n.ResamplingAdapter}}),Object.defineProperty(exports,`Screenshot`,{enumerable:!0,get:function(){return n.Screenshot}}),Object.defineProperty(exports,`SessionBreaks`,{enumerable:!0,get:function(){return n.SessionBreaks}}),Object.defineProperty(exports,`SessionShading`,{enumerable:!0,get:function(){return n.SessionShading}}),Object.defineProperty(exports,`SignalMarkerManager`,{enumerable:!0,get:function(){return n.SignalMarkerManager}}),exports.SparklineChart=a,Object.defineProperty(exports,`StreamManager`,{enumerable:!0,get:function(){return n.StreamManager}}),Object.defineProperty(exports,`TC_PALETTE`,{enumerable:!0,get:function(){return t.TC_PALETTE}}),Object.defineProperty(exports,`TC_SERIES_COLORS`,{enumerable:!0,get:function(){return t.TC_SERIES_COLORS}}),Object.defineProperty(exports,`TIMEFRAMES_CRYPTO`,{enumerable:!0,get:function(){return t.TIMEFRAMES_CRYPTO}}),Object.defineProperty(exports,`TIMEFRAMES_FOREX`,{enumerable:!0,get:function(){return t.TIMEFRAMES_FOREX}}),Object.defineProperty(exports,`TIMEFRAMES_STOCK`,{enumerable:!0,get:function(){return t.TIMEFRAMES_STOCK}}),exports.ThemeManager=e.y,Object.defineProperty(exports,`TickAggregator`,{enumerable:!0,get:function(){return n.TickAggregator}}),Object.defineProperty(exports,`TickBarAdapter`,{enumerable:!0,get:function(){return n.TickBarAdapter}}),Object.defineProperty(exports,`TickBarBuilder`,{enumerable:!0,get:function(){return n.TickBarBuilder}}),Object.defineProperty(exports,`TradeZoneManager`,{enumerable:!0,get:function(){return n.TradeZoneManager}}),Object.defineProperty(exports,`UndoRedoManager`,{enumerable:!0,get:function(){return n.UndoRedoManager}}),Object.defineProperty(exports,`VN_COLORS`,{enumerable:!0,get:function(){return t.VN_COLORS}}),Object.defineProperty(exports,`VOLUME_ALPHA`,{enumerable:!0,get:function(){return t.VOLUME_ALPHA}}),Object.defineProperty(exports,`VolumeRenderer`,{enumerable:!0,get:function(){return n.VolumeRenderer}}),exports.WaterfallChart=l,Object.defineProperty(exports,`Watermark`,{enumerable:!0,get:function(){return n.Watermark}}),Object.defineProperty(exports,`WebSocketAdapter`,{enumerable:!0,get:function(){return n.WebSocketAdapter}}),Object.defineProperty(exports,`barsAreDaily`,{enumerable:!0,get:function(){return t.barsAreDaily}}),exports.cleanLayoutName=e.r,exports.clearGlobalPlugins=e.d,exports.computeDrawdownCurve=h,exports.computeMonthlyReturns=g,Object.defineProperty(exports,`computePriceLimits`,{enumerable:!0,get:function(){return t.computePriceLimits}}),Object.defineProperty(exports,`createVNTheme`,{enumerable:!0,get:function(){return t.createVNTheme}}),Object.defineProperty(exports,`formatFraction`,{enumerable:!0,get:function(){return t.formatFraction}}),Object.defineProperty(exports,`formatNumber`,{enumerable:!0,get:function(){return t.formatNumber}}),Object.defineProperty(exports,`formatTooltipTime`,{enumerable:!0,get:function(){return n.formatTooltipTime}}),Object.defineProperty(exports,`formatVND`,{enumerable:!0,get:function(){return t.formatVND}}),Object.defineProperty(exports,`formatVolumeLoc`,{enumerable:!0,get:function(){return t.formatVolumeLoc}}),Object.defineProperty(exports,`fractionTick`,{enumerable:!0,get:function(){return t.fractionTick}}),Object.defineProperty(exports,`getCurrentSession`,{enumerable:!0,get:function(){return t.getCurrentSession}}),exports.getGlobalPlugins=e.f,Object.defineProperty(exports,`getLocale`,{enumerable:!0,get:function(){return t.getLocale}}),Object.defineProperty(exports,`indicatorSource`,{enumerable:!0,get:function(){return t.indicatorSource}}),Object.defineProperty(exports,`isPriceLevelAlert`,{enumerable:!0,get:function(){return n.isPriceLevelAlert}}),Object.defineProperty(exports,`isPriceSource`,{enumerable:!0,get:function(){return t.isPriceSource}}),Object.defineProperty(exports,`isTimeFrame`,{enumerable:!0,get:function(){return t.isTimeFrame}}),Object.defineProperty(exports,`isValidTimeZone`,{enumerable:!0,get:function(){return t.isValidTimeZone}}),exports.localStorageLayouts=e.i,Object.defineProperty(exports,`lttbDownsample`,{enumerable:!0,get:function(){return n.lttbDownsample}}),Object.defineProperty(exports,`lttbVisibleIndices`,{enumerable:!0,get:function(){return n.lttbVisibleIndices}}),Object.defineProperty(exports,`marketStatus`,{enumerable:!0,get:function(){return t.marketStatus}}),exports.memoryLayouts=e.a,Object.defineProperty(exports,`normalizeBar`,{enumerable:!0,get:function(){return t.normalizeBar}}),Object.defineProperty(exports,`normalizeBarTime`,{enumerable:!0,get:function(){return t.normalizeBarTime}}),Object.defineProperty(exports,`offsetAt`,{enumerable:!0,get:function(){return t.offsetAt}}),exports.overlaysForLayer=e.g,Object.defineProperty(exports,`parseIndicatorSource`,{enumerable:!0,get:function(){return t.parseIndicatorSource}}),exports.parseOHLCV=e.s,Object.defineProperty(exports,`parseTimeframe`,{enumerable:!0,get:function(){return t.parseTimeframe}}),Object.defineProperty(exports,`pickBaseTimeframe`,{enumerable:!0,get:function(){return t.pickBaseTimeframe}}),exports.pluginKey=e._,Object.defineProperty(exports,`priceFormatterFor`,{enumerable:!0,get:function(){return t.priceFormatterFor}}),Object.defineProperty(exports,`rangePresetStart`,{enumerable:!0,get:function(){return n.rangePresetStart}}),Object.defineProperty(exports,`rankSymbols`,{enumerable:!0,get:function(){return t.rankSymbols}}),Object.defineProperty(exports,`readNews`,{enumerable:!0,get:function(){return t.readNews}}),Object.defineProperty(exports,`readQuote`,{enumerable:!0,get:function(){return t.readQuote}}),Object.defineProperty(exports,`registerLocale`,{enumerable:!0,get:function(){return t.registerLocale}}),exports.registerPlugin=e.p,Object.defineProperty(exports,`resampleBars`,{enumerable:!0,get:function(){return t.resampleBars}}),exports.selectKeyStats=y,Object.defineProperty(exports,`servesTimeframe`,{enumerable:!0,get:function(){return n.servesTimeframe}}),Object.defineProperty(exports,`setLocale`,{enumerable:!0,get:function(){return t.setLocale}}),Object.defineProperty(exports,`setMaxWebGLCharts`,{enumerable:!0,get:function(){return n.setMaxWebGLCharts}}),Object.defineProperty(exports,`sourcePrice`,{enumerable:!0,get:function(){return t.sourcePrice}}),Object.defineProperty(exports,`stepDecimals`,{enumerable:!0,get:function(){return t.stepDecimals}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t.t}}),Object.defineProperty(exports,`tickBarCount`,{enumerable:!0,get:function(){return t.tickBarCount}}),Object.defineProperty(exports,`timeframeToMs`,{enumerable:!0,get:function(){return t.timeframeToMs}}),exports.toEquityPoints=m,Object.defineProperty(exports,`toHeikinAshi`,{enumerable:!0,get:function(){return n.toHeikinAshi}}),Object.defineProperty(exports,`toKagi`,{enumerable:!0,get:function(){return n.toKagi}}),Object.defineProperty(exports,`toLineBreak`,{enumerable:!0,get:function(){return n.toLineBreak}}),Object.defineProperty(exports,`toPointAndFigure`,{enumerable:!0,get:function(){return n.toPointAndFigure}}),Object.defineProperty(exports,`toRangeBars`,{enumerable:!0,get:function(){return n.toRangeBars}}),Object.defineProperty(exports,`toRenko`,{enumerable:!0,get:function(){return n.toRenko}}),exports.unregisterPlugin=e.m,Object.defineProperty(exports,`volumeColor`,{enumerable:!0,get:function(){return t.volumeColor}}),Object.defineProperty(exports,`wallToUtc`,{enumerable:!0,get:function(){return t.wallToUtc}}),Object.defineProperty(exports,`withResampling`,{enumerable:!0,get:function(){return n.withResampling}}),Object.defineProperty(exports,`withTickBars`,{enumerable:!0,get:function(){return n.withTickBars}}),Object.defineProperty(exports,`zoneOffsetMinutes`,{enumerable:!0,get:function(){return t.zoneOffsetMinutes}});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./LayoutSession-BOUFA2gH.cjs`);let t=require(`@tradecanvas/commons`),n=require(`@tradecanvas/core`);var r={"1x1":{cols:1,rows:1},"1x2":{cols:2,rows:1},"2x1":{cols:1,rows:2},"2x2":{cols:2,rows:2},"1x3":{cols:3,rows:1},"3x1":{cols:1,rows:3},"2x3":{cols:3,rows:2},"3x2":{cols:2,rows:3}},i=class{root;cells=[];layout;options;destroyed=!1;syncing=!1;constructor(e,t={}){this.options=t,this.layout=t.layout??`2x2`,this.root=document.createElement(`div`),this.root.style.cssText=`display:grid;width:100%;height:100%;overflow:hidden;`,e.appendChild(this.root),this.applyLayout(),this.createCells()}applyLayout(){let{cols:e,rows:t}=r[this.layout],n=this.options.gap??1;this.root.style.gridTemplateColumns=`repeat(${e}, 1fr)`,this.root.style.gridTemplateRows=`repeat(${t}, 1fr)`,this.root.style.gap=`${n}px`}createCells(){let{cols:e,rows:t}=r[this.layout],n=e*t;for(let e=0;e<n;e++)this.cells.push(this.createCell(e))}createCell(t){let n=this.options.cells?.[t]??{},r=document.createElement(`div`);r.style.cssText=`position:relative;overflow:hidden;min-width:0;min-height:0;`,this.root.appendChild(r);let i=new e.c(r,{chartType:`candlestick`,autoScale:!0,features:{crosshair:!0,keyboard:!0,volume:!0,legend:!0,priceAxis:!0,timeAxis:!0,grid:!0},...this.options.chartOptions,...n.chartOptions,theme:this.options.theme}),a={container:r,chart:i,symbol:n.symbol??`Chart ${t+1}`,timeframe:n.timeframe??`5m`};return this.options.syncCrosshair!==!1&&(i.on(`crosshairMove`,e=>{let t=e.payload.bar?.time;if(t!==void 0)for(let e of this.cells)e.chart!==i&&e.chart.setCrosshairTime(t)}),i.on(`crosshairLeave`,()=>{for(let e of this.cells)e.chart!==i&&e.chart.setCrosshairTime(null)})),this.options.syncTimeAxis!==!1&&i.on(`visibleRangeChange`,e=>{if(this.syncing)return;this.syncing=!0;let{from:t,to:n}=e.payload,r=i.getData();if(r.length>0&&t>=0&&n<r.length){let e=r[t]?.time,a=r[n]?.time;if(e&&a)for(let t of this.cells)t.chart!==i&&t.chart.setVisibleRange(e,a)}this.syncing=!1}),a}setLayout(e){if(e===this.layout)return;let t=this.cells.length,{cols:n,rows:i}=r[e],a=n*i;if(a<t)for(let e=t-1;e>=a;e--){let t=this.cells[e];t.chart.destroy(),t.container.remove(),this.cells.pop()}this.layout=e,this.applyLayout();for(let e=t;e<a;e++)this.cells.push(this.createCell(e))}getChart(e){return this.cells[e]?.chart??null}getCharts(){return this.cells.map(e=>e.chart)}getCellCount(){return this.cells.length}setData(e,t){this.cells[e]?.chart.setData(t)}setAllData(e){for(let t of this.cells)t.chart.setData(e)}async connectCell(e,t){let n=this.cells[e];n&&(n.symbol=t.symbol,n.timeframe=t.timeframe,await n.chart.connect(t))}async connectAll(e,t,n,r=500){let i=[];for(let a=0;a<this.cells.length&&a<t.length;a++)i.push(this.connectCell(a,{adapter:typeof e==`function`?e(t[a],a):e,symbol:t[a],timeframe:n,historyLimit:r}));await Promise.all(i)}setTheme(e){for(let t of this.cells)t.chart.setTheme(e)}destroy(){if(!this.destroyed){this.destroyed=!0;for(let e of this.cells)e.chart.destroy(),e.container.remove();this.cells=[],this.root.remove()}}},a=class extends n.BaseFinanceChart{options;constructor(e,t){super(e,t.theme),this.options=t,this.requestRender()}renderChart(e,t,r,i){(0,n.renderSparkline)(e,t,r,this.options,i)}update(e){this.options={...this.options,data:e},this.requestRender()}setOptions(e){this.options={...this.options,...e},this.requestRender()}},o=class extends n.BaseFinanceChart{options;crosshair=null;constructor(e,t){super(e,t.theme),this.options=t,t.crosshair!==!1&&(this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender())),this.requestRender()}renderChart(e,t,r,i){let a=this.crosshair?.getPosition()??null;(0,n.renderDepthChart)(e,t,r,this.options,i,a)}update(e){this.options={...this.options,data:e},this.requestRender()}setOptions(e){this.options={...this.options,...e},this.requestRender()}destroy(){this.crosshair?.destroy(),super.destroy()}},s=class extends n.BaseFinanceChart{options;crosshair=null;constructor(e,t){super(e,t.theme),this.options=t,t.crosshair!==!1&&(this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender())),this.requestRender()}renderChart(e,t,r,i){let a=this.crosshair?.getPosition()??null;(0,n.renderEquityCurve)(e,t,r,this.options,i,a)}update(e,t){this.options={...this.options,data:e},t!==void 0&&(this.options={...this.options,benchmark:t}),this.requestRender()}setOptions(e){this.options={...this.options,...e},this.requestRender()}destroy(){this.crosshair?.destroy(),super.destroy()}},c=class extends n.BaseFinanceChart{options;crosshair=null;cachedRects=[];currentData=[];lastLayoutWidth=0;lastLayoutHeight=0;handleClick=null;constructor(e,t){super(e,t.theme),this.options=t,this.currentData=t.data??[],t.crosshair!==!1&&(this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender())),t.onCellClick&&(this.handleClick=e=>{let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;this.onCanvasClick(n,r)},this.canvas.addEventListener(`click`,this.handleClick)),this.recomputeLayout(),this.requestRender()}recomputeLayout(){let e={x:0,y:0,width:this.width,height:this.height},t=this.options.cellPadding??2;if(this.lastLayoutWidth=this.width,this.lastLayoutHeight=this.height,this.options.weighted){let r=this.currentData.map(e=>({id:e.id,weight:e.weight??(Math.abs(e.value)||1)}));this.cachedRects=(0,n.layoutSquarifiedTreemap)(r,e,t)}else this.cachedRects=(0,n.layoutUniformGrid)(this.currentData.map(e=>({id:e.id})),e,t)}onCanvasClick(e,t){if(this.options.onCellClick)for(let n of this.cachedRects){let r=n.rect;if(e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height){let e=this.currentData.find(e=>e.id===n.id);e&&this.options.onCellClick(e);return}}}renderChart(e,t,r,i){(t!==this.lastLayoutWidth||r!==this.lastLayoutHeight)&&this.recomputeLayout();let a=this.crosshair?.getPosition()??null;(0,n.renderHeatmap)(e,t,r,this.currentData,this.cachedRects,this.options,i,a)}update(e){this.currentData=e,this.options={...this.options,data:e},this.recomputeLayout(),this.requestRender()}setOptions(e){this.options={...this.options,...e},e.data&&(this.currentData=e.data),this.recomputeLayout(),this.requestRender()}destroy(){this.crosshair?.destroy(),this.handleClick&&this.canvas.removeEventListener(`click`,this.handleClick),super.destroy()}},l=class extends n.BaseFinanceChart{options;crosshair=null;constructor(e,t){super(e,t.theme),this.options=t,t.crosshair!==!1&&(this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender())),this.requestRender()}renderChart(e,t,r,i){let a=this.crosshair?.getPosition()??null;(0,n.renderWaterfall)(e,t,r,this.options,i,a)}update(e){this.options={...this.options,data:e},this.requestRender()}setOptions(e){this.options={...this.options,...e},this.requestRender()}destroy(){this.crosshair?.destroy(),super.destroy()}},u=500;function d(e){let t=1-e;return 1-t*t*t}var f=class extends n.BaseFinanceChart{options;currentValue;targetValue;animationStart=null;animationFrom=0;animationFrameId=null;constructor(e,t){super(e,t.theme),this.options=t,this.currentValue=t.value,this.targetValue=t.value,this.requestRender()}renderChart(e,t,r,i){(0,n.renderGauge)(e,t,r,this.options,i,this.currentValue)}setValue(e){if(this.options.animate===!1){this.cancelAnimation(),this.currentValue=e,this.targetValue=e,this.options={...this.options,value:e},this.requestRender();return}this.targetValue=e,this.animationFrom=this.currentValue,this.animationStart=performance.now(),this.options={...this.options,value:e},this.startAnimationLoop()}setOptions(e){let t={...this.options,...e};if(e.value!==void 0&&e.value!==this.targetValue){this.options=t,this.setValue(e.value);return}this.options=t,this.requestRender()}startAnimationLoop(){if(this.animationFrameId!==null)return;let e=()=>{if(this.animationFrameId=null,this.animationStart===null)return;let t=this.options.animationDuration??u,n=performance.now()-this.animationStart,r=Math.min(1,n/Math.max(1,t)),i=d(r);this.currentValue=this.animationFrom+(this.targetValue-this.animationFrom)*i,this.requestRender(),r<1?this.animationFrameId=requestAnimationFrame(e):(this.currentValue=this.targetValue,this.animationStart=null)};this.animationFrameId=requestAnimationFrame(e)}cancelAnimation(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null),this.animationStart=null}destroy(){this.cancelAnimation(),super.destroy()}},p=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function m(e){return e.map(e=>({time:e.time,value:e.equity}))}function h(e){let t=-1/0;return e.map(e=>{e.equity>t&&(t=e.equity);let n=t>0?(e.equity/t-1)*100:0;return{time:e.time,value:n}})}function g(e){if(e.length===0)return[];let n=[];for(let r of e){let e=(0,t.timeframeBucketStart)(r.time,`1M`),i=n[n.length-1];i&&i.key===e?i.close=r.equity:n.push({key:e,close:r.equity})}let r=e[0].equity,i=[];for(let e of n){let t=r===0?1:r,n=(e.close/t-1)*100;r=e.close;let a=new Date(e.key),o=a.getUTCFullYear(),s=a.getUTCMonth();i.push({id:`${o}-${String(s+1).padStart(2,`0`)}`,label:p[s],group:String(o),value:n})}return i}function _(e){return`${e>0?`+`:``}${e.toFixed(2)}%`}function v(e){return e>0?`positive`:e<0?`negative`:`neutral`}function y(e){return[{label:`Total Return`,value:_(e.totalReturnPct),tone:v(e.totalReturnPct)},{label:`CAGR`,value:_(e.cagr*100),tone:v(e.cagr)},{label:`Sharpe`,value:e.sharpe.toFixed(2),tone:v(e.sharpe)},{label:`Sortino`,value:e.sortino.toFixed(2),tone:v(e.sortino)},{label:`Max Drawdown`,value:_(e.maxDrawdownPct),tone:`negative`},{label:`Win Rate`,value:`${(e.winRate*100).toFixed(1)}%`,tone:`neutral`},{label:`Profit Factor`,value:Number.isFinite(e.profitFactor)?e.profitFactor.toFixed(2):`∞`,tone:v(e.profitFactor-1)},{label:`Trades`,value:String(e.trades),tone:`neutral`}]}function b(e){return!e||e===`dark`?t.DARK_THEME:e===`light`?t.LIGHT_THEME:e}var x=class{options;theme;root;equityChart=null;drawdownChart=null;heatmap=null;constructor(e,t){this.options=t,this.theme=b(t.theme),this.root=document.createElement(`div`),this.build(),e.appendChild(this.root)}build(){let e=this.theme,{result:t,title:n,subtitle:r}=this.options,i=this.panelBackground(),a=e.grid;if(this.root.style.cssText=[`display:flex`,`flex-direction:column`,`gap:14px`,`width:100%`,`box-sizing:border-box`,`padding:16px`,`background:${e.background}`,`color:${e.text}`,`font-family:${e.font.family}`].join(`;`),n||r){let t=document.createElement(`div`);if(n){let r=document.createElement(`div`);r.textContent=n,r.style.cssText=`font-size:${e.font.sizeLarge}px;font-weight:600;letter-spacing:-0.01em;`,t.appendChild(r)}if(r){let n=document.createElement(`div`);n.textContent=r,n.style.cssText=`font-size:${e.font.sizeSmall}px;color:${e.textSecondary};margin-top:2px;`,t.appendChild(n)}this.root.appendChild(t)}this.root.appendChild(this.buildStatsStrip(y(t.metrics),i,a));let o=document.createElement(`div`);o.style.cssText=[`display:grid`,`grid-template-columns:repeat(auto-fit, minmax(280px, 1fr))`,`grid-auto-rows:220px`,`gap:14px`].join(`;`),this.root.appendChild(o);let l=this.buildPanel(`Equity Curve`,i,a);l.wrap.style.gridColumn=`1 / -1`,o.appendChild(l.wrap),this.equityChart=new s(l.body,{data:m(t.equityCurve),theme:e,lineColor:e.candleUp,fillArea:!0,crosshair:!0});let u=this.buildPanel(`Drawdown`,i,a);o.appendChild(u.wrap),this.drawdownChart=new s(u.body,{data:h(t.equityCurve),theme:e,lineColor:e.candleDown,fillArea:!0,crosshair:!0,valueFormat:e=>`${e.toFixed(1)}%`});let d=g(t.equityCurve),f=this.buildPanel(`Monthly Returns`,i,a);o.appendChild(f.wrap),this.heatmap=new c(f.body,{data:d,theme:e,showValues:!0,valueFormat:e=>`${e>=0?`+`:``}${e.toFixed(1)}`,colorScale:{negative:e.candleDown,zero:i,positive:e.candleUp}})}buildStatsStrip(e,t,n){let r=document.createElement(`div`);r.style.cssText=[`display:grid`,`grid-template-columns:repeat(auto-fit, minmax(120px, 1fr))`,`gap:10px`].join(`;`);let i=this.theme;for(let a of e){let e=document.createElement(`div`);e.style.cssText=[`background:${t}`,`border:1px solid ${n}`,`border-radius:10px`,`padding:10px 12px`,`display:flex`,`flex-direction:column`,`gap:4px`].join(`;`);let o=document.createElement(`div`);o.textContent=a.label,o.style.cssText=`font-size:${i.font.sizeSmall}px;color:${i.textSecondary};text-transform:uppercase;letter-spacing:0.04em;`;let s=document.createElement(`div`);s.textContent=a.value;let c=a.tone===`positive`?i.candleUp:a.tone===`negative`?i.candleDown:i.text;s.style.cssText=`font-size:${i.font.sizeLarge}px;font-weight:600;color:${c};font-variant-numeric:tabular-nums;`,e.appendChild(o),e.appendChild(s),r.appendChild(e)}return r}buildPanel(e,t,n){let r=this.theme,i=document.createElement(`div`);i.style.cssText=[`background:${t}`,`border:1px solid ${n}`,`border-radius:10px`,`overflow:hidden`,`display:flex`,`flex-direction:column`].join(`;`);let a=document.createElement(`div`);a.textContent=e,a.style.cssText=[`font-size:${r.font.sizeSmall}px`,`font-weight:600`,`color:${r.textSecondary}`,`padding:8px 12px`,`border-bottom:1px solid ${n}`,`text-transform:uppercase`,`letter-spacing:0.04em`].join(`;`);let o=document.createElement(`div`);return o.style.cssText=`flex:1;min-height:0;position:relative;`,i.appendChild(a),i.appendChild(o),{wrap:i,body:o}}panelBackground(){return this.theme.name===`light`?`rgba(0,0,0,0.02)`:`rgba(255,255,255,0.03)`}update(e){this.options={...this.options,result:e},this.destroyCharts(),this.root.replaceChildren(),this.build()}setTheme(e){this.theme=b(e),this.options={...this.options,theme:e},this.destroyCharts(),this.root.replaceChildren(),this.build()}destroyCharts(){this.equityChart?.destroy(),this.drawdownChart?.destroy(),this.heatmap?.destroy(),this.equityChart=null,this.drawdownChart=null,this.heatmap=null}destroy(){this.destroyCharts(),this.root.remove()}};Object.defineProperty(exports,`AlertManager`,{enumerable:!0,get:function(){return n.AlertManager}}),Object.defineProperty(exports,`Animator`,{enumerable:!0,get:function(){return n.Animator}}),Object.defineProperty(exports,`BarCountdown`,{enumerable:!0,get:function(){return n.BarCountdown}}),Object.defineProperty(exports,`BinanceAdapter`,{enumerable:!0,get:function(){return n.BinanceAdapter}}),Object.defineProperty(exports,`BybitAdapter`,{enumerable:!0,get:function(){return n.BybitAdapter}}),Object.defineProperty(exports,`CHART_STYLE_KEYS`,{enumerable:!0,get:function(){return t.CHART_STYLE_KEYS}}),exports.Chart=e.c,exports.ChartGrid=i,Object.defineProperty(exports,`ChartLegend`,{enumerable:!0,get:function(){return n.ChartLegend}}),Object.defineProperty(exports,`ChartStateManager`,{enumerable:!0,get:function(){return n.ChartStateManager}}),Object.defineProperty(exports,`CoinbaseAdapter`,{enumerable:!0,get:function(){return n.CoinbaseAdapter}}),Object.defineProperty(exports,`CompareRenderer`,{enumerable:!0,get:function(){return n.CompareRenderer}}),Object.defineProperty(exports,`CrosshairTooltip`,{enumerable:!0,get:function(){return n.CrosshairTooltip}}),Object.defineProperty(exports,`CurrentPriceLine`,{enumerable:!0,get:function(){return n.CurrentPriceLine}}),Object.defineProperty(exports,`DARK_TERMINAL`,{enumerable:!0,get:function(){return t.DARK_TERMINAL}}),Object.defineProperty(exports,`DARK_THEME`,{enumerable:!0,get:function(){return t.DARK_THEME}}),Object.defineProperty(exports,`DEFAULT_DRAWING_STYLE`,{enumerable:!0,get:function(){return t.DEFAULT_DRAWING_STYLE}}),exports.DEFAULT_HISTORY_PAGE_SIZE=e.b,Object.defineProperty(exports,`DEFAULT_LEGEND_CONFIG`,{enumerable:!0,get:function(){return n.DEFAULT_LEGEND_CONFIG}}),Object.defineProperty(exports,`DEFAULT_MAX_WEBGL_CHARTS`,{enumerable:!0,get:function(){return n.DEFAULT_MAX_WEBGL_CHARTS}}),Object.defineProperty(exports,`DEFAULT_RECONNECT`,{enumerable:!0,get:function(){return t.DEFAULT_RECONNECT}}),Object.defineProperty(exports,`DEFAULT_SESSION_HOURS`,{enumerable:!0,get:function(){return n.DEFAULT_SESSION_HOURS}}),Object.defineProperty(exports,`DEFAULT_SIGNAL_STYLE`,{enumerable:!0,get:function(){return t.DEFAULT_SIGNAL_STYLE}}),Object.defineProperty(exports,`DEFAULT_STREAM_CONFIG`,{enumerable:!0,get:function(){return t.DEFAULT_STREAM_CONFIG}}),Object.defineProperty(exports,`DEFAULT_TIMEFRAME_FAVORITES`,{enumerable:!0,get:function(){return t.DEFAULT_TIMEFRAME_FAVORITES}}),Object.defineProperty(exports,`DEFAULT_TRADE_ZONE_STYLE`,{enumerable:!0,get:function(){return t.DEFAULT_TRADE_ZONE_STYLE}}),Object.defineProperty(exports,`DEFAULT_TRADING_CONFIG`,{enumerable:!0,get:function(){return t.DEFAULT_TRADING_CONFIG}}),Object.defineProperty(exports,`DataExporter`,{enumerable:!0,get:function(){return n.DataExporter}}),exports.DataManager=e.S,exports.DepthChart=o,exports.DragDropImporter=e.o,Object.defineProperty(exports,`DrawingBase`,{enumerable:!0,get:function(){return n.DrawingBase}}),exports.EXCHANGE_TIMEZONE=e.l,Object.defineProperty(exports,`Easing`,{enumerable:!0,get:function(){return n.Easing}}),exports.EquityCurveChart=s,exports.GaugeChart=f,exports.HISTORY_RETRY_MS=e.x,exports.HeatmapChart=c,Object.defineProperty(exports,`IndicatorBase`,{enumerable:!0,get:function(){return n.IndicatorBase}}),Object.defineProperty(exports,`IndicatorValueMap`,{enumerable:!0,get:function(){return n.IndicatorValueMap}}),Object.defineProperty(exports,`KeyboardHandler`,{enumerable:!0,get:function(){return n.KeyboardHandler}}),Object.defineProperty(exports,`KrakenAdapter`,{enumerable:!0,get:function(){return n.KrakenAdapter}}),Object.defineProperty(exports,`LIGHT_THEME`,{enumerable:!0,get:function(){return t.LIGHT_THEME}}),exports.LayoutManager=e.v,exports.LayoutSession=e.t,Object.defineProperty(exports,`MARKET_CRYPTO`,{enumerable:!0,get:function(){return t.MARKET_CRYPTO}}),Object.defineProperty(exports,`MARKET_HNX`,{enumerable:!0,get:function(){return t.MARKET_HNX}}),Object.defineProperty(exports,`MARKET_HOSE`,{enumerable:!0,get:function(){return t.MARKET_HOSE}}),Object.defineProperty(exports,`MARKET_NYSE`,{enumerable:!0,get:function(){return t.MARKET_NYSE}}),Object.defineProperty(exports,`MARKET_UPCOM`,{enumerable:!0,get:function(){return t.MARKET_UPCOM}}),Object.defineProperty(exports,`MAX_ALERT_BARS`,{enumerable:!0,get:function(){return n.MAX_ALERT_BARS}}),exports.MAX_LAYOUT_NAME=e.n,Object.defineProperty(exports,`MIN_ALERT_BARS`,{enumerable:!0,get:function(){return n.MIN_ALERT_BARS}}),Object.defineProperty(exports,`MockAdapter`,{enumerable:!0,get:function(){return n.MockAdapter}}),exports.PLUGIN_API_VERSION=e.h,Object.defineProperty(exports,`PRICE_SOURCES`,{enumerable:!0,get:function(){return t.PRICE_SOURCES}}),Object.defineProperty(exports,`PaperExecutionAdapter`,{enumerable:!0,get:function(){return n.PaperExecutionAdapter}}),exports.PerformanceDashboard=x,exports.PluginManager=e.u,Object.defineProperty(exports,`PollingAdapter`,{enumerable:!0,get:function(){return n.PollingAdapter}}),Object.defineProperty(exports,`RANGE_PRESETS`,{enumerable:!0,get:function(){return n.RANGE_PRESETS}}),Object.defineProperty(exports,`ReplayManager`,{enumerable:!0,get:function(){return n.ReplayManager}}),Object.defineProperty(exports,`ResamplingAdapter`,{enumerable:!0,get:function(){return n.ResamplingAdapter}}),Object.defineProperty(exports,`Screenshot`,{enumerable:!0,get:function(){return n.Screenshot}}),Object.defineProperty(exports,`SessionBreaks`,{enumerable:!0,get:function(){return n.SessionBreaks}}),Object.defineProperty(exports,`SessionShading`,{enumerable:!0,get:function(){return n.SessionShading}}),Object.defineProperty(exports,`SignalMarkerManager`,{enumerable:!0,get:function(){return n.SignalMarkerManager}}),exports.SparklineChart=a,Object.defineProperty(exports,`StreamManager`,{enumerable:!0,get:function(){return n.StreamManager}}),Object.defineProperty(exports,`TC_PALETTE`,{enumerable:!0,get:function(){return t.TC_PALETTE}}),Object.defineProperty(exports,`TC_SERIES_COLORS`,{enumerable:!0,get:function(){return t.TC_SERIES_COLORS}}),Object.defineProperty(exports,`TIMEFRAMES_CRYPTO`,{enumerable:!0,get:function(){return t.TIMEFRAMES_CRYPTO}}),Object.defineProperty(exports,`TIMEFRAMES_FOREX`,{enumerable:!0,get:function(){return t.TIMEFRAMES_FOREX}}),Object.defineProperty(exports,`TIMEFRAMES_STOCK`,{enumerable:!0,get:function(){return t.TIMEFRAMES_STOCK}}),exports.ThemeManager=e.y,Object.defineProperty(exports,`TickAggregator`,{enumerable:!0,get:function(){return n.TickAggregator}}),Object.defineProperty(exports,`TickBarAdapter`,{enumerable:!0,get:function(){return n.TickBarAdapter}}),Object.defineProperty(exports,`TickBarBuilder`,{enumerable:!0,get:function(){return n.TickBarBuilder}}),Object.defineProperty(exports,`TradeZoneManager`,{enumerable:!0,get:function(){return n.TradeZoneManager}}),Object.defineProperty(exports,`UndoRedoManager`,{enumerable:!0,get:function(){return n.UndoRedoManager}}),Object.defineProperty(exports,`VN_COLORS`,{enumerable:!0,get:function(){return t.VN_COLORS}}),Object.defineProperty(exports,`VOLUME_ALPHA`,{enumerable:!0,get:function(){return t.VOLUME_ALPHA}}),Object.defineProperty(exports,`VolumeRenderer`,{enumerable:!0,get:function(){return n.VolumeRenderer}}),exports.WaterfallChart=l,Object.defineProperty(exports,`Watermark`,{enumerable:!0,get:function(){return n.Watermark}}),Object.defineProperty(exports,`WebSocketAdapter`,{enumerable:!0,get:function(){return n.WebSocketAdapter}}),Object.defineProperty(exports,`barsAreDaily`,{enumerable:!0,get:function(){return t.barsAreDaily}}),exports.cleanLayoutName=e.r,exports.clearGlobalPlugins=e.d,exports.computeDrawdownCurve=h,exports.computeMonthlyReturns=g,Object.defineProperty(exports,`computePriceLimits`,{enumerable:!0,get:function(){return t.computePriceLimits}}),Object.defineProperty(exports,`createVNTheme`,{enumerable:!0,get:function(){return t.createVNTheme}}),Object.defineProperty(exports,`formatFraction`,{enumerable:!0,get:function(){return t.formatFraction}}),Object.defineProperty(exports,`formatNumber`,{enumerable:!0,get:function(){return t.formatNumber}}),Object.defineProperty(exports,`formatTooltipTime`,{enumerable:!0,get:function(){return n.formatTooltipTime}}),Object.defineProperty(exports,`formatVND`,{enumerable:!0,get:function(){return t.formatVND}}),Object.defineProperty(exports,`formatVolumeLoc`,{enumerable:!0,get:function(){return t.formatVolumeLoc}}),Object.defineProperty(exports,`fractionTick`,{enumerable:!0,get:function(){return t.fractionTick}}),Object.defineProperty(exports,`getCurrentSession`,{enumerable:!0,get:function(){return t.getCurrentSession}}),exports.getGlobalPlugins=e.f,Object.defineProperty(exports,`getLocale`,{enumerable:!0,get:function(){return t.getLocale}}),Object.defineProperty(exports,`indicatorSource`,{enumerable:!0,get:function(){return t.indicatorSource}}),Object.defineProperty(exports,`isPriceLevelAlert`,{enumerable:!0,get:function(){return n.isPriceLevelAlert}}),Object.defineProperty(exports,`isPriceSource`,{enumerable:!0,get:function(){return t.isPriceSource}}),Object.defineProperty(exports,`isTimeFrame`,{enumerable:!0,get:function(){return t.isTimeFrame}}),Object.defineProperty(exports,`isValidTimeZone`,{enumerable:!0,get:function(){return t.isValidTimeZone}}),exports.localStorageLayouts=e.i,Object.defineProperty(exports,`lttbDownsample`,{enumerable:!0,get:function(){return n.lttbDownsample}}),Object.defineProperty(exports,`lttbVisibleIndices`,{enumerable:!0,get:function(){return n.lttbVisibleIndices}}),Object.defineProperty(exports,`marketStatus`,{enumerable:!0,get:function(){return t.marketStatus}}),exports.memoryLayouts=e.a,Object.defineProperty(exports,`normalizeBar`,{enumerable:!0,get:function(){return t.normalizeBar}}),Object.defineProperty(exports,`normalizeBarTime`,{enumerable:!0,get:function(){return t.normalizeBarTime}}),Object.defineProperty(exports,`offsetAt`,{enumerable:!0,get:function(){return t.offsetAt}}),exports.overlaysForLayer=e.g,Object.defineProperty(exports,`parseIndicatorSource`,{enumerable:!0,get:function(){return t.parseIndicatorSource}}),exports.parseOHLCV=e.s,Object.defineProperty(exports,`parseTimeframe`,{enumerable:!0,get:function(){return t.parseTimeframe}}),Object.defineProperty(exports,`pickBaseTimeframe`,{enumerable:!0,get:function(){return t.pickBaseTimeframe}}),exports.pluginKey=e._,Object.defineProperty(exports,`priceFormatterFor`,{enumerable:!0,get:function(){return t.priceFormatterFor}}),Object.defineProperty(exports,`rangePresetStart`,{enumerable:!0,get:function(){return n.rangePresetStart}}),Object.defineProperty(exports,`rankSymbols`,{enumerable:!0,get:function(){return t.rankSymbols}}),Object.defineProperty(exports,`readNews`,{enumerable:!0,get:function(){return t.readNews}}),Object.defineProperty(exports,`readQuote`,{enumerable:!0,get:function(){return t.readQuote}}),Object.defineProperty(exports,`registerLocale`,{enumerable:!0,get:function(){return t.registerLocale}}),exports.registerPlugin=e.p,Object.defineProperty(exports,`resampleBars`,{enumerable:!0,get:function(){return t.resampleBars}}),exports.selectKeyStats=y,Object.defineProperty(exports,`servesTimeframe`,{enumerable:!0,get:function(){return n.servesTimeframe}}),Object.defineProperty(exports,`setLocale`,{enumerable:!0,get:function(){return t.setLocale}}),Object.defineProperty(exports,`setMaxWebGLCharts`,{enumerable:!0,get:function(){return n.setMaxWebGLCharts}}),Object.defineProperty(exports,`sourcePrice`,{enumerable:!0,get:function(){return t.sourcePrice}}),Object.defineProperty(exports,`stepDecimals`,{enumerable:!0,get:function(){return t.stepDecimals}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t.t}}),Object.defineProperty(exports,`tickBarCount`,{enumerable:!0,get:function(){return t.tickBarCount}}),Object.defineProperty(exports,`timeframeToMs`,{enumerable:!0,get:function(){return t.timeframeToMs}}),exports.toEquityPoints=m,Object.defineProperty(exports,`toHeikinAshi`,{enumerable:!0,get:function(){return n.toHeikinAshi}}),Object.defineProperty(exports,`toKagi`,{enumerable:!0,get:function(){return n.toKagi}}),Object.defineProperty(exports,`toLineBreak`,{enumerable:!0,get:function(){return n.toLineBreak}}),Object.defineProperty(exports,`toPointAndFigure`,{enumerable:!0,get:function(){return n.toPointAndFigure}}),Object.defineProperty(exports,`toRangeBars`,{enumerable:!0,get:function(){return n.toRangeBars}}),Object.defineProperty(exports,`toRenko`,{enumerable:!0,get:function(){return n.toRenko}}),exports.unregisterPlugin=e.m,Object.defineProperty(exports,`volumeColor`,{enumerable:!0,get:function(){return t.volumeColor}}),Object.defineProperty(exports,`wallToUtc`,{enumerable:!0,get:function(){return t.wallToUtc}}),Object.defineProperty(exports,`withResampling`,{enumerable:!0,get:function(){return n.withResampling}}),Object.defineProperty(exports,`withTickBars`,{enumerable:!0,get:function(){return n.withTickBars}}),Object.defineProperty(exports,`zoneOffsetMinutes`,{enumerable:!0,get:function(){return t.zoneOffsetMinutes}});
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export { LayoutManager } from './layout/LayoutManager.js';
|
|
|
7
7
|
export * from './plugins/index.js';
|
|
8
8
|
export { parseOHLCV, DragDropImporter } from './io/index.js';
|
|
9
9
|
export type { ParseResult, DragDropImporterCallbacks } from './io/index.js';
|
|
10
|
-
export type { OHLCBar, DataSeries, TimeFrame, ChartOptions, ChartType, Theme, ThemeName, ChartEventType, ChartEvent, ChartEventMap, IndicatorPlugin, IndicatorDescriptor, IndicatorConfig, IndicatorOutput, IndicatorValue, TauriBridgeOptions, ViewportState, CrosshairMovePayload, BarClickPayload, VisibleRangeChangePayload, OrderModifyPayload, OrderCancelPayload, PositionModifyPayload, PositionClosePayload, OrderPlacePayload, IndicatorChangePayload, ThemeChangePayload, ResizePayload, ZoomChangePayload, PriceRangeChangePayload, DrawingCreatePayload, DrawingRemovePayload, SignalMarkerAddPayload, ChartContextArea, ChartContextMenuPayload, PriceAxisAddPayload, SignalMarkerRemovePayload, TradeZoneAddPayload, TradeZoneRemovePayload, DrawingToolType, DrawingState, DrawingStyle, DrawingPlugin, DrawingDescriptor, FeaturesConfig, SessionBreakOptions, PriceAxisOptions, TimeAxisOptions, AnchorPoint, PanelPosition, PanelConfig, ResolvedLayout, TradingOrder, TradingPosition, DepthData, DepthLevel, TradingConfig, OrderSide, OrderType, OrderStatus, OrderLabel, OrderPlaceIntent, OrderModifyIntent, OrderCancelIntent, PositionModifyIntent, PositionCloseIntent, PositionReverseIntent, TimeInForce, FillReason, ExecutionAdapter, ExecutionConfig, ExecutionEvent, ExecutionEventType, ExecutionListener, FillEvent, ExecutionError, Locale, LocaleStrings, MarketConfig, MarketType, StockExchange, MarketColorScheme, TradingSession, PriceLimitInfo, DataAdapter, DataAdapterConfig, DataAdapterEventType, StreamConfig, ConnectionState, ConnectionInfo, RawTick, AggregatedBar, ReconnectConfig, ResolvedIndicatorStyle, WatermarkConfig, GridOptions, CrosshairOptions, SignalMarker, SignalDirection, SignalMarkerStyle, TradeZone, TradeZoneDirection, TradeZoneStyle, } from '@tradecanvas/commons';
|
|
11
|
-
export { DARK_THEME, LIGHT_THEME, DARK_TERMINAL, TC_PALETTE, TC_SERIES_COLORS, volumeColor, VOLUME_ALPHA, DEFAULT_DRAWING_STYLE, DEFAULT_TRADING_CONFIG, DEFAULT_SIGNAL_STYLE, DEFAULT_TRADE_ZONE_STYLE, TIMEFRAMES_CRYPTO, TIMEFRAMES_STOCK, TIMEFRAMES_FOREX, DEFAULT_TIMEFRAME_FAVORITES, } from '@tradecanvas/commons';
|
|
10
|
+
export type { OHLCBar, DataSeries, TimeFrame, ChartOptions, ChartType, Theme, ThemeName, ChartEventType, ChartEvent, ChartEventMap, IndicatorPlugin, IndicatorDescriptor, IndicatorConfig, IndicatorOutput, IndicatorValue, TauriBridgeOptions, ViewportState, CrosshairMovePayload, BarClickPayload, VisibleRangeChangePayload, OrderModifyPayload, OrderCancelPayload, PositionModifyPayload, PositionClosePayload, OrderPlacePayload, IndicatorChangePayload, ThemeChangePayload, StyleChangePayload, ResizePayload, ZoomChangePayload, PriceRangeChangePayload, DrawingCreatePayload, DrawingRemovePayload, SignalMarkerAddPayload, ChartContextArea, ChartContextMenuPayload, PriceAxisAddPayload, SignalMarkerRemovePayload, TradeZoneAddPayload, TradeZoneRemovePayload, DrawingToolType, DrawingState, DrawingStyle, DrawingPlugin, DrawingDescriptor, FeaturesConfig, SessionBreakOptions, PriceAxisOptions, TimeAxisOptions, AnchorPoint, PanelPosition, PanelConfig, ResolvedLayout, TradingOrder, TradingPosition, DepthData, DepthLevel, TradingConfig, OrderSide, OrderType, OrderStatus, OrderLabel, OrderPlaceIntent, OrderModifyIntent, OrderCancelIntent, PositionModifyIntent, PositionCloseIntent, PositionReverseIntent, TimeInForce, FillReason, ExecutionAdapter, ExecutionConfig, ExecutionEvent, ExecutionEventType, ExecutionListener, FillEvent, ExecutionError, Locale, LocaleStrings, MarketConfig, MarketType, StockExchange, MarketColorScheme, TradingSession, PriceLimitInfo, DataAdapter, DataAdapterConfig, DataAdapterEventType, StreamConfig, ConnectionState, ConnectionInfo, RawTick, AggregatedBar, ReconnectConfig, ResolvedIndicatorStyle, IndicatorStyleConfig, IndicatorPlotStyle, ChartStyleKey, ChartStyleOverrides, ChartStyleOverridesPatch, ResolvedChartStyle, ResolvedLineLook, StyleLayer, StyleValueKind, PaneStyle, WatermarkConfig, GridOptions, CrosshairOptions, SignalMarker, SignalDirection, SignalMarkerStyle, TradeZone, TradeZoneDirection, TradeZoneStyle, } from '@tradecanvas/commons';
|
|
11
|
+
export { DARK_THEME, LIGHT_THEME, DARK_TERMINAL, TC_PALETTE, TC_SERIES_COLORS, volumeColor, VOLUME_ALPHA, CHART_STYLE_KEYS, DEFAULT_DRAWING_STYLE, DEFAULT_TRADING_CONFIG, DEFAULT_SIGNAL_STYLE, DEFAULT_TRADE_ZONE_STYLE, TIMEFRAMES_CRYPTO, TIMEFRAMES_STOCK, TIMEFRAMES_FOREX, DEFAULT_TIMEFRAME_FAVORITES, } from '@tradecanvas/commons';
|
|
12
12
|
export { normalizeBarTime, normalizeBar, barsAreDaily } from '@tradecanvas/commons';
|
|
13
13
|
export { parseTimeframe, isTimeFrame, timeframeToMs, resampleBars, pickBaseTimeframe, isValidTimeZone, zoneOffsetMinutes, offsetAt, wallToUtc, } from '@tradecanvas/commons';
|
|
14
14
|
export type { KnownTimeFrame, TimeFrameUnit, TimeZoneSetting, HistoryLoadPayload, OverlayScale } from '@tradecanvas/commons';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AACh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BAA0B,CAAC;AAC3F,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9E,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC/F,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGxF,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,gBAAgB,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAClJ,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,GACf,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,2BAA2B,EAC3B,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,YAAY,GACb,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as e, _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as ee, n as te, o as ne, p as re, r as ie, s as ae, t as oe, u as se, v as ce, x as le, y as ue } from "./LayoutSession-
|
|
2
|
-
import {
|
|
3
|
-
import { AlertManager as
|
|
1
|
+
import { S as e, _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as ee, n as te, o as ne, p as re, r as ie, s as ae, t as oe, u as se, v as ce, x as le, y as ue } from "./LayoutSession-CiDh-H9-.js";
|
|
2
|
+
import { CHART_STYLE_KEYS as de, DARK_TERMINAL as fe, DARK_THEME as pe, DARK_THEME as d, DEFAULT_DRAWING_STYLE as f, DEFAULT_RECONNECT as p, DEFAULT_SIGNAL_STYLE as m, DEFAULT_STREAM_CONFIG as h, DEFAULT_TIMEFRAME_FAVORITES as g, DEFAULT_TRADE_ZONE_STYLE as _, DEFAULT_TRADING_CONFIG as v, LIGHT_THEME as y, LIGHT_THEME as b, MARKET_CRYPTO as x, MARKET_HNX as S, MARKET_HOSE as C, MARKET_NYSE as w, MARKET_UPCOM as T, PRICE_SOURCES as E, TC_PALETTE as D, TC_SERIES_COLORS as O, TIMEFRAMES_CRYPTO as k, TIMEFRAMES_FOREX as A, TIMEFRAMES_STOCK as j, VN_COLORS as M, VOLUME_ALPHA as N, barsAreDaily as P, computePriceLimits as F, createVNTheme as I, formatFraction as L, formatNumber as R, formatVND as z, formatVolumeLoc as B, fractionTick as me, getCurrentSession as he, getLocale as ge, indicatorSource as _e, isPriceSource as ve, isTimeFrame as ye, isValidTimeZone as be, marketStatus as xe, normalizeBar as Se, normalizeBarTime as Ce, offsetAt as we, parseIndicatorSource as Te, parseTimeframe as Ee, pickBaseTimeframe as De, priceFormatterFor as Oe, rankSymbols as ke, readNews as Ae, readQuote as je, registerLocale as Me, resampleBars as Ne, setLocale as Pe, sourcePrice as Fe, stepDecimals as Ie, t as Le, tickBarCount as Re, timeframeBucketStart as ze, timeframeToMs as Be, volumeColor as Ve, wallToUtc as He, zoneOffsetMinutes as Ue } from "@tradecanvas/commons";
|
|
3
|
+
import { AlertManager as We, Animator as Ge, BarCountdown as Ke, BaseFinanceChart as V, BinanceAdapter as qe, BybitAdapter as Je, ChartLegend as Ye, ChartStateManager as Xe, CoinbaseAdapter as Ze, CompareRenderer as Qe, CrosshairTooltip as $e, CurrentPriceLine as et, DEFAULT_LEGEND_CONFIG as tt, DEFAULT_MAX_WEBGL_CHARTS as nt, DEFAULT_SESSION_HOURS as rt, DataExporter as it, DrawingBase as at, Easing as ot, FinanceCrosshair as H, IndicatorBase as st, IndicatorValueMap as ct, KeyboardHandler as lt, KrakenAdapter as ut, MAX_ALERT_BARS as dt, MIN_ALERT_BARS as ft, MockAdapter as pt, PaperExecutionAdapter as mt, PollingAdapter as ht, RANGE_PRESETS as gt, ReplayManager as _t, ResamplingAdapter as vt, Screenshot as yt, SessionBreaks as bt, SessionShading as xt, SignalMarkerManager as St, StreamManager as Ct, TickAggregator as wt, TickBarAdapter as Tt, TickBarBuilder as Et, TradeZoneManager as Dt, UndoRedoManager as Ot, VolumeRenderer as kt, Watermark as At, WebSocketAdapter as jt, formatTooltipTime as Mt, isPriceLevelAlert as Nt, layoutSquarifiedTreemap as Pt, layoutUniformGrid as Ft, lttbDownsample as It, lttbVisibleIndices as Lt, rangePresetStart as Rt, renderDepthChart as zt, renderEquityCurve as Bt, renderGauge as Vt, renderHeatmap as Ht, renderSparkline as Ut, renderWaterfall as Wt, servesTimeframe as Gt, setMaxWebGLCharts as Kt, toHeikinAshi as qt, toKagi as Jt, toLineBreak as Yt, toPointAndFigure as Xt, toRangeBars as Zt, toRenko as Qt, withResampling as $t, withTickBars as en } from "@tradecanvas/core";
|
|
4
4
|
//#region src/grid/ChartGrid.ts
|
|
5
5
|
var U = {
|
|
6
6
|
"1x1": {
|
|
@@ -35,7 +35,7 @@ var U = {
|
|
|
35
35
|
cols: 2,
|
|
36
36
|
rows: 3
|
|
37
37
|
}
|
|
38
|
-
},
|
|
38
|
+
}, tn = class {
|
|
39
39
|
root;
|
|
40
40
|
cells = [];
|
|
41
41
|
layout;
|
|
@@ -142,13 +142,13 @@ var U = {
|
|
|
142
142
|
this.cells = [], this.root.remove();
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
},
|
|
145
|
+
}, nn = class extends V {
|
|
146
146
|
options;
|
|
147
147
|
constructor(e, t) {
|
|
148
148
|
super(e, t.theme), this.options = t, this.requestRender();
|
|
149
149
|
}
|
|
150
150
|
renderChart(e, t, n, r) {
|
|
151
|
-
|
|
151
|
+
Ut(e, t, n, this.options, r);
|
|
152
152
|
}
|
|
153
153
|
update(e) {
|
|
154
154
|
this.options = {
|
|
@@ -162,7 +162,7 @@ var U = {
|
|
|
162
162
|
...e
|
|
163
163
|
}, this.requestRender();
|
|
164
164
|
}
|
|
165
|
-
},
|
|
165
|
+
}, W = class extends V {
|
|
166
166
|
options;
|
|
167
167
|
crosshair = null;
|
|
168
168
|
constructor(e, t) {
|
|
@@ -170,7 +170,7 @@ var U = {
|
|
|
170
170
|
}
|
|
171
171
|
renderChart(e, t, n, r) {
|
|
172
172
|
let i = this.crosshair?.getPosition() ?? null;
|
|
173
|
-
|
|
173
|
+
zt(e, t, n, this.options, r, i);
|
|
174
174
|
}
|
|
175
175
|
update(e) {
|
|
176
176
|
this.options = {
|
|
@@ -187,7 +187,7 @@ var U = {
|
|
|
187
187
|
destroy() {
|
|
188
188
|
this.crosshair?.destroy(), super.destroy();
|
|
189
189
|
}
|
|
190
|
-
},
|
|
190
|
+
}, G = class extends V {
|
|
191
191
|
options;
|
|
192
192
|
crosshair = null;
|
|
193
193
|
constructor(e, t) {
|
|
@@ -195,7 +195,7 @@ var U = {
|
|
|
195
195
|
}
|
|
196
196
|
renderChart(e, t, n, r) {
|
|
197
197
|
let i = this.crosshair?.getPosition() ?? null;
|
|
198
|
-
|
|
198
|
+
Bt(e, t, n, this.options, r, i);
|
|
199
199
|
}
|
|
200
200
|
update(e, t) {
|
|
201
201
|
this.options = {
|
|
@@ -215,7 +215,7 @@ var U = {
|
|
|
215
215
|
destroy() {
|
|
216
216
|
this.crosshair?.destroy(), super.destroy();
|
|
217
217
|
}
|
|
218
|
-
},
|
|
218
|
+
}, K = class extends V {
|
|
219
219
|
options;
|
|
220
220
|
crosshair = null;
|
|
221
221
|
cachedRects = [];
|
|
@@ -241,8 +241,8 @@ var U = {
|
|
|
241
241
|
id: e.id,
|
|
242
242
|
weight: e.weight ?? (Math.abs(e.value) || 1)
|
|
243
243
|
}));
|
|
244
|
-
this.cachedRects =
|
|
245
|
-
} else this.cachedRects =
|
|
244
|
+
this.cachedRects = Pt(n, e, t);
|
|
245
|
+
} else this.cachedRects = Ft(this.currentData.map((e) => ({ id: e.id })), e, t);
|
|
246
246
|
}
|
|
247
247
|
onCanvasClick(e, t) {
|
|
248
248
|
if (this.options.onCellClick) for (let n of this.cachedRects) {
|
|
@@ -257,7 +257,7 @@ var U = {
|
|
|
257
257
|
renderChart(e, t, n, r) {
|
|
258
258
|
(t !== this.lastLayoutWidth || n !== this.lastLayoutHeight) && this.recomputeLayout();
|
|
259
259
|
let i = this.crosshair?.getPosition() ?? null;
|
|
260
|
-
|
|
260
|
+
Ht(e, t, n, this.currentData, this.cachedRects, this.options, r, i);
|
|
261
261
|
}
|
|
262
262
|
update(e) {
|
|
263
263
|
this.currentData = e, this.options = {
|
|
@@ -282,7 +282,7 @@ var U = {
|
|
|
282
282
|
}
|
|
283
283
|
renderChart(e, t, n, r) {
|
|
284
284
|
let i = this.crosshair?.getPosition() ?? null;
|
|
285
|
-
|
|
285
|
+
Wt(e, t, n, this.options, r, i);
|
|
286
286
|
}
|
|
287
287
|
update(e) {
|
|
288
288
|
this.options = {
|
|
@@ -315,7 +315,7 @@ var sn = class extends V {
|
|
|
315
315
|
super(e, t.theme), this.options = t, this.currentValue = t.value, this.targetValue = t.value, this.requestRender();
|
|
316
316
|
}
|
|
317
317
|
renderChart(e, t, n, r) {
|
|
318
|
-
|
|
318
|
+
Vt(e, t, n, this.options, r, this.currentValue);
|
|
319
319
|
}
|
|
320
320
|
setValue(e) {
|
|
321
321
|
if (this.options.animate === !1) {
|
|
@@ -356,7 +356,7 @@ var sn = class extends V {
|
|
|
356
356
|
destroy() {
|
|
357
357
|
this.cancelAnimation(), super.destroy();
|
|
358
358
|
}
|
|
359
|
-
},
|
|
359
|
+
}, cn = [
|
|
360
360
|
"Jan",
|
|
361
361
|
"Feb",
|
|
362
362
|
"Mar",
|
|
@@ -391,7 +391,7 @@ function Y(e) {
|
|
|
391
391
|
if (e.length === 0) return [];
|
|
392
392
|
let t = [];
|
|
393
393
|
for (let n of e) {
|
|
394
|
-
let e =
|
|
394
|
+
let e = ze(n.time, "1M"), r = t[t.length - 1];
|
|
395
395
|
r && r.key === e ? r.close = n.equity : t.push({
|
|
396
396
|
key: e,
|
|
397
397
|
close: n.equity
|
|
@@ -404,7 +404,7 @@ function Y(e) {
|
|
|
404
404
|
let a = new Date(e.key), o = a.getUTCFullYear(), s = a.getUTCMonth();
|
|
405
405
|
r.push({
|
|
406
406
|
id: `${o}-${String(s + 1).padStart(2, "0")}`,
|
|
407
|
-
label:
|
|
407
|
+
label: cn[s],
|
|
408
408
|
group: String(o),
|
|
409
409
|
value: i
|
|
410
410
|
});
|
|
@@ -464,9 +464,9 @@ function Q(e) {
|
|
|
464
464
|
//#endregion
|
|
465
465
|
//#region src/finance/PerformanceDashboard.ts
|
|
466
466
|
function $(e) {
|
|
467
|
-
return !e || e === "dark" ?
|
|
467
|
+
return !e || e === "dark" ? d : e === "light" ? b : e;
|
|
468
468
|
}
|
|
469
|
-
var
|
|
469
|
+
var ln = class {
|
|
470
470
|
options;
|
|
471
471
|
theme;
|
|
472
472
|
root;
|
|
@@ -509,7 +509,7 @@ var cn = class {
|
|
|
509
509
|
"gap:14px"
|
|
510
510
|
].join(";"), this.root.appendChild(o);
|
|
511
511
|
let s = this.buildPanel("Equity Curve", i, a);
|
|
512
|
-
s.wrap.style.gridColumn = "1 / -1", o.appendChild(s.wrap), this.equityChart = new
|
|
512
|
+
s.wrap.style.gridColumn = "1 / -1", o.appendChild(s.wrap), this.equityChart = new G(s.body, {
|
|
513
513
|
data: q(t.equityCurve),
|
|
514
514
|
theme: e,
|
|
515
515
|
lineColor: e.candleUp,
|
|
@@ -517,7 +517,7 @@ var cn = class {
|
|
|
517
517
|
crosshair: !0
|
|
518
518
|
});
|
|
519
519
|
let c = this.buildPanel("Drawdown", i, a);
|
|
520
|
-
o.appendChild(c.wrap), this.drawdownChart = new
|
|
520
|
+
o.appendChild(c.wrap), this.drawdownChart = new G(c.body, {
|
|
521
521
|
data: J(t.equityCurve),
|
|
522
522
|
theme: e,
|
|
523
523
|
lineColor: e.candleDown,
|
|
@@ -526,7 +526,7 @@ var cn = class {
|
|
|
526
526
|
valueFormat: (e) => `${e.toFixed(1)}%`
|
|
527
527
|
});
|
|
528
528
|
let l = Y(t.equityCurve), u = this.buildPanel("Monthly Returns", i, a);
|
|
529
|
-
o.appendChild(u.wrap), this.heatmap = new
|
|
529
|
+
o.appendChild(u.wrap), this.heatmap = new K(u.body, {
|
|
530
530
|
data: l,
|
|
531
531
|
theme: e,
|
|
532
532
|
showValues: !0,
|
|
@@ -615,6 +615,6 @@ var cn = class {
|
|
|
615
615
|
}
|
|
616
616
|
};
|
|
617
617
|
//#endregion
|
|
618
|
-
export {
|
|
618
|
+
export { We as AlertManager, Ge as Animator, Ke as BarCountdown, qe as BinanceAdapter, Je as BybitAdapter, de as CHART_STYLE_KEYS, i as Chart, tn as ChartGrid, Ye as ChartLegend, Xe as ChartStateManager, Ze as CoinbaseAdapter, Qe as CompareRenderer, $e as CrosshairTooltip, et as CurrentPriceLine, fe as DARK_TERMINAL, pe as DARK_THEME, f as DEFAULT_DRAWING_STYLE, r as DEFAULT_HISTORY_PAGE_SIZE, tt as DEFAULT_LEGEND_CONFIG, nt as DEFAULT_MAX_WEBGL_CHARTS, p as DEFAULT_RECONNECT, rt as DEFAULT_SESSION_HOURS, m as DEFAULT_SIGNAL_STYLE, h as DEFAULT_STREAM_CONFIG, g as DEFAULT_TIMEFRAME_FAVORITES, _ as DEFAULT_TRADE_ZONE_STYLE, v as DEFAULT_TRADING_CONFIG, it as DataExporter, e as DataManager, W as DepthChart, ne as DragDropImporter, at as DrawingBase, u as EXCHANGE_TIMEZONE, ot as Easing, G as EquityCurveChart, sn as GaugeChart, le as HISTORY_RETRY_MS, K as HeatmapChart, st as IndicatorBase, ct as IndicatorValueMap, lt as KeyboardHandler, ut as KrakenAdapter, y as LIGHT_THEME, ce as LayoutManager, oe as LayoutSession, x as MARKET_CRYPTO, S as MARKET_HNX, C as MARKET_HOSE, w as MARKET_NYSE, T as MARKET_UPCOM, dt as MAX_ALERT_BARS, te as MAX_LAYOUT_NAME, ft as MIN_ALERT_BARS, pt as MockAdapter, c as PLUGIN_API_VERSION, E as PRICE_SOURCES, mt as PaperExecutionAdapter, ln as PerformanceDashboard, se as PluginManager, ht as PollingAdapter, gt as RANGE_PRESETS, _t as ReplayManager, vt as ResamplingAdapter, yt as Screenshot, bt as SessionBreaks, xt as SessionShading, St as SignalMarkerManager, nn as SparklineChart, Ct as StreamManager, D as TC_PALETTE, O as TC_SERIES_COLORS, k as TIMEFRAMES_CRYPTO, A as TIMEFRAMES_FOREX, j as TIMEFRAMES_STOCK, ue as ThemeManager, wt as TickAggregator, Tt as TickBarAdapter, Et as TickBarBuilder, Dt as TradeZoneManager, Ot as UndoRedoManager, M as VN_COLORS, N as VOLUME_ALPHA, kt as VolumeRenderer, rn as WaterfallChart, At as Watermark, jt as WebSocketAdapter, P as barsAreDaily, ie as cleanLayoutName, a as clearGlobalPlugins, J as computeDrawdownCurve, Y as computeMonthlyReturns, F as computePriceLimits, I as createVNTheme, L as formatFraction, R as formatNumber, Mt as formatTooltipTime, z as formatVND, B as formatVolumeLoc, me as fractionTick, he as getCurrentSession, o as getGlobalPlugins, ge as getLocale, _e as indicatorSource, Nt as isPriceLevelAlert, ve as isPriceSource, ye as isTimeFrame, be as isValidTimeZone, l as localStorageLayouts, It as lttbDownsample, Lt as lttbVisibleIndices, xe as marketStatus, n as memoryLayouts, Se as normalizeBar, Ce as normalizeBarTime, we as offsetAt, s as overlaysForLayer, Te as parseIndicatorSource, ae as parseOHLCV, Ee as parseTimeframe, De as pickBaseTimeframe, t as pluginKey, Oe as priceFormatterFor, Rt as rangePresetStart, ke as rankSymbols, Ae as readNews, je as readQuote, Me as registerLocale, re as registerPlugin, Ne as resampleBars, Q as selectKeyStats, Gt as servesTimeframe, Pe as setLocale, Kt as setMaxWebGLCharts, Fe as sourcePrice, Ie as stepDecimals, Le as t, Re as tickBarCount, Be as timeframeToMs, q as toEquityPoints, qt as toHeikinAshi, Jt as toKagi, Yt as toLineBreak, Xt as toPointAndFigure, Zt as toRangeBars, Qt as toRenko, ee as unregisterPlugin, Ve as volumeColor, He as wallToUtc, $t as withResampling, en as withTickBars, Ue as zoneOffsetMinutes };
|
|
619
619
|
|
|
620
620
|
//# sourceMappingURL=index.js.map
|