@tradecanvas/chart 1.38.0 → 1.39.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 +1 -1
- package/dist/Chart.d.ts +9 -0
- package/dist/Chart.d.ts.map +1 -1
- package/dist/{LayoutSession-DFL2W819.js → LayoutSession-Cu_2o34T.js} +13 -2
- package/dist/LayoutSession-Cu_2o34T.js.map +1 -0
- package/dist/{LayoutSession-CQuy66RZ.cjs → LayoutSession-DgJNtsTx.cjs} +2 -2
- package/dist/LayoutSession-DgJNtsTx.cjs.map +1 -0
- package/dist/i18n-82FrUIVP.cjs +2 -0
- package/dist/i18n-82FrUIVP.cjs.map +1 -0
- package/dist/{i18n-EHdUj7jZ.js → i18n-LW1r5UcX.js} +43 -9
- package/dist/i18n-LW1r5UcX.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/widget/ChartWidget.d.ts +14 -5
- package/dist/widget/ChartWidget.d.ts.map +1 -1
- package/dist/widget/WidgetGoToDate.d.ts +72 -20
- package/dist/widget/WidgetGoToDate.d.ts.map +1 -1
- package/dist/widget/WidgetHotkeySheet.d.ts.map +1 -1
- package/dist/widget/WidgetSymbolSearch.d.ts +104 -20
- package/dist/widget/WidgetSymbolSearch.d.ts.map +1 -1
- package/dist/widget/calendarPopup.d.ts +2 -28
- package/dist/widget/calendarPopup.d.ts.map +1 -1
- package/dist/widget/formControls.d.ts +1 -1
- package/dist/widget/formControls.d.ts.map +1 -1
- package/dist/widget/index.cjs +442 -114
- package/dist/widget/index.cjs.map +1 -1
- package/dist/widget/index.js +2054 -1624
- package/dist/widget/index.js.map +1 -1
- package/dist/widget/keyTarget.d.ts +2 -2
- package/dist/widget/keyTarget.d.ts.map +1 -1
- 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 +21 -4
- 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 +589 -113
- 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/monthView.d.ts +56 -0
- package/dist/widget/monthView.d.ts.map +1 -0
- package/dist/widget/widgetCompare.d.ts +34 -0
- package/dist/widget/widgetCompare.d.ts.map +1 -0
- package/dist/widget/widgetFeatures.d.ts +1 -1
- package/dist/widget/widgetFeatures.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/LayoutSession-CQuy66RZ.cjs.map +0 -1
- package/dist/LayoutSession-DFL2W819.js.map +0 -1
- package/dist/i18n-3mW6rmUi.cjs +0 -2
- package/dist/i18n-3mW6rmUi.cjs.map +0 -1
- package/dist/i18n-EHdUj7jZ.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./LayoutSession-CQuy66RZ.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}});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./LayoutSession-DgJNtsTx.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.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-Cu_2o34T.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
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
|
|
@@ -7,6 +7,7 @@ import { indicatorChipLabel } from '../indicatorLabel.js';
|
|
|
7
7
|
import { ResolvedWidgetUI, WidgetUIPreset, WidgetUITheme } from './widgetUI.js';
|
|
8
8
|
import { WidgetLayoutContent } from './widgetLayout.js';
|
|
9
9
|
import { LayoutSession } from '../state/LayoutSession.js';
|
|
10
|
+
import { CompareWay } from './widgetCompare.js';
|
|
10
11
|
import { WidgetFeature, WidgetFeatures } from './widgetFeatures.js';
|
|
11
12
|
export declare class ChartWidget {
|
|
12
13
|
private chart;
|
|
@@ -165,6 +166,10 @@ export declare class ChartWidget {
|
|
|
165
166
|
/** Ranges apply one at a time, each reading the bars the last one brought. */
|
|
166
167
|
private rangeQueue;
|
|
167
168
|
private compares;
|
|
169
|
+
/** How the compare dialog adds a symbol: the way picked last. */
|
|
170
|
+
private compareWay;
|
|
171
|
+
/** Symbols whose bars are on the way to be compared in percent. */
|
|
172
|
+
private readonly comparesLoading;
|
|
168
173
|
/** Every switch, on or off (see `setFeatures`). */
|
|
169
174
|
private featureState;
|
|
170
175
|
/** The host's own shortcuts, first added first. */
|
|
@@ -251,6 +256,8 @@ export declare class ChartWidget {
|
|
|
251
256
|
private applyChartShapes;
|
|
252
257
|
destroy(): void;
|
|
253
258
|
private handleSymbolClick;
|
|
259
|
+
/** The symbol search, started from `query` (a letter typed on the chart). */
|
|
260
|
+
private openSymbolSearch;
|
|
254
261
|
/** The host's symbol search, else the adapter's; none filters `symbols`. */
|
|
255
262
|
private symbolSearchFn;
|
|
256
263
|
private handleTimeframe;
|
|
@@ -378,7 +385,8 @@ export declare class ChartWidget {
|
|
|
378
385
|
/** The display timezone from the settings; 'exchange' is the zone the chart resolved it to. */
|
|
379
386
|
private displayTimezone;
|
|
380
387
|
private toggleGoToDate;
|
|
381
|
-
|
|
388
|
+
/** A moment to centre, or a span to show edge to edge, from the Go to dialog. */
|
|
389
|
+
private goTo;
|
|
382
390
|
/** Pinned timeframes that are still on offer, shortest first. */
|
|
383
391
|
private pinnedTimeframes;
|
|
384
392
|
/** The timeframe menu's rows, typed intervals marked so they can be removed. */
|
|
@@ -432,8 +440,10 @@ export declare class ChartWidget {
|
|
|
432
440
|
private openIndicatorSettings;
|
|
433
441
|
private refreshObjects;
|
|
434
442
|
private handleAddCompare;
|
|
435
|
-
/**
|
|
436
|
-
private
|
|
443
|
+
/** What is compared with the chart's symbol now, as the compare dialog lists it. */
|
|
444
|
+
private comparedNow;
|
|
445
|
+
/** The compare dialog's list, after something was compared or taken off. */
|
|
446
|
+
private refreshCompareDialog;
|
|
437
447
|
/**
|
|
438
448
|
* Compare with another symbol: its percent change on the price scale
|
|
439
449
|
* (`'percent'`, the default), its price on a scale of its own (`'scale'`)
|
|
@@ -617,8 +627,7 @@ export declare class ChartWidget {
|
|
|
617
627
|
}
|
|
618
628
|
export { indicatorChipLabel };
|
|
619
629
|
type ActiveIndicator = ReturnType<Chart['getActiveIndicators']>[number];
|
|
620
|
-
|
|
621
|
-
export type CompareWay = 'percent' | 'scale' | 'pane' | 'spread' | 'ratio' | 'correlation' | 'correlationLog';
|
|
630
|
+
export type { CompareWay };
|
|
622
631
|
/**
|
|
623
632
|
* The lines `instanceId` can be computed from: every drawn line of the other
|
|
624
633
|
* indicators, except those that already read from it (that would be a loop).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartWidget.d.ts","sourceRoot":"","sources":["../../src/widget/ChartWidget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkE,KAAK,EAA2B,KAAK,EAAE,SAAS,EAAmB,MAAM,sBAAsB,CAAC;AAI9K,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,KAAK,EAAuB,kBAAkB,EAAuD,MAAM,YAAY,CAAC;AAa/H,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAMzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAA4C,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAqBzI,OAAO,EAAuD,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAClH,OAAO,EAA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03-01") and time ("14:30", empty = midnight) in the
|
|
4
5
|
* display timezone (an IANA zone, minutes east of UTC, or null for the
|
|
@@ -6,41 +7,92 @@ import { TimeZoneSetting } from '@tradecanvas/commons';
|
|
|
6
7
|
*/
|
|
7
8
|
export declare function wallTimeToUtc(date: string, time: string, tz: TimeZoneSetting): number | null;
|
|
8
9
|
/** The date and time fields' values for `ts` in the display timezone. */
|
|
9
|
-
export declare function utcToWallTime(ts: number, tz: TimeZoneSetting):
|
|
10
|
+
export declare function utcToWallTime(ts: number, tz: TimeZoneSetting): WallTime;
|
|
11
|
+
/** A date (YYYY-MM-DD) and a time (HH:MM, or empty for the day's start) on the wall clock. */
|
|
12
|
+
export interface WallTime {
|
|
10
13
|
date: string;
|
|
11
14
|
time: string;
|
|
12
|
-
}
|
|
13
|
-
export interface
|
|
15
|
+
}
|
|
16
|
+
export interface GoToLabels {
|
|
14
17
|
title: string;
|
|
18
|
+
/** The tabs. */
|
|
15
19
|
date: string;
|
|
20
|
+
range: string;
|
|
21
|
+
/** The range's ends. */
|
|
22
|
+
from: string;
|
|
23
|
+
to: string;
|
|
16
24
|
time: string;
|
|
17
25
|
submit: string;
|
|
18
26
|
cancel: string;
|
|
27
|
+
close: string;
|
|
28
|
+
calendar: CalendarLabels;
|
|
29
|
+
}
|
|
30
|
+
/** Where to go: a moment to centre, or a span to show edge to edge. */
|
|
31
|
+
export type GoToTarget = ({
|
|
32
|
+
kind: 'date';
|
|
33
|
+
} & WallTime) | {
|
|
34
|
+
kind: 'range';
|
|
35
|
+
from: WallTime;
|
|
36
|
+
to: WallTime;
|
|
37
|
+
};
|
|
38
|
+
export interface GoToStart {
|
|
39
|
+
/** The Date tab's moment. */
|
|
40
|
+
date: WallTime;
|
|
41
|
+
/** The Custom range tab's ends. */
|
|
42
|
+
range: {
|
|
43
|
+
from: WallTime;
|
|
44
|
+
to: WallTime;
|
|
45
|
+
};
|
|
46
|
+
/** Whether bars have a time of day (not on daily bars and longer). */
|
|
47
|
+
withTime: boolean;
|
|
48
|
+
/** The last day that can be picked, YYYY-MM-DD. */
|
|
49
|
+
max?: string;
|
|
50
|
+
/** Today in the time zone the dates are read in; the browser's when left out. */
|
|
51
|
+
today?: string;
|
|
19
52
|
}
|
|
20
53
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
54
|
+
* The Go to dialog. Date: a day and a time to centre the chart on. Custom
|
|
55
|
+
* range: two of them to show edge to edge. The month under the fields fills
|
|
56
|
+
* the date field in hand; after a range's start it moves on to its end.
|
|
57
|
+
* Mounts in the widget's overlay layer; focus goes back to what opened it.
|
|
23
58
|
*/
|
|
24
59
|
export declare class WidgetGoToDate {
|
|
25
|
-
private readonly
|
|
60
|
+
private readonly layer;
|
|
26
61
|
private readonly labels;
|
|
62
|
+
private readonly locale;
|
|
27
63
|
private readonly onSubmit;
|
|
28
|
-
private
|
|
64
|
+
private backdrop;
|
|
65
|
+
private fieldsEl;
|
|
66
|
+
private tabButtons;
|
|
67
|
+
private month;
|
|
68
|
+
/** The date field the month fills. */
|
|
69
|
+
private active;
|
|
70
|
+
private values;
|
|
71
|
+
private start;
|
|
72
|
+
private tab;
|
|
29
73
|
private returnFocus;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
private readonly onOutside;
|
|
33
|
-
constructor(host: HTMLElement, labels: GoToDateLabels, onSubmit: (value: {
|
|
34
|
-
date: string;
|
|
35
|
-
time: string;
|
|
36
|
-
}) => void);
|
|
74
|
+
private readonly uid;
|
|
75
|
+
constructor(layer: () => HTMLElement, labels: () => GoToLabels, locale: () => string, onSubmit: (target: GoToTarget) => void);
|
|
37
76
|
isOpen(): boolean;
|
|
38
|
-
open(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}, opener?: Element | null): void;
|
|
42
|
-
close(): void;
|
|
77
|
+
open(start: GoToStart): void;
|
|
78
|
+
/** Close without going anywhere; focus goes back to what opened it unless `giveFocusBack` is false. */
|
|
79
|
+
close(giveFocusBack?: boolean): void;
|
|
43
80
|
destroy(): void;
|
|
44
|
-
private
|
|
81
|
+
private build;
|
|
82
|
+
private buildTabs;
|
|
83
|
+
private buildFooter;
|
|
84
|
+
private select;
|
|
85
|
+
/** The tab's fields, the month on its first date; `focusField` puts the keyboard there. */
|
|
86
|
+
private renderTab;
|
|
87
|
+
/** A date and, on intraday bars, a time, after the name of the range's end they set. */
|
|
88
|
+
private row;
|
|
89
|
+
private input;
|
|
90
|
+
private setActive;
|
|
91
|
+
private showMonth;
|
|
92
|
+
/** A day from the month: into the field in hand; a range's start then moves on to its end. */
|
|
93
|
+
private pickDay;
|
|
94
|
+
private submit;
|
|
95
|
+
/** Arrow keys (the other way right to left), Home and End move between the tabs. */
|
|
96
|
+
private onTabKey;
|
|
45
97
|
}
|
|
46
98
|
//# sourceMappingURL=WidgetGoToDate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetGoToDate.d.ts","sourceRoot":"","sources":["../../src/widget/WidgetGoToDate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"WidgetGoToDate.d.ts","sourceRoot":"","sources":["../../src/widget/WidgetGoToDate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGlF,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAMhE;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAS5F;AAED,yEAAyE;AACzE,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,eAAe,GAAG,QAAQ,CAOvE;AAED,8FAA8F;AAC9F,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;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O;IAIjB,OAAO,IAAI,IAAI;CAGhB"}
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { SymbolInfo } from '@tradecanvas/commons';
|
|
2
2
|
import { Translator } from './i18n.js';
|
|
3
|
-
/**
|
|
4
|
-
* Symbol picker. Reuses the command-palette CSS for visual consistency.
|
|
5
|
-
*
|
|
6
|
-
* - Without a search function it filters the symbols it was given with a
|
|
7
|
-
* cheap subsequence match, good enough for lists in the low thousands.
|
|
8
|
-
* - With one (a feed's `searchSymbols`) it asks once typing pauses, cancels a
|
|
9
|
-
* query a newer one replaced, and lists names and exchanges.
|
|
10
|
-
*/
|
|
11
3
|
export interface SymbolSearchCallbacks {
|
|
12
4
|
onPick: (symbol: string) => void;
|
|
13
5
|
onClose: () => void;
|
|
@@ -16,42 +8,134 @@ export interface SymbolSearchCallbacks {
|
|
|
16
8
|
export type SymbolSearchFn = (query: string, signal: AbortSignal) => Promise<SymbolInfo[]>;
|
|
17
9
|
/** How long typing must pause before a search function is asked. */
|
|
18
10
|
export declare const SYMBOL_SEARCH_DEBOUNCE_MS = 150;
|
|
11
|
+
/** What the symbol search opens with. */
|
|
12
|
+
export interface SymbolSearchStart {
|
|
13
|
+
/** Listed until something is typed; filtered as it is when there is no `search`. */
|
|
14
|
+
symbols: readonly string[];
|
|
15
|
+
/** The chart's symbol, marked in the list. */
|
|
16
|
+
current: string;
|
|
17
|
+
/** A feed's search, asked once typing pauses. */
|
|
18
|
+
search?: SymbolSearchFn;
|
|
19
|
+
/** Typed already: the letter that opened it. */
|
|
20
|
+
query?: string;
|
|
21
|
+
/** Where a pick goes, in place of `onPick`. */
|
|
22
|
+
onPick?: (symbol: string) => void;
|
|
23
|
+
/** A line at the foot. */
|
|
24
|
+
hint?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Something compared with the chart's symbol, as the compare dialog lists it. */
|
|
27
|
+
export interface CompareEntry {
|
|
28
|
+
id: string;
|
|
29
|
+
symbol: string;
|
|
30
|
+
/** How it is compared, in words. */
|
|
31
|
+
way: string;
|
|
32
|
+
color?: string;
|
|
33
|
+
}
|
|
34
|
+
/** What the compare dialog opens with. */
|
|
35
|
+
export interface CompareStart {
|
|
36
|
+
symbols: readonly string[];
|
|
37
|
+
current: string;
|
|
38
|
+
search?: SymbolSearchFn;
|
|
39
|
+
/** The ways to add a symbol, and the one chosen to start with. */
|
|
40
|
+
ways: readonly {
|
|
41
|
+
id: string;
|
|
42
|
+
label: string;
|
|
43
|
+
}[];
|
|
44
|
+
way: string;
|
|
45
|
+
compared: readonly CompareEntry[];
|
|
46
|
+
onAdd: (symbol: string, way: string) => void;
|
|
47
|
+
onRemove: (id: string) => void;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The symbol search, and the same dialog for adding a symbol to compare.
|
|
51
|
+
*
|
|
52
|
+
* - Without a search function it filters the symbols it was given with a
|
|
53
|
+
* cheap subsequence match, good enough for lists in the low thousands.
|
|
54
|
+
* - With one (a feed's `searchSymbols`) it asks once typing pauses, cancels a
|
|
55
|
+
* query a newer one replaced, and lists names, kinds and exchanges; the
|
|
56
|
+
* names it hears of are kept for the list it opens with next time.
|
|
57
|
+
* - Results of more than one kind (stocks and crypto, say) can be narrowed to one.
|
|
58
|
+
* - Comparing, a pick adds the symbol the way chosen above the list and the
|
|
59
|
+
* dialog stays; what is compared already is listed first, each removable.
|
|
60
|
+
*
|
|
61
|
+
* The keys stay in the search field: up and down move through the list, Enter picks.
|
|
62
|
+
*/
|
|
19
63
|
export declare class WidgetSymbolSearch {
|
|
64
|
+
private readonly callbacks;
|
|
20
65
|
private readonly host;
|
|
21
66
|
private readonly t;
|
|
22
67
|
private backdrop;
|
|
23
|
-
private modal;
|
|
24
68
|
private input;
|
|
25
69
|
private list;
|
|
26
|
-
|
|
27
|
-
private
|
|
28
|
-
|
|
70
|
+
/** What scrolls: what is compared, the list of symbols, a note when there are none. */
|
|
71
|
+
private results;
|
|
72
|
+
/** Says "Searching…", "Search failed", "No symbols match" to a screen reader. */
|
|
73
|
+
private live;
|
|
74
|
+
private kindsEl;
|
|
75
|
+
private mode;
|
|
76
|
+
private rows;
|
|
77
|
+
private shown;
|
|
78
|
+
/** The kind of symbol the list keeps to; null for all. */
|
|
79
|
+
private kind;
|
|
80
|
+
private compared;
|
|
81
|
+
private way;
|
|
29
82
|
private selectedIndex;
|
|
30
|
-
private callbacks;
|
|
31
|
-
private boundKeydown;
|
|
32
|
-
/** One-shot pick override — when set, this open() routes picks here instead. */
|
|
33
|
-
private pickOverride;
|
|
34
83
|
private searchFn;
|
|
35
84
|
private searchTimer;
|
|
36
85
|
private searchAbort;
|
|
37
86
|
private status;
|
|
38
87
|
/** Enter came before the results for what was typed: take the top one when they land. */
|
|
39
88
|
private pickOnResults;
|
|
40
|
-
/**
|
|
89
|
+
/** Names, kinds and exchanges the search told of, by symbol. */
|
|
90
|
+
private readonly known;
|
|
91
|
+
private returnFocus;
|
|
92
|
+
private readonly uid;
|
|
93
|
+
/** Where the dialog mounts (the widget's overlay layer: themed, and inside it when fullscreen). */
|
|
41
94
|
constructor(callbacks: SymbolSearchCallbacks, host?: () => HTMLElement, t?: Translator);
|
|
42
|
-
open(
|
|
95
|
+
open(start: SymbolSearchStart): void;
|
|
96
|
+
openCompare(start: CompareStart): void;
|
|
97
|
+
/** What is compared now, after an add or a remove. */
|
|
98
|
+
setCompared(entries: readonly CompareEntry[]): void;
|
|
43
99
|
close(): void;
|
|
44
100
|
isOpen(): boolean;
|
|
101
|
+
/** Whether it is open to add a symbol to compare. */
|
|
102
|
+
isComparing(): boolean;
|
|
45
103
|
destroy(): void;
|
|
104
|
+
private begin;
|
|
105
|
+
private build;
|
|
106
|
+
private buildHeader;
|
|
107
|
+
private buildSearch;
|
|
108
|
+
/** Comparing: how the next symbol is added. */
|
|
109
|
+
private buildWay;
|
|
110
|
+
/** The symbols it was given, named where a search told of them. */
|
|
111
|
+
private listGiven;
|
|
112
|
+
private given;
|
|
46
113
|
private filter;
|
|
47
114
|
private scheduleSearch;
|
|
48
115
|
/** Run the search the pause would have started, now. */
|
|
49
116
|
private searchNow;
|
|
50
117
|
private runSearch;
|
|
51
118
|
private cancelSearch;
|
|
119
|
+
/** New rows: the kinds on offer, the list, the keys on the chart's symbol (`atCurrent`) or the top. */
|
|
120
|
+
private afterResults;
|
|
121
|
+
/** The rows on show: of the kind picked, and comparing, not the chart's own symbol. */
|
|
122
|
+
private visibleRows;
|
|
123
|
+
/** Chips for the kinds the results come in, when there are two or more. */
|
|
124
|
+
private renderKinds;
|
|
125
|
+
/**
|
|
126
|
+
* What is compared (comparing, before anything is typed) as a group under
|
|
127
|
+
* its heading, then the symbols, a listbox of options only, under theirs;
|
|
128
|
+
* a note when there are none, told to a screen reader too.
|
|
129
|
+
*/
|
|
52
130
|
private renderList;
|
|
53
|
-
private
|
|
131
|
+
private emptyNote;
|
|
132
|
+
private heading;
|
|
133
|
+
private row;
|
|
134
|
+
/** A symbol compared already: its name, its colour and way under Description, and a button to take it off. */
|
|
135
|
+
private addedRow;
|
|
136
|
+
private tag;
|
|
137
|
+
private markSelection;
|
|
54
138
|
private pick;
|
|
55
|
-
private
|
|
139
|
+
private onKeyDown;
|
|
56
140
|
}
|
|
57
141
|
//# sourceMappingURL=WidgetSymbolSearch.d.ts.map
|