highcharts
Version:
JavaScript charting framework
13 lines • 5.5 kB
JavaScript
/**
* Highcharts JS v13.0.1 (2026-08-17)
* @module highcharts/modules/parallel-coordinates
* @requires highcharts
*
* Support for parallel coordinates in Highcharts
*
* (c) 2010-2026 Highsoft AS
* Author: Paweł Fus
*
* A commercial license may be required depending on use,
* see www.highcharts.com/license
*/import*as e from"../highcharts.js";let t={};t.n=e=>{let a=e&&e.__esModule?()=>e.default:()=>e;return t.d(a,{a:a}),a},t.d=(e,a)=>{if(Array.isArray(a))for(var i=0;i<a.length;){var s=a[i++],l=a[i++];t.o(e,s)?0===l&&i++:0===l?Object.defineProperty(e,s,{enumerable:!0,value:a[i++]}):Object.defineProperty(e,s,{enumerable:!0,get:l})}else for(var s in a)t.o(a,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:a[s]})},t.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);let a=e.default;var i,s,l,o=t.n(a);let r={parallelCoordinates:!1,parallelAxes:{lineWidth:1,title:{text:"",reserveSpace:!1},labels:{x:0,y:4,align:"center",reserveSpace:!1},offset:0}},n={lineWidth:0,tickLength:0,opposite:!0,type:"category"};class h{constructor(e){this.axis=e}setPosition(e,t){let a=this.axis,i=a.chart,s=((this.position||0)+.5)/(i.parallelInfo.counter+1);i.polar?t.angle=360*s:(t[e[0]]=100*s+"%",a[e[1]]=t[e[1]]=0,a[e[2]]=t[e[2]]=null,a[e[3]]=t[e[3]]=null)}}!function(e){function t(e){let t=this.chart,i=this.parallelCoordinates,s=["left","width","height","top"];if(t.hasParallelCoordinates)if(t.inverted&&(s=s.reverse()),this.isXAxis)this.options=(0,a.merge)(this.options,n,e.userOptions);else{let l=t.yAxis.indexOf(this);this.options=(0,a.merge)(this.options,this.chart.options.chart.parallelAxes,e.userOptions),i.position=(0,a.pick)(i.position,l>=0?l:t.yAxis.length),i.setPosition(s,this.options)}}function i(e){let t=this.chart,i=this.parallelCoordinates;if(i&&t&&t.hasParallelCoordinates&&!this.isXAxis){let t=i.position,s=[];this.series.forEach(function(e){e.visible&&(0,a.isNumber)(t)&&(s=(e.pointArrayMap||["y"]).reduce((a,i)=>[...a,e.getColumn(i)?.[t]??null],s))}),s=s.filter(a.isNumber),this.dataMin=(0,a.arrayMin)(s),this.dataMax=(0,a.arrayMax)(s),e.preventDefault()}}function s(){this.parallelCoordinates||(this.parallelCoordinates=new h(this))}e.compose=function(e){e.keepProps.includes("parallel")||(e.keepProps.push("parallel"),(0,a.addEvent)(e,"init",s),(0,a.addEvent)(e,"afterSetOptions",t),(0,a.addEvent)(e,"getSeriesExtremes",i))}}(i||(i={}));let p=i,d=e.default.Templating;var c=t.n(d);let{composed:f}=o(),{format:u}=c();!function(e){function t(){let e=this.chart,t=this.points,i=t&&t.length,s=Number.MAX_VALUE,l,o;if(this.chart.hasParallelCoordinates){for(let r=0;r<i;r++)o=t[r],(0,a.defined)(o.y)?(e.polar?o.plotX=e.yAxis[r].angleRad||0:e.inverted?o.plotX=e.plotHeight-e.yAxis[r].top+e.plotTop:o.plotX=e.yAxis[r].left-e.plotLeft,o.clientX=o.plotX,o.plotY=e.yAxis[r].translate(o.y,!1,!0,void 0,!0),(0,a.isNumber)(o.high)&&(o.plotHigh=e.yAxis[r].translate(o.high,!1,!0,void 0,!0)),void 0!==l&&(s=Math.min(s,Math.abs(o.plotX-l))),l=o.plotX,o.isInside=e.isInsidePlot(o.plotX,o.plotY,{inverted:e.inverted})):o.isNull=!0;this.closestPointRangePx=s}}function i(e){let t=this.chart;if(t.hasParallelCoordinates){for(let e of t.axes)(0,a.insertItem)(this,e.series),e.isDirty=!0;this.xAxis=t.xAxis[0],this.yAxis=t.yAxis[0],e.preventDefault()}}function s(){let e=this.chart;if(e.hasParallelCoordinates)for(let t of e.axes||[])t&&t.series&&((0,a.erase)(t.series,this),t.isDirty=t.forceRedraw=!0)}function l(){let e=this.chart;if(e?.hasParallelCoordinates)for(let t of this.points){let i,s=e.yAxis[t.x||0],l=s.options,o=l.tooltipValueFormat??l.labels.format;i=o?u(o,(0,a.extend)(t,{value:t.y}),e):s.dateTime?e.time.dateFormat(e.time.resolveDTLFormat(l.dateTimeLabelFormats?.[s.tickPositions.info?.unitName||"year"]||"").main,t.y??void 0):(0,a.isArray)(l.categories)?l.categories[t.y??-1]:String(t.y??""),t.formattedValue=i}}e.compose=function(e){(0,a.pushUnique)(f,"ParallelSeries")&&((0,a.addEvent)(e,"afterTranslate",t,{order:1}),(0,a.addEvent)(e,"bindAxes",i),(0,a.addEvent)(e,"destroy",s),(0,a.addEvent)(e,"afterGeneratePoints",l))}}(s||(s={}));let x=s;class m{constructor(e){this.chart=e}setParallelInfo(e){let t=this.chart||this,a=e.series;for(let e of(t.parallelInfo={counter:0},a))e.data&&(t.parallelInfo.counter=Math.max(t.parallelInfo.counter,e.data.length-1))}}function y(e){let t=e.args[0],i=(0,a.splat)(t.yAxis||{}),s=[],l=i.length;if(this.hasParallelCoordinates=t.chart&&t.chart.parallelCoordinates,this.hasParallelCoordinates){for(this.setParallelInfo(t);l<=this.parallelInfo.counter;l++)s.push({});t.legend||(t.legend={}),t.legend&&void 0===t.legend.enabled&&(t.legend.enabled=!1),(0,a.merge)(!0,t,{boost:{seriesThreshold:Number.MAX_VALUE},plotOptions:{series:{boostThreshold:Number.MAX_VALUE}}}),t.yAxis=i.concat(s),t.xAxis=(0,a.merge)(n,(0,a.splat)(t.xAxis||{})[0])}}function g(e){let t=e.options;if(!1!==e.hasChanged&&(t.chart&&((0,a.defined)(t.chart.parallelCoordinates)&&(this.hasParallelCoordinates=t.chart.parallelCoordinates),this.options.chart.parallelAxes=(0,a.merge)(this.options.chart.parallelAxes,t.chart.parallelAxes)),this.hasParallelCoordinates))for(let e of(t.series&&this.setParallelInfo(t),this.yAxis))e.update({},!1)}(l||(l={})).compose=function(e,t,i,s){p.compose(e),x.compose(s);let l=m.prototype,o=t.prototype;o.setParallelInfo||(o.setParallelInfo=l.setParallelInfo,(0,a.addEvent)(t,"init",y),(0,a.addEvent)(t,"update",g),(0,a.merge)(!0,i.chart,r))};let A=l,v=o();A.compose(v.Axis,v.Chart,v.defaultOptions,v.Series);let P=o();export{P as default};