@tradecanvas/chart 1.32.0 → 1.35.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 +4 -4
- package/dist/Chart.d.ts +39 -1
- package/dist/Chart.d.ts.map +1 -1
- package/dist/{LayoutSession-B8vZsDaL.js → LayoutSession-CbqemKK4.js} +383 -336
- package/dist/LayoutSession-CbqemKK4.js.map +1 -0
- package/dist/LayoutSession-YDUD_7LQ.cjs +2 -0
- package/dist/LayoutSession-YDUD_7LQ.cjs.map +1 -0
- package/dist/{i18n-BPt_Qbx8.js → i18n-BbTfjEM4.js} +83 -9
- package/dist/i18n-BbTfjEM4.js.map +1 -0
- package/dist/i18n-yiJSpIn5.cjs +2 -0
- package/dist/i18n-yiJSpIn5.cjs.map +1 -0
- 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 +53 -53
- package/dist/widget/ChartWidget.d.ts +35 -8
- package/dist/widget/ChartWidget.d.ts.map +1 -1
- package/dist/widget/WidgetChartNav.d.ts +9 -2
- package/dist/widget/WidgetChartNav.d.ts.map +1 -1
- package/dist/widget/WidgetDepthLadder.d.ts +2 -0
- package/dist/widget/WidgetDepthLadder.d.ts.map +1 -1
- package/dist/widget/WidgetDrawingSidebar.d.ts +9 -0
- package/dist/widget/WidgetDrawingSidebar.d.ts.map +1 -1
- package/dist/widget/WidgetIndicatorLegend.d.ts +4 -0
- package/dist/widget/WidgetIndicatorLegend.d.ts.map +1 -1
- package/dist/widget/WidgetIndicatorPicker.d.ts +96 -0
- package/dist/widget/WidgetIndicatorPicker.d.ts.map +1 -0
- package/dist/widget/WidgetIndicatorSettings.d.ts +51 -23
- package/dist/widget/WidgetIndicatorSettings.d.ts.map +1 -1
- package/dist/widget/WidgetSelectionToolbar.d.ts +6 -1
- package/dist/widget/WidgetSelectionToolbar.d.ts.map +1 -1
- package/dist/widget/WidgetStatusBar.d.ts +63 -4
- package/dist/widget/WidgetStatusBar.d.ts.map +1 -1
- package/dist/widget/WidgetStyles.d.ts.map +1 -1
- package/dist/widget/WidgetToolbar.d.ts +9 -11
- package/dist/widget/WidgetToolbar.d.ts.map +1 -1
- package/dist/widget/WidgetTradeMenu.d.ts +29 -0
- package/dist/widget/WidgetTradeMenu.d.ts.map +1 -0
- package/dist/widget/drawingHotkeys.d.ts +6 -0
- package/dist/widget/drawingHotkeys.d.ts.map +1 -0
- package/dist/widget/focusTrap.d.ts +5 -2
- package/dist/widget/focusTrap.d.ts.map +1 -1
- package/dist/widget/index.cjs +859 -235
- package/dist/widget/index.cjs.map +1 -1
- package/dist/widget/index.js +2196 -1969
- package/dist/widget/index.js.map +1 -1
- package/dist/widget/indicatorDefaults.d.ts +18 -0
- package/dist/widget/indicatorDefaults.d.ts.map +1 -0
- package/dist/widget/indicatorSearch.d.ts +13 -0
- package/dist/widget/indicatorSearch.d.ts.map +1 -0
- package/dist/widget/indicatorSettingsTabs.d.ts +32 -0
- package/dist/widget/indicatorSettingsTabs.d.ts.map +1 -0
- package/dist/widget/locales/ar.d.ts.map +1 -1
- package/dist/widget/locales/cs.d.ts.map +1 -1
- package/dist/widget/locales/da.d.ts.map +1 -1
- package/dist/widget/locales/de.d.ts.map +1 -1
- package/dist/widget/locales/el.d.ts.map +1 -1
- package/dist/widget/locales/en.d.ts +39 -2
- package/dist/widget/locales/en.d.ts.map +1 -1
- package/dist/widget/locales/es.d.ts.map +1 -1
- package/dist/widget/locales/et.d.ts.map +1 -1
- package/dist/widget/locales/fa.d.ts.map +1 -1
- package/dist/widget/locales/fr.d.ts.map +1 -1
- package/dist/widget/locales/he.d.ts.map +1 -1
- package/dist/widget/locales/hu.d.ts.map +1 -1
- package/dist/widget/locales/id.d.ts.map +1 -1
- package/dist/widget/locales/index.cjs +1 -1
- package/dist/widget/locales/index.cjs.map +1 -1
- package/dist/widget/locales/index.js +1093 -57
- package/dist/widget/locales/index.js.map +1 -1
- package/dist/widget/locales/it.d.ts.map +1 -1
- package/dist/widget/locales/ja.d.ts.map +1 -1
- package/dist/widget/locales/ko.d.ts.map +1 -1
- package/dist/widget/locales/ms.d.ts.map +1 -1
- package/dist/widget/locales/nb.d.ts.map +1 -1
- package/dist/widget/locales/nl.d.ts.map +1 -1
- package/dist/widget/locales/pl.d.ts.map +1 -1
- package/dist/widget/locales/pt.d.ts.map +1 -1
- package/dist/widget/locales/ro.d.ts.map +1 -1
- package/dist/widget/locales/ru.d.ts.map +1 -1
- package/dist/widget/locales/sk.d.ts.map +1 -1
- package/dist/widget/locales/sv.d.ts.map +1 -1
- package/dist/widget/locales/th.d.ts.map +1 -1
- package/dist/widget/locales/tr.d.ts.map +1 -1
- package/dist/widget/locales/vi.d.ts.map +1 -1
- package/dist/widget/locales/zh.d.ts.map +1 -1
- package/dist/widget/locales/zhHant.d.ts.map +1 -1
- package/dist/widget/symbolInfoView.d.ts +59 -0
- package/dist/widget/symbolInfoView.d.ts.map +1 -0
- package/dist/widget/types.d.ts +19 -17
- package/dist/widget/types.d.ts.map +1 -1
- package/dist/widget/widgetConfig.d.ts +1 -3
- package/dist/widget/widgetConfig.d.ts.map +1 -1
- package/dist/widget/widgetFeatures.d.ts +1 -1
- package/dist/widget/widgetFeatures.d.ts.map +1 -1
- package/dist/widget/widgetTimeframes.d.ts +9 -0
- package/dist/widget/widgetTimeframes.d.ts.map +1 -1
- package/dist/widget/widgetUI.d.ts +6 -9
- package/dist/widget/widgetUI.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/LayoutSession-B8vZsDaL.js.map +0 -1
- package/dist/LayoutSession-Du0WuDJi.cjs +0 -2
- package/dist/LayoutSession-Du0WuDJi.cjs.map +0 -1
- package/dist/i18n-BPt_Qbx8.js.map +0 -1
- package/dist/i18n-DWtAiG7D.cjs +0 -2
- package/dist/i18n-DWtAiG7D.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./LayoutSession-Du0WuDJi.cjs`);let t=require(`@tradecanvas/commons`),n=require(`@tradecanvas/core`);function r(e){let{id:t,params:n={},position:r=null}=typeof e==`string`?{id:e}:e;return JSON.stringify([t,Object.keys(n).sort().map(e=>[e,n[e]]),r])}function i(e,t,n){let i=new Map,a=t.map(e=>{let t=r(e),n=i.get(t)??0;return i.set(t,n+1),{spec:e,key:`${t}#${n}`}}),o=new Set(a.map(e=>e.key));for(let[t,r]of[...n])o.has(t)||(e.removeIndicator(r),n.delete(t));for(let{spec:t,key:r}of a){if(n.has(r))continue;let i=typeof t==`string`?e.addIndicator(t):t.position===void 0?e.addIndicator(t.id,t.params??{}):e.addIndicator(t.id,t.params??{},t.position);i&&n.set(r,i)}}function a(e){let{viewport:t,data:r}=e,i=(0,n.priceToYMapper)(t),a=r.length-1,o=Math.max(0,Math.floor(t.visibleRange.from)),s=Math.min(a,Math.ceil(t.visibleRange.to)),c=e=>r.length>0?(0,n.timestampToBarIndex)(e,r):e;return{timeToX:e=>(0,n.barIndexToX)(c(e),t),xToTime:e=>{let i=(0,n.xToBarIndex)(e,t);return r.length>0?(0,n.barIndexToTime)(i,r):i},indexToX:e=>(0,n.barIndexToX)(e,t),xToIndex:e=>(0,n.xToBarIndex)(e,t),priceToY:i,yToPrice:e=>(0,n.yToPrice)(e,t),barWidth:t.barWidth,visible:s<o?{from:0,to:-1}:{from:o,to:s}}}var o={"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}},s=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}=o[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}=o[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:r}=o[e],i=n*r;if(i<t)for(let e=t-1;e>=i;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<i;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()}}},c=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()}},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.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()}},u=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()}},d=class extends n.BaseFinanceChart{options;crosshair=null;cachedRects=[];cachedGroups=[];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.applyLabel(),this.recomputeLayout(),this.requestRender()}applyLabel(){let e=new Set(this.currentData.map(e=>e.group).filter(Boolean)).size,t=this.options.grouped&&e>0?`Market map of ${this.currentData.length} cells in ${e} groups`:`Heatmap of ${this.currentData.length} cells`;this.setLabel(this.options.ariaLabel??t)}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.cachedGroups=[],this.options.grouped){let{groups:r,cells:i}=(0,n.layoutGroupedTreemap)(this.currentData.map(e=>({id:e.id,weight:e.weight??(Math.abs(e.value)||1),group:e.group,value:e.value})),e,t,n.GROUP_HEADER);this.cachedRects=i,this.cachedGroups=r}else if(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,this.cachedGroups)}update(e){this.currentData=e,this.options={...this.options,data:e},this.applyLabel(),this.recomputeLayout(),this.requestRender()}setOptions(e){this.options={...this.options,...e},e.data&&(this.currentData=e.data),this.applyLabel(),this.recomputeLayout(),this.requestRender()}destroy(){this.crosshair?.destroy(),this.handleClick&&this.canvas.removeEventListener(`click`,this.handleClick),super.destroy()}},f=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()}},p=500;function m(e){let t=1-e;return 1-t*t*t}var h=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??p,n=performance.now()-this.animationStart,r=Math.min(1,n/Math.max(1,t)),i=m(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()}},g=class extends n.BaseFinanceChart{options;layout=null;layoutFor=null;crosshair;onClick=e=>{let t=this.canvas.getBoundingClientRect();this.layout&&this.clickAt(this.layout,e.clientX-t.left,e.clientY-t.top)};onMove=e=>{if(!this.layout||!this.clickable())return;let t=this.canvas.getBoundingClientRect();this.canvas.style.cursor=this.hits(this.layout,e.clientX-t.left,e.clientY-t.top)?`pointer`:``};constructor(e,t){super(e,t.theme),this.options=t,this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender()),this.canvas.addEventListener(`click`,this.onClick),this.canvas.addEventListener(`pointermove`,this.onMove),this.applyLabel(),this.requestRender()}renderChart(e,t,r,i){let a=this.options.crosshair===!1?null:this.crosshair.getPosition(),o=this.layoutFor;(!this.layout||!o||o.options!==this.options||o.width!==t||o.height!==r||o.theme!==i)&&(this.layout=this.compute(t,r,i,(0,n.canvasMeasure)(e,i)),this.layoutFor={options:this.options,width:t,height:r,theme:i}),this.draw(e,t,r,i,a,this.layout)}setOptions(e){this.options={...this.options,...e},`theme`in e&&this.setTheme(e.theme??`dark`),this.applyLabel(),this.requestRender()}applyLabel(){this.setLabel(this.options.ariaLabel??this.describe())}destroy(){this.crosshair.destroy(),this.canvas.removeEventListener(`click`,this.onClick),this.canvas.removeEventListener(`pointermove`,this.onMove),super.destroy()}},_=class extends g{compute(e,t,r,i){return(0,n.computeBarLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderBarChart)(e,t,r,this.options,i,a,o)}describe(){return`Bar chart of ${this.options.series.map(e=>e.name).join(`, `)}, ${this.options.categories.length} categories`}clickable(){return this.options.onBarClick!==void 0}hits(e,t,r){return(0,n.hitBar)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.hitBar)(e,t,r);i&&this.options.onBarClick?.({category:i.category,series:i.series,value:i.value,index:i.index})}update(e,t){this.setOptions({categories:e,series:t})}},v=class extends g{compute(e,t,r,i){return(0,n.computeDonutLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderDonut)(e,t,r,this.options,i,a,o)}describe(){let e=this.options.data.filter(e=>Number.isFinite(e.value)&&e.value>0).map(e=>e.label).join(`, `);return`${(this.options.innerRadius??.6)>0?`Donut`:`Pie`} chart of ${e}`}clickable(){return this.options.onSliceClick!==void 0}hits(e,t,r){return(0,n.hitSlice)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.hitSlice)(e,t,r);i&&this.options.onSliceClick?.(i.slice)}update(e){this.setOptions({data:e})}},y=class extends g{compute(e,t,r,i){return(0,n.computeScatterLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderScatter)(e,t,r,this.options,i,a,o)}describe(){let e=this.options.series.reduce((e,t)=>e+t.points.length,0);return`Scatter chart${this.options.xLabel&&this.options.yLabel?` of ${this.options.yLabel} against ${this.options.xLabel}`:``}, ${e} points`}clickable(){return this.options.onPointClick!==void 0}hits(e,t,r){return(0,n.nearestPoint)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.nearestPoint)(e,t,r);i&&this.options.onPointClick?.(i.point,i.series)}update(e){this.setOptions({series:e})}},b=class extends g{compute(e,t,r,i){return(0,n.computeHistogramLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderHistogram)(e,t,r,this.options,i,a,o)}describe(){return`Histogram of ${this.options.values.length} values`}clickable(){return!1}hits(){return!1}clickAt(){}update(e){this.setOptions({values:e})}},x=class extends g{compute(e,t,r,i){return(0,n.computeCalendarLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderCalendar)(e,t,r,this.options,i,a,o)}describe(){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];return t&&n?`Calendar of daily values from ${t} to ${n}`:`Calendar of daily values`}clickable(){return this.options.onDayClick!==void 0}hits(e,t,r){return(0,n.hitDay)(e,t,r)?.day!==void 0}clickAt(e,t,r){let i=(0,n.hitDay)(e,t,r)?.day;i&&this.options.onDayClick?.(i)}update(e){this.setOptions({data:e})}},S=12,C=class extends g{compute(e,t,r,i){return(0,n.computeMatrixLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderMatrix)(e,t,r,this.options,i,a,o)}describe(){let{rows:e,columns:t}=this.options;return t?e.length+t.length<=S?`Matrix of ${e.join(`, `)} by ${t.join(`, `)}`:`Matrix of ${e.length} rows by ${t.length} columns`:e.length<=S?`Matrix of ${e.join(`, `)}`:`Matrix of ${e.length} rows`}clickable(){return this.options.onCellClick!==void 0}hits(e,t,r){return(0,n.hitMatrixCell)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.hitMatrixCell)(e,t,r);i&&this.options.onCellClick?.(i.cell)}update(e){this.setOptions({values:e})}},w=class extends g{compute(e,t,r,i){return(0,n.computeCounterClockLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderCounterClock)(e,t,r,this.options,i,a,o)}describe(){return`Counter-clock chart of price against volume, ${this.options.period??25}-bar averages`}clickable(){return this.options.onPointClick!==void 0}hits(e,t,r){return(0,n.nearestCounterClockPoint)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.nearestCounterClockPoint)(e,t,r);i&&this.options.onPointClick?.(i.point)}getPhase(){return(0,n.counterClockPhase)((0,n.counterClockPoints)(this.options.data,this.options.period??25,(0,n.shownCount)(this.options)))}update(e){this.setOptions({data:e})}},T=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function E(e){return e.map(e=>({time:e.time,value:e.equity}))}function D(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 O(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:T[s],group:String(o),value:n})}return i}function k(e){return`${e>0?`+`:``}${e.toFixed(2)}%`}function A(e){return e>0?`positive`:e<0?`negative`:`neutral`}function j(e){return[{label:`Total Return`,value:k(e.totalReturnPct),tone:A(e.totalReturnPct)},{label:`CAGR`,value:k(e.cagr*100),tone:A(e.cagr)},{label:`Sharpe`,value:e.sharpe.toFixed(2),tone:A(e.sharpe)},{label:`Sortino`,value:e.sortino.toFixed(2),tone:A(e.sortino)},{label:`Max Drawdown`,value:k(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:A(e.profitFactor-1)},{label:`Trades`,value:String(e.trades),tone:`neutral`}]}function M(e){return!e||e===`dark`?t.DARK_THEME:e===`light`?t.LIGHT_THEME:e}var N=class{options;theme;root;equityChart=null;drawdownChart=null;heatmap=null;constructor(e,t){this.options=t,this.theme=M(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(j(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 s=this.buildPanel(`Equity Curve`,i,a);s.wrap.style.gridColumn=`1 / -1`,o.appendChild(s.wrap),this.equityChart=new u(s.body,{data:E(t.equityCurve),theme:e,lineColor:e.candleUp,fillArea:!0,crosshair:!0});let c=this.buildPanel(`Drawdown`,i,a);o.appendChild(c.wrap),this.drawdownChart=new u(c.body,{data:D(t.equityCurve),theme:e,lineColor:e.candleDown,fillArea:!0,crosshair:!0,valueFormat:e=>`${e.toFixed(1)}%`});let l=O(t.equityCurve),f=this.buildPanel(`Monthly Returns`,i,a);o.appendChild(f.wrap),this.heatmap=new d(f.body,{data:l,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=M(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}}),exports.BarChart=_,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,`CANDLE_PATTERNS`,{enumerable:!0,get:function(){return n.CANDLE_PATTERNS}}),Object.defineProperty(exports,`CHART_STYLE_KEYS`,{enumerable:!0,get:function(){return t.CHART_STYLE_KEYS}}),exports.CalendarChart=x,exports.Chart=e.c,exports.ChartGrid=s,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}}),exports.CounterClockChart=w,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=l,exports.DonutChart=v,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=u,exports.GaugeChart=h,exports.HISTORY_RETRY_MS=e.x,Object.defineProperty(exports,`HNX_SESSIONS`,{enumerable:!0,get:function(){return t.HNX_SESSIONS}}),Object.defineProperty(exports,`HOSE_SESSIONS`,{enumerable:!0,get:function(){return t.HOSE_SESSIONS}}),exports.HeatmapChart=d,exports.HistogramChart=b,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_HOSE_ETF`,{enumerable:!0,get:function(){return t.MARKET_HOSE_ETF}}),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,`MARKET_VN30F`,{enumerable:!0,get:function(){return t.MARKET_VN30F}}),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,`MS_TIME_THRESHOLD`,{enumerable:!0,get:function(){return t.MS_TIME_THRESHOLD}}),exports.MatrixChart=C,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=N,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}}),exports.ScatterChart=y,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=c,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,`UPCOM_SESSIONS`,{enumerable:!0,get:function(){return t.UPCOM_SESSIONS}}),Object.defineProperty(exports,`UndoRedoManager`,{enumerable:!0,get:function(){return n.UndoRedoManager}}),Object.defineProperty(exports,`VN30F_SESSIONS`,{enumerable:!0,get:function(){return t.VN30F_SESSIONS}}),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=f,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,`barIndexToX`,{enumerable:!0,get:function(){return n.barIndexToX}}),Object.defineProperty(exports,`barTimeUnit`,{enumerable:!0,get:function(){return t.barTimeUnit}}),Object.defineProperty(exports,`barsAreDaily`,{enumerable:!0,get:function(){return t.barsAreDaily}}),exports.cleanLayoutName=e.r,exports.clearGlobalPlugins=e.d,exports.computeDrawdownCurve=D,exports.computeMonthlyReturns=O,Object.defineProperty(exports,`computePriceLimits`,{enumerable:!0,get:function(){return t.computePriceLimits}}),Object.defineProperty(exports,`correlationMatrix`,{enumerable:!0,get:function(){return n.correlationMatrix}}),Object.defineProperty(exports,`counterClockPhase`,{enumerable:!0,get:function(){return n.counterClockPhase}}),Object.defineProperty(exports,`counterClockPoints`,{enumerable:!0,get:function(){return n.counterClockPoints}}),Object.defineProperty(exports,`createVNTheme`,{enumerable:!0,get:function(){return t.createVNTheme}}),Object.defineProperty(exports,`detectCandlePatterns`,{enumerable:!0,get:function(){return n.detectCandlePatterns}}),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,`histogramBins`,{enumerable:!0,get:function(){return n.histogramBins}}),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,`niceScale`,{enumerable:!0,get:function(){return n.niceScale}}),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.overlayScale=a,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,`priceStepAt`,{enumerable:!0,get:function(){return t.priceStepAt}}),Object.defineProperty(exports,`priceToY`,{enumerable:!0,get:function(){return n.priceToY}}),Object.defineProperty(exports,`priceToYMapper`,{enumerable:!0,get:function(){return n.priceToYMapper}}),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}}),Object.defineProperty(exports,`roundToPriceStep`,{enumerable:!0,get:function(){return t.roundToPriceStep}}),Object.defineProperty(exports,`scaleMarketPrices`,{enumerable:!0,get:function(){return t.scaleMarketPrices}}),exports.selectKeyStats=j,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}}),exports.syncIndicators=i,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,`timeToX`,{enumerable:!0,get:function(){return n.timeToX}}),Object.defineProperty(exports,`timeframeToMs`,{enumerable:!0,get:function(){return t.timeframeToMs}}),Object.defineProperty(exports,`timestampToBarIndex`,{enumerable:!0,get:function(){return n.timestampToBarIndex}}),exports.toEquityPoints=E,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,`vn30fContracts`,{enumerable:!0,get:function(){return t.vn30fContracts}}),Object.defineProperty(exports,`vn30fLastTradingDay`,{enumerable:!0,get:function(){return t.vn30fLastTradingDay}}),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,`xToBarIndex`,{enumerable:!0,get:function(){return n.xToBarIndex}}),Object.defineProperty(exports,`xToTime`,{enumerable:!0,get:function(){return n.xToTime}}),Object.defineProperty(exports,`yToPrice`,{enumerable:!0,get:function(){return n.yToPrice}}),Object.defineProperty(exports,`zoneOffsetMinutes`,{enumerable:!0,get:function(){return t.zoneOffsetMinutes}});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./LayoutSession-YDUD_7LQ.cjs`);let t=require(`@tradecanvas/commons`),n=require(`@tradecanvas/core`);function r(e){let{id:t,params:n={},position:r=null}=typeof e==`string`?{id:e}:e;return JSON.stringify([t,Object.keys(n).sort().map(e=>[e,n[e]]),r])}function i(e,t,n){let i=new Map,a=t.map(e=>{let t=r(e),n=i.get(t)??0;return i.set(t,n+1),{spec:e,key:`${t}#${n}`}}),o=new Set(a.map(e=>e.key));for(let[t,r]of[...n])o.has(t)||(e.removeIndicator(r),n.delete(t));for(let{spec:t,key:r}of a){if(n.has(r))continue;let i=typeof t==`string`?e.addIndicator(t):t.position===void 0?e.addIndicator(t.id,t.params??{}):e.addIndicator(t.id,t.params??{},t.position);i&&n.set(r,i)}}function a(e){let{viewport:t,data:r}=e,i=(0,n.priceToYMapper)(t),a=r.length-1,o=Math.max(0,Math.floor(t.visibleRange.from)),s=Math.min(a,Math.ceil(t.visibleRange.to)),c=e=>r.length>0?(0,n.timestampToBarIndex)(e,r):e;return{timeToX:e=>(0,n.barIndexToX)(c(e),t),xToTime:e=>{let i=(0,n.xToBarIndex)(e,t);return r.length>0?(0,n.barIndexToTime)(i,r):i},indexToX:e=>(0,n.barIndexToX)(e,t),xToIndex:e=>(0,n.xToBarIndex)(e,t),priceToY:i,yToPrice:e=>(0,n.yToPrice)(e,t),barWidth:t.barWidth,visible:s<o?{from:0,to:-1}:{from:o,to:s}}}var o={"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}},s=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}=o[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}=o[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:r}=o[e],i=n*r;if(i<t)for(let e=t-1;e>=i;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<i;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()}}},c=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()}},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.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()}},u=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()}},d=class extends n.BaseFinanceChart{options;crosshair=null;cachedRects=[];cachedGroups=[];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.applyLabel(),this.recomputeLayout(),this.requestRender()}applyLabel(){let e=new Set(this.currentData.map(e=>e.group).filter(Boolean)).size,t=this.options.grouped&&e>0?`Market map of ${this.currentData.length} cells in ${e} groups`:`Heatmap of ${this.currentData.length} cells`;this.setLabel(this.options.ariaLabel??t)}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.cachedGroups=[],this.options.grouped){let{groups:r,cells:i}=(0,n.layoutGroupedTreemap)(this.currentData.map(e=>({id:e.id,weight:e.weight??(Math.abs(e.value)||1),group:e.group,value:e.value})),e,t,n.GROUP_HEADER);this.cachedRects=i,this.cachedGroups=r}else if(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,this.cachedGroups)}update(e){this.currentData=e,this.options={...this.options,data:e},this.applyLabel(),this.recomputeLayout(),this.requestRender()}setOptions(e){this.options={...this.options,...e},e.data&&(this.currentData=e.data),this.applyLabel(),this.recomputeLayout(),this.requestRender()}destroy(){this.crosshair?.destroy(),this.handleClick&&this.canvas.removeEventListener(`click`,this.handleClick),super.destroy()}},f=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()}},p=500;function m(e){let t=1-e;return 1-t*t*t}var h=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??p,n=performance.now()-this.animationStart,r=Math.min(1,n/Math.max(1,t)),i=m(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()}},g=class extends n.BaseFinanceChart{options;layout=null;layoutFor=null;crosshair;onClick=e=>{let t=this.canvas.getBoundingClientRect();this.layout&&this.clickAt(this.layout,e.clientX-t.left,e.clientY-t.top)};onMove=e=>{if(!this.layout||!this.clickable())return;let t=this.canvas.getBoundingClientRect();this.canvas.style.cursor=this.hits(this.layout,e.clientX-t.left,e.clientY-t.top)?`pointer`:``};constructor(e,t){super(e,t.theme),this.options=t,this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender()),this.canvas.addEventListener(`click`,this.onClick),this.canvas.addEventListener(`pointermove`,this.onMove),this.applyLabel(),this.requestRender()}renderChart(e,t,r,i){let a=this.options.crosshair===!1?null:this.crosshair.getPosition(),o=this.layoutFor;(!this.layout||!o||o.options!==this.options||o.width!==t||o.height!==r||o.theme!==i)&&(this.layout=this.compute(t,r,i,(0,n.canvasMeasure)(e,i)),this.layoutFor={options:this.options,width:t,height:r,theme:i}),this.draw(e,t,r,i,a,this.layout)}setOptions(e){this.options={...this.options,...e},`theme`in e&&this.setTheme(e.theme??`dark`),this.applyLabel(),this.requestRender()}applyLabel(){this.setLabel(this.options.ariaLabel??this.describe())}destroy(){this.crosshair.destroy(),this.canvas.removeEventListener(`click`,this.onClick),this.canvas.removeEventListener(`pointermove`,this.onMove),super.destroy()}},_=class extends g{compute(e,t,r,i){return(0,n.computeBarLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderBarChart)(e,t,r,this.options,i,a,o)}describe(){return`Bar chart of ${this.options.series.map(e=>e.name).join(`, `)}, ${this.options.categories.length} categories`}clickable(){return this.options.onBarClick!==void 0}hits(e,t,r){return(0,n.hitBar)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.hitBar)(e,t,r);i&&this.options.onBarClick?.({category:i.category,series:i.series,value:i.value,index:i.index})}update(e,t){this.setOptions({categories:e,series:t})}},v=class extends g{compute(e,t,r,i){return(0,n.computeDonutLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderDonut)(e,t,r,this.options,i,a,o)}describe(){let e=this.options.data.filter(e=>Number.isFinite(e.value)&&e.value>0).map(e=>e.label).join(`, `);return`${(this.options.innerRadius??.6)>0?`Donut`:`Pie`} chart of ${e}`}clickable(){return this.options.onSliceClick!==void 0}hits(e,t,r){return(0,n.hitSlice)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.hitSlice)(e,t,r);i&&this.options.onSliceClick?.(i.slice)}update(e){this.setOptions({data:e})}},y=class extends g{compute(e,t,r,i){return(0,n.computeScatterLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderScatter)(e,t,r,this.options,i,a,o)}describe(){let e=this.options.series.reduce((e,t)=>e+t.points.length,0);return`Scatter chart${this.options.xLabel&&this.options.yLabel?` of ${this.options.yLabel} against ${this.options.xLabel}`:``}, ${e} points`}clickable(){return this.options.onPointClick!==void 0}hits(e,t,r){return(0,n.nearestPoint)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.nearestPoint)(e,t,r);i&&this.options.onPointClick?.(i.point,i.series)}update(e){this.setOptions({series:e})}},b=class extends g{compute(e,t,r,i){return(0,n.computeHistogramLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderHistogram)(e,t,r,this.options,i,a,o)}describe(){return`Histogram of ${this.options.values.length} values`}clickable(){return!1}hits(){return!1}clickAt(){}update(e){this.setOptions({values:e})}},x=class extends g{compute(e,t,r,i){return(0,n.computeCalendarLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderCalendar)(e,t,r,this.options,i,a,o)}describe(){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];return t&&n?`Calendar of daily values from ${t} to ${n}`:`Calendar of daily values`}clickable(){return this.options.onDayClick!==void 0}hits(e,t,r){return(0,n.hitDay)(e,t,r)?.day!==void 0}clickAt(e,t,r){let i=(0,n.hitDay)(e,t,r)?.day;i&&this.options.onDayClick?.(i)}update(e){this.setOptions({data:e})}},S=12,C=class extends g{compute(e,t,r,i){return(0,n.computeMatrixLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderMatrix)(e,t,r,this.options,i,a,o)}describe(){let{rows:e,columns:t}=this.options;return t?e.length+t.length<=S?`Matrix of ${e.join(`, `)} by ${t.join(`, `)}`:`Matrix of ${e.length} rows by ${t.length} columns`:e.length<=S?`Matrix of ${e.join(`, `)}`:`Matrix of ${e.length} rows`}clickable(){return this.options.onCellClick!==void 0}hits(e,t,r){return(0,n.hitMatrixCell)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.hitMatrixCell)(e,t,r);i&&this.options.onCellClick?.(i.cell)}update(e){this.setOptions({values:e})}},w=class extends g{compute(e,t,r,i){return(0,n.computeCounterClockLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderCounterClock)(e,t,r,this.options,i,a,o)}describe(){return`Counter-clock chart of price against volume, ${this.options.period??25}-bar averages`}clickable(){return this.options.onPointClick!==void 0}hits(e,t,r){return(0,n.nearestCounterClockPoint)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.nearestCounterClockPoint)(e,t,r);i&&this.options.onPointClick?.(i.point)}getPhase(){return(0,n.counterClockPhase)((0,n.counterClockPoints)(this.options.data,this.options.period??25,(0,n.shownCount)(this.options)))}update(e){this.setOptions({data:e})}},T=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function E(e){return e.map(e=>({time:e.time,value:e.equity}))}function D(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 O(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:T[s],group:String(o),value:n})}return i}function k(e){return`${e>0?`+`:``}${e.toFixed(2)}%`}function A(e){return e>0?`positive`:e<0?`negative`:`neutral`}function j(e){return[{label:`Total Return`,value:k(e.totalReturnPct),tone:A(e.totalReturnPct)},{label:`CAGR`,value:k(e.cagr*100),tone:A(e.cagr)},{label:`Sharpe`,value:e.sharpe.toFixed(2),tone:A(e.sharpe)},{label:`Sortino`,value:e.sortino.toFixed(2),tone:A(e.sortino)},{label:`Max Drawdown`,value:k(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:A(e.profitFactor-1)},{label:`Trades`,value:String(e.trades),tone:`neutral`}]}function M(e){return!e||e===`dark`?t.DARK_THEME:e===`light`?t.LIGHT_THEME:e}var N=class{options;theme;root;equityChart=null;drawdownChart=null;heatmap=null;constructor(e,t){this.options=t,this.theme=M(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(j(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 s=this.buildPanel(`Equity Curve`,i,a);s.wrap.style.gridColumn=`1 / -1`,o.appendChild(s.wrap),this.equityChart=new u(s.body,{data:E(t.equityCurve),theme:e,lineColor:e.candleUp,fillArea:!0,crosshair:!0});let c=this.buildPanel(`Drawdown`,i,a);o.appendChild(c.wrap),this.drawdownChart=new u(c.body,{data:D(t.equityCurve),theme:e,lineColor:e.candleDown,fillArea:!0,crosshair:!0,valueFormat:e=>`${e.toFixed(1)}%`});let l=O(t.equityCurve),f=this.buildPanel(`Monthly Returns`,i,a);o.appendChild(f.wrap),this.heatmap=new d(f.body,{data:l,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=M(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}}),exports.BarChart=_,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,`CANDLE_PATTERNS`,{enumerable:!0,get:function(){return n.CANDLE_PATTERNS}}),Object.defineProperty(exports,`CHART_STYLE_KEYS`,{enumerable:!0,get:function(){return t.CHART_STYLE_KEYS}}),exports.CalendarChart=x,exports.Chart=e.c,exports.ChartGrid=s,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}}),exports.CounterClockChart=w,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=l,exports.DonutChart=v,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=u,exports.GaugeChart=h,exports.HISTORY_RETRY_MS=e.x,Object.defineProperty(exports,`HNX_SESSIONS`,{enumerable:!0,get:function(){return t.HNX_SESSIONS}}),Object.defineProperty(exports,`HOSE_SESSIONS`,{enumerable:!0,get:function(){return t.HOSE_SESSIONS}}),exports.HeatmapChart=d,exports.HistogramChart=b,Object.defineProperty(exports,`INDICATOR_CATEGORIES`,{enumerable:!0,get:function(){return n.INDICATOR_CATEGORIES}}),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_HOSE_ETF`,{enumerable:!0,get:function(){return t.MARKET_HOSE_ETF}}),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,`MARKET_VN30F`,{enumerable:!0,get:function(){return t.MARKET_VN30F}}),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,`MS_TIME_THRESHOLD`,{enumerable:!0,get:function(){return t.MS_TIME_THRESHOLD}}),exports.MatrixChart=C,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=N,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}}),exports.ScatterChart=y,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=c,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,`UPCOM_SESSIONS`,{enumerable:!0,get:function(){return t.UPCOM_SESSIONS}}),Object.defineProperty(exports,`UndoRedoManager`,{enumerable:!0,get:function(){return n.UndoRedoManager}}),Object.defineProperty(exports,`VN30F_SESSIONS`,{enumerable:!0,get:function(){return t.VN30F_SESSIONS}}),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=f,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,`barIndexToX`,{enumerable:!0,get:function(){return n.barIndexToX}}),Object.defineProperty(exports,`barTimeUnit`,{enumerable:!0,get:function(){return t.barTimeUnit}}),Object.defineProperty(exports,`barsAreDaily`,{enumerable:!0,get:function(){return t.barsAreDaily}}),exports.cleanLayoutName=e.r,exports.clearGlobalPlugins=e.d,exports.computeDrawdownCurve=D,exports.computeMonthlyReturns=O,Object.defineProperty(exports,`computePriceLimits`,{enumerable:!0,get:function(){return t.computePriceLimits}}),Object.defineProperty(exports,`correlationMatrix`,{enumerable:!0,get:function(){return n.correlationMatrix}}),Object.defineProperty(exports,`counterClockPhase`,{enumerable:!0,get:function(){return n.counterClockPhase}}),Object.defineProperty(exports,`counterClockPoints`,{enumerable:!0,get:function(){return n.counterClockPoints}}),Object.defineProperty(exports,`createVNTheme`,{enumerable:!0,get:function(){return t.createVNTheme}}),Object.defineProperty(exports,`detectCandlePatterns`,{enumerable:!0,get:function(){return n.detectCandlePatterns}}),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,`histogramBins`,{enumerable:!0,get:function(){return n.histogramBins}}),Object.defineProperty(exports,`indicatorCategory`,{enumerable:!0,get:function(){return n.indicatorCategory}}),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,`niceScale`,{enumerable:!0,get:function(){return n.niceScale}}),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.overlayScale=a,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,`priceStepAt`,{enumerable:!0,get:function(){return t.priceStepAt}}),Object.defineProperty(exports,`priceToY`,{enumerable:!0,get:function(){return n.priceToY}}),Object.defineProperty(exports,`priceToYMapper`,{enumerable:!0,get:function(){return n.priceToYMapper}}),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}}),Object.defineProperty(exports,`roundToPriceStep`,{enumerable:!0,get:function(){return t.roundToPriceStep}}),Object.defineProperty(exports,`scaleMarketPrices`,{enumerable:!0,get:function(){return t.scaleMarketPrices}}),exports.selectKeyStats=j,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}}),exports.syncIndicators=i,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,`timeToX`,{enumerable:!0,get:function(){return n.timeToX}}),Object.defineProperty(exports,`timeframeToMs`,{enumerable:!0,get:function(){return t.timeframeToMs}}),Object.defineProperty(exports,`timestampToBarIndex`,{enumerable:!0,get:function(){return n.timestampToBarIndex}}),exports.toEquityPoints=E,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,`vn30fContracts`,{enumerable:!0,get:function(){return t.vn30fContracts}}),Object.defineProperty(exports,`vn30fLastTradingDay`,{enumerable:!0,get:function(){return t.vn30fLastTradingDay}}),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,`xToBarIndex`,{enumerable:!0,get:function(){return n.xToBarIndex}}),Object.defineProperty(exports,`xToTime`,{enumerable:!0,get:function(){return n.xToTime}}),Object.defineProperty(exports,`yToPrice`,{enumerable:!0,get:function(){return n.yToPrice}}),Object.defineProperty(exports,`zoneOffsetMinutes`,{enumerable:!0,get:function(){return t.zoneOffsetMinutes}});
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { LayoutManager } from './layout/LayoutManager.js';
|
|
|
9
9
|
export * from './plugins/index.js';
|
|
10
10
|
export { parseOHLCV, DragDropImporter } from './io/index.js';
|
|
11
11
|
export type { ParseResult, DragDropImporterCallbacks } from './io/index.js';
|
|
12
|
-
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, CandlePatternInfo, CandlePatternMatch, CandlePatternOptions, CandlePatternDirection, CandlePatternKind, } from '@tradecanvas/commons';
|
|
12
|
+
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, IndicatorIntervals, IntervalUnit, IndicatorCategory, ChartStyleKey, ChartStyleOverrides, ChartStyleOverridesPatch, ResolvedChartStyle, ResolvedLineLook, StyleLayer, StyleValueKind, PaneStyle, WatermarkConfig, GridOptions, CrosshairOptions, SignalMarker, SignalDirection, SignalMarkerStyle, TradeZone, TradeZoneDirection, TradeZoneStyle, CandlePatternInfo, CandlePatternMatch, CandlePatternOptions, CandlePatternDirection, CandlePatternKind, } from '@tradecanvas/commons';
|
|
13
13
|
export { detectCandlePatterns, CANDLE_PATTERNS } from '@tradecanvas/core';
|
|
14
14
|
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';
|
|
15
15
|
export { normalizeBarTime, normalizeBar, barsAreDaily, barTimeUnit, MS_TIME_THRESHOLD } from '@tradecanvas/commons';
|
|
@@ -29,7 +29,7 @@ export type { PriceSource, IndicatorPlot, IndicatorPlotKind, IndicatorScale, Ind
|
|
|
29
29
|
export { setLocale, getLocale, t, registerLocale, formatNumber, formatVND, formatVolumeLoc } from '@tradecanvas/commons';
|
|
30
30
|
export { MARKET_HOSE, MARKET_HOSE_ETF, MARKET_HNX, MARKET_UPCOM, MARKET_VN30F, MARKET_CRYPTO, MARKET_NYSE, HOSE_SESSIONS, HNX_SESSIONS, UPCOM_SESSIONS, VN30F_SESSIONS, VN_COLORS, createVNTheme, computePriceLimits, getCurrentSession, priceStepAt, roundToPriceStep, scaleMarketPrices, vn30fLastTradingDay, vn30fContracts, } from '@tradecanvas/commons';
|
|
31
31
|
export type { PriceStepBand, VN30FContract } from '@tradecanvas/commons';
|
|
32
|
-
export { IndicatorBase, IndicatorValueMap, DrawingBase } from '@tradecanvas/core';
|
|
32
|
+
export { IndicatorBase, IndicatorValueMap, DrawingBase, indicatorCategory, INDICATOR_CATEGORIES } from '@tradecanvas/core';
|
|
33
33
|
export { barIndexToX, xToBarIndex, priceToY, priceToYMapper, yToPrice, timeToX, xToTime, timestampToBarIndex } from '@tradecanvas/core';
|
|
34
34
|
export { StreamManager, BinanceAdapter, MockAdapter, TickAggregator, CurrentPriceLine, PaperExecutionAdapter, WebSocketAdapter, PollingAdapter, CoinbaseAdapter, BybitAdapter, KrakenAdapter, ResamplingAdapter, withResampling, servesTimeframe, TickBarBuilder, TickBarAdapter, withTickBars } from '@tradecanvas/core';
|
|
35
35
|
export type { PaperExecutionOptions, WebSocketAdapterOptions, WsParseResult, PollingAdapterOptions, CoinbaseAdapterOptions, BybitAdapterOptions, KrakenAdapterOptions } from '@tradecanvas/core';
|
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,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAChF,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC7D,YAAY,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,eAAe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UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,oBAAoB,EACpB,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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-
|
|
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-CbqemKK4.js";
|
|
2
2
|
import { CHART_STYLE_KEYS as de, DARK_TERMINAL as fe, DARK_THEME as pe, DARK_THEME as me, DEFAULT_DRAWING_STYLE as he, DEFAULT_RECONNECT as ge, DEFAULT_SIGNAL_STYLE as _e, DEFAULT_STREAM_CONFIG as ve, DEFAULT_TIMEFRAME_FAVORITES as ye, DEFAULT_TRADE_ZONE_STYLE as be, DEFAULT_TRADING_CONFIG as xe, HNX_SESSIONS as Se, HOSE_SESSIONS as Ce, LIGHT_THEME as d, LIGHT_THEME as f, MARKET_CRYPTO as p, MARKET_HNX as m, MARKET_HOSE as h, MARKET_HOSE_ETF as g, MARKET_NYSE as _, MARKET_UPCOM as v, MARKET_VN30F as y, MS_TIME_THRESHOLD as b, PRICE_SOURCES as x, TC_PALETTE as S, TC_SERIES_COLORS as C, TIMEFRAMES_CRYPTO as w, TIMEFRAMES_FOREX as T, TIMEFRAMES_STOCK as E, UPCOM_SESSIONS as D, VN30F_SESSIONS as O, VN_COLORS as k, VOLUME_ALPHA as A, barTimeUnit as we, barsAreDaily as Te, computePriceLimits as Ee, createVNTheme as De, formatFraction as Oe, formatNumber as ke, formatVND as Ae, formatVolumeLoc as je, fractionTick as Me, getCurrentSession as Ne, getLocale as Pe, indicatorSource as Fe, isPriceSource as Ie, isTimeFrame as Le, isValidTimeZone as Re, marketStatus as ze, normalizeBar as Be, normalizeBarTime as Ve, offsetAt as He, parseIndicatorSource as Ue, parseTimeframe as We, pickBaseTimeframe as Ge, priceFormatterFor as Ke, priceStepAt as qe, rankSymbols as Je, readNews as Ye, readQuote as Xe, registerLocale as Ze, resampleBars as Qe, roundToPriceStep as $e, scaleMarketPrices as et, setLocale as tt, sourcePrice as nt, stepDecimals as rt, t as it, tickBarCount as at, timeframeBucketStart as ot, timeframeToMs as st, vn30fContracts as ct, vn30fLastTradingDay as lt, volumeColor as ut, wallToUtc as dt, zoneOffsetMinutes as ft } from "@tradecanvas/commons";
|
|
3
|
-
import { AlertManager as pt, Animator as mt, BarCountdown as ht, BaseFinanceChart as j, BinanceAdapter as gt, BybitAdapter as _t, CANDLE_PATTERNS as vt, ChartLegend as yt, ChartStateManager as bt, CoinbaseAdapter as xt, CompareRenderer as St, CrosshairTooltip as Ct, CurrentPriceLine as wt, DEFAULT_LEGEND_CONFIG as Tt, DEFAULT_MAX_WEBGL_CHARTS as Et, DEFAULT_SESSION_HOURS as Dt, DataExporter as Ot, DrawingBase as kt, Easing as At, FinanceCrosshair as M, GROUP_HEADER as jt,
|
|
3
|
+
import { AlertManager as pt, Animator as mt, BarCountdown as ht, BaseFinanceChart as j, BinanceAdapter as gt, BybitAdapter as _t, CANDLE_PATTERNS as vt, ChartLegend as yt, ChartStateManager as bt, CoinbaseAdapter as xt, CompareRenderer as St, CrosshairTooltip as Ct, CurrentPriceLine as wt, DEFAULT_LEGEND_CONFIG as Tt, DEFAULT_MAX_WEBGL_CHARTS as Et, DEFAULT_SESSION_HOURS as Dt, DataExporter as Ot, DrawingBase as kt, Easing as At, FinanceCrosshair as M, GROUP_HEADER as jt, INDICATOR_CATEGORIES as Mt, IndicatorBase as Nt, IndicatorValueMap as Pt, KeyboardHandler as Ft, KrakenAdapter as It, MAX_ALERT_BARS as Lt, MIN_ALERT_BARS as Rt, MockAdapter as zt, PaperExecutionAdapter as Bt, PollingAdapter as Vt, RANGE_PRESETS as Ht, ReplayManager as Ut, ResamplingAdapter as Wt, Screenshot as N, SessionBreaks as Gt, SessionShading as Kt, SignalMarkerManager as qt, StreamManager as Jt, TickAggregator as Yt, TickBarAdapter as Xt, TickBarBuilder as Zt, TradeZoneManager as Qt, UndoRedoManager as $t, VolumeRenderer as en, Watermark as tn, WebSocketAdapter as nn, barIndexToTime as rn, barIndexToX as an, barIndexToX as P, canvasMeasure as on, computeBarLayout as sn, computeCalendarLayout as cn, computeCounterClockLayout as ln, computeDonutLayout as un, computeHistogramLayout as dn, computeMatrixLayout as fn, computeScatterLayout as pn, correlationMatrix as mn, counterClockPhase as hn, counterClockPhase as gn, counterClockPoints as _n, counterClockPoints as vn, detectCandlePatterns as yn, formatTooltipTime as bn, histogramBins as xn, hitBar as F, hitDay as I, hitMatrixCell as L, hitSlice as R, indicatorCategory as Sn, isPriceLevelAlert as Cn, layoutGroupedTreemap as wn, layoutSquarifiedTreemap as Tn, layoutUniformGrid as En, lttbDownsample as Dn, lttbVisibleIndices as On, nearestCounterClockPoint as z, nearestPoint as B, niceScale as kn, priceToY as An, priceToYMapper as jn, priceToYMapper as Mn, rangePresetStart as Nn, renderBarChart as Pn, renderCalendar as Fn, renderCounterClock as In, renderDepthChart as Ln, renderDonut as Rn, renderEquityCurve as zn, renderGauge as Bn, renderHeatmap as Vn, renderHistogram as Hn, renderMatrix as Un, renderScatter as Wn, renderSparkline as Gn, renderWaterfall as Kn, servesTimeframe as qn, setMaxWebGLCharts as Jn, shownCount as Yn, timeToX as Xn, timestampToBarIndex as Zn, timestampToBarIndex as Qn, toHeikinAshi as $n, toKagi as er, toLineBreak as tr, toPointAndFigure as nr, toRangeBars as rr, toRenko as ir, withResampling as ar, withTickBars as or, xToBarIndex as sr, xToBarIndex as V, xToTime as cr, yToPrice as lr, yToPrice as ur } from "@tradecanvas/core";
|
|
4
4
|
//#region src/frameworks/syncIndicators.ts
|
|
5
|
-
function
|
|
5
|
+
function dr(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 lr(e) {
|
|
|
10
10
|
r
|
|
11
11
|
]);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function fr(e, t, n) {
|
|
14
14
|
let r = /* @__PURE__ */ new Map(), i = t.map((e) => {
|
|
15
|
-
let t =
|
|
15
|
+
let t = dr(e), n = r.get(t) ?? 0;
|
|
16
16
|
return r.set(t, n + 1), {
|
|
17
17
|
spec: e,
|
|
18
18
|
key: `${t}#${n}`
|
|
@@ -27,18 +27,18 @@ function ur(e, t, n) {
|
|
|
27
27
|
}
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region src/plugins/overlayScale.ts
|
|
30
|
-
function
|
|
31
|
-
let { viewport: t, data: n } = e, r =
|
|
30
|
+
function pr(e) {
|
|
31
|
+
let { viewport: t, data: n } = e, r = Mn(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 ? Qn(e, n) : e;
|
|
32
32
|
return {
|
|
33
33
|
timeToX: (e) => P(s(e), t),
|
|
34
34
|
xToTime: (e) => {
|
|
35
35
|
let r = V(e, t);
|
|
36
|
-
return n.length > 0 ?
|
|
36
|
+
return n.length > 0 ? rn(r, n) : r;
|
|
37
37
|
},
|
|
38
38
|
indexToX: (e) => P(e, t),
|
|
39
39
|
xToIndex: (e) => V(e, t),
|
|
40
40
|
priceToY: r,
|
|
41
|
-
yToPrice: (e) =>
|
|
41
|
+
yToPrice: (e) => ur(e, t),
|
|
42
42
|
barWidth: t.barWidth,
|
|
43
43
|
visible: o < a ? {
|
|
44
44
|
from: 0,
|
|
@@ -84,7 +84,7 @@ var H = {
|
|
|
84
84
|
cols: 2,
|
|
85
85
|
rows: 3
|
|
86
86
|
}
|
|
87
|
-
},
|
|
87
|
+
}, mr = class {
|
|
88
88
|
root;
|
|
89
89
|
cells = [];
|
|
90
90
|
layout;
|
|
@@ -191,13 +191,13 @@ var H = {
|
|
|
191
191
|
this.cells = [], this.root.remove();
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
},
|
|
194
|
+
}, hr = class extends j {
|
|
195
195
|
options;
|
|
196
196
|
constructor(e, t) {
|
|
197
197
|
super(e, t.theme), this.options = t, this.requestRender();
|
|
198
198
|
}
|
|
199
199
|
renderChart(e, t, n, r) {
|
|
200
|
-
|
|
200
|
+
Gn(e, t, n, this.options, r);
|
|
201
201
|
}
|
|
202
202
|
update(e) {
|
|
203
203
|
this.options = {
|
|
@@ -211,7 +211,7 @@ var H = {
|
|
|
211
211
|
...e
|
|
212
212
|
}, this.requestRender();
|
|
213
213
|
}
|
|
214
|
-
},
|
|
214
|
+
}, gr = class extends j {
|
|
215
215
|
options;
|
|
216
216
|
crosshair = null;
|
|
217
217
|
constructor(e, t) {
|
|
@@ -219,7 +219,7 @@ var H = {
|
|
|
219
219
|
}
|
|
220
220
|
renderChart(e, t, n, r) {
|
|
221
221
|
let i = this.crosshair?.getPosition() ?? null;
|
|
222
|
-
|
|
222
|
+
Ln(e, t, n, this.options, r, i);
|
|
223
223
|
}
|
|
224
224
|
update(e) {
|
|
225
225
|
this.options = {
|
|
@@ -244,7 +244,7 @@ var H = {
|
|
|
244
244
|
}
|
|
245
245
|
renderChart(e, t, n, r) {
|
|
246
246
|
let i = this.crosshair?.getPosition() ?? null;
|
|
247
|
-
|
|
247
|
+
zn(e, t, n, this.options, r, i);
|
|
248
248
|
}
|
|
249
249
|
update(e, t) {
|
|
250
250
|
this.options = {
|
|
@@ -291,7 +291,7 @@ var H = {
|
|
|
291
291
|
height: this.height
|
|
292
292
|
}, t = this.options.cellPadding ?? 2;
|
|
293
293
|
if (this.lastLayoutWidth = this.width, this.lastLayoutHeight = this.height, this.cachedGroups = [], this.options.grouped) {
|
|
294
|
-
let { groups: n, cells: r } =
|
|
294
|
+
let { groups: n, cells: r } = wn(this.currentData.map((e) => ({
|
|
295
295
|
id: e.id,
|
|
296
296
|
weight: e.weight ?? (Math.abs(e.value) || 1),
|
|
297
297
|
group: e.group,
|
|
@@ -303,8 +303,8 @@ var H = {
|
|
|
303
303
|
id: e.id,
|
|
304
304
|
weight: e.weight ?? (Math.abs(e.value) || 1)
|
|
305
305
|
}));
|
|
306
|
-
this.cachedRects =
|
|
307
|
-
} else this.cachedRects =
|
|
306
|
+
this.cachedRects = Tn(n, e, t);
|
|
307
|
+
} else this.cachedRects = En(this.currentData.map((e) => ({ id: e.id })), e, t);
|
|
308
308
|
}
|
|
309
309
|
onCanvasClick(e, t) {
|
|
310
310
|
if (this.options.onCellClick) for (let n of this.cachedRects) {
|
|
@@ -319,7 +319,7 @@ var H = {
|
|
|
319
319
|
renderChart(e, t, n, r) {
|
|
320
320
|
(t !== this.lastLayoutWidth || n !== this.lastLayoutHeight) && this.recomputeLayout();
|
|
321
321
|
let i = this.crosshair?.getPosition() ?? null;
|
|
322
|
-
|
|
322
|
+
Vn(e, t, n, this.currentData, this.cachedRects, this.options, r, i, this.cachedGroups);
|
|
323
323
|
}
|
|
324
324
|
update(e) {
|
|
325
325
|
this.currentData = e, this.options = {
|
|
@@ -336,7 +336,7 @@ var H = {
|
|
|
336
336
|
destroy() {
|
|
337
337
|
this.crosshair?.destroy(), this.handleClick && this.canvas.removeEventListener("click", this.handleClick), super.destroy();
|
|
338
338
|
}
|
|
339
|
-
},
|
|
339
|
+
}, _r = class extends j {
|
|
340
340
|
options;
|
|
341
341
|
crosshair = null;
|
|
342
342
|
constructor(e, t) {
|
|
@@ -344,7 +344,7 @@ var H = {
|
|
|
344
344
|
}
|
|
345
345
|
renderChart(e, t, n, r) {
|
|
346
346
|
let i = this.crosshair?.getPosition() ?? null;
|
|
347
|
-
|
|
347
|
+
Kn(e, t, n, this.options, r, i);
|
|
348
348
|
}
|
|
349
349
|
update(e) {
|
|
350
350
|
this.options = {
|
|
@@ -361,12 +361,12 @@ var H = {
|
|
|
361
361
|
destroy() {
|
|
362
362
|
this.crosshair?.destroy(), super.destroy();
|
|
363
363
|
}
|
|
364
|
-
},
|
|
365
|
-
function
|
|
364
|
+
}, vr = 500;
|
|
365
|
+
function yr(e) {
|
|
366
366
|
let t = 1 - e;
|
|
367
367
|
return 1 - t * t * t;
|
|
368
368
|
}
|
|
369
|
-
var
|
|
369
|
+
var br = class extends j {
|
|
370
370
|
options;
|
|
371
371
|
currentValue;
|
|
372
372
|
targetValue;
|
|
@@ -377,7 +377,7 @@ var vr = class extends j {
|
|
|
377
377
|
super(e, t.theme), this.options = t, this.currentValue = t.value, this.targetValue = t.value, this.requestRender();
|
|
378
378
|
}
|
|
379
379
|
renderChart(e, t, n, r) {
|
|
380
|
-
|
|
380
|
+
Bn(e, t, n, this.options, r, this.currentValue);
|
|
381
381
|
}
|
|
382
382
|
setValue(e) {
|
|
383
383
|
if (this.options.animate === !1) {
|
|
@@ -407,7 +407,7 @@ var vr = class extends j {
|
|
|
407
407
|
if (this.animationFrameId !== null) return;
|
|
408
408
|
let e = () => {
|
|
409
409
|
if (this.animationFrameId = null, this.animationStart === null) return;
|
|
410
|
-
let t = this.options.animationDuration ??
|
|
410
|
+
let t = this.options.animationDuration ?? vr, n = performance.now() - this.animationStart, r = Math.min(1, n / Math.max(1, t)), i = yr(r);
|
|
411
411
|
this.currentValue = this.animationFrom + (this.targetValue - this.animationFrom) * i, this.requestRender(), r < 1 ? this.animationFrameId = requestAnimationFrame(e) : (this.currentValue = this.targetValue, this.animationStart = null);
|
|
412
412
|
};
|
|
413
413
|
this.animationFrameId = requestAnimationFrame(e);
|
|
@@ -437,7 +437,7 @@ var vr = class extends j {
|
|
|
437
437
|
}
|
|
438
438
|
renderChart(e, t, n, r) {
|
|
439
439
|
let i = this.options.crosshair === !1 ? null : this.crosshair.getPosition(), a = this.layoutFor;
|
|
440
|
-
(!this.layout || !a || a.options !== this.options || a.width !== t || a.height !== n || a.theme !== r) && (this.layout = this.compute(t, n, r,
|
|
440
|
+
(!this.layout || !a || a.options !== this.options || a.width !== t || a.height !== n || a.theme !== r) && (this.layout = this.compute(t, n, r, on(e, r)), this.layoutFor = {
|
|
441
441
|
options: this.options,
|
|
442
442
|
width: t,
|
|
443
443
|
height: n,
|
|
@@ -456,12 +456,12 @@ var vr = class extends j {
|
|
|
456
456
|
destroy() {
|
|
457
457
|
this.crosshair.destroy(), this.canvas.removeEventListener("click", this.onClick), this.canvas.removeEventListener("pointermove", this.onMove), super.destroy();
|
|
458
458
|
}
|
|
459
|
-
},
|
|
459
|
+
}, xr = class extends G {
|
|
460
460
|
compute(e, t, n, r) {
|
|
461
|
-
return
|
|
461
|
+
return sn(this.options, e, t, n, r);
|
|
462
462
|
}
|
|
463
463
|
draw(e, t, n, r, i, a) {
|
|
464
|
-
|
|
464
|
+
Pn(e, t, n, this.options, r, i, a);
|
|
465
465
|
}
|
|
466
466
|
describe() {
|
|
467
467
|
return `Bar chart of ${this.options.series.map((e) => e.name).join(", ")}, ${this.options.categories.length} categories`;
|
|
@@ -487,12 +487,12 @@ var vr = class extends j {
|
|
|
487
487
|
series: t
|
|
488
488
|
});
|
|
489
489
|
}
|
|
490
|
-
},
|
|
490
|
+
}, Sr = class extends G {
|
|
491
491
|
compute(e, t, n, r) {
|
|
492
|
-
return
|
|
492
|
+
return un(this.options, e, t, n, r);
|
|
493
493
|
}
|
|
494
494
|
draw(e, t, n, r, i, a) {
|
|
495
|
-
|
|
495
|
+
Rn(e, t, n, this.options, r, i, a);
|
|
496
496
|
}
|
|
497
497
|
describe() {
|
|
498
498
|
let e = this.options.data.filter((e) => Number.isFinite(e.value) && e.value > 0).map((e) => e.label).join(", ");
|
|
@@ -511,12 +511,12 @@ var vr = class extends j {
|
|
|
511
511
|
update(e) {
|
|
512
512
|
this.setOptions({ data: e });
|
|
513
513
|
}
|
|
514
|
-
},
|
|
514
|
+
}, Cr = class extends G {
|
|
515
515
|
compute(e, t, n, r) {
|
|
516
|
-
return
|
|
516
|
+
return pn(this.options, e, t, n, r);
|
|
517
517
|
}
|
|
518
518
|
draw(e, t, n, r, i, a) {
|
|
519
|
-
|
|
519
|
+
Wn(e, t, n, this.options, r, i, a);
|
|
520
520
|
}
|
|
521
521
|
describe() {
|
|
522
522
|
let e = this.options.series.reduce((e, t) => e + t.points.length, 0);
|
|
@@ -535,12 +535,12 @@ var vr = class extends j {
|
|
|
535
535
|
update(e) {
|
|
536
536
|
this.setOptions({ series: e });
|
|
537
537
|
}
|
|
538
|
-
},
|
|
538
|
+
}, wr = class extends G {
|
|
539
539
|
compute(e, t, n, r) {
|
|
540
|
-
return
|
|
540
|
+
return dn(this.options, e, t, n, r);
|
|
541
541
|
}
|
|
542
542
|
draw(e, t, n, r, i, a) {
|
|
543
|
-
|
|
543
|
+
Hn(e, t, n, this.options, r, i, a);
|
|
544
544
|
}
|
|
545
545
|
describe() {
|
|
546
546
|
return `Histogram of ${this.options.values.length} values`;
|
|
@@ -555,12 +555,12 @@ var vr = class extends j {
|
|
|
555
555
|
update(e) {
|
|
556
556
|
this.setOptions({ values: e });
|
|
557
557
|
}
|
|
558
|
-
},
|
|
558
|
+
}, Tr = class extends G {
|
|
559
559
|
compute(e, t, n, r) {
|
|
560
|
-
return
|
|
560
|
+
return cn(this.options, e, t, n, r);
|
|
561
561
|
}
|
|
562
562
|
draw(e, t, n, r, i, a) {
|
|
563
|
-
|
|
563
|
+
Fn(e, t, n, this.options, r, i, a);
|
|
564
564
|
}
|
|
565
565
|
describe() {
|
|
566
566
|
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];
|
|
@@ -579,12 +579,12 @@ var vr = class extends j {
|
|
|
579
579
|
update(e) {
|
|
580
580
|
this.setOptions({ data: e });
|
|
581
581
|
}
|
|
582
|
-
}, K = 12,
|
|
582
|
+
}, K = 12, Er = class extends G {
|
|
583
583
|
compute(e, t, n, r) {
|
|
584
|
-
return
|
|
584
|
+
return fn(this.options, e, t, n, r);
|
|
585
585
|
}
|
|
586
586
|
draw(e, t, n, r, i, a) {
|
|
587
|
-
|
|
587
|
+
Un(e, t, n, this.options, r, i, a);
|
|
588
588
|
}
|
|
589
589
|
describe() {
|
|
590
590
|
let { rows: e, columns: t } = this.options;
|
|
@@ -603,12 +603,12 @@ var vr = class extends j {
|
|
|
603
603
|
update(e) {
|
|
604
604
|
this.setOptions({ values: e });
|
|
605
605
|
}
|
|
606
|
-
},
|
|
606
|
+
}, Dr = class extends G {
|
|
607
607
|
compute(e, t, n, r) {
|
|
608
|
-
return
|
|
608
|
+
return ln(this.options, e, t, n, r);
|
|
609
609
|
}
|
|
610
610
|
draw(e, t, n, r, i, a) {
|
|
611
|
-
|
|
611
|
+
In(e, t, n, this.options, r, i, a);
|
|
612
612
|
}
|
|
613
613
|
describe() {
|
|
614
614
|
return `Counter-clock chart of price against volume, ${this.options.period ?? 25}-bar averages`;
|
|
@@ -624,12 +624,12 @@ var vr = class extends j {
|
|
|
624
624
|
r && this.options.onPointClick?.(r.point);
|
|
625
625
|
}
|
|
626
626
|
getPhase() {
|
|
627
|
-
return
|
|
627
|
+
return gn(vn(this.options.data, this.options.period ?? 25, Yn(this.options)));
|
|
628
628
|
}
|
|
629
629
|
update(e) {
|
|
630
630
|
this.setOptions({ data: e });
|
|
631
631
|
}
|
|
632
|
-
},
|
|
632
|
+
}, Or = [
|
|
633
633
|
"Jan",
|
|
634
634
|
"Feb",
|
|
635
635
|
"Mar",
|
|
@@ -677,7 +677,7 @@ function Y(e) {
|
|
|
677
677
|
let a = new Date(e.key), o = a.getUTCFullYear(), s = a.getUTCMonth();
|
|
678
678
|
r.push({
|
|
679
679
|
id: `${o}-${String(s + 1).padStart(2, "0")}`,
|
|
680
|
-
label:
|
|
680
|
+
label: Or[s],
|
|
681
681
|
group: String(o),
|
|
682
682
|
value: i
|
|
683
683
|
});
|
|
@@ -739,7 +739,7 @@ function Q(e) {
|
|
|
739
739
|
function $(e) {
|
|
740
740
|
return !e || e === "dark" ? me : e === "light" ? f : e;
|
|
741
741
|
}
|
|
742
|
-
var
|
|
742
|
+
var kr = class {
|
|
743
743
|
options;
|
|
744
744
|
theme;
|
|
745
745
|
root;
|
|
@@ -888,6 +888,6 @@ var Dr = class {
|
|
|
888
888
|
}
|
|
889
889
|
};
|
|
890
890
|
//#endregion
|
|
891
|
-
export { pt as AlertManager, mt as Animator,
|
|
891
|
+
export { pt as AlertManager, mt as Animator, xr as BarChart, ht as BarCountdown, gt as BinanceAdapter, _t as BybitAdapter, vt as CANDLE_PATTERNS, de as CHART_STYLE_KEYS, Tr as CalendarChart, i as Chart, mr as ChartGrid, yt as ChartLegend, bt as ChartStateManager, xt as CoinbaseAdapter, St as CompareRenderer, Dr as CounterClockChart, Ct as CrosshairTooltip, wt as CurrentPriceLine, fe as DARK_TERMINAL, pe as DARK_THEME, he as DEFAULT_DRAWING_STYLE, r as DEFAULT_HISTORY_PAGE_SIZE, Tt as DEFAULT_LEGEND_CONFIG, Et as DEFAULT_MAX_WEBGL_CHARTS, ge as DEFAULT_RECONNECT, Dt as DEFAULT_SESSION_HOURS, _e as DEFAULT_SIGNAL_STYLE, ve as DEFAULT_STREAM_CONFIG, ye as DEFAULT_TIMEFRAME_FAVORITES, be as DEFAULT_TRADE_ZONE_STYLE, xe as DEFAULT_TRADING_CONFIG, Ot as DataExporter, e as DataManager, gr as DepthChart, Sr as DonutChart, ne as DragDropImporter, kt as DrawingBase, u as EXCHANGE_TIMEZONE, At as Easing, U as EquityCurveChart, br as GaugeChart, le as HISTORY_RETRY_MS, Se as HNX_SESSIONS, Ce as HOSE_SESSIONS, W as HeatmapChart, wr as HistogramChart, Mt as INDICATOR_CATEGORIES, Nt as IndicatorBase, Pt as IndicatorValueMap, Ft as KeyboardHandler, It as KrakenAdapter, d as LIGHT_THEME, ce as LayoutManager, oe as LayoutSession, p as MARKET_CRYPTO, m as MARKET_HNX, h as MARKET_HOSE, g as MARKET_HOSE_ETF, _ as MARKET_NYSE, v as MARKET_UPCOM, y as MARKET_VN30F, Lt as MAX_ALERT_BARS, te as MAX_LAYOUT_NAME, Rt as MIN_ALERT_BARS, b as MS_TIME_THRESHOLD, Er as MatrixChart, zt as MockAdapter, c as PLUGIN_API_VERSION, x as PRICE_SOURCES, Bt as PaperExecutionAdapter, kr as PerformanceDashboard, se as PluginManager, Vt as PollingAdapter, Ht as RANGE_PRESETS, Ut as ReplayManager, Wt as ResamplingAdapter, Cr as ScatterChart, N as Screenshot, Gt as SessionBreaks, Kt as SessionShading, qt as SignalMarkerManager, hr as SparklineChart, Jt as StreamManager, S as TC_PALETTE, C as TC_SERIES_COLORS, w as TIMEFRAMES_CRYPTO, T as TIMEFRAMES_FOREX, E as TIMEFRAMES_STOCK, ue as ThemeManager, Yt as TickAggregator, Xt as TickBarAdapter, Zt as TickBarBuilder, Qt as TradeZoneManager, D as UPCOM_SESSIONS, $t as UndoRedoManager, O as VN30F_SESSIONS, k as VN_COLORS, A as VOLUME_ALPHA, en as VolumeRenderer, _r as WaterfallChart, tn as Watermark, nn as WebSocketAdapter, an as barIndexToX, we as barTimeUnit, Te as barsAreDaily, ie as cleanLayoutName, a as clearGlobalPlugins, J as computeDrawdownCurve, Y as computeMonthlyReturns, Ee as computePriceLimits, mn as correlationMatrix, hn as counterClockPhase, _n as counterClockPoints, De as createVNTheme, yn as detectCandlePatterns, Oe as formatFraction, ke as formatNumber, bn as formatTooltipTime, Ae as formatVND, je as formatVolumeLoc, Me as fractionTick, Ne as getCurrentSession, o as getGlobalPlugins, Pe as getLocale, xn as histogramBins, Sn as indicatorCategory, Fe as indicatorSource, Cn as isPriceLevelAlert, Ie as isPriceSource, Le as isTimeFrame, Re as isValidTimeZone, l as localStorageLayouts, Dn as lttbDownsample, On as lttbVisibleIndices, ze as marketStatus, n as memoryLayouts, kn as niceScale, Be as normalizeBar, Ve as normalizeBarTime, He as offsetAt, pr as overlayScale, s as overlaysForLayer, Ue as parseIndicatorSource, ae as parseOHLCV, We as parseTimeframe, Ge as pickBaseTimeframe, t as pluginKey, Ke as priceFormatterFor, qe as priceStepAt, An as priceToY, jn as priceToYMapper, Nn as rangePresetStart, Je as rankSymbols, Ye as readNews, Xe as readQuote, Ze as registerLocale, re as registerPlugin, Qe as resampleBars, $e as roundToPriceStep, et as scaleMarketPrices, Q as selectKeyStats, qn as servesTimeframe, tt as setLocale, Jn as setMaxWebGLCharts, nt as sourcePrice, rt as stepDecimals, fr as syncIndicators, it as t, at as tickBarCount, Xn as timeToX, st as timeframeToMs, Zn as timestampToBarIndex, q as toEquityPoints, $n as toHeikinAshi, er as toKagi, tr as toLineBreak, nr as toPointAndFigure, rr as toRangeBars, ir as toRenko, ee as unregisterPlugin, ct as vn30fContracts, lt as vn30fLastTradingDay, ut as volumeColor, dt as wallToUtc, ar as withResampling, or as withTickBars, sr as xToBarIndex, cr as xToTime, lr as yToPrice, ft as zoneOffsetMinutes };
|
|
892
892
|
|
|
893
893
|
//# sourceMappingURL=index.js.map
|