diff --git a/inst/js/third-party/d3-4.11.0.min.js b/inst/js/d3-modules/d3-4.11.0.min.js similarity index 100% rename from inst/js/third-party/d3-4.11.0.min.js rename to inst/js/d3-modules/d3-4.11.0.min.js diff --git a/inst/js/d3-modules/d3-array.v1.min.js b/inst/js/d3-modules/d3-array.v1.min.js new file mode 100644 index 0000000..508c424 --- /dev/null +++ b/inst/js/d3-modules/d3-array.v1.min.js @@ -0,0 +1,2 @@ +// https://d3js.org/d3-array/ Version 1.2.1. Copyright 2017 Mike Bostock. +!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(n.d3=n.d3||{})}(this,function(n){"use strict";function r(n){return function(r,t){return f(n(r),t)}}function t(n,r){return[n,r]}function e(n,r,t){var e=(r-n)/Math.max(0,t),o=Math.floor(Math.log(e)/Math.LN10),u=e/Math.pow(10,o);return o>=0?(u>=b?10:u>=q?5:u>=L?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(u>=b?10:u>=q?5:u>=L?2:1)}function o(n,r,t){var e=Math.abs(r-n)/Math.max(0,t),o=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),u=e/o;return u>=b?o*=10:u>=q?o*=5:u>=L&&(o*=2),rr?1:n>=r?0:NaN},l=function(n){return 1===n.length&&(n=r(n)),{left:function(r,t,e,o){for(null==e&&(e=0),null==o&&(o=r.length);e>>1;n(r[u],t)<0?e=u+1:o=u}return e},right:function(r,t,e,o){for(null==e&&(e=0),null==o&&(o=r.length);e>>1;n(r[u],t)>0?o=u:e=u+1}return e}}},i=l(f),a=i.right,h=i.left,c=function(n,r){null==r&&(r=t);for(var e=0,o=n.length-1,u=n[0],f=new Array(o<0?0:o);en?1:r>=n?0:NaN},M=function(n){return null===n?NaN:+n},v=function(n,r){var t,e,o=n.length,u=0,f=-1,l=0,i=0;if(null==r)for(;++f1)return i/(u-1)},p=function(n,r){var t=v(n,r);return t?Math.sqrt(t):t},d=function(n,r){var t,e,o,u=n.length,f=-1;if(null==r){for(;++f=t)for(e=o=t;++ft&&(e=t),o=t)for(e=o=t;++ft&&(e=t),o0)return[n];if((o=r0)for(n=Math.ceil(n/l),r=Math.floor(r/l),f=new Array(u=Math.ceil(r-n+1));++is;)g.pop(),--M;var v,p=new Array(M+1);for(u=0;u<=M;++u)v=p[u]=[],v.x0=u>0?g[u-1]:c,v.x1=u=1)return+t(n[e-1],e-1,n);var e,o=(e-1)*r,u=Math.floor(o),f=+t(n[u],u,n);return f+(+t(n[u+1],u+1,n)-f)*(o-u)}},_=function(n,r,t){return n=m.call(n,M).sort(f),Math.ceil((t-r)/(2*(F(n,.75)-F(n,.25))*Math.pow(n.length,-1/3)))},z=function(n,r,t){return Math.ceil((t-r)/(3.5*p(n)*Math.pow(n.length,-1/3)))},D=function(n,r){var t,e,o=n.length,u=-1;if(null==r){for(;++u=t)for(e=t;++ue&&(e=t)}else for(;++u=t)for(e=t;++ue&&(e=t);return e},I=function(n,r){var t,e=n.length,o=e,u=-1,f=0;if(null==r)for(;++u=0;)for(e=n[o],r=e.length;--r>=0;)t[--f]=e[r];return t},R=function(n,r){var t,e,o=n.length,u=-1;if(null==r){for(;++u=t)for(e=t;++ut&&(e=t)}else for(;++u=t)for(e=t;++ut&&(e=t);return e},B=function(n,r){for(var t=r.length,e=new Array(t);t--;)e[t]=n[r[t]];return e},C=function(n,r){if(t=n.length){var t,e,o=0,u=0,l=n[u];for(null==r&&(r=f);++o=a.length)return null!=s&&t.sort(s),null!=f?f(t):t;for(var o,c,h,l=-1,v=t.length,p=a[r++],y=e(),d=i();++la.length)return n;var r,i=h[e-1];return null!=f&&e>=a.length?r=n.entries():(r=[],n.each(function(n,i){r.push({key:i,values:t(n,e)})})),null!=i?r.sort(function(n,t){return i(n.key,t.key)}):r}var s,f,c,a=[],h=[];return c={object:function(t){return n(t,0,r,i)},map:function(t){return n(t,0,u,o)},entries:function(e){return t(n(e,0,u,o),0)},key:function(n){return a.push(n),c},sortKeys:function(n){return h[a.length-1]=n,c},sortValues:function(n){return s=n,c},rollup:function(n){return f=n,c}}},n.set=f,n.map=e,n.keys=function(n){var t=[];for(var e in n)t.push(e);return t},n.values=function(n){var t=[];for(var e in n)t.push(n[e]);return t},n.entries=function(n){var t=[];for(var e in n)t.push({key:e,value:n[e]});return t},Object.defineProperty(n,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/inst/js/d3-modules/d3-color.v1.min.js b/inst/js/d3-modules/d3-color.v1.min.js new file mode 100644 index 0000000..69b30ca --- /dev/null +++ b/inst/js/d3-modules/d3-color.v1.min.js @@ -0,0 +1,2 @@ +// https://d3js.org/d3-color/ Version 1.2.0. Copyright 2018 Mike Bostock. +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.d3=t.d3||{})}(this,function(t){"use strict";function e(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function n(){}function i(t){var e;return t=(t+"").trim().toLowerCase(),(e=_.exec(t))?(e=parseInt(e[1],16),new o(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1)):(e=z.exec(t))?r(parseInt(e[1],16)):(e=C.exec(t))?new o(e[1],e[2],e[3],1):(e=L.exec(t))?new o(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=A.exec(t))?a(e[1],e[2],e[3],e[4]):(e=B.exec(t))?a(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=D.exec(t))?u(e[1],e[2]/100,e[3]/100,1):(e=F.exec(t))?u(e[1],e[2]/100,e[3]/100,e[4]):G.hasOwnProperty(t)?r(G[t]):"transparent"===t?new o(NaN,NaN,NaN,0):null}function r(t){return new o(t>>16&255,t>>8&255,255&t,1)}function a(t,e,n,i){return i<=0&&(t=e=n=NaN),new o(t,e,n,i)}function h(t){return t instanceof n||(t=i(t)),t?(t=t.rgb(),new o(t.r,t.g,t.b,t.opacity)):new o}function s(t,e,n,i){return 1===arguments.length?h(t):new o(t,e,n,null==i?1:i)}function o(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function l(t){return t=Math.max(0,Math.min(255,Math.round(t)||0)),(t<16?"0":"")+t.toString(16)}function u(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new d(t,e,n,i)}function c(t){if(t instanceof d)return new d(t.h,t.s,t.l,t.opacity);if(t instanceof n||(t=i(t)),!t)return new d;if(t instanceof d)return t;t=t.rgb();var e=t.r/255,r=t.g/255,a=t.b/255,h=Math.min(e,r,a),s=Math.max(e,r,a),o=NaN,l=s-h,u=(s+h)/2;return l?(o=e===s?(r-a)/l+6*(r0&&u<1?0:o,new d(o,l,u,t.opacity)}function g(t,e,n,i){return 1===arguments.length?c(t):new d(t,e,n,null==i?1:i)}function d(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function p(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function f(t){if(t instanceof w)return new w(t.l,t.a,t.b,t.opacity);if(t instanceof E){if(isNaN(t.h))return new w(t.l,0,0,t.opacity);var e=t.h*H;return new w(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof o||(t=h(t));var n,i,r=M(t.r),a=M(t.g),s=M(t.b),l=m((.2225045*r+.7168786*a+.0606169*s)/Q);return r===a&&a===s?n=i=l:(n=m((.4360747*r+.3850649*a+.1430804*s)/K),i=m((.0139322*r+.0971045*a+.7141733*s)/T)),new w(116*l-16,500*(n-l),200*(l-i),t.opacity)}function b(t,e){return new w(t,0,0,null==e?1:e)}function y(t,e,n,i){return 1===arguments.length?f(t):new w(t,e,n,null==i?1:i)}function w(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function m(t){return t>X?Math.pow(t,1/3):t/W+U}function k(t){return t>V?t*t*t:W*(t-U)}function N(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function M(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function v(t){if(t instanceof E)return new E(t.h,t.c,t.l,t.opacity);if(t instanceof w||(t=f(t)),0===t.a&&0===t.b)return new E(NaN,0,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*J;return new E(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function x(t,e,n,i){return 1===arguments.length?v(t):new E(n,e,t,null==i?1:i)}function q(t,e,n,i){return 1===arguments.length?v(t):new E(t,e,n,null==i?1:i)}function E(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}function $(t){if(t instanceof j)return new j(t.h,t.s,t.l,t.opacity);t instanceof o||(t=h(t));var e=t.r/255,n=t.g/255,i=t.b/255,r=(at*i+it*e-rt*n)/(at+it-rt),a=i-r,s=(nt*(n-r)-tt*a)/et,l=Math.sqrt(s*s+a*a)/(nt*r*(1-r)),u=l?Math.atan2(s,a)*J-120:NaN;return new j(u<0?u+360:u,l,r,t.opacity)}function R(t,e,n,i){return 1===arguments.length?$(t):new j(t,e,n,null==i?1:i)}function j(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}var I=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t},P="\\s*([+-]?\\d+)\\s*",O="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",S="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",_=/^#([0-9a-f]{3})$/,z=/^#([0-9a-f]{6})$/,C=new RegExp("^rgb\\("+[P,P,P]+"\\)$"),L=new RegExp("^rgb\\("+[S,S,S]+"\\)$"),A=new RegExp("^rgba\\("+[P,P,P,O]+"\\)$"),B=new RegExp("^rgba\\("+[S,S,S,O]+"\\)$"),D=new RegExp("^hsl\\("+[O,S,S]+"\\)$"),F=new RegExp("^hsla\\("+[O,S,S,O]+"\\)$"),G={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};I(n,i,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),I(o,s,e(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new o(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new o(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+l(this.r)+l(this.g)+l(this.b)},toString:function(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(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+")")}})),I(d,g,e(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new d(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new d(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new o(p(t>=240?t-240:t+120,r,i),p(t,r,i),p(t<120?t+240:t-120,r,i),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}}));var H=Math.PI/180,J=180/Math.PI,K=.96422,Q=1,T=.82521,U=4/29,V=6/29,W=3*V*V,X=V*V*V;I(w,y,e(n,{brighter:function(t){return new w(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new w(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=K*k(e),t=Q*k(t),n=T*k(n),new o(N(3.1338561*e-1.6168667*t-.4906146*n),N(-.9787684*e+1.9161415*t+.033454*n),N(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),I(E,q,e(n,{brighter:function(t){return new E(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new E(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return f(this).rgb()}}));var Y=-.14861,Z=1.78277,tt=-.29227,et=-.90649,nt=1.97294,it=nt*et,rt=nt*Z,at=Z*tt-et*Y;I(j,R,e(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new j(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new j(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*H,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),i=Math.cos(t),r=Math.sin(t);return new o(255*(e+n*(Y*i+Z*r)),255*(e+n*(tt*i+et*r)),255*(e+n*(nt*i)),this.opacity)}})),t.color=i,t.rgb=s,t.hsl=g,t.lab=y,t.hcl=q,t.lch=x,t.gray=b,t.cubehelix=R,Object.defineProperty(t,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/inst/js/d3-modules/d3-dispatch.v1.min.js b/inst/js/d3-modules/d3-dispatch.v1.min.js new file mode 100644 index 0000000..f4100b4 --- /dev/null +++ b/inst/js/d3-modules/d3-dispatch.v1.min.js @@ -0,0 +1,2 @@ +// https://d3js.org/d3-dispatch/ Version 1.0.3. Copyright 2017 Mike Bostock. +!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(n.d3=n.d3||{})}(this,function(n){"use strict";function e(){for(var n,e=0,r=arguments.length,o={};e=0&&(t=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:t}})}function o(n,e){for(var t,r=0,o=n.length;r0)for(var t,r,o=new Array(t),i=0;iP}q.mouse("drag")}function v(){n.select(n.event.view).on("mousemove.drag mouseup.drag",null),i(n.event.view,x),l(),q.mouse("end")}function g(){if(j.apply(this,arguments)){var t,e,i=n.event.changedTouches,r=k.apply(this,arguments),c=i.length;for(t=0;t=s?m=!0:(c=r.charCodeAt(d++))===u?v=!0:c===a&&(v=!0,r.charCodeAt(d)===u&&++d),r.slice(i+1,n-1).replace(/""/g,'"')}for(;d",this.sign=n[3]||"-",this.symbol=n[4]||"",this.zero=!!n[5],this.width=n[6]&&+n[6],this.comma=!!n[7],this.precision=n[8]&&+n[8].slice(1),this.trim=!!n[9],this.type=n[10]||""}function e(n){return f=M(n),t.format=f.format,t.formatPrefix=f.formatPrefix,f}var i=function(t,n){if((r=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var r,e=t.slice(0,r);return[e.length>1?e[0]+e.slice(2):e,+t.slice(r+1)]},o=function(t){return t=i(Math.abs(t)),t?t[1]:NaN},a=function(t,n){return function(r,e){for(var i=r.length,o=[],a=0,u=t[0],s=0;i>0&&u>0&&(s+u+1>e&&(u=Math.max(1,e-s)),o.push(r.substring(i-=u,i+u)),!((s+=u+1)>e));)u=t[a=(a+1)%t.length];return o.reverse().join(n)}},u=function(t){return function(n){return n.replace(/[0-9]/g,function(n){return t[+n]})}},s=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;n.prototype=r.prototype,r.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var c,f,h=function(t){t:for(var n,r=t.length,e=1,i=-1;e0){if(!+t[e])break t;i=0}}return i>0?t.slice(0,i)+t.slice(n+1):t},l=function(t,n){var r=i(t,n);if(!r)return t+"";var e=r[0],o=r[1],a=o-(c=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,u=e.length;return a===u?e:a>u?e+new Array(a-u+1).join("0"):a>0?e.slice(0,a)+"."+e.slice(a):"0."+new Array(1-a).join("0")+i(t,Math.max(0,n+a-1))[0]},m=function(t,n){var r=i(t,n);if(!r)return t+"";var e=r[0],o=r[1];return o<0?"0."+new Array(-o).join("0")+e:e.length>o+1?e.slice(0,o+1)+"."+e.slice(o+1):e+new Array(o-e.length+2).join("0")},p={"%":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 m(100*t,n)},r:m,s:l,X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},g=function(t){return t},d=["y","z","a","f","p","n","ยต","m","","k","M","G","T","P","E","Z","Y"],M=function(t){function r(t){function r(t){var n,r,u,s=w,m=j;if("c"===v)m=k(t)+m,t="";else{t=+t;var p=t<0;if(t=k(Math.abs(t),y),b&&(t=h(t)),p&&0==+t&&(p=!1),s=(p?"("===a?a:"-":"-"===a||"("===a?"":a)+s,m=("s"===v?d[8+c/3]:"")+m+(p&&"("===a?")":""),S)for(n=-1,r=t.length;++n(u=t.charCodeAt(n))||u>57){m=(46===u?f+t.slice(n+1):t.slice(n))+m,t=t.slice(0,n);break}}x&&!g&&(t=i(t,1/0));var P=s.length+t.length+m.length,A=P>1)+s+t+m+A.slice(P);break;default:t=A+s+t+m}return l(t)}t=n(t);var e=t.fill,o=t.align,a=t.sign,u=t.symbol,g=t.zero,M=t.width,x=t.comma,y=t.precision,b=t.trim,v=t.type;"n"===v?(x=!0,v="g"):p[v]||(null==y&&(y=12),b=!0,v="g"),(g||"0"===e&&"="===o)&&(g=!0,e="0",o="=");var w="$"===u?s[0]:"#"===u&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",j="$"===u?s[1]:/[%p]/.test(v)?m:"",k=p[v],S=/[defgprs%]/.test(v);return y=null==y?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),r.toString=function(){return t+""},r}function e(t,e){var i=r((t=n(t),t.type="f",t)),a=3*Math.max(-8,Math.min(8,Math.floor(o(e)/3))),u=Math.pow(10,-a),s=d[8+a/3];return function(t){return i(u*t)+s}}var i=t.grouping&&t.thousands?a(t.grouping,t.thousands):g,s=t.currency,f=t.decimal,l=t.numerals?u(t.numerals):g,m=t.percent||"%";return{format:r,formatPrefix:e}};e({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var x=function(t){return Math.max(0,-o(Math.abs(t)))},y=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(o(n)/3)))-o(Math.abs(t)))},b=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,o(n)-o(t))+1};t.formatDefaultLocale=e,t.formatLocale=M,t.formatSpecifier=n,t.precisionFixed=x,t.precisionPrefix=y,t.precisionRound=b,Object.defineProperty(t,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/inst/js/d3-modules/d3-geo.v1.min.js b/inst/js/d3-modules/d3-geo.v1.min.js new file mode 100644 index 0000000..a148a3c --- /dev/null +++ b/inst/js/d3-modules/d3-geo.v1.min.js @@ -0,0 +1,2 @@ +// https://d3js.org/d3-geo/ Version 1.10.0. Copyright 2018 Mike Bostock. +!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-array"],t):t(n.d3=n.d3||{},n.d3)}(this,function(n,t){"use strict";function r(){return new i}function i(){this.reset()}function e(n,t,r){var i=n.s=t+r,e=i-t,o=i-e;n.t=t-o+(r-e)}function o(n){return n>1?0:n<-1?nr:Math.acos(n)}function u(n){return n>1?tr:n<-1?-tr:Math.asin(n)}function c(n){return(n=gr(n/2))*n}function a(){}function l(n,t){n&&Sr.hasOwnProperty(n.type)&&Sr[n.type](n,t)}function f(n,t,r){var i,e=-1,o=n.length-r;for(t.lineStart();++e=0?1:-1,e=i*r,o=lr(t),u=gr(t),c=Nt*u,a=_t*o+c*lr(e),l=c*i*gr(e);mr.add(ar(l,a)),xt=n,_t=o,Nt=u}function E(n){return[ar(n[1],n[0]),u(n[2])]}function y(n){var t=n[0],r=n[1],i=lr(r);return[i*lr(t),i*gr(t),gr(r)]}function S(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function m(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function M(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function x(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function _(n){var t=dr(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function N(n,t){bt.push(Lt=[wt=n,Pt=n]),tRt&&(Rt=t)}function w(n,t){var r=y([n*or,t*or]);if(zt){var i=m(zt,r),e=m([i[1],-i[0],0],i);_(e),e=E(e);var o,u=n-At,c=u>0?1:-1,a=e[0]*er*c,l=ur(u)>180;l^(c*AtRt&&(Rt=o):(a=(a+360)%360-180,l^(c*AtRt&&(Rt=t))),l?nq(wt,Pt)&&(Pt=n):q(n,Pt)>q(wt,Pt)&&(wt=n):Pt>=wt?(nPt&&(Pt=n)):n>At?q(wt,n)>q(wt,Pt)&&(Pt=n):q(n,Pt)>q(wt,Pt)&&(wt=n)}else bt.push(Lt=[wt=n,Pt=n]);tRt&&(Rt=t),zt=r,At=n}function C(){Nr.point=w}function P(){Lt[0]=wt,Lt[1]=Pt,Nr.point=N,zt=null}function R(n,t){if(zt){var r=n-At;_r.add(ur(r)>180?r+(r>0?360:-360):r)}else jt=n,qt=t;xr.point(n,t),w(n,t)}function A(){xr.lineStart()}function j(){R(jt,qt),xr.lineEnd(),ur(_r)>Vt&&(wt=-(Pt=180)),Lt[0]=wt,Lt[1]=Pt,zt=null}function q(n,t){return(t-=n)<0?t+360:t}function z(n,t){return n[0]-t[0]}function b(n,t){return n[0]<=n[1]?n[0]<=t&&t<=n[1]:tnr?n-ir:n<-nr?n+ir:n,t]}function Y(n,t,r){return(n%=ir)?t||r?U(J(n),K(t,r)):J(n):t||r?K(t,r):X}function Z(n){return function(t,r){return t+=n,[t>nr?t-ir:t<-nr?t+ir:t,r]}}function J(n){var t=Z(n);return t.invert=Z(-n),t}function K(n,t){function r(n,t){var r=lr(t),a=lr(n)*r,l=gr(n)*r,f=gr(t),s=f*i+a*e;return[ar(l*o-s*c,a*i-f*e),u(s*o+l*c)]}var i=lr(n),e=gr(n),o=lr(t),c=gr(t);return r.invert=function(n,t){var r=lr(t),a=lr(n)*r,l=gr(n)*r,f=gr(t),s=f*o-l*c;return[ar(l*o+f*c,a*i+s*e),u(s*i-a*e)]},r}function Q(n){function t(t){return t=n(t[0]*or,t[1]*or),t[0]*=er,t[1]*=er,t}return n=Y(n[0]*or,n[1]*or,n.length>2?n[2]*or:0),t.invert=function(t){return t=n.invert(t[0]*or,t[1]*or),t[0]*=er,t[1]*=er,t},t}function V(n,t,r,i,e,o){if(r){var u=lr(t),c=gr(t),a=i*r;null==e?(e=t+i*ir,o=t-a/2):(e=$(u,e),o=$(u,o),(i>0?eo)&&(e+=i*ir));for(var l,f=e;i>0?f>o:f1&&t.push(t.pop().concat(t.shift()))},result:function(){var r=t;return t=[],n=null,r}}}function tn(n,t){return ur(n[0]-t[0])=0;--o)e.point((f=l[o])[0],f[1]);else i(p.x,p.p.x,-1,e);p=p.p}l=(p=p.o).z,h=!h}while(!p.v);e.lineEnd()}}}function on(n){if(t=n.length){for(var t,r,i=0,e=n[0];++i=0?1:-1,A=R*P,j=A>nr,q=d*w;if(Tr.add(ar(q*R*gr(A),E*C+q*lr(A))),c+=j?P+R*ir:P,j^g>=r^x>=r){var z=m(y(h),y(M));_(z);var b=m(o,z);_(b);var L=(j^P>=0?-1:1)*u(b[2]);(i>L||i===L&&(z[0]||z[1]))&&(a+=j^P>=0?1:-1)}}return(c<-Vt||c0){for(S||(o.polygonStart(),S=!0),o.lineStart(),n=0;n1&&2&e&&u.push(u.pop().concat(u.shift())),g.push(u.filter(an))}var h,g,v,d=r(o),E=nn(),y=r(E),S=!1,m={point:u,lineStart:a,lineEnd:l,polygonStart:function(){m.point=f,m.lineStart=s,m.lineEnd=p,g=[],h=[]},polygonEnd:function(){m.point=u,m.lineStart=a,m.lineEnd=l,g=t.merge(g);var n=un(h,e);g.length?(S||(o.polygonStart(),S=!0),en(g,ln,n,i,o)):n&&(S||(o.polygonStart(),S=!0),o.lineStart(),i(null,null,1,o),o.lineEnd()),S&&(o.polygonEnd(),S=!1),g=h=null},sphere:function(){o.polygonStart(),o.lineStart(),i(null,null,1,o),o.lineEnd(),o.polygonEnd()}};return m}}function an(n){return n.length>1}function ln(n,t){return((n=n.x)[0]<0?n[1]-tr-Vt:tr-n[1])-((t=t.x)[0]<0?t[1]-tr-Vt:tr-t[1])}function fn(n){function t(n,t){return lr(n)*lr(t)>e}function r(n,t,r){var i=[1,0,0],o=m(y(n),y(t)),u=S(o,o),c=o[0],a=u-c*c;if(!a)return!r&&n;var l=e*u/a,f=-e*c/a,s=m(i,o),p=x(i,l);M(p,x(o,f));var h=s,g=S(p,h),v=S(h,h),d=g*g-v*(S(p,p)-1);if(!(d<0)){var _=dr(d),N=x(h,(-g-_)/v);if(M(N,p),N=E(N),!r)return N;var w,C=n[0],P=t[0],R=n[1],A=t[1];P0^N[1]<(ur(N[0]-C)nr^(C<=N[0]&&N[0]<=P)){var z=x(h,(-g+_)/v);return M(z,p),[N,E(z)]}}}function i(t,r){var i=u?n:nr-n,e=0;return t<-i?e|=1:t>i&&(e|=2),r<-i?e|=4:r>i&&(e|=8),e}var e=lr(n),o=6*or,u=e>0,c=ur(e)>Vt;return cn(t,function(n){var e,o,a,l,f;return{lineStart:function(){l=a=!1,f=1},point:function(s,p){var h,g=[s,p],v=t(s,p),d=u?v?0:i(s,p):v?i(s+(s<0?nr:-nr),p):0;if(!e&&(l=a=v)&&n.lineStart(),v!==a&&(!(h=r(e,g))||tn(e,h)||tn(g,h))&&(g[0]+=Vt,g[1]+=Vt,v=t(g[0],g[1])),v!==a)f=0,v?(n.lineStart(),h=r(g,e),n.point(h[0],h[1])):(h=r(e,g),n.point(h[0],h[1]),n.lineEnd()),e=h;else if(c&&e&&u^v){var E;d&o||!(E=r(g,e,!0))||(f=0,u?(n.lineStart(),n.point(E[0][0],E[0][1]),n.point(E[1][0],E[1][1]),n.lineEnd()):(n.point(E[1][0],E[1][1]),n.lineEnd(),n.lineStart(),n.point(E[0][0],E[0][1])))}!v||e&&tn(e,g)||n.point(g[0],g[1]),e=g,a=v,o=d},lineEnd:function(){a&&n.lineEnd(),e=null},clean:function(){return f|(l&&a)<<1}}},function(t,r,i,e){V(e,n,o,i,t,r)},u?[0,-n]:[-nr,n-nr])}function sn(n,r,i,e){function o(t,o){return n<=t&&t<=i&&r<=o&&o<=e}function u(t,o,u,a){var f=0,s=0;if(null==t||(f=c(t,u))!==(s=c(o,u))||l(t,o)<0^u>0)do{a.point(0===f||3===f?n:i,f>1?e:r)}while((f=(f+u+4)%4)!==s);else a.point(o[0],o[1])}function c(t,e){return ur(t[0]-n)0?0:3:ur(t[0]-i)0?2:1:ur(t[1]-r)0?1:0:e>0?3:2}function a(n,t){return l(n.x,t.x)}function l(n,t){var r=c(n,1),i=c(t,1);return r!==i?r-i:0===r?t[1]-n[1]:1===r?n[0]-t[0]:2===r?n[1]-t[1]:t[0]-n[0]}return function(c){function l(n,t){o(n,t)&&x.point(n,t)}function f(t,u){var c=o(t,u);if(p&&h.push([t,u]),m)g=t,v=u,d=c,m=!1,c&&(x.lineStart(),x.point(t,u));else if(c&&S)x.point(t,u);else{var a=[E=Math.max(Hr,Math.min(Fr,E)),y=Math.max(Hr,Math.min(Fr,y))],l=[t=Math.max(Hr,Math.min(Fr,t)),u=Math.max(Hr,Math.min(Fr,u))];!function(n,t,r,i,e,o){var u,c=n[0],a=n[1],l=0,f=1,s=t[0]-c,p=t[1]-a;if(u=r-c,s||!(u>0)){if(u/=s,s<0){if(u0){if(u>f)return;u>l&&(l=u)}if(u=e-c,s||!(u<0)){if(u/=s,s<0){if(u>f)return;u>l&&(l=u)}else if(s>0){if(u0)){if(u/=p,p<0){if(u0){if(u>f)return;u>l&&(l=u)}if(u=o-a,p||!(u<0)){if(u/=p,p<0){if(u>f)return;u>l&&(l=u)}else if(p>0){if(u0&&(n[0]=c+l*s,n[1]=a+l*p),f<1&&(t[0]=c+f*s,t[1]=a+f*p),!0}}}}}(a,l,n,r,i,e)?c&&(x.lineStart(),x.point(t,u),M=!1):(S||(x.lineStart(),x.point(a[0],a[1])),x.point(l[0],l[1]),c||x.lineEnd(),M=!1)}E=t,y=u,S=c}var s,p,h,g,v,d,E,y,S,m,M,x=c,_=nn(),N={point:l,lineStart:function(){N.point=f,p&&p.push(h=[]),m=!0,S=!1,E=y=NaN},lineEnd:function(){s&&(f(g,v),d&&S&&_.rejoin(),s.push(_.result())),N.point=l,S&&x.lineEnd()},polygonStart:function(){x=_,s=[],p=[],M=!0},polygonEnd:function(){var r=function(){for(var t=0,r=0,i=p.length;re&&(s-o)*(e-u)>(h-u)*(n-o)&&++t:h<=e&&(s-o)*(e-u)<(h-u)*(n-o)&&--t;return t}(),i=M&&r,o=(s=t.merge(s)).length;(i||o)&&(c.polygonStart(),i&&(c.lineStart(),u(null,null,1,c),c.lineEnd()),o&&en(s,a,r,u,c),c.polygonEnd()),x=c,s=p=h=null}};return N}}function pn(){Wr.point=Wr.lineEnd=a}function hn(n,t){Cr=n*=or,Pr=gr(t*=or),Rr=lr(t),Wr.point=gn}function gn(n,t){n*=or;var r=gr(t*=or),i=lr(t),e=ur(n-Cr),o=lr(e),u=i*gr(e),c=Rr*r-Pr*i*o,a=Pr*r+Rr*i*o;Ir.add(ar(dr(u*u+c*c),a)),Cr=n,Pr=r,Rr=i}function vn(n){return Ir.reset(),p(n,Wr),+Ir}function dn(n,t){return Br[0]=n,Br[1]=t,vn(Dr)}function En(n,t){return!(!n||!Xr.hasOwnProperty(n.type))&&Xr[n.type](n,t)}function yn(n,t){return 0===dn(n,t)}function Sn(n,t){var r=dn(n[0],n[1]);return dn(n[0],t)+dn(t,n[1])<=r+Vt}function mn(n,t){return!!un(n.map(Mn),xn(t))}function Mn(n){return(n=n.map(xn)).pop(),n}function xn(n){return[n[0]*or,n[1]*or]}function _n(n,r,i){var e=t.range(n,r-Vt,i).concat(r);return function(n){return e.map(function(t){return[n,t]})}}function Nn(n,r,i){var e=t.range(n,r-Vt,i).concat(r);return function(n){return e.map(function(t){return[t,n]})}}function wn(){function n(){return{type:"MultiLineString",coordinates:r()}}function r(){return t.range(fr(u/E)*E,o,E).map(h).concat(t.range(fr(f/y)*y,l,y).map(g)).concat(t.range(fr(e/v)*v,i,v).filter(function(n){return ur(n%E)>Vt}).map(s)).concat(t.range(fr(a/d)*d,c,d).filter(function(n){return ur(n%y)>Vt}).map(p))}var i,e,o,u,c,a,l,f,s,p,h,g,v=10,d=v,E=90,y=360,S=2.5;return n.lines=function(){return r().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(u).concat(g(l).slice(1),h(o).reverse().slice(1),g(f).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.extentMajor(t).extentMinor(t):n.extentMinor()},n.extentMajor=function(t){return arguments.length?(u=+t[0][0],o=+t[1][0],f=+t[0][1],l=+t[1][1],u>o&&(t=u,u=o,o=t),f>l&&(t=f,f=l,l=t),n.precision(S)):[[u,f],[o,l]]},n.extentMinor=function(t){return arguments.length?(e=+t[0][0],i=+t[1][0],a=+t[0][1],c=+t[1][1],e>i&&(t=e,e=i,i=t),a>c&&(t=a,a=c,c=t),n.precision(S)):[[e,a],[i,c]]},n.step=function(t){return arguments.length?n.stepMajor(t).stepMinor(t):n.stepMinor()},n.stepMajor=function(t){return arguments.length?(E=+t[0],y=+t[1],n):[E,y]},n.stepMinor=function(t){return arguments.length?(v=+t[0],d=+t[1],n):[v,d]},n.precision=function(t){return arguments.length?(S=+t,s=_n(a,c,90),p=Nn(e,i,S),h=_n(f,l,90),g=Nn(u,o,S),n):S},n.extentMajor([[-180,-90+Vt],[180,90-Vt]]).extentMinor([[-180,-80-Vt],[180,80+Vt]])}function Cn(n){return n}function Pn(){Jr.point=Rn}function Rn(n,t){Jr.point=An,Ar=qr=n,jr=zr=t}function An(n,t){Zr.add(zr*n-qr*t),qr=n,zr=t}function jn(){An(Ar,jr)}function qn(n,t){ti+=n,ri+=t,++ii}function zn(){fi.point=bn}function bn(n,t){fi.point=Ln,qn(Or=n,Gr=t)}function Ln(n,t){var r=n-Or,i=t-Gr,e=dr(r*r+i*i);ei+=e*(Or+n)/2,oi+=e*(Gr+t)/2,ui+=e,qn(Or=n,Gr=t)}function On(){fi.point=qn}function Gn(){fi.point=kn}function Tn(){Fn(br,Lr)}function kn(n,t){fi.point=Fn,qn(br=Or=n,Lr=Gr=t)}function Fn(n,t){var r=n-Or,i=t-Gr,e=dr(r*r+i*i);ei+=e*(Or+n)/2,oi+=e*(Gr+t)/2,ui+=e,ci+=(e=Gr*n-Or*t)*(Or+n),ai+=e*(Gr+t),li+=3*e,qn(Or=n,Gr=t)}function Hn(n){this._context=n}function In(n,t){Ei.point=Wn,pi=gi=n,hi=vi=t}function Wn(n,t){gi-=n,vi-=t,di.add(dr(gi*gi+vi*vi)),gi=n,vi=t}function Bn(){this._string=[]}function Dn(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Un(n){return function(t){var r=new Xn;for(var i in n)r[i]=n[i];return r.stream=t,r}}function Xn(){}function Yn(n,t,r){var i=n.clipExtent&&n.clipExtent();return n.scale(150).translate([0,0]),null!=i&&n.clipExtent(null),p(r,n.stream(ni)),t(ni.result()),null!=i&&n.clipExtent(i),n}function Zn(n,t,r){return Yn(n,function(r){var i=t[1][0]-t[0][0],e=t[1][1]-t[0][1],o=Math.min(i/(r[1][0]-r[0][0]),e/(r[1][1]-r[0][1])),u=+t[0][0]+(i-o*(r[1][0]+r[0][0]))/2,c=+t[0][1]+(e-o*(r[1][1]+r[0][1]))/2;n.scale(150*o).translate([u,c])},r)}function Jn(n,t,r){return Zn(n,[[0,0],t],r)}function Kn(n,t,r){return Yn(n,function(r){var i=+t,e=i/(r[1][0]-r[0][0]),o=(i-e*(r[1][0]+r[0][0]))/2,u=-e*r[0][1];n.scale(150*e).translate([o,u])},r)}function Qn(n,t,r){return Yn(n,function(r){var i=+t,e=i/(r[1][1]-r[0][1]),o=-e*r[0][0],u=(i-e*(r[1][1]+r[0][1]))/2;n.scale(150*e).translate([o,u])},r)}function Vn(n,t){return+t?function(n,t){function r(i,e,o,c,a,l,f,s,p,h,g,v,d,E){var y=f-i,S=s-e,m=y*y+S*S;if(m>4*t&&d--){var M=c+h,x=a+g,_=l+v,N=dr(M*M+x*x+_*_),w=u(_/=N),C=ur(ur(_)-1)t||ur((y*j+S*q)/m-.5)>.3||c*h+a*g+l*v2?n[2]%360*or:0,r()):[S*er,m*er,M*er]},t.angle=function(n){return arguments.length?(x=n%360*or,r()):x*er},t.precision=function(n){return arguments.length?(l=Vn(f,P=n*n),i()):dr(P)},t.fitExtent=function(n,r){return Zn(t,n,r)},t.fitSize=function(n,r){return Jn(t,n,r)},t.fitWidth=function(n,r){return Kn(t,n,r)},t.fitHeight=function(n,r){return Qn(t,n,r)},function(){return e=n.apply(this,arguments),t.invert=e.invert&&function(n){return(n=s.invert(n[0],n[1]))&&[n[0]*er,n[1]*er]},r()}}function rt(n){var t=0,r=nr/3,i=tt(n),e=i(t,r);return e.parallels=function(n){return arguments.length?i(t=n[0]*or,r=n[1]*or):[t*er,r*er]},e}function it(n,t){function r(n,t){var r=dr(o-2*e*gr(t))/e;return[r*gr(n*=e),c-r*lr(n)]}var i=gr(n),e=(i+gr(t))/2;if(ur(e)0?t<-tr+Vt&&(t=-tr+Vt):t>tr-Vt&&(t=tr-Vt);var r=o/hr(ft(t),e);return[r*gr(e*n),o-r*lr(e*n)]}var i=lr(n),e=n===t?gr(n):pr(i/lr(t))/pr(ft(t)/ft(n)),o=i*hr(ft(n),e)/e;return e?(r.invert=function(n,t){var r=o-t,i=vr(e)*dr(n*n+r*r);return[ar(n,ur(r))/e*vr(r),2*cr(hr(o/i,1/e))-tr]},r):at}function pt(n,t){return[n,t]}function ht(n,t){function r(n,t){var r=o-t,i=e*n;return[r*gr(i),o-r*lr(i)]}var i=lr(n),e=n===t?gr(n):(i-lr(t))/(t-n),o=i/e+n;return ur(e)0?1:n<0?-1:0},dr=Math.sqrt,Er=Math.tan,yr={Feature:function(n,t){l(n.geometry,t)},FeatureCollection:function(n,t){for(var r=n.features,i=-1,e=r.length;++iVt?Rt=90:_r<-Vt&&(Ct=-90),Lt[0]=wt,Lt[1]=Pt}},wr={sphere:a,point:L,lineStart:G,lineEnd:F,polygonStart:function(){wr.lineStart=H,wr.lineEnd=I},polygonEnd:function(){wr.lineStart=G,wr.lineEnd=F}};X.invert=X;var Cr,Pr,Rr,Ar,jr,qr,zr,br,Lr,Or,Gr,Tr=r(),kr=cn(function(){return!0},function(n){var t,r=NaN,i=NaN,e=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(o,u){var c=o>0?nr:-nr,a=ur(o-r);ur(a-nr)0?tr:-tr),n.point(e,i),n.lineEnd(),n.lineStart(),n.point(c,i),n.point(o,i),t=0):e!==c&&a>=nr&&(ur(r-e)Vt?cr((gr(t)*(o=lr(i))*gr(r)-gr(i)*(e=lr(t))*gr(n))/(e*o*u)):(t+i)/2}(r,i,o,u),n.point(e,i),n.lineEnd(),n.lineStart(),n.point(c,i),t=0),n.point(r=o,i=u),e=c},lineEnd:function(){n.lineEnd(),r=i=NaN},clean:function(){return 2-t}}},function(n,t,r,i){var e;if(null==n)e=r*tr,i.point(-nr,e),i.point(0,e),i.point(nr,e),i.point(nr,0),i.point(nr,-e),i.point(0,-e),i.point(-nr,-e),i.point(-nr,0),i.point(-nr,e);else if(ur(n[0]-t[0])>Vt){var o=n[0]Vr&&(Vr=n),t$r&&($r=t)},lineStart:a,lineEnd:a,polygonStart:a,polygonEnd:a,result:function(){var n=[[Kr,Qr],[Vr,$r]];return Vr=$r=-(Qr=Kr=1/0),n}},ti=0,ri=0,ii=0,ei=0,oi=0,ui=0,ci=0,ai=0,li=0,fi={point:qn,lineStart:zn,lineEnd:On,polygonStart:function(){fi.lineStart=Gn,fi.lineEnd=Tn},polygonEnd:function(){fi.point=qn,fi.lineStart=zn,fi.lineEnd=On},result:function(){var n=li?[ci/li,ai/li]:ui?[ei/ui,oi/ui]:ii?[ti/ii,ri/ii]:[NaN,NaN];return ti=ri=ii=ei=oi=ui=ci=ai=li=0,n}};Hn.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(n,t){switch(this._point){case 0:this._context.moveTo(n,t),this._point=1;break;case 1:this._context.lineTo(n,t);break;default:this._context.moveTo(n+this._radius,t),this._context.arc(n,t,this._radius,0,ir)}},result:a};var si,pi,hi,gi,vi,di=r(),Ei={point:a,lineStart:function(){Ei.point=In},lineEnd:function(){si&&Wn(pi,hi),Ei.point=a},polygonStart:function(){si=!0},polygonEnd:function(){si=null},result:function(){var n=+di;return di.reset(),n}};Bn.prototype={_radius:4.5,_circle:Dn(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(n,t){switch(this._point){case 0:this._string.push("M",n,",",t),this._point=1;break;case 1:this._string.push("L",n,",",t);break;default:null==this._circle&&(this._circle=Dn(this._radius)),this._string.push("M",n,",",t,this._circle)}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}return null}},Xn.prototype={constructor:Xn,point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var yi=16,Si=lr(30*or),mi=Un({point:function(n,t){this.stream.point(n*or,t*or)}}),Mi=ut(function(n){return dr(2/(1+n))});Mi.invert=ct(function(n){return 2*u(n/2)});var xi=ut(function(n){return(n=o(n))&&n/gr(n)});xi.invert=ct(function(n){return n}),at.invert=function(n,t){return[n,2*cr(sr(t))-tr]},pt.invert=pt,gt.invert=ct(cr),dt.invert=function(n,t){var r,i=t,e=25;do{var o=i*i,u=o*o;i-=r=(i*(1.007226+o*(.015085+u*(.028874*o-.044475-.005916*u)))-t)/(1.007226+o*(.045255+u*(.259866*o-.311325-.005916*11*u)))}while(ur(r)>Vt&&--e>0);return[n/(.8707+(o=i*i)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),i]},Et.invert=ct(u),yt.invert=ct(function(n){return 2*cr(n)}),St.invert=function(n,t){return[-t,2*cr(sr(n))-tr]},n.geoArea=function(n){return Mr.reset(),p(n,xr),2*Mr},n.geoBounds=function(n){var t,r,i,e,o,u,c;if(Rt=Pt=-(wt=Ct=1/0),bt=[],p(n,Nr),r=bt.length){for(bt.sort(z),t=1,o=[i=bt[0]];tq(i[0],i[1])&&(i[1]=e[1]),q(e[0],i[1])>q(i[0],i[1])&&(i[0]=e[0])):o.push(i=e);for(u=-1/0,t=0,i=o[r=o.length-1];t<=r;i=e,++t)e=o[t],(c=q(i[1],e[0]))>u&&(u=c,wt=e[0],Pt=i[1])}return bt=Lt=null,wt===1/0||Ct===1/0?[[NaN,NaN],[NaN,NaN]]:[[wt,Ct],[Pt,Rt]]},n.geoCentroid=function(n){Ot=Gt=Tt=kt=Ft=Ht=It=Wt=Bt=Dt=Ut=0,p(n,wr);var t=Bt,r=Dt,i=Ut,e=t*t+r*r+i*i;return e<$t&&(t=Ht,r=It,i=Wt,Gt=.12&&e<.234&&i>=-.425&&i<-.214?l:e>=.166&&e<.234&&i>=-.214&&i<-.115?f:a).invert(n)},n.stream=function(n){return r&&i===n?r:r=function(n){var t=n.length;return{point:function(r,i){for(var e=-1;++e2?n[2]+90:90]):(n=r(),[n[0],n[1],n[2]-90])},r([0,0,90]).scale(159.155)},n.geoTransverseMercatorRaw=St,n.geoRotation=Q,n.geoStream=p,n.geoTransform=function(n){return{stream:Un(n)}},Object.defineProperty(n,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/inst/js/d3-modules/d3-interpolate.v1.min.js b/inst/js/d3-modules/d3-interpolate.v1.min.js new file mode 100644 index 0000000..8f7e1e5 --- /dev/null +++ b/inst/js/d3-modules/d3-interpolate.v1.min.js @@ -0,0 +1,2 @@ +// https://d3js.org/d3-interpolate/ Version 1.2.0. Copyright 2018 Mike Bostock. +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-color")):"function"==typeof define&&define.amd?define(["exports","d3-color"],n):n(t.d3=t.d3||{},t.d3)}(this,function(t,n){"use strict";function r(t,n,r,e,o){var a=t*t,u=a*t;return((1-3*t+3*a-u)*n+(4-6*a+3*u)*r+(1+3*t+3*a-3*u)*e+u*o)/6}function e(t,n){return function(r){return t+r*n}}function o(t,n,r){return t=Math.pow(t,r),n=Math.pow(n,r)-t,r=1/r,function(e){return Math.pow(t+e*n,r)}}function a(t,n){var r=n-t;return r?e(t,r>180||r<-180?r-360*Math.round(r/360):r):j(isNaN(t)?n:t)}function u(t){return 1==(t=+t)?i:function(n,r){return r-n?o(n,r,t):j(isNaN(n)?r:n)}}function i(t,n){var r=n-t;return r?e(t,r):j(isNaN(t)?n:t)}function l(t){return function(r){var e,o,a=r.length,u=new Array(a),i=new Array(a),l=new Array(a);for(e=0;e180?n+=360:n-t>180&&(t+=360),a.push({i:r.push(o(r)+"rotate(",null,e)-2,x:I(t,n)})):n&&r.push(o(r)+"rotate("+n+e)}function i(t,n,r,a){t!==n?a.push({i:r.push(o(r)+"skewX(",null,e)-2,x:I(t,n)}):n&&r.push(o(r)+"skewX("+n+e)}function l(t,n,r,e,a,u){if(t!==r||n!==e){var i=a.push(o(a)+"scale(",null,",",null,")");u.push({i:i-4,x:I(t,r)},{i:i-2,x:I(n,e)})}else 1===r&&1===e||a.push(o(a)+"scale("+r+","+e+")")}return function(n,r){var e=[],o=[];return n=t(n),r=t(r),a(n.translateX,n.translateY,r.translateX,r.translateY,e,o),u(n.rotate,r.rotate,e,o),i(n.skewX,r.skewX,e,o),l(n.scaleX,n.scaleY,r.scaleX,r.scaleY,e,o),n=r=null,function(t){for(var n,r=-1,a=o.length;++r=1?(e=1,n-1):Math.floor(e*n),a=t[o],u=t[o+1],i=o>0?t[o-1]:2*a-u,l=oa&&(o=n.slice(a,o),i[u]?i[u]+=o:i[++u]=o),(r=r[0])===(e=e[0])?i[u]?i[u]+=e:i[++u]=e:(i[++u]=null,l.push({i:u,x:I(r,e)})),a=H.lastIndex;return a1e-6)if(Math.abs(c*r-a*u)>1e-6&&e){var x=s-n,y=_-o,M=r*r+a*a,l=x*x+y*y,d=Math.sqrt(M),p=Math.sqrt(f),v=e*Math.tan((h-Math.acos((M+f-l)/(2*d*p)))/2),b=v/p,w=v/d;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*u)+","+(i+b*c)),this._+="A"+e+","+e+",0,0,"+ +(c*x>u*y)+","+(this._x1=t+w*r)+","+(this._y1=i+w*a)}else this._+="L"+(this._x1=t)+","+(this._y1=i);else;},arc:function(t,i,s,n,o,r){t=+t,i=+i,s=+s;var a=s*Math.cos(n),u=s*Math.sin(n),c=t+a,f=i+u,x=1^r,y=r?n-o:o-n;if(s<0)throw new Error("negative radius: "+s);null===this._x1?this._+="M"+c+","+f:(Math.abs(this._x1-c)>1e-6||Math.abs(this._y1-f)>1e-6)&&(this._+="L"+c+","+f),s&&(y<0&&(y=y%_+_),y>e?this._+="A"+s+","+s+",0,1,"+x+","+(t-a)+","+(i-u)+"A"+s+","+s+",0,1,"+x+","+(this._x1=c)+","+(this._y1=f):y>1e-6&&(this._+="A"+s+","+s+",0,"+ +(y>=h)+","+x+","+(this._x1=t+s*Math.cos(o))+","+(this._y1=i+s*Math.sin(o))))},rect:function(t,i,s,h){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)+"h"+ +s+"v"+ +h+"h"+-s+"Z"},toString:function(){return this._}},t.path=s,Object.defineProperty(t,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/inst/js/third-party/d3-scale-chromatic-1.1.1.min.js b/inst/js/d3-modules/d3-scale-chromatic-1.1.1.min.js similarity index 100% rename from inst/js/third-party/d3-scale-chromatic-1.1.1.min.js rename to inst/js/d3-modules/d3-scale-chromatic-1.1.1.min.js diff --git a/inst/js/d3-modules/d3-scale.v2.min.js b/inst/js/d3-modules/d3-scale.v2.min.js new file mode 100644 index 0000000..b964ea5 --- /dev/null +++ b/inst/js/d3-modules/d3-scale.v2.min.js @@ -0,0 +1,2 @@ +// https://d3js.org/d3-scale/ Version 2.0.0. Copyright 2018 Mike Bostock. +!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-array"),require("d3-collection"),require("d3-interpolate"),require("d3-format"),require("d3-time"),require("d3-time-format")):"function"==typeof define&&define.amd?define(["exports","d3-array","d3-collection","d3-interpolate","d3-format","d3-time","d3-time-format"],t):t(n.d3=n.d3||{},n.d3,n.d3,n.d3,n.d3,n.d3,n.d3)}(this,function(n,t,e,r,i,u,o){"use strict";function a(n){function t(t){var e=t+"",o=r.get(e);if(!o){if(u!==B)return u;r.set(e,o=i.push(t))}return n[(o-1)%n.length]}var r=e.map(),i=[],u=B;return n=null==n?[]:j.call(n),t.domain=function(n){if(!arguments.length)return i.slice();i=[],r=e.map();for(var u,o,a=-1,c=n.length;++a2?m:s,o=a=null,i}function i(t){return(o||(o=u(c,l,g?function(n){return function(t,e){var r=n(t=+t,e=+e);return function(n){return n<=t?0:n>=e?1:r(n)}}}(n):n,f)))(+t)}var u,o,a,c=C,l=C,f=r.interpolate,g=!1;return i.invert=function(n){return(a||(a=u(l,c,d,g?function(n){return function(t,e){var r=n(t=+t,e=+e);return function(n){return n<=0?t:n>=1?e:r(n)}}}(t):t)))(+n)},i.domain=function(n){return arguments.length?(c=Y.call(n,h),e()):c.slice()},i.range=function(n){return arguments.length?(l=j.call(n),e()):l.slice()},i.rangeRound=function(n){return l=j.call(n),f=r.interpolateRound,e()},i.clamp=function(n){return arguments.length?(g=!!n,e()):g},i.interpolate=function(n){return arguments.length?(f=n,e()):f},e()}function M(n){var e=n.domain;return n.ticks=function(n){var r=e();return t.ticks(r[0],r[r.length-1],null==n?10:n)},n.tickFormat=function(n,r){return function(n,e,r){var u,o=n[0],a=n[n.length-1],c=t.tickStep(o,a,null==e?10:e);switch((r=i.formatSpecifier(null==r?",f":r)).type){case"s":var l=Math.max(Math.abs(o),Math.abs(a));return null!=r.precision||isNaN(u=i.precisionPrefix(c,l))||(r.precision=u),i.formatPrefix(r,l);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(u=i.precisionRound(c,Math.max(Math.abs(o),Math.abs(a))))||(r.precision=u-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(u=i.precisionFixed(c))||(r.precision=u-2*("%"===r.type))}return i.format(r)}(e(),n,r)},n.nice=function(r){null==r&&(r=10);var i,u=e(),o=0,a=u.length-1,c=u[o],l=u[a];return l0?(c=Math.floor(c/i)*i,l=Math.ceil(l/i)*i,i=t.tickIncrement(c,l,r)):i<0&&(c=Math.ceil(c*i)/i,l=Math.floor(l*i)/i,i=t.tickIncrement(c,l,r)),i>0?(u[o]=Math.floor(c/i)*i,u[a]=Math.ceil(l/i)*i,e(u)):i<0&&(u[o]=Math.ceil(c*i)/i,u[a]=Math.floor(l*i)/i,e(u)),n},n}function v(){var n=p(d,r.interpolateNumber);return n.copy=function(){return g(n,v())},M(n)}function y(){function n(n){return+n}var t=[0,1];return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=Y.call(e,h),n):t.slice()},n.copy=function(){return y().domain(t)},M(n)}function x(n,t){var e,r=0,i=(n=n.slice()).length-1,u=n[r],o=n[i];return o0){for(;sl)break;p.push(d)}}else for(;s=1;--h)if(!((d=f*h)l)break;p.push(d)}}else p=t.ticks(s,m,Math.min(m-s,g)).map(a);return e?p.reverse():p},e.tickFormat=function(n,t){if(null==t&&(t=10===u?".0e":","),"function"!=typeof t&&(t=i.format(t)),n===1/0)return t;null==n&&(n=10);var r=Math.max(1,u*n/e.ticks().length);return function(n){var e=n/a(Math.round(o(n)));return e*u0?u[t-1]:r[0],t=u?[o[u-1],i]:[o[t-1],o[t]]},n.copy=function(){return A().domain([r,i]).range(a)},M(n)}function E(){function n(n){if(n<=n)return r[t.bisect(e,n,0,i)]}var e=[.5],r=[0,1],i=1;return n.domain=function(t){return arguments.length?(e=j.call(t),i=Math.min(e.length,r.length-1),n):e.slice()},n.range=function(t){return arguments.length?(r=j.call(t),i=Math.min(e.length,r.length-1),n):r.slice()},n.invertExtent=function(n){var t=r.indexOf(n);return[e[t-1],e[t]]},n.copy=function(){return E().domain(e).range(r)},n}function P(n){return new Date(n)}function R(n){return n instanceof Date?+n:+new Date(+n)}function T(n,e,i,u,o,a,c,l,f){function h(t){return(c(t)=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),H.hasOwnProperty(n)?{space:H[n],local:t}:t}function e(t){var e=n(t);return(e.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===z&&n.documentElement.namespaceURI===z?n.createElement(t):n.createElementNS(e,t)}})(e)}function r(){}function i(t){return null==t?r:function(){return this.querySelector(t)}}function o(){return[]}function u(t){return null==t?o:function(){return this.querySelectorAll(t)}}function c(t){return new Array(t.length)}function s(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function a(t,n,e,r,i,o){for(var u,c=0,a=n.length,l=o.length;cn?1:t>=n?0:NaN}function h(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function p(t,n){return t.style.getPropertyValue(n)||h(t).getComputedStyle(t,null).getPropertyValue(n)}function _(t){return t.trim().split(/^|\s+/)}function d(t){return t.classList||new v(t)}function v(t){this._node=t,this._names=_(t.getAttribute("class")||"")}function m(t,n){for(var e=d(t),r=-1,i=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Y={};if(t.event=null,"undefined"!=typeof document){"onmouseenter"in document.documentElement||(Y={mouseenter:"mouseover",mouseleave:"mouseout"})}var $=[null];B.prototype=q.prototype={constructor:B,select:function(t){"function"!=typeof t&&(t=i(t));for(var n=this._groups,e=n.length,r=new Array(e),o=0;o=x&&(x=A+1);!(w=y[x])&&++x=0;)(r=i[o])&&(u&&u!==r.nextSibling&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=f);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof n?function(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}:function(t,n,e){return function(){this.style.setProperty(t,n,e)}})(t,n,null==e?"":e)):p(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?function(t){return function(){delete this[t]}}:"function"==typeof n?function(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}:function(t,n){return function(){this[t]=n}})(t,n)):this.node()[t]},classed:function(t,n){var e=_(t+"");if(arguments.length<2){for(var r=d(this.node()),i=-1,o=e.length;++i=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}(t+""),u=o.length;if(!(arguments.length<2)){for(c=n?L:M,null==e&&(e=!1),r=0;r1?0:t<-1?lt:Math.acos(t)}function e(t){return t>=1?ut:t<=-1?-ut:Math.asin(t)}function s(t){return t.innerRadius}function h(t){return t.outerRadius}function o(t){return t.startAngle}function _(t){return t.endAngle}function r(t){return t&&t.padAngle}function a(t,n,i,e,s,h,o,_){var r=i-t,a=e-n,c=o-s,l=_-h,u=(c*(n-h)-l*(t-s))/(l*r-c*a);return[t+u*r,n+u*a]}function c(t,n,i,e,s,h,o){var _=t-i,r=n-e,a=(o?h:-h)/at(_*_+r*r),c=a*r,l=-a*_,u=t+c,f=n+l,x=i+c,y=e+l,p=(u+x)/2,v=(f+y)/2,d=x-u,T=y-f,g=d*d+T*T,b=s-h,w=u*y-x*f,k=(T<0?-1:1)*at(ot(0,b*b*g-w*w)),m=(w*T-d*k)/g,N=(-w*d-T*k)/g,M=(w*T+d*k)/g,S=(-w*d+T*k)/g,E=m-p,A=N-v,P=M-p,C=S-v;return E*E+A*A>P*P+C*C&&(m=M,N=S),{cx:m,cy:N,x01:-c,y01:-l,x11:m*(s/b-1),y11:N*(s/b-1)}}function l(t){this._context=t}function u(t){return t[0]}function f(t){return t[1]}function x(t){this._curve=t}function y(t){function n(n){return new x(t(n))}return n._curve=t,n}function p(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(y(t)):n()._curve},t}function v(t){return t.source}function d(t){return t.target}function T(t){function i(){var i,r=Nt.call(arguments),a=e.apply(this,r),c=s.apply(this,r);if(_||(_=i=n.path()),t(_,+h.apply(this,(r[0]=a,r)),+o.apply(this,r),+h.apply(this,(r[0]=c,r)),+o.apply(this,r)),i)return _=null,i+""||null}var e=v,s=d,h=u,o=f,_=null;return i.source=function(t){return arguments.length?(e=t,i):e},i.target=function(t){return arguments.length?(s=t,i):s},i.x=function(t){return arguments.length?(h="function"==typeof t?t:it(+t),i):h},i.y=function(t){return arguments.length?(o="function"==typeof t?t:it(+t),i):o},i.context=function(t){return arguments.length?(_=null==t?null:t,i):_},i}function g(t,n,i,e,s){t.moveTo(n,i),t.bezierCurveTo(n=(n+e)/2,i,n,s,e,s)}function b(t,n,i,e,s){t.moveTo(n,i),t.bezierCurveTo(n,i=(i+s)/2,e,i,e,s)}function w(t,n,i,e,s){var h=mt(n,i),o=mt(n,i=(i+s)/2),_=mt(e,i),r=mt(e,s);t.moveTo(h[0],h[1]),t.bezierCurveTo(o[0],o[1],_[0],_[1],r[0],r[1])}function k(){return T(g)}function m(){return T(b)}function N(){var t=T(w);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}function M(t,n,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+i)/6)}function S(t){this._context=t}function E(t){this._context=t}function A(t){this._context=t}function P(t,n){this._basis=new S(t),this._beta=n}function C(t,n,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function R(t,n){this._context=t,this._k=(1-n)/6}function q(t,n){this._context=t,this._k=(1-n)/6}function O(t,n){this._context=t,this._k=(1-n)/6}function z(t,n,i){var e=t._x1,s=t._y1,h=t._x2,o=t._y2;if(t._l01_a>ct){var _=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,r=3*t._l01_a*(t._l01_a+t._l12_a);e=(e*_-t._x0*t._l12_2a+t._x2*t._l01_2a)/r,s=(s*_-t._y0*t._l12_2a+t._y2*t._l01_2a)/r}if(t._l23_a>ct){var a=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);h=(h*a+t._x1*t._l23_2a-n*t._l12_2a)/c,o=(o*a+t._y1*t._l23_2a-i*t._l12_2a)/c}t._context.bezierCurveTo(e,s,h,o,t._x2,t._y2)}function X(t,n){this._context=t,this._alpha=n}function Y(t,n){this._context=t,this._alpha=n}function B(t,n){this._context=t,this._alpha=n}function I(t){this._context=t}function j(t){return t<0?-1:1}function D(t,n,i){var e=t._x1-t._x0,s=n-t._x1,h=(t._y1-t._y0)/(e||s<0&&-0),o=(i-t._y1)/(s||e<0&&-0),_=(h*s+o*e)/(e+s);return(j(h)+j(o))*Math.min(Math.abs(h),Math.abs(o),.5*Math.abs(_))||0}function L(t,n){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-n)/2:n}function V(t,n,i){var e=t._x0,s=t._y0,h=t._x1,o=t._y1,_=(h-e)/3;t._context.bezierCurveTo(e+_,s+_*n,h-_,o-_*i,h,o)}function W(t){this._context=t}function H(t){this._context=new F(t)}function F(t){this._context=t}function G(t){return new W(t)}function J(t){return new H(t)}function K(t){this._context=t}function Q(t){var n,i,e=t.length-1,s=new Array(e),h=new Array(e),o=new Array(e);for(s[0]=0,h[0]=2,o[0]=t[0]+2*t[1],n=1;n=0;--n)s[n]=(o[n]-s[n+1])/h[n];for(h[e-1]=(t[e]+s[e-1])/2,n=0;n_;if(d||(d=t=n.path()),oct)if(T>ft-ct)d.moveTo(o*ht(_),o*rt(_)),d.arc(0,0,o,_,r,!g),h>ct&&(d.moveTo(h*ht(r),h*rt(r)),d.arc(0,0,h,r,_,g));else{var b,w,k=_,m=r,N=_,M=r,S=T,E=T,A=v.apply(this,arguments)/2,P=A>ct&&(x?+x.apply(this,arguments):at(h*h+o*o)),C=_t(et(o-h)/2,+f.apply(this,arguments)),R=C,q=C;if(P>ct){var O=e(P/h*rt(A)),z=e(P/o*rt(A));(S-=2*O)>ct?(O*=g?1:-1,N+=O,M-=O):(S=0,N=M=(_+r)/2),(E-=2*z)>ct?(z*=g?1:-1,k+=z,m-=z):(E=0,k=m=(_+r)/2)}var X=o*ht(k),Y=o*rt(k),B=h*ht(M),I=h*rt(M);if(C>ct){var j=o*ht(m),D=o*rt(m),L=h*ht(N),V=h*rt(N);if(Tct?a(X,Y,L,V,j,D,B,I):[B,I],H=X-W[0],F=Y-W[1],G=j-W[0],J=D-W[1],K=1/rt(i((H*G+F*J)/(at(H*H+F*F)*at(G*G+J*J)))/2),Q=at(W[0]*W[0]+W[1]*W[1]);R=_t(C,(h-Q)/(K-1)),q=_t(C,(o-Q)/(K+1))}}E>ct?q>ct?(b=c(L,V,X,Y,o,q,g),w=c(j,D,B,I,o,q,g),d.moveTo(b.cx+b.x01,b.cy+b.y01),qct&&S>ct?R>ct?(b=c(B,I,j,D,h,-R,g),w=c(X,Y,L,V,h,-R,g),d.lineTo(b.cx+b.x01,b.cy+b.y01),R=l;--u)c.point(v[u],d[u]);c.lineEnd(),c.areaEnd()}p&&(v[i]=+e(f,i,t),d[i]=+h(f,i,t),c.point(s?+s(f,i,t):v[i],o?+o(f,i,t):d[i]))}if(x)return c=null,x+""||null}function i(){return pt().defined(_).curve(a).context(r)}var e=u,s=null,h=it(0),o=f,_=it(!0),r=null,a=yt,c=null;return t.x=function(n){return arguments.length?(e="function"==typeof n?n:it(+n),s=null,t):e},t.x0=function(n){return arguments.length?(e="function"==typeof n?n:it(+n),t):e},t.x1=function(n){return arguments.length?(s=null==n?null:"function"==typeof n?n:it(+n),t):s},t.y=function(n){return arguments.length?(h="function"==typeof n?n:it(+n),o=null,t):h},t.y0=function(n){return arguments.length?(h="function"==typeof n?n:it(+n),t):h},t.y1=function(n){return arguments.length?(o=null==n?null:"function"==typeof n?n:it(+n),t):o},t.lineX0=t.lineY0=function(){return i().x(e).y(h)},t.lineY1=function(){return i().x(e).y(o)},t.lineX1=function(){return i().x(s).y(h)},t.defined=function(n){return arguments.length?(_="function"==typeof n?n:it(!!n),t):_},t.curve=function(n){return arguments.length?(a=n,null!=r&&(c=a(r)),t):a},t.context=function(n){return arguments.length?(null==n?r=c=null:c=a(r=n),t):r},t},dt=function(t,n){return nt?1:n>=t?0:NaN},Tt=function(t){return t},gt=function(){function t(t){var _,r,a,c,l,u=t.length,f=0,x=new Array(u),y=new Array(u),p=+s.apply(this,arguments),v=Math.min(ft,Math.max(-ft,h.apply(this,arguments)-p)),d=Math.min(Math.abs(v)/u,o.apply(this,arguments)),T=d*(v<0?-1:1);for(_=0;_0&&(f+=l);for(null!=i?x.sort(function(t,n){return i(y[t],y[n])}):null!=e&&x.sort(function(n,i){return e(t[n],t[i])}),_=0,a=f?(v-u*T)/f:0;_0?l*a:0)+T,y[r]={data:t[r],index:_,value:l,startAngle:p,endAngle:c,padAngle:d};return y}var n=Tt,i=dt,e=null,s=it(0),h=it(ft),o=it(0);return t.value=function(i){return arguments.length?(n="function"==typeof i?i:it(+i),t):n},t.sortValues=function(n){return arguments.length?(i=n,e=null,t):i},t.sort=function(n){return arguments.length?(e=n,i=null,t):e},t.startAngle=function(n){return arguments.length?(s="function"==typeof n?n:it(+n),t):s},t.endAngle=function(n){return arguments.length?(h="function"==typeof n?n:it(+n),t):h},t.padAngle=function(n){return arguments.length?(o="function"==typeof n?n:it(+n),t):o},t},bt=y(yt);x.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))}};var wt=function(){return p(pt().curve(bt))},kt=function(){var t=vt().curve(bt),n=t.curve,i=t.lineX0,e=t.lineX1,s=t.lineY0,h=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return p(i())},delete t.lineX0,t.lineEndAngle=function(){return p(e())},delete t.lineX1,t.lineInnerRadius=function(){return p(s())},delete t.lineY0,t.lineOuterRadius=function(){return p(h())},delete t.lineY1,t.curve=function(t){return arguments.length?n(y(t)):n()._curve},t},mt=function(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]},Nt=Array.prototype.slice,Mt={draw:function(t,n){var i=Math.sqrt(n/lt);t.moveTo(i,0),t.arc(0,0,i,0,ft)}},St={draw:function(t,n){var i=Math.sqrt(n/5)/2;t.moveTo(-3*i,-i),t.lineTo(-i,-i),t.lineTo(-i,-3*i),t.lineTo(i,-3*i),t.lineTo(i,-i),t.lineTo(3*i,-i),t.lineTo(3*i,i),t.lineTo(i,i),t.lineTo(i,3*i),t.lineTo(-i,3*i),t.lineTo(-i,i),t.lineTo(-3*i,i),t.closePath()}},Et=Math.sqrt(1/3),At=2*Et,Pt={draw:function(t,n){var i=Math.sqrt(n/At),e=i*Et;t.moveTo(0,-i),t.lineTo(e,0),t.lineTo(0,i),t.lineTo(-e,0),t.closePath()}},Ct=Math.sin(lt/10)/Math.sin(7*lt/10),Rt=Math.sin(ft/10)*Ct,qt=-Math.cos(ft/10)*Ct,Ot={draw:function(t,n){var i=Math.sqrt(.8908130915292852*n),e=Rt*i,s=qt*i;t.moveTo(0,-i),t.lineTo(e,s);for(var h=1;h<5;++h){var o=ft*h/5,_=Math.cos(o),r=Math.sin(o);t.lineTo(r*i,-_*i),t.lineTo(_*e-r*s,r*e+_*s)}t.closePath()}},zt={draw:function(t,n){var i=Math.sqrt(n),e=-i/2;t.rect(e,e,i,i)}},Xt=Math.sqrt(3),Yt={draw:function(t,n){var i=-Math.sqrt(n/(3*Xt));t.moveTo(0,2*i),t.lineTo(-Xt*i,-i),t.lineTo(Xt*i,-i),t.closePath()}},Bt=-.5,It=Math.sqrt(3)/2,jt=1/Math.sqrt(12),Dt=3*(jt/2+1),Lt={draw:function(t,n){var i=Math.sqrt(n/Dt),e=i/2,s=i*jt,h=e,o=i*jt+i,_=-h,r=o;t.moveTo(e,s),t.lineTo(h,o),t.lineTo(_,r),t.lineTo(Bt*e-It*s,It*e+Bt*s),t.lineTo(Bt*h-It*o,It*h+Bt*o),t.lineTo(Bt*_-It*r,It*_+Bt*r),t.lineTo(Bt*e+It*s,Bt*s-It*e),t.lineTo(Bt*h+It*o,Bt*o-It*h),t.lineTo(Bt*_+It*r,Bt*r-It*_),t.closePath()}},Vt=[Mt,St,Pt,zt,Ot,Yt,Lt],Wt=function(){function t(){var t;if(s||(s=t=n.path()),i.apply(this,arguments).draw(s,+e.apply(this,arguments)),t)return s=null,t+""||null}var i=it(Mt),e=it(64),s=null;return t.type=function(n){return arguments.length?(i="function"==typeof n?n:it(n),t):i},t.size=function(n){return arguments.length?(e="function"==typeof n?n:it(+n),t):e},t.context=function(n){return arguments.length?(s=null==n?null:n,t):s},t},Ht=function(){};S.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:M(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(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;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:M(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var Ft=function(t){return new S(t)};E.prototype={areaStart:Ht,areaEnd:Ht,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:M(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var Gt=function(t){return new E(t)};A.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===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;break;case 1:this._point=2;break;case 2:this._point=3;var i=(this._x0+4*this._x1+t)/6,e=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(i,e):this._context.moveTo(i,e);break;case 3:this._point=4;default:M(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var Jt=function(t){return new A(t)};P.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,i=t.length-1;if(i>0)for(var e,s=t[0],h=n[0],o=t[i]-s,_=n[i]-h,r=-1;++r<=i;)e=r/i,this._basis.point(this._beta*t[r]+(1-this._beta)*(s+e*o),this._beta*n[r]+(1-this._beta)*(h+e*_));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var Kt=function t(n){function i(t){return 1===n?new S(t):new P(t,n)}return i.beta=function(n){return t(+n)},i}(.85);R.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:C(this,this._x1,this._y1)}(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,this._x1=t,this._y1=n;break;case 2:this._point=3;default:C(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Qt=function t(n){function i(t){return new R(t,n)}return i.tension=function(n){return t(+n)},i}(0);q.prototype={areaStart:Ht,areaEnd:Ht,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:C(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Ut=function t(n){function i(t){return new q(t,n)}return i.tension=function(n){return t(+n)},i}(0);O.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===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;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:C(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Zt=function t(n){function i(t){return new O(t,n)}return i.tension=function(n){return t(+n)},i}(0);X.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}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;default:z(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var $t=function t(n){function i(t){return n?new X(t,n):new R(t,0)}return i.alpha=function(n){return t(+n)},i}(.5);Y.prototype={areaStart:Ht,areaEnd:Ht,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:z(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var tn=function t(n){function i(t){return n?new Y(t,n):new q(t,0)}return i.alpha=function(n){return t(+n)},i}(.5);B.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:z(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var nn=function t(n){function i(t){return n?new B(t,n):new O(t,0)}return i.alpha=function(n){return t(+n)},i}(.5);I.prototype={areaStart:Ht,areaEnd:Ht,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}};var en=function(t){return new I(t)};W.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:V(this,this._t0,L(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(t=+t,n=+n,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,V(this,L(this,i=D(this,t,n)),i);break;default:V(this,this._t0,i=D(this,t,n))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=i}}},(H.prototype=Object.create(W.prototype)).point=function(t,n){W.prototype.point.call(this,n,t)},F.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,s,h){this._context.bezierCurveTo(n,t,e,i,h,s)}},K.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=Q(t),s=Q(n),h=0,o=1;o=0&&(this._t=1-this._t,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:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var i=this._x*(1-this._t)+t*this._t;this._context.lineTo(i,this._y),this._context.lineTo(i,n)}}this._x=t,this._y=n}};var hn=function(t){return new U(t,.5)},on=function(t,n){if((s=t.length)>1)for(var i,e,s,h=1,o=t[n[0]],_=o.length;h=0;)i[n]=n;return i},rn=function(){function t(t){var h,o,_=n.apply(this,arguments),r=t.length,a=_.length,c=new Array(a);for(h=0;h0){for(var i,e,s,h=0,o=t[0].length;h1)for(var i,e,s,h,o,_,r=0,a=t[n[0]].length;r=0?(e[0]=h,e[1]=h+=s):s<0?(e[1]=o,e[0]=o+=s):e[0]=h},ln=function(t,n){if((i=t.length)>0){for(var i,e=0,s=t[n[0]],h=s.length;e0&&(e=(i=t[n[0]]).length)>0){for(var i,e,s,h=0,o=1;o=0&&e._call.call(null,t),e=e._next;--_}function u(){h=(d=v.now())+y,_=m=0;try{r()}finally{_=0,c(),h=0}}function l(){var t=v.now(),n=t-d;n>w&&(y-=n,d=t)}function c(){for(var t,n,e=f,o=1/0;e;)e._call?(o>e._time&&(o=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:f=n);s=t,a(o)}function a(t){_||(m&&(m=clearTimeout(m)),t-h>24?(t<1/0&&(m=setTimeout(u,t-v.now()-y)),p&&(p=clearInterval(p))):(p||(d=v.now(),p=setInterval(l,w)),_=1,x(u)))}var f,s,_=0,m=0,p=0,w=1e3,d=0,h=0,y=0,v="object"==typeof performance&&performance.now?performance:Date,x="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};o.prototype=i.prototype={constructor:o,restart:function(t,e,o){if("function"!=typeof t)throw new TypeError("callback is not a function");o=(null==o?n():+o)+(null==e?0:+e),this._next||s===this||(s?s._next=this:f=this,s=this),this._call=t,this._time=o,a()},stop:function(){this._call&&(this._call=null,this._time=1/0,a())}};t.now=n,t.timer=i,t.timerFlush=r,t.timeout=function(t,n,e){var i=new o;return n=null==n?0:+n,i.restart(function(e){i.stop(),t(e+n)},n,e),i},t.interval=function(t,e,i){var r=new o,u=e;return null==e?(r.restart(t,e,i),r):(e=+e,i=null==i?n():+i,r.restart(function n(o){o+=u,r.restart(n,u+=e,i),t(o)},e,i),r)},Object.defineProperty(t,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/inst/js/d3-modules/d3-transition.v1.min.js b/inst/js/d3-modules/d3-transition.v1.min.js new file mode 100644 index 0000000..053b669 --- /dev/null +++ b/inst/js/d3-modules/d3-transition.v1.min.js @@ -0,0 +1,2 @@ +// https://d3js.org/d3-transition/ Version 1.1.1. Copyright 2017 Mike Bostock. +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-selection"),require("d3-dispatch"),require("d3-timer"),require("d3-interpolate"),require("d3-color"),require("d3-ease")):"function"==typeof define&&define.amd?define(["exports","d3-selection","d3-dispatch","d3-timer","d3-interpolate","d3-color","d3-ease"],n):n(t.d3=t.d3||{},t.d3,t.d3,t.d3,t.d3,t.d3,t.d3)}(this,function(t,n,e,r,i,o,a){"use strict";function u(t,n){var e=l(t,n);if(e.state>J)throw new Error("too late; already scheduled");return e}function s(t,n){var e=l(t,n);if(e.state>L)throw new Error("too late; already started");return e}function l(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function f(t,n,e){function i(t){e.state=K,e.timer.restart(o,e.delay,e.time),e.delay<=t&&o(t-e.delay)}function o(i){var f,c,h,d;if(e.state!==K)return u();for(f in l)if(d=l[f],d.name===e.name){if(d.state===Q)return r.timeout(o);d.state===U?(d.state=W,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete l[f]):+f=0&&(t=t.slice(0,n)),!t||"start"===t})}function q(t,n,e){var r,i,o=T(n)?u:s;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}function C(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function P(t,e){var r,i,o;return function(){var a=n.style(this,t),u=(this.style.removeProperty(t),n.style(this,t));return a===u?null:a===r&&u===i?o:o=e(r=a,i=u)}}function O(t){return function(){this.style.removeProperty(t)}}function j(t,e,r){var i,o;return function(){var a=n.style(this,t);return a===r?null:a===i?o:o=e(i=a,r)}}function k(t,e,r){var i,o,a;return function(){var u=n.style(this,t),s=r(this);return null==s&&(this.style.removeProperty(t),s=n.style(this,t)),u===s?null:u===i&&s===o?a:a=e(i=u,o=s)}}function z(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}function M(t){return function(){this.textContent=t}}function R(t){return function(){var n=t(this);this.textContent=null==n?"":n}}function I(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function B(t){return n.selection().transition(t)}function D(){return++mt}function F(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return gt.time=r.now(),gt;return e}var G=e.dispatch("start","end","interrupt"),H=[],J=0,K=1,L=2,Q=3,U=4,V=5,W=6,X=function(t,n,e,r,i,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};f(t,e,{name:n,index:r,group:i,on:G,tween:H,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:J})},Y=function(t,n){var e,r,i,o=t.__transition,a=!0;if(o){n=null==n?null:n+"";for(i in o)(e=o[i]).name===n?(r=e.state>L&&e.stateK&&e.name===n)return new I([[t]],At,n,+r)}return null};t.transition=B,t.active=xt,t.interrupt=Y,Object.defineProperty(t,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/inst/resource.library.yaml b/inst/resource.library.yaml index 8b48a54..9824815 100644 --- a/inst/resource.library.yaml +++ b/inst/resource.library.yaml @@ -295,15 +295,127 @@ version: 3.2.1 mimetype: text/javascript publisher: resource + +### D3 LIBRARIES ### - id: lib-d3-js - location: js/third-party/d3-4.11.0.min.js + location: js/d3-modules/d3-4.11.0.min.js version: 4.11.0 mimetype: text/javascript publisher: resource +- + id: lib-d3-array-js + location: js/d3-modules/d3-array.v1.min.js + version: 1.2.1 + mimetype: text/javascript + publisher: resource +- + id: lib-d3-collection-js + location: js/d3-modules/d3-collection.v1.min.js + version: 1.0.4 + mimetype: text/javascript + publisher: resource +- + id: lib-d3-color-js + location: js/d3-modules/d3-color.v1.min.js + version: 1.2.0 + mimetype: text/javascript + publisher: resource +- + id: lib-d3-dispatch-js + location: js/d3-modules/d3-dispatch.v1.min.js + version: 1.0.3 + mimetype: text/javascript + publisher: resource +- + # depends: d3-dispatch, d3-selection + id: lib-d3-drag-js + location: js/d3-modules/d3-drag.v1.min.js + version: 1.2.1 + mimetype: text/javascript + publisher: resource +- + id: lib-d3-dsv-js + location: js/d3-modules/d3-dsv.v1.min.js + version: 1.0.8 + mimetype: text/javascript + publisher: resource +- + id: lib-d3-ease-js + location: js/d3-modules/d3-ease.v1.min.js + version: 1.0.3 + mimetype: text/javascript + publisher: resource +- + # depends: d3-dsv + id: lib-d3-fetch-js + location: js/d3-modules/d3-fetch.v1.min.js + version: 1.1.0 + mimetype: text/javascript + publisher: resource +- + id: lib-d3-format-js + location: js/d3-modules/d3-format.v1.min.js + version: 1.3.0 + mimetype: text/javascript + publisher: resource +- + # depends: d3-array + id: lib-d3-geo-js + location: js/d3-modules/d3-geo.v1.min.js + version: 1.10.0 + mimetype: text/javascript + publisher: resource +- + # depends: d3-color + id: lib-d3-interpolate-js + location: js/d3-modules/d3-interpolate.v1.min.js + version: 1.2.0 + mimetype: text/javascript + publisher: resource - + id: lib-d3-path-js + location: js/d3-modules/d3-path.v1.min.js + version: 1.0.5 + mimetype: text/javascript + publisher: resource +- + # depends: d3-format, d3-array, d3-collection, d3-interpolate id: lib-d3-scale-js - location: js/third-party/d3-scale-chromatic-1.1.1.min.js + location: js/d3-modules/d3-scale.v2.min.js + version: 2.0.0 + mimetype: text/javascript + publisher: resource +- + # depends: d3-interpolate + id: lib-d3-scale-chromatic-js + location: js/d3-modules/d3-scale-chromatic-1.1.1.min.js + version: 1.1.1 + mimetype: text/javascript + publisher: resource +- + id: lib-d3-selection-js + location: js/d3-modules/d3-selection.v1.min.js + version: 1.3.0 + mimetype: text/javascript + publisher: resource +- + # depends: d3-path + id: lib-d3-shape-js + location: js/d3-modules/d3-shape.v1.min.js + version: 1.2.0 + mimetype: text/javascript + publisher: resource +- + id: lib-d3-timer-js + location: js/d3-modules/d3-timer.v1.min.js + version: 1.0.7 + mimetype: text/javascript + publisher: resource +- + # depends: d3-interpolate, d3-selection, d3-timer, d3-ease, d3-dispatch + id: lib-d3-transition-js + location: js/d3-modules/d3-transition.v1.min.js version: 1.1.1 mimetype: text/javascript publisher: resource