highcharts
Version:
JavaScript charting framework
13 lines • 7.11 kB
JavaScript
/**
* Highcharts JS v12.6.0 (2026-04-13)
* @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 t from"../highcharts.js";var e,o,l,r={};r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let i=t.default;var s=r.n(i);let n={parallelCoordinates:!1,parallelAxes:{lineWidth:1,title:{text:"",reserveSpace:!1},labels:{x:0,y:4,align:"center",reserveSpace:!1},offset:0}},a={lineWidth:0,tickLength:0,opposite:!0,type:"category"},{doc:c,win:h}=s();function p(t,e,o,l={}){let r="function"==typeof t&&t.prototype||t;Object.hasOwnProperty.call(r,"hcEvents")||(r.hcEvents={});let i=r.hcEvents;s().Point&&t instanceof s().Point&&t.series&&t.series.chart&&(t.series.chart.runTrackerClick=!0);let n=t.addEventListener;n&&n.call(t,e,o,!!s().supportsPassiveEvents&&{passive:void 0===l.passive?-1!==e.indexOf("touch"):l.passive,capture:!1}),i[e]||(i[e]=[]);let a={fn:o,order:"number"==typeof l.order?l.order:1/0};return i[e].push(a),i[e].sort((t,e)=>t.order-e.order),function(){!function(t,e,o){function l(e,o){let l=t.removeEventListener;l&&l.call(t,e,o,!1)}function r(o){let r,i;t.nodeName&&(e?(r={})[e]=!0:r=o,v(r,function(t,e){if(o[e])for(i=o[e].length;i--;)l(e,o[e][i].fn)}))}let i="function"==typeof t&&t.prototype||t;if(Object.hasOwnProperty.call(i,"hcEvents")){let t=i.hcEvents;if(e){let i=t[e]||[];o?(t[e]=i.filter(function(t){return o!==t.fn}),l(e,o)):(r(t),t[e]=[])}else r(t),delete i.hcEvents}}(t,e,o)}}function f(t){return y(t)&&"number"==typeof t.nodeType}function u(t){return"number"==typeof t&&!isNaN(t)&&t<1/0&&t>-1/0}function d(t){let e=Object.prototype.toString.call(t);return"[object Array]"===e||"[object Array Iterator]"===e}function y(t,e){return!!t&&"object"==typeof t&&(!e||!d(t))}function x(t,...e){let o,l=[t,...e],r={},i=function(t,e){return"object"!=typeof t&&(t={}),v(e,function(o,l){if("__proto__"!==l&&"constructor"!==l){let r;!y(o,!0)||(r=o?.constructor,y(o,!0)&&!f(o)&&r?.name&&"Object"!==r.name)||f(o)?t[l]=e[l]:t[l]=i(t[l]||{},o)}}),t};!0===t&&(r=l[1],l=Array.prototype.slice.call(l,2));let s=l.length;for(o=0;o<s;o++)r=i(r,l[o]);return r}function v(t,e,o){for(let l in t)Object.hasOwnProperty.call(t,l)&&e.call(o||t[l],t[l],l,t)}Array.prototype.find;class m{constructor(t){this.axis=t}setPosition(t,e){let o=this.axis,l=o.chart,r=((this.position||0)+.5)/(l.parallelInfo.counter+1);l.polar?e.angle=360*r:(e[t[0]]=100*r+"%",o[t[1]]=e[t[1]]=0,o[t[2]]=e[t[2]]=null,o[t[3]]=e[t[3]]=null)}}!function(t){function e(t){let e=this.chart,o=this.parallelCoordinates,l=["left","width","height","top"];if(e.hasParallelCoordinates)if(e.inverted&&(l=l.reverse()),this.isXAxis)this.options=x(this.options,a,t.userOptions);else{let r=e.yAxis.indexOf(this);this.options=x(this.options,this.chart.options.chart.parallelAxes,t.userOptions),o.position=function(){let t=arguments,e=t.length;for(let o=0;o<e;o++){let e=t[o];if(null!=e)return e}}(o.position,r>=0?r:e.yAxis.length),o.setPosition(l,this.options)}}function o(t){let e=this.chart,o=this.parallelCoordinates;if(o&&e&&e.hasParallelCoordinates&&!this.isXAxis){let e=o.position,l=[];this.series.forEach(function(t){t.visible&&u(e)&&(l=(t.pointArrayMap||["y"]).reduce((o,l)=>[...o,t.getColumn(l)?.[e]??null],l))}),l=l.filter(u),this.dataMin=function(t){let e=t.length,o=t[0];for(;e--;)t[e]<o&&(o=t[e]);return o}(l),this.dataMax=function(t){let e=t.length,o=t[0];for(;e--;)t[e]>o&&(o=t[e]);return o}(l),t.preventDefault()}}function l(){this.parallelCoordinates||(this.parallelCoordinates=new m(this))}t.compose=function(t){t.keepProps.includes("parallel")||(t.keepProps.push("parallel"),p(t,"init",l),p(t,"afterSetOptions",e),p(t,"getSeriesExtremes",o))}}(e||(e={}));let A=e,g=t.default.Templating;var P=r.n(g);let{composed:b}=s(),{format:C}=P();!function(t){function e(){let t=this.chart,e=this.points,o=e&&e.length,l=Number.MAX_VALUE,r,i;if(this.chart.hasParallelCoordinates){for(let s=0;s<o;s++)null!=(i=e[s]).y?(t.polar?i.plotX=t.yAxis[s].angleRad||0:t.inverted?i.plotX=t.plotHeight-t.yAxis[s].top+t.plotTop:i.plotX=t.yAxis[s].left-t.plotLeft,i.clientX=i.plotX,i.plotY=t.yAxis[s].translate(i.y,!1,!0,void 0,!0),u(i.high)&&(i.plotHigh=t.yAxis[s].translate(i.high,!1,!0,void 0,!0)),void 0!==r&&(l=Math.min(l,Math.abs(i.plotX-r))),r=i.plotX,i.isInside=t.isInsidePlot(i.plotX,i.plotY,{inverted:t.inverted})):i.isNull=!0;this.closestPointRangePx=l}}function o(t){let e=this.chart;if(e.hasParallelCoordinates){for(let t of e.axes)(0,i.insertItem)(this,t.series),t.isDirty=!0;this.xAxis=e.xAxis[0],this.yAxis=e.yAxis[0],t.preventDefault()}}function l(){let t=this.chart;if(t.hasParallelCoordinates)for(let e of t.axes||[])e&&e.series&&(!function(t,e){let o=t.length;for(;o--;)if(t[o]===e){t.splice(o,1);break}}(e.series,this),e.isDirty=e.forceRedraw=!0)}function r(){let t=this.chart;if(t?.hasParallelCoordinates)for(let e of this.points){let o,l=t.yAxis[e.x||0],r=l.options,i=r.tooltipValueFormat??r.labels.format;o=i?C(i,function(t,e){let o;for(o in t||(t={}),e)t[o]=e[o];return t}(e,{value:e.y}),t):l.dateTime?t.time.dateFormat(t.time.resolveDTLFormat(r.dateTimeLabelFormats?.[l.tickPositions.info?.unitName||"year"]||"").main,e.y??void 0):d(r.categories)?r.categories[e.y??-1]:String(e.y??""),e.formattedValue=o}}t.compose=function(t){var i;i="ParallelSeries",0>b.indexOf(i)&&b.push(i)&&(p(t,"afterTranslate",e,{order:1}),p(t,"bindAxes",o),p(t,"destroy",l),p(t,"afterGeneratePoints",r))}}(o||(o={}));let O=o;class I{constructor(t){this.chart=t}setParallelInfo(t){let e=this.chart||this,o=t.series;for(let t of(e.parallelInfo={counter:0},o))t.data&&(e.parallelInfo.counter=Math.max(e.parallelInfo.counter,t.data.length-1))}}function E(t){var e,o;let l=t.args[0],r=d(e=l.yAxis||{})?e:[e],i=[],s=r.length;if(this.hasParallelCoordinates=l.chart&&l.chart.parallelCoordinates,this.hasParallelCoordinates){for(this.setParallelInfo(l);s<=this.parallelInfo.counter;s++)i.push({});l.legend||(l.legend={}),l.legend&&void 0===l.legend.enabled&&(l.legend.enabled=!1),x(!0,l,{boost:{seriesThreshold:Number.MAX_VALUE},plotOptions:{series:{boostThreshold:Number.MAX_VALUE}}}),l.yAxis=r.concat(i),l.xAxis=x(a,(d(o=l.xAxis||{})?o:[o])[0])}}function X(t){let e=t.options;e.chart&&(null!=e.chart.parallelCoordinates&&(this.hasParallelCoordinates=e.chart.parallelCoordinates),this.options.chart.parallelAxes=x(this.options.chart.parallelAxes,e.chart.parallelAxes));if(this.hasParallelCoordinates)for(let t of(e.series&&this.setParallelInfo(e),this.yAxis))t.update({},!1)}(l||(l={})).compose=function(t,e,o,l){A.compose(t),O.compose(l);let r=I.prototype,i=e.prototype;i.setParallelInfo||(i.setParallelInfo=r.setParallelInfo,p(e,"init",E),p(e,"update",X),x(!0,o.chart,n))};let j=l,_=s();j.compose(_.Axis,_.Chart,_.defaultOptions,_.Series);let M=s();export{M as default};