UNPKG

highcharts

Version:
14 lines 4.84 kB
!/** * Highstock JS v13.0.1 (2026-08-17) * @module highcharts/indicators/aroon * @requires highcharts * @requires highcharts/modules/stock * * Indicator series type for Highcharts Stock * * (c) 2010-2026 Highsoft AS * Author: Wojciech Chmiel * * A commercial license may be required depending on use, * see www.highcharts.com/license */function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(e._Highcharts,e._Highcharts.SeriesRegistry):"function"==typeof define&&define.amd?define("highcharts/indicators/aroon",["highcharts/highcharts"],function(e){return t(e,e.SeriesRegistry)}):"object"==typeof exports?exports["highcharts/indicators/aroon"]=t(e._Highcharts,e._Highcharts.SeriesRegistry):e.Highcharts=t(e.Highcharts,e.Highcharts.SeriesRegistry)}("u"<typeof window?this:window,(e,t)=>(()=>{"use strict";var r,o={512(e){e.exports=t},944(t){t.exports=e}};let i={};function a(e){let t=i[e];if(void 0!==t)return t.exports;let r=i[e]={exports:{}};return o[e](r,r.exports,a),r.exports}a.n=e=>{let t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var o=t[r++],i=t[r++];a.o(e,o)?0===i&&r++:0===i?Object.defineProperty(e,o,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,o,{enumerable:!0,get:i})}else for(var o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);let n={};a.d(n,{default:()=>g});var s=a(944),p=a.n(s),l=a(512),h=a.n(l);let{sma:{prototype:c}}=h().seriesTypes;!function(e){let t=["bottomLine"],r=["top","bottom"],o=["top"];function i(e){return"plot"+e.charAt(0).toUpperCase()+e.slice(1)}function a(e,t){let r=[];return(e.pointArrayMap||[]).forEach(e=>{e!==t&&r.push(i(e))}),r}function n(){let e=this,t=e.pointValKey,r=e.linesApiNames,o=e.areaLinesNames,n=e.points,p=e.options,l=e.graph,h={options:{gapSize:p.gapSize}},f=[],u=a(e,t),d=n.length,y;if(u.forEach((e,t)=>{for(f[t]=[];d--;)y=n[d],f[t].push({x:y.x,plotX:y.plotX,plotY:y[e],isNull:!(0,s.defined)(y[e])});d=n.length}),e.userOptions.fillColor&&o.length){let t=f[u.indexOf(i(o[0]))],r=1===o.length?n:f[u.indexOf(i(o[1]))],a=e.color;e.points=r,e.nextPoints=t,e.color=e.userOptions.fillColor,e.options=(0,s.merge)(n,h),e.graph=e.area,e.fillGraph=!0,c.drawGraph.call(e),e.area=e.graph,delete e.nextPoints,delete e.fillGraph,e.color=a}r.forEach((t,r)=>{f[r]?(e.points=f[r],p[t]?e.options=(0,s.merge)(p[t].styles,h):(0,s.error)('Error: "There is no '+t+' in DOCS options declared. Check if linesApiNames are consistent with your DOCS line names."'),e.graph=e["graph"+t],c.drawGraph.call(e),e["graph"+t]=e.graph):(0,s.error)('Error: "'+t+" doesn't have equivalent in pointArrayMap. To many elements in linesApiNames relative to pointArrayMap.\"")}),e.points=n,e.options=p,e.graph=l,c.drawGraph.call(e)}function p(e){let t,r=[],o=[];if(e=e||this.points,this.fillGraph&&this.nextPoints){if((t=c.getGraphPath.call(this,this.nextPoints))&&t.length){t[0][0]="L",r=c.getGraphPath.call(this,e),o=t.slice(0,r.length);for(let e=o.length-1;e>=0;e--)r.push(o[e])}}else r=c.getGraphPath.apply(this,arguments);return r}function l(e){let t=[];return(this.pointArrayMap||[]).forEach(r=>{t.push(e[r])}),t}function h(){let e=this.pointArrayMap,t=[],r;t=a(this),c.translate.apply(this,arguments),this.points.forEach(o=>{e.forEach((e,i)=>{r=o[e],this.dataModify&&(r=this.dataModify.modifyValue(r)),null!==r&&(o[t[i]]=this.yAxis.toPixels(r,!0))})})}e.compose=function(e){let i=e.prototype;return i.linesApiNames=i.linesApiNames||t.slice(),i.pointArrayMap=i.pointArrayMap||r.slice(),i.pointValKey=i.pointValKey||"top",i.areaLinesNames=i.areaLinesNames||o.slice(),i.drawGraph=n,i.getGraphPath=p,i.toYData=l,i.translate=h,e}}(r||(r={}));let f=r,{sma:u}=h().seriesTypes;function d(e,t){let r=e[0],o=0,i;for(i=1;i<e.length;i++)("max"===t&&e[i]>=r||"min"===t&&e[i]<=r)&&(r=e[i],o=i);return o}class y extends u{getValues(e,t){let r,o,i,a,n,p=t.period,l=e.xData,h=e.yData,c=h?h.length:0,f=[],u=[],y=[];for(a=p-1;a<c;a++)i=d((n=h.slice(a-p+1,a+2)).map(function(e){return(0,s.pick)(e[2],e)}),"min"),r=d(n.map(function(e){return(0,s.pick)(e[1],e)}),"max")/p*100,o=i/p*100,l[a+1]&&(f.push([l[a+1],r,o]),u.push(l[a+1]),y.push([r,o]));return{values:f,xData:u,yData:y}}}y.defaultOptions=(0,s.merge)(u.defaultOptions,{params:{index:void 0,period:25},marker:{enabled:!1},tooltip:{pointFormat:'<span style="color:{point.color}">●</span><b> {series.name}</b><br/>Aroon Up: {point.y}<br/>Aroon Down: {point.aroonDown}<br/>'},aroonDown:{styles:{lineWidth:1,lineColor:void 0}},dataGrouping:{approximation:"averages"}}),(0,s.extend)(y.prototype,{areaLinesNames:[],linesApiNames:["aroonDown"],nameBase:"Aroon",pointArrayMap:["y","aroonDown"],pointValKey:"y"}),f.compose(y),h().registerSeriesType("aroon",y);let g=p();return n.default})());