forked from qwerty/tupali
20 lines
4.7 KiB
JavaScript
20 lines
4.7 KiB
JavaScript
/*
|
|
Highcharts JS v8.1.0 (2020-05-05)
|
|
|
|
Support for parallel coordinates in Highcharts
|
|
|
|
(c) 2010-2019 Pawel Fus
|
|
|
|
License: www.highcharts.com/license
|
|
*/
|
|
(function(b){"object"===typeof module&&module.exports?(b["default"]=b,module.exports=b):"function"===typeof define&&define.amd?define("highcharts/modules/parallel-coordinates",["highcharts"],function(g){b(g);b.Highcharts=g;return b}):b("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(b){function g(b,h,e,g){b.hasOwnProperty(h)||(b[h]=g.apply(null,e))}b=b?b._modules:{};g(b,"modules/parallel-coordinates.src.js",[b["parts/Axis.js"],b["parts/Globals.js"],b["parts/Utilities.js"]],function(b,
|
|
h,e){function g(a){var d=this.series&&this.series.chart,f=a.apply(this,Array.prototype.slice.call(arguments,1)),b;if(d&&d.hasParallelCoordinates&&!n(f.formattedValue)){var k=d.yAxis[this.x];var c=k.options;d=(b=p(c.tooltipValueFormat,c.labels.format))?v(b,q(this,{value:this.y}),d):k.dateTime?d.time.dateFormat(d.time.resolveDTLFormat(c.dateTimeLabelFormats[k.tickPositions.info.unitName]).main,this.y):c.categories?c.categories[this.y]:this.y;f.formattedValue=f.point.formattedValue=d}return f}var l=
|
|
e.addEvent,w=e.arrayMax,x=e.arrayMin,n=e.defined,y=e.erase,q=e.extend,v=e.format,m=e.merge,p=e.pick,r=e.splat,z=e.wrap;e=h.Chart;var A=e.prototype,t={lineWidth:0,tickLength:0,opposite:!0,type:"category"};h.setOptions({chart:{parallelCoordinates:!1,parallelAxes:{lineWidth:1,title:{text:"",reserveSpace:!1},labels:{x:0,y:4,align:"center",reserveSpace:!1},offset:0}}});var B=function(){function a(a){this.axis=a}a.prototype.setPosition=function(a,f){var d=this.axis,b=d.chart,c=((this.position||0)+.5)/(b.parallelInfo.counter+
|
|
1);b.polar?f.angle=360*c:(f[a[0]]=100*c+"%",d[a[1]]=f[a[1]]=0,d[a[2]]=f[a[2]]=null,d[a[3]]=f[a[3]]=null)};return a}(),u=function(){function a(){}a.compose=function(a){a.keepProps.push("parallel");l(a,"init",function(){this.parallelCoordinates||(this.parallelCoordinates=new B(this))});l(a,"afterSetOptions",function(a){var d=this.chart,b=this.parallelCoordinates,c=["left","width","height","top"];d.hasParallelCoordinates&&(d.inverted&&(c=c.reverse()),this.isXAxis?this.options=m(this.options,t,a.userOptions):
|
|
(this.options=m(this.options,this.chart.options.chart.parallelAxes,a.userOptions),b.position=p(b.position,d.yAxis.length),b.setPosition(c,this.options)))});l(a,"getSeriesExtremes",function(a){var d=this.chart,b=this.parallelCoordinates;if(b&&d&&d.hasParallelCoordinates&&!this.isXAxis){var c=b.position,f=[];this.series.forEach(function(a){a.visible&&n(a.yData[c])&&f.push(a.yData[c])});this.dataMin=x(f);this.dataMax=w(f);a.preventDefault()}})};return a}();u.compose(b);l(e,"init",function(a){a=a.args[0];
|
|
var d=r(a.yAxis||{}),b=d.length,e=[];if(this.hasParallelCoordinates=a.chart&&a.chart.parallelCoordinates){for(this.setParallelInfo(a);b<=this.parallelInfo.counter;b++)e.push({});a.legend||(a.legend={});"undefined"===typeof a.legend.enabled&&(a.legend.enabled=!1);m(!0,a,{boost:{seriesThreshold:Number.MAX_VALUE},plotOptions:{series:{boostThreshold:Number.MAX_VALUE}}});a.yAxis=d.concat(e);a.xAxis=m(t,r(a.xAxis||{})[0])}});l(e,"update",function(a){a=a.options;a.chart&&(n(a.chart.parallelCoordinates)&&
|
|
(this.hasParallelCoordinates=a.chart.parallelCoordinates),this.options.chart.parallelAxes=m(this.options.chart.parallelAxes,a.chart.parallelAxes));this.hasParallelCoordinates&&(a.series&&this.setParallelInfo(a),this.yAxis.forEach(function(a){a.update({},!1)}))});q(A,{setParallelInfo:function(a){var b=this;a=a.series;b.parallelInfo={counter:0};a.forEach(function(a){a.data&&(b.parallelInfo.counter=Math.max(b.parallelInfo.counter,a.data.length-1))})}});l(h.Series,"bindAxes",function(a){if(this.chart.hasParallelCoordinates){var b=
|
|
this;this.chart.axes.forEach(function(a){b.insert(a.series);a.isDirty=!0});b.xAxis=this.chart.xAxis[0];b.yAxis=this.chart.yAxis[0];a.preventDefault()}});l(h.Series,"afterTranslate",function(){var a=this.chart,b=this.points,e=b&&b.length,g=Number.MAX_VALUE,k;if(this.chart.hasParallelCoordinates){for(k=0;k<e;k++){var c=b[k];if(n(c.y)){c.plotX=a.polar?a.yAxis[k].angleRad||0:a.inverted?a.plotHeight-a.yAxis[k].top+a.plotTop:a.yAxis[k].left-a.plotLeft;c.clientX=c.plotX;c.plotY=a.yAxis[k].translate(c.y,
|
|
!1,!0,null,!0);"undefined"!==typeof h&&(g=Math.min(g,Math.abs(c.plotX-h)));var h=c.plotX;c.isInside=a.isInsidePlot(c.plotX,c.plotY,a.inverted)}else c.isNull=!0}this.closestPointRangePx=g}},{order:1});l(h.Series,"destroy",function(){this.chart.hasParallelCoordinates&&(this.chart.axes||[]).forEach(function(a){a&&a.series&&(y(a.series,this),a.isDirty=a.forceRedraw=!0)},this)});["line","spline"].forEach(function(a){z(h.seriesTypes[a].prototype.pointClass.prototype,"getLabelConfig",g)});return u});g(b,
|
|
"masters/modules/parallel-coordinates.src.js",[],function(){})});
|
|
//# sourceMappingURL=parallel-coordinates.js.map
|