/*
 FusionCharts JavaScript Library - ZoomScatter Chart
 Copyright FusionCharts Technologies LLP
 License Information at <http://www.fusioncharts.com/license>

 @version 3.11.0
*/
FusionCharts.register("module",["private","modules.renderer.js-zoomscatter",function(){function O(){}var D=this,x=D.hcLib,V=x.parseTooltext,M=x.Raphael,W=x.addEvent,ba=x.removeEvent,P=D.window,X=P.MouseEvent,E=P.document,F=x.BLANKSTRING,y=x.pluck,C=x.pluckNumber,ca=x.getFirstValue,da=x.toRaphaelColor,ea=x.hasSVG,Y=x.isIE,Q=x.getFirstColor,N=x.hasTouch,R="rgba(192,192,192,"+(Y?.002:1E-6)+")",A=Math,K=A.round,z=A.min,B=A.max,S=A.abs,H=A.cos,I=A.sin,Z=A.floor,fa=2*Math.PI,ga=x.getMouseCoordinate,ha=
x.POSITION_BOTTOM,J=x.chartAPI,T=x.HUNDREDSTRING,A=!/fusioncharts\.com$/i.test(P.location.hostname),$,aa,L=function(c,b){var a=ga(b.linkedItems.container,c),d=a.chartX,e=a.chartY,f=b.config,k=f.canvasLeft,h=f.canvasTop,g=f.canvasLeft+f.canvasWidth,f=f.canvasHeight+f.canvasTop;a.insideCanvas=!1;a.originalEvent=c;d>k&&d<g&&e>h&&e<f&&(a.insideCanvas=!0);return a},ia=function(c,b,a){var d;b&&c&&(a||(a={}),a.originalEvent&&(a=a.originalEvent),a.touches&&(a=a.touches[0]),b.dispatchEvent?(X?d=new X(c,{bubbles:!!a.bubbles,
cancelable:!!a.cancelable,clientX:a.clientX||a.pageX&&a.pageX-E.body.scrollLeft-E.documentElement.scrollLeft||0,clientY:a.clientY||a.pageY&&a.pageY-E.body.scrollTop-E.documentElement.scrollTop||0,screenX:a.screenX||0,screenY:a.screenY||0,pageX:a.pageX||0,pageY:a.pageY||0}):E.createEvent&&(d=E.createEvent("HTMLEvents"),d.initEvent(c,!!a.bubbles,!!a.cancelable)),d.eventName=c,d&&b.dispatchEvent(d)):E.createEventObject&&b.fireEvent&&(d=E.createEventObject(),d.eventType=c,d.eventName=c,b.fireEvent("on"+
c,d)))};J("zoomscatter",{standaloneInit:!0,defaultDatasetType:"zoomscatter",applicableDSList:{zoomscatter:!0},friendlyName:"ZoomScatter Chart",isXY:!0,defaultZeroPlaneHighlighted:!1,creditLabel:A,configure:function(){var c,b=this.config;J.scatter.configure.apply(this,arguments);c=this.jsonData.chart;b.stepZoom=1-C(c.stepzoom,25)/100;b.showToolBarButtonToolText=C(c.showtoolbarbuttontooltext,1);b.btnResetChartToolText=y(c.btnresetcharttooltext,"Reset Chart");b.btnZoomOutToolText=y(c.btnzoomouttooltext,
"Zoom out to previous level");b.btnZoomInToolText=y(c.btnzoomintooltext,"<strong>Zoom in</strong><br/>Or double-click on plot to zoom-in");b.btnSelectZoomToolText=y(c.btnselectzoomtooltext,"<strong>Select a region to zoom-in</strong><br/>Click to enable pan mode.");b.btnPanToolText=y(c.btnpantooltext,"<strong>Drag to move across chart</strong><br/>Click to enable select-zoom mode.")},_setAxisLimits:function(){var c=this.jsonData,b=this.components.xAxis,a=y(c.chart.xaxislabelmode,"categories"),c=c.categories&&
c.categories[0],c=(c&&c.category||[]).slice(),d,e=Infinity,f=-Infinity,k;if("auto"===a||0===c.length){J.mscartesian._setAxisLimits.call(this);a=b[0].getLimit();b[0].setAxisData({hasCategory:0});b[0].resetCategoryAxisComponents();for(d=0;d<c.length;d+=1)if(k=c[d].x)k<e&&(e=k),k>f&&(f=k);if(f>a.max||e<a.min)f=B(f,a.max),e=z(e,a.min),b[0].setDataLimit(f,e)}else b[0].resetNumericAxisComponents(),J.scatterBase._setAxisLimits.call(this)},_createAxes:function(){var c=this.components;J.scatter._createAxes.call(this,
arguments);c.yAxis[0].setAxisConfig({animateAxis:!1});c.xAxis[0].setAxisConfig({animateAxis:!1})},_spaceManager:function(){var c,b,a=this.config,d=this.components,e=d.xAxis&&d.xAxis[0];b=d.yAxis&&d.yAxis||[];var f,k,h=d.legend.config.legendPos,g=a.xDepth,l=a.yDepth,m=a.canvasBgDepth,n=a.canvasBaseDepth,t=a.canvasBasePadding,q=d.canvas.config.canvasBorderWidth,p=a.realTimeConfig&&a.realTimeConfig.showRTValue,r=a.borderWidth,s=a.canvasMarginTop,w=a.canvasMarginBottom,u=a.canvasMarginLeft,v=a.canvasMarginRight,
d=a.minCanvasHeight,U=a.minCanvasWidth;c=a.minChartWidth;var y=a.minChartHeight,z=a.height,x=a.width,G=a._initConfig||(a._initConfig={}),B=!1,D=a.origCanvasTopMargin,F=a.origCanvasBottomMargin,C,A,E=[];G.canvasLeft=a.canvasLeft;G.canvasWidth=a.canvasWidth;G.canvasHeight=a.canvasHeight;G.canvasTop=a.canvasTop;G.availableHeight=a.availableHeight;G.availableWidth=a.availableWidth;a.canvasWidth-2*r<c&&(k=(a.canvasWidth-c)/2);a.canvasHeight-2*r<y&&(f=(a.canvasHeight-y)/2);this._allocateSpace({top:f||r,
bottom:f||r,left:k||r,right:k||r});a.origCanvasWidth=a.canvasWidth;a.origCanvasLeft=a.canvasLeft;a.canvasRight=a.canvasLeft+a.canvasWidth;a.origCanvasRight=a.canvasRight;r=0;for(k=b.length;r<k;r++)f=b[r],c=.7*a.availableWidth,c=f&&f.placeAxis(c)||{},E.push({axisIndex:r,spaceTaken:c}),f&&this._allocateSpace(c);b=.7*a.canvasHeight;this._manageActionBarSpace&&this._allocateSpace(this._manageActionBarSpace(b));this._manageLegendSpace(void 0);l&&(this._allocateSpace({bottom:l}),a.shift=g+t+n);m&&this._allocateSpace({right:m});
a.canvasWidth-2*q<U&&(A=(a.canvasWidth-U)/2);this._allocateSpace({left:A||q,right:A||q});U>x-u-v&&(l=a.canvasWidth-U,g=u+v,u=a.canvasMarginLeft=l*u/g,v=a.canvasMarginRight=l*v/g);u=u>a.canvasLeft?u-a.canvasLeft:0;this._allocateSpace({left:u,right:v>x-a.canvasRight?v+a.canvasRight-x:0});b=h===ha?.6*a.canvasHeight:.6*a.canvasWidth;this._manageChartMenuBar(b);b=.2*a.availableHeight;this._allocateSpace(this._getSumValueSpace(b));b=.3*a.availableHeight;a.origCanvasHeight=a.canvasHeight;a.canvasBottom=
a.canvasTop+a.canvasHeight;a.origCanvasBottom=a.canvasBottom;a.origCanvasTop=a.canvasTop;a.realtimeEnabled&&(p?this._allocateSpace(this._realTimeValuePositioning(b)):this._hideRealTimeValue());b=.6*a.availableHeight;a.xAxisSpaceAllocation=h=e&&e.placeAxis(b);e&&this._allocateSpace(h);this._getDSspace&&this._allocateSpace(this._getDSspace(.4*a.canvasWidth));b=.3*a.availableHeight;this._manageScrollerPosition&&this._manageScrollerPosition(b);a.canvasHeight-2*q<d&&(C=(a.canvasHeight-d)/2);this._allocateSpace({top:C||
q,bottom:C||q});this._allocateSpace({bottom:n});d>z-s-w&&(B=!0,l=a.canvasHeight-d,g=s+w,s=a.canvasMarginTop=l*s/g,w=a.canvasMarginBottom=l*w/g);e=s>a.canvasTop?s-a.canvasTop:0;n=w>z-a.canvasBottom?w+a.canvasBottom-z:0;this._allocateSpace({top:e,bottom:n});B&&(g=D+F,B=a.canvasHeight,B>d&&(l=B-d,e=l*D/g,n=l*F/g),this._allocateSpace({top:e,bottom:n}));a.actualCanvasMarginTop=e;a.actualCanvasMarginLeft=u},_createToolBox:function(){var c,b,a,d,e,f,k,h,g,l=this,m=l.config;d=l.components;c=d.chartMenuBar;
g=m.showToolBarButtonToolText;var n=m.stepZoom;c&&c.drawn||(J.mscartesian._createToolBox.call(l),c=d.tb,b=c.graphics||(c.graphics={}),a=c.getAPIInstances(c.ALIGNMENT_HORIZONTAL),a=a.Symbol,d=d.chartMenuBar.componentGroups[0],e=b.zoomInButton=(new a("zoomInIcon",void 0,c.idCount++,c.pId)).attachEventHandlers({click:function(){l.zoom(n)},tooltext:g&&m.btnZoomInToolText||F}),f=b.zoomOutButton=(new a("zoomOutIcon",void 0,c.idCount++,c.pId)).attachEventHandlers({click:function(){var a=m.viewPortHistory;
1<a.length&&(a=a.slice(-2,-1)[0],l.updateVisual(a.x,a.y,a.scaleX,a.scaleY))},tooltext:g&&m.btnZoomOutToolText||F}),k=b.resetButton=(new a("resetIcon",void 0,c.idCount++,c.pId)).attachEventHandlers({click:function(){var a=m.viewPortConfig,b=l.graphics;1<m.viewPortHistory.length&&(a.isReset=!0,l.zoomSelection(0,0,m.canvasWidth,m.canvasHeight),m.viewPortHistory.splice(1),b.trackerGroup.attr({cursor:"default"}),l.updateButtonVisual(),l.updateSelectionBox(0,0,0,0));D.raiseEvent("zoomReset",{},l.chartInstance,
[l.chartInstance.id])},tooltext:g&&m.btnResetChartToolText||F}),h=b.toggleZoomInButton=(new a("zoomModeIcon",void 0,c.idCount++,c.pId)).attachEventHandlers({click:function(){l.toogleDragPan(!0)},tooltext:g&&m.btnSelectZoomToolText||F}),g=b.togglePanButton=(new a("panModeIcon",void 0,c.idCount++,c.pId)).attachEventHandlers({click:function(){l.toogleDragPan(!0)},tooltext:g&&m.btnPanToolText||F}),d.addSymbol(g,!0),d.addSymbol(h,!0),d.addSymbol(k,!0),d.addSymbol(f,!0),d.addSymbol(e,!0))},_createLayers:function(){var c=
this.graphics,b=this.components.paper;J.scatter._createLayers.call(this);!c.imageContainer&&(c.imageContainer=b.group("dataset-orphan",c.datasetGroup));this.__preDraw()},_dist:function(c,b){var a=this.components,d;d=a.xAxis[0];a=a.yAxis[0];if(c&&b)return d=(c.x-b.x)*d.getPVR(),a=(c.y-b.y)*a.getPVR(),Math.sqrt(Math.pow(d,2)+Math.pow(a,2))},__preDraw:function(){var c=this.graphics,b=c.imageContainer,a=this.config,d=a.canvasLeft,e=a.canvasTop,f=a.canvasWidth,k=a.canvasHeight,h=this.jsonData.chart,g=
this.linkedItems,g=g.eventListeners||(g.eventListeners=[]),l=this.linkedItems.container,m=this.components.paper;a.updateAnimDuration=500;b.transform("t"+d+","+e);b.attr({"clip-rect":d+","+e+","+f+","+k});a.status="zoom";a.maxZoomLimit=C(h.maxzoomlimit,1E3);a.viewPortHistory=[{scaleX:1,scaleY:1,x:0,y:0}];!c.trackerElem&&(c.trackerElem=m.rect(d,e,f,k,0,c.trackerGroup).attr({fill:R,stroke:R}));ba(l,N?"touchstart":"mousemove",this.searchMouseMove);g.push(W(l,"touchstart mousemove",this.searchMouseMove,
this));this.zoomPanManager(b)},searchMouseMove:function(c){var b,a,d,e=c.data,f=e.config,k=f.viewPortConfig;a=e.components;var h=a.xAxis[0],g=a.yAxis[0];e.linkedItems.container&&!f.isDragging&&((b=L(c,e))&&b.insideCanvas?(a=f.canvasTop,d=f.canvasLeft,k.lastMouseCoordinate={x:Number(h.getValue(b.chartX-d)),y:Number(g.getValue(b.chartY-a))},clearTimeout(k.neighbourSearchTimer),f.lastMouseEvent=c,k.neighbourSearchTimer=setTimeout(function(){f.isDragging||e._bestNeighbour(k.lastMouseCoordinate)},100)):
e.highlightPoint(!1))},updateSelectionBox:function(c,b,a,d){var e=this.config,f=this.graphics,k=this.components.paper,h=e.viewPortConfig,g=e.cursor,l=f.selectionBox,m=e.canvasRight,n=e.canvasLeft,t=e.canvasTop,q=e.canvasBottom,p=c<a?c:a,r=b<d?b:d,s=c>a?c:a,w=b>d?b:d,u=a-c,v=b-d,g=g?0<u&&0<v?"ne-resize":0>u&&0<v?"nw-resize":0>u&&0>v?"sw-resize":0<u&&0>v?"se-resize":"default":"default",p=p<n?n:p>m?m:p,r=r<t?t:r>q?q:r,u=c===a&&b===d?0:(s>m?m:s<n?n:s)-p,v=c===a&&b===d?0:(w>q?q:w<t?t:w)-r;l?l.attr({x:p,
y:r,width:u,height:v,cursor:g}):f.selectionBox=k.rect(p,r,u,v).attr({"stroke-width":1,stroke:"red",fill:"#00FF00",opacity:.2,cursor:g});f.trackerGroup.attr({cursor:g});e.cursor=g;h.selectionDimensions||(h.selectionDimensions={startX:0,endX:0,startY:0,endY:0});h.selectionDimensions.startX=c;h.selectionDimensions.endX=b;h.selectionDimensions.startY=a;h.selectionDimensions.endY=d},getValue:function(c){var b=this.config,a=this.components,d=b.viewPortConfig;c=this.getOriginalPositions(c.x,c.y,c.x,c.y);
var e=a.xAxis[0].config.axisRange,a=a.yAxis[0].config.axisRange,f=e.min,k=a.max;return{x:f+(c[0]-b.canvasLeft)/(b.canvasWidth*d.scaleX/(e.max-f)),y:k-(c[1]-b.canvasTop)/(b.canvasHeight*d.scaleY/(k-a.min))}},_getTouchViewPort:function(c,b,a){var d,e;e=this.config;var f=e.canvasLeft,k=e.canvasTop;d=e.canvasWidth;e=e.canvasHeight;var h=z(c[0].chartX,c[1].chartX)-f,g=z(c[0].chartY,c[1].chartY)-k,l=Math.abs(c[1].chartX-c[0].chartX);c=Math.abs(c[1].chartY-c[0].chartY);var f=z(b[0].chartX,b[1].chartX)-f,
k=z(b[0].chartY,b[1].chartY)-k,m=Math.abs(b[1].chartX-b[0].chartX),n=Math.abs(b[1].chartY-b[0].chartY);b=m/l*a.scaleX;l=n/c*a.scaleY;h=a.x+h/a.scaleX-f/b;a=a.y+g/a.scaleY-k/l;h=0>h?0:h;a=0>a?0:a;l=1>l?1:l;b=1>b?1:b;d-=d/b;e-=e/l;return{x:h>d?d:h,y:a>e?e:a,scaleX:b,scaleY:l}},getOriginalPositions:function(c,b,a,d){var e=this.config,f=e.viewPortConfig,k=f.scaleX,h=f.scaleY,g=f.x,f=f.y,l=z(c,a);c=B(c,a);a=z(b,d);b=B(b,d);c=c>e.canvasWidth?e.canvasWidth:c;b=b>e.canvasHeight?e.canvasHeight:b;l=0>l?0:l;
a=0>a?0:a;return[g+l/k,f+a/h,(c-l)/k,(b-a)/h]},zoomSelection:function(c,b,a,d){var e=this.config;a&&d&&(a=Math.abs(e.canvasWidth/a),d=Math.abs(e.canvasHeight/d),this.updateVisual(c,b,a,d))},toogleDragPan:function(c){var b=this.config,a=b.status;c&&(b.status="zoom"===a?"pan":"zoom",D.raiseEvent("zoomModeChanged",{panModeActive:b.status},this.chartInstance,[this.chartInstance.id]));this.updateButtonVisual()},updateManager:function(c){var b,a=this.components.dataset,d=a.length;for(b=0;b<d;b+=1)a[b].draw(c);
c||this._drawQuadrant()},zoomPanManager:function(){var c,b=[],a=[],d=this,e=d.config,f=d.graphics,k=d.components,h=k.eventListeners||(k.eventListeners=[]),g=d.viewPortConfig,l=!1,m=0,n,t={},q=function(a){var b=a.chartX,c=a.chartY,d=e.canvasLeft,f=e.canvasTop,g=e.canvasRight,h=e.canvasBottom;b<d&&(a.chartX=B(b,d));b>g&&(a.chartX=z(b,g));c<f&&(a.chartY=B(c,f));c>h&&(a.chartY=z(c,h))},p={start:function(a){g=e.viewPortConfig;N=a.touches?!0:!1;b[0]=L(a,d);d.updateSelectionBox(0,0,0,0);N&&(l=!1,c=a.touches.length,
2===c&&(l=!0,t.x=g.x,t.y=g.y,t.scaleX=g.scaleX,t.scaleY=g.scaleY,b[0]=L(a.touches.item(0),d),b[1]=L(a.touches.item(1),d)));e.isDragging=!1;"pan"===e.status&&(e.panStartX=g.x,e.panStartY=g.y,b[0].insideCanvas&&f.trackerGroup.attr({cursor:"move"}))},on:function(c){var h,m,n,q;n=e.panStartX;var p=e.panStartY;h=g.scaleX;m=g.scaleY;var z=k.xAxis[0],x=k.yAxis[0];N=c.touches?!0:!1;a[0]=L(c,d);a[0].insideCanvas?"pan"===e.status&&f.trackerGroup.attr({cursor:"move"}):f.trackerGroup.attr({cursor:"default"});
N&&c&&(q=c.touches.length,2===q?(l=!0,a[0]=L(c.touches.item(0),d),a[1]=L(c.touches.item(1),d)):l=!1);!e.isDragging&&(!N||2<S(a[0].chartX-b[0].chartX)||2<S(a[0].chartY-b[0].chartY))&&(e.isDragging=!0,d.highlightPoint(!1),"zoom"===e.status&&(b[0].pointValue=d.getValue({x:b[0].chartX,y:b[0].chartY}),D.raiseEvent("selectionStart",{chartX:b[0].chartX,chartY:b[0].chartY,pageX:b[0].pageX,pageY:b[0].pageY,selectionTop:b[0].chartX+e.canvasLeft,selectionLeft:b[0].chartY+e.canvasTop,selectionWidth:0,selectionHeight:0,
startXVAlue:b[0].pointValue.x,startYVAlue:b[0].pointValue.y},d.chartInstance,[d.chartInstance.id])));if(e.isDragging)if(l){if(b[0].insideCanvas||b[1].insideCanvas)n=d._getTouchViewPort(b,a,t),d.updateVisual(n.x,n.y,n.scaleX,n.scaleY,!0)}else"zoom"===e.status?d.updateSelectionBox(b[0].chartX,b[0].chartY,a[0].chartX,a[0].chartY):"pan"!==e.status||1===h&&1===m||!b[0].insideCanvas||(c=b&&a[0].chartX-b[0].chartX,q=b&&a[0].chartY-b[0].chartY,n-=c/h,p-=q/m,h=e.canvasWidth*(h-1)/h,m=e.canvasHeight*(m-1)/
m,g.x=n>h?h:0>n?0:n,g.y=p>m?m:0>p?0:p,d.updateManager(),z.draw(),x.draw())},end:function(c){var g=L(c,d),h=e.canvasLeft,k=e.canvasTop,p;p=e.canvasWidth/4;var z=e.canvasHeight/4,g=isNaN(g.chartX)||isNaN(g.chartY)?a[0]||b[0]:g;if(e.isDragging){if(l){if(b[0].insideCanvas||b[1].insideCanvas)c=d._getTouchViewPort(b,a,t),d.updateVisual(c.x,c.y,c.scaleX,c.scaleY);l=!1}else"zoom"===e.status&&(c=g,p=b[0],q(p),q(c),k=d.getOriginalPositions(p.chartX-h,p.chartY-k,c.chartX-h,c.chartY-k))&&(c.pointValue=d.getValue({x:c.chartX,
y:c.chartY}),D.raiseEvent("selectionEnd",{chartX:c.chartX,chartY:c.chartY,pageX:c.pageX,pageY:c.pageY,selectionTop:c.chartX+e.canvasLeft,selectionLeft:c.chartY+e.canvasTop,selectionWidth:Math.abs(c.chartX-p.chartX),selectionHeight:Math.abs(c.chartY-p.chartY),startXVAlue:p.pointValue.x,startYVAlue:p.pointValue.y,endXValue:c.pointValue.x,endYValue:c.pointValue.y},d.chartInstance,[d.chartInstance.id]),p.chartX!==c.chartX&&p.chartY!==c.chartY&&d.zoomSelection(k[0],k[1],k[2],k[3]),d.updateSelectionBox(0,
0,0,0));e.isDragging=!1;c=a[0]||b[0];c.data=d;d.searchMouseMove(c)}else g.insideCanvas&&(m+=1,setTimeout(function(){m=0;n=void 0},500),2===m?(c&&c.touches?!0:!1)===n&&(h=g.chartX-h,k=g.chartY-k,k=d.getOriginalPositions(h-p,k-z,h+p,k+z),d.zoomSelection(k[0],k[1],k[2],k[3]),c.preventDefault()):n=c&&c.touches?!0:!1);f.trackerGroup.attr({cursor:"default"})}};h.push(W(d.linkedItems.container,"pointerdrag",function(a){p[a.state](a.originalEvent)}))},_drawDataset:function(){var c,b=this.components.dataset,
a=b.length;for(c=0;c<a;c+=1)b[c]._deleteGridImages(),b[c].graphics._grid={};this.updateVisual()},updateVisual:function(c,b,a,d,e){var f,k,h,g,l;f=this.config;var m=this.components,n=f.viewPortConfig;l=f.canvasWidth;var t=f.canvasHeight,q=l,p=t,r=f.viewPortHistory,p=r.slice(-1)[0],s=[],s=f.status,w=f._initConfig;k=m.xAxis[0];g=m.yAxis[0];h=this.graphics;m=(m=m.quadrant)&&m.graphics.container;q=f.maxZoomLimit;n.x=isNaN(c)?c=p.x:c;n.y=isNaN(b)?b=p.y:b;n.scaleX=a||(a=p.scaleX);n.scaleY=d||(d=p.scaleY);
a>q&&(n.x=c=z(c,l-l/q),n.scaleX=a=q);d>q&&(n.y=b=z(b,t-t/q),n.scaleY=d=q);if(e)this.updateManager(e);else for(1<a||1<d?("zoom"===s&&this.toogleDragPan(!0),a>=p.scaleX||d>=p.scaleY?(r.push({scaleX:a,scaleY:d,x:c,y:b}),s=["zoomed","zoomIn"]):(r.pop(),p=r.slice(-1)[0],n.x=p.x,n.y=p.y,n.scaleX=p.scaleX,n.scaleY=p.scaleY,s=["zoomed","zoomOut"])):(1<r.length&&r.pop(),"pan"===s&&this.toogleDragPan(!0),s=["zoomed","zoomOut"]),this.toogleDragPan(),q=f.canvasWidth,p=f.canvasHeight,c&&(c=n.x*=q/l),b&&(n.y*=
p/t),f.canvasLeft=w.canvasLeft,f.canvasWidth=w.canvasWidth,f.canvasHeight=w.canvasHeight,f.canvasTop=w.canvasTop,f.availableHeight=w.availableHeight,f.availableWidth=w.availableWidth,this._spaceManager(),this._postSpaceManagement(),this.updateManager(),k.draw(),g.draw(),this._drawCanvas(),l={"clip-rect":f.canvasLeft+","+f.canvasTop+","+f.canvasWidth+","+f.canvasHeight},f.viewPortConfig&&this.graphics.imageContainer.attr({x:f.canvasLeft,y:f.canvasRight}),h.imageContainer.attr(l).transform("T"+f.canvasLeft+
","+f.canvasTop),h.tracker&&h.tracker.attr(l),m&&m.attr(l),f=k.getValue(0),k=k.getValue(q),h=g.getValue(0),g=g.getValue(p),0===arguments.length&&(s=F),l=0;l<s.length;l+=1)"zoomed"===s[l]&&D.raiseEvent("zoomed",{level:r.length,startX:f,startY:h,endX:k,endY:g},this.chartInstance,[this.chartInstance.id]),"zoomIn"===s[l]?D.raiseEvent("zoomedIn",{level:r.length,startX:f,startY:h,endX:k,endY:g},this.chartInstance,[this.chartInstance.id]):"zoomOut"!==s[l]||n.isReset||D.raiseEvent("zoomedOut",{level:r.length,
startX:f,startY:h,endX:k,endY:g},this.chartInstance,[this.chartInstance.id]);this.highlightPoint(!1);n.isReset=!1},getFillColor:function(c,b){b=parseFloat(b/100);0>b?b=0:1<b&&(b=1);c||(c="#FFFFFF");if(Y&&!ea)return b?c:"transparent";c=c.replace(/^#?([a-f0-9]+)/ig,"$1");c=x.graphics.HEXtoRGB(c);c[3]=b.toString();return"rgba("+c.join(",")+")"},_bestNeighbour:function(c){var b=this.components,a=this.config,d=b.xAxis[0],e=b.yAxis[0],f=this.jsonData.chart,k=a.canvasLeft,h=a.canvasTop,g,l,m,n,t,q,p,r,s,
w,u,v;v=b.numberFormatter;s=b.dataset;for(g=s.length-1;0<=g;--g)if(b=s[g],u=b.config,l=u.showHoverEffect,r=u.showTooltip,b.components.kDTree&&b.visible&&(n=b.getElement(c),b=this._dist(c,n),!t||b<q))if(m=g,t=n,q=b,p=s[m]&&u.zoomedRadius||0,q<=p)break;q<=B(p+2,5)?(c=d.getPixel(t.x)-k,h=e.getPixel(t.y)-h,k=y(t.tooltext,u.plotToolText),b=s[m],u=b.config,s=u.tooltip.toolTipSepChar,q=u.tooltip.seriesNameInToolTip,p=t.x,g=t.y,t&&(w=v.yAxis(g),v=v.xAxis(p),w=Number(r)?void 0!==k?V(k,[4,5,6,7,8,9,10,11],
{yaxisName:e.getAxisData("axisName"),xaxisName:d.getAxisData("axisName"),yDataValue:w,xDataValue:v},t,f,b.config):(q?u.seriesname?u.seriesname+s:"":"")+"x:"+v+s+"y:"+w:F),a.lastHoveredPoint!==t&&this.highlightPoint(l,c,h,t,m,w)):this.highlightPoint(!1)},highlightPoint:function(c,b,a,d,e,f){var k=this,h=k.config,g=k.components,l=k.graphics,m=g.paper,n=l.tracker,t=(g=g.dataset[e])&&g.config;e=g&&t.zoomedRadius||0;var q=g&&t.hoverCosmetics,g=q&&q.fill,t=q&&q.borderColor,q=q&&q.borderThickness,p={},p=
function(a){x.plotEventHandler.call(this,k,a)},r=function(a){x.plotEventHandler.call(this,k,a,"dataplotRollover")},s=function(a){x.plotEventHandler.call(this,k,a,"dataplotRollout")},w=d&&d.link;n||(n=l.tracker=m.circle(0,0,0,l.trackerGroup).attr({"clip-rect":h.canvasLeft+","+h.canvasTop+","+h.canvasWidth+","+h.canvasHeight}).click(p).trackTooltip(!0).hover(r,s));d&&n.data("eventArgs",{x:d.x,y:d.y,tooltip:f,link:w});h.lastHoveredPoint=d;p=Number(c)?{r:e,fill:g,stroke:t,"stroke-width":q}:{r:e,fill:R,
stroke:R,"stroke-width":0};p.cursor=w?"pointer":"";n.attr(p).tooltip(f).transform("t"+(b+h.canvasLeft)+","+(a+h.canvasTop));d&&ia("mouseover",n&&n.node,h.lastMouseEvent)},zoom:function(c){var b,a,d=this.config,e=d.viewPortConfig;b=e.x;a=e.y;var f=d.canvasWidth,d=d.canvasHeight,k=f/e.scaleX,h=d/e.scaleY,e=k*c;c*=h;e=e>f?f:e;c=c>d?d:c;b=b+k/2-e/2;a=a+h/2-c/2;b=0>b?0:b;a=0>a?0:a;b=b+e>f?f-e:b;a=a+c>d?d-c:a;this.zoomSelection(b,a,e,c)},updateButtonVisual:function(){var c,b,a,d;a=this.config;var e=this.components.tb.graphics;
c=a.status;var f;1>=a.viewPortHistory.length?(a=["zoomOutButton","resetButton","togglePanButton"],d=["zoomInButton"],f="toggleZoomInButton"):(d=["resetButton","zoomOutButton","zoomInButton"],a=[],"zoom"===c?(d.push("togglePanButton"),f="toggleZoomInButton"):"pan"===c&&(d.push("toggleZoomInButton"),f="togglePanButton"));for(c=0;c<a.length;c+=1)b=a[c],e[b].node.attr({config:{hover:{fill:"#FFFFFF","stroke-width":1,stroke:"#E3E3E3",cursor:"default"},normal:{fill:"#FFFFFF",stroke:"#E3E3E3","stroke-width":1,
cursor:"default"},disable:{fill:"#FFFFFF","stroke-width":1,stroke:"#E3E3E3","stroke-opacity":1,cursor:"default"},pressed:{fill:"#FFFFFF","stroke-width":1,stroke:"#E3E3E3",cursor:"default"}},fill:["#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF",!0],"button-disabled":!1,stroke:"#E3E3E3","stroke-opacity":1});for(c=0;c<d.length;c+=1)b=d[c],e[b].node.attr({config:{hover:{fill:"#FFFFFF","stroke-width":1,stroke:"#aaaaaa",cursor:"pointer"},normal:{fill:"#FFFFFF",stroke:"#C2C2C2","stroke-width":1,cursor:"pointer"},
disable:{fill:"#FFFFFF","stroke-width":1,stroke:"#E3E3E3","stroke-opacity":1,cursor:"pointer"},pressed:{fill:"#EFEFEF","stroke-width":1,stroke:"#C2C2C2",cursor:"pointer"}},"button-disabled":!1,fill:["#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF",!0],stroke:"#C2C2C2","stroke-opacity":1});e[f].node.attr({config:{hover:{fill:"#EFEFEF","stroke-width":1,stroke:"#EFEFEF",cursor:"default"},normal:{fill:"#EFEFEF",stroke:"#E3E3E3","stroke-width":1,cursor:"default"},disable:{fill:"#E6E6E6","stroke-width":1,stroke:"#E3E3E3",
"stroke-opacity":1,cursor:"default"},pressed:{fill:"#EFEFEF","stroke-width":1,stroke:"#E3E3E3",cursor:"default"}},"button-disabled":!1,fill:["#EFEFEF","#EFEFEF","#EFEFEF","#EFEFEF",!0],stroke:"#E3E3E3","stroke-opacity":1})}},J.scatterBase);FusionCharts.register("component",["dataset","zoomscatter",{type:"zoomscatter",configure:function(){var c,b,a,d,e,f,k;f=this.chart;d=f.jsonData.chart;var h=f.getFillColor,g=this.JSONData;this.__base__.configure.call(this);f=this.config;b=this.components;c=y(g.anchorbordercolor,
d.anchorbordercolor);f.anchorBorderThickness=y(g.anchorborderthickness,d.anchorborderthickness,c?1:0);b.kDTree=new O;f.chunkSize=Math.floor(z((g.data||[]).length/5,5E4));c=f.staticRadius=C(d.staticradius,0);f.radius=C(g.radius,g.anchorradius,d.radius,d.anchorradius,c?3:.5);k=f.showHoverEffect;c=Q(y(g.plotfillhovercolor,g.hovercolor,d.plotfillhovercolor,d.hovercolor,f.anchorBgColor));b=y(g.plotfillhoveralpha,g.hoveralpha,d.plotfillhoveralpha,d.hoveralpha,T);a=Q(y(g.plotfillhovercolor,g.hovercolor,
d.plotfillhovercolor,d.hovercolor,c));e=y(g.plotfillhoveralpha,g.hoveralpha,d.plotfillhoveralpha,d.hoveralpha,T);d=C(g.borderhoverthickness,d.borderhoverthickness,1);f.hoverCosmetics={showHoverEffect:k,fill:h(c,b),borderColor:h(a,e),borderThickness:d};f.tooltip={toolTipVisible:f.showTooltip,seriesNameInToolTip:f.seriesNameInTooltip,toolTipSepChar:f.toolTipSepChar};f.lastViewPort={}},draw:function(c){var b,a,d;b=this.graphics;d=this.chart;a=d.components;var e=d.graphics.imageContainer,f=a.paper;d=
d.config;var k=this.visible,h=d.viewPortConfig,g=this.config,l=g.lastViewPort||{},m=!1;b.container||(b.container=f.group("grid-container",e));k&&this._conatinerHidden?this.show():k||this._conatinerHidden||this.hide();if(c)this._pixelatedDraw();else{if(l.scaleX!==h.scaleX||l.scaleY!==h.scaleY)l.scaleX=h.scaleX,l.scaleY=h.scaleY,c=a.xAxis[0],b=a.yAxis[0],a=c.getPVR(),c=b.getPVR(),d=B(g.zoomedRadius=z(g.staticRadius?g.radius:g.radius*z(h.scaleX,h.scaleY),d.canvasWidth/2,d.canvasHeight/2),2),this.components.kDTree._setSearchLimit(d/
a,d/c),this._deleteGridImages(),this.graphics._grid={},m=!0;this._gridDraw(m)}},_pixelatedDraw:function(){var c,b,a,d,e,f=this.chart.config;a=this.config;d=this.graphics;var k=a.drawLine,h=a.lastViewPort||{},g=h.scaleX,l=h.scaleY;e=f.viewPortConfig;var m=e.scaleX,n=e.scaleY,h=this.graphics._grid||(this.graphics._grid=[]),g=m/g,l=n/l,n=f.canvasWidth*g,f=f.canvasHeight*l;a=a._batchDarwTimers;d=d.container;clearTimeout(this.timer);if(a&&a.length)for(;a.length;)clearTimeout(a.shift());d.transform("t"+
K(-e.x*e.scaleX)+","+K(-e.y*e.scaleY));for(c in h)if(e=h[c])for(b in e)(d=e[b])&&d.drawState&&(a=d.image,a.attr({x:d.xPixel*g,y:d.yPixel*l,width:n,height:f}),k&&(a=d.lineImage,a.attr({x:d.xPixel*g,y:d.yPixel*l,width:n,height:f})))},_deleteGridImages:function(){var c,b,a,d,e;b=this.config;var f=this.graphics,k=f._imagePool||(f._imagePool=[]),h=f._canvasPool||(f._canvasPool=[]),g=f._lineImagePool||(f._lineImagePool=[]),l=f._lineCanvasPool||(f._lineCanvasPool=[]),m=f._grid||[];if((b=b._batchDarwTimers)&&
b.length)for(;b.length;)clearTimeout(b.shift());for(a in m)if(e=m[a])for(d in e)(b=e[d])&&b.drawState&&(c=b.image,c.attr({src:"",width:0,height:0}),k.push(c),delete b.image,c=b.canvas,h.push(c),delete b.canvas,delete b.ctx,c=b.lineImage)&&(c.attr({src:"",width:0,height:0}),g.push(c),delete b.lineImage,c=b.lineCanvas,l.push(c),delete b.lineCanvas,delete b.lineCtx);delete f._grid},_gridDraw:function(c){var b=this,a=b.graphics,d=b.config,e=b.chart.config.viewPortConfig;clearTimeout(d.timer);a.container.transform("t"+
K(-e.x*e.scaleX)+","+K(-e.y*e.scaleY));c?b._gridManager():d.timer=setTimeout(function(){b._gridManager()},10)},_gridManager:function(){var c,b,a,d,e,f,k,h,g,l=this,m=l.config,n=l.graphics._grid,t=m._drawGrid||(m._drawGrid=[]),q=l.chart,p=q.config,r=q.components;e=p.viewPortConfig;f=e.scaleX;var s=e.scaleY;k=Math.ceil(s);d=Math.ceil(f);var q=p.canvasWidth,p=p.canvasHeight,w=r.xAxis[0],u=r.yAxis[0],v=w.config,x=u.config,r=v.axisRange.min,v=v.axisRange.max,y=x.axisRange.min,x=x.axisRange.max,C=(v-r)/
f,A=(x-y)/s;b=m.radius*z(e.scaleX,e.scaleY)+m.plotCosmetics.borderWidth;w=S(b/(q*e.scaleX/(w.max-w.min)));u=S(b/(p*e.scaleY/(u.max-u.min)));b=q/f;g=p/s;c=z(1,b/10,g/10);var s={},G=[];f=e.x+c;b=e.x-c+b;h=e.y+c;c=e.y+g-c;e=l._getFocusedGrid(f,h);g=s[e.row]||(s[e.row]={});g[e.col]=!0;e=l._getFocusedGrid(b,h);g=s[e.row]||(s[e.row]={});g[e.col]=!0;e=l._getFocusedGrid(b,c);g=s[e.row]||(s[e.row]={});g[e.col]=!0;e=l._getFocusedGrid(f,c);g=s[e.row]||(s[e.row]={});g[e.col]=!0;f=l._getFocusedGrid();e=f.row;
f=f.col;b=B(e-1,0);e=z(e+1,k-1);k=B(f-1,0);f=z(f+1,d-1);d=x-b*A;for(h=b;h<=e;h+=1){n[h]||(n[h]={});b=r+k*C;for(g=k;g<=f;g+=1)c=n[h][g],c||(a=B(d-A,y),c=z(b+C,v),c=n[h][g]={xPixel:g*q,yPixel:h*p,xMinValue:b,yMinValue:a,xMaxValue:c,yMaxValue:d,drawState:0,xMinWPad:B(b-w,r),yMinWPad:B(a-u,y),xMaxWPad:z(c+w,v),yMaxWPad:z(d+u,x)}),c.drawState||(s[h]&&s[h][g]?t.push({row:h,col:g}):G.push({row:h,col:g})),b+=C;d-=A}(t.length||G.length)&&l._drawGridArr(function(){m._drawGrid=G;l._drawGridArr()})},_getFocusedGrid:function(c,
b){var a=this.chart.config,d=a.viewPortConfig,e=a.canvasWidth/d.scaleX,a=a.canvasHeight/d.scaleY,f=isNaN(c)?d.x+e/2:c,d=isNaN(b)?d.y+a/2:b;return{row:Z(d/a),col:Z(f/e)}},_drawGridArr:function(c){var b,a,d,e,f=this.chart,k=f.config,h=k.viewPortConfig,g=this.config,l=g.drawLine,m=g._drawGrid,n=[],t=this.graphics.container,f=f.components.paper,q=k.canvasWidth,k=k.canvasHeight,p=this.graphics._grid,r=this.graphics._imagePool||[],s=this.graphics._canvasPool||[],w=this.graphics._lineImagePool||[],u=this.graphics._lineCanvasPool||
[],v=g.plotCosmetics,h=g.radius*z(h.scaleX,h.scaleY);if(m.length){for(;m.length;)b=m.shift(),b=p[b.row][b.col],2!==b.drawState&&(b.drawState=2,l&&(b.lineImage=w.length?w.shift():f.image("",t),b.lineImage.attr({x:b.xPixel,y:b.yPixel,width:q,height:k}),b.lineCanvas=s.length?d=u.shift():d=P.document.createElement("canvas"),d.setAttribute("width",q),d.setAttribute("height",k),e=b.lineCtx=d.getContext("2d"),e.fillStyle=v.fillStyle,e.strokeStyle=v.lineStrokeStyle,e.lineWidth=v.lineWidth),b.image=r.length?
r.shift():f.image("",t),b.image.attr({x:b.xPixel,y:b.yPixel,width:q,height:k}),b.canvas=s.length?a=s.shift():a=P.document.createElement("canvas"),a.setAttribute("width",q),a.setAttribute("height",k),e=b.ctx=a.getContext("2d"),1>h?(e.strokeStyle=v.fillStyle,e.lineWidth=.5):(e.fillStyle=v.fillStyle,e.strokeStyle=v.strokeStyle,e.lineWidth=v.borderWidth),n.push(b));g._batchDrawindex=this.JSONData.data&&this.JSONData.data.length-1||0;this._drawGridArrBatch(n,c,!g.animation.enabled)}else c&&c()},_drawGridArrBatch:function(c,
b,a){var d,e,f,k,h,g,l,m,n,t,q,p,r,s,w,u,v=this;g=v.config;var x=v.chart.components;u=v.config;var z=u.drawLine;m=u.plotCosmetics;k=u._batchDrawindex;f=v.components.data;h=k-u.chunkSize;var y=x.yAxis[0],B=u.zoomedRadius,x=x.xAxis[0].getPVR(),y=y.getPVR(),C=g.showRegressionLine,A=u._store||[],D=m.lineWidth||1>B;C&&(s=g.regLineColor,w=g.regressionLineThickness);for(m=0;m<c.length;m+=1)c[m].ctx.beginPath(),z&&c[m].lineCtx.beginPath();for(h=0>=h?0:h;k>=h;--k)if((q=f[k]&&f[k].config.setValue)&&!isNaN(q.x)&&
!isNaN(q.y))for(m=0;m<c.length;m+=1)(d=c[m],p=d.xMinValue,r=d.yMaxValue,q.x<d.xMinWPad||q.x>d.xMaxWPad||q.y<d.yMinWPad||q.y>d.yMaxWPad||(n=d.ctx,t=d.lineCtx,d=K((q.x-p)*x),e=K((r-q.y)*y),(l=A[d])||(l=A[d]={}),l[e]))||(l[e]=!0,z&&(l=0<=k-1&&f[k-1].config.setValue)&&(t.moveTo(K((l.x-p)*x),K((r-l.y)*y)),t.lineTo(d,e)),1>B?(n.moveTo(d,e),n.lineTo(d+1,e)):(n.moveTo(d+B,e),n.arc(d,e,B,0,fa)));for(m=0;m<c.length;m+=1)d=c[m],n=d.ctx,n.fill(),D&&n.stroke(),n.closePath(),z&&(t=d.lineCtx,t.fill(),D&&t.stroke(),
t.closePath());u._batchDrawindex=k;if(0<=k){if(!a)for(m=0;m<c.length;m+=1)n=c[m].image,f=c[m].canvas,n.attr({src:f.toDataURL("image/png")}),u.drawLine&&(s=c[m].lineImage,w=c[m].lineCanvas,s.attr({src:w.toDataURL("image/png")}));(u._batchDarwTimers||(u._batchDarwTimers=[])).push(setTimeout(function(){v.chart&&v._drawGridArrBatch(c,b,a)},0))}else{delete u._store;if(C)for(u=g.regressionData,m=0;m<c.length;m+=1)d=c[m],k=d.xMinValue,g=d.yMaxValue,n=d.image,f=d.canvas,n=d.ctx,f=(u[0].x-k)*x,h=(g-u[0].y)*
y,k=(u[1].x-k)*x,g=(g-u[1].y)*y,n.beginPath(),n.strokeStyle=s,n.lineWidth=w,n.moveTo(f,h),n.lineTo(k,g),n.stroke(),n.closePath();for(m=0;m<c.length;m+=1)d=c[m],n=d.image,f=d.canvas,d.drawState=1,n.attr({src:f.toDataURL("image/png")}),z&&(s=d.lineImage,w=d.lineCanvas,s.attr({src:w.toDataURL("image/png")}));v.tree||setTimeout(function(){v._buildKdTree()},250);b&&b()}},_buildKdTree:function(){var c=this.config;c._kdPoints=(this.JSONData.data||[]).slice();this.components.kDTree||(this.components.kDTree=
new O);this.components.kDTree.buildKdTree(c._kdPoints);delete c._kdPoints},getElement:function(c){if(this.components.kDTree)return this.components.kDTree.getNeighbour(c)},show:function(){var c=this.graphics,c=c&&c.container;this.visible=!0;this._conatinerHidden=!1;c.show()},hide:function(){var c=this.graphics,c=c&&c.container;this.visible=!1;this._conatinerHidden=!0;c.hide()},_addLegend:function(){var c=this.chart,b=c.jsonData.chart,a=this.config,d=this.JSONData,e=c.getFillColor,f=y(d.anchorbordercolor,
b.anchorbordercolor),k=Q(y(f,a.plotBorderColor)),f=C(d.anchorborderthickness,b.anchorborderthickness,f?1:0),h=Q(y(d.anchorbgcolor,d.color,b.anchorbgcolor,a.plotColor)),g=y(d.anchoralpha,d.alpha,b.anchoralpha,T),b=y(d.anchorbgalpha,d.alpha,b.anchorbgalpha,T),d={color:a.lineColor,alpha:a.lineAlpha},e=a.plotCosmetics={fillStyle:e(h,g*b/100),strokeStyle:e(k,g),borderWidth:f,lineWidth:a.lineThickness,lineStrokeStyle:da(d)};this.legendItemId=c.components.legend.addItems(this,this.legendInteractivity,{enabled:a.includeInLegend,
type:this.type,fillColor:e.fillStyle,strokeColor:e.strokeStyle,anchorSide:2,strokeWidth:a.anchorBorderThickness,label:ca(this.JSONData.seriesname)})},_setConfigure:function(){var c,b,a,d,e,f,k,h,g,l=-Infinity,m=Infinity,n=Infinity,t=-Infinity,q=this.components.data||(this.components.data=[]);c=this.chart;var p=x.parseUnsafeString,r=this.config,s=this.JSONData,w=c.jsonData.chart,u=s.data||[],v=u.length,A=c.components.numberFormatter,D=p(w.yaxisname),E=p(w.xaxisname),K=r.lineDashed,G=r.lineDashStyle,
H=r.parentYAxis,I=r.toolTipSepChar,J=r.seriesname;for(c=0;c<v;c+=1)d=u[c],a=q[c]||(q[c]={}),b=a.config||(a.config={}),b.setValue=e={x:A.getCleanValue(d.x),y:A.getCleanValue(d.y),index:c},t=B(t,e.x),n=z(n,e.x),l=B(l,e.y),m=z(m,e.y),r.showRegressionLine&&this.pointValueWatcher(e.x,e.y,r.regressionObj),b.setLink=y(d.link),b.anchorProps=this._parseAnchorProperties(c),b.showValue=C(d.showvalue,r.showValues),b.dashed=C(d.dashed,K),b.color=y(d.color,r.lineColor),b.alpha=y(d.alpha,r.lineAlpha),b.dashStyle=
b.dashed?G:"none",b.toolTipValue=f=A.dataLabels(e.y,H),b.setDisplayValue=g=p(d.displayvalue),h=b.formatedVal=y(d.toolTipValue,A.dataLabels(e.y,H)),k=A.xAxis(e.x),b.displayValue=y(g,f),b.setTooltext=x.getValidValue(p(y(d.tooltext,r.plotToolText))),r.showTooltip?void 0!==b.setTooltext?(e=[4,5,6,7,8,9,10,11],k={yaxisName:D,xaxisName:E,yDataValue:h,xDataValue:k},d=V(b.setTooltext,e,k,d,w,s)):null===h?d=!1:(d=J?J+I:F,d+=e.x?k+I:F,d+=f):d=!1,b.toolText=d,a?a.graphics||(q[c].graphics={}):a=q[c]={graphics:{}},
b.hoverEffects=this._parseHoverEffectOptions(a),b.anchorProps.isAnchorHoverRadius=b.hoverEffects.anchorRadius;r.xMax=t;r.xMin=n;r.yMin=m;r.yMax=l;r.showRegressionLine&&(r.regressionData=this.getRegressionLineSeries(r.regressionObj,r.showYOnX,v));this.ErrorValueConfigure&&this.ErrorValueConfigure()}},"Scatter"]);$=function(c,b){return c.x-b.x};aa=function(c,b){return c.y-b.y};O.prototype={buildKdTree:function(c){this.tree=this._buildKdTree(c,!1)},getNeighbour:function(c){var b=this.tree,a={x1:c.x-
this.xLimit,x2:c.x+this.xLimit,y1:c.y-this.yLimit,y2:c.y+this.yLimit};c=this._getIsWithinLimitFn(c);if(b)return this._searchBtwnLimit(a,b,!1,c)},_getIsWithinLimitFn:function(c){var b=this;return function(a){return a&&1>=Math.pow((a.x-c.x)/b.xLimit,2)+Math.pow((a.y-c.y)/b.yLimit,2)?!0:!1}},_compair2closest:function(c,b){if(c){if(b)return b.i>c.i?b:c}else return b;return c},_searchBtwnLimit:function(c,b,a,d){var e,f,k,h;k=a?"x":"y";var g=a?c.x1:c.y1,l=a?c.x2:c.y2;if(b)return e=b.point1?b.point1[k]:
l,f=b.point2?b.point2[k]:l,k=b.point3?b.point3[k]:l,d(b.point1)&&(h=this._compair2closest(h,b.point1)),e>=g&&b.left&&(h=this._compair2closest(h,this._searchBtwnLimit(c,b.left,!a,d))),e<=l&&b.middle1&&(d(b.point2)&&(h=this._compair2closest(h,b.point2)),f>=g&&(h=this._compair2closest(h,this._searchBtwnLimit(c,b.middle1,!a,d))),f<=l&&b.middle2&&(d(b.point3)&&(h=this._compair2closest(h,b.point3)),k>=g&&(h=this._compair2closest(h,this._searchBtwnLimit(c,b.middle2,!a,d))),k<=l&&b.right&&(h=this._compair2closest(h,
this._searchBtwnLimit(c,b.right,!a,d))))),h},_buildKdTree:function(c,b){var a,d,e;if(a=c&&c.length)return c.sort(b?$:aa),7<a?(a=Math.floor(a/4),d=2*(a+1)-1,e=3*(a+1)-1,{left:this._buildKdTree(c.slice(0,a),!b),point1:c[a],middle1:this._buildKdTree(c.slice(a+1,d),!b),point2:c[d],middle2:this._buildKdTree(c.slice(d+1,e),!b),point3:c[e],right:this._buildKdTree(c.slice(e+1),!b)}):{left:2<=a?{point1:c[0]}:void 0,point1:1<=a?1===a?c[0]:c[1]:void 0,middle1:3<=a?{point1:c[2]}:void 0,point2:4<=a?c[3]:void 0,
middle2:5<=a?{point1:c[4]}:void 0,point3:6<=a?c[5]:void 0,right:7==a?{point1:c[6]}:void 0}},_setSearchLimit:function(c,b){this.xLimit=c;this.yLimit=b}};O.prototype.constructor=O;M.addSymbol({zoomInIcon:function(c,b,a){c-=.2*a;b-=.2*a;var d=.8*a,e=M.rad(43),f=M.rad(48),k=c+d*H(e),e=b+d*I(e),h=c+d*H(f),f=b+d*I(f),g=M.rad(45),l=k+a*H(g),m=e+a*I(g),n=h+a*H(g)-1;a=f+a*I(g)-1;return["M",k,e,"A",d,d,0,1,0,h,f,"Z","M",k+1,e+1,"L",l,m,n,a,h+1,f+1,"Z","M",c-2,b,"L",c+2,b,"Z","M",c,b-2,"L",c,b+2,"Z"]},zoomModeIcon:function(c,
b,a){var d=[];c-=.2*a;b-=.2*a;var e=.8*a,f=M.rad(43),k=M.rad(48),h=c+e*H(f),f=b+e*I(f),g=c+e*H(k),k=b+e*I(k),l=M.rad(45),m=h+a*H(l),n=f+a*I(l),t=g+a*H(l)-1;a=k+a*I(l)-1;return d=d.concat(["M",h,f,"A",e,e,0,1,0,g,k,"Z","M",h+1,f+1,"L",m,n,t,a,t+1,a-1,t+1.5,a+1.5,t-1,a+1,t,a,g+1,k+1,"Z","M",c-2,b,"L",c+2,b,"Z","M",c,b-2,"L",c,b+2,"Z"])},panModeIcon:function(c,b,a){var d=c-11.25,d=c;a*=2.5;return[].concat(["M",d-a/16,b-a/8,"L",d+a/16,b-a/8,"L",d+a/16,b-a/3.2,"L",d+6*a/32,b-10*a/32,"L",d,b-a/2,"L",d-
6*a/32,b-10*a/32,"L",d-a/16,b-a/3.2,"Z","M",d+4*a/32,b-2*a/32,"L",d+10*a/32,b-2*a/32,"L",d+10*a/32,b-6*a/32,"L",d+16*a/32,b,"L",d+10*a/32,b+6*a/32,"L",d+10*a/32,b+2*a/32,"L",d+4*a/32,b+2*a/32,"Z","M",d+2*a/32,b+5*a/32,"L",d+2*a/32,b+10*a/32,"L",d+6*a/32,b+10*a/32,"L",d,b+16*a/32,"L",d-6*a/32,b+10*a/32,"L",d-2*a/32,b+10*a/32,"L",d-2*a/32,b+5*a/32,"Z","M",d-4*a/32,b-2*a/32,"L",d-10*a/32,b-2*a/32,"L",d-10*a/32,b-6*a/32,"L",d-16*a/32,b,"L",d-10*a/32,b+6*a/32,"L",d-10*a/32,b+2*a/32,"L",d-4*a/32,b+2*a/
32,"Z"])}})}]);
