Icard/angular-clarity-master(work.../node_modules/highcharts/modules/geoheatmap.js

7 lines
6.2 KiB
JavaScript
Raw Permalink Normal View History

2024-07-16 14:55:36 +00:00
!/**
* Highcharts JS v11.4.1 (2024-04-04)
*
* (c) 2009-2024
*
* License: www.highcharts.com/license
*/function(t){"object"==typeof module&&module.exports?(t.default=t,module.exports=t):"function"==typeof define&&define.amd?define("highcharts/modules/geoheatmap",["highcharts"],function(e){return t(e),t.Highcharts=e,t}):t("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(t){"use strict";var e=t?t._modules:{};function i(t,e,i,o){t.hasOwnProperty(e)||(t[e]=o.apply(null,i),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}i(e,"Series/GeoHeatmap/GeoHeatmapPoint.js",[e["Core/Utilities.js"],e["Core/Series/SeriesRegistry.js"]],function(t,e){let{map:{prototype:{pointClass:i}}}=e.seriesTypes,{isNumber:o}=t;return class extends i{applyOptions(t,e){let i=super.applyOptions.call(this,t,e),{lat:a,lon:s}=i.options;if(o(s)&&o(a)){let{colsize:t=1,rowsize:e=1}=this.series.options,o=s-t/2,n=a-e/2;i.geometry=i.options.geometry={type:"Polygon",coordinates:[[[o,n],[o+t,n],[o+t,n+e],[o,n+e],[o,n]]]}}return i}}}),i(e,"Series/InterpolationUtilities.js",[e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e){let{doc:i}=t,{defined:o,pick:a}=e;return{colorFromPoint:function(t,e){let i=e.series.colorAxis;if(i){let s=i.toColor(t||0,e).split(")")[0].split("(")[1].split(",").map(t=>a(parseFloat(t),parseInt(t,10)));return s[3]=255*a(s[3],1),o(t)&&e.visible||(s[3]=0),s}return[0,0,0,0]},getContext:function(t){let{canvas:e,context:o}=t;return e&&o?(o.clearRect(0,0,e.width,e.height),o):(t.canvas=i.createElement("canvas"),t.context=t.canvas.getContext("2d",{willReadFrequently:!0})||void 0,t.context)}}}),i(e,"Series/GeoHeatmap/GeoHeatmapSeries.js",[e["Core/Animation/AnimationUtilities.js"],e["Series/GeoHeatmap/GeoHeatmapPoint.js"],e["Core/Globals.js"],e["Series/InterpolationUtilities.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i,o,a,s){let{animObject:n,stop:r}=t,{noop:l}=i,{colorFromPoint:h,getContext:p}=o,{seriesTypes:{map:d}}=a,{addEvent:u,extend:g,isNumber:c,isObject:m,merge:y,pick:f}=s;function x(t){return t-360*Math.floor((t+180)/360)}class b extends d{constructor(){super(...arguments),this.isDirtyCanvas=!0}update(){this.options=y(this.options,arguments[0]),this.getInterpolation().enabled&&(this.isDirtyCanvas=!0,this.points.forEach(t=>{t.graphic&&(t.graphic.destroy(),delete t.graphic)})),super.update.apply(this,arguments)}translate(){(!this.getInterpolation().enabled||!this.image||this.isDirty||this.isDirtyData)&&super.translate.apply(this,arguments)}getInterpolation(){return m(this.options.interpolation)?this.options.interpolation:{blur:1,enabled:this.options.interpolation}}drawPoints(){let t=this.chart.mapView,e=this.options;if(this.getInterpolation().enabled&&t&&this.bounds){let i=this.context||p(this),{canvas:o,colorAxis:a,image:s,chart:l,points:d}=this,[u,g]=[f(e.colsize,1),f(e.rowsize,1)],m=t.projectedUnitsToPixels({x:this.bounds.x1,y:this.bounds.y2}),x=t.projectedUnitsToPixels({x:this.bounds.x2,y:this.bounds.y1});if(o&&i&&a&&m&&x){let e={x:m.x,y:m.y,width:x.x-m.x,height:x.y-m.y};if(this.isDirtyCanvas||this.isDirtyData||"Orthographic"===t.projection.options.name){this.isDirtyCanvas=!0;let a=o.width=~~(360/u)+1,s=o.height=~~(180/g)+1,n=new Uint8ClampedArray(a*s*4);this.directTouch=!1;for(let t=0;t<d.length;t++){let e=d[t],i=new Uint8ClampedArray(h(e.value,e)),{lon:o,lat:r}=e.options;c(o)&&c(r)&&n.set(i,4*Math.ceil(a*(s-1-(r+90)/g)+(o+180)/u))}let r=this.getInterpolation().blur,l=0===r?1:11*r,p=~~e.width,m=~~e.height,y=new ImageData(n,a,s);o.width=~~(a*l),o.height=~~(s*l),i.putImageData(y,0,0),i.globalCompositeOperation="copy",i.drawImage(o,0,0,y.width,y.height,0,0,o.width,o.height);let f=i.getImageData(0,0,o.width,o.height),x=new ImageData(this.getProjectedImageData(t,p,m,f,o,e.x,e.y),p,m);i.globalCompositeOperation="copy",o.width=p,o.height=m,i.putImageData(x,0,0)}if(s){if(l.renderer.globalAnimation&&l.hasRendered){let t=Number(s.attr("x")),i=Number(s.attr("y")),a=Number(s.attr("width")),r=Number(s.attr("height")),h=(o,n)=>{s.attr({x:t+(e.x-t)*n.pos,y:i+(e.y-i)*n.pos,width:a+(e.width-a)*n.pos,height:r+(e.height-r)*n.pos})},