!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define("contour_plot",["exports"],e):e(t.contour_plot={})}(this,function(t){"use strict";function e(t,e,n,r){r=r||{};var o=r.maxIterations||100,a=r.tolerance||1e-10,i=t(e),l=t(n),s=n-e;if(i*l>0)throw"Initial bisect points must have opposite signs";if(0===i)return e;if(0===l)return n;for(var u=0;u=0&&(e=f),Math.abs(s)o[1]||la[1])&&t(n.invert(i),r.invert(l))=i[1]||h<=l[0]||h>=l[1])){for(var v=s(h),p={maxIterations:9},g=.5;g<=3;g+=.5){if(s(h-g)*v<0)h=e(s,h,h-g,p);else if(u(d-g)*v<0)d=e(u,d,d-g,p);else if(s(h+g)*v<0)h=e(s,h,h+g,p);else{if(!(u(d+g)*v<0))continue;d=e(u,d,d+g,p)}break}c[0]=d,c[1]=h}}}function i(t,e,n,r){var o,a,i,l=e.range(),s=n.range();o=a=t(e.invert(l[0]),n.invert(s[0]));for(var u=s[0];uf(x,y) = "+o.toFixed(2))}).on("mouseout",function(){v.transition().duration(400).style("opacity",0),v.style("z-index",-1)});var g=s(n,h,d,i,a),y=g.paths,x=(g.levels,d3.line().x(function(t){return t[0]}).y(function(t){return t[1]}).curve(d3.curveLinearClosed).defined(function(t){return t})),m=p.append("g");if(m.selectAll("path").data(y).enter().append("path").attr("d",x).style("fill",function(t,e){return l(e)}).style("stroke-width",1.5).style("stroke","white").on("mouseover",function(){d3.select(this).style("stroke-width","4")}).on("mouseout",function(){d3.select(this).style("stroke-width","1.5")}),e){var b=d3.axisBottom().scale(h),M=d3.axisLeft().scale(d);p.append("g").attr("class","axis").attr("transform","translate(0,"+(f-1*c)+")").call(b),p.append("g").attr("class","axis").attr("transform","translate("+c+",0)").call(M)}return{xScale:h,yScale:d,svg:p}}var e=!1,n=function(t,e){return(1-t)*(1-t)+100*(e-t*t)*(e-t*t)},r=[3,-3],o=[-2,2],a=null,i=14,l=d3.scaleLinear().domain([0,i]).range(["white",d3.schemeCategory10[0]]);return t.drawAxis=function(n){return arguments.length?(e=n,t):e},t.xDomain=function(e){return arguments.length?(o=e,t):o},t.yDomain=function(e){return arguments.length?(r=e,t):r},t.colourScale=function(e){return arguments.length?(l=e,t):l},t.contourCount=function(e){return arguments.length?(i=e,t):i},t.minima=function(e){return arguments.length?(a=e,t):a},t.f=function(e){return arguments.length?(n=e,t):n},t}var f=[1,0,1,1,-1,0,-1,1,0,0,0,0,-1,0,-1,NaN],c=[0,-1,0,0,0,-1,0,0,1,-1,1,1,0,-1,0,NaN],d="0.0.1";t.version=d,t.isoline=o,t.smoothPoints=a,t.getLogLevels=i,t.getContours=s,t.ContourPlot=u});