-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathd3-radial-axis.min.js
More file actions
2 lines (2 loc) · 26.8 KB
/
d3-radial-axis.min.js
File metadata and controls
2 lines (2 loc) · 26.8 KB
1
2
// Version 1.6.3 d3-radial-axis - https://github.com/vasturiano/d3-radial-axis#readme
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var n=Math.PI,i=2*n,e=i-1e-6;function r(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function o(){return new r}function a(t){return function(){return t}}function u(t){this._context=t}function s(t){return new u(t)}function h(t){return t[0]}function c(t){return t[1]}r.prototype=o.prototype={constructor:r,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,i,e){this._+="Q"+ +t+","+ +n+","+(this._x1=+i)+","+(this._y1=+e)},bezierCurveTo:function(t,n,i,e,r,o){this._+="C"+ +t+","+ +n+","+ +i+","+ +e+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(t,i,e,r,o){t=+t,i=+i,e=+e,r=+r,o=+o;var a=this._x1,u=this._y1,s=e-t,h=r-i,c=a-t,l=u-i,f=c*c+l*l;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=i);else if(f>1e-6)if(Math.abs(l*s-h*c)>1e-6&&o){var g=e-a,p=r-u,d=s*s+h*h,y=g*g+p*p,m=Math.sqrt(d),_=Math.sqrt(f),v=o*Math.tan((n-Math.acos((d+f-y)/(2*m*_)))/2),x=v/_,M=v/m;Math.abs(x-1)>1e-6&&(this._+="L"+(t+x*c)+","+(i+x*l)),this._+="A"+o+","+o+",0,0,"+ +(l*g>c*p)+","+(this._x1=t+M*s)+","+(this._y1=i+M*h)}else this._+="L"+(this._x1=t)+","+(this._y1=i);else;},arc:function(t,r,o,a,u,s){t=+t,r=+r,s=!!s;var h=(o=+o)*Math.cos(a),c=o*Math.sin(a),l=t+h,f=r+c,g=1^s,p=s?a-u:u-a;if(o<0)throw new Error("negative radius: "+o);null===this._x1?this._+="M"+l+","+f:(Math.abs(this._x1-l)>1e-6||Math.abs(this._y1-f)>1e-6)&&(this._+="L"+l+","+f),o&&(p<0&&(p=p%i+i),p>e?this._+="A"+o+","+o+",0,1,"+g+","+(t-h)+","+(r-c)+"A"+o+","+o+",0,1,"+g+","+(this._x1=l)+","+(this._y1=f):p>1e-6&&(this._+="A"+o+","+o+",0,"+ +(p>=n)+","+g+","+(this._x1=t+o*Math.cos(u))+","+(this._y1=r+o*Math.sin(u))))},rect:function(t,n,i,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +i+"v"+ +e+"h"+-i+"Z"},toString:function(){return this._}},u.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}};var l=g(s);function f(t){this._curve=t}function g(t){function n(n){return new f(t(n))}return n._curve=t,n}function p(){return t=function(){var t=h,n=c,i=a(!0),e=null,r=s,u=null;function l(a){var s,h,c,l=a.length,f=!1;for(null==e&&(u=r(c=o())),s=0;s<=l;++s)!(s<l&&i(h=a[s],s,a))===f&&((f=!f)?u.lineStart():u.lineEnd()),f&&u.point(+t(h,s,a),+n(h,s,a));if(c)return u=null,c+""||null}return l.x=function(n){return arguments.length?(t="function"==typeof n?n:a(+n),l):t},l.y=function(t){return arguments.length?(n="function"==typeof t?t:a(+t),l):n},l.defined=function(t){return arguments.length?(i="function"==typeof t?t:a(!!t),l):i},l.curve=function(t){return arguments.length?(r=t,null!=e&&(u=r(e)),l):r},l.context=function(t){return arguments.length?(null==t?e=u=null:u=r(e=t),l):e},l}().curve(l),n=t.curve,t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(g(t)):n()._curve},t;var t,n}function d(t){return t<0?-1:1}function y(t,n,i){var e=t._x1-t._x0,r=n-t._x1,o=(t._y1-t._y0)/(e||r<0&&-0),a=(i-t._y1)/(r||e<0&&-0),u=(o*r+a*e)/(e+r);return(d(o)+d(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function m(t,n){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-n)/2:n}function _(t,n,i){var e=t._x0,r=t._y0,o=t._x1,a=t._y1,u=(o-e)/3;t._context.bezierCurveTo(e+u,r+u*n,o-u,a-u*i,o,a)}function v(t){this._context=t}function x(t){this._context=t}function M(t){this._context=t}function b(t){var n,i,e=t.length-1,r=new Array(e),o=new Array(e),a=new Array(e);for(r[0]=0,o[0]=2,a[0]=t[0]+2*t[1],n=1;n<e-1;++n)r[n]=1,o[n]=4,a[n]=4*t[n]+2*t[n+1];for(r[e-1]=2,o[e-1]=7,a[e-1]=8*t[e-1]+t[e],n=1;n<e;++n)i=r[n]/o[n-1],o[n]-=i,a[n]-=i*a[n-1];for(r[e-1]=a[e-1]/o[e-1],n=e-2;n>=0;--n)r[n]=(a[n]-r[n+1])/o[n];for(o[e-1]=(t[e]+r[e-1])/2,n=0;n<e-1;++n)o[n]=2*t[n+1]-r[n+1];return[r,o]}function w(t){return new M(t)}function k(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}f.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}},v.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:_(this,this._t0,m(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var i=NaN;if(n=+n,(t=+t)!==this._x1||n!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,_(this,m(this,i=y(this,t,n)),i);break;default:_(this,this._t0,i=y(this,t,n))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=i}}},(function(t){this._context=new x(t)}.prototype=Object.create(v.prototype)).point=function(t,n){v.prototype.point.call(this,n,t)},x.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,i,e,r,o){this._context.bezierCurveTo(n,t,e,i,o,r)}},M.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,n=this._y,i=t.length;if(i)if(this._line?this._context.lineTo(t[0],n[0]):this._context.moveTo(t[0],n[0]),2===i)this._context.lineTo(t[1],n[1]);else for(var e=b(t),r=b(n),o=0,a=1;a<i;++o,++a)this._context.bezierCurveTo(e[0][o],r[0][o],e[1][o],r[1][o],t[a],n[a]);(this._line||0!==this._line&&1===i)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var N,A,E=(1===(N=k).length&&(A=N,N=function(t,n){return k(A(t),n)}),{left:function(t,n,i,e){for(null==i&&(i=0),null==e&&(e=t.length);i<e;){var r=i+e>>>1;N(t[r],n)<0?i=r+1:e=r}return i},right:function(t,n,i,e){for(null==i&&(i=0),null==e&&(e=t.length);i<e;){var r=i+e>>>1;N(t[r],n)>0?e=r:i=r+1}return i}}).right,S=Math.sqrt(50),T=Math.sqrt(10),j=Math.sqrt(2);function P(t,n,i){var e=(n-t)/Math.max(0,i),r=Math.floor(Math.log(e)/Math.LN10),o=e/Math.pow(10,r);return r>=0?(o>=S?10:o>=T?5:o>=j?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(o>=S?10:o>=T?5:o>=j?2:1)}function z(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}function q(t,n,i){t.prototype=n.prototype=i,i.constructor=t}function R(t,n){var i=Object.create(t.prototype);for(var e in n)i[e]=n[e];return i}function I(){}var $="\\s*([+-]?\\d+)\\s*",C="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",F="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",L=/^#([0-9a-f]{3,8})$/,O=new RegExp("^rgb\\("+[$,$,$]+"\\)$"),H=new RegExp("^rgb\\("+[F,F,F]+"\\)$"),Z=new RegExp("^rgba\\("+[$,$,$,C]+"\\)$"),D=new RegExp("^rgba\\("+[F,F,F,C]+"\\)$"),X=new RegExp("^hsl\\("+[C,F,F]+"\\)$"),G=new RegExp("^hsla\\("+[C,F,F,C]+"\\)$"),Q={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function U(){return this.rgb().formatHex()}function V(){return this.rgb().formatRgb()}function Y(t){var n,i;return t=(t+"").trim().toLowerCase(),(n=L.exec(t))?(i=n[1].length,n=parseInt(n[1],16),6===i?B(n):3===i?new W(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===i?new W(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===i?new W(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=O.exec(t))?new W(n[1],n[2],n[3],1):(n=H.exec(t))?new W(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Z.exec(t))?J(n[1],n[2],n[3],n[4]):(n=D.exec(t))?J(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=X.exec(t))?et(n[1],n[2]/100,n[3]/100,1):(n=G.exec(t))?et(n[1],n[2]/100,n[3]/100,n[4]):Q.hasOwnProperty(t)?B(Q[t]):"transparent"===t?new W(NaN,NaN,NaN,0):null}function B(t){return new W(t>>16&255,t>>8&255,255&t,1)}function J(t,n,i,e){return e<=0&&(t=n=i=NaN),new W(t,n,i,e)}function K(t,n,i,e){return 1===arguments.length?((r=t)instanceof I||(r=Y(r)),r?new W((r=r.rgb()).r,r.g,r.b,r.opacity):new W):new W(t,n,i,null==e?1:e);var r}function W(t,n,i,e){this.r=+t,this.g=+n,this.b=+i,this.opacity=+e}function tt(){return"#"+it(this.r)+it(this.g)+it(this.b)}function nt(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function it(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function et(t,n,i,e){return e<=0?t=n=i=NaN:i<=0||i>=1?t=n=NaN:n<=0&&(t=NaN),new ot(t,n,i,e)}function rt(t){if(t instanceof ot)return new ot(t.h,t.s,t.l,t.opacity);if(t instanceof I||(t=Y(t)),!t)return new ot;if(t instanceof ot)return t;var n=(t=t.rgb()).r/255,i=t.g/255,e=t.b/255,r=Math.min(n,i,e),o=Math.max(n,i,e),a=NaN,u=o-r,s=(o+r)/2;return u?(a=n===o?(i-e)/u+6*(i<e):i===o?(e-n)/u+2:(n-i)/u+4,u/=s<.5?o+r:2-o-r,a*=60):u=s>0&&s<1?0:a,new ot(a,u,s,t.opacity)}function ot(t,n,i,e){this.h=+t,this.s=+n,this.l=+i,this.opacity=+e}function at(t,n,i){return 255*(t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n)}function ut(t){return function(){return t}}function st(t){return 1==(t=+t)?ht:function(n,i){return i-n?function(t,n,i){return t=Math.pow(t,i),n=Math.pow(n,i)-t,i=1/i,function(e){return Math.pow(t+e*n,i)}}(n,i,t):ut(isNaN(n)?i:n)}}function ht(t,n){var i=n-t;return i?function(t,n){return function(i){return t+i*n}}(t,i):ut(isNaN(t)?n:t)}q(I,Y,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:U,formatHex:U,formatHsl:function(){return rt(this).formatHsl()},formatRgb:V,toString:V}),q(W,K,R(I,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new W(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new W(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:tt,formatHex:tt,formatRgb:nt,toString:nt})),q(ot,(function(t,n,i,e){return 1===arguments.length?rt(t):new ot(t,n,i,null==e?1:e)}),R(I,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new ot(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new ot(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,e=i+(i<.5?i:1-i)*n,r=2*i-e;return new W(at(t>=240?t-240:t+120,r,e),at(t,r,e),at(t<120?t+240:t-120,r,e),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var ct=function t(n){var i=st(n);function e(t,n){var e=i((t=K(t)).r,(n=K(n)).r),r=i(t.g,n.g),o=i(t.b,n.b),a=ht(t.opacity,n.opacity);return function(n){return t.r=e(n),t.g=r(n),t.b=o(n),t.opacity=a(n),t+""}}return e.gamma=t,e}(1);function lt(t,n){var i,e=n?n.length:0,r=t?Math.min(e,t.length):0,o=new Array(r),a=new Array(e);for(i=0;i<r;++i)o[i]=_t(t[i],n[i]);for(;i<e;++i)a[i]=n[i];return function(t){for(i=0;i<r;++i)a[i]=o[i](t);return a}}function ft(t,n){var i=new Date;return n-=t=+t,function(e){return i.setTime(t+n*e),i}}function gt(t,n){return n-=t=+t,function(i){return t+n*i}}function pt(t,n){var i,e={},r={};for(i in null!==t&&"object"==typeof t||(t={}),null!==n&&"object"==typeof n||(n={}),n)i in t?e[i]=_t(t[i],n[i]):r[i]=n[i];return function(t){for(i in e)r[i]=e[i](t);return r}}var dt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,yt=new RegExp(dt.source,"g");function mt(t,n){var i,e,r,o=dt.lastIndex=yt.lastIndex=0,a=-1,u=[],s=[];for(t+="",n+="";(i=dt.exec(t))&&(e=yt.exec(n));)(r=e.index)>o&&(r=n.slice(o,r),u[a]?u[a]+=r:u[++a]=r),(i=i[0])===(e=e[0])?u[a]?u[a]+=e:u[++a]=e:(u[++a]=null,s.push({i:a,x:gt(i,e)})),o=yt.lastIndex;return o<n.length&&(r=n.slice(o),u[a]?u[a]+=r:u[++a]=r),u.length<2?s[0]?function(t){return function(n){return t(n)+""}}(s[0].x):function(t){return function(){return t}}(n):(n=s.length,function(t){for(var i,e=0;e<n;++e)u[(i=s[e]).i]=i.x(t);return u.join("")})}function _t(t,n){var i,e=typeof n;return null==n||"boolean"===e?ut(n):("number"===e?gt:"string"===e?(i=Y(n))?(n=i,ct):mt:n instanceof Y?ct:n instanceof Date?ft:Array.isArray(n)?lt:"function"!=typeof n.valueOf&&"function"!=typeof n.toString||isNaN(n)?pt:gt)(t,n)}function vt(t,n){return n-=t=+t,function(i){return Math.round(t+n*i)}}function xt(t){return+t}var Mt=[0,1];function bt(t){return t}function wt(t,n){return(n-=t=+t)?function(i){return(i-t)/n}:function(t){return function(){return t}}(isNaN(n)?NaN:.5)}function kt(t,n,i){var e=t[0],r=t[1],o=n[0],a=n[1];return r<e?(e=wt(r,e),o=i(a,o)):(e=wt(e,r),o=i(o,a)),function(t){return o(e(t))}}function Nt(t,n,i){var e=Math.min(t.length,n.length)-1,r=new Array(e),o=new Array(e),a=-1;for(t[e]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++a<e;)r[a]=wt(t[a],t[a+1]),o[a]=i(n[a],n[a+1]);return function(n){var i=E(t,n,1,e)-1;return o[i](r[i](n))}}function At(){var t,n,i,e,r,o,a=Mt,u=Mt,s=_t,h=bt;function c(){var t,n,i,s=Math.min(a.length,u.length);return h!==bt&&(t=a[0],n=a[s-1],t>n&&(i=t,t=n,n=i),h=function(i){return Math.max(t,Math.min(n,i))}),e=s>2?Nt:kt,r=o=null,l}function l(n){return isNaN(n=+n)?i:(r||(r=e(a.map(t),u,s)))(t(h(n)))}return l.invert=function(i){return h(n((o||(o=e(u,a.map(t),gt)))(i)))},l.domain=function(t){return arguments.length?(a=Array.from(t,xt),c()):a.slice()},l.range=function(t){return arguments.length?(u=Array.from(t),c()):u.slice()},l.rangeRound=function(t){return u=Array.from(t),s=vt,c()},l.clamp=function(t){return arguments.length?(h=!!t||bt,c()):h!==bt},l.interpolate=function(t){return arguments.length?(s=t,c()):s},l.unknown=function(t){return arguments.length?(i=t,l):i},function(i,e){return t=i,n=e,c()}}function Et(t,n){if((i=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var i,e=t.slice(0,i);return[e.length>1?e[0]+e.slice(2):e,+t.slice(i+1)]}function St(t){return(t=Et(Math.abs(t)))?t[1]:NaN}var Tt,jt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Pt(t){if(!(n=jt.exec(t)))throw new Error("invalid format: "+t);var n;return new zt({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}function zt(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function qt(t,n){var i=Et(t,n);if(!i)return t+"";var e=i[0],r=i[1];return r<0?"0."+new Array(-r).join("0")+e:e.length>r+1?e.slice(0,r+1)+"."+e.slice(r+1):e+new Array(r-e.length+2).join("0")}Pt.prototype=zt.prototype,zt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Rt={"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return qt(100*t,n)},r:qt,s:function(t,n){var i=Et(t,n);if(!i)return t+"";var e=i[0],r=i[1],o=r-(Tt=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,a=e.length;return o===a?e:o>a?e+new Array(o-a+1).join("0"):o>0?e.slice(0,o)+"."+e.slice(o):"0."+new Array(1-o).join("0")+Et(t,Math.max(0,n+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function It(t){return t}var $t,Ct,Ft,Lt=Array.prototype.map,Ot=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ht(t){var n,i,e=void 0===t.grouping||void 0===t.thousands?It:(n=Lt.call(t.grouping,Number),i=t.thousands+"",function(t,e){for(var r=t.length,o=[],a=0,u=n[0],s=0;r>0&&u>0&&(s+u+1>e&&(u=Math.max(1,e-s)),o.push(t.substring(r-=u,r+u)),!((s+=u+1)>e));)u=n[a=(a+1)%n.length];return o.reverse().join(i)}),r=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?It:function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(Lt.call(t.numerals,String)),s=void 0===t.percent?"%":t.percent+"",h=void 0===t.minus?"-":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function l(t){var n=(t=Pt(t)).fill,i=t.align,l=t.sign,f=t.symbol,g=t.zero,p=t.width,d=t.comma,y=t.precision,m=t.trim,_=t.type;"n"===_?(d=!0,_="g"):Rt[_]||(void 0===y&&(y=12),m=!0,_="g"),(g||"0"===n&&"="===i)&&(g=!0,n="0",i="=");var v="$"===f?r:"#"===f&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",x="$"===f?o:/[%p]/.test(_)?s:"",M=Rt[_],b=/[defgprs%]/.test(_);function w(t){var r,o,s,f=v,w=x;if("c"===_)w=M(t)+w,t="";else{var k=(t=+t)<0;if(t=isNaN(t)?c:M(Math.abs(t),y),m&&(t=function(t){t:for(var n,i=t.length,e=1,r=-1;e<i;++e)switch(t[e]){case".":r=n=e;break;case"0":0===r&&(r=e),n=e;break;default:if(r>0){if(!+t[e])break t;r=0}}return r>0?t.slice(0,r)+t.slice(n+1):t}(t)),k&&0==+t&&(k=!1),f=(k?"("===l?l:h:"-"===l||"("===l?"":l)+f,w=("s"===_?Ot[8+Tt/3]:"")+w+(k&&"("===l?")":""),b)for(r=-1,o=t.length;++r<o;)if(48>(s=t.charCodeAt(r))||s>57){w=(46===s?a+t.slice(r+1):t.slice(r))+w,t=t.slice(0,r);break}}d&&!g&&(t=e(t,1/0));var N=f.length+t.length+w.length,A=N<p?new Array(p-N+1).join(n):"";switch(d&&g&&(t=e(A+t,A.length?p-w.length:1/0),A=""),i){case"<":t=f+t+w+A;break;case"=":t=f+A+t+w;break;case"^":t=A.slice(0,N=A.length>>1)+f+t+w+A.slice(N);break;default:t=A+f+t+w}return u(t)}return y=void 0===y?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),w.toString=function(){return t+""},w}return{format:l,formatPrefix:function(t,n){var i=l(((t=Pt(t)).type="f",t)),e=3*Math.max(-8,Math.min(8,Math.floor(St(n)/3))),r=Math.pow(10,-e),o=Ot[8+e/3];return function(t){return i(r*t)+o}}}}function Zt(t,n,i,e){var r,o=function(t,n,i){var e=Math.abs(n-t)/Math.max(0,i),r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),o=e/r;return o>=S?r*=10:o>=T?r*=5:o>=j&&(r*=2),n<t?-r:r}(t,n,i);switch((e=Pt(null==e?",f":e)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(n));return null!=e.precision||isNaN(r=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(St(n)/3)))-St(Math.abs(t)))}(o,a))||(e.precision=r),Ft(e,a);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(r=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,St(n)-St(t))+1}(o,Math.max(Math.abs(t),Math.abs(n))))||(e.precision=r-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(r=function(t){return Math.max(0,-St(Math.abs(t)))}(o))||(e.precision=r-2*("%"===e.type))}return Ct(e)}function Dt(t){var n=t.domain;return t.ticks=function(t){var i=n();return function(t,n,i){var e,r,o,a,u=-1;if(i=+i,(t=+t)===(n=+n)&&i>0)return[t];if((e=n<t)&&(r=t,t=n,n=r),0===(a=P(t,n,i))||!isFinite(a))return[];if(a>0)for(t=Math.ceil(t/a),n=Math.floor(n/a),o=new Array(r=Math.ceil(n-t+1));++u<r;)o[u]=(t+u)*a;else for(t=Math.floor(t*a),n=Math.ceil(n*a),o=new Array(r=Math.ceil(t-n+1));++u<r;)o[u]=(t-u)/a;return e&&o.reverse(),o}(i[0],i[i.length-1],null==t?10:t)},t.tickFormat=function(t,i){var e=n();return Zt(e[0],e[e.length-1],null==t?10:t,i)},t.nice=function(i){null==i&&(i=10);var e,r=n(),o=0,a=r.length-1,u=r[o],s=r[a];return s<u&&(e=u,u=s,s=e,e=o,o=a,a=e),(e=P(u,s,i))>0?e=P(u=Math.floor(u/e)*e,s=Math.ceil(s/e)*e,i):e<0&&(e=P(u=Math.ceil(u*e)/e,s=Math.floor(s*e)/e,i)),e>0?(r[o]=Math.floor(u/e)*e,r[a]=Math.ceil(s/e)*e,n(r)):e<0&&(r[o]=Math.ceil(u*e)/e,r[a]=Math.floor(s*e)/e,n(r)),t},t}function Xt(){var t=At()(bt,bt);return t.copy=function(){return n=t,Xt().domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown());var n},z.apply(t,arguments),Dt(t)}function Gt(t){return t}function Qt(t,n){return"translate("+t+","+n+")"}function Ut(t){var n=t.bandwidth()/2;return t.round()&&(n=Math.round(n)),function(i){return t(i)+n}}function Vt(){return!this.__axis}function Yt(t,n,i,e){var r=[],o=null,a=null,u=6,s=6,h=12;function c(t,n){return Qt.apply(Qt,l(t,n))}function l(t,n){return[Math.sin(t)*n,-Math.cos(t)*n]}function f(f){var g=void 0!==i&&n!==i;i=g?i:n;var d=null==o?t.ticks?t.ticks.apply(t,r):t.domain():o,y=null==a?t.tickFormat?t.tickFormat.apply(t,r):Gt:a,m=Math.max(u,0)+h,_=t.copy().range([n,i]),v=t.range(),x=(t.bandwidth?Ut:Gt)(t.copy()),M=f.selection?f.selection():f,b=M.selectAll(".domain").data([null]),k=M.selectAll(".tick").data(d,t).order(),N=k.exit(),A=k.enter().append("g").attr("class","tick"),E=k.select("line"),S=k.select("text");function T(t,n){return"M"+l(t,n+s*(e?1:-1)).join(",")+"L"+l(t,n).join(",")}b=b.merge(b.enter().insert("path",".tick").attr("class","domain").attr("stroke","#000")),k=k.merge(A),E=E.merge(A.append("line").attr("stroke","#000")),S=S.merge(A.append("text").attr("fill","#000").attr("dy",".35em").attr("text-anchor","middle")),f!==M&&(b=b.transition(f),k=k.transition(f),E=E.transition(f),S=S.transition(f),N=N.transition(f).attr("opacity",0).attr("transform",(function(t){return isFinite(x(t))?c(x(t),_(t)):this.getAttribute("transform")})),A.attr("opacity",0).attr("transform",(function(t){var n=this.parentNode.__axis;return c(n&&isFinite(n=n(t))?n:x(t),_(t))}))),N.remove(),b.attr("d",(g?function(t,n,i,e){var r=(n-t)/(2*Math.PI)*40,o=p().angle(Xt().range([t,n])).radius(Xt().range([i,e])).curve(w);return"M"+l(t,i).join(",")+o(Xt().ticks(r))}:function(t,n,i){return"M"+l(t,i).join(",")+(Math.abs(n-t)>=2*Math.PI?"A"+[i,i,0,1,1].concat(l(t+Math.PI,i)).join(",")+"A"+[i,i,0,1,1].concat(l(t,i)).join(","):"")+"A"+[i,i,0,Math.abs(n-t)%(2*Math.PI)>Math.PI?1:0,n>t?1:0].concat(l(n,i)).join(",")})(v[0],v[1],n,i)+T(v[0],n)+T(v[1],i)),k.attr("opacity",1).attr("transform",(function(t){return c(x(t),_(t))})),E.attr("x1",0).attr("y1",0).attr("x2",(function(t){return l(x(t),u)[0]*(e?1:-1)})).attr("y2",(function(t){return l(x(t),u)[1]*(e?1:-1)})),S.attr("x",(function(t){return l(x(t),m)[0]*(e?1:-1)})).attr("y",(function(t){return l(x(t),m)[1]*(e?1:-1)})).text(y),M.filter(Vt).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif"),M.each((function(){this.__axis=x}))}return f.angleScale=function(n){return arguments.length?(t=n,f):t},f.radius=function(t){return arguments.length?(n=i=+t,f):n},f.startRadius=function(t){return arguments.length?(n=+t,f):n},f.endRadius=function(t){return arguments.length?(i=+t,f):i},f.ticks=function(){return r=Array.prototype.slice.call(arguments),f},f.tickArguments=function(t){return arguments.length?(r=null==t?[]:Array.prototype.slice.call(t),f):r.slice()},f.tickValues=function(t){return arguments.length?(o=null==t?null:Array.prototype.slice.call(t),f):o&&o.slice()},f.tickFormat=function(t){return arguments.length?(a=t,f):a},f.tickSize=function(t){return arguments.length?(u=s=+t,f):u},f.tickSizeInner=function(t){return arguments.length?(u=+t,f):u},f.tickSizeOuter=function(t){return arguments.length?(s=+t,f):s},f.tickPadding=function(t){return arguments.length?(h=+t,f):h},f}$t=Ht({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),Ct=$t.format,Ft=$t.formatPrefix,t.axisRadialInner=function(t,n,i){return Yt(t,n,i,!1)},t.axisRadialOuter=function(t,n,i){return Yt(t,n,i,!0)},Object.defineProperty(t,"__esModule",{value:!0})}));