cut-to-pack-service/target/classes/static/js/vendor/highcharts/modules/item-series.js

19 lines
4.6 KiB
JavaScript

/*
Highcharts JS v11.1.0 (2023-06-05)
Item series type for Highcharts
(c) 2019 Torstein Honsi
License: www.highcharts.com/license
*/
'use strict';(function(a){"object"===typeof module&&module.exports?(a["default"]=a,module.exports=a):"function"===typeof define&&define.amd?define("highcharts/modules/item-series",["highcharts"],function(b){a(b);a.Highcharts=b;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function b(a,c,f,b){a.hasOwnProperty(c)||(a[c]=b.apply(null,f),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:c,module:a[c]}})))}a=a?a._modules:
{};b(a,"Series/Item/ItemPoint.js",[a["Core/Series/SeriesRegistry.js"],a["Core/Utilities.js"]],function(a,b){const {series:f,seriesTypes:{pie:c}}=a;({extend:a}=b);class q extends c.prototype.pointClass{constructor(){super(...arguments);this.series=this.options=void 0}}a(q.prototype,{haloPath:f.prototype.pointClass.prototype.haloPath});return q});b(a,"Series/Item/ItemSeries.js",[a["Core/Globals.js"],a["Series/Item/ItemPoint.js"],a["Core/Defaults.js"],a["Core/Series/SeriesRegistry.js"],a["Core/Utilities.js"]],
function(a,b,f,A,q){({defaultOptions:f}=f);const {seriesTypes:{pie:c}}=A,{defined:E,extend:B,fireEvent:H,isNumber:r,merge:C,pick:I}=q;class m extends c{constructor(){super(...arguments);this.points=this.options=this.data=void 0}animate(a){a?this.group.attr({opacity:0}):this.group.animate({opacity:1},this.options.animation)}drawDataLabels(){this.center&&this.slots?a.seriesTypes.pie.prototype.drawDataLabels.call(this):this.points.forEach(function(a){a.destroyElements({dataLabel:1})})}drawPoints(){let a=
this,F=this.options,h=a.chart.renderer,b=F.marker,c=this.borderWidth%2?.5:1,p=0,f=this.getRows(),z=Math.ceil(this.total/f),v=this.chart.plotWidth/z,w=this.chart.plotHeight/f,x=this.itemSize||Math.min(v,w);this.points.forEach(function(d){var t;var k=d.marker||{};let y=k.symbol||b.symbol,l=I(k.radius,b.radius),G=E(l)?2*l:x,u=G*F.itemPadding;let m,n;d.graphics=k=d.graphics||[];a.chart.styledMode||(t=a.pointAttribs(d,d.selected&&"select"));if(!d.isNull&&d.visible){d.graphic||(d.graphic=h.g("point").add(a.group));
for(let b=0;b<(d.y||0);b++){if(a.center&&a.slots){var e=a.slots.shift();var g=e.x-x/2;e=e.y-x/2}else"horizontal"===F.layout?(g=p%z*v,e=w*Math.floor(p/z)):(g=v*Math.floor(p/f),e=p%f*w);g+=u;e+=u;n=m=Math.round(G-2*u);a.options.crisp&&(g=Math.round(g)-c,e=Math.round(e)+c);g={x:g,y:e,width:m,height:n};"undefined"!==typeof l&&(g.r=l);t&&B(g,t);(e=k[b])?e.animate(g):e=h.symbol(y,void 0,void 0,void 0,void 0,{backgroundSize:"within"}).attr(g).add(d.graphic);e.isActive=!0;k[b]=e;p++}}for(d=0;d<k.length;d++){t=
k[d];if(!t)break;t.isActive?t.isActive=!1:(t.destroy(),k.splice(d,1),d--)}})}getRows(){let a=this.options.rows,b,h;if(!a)if(h=this.chart.plotWidth/this.chart.plotHeight,a=Math.sqrt(this.total),1<h)for(a=Math.ceil(a);0<a;){b=this.total/a;if(b/a>h)break;a--}else for(a=Math.floor(a);a<this.total;){b=this.total/a;if(b/a<h)break;a++}return a}getSlots(){function a(a){0<D&&(a.row.colCount--,D--)}let b=this.center,h=b[2],c=b[3],f,p=this.slots,m,z,v,w,x,d,q,k,y=0,l,r=this.endAngleRad-this.startAngleRad,u=
Number.MAX_VALUE,A,n,e,g=this.options.rows,B=(h-c)/h,C=0===r%(2*Math.PI),E=this.total||0;for(;u>E+(n&&C?n.length:0);)for(A=u,u=p.length=0,n=e,e=[],y++,l=h/y/2,g?(c=(l-g)/l*h,0<=c?l=g:(c=0,B=1)):l=Math.floor(l*B),f=l;0<f;f--)v=(c+f/l*(h-c-y))/2,w=r*v,x=Math.ceil(w/y),e.push({rowRadius:v,rowLength:w,colCount:x}),u+=x+1;if(n){for(var D=A-this.total-(C?n.length:0);0<D;)n.map(function(a){return{angle:a.colCount/a.rowLength,row:a}}).sort(function(a,b){return b.angle-a.angle}).slice(0,Math.min(D,Math.ceil(n.length/
2))).forEach(a);n.forEach(function(a){const c=a.rowRadius;d=(a=a.colCount)?r/a:0;for(k=0;k<=a;k+=1)q=this.startAngleRad+k*d,m=b[0]+Math.cos(q)*c,z=b[1]+Math.sin(q)*c,p.push({x:m,y:z,angle:q})},this);p.sort(function(a,b){return a.angle-b.angle});this.itemSize=y;return p}}translate(b){0===this.total&&r(this.options.startAngle)&&r(this.options.endAngle)&&(this.center=this.getCenter());this.slots||(this.slots=[]);r(this.options.startAngle)&&r(this.options.endAngle)?(a.seriesTypes.pie.prototype.translate.apply(this,
arguments),this.slots=this.getSlots()):(this.generatePoints(),H(this,"afterTranslate"))}}m.defaultOptions=C(c.defaultOptions,{endAngle:void 0,innerSize:"40%",itemPadding:.1,layout:"vertical",marker:C(f.plotOptions.line.marker,{radius:null}),rows:void 0,crisp:!1,showInLegend:!0,startAngle:void 0});B(m.prototype,{markerAttribs:void 0});m.prototype.pointClass=b;A.registerSeriesType("item",m);"";return m});b(a,"masters/modules/item-series.src.js",[],function(){})});
//# sourceMappingURL=item-series.js.map