text: nv.models.scatterChart=function(){"use strict";function t(I){return I.each(function(I){function W(){if(S)return J.select(".nv-point-paths").style("pointer-events","all"),!1;J.select(".nv-point-paths").style("pointer-events","none");var t=d3.mouse(this);f.distortion(D).focus(t[0]),p.distortion(D).focus(t[1]),J.select(".nv-scatterWrap").call(n),y&&J.select(".nv-x.nv-axis").call(e),b&&J.select(".nv-y.nv-axis").call(i),J.select(".nv-distributionX").datum(I.filter(function(t){return!t.disabled})).call(s),J.select(".nv-distributionY").datum(I.filter(function(t){return!t.disabled})).call(r)}var A=d3.select(this),T=this,N=(c||parseInt(A.style("width"))||960)-l.left-l.right,V=(d||parseInt(A.style("height"))||400)-l.top-l.bottom;if(t.update=function(){A.transition().duration(L).call(t)},t.container=this,z.disabled=I.map(function(t){return!!t.disabled}),!Y){var E;Y={};for(E in z)Y[E]=z[E]instanceof Array?z[E].slice(0):z[E]}if(!(I&&I.length&&I.filter(function(t){return t.values.length}).length)){var j=A.selectAll(".nv-noData").data([F]);return j.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),j.attr("x",l.left+N/2).attr("y",l.top+V/2).text(function(t){return t}),t}A.selectAll(".nv-noData").remove(),P=P||f,R=R||p;var q=A.selectAll("g.nv-wrap.nv-scatterChart").data([I]),B=q.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+n.id()),G=B.append("g"),J=q.select("g");if(G.append("rect").attr("class","nvd3 nv-background"),G.append("g").attr("class","nv-x nv-axis"),G.append("g").attr("class","nv-y nv-axis"),G.append("g").attr("class","nv-scatterWrap"),G.append("g").attr("class","nv-distWrap"),G.append("g").attr("class","nv-legendWrap"),G.append("g").attr("class","nv-controlsWrap"),x){var K=w?N/2:N;o.width(K),q.select(".nv-legendWrap").datum(I).call(o),l.top!=o.height()&&(l.top=o.height(),V=(d||parseInt(A.style("height"))||400)-l.top-l.bottom),q.select(".nv-legendWrap").attr("transform","translate("+(N-K)+","+-l.top+")")}if(w&&(a.width(180).color(["#444"]),J.select(".nv-controlsWrap").datum(M).attr("transform","translate(0,"+-l.top+")").call(a)),q.attr("transform","translate("+l.left+","+l.top+")"),k&&J.select(".nv-y.nv-axis").attr("transform","translate("+N+",0)"),n.width(N).height(V).color(I.map(function(t,n){return t.color||u(t,n)}).filter(function(t,n){return!I[n].disabled})),0!==g&&n.xDomain(null),0!==h&&n.yDomain(null),q.select(".nv-scatterWrap").datum(I.filter(function(t){return!t.disabled})).call(n),0!==g){var O=f.domain()[1]-f.domain()[0];n.xDomain([f.domain()[0]-g*O,f.domain()[1]+g*O])}if(0!==h){var Q=p.domain()[1]-p.domain()[0];n.yDomain([p.domain()[0]-h*Q,p.domain()[1]+h*Q])}(0!==h||0!==g)&&q.select(".nv-scatterWrap").datum(I.filter(function(t){return!t.disabled})).call(n),y&&(e.scale(f).ticks(e.ticks()&&e.ticks().length?e.ticks():N/100).tickSize(-V,0),J.select(".nv-x.nv-axis").attr("transform","translate(0,"+p.range()[0]+")").call(e)),b&&(i.scale(p).ticks(i.ticks()&&i.ticks().length?i.ticks():V/36).tickSize(-N,0),J.select(".nv-y.nv-axis").call(i)),v&&(s.getData(n.x()).scale(f).width(N).color(I.map(function(t,n){return t.color||u(t,n)}).filter(function(t,n){return!I[n].disabled})),G.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),J.select(".nv-distributionX").attr("transform","translate(0,"+p.range()[0]+")").datum(I.filter(function(t){return!t.disabled})).call(s)),m&&(r.getData(n.y()).scale(p).width(V).color(I.map(function(t,n){return t.color||u(t,n)}).filter(function(t,n){return!I[n].disabled})),G.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),J.select(".nv-distributionY").attr("transform","translate("+(k?N:-r.size())+",0)").datum(I.filter(function(t){return!t.disabled})).call(r)),d3.fisheye&&(J.select(".nv-background").attr("width",N).attr("height",V),J.select(".nv-background").on("mousemove",W),J.select(".nv-background").on("click",function(){S=!S}),n.dispatch.on("elementClick.freezeFisheye",function(){S=!S})),a.dispatch.on("legendClick",function(o){o.disabled=!o.disabled,D=o.disabled?0:2.5,J.select(".nv-background").style("pointer-events",o.disabled?"none":"all"),J.select(".nv-point-paths").style("pointer-events",o.disabled?"all":"none"),o.disabled?(f.distortion(D).focus(0),p.distortion(D).focus(0),J.select(".nv-scatterWrap").call(n),J.select(".nv-x.nv-axis").call(e),J.select(".nv-y.nv-axis").call(i)):S=!1,t.update()}),o.dispatch.on("stateChange",function(n){z.disabled=n.disabled,X.stateChange(z),t.update()}),n.dispatch.on("elementMouseover.tooltip",function(t){d3.select(".nv-chart-"+n.id()+" .nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",function(){return t.pos[1]-V}),d3.select(".nv-chart-"+n.id()+" .nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",t.pos[0]+s.size()),t.pos=[t.pos[0]+l.left,t.pos[1]+l.top],X.tooltipShow(t)}),X.on("tooltipShow",function(t){C&&H(t,T.parentNode)}),X.on("changeState",function(n){"undefined"!=typeof n.disabled&&(I.forEach(function(t,e){t.disabled=n.disabled[e]}),z.disabled=n.disabled),t.update()}),P=f.copy(),R=p.copy()}),t}var n=nv.models.scatter(),e=nv.models.axis(),i=nv.models.axis(),o=nv.models.legend(),a=nv.models.legend(),s=nv.models.distribution(),r=nv.models.distribution(),l={top:30,right:20,bottom:50,left:75},c=null,d=null,u=nv.utils.defaultColor(),f=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):n.xScale(),p=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):n.yScale(),g=0,h=0,v=!1,m=!1,x=!0,y=!0,b=!0,k=!1,w=!!d3.fisheye,D=0,S=!1,C=!0,I=function(t,n){return"<strong>"+n+"</strong>"},W=function(t,n,e){return"<strong>"+e+"</strong>"},A=null,z={},Y=null,X=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),F="No Data Available.",L=250;n.xScale(f).yScale(p),e.orient("bottom").tickPadding(10),i.orient(k?"right":"left").tickPadding(10),s.axis("x"),r.axis("y"),a.updateState(!1);var P,R,H=function(o,a){var s=o.pos[0]+(a.offsetLeft||0),r=o.pos[1]+(a.offsetTop||0),c=o.pos[0]+(a.offsetLeft||0),d=p.range()[0]+l.top+(a.offsetTop||0),u=f.range()[0]+l.left+(a.offsetLeft||0),g=o.pos[1]+(a.offsetTop||0),h=e.tickFormat()(n.x()(o.point,o.pointIndex)),v=i.tickFormat()(n.y()(o.point,o.pointIndex));null!=I&&nv.tooltip.show([c,d],I(o.series.key,h,v,o,t),"n",1,a,"x-nvtooltip"),null!=W&&nv.tooltip.show([u,g],W(o.series.key,h,v,o,t),"e",1,a,"y-nvtooltip"),null!=A&&nv.tooltip.show([s,r],A(o.series.key,h,v,o,t),o.value<0?"n":"s",null,a)},M=[{key:"Magnify",disabled:!0}];return n.dispatch.on("elementMouseout.tooltip",function(t){X.tooltipHide(t),d3.select(".nv-chart-"+n.id()+" .nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",0),d3.select(".nv-chart-"+n.id()+" .nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",r.size())}),X.on("tooltipHide",function(){C&&nv.tooltip.cleanup()}),t.dispatch=X,t.scatter=n,t.legend=o,t.controls=a,t.xAxis=e,t.yAxis=i,t.distX=s,t.distY=r,d3.rebind(t,n,"id","interactive","pointActive","x","y","shape","size","xScale","yScale","zScale","xDomain","yDomain","xRange","yRange","sizeDomain","sizeRange","forceX","forceY","forceSize","clipVoronoi","clipRadius","useVoronoi"),t.options=nv.utils.optionsFunc.bind(t),t.margin=function(n){return arguments.length?(l.top="undefined"!=typeof n.top?n.top:l.top,l.right="undefined"!=typeof n.right?n.right:l.right,l.bottom="undefined"!=typeof n.bottom?n.bottom:l.bottom,l.left="undefined"!=typeof n.left?n.left:l.left,t):l},t.width=function(n){return arguments.length?(c=n,t):c},t.height=function(n){return arguments.length?(d=n,t):d},t.color=function(n){return arguments.length?(u=nv.utils.getColor(n),o.color(u),s.color(u),r.color(u),t):u},t.showDistX=function(n){return arguments.length?(v=n,t):v},t.showDistY=function(n){return arguments.length?(m=n,t):m},t.showControls=function(n){return arguments.length?(w=n,t):w},t.showLegend=function(n){return arguments.length?(x=n,t):x},t.showXAxis=function(n){return arguments.length?(y=n,t):y},t.showYAxis=function(n){return arguments.length?(b=n,t):b},t.rightAlignYAxis=function(n){return arguments.length?(k=n,i.orient(n?"right":"left"),t):k},t.fisheye=function(n){return arguments.length?(D=n,t):D},t.xPadding=function(n){return arguments.length?(g=n,t):g},t.yPadding=function(n){return arguments.length?(h=n,t):h},t.tooltips=function(n){return arguments.length?(C=n,t):C},t.tooltipContent=function(n){return arguments.length?(A=n,t):A},t.tooltipXContent=function(n){return arguments.length?(I=n,t):I},t.tooltipYContent=function(n){return arguments.length?(W=n,t):W},t.state=function(n){return arguments.length?(z=n,t):z},t.defaultState=function(n){return arguments.length?(Y=n,t):Y},t.noData=function(n){return arguments.length?(F=n,t):F},t.transitionDuration=function(n){return arguments.length?(L=n,t):L},t};