{"size": 10093, "ext": "js", "max_stars_repo_path": "Public/Admin/dist/js/libs/ueditor/third-party/highcharts/modules/map.src.js", "max_stars_repo_name": "guangpunba/520you", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "Public/Admin/dist/js/libs/ueditor/third-party/highcharts/modules/map.src.js", "max_issues_repo_name": "guangpunba/520you", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Public/Admin/dist/js/libs/ueditor/third-party/highcharts/modules/map.src.js", "max_forks_repo_name": "guangpunba/520you", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 1121.4444444444, "max_line_length": 9964, "alphanum_fraction": 0.7102942634}
/**
 * @license Map plugin v0.1 for Highcharts
 *
 * (c) 2011-2013 Torstein Hønsi
 *
 * License: www.highcharts.com/license
 */

(function(e){function g(e,t,n){var r=4,i=[];while(r--)i[r]=Math.round(t.rgba[r]+(e.rgba[r]-t.rgba[r])*(1-n));return"rgba("+i.join(",")+")"}var t,n=e.Axis,r=e.Chart,i=e.Point,s=e.Pointer,o=e.each,u=e.extend,a=e.merge,f=e.pick,l=e.numberFormat,c=e.getOptions(),h=e.seriesTypes,p=c.plotOptions,d=e.wrap,v=e.Color,m=function(){};c.mapNavigation={buttonOptions:{align:"right",verticalAlign:"bottom",x:0,width:18,height:18,style:{fontSize:"15px",fontWeight:"bold",textAlign:"center"}},buttons:{zoomIn:{onclick:function(){this.mapZoom(.5)},text:"+",y:-32},zoomOut:{onclick:function(){this.mapZoom(2)},text:"-",y:0}}},e.splitPath=function(e){var t;e=e.replace(/([A-Za-z])/g," $1 "),e=e.replace(/^\s*/,"").replace(/\s*$/,""),e=e.split(/[ ,]+/);for(t=0;t<e.length;t++)/[a-zA-Z]/.test(e[t])||(e[t]=parseFloat(e[t]));return e},e.maps={},d(n.prototype,"getSeriesExtremes",function(e){var t=this.isXAxis,n,r,i=[];o(this.series,function(e,t){e.useMapGeometry&&(i[t]=e.xData,e.xData=[])}),e.call(this),n=f(this.dataMin,Number.MAX_VALUE),r=f(this.dataMax,Number.MIN_VALUE),o(this.series,function(e,s){e.useMapGeometry&&(n=Math.min(n,e[t?"minX":"minY"]),r=Math.max(r,e[t?"maxX":"maxY"]),e.xData=i[s])}),this.dataMin=n,this.dataMax=r}),d(n.prototype,"setAxisTranslation",function(e){var n=this.chart,r,i=n.plotWidth/n.plotHeight,s=this.isXAxis,o,u=n.xAxis[0],a;e.call(this),n.options.chart.type==="map"&&!s&&u.transA!==t&&(this.transA=u.transA=Math.min(this.transA,u.transA),r=(u.max-u.min)/(this.max-this.min),a=r>i?this:u,o=(a.max-a.min)*a.transA,a.minPixelPadding=(a.len-o)/2)}),d(r.prototype,"render",function(t){var n=this,r=n.options.mapNavigation;t.call(n),n.renderMapNavigation(),r.zoomOnDoubleClick&&e.addEvent(n.container,"dblclick",function(e){n.pointer.onContainerDblClick(e)}),r.zoomOnMouseWheel&&e.addEvent(n.container,document.onmousewheel===undefined?"DOMMouseScroll":"mousewheel",function(e){n.pointer.onContainerMouseWheel(e)})}),u(s.prototype,{onContainerDblClick:function(e){var t=this.chart;e=this.normalize(e),t.isInsidePlot(e.chartX-t.plotLeft,e.chartY-t.plotTop)&&t.mapZoom(.5,t.xAxis[0].toValue(e.chartX),t.yAxis[0].toValue(e.chartY))},onContainerMouseWheel:function(e){var t=this.chart,n;e=this.normalize(e),n=e.detail||-(e.wheelDelta/120),t.isInsidePlot(e.chartX-t.plotLeft,e.chartY-t.plotTop)&&t.mapZoom(n>0?2:.5,t.xAxis[0].toValue(e.chartX),t.yAxis[0].toValue(e.chartY))}}),d(s.prototype,"init",function(e,t,n){e.call(this,t,n),n.mapNavigation.enableTouchZoom&&(this.pinchX=this.pinchHor=this.pinchY=this.pinchVert=!0)}),u(r.prototype,{renderMapNavigation:function(){var e=this,t=this.options.mapNavigation,n=t.buttons,r,i,s,o=function(){this.handler.call(e)};if(t.enableButtons)for(r in n)n.hasOwnProperty(r)&&(s=a(t.buttonOptions,n[r]),i=e.renderer.button(s.text,0,0,o).attr({width:s.width,height:s.height}).css(s.style).add(),i.handler=s.onclick,i.align(u(s,{width:i.width,height:i.height}),null,"spacingBox"))},fitToBox:function(e,t){return o([["x","width"],["y","height"]],function(n){var r=n[0],i=n[1];e[r]+e[i]>t[r]+t[i]&&(e[i]>t[i]?(e[i]=t[i],e[r]=t[r]):e[r]=t[r]+t[i]-e[i]),e[i]>t[i]&&(e[i]=t[i]),e[r]<t[r]&&(e[r]=t[r])}),e},mapZoom:function(e,t,n){if(this.isMapZooming)return;var r=this,i=r.xAxis[0],s=i.max-i.min,o=f(t,i.min+s/2),u=s*e,a=r.yAxis[0],l=a.max-a.min,c=f(n,a.min+l/2),h=l*e,p=o-u/2,d=c-h/2,v=f(r.options.chart.animation,!0),m,g=r.fitToBox({x:p,y:d,width:u,height:h},{x:i.dataMin,y:a.dataMin,width:i.dataMax-i.dataMin,height:a.dataMax-a.dataMin});i.setExtremes(g.x,g.x+g.width,!1),a.setExtremes(g.y,g.y+g.height,!1),m=v?v.duration||500:0,m&&(r.isMapZooming=!0,setTimeout(function(){r.isMapZooming=!1},m)),r.redraw()}}),p.map=a(p.scatter,{animation:!1,nullColor:"#F8F8F8",borderColor:"silver",borderWidth:1,marker:null,stickyTracking:!1,dataLabels:{verticalAlign:"middle"},turboThreshold:0,tooltip:{followPointer:!0,pointFormat:"{point.name}: {point.y}<br/>"},states:{normal:{animation:!0}}});var y=e.extendClass(i,{applyOptions:function(t,n){var r=i.prototype.applyOptions.call(this,t,n);return r.path&&typeof r.path=="string"&&(r.path=r.options.path=e.splitPath(r.path)),r},onMouseOver:function(){clearTimeout(this.colorInterval),i.prototype.onMouseOver.call(this)},onMouseOut:function(){var e=this,t=+(new Date),n=v(e.options.color),r=v(e.pointAttr.hover.fill),s=e.series.options.states.normal.animation,o=s&&(s.duration||500);o&&n.rgba.length===4&&r.rgba.length===4&&(delete e.pointAttr[""].fill,clearTimeout(e.colorInterval),e.colorInterval=setInterval(function(){var i=(new Date-t)/o,s=e.graphic;i>1&&(i=1),s&&s.attr("fill",g(r,n,i)),i>=1&&clearTimeout(e.colorInterval)},13)),i.prototype.onMouseOut.call(e)}});h.map=e.extendClass(h.scatter,{type:"map",pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},colorKey:"y",pointClass:y,trackerGroups:["group","markerGroup","dataLabelsGroup"],getSymbol:m,supportsDrilldown:!0,getExtremesFromAll:!0,useMapGeometry:!0,init:function(n){var r=this,i=n.options.legend.valueDecimals,s=[],u,a,f,c,p,d,v,m,g,y,b=n.options.legend.layout==="horizontal";e.Series.prototype.init.apply(this,arguments),d=r.options.colorRange,v=r.options.valueRanges,v?(o(v,function(n){a=n.from,f=n.to,u="",a===t?u="< ":f===t&&(u="> "),a!==t&&(u+=l(a,i)),a!==t&&f!==t&&(u+=" - "),f!==t&&(u+=l(f,i)),s.push(e.extend({chart:r.chart,name:u,options:{},drawLegendSymbol:h.area.prototype.drawLegendSymbol,visible:!0,setState:function(){},setVisible:function(){}},n))}),r.legendItems=s):d&&(a=d.from,f=d.to,c=d.fromLabel,p=d.toLabel,g=b?[0,0,1,0]:[0,1,0,0],b||(y=c,c=p,p=y),m={linearGradient:{x1:g[0],y1:g[1],x2:g[2],y2:g[3]},stops:[[0,a],[1,f]]},s=[{chart:r.chart,options:{},fromLabel:c,toLabel:p,color:m,drawLegendSymbol:this.drawLegendSymbolGradient,visible:!0,setState:function(){},setVisible:function(){}}],r.legendItems=s)},drawLegendSymbol:h.area.prototype.drawLegendSymbol,drawLegendSymbolGradient:function(e,t){var n=e.options.symbolPadding,r=f(e.options.padding,8),i,s,o=this.chart.renderer.fontMetrics(e.options.itemStyle.fontSize).h,u=e.options.layout==="horizontal",a,l,c,h=f(e.options.rectangleLength,200);u?(i=-(n/2),s=0):(i=-h+e.baseline-n/2,s=r+o),t.fromText=this.chart.renderer.text(t.fromLabel,s,i).attr({zIndex:2}).add(t.legendGroup),a=t.fromText.getBBox(),t.legendSymbol=this.chart.renderer.rect(u?a.x+a.width+n:a.x-o-n,a.y,u?h:o,u?o:h,2).attr({zIndex:1}).add(t.legendGroup),l=t.legendSymbol.getBBox(),t.toText=this.chart.renderer.text(t.toLabel,l.x+l.width+n,u?i:l.y+l.height-n).attr({zIndex:2}).add(t.legendGroup),c=t.toText.getBBox(),u?(e.offsetWidth=a.width+l.width+c.width+n*2+r,e.itemY=o+r):(e.offsetWidth=Math.max(a.width,c.width)+n+l.width+r,e.itemY=l.height+r,e.itemX=n)},getBox:function(e){var t=Number.MIN_VALUE,n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE;o(e||this.options.data,function(e){var s=e.path,o=s.length,u=!1,a=Number.MIN_VALUE,f=Number.MAX_VALUE,l=Number.MIN_VALUE,c=Number.MAX_VALUE;while(o--)typeof s[o]=="number"&&!isNaN(s[o])&&(u?(a=Math.max(a,s[o]),f=Math.min(f,s[o])):(l=Math.max(l,s[o]),c=Math.min(c,s[o])),u=!u);e._maxX=a,e._minX=f,e._maxY=l,e._minY=c,t=Math.max(t,a),n=Math.min(n,f),r=Math.max(r,l),i=Math.min(i,c)}),this.minY=i,this.maxY=r,this.minX=n,this.maxX=t},translatePath:function(e){var t=this,n=!1,r=t.xAxis,i=t.yAxis,s;e=[].concat(e),s=e.length;while(s--)typeof e[s]=="number"&&(n?e[s]=Math.round(r.translate(e[s])):e[s]=Math.round(i.len-i.translate(e[s])),n=!n);return e},setData:function(){e.Series.prototype.setData.apply(this,arguments),this.getBox()},translate:function(){var e=this,t=Number.MAX_VALUE,n=Number.MIN_VALUE;e.generatePoints(),o(e.data,function(r){r.shapeType="path",r.shapeArgs={d:e.translatePath(r.path)},typeof r.y=="number"&&(r.y>n?n=r.y:r.y<t&&(t=r.y))}),e.translateColors(t,n)},translateColors:function(e,n){var r=this.options,i=r.valueRanges,s=r.colorRange,u=this.colorKey,a,f;s&&(a=v(s.from),f=v(s.to)),o(this.data,function(o){var l=o[u],c,h,p,d;if(i){p=i.length;while(p--){c=i[p],a=c.from,f=c.to;if((a===t||l>=a)&&(f===t||l<=f)){h=c.color;break}}}else s&&l!==undefined&&(d=1-(n-l)/(n-e),h=l===null?r.nullColor:g(a,f,d));h&&(o.color=null,o.options.color=h)})},drawGraph:m,drawDataLabels:m,drawPoints:function(){var t=this,n=t.xAxis,r=t.yAxis,i=t.colorKey;o(t.data,function(e){e.plotY=1,e[i]===null&&(e[i]=0,e.isNull=!0)}),h.column.prototype.drawPoints.apply(t),o(t.data,function(e){var t=e.dataLabels,s=n.toPixels(e._minX,!0),o=n.toPixels(e._maxX,!0),u=r.toPixels(e._minY,!0),a=r.toPixels(e._maxY,!0);e.plotX=Math.round(s+(o-s)*f(t&&t.anchorX,.5)),e.plotY=Math.round(u+(a-u)*f(t&&t.anchorY,.5)),e.isNull&&(e[i]=null)}),e.Series.prototype.drawDataLabels.call(t)},animateDrilldown:function(e){var t=this.chart.plotBox,n=this.chart.drilldownLevels[this.chart.drilldownLevels.length-1],r=n.bBox,i=this.chart.options.drilldown.animation,s;e||(s=Math.min(r.width/t.width,r.height/t.height),n.shapeArgs={scaleX:s,scaleY:s,translateX:r.x,translateY:r.y},o(this.points,function(e){e.graphic.attr(n.shapeArgs).animate({scaleX:1,scaleY:1,translateX:0,translateY:0},i)}),delete this.animate)},animateDrillupFrom:function(e){h.column.prototype.animateDrillupFrom.call(this,e)},animateDrillupTo:function(e){h.column.prototype.animateDrillupTo.call(this,e)}}),p.mapline=a(p.map,{lineWidth:1,backgroundColor:"none"}),h.mapline=e.extendClass(h.map,{type:"mapline",pointAttrToOptions:{stroke:"color","stroke-width":"lineWidth",fill:"backgroundColor"},drawLegendSymbol:h.line.prototype.drawLegendSymbol}),p.mappoint=a(p.scatter,{dataLabels:{enabled:!0,format:"{point.name}",color:"black",style:{textShadow:"0 0 5px white"}}}),h.mappoint=e.extendClass(h.scatter,{type:"mappoint"}),e.Map=function(t,n){var r={endOnTick:!1,gridLineWidth:0,labels:{enabled:!1},lineWidth:0,minPadding:0,maxPadding:0,startOnTick:!1,tickWidth:0,title:null},i;return i=t.series,t.series=null,t=a({chart:{type:"map",panning:"xy"},xAxis:r,yAxis:a(r,{reversed:!0})},t,{chart:{inverted:!1}}),t.series=i,new e.Chart(t,n)}})(Highcharts);