@d3plus/core 3.0.15 → 3.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -41
- package/es/src/charts/Viz.js +1 -1
- package/es/src/shapes/Shape.js +6 -6
- package/package.json +8 -8
- package/umd/d3plus-core.full.js +8 -8
- package/umd/d3plus-core.full.js.map +1 -1
- package/umd/d3plus-core.full.min.js +375 -375
- package/umd/d3plus-core.js +8 -8
- package/umd/d3plus-core.js.map +1 -1
- package/umd/d3plus-core.min.js +99 -99
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
@d3plus/core v3.0.
|
|
2
|
+
@d3plus/core v3.0.16
|
|
3
3
|
Data visualization made easy. A javascript library that extends the popular D3.js to enable fast and beautiful visualizations.
|
|
4
4
|
Copyright (c) 2026 D3plus - https://d3plus.org
|
|
5
5
|
@license MIT
|
|
@@ -93,11 +93,11 @@ return t},empty:function(){return!this.node()},each:function(t){for(var n=this._
|
|
|
93
93
|
if(!(arguments.length<2)){
|
|
94
94
|
// If a type was specified, set the callback for the given type and name.
|
|
95
95
|
// Otherwise, if a null callback was specified, remove callbacks of the given name.
|
|
96
|
-
if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o<s;)if(e=(t=r[o]).type)a[e]=St(a[e],t.name,n);else if(null==n)for(e in a)a[e]=St(a[e],t.name,null);return this}for(;++o<s;)if(e=(e=(t=r[o]).type)&&((t,n)=>{for(var e,i=0,a=t.length;i<a;++i)if((e=t[i]).name===n)return e.value})(a[e],t.name))return e},copy:function(){var t,n={},e=this._;for(t in e)n[t]=e[t].slice();return new wt(n)},call:function(t,n){if(0<(e=arguments.length-2))for(var e,i,a=new Array(e),r=0;r<e;++r)a[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=0,e=(i=this._[t]).length;r<e;++r)i[r].value.apply(n,a)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],a=0,r=i.length;a<r;++a)i[a].value.apply(n,e)}};var kt,Ct,Mt=0,At=0,zt=0,Tt=1e3,Rt=0,
|
|
96
|
+
if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o<s;)if(e=(t=r[o]).type)a[e]=St(a[e],t.name,n);else if(null==n)for(e in a)a[e]=St(a[e],t.name,null);return this}for(;++o<s;)if(e=(e=(t=r[o]).type)&&((t,n)=>{for(var e,i=0,a=t.length;i<a;++i)if((e=t[i]).name===n)return e.value})(a[e],t.name))return e},copy:function(){var t,n={},e=this._;for(t in e)n[t]=e[t].slice();return new wt(n)},call:function(t,n){if(0<(e=arguments.length-2))for(var e,i,a=new Array(e),r=0;r<e;++r)a[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=0,e=(i=this._[t]).length;r<e;++r)i[r].value.apply(n,a)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],a=0,r=i.length;a<r;++a)i[a].value.apply(n,e)}};var kt,Ct,Mt=0,At=0,zt=0,Tt=1e3,Rt=0,Ft=0,It=0,Ht="object"==typeof performance&&performance.now?performance:Date,Gt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Kt(){return Ft||(Gt(Ut),Ft=Ht.now()+It)}function Ut(){Ft=0}function Wt(){this._call=this._time=this._next=null}function qt(t,n,e){var i=new Wt;return i.restart(t,n,e),i}function $t(){Ft=(Rt=Ht.now())+It,Mt=At=0;try{Kt(),// Get the current time, if not already set.
|
|
97
97
|
++Mt;for(// Pretend we’ve set an alarm, if we haven’t already.
|
|
98
|
-
var t,n=kt;n;)0<=(t=
|
|
98
|
+
var t,n=kt;n;)0<=(t=Ft-n._time)&&n._call.call(void 0,t),n=n._next;--Mt}finally{for(var e,i,a=kt,r=1/(Mt=0);a;)a=a._call?(r>a._time&&(r=a._time),(e=a)._next):(i=a._next,a._next=null,e?e._next=i:kt=i);Ct=e,Yt(r),Ft=0}}function Vt(){var t=Ht.now(),n=t-Rt;Tt<n&&(It-=n,Rt=t)}function Yt(t){Mt||(// Soonest alarm already set, or will be.
|
|
99
99
|
At=At&&clearTimeout(At),// Strictly less than if we recomputed clockNow.
|
|
100
|
-
24<t-
|
|
100
|
+
24<t-Ft?(t<1/0&&(At=setTimeout($t,t-Ht.now()-It)),zt=zt&&clearInterval(zt)):(zt||(Rt=Ht.now(),zt=setInterval(Vt,Tt)),Mt=1,Gt($t)))}function Zt(n,e,t){var i=new Wt;return e=null==e?0:+e,i.restart(t=>{i.stop(),n(t+e)},e,t),i}Wt.prototype=qt.prototype={constructor:Wt,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Kt():+e)+(null==n?0:+n),this._next||Ct===this||(Ct?Ct._next=this:kt=this,Ct=this),this._call=t,this._time=e,Yt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Yt())}};var Xt=xt("start","end","cancel","interrupt"),Jt=[],Qt=0,tn=1,nn=2,en=3,an=4,rn=5,on=6;function sn(t,n,e,i,a,r){var o,s,l,h,u,c=t.__transition;if(c){if(e in c)return}else t.__transition={};function g(t){var n,e,i,a;
|
|
101
101
|
// If the state is not SCHEDULED, then we previously errored on start.
|
|
102
102
|
if(l.state!==tn)return f();for(n in u)if((a=u[n]).name===l.name){
|
|
103
103
|
// While this element already has a starting transition during this frame,
|
|
@@ -124,8 +124,8 @@ delete o.__transition}o=t,s=e,l={name:n,index:i,group:a,on:Xt,tween:Jt,time:r.ti
|
|
|
124
124
|
// Note the actual delay is not known until the first callback!
|
|
125
125
|
(u=o.__transition)[s]=l).timer=qt(function(t){l.state=tn,l.timer.restart(g,l.delay,l.time),
|
|
126
126
|
// If the elapsed delay is less than our first sleep, start immediately.
|
|
127
|
-
l.delay<=t&&g(t-l.delay)},0,l.time)}function ln(t,n){t=un(t,n);if(t.state>Qt)throw new Error("too late; already scheduled");return t}function hn(t,n){t=un(t,n);if(t.state>en)throw new Error("too late; already running");return t}function un(t,n){t=t.__transition;if(t=t&&t[n])return t;throw new Error("transition not found")}function cn(t,n){var e,i,a,r=t.__transition,o=!0;if(r){for(a in n=null==n?null:n+"",r)(e=r[a]).name!==n?o=!1:(i=nn<e.state&&e.state<rn,e.state=on,e.timer.stop(),e.on.call(i?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete r[a]);o&&delete t.__transition}}function gn(t,n,e){(t.prototype=n.prototype=e).constructor=t}function dn(t,n){var e,i=Object.create(t.prototype);for(e in n)i[e]=n[e];return i}function fn(){}var pn="\\s*([+-]?\\d+)\\s*",_n="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",mn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",yn=/^#([0-9a-f]{3,8})$/,vn=new RegExp(`^rgb\\(${pn},${pn},${pn}\\)$`),bn=new RegExp(`^rgb\\(${mn},${mn},${mn}\\)$`),xn=new RegExp(`^rgba\\(${pn},${pn},${pn},${_n}\\)$`),wn=new RegExp(`^rgba\\(${mn},${mn},${mn},${_n}\\)$`),Sn=new RegExp(`^hsl\\(${_n},${mn},${mn}\\)$`),kn=new RegExp(`^hsla\\(${_n},${mn},${mn},${_n}\\)$`),Cn={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 Mn(){return this.rgb().formatHex()}function An(){return this.rgb().formatRgb()}function zn(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=yn.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?Tn(n):3===e?new Pn(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?En(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?En(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=vn.exec(t))?new Pn(n[1],n[2],n[3],1):(n=bn.exec(t))?new Pn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=xn.exec(t))?En(n[1],n[2],n[3],n[4]):(n=wn.exec(t))?En(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Sn.exec(t))?Rn(n[1],n[2]/100,n[3]/100,1):(n=kn.exec(t))?Rn(n[1],n[2]/100,n[3]/100,n[4]):Cn.hasOwnProperty(t)?Tn(Cn[t]):"transparent"===t?new Pn(NaN,NaN,NaN,0):null}function Tn(t){return new Pn(t>>16&255,t>>8&255,255&t,1)}function En(t,n,e,i){return new Pn(t=i<=0?n=e=NaN:t,n,e,i)}function Nn(t,n,e,i){return 1===arguments.length?(a=(a=t)instanceof fn?a:zn(a))?new Pn((a=a.rgb()).r,a.g,a.b,a.opacity):new Pn:new Pn(t,n,e,null==i?1:i);var a}function Pn(t,n,e,i){this.r=+t,this.g=+n,this.b=+e,this.opacity=+i}function
|
|
128
|
-
/* From FvD 13.37, CSS Color Module Level 3 */function Un(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}gn(fn,zn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Mn,formatHex:Mn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return
|
|
127
|
+
l.delay<=t&&g(t-l.delay)},0,l.time)}function ln(t,n){t=un(t,n);if(t.state>Qt)throw new Error("too late; already scheduled");return t}function hn(t,n){t=un(t,n);if(t.state>en)throw new Error("too late; already running");return t}function un(t,n){t=t.__transition;if(t=t&&t[n])return t;throw new Error("transition not found")}function cn(t,n){var e,i,a,r=t.__transition,o=!0;if(r){for(a in n=null==n?null:n+"",r)(e=r[a]).name!==n?o=!1:(i=nn<e.state&&e.state<rn,e.state=on,e.timer.stop(),e.on.call(i?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete r[a]);o&&delete t.__transition}}function gn(t,n,e){(t.prototype=n.prototype=e).constructor=t}function dn(t,n){var e,i=Object.create(t.prototype);for(e in n)i[e]=n[e];return i}function fn(){}var pn="\\s*([+-]?\\d+)\\s*",_n="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",mn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",yn=/^#([0-9a-f]{3,8})$/,vn=new RegExp(`^rgb\\(${pn},${pn},${pn}\\)$`),bn=new RegExp(`^rgb\\(${mn},${mn},${mn}\\)$`),xn=new RegExp(`^rgba\\(${pn},${pn},${pn},${_n}\\)$`),wn=new RegExp(`^rgba\\(${mn},${mn},${mn},${_n}\\)$`),Sn=new RegExp(`^hsl\\(${_n},${mn},${mn}\\)$`),kn=new RegExp(`^hsla\\(${_n},${mn},${mn},${_n}\\)$`),Cn={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 Mn(){return this.rgb().formatHex()}function An(){return this.rgb().formatRgb()}function zn(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=yn.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?Tn(n):3===e?new Pn(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?En(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?En(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=vn.exec(t))?new Pn(n[1],n[2],n[3],1):(n=bn.exec(t))?new Pn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=xn.exec(t))?En(n[1],n[2],n[3],n[4]):(n=wn.exec(t))?En(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Sn.exec(t))?Rn(n[1],n[2]/100,n[3]/100,1):(n=kn.exec(t))?Rn(n[1],n[2]/100,n[3]/100,n[4]):Cn.hasOwnProperty(t)?Tn(Cn[t]):"transparent"===t?new Pn(NaN,NaN,NaN,0):null}function Tn(t){return new Pn(t>>16&255,t>>8&255,255&t,1)}function En(t,n,e,i){return new Pn(t=i<=0?n=e=NaN:t,n,e,i)}function Nn(t,n,e,i){return 1===arguments.length?(a=(a=t)instanceof fn?a:zn(a))?new Pn((a=a.rgb()).r,a.g,a.b,a.opacity):new Pn:new Pn(t,n,e,null==i?1:i);var a}function Pn(t,n,e,i){this.r=+t,this.g=+n,this.b=+e,this.opacity=+i}function Ln(){return"#"+jn(this.r)+jn(this.g)+jn(this.b)}function Bn(){var t=On(this.opacity);return(1===t?"rgb(":"rgba(")+Dn(this.r)+`, ${Dn(this.g)}, `+Dn(this.b)+(1===t?")":`, ${t})`)}function On(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Dn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function jn(t){return((t=Dn(t))<16?"0":"")+t.toString(16)}function Rn(t,n,e,i){return i<=0?t=n=e=NaN:e<=0||1<=e?t=n=NaN:n<=0&&(t=NaN),new Hn(t,n,e,i)}function Fn(t){var n,e,i,a,r,o,s,l;return t instanceof Hn?new Hn(t.h,t.s,t.l,t.opacity):(t=t instanceof fn?t:zn(t))?t instanceof Hn?t:(n=(t=t.rgb()).r/255,e=t.g/255,i=t.b/255,a=Math.min(n,e,i),o=NaN,l=((r=Math.max(n,e,i))+a)/2,(s=r-a)?(o=n===r?(e-i)/s+6*(e<i):e===r?(i-n)/s+2:(n-e)/s+4,s/=l<.5?r+a:2-r-a,o*=60):s=0<l&&l<1?0:o,new Hn(o,s,l,t.opacity)):new Hn}function In(t,n,e,i){return 1===arguments.length?Fn(t):new Hn(t,n,e,null==i?1:i)}function Hn(t,n,e,i){this.h=+t,this.s=+n,this.l=+e,this.opacity=+i}function Gn(t){return(t=(t||0)%360)<0?t+360:t}function Kn(t){return Math.max(0,Math.min(1,t||0))}
|
|
128
|
+
/* From FvD 13.37, CSS Color Module Level 3 */function Un(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}gn(fn,zn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Mn,formatHex:Mn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Fn(this).formatHsl()},formatRgb:An,toString:An}),gn(Pn,Nn,dn(fn,{brighter(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Pn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new Pn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Pn(Dn(this.r),Dn(this.g),Dn(this.b),On(this.opacity))},displayable(){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:Ln,formatHex:Ln,formatHex8:function(){return"#"+jn(this.r)+jn(this.g)+jn(this.b)+jn(255*(isNaN(this.opacity)?1:this.opacity))},formatRgb:Bn,toString:Bn})),gn(Hn,In,dn(fn,{brighter(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Hn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new Hn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,n=e+(e<.5?e:1-e)*n,e=2*e-n;return new Pn(Un(240<=t?t-240:120+t,e,n),Un(t,e,n),Un(t<120?240+t:t-120,e,n),this.opacity)},clamp(){return new Hn(Gn(this.h),Kn(this.s),Kn(this.l),On(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){var t=On(this.opacity);return(1===t?"hsl(":"hsla(")+Gn(this.h)+`, ${100*Kn(this.s)}%, ${100*Kn(this.l)}%`+(1===t?")":`, ${t})`)}}));var Wn=t=>()=>t;function qn(r){return 1==(r=+r)?$n:function(t,n){return n-t?(e=t,i=n,a=r,e=Math.pow(e,a),i=Math.pow(i,a)-e,a=1/a,function(t){return Math.pow(e+t*i,a)}):Wn(isNaN(t)?n:t);var e,i,a}}function $n(t,n){var e,i,a=n-t;return a?(e=t,i=a,function(t){return e+t*i}):Wn(isNaN(t)?n:t)}var Vn=function t(n){var o=qn(n);function e(n,t){var e=o((n=Nn(n)).r,(t=Nn(t)).r),i=o(n.g,t.g),a=o(n.b,t.b),r=$n(n.opacity,t.opacity);return function(t){return n.r=e(t),n.g=i(t),n.b=a(t),n.opacity=r(t),n+""}}return e.gamma=t,e}(1);function Yn(n,e){e=e||[];var i,a=n?Math.min(e.length,n.length):0,r=e.slice();return function(t){for(i=0;i<a;++i)r[i]=n[i]*(1-t)+e[i]*t;return r}}function Zn(t,n){for(var e=n?n.length:0,i=t?Math.min(e,t.length):0,a=new Array(i),r=new Array(e),o=0;o<i;++o)a[o]=ie(t[o],n[o]);for(;o<e;++o)r[o]=n[o];return function(t){for(o=0;o<i;++o)r[o]=a[o](t);return r}}function Xn(n,e){var i=new Date;return n=+n,e=+e,function(t){return i.setTime(n*(1-t)+e*t),i}}function Jn(n,e){return n=+n,e=+e,function(t){return n*(1-t)+e*t}}function Qn(t,n){var e,i={},a={};for(e in null!==t&&"object"==typeof t||(t={}),n=null!==n&&"object"==typeof n?n:{})e in t?i[e]=ie(t[e],n[e]):a[e]=n[e];return function(t){for(e in i)a[e]=i[e](t);return a}}var te=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ne=new RegExp(te.source,"g");function ee(t,i){var n,e,a,r,o,s=te.lastIndex=ne.lastIndex=0,l=-1,h=[],u=[];// number interpolators
|
|
129
129
|
// Coerce inputs to strings.
|
|
130
130
|
// Interpolate pairs of numbers in a & b.
|
|
131
131
|
for(t+="",i+="";(n=te.exec(t))&&(e=ne.exec(i));)(a=e.index)>s&&(a=i.slice(s,a),h[l]?h[l]+=a:h[++l]=a),(n=n[0])===(e=e[0])?h[l]?h[l]+=e:h[++l]=e:(h[++l]=null,u.push({i:l,x:Jn(n,e)})),s=ne.lastIndex;
|
|
@@ -205,13 +205,13 @@ n=Object.assign({},{condition:!0,enter:{},exit:{},duration:0,parent:H("body"),up
|
|
|
205
205
|
@param {String} value
|
|
206
206
|
*/var n,e;return void 0===t?t="undefined":"string"==typeof t||(n=t,null!=(e=String)&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?e[Symbol.hasInstance](n):n instanceof e)||(t=JSON.stringify(t)),t}
|
|
207
207
|
// great unicode list: http://asecuritysite.com/coding/asc2
|
|
208
|
-
var Ne,Pe,Be,
|
|
208
|
+
var Ne,Pe,Le,Be,Oe,De,je=[[/[\300-\305]/g,"A"],[/[\340-\345]/g,"a"],[/[\306]/g,"AE"],[/[\346]/g,"ae"],[/[\337]/g,"B"],[/[\307]/g,"C"],[/[\347]/g,"c"],[/[\320\336\376]/g,"D"],[/[\360]/g,"d"],[/[\310-\313]/g,"E"],[/[\350-\353]/g,"e"],[/[\314-\317]/g,"I"],[/[\354-\357]/g,"i"],[/[\321]/g,"N"],[/[\361]/g,"n"],[/[\u014c\322-\326\330]/g,"O"],[/[\u014d\362-\366\370]/g,"o"],[/[\u016a\331-\334]/g,"U"],[/[\u016b\371-\374]/g,"u"],[/[\327]/g,"x"],[/[\335]/g,"Y"],[/[\375\377]/g,"y"]];
|
|
209
209
|
/**
|
|
210
210
|
@function strip
|
|
211
211
|
@desc Removes all non ASCII characters from a string.
|
|
212
212
|
@param {String} value
|
|
213
213
|
@param {String} [spacer = "-"]
|
|
214
|
-
*/function Re(t,n){var i=1<arguments.length&&void 0!==n?n:"-";return"".concat(t).replace(/[^A-Za-z0-9\-_\u0621-\u064A]/g,function(t){if(" "===t)return i;for(var n=!1,e=0;e<je.length;e++)if(new RegExp(je[e][0]).test(t)){n=je[e][1];break}return n||""})}function
|
|
214
|
+
*/function Re(t,n){var i=1<arguments.length&&void 0!==n?n:"-";return"".concat(t).replace(/[^A-Za-z0-9\-_\u0621-\u064A]/g,function(t){if(" "===t)return i;for(var n=!1,e=0;e<je.length;e++)if(new RegExp(je[e][0]).test(t)){n=je[e][1];break}return n||""})}function Fe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ie(){if(!Pe){Pe=1;
|
|
215
215
|
/* build fixed length tree */for(var y=0,v=-3,b=new i,x=new i,s=new Uint8Array(30),l=new Uint16Array(30),h=new Uint8Array(30),u=new Uint16Array(30),w=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),S=new i,k=new Uint8Array(320),o=new Uint16Array(16),
|
|
216
216
|
/* -------------------- *
|
|
217
217
|
* -- initialization -- *
|
|
@@ -274,7 +274,7 @@ this.dtree=new i}
|
|
|
274
274
|
/* check for end of block */if(256===i)return y;if(i<256)t.dest[t.destLen++]=i;else
|
|
275
275
|
/* copy match */for(var a,
|
|
276
276
|
/* possibly get more bits from length code */r=A(t,s[i-=257],l[i]),i=z(t,e),o=
|
|
277
|
-
/* possibly get more bits from distance code */a=t.destLen-A(t,h[i],u[i]);o<a+r;++o)t.dest[t.destLen++]=t.dest[o]}}}function He(){if(!
|
|
277
|
+
/* possibly get more bits from distance code */a=t.destLen-A(t,h[i],u[i]);o<a+r;++o)t.dest[t.destLen++]=t.dest[o]}}}function He(){if(!Be){Be=1;let n=18===new Uint8Array(new Uint32Array([305419896]).buffer)[0],i=(t,n,e)=>{var i=t[n];t[n]=t[e],t[e]=i};Le={swap32LE:t=>{n&&(n=>{var e=n.length;for(let t=0;t<e;t+=4)i(n,t,t+3),i(n,t+1,t+2)})(t)}}}return Le}var Ge,Ke,Ue,We,qe,$e,Ve,Ye,Ze,mn=Fe((()=>{if(!De){De=1;let i=Ie(),a=He().swap32LE;Oe=class{get(t){let n;return t<0||1114111<t?this.errorValue:t<55296||56319<t&&t<=65535?(
|
|
278
278
|
// Ordinary BMP code point, excluding leading surrogates.
|
|
279
279
|
// BMP uses a single level lookup. BMP index starts at offset 0 in the index.
|
|
280
280
|
// data is stored in the index array itself.
|
|
@@ -310,7 +310,7 @@ for(n=0,i=t.length-r;n<i;n+=3)e=(t[n]<<16)+(t[n+1]<<8)+t[n+2],o+=s((a=e)>>18&63)
|
|
|
310
310
|
switch(r){case 1:o=(o+=s((e=t[t.length-1])>>2))+s(e<<4&63)+"==";break;case 2:o=(o=(o+=s((e=(t[t.length-2]<<8)+t[t.length-1])>>10))+s(e>>4&63))+s(e<<2&63)+"="}return o});var Je={};function Qe(t){switch(t){case 33:return 12;case 39:case 40:case 42:return 12;case 35:return 5;default:return t}}function ti(t){switch(t){case 37:case 38:return 34;case 41:return 22;default:return t}}// Prohibited break
|
|
311
311
|
let ni=[
|
|
312
312
|
//OP , CL , CP , QU , GL , NS , EX , SY , IS , PR , PO , NU , AL , HL , ID , IN , HY , BA , BB , B2 , ZW , CM , WJ , H2 , H3 , JL , JV , JT , RI , EB , EM , ZWJ , CB
|
|
313
|
-
[4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,4,4,4,4,4,4,4,4,4,4,4],[0,4,4,1,1,4,4,4,4,1,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,4,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[4,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1,1,1,1,1],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1,1,1,1,1],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,1,0,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,0,0,1,1,1,1,1,1,1,0,0,4,2,4,1,1,1,1,1,0,1,1,1,0],[1,4,4,1,1,1,4,4,4,0,0,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,0,1,4,4,4,0,0,1,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,0,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1,1,1,1,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,4,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1,1,1,1,1],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,1,1,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,1,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,1,1,1,1,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,1,1,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,1,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,1,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,1,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,0,4,4,4,0,0,0,0,0,0,0,0,0,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0]],ei=new mn(
|
|
313
|
+
[4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,4,4,4,4,4,4,4,4,4,4,4],[0,4,4,1,1,4,4,4,4,1,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,4,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[4,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1,1,1,1,1],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1,1,1,1,1],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,1,0,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,0,0,1,1,1,1,1,1,1,0,0,4,2,4,1,1,1,1,1,0,1,1,1,0],[1,4,4,1,1,1,4,4,4,0,0,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,0,1,4,4,4,0,0,1,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,0,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1,1,1,1,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,4,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1,1,1,1,1],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,1,1,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,1,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,1,1,1,1,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,1,1,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,1,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,1,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,1,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,0,4,4,4,0,0,0,0,0,0,0,0,0,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0]],ei=new mn(Fe(_n).toByteArray("AAgOAAAAAAAQ4QAAAQ0P8vDtnQuMXUUZx+eyu7d7797d9m5bHoWltKVUlsjLWE0VJNigQoMVqkStEoNQQUl5GIo1KKmogEgqkKbBRki72lYabZMGKoGAjQRtJJDaCCIRiiigREBQS3z+xzOTnZ3O+3HOhd5NfpkzZx7fN9988zivu2M9hGwB28F94DnwEngd/Asc1EtIs9c/bIPDwCxwLDgezHcodyo4w5C+CCwBS8FnwSXgCnA1uFbI93XwbXAbWAfWgx+CzWAb+An4KfgFeAzsYWWfYuFz4CXwGvgb+Dfo6yNkEEwGh4CZYB44FpwI3g1OY+kfBItZOo2fB84Hy8DF4HJwNbiWpV8PVoO1LH4n2NRXyN+KcAd4kNVP9XsY4aPgcfAbsBfs6SniL4K/sPjfEf6HlanXCRkCw2BGvUh/keWfXS/CY+pFXs7x9XHmM94LTmWIeU2cgbxnS/k/B3kf86jDhU8L9V2E40vAFWAlWFUfb++NOL4F3C7JX4/4GiE+hvgWsF0oS7mXldspnN+F493gyXrh9xTav0cg3EvzgVfBG6wsmVSEkxBOBgdPGpd7JI6PnqRvJ68/xlbHof53gPeA94OzwLngk+ACsAwsByvASrAK3MB0Ws3CtQjvBJvAVrADPMDSHkb4CNijaccTwvnf4fiPEs8Lxy+D18A/QU8/xjgYBjPAbDAKTgYLwOngTHAO+EQ/8wuEF4EvsPiVCFf2+9tsFStzA8LVHuXXBsi6QyqzUYiPMR/7Mc7dAx7oL8bzw/3u/Bw8Bp4Az4AXwCtgHzsmDXP5fiF9iiVvly5d0sHngar16NKlS5cuXbp06fLmYlqHXrcd3ph4P0THUY3iXh49novju4S0tzfs5d+JPKewfAsRntZb3K9ZhOMlrO6lCC8An28U9+OuovcPcPxlVu5rCL/VmHh/iHIrzn3fIPu7SN8Axmg+8AOwEWwCm7tp3bRuWjetm5Y8bSu4B9zbKO6ZVsnORrVU3f4uXTqZ2H3sLoyx3eDXjfDndE9qyj6L838CfwVvgFpzYnof4oNgOhgBc8Fos9DrZIQLmtXPP1MmF6wGj4H+KXoWguvADkXaPil+YpuQy8Am8Ey7ODdtmJDF4HowBp4De6HDTNjhfHAHeBr0DBBy0kDxfPbcgSIusgrcWhtnJ8vL+TPix7UIOQtcBq4C28Cr4KRBnANbwSuDE+s50JgyNNFuXbp06XIgsXjIvPafjvXozKY+fVFz/z0LT1uCtKVSWbrOLWPnztG8e0Xfy7ol8XtZJi7WtG+5od2UFXQ/A12vUeS7jp27yVKHjdsU9lXB869TyNvAzt0lpP2oWbwLdjiO78bx/Sz+EMJHwK9Y/LcIfw+eZ3F67/Hl5vh9xX80J+rwX8SvRDhpgL17iPAQMHNArfPrqHPewLheI+AERV6efwV418B4nOZ/H+IfYHV8GOF5LJ3eAz0fx8sM9S0fUNud39O9CulfGZhY5huI3wzWgNvBelbHZoTbNPVpfYjKQpkHwUNgl0LWblbnk0LbbDxr0OMFpL3iqWdu9nWYPlVAWkXY39LnGdCkDbeqv1YNbfcMQ3t9oe8lzm6NH9N1ZB6Ln4BwfkJZJk7RyFnYKt6b/JDQXx9p5X+eFdqOjzM9P9MB/lUlFzr20aXIdzlY4dmn9F3YqtvoO76/2hp/D/xA5Zue88nNyL8GbFbs075X0tyUig3Qd2MCnf//HjnzpbsR3g9+1kHzzVjdnE71/qVBX9rGPUh/ysNWe1neFzvIDi5zAufV1sT0N0poR22wkFUfTOPfA4N2mbZ5fSrqOHSw+IbkSBbOGSzSRgf91/GTUWYBOB2cIZQ/G8cfBZ8CFwrnL8XxF8FKcA24jqXdiPA7Qr61OF7H4mMItwzuv2/YLth1ISt3Hzu3k4W7EH5JqPdRHD/O4k+z8A8IX5Lq3y7Z4nXE9xn6kX6vQ4bKfy+ok+hH+xf3hq9dnTTHhjKd2GmDuWA242iHMq4cC7A8kJ7i8o1+skSa7Jieo38HCWnoNjKFhdSFBxzpZ7QE6lI8N4S14aASZcryaV/WWHw66f6NHuCoxuQxmvM56GX9QMd8Q4D65ywGP+ZzRJuM+zQvx/MOS2VFeqQ4IXnH26zM9Xe6/E6D+4foAzzuajPZp8Qyw5ayZVDWuH0z0BtYRkeIDqH9KO9VbH1btd/lhNqCzvl8zeLnG0S/hnU6baHfpiuO6yy0rd+DHURo/zYF5H26j03rQsip2ndzz82u1z9N4VjWKWeb68Tedpt95HRVXp7H1R6p+/Wt4FPy/PpWwscOLRJ+PVWF/+W0iVyGzs18TIvXkOJ1Wxm66vSXz+vylenrZcj1ub439W+K8RNCGTJi2p/TJ1K23VaXr35tRpnzmjxequgfcfyk6B/TGBVlyedsNgpdd/h+W1U3P99QyFPNo1X3TwpM/WLTIWYfoBqXrv6iskHZ/RFr79R6hIyHBrH3f1nrUVnjP8SnZZ+rYtzr9Exld5MNbPNErusAPg+77u/eDOPftU9yj39TH7rezxd1LvsZQJlzkWlOirG/79zjMj/mtHUKu7vKy+3/LnXr9okyKedjX5/0He9iP/j63LwOQdarEVlfy8OO/Lqw023j6xcqmwxLiOd6heM2i9cV9LJy8jMJ23yQ+rpbfu7EQ/pXE8KYvUSqvVnb4XzZa6LrHMXHR+zcLvqWbm/Bn0/HzIs6fWPHoat8XfnDKmZGxRxeMbn2UqZ5Q94nmcZRbqqUXbZ8+lcjE+cPX11t814orvvAXNcG8vqj2vvk1MGn3anlj0bIT72v47bvE+Lc98T9b6r7AKn6j+8Duf7D0nnZx/j7Zjn0j9nbpSTndaLr9WNLivP+iN23xF7L+fqv6ZouFyb78jxVXvv5jJ9YUs9/sddO8h7KNg5jrhfaJGztT6G7KF+1d6yCmD5Kdb2fan60rSc552fZr3zeQ9DpnPp+Si5cx5Ktv2QfSzF/mMbWdOm46rFI4XstnU9xeqX4NKb7TKEdcr6pZOK3ID1k/LvFHkVczEuZLEDr499YqvqBym1aEHWgcvoYOtv0M91qQl5TfpO/in6rWx8OVpT1Wedkv3f5xom3T/xeR/6Gx6V86PWAOB4bBpqWdN+yTcVxjIyGRz/FrDGu6w/3d7kPm8StX8RyPu+uuvpNju/vTLJV37GpvoM0oZPnW87VLnL/5pDno1NoW1R6yedU6TyUv3u19a3KFnIbTLYz+ZCLP4T0tU1uivFgso0pnsJ/UtXvarNY28Xq5cvkBDrQP/E5ZaiuQwwfmTlsOiQRU1fMuqrDd/3ISSuwjOwXOfTyGUMpZIXq4GpLn3pUcdfzch2x7XO1u2uZHOPb1G6b3Xg9PH1IIWeEpJlPQtqos2EKW8b0u8rnuP1UeVLoXJb9be0uG9nnbchjU+XTszT5VeNBThPHnc5OKj1U9aj0GTHIVaGy1YhEWT4ixns00DT+XEzWn/7VAsIc63Cov3OdyhwjrnaqQqZvWKXdypRdlq+k8msZ031U+Rm4fA+3TtyeR9hwfW9G9yxDN0fZMN33F+9TE6md4hwoxumfaUzI9fN3PFT3xVV2msrQ3UsnChm6Nulk8TndpS28D3zX9tTIPsF/z7Am5OkTjm1tI1JZW74+4VgsZ0N3L1yXV3WeP5uR7TGHHdvC3JQlxybfpd22tDlk/2eofRK8TzrN/qnar/K/OUTth6I/+jAnEptNbPvFHP2gs40N3+dfMWtwqvVct7/wfd8gtQ7imifial9ZJ9/3IHLYU6eDj3+4PhsNhX+vwvcWLnu6kGfEMe8DuciPfUfGZB8X/7HJy/Gefe5n+VRGFd/wyP2ta7/LO4yh/sbLV/k9lev6kfO9Dt/5U67b1/6u/epqB1U9Me23jfHY9sscAg4tkbLl+e4/U36rJ9ddxfd6sg5vq5ice42Wpk/pb9FOJ36/W9tpv4kbC79nUbZceX8Zu6/qJ+P3WvhvA8v3reh7Jbn2d6rrNC7XNZTLma4Ba0JI9efX2uLzF5scG/w9UNU1ZxW+ymUfzELeTllXlQ1rUuhzjS5fp9c964iFBOqeSz63bU065nZKdU+mDEz3qHIjjifquw0pnb/raRtvrnsYcb46ihT3taoYz6brdNW9l6rWRnE/navdPn1XlR1km7hcz1WlH/elKuSOSvLLuE8U6m8uzwRdfcGl73VyTHuyMvzJ1Sa2cWDTP/Z63Kc94n2B1PYr24dz1JlyHLlcP+S4B6vD1c9EW4q2LWstCvUjeVy63k/LMYdUNd5D1xQfvVTzX1VjkMsUv88N8VH5fReVn/Fjn++/h6X6Q8a6b1/q3g/i/ewi0/Scs8zxXeV6mWIOUPlPzBgdFerW+bZrm2P18dnjuK6HunEp+rHvPMXbr+sHVb/lnL+pTP57jPw9Cvk3PW178JD9qChfzuvTf7Htl38L1QUf/VKu9SFjwWbTWPvFEvu7Uq76y7+31g6QlYPc669pbsm9Xur2LWI9Pu8ypfDXqm3A2z8s1FWGn4ntL9NfQu2oSlftX9uetvTtv7J8Ql4zxfXGZ3zk8PeQ9w59x2uMfqI8/q5eKh/l9cb2rwsu9rSNl06ZP2Pmxtz+rNMx93yno0n2/82rVH7rQ+y9P15H6FyRun9ViH81ATmffI7nJ5r8uXXW6enbP6b/B8/l5OifVHYLnb9S39s2zcc+Ph+rh8+eQgVPS72elzGWY/tUtbbabBpDiI7yN1q6/4th2y+ErAc5+9BVvu/7KamJbWNZeuqI/R4tRf+YyD1HmOZM1bMV3/14Sn10c0Xu+Sj1nOXb5jL73ncdy02uvlXZNde65dOHYl7Vs4KYuS6FzWLn2zJlpZqPXPVPOa5yzKOyn1VhT9lmMfdbfH7D11Wf2PXN5h9y+dD287+qxgSnaYmnIrRtIb8pJe6/Uv9OVer6Whn0zfGO/BEloZI9ojmfAlUflClDd178bTmVHVTpZXOkAlk/lb42UujmI89HH5V+cl7XtowY6vTxLVWok6UrGzoGTHN+bB+6ri05687VNpvfuvRfaP2uMlNQth1D5JjGelm/8yn+9p3p/7qk9gnfeddXZmq/Sm333PJT659Kv1zjNbZ9uv2Oi//67CV8/N1nj1DmviyXDNVeJkaeaX8UsyesYg8cu2+NvdaPfb+lLDu5tvt/"));class ii{constructor(t,n=!1){this.position=t,this.required=n}}
|
|
314
314
|
/**
|
|
315
315
|
@function textSplit
|
|
316
316
|
@desc Splits a given sentence into an array of words.
|
|
@@ -460,7 +460,7 @@ this.LB8a=31===this.nextClass,t)return new ii(this.lastPos)}return this.lastPos<
|
|
|
460
460
|
* @desc finds all prototype methods of a class and it's parent classes
|
|
461
461
|
* @param {*} obj
|
|
462
462
|
* @private
|
|
463
|
-
*/function Pi(t){let n=[];for(;n=n.concat(Object.getOwnPropertyNames(t)),(t=Object.getPrototypeOf(t))&&t!==Object.prototype;);return n.filter(t=>0!==t.indexOf("_")&&!["config","constructor","parent","render"].includes(t))}class
|
|
463
|
+
*/function Pi(t){let n=[];for(;n=n.concat(Object.getOwnPropertyNames(t)),(t=Object.getPrototypeOf(t))&&t!==Object.prototype;);return n.filter(t=>0!==t.indexOf("_")&&!["config","constructor","parent","render"].includes(t))}class Li{
|
|
464
464
|
/**
|
|
465
465
|
@memberof BaseClass
|
|
466
466
|
@desc If *value* is specified, sets the methods that correspond to the key/value pairs and returns this class. If *value* is not specified, returns the current configuration.
|
|
@@ -538,7 +538,7 @@ this.LB8a=31===this.nextClass,t)return new ii(this.lastPos)}return this.lastPos<
|
|
|
538
538
|
@param {Object} [config = this._shapeConfig] The configuration object to parse.
|
|
539
539
|
@param {String} [type = "shape"] The event classifier to user for "on" events. For example, the default event type of "shape" will apply all events in the "on" config object with that key, like "click.shape" and "mouseleave.shape", in addition to any gloval events like "click" and "mouseleave".
|
|
540
540
|
@param {String} [nest] An optional nested key to bubble up to the parent config level.
|
|
541
|
-
*/function
|
|
541
|
+
*/function Lt(t=this._shapeConfig,i="shape",n=!1){var e={duration:this._duration,on:{}};let a=r=>(t,n,e,i)=>{if(!r)return r;let a;for(;t.__d3plus__;)a&&(t.__d3plusParent__=a),n=(a=t).i,t=t.data||t.feature;return r.bind(this)(t,n,e||a,i)},r=(t,n)=>{for(var e in n)({}.hasOwnProperty.call(n,e)&&!e.includes(".")||e.includes("."+i))&&(t.on[e]=a(n[e]))},o=t=>t.map(t=>t instanceof Array?o(t):"object"==typeof t?s({},t):"function"==typeof t?a(t):t),s=(t,n)=>{for(var e in n)!{}.hasOwnProperty.call(n,e)||("on"===e?r(t,n[e]):"function"==typeof n[e]?t[e]=a(n[e]):n[e]instanceof Array?t[e]=o(n[e]):"object"==typeof n[e]?(t[e]||(t[e]={}),t[e].on={},s(t[e],n[e])):t[e]=n[e])};return s(e,t),this._on&&r(e,this._on),n&&t[n]&&(s(e,t[n]),t[n].on)&&r(e,t[n].on),e}
|
|
542
542
|
/**
|
|
543
543
|
@function constant
|
|
544
544
|
@desc Wraps non-function variables in a simple return function.
|
|
@@ -549,20 +549,20 @@ this.LB8a=31===this.nextClass,t)return new ii(this.lastPos)}return this.lastPos<
|
|
|
549
549
|
function() {
|
|
550
550
|
return 42;
|
|
551
551
|
}
|
|
552
|
-
*/function
|
|
552
|
+
*/function Bt(t){return function(){return t}}
|
|
553
553
|
/**
|
|
554
554
|
@module getProp
|
|
555
555
|
@param {String} type
|
|
556
556
|
@param {Object} d
|
|
557
557
|
@param {Number} i
|
|
558
558
|
@private
|
|
559
|
-
*/function
|
|
559
|
+
*/function Bi(t,n,e){return n[t]||this["_"+t](n,e)}function Oi(t,n){return null==t||null==n?NaN:t<n?-1:n<t?1:n<=t?0:NaN}function Di(e){let r,o,a;
|
|
560
560
|
// If an accessor is specified, promote it to a comparator. In this case we
|
|
561
561
|
// can test whether the search value is (self-) comparable. We can’t do this
|
|
562
562
|
// for a comparator (except for specific, known comparators) because we can’t
|
|
563
563
|
// tell if the comparator is symmetric, and an asymmetric comparator can’t be
|
|
564
564
|
// used to test whether a single value is comparable.
|
|
565
|
-
function s(t,n,e=0,i=t.length){if(e<i){if(0!==r(n,n))return i;do{var a=e+i>>>1;o(t[a],n)<0?e=1+a:i=a}while(e<i)}return e}return a=2!==e.length?(r=Oi,o=(t,n)=>Oi(e(t),n),(t,n)=>e(t)-n):(r=e===Oi||e===function(t,n){return null==t||null==n?NaN:n<t?-1:t<n?1:t<=n?0:NaN}?e:ji,o=e),{left:s,center:function(t,n,e=0,i=t.length){return i=s(t,n,e,i-1),e<i&&a(t[i-1],n)>-a(t[i],n)?i-1:i},right:function(t,n,e=0,i=t.length){if(e<i){if(0!==r(n,n))return i;do{var a=e+i>>>1;o(t[a],n)<=0?e=1+a:i=a}while(e<i)}return e}}}function ji(){return 0}function Ri(t){return null===t?NaN:+t}let
|
|
565
|
+
function s(t,n,e=0,i=t.length){if(e<i){if(0!==r(n,n))return i;do{var a=e+i>>>1;o(t[a],n)<0?e=1+a:i=a}while(e<i)}return e}return a=2!==e.length?(r=Oi,o=(t,n)=>Oi(e(t),n),(t,n)=>e(t)-n):(r=e===Oi||e===function(t,n){return null==t||null==n?NaN:n<t?-1:t<n?1:t<=n?0:NaN}?e:ji,o=e),{left:s,center:function(t,n,e=0,i=t.length){return i=s(t,n,e,i-1),e<i&&a(t[i-1],n)>-a(t[i],n)?i-1:i},right:function(t,n,e=0,i=t.length){if(e<i){if(0!==r(n,n))return i;do{var a=e+i>>>1;o(t[a],n)<=0?e=1+a:i=a}while(e<i)}return e}}}function ji(){return 0}function Ri(t){return null===t?NaN:+t}let Fi=Di(Oi).right;function Ii(t){t=(t=>{let n=0;var e,i;let a=0,r=0;for(i of t)null!=i&&(i=+i)>=i&&(e=i-a,a+=e/++n,r+=e*(i-a));if(1<n)return r/(n-1)})(t);return t&&Math.sqrt(t)}function Hi(n,e){let i,a;if(void 0===e)for(var t of n)null!=t&&(void 0===i?t>=t&&(i=a=t):(i>t&&(i=t),a<t&&(a=t)));else{let t=-1;for(var r of n)null!=(r=e(r,++t,n))&&(void 0===i?r>=r&&(i=a=r):(i>r&&(i=r),a<r&&(a=r)))}return[i,a]}
|
|
566
566
|
// https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Modules/mathmodule.c#L1423
|
|
567
567
|
Di(Ri).center;let Gi=class{add(n){var e=this._partials;let i=0;for(let t=0;t<this._n&&t<32;t++){var a=e[t],r=n+a,a=Math.abs(n)<Math.abs(a)?n-(r-a):a-(r-n);a&&(e[i++]=a),n=r}return e[i]=n,this._n=i+1,this}valueOf(){var t=this._partials;let n=this._n,e,i,a,r=0;if(0<n){for(r=t[--n];0<n&&(e=r,i=t[--n],r=e+i,!(a=i-(r-e))););0<n&&(a<0&&t[n-1]<0||0<a&&0<t[n-1])&&(i=2*a,e=r+i,i==e-r)&&(r=e)}return r}constructor(){this._partials=new Float64Array(32),this._n=0}};class Ki extends Map{get(t){return super.get(Ui(this,t))}has(t){return super.has(Ui(this,t))}set(t,n){return super.set((({_intern:t,_key:n},e)=>(n=n(e),t.has(n)?t.get(n):(t.set(n,e),e)))(this,t),n)}delete(t){return super.delete((({_intern:t,_key:n},e)=>(n=n(e),t.has(n)&&(e=t.get(n),t.delete(n)),e))(this,t))}constructor(e,t=function(t){return null!==t&&"object"==typeof t?t.valueOf():t}){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(let[t,n]of e)this.set(t,n)}}function Ui({_intern:t,_key:n},e){n=n(e);return t.has(n)?t.get(n):e}function Wi(t){return t}function qi(t,n,...e){return $i(t,Wi,n,e)}function $i(t,h,u,c){return function e(t,i){if(i>=c.length)return u(t);var n,a=new Ki,r=c[i++];let o=-1;for(n of t){var s=r(n,++o,t),l=a.get(s);l?l.push(n):a.set(s,[n])}for(let[t,n]of a)a.set(t,e(n,i));return h(a)}(t,0)}function Vi(t,n){return(null==t||!(t<=t))-(null==n||!(n<=n))||(t<n?-1:n<t?1:0)}let Yi=Math.sqrt(50),Zi=Math.sqrt(10),Xi=Math.sqrt(2);function Ji(t,n,e){var i=(n-t)/Math.max(0,e),a=Math.floor(Math.log10(i)),i=i/Math.pow(10,a),i=i>=Yi?10:i>=Zi?5:i>=Xi?2:1;let r,o,s;return a<0?(s=Math.pow(10,-a)/i,r=Math.round(t*s),o=Math.round(n*s),r/s<t&&++r,o/s>n&&--o,s=-s):(s=Math.pow(10,a)*i,r=Math.round(t/s),o=Math.round(n/s),r*s<t&&++r,o*s>n&&--o),o<r&&.5<=e&&e<2?Ji(t,n,2*e):[r,o,s]}function Qi(t,n,e){if(!(0<(e=+e)))return[];if((t=+t)===(n=+n))return[t];var i=n<t,[a,r,o]=i?Ji(n,t,e):Ji(t,n,e);if(!(a<=r))return[];var s=r-a+1,l=new Array(s);if(i)if(o<0)for(let t=0;t<s;++t)l[t]=(r-t)/-o;else for(let t=0;t<s;++t)l[t]=(r-t)*o;else if(o<0)for(let t=0;t<s;++t)l[t]=(a+t)/-o;else for(let t=0;t<s;++t)l[t]=(a+t)*o;return l}function ta(t,n,e){return Ji(t=+t,n=+n,e=+e)[2]}function na(t,n,e){e=+e;var i=(n=+n)<(t=+t),t=i?ta(n,t,e):ta(t,n,e);return(i?-1:1)*(t<0?1/-t:t)}function Ot(n,e){let i;if(void 0===e)for(var t of n)null!=t&&(i<t||void 0===i&&t>=t)&&(i=t);else{let t=-1;for(var a of n)null!=(a=e(a,++t,n))&&(i<a||void 0===i&&a>=a)&&(i=a)}return i}function Dt(n,e){let i;if(void 0===e)for(var t of n)null!=t&&(i>t||void 0===i&&t>=t)&&(i=t);else{let t=-1;for(var a of n)null!=(a=e(a,++t,n))&&(i>a||void 0===i&&a>=a)&&(i=a)}return i}
|
|
568
568
|
// Based on https://github.com/mourner/quickselect
|
|
@@ -574,15 +574,15 @@ if(t instanceof ha)t.each(function(t,n){e.set(n,t)});else if(Array.isArray(t)){v
|
|
|
574
574
|
// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].
|
|
575
575
|
function Ma(t,n,e){var i=t[0],t=t[1],a=n[0],n=n[1],a=t<i?(i=Ca(t,i),e(n,a)):(i=Ca(i,t),e(a,n));return function(t){return a(i(t))}}function Aa(e,t,n){var i=Math.min(e.length,t.length)-1,a=new Array(i),r=new Array(i),o=-1;
|
|
576
576
|
// Reverse descending domains.
|
|
577
|
-
for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<i;)a[o]=Ca(e[o],e[o+1]),r[o]=n(t[o],t[o+1]);return function(t){var n=
|
|
577
|
+
for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<i;)a[o]=Ca(e[o],e[o+1]),r[o]=n(t[o],t[o+1]);return function(t){var n=Fi(e,t,1,i)-1;return r[n](a[n](t))}}function za(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Ta(){var e,i,n,a,r,o,s=Sa,l=Sa,h=ie,u=ka;function c(){var n,e,t,i=Math.min(s.length,l.length);return u!==ka&&(n=s[0],(e=s[i-1])<n&&(t=n,n=e,e=t),u=function(t){return Math.max(n,Math.min(e,t))}),a=2<i?Aa:Ma,r=o=null,g}function g(t){return null==t||isNaN(t=+t)?n:(r=r||a(s.map(e),l,h))(e(u(t)))}return g.invert=function(t){return u(i((o=o||a(l,s.map(e),Jn))(t)))},g.domain=function(t){return arguments.length?(s=Array.from(t,wa),c()):s.slice()},g.range=function(t){return arguments.length?(l=Array.from(t),c()):l.slice()},g.rangeRound=function(t){return l=Array.from(t),h=ae,c()},g.clamp=function(t){return arguments.length?(u=!!t||ka,c()):u!==ka},g.interpolate=function(t){return arguments.length?(h=t,c()):h},g.unknown=function(t){return arguments.length?(n=t,g):n},function(t,n){return e=t,i=n,c()}}function Ea(){return Ta()(ka,ka)}
|
|
578
578
|
// Computes the decimal coefficient and exponent of the specified number x with
|
|
579
579
|
// significant digits p, where x is positive and p is in [1, 21] or undefined.
|
|
580
580
|
// For example, formatDecimalParts(1.23) returns ["123", 0].
|
|
581
581
|
function Na(t,n){var e;// NaN, ±Infinity
|
|
582
582
|
return(n=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0?null:[1<(e=t.slice(0,n)).length?e[0]+e.slice(2):e,+t.slice(n+1)]}function Pa(t){return(t=Na(Math.abs(t)))?t[1]:NaN}
|
|
583
583
|
// [[fill]align][sign][symbol][0][width][,][.precision][~][type]
|
|
584
|
-
var Ba
|
|
585
|
-
function Da(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 ja(t,n){var e,n=Na(t,n);return n?(e=n[0],(n=n[1])<0?"0."+new Array(-n).join("0")+e:e.length>n+1?e.slice(0,n+1)+"."+e.slice(n+1):e+new Array(n-e.length+2).join("0")):t+""}Oa.prototype=Da.prototype,Da.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 Ra={"%":(t,n)=>(100*t).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return 1e21<=Math.abs(t=Math.round(t))?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>ja(100*t,n),r:ja,s:function(t,n){var e,i,a=Na(t,n);return a?(e=a[0],(a=(a=a[1])-(
|
|
584
|
+
var La,Ba=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Oa(t){var n;if(n=Ba.exec(t))return new Da({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]});throw new Error("invalid format: "+t)}// instanceof
|
|
585
|
+
function Da(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 ja(t,n){var e,n=Na(t,n);return n?(e=n[0],(n=n[1])<0?"0."+new Array(-n).join("0")+e:e.length>n+1?e.slice(0,n+1)+"."+e.slice(n+1):e+new Array(n-e.length+2).join("0")):t+""}Oa.prototype=Da.prototype,Da.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 Ra={"%":(t,n)=>(100*t).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return 1e21<=Math.abs(t=Math.round(t))?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>ja(100*t,n),r:ja,s:function(t,n){var e,i,a=Na(t,n);return a?(e=a[0],(a=(a=a[1])-(La=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1)===(i=e.length)?e:i<a?e+new Array(a-i+1).join("0"):0<a?e.slice(0,a)+"."+e.slice(a):"0."+new Array(1-a).join("0")+Na(t,Math.max(0,n+a-1))[0]):t+""},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Fa(t){return t}var Ia,Ha,Ga=Array.prototype.map,Ka=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ua(t){var n,s,l,w=void 0===t.grouping||void 0===t.thousands?Fa:(s=Ga.call(t.grouping,Number),l=t.thousands+"",function(t,n){for(var e=t.length,i=[],a=0,r=s[0],o=0;0<e&&0<r&&(n<o+r+1&&(r=Math.max(1,n-o)),i.push(t.substring(e-=r,e+r)),!((o+=r+1)>n));)r=s[a=(a+1)%s.length];return i.reverse().join(l)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",S=void 0===t.decimal?".":t.decimal+"",k=void 0===t.numerals?Fa:(n=Ga.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return n[+t]})}),r=void 0===t.percent?"%":t.percent+"",C=void 0===t.minus?"−":t.minus+"",M=void 0===t.nan?"NaN":t.nan+"";function o(t){var h=(t=Oa(t)).fill,u=t.align,c=t.sign,n=t.symbol,g=t.zero,d=t.width,f=t.comma,p=t.precision,_=t.trim,m=t.type,y=(
|
|
586
586
|
// The "n" type is an alias for ",g".
|
|
587
587
|
"n"===m?(f=!0,m="g"):Ra[m]||(void 0===p&&(p=12),_=!0,m="g"),
|
|
588
588
|
// If zero fill is specified, padding goes after sign and before digits.
|
|
@@ -600,7 +600,7 @@ t=>{t:for(var n,e=t.length,i=1,a=-1;i<e;++i)switch(t[i]){case".":a=n=i;break;cas
|
|
|
600
600
|
// Compute the prefix and suffix.
|
|
601
601
|
a=((
|
|
602
602
|
// If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.
|
|
603
|
-
o=o&&0==+t&&"+"!==c?!1:o)?"("===c?c:C:"-"===c||"("===c?"":c)+a,r=("s"===m?Ka[8+
|
|
603
|
+
o=o&&0==+t&&"+"!==c?!1:o)?"("===c?c:C:"-"===c||"("===c?"":c)+a,r=("s"===m?Ka[8+La/3]:"")+r+(o&&"("===c?")":""),x)for(n=-1,e=t.length;++n<e;)if((i=t.charCodeAt(n))<48||57<i){r=(46===i?S+t.slice(n+1):t.slice(n))+r,t=t.slice(0,n);break}}
|
|
604
604
|
// If the fill character is not "0", grouping is applied before padding.
|
|
605
605
|
f&&!g&&(t=w(t,1/0));
|
|
606
606
|
// Compute the padding.
|
|
@@ -612,20 +612,20 @@ switch(f&&g&&(t=w(l+t,l.length?d-r.length:1/0),l=""),u){case"<":t=a+t+r+l;break;
|
|
|
612
612
|
// or clamp the specified precision to the supported range.
|
|
613
613
|
// For significant precision, it must be in [1, 21].
|
|
614
614
|
// For fixed precision, it must be in [0, 20].
|
|
615
|
-
return p=void 0===p?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,p)):Math.max(0,Math.min(20,p)),e.toString=function(){return t+""},e}return{format:o,formatPrefix:function(t,n){var e=o(((t=Oa(t)).type="f",t)),t=3*Math.max(-8,Math.min(8,Math.floor(Pa(n)/3))),i=Math.pow(10,-t),a=Ka[8+t/3];return function(t){return e(i*t)+a}}}}function Wa(t,n,e,i){var a,r,o=na(t,n,e);switch((i=Oa(null==i?",f":i)).type){case"s":var s=Math.max(Math.abs(t),Math.abs(n));return null!=i.precision||isNaN((r=o,r=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Pa(s)/3)))-Pa(Math.abs(r)))))||(i.precision=r),Ha(i,s);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN((s=o,a=Math.max(Math.abs(t),Math.abs(n)),s=Math.abs(s),a=Math.abs(a)-s,r=Math.max(0,Pa(a)-Pa(s))+1))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=Math.max(0,-Pa(Math.abs(o))))||(i.precision=r-2*("%"===i.type))}return
|
|
616
|
-
return t=>{let n=t/g(Math.round(c(t)));return n*u<u-.5&&(n*=u),n<=i?e(t):""}},a.nice=()=>h(Va(h(),{floor:t=>g(Math.floor(c(t))),ceil:t=>g(Math.ceil(c(t)))})),a}function er(){let t=nr(Ta()).domain([1,10]);return t.copy=()=>za(t,er()).base(t.base()),ma.apply(t,arguments),t}function ir(n){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/n))}}function ar(n){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*n}}function rr(n){var e=1,t=n(ir(e),ar(e));return t.constant=function(t){return arguments.length?n(ir(e=+t),ar(e)):e},qa(t)}function or(n){return function(t){return t<0?-Math.pow(-t,n):Math.pow(t,n)}}function sr(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function lr(t){return t<0?-t*t:t*t}function hr(n){var t=n(ka,ka),e=1;return t.exponent=function(t){return arguments.length?1===(e=+t)?n(ka,ka):.5===e?n(sr,lr):n(or(e),or(1/e)):e},qa(t)}function ur(){var t=hr(Ta());return t.copy=function(){return za(t,ur()).exponent(t.exponent())},ma.apply(t,arguments),t}function cr(t){return Math.sign(t)*t*t}function gr(){var n,e=[.5],i=[0,1],a=1;function r(t){return null!=t&&t<=t?i[
|
|
615
|
+
return p=void 0===p?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,p)):Math.max(0,Math.min(20,p)),e.toString=function(){return t+""},e}return{format:o,formatPrefix:function(t,n){var e=o(((t=Oa(t)).type="f",t)),t=3*Math.max(-8,Math.min(8,Math.floor(Pa(n)/3))),i=Math.pow(10,-t),a=Ka[8+t/3];return function(t){return e(i*t)+a}}}}function Wa(t,n,e,i){var a,r,o=na(t,n,e);switch((i=Oa(null==i?",f":i)).type){case"s":var s=Math.max(Math.abs(t),Math.abs(n));return null!=i.precision||isNaN((r=o,r=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Pa(s)/3)))-Pa(Math.abs(r)))))||(i.precision=r),Ha(i,s);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN((s=o,a=Math.max(Math.abs(t),Math.abs(n)),s=Math.abs(s),a=Math.abs(a)-s,r=Math.max(0,Pa(a)-Pa(s))+1))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=Math.max(0,-Pa(Math.abs(o))))||(i.precision=r-2*("%"===i.type))}return Ia(i)}function qa(h){var u=h.domain;return h.ticks=function(t){var n=u();return Qi(n[0],n[n.length-1],null==t?10:t)},h.tickFormat=function(t,n){var e=u();return Wa(e[0],e[e.length-1],null==t?10:t,n)},h.nice=function(t){null==t&&(t=10);var n,e,i=u(),a=0,r=i.length-1,o=i[a],s=i[r],l=10;for(s<o&&(e=o,o=s,s=e,e=a,a=r,r=e);0<l--;){if((e=ta(o,s,t))===n)return i[a]=o,i[r]=s,u(i);if(0<e)o=Math.floor(o/e)*e,s=Math.ceil(s/e)*e;else{if(!(e<0))break;o=Math.ceil(o*e)/e,s=Math.floor(s*e)/e}n=e}return h},h}function $a(){var t=Ea();return t.copy=function(){return za(t,$a())},ma.apply(t,arguments),qa(t)}function Va(t,n){var e,i=0,a=(t=t.slice()).length-1,r=t[i],o=t[a];return o<r&&(e=i,i=a,a=e,e=r,r=o,o=e),t[i]=n.floor(r),t[a]=n.ceil(o),t}function Ya(t){return Math.log(t)}function Za(t){return Math.exp(t)}function Xa(t){return-Math.log(-t)}function Ja(t){return-Math.exp(-t)}function Qa(t){return isFinite(t)?+("1e"+t):t<0?0:t}function tr(e){return(t,n)=>-e(-t,n)}function nr(t){let a=t(Ya,Za),h=a.domain,u=10,c,g;function n(){var n,e;return c=(e=u)===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e),g=10===(n=u)?Qa:n===Math.E?Math.exp:t=>Math.pow(n,t),h()[0]<0?(c=tr(c),g=tr(g),t(Xa,Ja)):t(Ya,Za),a}return a.base=function(t){return arguments.length?(u=+t,n()):u},a.domain=function(t){return(arguments.length?(h(t),n):h)()},a.ticks=t=>{var n=h();let e=n[0],i=n[n.length-1];n=i<e;n&&([e,i]=[i,e]);let a=c(e),r=c(i),o,s;t=null==t?10:+t;let l=[];if(!(u%1)&&r-a<t){if(a=Math.floor(a),r=Math.ceil(r),0<e){for(;a<=r;++a)for(o=1;o<u;++o)if(!((s=a<0?o/g(-a):o*g(a))<e)){if(s>i)break;l.push(s)}}else for(;a<=r;++a)for(o=u-1;1<=o;--o)if(!((s=0<a?o/g(-a):o*g(a))<e)){if(s>i)break;l.push(s)}2*l.length<t&&(l=Qi(e,i,t))}else l=Qi(a,r,Math.min(r-a,t)).map(g);return n?l.reverse():l},a.tickFormat=(t,e)=>{if(null==t&&(t=10),"function"!=typeof(e=null==e?10===u?"s":",":e)&&(u%1||null!=(e=Oa(e)).precision||(e.trim=!0),e=Ia(e)),t===1/0)return e;let i=Math.max(1,u*t/a.ticks().length);// TODO fast estimate?
|
|
616
|
+
return t=>{let n=t/g(Math.round(c(t)));return n*u<u-.5&&(n*=u),n<=i?e(t):""}},a.nice=()=>h(Va(h(),{floor:t=>g(Math.floor(c(t))),ceil:t=>g(Math.ceil(c(t)))})),a}function er(){let t=nr(Ta()).domain([1,10]);return t.copy=()=>za(t,er()).base(t.base()),ma.apply(t,arguments),t}function ir(n){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/n))}}function ar(n){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*n}}function rr(n){var e=1,t=n(ir(e),ar(e));return t.constant=function(t){return arguments.length?n(ir(e=+t),ar(e)):e},qa(t)}function or(n){return function(t){return t<0?-Math.pow(-t,n):Math.pow(t,n)}}function sr(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function lr(t){return t<0?-t*t:t*t}function hr(n){var t=n(ka,ka),e=1;return t.exponent=function(t){return arguments.length?1===(e=+t)?n(ka,ka):.5===e?n(sr,lr):n(or(e),or(1/e)):e},qa(t)}function ur(){var t=hr(Ta());return t.copy=function(){return za(t,ur()).exponent(t.exponent())},ma.apply(t,arguments),t}function cr(t){return Math.sign(t)*t*t}function gr(){var n,e=[.5],i=[0,1],a=1;function r(t){return null!=t&&t<=t?i[Fi(e,t,0,a)]:n}return r.domain=function(t){return arguments.length?(e=Array.from(t),a=Math.min(e.length,i.length-1),r):e.slice()},r.range=function(t){return arguments.length?(i=Array.from(t),a=Math.min(e.length,i.length-1),r):i.slice()},r.invertExtent=function(t){t=i.indexOf(t);return[e[t-1],e[t]]},r.unknown=function(t){return arguments.length?(n=t,r):n},r.copy=function(){return gr().domain(e).range(i).unknown(n)},ma.apply(r,arguments)}pn=Ua({thousands:",",grouping:[3],currency:["$",""]}),Ia=pn.format,Ha=pn.formatPrefix;let dr=new Date,fr=new Date;function pr(r,o,e,i){function s(t){return r(t=0===arguments.length?new Date:new Date(+t)),t}return s.floor=t=>(r(t=new Date(+t)),t),s.ceil=t=>(r(t=new Date(t-1)),o(t,1),r(t),t),s.round=t=>{var n=s(t),e=s.ceil(t);return t-n<e-t?n:e},s.offset=(t,n)=>(o(t=new Date(+t),null==n?1:Math.floor(n)),t),s.range=(t,n,e)=>{var i,a=[];if(t=s.ceil(t),e=null==e?1:Math.floor(e),t<n&&0<e)for(;a.push(i=new Date(+t)),o(t,e),r(t),i<t&&t<n;);// also handles Invalid Date
|
|
617
617
|
return a},s.filter=e=>pr(t=>{if(t<=t)for(;r(t),!e(t);)t.setTime(t-1)},(t,n)=>{if(t<=t)if(n<0)for(;++n<=0;)for(;o(t,-1),!e(t););// eslint-disable-line no-empty
|
|
618
618
|
else for(;0<=--n;)for(;o(t,1),!e(t););// eslint-disable-line no-empty
|
|
619
619
|
}),e&&(s.count=(t,n)=>(dr.setTime(+t),fr.setTime(+n),r(dr),r(fr),Math.floor(e(dr,fr))),s.every=n=>(n=Math.floor(n),isFinite(n)&&0<n?1<n?s.filter(i?t=>i(t)%n==0:t=>s.count(0,t)%n==0):s:null)),s}let _r=pr(()=>{
|
|
620
620
|
// noop
|
|
621
621
|
},(t,n)=>{t.setTime(+t+n)},(t,n)=>n-t),mr=(
|
|
622
622
|
// An optimized implementation for this simple case.
|
|
623
|
-
_r.every=e=>(e=Math.floor(e),isFinite(e)&&0<e?1<e?pr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):_r:null),_r,1e3),yr=6e4,vr=36e5,br=864e5,xr=7*br,wr=(br,365*br),Sr=pr(t=>{t.setTime(t-t.getMilliseconds())},(t,n)=>{t.setTime(+t+n*mr)},(t,n)=>(n-t)/mr,t=>t.getUTCSeconds()),kr=(Sr.range,pr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mr)},(t,n)=>{t.setTime(+t+n*yr)},(t,n)=>(n-t)/yr,t=>t.getMinutes())),Cr=(kr.range,pr(t=>{t.setUTCSeconds(0,0)},(t,n)=>{t.setTime(+t+n*yr)},(t,n)=>(n-t)/yr,t=>t.getUTCMinutes())),Mr=(Cr.range,pr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mr-t.getMinutes()*yr)},(t,n)=>{t.setTime(+t+n*vr)},(t,n)=>(n-t)/vr,t=>t.getHours())),Ar=(Mr.range,pr(t=>{t.setUTCMinutes(0,0,0)},(t,n)=>{t.setTime(+t+n*vr)},(t,n)=>(n-t)/vr,t=>t.getUTCHours())),zr=(Ar.range,pr(t=>t.setHours(0,0,0,0),(t,n)=>t.setDate(t.getDate()+n),(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*yr)/br,t=>t.getDate()-1)),Tr=(zr.range,pr(t=>{t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n)},(t,n)=>(n-t)/br,t=>t.getUTCDate()-1));Tr.range;mn=pr(t=>{t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n)},(t,n)=>(n-t)/br,t=>Math.floor(t/br));function Er(n){return pr(t=>{t.setDate(t.getDate()-(t.getDay()+7-n)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+7*n)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*yr)/xr)}mn.range;let Nr=Er(0),Pr=Er(1);_n=Er(2),n=Er(3);let
|
|
623
|
+
_r.every=e=>(e=Math.floor(e),isFinite(e)&&0<e?1<e?pr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):_r:null),_r,1e3),yr=6e4,vr=36e5,br=864e5,xr=7*br,wr=(br,365*br),Sr=pr(t=>{t.setTime(t-t.getMilliseconds())},(t,n)=>{t.setTime(+t+n*mr)},(t,n)=>(n-t)/mr,t=>t.getUTCSeconds()),kr=(Sr.range,pr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mr)},(t,n)=>{t.setTime(+t+n*yr)},(t,n)=>(n-t)/yr,t=>t.getMinutes())),Cr=(kr.range,pr(t=>{t.setUTCSeconds(0,0)},(t,n)=>{t.setTime(+t+n*yr)},(t,n)=>(n-t)/yr,t=>t.getUTCMinutes())),Mr=(Cr.range,pr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mr-t.getMinutes()*yr)},(t,n)=>{t.setTime(+t+n*vr)},(t,n)=>(n-t)/vr,t=>t.getHours())),Ar=(Mr.range,pr(t=>{t.setUTCMinutes(0,0,0)},(t,n)=>{t.setTime(+t+n*vr)},(t,n)=>(n-t)/vr,t=>t.getUTCHours())),zr=(Ar.range,pr(t=>t.setHours(0,0,0,0),(t,n)=>t.setDate(t.getDate()+n),(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*yr)/br,t=>t.getDate()-1)),Tr=(zr.range,pr(t=>{t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n)},(t,n)=>(n-t)/br,t=>t.getUTCDate()-1));Tr.range;mn=pr(t=>{t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n)},(t,n)=>(n-t)/br,t=>Math.floor(t/br));function Er(n){return pr(t=>{t.setDate(t.getDate()-(t.getDay()+7-n)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+7*n)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*yr)/xr)}mn.range;let Nr=Er(0),Pr=Er(1);_n=Er(2),n=Er(3);let Lr=Er(4);var pn=Er(5),Br=Er(6);function Or(n){return pr(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-n)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+7*n)},(t,n)=>(n-t)/xr)}Nr.range,Pr.range,_n.range,n.range,Lr.range,pn.range,Br.range;let Dr=Or(0),jr=Or(1);_n=Or(2),n=Or(3);let Rr=Or(4);pn=Or(5),Br=Or(6);Dr.range,jr.range,_n.range,n.range,Rr.range,pn.range,Br.range;let Fr=pr(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,n)=>{t.setMonth(t.getMonth()+n)},(t,n)=>n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear()),t=>t.getMonth()),Ir=(Fr.range,pr(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCMonth(t.getUTCMonth()+n)},(t,n)=>n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear()),t=>t.getUTCMonth())),Hr=(Ir.range,pr(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n)},(t,n)=>n.getFullYear()-t.getFullYear(),t=>t.getFullYear())),Gr=(
|
|
624
624
|
// An optimized implementation for this simple case.
|
|
625
625
|
Hr.every=e=>isFinite(e=Math.floor(e))&&0<e?pr(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null,Hr,pr(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n)},(t,n)=>n.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear()));function Kr(r,t,n,e,i,a){let o=[[Sr,1,mr],[Sr,5,5e3],[Sr,15,15e3],[Sr,30,3e4],[a,1,yr],[a,5,3e5],[a,15,9e5],[a,30,18e5],[i,1,vr],[i,3,3*vr],[i,6,6*vr],[i,12,432e5],[e,1,br],[e,2,2*br],[n,1,xr],[t,1,2592e6],[t,3,7776e6],[r,1,wr]];function s(t,n,e){var i=Math.abs(n-t)/e,a=Di(([,,t])=>t).right(o,i);return a===o.length?r.every(na(t/wr,n/wr,e)):0===a?_r.every(Math.max(na(t,n,e),1)):([t,n]=o[i/o[a-1][2]<o[a][2]/i?a-1:a],t.every(n))}return[function(t,n,e){var i=n<t;i&&([t,n]=[n,t]);e=(e=e&&"function"==typeof e.range?e:s(t,n,e))?e.range(t,+n+1):[];// inclusive stop
|
|
626
626
|
return i?e.reverse():e},s]}
|
|
627
627
|
// An optimized implementation for this simple case.
|
|
628
|
-
Gr.every=e=>isFinite(e=Math.floor(e))&&0<e?pr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null,Gr;let[Ur,Wr]=Kr(Gr,
|
|
628
|
+
Gr.every=e=>isFinite(e=Math.floor(e))&&0<e?pr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null,Gr;let[Ur,Wr]=Kr(Gr,Ir,Dr,mn,Ar,Cr),[qr,$r]=Kr(Hr,Fr,Nr,zr,Mr,kr);function Vr(t){var n;return 0<=t.y&&t.y<100?((n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L)).setFullYear(t.y),n):new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Yr(t){var n;return 0<=t.y&&t.y<100?((n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L))).setUTCFullYear(t.y),n):new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Zr(t,n,e){return{y:t,m:n,d:e,H:0,M:0,S:0,L:0}}function Xr(t){var i=t.dateTime,a=t.date,r=t.time,n=t.periods,e=t.days,o=t.shortDays,s=t.months,l=t.shortMonths,h=so(n),u=lo(n),c=so(e),g=lo(e),d=so(o),f=lo(o),p=so(s),_=lo(s),m=so(l),y=lo(l),v={a:function(t){return o[t.getDay()]},A:function(t){return e[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:Eo,e:Eo,f:Oo,g:qo,G:Vo,H:No,I:Po,j:Lo,L:Bo,m:Do,M:jo,p:function(t){return n[+(12<=t.getHours())]},q:function(t){return 1+~~(t.getMonth()/3)},Q:ms,s:ys,S:Ro,u:Fo,U:Io,V:Go,w:Ko,W:Uo,x:null,X:null,y:Wo,Y:$o,Z:Yo,"%":_s},b={a:function(t){return o[t.getUTCDay()]},A:function(t){return e[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:Zo,e:Zo,f:ns,g:gs,G:fs,H:Xo,I:Jo,j:Qo,L:ts,m:es,M:is,p:function(t){return n[+(12<=t.getUTCHours())]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:ms,s:ys,S:as,u:rs,U:os,V:ls,w:hs,W:us,x:null,X:null,y:cs,Y:ds,Z:ps,"%":_s},x={a:function(t,n,e){n=d.exec(n.slice(e));return n?(t.w=f.get(n[0].toLowerCase()),e+n[0].length):-1},A:function(t,n,e){n=c.exec(n.slice(e));return n?(t.w=g.get(n[0].toLowerCase()),e+n[0].length):-1},b:function(t,n,e){n=m.exec(n.slice(e));return n?(t.m=y.get(n[0].toLowerCase()),e+n[0].length):-1},B:function(t,n,e){n=p.exec(n.slice(e));return n?(t.m=_.get(n[0].toLowerCase()),e+n[0].length):-1},c:function(t,n,e){return k(t,i,n,e)},d:bo,e:bo,f:Mo,g:_o,G:po,H:wo,I:wo,j:xo,L:Co,m:vo,M:So,p:function(t,n,e){n=h.exec(n.slice(e));return n?(t.p=u.get(n[0].toLowerCase()),e+n[0].length):-1},q:yo,Q:zo,s:To,S:ko,u:uo,U:co,V:go,w:ho,W:fo,x:function(t,n,e){return k(t,a,n,e)},X:function(t,n,e){return k(t,r,n,e)},y:_o,Y:po,Z:mo,"%":Ao};function w(l,h){return function(t){var n,e,i,a=[],r=-1,o=0,s=l.length;for(t instanceof Date||(t=new Date(+t));++r<s;)37===l.charCodeAt(r)&&(a.push(l.slice(o,r)),null!=(e=no[n=l.charAt(++r)])?n=l.charAt(++r):e="e"===n?" ":"0",(i=h[n])&&(n=i(t,e)),a.push(n),o=r+1);return a.push(l.slice(o,r)),a.join("")}}function S(a,r){return function(t){var n,e,i=Zr(1900,void 0,1);if(k(i,a,t+="",0)!=t.length)return null;
|
|
629
629
|
// If a UNIX timestamp is specified, return it.
|
|
630
630
|
if("Q"in i)return new Date(i.Q);if("s"in i)return new Date(1e3*i.s+("L"in i?i.L:0));
|
|
631
631
|
// If this is utcParse, never use the local timezone.
|
|
@@ -641,7 +641,7 @@ return("Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,Yr):Vr)(i);
|
|
|
641
641
|
// Otherwise, all fields are in local time.
|
|
642
642
|
}}function k(t,n,e,i){for(var a,r,o=0,s=n.length,l=e.length;o<s;){if(l<=i)return-1;if(37===(a=n.charCodeAt(o++))){if(a=n.charAt(o++),!(r=x[a in no?n.charAt(o++):a])||(i=r(t,e,i))<0)return-1}else if(a!=e.charCodeAt(i++))return-1}return i}
|
|
643
643
|
// These recursive directive definitions must be deferred.
|
|
644
|
-
return v.x=w(a,v),v.X=w(r,v),v.c=w(i,v),b.x=w(a,b),b.X=w(r,b),b.c=w(i,b),{format:function(t){var n=w(t+="",v);return n.toString=function(){return t},n},parse:function(t){var n=S(t+="",!1);return n.toString=function(){return t},n},utcFormat:function(t){var n=w(t+="",b);return n.toString=function(){return t},n},utcParse:function(t){var n=S(t+="",!0);return n.toString=function(){return t},n}}}var Jr,Qr,to,no={"-":"",_:" ",0:"0"},eo=/^\s*\d+/,io=/^%/,ao=/[\\^$*+?|[\]().{}]/g;function ro(t,n,e){var i=t<0?"-":"",t=(i?-t:t)+"",a=t.length;return i+(a<e?new Array(e-a+1).join(n)+t:t)}function oo(t){return t.replace(ao,"\\$&")}function so(t){return new RegExp("^(?:"+t.map(oo).join("|")+")","i")}function lo(t){return new Map(t.map((t,n)=>[t.toLowerCase(),n]))}function ho(t,n,e){n=eo.exec(n.slice(e,e+1));return n?(t.w=+n[0],e+n[0].length):-1}function uo(t,n,e){n=eo.exec(n.slice(e,e+1));return n?(t.u=+n[0],e+n[0].length):-1}function co(t,n,e){n=eo.exec(n.slice(e,e+2));return n?(t.U=+n[0],e+n[0].length):-1}function go(t,n,e){n=eo.exec(n.slice(e,e+2));return n?(t.V=+n[0],e+n[0].length):-1}function fo(t,n,e){n=eo.exec(n.slice(e,e+2));return n?(t.W=+n[0],e+n[0].length):-1}function po(t,n,e){n=eo.exec(n.slice(e,e+4));return n?(t.y=+n[0],e+n[0].length):-1}function _o(t,n,e){n=eo.exec(n.slice(e,e+2));return n?(t.y=+n[0]+(68<+n[0]?1900:2e3),e+n[0].length):-1}function mo(t,n,e){n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),e+n[0].length):-1}function yo(t,n,e){n=eo.exec(n.slice(e,e+1));return n?(t.q=3*n[0]-3,e+n[0].length):-1}function vo(t,n,e){n=eo.exec(n.slice(e,e+2));return n?(t.m=n[0]-1,e+n[0].length):-1}function bo(t,n,e){n=eo.exec(n.slice(e,e+2));return n?(t.d=+n[0],e+n[0].length):-1}function xo(t,n,e){n=eo.exec(n.slice(e,e+3));return n?(t.m=0,t.d=+n[0],e+n[0].length):-1}function wo(t,n,e){n=eo.exec(n.slice(e,e+2));return n?(t.H=+n[0],e+n[0].length):-1}function So(t,n,e){n=eo.exec(n.slice(e,e+2));return n?(t.M=+n[0],e+n[0].length):-1}function ko(t,n,e){n=eo.exec(n.slice(e,e+2));return n?(t.S=+n[0],e+n[0].length):-1}function Co(t,n,e){n=eo.exec(n.slice(e,e+3));return n?(t.L=+n[0],e+n[0].length):-1}function Mo(t,n,e){n=eo.exec(n.slice(e,e+6));return n?(t.L=Math.floor(n[0]/1e3),e+n[0].length):-1}function Ao(t,n,e){n=io.exec(n.slice(e,e+1));return n?e+n[0].length:-1}function zo(t,n,e){n=eo.exec(n.slice(e));return n?(t.Q=+n[0],e+n[0].length):-1}function To(t,n,e){n=eo.exec(n.slice(e));return n?(t.s=+n[0],e+n[0].length):-1}function Eo(t,n){return ro(t.getDate(),n,2)}function No(t,n){return ro(t.getHours(),n,2)}function Po(t,n){return ro(t.getHours()%12||12,n,2)}function Bo(t,n){return ro(1+zr.count(Hr(t),t),n,3)}function Lo(t,n){return ro(t.getMilliseconds(),n,3)}function Oo(t,n){return Lo(t,n)+"000"}function Do(t,n){return ro(t.getMonth()+1,n,2)}function jo(t,n){return ro(t.getMinutes(),n,2)}function Ro(t,n){return ro(t.getSeconds(),n,2)}function Io(t){t=t.getDay();return 0===t?7:t}function Fo(t,n){return ro(Nr.count(Hr(t)-1,t),n,2)}function Ho(t){var n=t.getDay();return 4<=n||0===n?Br(t):Br.ceil(t)}function Go(t,n){return t=Ho(t),ro(Br.count(Hr(t),t)+(4===Hr(t).getDay()),n,2)}function Ko(t){return t.getDay()}function Uo(t,n){return ro(Pr.count(Hr(t)-1,t),n,2)}function Wo(t,n){return ro(t.getFullYear()%100,n,2)}function qo(t,n){return ro((t=Ho(t)).getFullYear()%100,n,2)}function $o(t,n){return ro(t.getFullYear()%1e4,n,4)}function Vo(t,n){var e=t.getDay();return ro((t=4<=e||0===e?Br(t):Br.ceil(t)).getFullYear()%1e4,n,4)}function Yo(t){t=t.getTimezoneOffset();return(0<t?"-":(t*=-1,"+"))+ro(t/60|0,"0",2)+ro(t%60,"0",2)}function Zo(t,n){return ro(t.getUTCDate(),n,2)}function Xo(t,n){return ro(t.getUTCHours(),n,2)}function Jo(t,n){return ro(t.getUTCHours()%12||12,n,2)}function Qo(t,n){return ro(1+Tr.count(Gr(t),t),n,3)}function ts(t,n){return ro(t.getUTCMilliseconds(),n,3)}function ns(t,n){return ts(t,n)+"000"}function es(t,n){return ro(t.getUTCMonth()+1,n,2)}function is(t,n){return ro(t.getUTCMinutes(),n,2)}function as(t,n){return ro(t.getUTCSeconds(),n,2)}function rs(t){t=t.getUTCDay();return 0===t?7:t}function os(t,n){return ro(Dr.count(Gr(t)-1,t),n,2)}function ss(t){var n=t.getUTCDay();return 4<=n||0===n?Rr(t):Rr.ceil(t)}function ls(t,n){return t=ss(t),ro(Rr.count(Gr(t),t)+(4===Gr(t).getUTCDay()),n,2)}function hs(t){return t.getUTCDay()}function us(t,n){return ro(jr.count(Gr(t)-1,t),n,2)}function cs(t,n){return ro(t.getUTCFullYear()%100,n,2)}function gs(t,n){return ro((t=ss(t)).getUTCFullYear()%100,n,2)}function ds(t,n){return ro(t.getUTCFullYear()%1e4,n,4)}function fs(t,n){var e=t.getUTCDay();return ro((t=4<=e||0===e?Rr(t):Rr.ceil(t)).getUTCFullYear()%1e4,n,4)}function ps(){return"+0000"}function _s(){return"%"}function ms(t){return+t}function ys(t){return Math.floor(+t/1e3)}function vs(t){return Jr=Xr(t),Qr=Jr.format,to=Jr.utcFormat,Jr}function bs(t){return new Date(t)}function xs(t){return t instanceof Date?+t:+new Date(+t)}function ws(e,i,n,a,r,o,s,l,h,u){var c=Ea(),g=c.invert,d=c.domain,f=u(".%L"),p=u(":%S"),_=u("%I:%M"),m=u("%I %p"),y=u("%a %d"),v=u("%b %d"),b=u("%B"),x=u("%Y");function w(t){return(h(t)<t?f:l(t)<t?p:s(t)<t?_:o(t)<t?m:a(t)<t?r(t)<t?y:v:n(t)<t?b:x)(t)}return c.invert=function(t){return new Date(g(t))},c.domain=function(t){return arguments.length?d(Array.from(t,xs)):d().map(bs)},c.ticks=function(t){var n=d();return e(n[0],n[n.length-1],null==t?10:t)},c.tickFormat=function(t,n){return null==n?w:u(n)},c.nice=function(t){var n=d();return(t=t&&"function"==typeof t.range?t:i(n[0],n[n.length-1],null==t?10:t))?d(Va(n,t)):c},c.copy=function(){return za(c,ws(e,i,n,a,r,o,s,l,h,u))},c}function Ss(){return ma.apply(ws(qr,$r,Hr,Ir,Nr,zr,Mr,kr,Sr,Qr).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ks(){var n,e,i,a,r,o=0,s=1,l=ka,h=!1;function u(t){return null==t||isNaN(t=+t)?r:l(0===i?.5:(t=(a(t)-n)*i,h?Math.max(0,Math.min(1,t)):t))}function t(e){return function(t){var n;return arguments.length?([t,n]=t,l=e(t,n),u):[l(0),l(1)]}}return u.domain=function(t){return arguments.length?([o,s]=t,n=a(o=+o),e=a(s=+s),i=n===e?0:1/(e-n),u):[o,s]},u.clamp=function(t){return arguments.length?(h=!!t,u):h},u.interpolator=function(t){return arguments.length?(l=t,u):l},u.range=t(ie),u.rangeRound=t(ae),u.unknown=function(t){return arguments.length?(r=t,u):r},function(t){return n=(a=t)(o),e=t(s),i=n===e?0:1/(e-n),u}}function Cs(t,n){return n.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Ms(){var t=hr(ks());return t.copy=function(){return Cs(t,Ms()).exponent(t.exponent())},ya.apply(t,arguments)}function As(){var n,e,i,a,r,o,s,l=0,h=.5,u=1,c=1,g=ka,d=!1;function f(t){return isNaN(t=+t)?s:(t=.5+((t=+o(t))-e)*(c*t<c*e?a:r),g(d?Math.max(0,Math.min(1,t)):t))}function t(i){return function(t){var n,e;return arguments.length?([t,n,e]=t,g=((t,n)=>{void 0===n&&(n=t,t=ie);for(var e=0,i=n.length-1,a=n[0],r=new Array(i<0?0:i);e<i;)r[e]=t(a,a=n[++e]);return function(t){var n=Math.max(0,Math.min(i-1,Math.floor(t*=i)));return r[n](t-n)}})(i,[t,n,e]),f):[g(0),g(.5),g(1)]}}return f.domain=function(t){return arguments.length?([l,h,u]=t,n=o(l=+l),e=o(h=+h),i=o(u=+u),a=n===e?0:.5/(e-n),r=e===i?0:.5/(i-e),c=e<n?-1:1,f):[l,h,u]},f.clamp=function(t){return arguments.length?(d=!!t,f):d},f.interpolator=function(t){return arguments.length?(g=t,f):g},f.range=t(ie),f.rangeRound=t(ae),f.unknown=function(t){return arguments.length?(s=t,f):s},function(t){return n=(o=t)(l),e=t(h),i=t(u),a=n===e?0:.5/(e-n),r=e===i?0:.5/(i-e),c=e<n?-1:1,f}}function zs(){var t=hr(As());return t.copy=function(){return Cs(t,zs()).exponent(t.exponent())},ya.apply(t,arguments)}vs({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var Ts=Object.freeze({__proto__:null,scaleBand:xa,scaleDiverging:function t(){var n=qa(As()(ka));return n.copy=function(){return Cs(n,t())},ya.apply(n,arguments)},scaleDivergingLog:function t(){var n=nr(As()).domain([.1,1,10]);return n.copy=function(){return Cs(n,t()).base(n.base())},ya.apply(n,arguments)},scaleDivergingPow:zs,scaleDivergingSqrt:function(){return zs.apply(null,arguments).exponent(.5)},scaleDivergingSymlog:function t(){var n=rr(As());return n.copy=function(){return Cs(n,t()).constant(n.constant())},ya.apply(n,arguments)},scaleIdentity:function t(n){var e;function i(t){return null==t||isNaN(t=+t)?e:t}return(i.invert=i).domain=i.range=function(t){return arguments.length?(n=Array.from(t,wa),i):n.slice()},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return t(n).unknown(e)},n=arguments.length?Array.from(n,wa):[0,1],qa(i)},scaleImplicit:va,scaleLinear:$a,scaleLog:er,scaleOrdinal:ba,scalePoint:function(){return function t(n){var e=n.copy;return n.padding=n.paddingOuter,delete n.paddingInner,delete n.paddingOuter,n.copy=function(){return t(e())},n}(xa.apply(null,arguments).paddingInner(1))},scalePow:ur,scaleQuantile:function t(){var n,e=[],i=[],a=[];function r(){var t=0,n=Math.max(1,i.length);for(a=new Array(n-1);++t<n;)a[t-1]=((t,n,e=Ri)=>{var i,a;if((i=t.length)&&!isNaN(n=+n))return n<=0||i<2?+e(t[0],0,t):1<=n?+e(t[i-1],i-1,t):(i=(i-1)*n,(a=+e(t[n=Math.floor(i)],n,t))+(+e(t[n+1],n+1,t)-a)*(i-n))})(e,t/n);return o}function o(t){return null==t||isNaN(t=+t)?n:i[Ii(a,t)]}return o.invertExtent=function(t){return(t=i.indexOf(t))<0?[NaN,NaN]:[0<t?a[t-1]:e[0],t<a.length?a[t]:e[e.length-1]]},o.domain=function(t){if(!arguments.length)return e.slice();e=[];for(var n of t)null==n||isNaN(n=+n)||e.push(n);return e.sort(Oi),r()},o.range=function(t){return arguments.length?(i=Array.from(t),r()):i.slice()},o.unknown=function(t){return arguments.length?(n=t,o):n},o.quantiles=function(){return a.slice()},o.copy=function(){return t().domain(e).range(i).unknown(n)},ma.apply(o,arguments)},scaleQuantize:function t(){var n,e=0,i=1,a=1,r=[.5],o=[0,1];function s(t){return null!=t&&t<=t?o[Ii(r,t,0,a)]:n}function l(){var t=-1;for(r=new Array(a);++t<a;)r[t]=((t+1)*i-(t-a)*e)/(a+1);return s}return s.domain=function(t){return arguments.length?([e,i]=t,e=+e,i=+i,l()):[e,i]},s.range=function(t){return arguments.length?(a=(o=Array.from(t)).length-1,l()):o.slice()},s.invertExtent=function(t){return(t=o.indexOf(t))<0?[NaN,NaN]:t<1?[e,r[0]]:a<=t?[r[a-1],i]:[r[t-1],r[t]]},s.unknown=function(t){return arguments.length&&(n=t),s},s.thresholds=function(){return r.slice()},s.copy=function(){return t().domain([e,i]).range(o).unknown(n)},ma.apply(qa(s),arguments)},scaleRadial:function t(){var n,e=Ea(),i=[0,1],a=!1;function r(t){return t=e(t),t=Math.sign(t)*Math.sqrt(Math.abs(t)),isNaN(t)?n:a?Math.round(t):t}return r.invert=function(t){return e.invert(cr(t))},r.domain=function(t){return arguments.length?(e.domain(t),r):e.domain()},r.range=function(t){return arguments.length?(e.range((i=Array.from(t,wa)).map(cr)),r):i.slice()},r.rangeRound=function(t){return r.range(t).round(!0)},r.round=function(t){return arguments.length?(a=!!t,r):a},r.clamp=function(t){return arguments.length?(e.clamp(t),r):e.clamp()},r.unknown=function(t){return arguments.length?(n=t,r):n},r.copy=function(){return t(e.domain(),i).round(a).clamp(e.clamp()).unknown(n)},ma.apply(r,arguments),qa(r)},scaleSequential:function t(){var n=qa(ks()(ka));return n.copy=function(){return Cs(n,t())},ya.apply(n,arguments)},scaleSequentialLog:function t(){var n=nr(ks()).domain([1,10]);return n.copy=function(){return Cs(n,t()).base(n.base())},ya.apply(n,arguments)},scaleSequentialPow:Ms,scaleSequentialQuantile:function t(){var i=[],e=ka;function a(t){if(null!=t&&!isNaN(t=+t))return e((Ii(i,t,1)-1)/(i.length-1))}return a.domain=function(t){if(!arguments.length)return i.slice();i=[];for(var n of t)null==n||isNaN(n=+n)||i.push(n);return i.sort(Oi),a},a.interpolator=function(t){return arguments.length?(e=t,a):e},a.range=function(){return i.map((t,n)=>e(n/(i.length-1)))},a.quantiles=function(e){return Array.from({length:e+1},(t,n)=>aa(i,n/e))},a.copy=function(){return t(e).domain(i)},ya.apply(a,arguments)},scaleSequentialSqrt:function(){return Ms.apply(null,arguments).exponent(.5)},scaleSequentialSymlog:function t(){var n=rr(ks());return n.copy=function(){return Cs(n,t()).constant(n.constant())},ya.apply(n,arguments)},scaleSqrt:function(){return ur.apply(null,arguments).exponent(.5)},scaleSymlog:function t(){var n=rr(Ta());return n.copy=function(){return za(n,t()).constant(n.constant())},ma.apply(n,arguments)},scaleThreshold:gr,scaleTime:Ss,scaleUtc:function(){return ma.apply(ws(Ur,Wr,Gr,Fr,Dr,Tr,Ar,Cr,Sr,to).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},tickFormat:Wa});function v(t){return function(){return t}}let Es=Math.abs,Ns=Math.atan2,Ps=Math.cos,Bs=Math.max,Ls=Math.min,Os=Math.sin,Ds=Math.sqrt,js=1e-12,Rs=Math.PI,Is=Rs/2,Fs=2*Rs;function Hs(t){return 1<=t?Is:t<=-1?-Is:Math.asin(t)}let Gs=Math.PI,Ks=2*Gs,Us=1e-6,Ws=Ks-Us;function qs(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}let $s=class{moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,e,i){this._append`Q${+t},${+n},${this._x1=+e},${this._y1=+i}`}bezierCurveTo(t,n,e,i,a,r){this._append`C${+t},${+n},${+e},${+i},${this._x1=+a},${this._y1=+r}`}arcTo(t,n,e,i,a){
|
|
644
|
+
return v.x=w(a,v),v.X=w(r,v),v.c=w(i,v),b.x=w(a,b),b.X=w(r,b),b.c=w(i,b),{format:function(t){var n=w(t+="",v);return n.toString=function(){return t},n},parse:function(t){var n=S(t+="",!1);return n.toString=function(){return t},n},utcFormat:function(t){var n=w(t+="",b);return n.toString=function(){return t},n},utcParse:function(t){var n=S(t+="",!0);return n.toString=function(){return t},n}}}var Jr,Qr,to,no={"-":"",_:" ",0:"0"},eo=/^\s*\d+/,io=/^%/,ao=/[\\^$*+?|[\]().{}]/g;function ro(t,n,e){var i=t<0?"-":"",t=(i?-t:t)+"",a=t.length;return i+(a<e?new Array(e-a+1).join(n)+t:t)}function oo(t){return t.replace(ao,"\\$&")}function so(t){return new RegExp("^(?:"+t.map(oo).join("|")+")","i")}function lo(t){return new Map(t.map((t,n)=>[t.toLowerCase(),n]))}function ho(t,n,e){n=eo.exec(n.slice(e,e+1));return n?(t.w=+n[0],e+n[0].length):-1}function uo(t,n,e){n=eo.exec(n.slice(e,e+1));return n?(t.u=+n[0],e+n[0].length):-1}function co(t,n,e){n=eo.exec(n.slice(e,e+2));return n?(t.U=+n[0],e+n[0].length):-1}function go(t,n,e){n=eo.exec(n.slice(e,e+2));return n?(t.V=+n[0],e+n[0].length):-1}function fo(t,n,e){n=eo.exec(n.slice(e,e+2));return n?(t.W=+n[0],e+n[0].length):-1}function po(t,n,e){n=eo.exec(n.slice(e,e+4));return n?(t.y=+n[0],e+n[0].length):-1}function _o(t,n,e){n=eo.exec(n.slice(e,e+2));return n?(t.y=+n[0]+(68<+n[0]?1900:2e3),e+n[0].length):-1}function mo(t,n,e){n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),e+n[0].length):-1}function yo(t,n,e){n=eo.exec(n.slice(e,e+1));return n?(t.q=3*n[0]-3,e+n[0].length):-1}function vo(t,n,e){n=eo.exec(n.slice(e,e+2));return n?(t.m=n[0]-1,e+n[0].length):-1}function bo(t,n,e){n=eo.exec(n.slice(e,e+2));return n?(t.d=+n[0],e+n[0].length):-1}function xo(t,n,e){n=eo.exec(n.slice(e,e+3));return n?(t.m=0,t.d=+n[0],e+n[0].length):-1}function wo(t,n,e){n=eo.exec(n.slice(e,e+2));return n?(t.H=+n[0],e+n[0].length):-1}function So(t,n,e){n=eo.exec(n.slice(e,e+2));return n?(t.M=+n[0],e+n[0].length):-1}function ko(t,n,e){n=eo.exec(n.slice(e,e+2));return n?(t.S=+n[0],e+n[0].length):-1}function Co(t,n,e){n=eo.exec(n.slice(e,e+3));return n?(t.L=+n[0],e+n[0].length):-1}function Mo(t,n,e){n=eo.exec(n.slice(e,e+6));return n?(t.L=Math.floor(n[0]/1e3),e+n[0].length):-1}function Ao(t,n,e){n=io.exec(n.slice(e,e+1));return n?e+n[0].length:-1}function zo(t,n,e){n=eo.exec(n.slice(e));return n?(t.Q=+n[0],e+n[0].length):-1}function To(t,n,e){n=eo.exec(n.slice(e));return n?(t.s=+n[0],e+n[0].length):-1}function Eo(t,n){return ro(t.getDate(),n,2)}function No(t,n){return ro(t.getHours(),n,2)}function Po(t,n){return ro(t.getHours()%12||12,n,2)}function Lo(t,n){return ro(1+zr.count(Hr(t),t),n,3)}function Bo(t,n){return ro(t.getMilliseconds(),n,3)}function Oo(t,n){return Bo(t,n)+"000"}function Do(t,n){return ro(t.getMonth()+1,n,2)}function jo(t,n){return ro(t.getMinutes(),n,2)}function Ro(t,n){return ro(t.getSeconds(),n,2)}function Fo(t){t=t.getDay();return 0===t?7:t}function Io(t,n){return ro(Nr.count(Hr(t)-1,t),n,2)}function Ho(t){var n=t.getDay();return 4<=n||0===n?Lr(t):Lr.ceil(t)}function Go(t,n){return t=Ho(t),ro(Lr.count(Hr(t),t)+(4===Hr(t).getDay()),n,2)}function Ko(t){return t.getDay()}function Uo(t,n){return ro(Pr.count(Hr(t)-1,t),n,2)}function Wo(t,n){return ro(t.getFullYear()%100,n,2)}function qo(t,n){return ro((t=Ho(t)).getFullYear()%100,n,2)}function $o(t,n){return ro(t.getFullYear()%1e4,n,4)}function Vo(t,n){var e=t.getDay();return ro((t=4<=e||0===e?Lr(t):Lr.ceil(t)).getFullYear()%1e4,n,4)}function Yo(t){t=t.getTimezoneOffset();return(0<t?"-":(t*=-1,"+"))+ro(t/60|0,"0",2)+ro(t%60,"0",2)}function Zo(t,n){return ro(t.getUTCDate(),n,2)}function Xo(t,n){return ro(t.getUTCHours(),n,2)}function Jo(t,n){return ro(t.getUTCHours()%12||12,n,2)}function Qo(t,n){return ro(1+Tr.count(Gr(t),t),n,3)}function ts(t,n){return ro(t.getUTCMilliseconds(),n,3)}function ns(t,n){return ts(t,n)+"000"}function es(t,n){return ro(t.getUTCMonth()+1,n,2)}function is(t,n){return ro(t.getUTCMinutes(),n,2)}function as(t,n){return ro(t.getUTCSeconds(),n,2)}function rs(t){t=t.getUTCDay();return 0===t?7:t}function os(t,n){return ro(Dr.count(Gr(t)-1,t),n,2)}function ss(t){var n=t.getUTCDay();return 4<=n||0===n?Rr(t):Rr.ceil(t)}function ls(t,n){return t=ss(t),ro(Rr.count(Gr(t),t)+(4===Gr(t).getUTCDay()),n,2)}function hs(t){return t.getUTCDay()}function us(t,n){return ro(jr.count(Gr(t)-1,t),n,2)}function cs(t,n){return ro(t.getUTCFullYear()%100,n,2)}function gs(t,n){return ro((t=ss(t)).getUTCFullYear()%100,n,2)}function ds(t,n){return ro(t.getUTCFullYear()%1e4,n,4)}function fs(t,n){var e=t.getUTCDay();return ro((t=4<=e||0===e?Rr(t):Rr.ceil(t)).getUTCFullYear()%1e4,n,4)}function ps(){return"+0000"}function _s(){return"%"}function ms(t){return+t}function ys(t){return Math.floor(+t/1e3)}function vs(t){return Jr=Xr(t),Qr=Jr.format,to=Jr.utcFormat,Jr}function bs(t){return new Date(t)}function xs(t){return t instanceof Date?+t:+new Date(+t)}function ws(e,i,n,a,r,o,s,l,h,u){var c=Ea(),g=c.invert,d=c.domain,f=u(".%L"),p=u(":%S"),_=u("%I:%M"),m=u("%I %p"),y=u("%a %d"),v=u("%b %d"),b=u("%B"),x=u("%Y");function w(t){return(h(t)<t?f:l(t)<t?p:s(t)<t?_:o(t)<t?m:a(t)<t?r(t)<t?y:v:n(t)<t?b:x)(t)}return c.invert=function(t){return new Date(g(t))},c.domain=function(t){return arguments.length?d(Array.from(t,xs)):d().map(bs)},c.ticks=function(t){var n=d();return e(n[0],n[n.length-1],null==t?10:t)},c.tickFormat=function(t,n){return null==n?w:u(n)},c.nice=function(t){var n=d();return(t=t&&"function"==typeof t.range?t:i(n[0],n[n.length-1],null==t?10:t))?d(Va(n,t)):c},c.copy=function(){return za(c,ws(e,i,n,a,r,o,s,l,h,u))},c}function Ss(){return ma.apply(ws(qr,$r,Hr,Fr,Nr,zr,Mr,kr,Sr,Qr).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ks(){var n,e,i,a,r,o=0,s=1,l=ka,h=!1;function u(t){return null==t||isNaN(t=+t)?r:l(0===i?.5:(t=(a(t)-n)*i,h?Math.max(0,Math.min(1,t)):t))}function t(e){return function(t){var n;return arguments.length?([t,n]=t,l=e(t,n),u):[l(0),l(1)]}}return u.domain=function(t){return arguments.length?([o,s]=t,n=a(o=+o),e=a(s=+s),i=n===e?0:1/(e-n),u):[o,s]},u.clamp=function(t){return arguments.length?(h=!!t,u):h},u.interpolator=function(t){return arguments.length?(l=t,u):l},u.range=t(ie),u.rangeRound=t(ae),u.unknown=function(t){return arguments.length?(r=t,u):r},function(t){return n=(a=t)(o),e=t(s),i=n===e?0:1/(e-n),u}}function Cs(t,n){return n.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Ms(){var t=hr(ks());return t.copy=function(){return Cs(t,Ms()).exponent(t.exponent())},ya.apply(t,arguments)}function As(){var n,e,i,a,r,o,s,l=0,h=.5,u=1,c=1,g=ka,d=!1;function f(t){return isNaN(t=+t)?s:(t=.5+((t=+o(t))-e)*(c*t<c*e?a:r),g(d?Math.max(0,Math.min(1,t)):t))}function t(i){return function(t){var n,e;return arguments.length?([t,n,e]=t,g=((t,n)=>{void 0===n&&(n=t,t=ie);for(var e=0,i=n.length-1,a=n[0],r=new Array(i<0?0:i);e<i;)r[e]=t(a,a=n[++e]);return function(t){var n=Math.max(0,Math.min(i-1,Math.floor(t*=i)));return r[n](t-n)}})(i,[t,n,e]),f):[g(0),g(.5),g(1)]}}return f.domain=function(t){return arguments.length?([l,h,u]=t,n=o(l=+l),e=o(h=+h),i=o(u=+u),a=n===e?0:.5/(e-n),r=e===i?0:.5/(i-e),c=e<n?-1:1,f):[l,h,u]},f.clamp=function(t){return arguments.length?(d=!!t,f):d},f.interpolator=function(t){return arguments.length?(g=t,f):g},f.range=t(ie),f.rangeRound=t(ae),f.unknown=function(t){return arguments.length?(s=t,f):s},function(t){return n=(o=t)(l),e=t(h),i=t(u),a=n===e?0:.5/(e-n),r=e===i?0:.5/(i-e),c=e<n?-1:1,f}}function zs(){var t=hr(As());return t.copy=function(){return Cs(t,zs()).exponent(t.exponent())},ya.apply(t,arguments)}vs({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var Ts=Object.freeze({__proto__:null,scaleBand:xa,scaleDiverging:function t(){var n=qa(As()(ka));return n.copy=function(){return Cs(n,t())},ya.apply(n,arguments)},scaleDivergingLog:function t(){var n=nr(As()).domain([.1,1,10]);return n.copy=function(){return Cs(n,t()).base(n.base())},ya.apply(n,arguments)},scaleDivergingPow:zs,scaleDivergingSqrt:function(){return zs.apply(null,arguments).exponent(.5)},scaleDivergingSymlog:function t(){var n=rr(As());return n.copy=function(){return Cs(n,t()).constant(n.constant())},ya.apply(n,arguments)},scaleIdentity:function t(n){var e;function i(t){return null==t||isNaN(t=+t)?e:t}return(i.invert=i).domain=i.range=function(t){return arguments.length?(n=Array.from(t,wa),i):n.slice()},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return t(n).unknown(e)},n=arguments.length?Array.from(n,wa):[0,1],qa(i)},scaleImplicit:va,scaleLinear:$a,scaleLog:er,scaleOrdinal:ba,scalePoint:function(){return function t(n){var e=n.copy;return n.padding=n.paddingOuter,delete n.paddingInner,delete n.paddingOuter,n.copy=function(){return t(e())},n}(xa.apply(null,arguments).paddingInner(1))},scalePow:ur,scaleQuantile:function t(){var n,e=[],i=[],a=[];function r(){var t=0,n=Math.max(1,i.length);for(a=new Array(n-1);++t<n;)a[t-1]=((t,n,e=Ri)=>{var i,a;if((i=t.length)&&!isNaN(n=+n))return n<=0||i<2?+e(t[0],0,t):1<=n?+e(t[i-1],i-1,t):(i=(i-1)*n,(a=+e(t[n=Math.floor(i)],n,t))+(+e(t[n+1],n+1,t)-a)*(i-n))})(e,t/n);return o}function o(t){return null==t||isNaN(t=+t)?n:i[Fi(a,t)]}return o.invertExtent=function(t){return(t=i.indexOf(t))<0?[NaN,NaN]:[0<t?a[t-1]:e[0],t<a.length?a[t]:e[e.length-1]]},o.domain=function(t){if(!arguments.length)return e.slice();e=[];for(var n of t)null==n||isNaN(n=+n)||e.push(n);return e.sort(Oi),r()},o.range=function(t){return arguments.length?(i=Array.from(t),r()):i.slice()},o.unknown=function(t){return arguments.length?(n=t,o):n},o.quantiles=function(){return a.slice()},o.copy=function(){return t().domain(e).range(i).unknown(n)},ma.apply(o,arguments)},scaleQuantize:function t(){var n,e=0,i=1,a=1,r=[.5],o=[0,1];function s(t){return null!=t&&t<=t?o[Fi(r,t,0,a)]:n}function l(){var t=-1;for(r=new Array(a);++t<a;)r[t]=((t+1)*i-(t-a)*e)/(a+1);return s}return s.domain=function(t){return arguments.length?([e,i]=t,e=+e,i=+i,l()):[e,i]},s.range=function(t){return arguments.length?(a=(o=Array.from(t)).length-1,l()):o.slice()},s.invertExtent=function(t){return(t=o.indexOf(t))<0?[NaN,NaN]:t<1?[e,r[0]]:a<=t?[r[a-1],i]:[r[t-1],r[t]]},s.unknown=function(t){return arguments.length&&(n=t),s},s.thresholds=function(){return r.slice()},s.copy=function(){return t().domain([e,i]).range(o).unknown(n)},ma.apply(qa(s),arguments)},scaleRadial:function t(){var n,e=Ea(),i=[0,1],a=!1;function r(t){return t=e(t),t=Math.sign(t)*Math.sqrt(Math.abs(t)),isNaN(t)?n:a?Math.round(t):t}return r.invert=function(t){return e.invert(cr(t))},r.domain=function(t){return arguments.length?(e.domain(t),r):e.domain()},r.range=function(t){return arguments.length?(e.range((i=Array.from(t,wa)).map(cr)),r):i.slice()},r.rangeRound=function(t){return r.range(t).round(!0)},r.round=function(t){return arguments.length?(a=!!t,r):a},r.clamp=function(t){return arguments.length?(e.clamp(t),r):e.clamp()},r.unknown=function(t){return arguments.length?(n=t,r):n},r.copy=function(){return t(e.domain(),i).round(a).clamp(e.clamp()).unknown(n)},ma.apply(r,arguments),qa(r)},scaleSequential:function t(){var n=qa(ks()(ka));return n.copy=function(){return Cs(n,t())},ya.apply(n,arguments)},scaleSequentialLog:function t(){var n=nr(ks()).domain([1,10]);return n.copy=function(){return Cs(n,t()).base(n.base())},ya.apply(n,arguments)},scaleSequentialPow:Ms,scaleSequentialQuantile:function t(){var i=[],e=ka;function a(t){if(null!=t&&!isNaN(t=+t))return e((Fi(i,t,1)-1)/(i.length-1))}return a.domain=function(t){if(!arguments.length)return i.slice();i=[];for(var n of t)null==n||isNaN(n=+n)||i.push(n);return i.sort(Oi),a},a.interpolator=function(t){return arguments.length?(e=t,a):e},a.range=function(){return i.map((t,n)=>e(n/(i.length-1)))},a.quantiles=function(e){return Array.from({length:e+1},(t,n)=>aa(i,n/e))},a.copy=function(){return t(e).domain(i)},ya.apply(a,arguments)},scaleSequentialSqrt:function(){return Ms.apply(null,arguments).exponent(.5)},scaleSequentialSymlog:function t(){var n=rr(ks());return n.copy=function(){return Cs(n,t()).constant(n.constant())},ya.apply(n,arguments)},scaleSqrt:function(){return ur.apply(null,arguments).exponent(.5)},scaleSymlog:function t(){var n=rr(Ta());return n.copy=function(){return za(n,t()).constant(n.constant())},ma.apply(n,arguments)},scaleThreshold:gr,scaleTime:Ss,scaleUtc:function(){return ma.apply(ws(Ur,Wr,Gr,Ir,Dr,Tr,Ar,Cr,Sr,to).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},tickFormat:Wa});function v(t){return function(){return t}}let Es=Math.abs,Ns=Math.atan2,Ps=Math.cos,Ls=Math.max,Bs=Math.min,Os=Math.sin,Ds=Math.sqrt,js=1e-12,Rs=Math.PI,Fs=Rs/2,Is=2*Rs;function Hs(t){return 1<=t?Fs:t<=-1?-Fs:Math.asin(t)}let Gs=Math.PI,Ks=2*Gs,Us=1e-6,Ws=Ks-Us;function qs(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}let $s=class{moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,e,i){this._append`Q${+t},${+n},${this._x1=+e},${this._y1=+i}`}bezierCurveTo(t,n,e,i,a,r){this._append`C${+t},${+n},${+e},${+i},${this._x1=+a},${this._y1=+r}`}arcTo(t,n,e,i,a){
|
|
645
645
|
// Is the radius negative? Error.
|
|
646
646
|
if(t=+t,n=+n,e=+e,i=+i,(a=+a)<0)throw new Error("negative radius: "+a);var r,o,s=this._x1,l=this._y1,h=e-t,u=i-n,c=s-t,g=l-n,d=c*c+g*g;
|
|
647
647
|
// Is this path empty? Move to (x1,y1).
|
|
@@ -662,18 +662,18 @@ this._="",this._append=null==t?qs:(t=>{var n=Math.floor(t);if(!(0<=n))throw new
|
|
|
662
662
|
}
|
|
663
663
|
// Compute perpendicular offset line of length rc.
|
|
664
664
|
// http://mathworld.wolfram.com/Circle-LineIntersection.html
|
|
665
|
-
function tl(t,n,e,i,a,r,o){var s=t-e,l=n-i,o=(o?r:-r)/Ds(s*s+l*l),l=o*l,o=-o*s,s=t+l,t=n+o,n=e+l,e=i+o,i=(s+n)/2,h=(t+e)/2,u=n-s,c=e-t,g=u*u+c*c,r=a-r,s=s*e-n*t,e=(c<0?-1:1)*Ds(
|
|
665
|
+
function tl(t,n,e,i,a,r,o){var s=t-e,l=n-i,o=(o?r:-r)/Ds(s*s+l*l),l=o*l,o=-o*s,s=t+l,t=n+o,n=e+l,e=i+o,i=(s+n)/2,h=(t+e)/2,u=n-s,c=e-t,g=u*u+c*c,r=a-r,s=s*e-n*t,e=(c<0?-1:1)*Ds(Ls(0,r*r*g-s*s)),n=(s*c-u*e)/g,t=(-s*u-c*e)/g,d=(s*c+u*e)/g,s=(-s*u+c*e)/g,u=n-i,c=t-h,e=d-i,g=s-h;
|
|
666
666
|
// Pick the closer of the two intersection points.
|
|
667
667
|
// TODO Is there a faster way to determine which intersection to use?
|
|
668
|
-
return e*e+g*g<u*u+c*c&&(n=d,t=s),{cx:n,cy:t,x01:-l,y01:-o,x11:n*(a/r-1),y11:t*(a/r-1)}}function nl(){var z=Ys,T=Zs,E=v(0),N=null,P=Xs,
|
|
668
|
+
return e*e+g*g<u*u+c*c&&(n=d,t=s),{cx:n,cy:t,x01:-l,y01:-o,x11:n*(a/r-1),y11:t*(a/r-1)}}function nl(){var z=Ys,T=Zs,E=v(0),N=null,P=Xs,L=Js,B=Qs,O=null,D=Vs(n);function n(){var t,n,e,i,a,r,o,s,l,h,u,c,g,d,f,p,_,m,y,v,b,x,w=+z.apply(this,arguments),S=+T.apply(this,arguments),k=P.apply(this,arguments)-Fs,C=L.apply(this,arguments)-Fs,M=Es(C-k),A=k<C;if(O=O||(t=D()),
|
|
669
669
|
// Ensure that the outer radius is always larger than the inner radius.
|
|
670
670
|
S<w&&(n=S,S=w,w=n),
|
|
671
671
|
// Is it a point?
|
|
672
|
-
S>js?M>
|
|
672
|
+
S>js?M>Is-js?(O.moveTo(S*Ps(k),S*Os(k)),O.arc(0,0,S,k,C,!A),w>js&&(O.moveTo(w*Ps(C),w*Os(C)),O.arc(0,0,w,C,k,A))):(i=n=k,a=e=C,o=r=M,g=(u=B.apply(this,arguments)/2)>js&&(N?+N.apply(this,arguments):Ds(w*w+S*S)),x=b=s=Bs(Es(S-w)/2,+E.apply(this,arguments)),
|
|
673
673
|
// Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.
|
|
674
674
|
g>js&&(c=Hs(g/w*Os(u)),g=Hs(g/S*Os(u)),(r-=2*c)>js?(i+=c*=A?1:-1,a-=c):(r=0,i=a=(k+C)/2),(o-=2*g)>js?(n+=g*=A?1:-1,e-=g):(o=0,n=e=(k+C)/2)),u=S*Ps(n),c=S*Os(n),g=w*Ps(a),k=w*Os(a),
|
|
675
675
|
// Apply rounded corners?
|
|
676
|
-
s>js&&(d=S*Ps(e),f=S*Os(e),p=w*Ps(i),_=w*Os(i),M<Rs)&&((C=((t,n,e,i,a,r,o,s)=>{var l=(s=s-r)*(e=e-t)-(o=o-a)*(i=i-n);if(!(l*l<js))return[t+(l=(o*(n-r)-s*(t-a))/l)*e,n+l*i]})(u,c,p,_,d,f,g,k))?(M=u-C[0],y=c-C[1],v=d-C[0],m=f-C[1],y=1/Os((1<(M=(M*v+y*m)/(Ds(M*M+y*y)*Ds(v*v+m*m)))?0:M<-1?Rs:Math.acos(M))/2),v=Ds(C[0]*C[0]+C[1]*C[1]),b=
|
|
676
|
+
s>js&&(d=S*Ps(e),f=S*Os(e),p=w*Ps(i),_=w*Os(i),M<Rs)&&((C=((t,n,e,i,a,r,o,s)=>{var l=(s=s-r)*(e=e-t)-(o=o-a)*(i=i-n);if(!(l*l<js))return[t+(l=(o*(n-r)-s*(t-a))/l)*e,n+l*i]})(u,c,p,_,d,f,g,k))?(M=u-C[0],y=c-C[1],v=d-C[0],m=f-C[1],y=1/Os((1<(M=(M*v+y*m)/(Ds(M*M+y*y)*Ds(v*v+m*m)))?0:M<-1?Rs:Math.acos(M))/2),v=Ds(C[0]*C[0]+C[1]*C[1]),b=Bs(s,(w-v)/(y-1)),x=Bs(s,(S-v)/(1+y))):b=x=0),
|
|
677
677
|
// Is the sector collapsed to a line?
|
|
678
678
|
o>js?x>js?(l=tl(p,_,u,c,S,x,A),h=tl(d,f,g,k,S,x,A),O.moveTo(l.cx+l.x01,l.cy+l.y01),
|
|
679
679
|
// Have the corners merged?
|
|
@@ -682,16 +682,16 @@ x<s?O.arc(l.cx,l.cy,x,Ns(l.y01,l.x01),Ns(h.y01,h.x01),!A):(O.arc(l.cx,l.cy,x,Ns(
|
|
|
682
682
|
// Or perhaps it’s an annular sector collapsed due to padding?
|
|
683
683
|
w>js&&r>js?b>js?(l=tl(g,k,d,f,w,-b,A),h=tl(u,c,p,_,w,-b,A),O.lineTo(l.cx+l.x01,l.cy+l.y01),
|
|
684
684
|
// Have the corners merged?
|
|
685
|
-
b<s?O.arc(l.cx,l.cy,b,Ns(l.y01,l.x01),Ns(h.y01,h.x01),!A):(O.arc(l.cx,l.cy,b,Ns(l.y01,l.x01),Ns(l.y11,l.x11),!A),O.arc(0,0,w,Ns(l.cy+l.y11,l.cx+l.x11),Ns(h.cy+h.y11,h.cx+h.x11),A),O.arc(h.cx,h.cy,b,Ns(h.y11,h.x11),Ns(h.y01,h.x01),!A))):O.arc(0,0,w,a,i,A):O.lineTo(g,k)):O.moveTo(0,0),O.closePath(),t)return O=null,t+""||null}return n.centroid=function(){var t=(+z.apply(this,arguments)+ +T.apply(this,arguments))/2,n=(+P.apply(this,arguments)+ +
|
|
686
|
-
}function al(t){this._context=t}function rl(t){return new al(t)}function ol(t){return t[0]}function sl(t){return t[1]}function ll(o,s){var l=v(!0),h=null,u=rl,c=null,g=Vs(n);function n(t){var n,e,i,a=(t=il(t)).length,r=!1;for(null==h&&(c=u(i=g())),n=0;n<=a;++n)!(n<a&&l(e=t[n],n,t))===r&&((r=!r)?c.lineStart():c.lineEnd()),r&&c.point(+o(e,n,t),+s(e,n,t));if(i)return c=null,i+""||null}return o="function"==typeof o?o:void 0===o?ol:v(o),s="function"==typeof s?s:void 0===s?sl:v(s),n.x=function(t){return arguments.length?(o="function"==typeof t?t:v(+t),n):o},n.y=function(t){return arguments.length?(s="function"==typeof t?t:v(+t),n):s},n.defined=function(t){return arguments.length?(l="function"==typeof t?t:v(!!t),n):l},n.curve=function(t){return arguments.length?(u=t,null!=h&&(c=u(h)),n):u},n.context=function(t){return arguments.length?(null==t?h=c=null:c=u(h=t),n):h},n}function hl(u,c,g){var d=null,f=v(!0),p=null,_=rl,m=null,y=Vs(n);function n(t){var n,e,i,a,r,o=(t=il(t)).length,s=!1,l=new Array(o),h=new Array(o);for(null==p&&(m=_(r=y())),n=0;n<=o;++n){if(!(n<o&&f(a=t[n],n,t))===s)if(s=!s)e=n,m.areaStart(),m.lineStart();else{for(m.lineEnd(),m.lineStart(),i=n-1;e<=i;--i)m.point(l[i],h[i]);m.lineEnd(),m.areaEnd()}s&&(l[n]=+u(a,n,t),h[n]=+c(a,n,t),m.point(d?+d(a,n,t):l[n],g?+g(a,n,t):h[n]))}if(r)return m=null,r+""||null}function t(){return ll().defined(f).curve(_).context(p)}return u="function"==typeof u?u:void 0===u?ol:v(+u),c="function"==typeof c?c:v(void 0===c?0:+c),g="function"==typeof g?g:void 0===g?sl:v(+g),n.x=function(t){return arguments.length?(u="function"==typeof t?t:v(+t),d=null,n):u},n.x0=function(t){return arguments.length?(u="function"==typeof t?t:v(+t),n):u},n.x1=function(t){return arguments.length?(d=null==t?null:"function"==typeof t?t:v(+t),n):d},n.y=function(t){return arguments.length?(c="function"==typeof t?t:v(+t),g=null,n):c},n.y0=function(t){return arguments.length?(c="function"==typeof t?t:v(+t),n):c},n.y1=function(t){return arguments.length?(g=null==t?null:"function"==typeof t?t:v(+t),n):g},n.lineX0=n.lineY0=function(){return t().x(u).y(c)},n.lineY1=function(){return t().x(u).y(g)},n.lineX1=function(){return t().x(d).y(c)},n.defined=function(t){return arguments.length?(f="function"==typeof t?t:v(!!t),n):f},n.curve=function(t){return arguments.length?(_=t,null!=p&&(m=_(p)),n):_},n.context=function(t){return arguments.length?(null==t?p=m=null:m=_(p=t),n):p},n}function ul(t,n){return n<t?-1:t<n?1:t<=n?0:NaN}function cl(t){return t}function gl(){var d=cl,f=ul,p=null,_=v(0),m=v(
|
|
685
|
+
b<s?O.arc(l.cx,l.cy,b,Ns(l.y01,l.x01),Ns(h.y01,h.x01),!A):(O.arc(l.cx,l.cy,b,Ns(l.y01,l.x01),Ns(l.y11,l.x11),!A),O.arc(0,0,w,Ns(l.cy+l.y11,l.cx+l.x11),Ns(h.cy+h.y11,h.cx+h.x11),A),O.arc(h.cx,h.cy,b,Ns(h.y11,h.x11),Ns(h.y01,h.x01),!A))):O.arc(0,0,w,a,i,A):O.lineTo(g,k)):O.moveTo(0,0),O.closePath(),t)return O=null,t+""||null}return n.centroid=function(){var t=(+z.apply(this,arguments)+ +T.apply(this,arguments))/2,n=(+P.apply(this,arguments)+ +L.apply(this,arguments))/2-Rs/2;return[Ps(n)*t,Os(n)*t]},n.innerRadius=function(t){return arguments.length?(z="function"==typeof t?t:v(+t),n):z},n.outerRadius=function(t){return arguments.length?(T="function"==typeof t?t:v(+t),n):T},n.cornerRadius=function(t){return arguments.length?(E="function"==typeof t?t:v(+t),n):E},n.padRadius=function(t){return arguments.length?(N=null==t?null:"function"==typeof t?t:v(+t),n):N},n.startAngle=function(t){return arguments.length?(P="function"==typeof t?t:v(+t),n):P},n.endAngle=function(t){return arguments.length?(L="function"==typeof t?t:v(+t),n):L},n.padAngle=function(t){return arguments.length?(B="function"==typeof t?t:v(+t),n):B},n.context=function(t){return arguments.length?(O=null==t?null:t,n):O},n}var el=Array.prototype.slice;function il(t){return"object"==typeof t&&"length"in t?t:Array.from(t);// Map, Set, iterable, string, or anything else
|
|
686
|
+
}function al(t){this._context=t}function rl(t){return new al(t)}function ol(t){return t[0]}function sl(t){return t[1]}function ll(o,s){var l=v(!0),h=null,u=rl,c=null,g=Vs(n);function n(t){var n,e,i,a=(t=il(t)).length,r=!1;for(null==h&&(c=u(i=g())),n=0;n<=a;++n)!(n<a&&l(e=t[n],n,t))===r&&((r=!r)?c.lineStart():c.lineEnd()),r&&c.point(+o(e,n,t),+s(e,n,t));if(i)return c=null,i+""||null}return o="function"==typeof o?o:void 0===o?ol:v(o),s="function"==typeof s?s:void 0===s?sl:v(s),n.x=function(t){return arguments.length?(o="function"==typeof t?t:v(+t),n):o},n.y=function(t){return arguments.length?(s="function"==typeof t?t:v(+t),n):s},n.defined=function(t){return arguments.length?(l="function"==typeof t?t:v(!!t),n):l},n.curve=function(t){return arguments.length?(u=t,null!=h&&(c=u(h)),n):u},n.context=function(t){return arguments.length?(null==t?h=c=null:c=u(h=t),n):h},n}function hl(u,c,g){var d=null,f=v(!0),p=null,_=rl,m=null,y=Vs(n);function n(t){var n,e,i,a,r,o=(t=il(t)).length,s=!1,l=new Array(o),h=new Array(o);for(null==p&&(m=_(r=y())),n=0;n<=o;++n){if(!(n<o&&f(a=t[n],n,t))===s)if(s=!s)e=n,m.areaStart(),m.lineStart();else{for(m.lineEnd(),m.lineStart(),i=n-1;e<=i;--i)m.point(l[i],h[i]);m.lineEnd(),m.areaEnd()}s&&(l[n]=+u(a,n,t),h[n]=+c(a,n,t),m.point(d?+d(a,n,t):l[n],g?+g(a,n,t):h[n]))}if(r)return m=null,r+""||null}function t(){return ll().defined(f).curve(_).context(p)}return u="function"==typeof u?u:void 0===u?ol:v(+u),c="function"==typeof c?c:v(void 0===c?0:+c),g="function"==typeof g?g:void 0===g?sl:v(+g),n.x=function(t){return arguments.length?(u="function"==typeof t?t:v(+t),d=null,n):u},n.x0=function(t){return arguments.length?(u="function"==typeof t?t:v(+t),n):u},n.x1=function(t){return arguments.length?(d=null==t?null:"function"==typeof t?t:v(+t),n):d},n.y=function(t){return arguments.length?(c="function"==typeof t?t:v(+t),g=null,n):c},n.y0=function(t){return arguments.length?(c="function"==typeof t?t:v(+t),n):c},n.y1=function(t){return arguments.length?(g=null==t?null:"function"==typeof t?t:v(+t),n):g},n.lineX0=n.lineY0=function(){return t().x(u).y(c)},n.lineY1=function(){return t().x(u).y(g)},n.lineX1=function(){return t().x(d).y(c)},n.defined=function(t){return arguments.length?(f="function"==typeof t?t:v(!!t),n):f},n.curve=function(t){return arguments.length?(_=t,null!=p&&(m=_(p)),n):_},n.context=function(t){return arguments.length?(null==t?p=m=null:m=_(p=t),n):p},n}function ul(t,n){return n<t?-1:t<n?1:t<=n?0:NaN}function cl(t){return t}function gl(){var d=cl,f=ul,p=null,_=v(0),m=v(Is),y=v(0);function n(e){for(var t,n,i,a=(e=il(e)).length,r=0,o=new Array(a),s=new Array(a),l=+_.apply(this,arguments),h=Math.min(Is,Math.max(-Is,m.apply(this,arguments)-l)),u=Math.min(Math.abs(h)/a,y.apply(this,arguments)),c=u*(h<0?-1:1),g=0;g<a;++g)0<(i=s[o[g]=g]=+d(e[g],g,e))&&(r+=i);
|
|
687
687
|
// Optionally sort the arcs by previously-computed values or by data.
|
|
688
688
|
// Compute the arcs! They are stored in the original data's order.
|
|
689
689
|
for(null!=f?o.sort(function(t,n){return f(s[t],s[n])}):null!=p&&o.sort(function(t,n){return p(e[t],e[n])}),g=0,t=r?(h-a*c)/r:0;g<a;++g,l=n)n=o[g],i=s[n],s[n]={data:e[n],index:g,value:i,startAngle:l,endAngle:n=l+(0<i?i*t:0)+c,padAngle:u};return s}return n.value=function(t){return arguments.length?(d="function"==typeof t?t:v(+t),n):d},n.sortValues=function(t){return arguments.length?(f=t,p=null,n):f},n.sort=function(t){return arguments.length?(p=t,f=null,n):p},n.startAngle=function(t){return arguments.length?(_="function"==typeof t?t:v(+t),n):_},n.endAngle=function(t){return arguments.length?(m="function"==typeof t?t:v(+t),n):m},n.padAngle=function(t){return arguments.length?(y="function"==typeof t?t:v(+t),n):y},n}al.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;// falls through
|
|
690
690
|
default:this._context.lineTo(t,n)}}};var dl=pl(rl);function fl(t){this._curve=t}function pl(n){function t(t){return new fl(n(t))}return t._curve=n,t}function _l(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(pl(t)):n()._curve},t}function ml(){return _l(ll().curve(dl))}function yl(){var t=hl().curve(dl),n=t.curve,e=t.lineX0,i=t.lineX1,a=t.lineY0,r=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 _l(e())},delete t.lineX0,t.lineEndAngle=function(){return _l(i())},delete t.lineX1,t.lineInnerRadius=function(){return _l(a())},delete t.lineY0,t.lineOuterRadius=function(){return _l(r())},delete t.lineY1,t.curve=function(t){return arguments.length?n(pl(t)):n()._curve},t}function vl(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]}fl.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))}};class bl{areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(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;// falls through
|
|
691
|
-
default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n)}this._x0=t,this._y0=n}constructor(t,n){this._context=t,this._x=n}}class xl{lineStart(){this._point=0}lineEnd(){}point(t,n){var e,i,a,r;t=+t,n=+n,0===this._point?this._point=1:(e=vl(this._x0,this._y0),i=vl(this._x0,this._y0=(this._y0+n)/2),a=vl(t,this._y0),r=vl(t,n),this._context.moveTo(...e),this._context.bezierCurveTo(...i,...a,...r)),this._x0=t,this._y0=n}constructor(t){this._context=t}}function wl(t){return new bl(t,!0)}function Sl(t){return new bl(t,!1)}function kl(t){return new xl(t)}function Cl(t){return t.source}function Ml(t){return t.target}function Al(a){let r=Cl,o=Ml,s=ol,l=sl,h=null,u=null,c=Vs(n);function n(){let t;var n=el.call(arguments),e=r.apply(this,n),i=o.apply(this,n);if((u=null==h?a(t=c()):u).lineStart(),n[0]=e,u.point(+s.apply(this,n),+l.apply(this,n)),n[0]=i,u.point(+s.apply(this,n),+l.apply(this,n)),u.lineEnd(),t)return u=null,t+""||null}return n.source=function(t){return arguments.length?(r=t,n):r},n.target=function(t){return arguments.length?(o=t,n):o},n.x=function(t){return arguments.length?(s="function"==typeof t?t:v(+t),n):s},n.y=function(t){return arguments.length?(l="function"==typeof t?t:v(+t),n):l},n.context=function(t){return arguments.length?(null==t?h=u=null:u=a(h=t),n):h},n}let zl=Ds(3),Tl={draw(t,n){var n=.59436*Ds(n+
|
|
692
|
-
t.moveTo(0,-n),t.lineTo(i,e),t.lineTo(-i,e),t.closePath()}},Wl=-.5,ql=Ds(3)/2,$l=1/Ds(12),Vl=3*($l/2+1),Yl={draw(t,n){var n=Ds(n/Vl),e=n/2,i=n*$l,a=e,n=n*$l+n,r=-a,o=n;t.moveTo(e,i),t.lineTo(a,n),t.lineTo(r,o),t.lineTo(Wl*e-ql*i,ql*e+Wl*i),t.lineTo(Wl*a-ql*n,ql*a+Wl*n),t.lineTo(Wl*r-ql*o,ql*r+Wl*o),t.lineTo(Wl*e+ql*i,Wl*i-ql*e),t.lineTo(Wl*a+ql*n,Wl*n-ql*a),t.lineTo(Wl*r+ql*o,Wl*o-ql*r),t.closePath()}},Zl={draw(t,n){n=.6189*Ds(n-
|
|
691
|
+
default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n)}this._x0=t,this._y0=n}constructor(t,n){this._context=t,this._x=n}}class xl{lineStart(){this._point=0}lineEnd(){}point(t,n){var e,i,a,r;t=+t,n=+n,0===this._point?this._point=1:(e=vl(this._x0,this._y0),i=vl(this._x0,this._y0=(this._y0+n)/2),a=vl(t,this._y0),r=vl(t,n),this._context.moveTo(...e),this._context.bezierCurveTo(...i,...a,...r)),this._x0=t,this._y0=n}constructor(t){this._context=t}}function wl(t){return new bl(t,!0)}function Sl(t){return new bl(t,!1)}function kl(t){return new xl(t)}function Cl(t){return t.source}function Ml(t){return t.target}function Al(a){let r=Cl,o=Ml,s=ol,l=sl,h=null,u=null,c=Vs(n);function n(){let t;var n=el.call(arguments),e=r.apply(this,n),i=o.apply(this,n);if((u=null==h?a(t=c()):u).lineStart(),n[0]=e,u.point(+s.apply(this,n),+l.apply(this,n)),n[0]=i,u.point(+s.apply(this,n),+l.apply(this,n)),u.lineEnd(),t)return u=null,t+""||null}return n.source=function(t){return arguments.length?(r=t,n):r},n.target=function(t){return arguments.length?(o=t,n):o},n.x=function(t){return arguments.length?(s="function"==typeof t?t:v(+t),n):s},n.y=function(t){return arguments.length?(l="function"==typeof t?t:v(+t),n):l},n.context=function(t){return arguments.length?(null==t?h=u=null:u=a(h=t),n):h},n}let zl=Ds(3),Tl={draw(t,n){var n=.59436*Ds(n+Bs(n/28,.75)),e=n/2,i=e*zl;t.moveTo(0,n),t.lineTo(0,-n),t.moveTo(-i,-e),t.lineTo(i,e),t.moveTo(-i,e),t.lineTo(i,-e)}};var El={draw(t,n){n=Ds(n/Rs);t.moveTo(n,0),t.arc(0,0,n,0,Is)}},_n={draw(t,n){n=Ds(n/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}};let Nl=Ds(1/3),Pl=2*Nl,Ll={draw(t,n){var n=Ds(n/Pl),e=n*Nl;t.moveTo(0,-n),t.lineTo(e,0),t.lineTo(0,n),t.lineTo(-e,0),t.closePath()}},Bl={draw(t,n){n=.62625*Ds(n);t.moveTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.lineTo(-n,0),t.closePath()}},Ol={draw(t,n){n=.87559*Ds(n-Bs(n/7,2));t.moveTo(-n,0),t.lineTo(n,0),t.moveTo(0,n),t.lineTo(0,-n)}},Dl={draw(t,n){var n=Ds(n),e=-n/2;t.rect(e,e,n,n)}},jl={draw(t,n){n=.4431*Ds(n);t.moveTo(n,n),t.lineTo(n,-n),t.lineTo(-n,-n),t.lineTo(-n,n),t.closePath()}};n=Os(Rs/10)/Os(7*Rs/10);let Rl=Os(Is/10)*n,Fl=-Ps(Is/10)*n,Il={draw(n,t){var e=Ds(.8908130915292852*t),i=Rl*e,a=Fl*e;n.moveTo(0,-e),n.lineTo(i,a);for(let t=1;t<5;++t){var r=Is*t/5,o=Ps(r),r=Os(r);n.lineTo(r*e,-o*e),n.lineTo(o*i-r*a,r*i+o*a)}n.closePath()}},Hl=Ds(3),Gl={draw(t,n){n=-Ds(n/(3*Hl));t.moveTo(0,2*n),t.lineTo(-Hl*n,-n),t.lineTo(Hl*n,-n),t.closePath()}},Kl=Ds(3),Ul={draw(t,n){var n=.6824*Ds(n),e=n/2,i=n*Kl/2;// cos(Math.PI / 6)
|
|
692
|
+
t.moveTo(0,-n),t.lineTo(i,e),t.lineTo(-i,e),t.closePath()}},Wl=-.5,ql=Ds(3)/2,$l=1/Ds(12),Vl=3*($l/2+1),Yl={draw(t,n){var n=Ds(n/Vl),e=n/2,i=n*$l,a=e,n=n*$l+n,r=-a,o=n;t.moveTo(e,i),t.lineTo(a,n),t.lineTo(r,o),t.lineTo(Wl*e-ql*i,ql*e+Wl*i),t.lineTo(Wl*a-ql*n,ql*a+Wl*n),t.lineTo(Wl*r-ql*o,ql*r+Wl*o),t.lineTo(Wl*e+ql*i,Wl*i-ql*e),t.lineTo(Wl*a+ql*n,Wl*n-ql*a),t.lineTo(Wl*r+ql*o,Wl*o-ql*r),t.closePath()}},Zl={draw(t,n){n=.6189*Ds(n-Bs(n/6,1.7));t.moveTo(-n,-n),t.lineTo(n,n),t.moveTo(-n,n),t.lineTo(n,-n)}};
|
|
693
693
|
// These symbols are designed to be filled.
|
|
694
|
-
pn=[El,_n,
|
|
694
|
+
pn=[El,_n,Ll,Dl,Il,Gl,Yl],Br=[El,Ol,Zl,Ul,Tl,jl,Bl];
|
|
695
695
|
// These symbols are designed to be stroked (with a width of 1.5px and round caps).
|
|
696
696
|
function Xl(){}function Jl(t,n,e){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+e)/6)}function Ql(t){this._context=t}function th(t){this._context=t}function nh(t){this._context=t}function eh(t,n){this._basis=new Ql(t),this._beta=n}Ql.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:Jl(this,this._x1,this._y1);// falls through
|
|
697
697
|
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);// falls through
|
|
@@ -713,27 +713,27 @@ function vh(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}
|
|
|
713
713
|
// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1".
|
|
714
714
|
function bh(t,n,e){var i=t._x0,a=t._x1,r=t._y1,o=(a-i)/3;t._context.bezierCurveTo(i+o,t._y0+o*n,a-o,r-o*e,a,r)}function xh(t){this._context=t}function wh(t){this._context=new Sh(t)}function Sh(t){this._context=t}function kh(t){this._context=t}
|
|
715
715
|
// See https://www.particleincell.com/2012/bezier-splines/ for derivation.
|
|
716
|
-
function Ch(t){var n,e,i=t.length-1,a=new Array(i),r=new Array(i),o=new Array(i);for(r[a[0]=0]=2,o[0]=t[0]+2*t[1],n=1;n<i-1;++n)a[n]=1,r[n]=4,o[n]=4*t[n]+2*t[n+1];for(a[i-1]=2,r[i-1]=7,o[i-1]=8*t[i-1]+t[i],n=1;n<i;++n)e=a[n]/r[n-1],r[n]-=e,o[n]-=e*o[n-1];for(a[i-1]=o[i-1]/r[i-1],n=i-2;0<=n;--n)a[n]=(o[n]-a[n+1])/r[n];for(r[i-1]=(t[i]+a[i-1])/2,n=0;n<i-1;++n)r[n]=2*t[n+1]-a[n+1];return[a,r]}function Mh(t,n){this._context=t,this._t=n}function Ah(t,n){if(1<(a=t.length))for(var e,i,a,r=1,o=t[n[0]],s=o.length;r<a;++r)for(i=o,o=t[n[r]],e=0;e<s;++e)o[e][1]+=o[e][0]=isNaN(i[e][1])?i[e][0]:i[e][1]}function zh(t){for(var n=t.length,e=new Array(n);0<=--n;)e[n]=n;return e}function Th(t,n){return t[n]}function Eh(t){var n=[];return n.key=t,n}function Nh(){var s=v([]),l=zh,h=Ah,u=Th;function n(t){var n,e,i,a=Array.from(s.apply(this,arguments),Eh),r=a.length,o=-1;for(i of t)for(n=0,++o;n<r;++n)(a[n][o]=[0,+u(i,a[n].key,o,t)]).data=i;for(n=0,e=il(l(a));n<r;++n)a[e[n]].index=n;return h(a,e),a}return n.keys=function(t){return arguments.length?(s="function"==typeof t?t:v(Array.from(t)),n):s},n.value=function(t){return arguments.length?(u="function"==typeof t?t:v(+t),n):u},n.order=function(t){return arguments.length?(l=null==t?zh:"function"==typeof t?t:v(Array.from(t)),n):l},n.offset=function(t){return arguments.length?(h=null==t?Ah:t,n):h},n}function Ph(t){var e=t.map(
|
|
716
|
+
function Ch(t){var n,e,i=t.length-1,a=new Array(i),r=new Array(i),o=new Array(i);for(r[a[0]=0]=2,o[0]=t[0]+2*t[1],n=1;n<i-1;++n)a[n]=1,r[n]=4,o[n]=4*t[n]+2*t[n+1];for(a[i-1]=2,r[i-1]=7,o[i-1]=8*t[i-1]+t[i],n=1;n<i;++n)e=a[n]/r[n-1],r[n]-=e,o[n]-=e*o[n-1];for(a[i-1]=o[i-1]/r[i-1],n=i-2;0<=n;--n)a[n]=(o[n]-a[n+1])/r[n];for(r[i-1]=(t[i]+a[i-1])/2,n=0;n<i-1;++n)r[n]=2*t[n+1]-a[n+1];return[a,r]}function Mh(t,n){this._context=t,this._t=n}function Ah(t,n){if(1<(a=t.length))for(var e,i,a,r=1,o=t[n[0]],s=o.length;r<a;++r)for(i=o,o=t[n[r]],e=0;e<s;++e)o[e][1]+=o[e][0]=isNaN(i[e][1])?i[e][0]:i[e][1]}function zh(t){for(var n=t.length,e=new Array(n);0<=--n;)e[n]=n;return e}function Th(t,n){return t[n]}function Eh(t){var n=[];return n.key=t,n}function Nh(){var s=v([]),l=zh,h=Ah,u=Th;function n(t){var n,e,i,a=Array.from(s.apply(this,arguments),Eh),r=a.length,o=-1;for(i of t)for(n=0,++o;n<r;++n)(a[n][o]=[0,+u(i,a[n].key,o,t)]).data=i;for(n=0,e=il(l(a));n<r;++n)a[e[n]].index=n;return h(a,e),a}return n.keys=function(t){return arguments.length?(s="function"==typeof t?t:v(Array.from(t)),n):s},n.value=function(t){return arguments.length?(u="function"==typeof t?t:v(+t),n):u},n.order=function(t){return arguments.length?(l=null==t?zh:"function"==typeof t?t:v(Array.from(t)),n):l},n.offset=function(t){return arguments.length?(h=null==t?Ah:t,n):h},n}function Ph(t){var e=t.map(Lh);return zh(t).sort(function(t,n){return e[t]-e[n]})}function Lh(t){for(var n,e=-1,i=0,a=t.length,r=-1/0;++e<a;)(n=+t[e][1])>r&&(r=n,i=e);return i}function Bh(t){var e=t.map(Oh);return zh(t).sort(function(t,n){return e[t]-e[n]})}function Oh(t){for(var n,e=0,i=-1,a=t.length;++i<a;)(n=+t[i][1])&&(e+=n);return e}_h.prototype={areaStart:Xl,areaEnd:Xl,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))}},xh.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:bh(this,this._t0,vh(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var e=NaN;if(n=+n,(t=+t)!==this._x1||n!==this._y1){// Ignore coincident points.
|
|
717
717
|
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,bh(this,vh(this,e=yh(this,t,n)),e);break;default:bh(this,this._t0,e=yh(this,t,n))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=e}}},(wh.prototype=Object.create(xh.prototype)).point=function(t,n){xh.prototype.point.call(this,n,t)},Sh.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,e,i,a,r){this._context.bezierCurveTo(n,t,i,e,r,a)}},kh.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,e=t.length;if(e)if(this._line?this._context.lineTo(t[0],n[0]):this._context.moveTo(t[0],n[0]),2===e)this._context.lineTo(t[1],n[1]);else for(var i=Ch(t),a=Ch(n),r=0,o=1;o<e;++r,++o)this._context.bezierCurveTo(i[0][r],a[0][r],i[1][r],a[1][r],t[o],n[o]);(this._line||0!==this._line&&1===e)&&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)}},Mh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),0<=this._line&&(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;// falls through
|
|
718
|
-
default:var e;this._t<=0?(this._context.lineTo(this._x,n),this._context.lineTo(t,n)):(e=this._x*(1-this._t)+t*this._t,this._context.lineTo(e,this._y),this._context.lineTo(e,n))}this._x=t,this._y=n}};var Dh,jh=Object.freeze({__proto__:null,arc:nl,area:hl,areaRadial:yl,curveBasis:function(t){return new Ql(t)},curveBasisClosed:function(t){return new th(t)},curveBasisOpen:function(t){return new nh(t)},curveBumpX:wl,curveBumpY:Sl,curveBundle:mn,curveCardinal:n,curveCardinalClosed:oh,curveCardinalOpen:lh,curveCatmullRom:ch,curveCatmullRomClosed:dh,curveCatmullRomOpen:ph,curveLinear:rl,curveLinearClosed:function(t){return new _h(t)},curveMonotoneX:function(t){return new xh(t)},curveMonotoneY:function(t){return new wh(t)},curveNatural:function(t){return new kh(t)},curveStep:function(t){return new Mh(t,.5)},curveStepAfter:function(t){return new Mh(t,1)},curveStepBefore:function(t){return new Mh(t,0)},line:ll,lineRadial:ml,link:Al,linkHorizontal:function(){return Al(wl)},linkRadial:function(){var t=Al(kl);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},linkVertical:function(){return Al(Sl)},pie:gl,pointRadial:vl,radialArea:yl,radialLine:ml,stack:Nh,stackOffsetDiverging:function(t,n){if(0<(s=t.length))for(var e,i,a,r,o,s,l=0,h=t[n[0]].length;l<h;++l)for(e=r=o=0;e<s;++e)0<(a=(i=t[n[e]][l])[1]-i[0])?(i[0]=r,i[1]=r+=a):a<0?(i[1]=o,i[0]=o+=a):(i[0]=0,i[1]=a)},stackOffsetExpand:function(t,n){if(0<(i=t.length)){for(var e,i,a,r=0,o=t[0].length;r<o;++r){for(a=e=0;e<i;++e)a+=t[e][r][1]||0;if(a)for(e=0;e<i;++e)t[e][r][1]/=a}Ah(t,n)}},stackOffsetNone:Ah,stackOffsetSilhouette:function(t,n){if(0<(e=t.length)){for(var e,i=0,a=t[n[0]],r=a.length;i<r;++i){for(var o=0,s=0;o<e;++o)s+=t[o][i][1]||0;a[i][1]+=a[i][0]=-s/2}Ah(t,n)}},stackOffsetWiggle:function(t,n){if(0<(a=t.length)&&0<(i=(e=t[n[0]]).length)){for(var e,i,a,r=0,o=1;o<i;++o){for(var s=0,l=0,h=0;s<a;++s){for(var u=t[n[s]],c=u[o][1]||0,g=(c-(u[o-1][1]||0))/2,d=0;d<s;++d){var f=t[n[d]];g+=(f[o][1]||0)-(f[o-1][1]||0)}l+=c,h+=g*c}e[o-1][1]+=e[o-1][0]=r,l&&(r-=h/l)}e[o-1][1]+=e[o-1][0]=r,Ah(t,n)}},stackOrderAppearance:Ph,stackOrderAscending:
|
|
718
|
+
default:var e;this._t<=0?(this._context.lineTo(this._x,n),this._context.lineTo(t,n)):(e=this._x*(1-this._t)+t*this._t,this._context.lineTo(e,this._y),this._context.lineTo(e,n))}this._x=t,this._y=n}};var Dh,jh=Object.freeze({__proto__:null,arc:nl,area:hl,areaRadial:yl,curveBasis:function(t){return new Ql(t)},curveBasisClosed:function(t){return new th(t)},curveBasisOpen:function(t){return new nh(t)},curveBumpX:wl,curveBumpY:Sl,curveBundle:mn,curveCardinal:n,curveCardinalClosed:oh,curveCardinalOpen:lh,curveCatmullRom:ch,curveCatmullRomClosed:dh,curveCatmullRomOpen:ph,curveLinear:rl,curveLinearClosed:function(t){return new _h(t)},curveMonotoneX:function(t){return new xh(t)},curveMonotoneY:function(t){return new wh(t)},curveNatural:function(t){return new kh(t)},curveStep:function(t){return new Mh(t,.5)},curveStepAfter:function(t){return new Mh(t,1)},curveStepBefore:function(t){return new Mh(t,0)},line:ll,lineRadial:ml,link:Al,linkHorizontal:function(){return Al(wl)},linkRadial:function(){var t=Al(kl);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},linkVertical:function(){return Al(Sl)},pie:gl,pointRadial:vl,radialArea:yl,radialLine:ml,stack:Nh,stackOffsetDiverging:function(t,n){if(0<(s=t.length))for(var e,i,a,r,o,s,l=0,h=t[n[0]].length;l<h;++l)for(e=r=o=0;e<s;++e)0<(a=(i=t[n[e]][l])[1]-i[0])?(i[0]=r,i[1]=r+=a):a<0?(i[1]=o,i[0]=o+=a):(i[0]=0,i[1]=a)},stackOffsetExpand:function(t,n){if(0<(i=t.length)){for(var e,i,a,r=0,o=t[0].length;r<o;++r){for(a=e=0;e<i;++e)a+=t[e][r][1]||0;if(a)for(e=0;e<i;++e)t[e][r][1]/=a}Ah(t,n)}},stackOffsetNone:Ah,stackOffsetSilhouette:function(t,n){if(0<(e=t.length)){for(var e,i=0,a=t[n[0]],r=a.length;i<r;++i){for(var o=0,s=0;o<e;++o)s+=t[o][i][1]||0;a[i][1]+=a[i][0]=-s/2}Ah(t,n)}},stackOffsetWiggle:function(t,n){if(0<(a=t.length)&&0<(i=(e=t[n[0]]).length)){for(var e,i,a,r=0,o=1;o<i;++o){for(var s=0,l=0,h=0;s<a;++s){for(var u=t[n[s]],c=u[o][1]||0,g=(c-(u[o-1][1]||0))/2,d=0;d<s;++d){var f=t[n[d]];g+=(f[o][1]||0)-(f[o-1][1]||0)}l+=c,h+=g*c}e[o-1][1]+=e[o-1][0]=r,l&&(r-=h/l)}e[o-1][1]+=e[o-1][0]=r,Ah(t,n)}},stackOrderAppearance:Ph,stackOrderAscending:Bh,stackOrderDescending:function(t){return Bh(t).reverse()},stackOrderInsideOut:function(t){for(var n,e=t.length,i=t.map(Oh),a=Ph(t),r=0,o=0,s=[],l=[],h=0;h<e;++h)n=a[h],(r<o?(r+=i[n],s):(o+=i[n],l)).push(n);return l.reverse().concat(s)},stackOrderNone:zh,stackOrderReverse:function(t){return zh(t).reverse()},symbol:function(n,e){let i=null,a=Vs(r);function r(){let t;if(i=i||(t=a()),n.apply(this,arguments).draw(i,+e.apply(this,arguments)),t)return i=null,t+""||null}return n="function"==typeof n?n:v(n||El),e="function"==typeof e?e:v(void 0===e?64:+e),r.type=function(t){return arguments.length?(n="function"==typeof t?t:v(t),r):n},r.size=function(t){return arguments.length?(e="function"==typeof t?t:v(+t),r):e},r.context=function(t){return arguments.length?(i=null==t?null:t,r):i},r},symbolAsterisk:Tl,symbolCircle:El,symbolCross:_n,symbolDiamond:Ll,symbolDiamond2:Bl,symbolPlus:Ol,symbolSquare:Dl,symbolSquare2:jl,symbolStar:Il,symbolTimes:Zl,symbolTriangle:Gl,symbolTriangle2:Ul,symbolWye:Yl,symbolX:Zl,symbols:pn,symbolsFill:pn,symbolsStroke:Br});
|
|
719
719
|
/*
|
|
720
720
|
*
|
|
721
721
|
* 𝗖 𝗢 𝗟 𝗢 𝗥
|
|
722
722
|
* v 1.9.1
|
|
723
723
|
*
|
|
724
|
-
* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */J2||(J2=1,Dh={theme:{colors:{white:"#ffffff",black:"#000000",gray:{50:"#f8f9fa",100:"#f1f3f5",200:"#e9ecef",300:"#dee2e6",400:"#ced4da",500:"#adb5bd",600:"#868e96",700:"#495057",800:"#343a40",900:"#212529"},red:{50:"#fff5f5",100:"#ffe3e3",200:"#ffc9c9",300:"#ffa8a8",400:"#ff8787",500:"#ff6b6b",600:"#fa5252",700:"#f03e3e",800:"#e03131",900:"#c92a2a"},pink:{50:"#fff0f6",100:"#ffdeeb",200:"#fcc2d7",300:"#faa2c1",400:"#f783ac",500:"#f06595",600:"#e64980",700:"#d6336c",800:"#c2255c",900:"#a61e4d"},grape:{50:"#f8f0fc",100:"#f3d9fa",200:"#eebefa",300:"#e599f7",400:"#da77f2",500:"#cc5de8",600:"#be4bdb",700:"#ae3ec9",800:"#9c36b5",900:"#862e9c"},violet:{50:"#f3f0ff",100:"#e5dbff",200:"#d0bfff",300:"#b197fc",400:"#9775fa",500:"#845ef7",600:"#7950f2",700:"#7048e8",800:"#6741d9",900:"#5f3dc4"},indigo:{50:"#edf2ff",100:"#dbe4ff",200:"#bac8ff",300:"#91a7ff",400:"#748ffc",500:"#5c7cfa",600:"#4c6ef5",700:"#4263eb",800:"#3b5bdb",900:"#364fc7"},blue:{50:"#e7f5ff",100:"#d0ebff",200:"#a5d8ff",300:"#74c0fc",400:"#4dabf7",500:"#339af0",600:"#228be6",700:"#1c7ed6",800:"#1971c2",900:"#1864ab"},cyan:{50:"#e3fafc",100:"#c5f6fa",200:"#99e9f2",300:"#66d9e8",400:"#3bc9db",500:"#22b8cf",600:"#15aabf",700:"#1098ad",800:"#0c8599",900:"#0b7285"},teal:{50:"#e6fcf5",100:"#c3fae8",200:"#96f2d7",300:"#63e6be",400:"#38d9a9",500:"#20c997",600:"#12b886",700:"#0ca678",800:"#099268",900:"#087f5b"},green:{50:"#ebfbee",100:"#d3f9d8",200:"#b2f2bb",300:"#8ce99a",400:"#69db7c",500:"#51cf66",600:"#40c057",700:"#37b24d",800:"#2f9e44",900:"#2b8a3e"},lime:{50:"#f4fce3",100:"#e9fac8",200:"#d8f5a2",300:"#c0eb75",400:"#a9e34b",500:"#94d82d",600:"#82c91e",700:"#74b816",800:"#66a80f",900:"#5c940d"},yellow:{50:"#fff9db",100:"#fff3bf",200:"#ffec99",300:"#ffe066",400:"#ffd43b",500:"#fcc419",600:"#fab005",700:"#f59f00",800:"#f08c00",900:"#e67700"},orange:{50:"#fff4e6",100:"#ffe8cc",200:"#ffd8a8",300:"#ffc078",400:"#ffa94d",500:"#ff922b",600:"#fd7e14",700:"#f76707",800:"#e8590c",900:"#d9480f"}}},plugins:[]});var mn=
|
|
724
|
+
* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */J2||(J2=1,Dh={theme:{colors:{white:"#ffffff",black:"#000000",gray:{50:"#f8f9fa",100:"#f1f3f5",200:"#e9ecef",300:"#dee2e6",400:"#ced4da",500:"#adb5bd",600:"#868e96",700:"#495057",800:"#343a40",900:"#212529"},red:{50:"#fff5f5",100:"#ffe3e3",200:"#ffc9c9",300:"#ffa8a8",400:"#ff8787",500:"#ff6b6b",600:"#fa5252",700:"#f03e3e",800:"#e03131",900:"#c92a2a"},pink:{50:"#fff0f6",100:"#ffdeeb",200:"#fcc2d7",300:"#faa2c1",400:"#f783ac",500:"#f06595",600:"#e64980",700:"#d6336c",800:"#c2255c",900:"#a61e4d"},grape:{50:"#f8f0fc",100:"#f3d9fa",200:"#eebefa",300:"#e599f7",400:"#da77f2",500:"#cc5de8",600:"#be4bdb",700:"#ae3ec9",800:"#9c36b5",900:"#862e9c"},violet:{50:"#f3f0ff",100:"#e5dbff",200:"#d0bfff",300:"#b197fc",400:"#9775fa",500:"#845ef7",600:"#7950f2",700:"#7048e8",800:"#6741d9",900:"#5f3dc4"},indigo:{50:"#edf2ff",100:"#dbe4ff",200:"#bac8ff",300:"#91a7ff",400:"#748ffc",500:"#5c7cfa",600:"#4c6ef5",700:"#4263eb",800:"#3b5bdb",900:"#364fc7"},blue:{50:"#e7f5ff",100:"#d0ebff",200:"#a5d8ff",300:"#74c0fc",400:"#4dabf7",500:"#339af0",600:"#228be6",700:"#1c7ed6",800:"#1971c2",900:"#1864ab"},cyan:{50:"#e3fafc",100:"#c5f6fa",200:"#99e9f2",300:"#66d9e8",400:"#3bc9db",500:"#22b8cf",600:"#15aabf",700:"#1098ad",800:"#0c8599",900:"#0b7285"},teal:{50:"#e6fcf5",100:"#c3fae8",200:"#96f2d7",300:"#63e6be",400:"#38d9a9",500:"#20c997",600:"#12b886",700:"#0ca678",800:"#099268",900:"#087f5b"},green:{50:"#ebfbee",100:"#d3f9d8",200:"#b2f2bb",300:"#8ce99a",400:"#69db7c",500:"#51cf66",600:"#40c057",700:"#37b24d",800:"#2f9e44",900:"#2b8a3e"},lime:{50:"#f4fce3",100:"#e9fac8",200:"#d8f5a2",300:"#c0eb75",400:"#a9e34b",500:"#94d82d",600:"#82c91e",700:"#74b816",800:"#66a80f",900:"#5c940d"},yellow:{50:"#fff9db",100:"#fff3bf",200:"#ffec99",300:"#ffe066",400:"#ffd43b",500:"#fcc419",600:"#fab005",700:"#f59f00",800:"#f08c00",900:"#e67700"},orange:{50:"#fff4e6",100:"#ffe8cc",200:"#ffd8a8",300:"#ffc078",400:"#ffa94d",500:"#ff922b",600:"#fd7e14",700:"#f76707",800:"#e8590c",900:"#d9480f"}}},plugins:[]});var mn=Fe(Dh),n=mn.theme,Rh={dark:n.colors.gray[700],light:n.colors.gray[50],missing:n.colors.gray[400],off:n.colors.red[900],on:n.colors.green[900],scale:ba().range([n.colors.indigo[900],n.colors.yellow[600],n.colors.red[900],n.colors.green[900],n.colors.orange[600],n.colors.grape[900],n.colors.cyan[600],n.colors.pink[600],n.colors.lime[600],n.colors.blue[300],n.colors.pink[300],n.colors.lime[300],n.colors.violet[300],n.colors.cyan[100],n.colors.orange[100],n.colors.green[100],n.colors.grape[100],n.colors.red[100]])};
|
|
725
725
|
/**
|
|
726
726
|
Returns a color based on a key, whether it is present in a user supplied object or in the default object.
|
|
727
727
|
@returns {String}
|
|
728
728
|
@private
|
|
729
|
-
*/function
|
|
729
|
+
*/function Fh(t,n
|
|
730
730
|
/**
|
|
731
731
|
@function colorAssign
|
|
732
732
|
@desc Assigns a color to a value using a predefined set of defaults.
|
|
733
733
|
@param {String} c A valid CSS color string.
|
|
734
734
|
@param {Object} [u = defaults] An object containing overrides of the default colors.
|
|
735
735
|
@returns {String}
|
|
736
|
-
*/){n=1<arguments.length&&void 0!==n?n:{};return t in n?n[t]:t in Rh?Rh[t]:Rh.missing}function
|
|
736
|
+
*/){n=1<arguments.length&&void 0!==n?n:{};return t in n?n[t]:t in Rh?Rh[t]:Rh.missing}function Ih(t,n
|
|
737
737
|
/**
|
|
738
738
|
@function colorContrast
|
|
739
739
|
@desc A set of default color values used when assigning colors based on data.
|
|
@@ -742,15 +742,15 @@ default:var e;this._t<=0?(this._context.lineTo(this._x,n),this._context.lineTo(t
|
|
|
742
742
|
@returns {String}
|
|
743
743
|
*/){n=1<arguments.length&&void 0!==n?n:{};
|
|
744
744
|
// If the value is null or undefined, set to grey.
|
|
745
|
-
return 0<=[null,void 0].indexOf(t)?
|
|
745
|
+
return 0<=[null,void 0].indexOf(t)?Fh("missing",n):!0===t?Fh("on",n):!1===t?Fh("off",n):
|
|
746
746
|
// If the value is not a valid color string, use the color scale.
|
|
747
|
-
zn(t)?t.toString():
|
|
747
|
+
zn(t)?t.toString():Fh("scale",n)(t)}function Hh(t,n
|
|
748
748
|
/**
|
|
749
749
|
@function colorLegible
|
|
750
750
|
@desc Darkens a color so that it will appear legible on a white background.
|
|
751
751
|
@param {String} c A valid CSS color string.
|
|
752
752
|
@returns {String}
|
|
753
|
-
*/){n=1<arguments.length&&void 0!==n?n:{};return
|
|
753
|
+
*/){n=1<arguments.length&&void 0!==n?n:{};return Fh(128<=(299*(t=Nn(t)).r+587*t.g+114*t.b)/1e3?"dark":"light",n)}function Gh(t){return.45<(t=In(t)).l&&(.8<t.s&&(t.s=.8),t.l=.45),t.toString()}
|
|
754
754
|
/**
|
|
755
755
|
@function colorLighter
|
|
756
756
|
@desc Similar to d3.color.brighter, except that this also reduces saturation so that colors don't appear neon.
|
|
@@ -762,7 +762,7 @@ zn(t)?t.toString():Ih("scale",n)(t)}function Hh(t,n
|
|
|
762
762
|
@function isData
|
|
763
763
|
@desc Returns true/false whether the argument provided to the function should be loaded using an internal XHR request. Valid data can either be a string URL or an Object with "url" and "headers" keys.
|
|
764
764
|
@param {*} dataItem The value to be tested
|
|
765
|
-
*/){n=1<arguments.length&&void 0!==n?n:.5;return n*=1-(t=
|
|
765
|
+
*/){n=1<arguments.length&&void 0!==n?n:.5;return n*=1-(t=In(t)).l,t.l+=n,t.s-=n,t.toString()}function Uh(t){return"string"==typeof t||"object"==(void 0===t?"undefined":(n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)&&t.url;var n}var Wh={},qh={};function $h(t){return new Function("d","return {"+t.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}
|
|
766
766
|
// Compute unique columns in order of discovery.
|
|
767
767
|
function Vh(t){var e=Object.create(null),i=[];return t.forEach(function(t){for(var n in t)n in e||i.push(e[n]=n)}),i}function Yh(t,n){var t=t+"",e=t.length;return e<n?new Array(n-e+1).join(0)+t:t}function Zh(t){var n,e=t.getUTCHours(),i=t.getUTCMinutes(),a=t.getUTCSeconds(),r=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((n=t.getUTCFullYear())<0?"-"+Yh(-n,6):9999<n?"+"+Yh(n,6):Yh(n,4))+"-"+Yh(t.getUTCMonth()+1,2)+"-"+Yh(t.getUTCDate(),2)+(r?"T"+Yh(e,2)+":"+Yh(i,2)+":"+Yh(a,2)+"."+Yh(r,3)+"Z":a?"T"+Yh(e,2)+":"+Yh(i,2)+":"+Yh(a,2)+"Z":i||e?"T"+Yh(e,2)+":"+Yh(i,2)+"Z":"")}function Xh(i){var n=new RegExp('["'+i+"\n\r]"),c=i.charCodeAt(0);function e(i,t){var n,e=[],a=i.length,r=0,o=0,s=a<=0,l=!1;// current token followed by EOL?
|
|
768
768
|
// Strip the trailing newline.
|
|
@@ -1072,7 +1072,7 @@ return function t(n,e,i,a,r){for(var o,s,l,h,u,c,g,d=a,f=e+1;f<i;f++){s=n[f],p=n
|
|
|
1072
1072
|
@param {Array} polygon
|
|
1073
1073
|
@param {Number} sqTolerance
|
|
1074
1074
|
@private
|
|
1075
|
-
*/(t,n)=>{for(var e,i=t[0],a=[i],r=1,o=t.length;r<o;r++)Mu(e=t[r],i)>n&&(a.push(e),i=e);return i!==e&&a.push(e),a})(t,n),n)),t}function
|
|
1075
|
+
*/(t,n)=>{for(var e,i=t[0],a=[i],r=1,o=t.length;r<o;r++)Mu(e=t[r],i)>n&&(a.push(e),i=e);return i!==e&&a.push(e),a})(t,n),n)),t}function Lu(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Bu(t,n){return null!=n&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?n[Symbol.hasInstance](t):t instanceof n}function Ou(t,n){return(t=>{if(Array.isArray(t))return t})(t)||((t,n)=>{var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var i,a,r=[],o=!0,s=!1;try{for(e=e.call(t);!(o=(i=e.next()).done)&&(r.push(i.value),!n||r.length!==n);o=!0);}catch(t){s=!0,a=t}finally{try{o||null==e.return||e.return()}finally{if(s)throw a}}return r}})(t,n)||((t,n)=>{var e;if(t)return"string"==typeof t?Lu(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Lu(t,n):void 0}
|
|
1076
1076
|
// Algorithm constants
|
|
1077
1077
|
)(t,n)||(()=>{throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}var Du={};// step size for the aspect ratio
|
|
1078
1078
|
/**
|
|
@@ -1112,14 +1112,14 @@ return function t(n,e,i,a,r){for(var o,s,l,h,u,c,g,d=a,f=e+1;f<i;f++){s=n[f],p=n
|
|
|
1112
1112
|
@returns {Array}
|
|
1113
1113
|
*/){var e=1<arguments.length&&void 0!==n?n:{};if(t.length<3)return e.verbose&&console.error("polygon has to have at least 3 points",t),null;
|
|
1114
1114
|
// For visualization debugging purposes
|
|
1115
|
-
var i,a=[],r=
|
|
1115
|
+
var i,a=[],r=Bu((
|
|
1116
1116
|
// User's input normalization
|
|
1117
|
-
e=Object.assign({angle:jt(-90,95,5),cache:!0,maxAspectRatio:15,minAspectRatio:1,minHeight:0,minWidth:0,nTries:20,tolerance:.02,verbose:!1},e)).angle,Array)?e.angle:"number"==typeof e.angle?[e.angle]:"string"!=typeof e.angle||isNaN(e.angle)?[]:[Number(e.angle)],D=
|
|
1117
|
+
e=Object.assign({angle:jt(-90,95,5),cache:!0,maxAspectRatio:15,minAspectRatio:1,minHeight:0,minWidth:0,nTries:20,tolerance:.02,verbose:!1},e)).angle,Array)?e.angle:"number"==typeof e.angle?[e.angle]:"string"!=typeof e.angle||isNaN(e.angle)?[]:[Number(e.angle)],D=Bu(e.aspectRatio,Array)?e.aspectRatio:"number"==typeof e.aspectRatio?[e.aspectRatio]:"string"!=typeof e.aspectRatio||isNaN(e.aspectRatio)?[]:[Number(e.aspectRatio)],o=e.origin&&Bu(e.origin,Array)?Bu(e.origin[0],Array)?e.origin:[e.origin]:[];if(e.cache&&(i=oa(t).join(","),i=(i=(i=(i=(i=(i+="-".concat(e.minAspectRatio))+"-".concat(e.maxAspectRatio))+"-".concat(e.minHeight))+"-".concat(e.minWidth))+"-".concat(r.join(",")))+"-".concat(o.join(",")),Du[i]))return Du[i];var j=Math.abs((t=>{for(var n,e=-1,i=t.length,a=t[i-1],r=0;++e<i;)n=a,a=t[e],r+=n[1]*a[0]-n[0]*a[1];return r/2})(t));// take absolute value of the signed area
|
|
1118
1118
|
if(0===j)return e.verbose&&console.error("polygon has 0 area",t),null;
|
|
1119
1119
|
// get the width of the bounding box of the original polygon to determine tolerance
|
|
1120
1120
|
var n=Ou(Hi(t,function(t){return t[0]}),2),s=n[0],n=n[1],l=Ou(Hi(t,function(t){return t[1]}),2),h=l[0],l=l[1],l=Math.min(n-s,l-h)*e.tolerance,n=(0<l&&(t=Pu(t,l)),e.events&&a.push({type:"simplify",poly:t}),s=(
|
|
1121
1121
|
// get the width of the bounding box of the simplified polygon
|
|
1122
|
-
l=Ou(Hi(t,function(t){return t[0]}),2))[0],n=l[1],h=(l=Ou(Hi(t,function(t){return t[1]}),2))[0],[n-s,l[1]-h]),R=n[0],
|
|
1122
|
+
l=Ou(Hi(t,function(t){return t[0]}),2))[0],n=l[1],h=(l=Ou(Hi(t,function(t){return t[1]}),2))[0],[n-s,l[1]-h]),R=n[0],F=n[1],I=Math.min(R,F)/50;
|
|
1123
1123
|
// populate possible center points with random points inside the polygon
|
|
1124
1124
|
if(!o.length){
|
|
1125
1125
|
// get the centroid of the polygon
|
|
@@ -1130,13 +1130,13 @@ l=(t=>{for(var n,e,i=-1,a=t.length,r=0,o=0,s=t[a-1],l=0;++i<a;)n=s,s=t[i],l+=e=n
|
|
|
1130
1130
|
// negative if clockwise, and zero if the points are collinear.
|
|
1131
1131
|
)(t);if(!isFinite(l[0]))return e.verbose&&console.error("cannot find centroid",t),null;bu(t,l)&&o.push(l);
|
|
1132
1132
|
// get few more points inside the polygon
|
|
1133
|
-
for(var H=e.nTries;H;){var G=[Math.random()*R+s,Math.random()*
|
|
1133
|
+
for(var H=e.nTries;H;){var G=[Math.random()*R+s,Math.random()*F+h];bu(t,G)&&o.push(G),H--}}e.events&&a.push({type:"origins",points:o});for(var u=0,c=null,g=0;g<r.length;g++){var d=r[g],f=-d*Math.PI/180;e.events&&a.push({type:"angle",angle:d});for(var p=0;p<o.length;p++){var _=o[p],m=Ou(Tu(t,_,f),2),y=m[0],m=m[1],_=Ou(Tu(t,_,f+Math.PI/2),2),v=_[0],_=_[1],b=[];
|
|
1134
1134
|
// generate improved origins
|
|
1135
1135
|
y&&m&&b.push([(y[0]+m[0])/2,(y[1]+m[1])/2]),// average along with width axis
|
|
1136
1136
|
v&&_&&b.push([(v[0]+_[0])/2,(v[1]+_[1])/2]),// average along with height axis
|
|
1137
1137
|
e.events&&a.push({type:"modifOrigin",idx:p,p1W:y,p2W:m,p1H:v,p2H:_,modifOrigins:b});for(var x=0;x<b.length;x++){var w=b[x],S=(e.events&&a.push({type:"origin",cx:w[0],cy:w[1]}),Ou(Tu(t,w,f),2)),k=S[0],S=S[1];if(null!==k&&null!==S){var k=Math.min(Mu(w,k),Mu(w,S)),C=2*Math.sqrt(k),S=Ou(Tu(t,w,f+Math.PI/2),2),k=S[0],S=S[1];if(null!==k&&null!==S){var k=Math.min(Mu(w,k),Mu(w,S)),M=2*Math.sqrt(k);if(!(C*M<u)){var A=D;A.length||(A=jt(Math.max(e.minAspectRatio,e.minWidth/M,u/(M*M)),Math.min(e.maxAspectRatio,C/e.minHeight,C*C/u)+.5,.5));for(var K=0;K<A.length;K++){var z=A[K],T=Math.max(e.minWidth,Math.sqrt(u*z)),E=Math.min(C,M*z);
|
|
1138
1138
|
// do a binary search to find the max width that works
|
|
1139
|
-
if(!(E*M<u))for(e.events&&
|
|
1139
|
+
if(!(E*M<u))for(e.events&&I<=E-T&&a.push({type:"aRatio",aRatio:z});I<=E-T;){var N=(T+E)/2,P=N/z,L=Ou(w,2),B=L[0],L=L[1],O=[[B-N/2,L-P/2],[B+N/2,L-P/2],[B+N/2,L+P/2],[B-N/2,L+P/2]],U=Cu(O=function(t,n,e
|
|
1140
1140
|
/**
|
|
1141
1141
|
@desc square distance from a point to a segment
|
|
1142
1142
|
@param {Array} point
|
|
@@ -1145,27 +1145,27 @@ if(!(E*M<u))for(e.events&&F<=E-T&&a.push({type:"aRatio",aRatio:z});F<=E-T;){var
|
|
|
1145
1145
|
@private
|
|
1146
1146
|
*/){var i=2<arguments.length&&void 0!==e?e:[0,0];return t.map(function(t){return Eu(t,n,i)})}(O,f,w),t);U?(
|
|
1147
1147
|
// we know that the area is already greater than the maxArea found so far
|
|
1148
|
-
u=N*P,O.push(O[0]),c={area:u,cx:
|
|
1148
|
+
u=N*P,O.push(O[0]),c={area:u,cx:B,cy:L,width:N,height:P,angle:-d,points:O},T=N):E=N,e.events&&a.push({type:"rectangle",areaFraction:N*P/j,cx:B,cy:L,width:N,height:P,angle:d,insidePoly:U})}}}}}}}}return e.cache&&(Du[i]=c),e.events?Object.assign(c||{},{events:a}):c}
|
|
1149
1149
|
/**
|
|
1150
1150
|
@function pointDistance
|
|
1151
1151
|
@desc Calculates the pixel distance between two points.
|
|
1152
1152
|
@param {Array} p1 The first point, which should always be an `[x, y]` formatted Array.
|
|
1153
1153
|
@param {Array} p2 The second point, which should always be an `[x, y]` formatted Array.
|
|
1154
1154
|
@returns {Number}
|
|
1155
|
-
*/function Ru(t,n){return Math.sqrt(Mu(t,n))}var
|
|
1155
|
+
*/function Ru(t,n){return Math.sqrt(Mu(t,n))}var Fu=function(t,n){return parseFloat(Math.round(t*Math.pow(10,n))/Math.pow(10,n)).toFixed(n)};
|
|
1156
1156
|
/**
|
|
1157
1157
|
* @private
|
|
1158
1158
|
*/
|
|
1159
1159
|
/**
|
|
1160
1160
|
* @private
|
|
1161
|
-
*/function
|
|
1161
|
+
*/function Iu(t,n){var e=Math.pow(10,3*Math.abs(8-n));return{scale:8<n?function(t){return t/e}:function(t){return t*e},symbol:t}}
|
|
1162
1162
|
/**
|
|
1163
1163
|
@function formatAbbreviate
|
|
1164
1164
|
@desc Formats a number to an appropriate number of decimal places and rounding, adding suffixes if applicable (ie. `1200000` to `"1.2M"`).
|
|
1165
1165
|
@param {Number|String} n The number to be formatted.
|
|
1166
1166
|
@param {Object|String} locale The locale config to be used. If *value* is an object, the function will format the numbers according the object. The object must include `suffixes`, `delimiter` and `currency` properties.
|
|
1167
1167
|
@returns {String}
|
|
1168
|
-
*/function Hu(t){var n,e,i,a,r,o,s,l,h=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"en-US",u=2<arguments.length&&void 0!==arguments[2]?arguments[2]:void 0;return isFinite(t)?(n=(t*=1)<0,e=t.toString().split(".")[0].replace("-","").length,h=(i="object"==(void 0===h?"undefined":(i=h)&&"undefined"!=typeof Symbol&&i.constructor===Symbol?"symbol":typeof i)?h:xi[h]||xi["en-US"]).suffixes.map(
|
|
1168
|
+
*/function Hu(t){var n,e,i,a,r,o,s,l,h=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"en-US",u=2<arguments.length&&void 0!==arguments[2]?arguments[2]:void 0;return isFinite(t)?(n=(t*=1)<0,e=t.toString().split(".")[0].replace("-","").length,h=(i="object"==(void 0===h?"undefined":(i=h)&&"undefined"!=typeof Symbol&&i.constructor===Symbol?"symbol":typeof i)?h:xi[h]||xi["en-US"]).suffixes.map(Iu),a=i.delimiters.decimal||".",r=i.separator||"",o=i.delimiters.thousands||",",o=Ua({currency:i.currency||["$",""],decimal:a,grouping:i.grouping||[3],thousands:o}),h=u?o.format(u)(t):0===t?"0":3<=e?(u=o.format(".3r")(t),s=2,h=h,l=0,(u=parseFloat(u.replace("−","-"),10))&&(u<0&&(u*=-1),l=1+Math.floor(1e-12+Math.log(u)/Math.LN10),l=Math.max(-24,Math.min(24,3*Math.floor((l-1)/3)))),h=h[8+l/3],l={number:Fu(h.scale(u),s),symbol:h.symbol},u=parseFloat(l.number).toString().replace(".",a),s=l.symbol,"".concat(u).concat(r).concat(s)):(3===e?o.format(",f"):t<1&&-1<t?o.format(".2g"):o.format(".3g"))(t),"".concat(n&&"−"!==h.charAt(0)?"−":"").concat(h).replace(/−/g,"-").replace(/(\.[0]*[1-9]*)[0]*$/g,"$1").replace(/\.[0]*$/g,"")):"N/A"}function Gu(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Ku(t,n){return(t=>{if(Array.isArray(t))return t})(t)||((t,n)=>{var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var i,a,r=[],o=!0,s=!1;try{for(e=e.call(t);!(o=(i=e.next()).done)&&(r.push(i.value),!n||r.length!==n);o=!0);}catch(t){s=!0,a=t}finally{try{o||null==e.return||e.return()}finally{if(s)throw a}}return r}})(t,n)||((t,n)=>{var e;if(t)return"string"==typeof t?Gu(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Gu(t,n):void 0}
|
|
1169
1169
|
/**
|
|
1170
1170
|
@function formatDate
|
|
1171
1171
|
@desc A default set of date formatters, which takes into account both the interval in between in each data point but also the start/end data points.
|
|
@@ -1181,7 +1181,7 @@ u=N*P,O.push(O[0]),c={area:u,cx:L,cy:B,width:N,height:P,angle:-d,points:O},T=N):
|
|
|
1181
1181
|
@param {*} d2
|
|
1182
1182
|
@returns {Number} the number of months between the two Date objects
|
|
1183
1183
|
@private
|
|
1184
|
-
*/){var t=2<arguments.length&&void 0!==t?t:Qr,e=t("%I %p"),i=t(".%L"),a=t("%I:%M"),r=t("%b"),s=t("%b %-d"),l=t("%b %-d, %Y"),h=t("%b %Y"),u=t("Q%q"),c=t("Q%q %Y"),g=t(":%S"),t=t("%Y"),d=o.findIndex(function(t){return+t==+n}),d=0===d||d===o.length-1,f=o.length<=5,p=Ku(o.reduce(function(t,n,e){var i,a,r;return e&&(t[0].push(n.getFullYear()-o[e-1].getFullYear()),t[1].push((i=o[e-1],r=12*((a=n).getFullYear()-i.getFullYear()),(r=(r-=i.getMonth())+a.getMonth())<=0?0:r)),t[2].push(Math.round((n-o[e-1])/864e5)),t[3].push(Math.round((n-o[e-1])/36e5))),t},[[],[],[],[]]),4),_=p[0],m=p[1],y=p[2],p=p[3];return(_.every(function(t){return 1<=t&&!(t%1)})?t:m.every(function(t){return 3<=t&&!(t%3)})?+Hr(n)===n||d||f?c:u:m.every(function(t){return 1<=t&&!(t%1)})?+Hr(n)===n||d||f?h:r:y.every(function(t){return 1<=t&&!(t%1)})?+Hr(n)===n||d||f?l:s:p.every(function(t){return 1<=t&&!(t%1)})?d||f?l:+
|
|
1184
|
+
*/){var t=2<arguments.length&&void 0!==t?t:Qr,e=t("%I %p"),i=t(".%L"),a=t("%I:%M"),r=t("%b"),s=t("%b %-d"),l=t("%b %-d, %Y"),h=t("%b %Y"),u=t("Q%q"),c=t("Q%q %Y"),g=t(":%S"),t=t("%Y"),d=o.findIndex(function(t){return+t==+n}),d=0===d||d===o.length-1,f=o.length<=5,p=Ku(o.reduce(function(t,n,e){var i,a,r;return e&&(t[0].push(n.getFullYear()-o[e-1].getFullYear()),t[1].push((i=o[e-1],r=12*((a=n).getFullYear()-i.getFullYear()),(r=(r-=i.getMonth())+a.getMonth())<=0?0:r)),t[2].push(Math.round((n-o[e-1])/864e5)),t[3].push(Math.round((n-o[e-1])/36e5))),t},[[],[],[],[]]),4),_=p[0],m=p[1],y=p[2],p=p[3];return(_.every(function(t){return 1<=t&&!(t%1)})?t:m.every(function(t){return 3<=t&&!(t%3)})?+Hr(n)===n||d||f?c:u:m.every(function(t){return 1<=t&&!(t%1)})?+Hr(n)===n||d||f?h:r:y.every(function(t){return 1<=t&&!(t%1)})?+Hr(n)===n||d||f?l:s:p.every(function(t){return 1<=t&&!(t%1)})?d||f?l:+Fr(n)===n?s:e:Sr(n)<n?i:kr(n)<n?g:Mr(n)<n?a:n)(n)}function Wu(){return"".concat(Math.random().toString(36),"00000000000000000").replace(/[^a-z]+/g,"").slice(0,5)}function qu(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function $u(t,n){var e,i;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=((t,n)=>{var e;if(t)return"string"==typeof t?qu(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?qu(t,n):void 0})(t))||n)return e&&(t=e),i=0,{s:n=function(){},n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,r=!0,o=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return r=t.done,t},e:function(t){o=!0,a=t},f:function(){try{r||null==e.return||e.return()}finally{if(o)throw a}}}}
|
|
1185
1185
|
/* eslint import/no-anonymous-default-export: [2, {"allowObject": true}] */var Vu={circles:function(){function n(t){var n=t.append("defs").append("pattern").attr("id",g).attr("patternUnits","userSpaceOnUse").attr("width",r).attr("height",r);if(o&&n.append("rect").attr("width",r).attr("height",r).attr("fill",o),n.append("circle").attr("cx",r/2).attr("cy",r/2).attr("r",s).attr("fill",h).attr("stroke",u).attr("stroke-width",c),l)for(var e=0,i=[[0,0],[0,r],[r,0],[r,r]];e<i.length;e++){var a=i[e];n.append("circle").attr("cx",a[0]).attr("cy",a[1]).attr("r",s).attr("fill",h).attr("stroke",u).attr("stroke-width",c)}}var r=20,o="",s=2,l=!1,h="#343434",u="#343434",c=0,g=Wu();return n.heavier=function(t){return s*=0===arguments.length?2:2*t,n},n.lighter=function(t){return s/=0===arguments.length?2:2*t,n},n.thinner=function(t){return r*=0===arguments.length?2:2*t,n},n.thicker=function(t){return r/=0===arguments.length?2:2*t,n},n.background=function(t){return o=t,n},n.size=function(t){return r=t,n},n.complement=function(t){return l=0===arguments.length||t,n},n.radius=function(t){return s=t,n},n.fill=function(t){return h=t,n},n.stroke=function(t){return u=t,n},n.strokeWidth=function(t){return c=t,n},n.id=function(t){return 0===arguments.length?g:(g=t,n)},n.url=function(){return"url(#".concat(g,")")},n},lines:function(){function i(t){var n,e=t.append("defs").append("pattern").attr("id",h).attr("patternUnits","userSpaceOnUse").attr("width",r).attr("height",r),i=(l&&e.append("rect").attr("width",r).attr("height",r).attr("fill",l),$u(u));try{for(i.s();!(n=i.n()).done;){var a=n.value;e.append("path").attr("d",(t=>{var n=r;switch(t){case"0/8":case"vertical":return"M ".concat(n/2,", 0 l 0, ").concat(n);case"1/8":return"M ".concat(-n/4,",").concat(n," l ").concat(n/2,",").concat(-n," M ").concat(n/4,",").concat(n," l ").concat(n/2,",").concat(-n," M ").concat(3*n/4,",").concat(n," l ").concat(n/2,",").concat(-n);case"2/8":case"diagonal":return"M 0,".concat(n," l ").concat(n,",").concat(-n," M ").concat(-n/4,",").concat(n/4," l ").concat(n/2,",").concat(-n/2," M ").concat(.75*n,",").concat(5/4*n," l ").concat(n/2,",").concat(-n/2);case"3/8":return"M 0,".concat(.75*n," l ").concat(n,",").concat(-n/2," M 0,").concat(n/4," l ").concat(n,",").concat(-n/2," M 0,").concat(5*n/4," l ").concat(n,",").concat(-n/2);case"4/8":case"horizontal":return"M 0,".concat(n/2," l ").concat(n,",0");case"5/8":return"M 0,".concat(-n/4," l ").concat(n,",").concat(n/2,"M 0,").concat(n/4," l ").concat(n,",").concat(n/2," M 0,").concat(3*n/4," l ").concat(n,",").concat(n/2);case"6/8":return"M 0,0 l ".concat(n,",").concat(n," M ").concat(-n/4,",").concat(.75*n," l ").concat(n/2,",").concat(n/2," M ").concat(3*n/4,",").concat(-n/4," l ").concat(n/2,",").concat(n/2);case"7/8":return"M ".concat(-n/4,",0 l ").concat(n/2,",").concat(n," M ").concat(n/4,",0 l ").concat(n/2,",").concat(n," M ").concat(3*n/4,",0 l ").concat(n/2,",").concat(n);default:return"M ".concat(n/2,", 0 l 0, ").concat(n)}})(a)).attr("stroke-width",s).attr("shape-rendering",c).attr("stroke",o).attr("stroke-linecap","square")}}catch(t){i.e(t)}finally{i.f()}}var r=20,o="#343434",s=2,l="",h=Wu(),u=["diagonal"],c="auto";return i.heavier=function(t){return s*=0===arguments.length?2:2*t,i},i.lighter=function(t){return s/=0===arguments.length?2:2*t,i},i.thinner=function(t){return r*=0===arguments.length?2:2*t,i},i.thicker=function(t){return r/=0===arguments.length?2:2*t,i},i.background=function(t){return l=t,i},i.size=function(t){return r=t,i},i.orientation=function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return 0!==arguments.length&&(u=n),i},i.shapeRendering=function(t){return c=t,i},i.stroke=function(t){return o=t,i},i.strokeWidth=function(t){return s=t,i},i.id=function(t){return 0===arguments.length?h:(h=t,i)},i.url=function(){return"url(#".concat(h,")")},i},paths:function(){function n(t){var n=(t=>{var n=a;switch(t){case"squares":return"M ".concat(n/4," ").concat(n/4," l ").concat(n/2," 0 l 0 ").concat(n/2," l ").concat(-n/2," 0 Z");case"nylon":return"M 0 ".concat(n/4," l ").concat(n/4," 0 l 0 ").concat(-n/4," M ").concat(3*n/4," ").concat(n," l 0 ").concat(-n/4," l ").concat(n/4," 0 M ").concat(n/4," ").concat(n/2," l 0 ").concat(n/4," l ").concat(n/4," 0 M ").concat(n/2," ").concat(n/4," l ").concat(n/4," 0 l 0 ").concat(n/4);case"waves":return"M 0 ".concat(n/2," c ").concat(n/8," ").concat(-n/4," , ").concat(3*n/8," ").concat(-n/4," , ").concat(n/2," 0 c ").concat(n/8," ").concat(n/4," , ").concat(3*n/8," ").concat(n/4," , ").concat(n/2," 0 M ").concat(-n/2," ").concat(n/2," c ").concat(n/8," ").concat(n/4," , ").concat(3*n/8," ").concat(n/4," , ").concat(n/2," 0 M ").concat(n," ").concat(n/2," c ").concat(n/8," ").concat(-n/4," , ").concat(3*n/8," ").concat(-n/4," , ").concat(n/2," 0");case"woven":return"M ".concat(n/4,",").concat(n/4,"l").concat(n/2,",").concat(n/2,"M").concat(3*n/4,",").concat(n/4,"l").concat(n/2,",").concat(-n/2," M").concat(n/4,",").concat(3*n/4,"l").concat(-n/2,",").concat(n/2,"M").concat(3*n/4,",").concat(5*n/4,"l").concat(n/2,",").concat(-n/2," M").concat(-n/4,",").concat(n/4,"l").concat(n/2,",").concat(-n/2);case"crosses":return"M ".concat(n/4,",").concat(n/4,"l").concat(n/2,",").concat(n/2,"M").concat(n/4,",").concat(3*n/4,"l").concat(n/2,",").concat(-n/2);case"caps":return"M ".concat(n/4,",").concat(3*n/4,"l").concat(n/4,",").concat(-n/2,"l").concat(n/4,",").concat(n/2);case"hexagons":return e=3,i=Math.sqrt(3),"M ".concat(n,",0 l ").concat(n,",0 l ").concat(n/2,",").concat(n*Math.sqrt(3)/2," l ").concat(-n/2,",").concat(n*Math.sqrt(3)/2," l ").concat(-n,",0 l ").concat(-n/2,",").concat(-n*Math.sqrt(3)/2," Z M 0,").concat(n*Math.sqrt(3)/2," l ").concat(n/2,",0 M ").concat(3*n,",").concat(n*Math.sqrt(3)/2," l ").concat(-n/2,",0");default:return t(n)}})(l),t=t.append("defs").append("pattern").attr("id",h).attr("patternUnits","userSpaceOnUse").attr("width",a*e).attr("height",a*i);s&&t.append("rect").attr("width",a*e).attr("height",a*i).attr("fill",s),t.append("path").attr("d",n).attr("fill",u).attr("stroke",r).attr("stroke-width",o).attr("stroke-linecap","square").attr("shape-rendering",c)}var e=1,i=1,a=20,r="#343434",o=2,s="",l=function(t){return"M ".concat(t/4,",").concat(3*t/4,"l").concat(t/4,",").concat(-t/2,"l").concat(t/4,",").concat(t/2)},h=Wu(),u="transparent",c="auto";return n.heavier=function(t){return o*=0===arguments.length?2:2*t,n},n.lighter=function(t){return o/=0===arguments.length?2:2*t,n},n.thinner=function(t){return a*=0===arguments.length?2:2*t,n},n.thicker=function(t){return a/=0===arguments.length?2:2*t,n},n.background=function(t){return s=t,n},n.shapeRendering=function(t){return c=t,n},n.size=function(t){return a=t,n},n.d=function(t){return l=t,n},n.fill=function(t){return u=t,n},n.stroke=function(t){return r=t,n},n.strokeWidth=function(t){return o=t,n},n.id=function(t){return 0===arguments.length?h:(h=t,n)},n.url=function(){return"url(#".concat(h,")")},n}};class Yu{
|
|
1186
1186
|
/**
|
|
1187
1187
|
@memberof Image
|
|
@@ -1210,7 +1210,7 @@ u=N*P,O.push(O[0]),c={area:u,cx:L,cy:B,width:N,height:P,angle:-d,points:O},T=N):
|
|
|
1210
1210
|
function(d) {
|
|
1211
1211
|
return d.height;
|
|
1212
1212
|
}
|
|
1213
|
-
*/height(t){return arguments.length?(this._height="function"==typeof t?t:
|
|
1213
|
+
*/height(t){return arguments.length?(this._height="function"==typeof t?t:Bt(t),this):this._height}
|
|
1214
1214
|
/**
|
|
1215
1215
|
@memberof Image
|
|
1216
1216
|
@desc If *value* is specified, sets the id accessor to the specified function and returns the current class instance.
|
|
@@ -1226,13 +1226,13 @@ u=N*P,O.push(O[0]),c={area:u,cx:L,cy:B,width:N,height:P,angle:-d,points:O},T=N):
|
|
|
1226
1226
|
@desc Sets the opacity of the image.
|
|
1227
1227
|
@param {Number} [*value* = 1]
|
|
1228
1228
|
@chainable
|
|
1229
|
-
*/opacity(t){return arguments.length?(this._opacity="function"==typeof t?t:
|
|
1229
|
+
*/opacity(t){return arguments.length?(this._opacity="function"==typeof t?t:Bt(t),this):this._opacity}
|
|
1230
1230
|
/**
|
|
1231
1231
|
@memberof Image
|
|
1232
1232
|
@desc If *value* is specified, sets the pointer-events accessor to the specified function or string and returns the current class instance.
|
|
1233
1233
|
@param {Function|String} [*value* = "auto"]
|
|
1234
1234
|
@chainable
|
|
1235
|
-
*/pointerEvents(t){return arguments.length?(this._pointerEvents="function"==typeof t?t:
|
|
1235
|
+
*/pointerEvents(t){return arguments.length?(this._pointerEvents="function"==typeof t?t:Bt(t),this):this._pointerEvents}
|
|
1236
1236
|
/**
|
|
1237
1237
|
@memberof Image
|
|
1238
1238
|
@desc If *selector* is specified, sets the SVG container element to the specified d3 selector or DOM element and returns the current class instance. If *selector* is not specified, returns the current SVG container element.
|
|
@@ -1258,7 +1258,7 @@ u=N*P,O.push(O[0]),c={area:u,cx:L,cy:B,width:N,height:P,angle:-d,points:O},T=N):
|
|
|
1258
1258
|
function(d) {
|
|
1259
1259
|
return d.width;
|
|
1260
1260
|
}
|
|
1261
|
-
*/width(t){return arguments.length?(this._width="function"==typeof t?t:
|
|
1261
|
+
*/width(t){return arguments.length?(this._width="function"==typeof t?t:Bt(t),this):this._width}
|
|
1262
1262
|
/**
|
|
1263
1263
|
@memberof Image
|
|
1264
1264
|
@desc If *value* is specified, sets the x accessor to the specified function or number and returns the current class instance.
|
|
@@ -1268,7 +1268,7 @@ u=N*P,O.push(O[0]),c={area:u,cx:L,cy:B,width:N,height:P,angle:-d,points:O},T=N):
|
|
|
1268
1268
|
function(d) {
|
|
1269
1269
|
return d.x || 0;
|
|
1270
1270
|
}
|
|
1271
|
-
*/x(t){return arguments.length?(this._x="function"==typeof t?t:
|
|
1271
|
+
*/x(t){return arguments.length?(this._x="function"==typeof t?t:Bt(t),this):this._x}
|
|
1272
1272
|
/**
|
|
1273
1273
|
@memberof Image
|
|
1274
1274
|
@desc If *value* is specified, sets the y accessor to the specified function or number and returns the current class instance.
|
|
@@ -1278,19 +1278,19 @@ u=N*P,O.push(O[0]),c={area:u,cx:L,cy:B,width:N,height:P,angle:-d,points:O},T=N):
|
|
|
1278
1278
|
function(d) {
|
|
1279
1279
|
return d.y || 0;
|
|
1280
1280
|
}
|
|
1281
|
-
*/y(t){return arguments.length?(this._y="function"==typeof t?t:
|
|
1281
|
+
*/y(t){return arguments.length?(this._y="function"==typeof t?t:Bt(t),this):this._y}
|
|
1282
1282
|
/**
|
|
1283
1283
|
@memberof Image
|
|
1284
1284
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
1285
1285
|
@private
|
|
1286
|
-
*/constructor(){this._duration=600,this._height=p("height"),this._id=p("id"),this._opacity=
|
|
1286
|
+
*/constructor(){this._duration=600,this._height=p("height"),this._id=p("id"),this._opacity=Bt(1),this._pointerEvents=Bt("auto"),this._select,this._url=p("url"),this._width=p("width"),this._x=p("x",0),this._y=p("y",0)}}
|
|
1287
1287
|
/**
|
|
1288
1288
|
* @param {*} nodeList
|
|
1289
1289
|
* @param {*} classNames
|
|
1290
1290
|
* @private
|
|
1291
1291
|
*/function Zu(n,e){for(let t=0;t<e.length;t++){var i=e[t];for(let t=n.length-1;0<=t;t--)if(n[t].classList.contains(i))return t;// Return the index if found
|
|
1292
|
-
}return
|
|
1293
|
-
}class Xu extends
|
|
1292
|
+
}return-1;// Return -1 if no element is found with the class
|
|
1293
|
+
}class Xu extends Li{
|
|
1294
1294
|
/**
|
|
1295
1295
|
@memberof Shape
|
|
1296
1296
|
@desc Given a specific data point and index, returns the aesthetic properties of the shape.
|
|
@@ -1367,7 +1367,7 @@ this._group.selectAll(`g.d3plus-${this._name}-shape, g.d3plus-${this._name}-imag
|
|
|
1367
1367
|
@memberof Shape
|
|
1368
1368
|
@desc Modifies existing shapes to show hover status.
|
|
1369
1369
|
@private
|
|
1370
|
-
*/_renderHover(){let o=this;this._group.selectAll(`g.d3plus-${this._name}-shape, g.d3plus-${this._name}-image, g.d3plus-${this._name}-text, g.d3plus-${this._name}-hover`).selectAll(".d3plus-Shape, .d3plus-Image, .d3plus-textBox").each(function(t,n){(t=t||{}).parentNode||(t.parentNode=this.parentNode)
|
|
1370
|
+
*/_renderHover(){let o=this;this._group.selectAll(`g.d3plus-${this._name}-shape, g.d3plus-${this._name}-image, g.d3plus-${this._name}-text, g.d3plus-${this._name}-hover`).selectAll(".d3plus-Shape, .d3plus-Image, .d3plus-textBox").each(function(t,n){(t=t||{}).parentNode||(t.parentNode=this.parentNode);var e=t.parentNode,i=H(this).classed("d3plus-textBox")?"textBox":H(this).classed("d3plus-Image")?"Image":"Shape";if((t="textBox"==i?t.data:t).__d3plusShape__||t.__d3plus__)for(;t&&(t.__d3plusShape__||t.__d3plus__);)n=t.i,t=t.data;else n=o._data.indexOf(t);var a=!o._hover||"function"!=typeof o._hover||!o._hover(t,n),r=a?e:o._hoverGroup.node();r!==this.parentNode&&(i="textBox"==i?Zu(r.childNodes,["d3plus-Image","d3plus-Shape"]):"Image"==i?Zu(r.childNodes,["d3plus-Shape"]):-1,a?r.appendChild(this):-1===i?r.prepend(this):r.childNodes[i].after(this)),this.className.baseVal.includes("d3plus-Shape")&&(e===r?H(this).call(o._applyStyle.bind(o)):H(this).call(o._updateStyle.bind(o,H(this),o._hoverStyle)))}),
|
|
1371
1371
|
// this._renderImage();
|
|
1372
1372
|
// this._renderLabels();
|
|
1373
1373
|
this._group.selectAll(`g.d3plus-${this._name}-shape, g.d3plus-${this._name}-image, g.d3plus-${this._name}-text`).attr("opacity",this._hover?this._hoverOpacity:this._active?this._activeOpacity:1)}
|
|
@@ -1380,7 +1380,7 @@ this._group.selectAll(`g.d3plus-${this._name}-shape, g.d3plus-${this._name}-imag
|
|
|
1380
1380
|
@memberof Shape
|
|
1381
1381
|
@desc Adds labels to each shape group.
|
|
1382
1382
|
@private
|
|
1383
|
-
*/_renderLabels(){let u=[];this._update.merge(this._enter).data().forEach((t,n)=>{let e=t,i=(t.nested&&t.key&&t.values&&(e=t.values[0],n=this._data.indexOf(e)),this._label(e,n));if(this._labelBounds&&!1!==i&&null!=i){var a=this._labelBounds.bind(this)(e,n,this._aes(t,n));if(a){i.constructor!==Array&&(i=[i]);var r=e.__d3plusShape__?e.translate?e.translate[0]:this._x(e.data,e.i):this._x(e,n),o=e.__d3plusShape__?e.translate?e.translate[1]:this._y(e.data,e.i):this._y(e,n);e.__d3plusShape__&&(n=(e=e.data).i);for(let t=0;t<i.length;t++){var s=a.constructor===Array?a[t]:Object.assign({},a),l=this._rotate(e,n),h=e.labelConfig&&e.labelConfig.rotate?e.labelConfig.rotate:void 0!==a.angle?a.angle:0,l=(h+=l,0!==l?[-1*s.x||0,-1*s.y||0]:[s.width/2,s.height/2]);u.push({__d3plus__:!0,data:e,height:s.height,l:t,id:this._id(e,n)+"_"+t,r:h,rotateAnchor:l,text:i[t],width:s.width,x:r+s.x,y:o+s.y})}}}}),this._labelClass.data(u).duration(this._duration).fontOpacity(this._nestWrapper(this._opacity)).pointerEvents("none").rotate(t=>(t.__d3plus__?t:t.data).r).rotateAnchor(t=>(t.__d3plus__?t:t.data).rotateAnchor).select(Pt(`g.d3plus-${this._name}-text`,{parent:this._group,update:{opacity:this._active?this._activeOpacity:1}}).node()).config(
|
|
1383
|
+
*/_renderLabels(){let u=[];this._update.merge(this._enter).data().forEach((t,n)=>{let e=t,i=(t.nested&&t.key&&t.values&&(e=t.values[0],n=this._data.indexOf(e)),this._label(e,n));if(this._labelBounds&&!1!==i&&null!=i){var a=this._labelBounds.bind(this)(e,n,this._aes(t,n));if(a){i.constructor!==Array&&(i=[i]);var r=e.__d3plusShape__?e.translate?e.translate[0]:this._x(e.data,e.i):this._x(e,n),o=e.__d3plusShape__?e.translate?e.translate[1]:this._y(e.data,e.i):this._y(e,n);e.__d3plusShape__&&(n=(e=e.data).i);for(let t=0;t<i.length;t++){var s=a.constructor===Array?a[t]:Object.assign({},a),l=this._rotate(e,n),h=e.labelConfig&&e.labelConfig.rotate?e.labelConfig.rotate:void 0!==a.angle?a.angle:0,l=(h+=l,0!==l?[-1*s.x||0,-1*s.y||0]:[s.width/2,s.height/2]);u.push({__d3plus__:!0,data:e,height:s.height,l:t,id:this._id(e,n)+"_"+t,r:h,rotateAnchor:l,text:i[t],width:s.width,x:r+s.x,y:o+s.y})}}}}),this._labelClass.data(u).duration(this._duration).fontOpacity(this._nestWrapper(this._opacity)).pointerEvents("none").rotate(t=>(t.__d3plus__?t:t.data).r).rotateAnchor(t=>(t.__d3plus__?t:t.data).rotateAnchor).select(Pt(`g.d3plus-${this._name}-text`,{parent:this._group,update:{opacity:this._active?this._activeOpacity:1}}).node()).config(Lt.bind(this)(this._labelConfig)).render()}
|
|
1384
1384
|
/**
|
|
1385
1385
|
@memberof Shape
|
|
1386
1386
|
@desc Renders the current Shape to the page. If a *callback* is specified, it will be called once the shapes are done drawing.
|
|
@@ -1419,13 +1419,13 @@ this._renderActive(),this):this._active}
|
|
|
1419
1419
|
@desc If *value* is specified, sets the aria-label attribute to the specified function or string and returns the current class instance.
|
|
1420
1420
|
@param {Function|String} *value*
|
|
1421
1421
|
@chainable
|
|
1422
|
-
*/ariaLabel(t){return void 0!==t?(this._ariaLabel="function"==typeof t?t:
|
|
1422
|
+
*/ariaLabel(t){return void 0!==t?(this._ariaLabel="function"==typeof t?t:Bt(t),this):this._ariaLabel}
|
|
1423
1423
|
/**
|
|
1424
1424
|
@memberof Shape
|
|
1425
1425
|
@desc If *value* is specified, sets the background-image accessor to the specified function or string and returns the current class instance.
|
|
1426
1426
|
@param {Function|String} [*value* = false]
|
|
1427
1427
|
@chainable
|
|
1428
|
-
*/backgroundImage(t){return arguments.length?(this._backgroundImage="function"==typeof t?t:
|
|
1428
|
+
*/backgroundImage(t){return arguments.length?(this._backgroundImage="function"==typeof t?t:Bt(t),this):this._backgroundImage}
|
|
1429
1429
|
/**
|
|
1430
1430
|
@memberof Shape
|
|
1431
1431
|
@desc If *data* is specified, sets the data array to the specified array and returns the current class instance. If *data* is not specified, returns the current data array. A shape will be drawn for each object in the array.
|
|
@@ -1449,13 +1449,13 @@ this._renderActive(),this):this._active}
|
|
|
1449
1449
|
@desc If *value* is specified, sets the fill accessor to the specified function or string and returns the current class instance.
|
|
1450
1450
|
@param {Function|String} [*value* = "black"]
|
|
1451
1451
|
@chainable
|
|
1452
|
-
*/fill(t){return arguments.length?(this._fill="function"==typeof t?t:
|
|
1452
|
+
*/fill(t){return arguments.length?(this._fill="function"==typeof t?t:Bt(t),this):this._fill}
|
|
1453
1453
|
/**
|
|
1454
1454
|
@memberof Shape
|
|
1455
1455
|
@desc Defines the "fill-opacity" attribute for the shapes.
|
|
1456
1456
|
@param {Function|Number} [*value* = 1]
|
|
1457
1457
|
@chainable
|
|
1458
|
-
*/fillOpacity(t){return arguments.length?(this._fillOpacity="function"==typeof t?t:
|
|
1458
|
+
*/fillOpacity(t){return arguments.length?(this._fillOpacity="function"==typeof t?t:Bt(t),this):this._fillOpacity}
|
|
1459
1459
|
/**
|
|
1460
1460
|
@memberof Shape
|
|
1461
1461
|
@desc If *value* is specified, sets the highlight accessor to the specified function and returns the current class instance.
|
|
@@ -1491,7 +1491,7 @@ this._renderHover(),this):this._hover}
|
|
|
1491
1491
|
"y": -shape.height / 2
|
|
1492
1492
|
};
|
|
1493
1493
|
}
|
|
1494
|
-
*/hitArea(t){return arguments.length?(this._hitArea="function"==typeof t?t:
|
|
1494
|
+
*/hitArea(t){return arguments.length?(this._hitArea="function"==typeof t?t:Bt(t),this):this._hitArea}
|
|
1495
1495
|
/**
|
|
1496
1496
|
@memberof Shape
|
|
1497
1497
|
@desc If *value* is specified, sets the id accessor to the specified function and returns the current class instance.
|
|
@@ -1503,7 +1503,7 @@ this._renderHover(),this):this._hover}
|
|
|
1503
1503
|
@desc If *value* is specified, sets the label accessor to the specified function or string and returns the current class instance.
|
|
1504
1504
|
@param {Function|String|Array} [*value*]
|
|
1505
1505
|
@chainable
|
|
1506
|
-
*/label(t){return arguments.length?(this._label="function"==typeof t?t:
|
|
1506
|
+
*/label(t){return arguments.length?(this._label="function"==typeof t?t:Bt(t),this):this._label}
|
|
1507
1507
|
/**
|
|
1508
1508
|
@memberof Shape
|
|
1509
1509
|
@desc If *bounds* is specified, sets the label bounds to the specified function and returns the current class instance. If *bounds* is not specified, returns the current inner bounds accessor.
|
|
@@ -1518,7 +1518,7 @@ this._renderHover(),this):this._hover}
|
|
|
1518
1518
|
"y": -shape.height / 2
|
|
1519
1519
|
};
|
|
1520
1520
|
}
|
|
1521
|
-
*/labelBounds(t){return arguments.length?(this._labelBounds="function"==typeof t?t:
|
|
1521
|
+
*/labelBounds(t){return arguments.length?(this._labelBounds="function"==typeof t?t:Bt(t),this):this._labelBounds}
|
|
1522
1522
|
/**
|
|
1523
1523
|
@memberof Shape
|
|
1524
1524
|
@desc A pass-through to the config method of the TextBox class used to create a shape's labels.
|
|
@@ -1530,43 +1530,43 @@ this._renderHover(),this):this._hover}
|
|
|
1530
1530
|
@desc If *value* is specified, sets the opacity accessor to the specified function or number and returns the current class instance.
|
|
1531
1531
|
@param {Number} [*value* = 1]
|
|
1532
1532
|
@chainable
|
|
1533
|
-
*/opacity(t){return arguments.length?(this._opacity="function"==typeof t?t:
|
|
1533
|
+
*/opacity(t){return arguments.length?(this._opacity="function"==typeof t?t:Bt(t),this):this._opacity}
|
|
1534
1534
|
/**
|
|
1535
1535
|
@memberof Shape
|
|
1536
1536
|
@desc If *value* is specified, sets the pointerEvents accessor to the specified function or string and returns the current class instance.
|
|
1537
1537
|
@param {String} [*value*]
|
|
1538
1538
|
@chainable
|
|
1539
|
-
*/pointerEvents(t){return arguments.length?(this._pointerEvents="function"==typeof t?t:
|
|
1539
|
+
*/pointerEvents(t){return arguments.length?(this._pointerEvents="function"==typeof t?t:Bt(t),this):this._pointerEvents}
|
|
1540
1540
|
/**
|
|
1541
1541
|
@memberof Shape
|
|
1542
1542
|
@desc If *value* is specified, sets the role attribute to the specified function or string and returns the current class instance.
|
|
1543
1543
|
@param {Function|String} *value*
|
|
1544
1544
|
@chainable
|
|
1545
|
-
*/role(t){return void 0!==t?(this._role="function"==typeof t?t:
|
|
1545
|
+
*/role(t){return void 0!==t?(this._role="function"==typeof t?t:Bt(t),this):this._role}
|
|
1546
1546
|
/**
|
|
1547
1547
|
@memberof Shape
|
|
1548
1548
|
@desc If *value* is specified, sets the rotate accessor to the specified function or number and returns the current class instance.
|
|
1549
1549
|
@param {Function|Number} [*value* = 0]
|
|
1550
1550
|
@chainable
|
|
1551
|
-
*/rotate(t){return arguments.length?(this._rotate="function"==typeof t?t:
|
|
1551
|
+
*/rotate(t){return arguments.length?(this._rotate="function"==typeof t?t:Bt(t),this):this._rotate}
|
|
1552
1552
|
/**
|
|
1553
1553
|
@memberof Shape
|
|
1554
1554
|
@desc Defines the "rx" attribute for the shapes.
|
|
1555
1555
|
@param {Function|Number} [*value* = 0]
|
|
1556
1556
|
@chainable
|
|
1557
|
-
*/rx(t){return arguments.length?(this._rx="function"==typeof t?t:
|
|
1557
|
+
*/rx(t){return arguments.length?(this._rx="function"==typeof t?t:Bt(t),this):this._rx}
|
|
1558
1558
|
/**
|
|
1559
1559
|
@memberof Shape
|
|
1560
1560
|
@desc Defines the "rx" attribute for the shapes.
|
|
1561
1561
|
@param {Function|Number} [*value* = 0]
|
|
1562
1562
|
@chainable
|
|
1563
|
-
*/ry(t){return arguments.length?(this._ry="function"==typeof t?t:
|
|
1563
|
+
*/ry(t){return arguments.length?(this._ry="function"==typeof t?t:Bt(t),this):this._ry}
|
|
1564
1564
|
/**
|
|
1565
1565
|
@memberof Shape
|
|
1566
1566
|
@desc If *value* is specified, sets the scale accessor to the specified function or string and returns the current class instance.
|
|
1567
1567
|
@param {Function|Number} [*value* = 1]
|
|
1568
1568
|
@chainable
|
|
1569
|
-
*/scale(t){return arguments.length?(this._scale="function"==typeof t?t:
|
|
1569
|
+
*/scale(t){return arguments.length?(this._scale="function"==typeof t?t:Bt(t),this):this._scale}
|
|
1570
1570
|
/**
|
|
1571
1571
|
@memberof Shape
|
|
1572
1572
|
@desc If *selector* is specified, sets the SVG container element to the specified d3 selector or DOM element and returns the current class instance. If *selector* is not specified, returns the current SVG container element.
|
|
@@ -1582,7 +1582,7 @@ this._renderHover(),this):this._hover}
|
|
|
1582
1582
|
function(d) {
|
|
1583
1583
|
return d.x;
|
|
1584
1584
|
}
|
|
1585
|
-
*/shapeRendering(t){return arguments.length?(this._shapeRendering="function"==typeof t?t:
|
|
1585
|
+
*/shapeRendering(t){return arguments.length?(this._shapeRendering="function"==typeof t?t:Bt(t),this):this._shapeRendering}
|
|
1586
1586
|
/**
|
|
1587
1587
|
@memberof Shape
|
|
1588
1588
|
@desc If *value* is specified, sets the sort comparator to the specified function and returns the current class instance.
|
|
@@ -1594,43 +1594,43 @@ this._renderHover(),this):this._hover}
|
|
|
1594
1594
|
@desc If *value* is specified, sets the stroke accessor to the specified function or string and returns the current class instance.
|
|
1595
1595
|
@param {Function|String} [*value* = "black"]
|
|
1596
1596
|
@chainable
|
|
1597
|
-
*/stroke(t){return arguments.length?(this._stroke="function"==typeof t?t:
|
|
1597
|
+
*/stroke(t){return arguments.length?(this._stroke="function"==typeof t?t:Bt(t),this):this._stroke}
|
|
1598
1598
|
/**
|
|
1599
1599
|
@memberof Shape
|
|
1600
1600
|
@desc Defines the "stroke-dasharray" attribute for the shapes.
|
|
1601
1601
|
@param {Function|String} [*value* = "1"]
|
|
1602
1602
|
@chainable
|
|
1603
|
-
*/strokeDasharray(t){return arguments.length?(this._strokeDasharray="function"==typeof t?t:
|
|
1603
|
+
*/strokeDasharray(t){return arguments.length?(this._strokeDasharray="function"==typeof t?t:Bt(t),this):this._strokeDasharray}
|
|
1604
1604
|
/**
|
|
1605
1605
|
@memberof Shape
|
|
1606
1606
|
@desc Defines the "stroke-linecap" attribute for the shapes. Accepted values are `"butt"`, `"round"`, and `"square"`.
|
|
1607
1607
|
@param {Function|String} [*value* = "butt"]
|
|
1608
1608
|
@chainable
|
|
1609
|
-
*/strokeLinecap(t){return arguments.length?(this._strokeLinecap="function"==typeof t?t:
|
|
1609
|
+
*/strokeLinecap(t){return arguments.length?(this._strokeLinecap="function"==typeof t?t:Bt(t),this):this._strokeLinecap}
|
|
1610
1610
|
/**
|
|
1611
1611
|
@memberof Shape
|
|
1612
1612
|
@desc Defines the "stroke-opacity" attribute for the shapes.
|
|
1613
1613
|
@param {Function|Number} [*value* = 1]
|
|
1614
1614
|
@chainable
|
|
1615
|
-
*/strokeOpacity(t){return arguments.length?(this._strokeOpacity="function"==typeof t?t:
|
|
1615
|
+
*/strokeOpacity(t){return arguments.length?(this._strokeOpacity="function"==typeof t?t:Bt(t),this):this._strokeOpacity}
|
|
1616
1616
|
/**
|
|
1617
1617
|
@memberof Shape
|
|
1618
1618
|
@desc If *value* is specified, sets the stroke-width accessor to the specified function or string and returns the current class instance.
|
|
1619
1619
|
@param {Function|Number} [*value* = 0]
|
|
1620
1620
|
@chainable
|
|
1621
|
-
*/strokeWidth(t){return arguments.length?(this._strokeWidth="function"==typeof t?t:
|
|
1621
|
+
*/strokeWidth(t){return arguments.length?(this._strokeWidth="function"==typeof t?t:Bt(t),this):this._strokeWidth}
|
|
1622
1622
|
/**
|
|
1623
1623
|
@memberof Shape
|
|
1624
1624
|
@desc If *value* is specified, sets the text-anchor accessor to the specified function or string and returns the current class instance.
|
|
1625
1625
|
@param {Function|String|Array} [*value* = "start"]
|
|
1626
1626
|
@chainable
|
|
1627
|
-
*/textAnchor(t){return arguments.length?(this._textAnchor="function"==typeof t?t:
|
|
1627
|
+
*/textAnchor(t){return arguments.length?(this._textAnchor="function"==typeof t?t:Bt(t),this):this._textAnchor}
|
|
1628
1628
|
/**
|
|
1629
1629
|
@memberof Shape
|
|
1630
1630
|
@desc Defines the texture used inside of each shape. This uses the [textures.js](https://riccardoscalco.it/textures/) package, and expects either a simple string (`"lines"` or `"circles"`) or a more complex Object containing the various properties of the texture (ie. `{texture: "lines", orientation: "3/8", stroke: "darkorange"}`). If multiple textures are necessary, provide an accsesor Function that returns the correct String/Object for each given data point and index.
|
|
1631
1631
|
@param {String|Object|Function} [*value*]
|
|
1632
1632
|
@chainable
|
|
1633
|
-
*/texture(t){return arguments.length?(this._texture="function"==typeof t?t:
|
|
1633
|
+
*/texture(t){return arguments.length?(this._texture="function"==typeof t?t:Bt(t),this):this._texture}
|
|
1634
1634
|
/**
|
|
1635
1635
|
@memberof Shape
|
|
1636
1636
|
@desc A series of global texture methods to be used for all textures (ie. `{stroke: "darkorange", strokeWidth: 2}`).
|
|
@@ -1642,13 +1642,13 @@ this._renderHover(),this):this._hover}
|
|
|
1642
1642
|
@desc If *value* is specified, sets the vector-effect accessor to the specified function or string and returns the current class instance.
|
|
1643
1643
|
@param {Function|String} [*value* = "non-scaling-stroke"]
|
|
1644
1644
|
@chainable
|
|
1645
|
-
*/vectorEffect(t){return arguments.length?(this._vectorEffect="function"==typeof t?t:
|
|
1645
|
+
*/vectorEffect(t){return arguments.length?(this._vectorEffect="function"==typeof t?t:Bt(t),this):this._vectorEffect}
|
|
1646
1646
|
/**
|
|
1647
1647
|
@memberof Shape
|
|
1648
1648
|
@desc If *value* is specified, sets the vertical alignment accessor to the specified function or string and returns the current class instance.
|
|
1649
1649
|
@param {Function|String|Array} [*value* = "start"]
|
|
1650
1650
|
@chainable
|
|
1651
|
-
*/verticalAlign(t){return arguments.length?(this._verticalAlign="function"==typeof t?t:
|
|
1651
|
+
*/verticalAlign(t){return arguments.length?(this._verticalAlign="function"==typeof t?t:Bt(t),this):this._verticalAlign}
|
|
1652
1652
|
/**
|
|
1653
1653
|
@memberof Shape
|
|
1654
1654
|
@desc If *value* is specified, sets the x accessor to the specified function or number and returns the current class instance.
|
|
@@ -1658,7 +1658,7 @@ this._renderHover(),this):this._hover}
|
|
|
1658
1658
|
function(d) {
|
|
1659
1659
|
return d.x;
|
|
1660
1660
|
}
|
|
1661
|
-
*/x(t){return arguments.length?(this._x="function"==typeof t?t:
|
|
1661
|
+
*/x(t){return arguments.length?(this._x="function"==typeof t?t:Bt(t),this):this._x}
|
|
1662
1662
|
/**
|
|
1663
1663
|
@memberof Shape
|
|
1664
1664
|
@desc If *value* is specified, sets the y accessor to the specified function or number and returns the current class instance.
|
|
@@ -1668,12 +1668,12 @@ this._renderHover(),this):this._hover}
|
|
|
1668
1668
|
function(d) {
|
|
1669
1669
|
return d.y;
|
|
1670
1670
|
}
|
|
1671
|
-
*/y(t){return arguments.length?(this._y="function"==typeof t?t:
|
|
1671
|
+
*/y(t){return arguments.length?(this._y="function"==typeof t?t:Bt(t),this):this._y}
|
|
1672
1672
|
/**
|
|
1673
1673
|
@memberof Shape
|
|
1674
1674
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
1675
1675
|
@private
|
|
1676
|
-
*/constructor(t="g"){super(),this._activeOpacity=.25,this._activeStyle={stroke:(t,n)=>{let e=this._fill(t,n);return zn(e=["transparent","none"].includes(e)?this._stroke(t,n):e).darker(1)},"stroke-width":(t,n)=>3*(this._strokeWidth(t,n)||1)},this._ariaLabel=
|
|
1676
|
+
*/constructor(t="g"){super(),this._activeOpacity=.25,this._activeStyle={stroke:(t,n)=>{let e=this._fill(t,n);return zn(e=["transparent","none"].includes(e)?this._stroke(t,n):e).darker(1)},"stroke-width":(t,n)=>3*(this._strokeWidth(t,n)||1)},this._ariaLabel=Bt(""),this._backgroundImage=Bt(!1),this._backgroundImageClass=new Yu,this._data=[],this._duration=600,this._fill=Bt("black"),this._fillOpacity=Bt(1),this._hoverOpacity=.5,this._hoverStyle={stroke:(t,n)=>{let e=this._fill(t,n);return zn(e=["transparent","none"].includes(e)?this._stroke(t,n):e).darker(.5)},"stroke-width":(t,n)=>2*(this._strokeWidth(t,n)||1)},this._id=(t,n)=>void 0!==t.id?t.id:n,this._label=Bt(!1),this._labelClass=new Ic,this._labelConfig={fontColor:(t,n)=>Hh(this._fill(t,n)),fontSize:12,padding:5},this._name="Shape",this._opacity=Bt(1),this._pointerEvents=Bt("visiblePainted"),this._role=Bt("presentation"),this._rotate=Bt(0),this._rx=Bt(0),this._ry=Bt(0),this._scale=Bt(1),this._shapeRendering=Bt("geometricPrecision"),this._stroke=(t,n)=>zn(this._fill(t,n)).darker(1).formatHex(),this._strokeDasharray=Bt("0"),this._strokeLinecap=Bt("butt"),this._strokeOpacity=Bt(1),this._strokeWidth=Bt(0),this._tagName=t,this._textAnchor=Bt("start"),this._texture=Bt(!1),this._textureDefault={},this._textureDefs={},this._vectorEffect=Bt("non-scaling-stroke"),this._verticalAlign=Bt("top"),this._x=p("x",0),this._y=p("y",0)}}function Ju(n,t){var e,i=Object.keys(n);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(n),t&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})),i.push.apply(i,e)),i}function Qu(i){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?Ju(Object(a),!0).forEach(function(t){var n,e;n=i,e=a[t=t],t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):Ju(Object(a)).forEach(function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(a,t))})}return i}function tc(t){return(tc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nc(){return(nc=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e,i=arguments[n];for(e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])}return t}).apply(this,arguments)}function ec(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function ic(t,n){var e,i,a,r,o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(o)return i=!(e=!0),{s:function(){o=o.call(t)},n:function(){var t=o.next();return e=t.done,t},e:function(t){i=!0,a=t},f:function(){try{e||null==o.return||o.return()}finally{if(i)throw a}}};if(Array.isArray(t)||(o=((t,n)=>{var e;if(t)return"string"==typeof t?ec(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?ec(t,n):void 0})(t))||n)return o&&(t=o),r=0,{s:n=function(){},n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}
|
|
1677
1677
|
/**
|
|
1678
1678
|
* de Casteljau's algorithm for drawing and splitting bezier curves.
|
|
1679
1679
|
* Inspired by https://pomax.github.io/bezierinfo/
|
|
@@ -1903,7 +1903,7 @@ Object.keys(lc).forEach(function(t){lc[t.toLowerCase()]=lc[t]});class fc extends
|
|
|
1903
1903
|
@desc If *value* is specified, sets the area curve to the specified string and returns the current class instance. If *value* is not specified, returns the current area curve.
|
|
1904
1904
|
@param {Function|String} [*value* = "linear"]
|
|
1905
1905
|
@chainable
|
|
1906
|
-
*/curve(t){return arguments.length?(this._curve="function"==typeof t?t:
|
|
1906
|
+
*/curve(t){return arguments.length?(this._curve="function"==typeof t?t:Bt(t),this):this._curve}
|
|
1907
1907
|
/**
|
|
1908
1908
|
@memberof Area
|
|
1909
1909
|
@desc If *value* is specified, sets the defined accessor to the specified function and returns the current class instance. If *value* is not specified, returns the current defined accessor.
|
|
@@ -1915,42 +1915,42 @@ Object.keys(lc).forEach(function(t){lc[t.toLowerCase()]=lc[t]});class fc extends
|
|
|
1915
1915
|
@desc If *value* is specified, sets the x accessor to the specified function or number and returns the current class instance. If *value* is not specified, returns the current x accessor.
|
|
1916
1916
|
@param {Function|Number} [*value*]
|
|
1917
1917
|
@chainable
|
|
1918
|
-
*/x(t){return arguments.length?(this._x="function"==typeof t?t:
|
|
1918
|
+
*/x(t){return arguments.length?(this._x="function"==typeof t?t:Bt(t),this._x0=this._x,this):this._x}
|
|
1919
1919
|
/**
|
|
1920
1920
|
@memberof Area
|
|
1921
1921
|
@desc If *value* is specified, sets the x0 accessor to the specified function or number and returns the current class instance. If *value* is not specified, returns the current x0 accessor.
|
|
1922
1922
|
@param {Function|Number} [*value*]
|
|
1923
1923
|
@chainable
|
|
1924
|
-
*/x0(t){return arguments.length?(this._x0="function"==typeof t?t:
|
|
1924
|
+
*/x0(t){return arguments.length?(this._x0="function"==typeof t?t:Bt(t),this._x=this._x0,this):this._x0}
|
|
1925
1925
|
/**
|
|
1926
1926
|
@memberof Area
|
|
1927
1927
|
@desc If *value* is specified, sets the x1 accessor to the specified function or number and returns the current class instance. If *value* is not specified, returns the current x1 accessor.
|
|
1928
1928
|
@param {Function|Number|null} [*value*]
|
|
1929
1929
|
@chainable
|
|
1930
|
-
*/x1(t){return arguments.length?(this._x1="function"==typeof t||null===t?t:
|
|
1930
|
+
*/x1(t){return arguments.length?(this._x1="function"==typeof t||null===t?t:Bt(t),this):this._x1}
|
|
1931
1931
|
/**
|
|
1932
1932
|
@memberof Area
|
|
1933
1933
|
@desc If *value* is specified, sets the y accessor to the specified function or number and returns the current class instance. If *value* is not specified, returns the current y accessor.
|
|
1934
1934
|
@param {Function|Number} [*value*]
|
|
1935
1935
|
@chainable
|
|
1936
|
-
*/y(t){return arguments.length?(this._y="function"==typeof t?t:
|
|
1936
|
+
*/y(t){return arguments.length?(this._y="function"==typeof t?t:Bt(t),this._y0=this._y,this):this._y}
|
|
1937
1937
|
/**
|
|
1938
1938
|
@memberof Area
|
|
1939
1939
|
@desc If *value* is specified, sets the y0 accessor to the specified function or number and returns the current class instance. If *value* is not specified, returns the current y0 accessor.
|
|
1940
1940
|
@param {Function|Number} [*value*]
|
|
1941
1941
|
@chainable
|
|
1942
|
-
*/y0(t){return arguments.length?(this._y0="function"==typeof t?t:
|
|
1942
|
+
*/y0(t){return arguments.length?(this._y0="function"==typeof t?t:Bt(t),this._y=this._y0,this):this._y0}
|
|
1943
1943
|
/**
|
|
1944
1944
|
@memberof Area
|
|
1945
1945
|
@desc If *value* is specified, sets the y1 accessor to the specified function or number and returns the current class instance. If *value* is not specified, returns the current y1 accessor.
|
|
1946
1946
|
@param {Function|Number|null} [*value*]
|
|
1947
1947
|
@chainable
|
|
1948
|
-
*/y1(t){return arguments.length?(this._y1="function"==typeof t||null===t?t:
|
|
1948
|
+
*/y1(t){return arguments.length?(this._y1="function"==typeof t||null===t?t:Bt(t),this):this._y1}
|
|
1949
1949
|
/**
|
|
1950
1950
|
@memberof Area
|
|
1951
1951
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from Shape.
|
|
1952
1952
|
@private
|
|
1953
|
-
*/constructor(){super(),this._curve=
|
|
1953
|
+
*/constructor(){super(),this._curve=Bt("linear"),this._defined=()=>!0,this._labelBounds=(t,n,e)=>{e=ju(e.points);return e?{angle:e.angle,width:e.width,height:e.height,x:e.cx-e.width/2-this._x(t,n),y:e.cy-e.height/2-this._y(t,n)}:null},this._labelConfig=Object.assign(this._labelConfig,{textAnchor:"middle",verticalAlign:"middle"}),this._name="Area",this._x=p("x"),this._x0=p("x"),this._x1=null,this._y=Bt(0),this._y0=Bt(0),this._y1=p("y")}}class pc extends Xu{
|
|
1954
1954
|
/**
|
|
1955
1955
|
@memberof Bar
|
|
1956
1956
|
@desc Draws the bars.
|
|
@@ -2007,7 +2007,7 @@ Object.keys(lc).forEach(function(t){lc[t.toLowerCase()]=lc[t]});class fc extends
|
|
|
2007
2007
|
function(d) {
|
|
2008
2008
|
return d.height;
|
|
2009
2009
|
}
|
|
2010
|
-
*/height(t){return arguments.length?(this._height="function"==typeof t?t:
|
|
2010
|
+
*/height(t){return arguments.length?(this._height="function"==typeof t?t:Bt(t),this):this._height}
|
|
2011
2011
|
/**
|
|
2012
2012
|
@memberof Bar
|
|
2013
2013
|
@desc If *value* is specified, sets the width accessor to the specified function or number and returns the current class instance.
|
|
@@ -2017,36 +2017,36 @@ Object.keys(lc).forEach(function(t){lc[t.toLowerCase()]=lc[t]});class fc extends
|
|
|
2017
2017
|
function(d) {
|
|
2018
2018
|
return d.width;
|
|
2019
2019
|
}
|
|
2020
|
-
*/width(t){return arguments.length?(this._width="function"==typeof t?t:
|
|
2020
|
+
*/width(t){return arguments.length?(this._width="function"==typeof t?t:Bt(t),this):this._width}
|
|
2021
2021
|
/**
|
|
2022
2022
|
@memberof Bar
|
|
2023
2023
|
@desc If *value* is specified, sets the x0 accessor to the specified function or number and returns the current class instance.
|
|
2024
2024
|
@param {Function|Number} [*value*]
|
|
2025
2025
|
@chainable
|
|
2026
|
-
*/x0(t){return arguments.length?(this._x0="function"==typeof t?t:
|
|
2026
|
+
*/x0(t){return arguments.length?(this._x0="function"==typeof t?t:Bt(t),this._x=this._x0,this):this._x0}
|
|
2027
2027
|
/**
|
|
2028
2028
|
@memberof Bar
|
|
2029
2029
|
@desc If *value* is specified, sets the x1 accessor to the specified function or number and returns the current class instance.
|
|
2030
2030
|
@param {Function|Number|null} [*value*]
|
|
2031
2031
|
@chainable
|
|
2032
|
-
*/x1(t){return arguments.length?(this._x1="function"==typeof t||null===t?t:
|
|
2032
|
+
*/x1(t){return arguments.length?(this._x1="function"==typeof t||null===t?t:Bt(t),this):this._x1}
|
|
2033
2033
|
/**
|
|
2034
2034
|
@memberof Bar
|
|
2035
2035
|
@desc If *value* is specified, sets the y0 accessor to the specified function or number and returns the current class instance.
|
|
2036
2036
|
@param {Function|Number} [*value*]
|
|
2037
2037
|
@chainable
|
|
2038
|
-
*/y0(t){return arguments.length?(this._y0="function"==typeof t?t:
|
|
2038
|
+
*/y0(t){return arguments.length?(this._y0="function"==typeof t?t:Bt(t),this._y=this._y0,this):this._y0}
|
|
2039
2039
|
/**
|
|
2040
2040
|
@memberof Bar
|
|
2041
2041
|
@desc If *value* is specified, sets the y1 accessor to the specified function or number and returns the current class instance.
|
|
2042
2042
|
@param {Function|Number|null} [*value*]
|
|
2043
2043
|
@chainable
|
|
2044
|
-
*/y1(t){return arguments.length?(this._y1="function"==typeof t||null===t?t:
|
|
2044
|
+
*/y1(t){return arguments.length?(this._y1="function"==typeof t||null===t?t:Bt(t),this):this._y1}
|
|
2045
2045
|
/**
|
|
2046
2046
|
@memberof Bar
|
|
2047
2047
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from Shape.
|
|
2048
2048
|
@private
|
|
2049
|
-
*/constructor(){super("rect"),this._name="Bar",this._height=
|
|
2049
|
+
*/constructor(){super("rect"),this._name="Bar",this._height=Bt(10),this._labelBounds=(t,n,e)=>({width:e.width,height:e.height,x:null!==this._x1?this._getX(t,n):-e.width/2,y:null===this._x1?this._getY(t,n):-e.height/2}),this._width=Bt(10),this._x=p("x"),this._x0=p("x"),this._x1=null,this._y=Bt(0),this._y0=Bt(0),this._y1=p("y")}}class _c extends Xu{
|
|
2050
2050
|
/**
|
|
2051
2051
|
@memberof Circle
|
|
2052
2052
|
@desc Provides the default positioning to the <rect> elements.
|
|
@@ -2074,7 +2074,7 @@ Object.keys(lc).forEach(function(t){lc[t.toLowerCase()]=lc[t]});class fc extends
|
|
|
2074
2074
|
function(d) {
|
|
2075
2075
|
return d.r;
|
|
2076
2076
|
}
|
|
2077
|
-
*/r(t){return arguments.length?(this._r="function"==typeof t?t:
|
|
2077
|
+
*/r(t){return arguments.length?(this._r="function"==typeof t?t:Bt(t),this):this._r}
|
|
2078
2078
|
/**
|
|
2079
2079
|
@memberof Circle
|
|
2080
2080
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from Shape.
|
|
@@ -2108,7 +2108,7 @@ Object.keys(lc).forEach(function(t){lc[t.toLowerCase()]=lc[t]});class fc extends
|
|
|
2108
2108
|
function(d) {
|
|
2109
2109
|
return d.height;
|
|
2110
2110
|
}
|
|
2111
|
-
*/height(t){return arguments.length?(this._height="function"==typeof t?t:
|
|
2111
|
+
*/height(t){return arguments.length?(this._height="function"==typeof t?t:Bt(t),this):this._height}
|
|
2112
2112
|
/**
|
|
2113
2113
|
@memberof Rect
|
|
2114
2114
|
@desc If *value* is specified, sets the width accessor to the specified function or number and returns the current class instance.
|
|
@@ -2118,7 +2118,7 @@ Object.keys(lc).forEach(function(t){lc[t.toLowerCase()]=lc[t]});class fc extends
|
|
|
2118
2118
|
function(d) {
|
|
2119
2119
|
return d.width;
|
|
2120
2120
|
}
|
|
2121
|
-
*/width(t){return arguments.length?(this._width="function"==typeof t?t:
|
|
2121
|
+
*/width(t){return arguments.length?(this._width="function"==typeof t?t:Bt(t),this):this._width}
|
|
2122
2122
|
/**
|
|
2123
2123
|
@memberof Rect
|
|
2124
2124
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from Shape.
|
|
@@ -2153,7 +2153,7 @@ Object.keys(lc).forEach(function(t){lc[t.toLowerCase()]=lc[t]});class fc extends
|
|
|
2153
2153
|
@desc If *value* is specified, sets the area curve to the specified string and returns the current class instance. If *value* is not specified, returns the current area curve.
|
|
2154
2154
|
@param {Function|String} [*value* = "linear"]
|
|
2155
2155
|
@chainable
|
|
2156
|
-
*/curve(t){return arguments.length?(this._curve="function"==typeof t?t:
|
|
2156
|
+
*/curve(t){return arguments.length?(this._curve="function"==typeof t?t:Bt(t),this):this._curve}
|
|
2157
2157
|
/**
|
|
2158
2158
|
@memberof Line
|
|
2159
2159
|
@desc If *value* is specified, sets the defined accessor to the specified function and returns the current class instance. If *value* is not specified, returns the current defined accessor.
|
|
@@ -2164,7 +2164,7 @@ Object.keys(lc).forEach(function(t){lc[t.toLowerCase()]=lc[t]});class fc extends
|
|
|
2164
2164
|
@memberof Line
|
|
2165
2165
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from Shape.
|
|
2166
2166
|
@private
|
|
2167
|
-
*/constructor(){super(),this._curve=
|
|
2167
|
+
*/constructor(){super(),this._curve=Bt("linear"),this._defined=t=>t,this._fill=Bt("none"),this._hitArea=Bt({d:t=>this._path(t.values),fill:"none","stroke-width":10,transform:null}),this._name="Line",this._path=ll(),this._stroke=Bt("black"),this._strokeWidth=Bt(1)}}let vc={Circle:_c,Rect:mc};class bc extends Li{
|
|
2168
2168
|
/**
|
|
2169
2169
|
@memberof Whisker
|
|
2170
2170
|
@desc Draws the whisker.
|
|
@@ -2172,9 +2172,9 @@ Object.keys(lc).forEach(function(t){lc[t.toLowerCase()]=lc[t]});class fc extends
|
|
|
2172
2172
|
@chainable
|
|
2173
2173
|
*/render(t){void 0===this._select&&this.select(H("body").append("svg").style("width",window.innerWidth+"px").style("height",window.innerHeight+"px").style("display","block").node());let s=[];this._data.forEach((t,n)=>{var e=this._orient(t,n),i=this._x(t,n),a=this._y(t,n);let r=i,o=("left"===e?r-=this._length(t,n):"right"===e&&(r+=this._length(t,n)),a);"top"===e?o-=this._length(t,n):"bottom"===e&&(o+=this._length(t,n)),s.push({__d3plus__:!0,data:t,i:n,id:n,x:i,y:a}),s.push({__d3plus__:!0,data:t,i:n,id:n,x:r,y:o})}),
|
|
2174
2174
|
// Draw whisker line.
|
|
2175
|
-
this._line=(new yc).data(s).select(Pt("g.d3plus-Whisker",{parent:this._select}).node()).config(
|
|
2175
|
+
this._line=(new yc).data(s).select(Pt("g.d3plus-Whisker",{parent:this._select}).node()).config(Lt.bind(this)(this._lineConfig,"shape")).render(t);t=this._data.map((t,n)=>{var e={__d3plus__:!0};e.data=t,e.i=n,e.endpoint=this._endpoint(t,n),e.length=this._length(t,n),e.orient=this._orient(t,n);let i=this._x(t,n),a=("left"===e.orient?i-=e.length:"right"===e.orient&&(i+=e.length),this._y(t,n));return"top"===e.orient?a-=e.length:"bottom"===e.orient&&(a+=e.length),e.x=i,e.y=a,e});
|
|
2176
2176
|
// Draw whisker endpoint.
|
|
2177
|
-
return this._whiskerEndpoint=[],ca().key(t=>t.endpoint).entries(t).forEach(t=>{var n=t.key;this._whiskerEndpoint.push((new vc[n]).data(t.values).select(Pt("g.d3plus-Whisker-Endpoint-"+n,{parent:this._select}).node()).config({height:t=>"top"===t.orient||"bottom"===t.orient?5:20,width:t=>"top"===t.orient||"bottom"===t.orient?20:5}).config(
|
|
2177
|
+
return this._whiskerEndpoint=[],ca().key(t=>t.endpoint).entries(t).forEach(t=>{var n=t.key;this._whiskerEndpoint.push((new vc[n]).data(t.values).select(Pt("g.d3plus-Whisker-Endpoint-"+n,{parent:this._select}).node()).config({height:t=>"top"===t.orient||"bottom"===t.orient?5:20,width:t=>"top"===t.orient||"bottom"===t.orient?20:5}).config(Lt.bind(this)(this._endpointConfig,"shape",n)).render())}),this}
|
|
2178
2178
|
/**
|
|
2179
2179
|
@memberof Whisker
|
|
2180
2180
|
@desc Sets the highlight accessor to the Shape class's active function.
|
|
@@ -2192,7 +2192,7 @@ return this._whiskerEndpoint=[],ca().key(t=>t.endpoint).entries(t).forEach(t=>{v
|
|
|
2192
2192
|
@desc If *value* is specified, sets the endpoint accessor to the specified function or string and returns the current class instance.
|
|
2193
2193
|
@param {Function|String}
|
|
2194
2194
|
@chainable
|
|
2195
|
-
*/endpoint(t){return arguments.length?(this._endpoint="function"==typeof t?t:
|
|
2195
|
+
*/endpoint(t){return arguments.length?(this._endpoint="function"==typeof t?t:Bt(t),this):this._endpoint}
|
|
2196
2196
|
/**
|
|
2197
2197
|
@memberof Whisker
|
|
2198
2198
|
@desc If *value* is specified, sets the config method for each endpoint and returns the current class instance.
|
|
@@ -2210,7 +2210,7 @@ return this._whiskerEndpoint=[],ca().key(t=>t.endpoint).entries(t).forEach(t=>{v
|
|
|
2210
2210
|
@desc If *value* is specified, sets the length accessor for whisker and returns the current class instance.
|
|
2211
2211
|
@param {Function|Number} [*value*]
|
|
2212
2212
|
@chainable
|
|
2213
|
-
*/length(t){return arguments.length?(this._length="function"==typeof t?t:
|
|
2213
|
+
*/length(t){return arguments.length?(this._length="function"==typeof t?t:Bt(t),this):this._length}
|
|
2214
2214
|
/**
|
|
2215
2215
|
@memberof Whisker
|
|
2216
2216
|
@desc If *value* is specified, sets the config method for line shape and returns the current class instance.
|
|
@@ -2222,7 +2222,7 @@ return this._whiskerEndpoint=[],ca().key(t=>t.endpoint).entries(t).forEach(t=>{v
|
|
|
2222
2222
|
@desc If *value* is specified, sets the orientation to the specified value. If *value* is not specified, returns the current orientation.
|
|
2223
2223
|
@param {Function|String} [*value* = "top"] Accepts "top", "right", "bottom" or "left"
|
|
2224
2224
|
@chainable
|
|
2225
|
-
*/orient(t){return arguments.length?(this._orient="function"==typeof t?t:
|
|
2225
|
+
*/orient(t){return arguments.length?(this._orient="function"==typeof t?t:Bt(t),this):this._orient}
|
|
2226
2226
|
/**
|
|
2227
2227
|
@memberof Whisker
|
|
2228
2228
|
@desc If *selector* is specified, sets the SVG container element to the specified d3 selector or DOM element and returns the current class instance. If *selector* is not specified, returns the current SVG container element.
|
|
@@ -2238,7 +2238,7 @@ return this._whiskerEndpoint=[],ca().key(t=>t.endpoint).entries(t).forEach(t=>{v
|
|
|
2238
2238
|
function(d) {
|
|
2239
2239
|
return d.x;
|
|
2240
2240
|
}
|
|
2241
|
-
*/x(t){return arguments.length?(this._x="function"==typeof t?t:
|
|
2241
|
+
*/x(t){return arguments.length?(this._x="function"==typeof t?t:Bt(t),this):this._x}
|
|
2242
2242
|
/**
|
|
2243
2243
|
@memberof Whisker
|
|
2244
2244
|
@desc If *value* is specified, sets the y axis to the specified function or number and returns the current class instance.
|
|
@@ -2248,12 +2248,12 @@ return this._whiskerEndpoint=[],ca().key(t=>t.endpoint).entries(t).forEach(t=>{v
|
|
|
2248
2248
|
function(d) {
|
|
2249
2249
|
return d.y;
|
|
2250
2250
|
}
|
|
2251
|
-
*/y(t){return arguments.length?(this._y="function"==typeof t?t:
|
|
2251
|
+
*/y(t){return arguments.length?(this._y="function"==typeof t?t:Bt(t),this):this._y}
|
|
2252
2252
|
/**
|
|
2253
2253
|
@memberof Whisker
|
|
2254
2254
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from BaseClass.
|
|
2255
2255
|
@private
|
|
2256
|
-
*/constructor(){super(),this._endpoint=p("endpoint","Rect"),this._endpointConfig={Circle:{r:p("r",5)}},this._length=p("length",25),this._lineConfig={},this._orient=p("orient","top"),this._x=p("x",0),this._y=p("y",0)}}let xc={Circle:_c,Rect:mc};class wc extends
|
|
2256
|
+
*/constructor(){super(),this._endpoint=p("endpoint","Rect"),this._endpointConfig={Circle:{r:p("r",5)}},this._length=p("length",25),this._lineConfig={},this._orient=p("orient","top"),this._x=p("x",0),this._y=p("y",0)}}let xc={Circle:_c,Rect:mc};class wc extends Li{
|
|
2257
2257
|
/**
|
|
2258
2258
|
@memberof Box
|
|
2259
2259
|
@desc Draws the Box.
|
|
@@ -2267,16 +2267,16 @@ a.height=this._rectWidth(a.data,a.i),a.width=t,a.x=a.first+t/2,a.y=this._y(a.dat
|
|
|
2267
2267
|
// Compute data for outliers.
|
|
2268
2268
|
a.values.forEach((t,n)=>{var e,i="vertical"===a.orient?this._y(t,n):this._x(t,n);(i<a.lowerLimit||i>a.upperLimit)&&((e={__d3plus__:!0}).data=t,e.i=n,e.outlier=this._outlier(t,n),"vertical"===a.orient?(e.x=a.x,e.y=i,r.push(e)):"horizontal"===a.orient&&(e.y=a.y,e.x=i,r.push(e)))}),a.__d3plus__=!0,a});
|
|
2269
2269
|
// Draw box.
|
|
2270
|
-
this._box=(new mc).data(t).x(t=>t.x).y(t=>t.y).select(Pt("g.d3plus-Box",{parent:this._select}).node()).config(
|
|
2270
|
+
this._box=(new mc).data(t).x(t=>t.x).y(t=>t.y).select(Pt("g.d3plus-Box",{parent:this._select}).node()).config(Lt.bind(this)(this._rectConfig,"shape")).render(),
|
|
2271
2271
|
// Draw median.
|
|
2272
|
-
this._median=(new mc).data(t).x(t=>"vertical"===t.orient?t.x:t.median).y(t=>"vertical"===t.orient?t.median:t.y).height(t=>"vertical"===t.orient?1:t.height).width(t=>"vertical"===t.orient?t.width:1).select(Pt("g.d3plus-Box-Median",{parent:this._select}).node()).config(
|
|
2272
|
+
this._median=(new mc).data(t).x(t=>"vertical"===t.orient?t.x:t.median).y(t=>"vertical"===t.orient?t.median:t.y).height(t=>"vertical"===t.orient?1:t.height).width(t=>"vertical"===t.orient?t.width:1).select(Pt("g.d3plus-Box-Median",{parent:this._select}).node()).config(Lt.bind(this)(this._medianConfig,"shape")).render();
|
|
2273
2273
|
// Draw 2 lines using Whisker class.
|
|
2274
2274
|
// Construct coordinates for whisker startpoints and push it to the whiskerData.
|
|
2275
2275
|
let l=[];return t.forEach((t,n)=>{var e,i,a=t.x,r=t.y,o=t.first-t.lowerLimit,s=t.upperLimit-t.third;"vertical"===t.orient?(e=r-t.height/2,i=r+t.height/2,l.push({__d3plus__:!0,data:t,i:n,x:a,y:e,length:o,orient:"top"},{__d3plus__:!0,data:t,i:n,x:a,y:i,length:s,orient:"bottom"})):"horizontal"===t.orient&&(e=a+t.width/2,i=a-t.width/2,l.push({__d3plus__:!0,data:t,i:n,x:e,y:r,length:s,orient:"right"},{__d3plus__:!0,data:t,i:n,x:i,y:r,length:o,orient:"left"}))}),
|
|
2276
2276
|
// Draw whiskers.
|
|
2277
|
-
this._whisker=(new bc).data(l).select(Pt("g.d3plus-Box-Whisker",{parent:this._select}).node()).config(
|
|
2277
|
+
this._whisker=(new bc).data(l).select(Pt("g.d3plus-Box-Whisker",{parent:this._select}).node()).config(Lt.bind(this)(this._whiskerConfig,"shape")).render(),
|
|
2278
2278
|
// Draw outliers.
|
|
2279
|
-
this._whiskerEndpoint=[],ca().key(t=>t.outlier).entries(r).forEach(t=>{var n=t.key;this._whiskerEndpoint.push((new xc[n]).data(t.values).select(Pt("g.d3plus-Box-Outlier-"+n,{parent:this._select}).node()).config(
|
|
2279
|
+
this._whiskerEndpoint=[],ca().key(t=>t.outlier).entries(r).forEach(t=>{var n=t.key;this._whiskerEndpoint.push((new xc[n]).data(t.values).select(Pt("g.d3plus-Box-Outlier-"+n,{parent:this._select}).node()).config(Lt.bind(this)(this._outlierConfig,"shape",n)).render())}),this}
|
|
2280
2280
|
/**
|
|
2281
2281
|
@memberof Box
|
|
2282
2282
|
@desc Sets the highlight accessor to the Shape class's active function.
|
|
@@ -2306,13 +2306,13 @@ this._whiskerEndpoint=[],ca().key(t=>t.outlier).entries(r).forEach(t=>{var n=t.k
|
|
|
2306
2306
|
@desc If *value* is specified, sets the orientation to the specified value. If *value* is not specified, returns the current orientation.
|
|
2307
2307
|
@param {Function|String} [*value* = "vertical"] Accepts "vertical" or "horizontal"
|
|
2308
2308
|
@chainable
|
|
2309
|
-
*/orient(t){return arguments.length?(this._orient="function"==typeof t?t:
|
|
2309
|
+
*/orient(t){return arguments.length?(this._orient="function"==typeof t?t:Bt(t),this):this._orient}
|
|
2310
2310
|
/**
|
|
2311
2311
|
@memberof Box
|
|
2312
2312
|
@desc If *value* is specified, sets the outlier accessor to the specified function or string and returns the current class instance.
|
|
2313
2313
|
@param {Function|String}
|
|
2314
2314
|
@chainable
|
|
2315
|
-
*/outlier(t){return arguments.length?(this._outlier="function"==typeof t?t:
|
|
2315
|
+
*/outlier(t){return arguments.length?(this._outlier="function"==typeof t?t:Bt(t),this):this._outlier}
|
|
2316
2316
|
/**
|
|
2317
2317
|
@memberof Box
|
|
2318
2318
|
@desc If *value* is specified, sets the config method for each outlier point and returns the current class instance.
|
|
@@ -2334,7 +2334,7 @@ this._whiskerEndpoint=[],ca().key(t=>t.outlier).entries(r).forEach(t=>{var n=t.k
|
|
|
2334
2334
|
function(d) {
|
|
2335
2335
|
return d.width;
|
|
2336
2336
|
}
|
|
2337
|
-
*/rectWidth(t){return arguments.length?(this._rectWidth="function"==typeof t?t:
|
|
2337
|
+
*/rectWidth(t){return arguments.length?(this._rectWidth="function"==typeof t?t:Bt(t),this):this._rectWidth}
|
|
2338
2338
|
/**
|
|
2339
2339
|
@memberof Box
|
|
2340
2340
|
@desc If *selector* is specified, sets the SVG container element to the specified d3 selector or DOM element and returns the current class instance. If *selector* is not specified, returns the current SVG container element.
|
|
@@ -2377,7 +2377,7 @@ this._whiskerEndpoint=[],ca().key(t=>t.outlier).entries(r).forEach(t=>{var n=t.k
|
|
|
2377
2377
|
@memberof Box
|
|
2378
2378
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from BaseClass.
|
|
2379
2379
|
@private
|
|
2380
|
-
*/constructor(){super(),this._medianConfig={fill:
|
|
2380
|
+
*/constructor(){super(),this._medianConfig={fill:Bt("black")},this._orient=p("orient","vertical"),this._outlier=p("outlier","Circle"),this._outlierConfig={Circle:{r:p("r",5)},Rect:{height:(t,n)=>"vertical"===this._orient(t,n)?5:20,width:(t,n)=>"vertical"===this._orient(t,n)?20:5}},this._rectConfig={fill:Bt("white"),stroke:Bt("black"),strokeWidth:Bt(1)},this._rectWidth=Bt(50),this._whiskerConfig={},this._whiskerMode=["tukey","tukey"],this._x=p("x",250),this._y=p("y",250)}}let Sc=class extends Xu{
|
|
2381
2381
|
/**
|
|
2382
2382
|
@memberof Path
|
|
2383
2383
|
@desc Given a specific data point and index, returns the aesthetic properties of the shape.
|
|
@@ -2400,7 +2400,7 @@ this._whiskerEndpoint=[],ca().key(t=>t.outlier).entries(r).forEach(t=>{var n=t.k
|
|
|
2400
2400
|
function(d) {
|
|
2401
2401
|
return d.path;
|
|
2402
2402
|
}
|
|
2403
|
-
*/d(t){return arguments.length?(this._d="function"==typeof t?t:
|
|
2403
|
+
*/d(t){return arguments.length?(this._d="function"==typeof t?t:Bt(t),this):this._d}
|
|
2404
2404
|
/**
|
|
2405
2405
|
@memberof Path
|
|
2406
2406
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from Shape.
|
|
@@ -2420,7 +2420,7 @@ this._whiskerEndpoint=[],ca().key(t=>t.outlier).entries(r).forEach(t=>{var n=t.k
|
|
|
2420
2420
|
// for time scale, if data array has been provided, filter out ticks that are not in the array
|
|
2421
2421
|
if("time"===this._scale&&this._data.length){let e=this._data.map(Number);i=i.filter(t=>{let n=+t;return e.find(t=>t>=n-936e5&&t<=936e5+n)})}
|
|
2422
2422
|
// forces min/max into ticks, if not present
|
|
2423
|
-
return this._d3ScaleNegative&&Mc(r[o?1:0])!==i.some(t=>Mc(t))||i.map(Number).includes(+r[0])||i.unshift(r[0]),this._d3ScaleNegative&&Mc(r[o?0:1])!==i.some(t=>Mc(t))||i.map(Number).includes(+r[1])||i.push(r[1]),i}class Nc extends
|
|
2423
|
+
return this._d3ScaleNegative&&Mc(r[o?1:0])!==i.some(t=>Mc(t))||i.map(Number).includes(+r[0])||i.unshift(r[0]),this._d3ScaleNegative&&Mc(r[o?0:1])!==i.some(t=>Mc(t))||i.map(Number).includes(+r[1])||i.push(r[1]),i}class Nc extends Li{
|
|
2424
2424
|
/**
|
|
2425
2425
|
@memberof Axis
|
|
2426
2426
|
@desc Sets positioning for the axis bar.
|
|
@@ -2530,7 +2530,7 @@ if(Mc(r[0])&&Mc(r[r.length-1]))this._d3ScaleNegative=this._d3Scale.copy().domain
|
|
|
2530
2530
|
/**
|
|
2531
2531
|
* "spillover" will contain the pixel spillover of the first and last label,
|
|
2532
2532
|
* and then adjust the scale range accordingly.
|
|
2533
|
-
*/,[0,1].map(t=>{var n,e,i,a=M[t?M.length-1:0];return!a||({height:a,position:n,rotate:i,width:e}=a,t=t?m[1]:m[0],i=(i||!d?a:e)/2,Math.abs(n-t)>=i)?0:Math.abs(i-(n-t))})),[z,T]=x,l=[z+l[0],T-l[1]];this._range&&(void 0!==this._range[0]&&(l[0]=this._range[0]),void 0!==this._range[this._range.length-1])&&(l[1]=this._range[this._range.length-1]),l[0]===z&&l[1]===T||(s.bind(this)(l),A.bind(this)(h?2:1));let E=Ot(M,t=>t.height)||0,N=(this._labelRotation=d&&void 0===this._labelRotation?M.some(t=>{var{i:t,height:n,position:e,truncated:i}=t,a=M[t-1];return i||t&&a.position+a.height/2>e-n/2}):this._labelRotation,this._labelOffset?Ot(M,t=>t.offset||0):0);M.forEach(t=>t.offset=t.offset?N:0);z="Line"===this._shape?0:k;let P=this._outerBounds={[u]:(Ot(M,t=>Math.ceil(t[t.rotate||!d?"width":"height"]+t.offset))||0)+(M.length?_:0),[n]:m[m.length-1]-m[0],[c]:m[0]};P[u]=Ot([this._minSize,P[u]]),v[this._orient]+=k,v[f]=void 0!==this._gridSize?Ot([this._gridSize,z]):this["_"+u]-v[this._orient]-P[u]-_,P[u]+=v[f]+v[this._orient],P[g]="start"===this._align?this._padding:"end"===this._align?this["_"+u]-P[u]-this._padding:this["_"+u]/2-P[u]/2;T=Pt("g#d3plus-Axis-"+this._uuid,{parent:i}),l=Pt("g.grid",{parent:this._group=T}).selectAll("line").data((0!==this._gridSize?this._grid||"log"===this._scale&&!this._gridLog?b:w:[]).map(t=>({id:t})),t=>t.id),l.exit().transition(a).attr("opacity",0).call(this._gridPosition.bind(this)).remove(),l.enter().append("line").attr("opacity",0).attr("clip-path",`url(#${e})`).call(this._gridPosition.bind(this),!0).merge(l).transition(a).attr("opacity",1).call(this._gridPosition.bind(this)),h=b.filter((t,n)=>M[n].lines.length&&!w.includes(t));let
|
|
2533
|
+
*/,[0,1].map(t=>{var n,e,i,a=M[t?M.length-1:0];return!a||({height:a,position:n,rotate:i,width:e}=a,t=t?m[1]:m[0],i=(i||!d?a:e)/2,Math.abs(n-t)>=i)?0:Math.abs(i-(n-t))})),[z,T]=x,l=[z+l[0],T-l[1]];this._range&&(void 0!==this._range[0]&&(l[0]=this._range[0]),void 0!==this._range[this._range.length-1])&&(l[1]=this._range[this._range.length-1]),l[0]===z&&l[1]===T||(s.bind(this)(l),A.bind(this)(h?2:1));let E=Ot(M,t=>t.height)||0,N=(this._labelRotation=d&&void 0===this._labelRotation?M.some(t=>{var{i:t,height:n,position:e,truncated:i}=t,a=M[t-1];return i||t&&a.position+a.height/2>e-n/2}):this._labelRotation,this._labelOffset?Ot(M,t=>t.offset||0):0);M.forEach(t=>t.offset=t.offset?N:0);z="Line"===this._shape?0:k;let P=this._outerBounds={[u]:(Ot(M,t=>Math.ceil(t[t.rotate||!d?"width":"height"]+t.offset))||0)+(M.length?_:0),[n]:m[m.length-1]-m[0],[c]:m[0]};P[u]=Ot([this._minSize,P[u]]),v[this._orient]+=k,v[f]=void 0!==this._gridSize?Ot([this._gridSize,z]):this["_"+u]-v[this._orient]-P[u]-_,P[u]+=v[f]+v[this._orient],P[g]="start"===this._align?this._padding:"end"===this._align?this["_"+u]-P[u]-this._padding:this["_"+u]/2-P[u]/2;T=Pt("g#d3plus-Axis-"+this._uuid,{parent:i}),l=Pt("g.grid",{parent:this._group=T}).selectAll("line").data((0!==this._gridSize?this._grid||"log"===this._scale&&!this._gridLog?b:w:[]).map(t=>({id:t})),t=>t.id),l.exit().transition(a).attr("opacity",0).call(this._gridPosition.bind(this)).remove(),l.enter().append("line").attr("opacity",0).attr("clip-path",`url(#${e})`).call(this._gridPosition.bind(this),!0).merge(l).transition(a).attr("opacity",1).call(this._gridPosition.bind(this)),h=b.filter((t,n)=>M[n].lines.length&&!w.includes(t));let L=M.some(t=>t.rotate),B=w.concat(h).map(n=>{var t=M.find(t=>t.d===n),e=this._getPosition(n),i=t?t.space:0,a=t?t.lines.length:1,r=t?t.lineHeight:1,o=t?t.fP:0,s=t&&this._labelOffset?t.offset:0,l=d?i:P.width-v[this._position.opposite]-k-v[this._orient]+_,h=v[f],s=(k+s)*(p?-1:1),h=p?P[g]+P[u]-h:P[g]+h;return{id:n,labelBounds:L&&t?{x:-t.width/2+t.fS/4,y:"bottom"===this._orient?s+(t.width-r*a)/2+o:2*s-(t.width+r*a)/2+o,width:t.width,height:t.height}:{x:d?-i/2:"left"===this._orient?-l-_+s:s+_,y:d?"bottom"===this._orient?s+o:s-E-o:-i/2,width:d?i:l,height:d?E:i},rotate:!!t&&t.rotate,size:b.includes(n)||"log"===this._scale&&Math.log10(Math.abs(n))%1==0?s:w.includes(n)?Math.ceil(s/2):this._data.find(t=>+t===n)?Math.ceil(s/4):0,text:!((t||{}).truncated||!b.includes(n))&&S(n),tick:w.includes(n),[c]:e+("band"===this._scale?this._d3Scale.bandwidth()/2:0),[g]:h}});"Line"===this._shape&&(B=B.concat(B.map(t=>{var n=Object.assign({},t);return n[g]+=t.size,n}))),(new kc[this._shape]).data(B).duration(this._duration).labelConfig({ellipsis:t=>t&&t.length?t+"...":"",rotate:t=>t.rotate?-90:0}).select(Pt("g.ticks",{parent:T}).node()).config(Lt.bind(this)(this._shapeConfig)).labelConfig({padding:0}).render();z=T.selectAll("line.bar").data([null]);return z.enter().append("line").attr("class","bar").attr("opacity",0).call(this._barPosition.bind(this)).merge(z).transition(a).attr("opacity",1).call(this._barPosition.bind(this)),this._titleClass.data(this._title?[{text:this._title}]:[]).duration(this._duration).height(v[this._orient]).rotate("left"===this._orient?-90:"right"===this._orient?90:0).select(Pt("g.d3plus-Axis-title",{parent:T}).node()).text(t=>t.text).verticalAlign("middle").width(x[x.length-1]-x[0]).x(d?x[0]:"left"===this._orient?P.x+v.left/2-(x[x.length-1]-x[0])/2:P.x+P.width-v.right/2-(x[x.length-1]-x[0])/2).y(d?"bottom"===this._orient?P.y+P.height-v.bottom:P.y:x[0]+(x[x.length-1]-x[0])/2-v[this._orient]/2).config(Lt.bind(this)(this._titleConfig)).render(),this._lastScale=this._getPosition.bind(this),t&&setTimeout(t,this._duration+100),this}
|
|
2534
2534
|
/**
|
|
2535
2535
|
@memberof Axis
|
|
2536
2536
|
@desc If *value* is specified, sets the horizontal alignment to the specified value and returns the current class instance.
|
|
@@ -2769,17 +2769,17 @@ if(Mc(r[0])&&Mc(r[r.length-1]))this._d3ScaleNegative=this._d3Scale.copy().domain
|
|
|
2769
2769
|
@memberof Axis
|
|
2770
2770
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
2771
2771
|
@private
|
|
2772
|
-
*/constructor(){super(),this._align="middle",this._barConfig={stroke:Cc.colors.gray[600],"stroke-width":1},this._data=[],this._domain=[0,10],this._duration=600,this._gridConfig={stroke:Rh.light,"stroke-width":1},this._gridLog=!1,this._height=400,this._labelOffset=!1,this._labelRotation=!1,this.orient("bottom"),this._outerBounds={width:0,height:0,x:0,y:0},this._padding=5,this._paddingInner=.1,this._paddingOuter=.1,this._rounding="none",this._roundingInsideMinPrefix="< ",this._roundingInsideMinSuffix="",this._roundingInsideMaxPrefix="",this._roundingInsideMaxSuffix="+",this._scale="linear",this._scalePadding=.5,this._shape="Line",this._shapeConfig={fill:Cc.colors.gray[600],height:t=>t.tick?8:0,label:t=>t.text,labelBounds:t=>t.labelBounds,labelConfig:{fontColor:Cc.colors.gray[600],fontResize:!1,fontSize:
|
|
2772
|
+
*/constructor(){super(),this._align="middle",this._barConfig={stroke:Cc.colors.gray[600],"stroke-width":1},this._data=[],this._domain=[0,10],this._duration=600,this._gridConfig={stroke:Rh.light,"stroke-width":1},this._gridLog=!1,this._height=400,this._labelOffset=!1,this._labelRotation=!1,this.orient("bottom"),this._outerBounds={width:0,height:0,x:0,y:0},this._padding=5,this._paddingInner=.1,this._paddingOuter=.1,this._rounding="none",this._roundingInsideMinPrefix="< ",this._roundingInsideMinSuffix="",this._roundingInsideMaxPrefix="",this._roundingInsideMaxSuffix="+",this._scale="linear",this._scalePadding=.5,this._shape="Line",this._shapeConfig={fill:Cc.colors.gray[600],height:t=>t.tick?8:0,label:t=>t.text,labelBounds:t=>t.labelBounds,labelConfig:{fontColor:Cc.colors.gray[600],fontResize:!1,fontSize:Bt(12),padding:5,textAnchor:()=>{var t=yi(this._select.node());return"left"===this._orient?t?"start":"end":"right"===this._orient?t?"end":"start":this._labelRotation?"bottom"===this._orient?"end":"start":"middle"},verticalAlign:()=>"bottom"===this._orient?"top":"top"===this._orient?"bottom":"middle"},r:t=>t.tick?4:0,stroke:Cc.colors.gray[600],strokeWidth:1,width:t=>t.tick?8:0},this._tickSize=8,this._tickSuffix="normal",this._tickUnit=0,this._timeLocale=void 0,this._titleClass=new Ic,this._titleConfig={fontColor:Rh.dark,fontSize:12,textAnchor:"middle"},this._width=400}}class Pc extends Nc{
|
|
2773
2773
|
/**
|
|
2774
2774
|
@memberof AxisBottom
|
|
2775
2775
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from Axis.
|
|
2776
2776
|
@private
|
|
2777
|
-
*/constructor(){super(),this.orient("bottom")}}class
|
|
2777
|
+
*/constructor(){super(),this.orient("bottom")}}class Lc extends Nc{
|
|
2778
2778
|
/**
|
|
2779
2779
|
@memberof AxisLeft
|
|
2780
2780
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from Axis.
|
|
2781
2781
|
@private
|
|
2782
|
-
*/constructor(){super(),this.orient("left")}}class
|
|
2782
|
+
*/constructor(){super(),this.orient("left")}}class Bc extends Nc{
|
|
2783
2783
|
/**
|
|
2784
2784
|
@memberof AxisRight
|
|
2785
2785
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from Axis.
|
|
@@ -2789,7 +2789,7 @@ if(Mc(r[0])&&Mc(r[r.length-1]))this._d3ScaleNegative=this._d3Scale.copy().domain
|
|
|
2789
2789
|
@memberof AxisTop
|
|
2790
2790
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from Axis.
|
|
2791
2791
|
@private
|
|
2792
|
-
*/constructor(){super(),this.orient("top")}}class Dc extends
|
|
2792
|
+
*/constructor(){super(),this.orient("top")}}class Dc extends Li{_fetchConfig(t,n,e){var i=(void 0!==this._shapeConfig[t]?this._shapeConfig:this._shapeConfig.labelConfig)[t];return i||"lineHeight"!==t?"function"==typeof i?i(n,e):i:1.4*this._fetchConfig("fontSize",n,e)}_rowHeight(t){return Ot(t.map(t=>t.height).concat(t.map(t=>t.shapeHeight)))+this._padding}_rowWidth(e){return sa(e.map((t,n)=>{n=this._padding*(n===e.length-1?0:t.width?2:1);return t.shapeWidth+t.width+n}))}
|
|
2793
2793
|
/**
|
|
2794
2794
|
@memberof Legend
|
|
2795
2795
|
@desc Renders the current Legend to the page. If a *callback* is specified, it will be called once the legend is done drawing.
|
|
@@ -2799,7 +2799,7 @@ if(Mc(r[0])&&Mc(r[r.length-1]))this._d3ScaleNegative=this._d3Scale.copy().domain
|
|
|
2799
2799
|
// Legend Container <g> Groups
|
|
2800
2800
|
this._group=Pt("g.d3plus-Legend",{parent:this._select}),this._titleGroup=Pt("g.d3plus-Legend-title",{parent:this._group}),this._shapeGroup=Pt("g.d3plus-Legend-shape",{parent:this._group});let h=this._height;if(this._titleHeight=0,this._titleWidth=0,this._title){var n=this._titleConfig.fontFamily||this._titleClass.fontFamily()(),e=this._titleConfig.fontSize||this._titleClass.fontSize()();let t=this._titleConfig.lineHeight||this._titleClass.lineHeight();t=t?t():1.4*e;n=si().fontFamily(n).fontSize(e).lineHeight(t).width(this._width).height(this._height)(this._title);this._titleHeight=t+n.lines.length+this._padding,this._titleWidth=Ot(n.widths),h-=this._titleHeight}
|
|
2801
2801
|
// Calculate Text Sizes
|
|
2802
|
-
this._lineData=this._data.map((i,a)=>{var r=this._label(i,a),o=this._shape(i,a),s=this._fetchConfig("r",i,a);let l={data:i,i:a,id:this._id(i,a),shape:o,shapeR:s,shapeWidth:"Circle"===o?2*s:this._fetchConfig("width",i,a),shapeHeight:"Circle"===o?2*s:this._fetchConfig("height",i,a),y:0};if(r){let n=this._fetchConfig("fontFamily",i,a),t=this._fetchConfig("lineHeight",i,a),e=this._fetchConfig("fontSize",i,a);o=h-(this._data.length+1)*this._padding,s=this._width,i=si().fontFamily(n).fontSize(e).lineHeight(t).width(s).height(o)(r);(l=Object.assign(l,i)).width=Math.ceil(Ot(l.lines.map(t=>Ae(t,{"font-family":n,"font-size":e}))))+10,l.height=Math.ceil(l.lines.length*(t+1)),l.og={height:l.height,width:l.width},l.f=n,l.s=e,l.lh=t}else l.sentence=!1,l.words=[],l.height=0,l.width=0;return l});let i,l=this._width-2*this._padding;if(i=this._rowWidth(this._lineData),"column"===this._direction||i>l){let o=1,s=[],t=Ot(this._lineData.map(t=>t.words.length));if(this._wrapLines=function(){if(!(++o>t)){var i=1===o?this._lineData.slice():this._lineData.filter(t=>t.width+t.shapeWidth+this._padding*(t.width?2:1)>l&&t.words.length>=o).sort((t,n)=>n.sentence.length-t.sentence.length);if(i.length&&h>i[0].height*o){let e=!1;for(let t=0;t<i.length;t++){let n=i[t];var a=n.og.height*o,r=n.og.width*(1/o*1.5),r=si().fontFamily(n.f).fontSize(n.s).lineHeight(n.lh).width(r).height(a)(n.sentence);if(r.truncated){e=!0;break}n.width=Math.ceil(Ot(r.lines.map(t=>Ae(t,{"font-family":n.f,"font-size":n.s}))))+n.s,n.height=r.lines.length*(n.lh+1)}e||this._wrapRows()}else s=[]}},this._wrapRows=function(){s=[];let n=1,e=0;for(let t=0;t<this._lineData.length;t++){var i=this._lineData[t],a=i.width+this._padding*(i.width?2:1)+i.shapeWidth;if(sa(s.map(t=>Ot(t,t=>Ot([t.height,t.shapeHeight]))))>h){s=[];break}if(a>l){s=[],this._wrapLines();break}e+a<l?e+=a:"column"!==this._direction&&(e=a,n++),s[n-1]||(s[n-1]=[]),s[n-1].push(i),"column"===this._direction&&(e=0,n++)}},this._wrapRows(),!s.length||sa(s,this._rowHeight.bind(this))+this._padding>h){i=sa(this._lineData.map(t=>t.shapeWidth+this._padding))-this._padding;for(let t=0;t<this._lineData.length;t++)this._lineData[t].width=0,this._lineData[t].height=0;this._wrapRows()}s.length&&sa(s,this._rowHeight.bind(this))+this._padding<h&&(s.forEach((t,n)=>{t.forEach(t=>{n&&(t.y=sa(s.slice(0,n),this._rowHeight.bind(this)))})}),i=Ot(s,this._rowWidth.bind(this)))}e=Ot(this._lineData,(t,n)=>Ot([t.height,this._fetchConfig("height",t.data,n)])+t.y)+this._titleHeight,n=Ot([i,this._titleWidth]);this._outerBounds.width=n,this._outerBounds.height=e;let a=this._padding,r=this._padding,o=("center"===this._align?a=(this._width-n)/2:"right"===this._align&&(a=this._width-this._padding-n),"middle"===this._verticalAlign?r=(this._height-e)/2:"bottom"===this._verticalAlign&&(r=this._height-this._padding-e),this._outerBounds.x=a,this._outerBounds.y=r,this._titleClass.data(this._title?[{text:this._title}]:[]).duration(this._duration).select(this._titleGroup.node()).textAnchor({left:"start",center:"middle",right:"end"}[this._align]).width(this._width-2*this._padding).x(this._padding).y(this._outerBounds.y).config(this._titleConfig).render(),this._shapes=[],
|
|
2802
|
+
this._lineData=this._data.map((i,a)=>{var r=this._label(i,a),o=this._shape(i,a),s=this._fetchConfig("r",i,a);let l={data:i,i:a,id:this._id(i,a),shape:o,shapeR:s,shapeWidth:"Circle"===o?2*s:this._fetchConfig("width",i,a),shapeHeight:"Circle"===o?2*s:this._fetchConfig("height",i,a),y:0};if(r){let n=this._fetchConfig("fontFamily",i,a),t=this._fetchConfig("lineHeight",i,a),e=this._fetchConfig("fontSize",i,a);o=h-(this._data.length+1)*this._padding,s=this._width,i=si().fontFamily(n).fontSize(e).lineHeight(t).width(s).height(o)(r);(l=Object.assign(l,i)).width=Math.ceil(Ot(l.lines.map(t=>Ae(t,{"font-family":n,"font-size":e}))))+10,l.height=Math.ceil(l.lines.length*(t+1)),l.og={height:l.height,width:l.width},l.f=n,l.s=e,l.lh=t}else l.sentence=!1,l.words=[],l.height=0,l.width=0;return l});let i,l=this._width-2*this._padding;if(i=this._rowWidth(this._lineData),"column"===this._direction||i>l){let o=1,s=[],t=Ot(this._lineData.map(t=>t.words.length));if(this._wrapLines=function(){if(!(++o>t)){var i=1===o?this._lineData.slice():this._lineData.filter(t=>t.width+t.shapeWidth+this._padding*(t.width?2:1)>l&&t.words.length>=o).sort((t,n)=>n.sentence.length-t.sentence.length);if(i.length&&h>i[0].height*o){let e=!1;for(let t=0;t<i.length;t++){let n=i[t];var a=n.og.height*o,r=n.og.width*(1/o*1.5),r=si().fontFamily(n.f).fontSize(n.s).lineHeight(n.lh).width(r).height(a)(n.sentence);if(r.truncated){e=!0;break}n.width=Math.ceil(Ot(r.lines.map(t=>Ae(t,{"font-family":n.f,"font-size":n.s}))))+n.s,n.height=r.lines.length*(n.lh+1)}e||this._wrapRows()}else s=[]}},this._wrapRows=function(){s=[];let n=1,e=0;for(let t=0;t<this._lineData.length;t++){var i=this._lineData[t],a=i.width+this._padding*(i.width?2:1)+i.shapeWidth;if(sa(s.map(t=>Ot(t,t=>Ot([t.height,t.shapeHeight]))))>h){s=[];break}if(a>l){s=[],this._wrapLines();break}e+a<l?e+=a:"column"!==this._direction&&(e=a,n++),s[n-1]||(s[n-1]=[]),s[n-1].push(i),"column"===this._direction&&(e=0,n++)}},this._wrapRows(),!s.length||sa(s,this._rowHeight.bind(this))+this._padding>h){i=sa(this._lineData.map(t=>t.shapeWidth+this._padding))-this._padding;for(let t=0;t<this._lineData.length;t++)this._lineData[t].width=0,this._lineData[t].height=0;this._wrapRows()}s.length&&sa(s,this._rowHeight.bind(this))+this._padding<h&&(s.forEach((t,n)=>{t.forEach(t=>{n&&(t.y=sa(s.slice(0,n),this._rowHeight.bind(this)))})}),i=Ot(s,this._rowWidth.bind(this)))}e=Ot(this._lineData,(t,n)=>Ot([t.height,this._fetchConfig("height",t.data,n)])+t.y)+this._titleHeight,n=Ot([i,this._titleWidth]);this._outerBounds.width=n,this._outerBounds.height=e;let a=this._padding,r=this._padding,o=("center"===this._align?a=(this._width-n)/2:"right"===this._align&&(a=this._width-this._padding-n),"middle"===this._verticalAlign?r=(this._height-e)/2:"bottom"===this._verticalAlign&&(r=this._height-this._padding-e),this._outerBounds.x=a,this._outerBounds.y=r,this._titleClass.data(this._title?[{text:this._title}]:[]).duration(this._duration).select(this._titleGroup.node()).textAnchor({left:"start",center:"middle",right:"end"}[this._align]).width(this._width-2*this._padding).x(this._padding).y(this._outerBounds.y).config(this._titleConfig).render(),this._shapes=[],Lt.bind(this)(this._shapeConfig,"legend")),s={id:t=>t.id,label:t=>t.label,lineHeight:t=>t.lH},u=this._data.map((t,n)=>({__d3plus__:!0,data:t,i:n,id:this._id(t,n),label:!!this._lineData[n].width&&this._label(t,n),lH:this._fetchConfig("lineHeight",t,n),shape:this._shape(t,n)}));
|
|
2803
2803
|
// Legend Shapes
|
|
2804
2804
|
return this._shapes=[],["Circle","Rect"].forEach(n=>{this._shapes.push((new kc[n]).parent(this).data(u.filter(t=>t.shape===n)).duration(this._duration).labelConfig({padding:0}).select(this._shapeGroup.node()).verticalAlign("top").config(Et({},o,s)).render())}),t&&setTimeout(t,this._duration+100),this}
|
|
2805
2805
|
/**
|
|
@@ -2859,7 +2859,7 @@ return this._shapes=[],["Circle","Rect"].forEach(n=>{this._shapes.push((new kc[n
|
|
|
2859
2859
|
@desc If *value* is specified, sets the label accessor to the specified function or string and returns the current class instance. If *value* is not specified, returns the current label accessor, which is the [id](#shape.id) accessor by default.
|
|
2860
2860
|
@param {Function|String} [*value*]
|
|
2861
2861
|
@chainable
|
|
2862
|
-
*/label(t){return arguments.length?(this._label="function"==typeof t?t:
|
|
2862
|
+
*/label(t){return arguments.length?(this._label="function"==typeof t?t:Bt(t),this):this._label}
|
|
2863
2863
|
/**
|
|
2864
2864
|
@memberof Legend
|
|
2865
2865
|
@desc If called after the elements have been drawn to DOM, will returns the outer bounds of the legend content.
|
|
@@ -2883,7 +2883,7 @@ return this._shapes=[],["Circle","Rect"].forEach(n=>{this._shapes.push((new kc[n
|
|
|
2883
2883
|
@desc If *value* is specified, sets the shape accessor to the specified function or string and returns the current class instance. If *value* is not specified, returns the current shape accessor.
|
|
2884
2884
|
@param {Function|String} [*value* = "Rect"]
|
|
2885
2885
|
@chainable
|
|
2886
|
-
*/shape(t){return arguments.length?(this._shape="function"==typeof t?t:
|
|
2886
|
+
*/shape(t){return arguments.length?(this._shape="function"==typeof t?t:Bt(t),this):this._shape}
|
|
2887
2887
|
/**
|
|
2888
2888
|
@memberof Legend
|
|
2889
2889
|
@desc If *config* is specified, sets the methods that correspond to the key/value pairs for each shape and returns the current class instance. If *config* is not specified, returns the current shape configuration.
|
|
@@ -2918,7 +2918,7 @@ return this._shapes=[],["Circle","Rect"].forEach(n=>{this._shapes.push((new kc[n
|
|
|
2918
2918
|
@memberof Legend
|
|
2919
2919
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
2920
2920
|
@private
|
|
2921
|
-
*/constructor(){super(),this._titleClass=new
|
|
2921
|
+
*/constructor(){super(),this._titleClass=new Ic,this._align="center",this._data=[],this._direction="row",this._duration=600,this._height=200,this._id=p("id"),this._label=p("id"),this._lineData=[],this._outerBounds={width:0,height:0,x:0,y:0},this._padding=5,this._shape=Bt("Rect"),this._shapes=[],this._shapeConfig={fill:p("color"),height:Bt(12),hitArea:(t,n)=>{var n=this._lineData[n],e=Ot([n.height,n.shapeHeight]);return{width:n.width+n.shapeWidth,height:e,x:-n.shapeWidth/2,y:-e/2}},labelBounds:(t,n)=>{n=this._lineData[n];let e=n.shapeWidth/2;"Circle"===n.shape&&(e-=n.shapeR/2);var i=Ot([n.shapeHeight,n.height]),a=this._rtl?n.shapeWidth+n.width+2*this._padding:0;return{width:n.width,height:i,x:e+5-a,y:-i/2}},labelConfig:{fontColor:Bt(Rh.dark),fontFamily:this._titleClass.fontFamily(),fontResize:!1,fontSize:Bt(10),verticalAlign:"middle"},opacity:1,r:Bt(6),width:Bt(12),x:(t,n)=>{var e=this._lineData[n];let i=e.y;var a="left"===this._align||"right"===this._align&&"column"===this._direction?0:"center"===this._align?(this._outerBounds.width-this._rowWidth(this._lineData.filter(t=>i===t.y)))/2:this._outerBounds.width-this._rowWidth(this._lineData.filter(t=>i===t.y)),n=this._lineData.slice(0,n).filter(t=>i===t.y),r=this._rtl?e.width+this._padding:0;return this._rowWidth(n)+this._padding*(n.length?e.sentence?2:1:0)+this._outerBounds.x+e.shapeWidth/2+a+r},y:(t,n)=>{let e=this._lineData[n];return e.y+this._titleHeight+this._outerBounds.y+Ot(this._lineData.filter(t=>e.y===t.y).map(t=>t.height).concat(this._data.map((t,n)=>this._fetchConfig("height",t,n))))/2}},this._titleConfig={fontSize:12},this._verticalAlign="middle",this._width=400}}class jc extends Li{
|
|
2922
2922
|
/**
|
|
2923
2923
|
@memberof ColorScale
|
|
2924
2924
|
@desc Renders the current ColorScale to the page. If a *callback* is specified, it will be called once the ColorScale is done drawing.
|
|
@@ -2926,7 +2926,7 @@ return this._shapes=[],["Circle","Rect"].forEach(n=>{this._shapes.push((new kc[n
|
|
|
2926
2926
|
@chainable
|
|
2927
2927
|
*/render(t){void 0===this._select&&this.select(H("body").append("svg").attr("width",this._width+"px").attr("height",this._height+"px").node());var s=["bottom","top"].includes(this._orient),l=s?"height":"width",h=s?"width":"height",u=s?"x":"y",c=s?"y":"x";
|
|
2928
2928
|
// Shape <g> Group
|
|
2929
|
-
this._group=Pt("g.d3plus-ColorScale",{parent:this._select});let i=this._data.map(this._value).filter(t=>null!==t&&"number"==typeof t).sort((t,n)=>t-n);var g=this._domain||Hi(i);let n=g[0]<this._midpoint;var d=g[1]>this._midpoint,f=n&&d;let r=Dt([this._buckets instanceof Array?this._buckets.length:this._buckets,f&&"jenks"!==this._scale?2*Math.floor(uu(i).length/2)-1:uu(i).length]),p=f&&(!this._color||this._color instanceof Array&&!this._color.includes(this._colorMid))?void 0:this._color,_,m;if(!p||p instanceof Array||(p=jt(0,r,1).map(t=>Kh(p,(t+1)/r)).reverse()),"jenks"===this._scale){var y=Dt([p?p.length:r,r,i.length]);let t=[];m=this._buckets instanceof Array?this._buckets:(t=f&&this._centered?(b=Math.floor(y/2),o=y%2,x=(k=
|
|
2929
|
+
this._group=Pt("g.d3plus-ColorScale",{parent:this._select});let i=this._data.map(this._value).filter(t=>null!==t&&"number"==typeof t).sort((t,n)=>t-n);var g=this._domain||Hi(i);let n=g[0]<this._midpoint;var d=g[1]>this._midpoint,f=n&&d;let r=Dt([this._buckets instanceof Array?this._buckets.length:this._buckets,f&&"jenks"!==this._scale?2*Math.floor(uu(i).length/2)-1:uu(i).length]),p=f&&(!this._color||this._color instanceof Array&&!this._color.includes(this._colorMid))?void 0:this._color,_,m;if(!p||p instanceof Array||(p=jt(0,r,1).map(t=>Kh(p,(t+1)/r)).reverse()),"jenks"===this._scale){var y=Dt([p?p.length:r,r,i.length]);let t=[];m=this._buckets instanceof Array?this._buckets:(t=f&&this._centered?(b=Math.floor(y/2),o=y%2,x=(k=Ii(v=i.filter(t=>t<this._midpoint)))<(S=Ii(w=i.concat(this._midpoint).filter(t=>t>=this._midpoint)))?1:0,S=_u(v,Dt([b+o*(S<k?1:0),v.length])),k=_u(w,Dt([b+o*x,w.length])),S.concat(k)):_u(i,y)).map(t=>t[0]);var v=new Set(m);if(m.length!==v.size&&(_=Array.from(v)),!p)if(f){p=[this._colorMin,this._colorMid,this._colorMax];let e=m.slice(0,y).filter((t,n)=>t<this._midpoint&&m[n+1]<=this._midpoint);var b=m.slice(0,y).filter((t,n)=>t<=this._midpoint&&m[n+1]>this._midpoint);let i=m.slice(0,y).filter(t=>t>this._midpoint);var o=e.map((t,n)=>n?Kh(p[0],n/e.length):p[0]),x=b.map(()=>p[1]),w=i.map((t,n)=>n===i.length-1?p[2]:Kh(p[2],1-(n+1)/i.length));p=o.concat(x).concat(w)}else p=jt(0,r,1).map(t=>Kh(this._colorMax,t/r)).reverse();p=[(p=m.length<=y?p.slice(-m.length):p)[0]].concat(p),this._colorScale=gr().domain(m).range(p)}else{let a=this._buckets instanceof Array?this._buckets:void 0;if(f&&!p){let n=Math.floor(r/2),e=Vn.gamma(2.2)(this._colorMin,this._colorMid);var S=jt(0,n,1).map(t=>e(t/n)),k=(r%2?[0]:[]).map(()=>this._colorMid);let i=Vn.gamma(2.2)(this._colorMax,this._colorMid);var v=jt(0,n,1).map(t=>i(t/n)).reverse();p=S.concat(k).concat(v),a||(b=(p.length-1)/2,a=[g[0],this._midpoint,g[1]],a=jt(g[0],this._midpoint,-(g[0]-this._midpoint)/b).concat(jt(this._midpoint,g[1],(g[1]-this._midpoint)/b)).concat([g[1]]))}else p||("buckets"===this._scale||"quantile"===this._scale?(p=jt(0,r,1).map(t=>Kh(n?this._colorMin:this._colorMax,t/r)),d&&(p=p.reverse())):p=n?[this._colorMin,Kh(this._colorMin,.8)]:[Kh(this._colorMax,.8),this._colorMax]),a=a||("quantile"===this._scale?jt(0,1+(o=1/(p.length-1))/2,o).map(t=>aa(i,t)):f&&this._color&&this._centered?(x=p.indexOf(this._colorMid),w=(this._midpoint-g[0])/x,y=(g[1]-this._midpoint)/(p.length-x),S=jt(g[0],this._midpoint,w),k=jt(this._midpoint,g[1]+y/2,y),S.concat(k)):(v=(g[1]-g[0])/(p.length-1),jt(g[0],g[1]+v/2,v)));if("buckets"===this._scale||"quantile"===this._scale)m=a,p=[p[0]].concat(p);else if("log"===this._scale){b=a.filter(t=>t<0);if(b.length){let n=b[0],e=b.map(t=>-Math.pow(Math.abs(n),t/n));b.forEach((t,n)=>{a[a.indexOf(t)]=e[n]})}d=a.filter(t=>0<t);if(d.length){let n=d[d.length-1],e=d.map(t=>Math.pow(n,t/n));d.forEach((t,n)=>{a[a.indexOf(t)]=e[n]})}a.includes(0)&&(a[a.indexOf(0)]=1)}this._colorScale=("buckets"===this._scale||"quantile"===this._scale?gr:$a)().domain(a).range(p)}this._colorScale.clamp&&this._colorScale.clamp(!0);o=this._bucketAxis||!["buckets","jenks","quantile"].includes(this._scale),f=ke().duration(this._duration),x={enter:{opacity:0},exit:{opacity:0},parent:this._group,transition:f,update:{opacity:1}},w=Pt("g.d3plus-ColorScale-labels",Object.assign({condition:o},x)),y=Pt("g.d3plus-ColorScale-Rect",Object.assign({condition:o},x)),S=Pt("g.d3plus-ColorScale-legend",Object.assign({condition:!o},x));if(o){k={x:0,y:0};let e=g.slice();this._bucketAxis&&(v=e[e.length-1],b=e[e.length-2],f=1<=(d=v?v/10:b/10)||d<=-1?Math.round(d).toString().length-1:-1*d.toString().split(".")[1].replace(/([1-9])[1-9].*$/,"$1").length,g=Math.pow(10,f),e[e.length-1]=v+g);b=Et({domain:s?e:e.slice().reverse(),duration:this._duration,height:this._height,labels:_||m,orient:this._orient,padding:this._padding,scale:"log"===this._scale?"log":"linear",ticks:m,width:this._width},this._axisConfig),d=Et({height:this["_"+l]/2,width:this["_"+h]/2},this._labelConfig),f=(this._labelClass.config(d),[]),v=(s&&this._labelMin&&((v={"font-family":this._labelClass.fontFamily()(this._labelMin),"font-size":this._labelClass.fontSize()(this._labelMin),"font-weight":this._labelClass.fontWeight()(this._labelMin)})["font-family"]instanceof Array&&(v["font-family"]=v["font-family"][0]),g=Ae(this._labelMin,v))&&g<this["_"+h]/2&&(f.push(this._labelMin),g+=this._padding,s&&(k.x+=g),b[h]-=g),s&&this._labelMax&&((v={"font-family":this._labelClass.fontFamily()(this._labelMax),"font-size":this._labelClass.fontSize()(this._labelMax),"font-weight":this._labelClass.fontWeight()(this._labelMax)})["font-family"]instanceof Array&&(v["font-family"]=v["font-family"][0]),g=Ae(this._labelMax,v))&&g<this["_"+h]/2&&(f.push(this._labelMax),g+=this._padding,s||(k.y+=g),b[h]-=g),this._axisTest.select(Pt("g.d3plus-ColorScale-axisTest",{enter:{opacity:0},parent:this._group}).node()).config(b).duration(0).render(),this._axisTest.outerBounds()),g=(this._outerBounds[h]=this["_"+h]-2*this._padding,this._outerBounds[l]=v[l]+this._size,this._outerBounds[u]=this._padding,this._outerBounds[c]=this._padding,"middle"===this._align?this._outerBounds[c]=(this["_"+l]-this._outerBounds[l])/2:"end"===this._align&&(this._outerBounds[c]=this["_"+l]-this._padding-this._outerBounds[l]),this._outerBounds[c]+(["bottom","right"].includes(this._orient)?this._size:0)-(b.padding||this._axisClass.padding())),g=`translate(${k.x+(s?0:g)}, ${k.y+(s?g:0)})`;this._axisClass.select(Pt("g.d3plus-ColorScale-axis",Et(x,{condition:!0,enter:{transform:g},update:{transform:g}})).node()).config(b).align("start").render();let i=this._axisTest._getPosition.bind(this._axisTest);g=this._axisTest._getRange();let t=this._group.selectAll("defs").data([0]);b=t.enter().append("defs"),b=(b.append("linearGradient").attr("id","gradient-"+this._uuid),(t=b.merge(t)).select("linearGradient").attr(u+"1",s?"0%":"100%").attr(u+"2",s?"100%":"0%").attr(c+"1","0%").attr(c+"2","0%"),t.select("linearGradient").selectAll("stop").data(p));let a=this._colorScale.domain(),r=$a().domain(g).range(s?[0,100]:[100,0]),o=(b.enter().append("stop").merge(b).attr("offset",(t,n)=>`${n<=a.length-1?r(i(a[n])):100}%`).attr("stop-color",String),(t,n)=>{n=m[n+1]||e[e.length-1];return Math.abs(i(n)-i(t))}),n=Et({duration:this._duration,fill:m?t=>this._colorScale(t):`url(#gradient-${this._uuid})`,[u]:m?(t,n)=>i(t)+o(t,n)/2-(["left","right"].includes(this._orient)?o(t,n):0):g[0]+(g[1]-g[0])/2+k[u],[c]:this._outerBounds[c]+(["top","left"].includes(this._orient)?v[l]:0)+this._size/2+k[c],[h]:m?o:g[1]-g[0],[l]:this._size},this._rectConfig);this._rectClass.data(m||[0]).id((t,n)=>n).select(y.node()).config(n).render(),d.height=this._outerBounds[l],d.width=this._outerBounds[h],this._labelClass.config(d).data(f).select(w.node()).x(t=>t===this._labelMax?n.x+n.width/2+this._padding:this._outerBounds.x).y(t=>n.y-this._labelClass.fontSize()(t)/2).text(t=>t).rotate(s?0:"right"===this._orient?90:-90).render()}else{Pt("g.d3plus-ColorScale-axis",Object.assign({condition:o},x));let t=m.reduce((t,n,e)=>{n=this._bucketFormat.bind(this)(n,e,m,i);return t.push({color:p[e+1],id:n}),t},[]);s||(t=t.reverse());b=Et({align:s?"center":{start:"left",middle:"center",end:"right"}[this._align],direction:s?"row":"column",duration:this._duration,height:this._height,padding:this._padding,shapeConfig:Et({duration:this._duration},this._axisConfig.shapeConfig||{}),title:this._axisConfig.title,titleConfig:this._axisConfig.titleConfig||{},width:this._width,verticalAlign:s?{start:"top",middle:"middle",end:"bottom"}[this._align]:"middle"},this._legendConfig);this._legendClass.data(t).select(S.node()).config(b).render(),this._outerBounds=this._legendClass.outerBounds()}return t&&setTimeout(t,this._duration+100),this}
|
|
2930
2930
|
/**
|
|
2931
2931
|
@memberof ColorScale
|
|
2932
2932
|
@desc The [ColorScale](http://d3plus.org/docs/#ColorScale) is constructed by combining an [Axis](http://d3plus.org/docs/#Axis) for the ticks/labels and a [Rect](http://d3plus.org/docs/#Rect) for the actual color box (or multiple boxes, as in a jenks scale). Because of this, there are separate configs for the [Axis](http://d3plus.org/docs/#Axis) class used to display the text ([axisConfig](http://d3plus.org/docs/#ColorScale.axisConfig)) and the [Rect](http://d3plus.org/docs/#Rect) class used to draw the color breaks ([rectConfig](http://d3plus.org/docs/#ColorScale.rectConfig)). This method acts as a pass-through to the config method of the [Axis](http://d3plus.org/docs/#Axis). An example usage of this method can be seen [here](http://d3plus.org/examples/d3plus-legend/colorScale-dark/).
|
|
@@ -3098,7 +3098,7 @@ this._group=Pt("g.d3plus-ColorScale",{parent:this._select});let i=this._data.map
|
|
|
3098
3098
|
function value(d) {
|
|
3099
3099
|
return d.value;
|
|
3100
3100
|
}
|
|
3101
|
-
*/value(t){return arguments.length?(this._value="function"==typeof t?t:
|
|
3101
|
+
*/value(t){return arguments.length?(this._value="function"==typeof t?t:Bt(t),this):this._value}
|
|
3102
3102
|
/**
|
|
3103
3103
|
@memberof ColorScale
|
|
3104
3104
|
@desc If *value* is specified, sets the overall width of the ColorScale and returns the current class instance. If *value* is not specified, returns the current width value.
|
|
@@ -3109,7 +3109,7 @@ this._group=Pt("g.d3plus-ColorScale",{parent:this._select});let i=this._data.map
|
|
|
3109
3109
|
@memberof ColorScale
|
|
3110
3110
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
3111
3111
|
@private
|
|
3112
|
-
*/constructor(){super(),this._axisClass=new Nc,this._axisConfig={gridSize:0},this._axisTest=new Nc,this._align="middle",this._buckets=5,this._bucketAxis=!1,this._bucketFormat=(n,t,e,i)=>{var a=this._axisConfig.tickFormat||Hu;let r=e[t+1];var o=!!t&&e[t-1],e=t===e.length-1;return n===r||e?(e=e&&n<Ot(i)?"+":"",a(n)+e):(e=1<=(e=r?r/100:n/100)||e<=-1?Math.round(e).toString().length-1:-1*e.toString().split(".")[1].replace(/([1-9])[1-9].*$/,"$1").length,e=Math.pow(10,e),o=a(o===n&&1===t?Dt([n+e,i.find(t=>n<t&&t<r)]):n),a=a(n&&1===t?r:Ot([r-e,i.reverse().find(t=>n<t&&t<r)])),this._bucketJoiner(o,a))},this._bucketJoiner=(t,n)=>t!==n?t+" - "+n:""+t,this._centered=!0,this._color=["#54478C","#2C699A","#0DB39E","#83E377","#EFEA5A"],this._colorMax=Rh.on,this._colorMid=Rh.light,this._colorMin=Rh.off,this._data=[],this._duration=600,this._height=200,this._labelClass=new
|
|
3112
|
+
*/constructor(){super(),this._axisClass=new Nc,this._axisConfig={gridSize:0},this._axisTest=new Nc,this._align="middle",this._buckets=5,this._bucketAxis=!1,this._bucketFormat=(n,t,e,i)=>{var a=this._axisConfig.tickFormat||Hu;let r=e[t+1];var o=!!t&&e[t-1],e=t===e.length-1;return n===r||e?(e=e&&n<Ot(i)?"+":"",a(n)+e):(e=1<=(e=r?r/100:n/100)||e<=-1?Math.round(e).toString().length-1:-1*e.toString().split(".")[1].replace(/([1-9])[1-9].*$/,"$1").length,e=Math.pow(10,e),o=a(o===n&&1===t?Dt([n+e,i.find(t=>n<t&&t<r)]):n),a=a(n&&1===t?r:Ot([r-e,i.reverse().find(t=>n<t&&t<r)])),this._bucketJoiner(o,a))},this._bucketJoiner=(t,n)=>t!==n?t+" - "+n:""+t,this._centered=!0,this._color=["#54478C","#2C699A","#0DB39E","#83E377","#EFEA5A"],this._colorMax=Rh.on,this._colorMid=Rh.light,this._colorMin=Rh.off,this._data=[],this._duration=600,this._height=200,this._labelClass=new Ic,this._labelConfig={fontColor:Rh.dark,fontSize:12},this._legendClass=new Dc,this._legendConfig={shapeConfig:{stroke:Rh.dark,strokeWidth:1}},this._midpoint=0,this._orient="bottom",this._outerBounds={width:0,height:0,x:0,y:0},this._padding=5,this._rectClass=(new mc).parent(this),this._rectConfig={stroke:"#999",strokeWidth:1},this._scale="linear",this._size=10,this._value=p("value"),this._width=400}}class Rc{
|
|
3113
3113
|
/**
|
|
3114
3114
|
@memberof Message
|
|
3115
3115
|
@desc Removes the message from the page.
|
|
@@ -3130,7 +3130,7 @@ this._group=Pt("g.d3plus-ColorScale",{parent:this._select});let i=this._data.map
|
|
|
3130
3130
|
@memberof Message
|
|
3131
3131
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
3132
3132
|
@private
|
|
3133
|
-
*/constructor(){this._isVisible=!1}}let
|
|
3133
|
+
*/constructor(){this._isVisible=!1}}let Fc={i:"font-style: italic;",em:"font-style: italic;",b:"font-weight: bold;",strong:"font-weight: bold;"};class Ic extends Li{
|
|
3134
3134
|
/**
|
|
3135
3135
|
@memberof TextBox
|
|
3136
3136
|
@desc Renders the text boxes. If a *callback* is specified, it will be called once the shapes are done drawing.
|
|
@@ -3161,7 +3161,7 @@ var n=new RegExp(/<([A-z]+)[^>]*>([^<^>]+)<\/[^>]+>/g);return t.match(n)?t=t.rep
|
|
|
3161
3161
|
@desc If *value* is specified, sets the aria-hidden attribute to the specified function or string and returns the current class instance.
|
|
3162
3162
|
@param {Function|String} *value*
|
|
3163
3163
|
@chainable
|
|
3164
|
-
*/ariaHidden(t){return void 0!==t?(this._ariaHidden="function"==typeof t?t:
|
|
3164
|
+
*/ariaHidden(t){return void 0!==t?(this._ariaHidden="function"==typeof t?t:Bt(t),this):this._ariaHidden}
|
|
3165
3165
|
/**
|
|
3166
3166
|
@memberof TextBox
|
|
3167
3167
|
@desc Sets the data array to the specified array. A text box will be drawn for each object in the array.
|
|
@@ -3189,67 +3189,67 @@ var n=new RegExp(/<([A-z]+)[^>]*>([^<^>]+)<\/[^>]+>/g);return t.match(n)?t=t.rep
|
|
|
3189
3189
|
function(text, line) {
|
|
3190
3190
|
return line ? text.replace(/\.|,$/g, "") + "..." : "";
|
|
3191
3191
|
}
|
|
3192
|
-
*/ellipsis(t){return arguments.length?(this._ellipsis="function"==typeof t?t:
|
|
3192
|
+
*/ellipsis(t){return arguments.length?(this._ellipsis="function"==typeof t?t:Bt(t),this):this._ellipsis}
|
|
3193
3193
|
/**
|
|
3194
3194
|
@memberof TextBox
|
|
3195
3195
|
@desc Sets the font color to the specified accessor function or static string, which is inferred from the [DOM selection](#textBox.select) by default.
|
|
3196
3196
|
@param {Function|String} [*value* = "black"]
|
|
3197
3197
|
@chainable
|
|
3198
|
-
*/fontColor(t){return arguments.length?(this._fontColor="function"==typeof t?t:
|
|
3198
|
+
*/fontColor(t){return arguments.length?(this._fontColor="function"==typeof t?t:Bt(t),this):this._fontColor}
|
|
3199
3199
|
/**
|
|
3200
3200
|
@memberof TextBox
|
|
3201
3201
|
@desc Defines the font-family to be used. The value passed can be either a *String* name of a font, a comma-separated list of font-family fallbacks, an *Array* of fallbacks, or a *Function* that returns either a *String* or an *Array*. If supplying multiple fallback fonts, the [fontExists](#fontExists) function will be used to determine the first available font on the client's machine.
|
|
3202
3202
|
@param {Array|Function|String} [*value* = ["Inter", "Helvetica Neue", "HelveticaNeue", "Helvetica", "Arial", "sans-serif"]]
|
|
3203
3203
|
@chainable
|
|
3204
|
-
*/fontFamily(t){return arguments.length?(this._fontFamily="function"==typeof t?t:
|
|
3204
|
+
*/fontFamily(t){return arguments.length?(this._fontFamily="function"==typeof t?t:Bt(t),this):this._fontFamily}
|
|
3205
3205
|
/**
|
|
3206
3206
|
@memberof TextBox
|
|
3207
3207
|
@desc Sets the maximum font size to the specified accessor function or static number (which corresponds to pixel units), which is used when [dynamically resizing fonts](#textBox.fontResize).
|
|
3208
3208
|
@param {Function|Number} [*value* = 50]
|
|
3209
3209
|
@chainable
|
|
3210
|
-
*/fontMax(t){return arguments.length?(this._fontMax="function"==typeof t?t:
|
|
3210
|
+
*/fontMax(t){return arguments.length?(this._fontMax="function"==typeof t?t:Bt(t),this):this._fontMax}
|
|
3211
3211
|
/**
|
|
3212
3212
|
@memberof TextBox
|
|
3213
3213
|
@desc Sets the minimum font size to the specified accessor function or static number (which corresponds to pixel units), which is used when [dynamically resizing fonts](#textBox.fontResize).
|
|
3214
3214
|
@param {Function|Number} [*value* = 8]
|
|
3215
3215
|
@chainable
|
|
3216
|
-
*/fontMin(t){return arguments.length?(this._fontMin="function"==typeof t?t:
|
|
3216
|
+
*/fontMin(t){return arguments.length?(this._fontMin="function"==typeof t?t:Bt(t),this):this._fontMin}
|
|
3217
3217
|
/**
|
|
3218
3218
|
@memberof TextBox
|
|
3219
3219
|
@desc Sets the font opacity to the specified accessor function or static number between 0 and 1.
|
|
3220
3220
|
@param {Function|Number} [*value* = 1]
|
|
3221
3221
|
@chainable
|
|
3222
|
-
*/fontOpacity(t){return arguments.length?(this._fontOpacity="function"==typeof t?t:
|
|
3222
|
+
*/fontOpacity(t){return arguments.length?(this._fontOpacity="function"==typeof t?t:Bt(t),this):this._fontOpacity}
|
|
3223
3223
|
/**
|
|
3224
3224
|
@memberof TextBox
|
|
3225
3225
|
@desc Toggles font resizing, which can either be defined as a static boolean for all data points, or an accessor function that returns a boolean. See [this example](http://d3plus.org/examples/d3plus-text/resizing-text/) for a side-by-side comparison.
|
|
3226
3226
|
@param {Function|Boolean} [*value* = false]
|
|
3227
3227
|
@chainable
|
|
3228
|
-
*/fontResize(t){return arguments.length?(this._fontResize="function"==typeof t?t:
|
|
3228
|
+
*/fontResize(t){return arguments.length?(this._fontResize="function"==typeof t?t:Bt(t),this):this._fontResize}
|
|
3229
3229
|
/**
|
|
3230
3230
|
@memberof TextBox
|
|
3231
3231
|
@desc Sets the font size to the specified accessor function or static number (which corresponds to pixel units), which is inferred from the [DOM selection](#textBox.select) by default.
|
|
3232
3232
|
@param {Function|Number} [*value* = 10]
|
|
3233
3233
|
@chainable
|
|
3234
|
-
*/fontSize(t){return arguments.length?(this._fontSize="function"==typeof t?t:
|
|
3234
|
+
*/fontSize(t){return arguments.length?(this._fontSize="function"==typeof t?t:Bt(t),this):this._fontSize}
|
|
3235
3235
|
/**
|
|
3236
3236
|
@memberof TextBox
|
|
3237
3237
|
@desc Sets the font stroke color for the rendered text.
|
|
3238
3238
|
@param {Function|String} [*value* = "transparent"]
|
|
3239
3239
|
@chainable
|
|
3240
|
-
*/fontStroke(t){return arguments.length?(this._fontStroke="function"==typeof t?t:
|
|
3240
|
+
*/fontStroke(t){return arguments.length?(this._fontStroke="function"==typeof t?t:Bt(t),this):this._fontStroke}
|
|
3241
3241
|
/**
|
|
3242
3242
|
@memberof TextBox
|
|
3243
3243
|
@desc Sets the font stroke width for the rendered text.
|
|
3244
3244
|
@param {Function|Number} [*value* = 0]
|
|
3245
3245
|
@chainable
|
|
3246
|
-
*/fontStrokeWidth(t){return arguments.length?(this._fontStrokeWidth="function"==typeof t?t:
|
|
3246
|
+
*/fontStrokeWidth(t){return arguments.length?(this._fontStrokeWidth="function"==typeof t?t:Bt(t),this):this._fontStrokeWidth}
|
|
3247
3247
|
/**
|
|
3248
3248
|
@memberof TextBox
|
|
3249
3249
|
@desc Sets the font weight to the specified accessor function or static number, which is inferred from the [DOM selection](#textBox.select) by default.
|
|
3250
3250
|
@param {Function|Number|String} [*value* = 400]
|
|
3251
3251
|
@chainable
|
|
3252
|
-
*/fontWeight(t){return arguments.length?(this._fontWeight="function"==typeof t?t:
|
|
3252
|
+
*/fontWeight(t){return arguments.length?(this._fontWeight="function"==typeof t?t:Bt(t),this):this._fontWeight}
|
|
3253
3253
|
/**
|
|
3254
3254
|
@memberof TextBox
|
|
3255
3255
|
@desc Sets the height for each box to the specified accessor function or static number.
|
|
@@ -3259,7 +3259,7 @@ var n=new RegExp(/<([A-z]+)[^>]*>([^<^>]+)<\/[^>]+>/g);return t.match(n)?t=t.rep
|
|
|
3259
3259
|
function(d) {
|
|
3260
3260
|
return d.height || 200;
|
|
3261
3261
|
}
|
|
3262
|
-
*/height(t){return arguments.length?(this._height="function"==typeof t?t:
|
|
3262
|
+
*/height(t){return arguments.length?(this._height="function"==typeof t?t:Bt(t),this):this._height}
|
|
3263
3263
|
/**
|
|
3264
3264
|
@memberof TextBox
|
|
3265
3265
|
@desc Configures the ability to render simple HTML tags. Defaults to supporting `<b>`, `<strong>`, `<i>`, and `<em>`, set to false to disable or provide a mapping of tags to svg styles
|
|
@@ -3270,7 +3270,7 @@ var n=new RegExp(/<([A-z]+)[^>]*>([^<^>]+)<\/[^>]+>/g);return t.match(n)?t=t.rep
|
|
|
3270
3270
|
strong: 'font-weight: bold;'
|
|
3271
3271
|
}]
|
|
3272
3272
|
@chainable
|
|
3273
|
-
*/html(t){return arguments.length?(this._html="boolean"==typeof t?!!t&&
|
|
3273
|
+
*/html(t){return arguments.length?(this._html="boolean"==typeof t?!!t&&Fc:t,this):this._html}
|
|
3274
3274
|
/**
|
|
3275
3275
|
@memberof TextBox
|
|
3276
3276
|
@desc Defines the unique id for each box to the specified accessor function or static number.
|
|
@@ -3280,49 +3280,49 @@ var n=new RegExp(/<([A-z]+)[^>]*>([^<^>]+)<\/[^>]+>/g);return t.match(n)?t=t.rep
|
|
|
3280
3280
|
function(d, i) {
|
|
3281
3281
|
return d.id || i + "";
|
|
3282
3282
|
}
|
|
3283
|
-
*/id(t){return arguments.length?(this._id="function"==typeof t?t:
|
|
3283
|
+
*/id(t){return arguments.length?(this._id="function"==typeof t?t:Bt(t),this):this._id}
|
|
3284
3284
|
/**
|
|
3285
3285
|
@memberof TextBox
|
|
3286
3286
|
@desc Sets the line height to the specified accessor function or static number, which is 1.2 times the [font size](#textBox.fontSize) by default.
|
|
3287
3287
|
@param {Function|Number} [*value*]
|
|
3288
3288
|
@chainable
|
|
3289
|
-
*/lineHeight(t){return arguments.length?(this._lineHeight="function"==typeof t?t:
|
|
3289
|
+
*/lineHeight(t){return arguments.length?(this._lineHeight="function"==typeof t?t:Bt(t),this):this._lineHeight}
|
|
3290
3290
|
/**
|
|
3291
3291
|
@memberof TextBox
|
|
3292
3292
|
@desc Restricts the maximum number of lines to wrap onto, which is null (unlimited) by default.
|
|
3293
3293
|
@param {Function|Number} [*value*]
|
|
3294
3294
|
@chainable
|
|
3295
|
-
*/maxLines(t){return arguments.length?(this._maxLines="function"==typeof t?t:
|
|
3295
|
+
*/maxLines(t){return arguments.length?(this._maxLines="function"==typeof t?t:Bt(t),this):this._maxLines}
|
|
3296
3296
|
/**
|
|
3297
3297
|
@memberof TextBox
|
|
3298
3298
|
@desc Sets the text overflow to the specified accessor function or static boolean.
|
|
3299
3299
|
@param {Function|Boolean} [*value* = false]
|
|
3300
3300
|
@chainable
|
|
3301
|
-
*/overflow(t){return arguments.length?(this._overflow="function"==typeof t?t:
|
|
3301
|
+
*/overflow(t){return arguments.length?(this._overflow="function"==typeof t?t:Bt(t),this):this._overflow}
|
|
3302
3302
|
/**
|
|
3303
3303
|
@memberof TextBox
|
|
3304
3304
|
@desc Sets the padding to the specified accessor function, CSS shorthand string, or static number, which is 0 by default.
|
|
3305
3305
|
@param {Function|Number|String} [*value*]
|
|
3306
3306
|
@chainable
|
|
3307
|
-
*/padding(t){return arguments.length?(this._padding="function"==typeof t?t:
|
|
3307
|
+
*/padding(t){return arguments.length?(this._padding="function"==typeof t?t:Bt(t),this):this._padding}
|
|
3308
3308
|
/**
|
|
3309
3309
|
@memberof TextBox
|
|
3310
3310
|
@desc Sets the pointer-events to the specified accessor function or static string.
|
|
3311
3311
|
@param {Function|String} [*value* = "auto"]
|
|
3312
3312
|
@chainable
|
|
3313
|
-
*/pointerEvents(t){return arguments.length?(this._pointerEvents="function"==typeof t?t:
|
|
3313
|
+
*/pointerEvents(t){return arguments.length?(this._pointerEvents="function"==typeof t?t:Bt(t),this):this._pointerEvents}
|
|
3314
3314
|
/**
|
|
3315
3315
|
@memberof TextBox
|
|
3316
3316
|
@desc Sets the rotate percentage for each box to the specified accessor function or static string.
|
|
3317
3317
|
@param {Function|Number} [*value* = 0]
|
|
3318
3318
|
@chainable
|
|
3319
|
-
*/rotate(t){return arguments.length?(this._rotate="function"==typeof t?t:
|
|
3319
|
+
*/rotate(t){return arguments.length?(this._rotate="function"==typeof t?t:Bt(t),this):this._rotate}
|
|
3320
3320
|
/**
|
|
3321
3321
|
@memberof TextBox
|
|
3322
3322
|
@desc Sets the anchor point around which to rotate the text box.
|
|
3323
3323
|
@param {Function|Number[]}
|
|
3324
3324
|
@chainable
|
|
3325
|
-
*/rotateAnchor(t){return arguments.length?(this._rotateAnchor="function"==typeof t?t:
|
|
3325
|
+
*/rotateAnchor(t){return arguments.length?(this._rotateAnchor="function"==typeof t?t:Bt(t),this):this._rotateAnchor}
|
|
3326
3326
|
/**
|
|
3327
3327
|
@memberof TextBox
|
|
3328
3328
|
@desc Sets the SVG container element to the specified d3 selector or DOM element. If not explicitly specified, an SVG element will be added to the page for use.
|
|
@@ -3344,19 +3344,19 @@ var n=new RegExp(/<([A-z]+)[^>]*>([^<^>]+)<\/[^>]+>/g);return t.match(n)?t=t.rep
|
|
|
3344
3344
|
function(d) {
|
|
3345
3345
|
return d.text;
|
|
3346
3346
|
}
|
|
3347
|
-
*/text(t){return arguments.length?(this._text="function"==typeof t?t:
|
|
3347
|
+
*/text(t){return arguments.length?(this._text="function"==typeof t?t:Bt(t),this):this._text}
|
|
3348
3348
|
/**
|
|
3349
3349
|
@memberof TextBox
|
|
3350
3350
|
@desc Sets the horizontal text anchor to the specified accessor function or static string, whose values are analagous to the SVG [text-anchor](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/text-anchor) property.
|
|
3351
3351
|
@param {Function|String} [*value* = "start"]
|
|
3352
3352
|
@chainable
|
|
3353
|
-
*/textAnchor(t){return arguments.length?(this._textAnchor="function"==typeof t?t:
|
|
3353
|
+
*/textAnchor(t){return arguments.length?(this._textAnchor="function"==typeof t?t:Bt(t),this):this._textAnchor}
|
|
3354
3354
|
/**
|
|
3355
3355
|
@memberof TextBox
|
|
3356
3356
|
@desc Sets the vertical alignment to the specified accessor function or static string. Accepts `"top"`, `"middle"`, and `"bottom"`.
|
|
3357
3357
|
@param {Function|String} [*value* = "top"]
|
|
3358
3358
|
@chainable
|
|
3359
|
-
*/verticalAlign(t){return arguments.length?(this._verticalAlign="function"==typeof t?t:
|
|
3359
|
+
*/verticalAlign(t){return arguments.length?(this._verticalAlign="function"==typeof t?t:Bt(t),this):this._verticalAlign}
|
|
3360
3360
|
/**
|
|
3361
3361
|
@memberof TextBox
|
|
3362
3362
|
@desc Sets the width for each box to the specified accessor function or static number.
|
|
@@ -3366,7 +3366,7 @@ var n=new RegExp(/<([A-z]+)[^>]*>([^<^>]+)<\/[^>]+>/g);return t.match(n)?t=t.rep
|
|
|
3366
3366
|
function(d) {
|
|
3367
3367
|
return d.width || 200;
|
|
3368
3368
|
}
|
|
3369
|
-
*/width(t){return arguments.length?(this._width="function"==typeof t?t:
|
|
3369
|
+
*/width(t){return arguments.length?(this._width="function"==typeof t?t:Bt(t),this):this._width}
|
|
3370
3370
|
/**
|
|
3371
3371
|
@memberof TextBox
|
|
3372
3372
|
@desc Sets the x position for each box to the specified accessor function or static number. The number given should correspond to the left side of the textBox.
|
|
@@ -3376,7 +3376,7 @@ var n=new RegExp(/<([A-z]+)[^>]*>([^<^>]+)<\/[^>]+>/g);return t.match(n)?t=t.rep
|
|
|
3376
3376
|
function(d) {
|
|
3377
3377
|
return d.x || 0;
|
|
3378
3378
|
}
|
|
3379
|
-
*/x(t){return arguments.length?(this._x="function"==typeof t?t:
|
|
3379
|
+
*/x(t){return arguments.length?(this._x="function"==typeof t?t:Bt(t),this):this._x}
|
|
3380
3380
|
/**
|
|
3381
3381
|
@memberof TextBox
|
|
3382
3382
|
@desc Sets the y position for each box to the specified accessor function or static number. The number given should correspond to the top side of the textBox.
|
|
@@ -3386,21 +3386,21 @@ var n=new RegExp(/<([A-z]+)[^>]*>([^<^>]+)<\/[^>]+>/g);return t.match(n)?t=t.rep
|
|
|
3386
3386
|
function(d) {
|
|
3387
3387
|
return d.y || 0;
|
|
3388
3388
|
}
|
|
3389
|
-
*/y(t){return arguments.length?(this._y="function"==typeof t?t:
|
|
3389
|
+
*/y(t){return arguments.length?(this._y="function"==typeof t?t:Bt(t),this):this._y}
|
|
3390
3390
|
/**
|
|
3391
3391
|
@memberof TextBox
|
|
3392
3392
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
3393
3393
|
@private
|
|
3394
|
-
*/constructor(){super(),this._ariaHidden=
|
|
3394
|
+
*/constructor(){super(),this._ariaHidden=Bt("false"),this._delay=0,this._duration=0,this._ellipsis=(t,n)=>n?t.replace(/\.|,$/g,"")+"...":"",this._fontColor=Bt("black"),this._fontFamily=Bt(Te),this._fontMax=Bt(50),this._fontMin=Bt(8),this._fontOpacity=Bt(1),this._fontResize=Bt(!1),this._fontSize=Bt(10),this._fontStroke=Bt("transparent"),this._fontStrokeWidth=Bt(0),this._fontWeight=Bt(400),this._height=p("height",200),this._html=Fc,this._id=(t,n)=>t.id||""+n,this._lineHeight=(t,n)=>1.2*this._fontSize(t,n),this._maxLines=Bt(null),this._on={},this._overflow=Bt(!1),this._padding=Bt(0),this._pointerEvents=Bt("auto"),this._rotate=Bt(0),this._rotateAnchor=t=>[t.w/2,t.h/2],this._split=ai,this._text=p("text"),this._textAnchor=Bt("start"),this._verticalAlign=Bt("top"),this._width=p("width",200),this._x=p("x",0),this._y=p("y",0)}}
|
|
3395
3395
|
// These are typically used in conjunction with noevent to ensure that we can
|
|
3396
3396
|
// preventDefault on the event.
|
|
3397
3397
|
let Hc={capture:!0,passive:!1};function Gc(t){t.preventDefault(),t.stopImmediatePropagation()}function Kc(t){var n=t.document.documentElement,t=H(t).on("dragstart.drag",Gc,Hc);"onselectstart"in n?t.on("selectstart.drag",Gc,Hc):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Uc(t,n){var e=t.document.documentElement,i=H(t).on("dragstart.drag",null);n&&(i.on("click.drag",Gc,Hc),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in e?i.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}var Wc=t=>()=>t;function qc(t,{sourceEvent:n,target:e,selection:i,mode:a,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},selection:{value:i,enumerable:!0,configurable:!0},mode:{value:a,enumerable:!0,configurable:!0},_:{value:r}})}function $c(t){t.preventDefault(),t.stopImmediatePropagation()}var Vc={name:"drag"},Yc={name:"space"},Zc={name:"handle"},Xc={name:"center"};let{abs:Jc,max:Qc,min:tg}=Math;function ng(t){return[+t[0],+t[1]]}function eg(t){return[ng(t[0]),ng(t[1])]}var ig={name:"x",handles:["w","e"].map(cg),input:function(t,n){return null==t?null:[[+t[0],n[0][1]],[+t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},ag={},rg={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(cg),input:function(t){return null==t?null:eg(t)},output:function(t){return t}},og={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},sg={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},lg={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},hg={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},ug={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function cg(t){return{type:t}}
|
|
3398
3398
|
// Ignore right-click, since that should open the context menu.
|
|
3399
3399
|
function gg(t){return!t.ctrlKey&&!t.button}function dg(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function fg(){return navigator.maxTouchPoints||"ontouchstart"in this}
|
|
3400
3400
|
// Like d3.local, but with the name “__brush” rather than auto-generated.
|
|
3401
|
-
function pg(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function _g(O){var D,n=dg,j=gg,e=fg,R=!0,a=xt("start","brush","end"),i=6;function r(t){var n=t.property("__brush",u).selectAll(".overlay").data([cg("overlay")]),n=(n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",og.overlay).merge(n).each(function(){var t=pg(this).extent;H(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])}),t.selectAll(".selection").data([cg("selection")]).enter().append("rect").attr("class","selection").attr("cursor",og.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges"),t.selectAll(".handle").data(O.handles,function(t){return t.type}));n.exit().remove(),n.enter().append("rect").attr("class",function(t){return"handle handle--"+t.type}).attr("cursor",function(t){return og[t.type]}),t.each(
|
|
3402
|
-
A&&(d=u[0][0],v=u[1][0]),z&&(_=u[0][1],w=u[1][1]),u[0][0]===d&&u[0][1]===_&&u[1][0]===v&&u[1][1]===w||(h.selection=[[d,_],[v,w]],
|
|
3403
|
-
(n=u)[0][0]!==n[1][0]&&n[0][1]!==n[1][1]||(h.selection=null,
|
|
3401
|
+
function pg(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function _g(O){var D,n=dg,j=gg,e=fg,R=!0,a=xt("start","brush","end"),i=6;function r(t){var n=t.property("__brush",u).selectAll(".overlay").data([cg("overlay")]),n=(n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",og.overlay).merge(n).each(function(){var t=pg(this).extent;H(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])}),t.selectAll(".selection").data([cg("selection")]).enter().append("rect").attr("class","selection").attr("cursor",og.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges"),t.selectAll(".handle").data(O.handles,function(t){return t.type}));n.exit().remove(),n.enter().append("rect").attr("class",function(t){return"handle handle--"+t.type}).attr("cursor",function(t){return og[t.type]}),t.each(F).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",s).filter(e).on("touchstart.brush",s).on("touchmove.brush",l).on("touchend.brush touchcancel.brush",h).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function F(){var t=H(this),n=pg(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",function(t){return"e"===t.type[t.type.length-1]?n[1][0]-i/2:n[0][0]-i/2}).attr("y",function(t){return"s"===t.type[0]?n[1][1]-i/2:n[0][1]-i/2}).attr("width",function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+i:i}).attr("height",function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+i:i})):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function I(t,n,e){var i=t.__brush.emitter;return!i||e&&i.clean?new o(t,n,e):i}function o(t,n,e){this.that=t,this.args=n,this.state=t.__brush,this.active=0,this.clean=e}function s(t){var r,a,o,s,l,h,u,c,g,d,f,p,_,m,y,v,b,x,w,S,k,C,M,A,z,T,E,n,e,N,i;function P(t){for(var n of t.changedTouches||[t])for(var e of T)e.identifier===n.identifier&&(e.cur=vt(n,r));var i,a;!M||A||z||1!==T.length||(i=T[0],Jc(i.cur[0]-i[0])>Jc(i.cur[1]-i[1])?z=!0:A=!0);for(a of T)a.cur&&(a[0]=a.cur[0],a[1]=a.cur[1]);C=!0,$c(t),L(t)}function L(t){var n,e=T[0],i=e.point0;switch(S=e[0]-i[0],k=e[1]-i[1],o){case Yc:case Vc:s&&(S=Qc(c-g,tg(m-y,S)),d=g+S,v=y+S),l&&(k=Qc(f-p,tg(b-x,k)),_=p+k,w=x+k);break;case Zc:T[1]?(s&&(d=Qc(c,tg(m,T[0][0])),v=Qc(c,tg(m,T[1][0])),s=1),l&&(_=Qc(f,tg(b,T[0][1])),w=Qc(f,tg(b,T[1][1])),l=1)):(s<0?(S=Qc(c-g,tg(m-g,S)),d=g+S,v=y):0<s&&(S=Qc(c-y,tg(m-y,S)),d=g,v=y+S),l<0?(k=Qc(f-p,tg(b-p,k)),_=p+k,w=x):0<l&&(k=Qc(f-x,tg(b-x,k)),_=p,w=x+k));break;case Xc:s&&(d=Qc(c,tg(m,g-S*s)),v=Qc(c,tg(m,y+S*s))),l&&(_=Qc(f,tg(b,p-k*l)),w=Qc(f,tg(b,x+k*l)))}v<d&&(s*=-1,n=g,g=y,y=n,n=d,d=v,v=n,a in sg)&&N.attr("cursor",og[a=sg[a]]),w<_&&(l*=-1,n=p,p=x,x=n,n=_,_=w,w=n,a in lg)&&N.attr("cursor",og[a=lg[a]]),h.selection&&(u=h.selection),// May be set by brush.move!
|
|
3402
|
+
A&&(d=u[0][0],v=u[1][0]),z&&(_=u[0][1],w=u[1][1]),u[0][0]===d&&u[0][1]===_&&u[1][0]===v&&u[1][1]===w||(h.selection=[[d,_],[v,w]],F.call(r),E.brush(t,o.name))}function B(t){if(t.stopImmediatePropagation(),t.touches){if(t.touches.length)return;D&&clearTimeout(D),D=setTimeout(function(){D=null},500)}else Uc(t.view,C),i.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);var n;e.attr("pointer-events","all"),N.attr("cursor",og.overlay),h.selection&&(u=h.selection),// May be set by brush.move (on start)!
|
|
3403
|
+
(n=u)[0][0]!==n[1][0]&&n[0][1]!==n[1][1]||(h.selection=null,F.call(r)),E.end(t,o.name)}D&&!t.touches||j.apply(this,arguments)&&(r=this,a=t.target.__data__.type,o="selection"===(R&&t.metaKey?a="overlay":a)?Vc:R&&t.altKey?Xc:Zc,s=O===ag?null:hg[a],l=O===ig?null:ug[a],n=(h=pg(r)).extent,u=h.selection,c=n[0][0],f=n[0][1],m=n[1][0],b=n[1][1],k=S=0,M=s&&l&&R&&t.shiftKey,T=Array.from(t.touches||[t],t=>{var n=t.identifier;return(t=vt(t,r)).point0=t.slice(),t.identifier=n,t}),cn(r),E=I(r,arguments,!0).beforestart(),"overlay"===a?(u&&(C=!0),n=[T[0],T[1]||T[0]],h.selection=u=[[g=O===ag?c:tg(n[0][0],n[1][0]),p=O===ig?f:tg(n[0][1],n[1][1])],[y=O===ag?m:Qc(n[0][0],n[1][0]),x=O===ig?b:Qc(n[0][1],n[1][1])]],1<T.length&&L(t)):(g=u[0][0],p=u[0][1],y=u[1][0],x=u[1][1]),d=g,_=p,v=y,w=x,e=H(r).attr("pointer-events","none"),N=e.selectAll(".overlay").attr("cursor",og[a]),t.touches?(E.moved=P,E.ended=B):(i=H(t.view).on("mousemove.brush",P,!0).on("mouseup.brush",B,!0),R&&i.on("keydown.brush",function(t){switch(t.keyCode){case 16:M=s&&l;break;case 18:o===Zc&&(s&&(y=v-S*s,g=d+S*s),l&&(x=w-k*l,p=_+k*l),o=Xc,L(t));break;case 32:o!==Zc&&o!==Xc||(s<0?y=v-S:0<s&&(g=d-S),l<0?x=w-k:0<l&&(p=_-k),o=Yc,N.attr("cursor",og.selection),L(t));break;default:return}$c(t)},!0).on("keyup.brush",function(t){switch(t.keyCode){case 16:M&&(A=z=M=!1,L(t));break;case 18:o===Xc&&(s<0?y=v:0<s&&(g=d),l<0?x=w:0<l&&(p=_),o=Zc,L(t));break;case 32:o===Yc&&(o=t.altKey?(s&&(y=v-S*s,g=d+S*s),l&&(x=w-k*l,p=_+k*l),Xc):(s<0?y=v:0<s&&(g=d),l<0?x=w:0<l&&(p=_),Zc),N.attr("cursor",og[a]),L(t));break;default:return}$c(t)},!0),Kc(t.view)),F.call(r),E.start(t,o.name))}function l(t){I(this,arguments).moved(t)}function h(t){I(this,arguments).ended(t)}function u(){var t=this.__brush||{selection:null};return t.extent=eg(n.apply(this,arguments)),t.dim=O,t}return r.move=function(t,s,i){t.tween?t.on("start.brush",function(t){I(this,arguments).beforestart().start(t)}).on("interrupt.brush end.brush",function(t){I(this,arguments).end(t)}).tween("brush",function(){var n=this,e=n.__brush,i=I(n,arguments),t=e.selection,a=O.input("function"==typeof s?s.apply(this,arguments):s,e.extent),r=ie(t,a);function o(t){e.selection=1===t&&null===a?null:r(t),F.call(n),i.brush()}return null!==t&&null!==a?o:o(1)}):t.each(function(){var t=arguments,n=this.__brush,e=O.input("function"==typeof s?s.apply(this,t):s,n.extent),t=I(this,t).beforestart();cn(this),n.selection=null===e?null:e,F.call(this),t.start(i).brush(i).end(i)})},r.clear=function(t,n){r.move(t,null,n)},o.prototype={beforestart:function(){return 1==++this.active&&((this.state.emitter=this).starting=!0),this},start:function(t,n){return this.starting?(this.starting=!1,this.emit("start",t,n)):this.emit("brush",t),this},brush:function(t,n){return this.emit("brush",t,n),this},end:function(t,n){return 0==--this.active&&(delete this.state.emitter,this.emit("end",t,n)),this},emit:function(t,n,e){var i=H(this.that).datum();a.call(t,this.that,new qc(t,{sourceEvent:n,target:r,selection:O.output(this.state.selection),mode:e,dispatch:a}),i)}},r.extent=function(t){return arguments.length?(n="function"==typeof t?t:Wc(eg(t)),r):n},r.filter=function(t){return arguments.length?(j="function"==typeof t?t:Wc(!!t),r):j},r.touchable=function(t){return arguments.length?(e="function"==typeof t?t:Wc(!!t),r):e},r.handleSize=function(t){return arguments.length?(i=+t,r):i},r.keyModifiers=function(t){return arguments.length?(R=!!t,r):R},r.on=function(){var t=a.on.apply(a,arguments);return t===a?r:t},r}let mg="#bbb";class yg extends Nc{
|
|
3404
3404
|
/**
|
|
3405
3405
|
@memberof Timeline
|
|
3406
3406
|
@desc Triggered on brush "brush".
|
|
@@ -3456,7 +3456,7 @@ o=+a[0]==+a[1];return"brush"!==n.type&&"end"!==n.type||(this._selection="ticks"=
|
|
|
3456
3456
|
// Measures size of ticks
|
|
3457
3457
|
this._ticksWidth=this._width,["auto","buttons"].includes(this._buttonBehavior)){let s=0;i.forEach((t,n)=>{var{fontFamily:e,fontSize:i}=this._shapeConfig.labelConfig;let a="function"==typeof e?e(t,n):e,r="function"==typeof i?i(t,n):i;e=si().fontFamily(a).fontSize(r).lineHeight(this._shapeConfig.lineHeight?this._shapeConfig.lineHeight(t,n):void 0)(l(t));let o=e.lines.length?Math.ceil(Ot(e.lines.map(t=>Ae(t,{"font-family":a,"font-size":r}))))+r/4:0;o%2&&o++,s<o&&(s=o+2*this._buttonPadding)}),this._ticksWidth=s*i.length}var r=this._playButton?this._playButtonConfig.width||this._buttonHeight:0,o=this._width-r,o=(this._buttonBehaviorCurrent="auto"===this._buttonBehavior?this._ticksWidth<o?"buttons":"ticks":this._buttonBehavior,this._hiddenHandles="buttons"===this._buttonBehaviorCurrent&&!this._brushing);if("buttons"===this._buttonBehaviorCurrent){this._scale="ordinal";let e=Ss().domain(this._domain.map(Nt)).ticks().map(Number);this._domain=this._ticks||Array.from(Array(e[e.length-1]-e[0]+1),(t,n)=>e[0]+n).map(Nt),this._ticks=this._domain;var s=.5*this._ticksWidth/this._ticks.length,h=this._width-this._ticksWidth-r;this._paddingLeft="middle"===this._buttonAlign?h/2+r:"end"===this._buttonAlign?h+r:r,this._range=[this._paddingLeft+s,this._paddingLeft+this._ticksWidth-s]}else this._scale="time",this._domain=Hi(i),this._range=[r?1.5*r:void 0,void 0],this._paddingLeft=r;super.render(t);let u=this._outerBounds[e],c=this._d3Scale.range();h=this._brush=_g(ig).extent([[c[0],u],[c[c.length-1],u+this._outerBounds[n]]]).filter(this._brushFilter).handleSize(o?0:this._handleSize).on("start",this._brushStart.bind(this)).on("brush",this._brushBrush.bind(this)).on("end",this._brushEnd.bind(this)),s="ticks"===this._buttonBehaviorCurrent?this._availableTicks:c,t=[this._brushMin()>s.length?s[0]:s[s.length-this._brushMin()],s[s.length-1]],e=void 0===this._selection?t:this._selection instanceof Array?"buttons"===this._buttonBehaviorCurrent?this._selection.map(Nt).map(t=>c[this._ticks.map(Number).indexOf(+t)]):this._selection.map(Nt):"buttons"===this._buttonBehaviorCurrent?[c[this._ticks.map(Number).indexOf(+this._selection)]]:[this._selection],1===e.length&&e.push(e[0]),this._updateBrushLimit(e),this._brushGroup=Pt("g.brushGroup",{parent:this._group}),this._brushGroup.call(h).transition(this._transition).call(h.move,"ticks"===this._buttonBehaviorCurrent?this._updateBrushLimit(e):e),this._outerBounds.y-=this._handleSize/2,this._outerBounds.height+=this._handleSize/2,n=Pt("g.d3plus-Timeline-play",{parent:this._group});
|
|
3458
3458
|
// data Array to be used when detecting the default value
|
|
3459
|
-
return this._playButtonClass.data(this._playButton?[{x:this._paddingLeft-r,y:"buttons"===this._buttonBehaviorCurrent?"middle"===this._align?this._height/2-this._buttonHeight/2:"start"===this._align?this._margin.top:this._height-this._buttonHeight-this._margin.bottom:this._outerBounds.y,width:r,height:this._buttonHeight}]:[]).select(n.node()).config(
|
|
3459
|
+
return this._playButtonClass.data(this._playButton?[{x:this._paddingLeft-r,y:"buttons"===this._buttonBehaviorCurrent?"middle"===this._align?this._height/2-this._buttonHeight/2:"start"===this._align?this._margin.top:this._height-this._buttonHeight-this._margin.bottom:this._outerBounds.y,width:r,height:this._buttonHeight}]:[]).select(n.node()).config(Lt.bind(this)(this._playButtonConfig)).render(),this}
|
|
3460
3460
|
/**
|
|
3461
3461
|
@memberof Timeline
|
|
3462
3462
|
@desc If *value* is specified, sets the button padding and returns the current class instance. If *value* is not specified, returns the current button padding.
|
|
@@ -3484,7 +3484,7 @@ return this._playButtonClass.data(this._playButton?[{x:this._paddingLeft-r,y:"bu
|
|
|
3484
3484
|
@desc Sets the minimum number of "ticks" to allow to be highlighted when using "ticks" buttonBehavior. Helpful when using x/y plots where you don't want the user to select less than 2 time periods. Value passed can either be a static Number, or a function that is expected to return a Number.
|
|
3485
3485
|
@param {Number|Function} [*value* = 1]
|
|
3486
3486
|
@chainable
|
|
3487
|
-
*/brushMin(t){return arguments.length?(this._brushMin="function"==typeof t?t:
|
|
3487
|
+
*/brushMin(t){return arguments.length?(this._brushMin="function"==typeof t?t:Bt(t),this):this._brushMin}
|
|
3488
3488
|
/**
|
|
3489
3489
|
@memberof Timeline
|
|
3490
3490
|
@desc If *value* is specified, toggles the horizontal alignment of the button timeline. Accepted values are `"start"`, `"middle"` and `"end"`. If *value* is not specified, returns the current button value.
|
|
@@ -3562,13 +3562,13 @@ return this._playButtonClass.data(this._playButton?[{x:this._paddingLeft-r,y:"bu
|
|
|
3562
3562
|
@memberof Timeline
|
|
3563
3563
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from Axis.
|
|
3564
3564
|
@private
|
|
3565
|
-
*/constructor(){super(),this._barConfig=Et({},this._barConfig,{stroke:()=>"buttons"===this._buttonBehaviorCurrent?"transparent":mg,"stroke-width":()=>"buttons"===this._buttonBehaviorCurrent?0:1}),this._brushing=!0,this._brushFilter=t=>!t.button&&t.detail<2,this._brushMin=
|
|
3565
|
+
*/constructor(){super(),this._barConfig=Et({},this._barConfig,{stroke:()=>"buttons"===this._buttonBehaviorCurrent?"transparent":mg,"stroke-width":()=>"buttons"===this._buttonBehaviorCurrent?0:1}),this._brushing=!0,this._brushFilter=t=>!t.button&&t.detail<2,this._brushMin=Bt(1),this._buttonAlign="middle",this._buttonBehavior="auto",this._buttonPadding=10,this._buttonHeight=24,this._domain=[2001,2010],this._gridSize=0,this._handleConfig={fill:Rh.light,stroke:"#228be6","stroke-width":2,rx:2,ry:2},this._handleSize=6,this._height=100,this._labelOffset=!1,this._on={},this.orient("bottom"),this._playButton=!0,this._playButtonClass=(new Ic).on("click",()=>{
|
|
3566
3566
|
// if playing, pause
|
|
3567
|
-
if(this._playTimer)clearInterval(this._playTimer),this._playTimer=!1,this._playButtonClass.render();else{let a=!0;var t=()=>{let t=this._selection||[this._domain[this._domain.length-1]];1===(t=(t=t instanceof Array?t:[t]).map(Nt).map(Number)).length&&t.push(t[0]);var n=this._ticks.map(Number),e=n.indexOf(t[0]),i=n.indexOf(t[t.length-1]);(i===n.length-1?a?this.selection([this._ticks[0],this._ticks[i-e]]):(clearInterval(this._playTimer),this._playTimer=!1,this._playButtonClass):(i+1===n.length-1&&(clearInterval(this._playTimer),this._playTimer=!1),this.selection([this._ticks[e+1],this._ticks[i+1]]))).render(),a=!1};this._playTimer=setInterval(t,this._playButtonInterval),t()}}).on("mousemove",()=>this._playButtonClass.select().style("cursor","pointer")),this._playButtonConfig={fontColor:Rh.dark,fontSize:15,text:()=>this._playTimer?"⏸":"⏵",textAnchor:"middle",verticalAlign:"middle"},this._playButtonInterval=1e3,this._selectionConfig={fill:"#228be6","fill-opacity":()=>"buttons"===this._buttonBehaviorCurrent?.3:1,"stroke-width":0},this._shape="Rect",this._shapeConfig=Et({},this._shapeConfig,{labelBounds:t=>"buttons"===this._buttonBehaviorCurrent?{x:t.labelBounds.x,y:-this._buttonHeight/2+1,width:t.labelBounds.width,height:this._buttonHeight}:t.labelBounds,labelConfig:{fontColor:Rh.dark,fontSize:()=>12,verticalAlign:()=>"buttons"===this._buttonBehaviorCurrent?"middle":"top"},fill:()=>"buttons"===this._buttonBehaviorCurrent?"#fff":mg,stroke:()=>"buttons"===this._buttonBehaviorCurrent?mg:"transparent",height:t=>"buttons"===this._buttonBehaviorCurrent?this._buttonHeight:t.tick?this._handleSize:0,width:t=>"buttons"===this._buttonBehaviorCurrent?this._ticksWidth/this._availableTicks.length:t.tick?this._domain.map(Number).includes(t.id)?2:1:0,y:t=>"buttons"===this._buttonBehaviorCurrent?"middle"===this._align?this._height/2:"start"===this._align?this._margin.top+this._buttonHeight/2:this._height-this._buttonHeight/2-this._margin.bottom:t.y,rx:t=>"buttons"!==this._buttonBehaviorCurrent&&this._domain.map(Number).includes(t.id)?1:0,ry:t=>"buttons"!==this._buttonBehaviorCurrent&&this._domain.map(Number).includes(t.id)?1:0}),this._snapping=!0}}var vg="top",bg="bottom",xg="right",wg="left",Sg="auto",kg=[vg,bg,xg,wg],Cg="start",Mg="end",Ag="clippingParents",zg="viewport",Tg="popper",Eg="reference",Ng=kg.reduce(function(t,n){return t.concat([n+"-"+Cg,n+"-"+Mg])},[]),Pg=[].concat(kg,[Sg]).reduce(function(t,n){return t.concat([n,n+"-"+Cg,n+"-"+Mg])},[]),
|
|
3567
|
+
if(this._playTimer)clearInterval(this._playTimer),this._playTimer=!1,this._playButtonClass.render();else{let a=!0;var t=()=>{let t=this._selection||[this._domain[this._domain.length-1]];1===(t=(t=t instanceof Array?t:[t]).map(Nt).map(Number)).length&&t.push(t[0]);var n=this._ticks.map(Number),e=n.indexOf(t[0]),i=n.indexOf(t[t.length-1]);(i===n.length-1?a?this.selection([this._ticks[0],this._ticks[i-e]]):(clearInterval(this._playTimer),this._playTimer=!1,this._playButtonClass):(i+1===n.length-1&&(clearInterval(this._playTimer),this._playTimer=!1),this.selection([this._ticks[e+1],this._ticks[i+1]]))).render(),a=!1};this._playTimer=setInterval(t,this._playButtonInterval),t()}}).on("mousemove",()=>this._playButtonClass.select().style("cursor","pointer")),this._playButtonConfig={fontColor:Rh.dark,fontSize:15,text:()=>this._playTimer?"⏸":"⏵",textAnchor:"middle",verticalAlign:"middle"},this._playButtonInterval=1e3,this._selectionConfig={fill:"#228be6","fill-opacity":()=>"buttons"===this._buttonBehaviorCurrent?.3:1,"stroke-width":0},this._shape="Rect",this._shapeConfig=Et({},this._shapeConfig,{labelBounds:t=>"buttons"===this._buttonBehaviorCurrent?{x:t.labelBounds.x,y:-this._buttonHeight/2+1,width:t.labelBounds.width,height:this._buttonHeight}:t.labelBounds,labelConfig:{fontColor:Rh.dark,fontSize:()=>12,verticalAlign:()=>"buttons"===this._buttonBehaviorCurrent?"middle":"top"},fill:()=>"buttons"===this._buttonBehaviorCurrent?"#fff":mg,stroke:()=>"buttons"===this._buttonBehaviorCurrent?mg:"transparent",height:t=>"buttons"===this._buttonBehaviorCurrent?this._buttonHeight:t.tick?this._handleSize:0,width:t=>"buttons"===this._buttonBehaviorCurrent?this._ticksWidth/this._availableTicks.length:t.tick?this._domain.map(Number).includes(t.id)?2:1:0,y:t=>"buttons"===this._buttonBehaviorCurrent?"middle"===this._align?this._height/2:"start"===this._align?this._margin.top+this._buttonHeight/2:this._height-this._buttonHeight/2-this._margin.bottom:t.y,rx:t=>"buttons"!==this._buttonBehaviorCurrent&&this._domain.map(Number).includes(t.id)?1:0,ry:t=>"buttons"!==this._buttonBehaviorCurrent&&this._domain.map(Number).includes(t.id)?1:0}),this._snapping=!0}}var vg="top",bg="bottom",xg="right",wg="left",Sg="auto",kg=[vg,bg,xg,wg],Cg="start",Mg="end",Ag="clippingParents",zg="viewport",Tg="popper",Eg="reference",Ng=kg.reduce(function(t,n){return t.concat([n+"-"+Cg,n+"-"+Mg])},[]),Pg=[].concat(kg,[Sg]).reduce(function(t,n){return t.concat([n,n+"-"+Cg,n+"-"+Mg])},[]),Lg=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Bg(t){return t?(t.nodeName||"").toLowerCase():null}function Og(t){var n;return null==t?window:"[object Window]"!==t.toString()?(n=t.ownerDocument)&&n.defaultView||window:t}function Dg(t){return t instanceof Og(t).Element||t instanceof Element}function jg(t){return t instanceof Og(t).HTMLElement||t instanceof HTMLElement}function Rg(t){
|
|
3568
3568
|
// IE 11 has no ShadowRoot
|
|
3569
3569
|
return"undefined"!=typeof ShadowRoot&&(t instanceof Og(t).ShadowRoot||t instanceof ShadowRoot)}
|
|
3570
3570
|
// and applies them to the HTMLElements such as popper and arrow
|
|
3571
|
-
function
|
|
3571
|
+
function Fg(t){return t.split("-")[0]}var Ig=Math.max,Hg=Math.min,Gg=Math.round;function Kg(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Ug(){return!/^((?!chrome|android).)*safari/i.test(Kg())}function Wg(t,n,e){void 0===n&&(n=!1),void 0===e&&(e=!1);var i=t.getBoundingClientRect(),a=1,r=1;n&&jg(t)&&(a=0<t.offsetWidth&&Gg(i.width)/t.offsetWidth||1,r=0<t.offsetHeight&&Gg(i.height)/t.offsetHeight||1);n=(Dg(t)?Og(t):window).visualViewport,t=!Ug()&&e,e=(i.left+(t&&n?n.offsetLeft:0))/a,t=(i.top+(t&&n?n.offsetTop:0))/r,n=i.width/a,a=i.height/r;return{width:n,height:a,top:t,right:e+n,bottom:t+a,left:e,x:e,y:t}}
|
|
3572
3572
|
// means it doesn't take into account transforms.
|
|
3573
3573
|
function qg(t){var n=Wg(t),e=t.offsetWidth,i=t.offsetHeight;// Use the clientRect sizes if it's not been transformed.
|
|
3574
3574
|
// Fixes https://github.com/popperjs/popper-core/issues/1223
|
|
@@ -3577,7 +3577,7 @@ if(t.contains(n))return!0;// Give up, the result is false
|
|
|
3577
3577
|
if(e&&Rg(e)){var i=n;do{if(i&&t.isSameNode(i))return!0;// $FlowFixMe[prop-missing]: need a better way to handle this...
|
|
3578
3578
|
}while(i=i.parentNode||i.host)}return!1}function Vg(t){return Og(t).getComputedStyle(t)}function Yg(t){
|
|
3579
3579
|
// $FlowFixMe[incompatible-return]: assume body is always available
|
|
3580
|
-
return((Dg(t)?t.ownerDocument:t.document)||window.document).documentElement}function Zg(t){return"html"===
|
|
3580
|
+
return((Dg(t)?t.ownerDocument:t.document)||window.document).documentElement}function Zg(t){return"html"===Bg(t)?t:// $FlowFixMe[incompatible-return]
|
|
3581
3581
|
// $FlowFixMe[prop-missing]
|
|
3582
3582
|
t.assignedSlot||// step into the shadow DOM of the parent of a slotted node
|
|
3583
3583
|
t.parentNode||(Rg(t)?t.host:null)||// ShadowRoot detected
|
|
@@ -3587,10 +3587,10 @@ Yg(t)}function Xg(t){return jg(t)&&// https://github.com/popperjs/popper-core/is
|
|
|
3587
3587
|
// return the containing block
|
|
3588
3588
|
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
3589
3589
|
// such as table ancestors and cross browser bugs.
|
|
3590
|
-
function Jg(t){for(var n,e=Og(t),i=Xg(t);i&&(n=i,0<=["table","td","th"].indexOf(
|
|
3590
|
+
function Jg(t){for(var n,e=Og(t),i=Xg(t);i&&(n=i,0<=["table","td","th"].indexOf(Bg(n)))&&"static"===Vg(i).position;)i=Xg(i);return(!i||"html"!==Bg(i)&&("body"!==Bg(i)||"static"!==Vg(i).position))&&(i||(t=>{var n=/firefox/i.test(Kg()),e=/Trident/i.test(Kg());if(!e||!jg(t)||"fixed"!==Vg(t).position){var i=Zg(t);for(Rg(i)&&(i=i.host);jg(i)&&["html","body"].indexOf(Bg(i))<0;){var a=Vg(i);// This is non-exhaustive but covers the most common CSS properties that
|
|
3591
3591
|
// create a containing block.
|
|
3592
3592
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
3593
|
-
if("none"!==a.transform||"none"!==a.perspective||"paint"===a.contain||-1!==["transform","perspective"].indexOf(a.willChange)||n&&"filter"===a.willChange||n&&a.filter&&"none"!==a.filter)return i;i=i.parentNode}}return null})(t))||e}function Qg(t){return 0<=["top","bottom"].indexOf(t)?"x":"y"}function td(t,n,e){return
|
|
3593
|
+
if("none"!==a.transform||"none"!==a.perspective||"paint"===a.contain||-1!==["transform","perspective"].indexOf(a.willChange)||n&&"filter"===a.willChange||n&&a.filter&&"none"!==a.filter)return i;i=i.parentNode}}return null})(t))||e}function Qg(t){return 0<=["top","bottom"].indexOf(t)?"x":"y"}function td(t,n,e){return Ig(t,Hg(n,e))}function nd(){return{top:0,right:0,bottom:0,left:0}}function ed(t){return Object.assign({},nd(),t)}function id(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}function ad(t){return t.split("-")[1]}var rd={top:"auto",right:"auto",bottom:"auto",left:"auto"};// Round the offsets to the nearest suitable subpixel based on the DPR.
|
|
3594
3594
|
// Zooming can change the DPR, but it seems to report a value that will
|
|
3595
3595
|
// cleanly divide the values into the appropriate subpixels.
|
|
3596
3596
|
function od(t){var n,e=t.popper,i=t.popperRect,a=t.placement,r=t.variation,o=t.offsets,s=t.position,l=t.gpuAcceleration,h=t.adaptive,u=t.roundOffsets,t=t.isFixed,c=o.x,c=void 0===c?0:c,g=o.y,g=void 0===g?0:g,d="function"==typeof u?u({x:c,y:g}):{x:c,y:g},d=(c=d.x,g=d.y,o.hasOwnProperty("x")),o=o.hasOwnProperty("y"),f=wg,p=vg,_=window,m=(h&&(m="clientHeight",n="clientWidth",(y=Jg(e))===Og(e)&&"static"!==Vg(y=Yg(e)).position&&"absolute"===s&&(m="scrollHeight",n="scrollWidth"),a!==vg&&(a!==wg&&a!==xg||r!==Mg)||(p=bg,g=(g-((t&&y===_&&_.visualViewport?_.visualViewport.height:y[m])-i.height))*(l?1:-1)),a!==wg&&(a!==vg&&a!==bg||r!==Mg)||(f=xg,c=(c-((t&&y===_&&_.visualViewport?_.visualViewport.width:y[n])-i.width))*(l?1:-1))),Object.assign({position:s},h&&rd)),y=!0===u?(a={x:c,y:g},r=Og(e),t=a.x,a=a.y,r=r.devicePixelRatio||1,{x:Gg(t*r)/r||0,y:Gg(a*r)/r||0}):{x:c,y:g};return c=y.x,g=y.y,l?Object.assign({},m,((n={})[p]=o?"0":"",n[f]=d?"0":"",n.transform=(_.devicePixelRatio||1)<=1?"translate("+c+"px, "+g+"px)":"translate3d("+c+"px, "+g+"px, 0)",n)):Object.assign({},m,((i={})[p]=o?g+"px":"",i[f]=d?c+"px":"",i.transform="",i))}// eslint-disable-next-line import/no-unused-modules
|
|
@@ -3611,21 +3611,21 @@ var t=Vg(t),n=t.overflow;return/auto|scroll|overlay|hidden/.test(n+t.overflowY+t
|
|
|
3611
3611
|
until we get to the top window object. This list is what we attach scroll listeners
|
|
3612
3612
|
to, because if any of these parent elements scroll, we'll need to re-calculate the
|
|
3613
3613
|
reference element's position.
|
|
3614
|
-
*/function pd(t,n){void 0===n&&(n=[]);var e=function t(n){return 0<=["html","body","#document"].indexOf(
|
|
3614
|
+
*/function pd(t,n){void 0===n&&(n=[]);var e=function t(n){return 0<=["html","body","#document"].indexOf(Bg(n))?n.ownerDocument.body:jg(n)&&fd(n)?n:t(Zg(n))}(t),t=e===(null==(t=t.ownerDocument)?void 0:t.body),i=Og(e),i=t?[i].concat(i.visualViewport||[],fd(e)?e:[]):e,e=n.concat(i);return t?e:e.concat(pd(Zg(i)))}function _d(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function md(t,n,e){return n===zg?_d((a=e,o=Og(i=t),s=Yg(i),o=o.visualViewport,l=s.clientWidth,s=s.clientHeight,u=h=0,o&&(l=o.width,s=o.height,(r=Ug())||!r&&"fixed"===a)&&(h=o.offsetLeft,u=o.offsetTop),{width:l,height:s,x:h+dd(i),y:u})):Dg(n)?((a=Wg(r=n,!1,"fixed"===(a=e))).top=a.top+r.clientTop,a.left=a.left+r.clientLeft,a.bottom=a.top+r.clientHeight,a.right=a.left+r.clientWidth,a.width=r.clientWidth,a.height=r.clientHeight,a.x=a.left,a.y=a.top,a):_d((o=Yg(t),l=Yg(o),s=gd(o),h=null==(h=o.ownerDocument)?void 0:h.body,i=Ig(l.scrollWidth,l.clientWidth,h?h.scrollWidth:0,h?h.clientWidth:0),u=Ig(l.scrollHeight,l.clientHeight,h?h.scrollHeight:0,h?h.clientHeight:0),o=-s.scrollLeft+dd(o),s=-s.scrollTop,"rtl"===Vg(h||l).direction&&(o+=Ig(l.clientWidth,h?h.clientWidth:0)-i),{width:i,height:u,x:o,y:s}));
|
|
3615
3615
|
// of the `<html>` and `<body>` rect bounds if horizontally scrollable
|
|
3616
3616
|
var i,a,r,o,s,l,h,u}// A "clipping parent" is an overflowable container with the characteristic of
|
|
3617
3617
|
// clipping (or hiding) overflowing elements with a position different from
|
|
3618
3618
|
// `initial`
|
|
3619
3619
|
// Gets the maximum area that the element is visible in due to any number of
|
|
3620
3620
|
// clipping parents
|
|
3621
|
-
function yd(e,t,n,i){var a,r="clippingParents"===t?(o=pd(Zg(r=e)),Dg(a=0<=["absolute","fixed"].indexOf(Vg(r).position)&&jg(r)?Jg(r):r)?o.filter(function(t){return Dg(t)&&$g(t,a)&&"body"!==
|
|
3621
|
+
function yd(e,t,n,i){var a,r="clippingParents"===t?(o=pd(Zg(r=e)),Dg(a=0<=["absolute","fixed"].indexOf(Vg(r).position)&&jg(r)?Jg(r):r)?o.filter(function(t){return Dg(t)&&$g(t,a)&&"body"!==Bg(t)}):[]):[].concat(t),o=[].concat(r,[n]),t=o[0],n=o.reduce(function(t,n){n=md(e,n,i);return t.top=Ig(n.top,t.top),t.right=Hg(n.right,t.right),t.bottom=Hg(n.bottom,t.bottom),t.left=Ig(n.left,t.left),t},md(e,t,i));return n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}function vd(t){var n,e=t.reference,i=t.element,t=t.placement,a=t?Fg(t):null,t=t?ad(t):null,r=e.x+e.width/2-i.width/2,o=e.y+e.height/2-i.height/2;switch(a){case vg:n={x:r,y:e.y-i.height};break;case bg:n={x:r,y:e.y+e.height};break;case xg:n={x:e.x+e.width,y:o};break;case wg:n={x:e.x-i.width,y:o};break;default:n={x:e.x,y:e.y}}var s=a?Qg(a):null;if(null!=s){var l="y"===s?"height":"width";switch(t){case Cg:n[s]=n[s]-(e[l]/2-i[l]/2);break;case Mg:n[s]=n[s]+(e[l]/2-i[l]/2)}}return n}function bd(t,n){var i,n=n=void 0===n?{}:n,e=n.placement,e=void 0===e?t.placement:e,a=n.strategy,a=void 0===a?t.strategy:a,r=n.boundary,r=void 0===r?Ag:r,o=n.rootBoundary,o=void 0===o?zg:o,s=n.elementContext,s=void 0===s?Tg:s,l=n.altBoundary,l=void 0!==l&&l,n=n.padding,n=void 0===n?0:n,n=ed("number"!=typeof n?n:id(n,kg)),h=t.rects.popper,l=t.elements[l?s===Tg?Eg:Tg:s],l=yd(Dg(l)?l:l.contextElement||Yg(t.elements.popper),r,o,a),r=Wg(t.elements.reference),o=vd({reference:r,element:h,placement:e}),a=_d(Object.assign({},h,o)),h=s===Tg?a:r,u={top:l.top-h.top+n.top,bottom:h.bottom-l.bottom+n.bottom,left:l.left-h.left+n.left,right:h.right-l.right+n.right},o=t.modifiersData.offset;// Offsets can be applied only to the popper element
|
|
3622
3622
|
return s===Tg&&o&&(i=o[e],Object.keys(u).forEach(function(t){var n=0<=[xg,bg].indexOf(t)?1:-1,e=0<=[vg,bg].indexOf(t)?"y":"x";u[t]+=i[e]*n})),u}function xd(t,n,e){return{top:t.top-n.height-(e=void 0===e?{x:0,y:0}:e).y,right:t.right-n.width+e.x,bottom:t.bottom-n.height+e.y,left:t.left-n.width-e.x}}function wd(n){return[vg,xg,bg,wg].some(function(t){return 0<=n[t]})}// Returns the composite rect of an element relative to its offsetParent.
|
|
3623
3623
|
// Composite means it takes into account transforms as well as layout.
|
|
3624
|
-
function Sd(t,n,e){void 0===e&&(e=!1);var i=jg(n),a=jg(n)&&(o=(a=n).getBoundingClientRect(),r=Gg(o.width)/a.offsetWidth||1,o=Gg(o.height)/a.offsetHeight||1,1!==r||1!==o),r=Yg(n),o=Wg(t,a,e),t={scrollLeft:0,scrollTop:0},s={x:0,y:0};return!i&&e||("body"===
|
|
3624
|
+
function Sd(t,n,e){void 0===e&&(e=!1);var i=jg(n),a=jg(n)&&(o=(a=n).getBoundingClientRect(),r=Gg(o.width)/a.offsetWidth||1,o=Gg(o.height)/a.offsetHeight||1,1!==r||1!==o),r=Yg(n),o=Wg(t,a,e),t={scrollLeft:0,scrollTop:0},s={x:0,y:0};return!i&&e||("body"===Bg(n)&&// https://github.com/popperjs/popper-core/issues/1078
|
|
3625
3625
|
!fd(r)||(t=(i=n)!==Og(i)&&jg(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:gd(i)),jg(n)?((s=Wg(n,!0)).x+=n.clientLeft,s.y+=n.clientTop):r&&(s.x=dd(r))),{x:o.left+t.scrollLeft-s.x,y:o.top+t.scrollTop-s.y,width:o.width,height:o.height}}function kd(t){var e=new Map,i=new Set,a=[];return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){i.has(t.name)||
|
|
3626
3626
|
// check for visited object
|
|
3627
3627
|
!// On visiting object, check for its dependencies and visit them recursively
|
|
3628
|
-
function n(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){i.has(t)||(t=e.get(t))&&n(t)}),a.push(t)}(t)}),a}var Cd={placement:"bottom",modifiers:[],strategy:"absolute"};function Md(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return!n.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function Ad(t){var t=t=void 0===t?{}:t,n=t.defaultModifiers,c=void 0===n?[]:n,n=t.defaultOptions,g=void 0===n?Cd:n;return function(i,a,n){void 0===n&&(n=g);var e,r,o={placement:"bottom",orderedModifiers:[],options:Object.assign({},Cd,g),modifiersData:{},elements:{reference:i,popper:a},attributes:{},styles:{}},s=[],l=!1,h={state:o,setOptions:function(t){var e,n,t="function"==typeof t?t(o.options):t,t=(u(),o.options=Object.assign({},g,o.options,t),o.scrollParents={reference:Dg(i)?pd(i):i.contextElement?pd(i.contextElement):[],popper:pd(a)},t=[].concat(c,o.options.modifiers),n=t.reduce(function(t,n){var e=t[n.name];return t[n.name]=e?Object.assign({},e,n,{options:Object.assign({},e.options,n.options),data:Object.assign({},e.data,n.data)}):n,t},{}),t=Object.keys(n).map(function(t){return n[t]}),e=kd(t),
|
|
3628
|
+
function n(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){i.has(t)||(t=e.get(t))&&n(t)}),a.push(t)}(t)}),a}var Cd={placement:"bottom",modifiers:[],strategy:"absolute"};function Md(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return!n.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function Ad(t){var t=t=void 0===t?{}:t,n=t.defaultModifiers,c=void 0===n?[]:n,n=t.defaultOptions,g=void 0===n?Cd:n;return function(i,a,n){void 0===n&&(n=g);var e,r,o={placement:"bottom",orderedModifiers:[],options:Object.assign({},Cd,g),modifiersData:{},elements:{reference:i,popper:a},attributes:{},styles:{}},s=[],l=!1,h={state:o,setOptions:function(t){var e,n,t="function"==typeof t?t(o.options):t,t=(u(),o.options=Object.assign({},g,o.options,t),o.scrollParents={reference:Dg(i)?pd(i):i.contextElement?pd(i.contextElement):[],popper:pd(a)},t=[].concat(c,o.options.modifiers),n=t.reduce(function(t,n){var e=t[n.name];return t[n.name]=e?Object.assign({},e,n,{options:Object.assign({},e.options,n.options),data:Object.assign({},e.data,n.data)}):n,t},{}),t=Object.keys(n).map(function(t){return n[t]}),e=kd(t),Lg.reduce(function(t,n){return t.concat(e.filter(function(t){return t.phase===n}))},[]));// Strip out disabled modifiers
|
|
3629
3629
|
return o.orderedModifiers=t.filter(function(t){return t.enabled}),o.orderedModifiers.forEach(function(t){var n=t.name,e=t.options,t=t.effect;"function"==typeof t&&(t=t({state:o,name:n,instance:h,options:void 0===e?{}:e}),s.push(t||function(){}))}),h.update()},
|
|
3630
3630
|
// Sync update – it will always be executed, even if not necessary. This
|
|
3631
3631
|
// is useful for low frequency updates where sync behavior simplifies the
|
|
@@ -3653,18 +3653,18 @@ update:(e=function(){return new Promise(function(t){h.forceUpdate(),t(o)})},func
|
|
|
3653
3653
|
// This is the most basic placement, and will be adjusted by
|
|
3654
3654
|
// the modifiers in the next step
|
|
3655
3655
|
n.modifiersData[t.name]=vd({reference:n.rects.reference,element:n.rects.popper,placement:n.placement})}// eslint-disable-next-line import/no-unused-modules
|
|
3656
|
-
,data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var n=t.state,e=void 0===(e=(t=t.options).gpuAcceleration)||e,i=void 0===(i=t.adaptive)||i,t=void 0===(t=t.roundOffsets)||t,e={placement:
|
|
3657
|
-
jg(i)&&
|
|
3656
|
+
,data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var n=t.state,e=void 0===(e=(t=t.options).gpuAcceleration)||e,i=void 0===(i=t.adaptive)||i,t=void 0===(t=t.roundOffsets)||t,e={placement:Fg(n.placement),variation:ad(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:e,isFixed:"fixed"===n.options.strategy};null!=n.modifiersData.popperOffsets&&(n.styles.popper=Object.assign({},n.styles.popper,od(Object.assign({},e,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:i,roundOffsets:t})))),null!=n.modifiersData.arrow&&(n.styles.arrow=Object.assign({},n.styles.arrow,od(Object.assign({},e,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:t})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var a=t.state;Object.keys(a.elements).forEach(function(t){var n=a.styles[t]||{},e=a.attributes[t]||{},i=a.elements[t];// arrow is optional + virtual elements
|
|
3657
|
+
jg(i)&&Bg(i)&&(// Flow doesn't support to extend this property, but it's the most
|
|
3658
3658
|
// effective way to apply styles to an HTMLElement
|
|
3659
3659
|
// $FlowFixMe[cannot-write]
|
|
3660
3660
|
Object.assign(i.style,n),Object.keys(e).forEach(function(t){var n=e[t];!1===n?i.removeAttribute(t):i.setAttribute(t,!0===n?"":n)}))})},effect:function(t){var i=t.state,a={popper:{position:i.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(i.elements.popper.style,a.popper),i.styles=a,i.elements.arrow&&Object.assign(i.elements.arrow.style,a.arrow),function(){Object.keys(i.elements).forEach(function(t){var n=i.elements[t],e=i.attributes[t]||{},t=Object.keys((i.styles.hasOwnProperty(t)?i.styles:a)[t]).reduce(function(t,n){return t[n]="",t},{});// arrow is optional + virtual elements
|
|
3661
|
-
jg(n)&&
|
|
3662
|
-
,requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var o=t.state,n=t.name,s=void 0===(t=t.options.offset)?[0,0]:t,t=Pg.reduce(function(t,n){var e,i,a,r;return t[n]=(n=n,e=o.rects,i=s,a=
|
|
3663
|
-
},{name:"flip",enabled:!0,phase:"main",fn:function(t){var c=t.state,n=t.options,t=t.name;if(!c.modifiersData[t]._skip){for(var e=n.mainAxis,i=void 0===e||e,e=n.altAxis,a=void 0===e||e,e=n.fallbackPlacements,g=n.padding,d=n.boundary,f=n.rootBoundary,r=n.altBoundary,o=n.flipVariations,p=void 0===o||o,_=n.allowedAutoPlacements,o=c.options.placement,n=
|
|
3661
|
+
jg(n)&&Bg(n)&&(Object.assign(n.style,t),Object.keys(e).forEach(function(t){n.removeAttribute(t)}))})}}// eslint-disable-next-line import/no-unused-modules
|
|
3662
|
+
,requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var o=t.state,n=t.name,s=void 0===(t=t.options.offset)?[0,0]:t,t=Pg.reduce(function(t,n){var e,i,a,r;return t[n]=(n=n,e=o.rects,i=s,a=Fg(n),r=0<=[wg,vg].indexOf(a)?-1:1,n=(e="function"==typeof i?i(Object.assign({},e,{placement:n})):i)[0]||0,i=(e[1]||0)*r,0<=[wg,xg].indexOf(a)?{x:i,y:n}:{x:n,y:i}),t},{}),e=(i=t[o.placement]).x,i=i.y;null!=o.modifiersData.popperOffsets&&(o.modifiersData.popperOffsets.x+=e,o.modifiersData.popperOffsets.y+=i),o.modifiersData[n]=t}// eslint-disable-next-line import/no-unused-modules
|
|
3663
|
+
},{name:"flip",enabled:!0,phase:"main",fn:function(t){var c=t.state,n=t.options,t=t.name;if(!c.modifiersData[t]._skip){for(var e=n.mainAxis,i=void 0===e||e,e=n.altAxis,a=void 0===e||e,e=n.fallbackPlacements,g=n.padding,d=n.boundary,f=n.rootBoundary,r=n.altBoundary,o=n.flipVariations,p=void 0===o||o,_=n.allowedAutoPlacements,o=c.options.placement,n=Fg(o),e=e||(n===o||!p?[hd(o)]:Fg(e=o)===Sg?[]:(n=hd(e),[cd(e),n,cd(n)])),s=[o].concat(e).reduce(function(t,n){return t.concat(Fg(n)===Sg?(e=c,i=(t=t=void 0===(t={placement:n,boundary:d,rootBoundary:f,padding:g,flipVariations:p,allowedAutoPlacements:_})?{}:t).placement,a=t.boundary,r=t.rootBoundary,o=t.padding,s=t.flipVariations,l=void 0===(t=t.allowedAutoPlacements)?Pg:t,h=ad(i),t=h?s?Ng:Ng.filter(function(t){return ad(t)===h}):kg,u=(i=0===(i=t.filter(function(t){return 0<=l.indexOf(t)})).length?t:i).reduce(function(t,n){return t[n]=bd(e,{placement:n,boundary:a,rootBoundary:r,padding:o})[Fg(n)],t},{}),Object.keys(u).sort(function(t,n){return u[t]-u[n]})):n);var e,i,a,r,o,s,l,h,u},[]),l=c.rects.reference,h=c.rects.popper,u=new Map,m=!0,y=s[0],v=0;v<s.length;v++){var b=s[v],x=Fg(b),w=ad(b)===Cg,S=0<=[vg,bg].indexOf(x),k=S?"width":"height",C=bd(c,{placement:b,boundary:d,rootBoundary:f,altBoundary:r,padding:g}),S=S?w?xg:wg:w?bg:vg,w=(l[k]>h[k]&&(S=hd(S)),hd(S)),k=[];if(i&&k.push(C[x]<=0),a&&k.push(C[S]<=0,C[w]<=0),k.every(function(t){return t})){y=b,m=!1;break}u.set(b,k)}if(m)for(
|
|
3664
3664
|
// `2` may be desired in some cases – research later
|
|
3665
3665
|
var M=p?3:1;0<M;M--)if("break"===(n=>{var t=s.find(function(t){t=u.get(t);if(t)return t.slice(0,n).every(function(t){return t})});if(t)return y=t,"break"})(M))break;c.placement!==y&&(c.modifiersData[t]._skip=!0,c.placement=y,c.reset=!0)}}// eslint-disable-next-line import/no-unused-modules
|
|
3666
|
-
,requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var n,e,i,a,r,o,s,l,h,u=t.state,c=t.options,t=t.name,g=void 0===(g=c.mainAxis)||g,d=void 0!==(d=c.altAxis)&&d,f=void 0===(f=c.tether)||f,p=void 0===(p=c.tetherOffset)?0:p,c=bd(u,{boundary:c.boundary,rootBoundary:c.rootBoundary,padding:c.padding,altBoundary:c.altBoundary}),_=
|
|
3667
|
-
,requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var n,e,i,a,r=t.state,o=t.name,t=t.options,s=r.elements.arrow,l=r.modifiersData.popperOffsets,h=Qg(u=
|
|
3666
|
+
,requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var n,e,i,a,r,o,s,l,h,u=t.state,c=t.options,t=t.name,g=void 0===(g=c.mainAxis)||g,d=void 0!==(d=c.altAxis)&&d,f=void 0===(f=c.tether)||f,p=void 0===(p=c.tetherOffset)?0:p,c=bd(u,{boundary:c.boundary,rootBoundary:c.rootBoundary,padding:c.padding,altBoundary:c.altBoundary}),_=Fg(u.placement),m=ad(u.placement),y=!m,v=Qg(_),b="x"===v?"y":"x",x=u.modifiersData.popperOffsets,w=u.rects.reference,S=u.rects.popper,p="number"==typeof(p="function"==typeof p?p(Object.assign({},u.rects,{placement:u.placement})):p)?{mainAxis:p,altAxis:p}:Object.assign({mainAxis:0,altAxis:0},p),k=u.modifiersData.offset?u.modifiersData.offset[u.placement]:null,C={x:0,y:0};x&&(g&&(g="y"===v?"height":"width",o=(s=x[v])+c[e="y"===v?vg:wg],l=s-c[h="y"===v?bg:xg],n=f?-S[g]/2:0,a=(m===Cg?w:S)[g],m=m===Cg?-S[g]:-w[g],r=u.elements.arrow,r=f&&r?qg(r):{width:0,height:0},e=(i=u.modifiersData["arrow#persistent"]?u.modifiersData["arrow#persistent"].padding:nd())[e],i=i[h],h=td(0,w[g],r[g]),r=y?w[g]/2-n-h-e-p.mainAxis:a-h-e-p.mainAxis,a=y?-w[g]/2+n+h+i+p.mainAxis:m+h+i+p.mainAxis,y=(e=u.elements.arrow&&Jg(u.elements.arrow))?"y"===v?e.clientTop||0:e.clientLeft||0:0,m=s+a-(n=null!=(g=null==k?void 0:k[v])?g:0),h=td(f?Hg(o,s+r-n-y):o,s,f?Ig(l,m):l),x[v]=h,C[v]=h-s),d&&(i="y"==b?"height":"width",a=(e=x[b])+c["x"===v?vg:wg],g=e-c["x"===v?bg:xg],r=-1!==[vg,wg].indexOf(_),y=null!=(n=null==k?void 0:k[b])?n:0,o=r?a:e-w[i]-S[i]-y+p.altAxis,m=r?e+w[i]+S[i]-y-p.altAxis:g,s=f&&r?(l=td(l=o,e,h=m),h<l?h:l):td(f?o:a,e,f?m:g),x[b]=s,C[b]=s-e),u.modifiersData[t]=C)}// eslint-disable-next-line import/no-unused-modules
|
|
3667
|
+
,requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var n,e,i,a,r=t.state,o=t.name,t=t.options,s=r.elements.arrow,l=r.modifiersData.popperOffsets,h=Qg(u=Fg(r.placement)),u=0<=[wg,xg].indexOf(u)?"height":"width";s&&l&&(t=t.padding,e=r,e=ed("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:id(t,kg)),t=qg(s),a="y"===h?vg:wg,i="y"===h?bg:xg,n=r.rects.reference[u]+r.rects.reference[h]-l[h]-r.rects.popper[u],l=l[h]-r.rects.reference[h],s=(s=Jg(s))?"y"===h?s.clientHeight||0:s.clientWidth||0:0,a=e[a],e=s-t[u]-e[i],a=td(a,i=s/2-t[u]/2+(n/2-l/2),e),r.modifiersData[o]=((s={})[h]=a,s.centerOffset=a-i,s))},effect:function(t){var n=t.state;null!=(t=void 0===(t=t.options.element)?"[data-popper-arrow]":t)&&("string"!=typeof t||(t=n.elements.popper.querySelector(t)))&&$g(n.elements.popper,t)&&(n.elements.arrow=t);// CSS selector
|
|
3668
3668
|
}// eslint-disable-next-line import/no-unused-modules
|
|
3669
3669
|
,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var n=t.state,t=t.name,e=n.rects.reference,i=n.rects.popper,a=n.modifiersData.preventOverflow,r=bd(n,{elementContext:"reference"}),o=bd(n,{altBoundary:!0}),r=xd(r,e),e=xd(o,i,a),o=wd(r),i=wd(e);n.modifiersData[t]={referenceClippingOffsets:r,popperEscapeOffsets:e,isReferenceHidden:o,hasPopperEscaped:i},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":o,"data-popper-escaped":i})}// eslint-disable-next-line import/no-unused-modules
|
|
3670
3670
|
}]});// eslint-disable-next-line import/no-unused-modules
|
|
@@ -3672,7 +3672,7 @@ var M=p?3:1;0<M;M--)if("break"===(n=>{var t=s.find(function(t){t=u.get(t);if(t)r
|
|
|
3672
3672
|
* Creates a reference element for popper.
|
|
3673
3673
|
* @param {Number[]} position
|
|
3674
3674
|
* @private
|
|
3675
|
-
*/function Td(t=[0,0]){return()=>({width:0,height:0,top:t[1],right:t[0],bottom:t[1],left:t[0]})}class Ed extends
|
|
3675
|
+
*/function Td(t=[0,0]){return()=>({width:0,height:0,top:t[1],right:t[0],bottom:t[1],left:t[0]})}class Ed extends Li{
|
|
3676
3676
|
/**
|
|
3677
3677
|
The inner return object and draw function that gets assigned the public methods.
|
|
3678
3678
|
@private
|
|
@@ -3697,7 +3697,7 @@ var M=p?3:1;0<M;M--)if("break"===(n=>{var t=s.find(function(t){t=u.get(t);if(t)r
|
|
|
3697
3697
|
function value(d) {
|
|
3698
3698
|
return d.arrow || "";
|
|
3699
3699
|
}
|
|
3700
|
-
*/arrow(t){return arguments.length?(this._arrow="function"==typeof t?t:
|
|
3700
|
+
*/arrow(t){return arguments.length?(this._arrow="function"==typeof t?t:Bt(t),this):this._arrow}
|
|
3701
3701
|
/**
|
|
3702
3702
|
@memberof Tooltip
|
|
3703
3703
|
@desc If *value* is specified, sets the arrow styles to the specified values and returns this generator. If *value* is not specified, returns the current arrow styles.
|
|
@@ -3715,7 +3715,7 @@ var M=p?3:1;0<M;M--)if("break"===(n=>{var t=s.find(function(t){t=u.get(t);if(t)r
|
|
|
3715
3715
|
@memberof Tooltip
|
|
3716
3716
|
@desc If *value* is specified, sets the background accessor to the specified function or string and returns this generator. If *value* is not specified, returns the current background accessor.
|
|
3717
3717
|
@param {Function|String} [*value* = colorDefaults.light]
|
|
3718
|
-
*/background(t){return arguments.length?(this._background="function"==typeof t?t:
|
|
3718
|
+
*/background(t){return arguments.length?(this._background="function"==typeof t?t:Bt(t),this):this._background}
|
|
3719
3719
|
/**
|
|
3720
3720
|
@memberof Tooltip
|
|
3721
3721
|
@desc If *value* is specified, sets the body accessor to the specified function or string and returns this generator. If *value* is not specified, returns the current body accessor.
|
|
@@ -3724,7 +3724,7 @@ var M=p?3:1;0<M;M--)if("break"===(n=>{var t=s.find(function(t){t=u.get(t);if(t)r
|
|
|
3724
3724
|
function value(d) {
|
|
3725
3725
|
return d.body || "";
|
|
3726
3726
|
}
|
|
3727
|
-
*/body(t){return arguments.length?(this._body="function"==typeof t?t:
|
|
3727
|
+
*/body(t){return arguments.length?(this._body="function"==typeof t?t:Bt(t),this):this._body}
|
|
3728
3728
|
/**
|
|
3729
3729
|
@memberof Tooltip
|
|
3730
3730
|
@desc If *value* is specified, sets the body styles to the specified values and returns this generator. If *value* is not specified, returns the current body styles.
|
|
@@ -3739,12 +3739,12 @@ var M=p?3:1;0<M;M--)if("break"===(n=>{var t=s.find(function(t){t=u.get(t);if(t)r
|
|
|
3739
3739
|
@memberof Tooltip
|
|
3740
3740
|
@desc If *value* is specified, sets the border accessor to the specified function or string and returns this generator. If *value* is not specified, returns the current border accessor.
|
|
3741
3741
|
@param {Function|String} [*value* = "1px solid rgba(0, 0, 0, 0.1)"]
|
|
3742
|
-
*/border(t){return arguments.length?(this._border="function"==typeof t?t:
|
|
3742
|
+
*/border(t){return arguments.length?(this._border="function"==typeof t?t:Bt(t),this):this._border}
|
|
3743
3743
|
/**
|
|
3744
3744
|
@memberof Tooltip
|
|
3745
3745
|
@desc If *value* is specified, sets the border-radius accessor to the specified function or string and returns this generator. If *value* is not specified, returns the current border-radius accessor.
|
|
3746
3746
|
@param {Function|String} [*value* = "2px"]
|
|
3747
|
-
*/borderRadius(t){return arguments.length?(this._borderRadius="function"==typeof t?t:
|
|
3747
|
+
*/borderRadius(t){return arguments.length?(this._borderRadius="function"==typeof t?t:Bt(t),this):this._borderRadius}
|
|
3748
3748
|
/**
|
|
3749
3749
|
@memberof Tooltip
|
|
3750
3750
|
@desc If *value* is specified, sets the class name to the specified string and returns this generator. If *value* is not specified, returns the current class name.
|
|
@@ -3763,7 +3763,7 @@ var M=p?3:1;0<M;M--)if("break"===(n=>{var t=s.find(function(t){t=u.get(t);if(t)r
|
|
|
3763
3763
|
function value(d) {
|
|
3764
3764
|
return d.footer || "";
|
|
3765
3765
|
}
|
|
3766
|
-
*/footer(t){return arguments.length?(this._footer="function"==typeof t?t:
|
|
3766
|
+
*/footer(t){return arguments.length?(this._footer="function"==typeof t?t:Bt(t),this):this._footer}
|
|
3767
3767
|
/**
|
|
3768
3768
|
@memberof Tooltip
|
|
3769
3769
|
@desc If *value* is specified, sets the footer styles to the specified values and returns this generator. If *value* is not specified, returns the current footer styles.
|
|
@@ -3778,7 +3778,7 @@ var M=p?3:1;0<M;M--)if("break"===(n=>{var t=s.find(function(t){t=u.get(t);if(t)r
|
|
|
3778
3778
|
@memberof Tooltip
|
|
3779
3779
|
@desc If *value* is specified, sets the height accessor to the specified function or string and returns this generator. If *value* is not specified, returns the current height accessor.
|
|
3780
3780
|
@param {Function|String} [*value* = "auto"]
|
|
3781
|
-
*/height(t){return arguments.length?(this._height="function"==typeof t?t:
|
|
3781
|
+
*/height(t){return arguments.length?(this._height="function"==typeof t?t:Bt(t),this):this._height}
|
|
3782
3782
|
/**
|
|
3783
3783
|
@memberof Tooltip
|
|
3784
3784
|
@desc If *value* is specified, sets the id accessor to the specified function or string and returns this generator. If *value* is not specified, returns the current id accessor.
|
|
@@ -3787,22 +3787,22 @@ var M=p?3:1;0<M;M--)if("break"===(n=>{var t=s.find(function(t){t=u.get(t);if(t)r
|
|
|
3787
3787
|
function value(d, i) {
|
|
3788
3788
|
return d.id || "" + i;
|
|
3789
3789
|
}
|
|
3790
|
-
*/id(t){return arguments.length?(this._id="function"==typeof t?t:
|
|
3790
|
+
*/id(t){return arguments.length?(this._id="function"==typeof t?t:Bt(t),this):this._id}
|
|
3791
3791
|
/**
|
|
3792
3792
|
@memberof Tooltip
|
|
3793
3793
|
@desc If *value* is specified, sets the offset accessor to the specified function or number and returns this generator. If *value* is not specified, returns the current offset accessor.
|
|
3794
3794
|
@param {Function|Number} [*value* = 10]
|
|
3795
|
-
*/offset(t){return arguments.length?(this._offset="function"==typeof t?t:
|
|
3795
|
+
*/offset(t){return arguments.length?(this._offset="function"==typeof t?t:Bt(t),this):this._offset}
|
|
3796
3796
|
/**
|
|
3797
3797
|
@memberof Tooltip
|
|
3798
3798
|
@desc If *value* is specified, sets the padding accessor to the specified function or string and returns this generator. If *value* is not specified, returns the current padding accessor.
|
|
3799
3799
|
@param {Function|String} [*value* = "5px"]
|
|
3800
|
-
*/padding(t){return arguments.length?(this._padding="function"==typeof t?t:
|
|
3800
|
+
*/padding(t){return arguments.length?(this._padding="function"==typeof t?t:Bt(t),this):this._padding}
|
|
3801
3801
|
/**
|
|
3802
3802
|
@memberof Tooltip
|
|
3803
3803
|
@desc If *value* is specified, sets the pointer-events accessor to the specified function or string and returns this generator. If *value* is not specified, returns the current pointer-events accessor.
|
|
3804
3804
|
@param {Function|String} [*value* = "auto"]
|
|
3805
|
-
*/pointerEvents(t){return arguments.length?(this._pointerEvents="function"==typeof t?t:
|
|
3805
|
+
*/pointerEvents(t){return arguments.length?(this._pointerEvents="function"==typeof t?t:Bt(t),this):this._pointerEvents}
|
|
3806
3806
|
/**
|
|
3807
3807
|
@memberof Tooltip
|
|
3808
3808
|
@desc If *value* is specified, sets the position accessor to the specified function or array and returns this generator. If *value* is not specified, returns the current position accessor. If *value* is an HTMLElement, anchors the Tooltip to that HTMLElement. If *value* is a selection string, anchors the Tooltip to the HTMLElement selected by that string. Otherwise, coordinate points must be in reference to the client viewport, not the overall page.
|
|
@@ -3811,7 +3811,7 @@ var M=p?3:1;0<M;M--)if("break"===(n=>{var t=s.find(function(t){t=u.get(t);if(t)r
|
|
|
3811
3811
|
function value(d) {
|
|
3812
3812
|
return [d.x, d.y];
|
|
3813
3813
|
}
|
|
3814
|
-
*/position(t){return arguments.length?(this._position="string"==typeof t?
|
|
3814
|
+
*/position(t){return arguments.length?(this._position="string"==typeof t?Bt(H(t).node()||[0,0]):"function"==typeof t?t:Bt(t),this):this._position}
|
|
3815
3815
|
/**
|
|
3816
3816
|
@memberof Tooltip
|
|
3817
3817
|
@desc If *value* is specified, sets the table styles to the specified values and returns this generator. If *value* is not specified, returns the current table styles.
|
|
@@ -3863,7 +3863,7 @@ var M=p?3:1;0<M;M--)if("break"===(n=>{var t=s.find(function(t){t=u.get(t);if(t)r
|
|
|
3863
3863
|
function value(d) {
|
|
3864
3864
|
return d.title || "";
|
|
3865
3865
|
}
|
|
3866
|
-
*/title(t){return arguments.length?(this._title="function"==typeof t?t:
|
|
3866
|
+
*/title(t){return arguments.length?(this._title="function"==typeof t?t:Bt(t),this):this._title}
|
|
3867
3867
|
/**
|
|
3868
3868
|
@memberof Tooltip
|
|
3869
3869
|
@desc If *value* is specified, sets the title styles to the specified values and returns this generator. If *value* is not specified, returns the current title styles.
|
|
@@ -3905,14 +3905,14 @@ var M=p?3:1;0<M;M--)if("break"===(n=>{var t=s.find(function(t){t=u.get(t);if(t)r
|
|
|
3905
3905
|
@memberof Tooltip
|
|
3906
3906
|
@desc If *value* is specified, sets the width accessor to the specified function or string and returns this generator. If *value* is not specified, returns the current width accessor.
|
|
3907
3907
|
@param {Function|String} [*value* = "auto"]
|
|
3908
|
-
*/width(t){return arguments.length?(this._width="function"==typeof t?t:
|
|
3908
|
+
*/width(t){return arguments.length?(this._width="function"==typeof t?t:Bt(t),this):this._width}
|
|
3909
3909
|
/**
|
|
3910
3910
|
@memberof Tooltip
|
|
3911
3911
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
3912
3912
|
@private
|
|
3913
|
-
*/constructor(){super(),this._arrow=p("arrow",""),this._arrowStyle={content:"",background:"inherit",border:"inherit","border-width":"0 1px 1px 0",height:"10px",position:"absolute",transform:"rotate(45deg)",width:"10px","z-index":"-1"},this._background=
|
|
3913
|
+
*/constructor(){super(),this._arrow=p("arrow",""),this._arrowStyle={content:"",background:"inherit",border:"inherit","border-width":"0 1px 1px 0",height:"10px",position:"absolute",transform:"rotate(45deg)",width:"10px","z-index":"-1"},this._background=Bt(Rh.light),this._body=p("body",""),this._bodyStyle={"font-size":"12px","font-weight":"400","z-index":"1"},this._border=Bt("1px solid rgba(0, 0, 0, 0.25)"),this._borderRadius=Bt("4px"),this._className="d3plus-tooltip",this._data=[],this._footer=p("footer",""),this._footerStyle={"font-size":"9px","font-weight":"400","margin-top":"5px","z-index":"1"},this._height=Bt("auto"),this._id=(t,n)=>""+n,this._offset=Bt(5),this._padding=Bt("10px"),this._pointerEvents=Bt("auto"),this._popperClasses={},this._position=t=>[t.x,t.y],this._prefix="-webkit-transform"in document.body.style?"-webkit-":"-moz-transform"in document.body.style?"-moz-":"-ms-transform"in document.body.style?"-ms-":"-o-transform"in document.body.style?"-o-":"",this._tableStyle={"border-collapse":"collapse","border-spacing":"0",width:"100%"},this._tbody=[],this._tbodyStyle={"font-size":"12px","text-align":"center"},this._thead=[],this._theadStyle={"font-size":"12px","font-weight":"600","text-align":"center"},this._title=p("title",""),this._titleStyle={"font-size":"14px","font-weight":"600","margin-bottom":"5px"},this._tooltipStyle={"box-shadow":"0 1px 5px rgba(0, 0, 0, 0.25)",color:Rh.dark,"font-family":ze(Te)},this._trStyle={"border-top":(t,n)=>n?"1px solid rgba(0, 0, 0, 0.1)":"none"},this._tdStyle={},this._width=Bt("150px")}}var Nd=[].slice,Pd={};function Ld(t){this._size=t,this._call=this._error=null,this._tasks=[],this._data=[],this._waiting=this._active=this._ended=this._start=0}function Bd(n){if(!n._start)try{for(var t=n;t._start=t._waiting&&t._active<t._size;){var e=t._ended+t._active,i=t._tasks[e],a=i.length-1,r=i[a];i[a]=((e,i)=>function(t,n){e._tasks[i]&&(// ignore multiple callbacks
|
|
3914
3914
|
--e._active,++e._ended,(e._tasks[i]=null)==e._error)&&(// ignore secondary errors
|
|
3915
|
-
null!=t?Od(e,t):(e._data[i]=n,(e._waiting?
|
|
3915
|
+
null!=t?Od(e,t):(e._data[i]=n,(e._waiting?Bd:Dd)(e)))})(t,e),--t._waiting,++t._active,i=r.apply(null,i),t._tasks[e]&&(// task finished synchronously
|
|
3916
3916
|
t._tasks[e]=i||Pd)}}catch(t){if(n._tasks[n._ended+n._active-1])Od(n,t);// task errored synchronously
|
|
3917
3917
|
else if(!n._data)throw t;// await callback errored synchronously
|
|
3918
3918
|
}}function Od(t,n){var e,i=t._tasks.length;// prevent starting
|
|
@@ -3920,19 +3920,19 @@ for(t._error=n,// ignore active callbacks
|
|
|
3920
3920
|
t._data=void 0,// allow gc
|
|
3921
3921
|
t._waiting=NaN;0<=--i;)if((e=t._tasks[i])&&(t._tasks[i]=null,e.abort))try{e.abort()}catch(n){}t._active=NaN,// allow notification
|
|
3922
3922
|
Dd(t)}function Dd(t){var n;!t._active&&t._call&&(n=t._data,t._data=void 0,// allow gc
|
|
3923
|
-
t._call(t._error,n))}function jd(t){if(null==t)t=1/0;else if(!(1<=(t=+t)))throw new Error("invalid concurrency");return new
|
|
3923
|
+
t._call(t._error,n))}function jd(t){if(null==t)t=1/0;else if(!(1<=(t=+t)))throw new Error("invalid concurrency");return new Ld(t)}Ld.prototype=jd.prototype={constructor:Ld,defer:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("defer after await");var n;return null==this._error&&((n=Nd.call(arguments,1)).push(t),++this._waiting,this._tasks.push(n),Bd(this)),this},abort:function(){return null==this._error&&Od(this,new Error("abort")),this},await:function(e){if("function"!=typeof e)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=function(t,n){e.apply(null,[t].concat(n))},Dd(this),this},awaitAll:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=t,Dd(this),this}};var Rd=t=>()=>t;function Fd(t,{sourceEvent:n,target:e,transform:i,dispatch:a}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:a}})}function Id(t,n,e){this.k=t,this.x=n,this.y=e}Id.prototype={constructor:Id,scale:function(t){return 1===t?this:new Id(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new Id(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Hd=new Id(1,0,0);function Gd(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Hd;return t.__zoom}function Kd(t){t.stopImmediatePropagation()}function Ud(t){t.preventDefault(),t.stopImmediatePropagation()}
|
|
3924
3924
|
// Ignore right-click, since that should open the context menu.
|
|
3925
3925
|
// except for pinch-to-zoom, which is sent as a wheel+ctrlKey event
|
|
3926
|
-
function Wd(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function qd(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function $d(){return this.__zoom||Hd}function Vd(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Yd(){return navigator.maxTouchPoints||"ontouchstart"in this}function Zd(t,n,e){var i=t.invertX(n[0][0])-e[0][0],a=t.invertX(n[1][0])-e[1][0],r=t.invertY(n[0][1])-e[0][1],n=t.invertY(n[1][1])-e[1][1];return t.translate(i<a?(i+a)/2:Math.min(0,i)||Math.max(0,a),r<n?(r+n)/2:Math.min(0,r)||Math.max(0,n))}function Xd(){var h,u,s,c=Wd,g=qd,d=Zd,r=Vd,n=Yd,o=[0,1/0],f=[[-1/0,-1/0],[1/0,1/0]],l=250,p=de,e=xt("start","zoom","end"),_=500,m=150,y=0,v=10;function b(t){t.property("__zoom",$d).on("wheel.zoom",a,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",A).filter(n).on("touchstart.zoom",z).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",E).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(t,n){return(n=Math.max(o[0],Math.min(o[1],n)))===t.k?t:new
|
|
3926
|
+
function Wd(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function qd(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function $d(){return this.__zoom||Hd}function Vd(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Yd(){return navigator.maxTouchPoints||"ontouchstart"in this}function Zd(t,n,e){var i=t.invertX(n[0][0])-e[0][0],a=t.invertX(n[1][0])-e[1][0],r=t.invertY(n[0][1])-e[0][1],n=t.invertY(n[1][1])-e[1][1];return t.translate(i<a?(i+a)/2:Math.min(0,i)||Math.max(0,a),r<n?(r+n)/2:Math.min(0,r)||Math.max(0,n))}function Xd(){var h,u,s,c=Wd,g=qd,d=Zd,r=Vd,n=Yd,o=[0,1/0],f=[[-1/0,-1/0],[1/0,1/0]],l=250,p=de,e=xt("start","zoom","end"),_=500,m=150,y=0,v=10;function b(t){t.property("__zoom",$d).on("wheel.zoom",a,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",A).filter(n).on("touchstart.zoom",z).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",E).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(t,n){return(n=Math.max(o[0],Math.min(o[1],n)))===t.k?t:new Id(n,t.x,t.y)}function w(t,n,e){var i=n[0]-e[0]*t.k,n=n[1]-e[1]*t.k;return i===t.x&&n===t.y?t:new Id(t.k,i,n)}function S(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function k(t,e,l,h){t.on("start.zoom",function(){C(this,arguments).event(h).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(h).end()}).tween("zoom",function(){var t=arguments,i=C(this,t).event(h),n=g.apply(this,t),a=null==l?S(n):"function"==typeof l?l.apply(this,t):l,r=Math.max(n[1][0]-n[0][0],n[1][1]-n[0][1]),n=this.__zoom,o="function"==typeof e?e.apply(this,t):e,s=p(n.invert(a).concat(r/n.k),o.invert(a).concat(r/o.k));return function(t){var n,e;t=1===t?o:(n=s(t),new Id(e=r/n[2],a[0]-n[0]*e,a[1]-n[1]*e)),i.zoom(null,t)}})}function C(t,n,e){return!e&&t.__zooming||new i(t,n)}function i(t,n){this.that=t,this.args=n,this.active=0,this.sourceEvent=null,this.extent=g.apply(t,n),this.taps=0}function a(t,...n){if(c.apply(this,arguments)){var e=C(this,n).event(t),n=this.__zoom,i=Math.max(o[0],Math.min(o[1],n.k*Math.pow(2,r.apply(this,arguments)))),a=vt(t);
|
|
3927
3927
|
// If the mouse is in the same location as before, reuse it.
|
|
3928
3928
|
// If there were recent wheel events, reset the wheel idle timeout.
|
|
3929
3929
|
if(e.wheel)e.mouse[0][0]===a[0]&&e.mouse[0][1]===a[1]||(e.mouse[1]=n.invert(e.mouse[0]=a)),clearTimeout(e.wheel);else{if(n.k===i)return;e.mouse=[a,n.invert(a)],cn(this),e.start()}Ud(t),e.wheel=setTimeout(function(){e.wheel=null,e.end()},m),e.zoom("mouse",d(w(x(n,i),e.mouse[0],e.mouse[1]),e.extent,f))}}function M(t,...n){var i,a,e,r,o;!s&&c.apply(this,arguments)&&(i=t.currentTarget,a=C(this,n,!0).event(t),e=H(t.view).on("mousemove.zoom",function(t){{var n,e;Ud(t),a.moved||(n=t.clientX-r,e=t.clientY-o,a.moved=y<n*n+e*e)}a.event(t).zoom("mouse",d(w(a.that.__zoom,a.mouse[0]=vt(t,i),a.mouse[1]),a.extent,f))},!0).on("mouseup.zoom",function(t){e.on("mousemove.zoom mouseup.zoom",null),Uc(t.view,a.moved),Ud(t),a.event(t).end()},!0),n=vt(t,i),r=t.clientX,o=t.clientY,Kc(t.view),Kd(t),a.mouse=[n,this.__zoom.invert(n)],cn(this),a.start())}function A(t,...n){var e,i,a,r;c.apply(this,arguments)&&(r=this.__zoom,e=vt(t.changedTouches?t.changedTouches[0]:t,this),i=r.invert(e),a=r.k*(t.shiftKey?.5:2),r=d(w(x(r,a),e,i),g.apply(this,n),f),Ud(t),0<l?H(this).transition().duration(l).call(k,r,e,t):H(this).call(b.transform,r,e,t))}function z(t,...n){if(c.apply(this,arguments)){var e,i,a,r,o=t.touches,s=o.length,l=C(this,n,t.changedTouches.length===s).event(t);for(Kd(t),i=0;i<s;++i)r=[r=vt(a=o[i],this),this.__zoom.invert(r),a.identifier],l.touch0?l.touch1||l.touch0[2]===r[2]||(l.touch1=r,l.taps=0):(l.touch0=r,e=!0,l.taps=1+!!h);h=h&&clearTimeout(h),e&&(l.taps<2&&(u=r[0],h=setTimeout(function(){h=null},_)),cn(this),l.start())}}function T(t,...n){if(this.__zooming){var e,i=C(this,n).event(t),a=t.changedTouches,r=a.length;for(Ud(t),e=0;e<r;++e)c=vt(u=a[e],this),i.touch0&&i.touch0[2]===u.identifier?i.touch0[0]=c:i.touch1&&i.touch1[2]===u.identifier&&(i.touch1[0]=c);if(u=i.that.__zoom,i.touch1)var n=i.touch0[0],t=i.touch0[1],o=i.touch1[0],s=i.touch1[1],l=(l=o[0]-n[0])*l+(l=o[1]-n[1])*l,h=(h=s[0]-t[0])*h+(h=s[1]-t[1])*h,u=x(u,Math.sqrt(l/h)),c=[(n[0]+o[0])/2,(n[1]+o[1])/2],l=[(t[0]+s[0])/2,(t[1]+s[1])/2];else{if(!i.touch0)return;c=i.touch0[0],l=i.touch0[1]}i.zoom("touch",d(w(u,c,l),i.extent,f))}}function E(t,...n){if(this.__zooming){var e,i,a=C(this,n).event(t),r=t.changedTouches,o=r.length;for(Kd(t),s&&clearTimeout(s),s=setTimeout(function(){s=null},_),e=0;e<o;++e)i=r[e],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0?a.touch0[1]=this.__zoom.invert(a.touch0[0]):(a.end(),
|
|
3930
3930
|
// If this was a dbltap, reroute to the (optional) dblclick.zoom handler.
|
|
3931
|
-
2===a.taps&&(i=vt(i,this),Math.hypot(u[0]-i[0],u[1]-i[1])<v)&&(n=H(this).on("dblclick.zoom"))&&n.apply(this,arguments))}}return b.transform=function(t,n,e,i){var a=t.selection?t.selection():t;a.property("__zoom",$d),t!==a?k(t,n,e,i):a.interrupt().each(function(){C(this,arguments).event(i).start().zoom(null,"function"==typeof n?n.apply(this,arguments):n).end()})},b.scaleBy=function(t,n,e,i){b.scaleTo(t,function(){return this.__zoom.k*("function"==typeof n?n.apply(this,arguments):n)},e,i)},b.scaleTo=function(t,r,o,n){b.transform(t,function(){var t=g.apply(this,arguments),n=this.__zoom,e=null==o?S(t):"function"==typeof o?o.apply(this,arguments):o,i=n.invert(e),a="function"==typeof r?r.apply(this,arguments):r;return d(w(x(n,a),e,i),t,f)},o,n)},b.translateBy=function(t,n,e,i){b.transform(t,function(){return d(this.__zoom.translate("function"==typeof n?n.apply(this,arguments):n,"function"==typeof e?e.apply(this,arguments):e),g.apply(this,arguments),f)},null,i)},b.translateTo=function(t,i,a,r,n){b.transform(t,function(){var t=g.apply(this,arguments),n=this.__zoom,e=null==r?S(t):"function"==typeof r?r.apply(this,arguments):r;return d(Hd.translate(e[0],e[1]).scale(n.k).translate("function"==typeof i?-i.apply(this,arguments):-i,"function"==typeof a?-a.apply(this,arguments):-a),t,f)},r,n)},i.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this).emit("start"),this},zoom:function(t,n){return this.mouse&&"mouse"!==t&&(this.mouse[1]=n.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=n.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=n.invert(this.touch1[0])),this.that.__zoom=n,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var n=H(this.that).datum();e.call(t,this.that,new
|
|
3931
|
+
2===a.taps&&(i=vt(i,this),Math.hypot(u[0]-i[0],u[1]-i[1])<v)&&(n=H(this).on("dblclick.zoom"))&&n.apply(this,arguments))}}return b.transform=function(t,n,e,i){var a=t.selection?t.selection():t;a.property("__zoom",$d),t!==a?k(t,n,e,i):a.interrupt().each(function(){C(this,arguments).event(i).start().zoom(null,"function"==typeof n?n.apply(this,arguments):n).end()})},b.scaleBy=function(t,n,e,i){b.scaleTo(t,function(){return this.__zoom.k*("function"==typeof n?n.apply(this,arguments):n)},e,i)},b.scaleTo=function(t,r,o,n){b.transform(t,function(){var t=g.apply(this,arguments),n=this.__zoom,e=null==o?S(t):"function"==typeof o?o.apply(this,arguments):o,i=n.invert(e),a="function"==typeof r?r.apply(this,arguments):r;return d(w(x(n,a),e,i),t,f)},o,n)},b.translateBy=function(t,n,e,i){b.transform(t,function(){return d(this.__zoom.translate("function"==typeof n?n.apply(this,arguments):n,"function"==typeof e?e.apply(this,arguments):e),g.apply(this,arguments),f)},null,i)},b.translateTo=function(t,i,a,r,n){b.transform(t,function(){var t=g.apply(this,arguments),n=this.__zoom,e=null==r?S(t):"function"==typeof r?r.apply(this,arguments):r;return d(Hd.translate(e[0],e[1]).scale(n.k).translate("function"==typeof i?-i.apply(this,arguments):-i,"function"==typeof a?-a.apply(this,arguments):-a),t,f)},r,n)},i.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this).emit("start"),this},zoom:function(t,n){return this.mouse&&"mouse"!==t&&(this.mouse[1]=n.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=n.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=n.invert(this.touch1[0])),this.that.__zoom=n,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var n=H(this.that).datum();e.call(t,this.that,new Fd(t,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:e}),n)}},b.wheelDelta=function(t){return arguments.length?(r="function"==typeof t?t:Rd(+t),b):r},b.filter=function(t){return arguments.length?(c="function"==typeof t?t:Rd(!!t),b):c},b.touchable=function(t){return arguments.length?(n="function"==typeof t?t:Rd(!!t),b):n},b.extent=function(t){return arguments.length?(g="function"==typeof t?t:Rd([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),b):g},b.scaleExtent=function(t){return arguments.length?(o[0]=+t[0],o[1]=+t[1],b):[o[0],o[1]]},b.translateExtent=function(t){return arguments.length?(f[0][0]=+t[0][0],f[1][0]=+t[1][0],f[0][1]=+t[0][1],f[1][1]=+t[1][1],b):[[f[0][0],f[0][1]],[f[1][0],f[1][1]]]},b.constrain=function(t){return arguments.length?(d=t,b):d},b.duration=function(t){return arguments.length?(l=+t,b):l},b.interpolate=function(t){return arguments.length?(p=t,b):p},b.on=function(){var t=e.on.apply(e,arguments);return t===e?b:t},b.clickDistance=function(t){return arguments.length?(y=(t=+t)*t,b):Math.sqrt(y)},b.tapDistance=function(t){return arguments.length?(v=+t,b):v},b}Gd.prototype=Id.prototype;var Jd,ch={exports:{}};function Qd(t){if(!(this instanceof Qd))return new Qd(t);this._LRUCacheState=new tf(t)}function tf(t){this.capacity=0<t?+t:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE,this.data=Object.create?Object.create(null):{},this.hash=Object.create?Object.create(null):{},this.linkedList=new nf}function nf(){this.length=0,this.head=null,this.end=null}function ef(t){this.key=t,this.p=null,this.n=null}
|
|
3932
3932
|
// 更新链表,把get或put方法操作的key提到链表head,即表示最新
|
|
3933
3933
|
function af(t,n){n!==t.head&&(t.end?t.end===n&&(t.end=n.n):t.end=n,rf(n.n,n.p),rf(n,t.head),t.head=n,t.head.n=null)}
|
|
3934
3934
|
// 对两个链表对象建立链接,形成一条链
|
|
3935
|
-
function rf(t,n){t!==n&&(t&&(t.p=n),n)&&(n.n=t)}Jd||(Jd=1,ch.exports=((dh=Qd.prototype).get=function(t){var n=this._LRUCacheState,e=n.hash[t];if(e)return af(n.linkedList,e),n.data[t]},dh.set=function(t,n){var e=this._LRUCacheState,i=e.hash[t];return void 0!==n&&(i||(e.hash[t]=new ef(t),e.linkedList.length+=1,i=e.hash[t]),af(e.linkedList,i),e.data[t]=n,e.linkedList.length>e.capacity)&&this.remove(e.linkedList.end.key),this},dh.update=function(t,n){return this.has(t)&&this.set(t,n(this.get(t))),this},dh.remove=function(t){var n=this._LRUCacheState,e=n.hash[t];return e&&(e===n.linkedList.head&&(n.linkedList.head=e.p),e===n.linkedList.end&&(n.linkedList.end=e.n),rf(e.n,e.p),delete n.hash[t],delete n.data[t],--n.linkedList.length),this},dh.removeAll=function(){return this._LRUCacheState=new tf(this._LRUCacheState.capacity),this},dh.info=function(){var t=this._LRUCacheState;return{capacity:t.capacity,length:t.linkedList.length}},dh.keys=function(){for(var t=[],n=this._LRUCacheState.linkedList.head;n;)t.push(n.key),n=n.p;return t},dh.has=function(t){return!!this._LRUCacheState.hash[t]},dh.staleKey=function(){return this._LRUCacheState.linkedList.end&&this._LRUCacheState.linkedList.end.key},dh.popStale=function(){var t,n=this.staleKey();return n?(t=[n,this._LRUCacheState.data[n]],this.remove(n),t):null},Qd));var of=
|
|
3935
|
+
function rf(t,n){t!==n&&(t&&(t.p=n),n)&&(n.n=t)}Jd||(Jd=1,ch.exports=((dh=Qd.prototype).get=function(t){var n=this._LRUCacheState,e=n.hash[t];if(e)return af(n.linkedList,e),n.data[t]},dh.set=function(t,n){var e=this._LRUCacheState,i=e.hash[t];return void 0!==n&&(i||(e.hash[t]=new ef(t),e.linkedList.length+=1,i=e.hash[t]),af(e.linkedList,i),e.data[t]=n,e.linkedList.length>e.capacity)&&this.remove(e.linkedList.end.key),this},dh.update=function(t,n){return this.has(t)&&this.set(t,n(this.get(t))),this},dh.remove=function(t){var n=this._LRUCacheState,e=n.hash[t];return e&&(e===n.linkedList.head&&(n.linkedList.head=e.p),e===n.linkedList.end&&(n.linkedList.end=e.n),rf(e.n,e.p),delete n.hash[t],delete n.data[t],--n.linkedList.length),this},dh.removeAll=function(){return this._LRUCacheState=new tf(this._LRUCacheState.capacity),this},dh.info=function(){var t=this._LRUCacheState;return{capacity:t.capacity,length:t.linkedList.length}},dh.keys=function(){for(var t=[],n=this._LRUCacheState.linkedList.head;n;)t.push(n.key),n=n.p;return t},dh.has=function(t){return!!this._LRUCacheState.hash[t]},dh.staleKey=function(){return this._LRUCacheState.linkedList.end&&this._LRUCacheState.linkedList.end.key},dh.popStale=function(){var t,n=this.staleKey();return n?(t=[n,this._LRUCacheState.data[n]],this.remove(n),t):null},Qd));var of=Fe(ch.exports);
|
|
3936
3936
|
/**
|
|
3937
3937
|
@function _drawBack
|
|
3938
3938
|
@desc Draws a back button if there are states in this._history.
|
|
@@ -3953,7 +3953,7 @@ function rf(t,n){t!==n&&(t&&(t.p=n),n)&&(n.n=t)}Jd||(Jd=1,ch.exports=((dh=Qd.pro
|
|
|
3953
3953
|
@desc Renders the legend if this._legend is not falsy.
|
|
3954
3954
|
@param {Array} data The filtered data array to be displayed.
|
|
3955
3955
|
@private
|
|
3956
|
-
*/function uf(t=[]){let e=[],i=(t,n,e)=>{var i=this._shape(t,n),i=("fill"===e&&"Line"===i&&(e="stroke"),(this._shapeConfig[i]&&this._shapeConfig[i][e]?this._shapeConfig[i]:this._shapeConfig)[e]);return"function"==typeof i?i.bind(this)(t,n):i};var n=(n,e)=>lf.map(t=>i(n,e,t)).join("_"),a=(qi(this._colorScale?t.filter((t,n)=>void 0===this._colorScale(t,n)):t,t=>e.push(cu(t,this._aggs)),n),e.sort(this._legendSort),e.map((t,n)=>this._ids(t,n).slice(0,this._drawDepth+1)));for(let n=this._legendDepth=0;n<=this._drawDepth;n++){var r=a.map(t=>t[n]);if(!r.some(t=>t instanceof Array)&&Array.from(new Set(r)).length===e.length){this._legendDepth=n;break}}let o=(t,n)=>{let e=this._id(t,n);return e instanceof Array&&(e=e[0]),this._hidden.includes(e)||this._solo.length&&!this._solo.includes(e)};var t=this._legendClass.outerBounds(),s=this.config();let l=this._legendPosition.bind(this)(s);[!1,"top","bottom","left","right"].includes(l)||(l="bottom");var h=["top","bottom"].includes(l),u=this._legendPadding()?this._padding:{top:0,right:0,bottom:0,left:0},c={transform:`translate(${h?this._margin.left+u.left:this._margin.left}, ${h?this._margin.top:this._margin.top+u.top})`},s=this._legend.bind(this)(s,e),c=Pt("g.d3plus-viz-legend",{condition:s&&!this._legendConfig.select,enter:c,parent:this._select,duration:this._duration,update:c}).node();this._legendClass.id(n).align(h?"center":l).direction(h?"row":"column").duration(this._duration).data(s?e:[]).height(h?this._height-(this._margin.bottom+this._margin.top):this._height-(this._margin.bottom+this._margin.top+u.bottom+u.top)).locale(this._locale).parent(this).select(c).shape((t,n)=>"Circle"===this._shape(t,n)?"Circle":"Rect").verticalAlign(h?l:"middle").width(h?this._width-(this._margin.left+this._margin.right+u.left+u.right):this._width-(this._margin.left+this._margin.right)).shapeConfig(
|
|
3956
|
+
*/function uf(t=[]){let e=[],i=(t,n,e)=>{var i=this._shape(t,n),i=("fill"===e&&"Line"===i&&(e="stroke"),(this._shapeConfig[i]&&this._shapeConfig[i][e]?this._shapeConfig[i]:this._shapeConfig)[e]);return"function"==typeof i?i.bind(this)(t,n):i};var n=(n,e)=>lf.map(t=>i(n,e,t)).join("_"),a=(qi(this._colorScale?t.filter((t,n)=>void 0===this._colorScale(t,n)):t,t=>e.push(cu(t,this._aggs)),n),e.sort(this._legendSort),e.map((t,n)=>this._ids(t,n).slice(0,this._drawDepth+1)));for(let n=this._legendDepth=0;n<=this._drawDepth;n++){var r=a.map(t=>t[n]);if(!r.some(t=>t instanceof Array)&&Array.from(new Set(r)).length===e.length){this._legendDepth=n;break}}let o=(t,n)=>{let e=this._id(t,n);return e instanceof Array&&(e=e[0]),this._hidden.includes(e)||this._solo.length&&!this._solo.includes(e)};var t=this._legendClass.outerBounds(),s=this.config();let l=this._legendPosition.bind(this)(s);[!1,"top","bottom","left","right"].includes(l)||(l="bottom");var h=["top","bottom"].includes(l),u=this._legendPadding()?this._padding:{top:0,right:0,bottom:0,left:0},c={transform:`translate(${h?this._margin.left+u.left:this._margin.left}, ${h?this._margin.top:this._margin.top+u.top})`},s=this._legend.bind(this)(s,e),c=Pt("g.d3plus-viz-legend",{condition:s&&!this._legendConfig.select,enter:c,parent:this._select,duration:this._duration,update:c}).node();this._legendClass.id(n).align(h?"center":l).direction(h?"row":"column").duration(this._duration).data(s?e:[]).height(h?this._height-(this._margin.bottom+this._margin.top):this._height-(this._margin.bottom+this._margin.top+u.bottom+u.top)).locale(this._locale).parent(this).select(c).shape((t,n)=>"Circle"===this._shape(t,n)?"Circle":"Rect").verticalAlign(h?l:"middle").width(h?this._width-(this._margin.left+this._margin.right+u.left+u.right):this._width-(this._margin.left+this._margin.right)).shapeConfig(Lt.bind(this)(this._shapeConfig,"legend")).shapeConfig({fill:(t,n)=>o(t,n)?this._hiddenColor(t,n):i(t,n,"fill"),labelConfig:{fontOpacity:(t,n)=>o(t,n)?this._hiddenOpacity(t,n):1}}).config(this._legendConfig).render(),!this._legendConfig.select&&t.height&&(this._margin[l]+=h?t.height+2*this._legendClass.padding():t.width+2*this._legendClass.padding())}
|
|
3957
3957
|
/**
|
|
3958
3958
|
@function _drawSubtitle
|
|
3959
3959
|
@desc Draws a subtitle if this._subtitle is defined.
|
|
@@ -4060,7 +4060,7 @@ this._brushGroup.call(this._zoomBrush.move,null),mf.bind(this)(t.selection))}.bi
|
|
|
4060
4060
|
* @param {Object} d Data Object
|
|
4061
4061
|
* @param {Number} i Index of Data Object in Array
|
|
4062
4062
|
* @private
|
|
4063
|
-
*/function wf(t,n,e){for(;n.__d3plus__&&n.data;)e=(n=n.data).i;return t(n,e)}class Sf extends
|
|
4063
|
+
*/function wf(t,n,e){for(;n.__d3plus__&&n.data;)e=(n=n.data).i;return t(n,e)}class Sf extends Li{
|
|
4064
4064
|
/**
|
|
4065
4065
|
@memberof Viz
|
|
4066
4066
|
@desc Called by draw before anything is drawn. Formats the data and performs preparations for draw.
|
|
@@ -4202,13 +4202,13 @@ return H("body").on("touchstart."+this._uuid,
|
|
|
4202
4202
|
@desc Tells the colorScale whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the colorScale appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.
|
|
4203
4203
|
@param {Boolean|Function} [*value*]
|
|
4204
4204
|
@chainable
|
|
4205
|
-
*/colorScalePadding(t){return arguments.length?(this._colorScalePadding="function"==typeof t?t:
|
|
4205
|
+
*/colorScalePadding(t){return arguments.length?(this._colorScalePadding="function"==typeof t?t:Bt(t),this):this._colorScalePadding}
|
|
4206
4206
|
/**
|
|
4207
4207
|
@memberof Viz
|
|
4208
4208
|
@desc Defines which side of the visualization to anchor the color scale. Acceptable values are `"top"`, `"bottom"`, `"left"`, `"right"`, and `false`. A `false` value will cause the color scale to not be displayed, but will still color shapes based on the scale.
|
|
4209
4209
|
@param {Function|String|Boolean} [*value* = "bottom"]
|
|
4210
4210
|
@chainable
|
|
4211
|
-
*/colorScalePosition(t){return arguments.length?(this._colorScalePosition="function"==typeof t?t:
|
|
4211
|
+
*/colorScalePosition(t){return arguments.length?(this._colorScalePosition="function"==typeof t?t:Bt(t),this):this._colorScalePosition}
|
|
4212
4212
|
/**
|
|
4213
4213
|
@memberof Viz
|
|
4214
4214
|
@desc Sets the maximum pixel size for drawing the color scale: width for horizontal scales and height for vertical scales.
|
|
@@ -4325,31 +4325,31 @@ return H("body").on("touchstart."+this._uuid,
|
|
|
4325
4325
|
@desc Defines the color used for legend shapes when the corresponding grouping is hidden from display (by clicking on the legend).
|
|
4326
4326
|
@param {Function|String} [*value* = "#aaa"]
|
|
4327
4327
|
@chainable
|
|
4328
|
-
*/hiddenColor(t){return arguments.length?(this._hiddenColor="function"==typeof t?t:
|
|
4328
|
+
*/hiddenColor(t){return arguments.length?(this._hiddenColor="function"==typeof t?t:Bt(t),this):this._hiddenColor}
|
|
4329
4329
|
/**
|
|
4330
4330
|
@memberof Viz
|
|
4331
4331
|
@desc Defines the opacity used for legend labels when the corresponding grouping is hidden from display (by clicking on the legend).
|
|
4332
4332
|
@param {Function|Number} [*value* = 0.5]
|
|
4333
4333
|
@chainable
|
|
4334
|
-
*/hiddenOpacity(t){return arguments.length?(this._hiddenOpacity="function"==typeof t?t:
|
|
4334
|
+
*/hiddenOpacity(t){return arguments.length?(this._hiddenOpacity="function"==typeof t?t:Bt(t),this):this._hiddenOpacity}
|
|
4335
4335
|
/**
|
|
4336
4336
|
@memberof Viz
|
|
4337
4337
|
@desc If *value* is specified, sets the hover method to the specified function and returns the current class instance.
|
|
4338
4338
|
@param {Function} [*value*]
|
|
4339
4339
|
@chainable
|
|
4340
|
-
*/hover(n){let i=this._hover=n;if(1!==this._shapeConfig.hoverOpacity){if("function"==typeof n){let t=oa(this._shapes.map(t=>t.data()));t=t.concat(this._legendClass.data());n=n?t.filter(n):[];let e=[];n.map(this._ids).forEach(n=>{for(let t=1;t<=n.length;t++)e.push(JSON.stringify(n.slice(0,t)))}),(e=e.filter((t,n)=>e.indexOf(t)===n)).length&&(i=(t,n)=>e.includes(JSON.stringify(this._ids(t,n))))}this._shapes.forEach(t=>t.hover(i)),this._legend&&this._legendClass.hover(i)}return this}
|
|
4340
|
+
*/hover(n){let i=this._hover=n;if(1!==this._shapeConfig.hoverOpacity&&void 0!==n){if("function"==typeof n){let t=oa(this._shapes.map(t=>t.data()));t=t.concat(this._legendClass.data());n=n?t.filter(n):[];let e=[];n.map(this._ids).forEach(n=>{for(let t=1;t<=n.length;t++)e.push(JSON.stringify(n.slice(0,t)))}),(e=e.filter((t,n)=>e.indexOf(t)===n)).length&&(i=(t,n)=>e.includes(JSON.stringify(this._ids(t,n))))}this._shapes.forEach(t=>t.hover(i)),this._legend&&this._legendClass.hover(i)}return this}
|
|
4341
4341
|
/**
|
|
4342
4342
|
@memberof Viz
|
|
4343
4343
|
@desc If *value* is specified, sets the label accessor to the specified function or string and returns the current class instance.
|
|
4344
4344
|
@param {Function|String} [*value*]
|
|
4345
4345
|
@chainable
|
|
4346
|
-
*/label(t){return arguments.length?(this._label="function"==typeof t?t:
|
|
4346
|
+
*/label(t){return arguments.length?(this._label="function"==typeof t?t:Bt(t),this):this._label}
|
|
4347
4347
|
/**
|
|
4348
4348
|
@memberof Viz
|
|
4349
4349
|
@desc If *value* is specified, toggles the legend based on the specified boolean and returns the current class instance.
|
|
4350
4350
|
@param {Boolean|Function} [*value* = true]
|
|
4351
4351
|
@chainable
|
|
4352
|
-
*/legend(t){return arguments.length?(this._legend="function"==typeof t?t:
|
|
4352
|
+
*/legend(t){return arguments.length?(this._legend="function"==typeof t?t:Bt(t),this):this._legend}
|
|
4353
4353
|
/**
|
|
4354
4354
|
@memberof Viz
|
|
4355
4355
|
@desc If *value* is specified, the object is passed to the legend's config method.
|
|
@@ -4361,19 +4361,19 @@ return H("body").on("touchstart."+this._uuid,
|
|
|
4361
4361
|
@desc Defines the click functionality of categorical legend squares. When set to false, clicking will hide that category and shift+clicking will solo that category. When set to true, clicking with solo that category and shift+clicking will hide that category.
|
|
4362
4362
|
@param {Boolean|Function} [*value* = false]
|
|
4363
4363
|
@chainable
|
|
4364
|
-
*/legendFilterInvert(t){return arguments.length?(this._legendFilterInvert="function"==typeof t?t:
|
|
4364
|
+
*/legendFilterInvert(t){return arguments.length?(this._legendFilterInvert="function"==typeof t?t:Bt(t),this):this._legendFilterInvert}
|
|
4365
4365
|
/**
|
|
4366
4366
|
@memberof Viz
|
|
4367
4367
|
@desc Tells the legend whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the legend appears centered underneath the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.
|
|
4368
4368
|
@param {Boolean|Function} [*value*]
|
|
4369
4369
|
@chainable
|
|
4370
|
-
*/legendPadding(t){return arguments.length?(this._legendPadding="function"==typeof t?t:
|
|
4370
|
+
*/legendPadding(t){return arguments.length?(this._legendPadding="function"==typeof t?t:Bt(t),this):this._legendPadding}
|
|
4371
4371
|
/**
|
|
4372
4372
|
@memberof Viz
|
|
4373
4373
|
@desc Defines which side of the visualization to anchor the legend. Expected values are `"top"`, `"bottom"`, `"left"`, and `"right"`.
|
|
4374
4374
|
@param {Function|String} [*value* = "bottom"]
|
|
4375
4375
|
@chainable
|
|
4376
|
-
*/legendPosition(t){return arguments.length?(this._legendPosition="function"==typeof t?t:
|
|
4376
|
+
*/legendPosition(t){return arguments.length?(this._legendPosition="function"==typeof t?t:Bt(t),this):this._legendPosition}
|
|
4377
4377
|
/**
|
|
4378
4378
|
@memberof Viz
|
|
4379
4379
|
@desc A JavaScript [sort comparator function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) used to sort the legend.
|
|
@@ -4391,7 +4391,7 @@ return H("body").on("touchstart."+this._uuid,
|
|
|
4391
4391
|
@desc Sets the inner HTML of the status message that is displayed when loading AJAX requests and displaying errors. Must be a valid HTML string or a function that, when passed this Viz instance, returns a valid HTML string.
|
|
4392
4392
|
@param {Function|String} [*value*]
|
|
4393
4393
|
@chainable
|
|
4394
|
-
*/loadingHTML(t){return arguments.length?(this._loadingHTML="function"==typeof t?t:
|
|
4394
|
+
*/loadingHTML(t){return arguments.length?(this._loadingHTML="function"==typeof t?t:Bt(t),this):this._loadingHTML}
|
|
4395
4395
|
/**
|
|
4396
4396
|
@memberof Viz
|
|
4397
4397
|
@desc Toggles the visibility of the status message that is displayed when loading AJAX requests and displaying errors.
|
|
@@ -4415,7 +4415,7 @@ return H("body").on("touchstart."+this._uuid,
|
|
|
4415
4415
|
@desc Sets the inner HTML of the status message that is displayed when no data is supplied to the visualization. Must be a valid HTML string or a function that, when passed this Viz instance, returns a valid HTML string.
|
|
4416
4416
|
@param {Function|String} [*value*]
|
|
4417
4417
|
@chainable
|
|
4418
|
-
*/noDataHTML(t){return arguments.length?(this._noDataHTML="function"==typeof t?t:
|
|
4418
|
+
*/noDataHTML(t){return arguments.length?(this._noDataHTML="function"==typeof t?t:Bt(t),this):this._noDataHTML}
|
|
4419
4419
|
/**
|
|
4420
4420
|
@memberof Viz
|
|
4421
4421
|
@desc Toggles the visibility of the status message that is displayed when no data is supplied to the visualization.
|
|
@@ -4439,7 +4439,7 @@ return H("body").on("touchstart."+this._uuid,
|
|
|
4439
4439
|
@desc Changes the primary shape used to represent each data point in a visualization. Not all visualizations support changing shapes, this method can be provided the String name of a D3plus shape class (for example, "Rect" or "Circle"), or an accessor Function that returns the String class name to be used for each individual data point.
|
|
4440
4440
|
@param {String|Function} [*value*]
|
|
4441
4441
|
@chainable
|
|
4442
|
-
*/shape(t){return arguments.length?(this._shape="function"==typeof t?t:
|
|
4442
|
+
*/shape(t){return arguments.length?(this._shape="function"==typeof t?t:Bt(t),this):this._shape}
|
|
4443
4443
|
/**
|
|
4444
4444
|
@memberof Viz
|
|
4445
4445
|
@desc If *value* is specified, sets the config method for each shape and returns the current class instance.
|
|
@@ -4451,7 +4451,7 @@ return H("body").on("touchstart."+this._uuid,
|
|
|
4451
4451
|
@desc If *value* is specified, sets the subtitle accessor to the specified function or string and returns the current class instance.
|
|
4452
4452
|
@param {Function|String} [*value*]
|
|
4453
4453
|
@chainable
|
|
4454
|
-
*/subtitle(t){return arguments.length?(this._subtitle="function"==typeof t?t:
|
|
4454
|
+
*/subtitle(t){return arguments.length?(this._subtitle="function"==typeof t?t:Bt(t),this):this._subtitle}
|
|
4455
4455
|
/**
|
|
4456
4456
|
@memberof Viz
|
|
4457
4457
|
@desc If *value* is specified, sets the config method for the subtitle and returns the current class instance.
|
|
@@ -4463,7 +4463,7 @@ return H("body").on("touchstart."+this._uuid,
|
|
|
4463
4463
|
@desc Tells the subtitle whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the subtitle appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.
|
|
4464
4464
|
@param {Boolean|Function} [*value*]
|
|
4465
4465
|
@chainable
|
|
4466
|
-
*/subtitlePadding(t){return arguments.length?(this._subtitlePadding="function"==typeof t?t:
|
|
4466
|
+
*/subtitlePadding(t){return arguments.length?(this._subtitlePadding="function"==typeof t?t:Bt(t),this):this._subtitlePadding}
|
|
4467
4467
|
/**
|
|
4468
4468
|
@memberof Viz
|
|
4469
4469
|
@desc If *value* is specified, sets the description accessor to the specified string and returns the current class instance.
|
|
@@ -4481,7 +4481,7 @@ return H("body").on("touchstart."+this._uuid,
|
|
|
4481
4481
|
@desc If *value* is specified, sets the threshold for buckets to the specified function or string, and returns the current class instance.
|
|
4482
4482
|
@param {Function|Number} [value]
|
|
4483
4483
|
@chainable
|
|
4484
|
-
*/threshold(t){return arguments.length?("function"==typeof t?this._threshold=t:isFinite(t)&&!isNaN(t)&&(this._threshold=
|
|
4484
|
+
*/threshold(t){return arguments.length?("function"==typeof t?this._threshold=t:isFinite(t)&&!isNaN(t)&&(this._threshold=Bt(+t)),this):this._threshold}
|
|
4485
4485
|
/**
|
|
4486
4486
|
@memberof Viz
|
|
4487
4487
|
@desc If *value* is specified, sets the accesor for the value used in the threshold algorithm, and returns the current class instance.
|
|
@@ -4493,7 +4493,7 @@ return H("body").on("touchstart."+this._uuid,
|
|
|
4493
4493
|
@desc If *value* is specified, sets the label for the bucket item, and returns the current class instance.
|
|
4494
4494
|
@param {Function|String} [value]
|
|
4495
4495
|
@chainable
|
|
4496
|
-
*/thresholdName(t){return arguments.length?(this._thresholdName="function"==typeof t?t:
|
|
4496
|
+
*/thresholdName(t){return arguments.length?(this._thresholdName="function"==typeof t?t:Bt(t),this):this._thresholdName}
|
|
4497
4497
|
/**
|
|
4498
4498
|
@memberof Viz
|
|
4499
4499
|
@desc If *value* is specified, sets the time accessor to the specified function or string and returns the current class instance.
|
|
@@ -4529,13 +4529,13 @@ return H("body").on("touchstart."+this._uuid,
|
|
|
4529
4529
|
@desc Tells the timeline whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the timeline appears centered underneath the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.
|
|
4530
4530
|
@param {Boolean|Function} [*value*]
|
|
4531
4531
|
@chainable
|
|
4532
|
-
*/timelinePadding(t){return arguments.length?(this._timelinePadding="function"==typeof t?t:
|
|
4532
|
+
*/timelinePadding(t){return arguments.length?(this._timelinePadding="function"==typeof t?t:Bt(t),this):this._timelinePadding}
|
|
4533
4533
|
/**
|
|
4534
4534
|
@memberof Viz
|
|
4535
4535
|
@desc If *value* is specified, sets the title accessor to the specified function or string and returns the current class instance.
|
|
4536
4536
|
@param {Function|String} [*value*]
|
|
4537
4537
|
@chainable
|
|
4538
|
-
*/title(t){return arguments.length?(this._title="function"==typeof t?t:
|
|
4538
|
+
*/title(t){return arguments.length?(this._title="function"==typeof t?t:Bt(t),this):this._title}
|
|
4539
4539
|
/**
|
|
4540
4540
|
@memberof Viz
|
|
4541
4541
|
@desc If *value* is specified, sets the config method for the title and returns the current class instance.
|
|
@@ -4547,13 +4547,13 @@ return H("body").on("touchstart."+this._uuid,
|
|
|
4547
4547
|
@desc Tells the title whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the title appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.
|
|
4548
4548
|
@param {Boolean|Function} [*value*]
|
|
4549
4549
|
@chainable
|
|
4550
|
-
*/titlePadding(t){return arguments.length?(this._titlePadding="function"==typeof t?t:
|
|
4550
|
+
*/titlePadding(t){return arguments.length?(this._titlePadding="function"==typeof t?t:Bt(t),this):this._titlePadding}
|
|
4551
4551
|
/**
|
|
4552
4552
|
@memberof Viz
|
|
4553
4553
|
@desc If *value* is specified, toggles the tooltip based on the specified boolean and returns the current class instance.
|
|
4554
4554
|
@param {Boolean|Function} [*value* = true]
|
|
4555
4555
|
@chainable
|
|
4556
|
-
*/tooltip(t){return arguments.length?(this._tooltip="function"==typeof t?t:
|
|
4556
|
+
*/tooltip(t){return arguments.length?(this._tooltip="function"==typeof t?t:Bt(t),this):this._tooltip}
|
|
4557
4557
|
/**
|
|
4558
4558
|
@memberof Viz
|
|
4559
4559
|
@desc If *value* is specified, sets the config method for the tooltip and returns the current class instance.
|
|
@@ -4583,7 +4583,7 @@ return H("body").on("touchstart."+this._uuid,
|
|
|
4583
4583
|
@desc Tells the total whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the total appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.
|
|
4584
4584
|
@param {Boolean|Function} [*value*]
|
|
4585
4585
|
@chainable
|
|
4586
|
-
*/totalPadding(t){return arguments.length?(this._totalPadding="function"==typeof t?t:
|
|
4586
|
+
*/totalPadding(t){return arguments.length?(this._totalPadding="function"==typeof t?t:Bt(t),this):this._totalPadding}
|
|
4587
4587
|
/**
|
|
4588
4588
|
@memberof Viz
|
|
4589
4589
|
@desc If *value* is specified, sets the overallwidth to the specified number and returns the current class instance.
|
|
@@ -4666,7 +4666,7 @@ return H("body").on("touchstart."+this._uuid,
|
|
|
4666
4666
|
@memberof Viz
|
|
4667
4667
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
4668
4668
|
@private
|
|
4669
|
-
*/constructor(){super(),this._aggs={},this._ariaHidden=!0,this._attribution=!1,this._attributionStyle={background:"rgba(255, 255, 255, 0.75)",border:"1px solid rgba(0, 0, 0, 0.25)",color:"rgba(0, 0, 0, 0.75)",display:"block",font:"400 11px/11px "+ze(Te),margin:"5px",opacity:.75,padding:"4px 6px 3px"},this._backClass=(new
|
|
4669
|
+
*/constructor(){super(),this._aggs={},this._ariaHidden=!0,this._attribution=!1,this._attributionStyle={background:"rgba(255, 255, 255, 0.75)",border:"1px solid rgba(0, 0, 0, 0.25)",color:"rgba(0, 0, 0, 0.75)",display:"block",font:"400 11px/11px "+ze(Te),margin:"5px",opacity:.75,padding:"4px 6px 3px"},this._backClass=(new Ic).on("click",()=>{(this._history.length?this.config(this._history.pop()):this.depth(this._drawDepth-1).filter(!1)).render()}).on("mousemove",()=>this._backClass.select().style("cursor","pointer")),this._backConfig={fontSize:10,padding:5,resize:!1},this._cache=!0,this._color=(t,n)=>this._groupBy[0](t,n),this._colorDefaults={...Rh,scale:ba().range(Rh.scale.range())},this._colorScaleClass=new jc,this._colorScaleConfig={axisConfig:{rounding:"inside"},scale:"jenks"},this._colorScalePadding=xf,this._colorScalePosition=()=>this._width>1.5*this._height?"right":"bottom",this._colorScaleMaxSize=600,this._data=[],this._dataCutoff=100,this._detectResize=!0,this._detectResizeDelay=400,this._detectVisible=!0,this._detectVisibleInterval=1e3,this._downloadButton=!1,this._downloadConfig={type:"png"},this._downloadPosition="top",this._duration=600,this._fontFamily=Te,this._hidden=[],this._hiddenColor=Bt("#aaa"),this._hiddenOpacity=Bt(.5),this._history=[],this._groupBy=[p("id")],this._legend=(t,n)=>{var e=Ot(n,(t,n)=>{t=this._groupBy[this._legendDepth].bind(this)(t,n);return t instanceof Array?t.length:1});return 1<n.length&&e<=2},this._legendClass=new Dc,this._legendConfig={label:hf.bind(this),shapeConfig:{ariaLabel:hf.bind(this),labelConfig:{fontColor:void 0,fontResize:!1,padding:0}}},this._legendFilterInvert=Bt(!1),this._legendPadding=xf,this._legendPosition=()=>this._width>1.5*this._height?"right":"bottom",this._legendSort=(t,n)=>this._drawLabel(t).localeCompare(this._drawLabel(n)),this._legendTooltip={},this._loadingHTML=()=>`
|
|
4670
4670
|
<div style="left: 50%; top: 50%; position: absolute; transform: translate(-50%, -50%);">
|
|
4671
4671
|
<strong>${this._translate("Loading Visualization")}</strong>
|
|
4672
4672
|
<sub style="bottom: 0; display: block; line-height: 1; margin-top: 5px;"><a href="https://d3plus.org" target="_blank">${this._translate("Powered by D3plus")}</a></sub>
|
|
@@ -4706,7 +4706,7 @@ this._on[t].toString()!==n),r=this._on["click.shape"]&&this._on["click.shape"].t
|
|
|
4706
4706
|
this._select.style("cursor",e||r&&o?"pointer":"auto"),a.touches?[a.touches[0].clientX,a.touches[0].clientY]:[a.clientX,a.clientY]);
|
|
4707
4707
|
// does the shape still have our default "click.shape" event?
|
|
4708
4708
|
// (if the user only sets "click", both functions will fire)
|
|
4709
|
-
this._tooltipClass.data([i||t]).footer(!(!r||!o)&&this._translate("Click to Expand")).title(this._drawLabel).position(e).config(
|
|
4709
|
+
this._tooltipClass.data([i||t]).footer(!(!r||!o)&&this._translate("Click to Expand")).title(this._drawLabel).position(e).config(Lt.bind(this)(this._tooltipConfig)).render()}}.bind(this),"mousemove.legend":function(e,i,a,r){var r=r.touches?[r.touches[0].clientX,r.touches[0].clientY]:[r.clientX,r.clientY],o=oa(this._legendClass.data().map((t,n)=>{let e=this._id(t,n);return e=e instanceof Array?e:[e]})).length;if(e&&this._tooltip(e,i)){let t=this._id(e,i);t instanceof Array&&(t=t[0]);i=this._translate;let n=bf.bind(this).toString();
|
|
4710
4710
|
// does the legend have any user-defined click events?
|
|
4711
4711
|
var s=Object.keys(this._on).some(t=>// all valid click event keys,
|
|
4712
4712
|
["click","click.legend"].includes(t)&&// truthy values (no nulls),
|
|
@@ -4716,7 +4716,7 @@ this._on[t].toString()!==n),l=this._on["click.legend"]&&this._on["click.legend"]
|
|
|
4716
4716
|
this._select.style("cursor",s||l&&h?"pointer":"auto"),this._legendFilterInvert.bind(this)()),h=this._solo.includes(t),u=this._hidden.includes(t);
|
|
4717
4717
|
// does the legend still have our default "click.legend" event?
|
|
4718
4718
|
// (if the user only sets "click", both functions will fire)
|
|
4719
|
-
this._tooltipClass.data([a||e]).footer(!!l&&(s?this._solo.length&&!h||u?i("Click to Highlight"):1===this._solo.length&&h||this._hidden.length===o-1?i("Click to Show All"):i("Click to Highlight")+"<br />"+i("Shift+Click to Hide"):this._solo.length&&!h||u?i("Click to Show")+"<br />"+i("Shift+Click to Highlight"):1===this._solo.length&&h||this._hidden.length===o-1?i("Click to Show All"):i("Click to Hide")+"<br />"+i("Shift+Click to Highlight"))).title(this._legendConfig.label?this._legendClass.label():hf.bind(this)).position(r).config(
|
|
4719
|
+
this._tooltipClass.data([a||e]).footer(!!l&&(s?this._solo.length&&!h||u?i("Click to Highlight"):1===this._solo.length&&h||this._hidden.length===o-1?i("Click to Show All"):i("Click to Highlight")+"<br />"+i("Shift+Click to Hide"):this._solo.length&&!h||u?i("Click to Show")+"<br />"+i("Shift+Click to Highlight"):1===this._solo.length&&h||this._hidden.length===o-1?i("Click to Show All"):i("Click to Hide")+"<br />"+i("Shift+Click to Highlight"))).title(this._legendConfig.label?this._legendClass.label():hf.bind(this)).position(r).config(Lt.bind(this)(this._tooltipConfig)).config(Lt.bind(this)(this._legendTooltip)).render()}}.bind(this)},this._queue=[],this._resizeObserver=new ResizeObserver(((e,i)=>{let a;return function(...t){let n=this;clearTimeout(a),a=setTimeout(()=>e.apply(n,t),i)}})(()=>{this._setSVGSize(),this.render(this._callback)},this._detectResizeDelay)),this._scrollContainer="undefined"==typeof window?"":window,this._shape=Bt("Rect"),this._shapes=[],this._shapeConfig={ariaLabel:(t,n)=>this._drawLabel(t,n),fill:(n,e)=>{for(;n.__d3plus__&&n.data;)e=(n=n.data).i;if(this._colorScale){let t=this._colorScale(n,e);var i,a;if(null!=t)return i=this._colorScaleClass._colorScale,a=this._colorScaleClass.color(),i?i.domain().length?i(t):i.range()[i.range().length-1]:a instanceof Array?a[a.length-1]:a}let t=this._color(n,e);return zn(t)?t:Ih("string"==typeof t?t:JSON.stringify(t),this._colorDefaults)},labelConfig:{fontColor:(t,n)=>Hh("function"==typeof this._shapeConfig.fill?this._shapeConfig.fill(t,n):this._shapeConfig.fill)},opacity:Bt(1),stroke:(t,n)=>zn("function"==typeof this._shapeConfig.fill?this._shapeConfig.fill(t,n):this._shapeConfig.fill).darker(.25),role:"presentation",strokeWidth:Bt(0)},this._solo=[],this._subtitleClass=new Ic,this._subtitleConfig={ariaHidden:!0,fontSize:12,padding:5,resize:!1,textAnchor:"middle"},this._subtitlePadding=xf,this._svgDesc="",this._svgTitle="",this._timeline=!0,this._timelineClass=(new yg).align("end"),this._timelineConfig={padding:5},this._timelinePadding=xf,this._threshold=Bt(1e-4),this._thresholdKey=void 0,this._thresholdName=()=>this._translate("Values"),this._titleClass=new Ic,this._titleConfig={ariaHidden:!0,fontSize:16,padding:5,resize:!1,textAnchor:"middle"},this._titlePadding=xf,this._tooltip=Bt(!0),this._tooltipClass=new Ed,this._tooltipConfig={pointerEvents:"none",titleStyle:{"max-width":"200px"}},this._totalClass=new Ic,this._totalConfig={fontSize:10,padding:5,resize:!1,textAnchor:"middle"},this._totalFormat=t=>this._translate("Total")+": "+Hu(t,this._locale),this._totalPadding=xf,this._zoom=!1,this._zoomBehavior=Xd(),this._zoomBrush=_g(rg),this._zoomBrushHandleSize=1,this._zoomBrushHandleStyle={fill:"#444"},this._zoomBrushSelectionStyle={fill:"#777","stroke-width":0},this._zoomControlStyle={background:"rgba(255, 255, 255, 0.75)",border:"1px solid rgba(0, 0, 0, 0.75)",color:"rgba(0, 0, 0, 0.75)",display:"block",font:"900 15px/21px "+ze(Te),height:"20px",margin:"5px",opacity:.75,padding:0,"text-align":"center",width:"20px"},this._zoomControlStyleActive={background:"rgba(0, 0, 0, 0.75)",color:"rgba(255, 255, 255, 0.75)",opacity:1},this._zoomControlStyleHover={cursor:"pointer",opacity:1},this._zoomFactor=2,this._zoomMax=16,this._zoomPadding=20,this._zoomPan=!0,this._zoomScroll=!0}}
|
|
4720
4720
|
/**
|
|
4721
4721
|
@module discreteBuffer
|
|
4722
4722
|
@desc Adds left/right padding to a point or time scale.
|
|
@@ -4745,7 +4745,7 @@ this._tooltipClass.data([a||e]).footer(!!l&&(s?this._solo.length&&!h||u?i("Click
|
|
|
4745
4745
|
@param {Object} [config]
|
|
4746
4746
|
@param {Number} [buffer] Defaults to the radius of the largest Circle.
|
|
4747
4747
|
@private
|
|
4748
|
-
*/let zf=mn.theme,Tf=new yc,Ef=new
|
|
4748
|
+
*/let zf=mn.theme,Tf=new yc,Ef=new Ic,Nf={Bar:function({data:t,x:n,y:e,x2:i,y2:a,buffer:r=10}){let o=i?"x2":"x",s=a?"y2":"y";var l,a=(i="x"===this._discrete?e:n).domain().slice();let h="x"===this._discrete;h&&a.reverse();let u,c,g=(u=this._stacked?(l=ca().key(t=>t[this._discrete]+"_"+t.group).entries(t).map(t=>t.values.map(t=>t[h?s:o])),c=l.map(t=>sa(t.filter(t=>0<t))),l.map(t=>sa(t.filter(t=>t<0)))):(l=t.map(t=>t[h?s:o]),c=l.filter(t=>0<t),l.filter(t=>t<0)),i(Ot(c))),d=((h?g<i(0):g>i(0))&&(g+=h?-r:r),g=i.invert(g),i(Dt(u)));return(h?d>i(0):d<i(0))&&(d+=h?r:-r),d=i.invert(d),g>a[1]&&(a[1]=g),d<a[0]&&(a[0]=d),h&&a.reverse(),i.domain(a),[n,e]}
|
|
4749
4749
|
/**
|
|
4750
4750
|
@module boxBuffer
|
|
4751
4751
|
@desc Adds a buffer to either side of the non-discrete axis.
|
|
@@ -4783,11 +4783,11 @@ this._tooltipClass.data([a||e]).footer(!!l&&(s?this._solo.length&&!h||u?i("Click
|
|
|
4783
4783
|
/**
|
|
4784
4784
|
@desc Logic for determining stackOrder ascending using groups.
|
|
4785
4785
|
@private
|
|
4786
|
-
*/function
|
|
4786
|
+
*/function Lf(t){let e=t.map(Of),i=t.map(t=>t.key.split("_")[0]);return zh(t).sort((t,n)=>i[n].localeCompare(i[t])||e[t]-e[n])}
|
|
4787
4787
|
/**
|
|
4788
4788
|
@desc Logic for determining stackOrder descending using groups.
|
|
4789
4789
|
@private
|
|
4790
|
-
*/function
|
|
4790
|
+
*/function Bf(t){return Lf(t).reverse()}
|
|
4791
4791
|
/**
|
|
4792
4792
|
@desc Logic for determining default sum of shapes using the stackSum function used in d3Shape.
|
|
4793
4793
|
@private
|
|
@@ -4820,19 +4820,19 @@ this._aggs[n]||this._discrete!==t||(this._aggs[n]=(t,n)=>{t=Array.from(new Set(t
|
|
|
4820
4820
|
Extends the draw behavior of the abstract Viz class.
|
|
4821
4821
|
@private
|
|
4822
4822
|
*/_draw(ot){if(this._filteredData.length||this._annotations.length){
|
|
4823
|
-
/* Determines whether or not any of the x or y axes are a "time" axis. */var st=!!this._time&&this._time(this._filteredData[0],0);let i=this._x2Time=st&&this._x2(this._filteredData[0],0)===st,a=this._xTime=st&&this._x(this._filteredData[0],0)===st,D=this._y2Time=st&&this._y2(this._filteredData[0],0)===st,j=this._yTime=st&&this._y(this._filteredData[0],0)===st,R=a||i||j||D,
|
|
4823
|
+
/* Determines whether or not any of the x or y axes are a "time" axis. */var st=!!this._time&&this._time(this._filteredData[0],0);let i=this._x2Time=st&&this._x2(this._filteredData[0],0)===st,a=this._xTime=st&&this._x(this._filteredData[0],0)===st,D=this._y2Time=st&&this._y2(this._filteredData[0],0)===st,j=this._yTime=st&&this._y(this._filteredData[0],0)===st,R=a||i||j||D,F=(t,n)=>`${!R&&this._time?this._time(t,n):"time"}_`+(this._stacked?""+(1<this._groupBy.length?this._ids(t,n).slice(0,-1).join("_"):"group"):""+this._ids(t,n).join("_"));var st=(t,n)=>{t={__d3plus__:!0,data:t,group:F(t,n),i:n,hci:this._confidence&&this._confidence[1]&&this._confidence[1](t,n),id:this._ids(t,n).slice(0,this._drawDepth+1).join("_"),lci:this._confidence&&this._confidence[0]&&this._confidence[0](t,n),shape:this._shape(t,n),x:a?Nt(this._x(t,n)):this._x(t,n),x2:i?Nt(this._x2(t,n)):this._x2(t,n),y:j?Nt(this._y(t,n)):this._y(t,n),y2:D?Nt(this._y2(t,n)):this._y2(t,n)};return t.discrete="Bar"===t.shape?t[this._discrete]+"_"+t.group:""+t[this._discrete],t.id="Bar"===t.shape?t.id+"_"+t[this._discrete]:t.id,t};let o=this._formattedData=this._filteredData.map(st),s=this._axisPersist?this._data.map(st):o;this._size?(st=Hi(s,t=>this._size(t.data)),this._sizeScaleD3=Ts["scale"+this._sizeScale.charAt(0).toUpperCase()+this._sizeScale.slice(1)]().domain(st).range([st[0]===st[1]?this._sizeMax:Dt([this._sizeMax/2,this._sizeMin]),this._sizeMax])):this._sizeScaleD3=()=>this._sizeMin;var st=s.some(t=>void 0!==t.x2),lt=s.some(t=>void 0!==t.y2);let t=this._height-this._margin.top-this._margin.bottom,d=this._discrete?"x"===this._discrete?"y":"x":void 0,I=this._discrete?"x"===this._discrete?"y2":"x2":void 0,H=[d,I].filter(t=>t),n=this._select,e=this._transition,v=this._width-this._margin.left-this._margin.right;
|
|
4824
4824
|
/**
|
|
4825
4825
|
* @desc Returns all unique values for a given axis.
|
|
4826
4826
|
* @param {String} axis
|
|
4827
4827
|
* @returns {Array}
|
|
4828
4828
|
* @private
|
|
4829
|
-
*/var ht=zt.bind(this)("x"),ut=zt.bind(this)("x2"),ct=zt.bind(this)("y"),gt=zt.bind(this)("y2");let G,f,p,_;if(this._stacked){var dt=s.filter(t=>["Area","Bar"].includes(t.shape));let a=ca().key(t=>t.group).entries(dt).reduce((t,n)=>(t[n.key]||(t[n.key]=0),t[n.key]+=sa(n.values,t=>t[d]),t),{}),e=(s.sort((t,n)=>{var e,i;return this[`_${this._discrete}Sort`]?this[`_${this._discrete}Sort`](t.data,n.data):(e=t[this._discrete])-(i=n[this._discrete])!=0?e-i:t.group!==n.group?a[n.group]-a[t.group]:n[d]-t[d]}),G=Array.from(new Set(s.map(t=>t.discrete))),_=Array.from(new Set(s.map(t=>t.id))),(p=ca().key(t=>t.discrete).entries(s).map(t=>t.values)).forEach(i=>{let a=Array.from(new Set(i.map(t=>t.id)));a.length<_.length&&_.forEach(n=>{var t,e;a.includes(n)||"Area"===(t=s.filter(t=>t.id===n)[0]).shape&&(e=
|
|
4829
|
+
*/var ht=zt.bind(this)("x"),ut=zt.bind(this)("x2"),ct=zt.bind(this)("y"),gt=zt.bind(this)("y2");let G,f,p,_;if(this._stacked){var dt=s.filter(t=>["Area","Bar"].includes(t.shape));let a=ca().key(t=>t.group).entries(dt).reduce((t,n)=>(t[n.key]||(t[n.key]=0),t[n.key]+=sa(n.values,t=>t[d]),t),{}),e=(s.sort((t,n)=>{var e,i;return this[`_${this._discrete}Sort`]?this[`_${this._discrete}Sort`](t.data,n.data):(e=t[this._discrete])-(i=n[this._discrete])!=0?e-i:t.group!==n.group?a[n.group]-a[t.group]:n[d]-t[d]}),G=Array.from(new Set(s.map(t=>t.discrete))),_=Array.from(new Set(s.map(t=>t.id))),(p=ca().key(t=>t.discrete).entries(s).map(t=>t.values)).forEach(i=>{let a=Array.from(new Set(i.map(t=>t.id)));a.length<_.length&&_.forEach(n=>{var t,e;a.includes(n)||"Area"===(t=s.filter(t=>t.id===n)[0]).shape&&(e=F(t.data,t.i),e={__d3plus__:!0,data:t.data,discrete:"Bar"===t.shape?i[0][this._discrete]+"_"+e:""+i[0][this._discrete],group:e,id:t.id,ids:n,shape:t.shape,[this._discrete]:i[0][this._discrete],[d]:0},o.push(e))})}),this[`_${this._discrete}Sort`]?o.sort((t,n)=>this[`_${this._discrete}Sort`](t.data,n.data)):o.sort((t,n)=>t[this._discrete]-n[this._discrete]),this._stackOrder);e instanceof Array?_.sort((t,n)=>e.indexOf(t)-e.indexOf(n)):e===zh&&_.sort((t,n)=>t.localeCompare(n)),p=Nh().keys(_).offset(this._stackOffset).order(e instanceof Array?zh:e).value((t,n)=>{t=t.filter(t=>t.id===n);return t.length?t[0][d]:0})(p);dt="x"===this._discrete?ht:ct;f={[this._discrete]:this[`_${this._discrete}Time`]?Hi(dt):dt,[d]:[Dt(p.map(t=>Dt(t.map(t=>t[0])))),Ot(p.map(t=>Ot(t.map(t=>t[1]))))]}}else{let e=this._discrete||"x";this[`_${this._discrete}Sort`]?s.sort((t,n)=>this[`_${this._discrete}Sort`](t.data,n.data)):s.sort((t,n)=>t[e]-n[e]),f={x:!a&&"x"===this._discrete||this._xSort?ht:Hi(ht),x2:!i&&"x"===this._discrete||this._x2Sort?ut:Hi(ut),y:!j&&"y"===this._discrete||this._ySort?ct:Hi(ct),y2:!D&&"y"===this._discrete||this._y2Sort?gt:Hi(gt)}}
|
|
4830
4830
|
/**
|
|
4831
4831
|
* Determins default scale type and domain for a given axis.
|
|
4832
4832
|
* @param {String} axis
|
|
4833
4833
|
* @private
|
|
4834
|
-
*/let[K,m,U,W]=Tt.bind(this)("x"),[q,y,$,V]=Tt.bind(this)("y");dt=(n,t)=>{var e,i=this[`_${n}Config`].scale;return"auto"===i?this._discrete===n?t:3<
|
|
4835
|
-
/** */function t(e,i,a){if(e.defaultY||(e.defaultY=this._yAxis._getPosition(e.value)),i){var r=a[i-1],{fontSize:o,padding:s}=e,l=e.newY||e.defaultY;let n=r.newY||r.defaultY;l-o/2-s<n&&(l=h.find(t=>t<n),e.defaultY-l<u)&&(r.newY=l,i)&&t(r,i-1,a)}}.bind(this))}),et=z.reduce((t,n)=>(n.newY&&(t[n.id]=n.newY),t),{})),this._yFunc=x=(t,n)=>"y2"===n?("log"===l&&0===t&&(t=c[1]<0?this._y2Axis._d3ScaleNegative.domain()[0]:this._y2Axis._d3Scale.domain()[1]),this._y2Axis._getPosition.bind(this._y2Axis)(t)-T):("log"===r&&0===t&&(t=S[1]<0?this._yAxis._d3ScaleNegative.domain()[0]:this._yAxis._d3Scale.domain()[1]),this._yAxis._getPosition.bind(this._yAxis)(t)-T),this._xAxis.barConfig()["stroke-width"]);P&&(P/=2),(new mc).data([{}]).select(mt.node()).x(N[0]+(N[1]-N[0])/2).width(N[1]-N[0]).y(this._margin.top+kt+E[0]+(E[1]-E[0])/2).height(E[1]-E[0]).config(this._backgroundConfig).render();yt=z.filter(t=>void 0!==t.newY);if(yt.length){ot=Pt("g.d3plus-plot-connectors",{parent:n,transition:e,enter:{transform:_t},update:{transform:_t}}).node();let t=yt.map(t=>Et({x:this._xAxis._getPosition.bind(this._xAxis)(t.xValue),y:t.defaultY},t)).concat(yt.map(t=>Et({x:this._xAxis._getPosition.bind(this._xAxis)(t.xValue)+t.padding-1,y:t.newY||t.defaultY},t)));(new yc).config({data:t,stroke:t=>t.fontColor,x:t=>t.x,y:t=>t.y}).config(this._labelConnectorConfig).select(ot).render()}let it=Pt("g.d3plus-plot-annotations",{parent:n,transition:e,enter:{transform:_t},update:{transform:_t}}).node();pt=Pt("g.d3plus-plot-shapes",{parent:n,transition:e,enter:{transform:_t},update:{transform:_t}}).node();let at=Pt("g.d3plus-plot-annotations-front",{parent:n,transition:e,enter:{transform:_t},update:{transform:_t}}).node(),
|
|
4834
|
+
*/let[K,m,U,W]=Tt.bind(this)("x"),[q,y,$,V]=Tt.bind(this)("y");dt=(n,t)=>{var e,i=this[`_${n}Config`].scale;return"auto"===i?this._discrete===n?t:3<Ii(e=s.map(t=>t[n]))/ra(e)?"log":"linear":i||t};let r=this._yConfigScale=dt("y",y).toLowerCase(),l=this._y2ConfigScale=dt("y2",V).toLowerCase(),h=this._xConfigScale=dt("x",m).toLowerCase(),u=this._x2ConfigScale=dt("x2",W).toLowerCase(),b=(f={x:K,x2:U||K,y:q,y2:$||q},Object.keys(f).forEach(n=>{"log"===this[`_${n}ConfigScale`]&&f[n].includes(0)&&(Dt(f[n])<0?f[n][1]=Ot(o.map(t=>t[n]).filter(t=>![NaN,void 0,!1].includes(t))):f[n][0]=Dt(s.map(t=>t[n]).filter(t=>![NaN,void 0,!1].includes(t))))}),H.forEach(t=>{var n;this[`_${t}Config`].domain?(n=this[`_${t}Config`].domain,"x"===this._discrete&&n.reverse(),f[t]=n):t&&void 0!==this._baseline&&(n=this._baseline,f[t]&&f[t][0]>n?f[t][0]=n:f[t]&&f[t][1]<n&&(f[t][1]=n))}),Ts["scale"+m]().domain(f.x).range(jt(0,1+v,v/(f.x.length-1)))),Y=Ts["scale"+W]().domain(f.x2).range(jt(0,1+v,v/(f.x2.length-1))),x=Ts["scale"+y]().domain(f.y.reverse()).range(jt(0,1+t,t/(f.y.length-1))),Z=Ts["scale"+V]().domain(f.y2.reverse()).range(jt(0,1+t,t/(f.y2.length-1)));dt=ca().key(t=>t.shape).entries(o).sort((t,n)=>this._shapeSort(t.key,n.key));"Point"!==("x"===this._discrete?y:m)&&ca().key(t=>t.shape).entries(s).forEach(t=>{var n;["Bar","Box"].includes(t.key)&&kf("x"===this._discrete?b:x,o,this._discrete),this._buffer[t.key]&&(n=this._buffer[t.key].bind(this)({data:t.values,x:b,y:x,yScale:r,xScale:h,config:this._shapeConfig[t.key]}),b=n[0],x=n[1],n=this._buffer[t.key].bind(this)({data:t.values,x:Y,y:Z,yScale:l,xScale:u,x2:!0,y2:!0,config:this._shapeConfig[t.key]}),Y=n[0],Z=n[1])});let w=b.domain(),X=Y.domain(),S=x.domain(),c=Z.domain();var ft={barConfig:{"stroke-width":0},gridSize:0,labels:[],title:!1,tickSize:0},ut=st?{data:ut}:ft,gt=lt?{data:gt}:ft,ft=("x"!==this._discrete||this._width>this._discreteCutoff)&&this._width>this._xCutoff,pt=("y"!==this._discrete||this._height>this._discreteCutoff)&&this._height>this._yCutoff,ct={data:ct,locale:this._locale,rounding:this._yDomain?"none":"outside",scalePadding:x.padding?x.padding():0},_t=(!ft&&pt&&(ct.barConfig={stroke:"transparent"},ct.tickSize=0,ct.shapeConfig={labelBounds:(t,n)=>{var{width:t,y:e}=t.labelBounds,i=this._height/2;return{x:n?-i:0,y:e,width:t,height:i}},labelConfig:{padding:0,rotate:0},labelRotation:!1}),Pt("g.d3plus-plot-test",{enter:{opacity:0},parent:this._select})),mt=Lt.bind(this)(this._shapeConfig,"shape","Bar");let J=void 0!==mt.label?"function"==typeof mt.label?mt.label:Bt(mt.label):this._drawLabel,g=s.map(t=>J(t.data,t.i)).filter(t=>"number"==typeof t||t).map(String),k=uu(s.map(t=>t.x2)),C=(k="Point"===W&&k.every(t=>g.includes(""+t))?[]:null,uu(s.map(t=>t.x))),Q=(C="Point"===m&&C.every(t=>g.includes(""+t))?[]:null,uu(s.map(t=>t.y2))),M=(Q="Point"===V&&Q.every(t=>g.includes(""+t))?[]:null,uu(s.map(t=>t.y)));M="Point"===y&&M.every(t=>g.includes(""+t))?[]:null,pt&&this._yTest.domain(S).height(t).maxSize(v/2).range([void 0,void 0]).select(_t.node()).ticks(M).width(v).config(ct).config(this._yConfig).scale(r).render();var mt=this._yTest.outerBounds(),yt=mt.width?mt.width+this._yTest.padding():void 0,vt=(lt&&this._y2Test.domain(c).height(t).range([void 0,void 0]).select(_t.node()).ticks(Q).width(v).config(ct).config(gt).config(this._y2Config).scale(l).render(),this._y2Test.outerBounds()),bt=vt.width?vt.width+this._y2Test.padding():void 0,ht={data:ht,locale:this._locale,rounding:this._xDomain?"none":"outside",scalePadding:b.padding?b.padding():0};!pt&&ft&&(ht.barConfig={stroke:"transparent"},ht.tickSize=0,ht.shapeConfig={labelBounds:(t,n)=>{var{height:t,y:e}=t.labelBounds,i=this._width/2;return{x:n?-i:0,y:e,width:i,height:t}},labelConfig:{padding:0,rotate:0,textAnchor:t=>C&&t.id===C[0]?"start":"end"},labelRotation:!1});let A=void 0;ft&&this._xTest.domain(w).height(t).maxSize(t/2).range([void 0,A]).select(_t.node()).ticks(C).width(v).config(ht).config(this._xConfig).scale(h).render();let tt,z=[],nt=this._lineLabels&&!lt;if(nt){var xt=o.filter(t=>"Line"===t.shape&&("function"!=typeof this._lineLabels||this._lineLabels(t.data,t.i))),xt=ca().key(t=>t.id).entries(xt);if(xt.length){var wt=Lt.bind(this)(this._shapeConfig,"shape","Line"),St=(Tf.config(wt),Tf.labelConfig());let c=void 0!==St.fontColor?St.fontColor:Ef.fontColor(),g=void 0!==St.fontSize?St.fontSize:Ef.fontSize(),d=void 0!==St.fontWeight?St.fontWeight:Ef.fontWeight(),f=void 0!==St.fontFamily?St.fontFamily:Ef.fontFamily(),p=void 0!==St.padding?St.padding:Ef.padding(),_=wt.label||this._drawLabel,m=t=>("log"===h&&0===t&&(t=w[0]<0?this._xTest._d3Scale.domain()[1]:this._xTest._d3Scale.domain()[0]),this._xTest._getPosition.bind(this._xTest)(t)),y=t=>("log"===r&&0===t&&(t=S[0]<0?this._yTest._d3Scale.domain()[1]:this._yTest._d3Scale.domain()[0]),this._yTest._getPosition.bind(this._yTest)(t)),n=(z=xt.map(t=>{let n=t.values[t.values.length-1],e;for(;n.__d3plus__&&n.data;)n=n.data,e=n.i;var i="function"==typeof _?_(n,e):_,a="function"==typeof c?c(n,e):c,r="function"==typeof g?g(n,e):g,o="function"==typeof d?d(n,e):d;let s="function"==typeof f?f(n,e):f;s instanceof Array&&(s=s.map(t=>`'${t}'`).join(", "));var l="function"==typeof p?p(n,e):p,i=Ae(i,{"font-size":r,"font-family":s,"font-weight":o}),o=t.values.map(t=>[m(t.x),y(t.y)]);let h=Ot(t.values.map(t=>m(t.x)));var u=t.values.find(t=>m(t.x)===h).y;return{id:t.key,labelWidth:i+2*l,spaceNeeded:i+4*l,value:u,yEstimate:y(u),padding:l,fontSize:r,fontColor:a,maxX:h,xValue:Ot(t.values,t=>t.x),coords:o}}).sort((t,n)=>S[1]>S[0]?t.value-n.value:n.value-t.value).filter((t,n,e)=>{let{fontSize:i,id:a,labelWidth:r,maxX:o,yEstimate:s}=t;return 0===e.filter(n=>n.id!==a&&n.coords.some(t=>(t[0]>o||t[0]===o&&n.maxX!==o)&&t[0]<=o+r&&t[1]<=s+.75*i&&t[1]>=s-.75*i)).length}),Ot(z,t=>t.maxX));tt=Ot(z.map(t=>t.labelWidth));St=n===this._xTest._getRange.bind(this._xTest)()[1]?Ot(z.filter(t=>t.maxX===n),t=>t.spaceNeeded):0;St&&(wt=Dt([St,v/4]),A=v-wt-this._margin.right)}}ft&&A&&this._xTest.domain(w).height(t).maxSize(t/2).range([void 0,A]).select(_t.node()).ticks(C).width(v).config(ht).config(this._xConfig).scale(h).render(),st&&this._x2Test.domain(X).height(t).range([void 0,A]).select(_t.node()).ticks(k).width(v).config(ht).tickSize(0).config(ut).config(this._x2Config).scale(u).render();xt=this._xTest._getRange(),St=this._x2Test._getRange(),wt=this._x2Test.outerBounds();let T=st?wt.height+this._x2Test.padding():0;var wt=Ot([yt,xt[0],St[0]]),kt=(ft&&this._xTest.range([wt,void 0]).render(),pt?this._yTest.shapeConfig().labelConfig.fontSize()/2:0),Ct=Ot([bt,v-xt[1],v-St[1]]),Mt=this._xTest.outerBounds().height+(pt?this._xTest.padding():0),ot=(this._padding.left+=wt,this._padding.right+=Ct,this._padding.bottom+=Mt,this._padding.top+=T+kt,super._draw(ot),this._margin.left+this._margin.right),At=this._margin.top+this._margin.bottom;let E=[T,t-(Mt+kt+At)],N=(pt&&this._yTest.domain(S).height(t).maxSize(v/2).range(E).select(_t.node()).ticks(M).width(v).config(ct).config(this._yConfig).scale(r).render(),wt=Ot([yt=(mt=this._yTest.outerBounds()).width?mt.width+this._yTest.padding():void 0,xt[0],St[0]]),lt&&this._y2Test.config(ct).domain(c).gridSize(0).height(t).range(E).select(_t.node()).width(v-Ot([0,Ct-bt])).title(!1).config(this._y2Config).config(gt).scale(l).render(),Ct=Ot([0,bt=(vt=this._y2Test.outerBounds()).width?vt.width+this._y2Test.padding():void 0,v-xt[1],v-St[1]]),[wt,v-(Ct+ot)]);mt=Pt("g.d3plus-plot-background",{parent:n,transition:e}),_t=`translate(${this._margin.left}, ${this._margin.top+T+kt})`,vt=`translate(${this._margin.left}, ${this._margin.top+kt})`,xt=Pt("g.d3plus-plot-x-axis",{parent:n,transition:e,enter:{transform:_t},update:{transform:_t,opacity:ft?1:0}}),St=st&&Pt("g.d3plus-plot-x2-axis",{parent:n,transition:e,enter:{transform:vt},update:{transform:vt}}),ot=`translate(${this._margin.left+(yt<wt?wt-yt:0)}, ${this._margin.top+kt})`,ft=Pt("g.d3plus-plot-y-axis",{parent:n,transition:e,enter:{transform:ot},update:{transform:ot,opacity:pt?1:0}}),vt=`translate(-${this._margin.right}, ${this._margin.top+kt})`,wt=lt&&Pt("g.d3plus-plot-y2-axis",{parent:n,transition:e,enter:{transform:vt},update:{transform:vt}});this._xAxis.domain(w).height(t-(T+kt+At)).maxSize(t/2).range(N).select(xt.node()).ticks(C).width(v).config(ht).config(this._xConfig).scale(h).render(),st&&this._x2Axis.domain(X).height(t-(Mt+kt+At)).range(N).select(St.node()).ticks(k).width(v).config(ht).config(ut).config(this._x2Config).scale(u).render(),this._xFunc=b=(t,n)=>("x2"===n?("log"===u&&0===t&&(t=X[0]<0?this._x2Axis._d3Scale.domain()[1]:this._x2Axis._d3Scale.domain()[0]),this._x2Axis._getPosition.bind(this._x2Axis)):("log"===h&&0===t&&(t=w[0]<0?this._xAxis._d3Scale.domain()[1]:this._xAxis._d3Scale.domain()[0]),this._xAxis._getPosition.bind(this._xAxis)))(t),E=[this._xAxis.outerBounds().y+T,t-(Mt+kt+At)],this._yAxis.domain(S).height(t).maxSize(v/2).range(E).select(ft.node()).ticks(M).width(N[N.length-1]).config(ct).config(this._yConfig).scale(r).render(),lt&&this._y2Axis.config(ct).domain(lt?c:S).gridSize(0).height(t).range(E).select(wt.node()).width(v-Ot([0,Ct-bt])).title(!1).config(this._y2Config).config(gt).scale(l).render();let et={},P=(z&&(ca().key(t=>t.xValue).entries(z).forEach(({values:t})=>{var n=Ot(t.map(t=>t.fontSize));let h=jt(E[0],E[1],n).reverse(),u=(E[1]-E[0])/8;t.forEach(
|
|
4835
|
+
/** */function t(e,i,a){if(e.defaultY||(e.defaultY=this._yAxis._getPosition(e.value)),i){var r=a[i-1],{fontSize:o,padding:s}=e,l=e.newY||e.defaultY;let n=r.newY||r.defaultY;l-o/2-s<n&&(l=h.find(t=>t<n),e.defaultY-l<u)&&(r.newY=l,i)&&t(r,i-1,a)}}.bind(this))}),et=z.reduce((t,n)=>(n.newY&&(t[n.id]=n.newY),t),{})),this._yFunc=x=(t,n)=>"y2"===n?("log"===l&&0===t&&(t=c[1]<0?this._y2Axis._d3ScaleNegative.domain()[0]:this._y2Axis._d3Scale.domain()[1]),this._y2Axis._getPosition.bind(this._y2Axis)(t)-T):("log"===r&&0===t&&(t=S[1]<0?this._yAxis._d3ScaleNegative.domain()[0]:this._yAxis._d3Scale.domain()[1]),this._yAxis._getPosition.bind(this._yAxis)(t)-T),this._xAxis.barConfig()["stroke-width"]);P&&(P/=2),(new mc).data([{}]).select(mt.node()).x(N[0]+(N[1]-N[0])/2).width(N[1]-N[0]).y(this._margin.top+kt+E[0]+(E[1]-E[0])/2).height(E[1]-E[0]).config(this._backgroundConfig).render();yt=z.filter(t=>void 0!==t.newY);if(yt.length){ot=Pt("g.d3plus-plot-connectors",{parent:n,transition:e,enter:{transform:_t},update:{transform:_t}}).node();let t=yt.map(t=>Et({x:this._xAxis._getPosition.bind(this._xAxis)(t.xValue),y:t.defaultY},t)).concat(yt.map(t=>Et({x:this._xAxis._getPosition.bind(this._xAxis)(t.xValue)+t.padding-1,y:t.newY||t.defaultY},t)));(new yc).config({data:t,stroke:t=>t.fontColor,x:t=>t.x,y:t=>t.y}).config(this._labelConnectorConfig).select(ot).render()}let it=Pt("g.d3plus-plot-annotations",{parent:n,transition:e,enter:{transform:_t},update:{transform:_t}}).node();pt=Pt("g.d3plus-plot-shapes",{parent:n,transition:e,enter:{transform:_t},update:{transform:_t}}).node();let at=Pt("g.d3plus-plot-annotations-front",{parent:n,transition:e,enter:{transform:_t},update:{transform:_t}}).node(),L=(Object.keys(this._previousAnnotations).forEach(n=>{let e="front"===n?at:it;var t=this._annotations.filter(t=>"back"===n&&!t.layer||t.layer===n);let i=t.map(t=>t.shape);t.forEach(t=>{(new kc[t.shape]).duration(this._duration).config(t).config({x:t=>t.x2?b(t.x2,"x2"):b(t.x),x0:"x"===this._discrete?t=>t.x2?b(t.x2,"x2"):b(t.x):b(f.x[0]),x1:"x"===this._discrete?null:t=>t.x2?b(t.x2,"x2"):b(t.x),y:t=>t.y2?x(t.y2,"y2"):x(t.y),y0:"y"===this._discrete?t=>t.y2?x(t.y2,"y2"):x(t.y):x(f.y[1])-P,y1:"y"===this._discrete?null:t=>t.y2?x(t.y2,"y2"):x(t.y)-P}).select(e).render()}),this._previousAnnotations[n].filter(t=>!i.includes(t)).forEach(t=>{(new kc[t]).data([]).select(e).render()}),this._previousAnnotations[n]=i}),this._discrete||"x"),B={discrete:this._discrete,duration:this._duration,label:t=>this._drawLabel(t.data,t.i),select:pt,x:t=>void 0!==t.x2?b(t.x2,"x2"):b(t.x),x0:"x"===L?t=>t.x2?b(t.x2,"x2"):b(t.x):b("number"==typeof this._baseline?this._baseline:f.x[0]),x1:"x"===L?null:t=>t.x2?b(t.x2,"x2"):b(t.x),y:t=>void 0!==t.y2?x(t.y2,"y2"):x(t.y),y0:"y"===L?t=>t.y2?x(t.y2,"y2"):x(t.y):x("number"==typeof this._baseline?this._baseline:f.y[1])-P,y1:"y"===L?null:t=>t.y2?x(t.y2,"y2"):x(t.y)-P},rt=Object.keys(this._on),O=(dt.forEach(r=>{var o=Object.assign({},B);if(this._stacked&&["Area","Bar"].includes(r.key)){let i="x"===d?b:x;o[""+d]=o[d+"0"]=t=>{var n=_.indexOf(t.id),e=G.indexOf(t.discrete),t=t[d]<0?1:0;return 0<=n?i(p[n][e][t]):i(f[d]["x"===d?0:1])},o[d+"1"]=t=>{var n=_.indexOf(t.id),e=G.indexOf(t.discrete),t=t[d]<0?0:1;return 0<=n?i(p[n][e][t]):i(f[d]["x"===d?0:1])}}var s=(new kc[r.key]).config(o).data(r.values);if("Bar"===r.key){let t,n="x"===this._discrete?b:x;var o="x"===this._discrete?m:y,l="x"===this._discrete?w:S,h="x"===this._discrete?N:E;t="Point"!==o&&2===l.length?((o=Array.from(new Set(r.values.map(t=>n(t[this._discrete]))))).unshift(h[0]-o[0]-h[0]),o.push(h[1]+h[1]-o[o.length-1]),o.reduce((t,n,e,i)=>t=e&&(n=Math.abs(n-i[e-1]))<t?n:t,1/0)):1<l.length?n(l[1])-n(l[0]):h[h.length-1]-h[0],this._groupPadding<t&&(t-=this._groupPadding);let i=t||1;o=ca().key(t=>t[this._discrete]).key(t=>t.group).entries(r.values),l=oa(o.map(t=>t.values.map(t=>t.key)));let a=Array.from(new Set(l));if(1===Ot(o.map(t=>t.values.length)))s[this._discrete]((t,n)=>B[this._discrete](t,n));else{i=(i-this._barPadding*a.length-1)/a.length;h=t/2-i/2;let e=$a().domain([0,a.length-1]).range([-h,h]);s[this._discrete]((t,n)=>B[this._discrete](t,n)+e(a.indexOf(t.group)))}s.width(i),s.height(i)}else if("Line"===r.key){if(s.duration(1.5*v),this._confidence){l=Object.assign({},B),o=this._discrete||"x";let n="x"===o?"y":"x",e="x"===o?x:b;l[n+"0"]=t=>e(this._confidence[0]?t.lci:t[n]),l[n+"1"]=t=>e(this._confidence[1]?t.hci:t[n]);h=(new fc).config(l).data(r.values),o=Object.assign(this._shapeConfig,this._confidenceConfig);h.config(Et(Lt.bind(this)(o,"shape","Line"),Lt.bind(this)(o,"shape","Area"))).render(),this._shapes.push(h)}s.config({discrete:B.discrete||"x",label:!!nt&&((e,t)=>{if("function"!=typeof this._lineLabels||this._lineLabels(e.data,e.i)){var i=z.find(t=>t.id===e.id);if(i){let n=i.newY||i.defaultY;i=z.filter(t=>t.newY===n);return 1<i.length?i[0].id===e.id&&`+${Hu(i.length,this._locale)} `+this._translate("more"):this._drawLabel(e,t)}}return!1}),labelBounds:!!nt&&((t,n,e)=>{var[i,a]=e.points[0],[e,r]=e.points[e.points.length-1],o=this._height/4;return{x:e-i,y:r-a-o/2-(et[t.id]?r-et[t.id]:0),width:tt,height:o}})})}let u=rt.filter(t=>t.includes("."+r.key)),c=rt.filter(t=>!t.includes(".")),g=rt.filter(t=>t.includes(".shape"));for(let a=0;a<c.length;a++)s.on(c[a],(t,n,e,i)=>this._on[c[a]](t.data,t.i,e,i));for(let a=0;a<g.length;a++)s.on(g[a],(t,n,e,i)=>this._on[g[a]](t.data,t.i,e,i));for(let a=0;a<u.length;a++)s.on(u[a],(t,n,e,i)=>this._on[u[a]](t.data,t.i,e,i));l=Lt.bind(this)(this._shapeConfig,"shape",r.key);if(void 0===this._shapeConfig.duration&&delete l.duration,s.config(l).render(),this._shapes.push(s),"Line"===r.key){var t=(new _c).data(this._lineMarkers?r.values:[]).config(B).config(this._lineMarkerConfig).id(t=>t.id+"_"+t.discrete);for(let a=0;a<c.length;a++)t.on(c[a],(t,n,e,i)=>this._on[c[a]](t.data,t.i,e,i));for(let a=0;a<g.length;a++)t.on(g[a],(t,n,e,i)=>this._on[g[a]](t.data,t.i,e,i));for(let a=0;a<u.length;a++)t.on(u[a],(t,n,e,i)=>this._on[u[a]](t.data,t.i,e,i));t.render(),this._shapes.push(t)}}),dt.map(t=>t.key));function zt(e){let i=this[`_${e}Time`];var t=i?o:s,n=t.filter(t=>![NaN,void 0,!1].includes(t[e]));if(!n.length)return[];let a="number"==typeof n[0][e],r=this._discrete===e?ca().key(t=>t[e]).rollup(t=>1===t.length?t[0].data:cu(t.map(t=>t.data),this._aggs)).entries(n).sort((t,n)=>this[`_${e}Sort`]?this[`_${e}Sort`](t.value,n.value):(i||a?parseFloat(t.key,10):t.key)-(i||a?parseFloat(n.key,10):n.key)).map(t=>i?Nt(t.key):a?parseFloat(t.key,10):t.key):uu(n.sort((t,n)=>this[`_${e}Sort`]?this[`_${e}Sort`](t.data,n.data):t[e]-n[e]).map(t=>t[e]),t=>""+t);return r=this._discrete!==e.charAt(0)&&this._confidence&&(this._confidence[0]&&(r=r.concat(t.map(t=>t.lci))),this._confidence[1])?r.concat(t.map(t=>t.hci)):r}function Tt(t){var n=this[`_${t}Time`]?"Time":this._discrete===t||this[`_${t}Sort`]?"Point":"Linear",e=this[`_${t}Domain`]?this[`_${t}Domain`].slice():f[t],i=this[`_${t}2Domain`]?this[`_${t}2Domain`].slice():f[t+"2"];return"Point"!=n&&(e&&void 0===e[0]&&(e[0]=f[t][0]),e&&void 0===e[1]&&(e[1]=f[t][1]),i&&void 0===i[0]&&(i[0]=f[t+"2"][0]),i)&&void 0===i[1]&&(i[1]=f[t+"2"][1]),[e,n,i,n]}O.includes("Line")&&(this._confidence&&O.push("Area"),this._lineMarkers)&&O.push("Circle"),this._previousShapes.filter(t=>!O.includes(t)).forEach(t=>{(new kc[t]).config(B).data([]).render()}),this._previousShapes=O}return this}
|
|
4836
4836
|
/**
|
|
4837
4837
|
@memberof Plot
|
|
4838
4838
|
@desc Allows drawing custom shapes to be used as annotations in the provided x/y plot. This method accepts custom config objects for the [Shape](http://d3plus.org/docs/#Shape) class, either a single config object or an array of config objects. Each config object requires an additional parameter, the "shape", which denotes which [Shape](http://d3plus.org/docs/#Shape) sub-class to use ([Rect](http://d3plus.org/docs/#Rect), [Line](http://d3plus.org/docs/#Line), etc).
|
|
@@ -4914,7 +4914,7 @@ this._aggs[n]||this._discrete!==t||(this._aggs[n]=(t,n)=>{t=Array.from(new Set(t
|
|
|
4914
4914
|
@desc The behavior to be used when calculating the position and size of each shape's label(s). The value passed can either be the _String_ name of the behavior to be used for all shapes, or an accessor _Function_ that will be provided each data point and will be expected to return the behavior to be used for that data point. The availability and options for this method depend on the default logic for each Shape. As an example, the values "outside" or "inside" can be set for Bar shapes, whose "auto" default will calculate the best position dynamically based on the available space.
|
|
4915
4915
|
@param {Function|String} [*value* = "auto"]
|
|
4916
4916
|
@chainable
|
|
4917
|
-
*/labelPosition(t){return arguments.length?(this._labelPosition="function"==typeof t?t:
|
|
4917
|
+
*/labelPosition(t){return arguments.length?(this._labelPosition="function"==typeof t?t:Bt(t),this):this._labelPosition}
|
|
4918
4918
|
/**
|
|
4919
4919
|
@memberof Plot
|
|
4920
4920
|
@desc Draws labels on the right side of any Line shapes that are drawn on the plot.
|
|
@@ -4980,7 +4980,7 @@ this._aggs[n]||this._discrete!==t||(this._aggs[n]=(t,n)=>{t=Array.from(new Set(t
|
|
|
4980
4980
|
@desc Sets the stack order. If *value* is not specified, returns the current stack order function.
|
|
4981
4981
|
@param {Function|String|Array} *value* = "none"
|
|
4982
4982
|
@chainable
|
|
4983
|
-
*/stackOrder(t){return arguments.length?(this._stackOrder="string"==typeof t?"ascending"===t?
|
|
4983
|
+
*/stackOrder(t){return arguments.length?(this._stackOrder="string"==typeof t?"ascending"===t?Lf:"descending"===t?Bf:jh["stackOrder"+(t.charAt(0).toUpperCase()+t.slice(1))]:t,this):this._stackOrder}
|
|
4984
4984
|
/**
|
|
4985
4985
|
@memberof Plot
|
|
4986
4986
|
@desc Sets the x accessor to the specified accessor Function or String representing which key in the data to reference. If *value* is not specified, returns the current x accessor.
|
|
@@ -5095,31 +5095,31 @@ this._aggs[n]||this._discrete!==t||(this._aggs[n]=(t,n)=>{t=Array.from(new Set(t
|
|
|
5095
5095
|
@memberof Plot
|
|
5096
5096
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
5097
5097
|
@private
|
|
5098
|
-
*/constructor(){super(),this._axisPersist=!1,this._annotations=[],this._backgroundConfig={duration:0,fill:"transparent"},this._barPadding=0,this._buffer=Et({},Nf,{Bar:!1,Line:!1}),this._confidenceConfig={fill:(t,n)=>"function"==typeof this._shapeConfig.Line.stroke?this._shapeConfig.Line.stroke(t,n):this._shapeConfig.Line.stroke,fillOpacity:
|
|
5098
|
+
*/constructor(){super(),this._axisPersist=!1,this._annotations=[],this._backgroundConfig={duration:0,fill:"transparent"},this._barPadding=0,this._buffer=Et({},Nf,{Bar:!1,Line:!1}),this._confidenceConfig={fill:(t,n)=>"function"==typeof this._shapeConfig.Line.stroke?this._shapeConfig.Line.stroke(t,n):this._shapeConfig.Line.stroke,fillOpacity:Bt(.5)},this._discreteCutoff=100,this._groupPadding=5,this._labelConnectorConfig={strokeDasharray:"1 1"},this._labelPosition=Bt("auto"),this._lineMarkerConfig={fill:(t,n)=>Ih(this._id(t,n)),r:Bt(3)},this._lineMarkers=!1,this._previousAnnotations={back:[],front:[]},this._previousShapes=[],this._shape=Bt("Circle"),this._shapeConfig=Et(this._shapeConfig,{Area:{label:(t,n)=>!!this._stacked&&this._drawLabel(t,n),labelBounds:(t,n,e)=>{let i=ju(e.points,{angle:jt(-20,20,5)});if(!(i=!i||i.height<20||i.width<50?ju(e.points,{angle:jt(-80,80,5)}):i))return null;let a=Dt(e.points,t=>t[0]);e=Ot(e.points.filter(t=>t[0]===a),t=>t[1]);return{angle:i.angle,width:i.width,height:i.height,x:i.cx-i.width/2-a,y:i.cy-i.height/2-e}},labelConfig:{fontMin:6,fontResize:!0,padding:10}},ariaLabel:(t,n)=>{let e="";return t.nested?e=""+this._drawLabel(t.data,t.i):(e=""+this._drawLabel(t,n),void 0!==this._x(t,n)&&(e+=", x: "+this._x(t,n)),void 0!==this._y(t,n)&&(e+=", y: "+this._y(t,n)),void 0!==this._x2(t,n)&&(e+=", x2: "+this._x2(t,n)),void 0!==this._y2(t,n)&&(e+=", y2: "+this._y2(t,n))),e+"."},Bar:{labelBounds(t,n,e){var i="y"===this._discrete?"width":"height",a="y"===this._discrete?"height":"width",r="x"===this._discrete.charAt(0)?"y":"x",o="y"==r,r=this._discrete.replace(this._discrete.charAt(0),r),s=this[`_${r}Axis`]._d3Scale.range(),s=Math.abs(s[1]-s[0]),r=this["_"+r](t,n)<0;return jf.bind(this)(t,n)?{[i]:s-e[i],[a]:e[a],x:o?-e.width/2:r?-s:e.width+1,y:o?r?e.height+1:-s:-e.height/2+1}:{[i]:e[i],[a]:e[a],x:o?-e.width/2:r?(this._stacked,1-e.width):-1,y:o?r?(this._stacked,1):1-e.height:-e.height/2+1}},labelConfig:{fontMax:16,fontMin:6,fontResize:!0,fontColor(t,n){return jf.bind(this)(t,n)?"transparent"===this._backgroundConfig.fill?Rh.dark:Hh(this._backgroundConfig.fill):Hh("function"==typeof this._shapeConfig.fill?this._shapeConfig.fill(t,n):this._shapeConfig.fill)},fontStroke(t,n){return jf.bind(this)(t,n)?"transparent"===this._backgroundConfig.fill?Rh.dark:Hh(this._backgroundConfig.fill):"transparent"},fontStrokeWidth(t,n){return jf.bind(this)(t,n)?.1:0},padding:3,textAnchor(t,n){var e="x"===this._discrete.charAt(0)?"y":"x",i="y"==e,e=this._discrete.replace(this._discrete.charAt(0),e),e=this["_"+e](t,n)<0,i=i?"middle":jf.bind(this)(t,n)?e?"end":"start":e?"start":"end";return yi()?"start"==i?"end":"end"==i?"start":i:i},verticalAlign(t,n){var e="x"===this._discrete.charAt(0)?"y":"x",i="y"==e,e=this._discrete.replace(this._discrete.charAt(0),e),e=this["_"+e](t,n)<0;return i?jf.bind(this)(t,n)?e?"top":"bottom":e?"bottom":"top":"middle"}}},Circle:{r:Pf.bind(this)},Line:{curve:()=>this._discrete?"monotone"+this._discrete.charAt(0).toUpperCase():"linear",fill:Bt("none"),labelConfig:{fontColor:(t,n)=>Gh("function"==typeof this._shapeConfig.Line.stroke?this._shapeConfig.Line.stroke(t,n):this._shapeConfig.Line.stroke),fontResize:!1,padding:5,textAnchor:"start",verticalAlign:"middle"},strokeWidth:Bt(2)},Rect:{height:t=>2*Pf.bind(this)(t),width:t=>2*Pf.bind(this)(t)}}),this._shapeOrder=["Area","Path","Bar","Box","Line","Rect","Circle"],this._shapeSort=(t,n)=>this._shapeOrder.indexOf(t)-this._shapeOrder.indexOf(n),this._sizeMax=20,this._sizeMin=5,this._sizeScale="sqrt",this._stackOffset=Df,this._stackOrder=Bf,this._timelineConfig=Et(this._timelineConfig,{brushMin:()=>this._xTime||this._yTime||this._x2Time||this._y2Time?2:1}),this._x=p("x"),this._xKey="x",this._xAxis=(new Pc).align("end"),this._xTest=(new Pc).align("end").gridSize(0),this._xConfig={gridConfig:{stroke:t=>this._discrete&&"x"===this._discrete.charAt(0)||this._xAxis.range()[0]===this._xAxis._getPosition.bind(this._xAxis)(t.id)?"transparent":zf.colors.gray[200]}},this._xCutoff=150,this._x2=p("x2"),this._x2Key="x2",this._x2Axis=(new Oc).align("start"),this._x2Test=(new Oc).align("start").gridSize(0),this._x2Config={},this._y=p("y"),this._yKey="y",this._yAxis=(new Lc).align("start"),this._yKey="y",this._yTest=(new Lc).align("start").gridSize(0),this._yConfig={gridConfig:{stroke:t=>{var n;return this._discrete&&"y"===this._discrete.charAt(0)||(n=this._yAxis.range())[n.length-1]===this._yAxis._getPosition.bind(this._yAxis)(t.id)?"transparent":zf.colors.gray[200]}}},this._yCutoff=150,this._y2=p("y2"),this._y2Key="y2",this._y2Axis=(new Bc).align("end"),this._y2Test=(new Lc).align("end").gridSize(0),this._y2Config={}}}class Ff extends Rf{
|
|
5099
5099
|
/**
|
|
5100
5100
|
@memberof AreaPlot
|
|
5101
5101
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from Plot.
|
|
5102
5102
|
@private
|
|
5103
|
-
*/constructor(){super(),this._baseline=0,this._discrete="x",this._shape=
|
|
5103
|
+
*/constructor(){super(),this._baseline=0,this._discrete="x",this._shape=Bt("Area")}}class If extends Rf{
|
|
5104
5104
|
/**
|
|
5105
5105
|
@memberof BarChart
|
|
5106
5106
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from Plot.
|
|
5107
5107
|
@private
|
|
5108
|
-
*/constructor(){super(),this._baseline=0,this._discrete="x";let e=this._legend;this._legend=(t,n)=>n.map(this._groupBy[this._legendDepth].bind(this)).sort().join()!==this._filteredData.map(this._groupBy[this._legendDepth].bind(this)).sort().join()&&e.bind(this)(t,n),this._shape=
|
|
5108
|
+
*/constructor(){super(),this._baseline=0,this._discrete="x";let e=this._legend;this._legend=(t,n)=>n.map(this._groupBy[this._legendDepth].bind(this)).sort().join()!==this._filteredData.map(this._groupBy[this._legendDepth].bind(this)).sort().join()&&e.bind(this)(t,n),this._shape=Bt("Bar")}}class Hf extends Rf{
|
|
5109
5109
|
/**
|
|
5110
5110
|
@memberof BoxWhisker
|
|
5111
5111
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from Plot.
|
|
5112
5112
|
@private
|
|
5113
|
-
*/constructor(){super(),this._discrete="x",this._shape=
|
|
5113
|
+
*/constructor(){super(),this._discrete="x",this._shape=Bt("Box"),this._tooltipConfig=Et(this._tooltipConfig,{title:(t,n)=>{if(!t)return"";for(;t.__d3plus__&&t.data;)n=(t=t.data).i;var e;return this._label?this._label(t,n):(e=this._ids(t,n).slice(0,this._drawDepth))[e.length-1]}})}}class Gf extends Rf{
|
|
5114
5114
|
/**
|
|
5115
5115
|
@memberof BumpChart
|
|
5116
5116
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from Plot.
|
|
5117
5117
|
@private
|
|
5118
|
-
*/constructor(){super(),this._discrete="x",this._shape=
|
|
5118
|
+
*/constructor(){super(),this._discrete="x",this._shape=Bt("Line"),this.y2(t=>this._y(t)),this.yConfig({tickFormat:n=>{var t=this._formattedData;let e=t[0].x instanceof Date?t[0].x.getTime():t[0].x;t=t.filter(t=>(t.x instanceof Date?t.x.getTime():t.x)===e).find(t=>t.y===n);return t?this._drawLabel(t,t.i):""}}),this.y2Config({tickFormat:n=>{var t=this._formattedData;let e=t[t.length-1].x instanceof Date?t[t.length-1].x.getTime():t[t.length-1].x;t=t.filter(t=>(t.x instanceof Date?t.x.getTime():t.x)===e).find(t=>t.y===n);return t?this._drawLabel(t,t.i):""}}),this.ySort((t,n)=>this._y(n)-this._y(t)),this.y2Sort((t,n)=>this._y(n)-this._y(t))}}class Kf extends Sf{
|
|
5119
5119
|
/**
|
|
5120
5120
|
Extends the draw behavior of the abstract Viz class.
|
|
5121
5121
|
@private
|
|
5122
|
-
*/_draw(t){super._draw(t);var t=this._height-this._margin.top-this._margin.bottom,n=this._width-this._margin.left-this._margin.right,e=Dt([n,t])/2,i=this._pieData=this._pie.padAngle(this._padAngle||this._padPixel/e).sort(this._sort).value(this._value)(this._filteredData),e=(i.forEach((t,n)=>{t.__d3plus__=!0,t.i=n}),nl().innerRadius(this._innerRadius).outerRadius(e)),n=`translate(${n/2+this._margin.left}, ${t/2+this._margin.top})`;return this._shapes.push((new Sc).data(i).d(e).select(Pt("g.d3plus-Pie",{parent:this._select,enter:{transform:n},update:{transform:n}}).node()).config({id:t=>this._ids(t).join("-"),x:0,y:0}).label(this._drawLabel).config(
|
|
5122
|
+
*/_draw(t){super._draw(t);var t=this._height-this._margin.top-this._margin.bottom,n=this._width-this._margin.left-this._margin.right,e=Dt([n,t])/2,i=this._pieData=this._pie.padAngle(this._padAngle||this._padPixel/e).sort(this._sort).value(this._value)(this._filteredData),e=(i.forEach((t,n)=>{t.__d3plus__=!0,t.i=n}),nl().innerRadius(this._innerRadius).outerRadius(e)),n=`translate(${n/2+this._margin.left}, ${t/2+this._margin.top})`;return this._shapes.push((new Sc).data(i).d(e).select(Pt("g.d3plus-Pie",{parent:this._select,enter:{transform:n},update:{transform:n}}).node()).config({id:t=>this._ids(t).join("-"),x:0,y:0}).label(this._drawLabel).config(Lt.bind(this)(this._shapeConfig,"shape","Path")).render()),this}
|
|
5123
5123
|
/**
|
|
5124
5124
|
@memberof Pie
|
|
5125
5125
|
@desc The pixel value, or function that returns a pixel value, that is used as the inner radius of the Pie (creating a Donut).
|
|
@@ -5160,19 +5160,19 @@ this._aggs[n]||this._discrete!==t||(this._aggs[n]=(t,n)=>{t=Array.from(new Set(t
|
|
|
5160
5160
|
@memberof Donut
|
|
5161
5161
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
5162
5162
|
@private
|
|
5163
|
-
*/constructor(){super(),this._innerRadius=()=>Dt([this._width-this._margin.left-this._margin.right,this._height-this._margin.top-this._margin.bottom])/4,this._padPixel=2}}var E=1e-6,Wf=1e-12,A=Math.PI,qf=A/2,$f=A/4,Vf=2*A,Yf=180/A,N=A/180,P=Math.abs,Zf=Math.atan,Xf=Math.atan2,z=Math.cos,Jf=Math.ceil,Qf=Math.exp,t0=Math.hypot,n0=Math.log,e0=Math.pow,T=Math.sin,i0=Math.sign||function(t){return 0<t?1:t<0?-1:0},a0=Math.sqrt,r0=Math.tan;function o0(t){return 1<t?0:t<-1?A:Math.acos(t)}function s0(t){return 1<t?qf:t<-1?-qf:Math.asin(t)}function l0(t){return(t=T(t/2))*t}function h0(){}function u0(t,n){t&&g0.hasOwnProperty(t.type)&&g0[t.type](t,n)}var c0={Feature:function(t,n){u0(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,i=-1,a=e.length;++i<a;)u0(e[i].geometry,n)}},g0={Sphere:function(t,n){n.sphere()},Point:function(t,n){t=t.coordinates,n.point(t[0],t[1],t[2])},MultiPoint:function(t,n){for(var e=t.coordinates,i=-1,a=e.length;++i<a;)t=e[i],n.point(t[0],t[1],t[2])},LineString:function(t,n){d0(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,i=-1,a=e.length;++i<a;)d0(e[i],n,0)},Polygon:function(t,n){f0(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,i=-1,a=e.length;++i<a;)f0(e[i],n)},GeometryCollection:function(t,n){for(var e=t.geometries,i=-1,a=e.length;++i<a;)u0(e[i],n)}};function d0(t,n,e){var i,a=-1,r=t.length-e;for(n.lineStart();++a<r;)i=t[a],n.point(i[0],i[1],i[2]);n.lineEnd()}function f0(t,n){var e=-1,i=t.length;for(n.polygonStart();++e<i;)d0(t[e],n,1);n.polygonEnd()}function p0(t,n){t&&c0.hasOwnProperty(t.type)?c0[t.type](t,n):u0(t,n)}var _0,m0,y0,v0,b0,x0,w0,S0,k0,C0,M0,A0,z0,T0,E0,N0,P0=new Gi,
|
|
5163
|
+
*/constructor(){super(),this._innerRadius=()=>Dt([this._width-this._margin.left-this._margin.right,this._height-this._margin.top-this._margin.bottom])/4,this._padPixel=2}}var E=1e-6,Wf=1e-12,A=Math.PI,qf=A/2,$f=A/4,Vf=2*A,Yf=180/A,N=A/180,P=Math.abs,Zf=Math.atan,Xf=Math.atan2,z=Math.cos,Jf=Math.ceil,Qf=Math.exp,t0=Math.hypot,n0=Math.log,e0=Math.pow,T=Math.sin,i0=Math.sign||function(t){return 0<t?1:t<0?-1:0},a0=Math.sqrt,r0=Math.tan;function o0(t){return 1<t?0:t<-1?A:Math.acos(t)}function s0(t){return 1<t?qf:t<-1?-qf:Math.asin(t)}function l0(t){return(t=T(t/2))*t}function h0(){}function u0(t,n){t&&g0.hasOwnProperty(t.type)&&g0[t.type](t,n)}var c0={Feature:function(t,n){u0(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,i=-1,a=e.length;++i<a;)u0(e[i].geometry,n)}},g0={Sphere:function(t,n){n.sphere()},Point:function(t,n){t=t.coordinates,n.point(t[0],t[1],t[2])},MultiPoint:function(t,n){for(var e=t.coordinates,i=-1,a=e.length;++i<a;)t=e[i],n.point(t[0],t[1],t[2])},LineString:function(t,n){d0(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,i=-1,a=e.length;++i<a;)d0(e[i],n,0)},Polygon:function(t,n){f0(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,i=-1,a=e.length;++i<a;)f0(e[i],n)},GeometryCollection:function(t,n){for(var e=t.geometries,i=-1,a=e.length;++i<a;)u0(e[i],n)}};function d0(t,n,e){var i,a=-1,r=t.length-e;for(n.lineStart();++a<r;)i=t[a],n.point(i[0],i[1],i[2]);n.lineEnd()}function f0(t,n){var e=-1,i=t.length;for(n.polygonStart();++e<i;)d0(t[e],n,1);n.polygonEnd()}function p0(t,n){t&&c0.hasOwnProperty(t.type)?c0[t.type](t,n):u0(t,n)}var _0,m0,y0,v0,b0,x0,w0,S0,k0,C0,M0,A0,z0,T0,E0,N0,P0=new Gi,L0=new Gi,B0={point:h0,lineStart:h0,lineEnd:h0,polygonStart:function(){P0=new Gi,B0.lineStart=O0,B0.lineEnd=D0},polygonEnd:function(){var t=+P0;L0.add(t<0?Vf+t:t),this.lineStart=this.lineEnd=this.point=h0},sphere:function(){L0.add(Vf)}};
|
|
5164
5164
|
// hello?
|
|
5165
|
-
function O0(){
|
|
5165
|
+
function O0(){B0.point=j0}function D0(){R0(_0,m0)}function j0(t,n){B0.point=R0,_0=t,m0=n,y0=t*=N,v0=z(n=(n*=N)/2+$f),b0=T(n)}function R0(t,n){// half the angular distance from south pole
|
|
5166
5166
|
// Spherical excess E for a spherical triangle with vertices: south pole,
|
|
5167
5167
|
// previous point, current point. Uses a formula derived from Cagnoli’s
|
|
5168
5168
|
// theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2).
|
|
5169
5169
|
var e=(t*=N)-y0,i=0<=e?1:-1,e=i*e,a=z(n=(n*=N)/2+$f),n=T(n),r=b0*n,o=v0*a+r*z(e),r=r*i*T(e);P0.add(Xf(r,o)),
|
|
5170
5170
|
// Advance the previous points.
|
|
5171
|
-
y0=t,v0=a,b0=n}function
|
|
5171
|
+
y0=t,v0=a,b0=n}function F0(t){return[Xf(t[1],t[0]),s0(t[2])]}function I0(t){var n=t[0],t=t[1],e=z(t);return[e*z(n),e*T(n),T(t)]}function H0(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function G0(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}
|
|
5172
5172
|
// TODO return a
|
|
5173
5173
|
function K0(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function U0(t,n){return[t[0]*n,t[1]*n,t[2]*n]}
|
|
5174
5174
|
// TODO return d
|
|
5175
|
-
function W0(t){var n=a0(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var q0,$0,V0,Y0,Z0,X0,J0,Q0,t1,n1,e1,i1,a1,r1,o1,s1,l1={point:h1,lineStart:c1,lineEnd:g1,polygonStart:function(){l1.point=d1,l1.lineStart=f1,l1.lineEnd=p1,T0=new Gi,
|
|
5175
|
+
function W0(t){var n=a0(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var q0,$0,V0,Y0,Z0,X0,J0,Q0,t1,n1,e1,i1,a1,r1,o1,s1,l1={point:h1,lineStart:c1,lineEnd:g1,polygonStart:function(){l1.point=d1,l1.lineStart=f1,l1.lineEnd=p1,T0=new Gi,B0.polygonStart()},polygonEnd:function(){B0.polygonEnd(),l1.point=h1,l1.lineStart=c1,l1.lineEnd=g1,P0<0?(x0=-(S0=180),w0=-(k0=90)):E<T0?k0=90:T0<-1e-6&&(w0=-90),N0[0]=x0,N0[1]=S0},sphere:function(){x0=-(S0=180),w0=-(k0=90)}};function h1(t,n){E0.push(N0=[x0=t,S0=t]),n<w0&&(w0=n),k0<n&&(k0=n)}function u1(t,n){var e,i,a,r,o,s=I0([t*N,n*N]);z0?(e=G0(z0,s),W0(e=G0([e[1],-e[0],0],e)),e=F0(e),o=t-C0,a=e[0]*Yf*(i=0<o?1:-1),(o=180<P(o))^(i*C0<a&&a<i*t)?(r=e[1]*Yf,k0<r&&(k0=r)):o^(i*C0<(a=(360+a)%360-180)&&a<i*t)?(r=-e[1]*Yf)<w0&&(w0=r):(n<w0&&(w0=n),k0<n&&(k0=n)),o?t<C0?_1(x0,t)>_1(x0,S0)&&(S0=t):_1(t,S0)>_1(x0,S0)&&(x0=t):x0<=S0?(t<x0&&(x0=t),S0<t&&(S0=t)):C0<t?_1(x0,t)>_1(x0,S0)&&(S0=t):_1(t,S0)>_1(x0,S0)&&(x0=t)):E0.push(N0=[x0=t,S0=t]),n<w0&&(w0=n),k0<n&&(k0=n),z0=s,C0=t}function c1(){l1.point=u1}function g1(){N0[0]=x0,N0[1]=S0,l1.point=h1,z0=null}function d1(t,n){var e;z0?(e=t-C0,T0.add(180<P(e)?e+(0<e?360:-360):e)):(M0=t,A0=n),B0.point(t,n),u1(t,n)}function f1(){B0.lineStart()}function p1(){d1(M0,A0),B0.lineEnd(),P(T0)>E&&(x0=-(S0=180)),N0[0]=x0,N0[1]=S0,z0=null}
|
|
5176
5176
|
// Finds the left-right distance between two longitudes.
|
|
5177
5177
|
// This is almost the same as (lambda1 - lambda0 + 360°) % 360°, except that we want
|
|
5178
5178
|
// the distance between ±180° to be 360°.
|
|
@@ -5194,11 +5194,11 @@ t1.add(o*n),n1.add(o*a),e1.add(o*r),$0+=s,X0+=s*(r1+(r1=i)),J0+=s*(o1+(o1=e)),Q0
|
|
|
5194
5194
|
// If the area-weighted ccentroid is undefined, fall back to length-weighted ccentroid.
|
|
5195
5195
|
return i<Wf&&(t=X0,n=J0,e=Q0,
|
|
5196
5196
|
// If the feature has zero length, fall back to arithmetic mean of point vectors.
|
|
5197
|
-
$0<E&&(t=V0,n=Y0,e=Z0),(i=t0(t,n,e))<Wf)?[NaN,NaN]:[Xf(n,t)*Yf,s0(e/i)*Yf]}function P1(t){return function(){return t}}function
|
|
5197
|
+
$0<E&&(t=V0,n=Y0,e=Z0),(i=t0(t,n,e))<Wf)?[NaN,NaN]:[Xf(n,t)*Yf,s0(e/i)*Yf]}function P1(t){return function(){return t}}function L1(e,i){function t(t,n){return t=e(t,n),i(t[0],t[1])}return e.invert&&i.invert&&(t.invert=function(t,n){return(t=i.invert(t,n))&&e.invert(t[0],t[1])}),t}function B1(t,n){return P(t)>A&&(t-=Math.round(t/Vf)*Vf),[t,n]}function O1(t,n,e){return(t%=Vf)?n||e?L1(j1(t),R1(n,e)):j1(t):n||e?R1(n,e):B1}function D1(e){return function(t,n){return P(t+=e)>A&&(t-=Math.round(t/Vf)*Vf),[t,n]}}function j1(t){var n=D1(t);return n.invert=D1(-t),n}function R1(t,n){var a=z(t),r=T(t),o=z(n),s=T(n);function e(t,n){var e=z(n),i=z(t)*e,t=T(t)*e,e=T(n),n=e*a+i*r;return[Xf(t*o-n*s,i*a-e*r),s0(n*o+t*s)]}return e.invert=function(t,n){var e=z(n),i=z(t)*e,t=T(t)*e,e=T(n),n=e*o-t*s;return[Xf(t*o+e*s,i*a+n*r),s0(n*a-i*r)]},e}function F1(n){function t(t){return(t=n(t[0]*N,t[1]*N))[0]*=Yf,t[1]*=Yf,t}return n=O1(n[0]*N,n[1]*N,2<n.length?n[2]*N:0),t.invert=function(t){return(t=n.invert(t[0]*N,t[1]*N))[0]*=Yf,t[1]*=Yf,t},t}
|
|
5198
5198
|
// Generates a circle centered at [0°, 0°], with a given radius and precision.
|
|
5199
|
-
function
|
|
5199
|
+
function I1(t,n,e,i,a,r){if(e){var o=z(n),s=T(n),l=i*e;null==a?(a=n+i*Vf,r=n-l/2):(a=H1(o,a),r=H1(o,r),(0<i?a<r:r<a)&&(a+=i*Vf));for(var h,u=a;0<i?r<u:u<r;u-=l)h=F0([o,-s*z(u),-s*T(u)]),t.point(h[0],h[1])}}
|
|
5200
5200
|
// Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0].
|
|
5201
|
-
function H1(t,n){(n=
|
|
5201
|
+
function H1(t,n){(n=I0(n))[0]-=t,W0(n);t=o0(-n[1]);return((-n[2]<0?-t:t)+Vf-E)%Vf}function G1(){var i,a,r=P1([0,0]),o=P1(90),s=P1(2),l={point:function(t,n){i.push(t=a(t,n)),t[0]*=Yf,t[1]*=Yf}};function n(){var t=r.apply(this,arguments),n=o.apply(this,arguments)*N,e=s.apply(this,arguments)*N;return i=[],a=O1(-t[0]*N,-t[1]*N,0).invert,I1(l,n,e,1),t={type:"Polygon",coordinates:[i]},i=a=null,t}return n.center=function(t){return arguments.length?(r="function"==typeof t?t:P1([+t[0],+t[1]]),n):r},n.radius=function(t){return arguments.length?(o="function"==typeof t?t:P1(+t),n):o},n.precision=function(t){return arguments.length?(s="function"==typeof t?t:P1(+t),n):s},n}function K1(){var i,n=[];return{point:function(t,n,e){i.push([t,n,e])},lineStart:function(){n.push(i=[])},lineEnd:h0,rejoin:function(){1<n.length&&n.push(n.pop().concat(n.shift()))},result:function(){var t=n;return n=[],i=null,t}}}function U1(t,n){return P(t[0]-n[0])<E&&P(t[1]-n[1])<E}function W1(t,n,e,i){this.x=t,this.z=n,this.o=e,// another intersection
|
|
5202
5202
|
this.e=i,// is an entry?
|
|
5203
5203
|
this.v=!1,// visited
|
|
5204
5204
|
this.n=this.p=null}
|
|
@@ -5212,7 +5212,7 @@ a[0]+=2*E}s.push(e=new W1(i,t,null,!0)),l.push(e.o=new W1(i,null,e,!1)),s.push(e
|
|
|
5212
5212
|
var g=c,d=!0;g.v;)if((g=g.n)===c)return;h=g.z,r.lineStart();do{if(g.v=g.o.v=!0,g.e){if(d)for(o=0,a=h.length;o<a;++o)r.point((u=h[o])[0],u[1]);else i(g.x,g.n.x,1,r);g=g.n}else{if(d)for(h=g.p.z,o=h.length-1;0<=o;--o)r.point((u=h[o])[0],u[1]);else i(g.x,g.p.x,-1,r);g=g.p}}while(h=(g=g.o).z,d=!d,!g.v);r.lineEnd()}}}function $1(t){if(n=t.length){for(var n,e,i=0,a=t[0];++i<n;)a.n=e=t[i],e.p=a,a=e;a.n=e=t[0],e.p=a}}function V1(t){return P(t[0])<=A?t[0]:i0(t[0])*((P(t[0])+A)%Vf-A)}function Y1(t,n){var e=V1(n),i=n[1],n=T(i),a=[T(e),-z(e),0],r=0,o=0,s=new Gi;1===n?i=qf+E:-1===n&&(i=-qf-E);for(var l=0,h=t.length;l<h;++l)if(c=(u=t[l]).length)for(var u,c,g=u[c-1],d=V1(g),f=g[1]/2+$f,p=T(f),_=z(f),m=0;m<c;++m,d=v,p=x,_=b,g=y){var y=u[m],v=V1(y),b=y[1]/2+$f,x=T(b),b=z(b),w=v-d,S=0<=w?1:-1,k=S*w,C=A<k,M=p*x;s.add(Xf(M*S*T(k),_*b+M*z(k))),r+=C?w+S*Vf:w,
|
|
5213
5213
|
// Are the longitudes either side of the point’s meridian (lambda),
|
|
5214
5214
|
// and are the latitudes smaller than the parallel (phi)?
|
|
5215
|
-
C^e<=d^e<=v&&(W0(M=G0(
|
|
5215
|
+
C^e<=d^e<=v&&(W0(M=G0(I0(g),I0(y))),W0(k=G0(a,M)),(S=(C^0<=w?-1:1)*s0(k[2]))<i||i===S&&(M[0]||M[1]))&&(o+=C^0<=w?1:-1)}
|
|
5216
5216
|
// First, determine whether the South pole is inside or outside:
|
|
5217
5217
|
//
|
|
5218
5218
|
// It is inside if:
|
|
@@ -5231,7 +5231,7 @@ if(1&a){if(0<(n=(e=r[0]).length-1)){for(d||(s.polygonStart(),d=!0),s.lineStart()
|
|
|
5231
5231
|
1<o&&2&a&&r.push(r.pop().concat(r.shift())),h.push(r.filter(X1))}return n}}function X1(t){return 1<t.length}
|
|
5232
5232
|
// Intersections are sorted along the clip edge. For both antimeridian cutting
|
|
5233
5233
|
// and circle clipping, the same comparison is used.
|
|
5234
|
-
function J1(t,n){return((t=t.x)[0]<0?t[1]-qf-E:qf-t[1])-((n=n.x)[0]<0?n[1]-qf-E:qf-n[1])}
|
|
5234
|
+
function J1(t,n){return((t=t.x)[0]<0?t[1]-qf-E:qf-t[1])-((n=n.x)[0]<0?n[1]-qf-E:qf-n[1])}B1.invert=B1;var Q1=Z1(function(){return 1},
|
|
5235
5235
|
// Takes a line and cuts into visible segments. Return values: 0 - there were
|
|
5236
5236
|
// intersections or the line was empty; 1 - no intersections; 2 - there were
|
|
5237
5237
|
// intersections, and the first and last segments should be rejoined.
|
|
@@ -5245,13 +5245,13 @@ function d(t,n){return z(t)*z(n)>p}
|
|
|
5245
5245
|
// intersections 2 - there were intersections, and the first and last segments
|
|
5246
5246
|
// should be rejoined.
|
|
5247
5247
|
// Intersects the great circle between a and b with the clip circle.
|
|
5248
|
-
function f(t,n,e){var i,a,r,o,s,l,h,u=[1,0,0],c=G0(
|
|
5248
|
+
function f(t,n,e){var i,a,r,o,s,l,h,u=[1,0,0],c=G0(I0(t),I0(n)),g=H0(c,c),d=c[0],f=g-d*d;
|
|
5249
5249
|
// We have two planes, n1.p = d1 and n2.p = d2.
|
|
5250
5250
|
// Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).
|
|
5251
5251
|
// Two polar points.
|
|
5252
|
-
return f?(i=G0(u,c),K0(u=U0(u,p*g/f),U0(c,-p*d/f)),(f=(c=H0(u,g=i))*c-(d=H0(g,g))*(H0(u,u)-1))<0?void 0:(K0(f=U0(g,(-c-(i=a0(f)))/d),u),f=
|
|
5252
|
+
return f?(i=G0(u,c),K0(u=U0(u,p*g/f),U0(c,-p*d/f)),(f=(c=H0(u,g=i))*c-(d=H0(g,g))*(H0(u,u)-1))<0?void 0:(K0(f=U0(g,(-c-(i=a0(f)))/d),u),f=F0(f),e?(
|
|
5253
5253
|
// Check that the first point is between a and b.
|
|
5254
|
-
a=t[0],r=n[0],o=t[1],n=n[1],r<a&&(h=a,a=r,r=h),!(l=P((s=r-a)-A)<E)&&n<o&&(h=o,o=n,n=h),(l||s<E?l?0<o+n^f[1]<(P(f[0]-a)<E?o:n):o<=f[1]&&f[1]<=n:A<s^(a<=f[0]&&f[0]<=r))?(K0(h=U0(g,(-c+i)/d),u),[f,
|
|
5254
|
+
a=t[0],r=n[0],o=t[1],n=n[1],r<a&&(h=a,a=r,r=h),!(l=P((s=r-a)-A)<E)&&n<o&&(h=o,o=n,n=h),(l||s<E?l?0<o+n^f[1]<(P(f[0]-a)<E?o:n):o<=f[1]&&f[1]<=n:A<s^(a<=f[0]&&f[0]<=r))?(K0(h=U0(g,(-c+i)/d),u),[f,F0(h)]):void 0):f)):!e&&t}
|
|
5255
5255
|
// Generates a 4-bit vector representing the location of a point relative to
|
|
5256
5256
|
// the small circle's bounding box.
|
|
5257
5257
|
function _(t,n){var e=c?a:A-a,i=0;// above
|
|
@@ -5267,7 +5267,7 @@ e=f(o,i),r.point(e[0],e[1],2),r.lineEnd()),o=e):g&&o&&c^a&&(
|
|
|
5267
5267
|
t&s||!(n=f(i,o,!0))||(u=0,c?(r.lineStart(),r.point(n[0][0],n[0][1]),r.point(n[1][0],n[1][1]),r.lineEnd()):(r.point(n[1][0],n[1][1]),r.lineEnd(),r.lineStart(),r.point(n[0][0],n[0][1],3)))),!a||o&&U1(o,i)||r.point(i[0],i[1]),o=i,l=a,s=t},lineEnd:function(){l&&r.lineEnd(),o=null},
|
|
5268
5268
|
// Rejoin first and last segments if there were intersections and the first
|
|
5269
5269
|
// and last points were visible.
|
|
5270
|
-
clean:function(){return u|(h&&l)<<1}}},function(t,n,e,i){
|
|
5270
|
+
clean:function(){return u|(h&&l)<<1}}},function(t,n,e,i){I1(i,a,r,e,t,n)},c?[0,-a]:[-A,a-A])}var np,ep,ip,ap,rp=1e9,op=-1e9;
|
|
5271
5271
|
// TODO Use d3-polygon’s polygonContains here for the ring check?
|
|
5272
5272
|
// TODO Eliminate duplicate buffering in clipBuffer and polygon.push?
|
|
5273
5273
|
function sp(m,y,v,b){function x(t,n){return m<=t&&t<=v&&y<=n&&n<=b}function w(t,n,e,i){var a=0,r=0;if(null==t||(a=o(t,e))!==(r=o(n,e))||s(t,n)<0^0<e)for(;i.point(0===a||3===a?m:v,1<a?b:y),(a=(a+e+4)%4)!==r;);else i.point(n[0],n[1])}function o(t,n){return P(t[0]-m)<E?0<n?0:3:P(t[0]-v)<E?0<n?2:1:P(t[1]-y)<E?0<n?1:0:0<n?3:2;// abs(p[1] - y1) < epsilon
|
|
@@ -5277,71 +5277,71 @@ function sp(m,y,v,b){function x(t,n){return m<=t&&t<=v&&y<=n&&n<=b}function w(t,
|
|
|
5277
5277
|
// clipping issues.
|
|
5278
5278
|
,lineEnd:function(){a&&(_(o,s),l&&g&&t.rejoin(),a.push(t.result()));n.point=e,g&&p.lineEnd()},polygonStart:
|
|
5279
5279
|
// Buffer geometry within a polygon and then clip it en masse.
|
|
5280
|
-
function(){p=t,a=[],c=[],f=!0},polygonEnd:function(){var t=(()=>{for(var t=0,n=0,e=c.length;n<e;++n)for(var i,a,r=c[n],o=1,s=r.length,l=r[0],h=l[0],u=l[1];o<s;++o)i=h,a=u,l=r[o],h=l[0],u=l[1],a<=b?b<u&&(u-a)*(m-i)<(h-i)*(b-a)&&++t:u<=b&&(h-i)*(b-a)<(u-a)*(m-i)&&--t;return t})(),n=f&&t,e=(a=oa(a)).length;(n||e)&&(i.polygonStart(),n&&(i.lineStart(),w(null,null,1,i),i.lineEnd()),e&&q1(a,S,t,w,i),i.polygonEnd());p=i,a=c=r=null}};function e(t,n){x(t,n)&&p.point(t,n)}function _(t,n){var e,i,a=x(t,n);c&&r.push([t,n]),d?(o=t,s=n,d=!1,(l=a)&&(p.lineStart(),p.point(t,n))):a&&g?p.point(t,n):((t,n,e,i,a,r)=>{var o=t[0],s=t[1],l=0,h=1,u=n[0]-o,c=n[1]-s,e=e-o;if(u||!(0<e)){if(e/=u,u<0){if(e<l)return;e<h&&(h=e)}else if(0<u){if(h<e)return;l<e&&(l=e)}if(e=a-o,u||!(e<0)){if(e/=u,u<0){if(h<e)return;l<e&&(l=e)}else if(0<u){if(e<l)return;e<h&&(h=e)}if(e=i-s,c||!(0<e)){if(e/=c,c<0){if(e<l)return;e<h&&(h=e)}else if(0<c){if(h<e)return;l<e&&(l=e)}if(e=r-s,c||!(e<0)){if(e/=c,c<0){if(h<e)return;l<e&&(l=e)}else if(0<c){if(e<l)return;e<h&&(h=e)}return 0<l&&(t[0]=o+l*u,t[1]=s+l*c),h<1&&(n[0]=o+h*u,n[1]=s+h*c),1}}}}})(e=[h=Math.max(op,Math.min(rp,h)),u=Math.max(op,Math.min(rp,u))],i=[t=Math.max(op,Math.min(rp,t)),n=Math.max(op,Math.min(rp,n))],m,y,v,b)?(g||(p.lineStart(),p.point(e[0],e[1])),p.point(i[0],i[1]),a||p.lineEnd(),f=!1):a&&(p.lineStart(),p.point(t,n),f=!1),h=t,u=n,g=a}return n}}var lp={sphere:h0,point:h0,lineStart:function(){lp.point=up,lp.lineEnd=hp},lineEnd:h0,polygonStart:h0,polygonEnd:h0};function hp(){lp.point=lp.lineEnd=h0}function up(t,n){ep=t*=N,ip=T(n*=N),ap=z(n),lp.point=cp}function cp(t,n){t*=N;var e=T(n*=N),n=z(n),i=P(t-ep),a=z(i),i=n*T(i),r=ap*e-ip*n*a,a=ip*e+ap*n*a;np.add(Xf(a0(i*i+r*r),a)),ep=t,ip=e,ap=n}function gp(t){return np=new Gi,p0(t,lp),+np}var dp=[null,null],fp={type:"LineString",coordinates:dp};function pp(t,n){return dp[0]=t,dp[1]=n,gp(fp)}var _p={Feature:function(t,n){return yp(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,i=-1,a=e.length;++i<a;)if(yp(e[i].geometry,n))return!0;return!1}},mp={Sphere:function(){return!0},Point:function(t,n){return vp(t.coordinates,n)},MultiPoint:function(t,n){for(var e=t.coordinates,i=-1,a=e.length;++i<a;)if(vp(e[i],n))return!0;return!1},LineString:function(t,n){return bp(t.coordinates,n)},MultiLineString:function(t,n){for(var e=t.coordinates,i=-1,a=e.length;++i<a;)if(bp(e[i],n))return!0;return!1},Polygon:function(t,n){return xp(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,i=-1,a=e.length;++i<a;)if(xp(e[i],n))return!0;return!1},GeometryCollection:function(t,n){for(var e=t.geometries,i=-1,a=e.length;++i<a;)if(yp(e[i],n))return!0;return!1}};function yp(t,n){return!(!t||!mp.hasOwnProperty(t.type))&&mp[t.type](t,n)}function vp(t,n){return 0===pp(t,n)}function bp(t,n){for(var e,i,a,r=0,o=t.length;r<o;r++){if(0===(i=pp(t[r],n)))return!0;if(0<r&&0<(a=pp(t[r],t[r-1]))&&e<=a&&i<=a&&(e+i-a)*(1-Math.pow((e-i)/a,2))<Wf*a)return!0;e=i}return!1}function xp(t,n){return!!Y1(t.map(wp),Sp(n))}function wp(t){return(t=t.map(Sp)).pop(),t}function Sp(t){return[t[0]*N,t[1]*N]}function kp(t,n,e){var i=jt(t,n-E,e).concat(n);return function(n){return i.map(function(t){return[n,t]})}}function Cp(t,n,e){var i=jt(t,n-E,e).concat(n);return function(n){return i.map(function(t){return[t,n]})}}function Mp(){var n,e,i,a,r,o,s,l,h,u,c,g,d=10,f=d,p=90,_=360,m=2.5;function y(){return{type:"MultiLineString",coordinates:t()}}function t(){return jt(Jf(a/p)*p,i,p).map(c).concat(jt(Jf(l/_)*_,s,_).map(g)).concat(jt(Jf(e/d)*d,n,d).filter(function(t){return P(t%p)>E}).map(h)).concat(jt(Jf(o/f)*f,r,f).filter(function(t){return P(t%_)>E}).map(u))}return y.lines=function(){return t().map(function(t){return{type:"LineString",coordinates:t}})},y.outline=function(){return{type:"Polygon",coordinates:[c(a).concat(g(s).slice(1),c(i).reverse().slice(1),g(l).reverse().slice(1))]}},y.extent=function(t){return arguments.length?y.extentMajor(t).extentMinor(t):y.extentMinor()},y.extentMajor=function(t){return arguments.length?(a=+t[0][0],i=+t[1][0],l=+t[0][1],s=+t[1][1],i<a&&(t=a,a=i,i=t),s<l&&(t=l,l=s,s=t),y.precision(m)):[[a,l],[i,s]]},y.extentMinor=function(t){return arguments.length?(e=+t[0][0],n=+t[1][0],o=+t[0][1],r=+t[1][1],n<e&&(t=e,e=n,n=t),r<o&&(t=o,o=r,r=t),y.precision(m)):[[e,o],[n,r]]},y.step=function(t){return arguments.length?y.stepMajor(t).stepMinor(t):y.stepMinor()},y.stepMajor=function(t){return arguments.length?(p=+t[0],_=+t[1],y):[p,_]},y.stepMinor=function(t){return arguments.length?(d=+t[0],f=+t[1],y):[d,f]},y.precision=function(t){return arguments.length?(m=+t,h=kp(o,r,90),u=Cp(e,n,m),c=kp(l,s,90),g=Cp(a,i,m),y):m},y.extentMajor([[-180,-90+E],[180,90-E]]).extentMinor([[-180,-80-E],[180,80+E]])}function Ap(t,n){var e=t[0]*N,i=t[1]*N,t=n[0]*N,n=n[1]*N,a=z(i),r=T(i),o=z(n),s=T(n),l=a*z(e),h=a*T(e),u=o*z(t),c=o*T(t),g=2*s0(a0(l0(n-i)+a*o*l0(t-e))),d=T(g),n=g?function(t){var n=T(t*=g)/d,t=T(g-t)/d,e=t*l+n*u,i=t*h+n*c,t=t*r+n*s;return[Xf(i,e)*Yf,Xf(t,a0(e*e+i*i))*Yf]}:function(){return[e*Yf,i*Yf]};return n.distance=g,n}var zp,Tp,Ep,Np,Pp=t=>t,
|
|
5280
|
+
function(){p=t,a=[],c=[],f=!0},polygonEnd:function(){var t=(()=>{for(var t=0,n=0,e=c.length;n<e;++n)for(var i,a,r=c[n],o=1,s=r.length,l=r[0],h=l[0],u=l[1];o<s;++o)i=h,a=u,l=r[o],h=l[0],u=l[1],a<=b?b<u&&(u-a)*(m-i)<(h-i)*(b-a)&&++t:u<=b&&(h-i)*(b-a)<(u-a)*(m-i)&&--t;return t})(),n=f&&t,e=(a=oa(a)).length;(n||e)&&(i.polygonStart(),n&&(i.lineStart(),w(null,null,1,i),i.lineEnd()),e&&q1(a,S,t,w,i),i.polygonEnd());p=i,a=c=r=null}};function e(t,n){x(t,n)&&p.point(t,n)}function _(t,n){var e,i,a=x(t,n);c&&r.push([t,n]),d?(o=t,s=n,d=!1,(l=a)&&(p.lineStart(),p.point(t,n))):a&&g?p.point(t,n):((t,n,e,i,a,r)=>{var o=t[0],s=t[1],l=0,h=1,u=n[0]-o,c=n[1]-s,e=e-o;if(u||!(0<e)){if(e/=u,u<0){if(e<l)return;e<h&&(h=e)}else if(0<u){if(h<e)return;l<e&&(l=e)}if(e=a-o,u||!(e<0)){if(e/=u,u<0){if(h<e)return;l<e&&(l=e)}else if(0<u){if(e<l)return;e<h&&(h=e)}if(e=i-s,c||!(0<e)){if(e/=c,c<0){if(e<l)return;e<h&&(h=e)}else if(0<c){if(h<e)return;l<e&&(l=e)}if(e=r-s,c||!(e<0)){if(e/=c,c<0){if(h<e)return;l<e&&(l=e)}else if(0<c){if(e<l)return;e<h&&(h=e)}return 0<l&&(t[0]=o+l*u,t[1]=s+l*c),h<1&&(n[0]=o+h*u,n[1]=s+h*c),1}}}}})(e=[h=Math.max(op,Math.min(rp,h)),u=Math.max(op,Math.min(rp,u))],i=[t=Math.max(op,Math.min(rp,t)),n=Math.max(op,Math.min(rp,n))],m,y,v,b)?(g||(p.lineStart(),p.point(e[0],e[1])),p.point(i[0],i[1]),a||p.lineEnd(),f=!1):a&&(p.lineStart(),p.point(t,n),f=!1),h=t,u=n,g=a}return n}}var lp={sphere:h0,point:h0,lineStart:function(){lp.point=up,lp.lineEnd=hp},lineEnd:h0,polygonStart:h0,polygonEnd:h0};function hp(){lp.point=lp.lineEnd=h0}function up(t,n){ep=t*=N,ip=T(n*=N),ap=z(n),lp.point=cp}function cp(t,n){t*=N;var e=T(n*=N),n=z(n),i=P(t-ep),a=z(i),i=n*T(i),r=ap*e-ip*n*a,a=ip*e+ap*n*a;np.add(Xf(a0(i*i+r*r),a)),ep=t,ip=e,ap=n}function gp(t){return np=new Gi,p0(t,lp),+np}var dp=[null,null],fp={type:"LineString",coordinates:dp};function pp(t,n){return dp[0]=t,dp[1]=n,gp(fp)}var _p={Feature:function(t,n){return yp(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,i=-1,a=e.length;++i<a;)if(yp(e[i].geometry,n))return!0;return!1}},mp={Sphere:function(){return!0},Point:function(t,n){return vp(t.coordinates,n)},MultiPoint:function(t,n){for(var e=t.coordinates,i=-1,a=e.length;++i<a;)if(vp(e[i],n))return!0;return!1},LineString:function(t,n){return bp(t.coordinates,n)},MultiLineString:function(t,n){for(var e=t.coordinates,i=-1,a=e.length;++i<a;)if(bp(e[i],n))return!0;return!1},Polygon:function(t,n){return xp(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,i=-1,a=e.length;++i<a;)if(xp(e[i],n))return!0;return!1},GeometryCollection:function(t,n){for(var e=t.geometries,i=-1,a=e.length;++i<a;)if(yp(e[i],n))return!0;return!1}};function yp(t,n){return!(!t||!mp.hasOwnProperty(t.type))&&mp[t.type](t,n)}function vp(t,n){return 0===pp(t,n)}function bp(t,n){for(var e,i,a,r=0,o=t.length;r<o;r++){if(0===(i=pp(t[r],n)))return!0;if(0<r&&0<(a=pp(t[r],t[r-1]))&&e<=a&&i<=a&&(e+i-a)*(1-Math.pow((e-i)/a,2))<Wf*a)return!0;e=i}return!1}function xp(t,n){return!!Y1(t.map(wp),Sp(n))}function wp(t){return(t=t.map(Sp)).pop(),t}function Sp(t){return[t[0]*N,t[1]*N]}function kp(t,n,e){var i=jt(t,n-E,e).concat(n);return function(n){return i.map(function(t){return[n,t]})}}function Cp(t,n,e){var i=jt(t,n-E,e).concat(n);return function(n){return i.map(function(t){return[t,n]})}}function Mp(){var n,e,i,a,r,o,s,l,h,u,c,g,d=10,f=d,p=90,_=360,m=2.5;function y(){return{type:"MultiLineString",coordinates:t()}}function t(){return jt(Jf(a/p)*p,i,p).map(c).concat(jt(Jf(l/_)*_,s,_).map(g)).concat(jt(Jf(e/d)*d,n,d).filter(function(t){return P(t%p)>E}).map(h)).concat(jt(Jf(o/f)*f,r,f).filter(function(t){return P(t%_)>E}).map(u))}return y.lines=function(){return t().map(function(t){return{type:"LineString",coordinates:t}})},y.outline=function(){return{type:"Polygon",coordinates:[c(a).concat(g(s).slice(1),c(i).reverse().slice(1),g(l).reverse().slice(1))]}},y.extent=function(t){return arguments.length?y.extentMajor(t).extentMinor(t):y.extentMinor()},y.extentMajor=function(t){return arguments.length?(a=+t[0][0],i=+t[1][0],l=+t[0][1],s=+t[1][1],i<a&&(t=a,a=i,i=t),s<l&&(t=l,l=s,s=t),y.precision(m)):[[a,l],[i,s]]},y.extentMinor=function(t){return arguments.length?(e=+t[0][0],n=+t[1][0],o=+t[0][1],r=+t[1][1],n<e&&(t=e,e=n,n=t),r<o&&(t=o,o=r,r=t),y.precision(m)):[[e,o],[n,r]]},y.step=function(t){return arguments.length?y.stepMajor(t).stepMinor(t):y.stepMinor()},y.stepMajor=function(t){return arguments.length?(p=+t[0],_=+t[1],y):[p,_]},y.stepMinor=function(t){return arguments.length?(d=+t[0],f=+t[1],y):[d,f]},y.precision=function(t){return arguments.length?(m=+t,h=kp(o,r,90),u=Cp(e,n,m),c=kp(l,s,90),g=Cp(a,i,m),y):m},y.extentMajor([[-180,-90+E],[180,90-E]]).extentMinor([[-180,-80-E],[180,80+E]])}function Ap(t,n){var e=t[0]*N,i=t[1]*N,t=n[0]*N,n=n[1]*N,a=z(i),r=T(i),o=z(n),s=T(n),l=a*z(e),h=a*T(e),u=o*z(t),c=o*T(t),g=2*s0(a0(l0(n-i)+a*o*l0(t-e))),d=T(g),n=g?function(t){var n=T(t*=g)/d,t=T(g-t)/d,e=t*l+n*u,i=t*h+n*c,t=t*r+n*s;return[Xf(i,e)*Yf,Xf(t,a0(e*e+i*i))*Yf]}:function(){return[e*Yf,i*Yf]};return n.distance=g,n}var zp,Tp,Ep,Np,Pp=t=>t,Lp=new Gi,Bp=new Gi,Op={point:h0,lineStart:h0,lineEnd:h0,polygonStart:function(){Op.lineStart=Dp,Op.lineEnd=Fp},polygonEnd:function(){Op.lineStart=Op.lineEnd=Op.point=h0,Lp.add(P(Bp)),Bp=new Gi},result:function(){var t=Lp/2;return Lp=new Gi,t}};function Dp(){Op.point=jp}function jp(t,n){Op.point=Rp,zp=Ep=t,Tp=Np=n}function Rp(t,n){Bp.add(Np*t-Ep*n),Ep=t,Np=n}function Fp(){Rp(zp,Tp)}var Ip=1/0,Hp=Ip,Gp=-Ip,Kp=Gp,Up={point:function(t,n){t<Ip&&(Ip=t);Gp<t&&(Gp=t);n<Hp&&(Hp=n);Kp<n&&(Kp=n)}
|
|
5281
5281
|
// TODO Enforce positive area for exterior, negative area for interior?
|
|
5282
|
-
,lineStart:h0,lineEnd:h0,polygonStart:h0,polygonEnd:h0,result:function(){var t=[[
|
|
5282
|
+
,lineStart:h0,lineEnd:h0,polygonStart:h0,polygonEnd:h0,result:function(){var t=[[Ip,Hp],[Gp,Kp]];return Gp=Kp=-(Hp=Ip=1/0),t}};var Wp,qp,$p,Vp,Yp=0,Zp=0,Xp=0,Jp=0,Qp=0,t_=0,n_=0,e_=0,i_=0,a_={point:r_,lineStart:o_,lineEnd:h_,polygonStart:function(){a_.lineStart=u_,a_.lineEnd=c_},polygonEnd:function(){a_.point=r_,a_.lineStart=o_,a_.lineEnd=h_},result:function(){var t=i_?[n_/i_,e_/i_]:t_?[Jp/t_,Qp/t_]:Xp?[Yp/Xp,Zp/Xp]:[NaN,NaN];return Yp=Zp=Xp=Jp=Qp=t_=n_=e_=i_=0,t}};function r_(t,n){Yp+=t,Zp+=n,++Xp}function o_(){a_.point=s_}function s_(t,n){a_.point=l_,r_($p=t,Vp=n)}function l_(t,n){var e=t-$p,i=n-Vp,e=a0(e*e+i*i);Jp+=e*($p+t)/2,Qp+=e*(Vp+n)/2,t_+=e,r_($p=t,Vp=n)}function h_(){a_.point=r_}function u_(){a_.point=g_}function c_(){d_(Wp,qp)}function g_(t,n){a_.point=d_,r_(Wp=$p=t,qp=Vp=n)}function d_(t,n){var e=t-$p,i=n-Vp,e=a0(e*e+i*i);Jp+=e*($p+t)/2,Qp+=e*(Vp+n)/2,t_+=e,n_+=(e=Vp*t-$p*n)*($p+t),e_+=e*(Vp+n),i_+=3*e,r_($p=t,Vp=n)}function f_(t){this._context=t}f_.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,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(t,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,Vf)}},result:h0};var p_,__,m_,y_,v_,b_=new Gi,x_={point:h0,lineStart:function(){x_.point=w_},lineEnd:function(){p_&&S_(__,m_),x_.point=h0},polygonStart:function(){p_=!0},polygonEnd:function(){p_=null},result:function(){var t=+b_;return b_=new Gi,t}};function w_(t,n){x_.point=S_,__=y_=t,m_=v_=n}function S_(t,n){y_-=t,v_-=n,b_.add(a0(y_*y_+v_*v_)),y_=t,v_=n}
|
|
5283
5283
|
// Simple caching for constant-radius points.
|
|
5284
5284
|
let k_,C_,M_,A_;class z_{pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:this._append`M${t},${n}`,this._point=1;break;case 1:this._append`L${t},${n}`;break;default:var e,i;this._append`M${t},${n}`,this._radius===M_&&this._append===C_||(e=this._radius,i=this._,this._="",// stash the old string so we can cache the circle path fragment
|
|
5285
|
-
this._append`m0,${e}a${e},${e} 0 1,1 0,${-2*e}a${e},${e} 0 1,1 0,${2*e}z`,M_=e,C_=this._append,A_=this._,this._=i),this._+=A_}}result(){var t=this._;return this._="",t.length?t:null}constructor(t){this._append=null==t?T_:(t=>{var n=Math.floor(t);if(!(0<=n))throw new RangeError("invalid digits: "+t);if(15<n)return T_;if(n!==k_){let i=10**n;k_=n,C_=function(t){let n=1;this._+=t[0];for(var e=t.length;n<e;++n)this._+=Math.round(arguments[n]*i)/i+t[n]}}return C_})(t),this._radius=4.5,this._=""}}function T_(t){let n=1;this._+=t[0];for(var e=t.length;n<e;++n)this._+=arguments[n]+t[n]}function E_(i){return function(t){var n,e=new N_;for(n in i)e[n]=i[n];return e.stream=t,e}}function N_(){}function P_(t,n,e){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),p0(e,t.stream(Up)),n(Up.result()),null!=i&&t.clipExtent(i),t}function
|
|
5286
|
-
function
|
|
5287
|
-
function t(t,n){t=A(t,n),i.point(t[0],t[1])}function n(){u=NaN,p.point=_,i.lineStart()}function _(t,n){var e=
|
|
5285
|
+
this._append`m0,${e}a${e},${e} 0 1,1 0,${-2*e}a${e},${e} 0 1,1 0,${2*e}z`,M_=e,C_=this._append,A_=this._,this._=i),this._+=A_}}result(){var t=this._;return this._="",t.length?t:null}constructor(t){this._append=null==t?T_:(t=>{var n=Math.floor(t);if(!(0<=n))throw new RangeError("invalid digits: "+t);if(15<n)return T_;if(n!==k_){let i=10**n;k_=n,C_=function(t){let n=1;this._+=t[0];for(var e=t.length;n<e;++n)this._+=Math.round(arguments[n]*i)/i+t[n]}}return C_})(t),this._radius=4.5,this._=""}}function T_(t){let n=1;this._+=t[0];for(var e=t.length;n<e;++n)this._+=arguments[n]+t[n]}function E_(i){return function(t){var n,e=new N_;for(n in i)e[n]=i[n];return e.stream=t,e}}function N_(){}function P_(t,n,e){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),p0(e,t.stream(Up)),n(Up.result()),null!=i&&t.clipExtent(i),t}function L_(a,r,t){return P_(a,function(t){var n=r[1][0]-r[0][0],e=r[1][1]-r[0][1],i=Math.min(n/(t[1][0]-t[0][0]),e/(t[1][1]-t[0][1])),n=+r[0][0]+(n-i*(t[1][0]+t[0][0]))/2,e=+r[0][1]+(e-i*(t[1][1]+t[0][1]))/2;a.scale(150*i).translate([n,e])},t)}function B_(t,n,e){return L_(t,[[0,0],n],e)}function O_(i,a,t){return P_(i,function(t){var n=+a,e=n/(t[1][0]-t[0][0]),n=(n-e*(t[1][0]+t[0][0]))/2,t=-e*t[0][1];i.scale(150*e).translate([n,t])},t)}function D_(a,r,t){return P_(a,function(t){var n=+r,e=n/(t[1][1]-t[0][1]),i=-e*t[0][0],n=(n-e*(t[1][1]+t[0][1]))/2;a.scale(150*e).translate([i,n])},t)}N_.prototype={constructor:N_,point:function(t,n){this.stream.point(t,n)},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 j_=16,R_=z(30*N);// cos(minimum angular distance)
|
|
5286
|
+
function F_(t,n){return+n?(A=t,z=n,function(i){var e,a,r,o,s,l,h,u,c,g,d,f,p={point:t,lineStart:n,lineEnd:m,polygonStart:function(){i.polygonStart(),p.lineStart=y},polygonEnd:function(){i.polygonEnd(),p.lineStart=n}};// previous point
|
|
5287
|
+
function t(t,n){t=A(t,n),i.point(t[0],t[1])}function n(){u=NaN,p.point=_,i.lineStart()}function _(t,n){var e=I0([t,n]),n=A(t,n);T(u,c,h,g,d,f,u=n[0],c=n[1],h=t,g=e[0],d=e[1],f=e[2],j_,i),i.point(u,c)}function m(){p.point=t,i.lineEnd()}function y(){n(),p.point=v,p.lineEnd=b}function v(t,n){_(e=t,n),a=u,r=c,o=g,s=d,l=f,p.point=_}function b(){T(u,c,h,g,d,f,a,r,e,o,s,l,j_,i),p.lineEnd=m,m()}return p}):(e=t,E_({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}}));var e,A,z;function T(t,n,e,i,a,r,o,s,l,h,u,c,g,d){var f,p,_,m,y,v,b,x,w,S,k=o-t,C=s-n,M=k*k+C*C;4*z<M&&g--&&(_=r+c,b=s0(_/=m=a0((f=i+h)*f+(p=a+u)*p+_*_)),y=P(P(_)-1)<E||P(e-l)<E?(e+l)/2:Xf(p,f),v=(b=A(y,b))[0],z<(S=C*(x=v-t)-k*(w=(b=b[1])-n))*S/M||.3<P((k*x+C*w)/M-.5)||i*h+a*u+r*c<R_)&&(T(t,n,e,i,a,r,v,b,y,f/=m,p/=m,_,g,d),d.point(v,b),T(v,b,y,f,p,_,o,s,l,h,u,c,g,d))}}var I_=E_({point:function(t,n){this.stream.point(t*N,n*N)}});function H_(t,e,i,a,r,n){var o,s,l,h,u,c,g,d,f,p,_,m;return n?(c=z(n),n=T(n),g=c*t,d=n*t,f=c/t,p=n/t,_=(n*i-c*e)/t,m=(n*e+c*i)/t,v.invert=function(t,n){return[a*(f*t-p*n+_),r*(m-p*t-f*n)]},v):(o=t,s=e,l=i,h=a,u=r,y.invert=function(t,n){return[(t-s)/o*h,(l-n)/o*u]},y);function y(t,n){return[s+o*(t*=h),l-o*(n*=u)]}function v(t,n){return[g*(t*=a)-d*(n*=r)+e,i-d*t-g*n]}}function d(t){return G_(function(){return t})()}function G_(t){var n,i,e,a,r,o,s,l,h,u,c=150,g=480,d=250,f=0,p=0,_=0,m=0,y=0,v=0,b=1,x=1,w=null,S=Q1,k=null,C=Pp,M=.5;function A(t){return l(t[0]*N,t[1]*N)}function z(t){return(t=l.invert(t[0],t[1]))&&[t[0]*Yf,t[1]*Yf]}function T(){var t=H_(c,0,0,b,x,v).apply(null,n(f,p)),t=H_(c,g-t[0],d-t[1],b,x,v);return i=O1(_,m,y),s=L1(n,t),l=L1(i,s),o=F_(s,M),E()}function E(){return h=u=null,A}return A.stream=function(t){return h&&u===t?h:h=I_((e=i,E_({point:function(t,n){t=e(t,n);return this.stream.point(t[0],t[1])}})(S(o(C(u=t))))));var e},A.preclip=function(t){return arguments.length?(S=t,w=void 0,E()):S},A.postclip=function(t){return arguments.length?(C=t,k=e=a=r=null,E()):C},A.clipAngle=function(t){return arguments.length?(S=+t?tp(w=t*N):(w=null,Q1),E()):w*Yf},A.clipExtent=function(t){return arguments.length?(C=null==t?(k=e=a=r=null,Pp):sp(k=+t[0][0],e=+t[0][1],a=+t[1][0],r=+t[1][1]),E()):null==k?null:[[k,e],[a,r]]},A.scale=function(t){return arguments.length?(c=+t,T()):c},A.translate=function(t){return arguments.length?(g=+t[0],d=+t[1],T()):[g,d]},A.center=function(t){return arguments.length?(f=t[0]%360*N,p=t[1]%360*N,T()):[f*Yf,p*Yf]},A.rotate=function(t){return arguments.length?(_=t[0]%360*N,m=t[1]%360*N,y=2<t.length?t[2]%360*N:0,T()):[_*Yf,m*Yf,y*Yf]},A.angle=function(t){return arguments.length?(v=t%360*N,T()):v*Yf},A.reflectX=function(t){return arguments.length?(b=t?-1:1,T()):b<0},A.reflectY=function(t){return arguments.length?(x=t?-1:1,T()):x<0},A.precision=function(t){return arguments.length?(o=F_(s,M=t*t),E()):a0(M)},A.fitExtent=function(t,n){return L_(A,t,n)},A.fitSize=function(t,n){return B_(A,t,n)},A.fitWidth=function(t,n){return O_(A,t,n)},A.fitHeight=function(t,n){return D_(A,t,n)},function(){return n=t.apply(this,arguments),A.invert=n.invert&&z,T()}}function K_(t){var n=0,e=A/3,i=G_(t),t=i(n,e);return t.parallels=function(t){return arguments.length?i(n=t[0]*N,e=t[1]*N):[n*Yf,e*Yf]},t}function U_(t,n){var e,i,a,r=T(t),o=(r+T(n))/2;
|
|
5288
5288
|
// Are the parallels symmetrical around the Equator?
|
|
5289
5289
|
return P(o)<E?(e=z(t),s.invert=function(t,n){return[t/e,s0(n*e)]},s):(a=a0(i=1+r*(2*o-r))/o,l.invert=function(t,n){var n=a-n,e=Xf(t,P(n))*i0(n);return n*o<0&&(e-=A*i0(t)*i0(n)),[e/o,s0((i-(t*t+n*n)*o*o)/(2*o))]},l);function s(t,n){return[t*e,T(n)/e]}function l(t,n){n=a0(i-2*o*T(n))/o;return[n*T(t*=o),a-n*z(t)]}}function W_(){return K_(U_).scale(155.424).center([0,33.6442])}function q_(){return W_().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}
|
|
5290
5290
|
// The projections must have mutually exclusive clip regions on the sphere,
|
|
5291
5291
|
// as this will avoid emitting interleaving lines and polygons.
|
|
5292
5292
|
function $_(a){return function(t,n){var e=z(t),i=z(n),e=a(e*i);return e===1/0?[2,0]:[e*i*T(t),e*T(n)]}}function V_(r){return function(t,n){var e=a0(t*t+n*n),i=r(e),a=T(i),i=z(i);return[Xf(t*a,e*i),s0(e&&n*a/e)]}}var Y_=$_(function(t){return a0(2/(1+t))});Y_.invert=V_(function(t){return 2*s0(t/2)});var Z_=$_(function(t){return(t=o0(t))&&t/T(t)});function X_(t,n){return[t,n0(r0((qf+n)/2))]}function J_(e){var i,a,r,o=d(e),n=o.center,s=o.scale,l=o.translate,h=o.clipExtent,u=null;// clip extent
|
|
5293
|
-
function c(){var t=A*s(),n=o(
|
|
5293
|
+
function c(){var t=A*s(),n=o(F1(o.rotate()).invert([0,0]));return h(null==u?[[n[0]-t,n[1]-t],[n[0]+t,n[1]+t]]:e===X_?[[Math.max(n[0]-t,u),i],[Math.min(n[0]+t,a),r]]:[[u,Math.max(n[1]-t,i)],[a,Math.min(n[1]+t,r)]])}return o.scale=function(t){return(arguments.length?(s(t),c):s)()},o.translate=function(t){return(arguments.length?(l(t),c):l)()},o.center=function(t){return(arguments.length?(n(t),c):n)()},o.clipExtent=function(t){return arguments.length?(null==t?u=i=a=r=null:(u=+t[0][0],i=+t[0][1],a=+t[1][0],r=+t[1][1]),c()):null==u?null:[[u,i],[a,r]]},c()}function Q_(t){return r0((qf+t)/2)}function tm(t,n){var e=z(t),a=t===n?T(t):n0(e/z(n))/n0(Q_(n)/Q_(t)),r=e*e0(Q_(t),a)/a;return a?(i.invert=function(t,n){var n=r-n,e=i0(a)*a0(t*t+n*n),i=Xf(t,P(n))*i0(n);return n*a<0&&(i-=A*i0(t)*i0(n)),[i/a,2*Zf(e0(r/e,1/a))-qf]},i):X_;function i(t,n){0<r?n<-qf+E&&(n=-qf+E):qf-E<n&&(n=qf-E);n=r/e0(Q_(n),a);return[n*T(a*t),r-n*z(a*t)]}}function nm(t,n){return[t,n]}function em(){return d(nm).scale(152.63)}function im(t,n){var e=z(t),i=t===n?T(t):(e-z(n))/(n-t),a=e/i+t;return P(i)<E?nm:(r.invert=function(t,n){var n=a-n,e=Xf(t,P(n))*i0(n);return n*i<0&&(e-=A*i0(t)*i0(n)),[e/i,a-i0(i)*a0(t*t+n*n)]},r);function r(t,n){n=a-n,t*=i;return[n*T(t),a-n*z(t)]}}Z_.invert=V_(function(t){return t}),X_.invert=function(t,n){return[t,2*Zf(Qf(n))-qf]},nm.invert=nm;var am=1.340264,rm=-.081106,om=893e-6,sm=.003796,lm=a0(3)/2;function hm(t,n){var n=s0(lm*T(n)),e=n*n,i=e*e*e;return[t*z(n)/(lm*(am+3*rm*e+i*(7*om+9*sm*e))),n*(am+rm*e+i*(om+sm*e))]}function um(t,n){var e=z(n),i=z(t)*e;return[e*T(t)/i,T(n)/i]}function cm(){return d(um).scale(144.049).clipAngle(60)}function gm(t,n){var e=n*n,i=e*e;return[t*(.8707-.131979*e+i*(i*(.003971*e-.001529*i)-.013791)),n*(1.007226+e*(.015085+i*(.028874*e-.044475-.005916*i)))]}function dm(t,n){return[z(n)*T(t),T(n)]}function fm(){return d(dm).scale(249.5).clipAngle(90+E)}function pm(t,n){var e=z(n),i=1+z(t)*e;return[e*T(t)/i,T(n)/i]}function _m(t,n){return[n0(r0((qf+n)/2)),-t]}hm.invert=function(t,n){for(var e,i=n,a=i*i,r=a*a*a,o=0;o<12&&(r=(a=(i-=e=(i*(am+rm*a+r*(om+sm*a))-n)/(am+3*rm*a+r*(7*om+9*sm*a)))*i)*a*a,!(P(e)<Wf));++o);return[lm*t*(am+3*rm*a+r*(7*om+9*sm*a))/z(i),s0(T(i)/lm)]},um.invert=V_(Zf),gm.invert=function(t,n){var e=n,i=25;do{var a=e*e,r=a*a}while(e-=r=(e*(1.007226+a*(.015085+r*(.028874*a-.044475-.005916*r)))-n)/(1.007226+a*(.045255+r*(.259866*a-.311325-.005916*11*r))),P(r)>E&&0<--i);return[t/(.8707+(a=e*e)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),e]},dm.invert=V_(s0),pm.invert=V_(function(t){return 2*Zf(t)}),_m.invert=function(t,n){return[-n,2*Zf(Qf(t))-qf]};var ph=Object.freeze({__proto__:null,geoAlbers:q_,geoAlbersUsa:
|
|
5294
5294
|
// A composite projection for the United States, configured by default for
|
|
5295
5295
|
// 960×500. The projection also works quite well at 960×600 if you change the
|
|
5296
5296
|
// scale to 1285 and adjust the translate accordingly. The set of standard
|
|
5297
5297
|
// parallels for each region comes from USGS, which is published here:
|
|
5298
5298
|
// http://egsc.usgs.gov/isb/pubs/MapProjections/projections.html#albers
|
|
5299
|
-
function(){var n,e,a,r,o,i,s=q_(),l=W_().rotate([154,0]).center([-2,58.5]).parallels([55,65]),h=W_().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,n){i=[t,n]}};function c(t){var n=t[0],t=t[1];return i=null,a.point(n,t),i||(r.point(n,t),i)||(o.point(n,t),i)}function g(){return n=e=null,c}return c.invert=function(t){var n=s.scale(),e=s.translate(),i=(t[0]-e[0])/n,e=(t[1]-e[1])/n;return(.12<=e&&e<.234&&-.425<=i&&i<-.214?l:.166<=e&&e<.234&&-.214<=i&&i<-.115?h:s).invert(t)},c.stream=function(t){return n&&e===t?n:(i=[s.stream(e=t),l.stream(t),h.stream(t)],a=i.length,n={point:function(t,n){for(var e=-1;++e<a;)i[e].point(t,n)},sphere:function(){for(var t=-1;++t<a;)i[t].sphere()},lineStart:function(){for(var t=-1;++t<a;)i[t].lineStart()},lineEnd:function(){for(var t=-1;++t<a;)i[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<a;)i[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<a;)i[t].polygonEnd()}});var i,a},c.precision=function(t){return arguments.length?(s.precision(t),l.precision(t),h.precision(t),g()):s.precision()},c.scale=function(t){return arguments.length?(s.scale(t),l.scale(.35*t),h.scale(t),c.translate(s.translate())):s.scale()},c.translate=function(t){var n,e,i;return arguments.length?(n=s.scale(),e=+t[0],i=+t[1],a=s.translate(t).clipExtent([[e-.455*n,i-.238*n],[e+.455*n,i+.238*n]]).stream(u),r=l.translate([e-.307*n,i+.201*n]).clipExtent([[e-.425*n+E,i+.12*n+E],[e-.214*n-E,i+.234*n-E]]).stream(u),o=h.translate([e-.205*n,i+.212*n]).clipExtent([[e-.214*n+E,i+.166*n+E],[e-.115*n-E,i+.234*n-E]]).stream(u),g()):s.translate()},c.fitExtent=function(t,n){return
|
|
5299
|
+
function(){var n,e,a,r,o,i,s=q_(),l=W_().rotate([154,0]).center([-2,58.5]).parallels([55,65]),h=W_().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,n){i=[t,n]}};function c(t){var n=t[0],t=t[1];return i=null,a.point(n,t),i||(r.point(n,t),i)||(o.point(n,t),i)}function g(){return n=e=null,c}return c.invert=function(t){var n=s.scale(),e=s.translate(),i=(t[0]-e[0])/n,e=(t[1]-e[1])/n;return(.12<=e&&e<.234&&-.425<=i&&i<-.214?l:.166<=e&&e<.234&&-.214<=i&&i<-.115?h:s).invert(t)},c.stream=function(t){return n&&e===t?n:(i=[s.stream(e=t),l.stream(t),h.stream(t)],a=i.length,n={point:function(t,n){for(var e=-1;++e<a;)i[e].point(t,n)},sphere:function(){for(var t=-1;++t<a;)i[t].sphere()},lineStart:function(){for(var t=-1;++t<a;)i[t].lineStart()},lineEnd:function(){for(var t=-1;++t<a;)i[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<a;)i[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<a;)i[t].polygonEnd()}});var i,a},c.precision=function(t){return arguments.length?(s.precision(t),l.precision(t),h.precision(t),g()):s.precision()},c.scale=function(t){return arguments.length?(s.scale(t),l.scale(.35*t),h.scale(t),c.translate(s.translate())):s.scale()},c.translate=function(t){var n,e,i;return arguments.length?(n=s.scale(),e=+t[0],i=+t[1],a=s.translate(t).clipExtent([[e-.455*n,i-.238*n],[e+.455*n,i+.238*n]]).stream(u),r=l.translate([e-.307*n,i+.201*n]).clipExtent([[e-.425*n+E,i+.12*n+E],[e-.214*n-E,i+.234*n-E]]).stream(u),o=h.translate([e-.205*n,i+.212*n]).clipExtent([[e-.214*n+E,i+.166*n+E],[e-.115*n-E,i+.234*n-E]]).stream(u),g()):s.translate()},c.fitExtent=function(t,n){return L_(c,t,n)},c.fitSize=function(t,n){return B_(c,t,n)},c.fitWidth=function(t,n){return O_(c,t,n)},c.fitHeight=function(t,n){return D_(c,t,n)},c.scale(1070)},geoArea:function(t){return L0=new Gi,p0(t,B0),2*L0},geoAzimuthalEqualArea:function(){return d(Y_).scale(124.75).clipAngle(179.999)},geoAzimuthalEqualAreaRaw:Y_,geoAzimuthalEquidistant:function(){return d(Z_).scale(79.4188).clipAngle(179.999)},geoAzimuthalEquidistantRaw:Z_,geoBounds:v1,geoCentroid:N1,geoCircle:G1,geoClipAntimeridian:Q1,geoClipCircle:tp,geoClipExtent:function(){var n,e,i,a=0,r=0,o=960,s=500;return i={stream:function(t){return n&&e===t?n:n=sp(a,r,o,s)(e=t)},extent:function(t){return arguments.length?(a=+t[0][0],r=+t[0][1],o=+t[1][0],s=+t[1][1],n=e=null,i):[[a,r],[o,s]]}}},geoClipRectangle:sp,geoConicConformal:function(){return K_(tm).scale(109.5).parallels([30,30])},geoConicConformalRaw:tm,geoConicEqualArea:W_,geoConicEqualAreaRaw:U_,geoConicEquidistant:function(){return K_(im).scale(131.154).center([0,13.9389])},geoConicEquidistantRaw:im,geoContains:function(t,n){return(t&&_p.hasOwnProperty(t.type)?_p[t.type]:yp)(t,n)},geoDistance:pp,geoEqualEarth:function(){return d(hm).scale(177.158)},geoEqualEarthRaw:hm,geoEquirectangular:em,geoEquirectangularRaw:nm,geoGnomonic:cm,geoGnomonicRaw:um,geoGraticule:Mp,geoGraticule10:function(){return Mp()()},geoIdentity:function(){var i,a,n,e,r,o,s,l=1,h=0,u=0,c=1,g=1,d=0,f=null,p=1,_=1,m=E_({point:function(t,n){t=b([t,n]);this.stream.point(t[0],t[1])}}),y=Pp;function v(){return p=l*c,_=l*g,o=s=null,b}function b(t){var n,e=t[0]*p,t=t[1]*_;return d&&(n=t*i-e*a,e=e*i+t*a,t=n),[e+h,t+u]}return b.invert=function(t){var n,e=t[0]-h,t=t[1]-u;return d&&(n=t*i+e*a,e=e*i-t*a,t=n),[e/p,t/_]},b.stream=function(t){return o&&s===t?o:o=m(y(s=t))},b.postclip=function(t){return arguments.length?(y=t,f=n=e=r=null,v()):y},b.clipExtent=function(t){return arguments.length?(y=null==t?(f=n=e=r=null,Pp):sp(f=+t[0][0],n=+t[0][1],e=+t[1][0],r=+t[1][1]),v()):null==f?null:[[f,n],[e,r]]},b.scale=function(t){return arguments.length?(l=+t,v()):l},b.translate=function(t){return arguments.length?(h=+t[0],u=+t[1],v()):[h,u]},b.angle=function(t){return arguments.length?(a=T(d=t%360*N),i=z(d),v()):d*Yf},b.reflectX=function(t){return arguments.length?(c=t?-1:1,v()):c<0},b.reflectY=function(t){return arguments.length?(g=t?-1:1,v()):g<0},b.fitExtent=function(t,n){return L_(b,t,n)},b.fitSize=function(t,n){return B_(b,t,n)},b.fitWidth=function(t,n){return O_(b,t,n)},b.fitHeight=function(t,n){return D_(b,t,n)},b},geoInterpolate:Ap,geoLength:gp,geoMercator:function(){return J_(X_).scale(961/Vf)},geoMercatorRaw:X_,geoNaturalEarth1:function(){return d(gm).scale(175.295)},geoNaturalEarth1Raw:gm,geoOrthographic:fm,geoOrthographicRaw:dm,geoPath:function(n,e){let i=3,a=4.5,r,o;function s(t){return t&&("function"==typeof a&&o.pointRadius(+a.apply(this,arguments)),p0(t,r(o))),o.result()}return s.area=function(t){return p0(t,r(Op)),Op.result()},s.measure=function(t){return p0(t,r(x_)),x_.result()},s.bounds=function(t){return p0(t,r(Up)),Up.result()},s.centroid=function(t){return p0(t,r(a_)),a_.result()},s.projection=function(t){return arguments.length?(r=null==t?(n=null,Pp):(n=t).stream,s):n},s.context=function(t){return arguments.length?(o=null==t?(e=null,new z_(i)):new f_(e=t),"function"!=typeof a&&o.pointRadius(a),s):e},s.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(o.pointRadius(+t),+t),s):a},s.digits=function(t){if(!arguments.length)return i;if(null==t)i=null;else{var n=Math.floor(t);if(!(0<=n))throw new RangeError("invalid digits: "+t);i=n}return null===e&&(o=new z_(i)),s},s.projection(n).digits(i).context(e)},geoProjection:d,geoProjectionMutator:G_,geoRotation:F1,geoStereographic:function(){return d(pm).scale(250).clipAngle(142)},geoStereographicRaw:pm,geoStream:p0,geoTransform:function(t){return{stream:E_(t)}},geoTransverseMercator:function(){var t=J_(_m),n=t.center,e=t.rotate;return t.center=function(t){return arguments.length?n([-t[1],t[0]]):[(t=n())[1],-t[0]]},t.rotate=function(t){return arguments.length?e([t[0],t[1],2<t.length?t[2]+90:90]):[(t=e())[0],t[1],t[2]-90]},e([0,0,90]).scale(159.155)},geoTransverseMercatorRaw:_m}),L=Math.abs,mm=Math.atan,b=Math.atan2,B=Math.cos,ym=Math.exp,vm=Math.floor,bm=Math.log,xm=Math.max,wm=Math.min,Sm=Math.pow,km=Math.round,y=Math.sign||function(t){return 0<t?1:t<0?-1:0},O=Math.sin,g=Math.tan,D=1e-6,Cm=1e-12,j=Math.PI,R=j/2,Mm=j/4,Am=Math.SQRT1_2,zm=I(2),Tm=I(j),Em=2*j,m=180/j,x=j/180;function F(t){return 1<t?R:t<-1?-R:Math.asin(t)}function Nm(t){return 1<t?0:t<-1?j:Math.acos(t)}function I(t){return 0<t?Math.sqrt(t):0}function Pm(t){return(ym(t)-ym(-t))/2}function Lm(t){return(ym(t)+ym(-t))/2}function Bm(u){var t=g(u/2),c=2*bm(B(u/2))/(t*t);function n(t,n){var e=B(t),i=B(n),n=O(n),e=i*e,e=-((1-e?bm((1+e)/2)/(1-e):-.5)+c/(1+e));return[e*i*O(t),e*n]}return n.invert=function(t,n){var e=I(t*t+n*n),i=-u/2,a=50;if(!e)return[0,0];do{var r=i/2,o=B(r),r=O(r),s=r/o,l=-bm(L(o))}while(i-=s=(2/s*l-c*s-e)/(-l/(r*r)+1-c/(2*o*o))*(o<0?.7:1),L(s)>D&&0<--a);var h=O(i);return[b(t*h,e*B(i)),F(n*h/e)]},n}function Om(t,n){var e=B(n),i=(i=Nm(e*B(t/=2)))?i/Math.sin(i):1;return[2*e*O(t)*i,O(n)*i]}
|
|
5300
5300
|
// Abort if [x, y] is not within an ellipse centered at [0, 0] with
|
|
5301
5301
|
// semi-major axis pi and semi-minor axis pi/2.
|
|
5302
|
-
function Dm(t){var f=O(t),p=
|
|
5303
|
-
t=i+
|
|
5302
|
+
function Dm(t){var f=O(t),p=B(t),_=0<=t?1:-1,m=g(_*t),y=(1+f-p)/2;function n(t,n){var e=B(n),i=B(t/=2);return[(1+e)*O(t),(_*n>-b(i,m)-.001?0:10*-_)+y+O(n)*p-(1+e)*f*i]}return n.invert=function(t,n){var e=0,i=0,a=50;do{var r=B(e),o=O(e),s=B(i),l=O(i),h=1+s,u=h*o-t,c=y+l*p-h*f*r-n,g=h*r/2,d=-o*l,h=f*h*o/2,o=p*s+f*r*l,s=d*h-o*g,r=(c*d-u*o)/s/2,l=(u*h-c*g)/s}while(2<L(l)&&(l/=2),e-=r,i-=l,(L(r)>D||L(l)>D)&&0<--a);return _*i>-b(B(e),m)-.001?[2*e,i]:null},n}function jm(t,n){var n=g(n/2),e=I(1-n*n),i=1+e*B(t/=2),t=O(t)*e/i,e=n/i,n=t*t,i=e*e;return[4/3*t*(3+n-3*i),4/3*e*(3+3*n-i)]}Om.invert=function(t,n){if(!(j*j+D<t*t+4*n*n)){var e=t,i=n,a=25;do{var r,o=O(e),s=O(e/2),l=B(e/2),h=O(i),u=B(i),c=O(2*i),g=h*h,d=u*u,f=s*s,p=1-d*l*l,p=p?Nm(u*l)*I(r=1/p):r=0,_=2*p*u*s-t,m=p*h-n,y=r*(d*f+p*u*l*g),v=r*(.5*o*c-2*p*h*s),c=.25*r*(c*s-p*h*d*o),s=r*(g*l+p*f*u),h=v*c-s*y;if(!h)break;d=(m*v-_*s)/h,o=(_*c-m*y)/h}while(e-=d,i-=o,(L(d)>D||L(o)>D)&&0<--a);return[e,i]}},jm.invert=function(t,n){var e,i,a,r,o;return n*=3/8,!(t*=3/8)&&1<L(n)?null:(e=F(o=I(((o=1+t*t+n*n)-I(o*o-4*n*n))/2))/3,o=o?(o=L(n/o),bm(o+I(o*o-1))/3):(o=L(t),bm(o+I(o*o+1))/3),i=B(e),r=(a=Lm(o))*a-i*i,[2*y(t)*b(Pm(o)*i,.25-r),2*y(n)*b(a*O(e),.25+r)])};var Rm=I(8),Fm=bm(1+zm);function Im(t,n){var e=L(n);return e<Mm?[t,bm(g(Mm+n/2))]:[t*B(e)*(2*zm-1/O(e)),y(n)*(2*zm*(e-Mm)-bm(g(e/2)))]}function Hm(t){var s=2*j/t;function n(t,n){var e,i,a,n=Z_(t,n);return L(t)>R&&(t=b(n[1],n[0]),e=I(n[0]*n[0]+n[1]*n[1]),i=s*km((t-R)/s)+R,a=b(O(t-=i),2-B(t)),// angle relative to lobe end
|
|
5303
|
+
t=i+F(j/e*O(a))-a,n[0]=e*B(t),n[1]=e*O(t)),n}return n.invert=function(t,n){var e,i,a,r,o=I(t*t+n*n);return R<o&&(r=b(n,t),i=(e=s*km((r-R)/s)+R)<r?-1:1,a=o*B(e-r),a=1/g(i*Nm((a-j)/I(j*(j-2*a)+o*o))),r=e+2*mm((a+i*I(a*a-3))/3),t=o*B(r),n=o*O(r)),Z_.invert(t,n)},n}function Gm(e,i){return 1===(i=arguments.length<2?e:i)?Y_:i===1/0?Km:(t.invert=function(t,n){t=Y_.invert(t/e,n);return t[0]*=i,t},t);function t(t,n){t=Y_(t/i,n);return t[0]*=e,t}}function Km(t,n){return[t*B(n)/B(n/=2),2*O(n)]}
|
|
5304
5304
|
// Approximate Newton-Raphson
|
|
5305
5305
|
// Solve f(x) = y, start from x
|
|
5306
|
-
function Um(t,n,e){var i,a,r=100;for(e=void 0===e?0:+e,n=+n;i=t(e),a=t(e+D),e-=i=-1*D*(i-n)/(i-(a=i===a?i+D:a)),0<r--&&
|
|
5306
|
+
function Um(t,n,e){var i,a,r=100;for(e=void 0===e?0:+e,n=+n;i=t(e),a=t(e+D),e-=i=-1*D*(i-n)/(i-(a=i===a?i+D:a)),0<r--&&L(i)>D;);return r<0?NaN:e}
|
|
5307
5307
|
// Approximate Newton-Raphson in 2D
|
|
5308
5308
|
// Solve f(a,b) = [x,y]
|
|
5309
5309
|
function Wm(_,m,y){return void 0===m&&(m=40),void 0===y&&(y=Cm),function(t,n,e,i){e=void 0===e?0:+e,i=void 0===i?0:+i;for(var a=0;a<m;a++){var r=_(e,i),// diffs
|
|
5310
|
-
o=r[0]-t,s=r[1]-n;if(
|
|
5310
|
+
o=r[0]-t,s=r[1]-n;if(L(o)<y&&L(s)<y)break;// we're there!
|
|
5311
5311
|
// backtrack if we overshot
|
|
5312
5312
|
var l=o*o+s*s;if(c<l)e-=h/=2,i-=u/=2;else{
|
|
5313
5313
|
// partial derivatives
|
|
5314
5314
|
var h,u,c=l,l=(0<e?-1:1)*y,g=(0<i?-1:1)*y,d=_(e+l,i),f=_(e,i+g),p=(d[0]-r[0])/l,d=(d[1]-r[1])/l,l=(f[0]-r[0])/g,f=(f[1]-r[1])/g,// determinant
|
|
5315
5315
|
r=f*p-d*l,// newton step — or half-step for small D
|
|
5316
|
-
g=(
|
|
5316
|
+
g=(L(r)<.5?.5:1)/r;if(e+=h=(s*l-o*f)*g,i+=u=(o*d-s*p)*g,L(h)<y&&L(u)<y)break;// we're crawling
|
|
5317
5317
|
}}return[e,i]}}
|
|
5318
5318
|
// Bertin 1953 as a modified Briesemeister
|
|
5319
5319
|
// https://bl.ocks.org/Fil/5b9ee9636dfb6ffa53443c9006beb642
|
|
5320
|
-
function qm(){var i=Gm(1.68,2);function t(t,n){t+n<-1.4&&(t+=e=(t-n+1.6)*(t+n+1.4)/8,n-=.8*e*O(n+j/2));var e=i(t,n),t=(1-
|
|
5320
|
+
function qm(){var i=Gm(1.68,2);function t(t,n){t+n<-1.4&&(t+=e=(t-n+1.6)*(t+n+1.4)/8,n-=.8*e*O(n+j/2));var e=i(t,n),t=(1-B(t*n))/12;return e[1]<0&&(e[0]*=1+t),0<e[1]&&(e[1]*=1+t/1.5*e[0]*e[0]),e}return t.invert=Wm(t),t}function $m(t,n){for(var e,i=t*O(n),a=30;n-=e=(n+O(n)-i)/(1+B(n)),L(e)>D&&0<--a;);return n/2}function Vm(e,i,a){function t(t,n){return[e*t*B(n=$m(a,n)),i*O(n)]}return t.invert=function(t,n){return n=F(n/i),[t/(e*B(n)),F((2*n+O(2*n))/a)]},t}Im.invert=function(t,n){if((e=L(n))<Fm)return[t,2*mm(ym(n))-R];var e,i=Mm,a=25;do{var r=B(i/2),o=g(i/2)}while(i-=r=(Rm*(i-Mm)-bm(o)-e)/(Rm-r*r/(2*o)),L(r)>Cm&&0<--a);return[t/(B(i)*(Rm-1/O(i))),y(n)*i]},Km.invert=function(t,n){n=2*F(n/2);return[t*B(n/2)/B(n),n]};var Ym=Vm(zm/R,zm,j);var Zm=2.00276;function Xm(t,n){var e=$m(j,n);return[Zm*t/(1/B(n)+1.11072/B(e)),(n+zm*O(e))/Zm]}function Jm(t){var n=0,e=G_(t),t=e(n);return t.parallel=function(t){return arguments.length?e(n=t*x):n*m},t}function Qm(t,n){return[t*B(n),n]}function ty(a){var r;return a?(r=1/g(a),t.invert=function(t,n){var e=I(t*t+(n=r-n)*n),i=r+a-e;return[e/B(i)*b(t,n),i]},t):Qm;function t(t,n){var e=r+a-n,t=e&&t*B(n)/e;return[e*O(t),r-e*B(t)]}}function ny(i){function t(t,n){n=R-n,t=n&&t*i*O(n)/n;return[n*O(t)/i,R-n*B(t)]}return t.invert=function(t,n){var t=t*i,n=R-n,e=I(t*t+n*n),t=b(t,n);return[(e?e/O(e):1)*t/i,R-e]},t}Xm.invert=function(t,n){for(var e,i,a=Zm*n,r=n<0?-Mm:Mm,o=25;i=a-zm*O(r),r-=e=(O(2*r)+2*r-j*O(i))/(2*B(2*r)+2+j*B(i)*zm*B(r)),L(e)>D&&0<--o;);return i=a-zm*O(r),[t*(1/B(i)+1.11072/B(r))/Zm,i]},Qm.invert=function(t,n){return[t/B(n),n]};var ey=Vm(1,4/j,j);
|
|
5321
5321
|
// Azimuthal distance.
|
|
5322
|
-
function iy(t,n,e,i,a,r){var o=
|
|
5322
|
+
function iy(t,n,e,i,a,r){var o=B(r);return t=1<L(t)||1<L(r)?Nm(e*a+n*i*o):2*F(I((t=O(t/2))*t+n*i*(t=O(r/2))*t)),L(t)>D?[t,b(i*O(r),n*a-e*i*o)]:[0,0]}
|
|
5323
5323
|
// Angle opposite a, and contained between sides of lengths b and c.
|
|
5324
5324
|
function ay(t,n,e){return Nm((t*t+n*n-e*e)/(2*t*n))}
|
|
5325
5325
|
// Normalize longitude.
|
|
5326
|
-
function ry(t,n,e){for(var i,h=[[t[0],t[1],O(t[1]),
|
|
5326
|
+
function ry(t,n,e){for(var i,h=[[t[0],t[1],O(t[1]),B(t[1])],[n[0],n[1],O(n[1]),B(n[1])],[e[0],e[1],O(e[1]),B(e[1])]],a=h[2],r=0;r<3;++r,a=i)i=h[r],a.v=iy(i[1]-a[1],a[3],a[2],i[3],i[2],i[0]-a[0]),a.point=[0,0];var t=ay(h[0].v[0],h[2].v[0],h[1].v[0]),u=ay(h[0].v[0],h[1].v[0],h[2].v[0]),c=j-t,g=(h[2].point[1]=0,h[0].point[0]=-(h[1].point[0]=h[0].v[0]/2),[h[2].point[0]=h[0].point[0]+h[2].v[0]*B(t),2*(h[0].point[1]=h[1].point[1]=h[2].v[0]*O(t))]);return function(t,n){
|
|
5327
5327
|
// Compute distance and azimuth from control points.
|
|
5328
|
-
for(var e=O(n),i=
|
|
5328
|
+
for(var e=O(n),i=B(n),a=new Array(3),r=0;r<3;++r){var o=h[r];if(a[r]=iy(n-o[1],o[3],o[2],i,e,t-o[0]),!a[r][0])return o.point;a[r][1]=(o=a[r][1]-o.v[1])-2*j*vm((o+j)/(2*j))}
|
|
5329
5329
|
// Arithmetic mean of interception points.
|
|
5330
|
-
var s=g.slice();for(r=0;r<3;++r){var l=2==r?0:r+1,l=ay(h[r].v[0],a[r][0],a[l][0]);a[r][1]<0&&(l=-l),r?1==r?(s[0]-=a[r][0]*
|
|
5330
|
+
var s=g.slice();for(r=0;r<3;++r){var l=2==r?0:r+1,l=ay(h[r].v[0],a[r][0],a[l][0]);a[r][1]<0&&(l=-l),r?1==r?(s[0]-=a[r][0]*B(l=u-l),s[1]-=a[r][0]*O(l)):(s[0]+=a[r][0]*B(l=c-l),s[1]+=a[r][0]*O(l)):(s[0]+=a[r][0]*B(l),s[1]-=a[r][0]*O(l))}return s[0]/=3,s[1]/=3,s}}function oy(t){return t[0]*=x,t[1]*=x,t}function sy(t,n,e){var i=N1({type:"MultiPoint",coordinates:[t,n,e]}),i=[-i[0],-i[1]],a=F1(i),t=ry(oy(a(t)),oy(a(n)),oy(a(e))),n=(t.invert=Wm(t),d(t).rotate(i)),r=n.center;return delete n.rotate,n.center=function(t){return arguments.length?r(a(t)):a.invert(r())},n.clipAngle(90)}function ly(t,n){n=I(1-O(n));return[2/Tm*t*n,Tm*(1-n)]}function hy(t){var i=g(t);function n(t,n){return[t,(t?t/O(t):1)*(O(n)*B(t)-i*B(n))]}return n.invert=i?function(t,n){t&&(n*=O(t)/t);var e=B(t);return[t,2*b(I(e*e+i*i-n*n)-e,i-n)]}:function(t,n){return[t,F(t?n*g(t)/t:n)]},n}ly.invert=function(t,n){n=(n=n/Tm-1)*n;return[0<n?t*I(j/n)/2:0,F(1-n)]};var uy=I(3);function cy(t,n){return[uy*t*(2*B(2*n/3)-1)/Tm,uy*Tm*O(n/3)]}function gy(t){var e=B(t);function n(t,n){return[t*e,O(n)/e]}return n.invert=function(t,n){return[t/e,F(n*e)]},n}function dy(t){var e=B(t);function n(t,n){return[t*e,(1+e)*g(n/2)]}return n.invert=function(t,n){return[t/e,2*mm(n/(1+e))]},n}function fy(t,n){var e=I(8/(3*j));return[e*t*(1-L(n)/j),e*n]}function py(t,n){var e=I(4-3*O(L(n)));return[2/I(6*j)*t*e,y(n)*I(2*j/3)*(2-e)]}function _y(t,n){var e=I(j*(4+j));return[2/e*t*(1+I(1-4*n*n/(j*j))),4/e*n]}function my(t,n){var e=(2+R)*O(n);n/=2;for(var i=0,a=1/0;i<10&&L(a)>D;i++){var r=B(n);n-=a=(n+O(n)*(r+2)-e)/(2*r*(1+r))}return[2/I(j*(4+j))*t*(1+B(n)),2*I(j/(4+j))*O(n)]}function yy(t,n){return[t*(1+B(n))/I(2+j),2*n/I(2+j)]}function vy(t,n){for(var e=(1+R)*O(n),i=0,a=1/0;i<10&&L(a)>D;i++)n-=a=(n+O(n)-e)/(1+B(n));return e=I(2+j),[t*(1+B(n))/e,2*n/e]}cy.invert=function(t,n){n=3*F(n/(uy*Tm));return[Tm*t/(uy*(2*B(2*n/3)-1)),n]},fy.invert=function(t,n){var e=I(8/(3*j)),n=n/e;return[t/(e*(1-L(n)/j)),n]},py.invert=function(t,n){var e=2-L(n)/I(2*j/3);return[t*I(6*j)/(2*e),y(n)*F((4-e*e)/3)]},_y.invert=function(t,n){var e=I(j*(4+j))/2;return[t*e/(1+I(1-n*n*(4+j)/(4*j))),n*e/2]},my.invert=function(t,n){var n=n*I((4+j)/j)/2,e=F(n),i=B(e);return[t/(2/I(j*(4+j))*(1+i)),F((e+n*(i+2))/(2+R))]},yy.invert=function(t,n){var e=I(2+j),n=n*e/2;return[e*t/(1+B(n)),n]},vy.invert=function(t,n){var e=1+R,i=I(e/2);return[2*t*i/(1+B(n*=i)),F((n+O(n))/e)]};var by=3+2*zm;function xy(t,n){var e=O(t/=2),t=B(t),i=I(B(n)),a=B(n/=2),n=O(n)/(a+zm*t*i),r=I(2/(1+n*n)),a=I((zm*a+(t+e)*i)/(zm*a+(t-e)*i));return[by*(r*(a-1/a)-2*bm(a)),by*(r*n*(a+1/a)-2*mm(n))]}xy.invert=function(t,n){if(!(e=jm.invert(t/1.2,1.065*n)))return null;var e,i=e[0],a=e[1],r=20;t/=by,n/=by;do{var o=i/2,s=a/2,l=O(o),o=B(o),h=O(s),s=B(s),u=B(a),c=I(u),g=h/(s+zm*o*c),d=g*g,f=I(2/(1+d)),p=(zm*s+(o+l)*c)/(zm*s+(o-l)*c),_=I(p),m=_-1/_,y=_+1/_,v=f*m-2*bm(_)-t,b=f*g*y-2*mm(g)-n,x=h&&Am*c*l*d/h,w=(zm*o*s+c)/(2*(s+zm*o*c)*(s+zm*o*c)*c),S=-.5*g*f*f*f,k=S*x,S=S*w,C=(C=2*s+zm*c*(o-l))*C*_,o=(zm*o*s*c+u)/C,s=-zm*l*h/(c*C),u=m*k-2*o/_+f*(o+o/p),l=m*S-2*s/_+f*(s+s/p),h=g*y*k-2*x/(1+d)+f*y*x+f*g*(o-o/p),c=g*y*S-2*w/(1+d)+f*y*w+f*g*(s-s/p),C=l*h-c*u;if(!C)break;m=(b*l-v*c)/C,_=(v*h-b*u)/C}while(i-=m,a=xm(-R,wm(R,a-_)),(L(m)>D||L(_)>D)&&0<--r);return L(L(a)-R)<D?[0,a]:r&&[i,a]};var wy=B(35*x);function Sy(t,n){n=g(n/2);return[t*wy*I(1-n*n),(1+wy)*n]}function ky(t,n){var e=n/2,i=B(e);return[2*t/Tm*B(n)*i*i,Tm*g(e)]}function Cy(a){var r=1-a,t=i(j,0)[0]-i(-j,0)[0],e=I(2*(i(0,R)[1]-i(0,-R)[1])/t);function i(t,n){var e=B(n),i=O(n);return[e/(r+a*e)*t,r*n+a*i]}function n(t,n){t=i(t,n);return[t[0]*e,t[1]/e]}function o(t){return n(0,t)[1]}return n.invert=function(t,n){n=Um(o,n);return[t/e*(a+r/B(n)),n]},n}function My(t){return[t[0]/2,F(g(t[1]/2*x))*m]}function Ay(t){return[2*t[0],2*mm(O(t[1]*x))*m]}function zy(m,t){var y=2*j/t,v=m*m;function n(t,n){var t=Z_(t,n),e=t[0],n=t[1],i=e*e+n*n;if(v<i){for(var a,r=I(i),i=b(n,e),o=y*km(i/y),i=i-o,s=m*B(i),l=(m*O(i)-i*O(s))/(R-s),h=Ty(i,l),u=(j-m)/Ey(h,s,j),e=r,c=50;e-=a=(m+Ey(h,s,e)*u-r)/(h(e)*u),L(a)>D&&0<--c;);n=i*O(e),e<R&&(n-=l*(e-R));i=O(o),l=B(o);t[0]=e*l-n*i,t[1]=e*i+n*l}return t}return n.invert=function(t,n){var e=t*t+n*n;if(v<e){for(var e=I(e),i=b(n,t),a=y*km(i/y),r=i-a,o=(t=e*B(r),n=e*O(r),t-R),s=O(t),l=n/s,h=t<R?1/0:0,u=10;;){var c=m*O(l),g=m*B(l),d=O(g),f=R-g,p=(c-l*d)/f,_=Ty(l,p);if(L(h)<Cm||!--u)break;l-=h=(l*s-p*o-n)/(s-2*o*(f*(g+l*c*B(g)-d)-c*(c-l*d))/(f*f))}t=(e=m+Ey(_,g,t)*(j-m)/Ey(_,g,j))*B(i=a+l),n=e*O(i)}return Z_.invert(t,n)},n}function Ty(e,i){return function(t){var n=e*B(t);return t<R&&(n-=i),I(1+n*n)}}
|
|
5331
5331
|
// Numerical integration: trapezoidal rule.
|
|
5332
|
-
function Ey(t,n,e){for(var i=(e-n)/50,a=t(n)+t(e),r=1,o=n;r<50;++r)a+=2*t(o+=i);return.5*a*i}function Ny(m,y,v,b,x,w,S,k){function t(t,n){var e,i,a;return n?(a=t*
|
|
5332
|
+
function Ey(t,n,e){for(var i=(e-n)/50,a=t(n)+t(e),r=1,o=n;r<50;++r)a+=2*t(o+=i);return.5*a*i}function Ny(m,y,v,b,x,w,S,k){function t(t,n){var e,i,a;return n?(a=t*F((i=m+(e=n*n)*(y+e*(v+e*b)))/(i=(i*i+(i=n*(x-1+e*(w-k+e*S)))*i)/(2*i)))/j,[i*O(a),n*(1+e*k)+i*(1-B(a))]):[m*t/j,0]}return arguments.length<8&&(k=0),t.invert=function(t,n){var e=j*t/m,i=n,a=50;do{var r=i*i,o=m+r*(y+r*(v+r*b)),s=i*(x-1+r*(w-k+r*S)),l=o*o+s*s,h=2*s,u=l/h,c=u*u,g=F(o/u)/j,d=e*g,f=o*o,p=(2*y+r*(4*v+6*r*b))*i,_=x+r*(3*w+5*r*S),s=(2*(o*p+s*(_-1))*h-l*(2*(_-1)))/(h*h),l=B(d),_=O(d),h=u*l,d=u*_,f=e/j*(1/I(1-f/c))*(p*u-o*s)/c,p=d-t,o=i*(1+r*k)+u-h-n,c=s*_+h*f,r=h*g,u=1+s-(s*l-d*f),_=d*g,h=c*_-u*r}while(h&&(e-=s=(o*c-p*u)/h,i-=l=(p*_-o*r)/h,(L(s)>D||L(l)>D)&&0<--a));return[e,i]},t}Sy.invert=function(t,n){n/=1+wy;return[t&&t/(wy*I(1-n*n)),2*mm(n)]},ky.invert=function(t,n){var n=mm(n/Tm),e=B(n),n=2*n;return[t*Tm/2/(B(n)*e*e),n]};var Py=Ny(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);var Ly=Ny(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);var By=Ny(5/6*j,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Oy(t,n){var e=t*t,i=n*n;return[t*(1-.162388*i)*(.87-952426e-9*e*e),n*(1+i/12)]}Oy.invert=function(t,n){var e,i=t,a=n,r=50;do{var o=a*a}while(a-=e=(a*(1+o/12)-n)/(1+o/4),L(e)>D&&0<--r);r=50,t/=1-.162388*o;do{var s=(s=i*i)*s}while(i-=e=(i*(.87-952426e-9*s)-t)/(.87-.00476213*s),L(e)>D&&0<--r);return[i,a]};var Dy=Ny(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function jy(i){var a=i(R,0)[0]-i(-R,0)[0];function t(t,n){var e=0<t?-.5:.5,t=i(t+e*j,n);return t[0]-=e*a,t}return i.invert&&(t.invert=function(t,n){var e=0<t?-.5:.5,t=i.invert(t+e*a,n),n=t[0]-e*j;return n<-j?n+=2*j:j<n&&(n-=2*j),t[0]=n,t}),t}function Ry(t,n){var e=y(t),i=y(n),a=B(n),r=B(t)*a,a=O(t)*a,o=O(i*n),a=(t=L(b(a,o)),n=F(r),L(t-R)>D&&(t%=R),((t,n)=>{if(n===R)return[0,0];var e,i,a=O(n),r=a*a,o=r*r,s=1+o,l=1+3*o,h=1-o,u=F(1/I(s)),c=h+r*s*u,g=(1-a)/c,d=I(g),f=g*s,p=I(f),_=d*h;if(0===t)return[0,-(_+r*p)];var m=B(n),y=1/m,v=2*a*m,b=-y*v,x=-y*(r*s*(m=(-c*m-(-3*r+u*l)*v*(1-a))/(c*c))+g*l*v),w=-2*y*(.5*m/d*h-2*r*d*v),S=4*t/j;
|
|
5333
5333
|
// Slower but accurate bisection method.
|
|
5334
|
-
if(.222*j<t||n<j/4&&.175*j<t){if(e=(_+r*
|
|
5334
|
+
if(.222*j<t||n<j/4&&.175*j<t){if(e=(_+r*I(f*(1+o)-_*_))/(1+o),j/4<t)return[e,e];var k=e,C=.5*e;e=.5*(C+k),i=50;do{var M=I(f-e*e),M=e*(w+b*M)+x*F(e/p)-S}while(M&&(M<0?C=e:k=e,e=.5*(C+k),L(k-C)>D&&0<--i))}else{e=D,i=25;do{var A=e*e,z=I(f-A),T=w+b*z,E=e*T+x*F(e/p)-S,T=T+(x-b*A)/z}while(e-=A=z?E/T:0,L(A)>D&&0<--i)}return[e,-_-r*I(f-e*e)]})(j/4<t?R-t:t,n));return j/4<t&&(o=a[0],a[0]=-a[1],a[1]=-o),a[0]*=e,a[1]*=-i,a}
|
|
5335
5335
|
// Returns [sn, cn, dn, ph](u|m).
|
|
5336
|
-
function
|
|
5336
|
+
function Fy(t,n){var e,i,a,r;if(n<D)return[(a=O(t))-(e=n*(t-a*(h=B(t)))/4)*h,h+e*a,1-n*a*a/2,t-e];if(1-D<=n)return e=(1-n)/4,i=1/(h=Lm(t)),[(a=((r=ym(2*(r=t)))-1)/(r+1))+e*((u=h*Pm(t))-t)/(h*h),i-e*a*i*(u-t),i+e*a*i*(u+t),2*mm(ym(t))-R+e*(u-t)/h];for(var o=[1,0,0,0,0,0,0,0,0],s=[I(n),0,0,0,0,0,0,0,0],l=0,h=I(1-n),u=1;L(s[l]/o[l])>D&&l<8;)e=o[l++],s[l]=(e-h)/2,o[l]=(e+h)/2,h=I(e*h),u*=2;for(i=u*o[l]*t;i=(F(a=s[l]*O(h=i)/o[l])+i)/2,--l;);return[O(i),a=B(i),a/B(i-h),i]}
|
|
5337
5337
|
// Calculate F(phi+iPsi|m).
|
|
5338
5338
|
// See Abramowitz and Stegun, 17.4.11.
|
|
5339
5339
|
// Calculate F(phi|m) where m = k² = sin²α.
|
|
5340
5340
|
// See Abramowitz and Stegun, 17.6.7.
|
|
5341
|
-
function
|
|
5341
|
+
function Iy(t,n){if(!n)return t;if(1===n)return bm(g(t/2+Mm));for(var e,i=1,a=I(1-n),r=I(n),o=0;L(r)>D;o++)t%j?((e=mm(a*g(t)/i))<0&&(e+=j),t+=e+~~(t/j)*j):t+=t,r=(i+a)/2,a=I(i*a),r=((i=r)-a)/2;return t/(Sm(2,o)*i)}function Hy(t,n){var e,i=(zm-1)/(zm+1),a=I(1-i*i),r=Iy(R,a*a),o=bm(g(j/4+L(n)/2)),o=ym(-1*o)/I(i),i=(i=o*B(-1*t),o=o*O(-1*t),t=o+1,[.5*((0<=i?R:-R)-b(o=1-(s=i*i)-o*o,2*i)),-.25*bm(o*o+4*s)+.5*bm(t*t+s)]),s=(o=i[1],t=a*a,a=L(s=i[0]),i=Pm(L(o)),a?(e=1/O(a),e=(-(e=-((a=1/(g(a)*g(a)))+t*(i*i*e*e)-1+t))+I(e*e-4*((t-1)*a)))/2,[Iy(mm(1/I(e)),t)*y(s),Iy(mm(I((e/a-1)/t)),1-t)*y(o)]):[0,Iy(mm(i),1-t)*y(o)]);return[-s[1],(0<=n?1:-1)*(.5*r-s[0])]}function Gy(t){var h=O(t),o=B(t),u=Ky(t);function n(t,n){var e=u(t,n),e=(t=e[0],O(n=e[1])),n=B(n),i=B(t),a=Nm(h*e+o*n*i),r=O(a),a=L(r)>D?a/r:1;return[a*o*O(t),(L(t)>R?a:-a)*(h*n-o*e*i)]}return u.invert=Ky(-t),n.invert=function(t,n){var e=I(t*t+n*n),i=-O(e),a=B(e),r=e*a,o=-n*i,s=e*h,l=I(r*r+o*o-s*s),o=b(r*s+o*l,o*s-r*l),s=(R<e?-1:1)*b(t*i,e*B(o)*a+n*O(o)*i);return u.invert(s,o)},n}
|
|
5342
5342
|
// Latitudinal rotation by phi0.
|
|
5343
5343
|
// Temporary hack until D3 supports arbitrary small-circle clipping origins.
|
|
5344
|
-
function Ky(t){var a=O(t),r=
|
|
5344
|
+
function Ky(t){var a=O(t),r=B(t);return function(t,n){var e=B(n),i=B(t)*e,t=O(t)*e,e=O(n);return[b(t,i*r-e*a),F(e*r+i*a)]}}Ry.invert=function(t,n){1<L(t)&&(t=2*y(t)-t),1<L(n)&&(n=2*y(n)-n);var e=y(t),i=y(n),t=-e*t,n=-i*n,a=n/t<1,t=((t,n)=>{for(var e,i,a,r,o=0,s=1,l=.5,h=50;;){var u=l*l,c=I(l),g=F(1/I(1+u)),d=1-u+l*(1+u)*g,f=(1-c)/d,p=I(f),_=f*(1+u),m=p*(1-u),y=I(_-t*t),m=n+m+l*y;if(L(s-o)<Cm||0==--h||0===m)break;0<m?o=l:s=l,l=.5*(o+s)}return h?(e=F(c),a=B(e),[j/4*(t*(-2*(i=1/a)*((1-u)*(.5*(r=(-d*a-(1-c)*((-3*l+g*(1+3*u))*(a=2*c*a)))/(d*d))/p)-2*l*p*a)+-i*a*y)+-i*(l*(1+u)*r+f*(1+3*u)*a)*F(t/I(_))),e]):null})(a?n:t,a?t:n),n=t[0],t=t[1],r=B(t);return[e*(b(O(n=a?-R-n:n)*r,-O(t))+j),i*F(B(n)*r)]},Hy.invert=function(t,n){var e=(zm-1)/(zm+1),i=I(1-e*e),a=Iy(R,i*i),n=(t=-t,i=i*i,(a=.5*a-n)?(a=Fy(a,i),t?(n=(r=Fy(t,1-i))[1]*r[1]+i*a[0]*a[0]*r[0]*r[0],[[a[0]*r[2]/n,a[1]*a[2]*r[0]*r[1]/n],[a[1]*r[1]/n,-a[0]*a[2]*r[0]*r[2]/n],[a[2]*r[1]*r[2]/n,-i*a[0]*a[1]*r[0]/n]]):[[a[0],0],[a[1],0],[a[2],0]]):[[0,(r=Fy(t,1-i))[0]/r[1]],[1/r[1],0],[r[2]/r[1],0]]),r=(a=n[0],i=(t=n[1])[0]*t[0]+t[1]*t[1],[(a[0]*t[0]+a[1]*t[1])/i,(a[1]*t[0]-a[0]*t[1])/i]);return[b(r[1],r[0])/-1,2*mm(ym(-.5*bm(e*r[0]*r[0]+e*r[1]*r[1])))-R]};var Uy=F(1-1/3)*m,Wy=gy(0);function qy(r){var o=Uy*x,s=ly(j,o)[0]-ly(-j,o)[0],l=Wy(0,o)[1],h=ly(0,o)[1],u=Tm-h,c=Em/r,g=4/Em,d=l+u*u*4/Em;function t(t,n){var e,i,a=L(n);return o<a?(i=wm(r-1,xm(0,vm((t+j)/c))),(e=ly(t+=j*(r-1)/r-i*c,a))[0]=e[0]*Em/s-Em*(r-1)/(2*r)+i*Em/r,e[1]=l+4*(e[1]-h)*u/Em,n<0&&(e[1]=-e[1])):e=Wy(t,n),e[0]*=g,e[1]/=d,e}return t.invert=function(t,n){t/=g;var e,i=L(n*=d);return l<i?(e=wm(r-1,xm(0,vm((t+j)/c))),t=(t+j*(r-1)/r-e*c)*s/Em,(i=ly.invert(t,.25*(i-l)*Em/u+h))[0]-=j*(r-1)/r-e*c,n<0&&(i[1]=-i[1]),i):Wy.invert(t,n)},t}function $y(t,n){return[t,1&n?90-D:Uy]}function Vy(t,n){return[t,1&n?-90+D:-Uy]}function Yy(t){return[t[0]*(1-D),t[1]]}function Zy(c){var g,d=1+c,f=F(O(1/d)),p=2*I(j/(g=j+4*f*d)),_=.5*p*(d+I(c*(2+c))),m=c*c,y=d*d;function t(t,n){var e,i,a=1-O(n);if(a&&a<2){var r=R-n,o=25;do{var s=O(r),l=B(r),h=f+b(s,d-l),u=1+y-2*d*l}while(r-=l=(r-m*f-d*s+u*h-.5*a*g)/(2*d*s*h),L(l)>Cm&&0<--o);e=p*I(u),i=t*h/j}else e=p*(c+a),i=t*f/j;return[e*O(i),_-e*B(i)]}return t.invert=function(t,n){var n=t*t+(n-=_)*n,e=(1+y-n/(p*p))/(2*d),i=Nm(e),a=O(i),r=f+b(a,d-e);return[F(t/I(n))*j/r,F(1-2*(i-m*f-d*a+(1+y-2*d*e)*r)/g)]},t}var Xy=.7109889596207567,Jy=.0528035274542;function Qy(t,n){return-.7109889596207567<n?((t=Ym(t,n))[1]+=Jy,t):Qm(t,n)}function tv(t,n){return L(n)>Xy?((t=Ym(t,n))[1]-=0<n?Jy:-.0528035274542,t):Qm(t,n)}function nv(n,e,i,t){var a=I(4*j/(2*i+(1+n-e/2)*O(2*i)+(n+e)/2*O(4*i)+e/2*O(6*i))),r=I(t*O(i)*I((1+n*B(2*i)+e*B(4*i))/(1+n+e))),o=i*l(1);function s(t){return I(1+n*B(2*t)+e*B(4*t))}function l(t){t*=i;return(2*t+(1+n-e/2)*O(2*t)+(n+e)/2*O(4*t)+e/2*O(6*t))/i}function h(t){return s(t)*O(t)}var u=function(t,n){var e=i*Um(l,o*O(n)/i,n/j),n=(isNaN(e)&&(e=i*y(n)),a*s(e));return[n*r*t/j*B(e),n/r*O(e)]};return u.invert=function(t,n){n=Um(h,n*r/a);return[t*j/(B(n)*a*r*s(n)),F(i*l(n/i)/o)]},0===i&&(a=I(t/j),(u=function(t,n){return[t*a,O(n)/a]}).invert=function(t,n){return[t/a,F(n*a)]}),u}function ev(t,n,e,i,a){void 0===a&&(a=20);var r=t(n),o=t(.5*(n+e)),s=t(e);
|
|
5345
5345
|
/*
|
|
5346
5346
|
if (state.maxDepthCount > 0 && console && console.warn) {
|
|
5347
5347
|
console.warn('integrate-adaptive-simpson: Warning: maximum recursion depth (' + maxdepth + ') reached ' + state.maxDepthCount + ' times');
|
|
@@ -5358,25 +5358,25 @@ return function t(n,e,i,a,r,o,s,l,h,u,c){if(c.nanEncountered)return NaN;var g,d,
|
|
|
5358
5358
|
// Simple check for NaN:
|
|
5359
5359
|
if(!isNaN(_)&&!isNaN(m))return s=((f=(g=p*(a+4*_+r)/12)+(d=p*(r+4*m+o)/12))-s)/15,h<u?(c.maxDepthCount++,f+s):Math.abs(s)<l?f+s:(s=t(n,e,f=e+.5*p,a,_,r,g,.5*l,h,u+1,c),isNaN(s)||(e=t(n,f,i,r,m,o,d,.5*l,h,u+1,c),isNaN(e))?(c.nanEncountered=!0,NaN):s+e);
|
|
5360
5360
|
// Simple check for NaN:
|
|
5361
|
-
c.nanEncountered=!0}(t,n,e,r,o,s,(r+4*o+s)*(e-n)/6,i,a,1,{maxDepthCount:0,nanEncountered:!1})}function iv(n,e,t){function i(t){return n+(1-n)*Sm(1-Sm(t,e),1/e)}function a(t){return ev(i,0,t,1e-4)}for(var r=1/a(1),o=(1+1e-8)*r,s=[],l=0;l<=1e3;l++)s.push(a(l/1e3)*o);function h(t){for(var n=0,e=1e3,i=500;t<s[i]?e=i:n=i,n<(i=n+e>>1););var a=s[i+1]-s[i];return(i+1+(a=a&&(t-s[i+1])/a))/1e3}function u(t,n){var e=h(
|
|
5361
|
+
c.nanEncountered=!0}(t,n,e,r,o,s,(r+4*o+s)*(e-n)/6,i,a,1,{maxDepthCount:0,nanEncountered:!1})}function iv(n,e,t){function i(t){return n+(1-n)*Sm(1-Sm(t,e),1/e)}function a(t){return ev(i,0,t,1e-4)}for(var r=1/a(1),o=(1+1e-8)*r,s=[],l=0;l<=1e3;l++)s.push(a(l/1e3)*o);function h(t){for(var n=0,e=1e3,i=500;t<s[i]?e=i:n=i,n<(i=n+e>>1););var a=s[i+1]-s[i];return(i+1+(a=a&&(t-s[i+1])/a))/1e3}function u(t,n){var e=h(L(O(n))),t=i(e)*t;return e/=c,[t,0<=n?e:-e]}var c=2*h(1)/j*r/t;return u.invert=function(t,n){var e;return L(n*=c)<1&&(e=y(n)*F(a(L(n))*r)),[t/i(L(n)),e]},u}function av(t,n){for(var e=-1,i=t.length,a=t[0],r=[];++e<i;){for(var o,s=((o=t[e])[0]-a[0])/n,l=(o[1]-a[1])/n,h=0;h<n;++h)r.push([a[0]+h*s,a[1]+h*l]);a=o}return r.push(o),r}function rv(h,u,t){var a,c;function g(t,n){for(var e=n<0?-1:1,i=u[+(n<0)],a=0,r=i.length-1;a<r&&t>i[a][2][0];++a);var o=h(t-i[a][1][0],n);return o[0]+=h(i[a][1][0],e*n>e*i[a][0][1]?i[a][0][1]:n)[0],o}t?g.invert=t(g):h.invert&&(g.invert=function(t,n){for(var e,i,a=c[+(n<0)],r=u[+(n<0)],o=0,s=a.length;o<s;++o){var l=a[o];if(l[0][0]<=t&&t<l[1][0]&&l[0][1]<=n&&n<l[1][1])return(l=h.invert(t-h(r[o][1][0],0)[0],n))[0]+=r[o][1][0],e=g(l[0],l[1]),i=[t,n],L(e[0]-i[0])<D&&L(e[1]-i[1])<D?l:null}});var r=d(g),o=r.stream;return r.stream=function(t){var n=r.rotate(),e=o(t),i=(r.rotate([0,0]),o(t));return r.rotate(n),e.sphere=function(){p0(a,i)},e},r.lobes=function(t){return arguments.length?(a=(t=>{
|
|
5362
5362
|
// Northern Hemisphere
|
|
5363
5363
|
for(var n,e,i,a,r,o,s=[],l=t[0].length,h=0;h<l;++h)e=(n=t[0][h])[0][0],i=n[0][1],a=n[1][1],r=n[2][0],o=n[2][1],s.push(av([[e+D,i+D],[e+D,a-D],[r-D,a-D],[r-D,o+D]],30));
|
|
5364
5364
|
// Southern Hemisphere
|
|
5365
|
-
for(h=t[1].length-1;0<=h;--h)e=(n=t[1][h])[0][0],i=n[0][1],a=n[1][1],r=n[2][0],o=n[2][1],s.push(av([[r-D,o-D],[r-D,a+D],[e+D,a+D],[e+D,i-D]],30));return{type:"Polygon",coordinates:[oa(s)]}})(t),u=t.map(function(t){return t.map(function(t){return[[t[0][0]*x,t[0][1]*x],[t[1][0]*x,t[1][1]*x],[t[2][0]*x,t[2][1]*x]]})}),c=u.map(function(t){return t.map(function(t){var n,e=h(t[0][0],t[0][1])[0],i=h(t[2][0],t[2][1])[0],a=h(t[1][0],t[0][1])[1],t=h(t[1][0],t[1][1])[1];return t<a&&(n=a,a=t,t=n),[[e,a],[i,t]]})}),r):u.map(function(t){return t.map(function(t){return[[t[0][0]*m,t[0][1]*m],[t[1][0]*m,t[1][1]*m],[t[2][0]*m,t[2][1]*m]]})})},null!=u&&r.lobes(u),r}Qy.invert=function(t,n){return-.7109889596207567<n?Ym.invert(t,n-Jy):Qm.invert(t,n)},tv.invert=function(t,n){return
|
|
5366
|
-
n=Sm((1+(n=2*n/(1+i+e)))/(1-n),1/a),[b(2*t,1-i-e)/a,
|
|
5365
|
+
for(h=t[1].length-1;0<=h;--h)e=(n=t[1][h])[0][0],i=n[0][1],a=n[1][1],r=n[2][0],o=n[2][1],s.push(av([[r-D,o-D],[r-D,a+D],[e+D,a+D],[e+D,i-D]],30));return{type:"Polygon",coordinates:[oa(s)]}})(t),u=t.map(function(t){return t.map(function(t){return[[t[0][0]*x,t[0][1]*x],[t[1][0]*x,t[1][1]*x],[t[2][0]*x,t[2][1]*x]]})}),c=u.map(function(t){return t.map(function(t){var n,e=h(t[0][0],t[0][1])[0],i=h(t[2][0],t[2][1])[0],a=h(t[1][0],t[0][1])[1],t=h(t[1][0],t[1][1])[1];return t<a&&(n=a,a=t,t=n),[[e,a],[i,t]]})}),r):u.map(function(t){return t.map(function(t){return[[t[0][0]*m,t[0][1]*m],[t[1][0]*m,t[1][1]*m],[t[2][0]*m,t[2][1]*m]]})})},null!=u&&r.lobes(u),r}Qy.invert=function(t,n){return-.7109889596207567<n?Ym.invert(t,n-Jy):Qm.invert(t,n)},tv.invert=function(t,n){return L(n)>Xy?Ym.invert(t,n+(0<n?Jy:-.0528035274542)):Qm.invert(t,n)};var ov=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var sv=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var lv=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var hv=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];var uv=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];var cv=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function gv(t,n){return[3/Em*t*I(j*j/3-n*n),n]}function dv(a){function t(t,n){var e;return L(L(n)-R)<D?[0,n<0?-2:2]:(n=O(n),e=.5*((n=Sm((1+n)/(1-n),a/2))+1/n)+B(t*=a),[2*O(t)/e,(n-1/n)/e])}return t.invert=function(t,n){var e,i=L(n);return L(i-2)<D?t?null:[0,y(n)*R]:2<i?null:(i=(t/=2)*t,e=(n/=2)*n,// tanh(nPhi)
|
|
5366
|
+
n=Sm((1+(n=2*n/(1+i+e)))/(1-n),1/a),[b(2*t,1-i-e)/a,F((n-1)/(n+1))])},t}gv.invert=function(t,n){return[Em/3*t/I(j*j/3-n*n),n]};var fv=j/zm;function pv(t,n){return[t*(1+I(B(n)))/2,n/(B(n/2)*B(t/6))]}function _v(t,n){var e=t*t,i=n*n;return[t*(.975534+i*(-.0143059*e-.119161+-.0547009*i)),n*(1.00384+e*(.0802894+-.02855*i+199025e-9*e)+i*(.0998909+-.0491032*i))]}function mv(t,n){return[O(t)/B(n),g(n)*B(t)]}function yv(a){var r=B(a),o=g(Mm+a/2);function t(t,n){var e=n-a,i=L(e)<D?t*r:L(i=Mm+n/2)<D||L(L(i)-R)<D?0:t*e/bm(g(i)/o);return[i,e]}return t.invert=function(t,n){var e,i=n+a;return[L(n)<D?t/r:L(e=Mm+i/2)<D||L(L(e)-R)<D?0:t*bm(g(e)/o)/n,i]},t}function vv(t,n){return[t,1.25*bm(g(Mm+.4*n))]}function bv(m){var y=m.length-1;function t(t,n){for(var e,i=B(n),a=2/(1+i*B(t)),r=a*i*O(t),o=a*O(n),s=y,l=m[s],h=l[0],u=l[1];0<=--s;)h=(l=m[s])[0]+r*(e=h)-o*u,u=l[1]+r*u+o*e;return[h=r*(e=h)-o*u,u=r*u+o*e]}return t.invert=function(t,n){var e,i,a,r=20,o=t,s=n;do{for(var l,h=y,u=m[h],c=u[0],g=u[1],d=0,f=0;0<=--h;)d=c+o*(l=d)-s*f,f=g+o*f+s*l,c=(u=m[h])[0]+o*(l=c)-s*g,g=u[1]+o*g+s*l;var p,_=(d=c+o*(l=d)-s*f)*d+(f=g+o*f+s*l)*f}while(o-=p=((c=o*(l=c)-s*g-t)*d+(g=o*g+s*l-n)*f)/_,s-=_=(g*d-c*f)/_,L(p)+L(_)>D*D&&0<--r);if(r)return e=I(o*o+s*s),i=2*mm(.5*e),a=O(i),[b(o*a,e*B(i)),e?F(s*a/e):0]},t}pv.invert=function(t,n){var e=L(t),i=L(n),a=D,r=R;i<fv?r*=i/fv:a+=6*Nm(fv/i);for(var o=0;o<25;o++){var s=O(r),l=I(B(r)),h=O(r/2),u=B(r/2),c=O(a/6),g=B(a/6),d=.5*a*(1+l)-e,f=r/(u*g)-i,s=l?-.25*a*s/l:0,l=.5*(1+l),h=(1+.5*r*h/u)/(u*g),u=r/u*(c/6)/(g*g),c=s*u-h*l,g=(d*u-f*l)/c,u=(f*s-d*h)/c;if(r-=g,a-=u,L(g)<D&&L(u)<D)break}return[t<0?-a:a,n<0?-r:r]},_v.invert=function(t,n){var e=y(t)*j,i=n/2,a=50;do{var r=e*e,o=i*i,s=e*i,l=e*(.975534+o*(-.0143059*r-.119161+-.0547009*o))-t,h=i*(1.00384+r*(.0802894+-.02855*o+199025e-9*r)+o*(.0998909+-.0491032*o))-n,u=.975534-o*(.119161+3*r*.0143059+.0547009*o),c=-s*(.238322+.2188036*o+.0286118*r),s=s*(.1605788+7961e-7*r+-.0571*o),r=1.00384+r*(.0802894+199025e-9*r)+o*(3*(.0998909-.02855*r)-.245516*o),o=c*s-r*u,c=(h*c-l*r)/o,r=(l*s-h*u)/o}while(e-=c,i-=r,(L(c)>D||L(r)>D)&&0<--a);return a&&[e,i]},mv.invert=function(t,n){var e=t*t,i=1+n*n,a=e+i,a=t?Am*I((a-I(a*a-4*e))/e):1/I(i);return[F(t*a),y(n)*Nm(a)]},vv.invert=function(t,n){return[t,2.5*mm(ym(.8*n))-.625*j]};var xv=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],wv=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Sv=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],kv=[[.9245,0],[0,0],[.01943,0]],Cv=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Mv(t,n){var t=d(bv(t)).rotate(n).clipAngle(90),e=F1(n),i=t.center;return delete t.rotate,t.center=function(t){return arguments.length?i(e(t)):e.invert(i())},t}var Av=I(6),zv=I(7);function Tv(t,n){n=F(7*O(n)/(3*Av));return[Av*t*(2*B(2*n/3)-1)/zv,9*O(n/3)/zv]}function Ev(t,n){for(var e,i=(1+Am)*O(n),a=n,r=0;r<25&&(a-=e=(O(a/2)+O(a)-i)/(.5*B(a/2)+B(a)),!(L(e)<D));r++);return[t*(1+2*B(a)/B(a/2))/(3*zm),2*I(3)*O(a/2)/I(2+zm)]}function Nv(t,n){for(var e,i=I(6/(4+j)),a=(1+j/4)*O(n),r=n/2,o=0;o<25&&(r-=e=(r/2+O(r)-a)/(.5+B(r)),!(L(e)<D));o++);return[i*(.5+B(r))*t/1.5,i*r]}function Pv(t,n){var e=n*n,i=e*e,a=e*i;return[t*(.84719-.13063*e+a*a*(.05494*e-.04515-.02326*i+.00331*a)),n*(1.01183+i*i*(.01926*e-.02625-.00396*i))]}function Lv(t,n){return[t*(1+B(n))/2,2*(n-g(n/2))]}Tv.invert=function(t,n){n=3*F(n*zv/9);return[t*zv/(Av*(2*B(2*n/3)-1)),F(3*O(n)*Av/7)]},Ev.invert=function(t,n){var n=n*I(2+zm)/(2*I(3)),e=2*F(n);return[3*zm*t/(1+2*B(e)/B(e/2)),F((n+O(e))/(1+Am))]},Nv.invert=function(t,n){var e=I(6/(4+j)),n=n/e;return L(L(n)-R)<D&&(n=n<0?-R:R),[1.5*t/(e*(.5+B(n))),F((n/2+O(n))/(1+j/4))]},Pv.invert=function(t,n){for(var e,i,a,r=n,o=25;r-=e=(r*(1.01183+(a=(i=r*r)*i)*a*(.01926*i-.02625-.00396*a))-n)/(1.01183+a*a*(.21186*i-.23625+-.05148*a)),L(e)>Cm&&0<--o;);return[t/(.84719-.13063*(i=r*r)+(t=i*(a=i*i))*t*(.05494*i-.04515-.02326*a+.00331*t)),r]},Lv.invert=function(t,n){for(var e=n/2,i=0,a=1/0;i<10&&L(a)>D;++i){var r=B(n/2);n-=a=(n-g(n/2)-e)/(1-.5/(r*r))}return[2*t/(1+B(n)),n]};var Bv=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];
|
|
5367
5367
|
// Based on Torben Jansen's implementation
|
|
5368
5368
|
// https://beta.observablehq.com/@toja/nicolosi-globular-projection
|
|
5369
5369
|
// https://beta.observablehq.com/@toja/nicolosi-globular-inverse
|
|
5370
|
-
function Ov(t,n){var e,i,a,r,o,s=O(n),l=
|
|
5370
|
+
function Ov(t,n){var e,i,a,r,o,s=O(n),l=B(n),h=y(t);return 0===t||L(n)===R?[0,n]:0===n?[t,0]:L(t)===R?[t*l,R*s]:(o=(r=((i=(a=(1-(a=2*n/j)*a)/(s-a))*a)*s/(e=(t=j/(2*t)-2*t/j)*t)+a/2)/(o=1+i/e))*r-(i*s*s/e+a*s-1)/o,[R*((a=(t*s/a-t/2)/(s=1+e/i))+I(a*a+l*l/s)*h),R*(r+I(o<0?0:o)*y(-n*t)*h)])}Ov.invert=function(t,n){var e=(t/=R)*t,i=e+(n/=R)*n,a=j*j;return[t?(i-1+I((1-i)*(1-i)+4*e))/(2*t)*R:0,Um(function(t){return i*(j*O(t)-2*t)*j+4*t*t*(n-O(t))+2*j*t-a*n},0)]};
|
|
5371
5371
|
// Based on Java implementation by Bojan Savric.
|
|
5372
5372
|
// https://github.com/OSUCartography/JMapProjLib/blob/master/src/com/jhlabs/map/proj/PattersonProjection.java
|
|
5373
|
-
var Dv=1.0148,jv=.23185,Rv=-.14499,
|
|
5373
|
+
var Dv=1.0148,jv=.23185,Rv=-.14499,Fv=.02406,Iv=1.790857183;function Hv(t,n){var e=n*n;return[t,n*(Dv+e*e*(jv+e*(Rv+Fv*e)))]}function Gv(t,n){var e;return L(n)<D?[t,0]:(e=g(n),t=t*O(n),[O(t)/e,n+(1-B(t))/e])}
|
|
5374
5374
|
// Note: 6-element arrays are used to denote the 3x3 affine transform matrix:
|
|
5375
5375
|
// [a, b, c,
|
|
5376
5376
|
// d, e, f,
|
|
5377
5377
|
// 0, 0, 1] - this redundant row is left out.
|
|
5378
5378
|
// Transform matrix for [a0, a1] -> [b0, b1].
|
|
5379
|
-
function Kv(t,n){var e=qv(t[1],t[0]),i=qv(n[1],n[0]),a=b(e[0]*i[1]-e[1]*i[0],e[0]*i[0]+e[1]*i[1]),e=$v(e)/$v(i);return Wv([1,0,t[0][0],0,1,t[0][1]],Wv([e,0,0,0,e,0],Wv([
|
|
5379
|
+
function Kv(t,n){var e=qv(t[1],t[0]),i=qv(n[1],n[0]),a=b(e[0]*i[1]-e[1]*i[0],e[0]*i[0]+e[1]*i[1]),e=$v(e)/$v(i);return Wv([1,0,t[0][0],0,1,t[0][1]],Wv([e,0,0,0,e,0],Wv([B(a),O(a),0,-O(a),B(a),0],[1,0,-n[0][0],0,1,-n[0][1]])))}
|
|
5380
5380
|
// Inverts a transform matrix.
|
|
5381
5381
|
function Uv(t){var n=1/(t[0]*t[4]-t[1]*t[3]);return[n*t[4],-n*t[1],n*(t[1]*t[5]-t[2]*t[4]),-n*t[3],n*t[0],n*(t[2]*t[3]-t[0]*t[5])]}
|
|
5382
5382
|
// Multiplies two 3x2 matrices.
|
|
@@ -5384,7 +5384,7 @@ function Wv(t,n){return[t[0]*n[0]+t[1]*n[3],t[0]*n[1]+t[1]*n[4],t[0]*n[2]+t[1]*n
|
|
|
5384
5384
|
// Subtracts 2D vectors.
|
|
5385
5385
|
function qv(t,n){return[t[0]-n[0],t[1]-n[1]]}
|
|
5386
5386
|
// Magnitude of a 2D vector.
|
|
5387
|
-
function $v(t){return
|
|
5387
|
+
function $v(t){return I(t[0]*t[0]+t[1]*t[1])}
|
|
5388
5388
|
// Angle between two 2D vectors.
|
|
5389
5389
|
// Creates a polyhedral projection.
|
|
5390
5390
|
// * root: a spanning tree of polygon faces. Nodes are automatically
|
|
@@ -5396,7 +5396,7 @@ function Vv(a,i){function t(t,n){var e=i(t,n),t=e.project([t*m,n*m]);return(n=e.
|
|
|
5396
5396
|
// polygonal quadtree.
|
|
5397
5397
|
function u(t){return i(t[0]*x,t[1]*x)}!function n(e,t){e.edges=Xv(e.face);
|
|
5398
5398
|
// Find shared edge.
|
|
5399
|
-
if(t.face){for(var i=e.shared=Zv(e.face,t.face),a=Kv(i.map(t.project),i.map(e.project)),r=(e.transform=t.transform?Wv(t.transform,a):a,t.edges),o=0,s=r.length;o<s;++o)Yv(i[0],r[o][1])&&Yv(i[1],r[o][0])&&(r[o]=e),Yv(i[0],r[o][0])&&Yv(i[1],r[o][1])&&(r[o]=e);for(r=e.edges,o=0,s=r.length;o<s;++o)Yv(i[0],r[o][0])&&Yv(i[1],r[o][1])&&(r[o]=t),Yv(i[0],r[o][1])&&Yv(i[1],r[o][0])&&(r[o]=t)}else e.transform=t.transform;e.children&&e.children.forEach(function(t){n(t,e)});return e}(a,{transform:null}),Jv(a)&&(t.invert=function(t,n){t=function t(n,e){var i=n.project.invert,a=n.transform,r=e;a&&(a=Uv(a),r=[a[0]*r[0]+a[1]*r[1]+a[2],a[3]*r[0]+a[4]*r[1]+a[5]]);if(i&&n===u(o=i(r)))return o;var o,s=n.children;for(var l=0,h=s&&s.length;l<h;++l)if(o=t(s[l],e))return o}(a,[t,-n]);return t&&(t[0]*=x,t[1]*=x,t)});var r=d(t),o=r.stream;return r.stream=function(t){var n=r.rotate(),e=o(t),i=(r.rotate([0,0]),o(t));return r.rotate(n),e.sphere=function(){i.polygonStart(),i.lineStart(),function t(n,e,i){var a,r,o=e.edges,s=o.length,l={type:"MultiPoint",coordinates:e.face},h=e.face.filter(function(t){return 90!==
|
|
5399
|
+
if(t.face){for(var i=e.shared=Zv(e.face,t.face),a=Kv(i.map(t.project),i.map(e.project)),r=(e.transform=t.transform?Wv(t.transform,a):a,t.edges),o=0,s=r.length;o<s;++o)Yv(i[0],r[o][1])&&Yv(i[1],r[o][0])&&(r[o]=e),Yv(i[0],r[o][0])&&Yv(i[1],r[o][1])&&(r[o]=e);for(r=e.edges,o=0,s=r.length;o<s;++o)Yv(i[0],r[o][0])&&Yv(i[1],r[o][1])&&(r[o]=t),Yv(i[0],r[o][1])&&Yv(i[1],r[o][0])&&(r[o]=t)}else e.transform=t.transform;e.children&&e.children.forEach(function(t){n(t,e)});return e}(a,{transform:null}),Jv(a)&&(t.invert=function(t,n){t=function t(n,e){var i=n.project.invert,a=n.transform,r=e;a&&(a=Uv(a),r=[a[0]*r[0]+a[1]*r[1]+a[2],a[3]*r[0]+a[4]*r[1]+a[5]]);if(i&&n===u(o=i(r)))return o;var o,s=n.children;for(var l=0,h=s&&s.length;l<h;++l)if(o=t(s[l],e))return o}(a,[t,-n]);return t&&(t[0]*=x,t[1]*=x,t)});var r=d(t),o=r.stream;return r.stream=function(t){var n=r.rotate(),e=o(t),i=(r.rotate([0,0]),o(t));return r.rotate(n),e.sphere=function(){i.polygonStart(),i.lineStart(),function t(n,e,i){var a,r,o=e.edges,s=o.length,l={type:"MultiPoint",coordinates:e.face},h=e.face.filter(function(t){return 90!==L(t[1])}),h=v1({type:"MultiPoint",coordinates:h}),u=!1,c=-1,g=h[1][0]-h[0][0];
|
|
5400
5400
|
// TODO
|
|
5401
5401
|
var d=180==g||360==g?[(h[0][0]+h[1][0])/2,(h[0][1]+h[1][1])/2]:N1(l);
|
|
5402
5402
|
// First find the shared edge…
|
|
@@ -5408,15 +5408,15 @@ function Zv(t,n){for(var e,i=t.length,a=null,r=0;r<i;++r)for(var o=t[r],s=n.leng
|
|
|
5408
5408
|
// Converts an array of n face vertices to an array of n + 1 edges.
|
|
5409
5409
|
function Xv(t){for(var n=t.length,e=[],i=t[n-1],a=0;a<n;++a)e.push([i,i=t[a]]);return e}function Jv(t){return t.project.invert||t.children&&t.children.some(Jv)}
|
|
5410
5410
|
// TODO generate on-the-fly to avoid external modification.
|
|
5411
|
-
Hv.invert=function(t,n){
|
|
5411
|
+
Hv.invert=function(t,n){Iv<n?n=Iv:n<-1.790857183&&(n=-1.790857183);var e=n;do{var i=e*e}while(e-=i=(e*(Dv+i*i*(jv+i*(Rv+Fv*i)))-n)/(1.0148+i*i*(1.1592500000000001+i*(.21654*i-1.01493))),L(i)>D);return[t,e]},Gv.invert=function(t,n){if(L(n)<D)return[t,0];var e=t*t+n*n,i=.5*n,a=10;do{var r=g(i),o=1/B(i),s=e-2*n*i+i*i}while(i-=s=(r*s+2*(i-n))/(2+s*o*o+2*(i-n)*r),L(s)>D&&0<--a);return r=g(i),[(L(n)<L(i+1/r)?F(t*r):y(n)*y(t)*(Nm(L(t*r))+R))/O(i),i]};var Qv=[[0,90],[-90,0],[0,0],[90,0],[180,0],[0,-90]],t2=[[0,2,1],[0,3,2],[5,1,2],[5,2,3],[0,1,4],[0,4,3],[5,4,1],[5,3,4]].map(function(t){return t.map(function(t){return Qv[t]})});var n2=2/I(3);function e2(t,n){t=ly(t,n);return[t[0]*n2,t[1]]}function i2(t,n){for(var e=0,i=t.length,a=0;e<i;++e)a+=t[e]*n[e];return a}
|
|
5412
5412
|
// Converts 3D Cartesian to spherical coordinates (degrees).
|
|
5413
|
-
function a2(t){return[b(t[1],t[0])*m,
|
|
5413
|
+
function a2(t){return[b(t[1],t[0])*m,F(xm(-1,wm(1,t[2])))*m]}
|
|
5414
5414
|
// Converts spherical coordinates (degrees) to 3D Cartesian.
|
|
5415
|
-
function r2(t){var n=t[0]*x,t=t[1]*x,e=
|
|
5415
|
+
function r2(t){var n=t[0]*x,t=t[1]*x,e=B(t);return[e*B(n),e*O(n),O(t)]}e2.invert=function(t,n){return ly.invert(t/n2,n)};_n=()=>{};function o2(t,n){return{type:"FeatureCollection",features:t.features.map(function(t){return s2(t,n)})}}function s2(t,n){return{type:"Feature",id:t.id,properties:t.properties,geometry:l2(t.geometry,n)}}function l2(t,n){if(!t)return null;if("GeometryCollection"===t.type)return e=n,{type:"GeometryCollection",geometries:t.geometries.map(function(t){return l2(t,e)})};var e,i;switch(t.type){case"Point":case"MultiPoint":i=c2;break;case"LineString":case"MultiLineString":i=g2;break;case"Polygon":case"MultiPolygon":case"Sphere":i=d2;break;default:return null}return p0(t,n(i)),i.result()}var h2=[],u2=[],c2={point:function(t,n){h2.push([t,n])},result:function(){var t=h2.length?h2.length<2?{type:"Point",coordinates:h2[0]}:{type:"MultiPoint",coordinates:h2}:null;return h2=[],t}},g2={lineStart:_n,point:function(t,n){h2.push([t,n])},lineEnd:function(){h2.length&&(u2.push(h2),h2=[])},result:function(){var t=u2.length?u2.length<2?{type:"LineString",coordinates:u2[0]}:{type:"MultiLineString",coordinates:u2}:null;return u2=[],t}},d2={polygonStart:_n,lineStart:_n,point:function(t,n){h2.push([t,n])},lineEnd:function(){var t=h2.length;if(t){for(;h2.push(h2[0].slice()),++t<4;);u2.push(h2),h2=[]}},polygonEnd:_n,result:function(){var i,n;return u2.length&&(i=[],n=[],
|
|
5416
5416
|
// https://github.com/d3/d3/issues/1558
|
|
5417
|
-
u2.forEach(function(t){(t=>{if(!((n=t.length)<4)){for(var n,e=0,i=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e<n;)i+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return i<=0}})(t)?i.push([t]):n.push(t)}),n.forEach(function(n){var e=n[0];i.some(function(t){if(((t,n)=>{for(var e=n[0],i=n[1],a=!1,r=0,o=t.length,s=o-1;r<o;s=r++){var l=t[r],h=l[0],l=l[1],u=t[s],c=u[0],u=u[1];i<l^i<u&&e<(c-h)*(i-l)/(u-l)+h&&(a=!a)}return a})(t[0],e))return t.push(n),!0})||i.push([n])}),u2=[],i.length)?1<i.length?{type:"MultiPolygon",coordinates:i}:{type:"Polygon",coordinates:i[0]}:null}};function f2(s){var l=s(R,0)[0]-s(-R,0)[0];function t(t,n){var e,i=
|
|
5417
|
+
u2.forEach(function(t){(t=>{if(!((n=t.length)<4)){for(var n,e=0,i=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e<n;)i+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return i<=0}})(t)?i.push([t]):n.push(t)}),n.forEach(function(n){var e=n[0];i.some(function(t){if(((t,n)=>{for(var e=n[0],i=n[1],a=!1,r=0,o=t.length,s=o-1;r<o;s=r++){var l=t[r],h=l[0],l=l[1],u=t[s],c=u[0],u=u[1];i<l^i<u&&e<(c-h)*(i-l)/(u-l)+h&&(a=!a)}return a})(t[0],e))return t.push(n),!0})||i.push([n])}),u2=[],i.length)?1<i.length?{type:"MultiPolygon",coordinates:i}:{type:"Polygon",coordinates:i[0]}:null}};function f2(s){var l=s(R,0)[0]-s(-R,0)[0];function t(t,n){var e,i=L(t)<R,t=s(i?t:0<t?t-j:t+j,n),n=(t[0]-t[1])*Am,t=(t[0]+t[1])*Am;return i?[n,t]:(i=l*Am,[(e=0<n^0<t?-1:1)*n-y(t)*i,e*t-y(n)*i])}return s.invert&&(t.invert=function(t,n){var e,i,a=(t+n)*Am,r=(n-t)*Am,o=L(a)<.5*l&&L(r)<.5*l,n=(o||(a=(-(e=-(i=0<a^0<r?-1:1)*t+(0<r?1:-1)*(t=l*Am))-(i=-i*n+(0<a?1:-1)*t))*Am,r=(e-i)*Am),s.invert(a,r));return o||(n[0]+=0<a?j:-j),n}),d(t).rotate([-90,-90,45]).clipAngle(179.999)}function p2(l){var h=O(l);function t(t,n){var e,i,t=h?g(t*h/2)/h:t/2;return n?(e=2*mm(t*O(n)),i=1/g(n),[O(e)*i,n+(1-B(e))*i-l]):[2*t,-l]}
|
|
5418
5418
|
// TODO return null for points outside outline.
|
|
5419
|
-
return t.invert=function(t,n){if(
|
|
5419
|
+
return t.invert=function(t,n){if(L(n+=l)<D)return[h?2*mm(h*t/2)/h:t,0];var e=t*t+n*n,i=0,a=10;do{var r=g(i),o=1/B(i),s=e-2*n*i+i*i}while(i-=s=(r*s+2*(i-n))/(2+s*o*o+2*(i-n)*r),L(s)>D&&0<--a);t*=r=g(i),t=g(L(n)<L(i+1/r)?.5*F(t):.5*Nm(t)+j/4)/O(i);return[h?2*mm(h*t)/h:2*t,i]},t}var _2=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];function m2(t,n){var e=wm(18,36*L(n)/j),i=vm(e),e=e-i,a=(l=_2[i])[0],r=l[1],o=(l=_2[++i])[0],s=l[1],i=(l=_2[wm(19,++i)])[0],l=l[1];return[t*(o+e*(i-a)/2+e*e*(i-2*o+a)/2),y(n)*(s+e*(l-r)/2+e*e*(l-2*s+r)/2)]}function y2(i,t){a=i,n.invert=function(t,n){var e=t*t+n*n,i=I(e),e=(a-I(1-e*(a+1)/(a-1)))/((a-1)/i+i/(a-1));return[b(t*e,i*I(1-e*e)),i?F(n*e/i):0]};var a,r,o,s=n;function n(t,n){var e=B(n),i=(a-1)/(a-e*B(t));return[i*e*O(t),i*O(n)]}return t?(r=B(t),o=O(t),e.invert=function(t,n){var e=(i-1)/(i-1-n*o);return s.invert(e*t,e*n*r)},e):s;function e(t,n){var t=s(t,n),n=t[1],e=n*o/(i-1)+r;return[t[0]*r/e,n/e]}}_2.forEach(function(t){t[1]*=1.593415793900743}),m2.invert=function(t,n){var e=wm(18,L((g=90*n)/5)),i=xm(0,vm(e));do{var a=_2[i][1],r=_2[i+1][1],o=_2[wm(19,i+2)][1],s=o-a,l=o-2*r+a,h=2*(L(n)-r)/s,l=l/s,u=h*(1-l*h*(1-2*l*h));if(0<=u||1===i){for(var c,g=(0<=n?5:-5)*(u+e),d=50;u=(e=wm(18,L(g)/5))-(i=vm(e)),a=_2[i][1],r=_2[i+1][1],o=_2[wm(19,i+2)][1],g-=(c=y(n)*(r+u*(o-a)/2+u*u*(o-2*r+a)/2)-n)*m,L(c)>Cm&&0<--d;);break}}while(0<=--i);var f=_2[i][0],p=_2[i+1][0],_=_2[wm(19,i+2)][0];return[t/(p+u*(_-f)/2+u*u*(_-2*p+f)/2),g*x]};var v2=1e4,b2=-180,x2=b2+1e-4,w2=180,S2=w2-1e-4,k2=-90,C2=k2+1e-4,M2=90,A2=M2-1e-4;function z2(t){return 0<t.length}function T2(t){return t===k2||t===M2?[0,t]:[b2,Math.floor(t*v2)/v2];// pole or antimeridian?
|
|
5420
5420
|
}function E2(t){var n=t[0],e=t[1],i=!1;return n<=x2?(n=b2,i=!0):S2<=n&&(n=w2,i=!0),e<=C2?(e=k2,i=!0):A2<=e&&(e=M2,i=!0),i?[n,e]:t}function N2(t){return t.map(E2)}
|
|
5421
5421
|
// For each ring, detect where it crosses the antimeridian or pole.
|
|
5422
5422
|
function P2(t,n,e){for(var i=0,a=t.length;i<a;++i){var r=t[i].slice();
|
|
@@ -5440,7 +5440,7 @@ o?((h={index:-1,polygon:n,ring:r.slice(0,o+1)}).ring[h.ring.length-1]=T2(u),e[e.
|
|
|
5440
5440
|
// Otherwise, add the remaining ring fragment and continue.
|
|
5441
5441
|
e.push({index:-1,polygon:n,ring:r=r.slice(c-1)}),r[0]=T2(r[0][1]),o=-1,s=r.length}}}}}
|
|
5442
5442
|
// Now stitch the fragments back together into rings.
|
|
5443
|
-
function
|
|
5443
|
+
function L2(t){
|
|
5444
5444
|
// For each fragment…
|
|
5445
5445
|
for(var n,e,i,a,r,o=t.length,s={},l={},h=0
|
|
5446
5446
|
// To connect the fragments start-to-end, create a simple index by end.
|
|
@@ -5455,11 +5455,11 @@ t[i.index]=null,n={index:-1,polygon:i.polygon,ring:i.ring.concat(n.ring)},i===r?
|
|
|
5455
5455
|
// Connect both ends to this single fragment to create a ring.
|
|
5456
5456
|
n.polygon.push(n.ring):(n.index=o++,t.push(s[n.ring[0]]=l[n.ring[n.ring.length-1]]=n))):r?(delete s[a],delete l[r.ring[r.ring.length-1]],n.ring.pop(),// drop the shared coordinate
|
|
5457
5457
|
n={index:o++,polygon:r.polygon,ring:n.ring.concat(r.ring)},t[r.index]=null,t.push(s[n.ring[0]]=l[n.ring[n.ring.length-1]]=n)):(n.ring.push(n.ring[0]),// close ring
|
|
5458
|
-
n.polygon.push(n.ring)))}function
|
|
5458
|
+
n.polygon.push(n.ring)))}function B2(t){var n={type:"Feature",geometry:O2(t.geometry)};return null!=t.id&&(n.id=t.id),null!=t.bbox&&(n.bbox=t.bbox),null!=t.properties&&(n.properties=t.properties),n}function O2(t){if(null==t)return t;var n;switch(t.type){case"GeometryCollection":n={type:"GeometryCollection",geometries:t.geometries.map(O2)};break;case"Point":n={type:"Point",coordinates:E2(t.coordinates)};break;case"MultiPoint":case"LineString":n={type:t.type,coordinates:N2(t.coordinates)};break;case"MultiLineString":n={type:"MultiLineString",coordinates:t.coordinates.map(N2)};break;case"Polygon":var e=[];P2(t.coordinates,e,i=[]),L2(i),n={type:"Polygon",coordinates:e};break;case"MultiPolygon":for(var i=[],a=-1,r=t.coordinates.length,o=new Array(r);++a<r;)P2(t.coordinates[a],o[a]=[],i);L2(i),n={type:"MultiPolygon",coordinates:o.filter(z2)};break;default:return t}return null!=t.bbox&&(n.bbox=t.bbox),n}function D2(t,n){var n=g(n/2),e=O(Mm*n);return[t*(.74482-.34588*e*e),1.70711*n]}
|
|
5459
5459
|
// Compute the origin as the midpoint of the two reference points.
|
|
5460
5460
|
// Rotate one of the reference points by the origin.
|
|
5461
5461
|
// Apply the spherical law of sines to compute gamma rotation.
|
|
5462
|
-
function j2(t,n,e){var e=Ap(n,e),i=e(.5),n=
|
|
5462
|
+
function j2(t,n,e){var e=Ap(n,e),i=e(.5),n=F1([-i[0],-i[1]])(n),e=e.distance/2,a=-F(O(n[1]*x)/O(e)),i=[-i[0],-i[1],-(0<n[0]?j-a:a)*m],n=d(t(e)).rotate(i),r=F1(i),o=n.center;return delete n.rotate,n.center=function(t){return arguments.length?o(r(t)):r.invert(o())},n.clipAngle(90)}function R2(t){var e=B(t);function n(t,n){t=um(t,n);return t[0]*=e,t}return n.invert=function(t,n){return um.invert(t/e,n)},n}function F2(t,n){return j2(R2,t,n)}function I2(i){var r,o,a,s,l;return(i*=2)?(a=i*i,s=g(o=-(r=-i/2)),l=.5/O(o),t.invert=function(t,n){var e,i=n*n,a=B(I(i+(e=t+r)*e)),i=B(I(i+(e=t+o)*e));return[b(t=a-i,e=(a+i)*s),(n<0?-1:1)*Nm(I(e*e+t*t)*l)]},t):Z_;function t(t,n){var e=Nm(B(n)*B(t-r)),t=Nm(B(n)*B(t-o));return[((e*=e)-(t*=t))/(2*i),(n<0?-1:1)*I(4*a*t-(a-e+t)*(a-e+t))/(2*i)]}}function H2(t,n){return j2(I2,t,n)}function G2(t,n){var e,i,a,r,o,s,l,h;return L(n)<D?[t,0]:(a=F(r=L(n/R)),L(t)<D||L(L(n)-R)<D?[0,y(n)*j*g(a/2)]:(s=(o=(r=(a=(a=B(a))/(r+a-1))*(2/r-1))*r)+(i=(e=L(j/t-t/j)/2)*e),l=a-o,h=i+a,[y(t)*j*(e*l+I(i*l*l-s*(a*a-o)))/s,y(n)*j*(r*h-e*I((1+i)*s-h*h))/s]))}function K2(t,n){var e,i,a,r;return L(n)<D?[t,0]:(r=F(e=L(n/R)),L(t)<D||L(L(n)-R)<D?[0,y(n)*j*g(r/2)]:(r=(r=B(r))*(I(1+(a=(i=L(j/t-t/j)/2)*i))-i*r)/(1+a*e*e),[y(t)*j*r,y(n)*j*I(1-r*(2*i+r))]))}function U2(t,n){var e,i;return L(n)<D?[t,0]:(e=F(i=n/R),L(t)<D||L(L(n)-R)<D?[0,j*g(e/2)]:(n=(j/t-t/j)/2,i=i/(1+B(e)),[j*(y(t)*I(n*n+1-i*i)-n),j*i]))}function W2(t,n){var e,i,a,r,o,s,l;return n?(r=L(n),t&&r!==R?(a=(l=(r=r/R)*r)+(e=(o=(8*r-l*(2+l)-5)/(2*l*(r-1)))*o)+2*(i=r*o),r=r+3*o,o=(o=t/R)+1/o,l=((o=y(L(t)-R)*I(o*o-4))*(a+e-1)+2*I(a*(l+e*(s=o*o)-1)+(1-l)*(l*(r*r+4*e)+12*i*e+4*e*e)))/(4*a+s),[y(t)*R*l,y(n)*R*I(1+o*L(l)-l*l)]):[0,n]):[t,0]}function q2(t,n,e,i){
|
|
5463
5463
|
// 60 is always used as reference parallel
|
|
5464
5464
|
var a,r,o,s,l,h=j/3,e=(
|
|
5465
5465
|
// sanitizing the input values
|
|
@@ -5472,38 +5472,38 @@ e=xm(e,0),(e=wm(e,100-D))/100+1),i=(
|
|
|
5472
5472
|
// ratio > 0.
|
|
5473
5473
|
// sensible values, i.e. something that renders a map which still can be
|
|
5474
5474
|
// recognized as world map, are e.g. 20 <= ratio <= 1000.
|
|
5475
|
-
i=xm(i,D))/100,e=Nm(e*
|
|
5475
|
+
i=xm(i,D))/100,e=Nm(e*B(h))/h,h=O(t)/O(e*R),u=n/j,i=I(i*O(t/2)/O(n/2)),t=i/I(u*h*e),n=1/(i*I(u*h*e));return a=t,r=n,o=h,s=e,l=u,c.invert=function(t,n){var e=t/a,i=n/r,e=I(e*e+i*i),i=2*F(e/2);return[b(t*g(i),a*e)/l,e&&F(n*O(i)/(r*o*e))/s]},c;function c(t,n){var n=o*O(s*n),e=I(1-n*n),i=I(2/(1+e*B(t*=l)));return[a*e*i*O(t),r*n*i]}}function $2(){
|
|
5476
5476
|
// default values generate wagner8
|
|
5477
|
-
var n=65*x,e=60*x,i=20,a=200,r=G_(q2),t=r(n,e,i,a);return t.poleline=function(t){return arguments.length?r(n=+t*x,e,i,a):n*m},t.parallels=function(t){return arguments.length?r(n,e=+t*x,i,a):e*m},t.inflation=function(t){return arguments.length?r(n,e,i=+t,a):i},t.ratio=function(t){return arguments.length?r(n,e,i,a=+t):a},t.scale(163.775)}D2.invert=function(t,n){var n=n/1.70711,e=O(Mm*n);return[t/(.74482-.34588*e*e),2*mm(n)]},G2.invert=function(t,n){var e,i,a,r,o,s,l,h;return
|
|
5477
|
+
var n=65*x,e=60*x,i=20,a=200,r=G_(q2),t=r(n,e,i,a);return t.poleline=function(t){return arguments.length?r(n=+t*x,e,i,a):n*m},t.parallels=function(t){return arguments.length?r(n,e=+t*x,i,a):e*m},t.inflation=function(t){return arguments.length?r(n,e,i=+t,a):i},t.ratio=function(t){return arguments.length?r(n,e,i,a=+t):a},t.scale(163.775)}D2.invert=function(t,n){var n=n/1.70711,e=O(Mm*n);return[t/(.74482-.34588*e*e),2*mm(n)]},G2.invert=function(t,n){var e,i,a,r,o,s,l,h;return L(n)<D?[t,0]:L(t)<D?[0,R*O(2*mm(n/j))]:(r=(a=(e=(t/=j)*t)+(i=(n/=j)*n))*a,h=Nm(3*(i/(s=-2*(l=-L(n)*(1+a))+1+2*i+r)+(2*(o=l-2*i+e)*o*o/(s*s*s)-9*l*o/(s*s))/27)/((l=(l-o*o/(3*s))/s)*(l=2*I(-l/3))))/3,[j*(a-1+I(1+2*(e-i)+r))/(2*t),y(n)*j*(-l*B(h+j/3)-o/(3*s))])},K2.invert=function(t,n){var e,i,a;return t?(a=I(1+(i=(1-(e=L(t/j))*e-(n/=j)*n)/(2*e))*i),[y(t)*j*(a-i),y(n)*R*O(2*b(I((1-2*i*e)*(i+a)-e),I(a+i+e)))]):[0,R*O(2*mm(n/j))]},U2.invert=function(t,n){var e;return n?(e=(j*j*(1-(n=n/j)*n)-t*t)/(2*j*t),[t?j*(y(t)*I(e*e+1)-e):0,R*O(2*mm(n))]):[t,0]},W2.invert=function(t,n){if(!t||!n)return[t,n];var e=y(n),i=(n=L(n)/j,y(t)*t/R),a=(i*i-1+4*n*n)/L(i),r=a*a,o=n*(2-(.5<n?wm(n,L(t)):0)),s=t*t+n*n,l=50;do{var h=o*o,u=(8*o-h*(2+h)-5)/(2*h*(o-1)),c=(3*o-h*o-10)/(2*h*o),g=u*u,d=o*u,f=o+u,p=f*f,_=o+3*u,m=-2*f*(4*d*g+(1-4*h+3*h*h)*(1+c)+g*(14*h-6-r+(8*h-8-2*r)*c)+d*(12*h-8+(10*h-10-r)*c)),h=I(p*(h+g*r-1)+(1-h)*(h*(_*_+4*g)+g*(12*d+4*g)))}while(o-=_=(a*(p+g-1)+2*h-i*(4*p+r))/(a*(2*u*c+2*f*(1+c))+m/h-8*f*(a*(g-1+p)+2*h)*(1+c)/(r+4*p)),D<_*s*s&&0<--l);return[y(t)*(I(a*a+4)+a)*j/4,e*R*o]};var pn=4*j+3*I(3),Br=2*I(2*j*I(3)/pn),V2=Vm(Br*I(3)/j,Br,pn/6);function Y2(t,n){return[t*I(1-3*n*n/(j*j)),n]}function Z2(t,n){var e=B(n),i=B(t)*e,a=1-i,n=B(t=b(O(t)*e,-O(n))),t=O(t);return[t*(e=I(1-i*i))-n*a,-n*e-t*a]}function X2(t,n){var e=Om(t,n);return[(e[0]+t/R)/2,(e[1]+n)/2]}Y2.invert=function(t,n){return[t/I(1-3*n*n/(j*j)),n]},Z2.invert=function(t,n){var e=(t*t+n*n)/-2,i=I(-e*(2+e)),a=n*e+t*i,t=t*e-n*i,n=I(t*t+a*a);return[b(i*a,n*(1+e)),n?-F(i*t/n):0]},X2.invert=function(t,n){var e=t,i=n,a=25;do{var r,o=B(i),s=O(i),l=O(2*i),h=s*s,u=o*o,c=O(e),g=B(e/2),d=O(e/2),f=d*d,p=1-u*g*g,p=p?Nm(o*g)*I(r=1/p):r=0,_=.5*(2*p*o*d+e/R)-t,m=.5*(p*s+i)-n,y=.5*r*(u*f+p*o*g*h)+.5/R,v=r*(c*l/4-p*s*d),l=.125*r*(l*d-p*s*u*c),d=.5*r*(h*g+p*f*o)+.5,s=v*l-d*y,u=(m*v-_*d)/s,c=(_*l-m*y)/s}while(e-=u,i-=c,(L(u)>D||L(c)>D)&&0<--a);return[e,i]};var J2=Object.freeze({__proto__:null,geoAiry:function(){var n=R,e=G_(Bm),t=e(n);return t.radius=function(t){return arguments.length?e(n=t*x):n*m},t.scale(179.976).clipAngle(147)},geoAiryRaw:Bm,geoAitoff:function(){return d(Om).scale(152.63)},geoAitoffRaw:Om,geoArmadillo:function(){var r=20*x,o=0<=r?1:-1,s=g(o*r),n=G_(Dm),l=n(r),h=l.stream;return l.parallel=function(t){return arguments.length?(s=g((o=0<=(r=t*x)?1:-1)*r),n(r)):r*m},l.stream=function(t){var n=l.rotate(),e=h(t),i=(l.rotate([0,0]),h(t)),a=l.precision();return l.rotate(n),e.sphere=function(){i.polygonStart(),i.lineStart();for(var t=-180*o;o*t<180;t+=90*o)i.point(t,90*o);if(r)for(;-180<=o*(t-=3*o*a);)i.point(t,o*-b(B(t*x/2),s)*m);i.lineEnd(),i.polygonEnd()},e},l.scale(218.695).center([0,28.0974])},geoArmadilloRaw:Dm,geoAugust:function(){return d(jm).scale(66.1603)},geoAugustRaw:jm,geoBaker:function(){return d(Im).scale(112.314)},geoBakerRaw:Im,geoBerghaus:function(){var o=5,n=G_(Hm),i=n(o),a=i.stream,s=-B(.01*x),l=O(.01*x);return i.lobes=function(t){return arguments.length?n(o=+t):o},i.stream=function(t){var n=i.rotate(),e=a(t),r=(i.rotate([0,0]),a(t));return i.rotate(n),e.sphere=function(){r.polygonStart(),r.lineStart();for(var t=0,n=360/o,e=2*j/o,i=90-180/o,a=R;t<o;++t,i-=n,a-=e)r.point(b(l*B(a),s)*m,F(l*O(a))*m),i<-90?(r.point(-90,-180-i-.01),r.point(-90,-180-i+.01)):(r.point(90,i+.01),r.point(90,i-.01));r.lineEnd(),r.polygonEnd()},e},i.scale(87.8076).center([0,17.1875]).clipAngle(179.999)},geoBerghausRaw:Hm,geoBertin1953:function(){
|
|
5478
5478
|
// this projection should not be rotated
|
|
5479
5479
|
return d(qm()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])},geoBertin1953Raw:qm,geoBoggs:function(){return d(Xm).scale(160.857)},geoBoggsRaw:Xm,geoBonne:function(){return Jm(ty).scale(123.082).center([0,26.1441]).parallel(45)},geoBonneRaw:ty,geoBottomley:function(){var n=.5,e=G_(ny),t=e(n);return t.fraction=function(t){return arguments.length?e(n=+t):n},t.scale(158.837)},geoBottomleyRaw:ny,geoBromley:function(){return d(ey).scale(152.63)},geoBromleyRaw:ey,geoChamberlin:sy,geoChamberlinAfrica:function(){return sy([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])},geoChamberlinRaw:ry,geoCollignon:function(){return d(ly).scale(95.6464).center([0,30])},geoCollignonRaw:ly,geoCraig:function(){return Jm(hy).scale(249.828).clipAngle(90)},geoCraigRaw:hy,geoCraster:function(){return d(cy).scale(156.19)},geoCrasterRaw:cy,geoCylindricalEqualArea:function(){return Jm(gy).parallel(38.58).scale(195.044);// width / (sqrt(width / height / pi) * 2 * pi)
|
|
5480
5480
|
},geoCylindricalEqualAreaRaw:gy,geoCylindricalStereographic:function(){return Jm(dy).scale(124.75)},geoCylindricalStereographicRaw:dy,geoEckert1:function(){return d(fy).scale(165.664)},geoEckert1Raw:fy,geoEckert2:function(){return d(py).scale(165.664)},geoEckert2Raw:py,geoEckert3:function(){return d(_y).scale(180.739)},geoEckert3Raw:_y,geoEckert4:function(){return d(my).scale(180.739)},geoEckert4Raw:my,geoEckert5:function(){return d(yy).scale(173.044)},geoEckert5Raw:yy,geoEckert6:function(){return d(vy).scale(173.044)},geoEckert6Raw:vy,geoEisenlohr:function(){return d(xy).scale(62.5271)},geoEisenlohrRaw:xy,geoFahey:function(){return d(Sy).scale(137.152)},geoFaheyRaw:Sy,geoFoucaut:function(){return d(ky).scale(135.264)},geoFoucautRaw:ky,geoFoucautSinusoidal:function(){var n=.5,e=G_(Cy),t=e(n);return t.alpha=function(t){return arguments.length?e(n=+t):n},t.scale(168.725)},geoFoucautSinusoidalRaw:Cy,geoGilbert:function(t){var n=(t=null==t?fm:t)(),i=em().scale(m).precision(0).clipAngle(null).translate([0,0]);// antimeridian cutting
|
|
5481
|
-
function e(t){return n(My(t))}function a(t){e[t]=function(){return arguments.length?(n[t].apply(n,arguments),e):n[t]()}}return n.invert&&(e.invert=function(t){return Ay(n.invert(t))}),e.stream=function(t){var e=n.stream(t),t=i.stream({point:function(t,n){e.point(t/2,
|
|
5481
|
+
function e(t){return n(My(t))}function a(t){e[t]=function(){return arguments.length?(n[t].apply(n,arguments),e):n[t]()}}return n.invert&&(e.invert=function(t){return Ay(n.invert(t))}),e.stream=function(t){var e=n.stream(t),t=i.stream({point:function(t,n){e.point(t/2,F(g(-n/2*x))*m)},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}});return t.sphere=e.sphere,t},e.rotate=function(t){return arguments.length?(i.rotate(t),e):i.rotate()},e.center=function(t){return arguments.length?(n.center(My(t)),e):Ay(n.center())},a("angle"),a("clipAngle"),a("clipExtent"),a("fitExtent"),a("fitHeight"),a("fitSize"),a("fitWidth"),a("scale"),a("translate"),a("precision"),e.scale(249.5)},geoGingery:function(){var a=6,n=30*x,r=B(n),o=O(n),e=G_(zy),s=e(n,a),l=s.stream,h=-B(.01*x),u=O(.01*x);return s.radius=function(t){return arguments.length?(r=B(n=t*x),o=O(n),e(n,a)):n*m},s.lobes=function(t){return arguments.length?e(n,a=+t):a},s.stream=function(t){var n=s.rotate(),e=l(t),i=(s.rotate([0,0]),l(t));return s.rotate(n),e.sphere=function(){i.polygonStart(),i.lineStart();for(var t=0,n=2*j/a,e=0;t<a;++t,e-=n)i.point(b(u*B(e),h)*m,F(u*O(e))*m),i.point(b(o*B(e-n/2),r)*m,F(o*O(e-n/2))*m);i.lineEnd(),i.polygonEnd()},e},s.rotate([90,-40]).scale(91.7095).clipAngle(179.999)},geoGingeryRaw:zy,geoGinzburg4:function(){return d(Py).scale(149.995)},geoGinzburg4Raw:Py,geoGinzburg5:function(){return d(Ly).scale(153.93)},geoGinzburg5Raw:Ly,geoGinzburg6:function(){return d(By).scale(130.945)},geoGinzburg6Raw:By,geoGinzburg8:function(){return d(Oy).scale(131.747)},geoGinzburg8Raw:Oy,geoGinzburg9:function(){return d(Dy).scale(131.087)},geoGinzburg9Raw:Dy,geoGringorten:function(){return d(jy(Ry)).scale(239.75)}
|
|
5482
5482
|
// Returns [sn, cn, dn](u + iv|m).
|
|
5483
5483
|
,geoGringortenQuincuncial:function(){return f2(Ry).scale(176.423)},geoGringortenRaw:Ry,geoGuyou:function(){return d(jy(Hy)).scale(151.496)},geoGuyouRaw:Hy,geoHammer:function(){var n=2,e=G_(Gm),t=e(n);return t.coefficient=function(t){return arguments.length?e(n=+t):n},t.scale(169.529)},geoHammerRaw:Gm,geoHammerRetroazimuthal:function(){var e=0,i=G_(Gy),a=i(e),n=a.rotate,t=a.stream,r=G1();return a.parallel=function(t){var n;return arguments.length?(n=a.rotate(),i(e=t*x).rotate(n)):e*m},
|
|
5484
5484
|
// Temporary hack; see hammerRetroazimuthalRotation.
|
|
5485
|
-
a.rotate=function(t){return arguments.length?(n.call(a,[t[0],t[1]-e*m]),r.center([-t[0],-t[1]]),a):((t=n.call(a))[1]+=e*m,t)},a.stream=function(a){return(a=t(a)).sphere=function(){a.polygonStart();var t,n=r.radius(89.99)().coordinates[0],e=n.length-1,i=-1;for(a.lineStart();++i<e;)a.point((t=n[i])[0],t[1]);for(a.lineEnd(),e=(n=r.radius(90.01)().coordinates[0]).length-1,a.lineStart();0<=--i;)a.point((t=n[i])[0],t[1]);a.lineEnd(),a.polygonEnd()},a},a.scale(79.4187).parallel(45).clipAngle(179.999)},geoHammerRetroazimuthalRaw:Gy,geoHealpix:function(){var a=4,n=G_(qy),r=n(a),o=r.stream;return r.lobes=function(t){return arguments.length?n(a=+t):a},r.stream=function(t){var n=r.rotate(),e=o(t),i=(r.rotate([0,0]),o(t));return r.rotate(n),e.sphere=function(){var t,n;p0((t=180/a,n=[].concat(jt(-180,180+t/2,t).map($y),jt(180,-180-t/2,-t).map(Vy)),{type:"Polygon",coordinates:[180===t?n.map(Yy):n]}),i)},e},r.scale(239.75)},geoHealpixRaw:qy,geoHill:function(){var n=1,e=G_(Zy),t=e(n);return t.ratio=function(t){return arguments.length?e(n=+t):n},t.scale(167.774).center([0,18.67])},geoHillRaw:Zy,geoHomolosine:function(){return d(tv).scale(152.63)},geoHomolosineRaw:tv,geoHufnagel:function(){var n=1,e=0,i=45*x,a=2,r=G_(nv),t=r(n,e,i,a);return t.a=function(t){return arguments.length?r(n=+t,e,i,a):n},t.b=function(t){return arguments.length?r(n,e=+t,i,a):e},t.psiMax=function(t){return arguments.length?r(n,e,i=+t*x,a):i*m},t.ratio=function(t){return arguments.length?r(n,e,i,a=+t):a},t.scale(180.739)},geoHufnagelRaw:nv,geoHyperelliptical:function(){var n=0,e=2.5,i=1.183136,a=G_(iv),t=a(n,e,i);return t.alpha=function(t){return arguments.length?a(n=+t,e,i):n},t.k=function(t){return arguments.length?a(n,e=+t,i):e},t.gamma=function(t){return arguments.length?a(n,e,i=+t):i},t.scale(152.63)},geoHyperellipticalRaw:iv,geoInterrupt:rv,geoInterruptedBoggs:function(){return rv(Xm,ov).scale(160.857)},geoInterruptedHomolosine:function(){return rv(tv,sv).scale(152.63)},geoInterruptedMollweide:function(){return rv(Ym,lv).scale(169.529)},geoInterruptedMollweideHemispheres:function(){return rv(Ym,hv).scale(169.529).rotate([20,0])},geoInterruptedQuarticAuthalic:function(){return rv(Gm(1/0),
|
|
5485
|
+
a.rotate=function(t){return arguments.length?(n.call(a,[t[0],t[1]-e*m]),r.center([-t[0],-t[1]]),a):((t=n.call(a))[1]+=e*m,t)},a.stream=function(a){return(a=t(a)).sphere=function(){a.polygonStart();var t,n=r.radius(89.99)().coordinates[0],e=n.length-1,i=-1;for(a.lineStart();++i<e;)a.point((t=n[i])[0],t[1]);for(a.lineEnd(),e=(n=r.radius(90.01)().coordinates[0]).length-1,a.lineStart();0<=--i;)a.point((t=n[i])[0],t[1]);a.lineEnd(),a.polygonEnd()},a},a.scale(79.4187).parallel(45).clipAngle(179.999)},geoHammerRetroazimuthalRaw:Gy,geoHealpix:function(){var a=4,n=G_(qy),r=n(a),o=r.stream;return r.lobes=function(t){return arguments.length?n(a=+t):a},r.stream=function(t){var n=r.rotate(),e=o(t),i=(r.rotate([0,0]),o(t));return r.rotate(n),e.sphere=function(){var t,n;p0((t=180/a,n=[].concat(jt(-180,180+t/2,t).map($y),jt(180,-180-t/2,-t).map(Vy)),{type:"Polygon",coordinates:[180===t?n.map(Yy):n]}),i)},e},r.scale(239.75)},geoHealpixRaw:qy,geoHill:function(){var n=1,e=G_(Zy),t=e(n);return t.ratio=function(t){return arguments.length?e(n=+t):n},t.scale(167.774).center([0,18.67])},geoHillRaw:Zy,geoHomolosine:function(){return d(tv).scale(152.63)},geoHomolosineRaw:tv,geoHufnagel:function(){var n=1,e=0,i=45*x,a=2,r=G_(nv),t=r(n,e,i,a);return t.a=function(t){return arguments.length?r(n=+t,e,i,a):n},t.b=function(t){return arguments.length?r(n,e=+t,i,a):e},t.psiMax=function(t){return arguments.length?r(n,e,i=+t*x,a):i*m},t.ratio=function(t){return arguments.length?r(n,e,i,a=+t):a},t.scale(180.739)},geoHufnagelRaw:nv,geoHyperelliptical:function(){var n=0,e=2.5,i=1.183136,a=G_(iv),t=a(n,e,i);return t.alpha=function(t){return arguments.length?a(n=+t,e,i):n},t.k=function(t){return arguments.length?a(n,e=+t,i):e},t.gamma=function(t){return arguments.length?a(n,e,i=+t):i},t.scale(152.63)},geoHyperellipticalRaw:iv,geoInterrupt:rv,geoInterruptedBoggs:function(){return rv(Xm,ov).scale(160.857)},geoInterruptedHomolosine:function(){return rv(tv,sv).scale(152.63)},geoInterruptedMollweide:function(){return rv(Ym,lv).scale(169.529)},geoInterruptedMollweideHemispheres:function(){return rv(Ym,hv).scale(169.529).rotate([20,0])},geoInterruptedQuarticAuthalic:function(){return rv(Gm(1/0),Bv).rotate([20,0]).scale(152.63)},geoInterruptedSinuMollweide:function(){return rv(Qy,uv,Wm).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},geoInterruptedSinusoidal:function(){return rv(Qm,cv).scale(152.63).rotate([-20,0])},geoKavrayskiy7:function(){return d(gv).scale(158.837)},geoKavrayskiy7Raw:gv,geoLagrange:function(){var n=.5,e=G_(dv),t=e(n);return t.spacing=function(t){return arguments.length?e(n=+t):n},t.scale(124.75)},geoLagrangeRaw:dv,geoLarrivee:function(){return d(pv).scale(97.2672)},geoLarriveeRaw:pv,geoLaskowski:function(){return d(_v).scale(139.98)},geoLaskowskiRaw:_v,geoLittrow:function(){return d(mv).scale(144.049).clipAngle(89.999)},geoLittrowRaw:mv,geoLoximuthal:function(){return Jm(yv).parallel(40).scale(158.837)},geoLoximuthalRaw:yv,geoMiller:function(){return d(vv).scale(108.318)},geoMillerRaw:vv,geoModifiedStereographic:Mv,geoModifiedStereographicAlaska:function(){return Mv(xv,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)},geoModifiedStereographicGs48:function(){return Mv(wv,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},geoModifiedStereographicGs50:function(){return Mv(Sv,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},geoModifiedStereographicLee:function(){return Mv(Cv,[165,10]).scale(250).clipAngle(130).center([-165,-10])},geoModifiedStereographicMiller:function(){return Mv(kv,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},geoModifiedStereographicRaw:bv,geoMollweide:function(){return d(Ym).scale(169.529)},geoMollweideRaw:Ym,geoMtFlatPolarParabolic:function(){return d(Tv).scale(164.859)},geoMtFlatPolarParabolicRaw:Tv,geoMtFlatPolarQuartic:function(){return d(Ev).scale(188.209)},geoMtFlatPolarQuarticRaw:Ev,geoMtFlatPolarSinusoidal:function(){return d(Nv).scale(166.518)},geoMtFlatPolarSinusoidalRaw:Nv,geoNaturalEarth2:function(){return d(Pv).scale(175.295)},geoNaturalEarth2Raw:Pv,geoNellHammer:function(){return d(Lv).scale(152.63)},geoNellHammerRaw:Lv,geoNicolosi:function(){return d(Ov).scale(127.267)},geoNicolosiRaw:Ov,geoPatterson:function(){return d(Hv).scale(139.319)},geoPattersonRaw:Hv,geoPeirceQuincuncial:function(){return f2(Hy).scale(111.48)},geoPolyconic:function(){return d(Gv).scale(103.74)},geoPolyconicRaw:Gv,geoPolyhedral:Vv,geoPolyhedralButterfly:function(n){n=n||function(t){t=N1({type:"MultiPoint",coordinates:t});return cm().scale(1).translate([0,0]).rotate([-t[0],-t[1]])};var e=t2.map(function(t){return{face:t,project:n(t)}});return[-1,0,0,1,0,1,4,5].forEach(function(t,n){t=e[t];t&&(t.children||(t.children=[])).push(e[n])}),Vv(e[0],function(t,n){return e[t<-j/2?n<0?6:4:t<0?n<0?2:0:t<j/2?n<0?3:1:n<0?7:5]}).angle(-30).scale(101.858).center([0,45])},geoPolyhedralCollignon:function(n){n=n||function(t){t=N1({type:"MultiPoint",coordinates:t});return d(e2).translate([0,0]).scale(1).rotate(0<t[1]?[-t[0],0]:[180-t[0],180])};var e=t2.map(function(t){return{face:t,project:n(t)}});return[-1,0,0,1,0,1,4,5].forEach(function(t,n){t=e[t];t&&(t.children||(t.children=[])).push(e[n])}),Vv(e[0],function(t,n){return e[t<-j/2?n<0?6:4:t<0?n<0?2:0:t<j/2?n<0?3:1:n<0?7:5]}).angle(-30).scale(121.906).center([0,48.5904])},geoPolyhedralWaterman:function(n){n=n||function(t){t=6===t.length?N1({type:"MultiPoint",coordinates:t}):t[0];return cm().scale(1).translate([0,0]).rotate([-t[0],-t[1]])};var l=t2.map(function(t){for(var n,e=t.map(r2),i=e.length,a=e[i-1],r=[],o=0;o<i;++o)n=e[o],r.push(a2([.9486832980505138*a[0]+.31622776601683794*n[0],.9486832980505138*a[1]+.31622776601683794*n[1],.9486832980505138*a[2]+.31622776601683794*n[2]]),a2([.9486832980505138*n[0]+.31622776601683794*a[0],.9486832980505138*n[1]+.31622776601683794*a[1],.9486832980505138*n[2]+.31622776601683794*a[2]])),a=n;return r}),h=[],u=[-1,0,0,1,0,1,4,5],i=(l.forEach(function(t,n){for(var e,i,a=t2[n],r=a.length,o=h[n]=[],s=0;s<r;++s)l.push([a[s],t[(2*s+2)%(2*r)],t[(2*s+1)%(2*r)]]),u.push(n),o.push((e=r2(t[(2*s+2)%(2*r)]),i=r2(t[(2*s+1)%(2*r)]),[e[1]*i[2]-e[2]*i[1],e[2]*i[0]-e[0]*i[2],e[0]*i[1]-e[1]*i[0]]))}),l.map(function(t){return{project:n(t),face:t}}));return u.forEach(function(t,n){t=i[t];t&&(t.children||(t.children=[])).push(i[n])}),Vv(i[0],function(t,n){var e=[(e=B(n))*B(t),e*O(t),O(n)];return i[i2((n=h[t=t<-j/2?n<0?6:4:t<0?n<0?2:0:t<j/2?n<0?3:1:n<0?7:5])[0],e)<0?8+3*t:i2(n[1],e)<0?8+3*t+1:i2(n[2],e)<0?8+3*t+2:t]}).angle(-30).scale(110.625).center([0,45])},geoProject:function(t,n){var e;if(!(n=n.stream))throw new Error("invalid projection");switch(t&&t.type){case"Feature":e=s2;break;case"FeatureCollection":e=o2;break;default:e=l2}return e(t,n)},geoQuantize:function(t,a){if(!(0<=(a=+a)&&a<=20))throw new Error("invalid digits");function r(t){var n=t.length,e=2,i=new Array(n);for(i[0]=+t[0].toFixed(a),i[1]=+t[1].toFixed(a);e<n;)i[e]=t[e],++e;return i}function e(t){for(var n=r(t[0]),e=[n],i=1;i<t.length;i++){var a=r(t[i]);(2<a.length||a[0]!=n[0]||a[1]!=n[1])&&(e.push(a),n=a)}return 1===e.length&&1<t.length&&e.push(r(t[t.length-1])),e}function i(t){return t.map(e)}function o(t){if(null==t)return t;var n;switch(t.type){case"GeometryCollection":n={type:"GeometryCollection",geometries:t.geometries.map(o)};break;case"Point":n={type:"Point",coordinates:r(t.coordinates)};break;case"MultiPoint":n={type:t.type,coordinates:t.coordinates.map(r)};break;case"LineString":n={type:t.type,coordinates:e(t.coordinates)};break;case"MultiLineString":case"Polygon":n={type:t.type,coordinates:i(t.coordinates)};break;case"MultiPolygon":n={type:"MultiPolygon",coordinates:t.coordinates.map(i)};break;default:return t}return null!=t.bbox&&(n.bbox=t.bbox),n}function n(t){var n={type:"Feature",properties:t.properties,geometry:o(t.geometry)};return null!=t.id&&(n.id=t.id),null!=t.bbox&&(n.bbox=t.bbox),n}if(null!=t)switch(t.type){case"Feature":return n(t);case"FeatureCollection":var s={type:"FeatureCollection",features:t.features.map(n)};return null!=t.bbox&&(s.bbox=t.bbox),s;default:return o(t)}return t},geoQuincuncial:f2,geoRectangularPolyconic:function(){return Jm(p2).scale(131.215)},geoRectangularPolyconicRaw:p2,geoRobinson:function(){return d(m2).scale(152.63)},geoRobinsonRaw:m2,geoSatellite:function(){var n=2,e=0,i=G_(y2),t=i(n,e);
|
|
5486
5486
|
// As a multiple of radius.
|
|
5487
|
-
return t.distance=function(t){return arguments.length?i(n=+t,e):n},t.tilt=function(t){return arguments.length?i(n,e=t*x):e*m},t.scale(432.147).clipAngle(Nm(1/n)*m-1e-6)},geoSatelliteRaw:y2,geoSinuMollweide:function(){return d(Qy).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},geoSinuMollweideRaw:Qy,geoSinusoidal:function(){return d(Qm).scale(152.63)},geoSinusoidalRaw:Qm,geoStitch:function(t){if(null==t)return t;switch(t.type){case"Feature":return
|
|
5487
|
+
return t.distance=function(t){return arguments.length?i(n=+t,e):n},t.tilt=function(t){return arguments.length?i(n,e=t*x):e*m},t.scale(432.147).clipAngle(Nm(1/n)*m-1e-6)},geoSatelliteRaw:y2,geoSinuMollweide:function(){return d(Qy).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},geoSinuMollweideRaw:Qy,geoSinusoidal:function(){return d(Qm).scale(152.63)},geoSinusoidalRaw:Qm,geoStitch:function(t){if(null==t)return t;switch(t.type){case"Feature":return B2(t);case"FeatureCollection":var n={type:"FeatureCollection",features:t.features.map(B2)};return null!=t.bbox&&(n.bbox=t.bbox),n;default:return O2(t)}},geoTimes:function(){return d(D2).scale(146.153)},geoTimesRaw:D2,geoTwoPointAzimuthal:F2,geoTwoPointAzimuthalRaw:R2,geoTwoPointAzimuthalUsa:function(){return F2([-158,21.5],[-77,39]).clipAngle(60).scale(400)},geoTwoPointEquidistant:H2,geoTwoPointEquidistantRaw:I2,geoTwoPointEquidistantUsa:function(){return H2([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},geoVanDerGrinten:function(){return d(G2).scale(79.4183)},geoVanDerGrinten2:function(){return d(K2).scale(79.4183)},geoVanDerGrinten2Raw:K2,geoVanDerGrinten3:function(){return d(U2).scale(79.4183)},geoVanDerGrinten3Raw:U2,geoVanDerGrinten4:function(){return d(W2).scale(127.16)},geoVanDerGrinten4Raw:W2,geoVanDerGrintenRaw:G2,geoWagner:$2,geoWagner4:function(){return d(V2).scale(176.84)},geoWagner4Raw:V2,geoWagner6:function(){return d(Y2).scale(152.63)},geoWagner6Raw:Y2,geoWagner7:function(){return $2().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)},geoWagnerRaw:q2,geoWiechel:function(){return d(Z2).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},geoWiechelRaw:Z2,geoWinkel3:function(){return d(X2).scale(158.837)},geoWinkel3Raw:X2}),G=1e-6;
|
|
5488
5488
|
// https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Modules/mathmodule.c#L1423
|
|
5489
5489
|
class Q2{add(n){var e=this._partials;let i=0;for(let t=0;t<this._n&&t<32;t++){var a=e[t],r=n+a,a=Math.abs(n)<Math.abs(a)?n-(r-a):a-(r-n);a&&(e[i++]=a),n=r}return e[i]=n,this._n=i+1,this}valueOf(){var t=this._partials;let n=this._n,e,i,a,r=0;if(0<n){for(r=t[--n];0<n&&(e=r,i=t[--n],r=e+i,!(a=i-(r-e))););0<n&&(a<0&&t[n-1]<0||0<a&&0<t[n-1])&&(i=2*a,e=r+i,i==e-r)&&(r=e)}return r}constructor(){this._partials=new Float64Array(32),this._n=0}}function t3(t){return Array.from(function*(t){for(var n of t)yield*n}(t))}var n3=1e-6,K=Math.PI,e3=K/2,i3=K/4,a3=2*K,r3=180/K,o3=K/180,s3=Math.abs,l3=Math.atan,h3=Math.atan2,u3=Math.cos,c3=Math.exp,g3=Math.log,d3=Math.pow,U=Math.sin,f3=Math.sign||function(t){return 0<t?1:t<0?-1:0},p3=Math.sqrt,_3=Math.tan;function m3(t){return 1<t?e3:t<-1?-e3:Math.asin(t)}function y3(){}function v3(t,n){t&&x3.hasOwnProperty(t.type)&&x3[t.type](t,n)}var b3={Feature:function(t,n){v3(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,i=-1,a=e.length;++i<a;)v3(e[i].geometry,n)}},x3={Sphere:function(t,n){n.sphere()},Point:function(t,n){t=t.coordinates,n.point(t[0],t[1],t[2])},MultiPoint:function(t,n){for(var e=t.coordinates,i=-1,a=e.length;++i<a;)t=e[i],n.point(t[0],t[1],t[2])},LineString:function(t,n){w3(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,i=-1,a=e.length;++i<a;)w3(e[i],n,0)},Polygon:function(t,n){S3(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,i=-1,a=e.length;++i<a;)S3(e[i],n)},GeometryCollection:function(t,n){for(var e=t.geometries,i=-1,a=e.length;++i<a;)v3(e[i],n)}};function w3(t,n,e){var i,a=-1,r=t.length-e;for(n.lineStart();++a<r;)i=t[a],n.point(i[0],i[1],i[2]);n.lineEnd()}function S3(t,n){var e=-1,i=t.length;for(n.polygonStart();++e<i;)w3(t[e],n,1);n.polygonEnd()}function k3(t,n){t&&b3.hasOwnProperty(t.type)?b3[t.type](t,n):v3(t,n)}function C3(t){return[h3(t[1],t[0]),m3(t[2])]}function M3(t){var n=t[0],t=t[1],e=u3(t);return[e*u3(n),e*U(n),U(t)]}function A3(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function z3(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}
|
|
5490
5490
|
// TODO return a
|
|
5491
5491
|
function T3(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function E3(t,n){return[t[0]*n,t[1]*n,t[2]*n]}
|
|
5492
5492
|
// TODO return d
|
|
5493
|
-
function N3(t){var n=p3(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}function P3(e,i){function t(t,n){return t=e(t,n),i(t[0],t[1])}return e.invert&&i.invert&&(t.invert=function(t,n){return(t=i.invert(t,n))&&e.invert(t[0],t[1])}),t}function
|
|
5493
|
+
function N3(t){var n=p3(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}function P3(e,i){function t(t,n){return t=e(t,n),i(t[0],t[1])}return e.invert&&i.invert&&(t.invert=function(t,n){return(t=i.invert(t,n))&&e.invert(t[0],t[1])}),t}function L3(t,n){return[s3(t)>K?t+Math.round(-t/a3)*a3:t,n]}function B3(t,n,e){return(t%=a3)?n||e?P3(D3(t),j3(n,e)):D3(t):n||e?j3(n,e):L3}function O3(e){return function(t,n){return[K<(t+=e)?t-a3:t<-K?t+a3:t,n]}}function D3(t){var n=O3(t);return n.invert=O3(-t),n}function j3(t,n){var a=u3(t),r=U(t),o=u3(n),s=U(n);function e(t,n){var e=u3(n),i=u3(t)*e,t=U(t)*e,e=U(n),n=e*a+i*r;return[h3(t*o-n*s,i*a-e*r),m3(n*o+t*s)]}return e.invert=function(t,n){var e=u3(n),i=u3(t)*e,t=U(t)*e,e=U(n),n=e*o-t*s;return[h3(t*o+e*s,i*a+n*r),m3(n*a-i*r)]},e}
|
|
5494
5494
|
// Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0].
|
|
5495
|
-
function R3(t,n){(n=M3(n))[0]-=t,N3(n);t=1<(t=-n[1])?0:t<-1?K:Math.acos(t);return((-n[2]<0?-t:t)+a3-n3)%a3}function
|
|
5495
|
+
function R3(t,n){(n=M3(n))[0]-=t,N3(n);t=1<(t=-n[1])?0:t<-1?K:Math.acos(t);return((-n[2]<0?-t:t)+a3-n3)%a3}function F3(){var i,n=[];return{point:function(t,n,e){i.push([t,n,e])},lineStart:function(){n.push(i=[])},lineEnd:y3,rejoin:function(){1<n.length&&n.push(n.pop().concat(n.shift()))},result:function(){var t=n;return n=[],i=null,t}}}function I3(t,n){return s3(t[0]-n[0])<n3&&s3(t[1]-n[1])<n3}function H3(t,n,e,i){this.x=t,this.z=n,this.o=e,// another intersection
|
|
5496
5496
|
this.e=i,// is an entry?
|
|
5497
5497
|
this.v=!1,// visited
|
|
5498
5498
|
this.n=this.p=null}
|
|
5499
5499
|
// A generalized polygon clipping algorithm: given a polygon that has been cut
|
|
5500
5500
|
// into its visible line segments, and rejoins the segments by interpolating
|
|
5501
5501
|
// along the clip edge.
|
|
5502
|
-
function G3(t,n,e,i,r){var o,a,s=[],l=[];if(t.forEach(function(t){if(!((n=t.length-1)<=0)){var n,e,i=t[0],a=t[n];if(
|
|
5502
|
+
function G3(t,n,e,i,r){var o,a,s=[],l=[];if(t.forEach(function(t){if(!((n=t.length-1)<=0)){var n,e,i=t[0],a=t[n];if(I3(i,a)){if(!i[2]&&!a[2]){for(r.lineStart(),o=0;o<n;++o)r.point((i=t[o])[0],i[1]);return void r.lineEnd()}
|
|
5503
5503
|
// handle degenerate cases by moving the point
|
|
5504
5504
|
a[0]+=2*n3}s.push(e=new H3(i,t,null,!0)),l.push(e.o=new H3(i,null,e,!1)),s.push(e=new H3(a,t,null,!1)),l.push(e.o=new H3(a,null,e,!0))}}),s.length){for(l.sort(n),K3(s),K3(l),o=0,a=l.length;o<a;++o)l[o].e=e=!e;for(var h,u,c=s[0];;){for(
|
|
5505
5505
|
// Find first unvisited intersection.
|
|
5506
|
-
var g=c,d=!0;g.v;)if((g=g.n)===c)return;h=g.z,r.lineStart();do{if(g.v=g.o.v=!0,g.e){if(d)for(o=0,a=h.length;o<a;++o)r.point((u=h[o])[0],u[1]);else i(g.x,g.n.x,1,r);g=g.n}else{if(d)for(h=g.p.z,o=h.length-1;0<=o;--o)r.point((u=h[o])[0],u[1]);else i(g.x,g.p.x,-1,r);g=g.p}}while(h=(g=g.o).z,d=!d,!g.v);r.lineEnd()}}}function K3(t){if(n=t.length){for(var n,e,i=0,a=t[0];++i<n;)a.n=e=t[i],e.p=a,a=e;a.n=e=t[0],e.p=a}}function U3(t){return s3(t[0])<=K?t[0]:f3(t[0])*((s3(t[0])+K)%a3-K)}function W3(_,m,y,v){return function(s){var l,h,u,e=m(s),c=
|
|
5506
|
+
var g=c,d=!0;g.v;)if((g=g.n)===c)return;h=g.z,r.lineStart();do{if(g.v=g.o.v=!0,g.e){if(d)for(o=0,a=h.length;o<a;++o)r.point((u=h[o])[0],u[1]);else i(g.x,g.n.x,1,r);g=g.n}else{if(d)for(h=g.p.z,o=h.length-1;0<=o;--o)r.point((u=h[o])[0],u[1]);else i(g.x,g.p.x,-1,r);g=g.p}}while(h=(g=g.o).z,d=!d,!g.v);r.lineEnd()}}}function K3(t){if(n=t.length){for(var n,e,i=0,a=t[0];++i<n;)a.n=e=t[i],e.p=a,a=e;a.n=e=t[0],e.p=a}}function U3(t){return s3(t[0])<=K?t[0]:f3(t[0])*((s3(t[0])+K)%a3-K)}function W3(_,m,y,v){return function(s){var l,h,u,e=m(s),c=F3(),g=m(c),d=!1,n={point:i,lineStart:a,lineEnd:r,polygonStart:function(){n.point=f,n.lineStart=o,n.lineEnd=p,h=[],l=[]},polygonEnd:function(){n.point=i,n.lineStart=a,n.lineEnd=r,h=t3(h);var t=((t,n)=>{var e=U3(n),i=n[1],n=U(i),a=[U(e),-u3(e),0],r=0,o=0,s=new Q2;1===n?i=e3+n3:-1===n&&(i=-e3-n3);for(var l=0,h=t.length;l<h;++l)if(c=(u=t[l]).length)for(var u,c,g=u[c-1],d=U3(g),f=g[1]/2+i3,p=U(f),_=u3(f),m=0;m<c;++m,d=v,p=x,_=b,g=y){var y=u[m],v=U3(y),b=y[1]/2+i3,x=U(b),b=u3(b),w=v-d,S=0<=w?1:-1,k=S*w,C=K<k,M=p*x;s.add(h3(M*S*U(k),_*b+M*u3(k))),r+=C?w+S*a3:w,
|
|
5507
5507
|
// Are the longitudes either side of the point’s meridian (lambda),
|
|
5508
5508
|
// and are the latitudes smaller than the parallel (phi)?
|
|
5509
5509
|
C^e<=d^e<=v&&(N3(M=z3(M3(g),M3(y))),N3(k=z3(a,M)),(S=(C^0<=w?-1:1)*m3(k[2]))<i||i===S&&(M[0]||M[1]))&&(o+=C^0<=w?1:-1)}
|
|
@@ -5525,7 +5525,7 @@ if(1&a){if(0<(n=(e=r[0]).length-1)){for(d||(s.polygonStart(),d=!0),s.lineStart()
|
|
|
5525
5525
|
1<o&&2&a&&r.push(r.pop().concat(r.shift())),h.push(r.filter(q3))}return n}}function q3(t){return 1<t.length}
|
|
5526
5526
|
// Intersections are sorted along the clip edge. For both antimeridian cutting
|
|
5527
5527
|
// and circle clipping, the same comparison is used.
|
|
5528
|
-
function $3(t,n){return((t=t.x)[0]<0?t[1]-e3-n3:e3-t[1])-((n=n.x)[0]<0?n[1]-e3-n3:e3-n[1])}
|
|
5528
|
+
function $3(t,n){return((t=t.x)[0]<0?t[1]-e3-n3:e3-t[1])-((n=n.x)[0]<0?n[1]-e3-n3:e3-n[1])}L3.invert=L3;var V3=W3(function(){return 1},
|
|
5529
5529
|
// Takes a line and cuts into visible segments. Return values: 0 - there were
|
|
5530
5530
|
// intersections or the line was empty; 1 - no intersections; 2 - there were
|
|
5531
5531
|
// intersections, and the first and last segments should be rejoined.
|
|
@@ -5551,21 +5551,21 @@ a=t[0],r=n[0],o=t[1],n=n[1],r<a&&(h=a,a=r,r=h),!(l=s3((s=r-a)-K)<n3)&&n<o&&(h=o,
|
|
|
5551
5551
|
function y(t,n){var e=c?d:K-d,i=0;// above
|
|
5552
5552
|
return t<-e?i|=1:e<t&&(i|=2),// right
|
|
5553
5553
|
n<-e?i|=4:e<n&&(i|=8),i}return W3(_,function(r){var o,s,l,h,u;// no intersections
|
|
5554
|
-
return{lineStart:function(){h=l=!1,u=1},point:function(t,n){var e,i=[t,n],a=_(t,n),t=c?a?0:y(t,n):a?y(t+(t<0?K:-K),n):0;!o&&(h=l=a)&&r.lineStart(),a===l||(e=m(o,i))&&!
|
|
5554
|
+
return{lineStart:function(){h=l=!1,u=1},point:function(t,n){var e,i=[t,n],a=_(t,n),t=c?a?0:y(t,n):a?y(t+(t<0?K:-K),n):0;!o&&(h=l=a)&&r.lineStart(),a===l||(e=m(o,i))&&!I3(o,e)&&!I3(i,e)||(i[2]=1),a!==l?(u=0,a?(
|
|
5555
5555
|
// outside going in
|
|
5556
5556
|
r.lineStart(),e=m(i,o),r.point(e[0],e[1])):(
|
|
5557
5557
|
// inside going out
|
|
5558
5558
|
e=m(o,i),r.point(e[0],e[1],2),r.lineEnd()),o=e):g&&o&&c^a&&(
|
|
5559
5559
|
// If the codes for two points are different, or are both zero,
|
|
5560
5560
|
// and there this segment intersects with the small circle.
|
|
5561
|
-
t&s||!(n=m(i,o,!0))||(u=0,c?(r.lineStart(),r.point(n[0][0],n[0][1]),r.point(n[1][0],n[1][1]),r.lineEnd()):(r.point(n[1][0],n[1][1]),r.lineEnd(),r.lineStart(),r.point(n[0][0],n[0][1],3)))),!a||o&&
|
|
5561
|
+
t&s||!(n=m(i,o,!0))||(u=0,c?(r.lineStart(),r.point(n[0][0],n[0][1]),r.point(n[1][0],n[1][1]),r.lineEnd()):(r.point(n[1][0],n[1][1]),r.lineEnd(),r.lineStart(),r.point(n[0][0],n[0][1],3)))),!a||o&&I3(o,i)||r.point(i[0],i[1]),o=i,l=a,s=t},lineEnd:function(){l&&r.lineEnd(),o=null},
|
|
5562
5562
|
// Rejoin first and last segments if there were intersections and the first
|
|
5563
5563
|
// and last points were visible.
|
|
5564
5564
|
clean:function(){return u|(h&&l)<<1}}},function(t,n,e,i){var a=i,i=d,r=f,o=e,e=t,s=n;if(r){var l=u3(i),h=U(i),u=o*r;null==e?(e=i+o*a3,s=i-u/2):(e=R3(l,e),s=R3(l,s),(0<o?e<s:s<e)&&(e+=o*a3));for(var c,g=e;0<o?s<g:g<s;g-=u)c=C3([l,-h*u3(g),-h*U(g)]),a.point(c[0],c[1])}},c?[0,-d]:[-K,d-K])}var Z3=1e9,X3=-1e9;
|
|
5565
5565
|
// TODO Use d3-polygon’s polygonContains here for the ring check?
|
|
5566
5566
|
// TODO Eliminate duplicate buffering in clipBuffer and polygon.push?
|
|
5567
5567
|
function J3(m,y,v,b){function x(t,n){return m<=t&&t<=v&&y<=n&&n<=b}function w(t,n,e,i){var a=0,r=0;if(null==t||(a=o(t,e))!==(r=o(n,e))||s(t,n)<0^0<e)for(;i.point(0===a||3===a?m:v,1<a?b:y),(a=(a+e+4)%4)!==r;);else i.point(n[0],n[1])}function o(t,n){return s3(t[0]-m)<n3?0<n?0:3:s3(t[0]-v)<n3?0<n?2:1:s3(t[1]-y)<n3?0<n?1:0:0<n?3:2;// abs(p[1] - y1) < epsilon
|
|
5568
|
-
}function S(t,n){return s(t.x,n.x)}function s(t,n){var e=o(t,1),i=o(n,1);return e!==i?e-i:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(i){var a,c,r,o,s,l,h,u,g,d,f,p=i,t=
|
|
5568
|
+
}function S(t,n){return s(t.x,n.x)}function s(t,n){var e=o(t,1),i=o(n,1);return e!==i?e-i:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(i){var a,c,r,o,s,l,h,u,g,d,f,p=i,t=F3(),n={point:e,lineStart:function(){n.point=_,c&&c.push(r=[]);d=!0,g=!1,h=u=NaN}
|
|
5569
5569
|
// TODO rather than special-case polygons, simply handle them separately.
|
|
5570
5570
|
// Ideally, coincident intersection points should be jittered to avoid
|
|
5571
5571
|
// clipping issues.
|
|
@@ -5573,10 +5573,10 @@ function J3(m,y,v,b){function x(t,n){return m<=t&&t<=v&&y<=n&&n<=b}function w(t,
|
|
|
5573
5573
|
// Buffer geometry within a polygon and then clip it en masse.
|
|
5574
5574
|
function(){p=t,a=[],c=[],f=!0},polygonEnd:function(){var t=(()=>{for(var t=0,n=0,e=c.length;n<e;++n)for(var i,a,r=c[n],o=1,s=r.length,l=r[0],h=l[0],u=l[1];o<s;++o)i=h,a=u,l=r[o],h=l[0],u=l[1],a<=b?b<u&&(u-a)*(m-i)<(h-i)*(b-a)&&++t:u<=b&&(h-i)*(b-a)<(u-a)*(m-i)&&--t;return t})(),n=f&&t,e=(a=t3(a)).length;(n||e)&&(i.polygonStart(),n&&(i.lineStart(),w(null,null,1,i),i.lineEnd()),e&&G3(a,S,t,w,i),i.polygonEnd());p=i,a=c=r=null}};function e(t,n){x(t,n)&&p.point(t,n)}function _(t,n){var e,i,a=x(t,n);c&&r.push([t,n]),d?(o=t,s=n,d=!1,(l=a)&&(p.lineStart(),p.point(t,n))):a&&g?p.point(t,n):((t,n,e,i,a,r)=>{var o=t[0],s=t[1],l=0,h=1,u=n[0]-o,c=n[1]-s,e=e-o;if(u||!(0<e)){if(e/=u,u<0){if(e<l)return;e<h&&(h=e)}else if(0<u){if(h<e)return;l<e&&(l=e)}if(e=a-o,u||!(e<0)){if(e/=u,u<0){if(h<e)return;l<e&&(l=e)}else if(0<u){if(e<l)return;e<h&&(h=e)}if(e=i-s,c||!(0<e)){if(e/=c,c<0){if(e<l)return;e<h&&(h=e)}else if(0<c){if(h<e)return;l<e&&(l=e)}if(e=r-s,c||!(e<0)){if(e/=c,c<0){if(h<e)return;l<e&&(l=e)}else if(0<c){if(e<l)return;e<h&&(h=e)}return 0<l&&(t[0]=o+l*u,t[1]=s+l*c),h<1&&(n[0]=o+h*u,n[1]=s+h*c),1}}}}})(e=[h=Math.max(X3,Math.min(Z3,h)),u=Math.max(X3,Math.min(Z3,u))],i=[t=Math.max(X3,Math.min(Z3,t)),n=Math.max(X3,Math.min(Z3,n))],m,y,v,b)?(g||(p.lineStart(),p.point(e[0],e[1])),p.point(i[0],i[1]),a||p.lineEnd(),f=!1):a&&(p.lineStart(),p.point(t,n),f=!1),h=t,u=n,g=a}return n}}var Q3=t=>t,tb=1/0,nb=tb,eb=-tb,ib=eb,ab={point:function(t,n){t<tb&&(tb=t);eb<t&&(eb=t);n<nb&&(nb=n);ib<n&&(ib=n)},lineStart:y3,lineEnd:y3,polygonStart:y3,polygonEnd:y3,result:function(){var t=[[tb,nb],[eb,ib]];return eb=ib=-(nb=tb=1/0),t}};function rb(i){return function(t){var n,e=new ob;for(n in i)e[n]=i[n];return e.stream=t,e}}function ob(){}function sb(t,n,e){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),k3(e,t.stream(ab)),n(ab.result()),null!=i&&t.clipExtent(i),t}function lb(a,r,t){return sb(a,function(t){var n=r[1][0]-r[0][0],e=r[1][1]-r[0][1],i=Math.min(n/(t[1][0]-t[0][0]),e/(t[1][1]-t[0][1])),n=+r[0][0]+(n-i*(t[1][0]+t[0][0]))/2,e=+r[0][1]+(e-i*(t[1][1]+t[0][1]))/2;a.scale(150*i).translate([n,e])},t)}ob.prototype={constructor:ob,point:function(t,n){this.stream.point(t,n)},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 hb=16,ub=u3(30*o3);// cos(minimum angular distance)
|
|
5575
5575
|
function cb(t,n){return+n?(A=t,z=n,function(i){var e,a,r,o,s,l,h,u,c,g,d,f,p={point:t,lineStart:n,lineEnd:m,polygonStart:function(){i.polygonStart(),p.lineStart=y},polygonEnd:function(){i.polygonEnd(),p.lineStart=n}};// previous point
|
|
5576
|
-
function t(t,n){t=A(t,n),i.point(t[0],t[1])}function n(){u=NaN,p.point=_,i.lineStart()}function _(t,n){var e=M3([t,n]),n=A(t,n);T(u,c,h,g,d,f,u=n[0],c=n[1],h=t,g=e[0],d=e[1],f=e[2],hb,i),i.point(u,c)}function m(){p.point=t,i.lineEnd()}function y(){n(),p.point=v,p.lineEnd=b}function v(t,n){_(e=t,n),a=u,r=c,o=g,s=d,l=f,p.point=_}function b(){T(u,c,h,g,d,f,a,r,e,o,s,l,hb,i),p.lineEnd=m,m()}return p}):(e=t,rb({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}}));var e,A,z;function T(t,n,e,i,a,r,o,s,l,h,u,c,g,d){var f,p,_,m,y,v,b,x,w,S,k=o-t,C=s-n,M=k*k+C*C;4*z<M&&g--&&(_=r+c,b=m3(_/=m=p3((f=i+h)*f+(p=a+u)*p+_*_)),y=s3(s3(_)-1)<n3||s3(e-l)<n3?(e+l)/2:h3(p,f),v=(b=A(y,b))[0],z<(S=C*(x=v-t)-k*(w=(b=b[1])-n))*S/M||.3<s3((k*x+C*w)/M-.5)||i*h+a*u+r*c<ub)&&(T(t,n,e,i,a,r,v,b,y,f/=m,p/=m,_,g,d),d.point(v,b),T(v,b,y,f,p,_,o,s,l,h,u,c,g,d))}}var gb,db=rb({point:function(t,n){this.stream.point(t*o3,n*o3)}});function fb(t,e,i,a,r,n){var o,s,l,h,u,c,g,d,f,p,_,m;return n?(c=u3(n),n=U(n),g=c*t,d=n*t,f=c/t,p=n/t,_=(n*i-c*e)/t,m=(n*e+c*i)/t,v.invert=function(t,n){return[a*(f*t-p*n+_),r*(m-p*t-f*n)]},v):(o=t,s=e,l=i,h=a,u=r,y.invert=function(t,n){return[(t-s)/o*h,(l-n)/o*u]},y);function y(t,n){return[s+o*(t*=h),l-o*(n*=u)]}function v(t,n){return[g*(t*=a)-d*(n*=r)+e,i-d*t-g*n]}}function pb(t){return _b(function(){return t})()}function _b(t){var n,i,e,a,r,o,s,l,h,u,c=150,g=480,d=250,f=0,p=0,_=0,m=0,y=0,v=0,b=1,x=1,w=null,S=V3,k=null,C=Q3,M=.5;function A(t){return l(t[0]*o3,t[1]*o3)}function z(t){return(t=l.invert(t[0],t[1]))&&[t[0]*r3,t[1]*r3]}function T(){var t=fb(c,0,0,b,x,v).apply(null,n(f,p)),t=fb(c,g-t[0],d-t[1],b,x,v);return i=
|
|
5576
|
+
function t(t,n){t=A(t,n),i.point(t[0],t[1])}function n(){u=NaN,p.point=_,i.lineStart()}function _(t,n){var e=M3([t,n]),n=A(t,n);T(u,c,h,g,d,f,u=n[0],c=n[1],h=t,g=e[0],d=e[1],f=e[2],hb,i),i.point(u,c)}function m(){p.point=t,i.lineEnd()}function y(){n(),p.point=v,p.lineEnd=b}function v(t,n){_(e=t,n),a=u,r=c,o=g,s=d,l=f,p.point=_}function b(){T(u,c,h,g,d,f,a,r,e,o,s,l,hb,i),p.lineEnd=m,m()}return p}):(e=t,rb({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}}));var e,A,z;function T(t,n,e,i,a,r,o,s,l,h,u,c,g,d){var f,p,_,m,y,v,b,x,w,S,k=o-t,C=s-n,M=k*k+C*C;4*z<M&&g--&&(_=r+c,b=m3(_/=m=p3((f=i+h)*f+(p=a+u)*p+_*_)),y=s3(s3(_)-1)<n3||s3(e-l)<n3?(e+l)/2:h3(p,f),v=(b=A(y,b))[0],z<(S=C*(x=v-t)-k*(w=(b=b[1])-n))*S/M||.3<s3((k*x+C*w)/M-.5)||i*h+a*u+r*c<ub)&&(T(t,n,e,i,a,r,v,b,y,f/=m,p/=m,_,g,d),d.point(v,b),T(v,b,y,f,p,_,o,s,l,h,u,c,g,d))}}var gb,db=rb({point:function(t,n){this.stream.point(t*o3,n*o3)}});function fb(t,e,i,a,r,n){var o,s,l,h,u,c,g,d,f,p,_,m;return n?(c=u3(n),n=U(n),g=c*t,d=n*t,f=c/t,p=n/t,_=(n*i-c*e)/t,m=(n*e+c*i)/t,v.invert=function(t,n){return[a*(f*t-p*n+_),r*(m-p*t-f*n)]},v):(o=t,s=e,l=i,h=a,u=r,y.invert=function(t,n){return[(t-s)/o*h,(l-n)/o*u]},y);function y(t,n){return[s+o*(t*=h),l-o*(n*=u)]}function v(t,n){return[g*(t*=a)-d*(n*=r)+e,i-d*t-g*n]}}function pb(t){return _b(function(){return t})()}function _b(t){var n,i,e,a,r,o,s,l,h,u,c=150,g=480,d=250,f=0,p=0,_=0,m=0,y=0,v=0,b=1,x=1,w=null,S=V3,k=null,C=Q3,M=.5;function A(t){return l(t[0]*o3,t[1]*o3)}function z(t){return(t=l.invert(t[0],t[1]))&&[t[0]*r3,t[1]*r3]}function T(){var t=fb(c,0,0,b,x,v).apply(null,n(f,p)),t=fb(c,g-t[0],d-t[1],b,x,v);return i=B3(_,m,y),s=P3(n,t),l=P3(i,s),o=cb(s,M),E()}function E(){return h=u=null,A}return A.stream=function(t){return h&&u===t?h:h=db((e=i,rb({point:function(t,n){t=e(t,n);return this.stream.point(t[0],t[1])}})(S(o(C(u=t))))));var e},A.preclip=function(t){return arguments.length?(S=t,w=void 0,E()):S},A.postclip=function(t){return arguments.length?(C=t,k=e=a=r=null,E()):C},A.clipAngle=function(t){return arguments.length?(S=+t?Y3(w=t*o3):(w=null,V3),E()):w*r3},A.clipExtent=function(t){return arguments.length?(C=null==t?(k=e=a=r=null,Q3):J3(k=+t[0][0],e=+t[0][1],a=+t[1][0],r=+t[1][1]),E()):null==k?null:[[k,e],[a,r]]},A.scale=function(t){return arguments.length?(c=+t,T()):c},A.translate=function(t){return arguments.length?(g=+t[0],d=+t[1],T()):[g,d]},A.center=function(t){return arguments.length?(f=t[0]%360*o3,p=t[1]%360*o3,T()):[f*r3,p*r3]},A.rotate=function(t){return arguments.length?(_=t[0]%360*o3,m=t[1]%360*o3,y=2<t.length?t[2]%360*o3:0,T()):[_*r3,m*r3,y*r3]},A.angle=function(t){return arguments.length?(v=t%360*o3,T()):v*r3},A.reflectX=function(t){return arguments.length?(b=t?-1:1,T()):b<0},A.reflectY=function(t){return arguments.length?(x=t?-1:1,T()):x<0},A.precision=function(t){return arguments.length?(o=cb(s,M=t*t),E()):p3(M)},A.fitExtent=function(t,n){return lb(A,t,n)},A.fitSize=function(t,n){return lb(A,[[0,0],t],n)},A.fitWidth=function(t,n){return a=t,sb(i=A,function(t){var n=+a,e=n/(t[1][0]-t[0][0]),n=(n-e*(t[1][0]+t[0][0]))/2,t=-e*t[0][1];i.scale(150*e).translate([n,t])},n);var i,a},A.fitHeight=function(t,n){return r=t,sb(a=A,function(t){var n=+r,e=n/(t[1][1]-t[0][1]),i=-e*t[0][0],n=(n-e*(t[1][1]+t[0][1]))/2;a.scale(150*e).translate([i,n])},n);var a,r},function(){return n=t.apply(this,arguments),A.invert=n.invert&&z,T()}}function mb(t){var n=0,e=K/3,i=_b(t),t=i(n,e);return t.parallels=function(t){return arguments.length?i(n=t[0]*o3,e=t[1]*o3):[n*r3,e*r3]},t}function yb(t,n){var e,i,a,r=U(t),o=(r+U(n))/2;
|
|
5577
5577
|
// Are the parallels symmetrical around the Equator?
|
|
5578
5578
|
return s3(o)<n3?(e=u3(t),s.invert=function(t,n){return[t/e,m3(n*e)]},s):(a=p3(i=1+r*(2*o-r))/o,l.invert=function(t,n){var n=a-n,e=h3(t,s3(n))*f3(n);return n*o<0&&(e-=K*f3(t)*f3(n)),[e/o,m3((i-(t*t+n*n)*o*o)/(2*o))]},l);function s(t,n){return[t*e,U(n)/e]}function l(t,n){n=p3(i-2*o*U(n))/o;return[n*U(t*=o),a-n*u3(t)]}}function vb(){return mb(yb).scale(155.424).center([0,33.6442])}function bb(){return vb().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function xb(t,n){return[t,g3(_3((e3+n)/2))]}function wb(){return Sb(xb).scale(961/a3)}function Sb(i){var a,r,o,s=pb(i),n=s.center,l=s.scale,e=s.translate,h=s.clipExtent,u=null;// clip extent
|
|
5579
|
-
function c(){var n,t=K*l(),e=s((n=
|
|
5579
|
+
function c(){var n,t=K*l(),e=s((n=B3((n=s.rotate())[0]*o3,n[1]*o3,2<n.length?n[2]*o3:0),function(t){return(t=n.invert(t[0]*o3,t[1]*o3))[0]*=r3,t[1]*=r3,t}([0,0])));return h(null==u?[[e[0]-t,e[1]-t],[e[0]+t,e[1]+t]]:i===xb?[[Math.max(e[0]-t,u),a],[Math.min(e[0]+t,r),o]]:[[u,Math.max(e[1]-t,a)],[r,Math.min(e[1]+t,o)]])}return s.scale=function(t){return(arguments.length?(l(t),c):l)()},s.translate=function(t){return(arguments.length?(e(t),c):e)()},s.center=function(t){return(arguments.length?(n(t),c):n)()},s.clipExtent=function(t){return arguments.length?(null==t?u=a=r=o=null:(u=+t[0][0],a=+t[0][1],r=+t[1][0],o=+t[1][1]),c()):null==u?null:[[u,a],[r,o]]},c()}function kb(t){return _3((e3+t)/2)}function Cb(t,n){var e=u3(t),a=t===n?U(t):g3(e/u3(n))/g3(kb(n)/kb(t)),r=e*d3(kb(t),a)/a;return a?(i.invert=function(t,n){var n=r-n,e=f3(a)*p3(t*t+n*n),i=h3(t,s3(n))*f3(n);return n*a<0&&(i-=K*f3(t)*f3(n)),[i/a,2*l3(d3(r/e,1/a))-e3]},i):xb;function i(t,n){0<r?n<-e3+n3&&(n=-e3+n3):e3-n3<n&&(n=e3-n3);n=r/d3(kb(n),a);return[n*U(a*t),r-n*u3(a*t)]}}function Mb(){return mb(Cb).scale(109.5).parallels([30,30])}function Ab(t,n){return[t,n]}function zb(){return pb(Ab).scale(152.63)}function Tb(t,n){var e=u3(t),i=t===n?U(t):(e-u3(n))/(n-t),a=e/i+t;return s3(i)<n3?Ab:(r.invert=function(t,n){var n=a-n,e=h3(t,s3(n))*f3(n);return n*i<0&&(e-=K*f3(t)*f3(n)),[e/i,a-f3(i)*p3(t*t+n*n)]},r);function r(t,n){n=a-n,t*=i;return[n*U(t),a-n*u3(t)]}}function Eb(){return mb(Tb).scale(131.154).center([0,13.9389])}function Nb(t,n){var e=u3(n),i=1+u3(t)*e;return[e*U(t)/i,U(n)/i]}function Pb(t,n){return[g3(_3((e3+n)/2)),-t]}function Lb(){}xb.invert=function(t,n){return[t,2*l3(c3(n))-e3]},Ab.invert=Ab,Nb.invert=(gb=function(t){return 2*l3(t)},function(t,n){var e=p3(t*t+n*n),i=gb(e),a=U(i),i=u3(i);return[h3(t*a,e*i),m3(e&&n*a/e)]}),Pb.invert=function(t,n){return[-n,2*l3(c3(t))-e3]};var Bb=1/0,Ob=Bb,Db=-Bb,jb=Db,Rb={point:function(t,n){t<Bb&&(Bb=t);Db<t&&(Db=t);n<Ob&&(Ob=n);jb<n&&(jb=n)},lineStart:Lb,lineEnd:Lb,polygonStart:Lb,polygonEnd:Lb,result:function(){var t=[[Bb,Ob],[Db,jb]];return Db=jb=-(Ob=Bb=1/0),t}};function Fb(t,n,e){var i=n[1][0]-n[0][0],a=n[1][1]-n[0][1],r=t.clipExtent&&t.clipExtent(),e=(t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),k3(e,t.stream(Rb)),Rb.result()),o=Math.min(i/(e[1][0]-e[0][0]),a/(e[1][1]-e[0][1])),i=+n[0][0]+(i-o*(e[1][0]+e[0][0]))/2,n=+n[0][1]+(a-o*(e[1][1]+e[0][1]))/2;return null!=r&&t.clipExtent(r),t.scale(150*o).translate([i,n])}function Ib(t,n,e){return Fb(t,[[0,0],n],e)}let Hb=Math.PI,Gb=2*Hb,Kb=1e-6,Ub=Gb-Kb;function Wb(){this._x0=this._y0=this._x1=this._y1=null,// end of current subpath
|
|
5580
5580
|
this._=""}function qb(){return new Wb}Wb.prototype=qb.prototype={constructor:Wb,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,e,i){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+i)},bezierCurveTo:function(t,n,e,i,a,r){this._+="C"+ +t+","+ +n+","+ +e+","+ +i+","+(this._x1=+a)+","+(this._y1=+r)},arcTo:function(t,n,e,i,a){var r,o,s=this._x1,l=this._y1,h=(e=+e)-(t=+t),u=(i=+i)-(n=+n),c=s-t,g=l-n,d=c*c+g*g;
|
|
5581
5581
|
// Is the radius negative? Error.
|
|
5582
5582
|
if((a=+a)<0)throw new Error("negative radius: "+a);
|
|
@@ -5593,7 +5593,7 @@ e&&(
|
|
|
5593
5593
|
// Is this a complete circle? Draw two arcs to complete the circle.
|
|
5594
5594
|
(
|
|
5595
5595
|
// Does the angle go the wrong way? Flip the direction.
|
|
5596
|
-
r=r<0?r%Gb+Gb:r)>Ub?this._+="A"+e+","+e+",0,1,"+u+","+(t-o)+","+(n-s)+"A"+e+","+e+",0,1,"+u+","+(this._x1=l)+","+(this._y1=h):r>Kb&&(this._+="A"+e+","+e+",0,"+ +(r>=Hb)+","+u+","+(this._x1=t+e*Math.cos(a))+","+(this._y1=n+e*Math.sin(a))))},rect:function(t,n,e,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +i+"h"+-e+"Z"},toString:function(){return this._}};n=Object.freeze({__proto__:null,geoAlbersUk:function(){var n,e,a,r,i,o=bb().rotate([4.4,.8]).center([0,55.4]).parallels([50,60]),s=bb().rotate([4.4,.8]).center([0,55.4]).parallels([50,60]),l={point:function(t,n){i=[t,n]}};function h(t){var n=t[0],t=t[1];return i=null,a.point(n,t),i||(r.point(n,t),i)}function u(){return n=e=null,h}return h.invert=function(t){var n=o.scale(),e=o.translate(),i=(t[0]-e[0])/n,e=(t[1]-e[1])/n;return(-.089<=e&&e<.06&&.029<=i&&i<.046?s:o).invert(t)},h.stream=function(t){return n&&e===t?n:(i=[o.stream(e=t),s.stream(t)],a=i.length,n={point:function(t,n){for(var e=-1;++e<a;)i[e].point(t,n)},sphere:function(){for(var t=-1;++t<a;)i[t].sphere()},lineStart:function(){for(var t=-1;++t<a;)i[t].lineStart()},lineEnd:function(){for(var t=-1;++t<a;)i[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<a;)i[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<a;)i[t].polygonEnd()}});var i,a},h.precision=function(t){return arguments.length?(o.precision(t),s.precision(t),u()):o.precision()},h.scale=function(t){return arguments.length?(o.scale(t),s.scale(t),h.translate(o.translate())):o.scale()},h.translate=function(t){var n,e,i;return arguments.length?(n=o.scale(),e=+t[0],i=+t[1],a=o.translate(t).clipExtent([[e-.065*n,i-.089*n],[e+.075*n,i+.089*n]]).stream(l),r=s.translate([e+.01*n,i+.025*n]).clipExtent([[e+.029*n+G,i-.089*n+G],[e+.046*n-G,i-.06*n-G]]).stream(l),u()):o.translate()},h.fitExtent=function(t,n){return
|
|
5596
|
+
r=r<0?r%Gb+Gb:r)>Ub?this._+="A"+e+","+e+",0,1,"+u+","+(t-o)+","+(n-s)+"A"+e+","+e+",0,1,"+u+","+(this._x1=l)+","+(this._y1=h):r>Kb&&(this._+="A"+e+","+e+",0,"+ +(r>=Hb)+","+u+","+(this._x1=t+e*Math.cos(a))+","+(this._y1=n+e*Math.sin(a))))},rect:function(t,n,e,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +i+"h"+-e+"Z"},toString:function(){return this._}};n=Object.freeze({__proto__:null,geoAlbersUk:function(){var n,e,a,r,i,o=bb().rotate([4.4,.8]).center([0,55.4]).parallels([50,60]),s=bb().rotate([4.4,.8]).center([0,55.4]).parallels([50,60]),l={point:function(t,n){i=[t,n]}};function h(t){var n=t[0],t=t[1];return i=null,a.point(n,t),i||(r.point(n,t),i)}function u(){return n=e=null,h}return h.invert=function(t){var n=o.scale(),e=o.translate(),i=(t[0]-e[0])/n,e=(t[1]-e[1])/n;return(-.089<=e&&e<.06&&.029<=i&&i<.046?s:o).invert(t)},h.stream=function(t){return n&&e===t?n:(i=[o.stream(e=t),s.stream(t)],a=i.length,n={point:function(t,n){for(var e=-1;++e<a;)i[e].point(t,n)},sphere:function(){for(var t=-1;++t<a;)i[t].sphere()},lineStart:function(){for(var t=-1;++t<a;)i[t].lineStart()},lineEnd:function(){for(var t=-1;++t<a;)i[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<a;)i[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<a;)i[t].polygonEnd()}});var i,a},h.precision=function(t){return arguments.length?(o.precision(t),s.precision(t),u()):o.precision()},h.scale=function(t){return arguments.length?(o.scale(t),s.scale(t),h.translate(o.translate())):o.scale()},h.translate=function(t){var n,e,i;return arguments.length?(n=o.scale(),e=+t[0],i=+t[1],a=o.translate(t).clipExtent([[e-.065*n,i-.089*n],[e+.075*n,i+.089*n]]).stream(l),r=s.translate([e+.01*n,i+.025*n]).clipExtent([[e+.029*n+G,i-.089*n+G],[e+.046*n-G,i-.06*n-G]]).stream(l),u()):o.translate()},h.fitExtent=function(t,n){return Fb(h,t,n)},h.fitSize=function(t,n){return Ib(h,t,n)},h.drawCompositionBorders=function(t){
|
|
5597
5597
|
/*var ul = main.invert([
|
|
5598
5598
|
shetland.clipExtent()[0][0],
|
|
5599
5599
|
shetland.clipExtent()[0][1]
|
|
@@ -5629,7 +5629,7 @@ r=r<0?r%Gb+Gb:r)>Ub?this._+="A"+e+","+e+",0,1,"+u+","+(t-o)+","+(n-s)+"A"+e+","+
|
|
|
5629
5629
|
function(){var n,e,a,r,o,i,h=bb(),s=vb().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=vb().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,n){i=[t,n]}};function c(t){var n=t[0],t=t[1];return i=null,a.point(n,t),i||(r.point(n,t),i)||(o.point(n,t),i)}function g(){return n=e=null,c}return c.invert=function(t){var n=h.scale(),e=h.translate(),i=(t[0]-e[0])/n,e=(t[1]-e[1])/n;return(.12<=e&&e<.234&&-.425<=i&&i<-.214?s:.166<=e&&e<.234&&-.214<=i&&i<-.115?l:h).invert(t)},c.stream=function(t){return n&&e===t?n:(i=[h.stream(e=t),s.stream(t),l.stream(t)],a=i.length,n={point:function(t,n){for(var e=-1;++e<a;)i[e].point(t,n)},sphere:function(){for(var t=-1;++t<a;)i[t].sphere()},lineStart:function(){for(var t=-1;++t<a;)i[t].lineStart()},lineEnd:function(){for(var t=-1;++t<a;)i[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<a;)i[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<a;)i[t].polygonEnd()}});
|
|
5630
5630
|
// The projections must have mutually exclusive clip regions on the sphere,
|
|
5631
5631
|
// as this will avoid emitting interleaving lines and polygons.
|
|
5632
|
-
var i,a},c.precision=function(t){return arguments.length?(h.precision(t),s.precision(t),l.precision(t),g()):h.precision()},c.scale=function(t){return arguments.length?(h.scale(t),s.scale(.35*t),l.scale(t),c.translate(h.translate())):h.scale()},c.translate=function(t){var n,e,i;return arguments.length?(n=h.scale(),e=+t[0],i=+t[1],a=h.translate(t).clipExtent([[e-.455*n,i-.238*n],[e+.455*n,i+.238*n]]).stream(u),r=s.translate([e-.307*n,i+.201*n]).clipExtent([[e-.425*n+G,i+.12*n+G],[e-.214*n-G,i+.234*n-G]]).stream(u),o=l.translate([e-.205*n,i+.212*n]).clipExtent([[e-.214*n+G,i+.166*n+G],[e-.115*n-G,i+.234*n-G]]).stream(u),g()):h.translate()},c.fitExtent=function(t,n){return
|
|
5632
|
+
var i,a},c.precision=function(t){return arguments.length?(h.precision(t),s.precision(t),l.precision(t),g()):h.precision()},c.scale=function(t){return arguments.length?(h.scale(t),s.scale(.35*t),l.scale(t),c.translate(h.translate())):h.scale()},c.translate=function(t){var n,e,i;return arguments.length?(n=h.scale(),e=+t[0],i=+t[1],a=h.translate(t).clipExtent([[e-.455*n,i-.238*n],[e+.455*n,i+.238*n]]).stream(u),r=s.translate([e-.307*n,i+.201*n]).clipExtent([[e-.425*n+G,i+.12*n+G],[e-.214*n-G,i+.234*n-G]]).stream(u),o=l.translate([e-.205*n,i+.212*n]).clipExtent([[e-.214*n+G,i+.166*n+G],[e-.115*n-G,i+.234*n-G]]).stream(u),g()):h.translate()},c.fitExtent=function(t,n){return Fb(c,t,n)},c.fitSize=function(t,n){return Ib(c,t,n)},c.drawCompositionBorders=function(t){var n=h([-102.91,26.3]),e=h([-104,27.5]),i=h([-108,29.1]),a=h([-110,29.1]),r=h([-110,26.7]),o=h([-112.8,27.6]),s=h([-114.3,30.6]),l=h([-119.3,30.1]);t.moveTo(n[0],n[1]),t.lineTo(e[0],e[1]),t.lineTo(i[0],i[1]),t.lineTo(a[0],a[1]),t.moveTo(r[0],r[1]),t.lineTo(o[0],o[1]),t.lineTo(s[0],s[1]),t.lineTo(l[0],l[1])},c.getCompositionBorders=function(){var t=qb();return this.drawCompositionBorders(t),t.toString()},c.scale(1070)}
|
|
5633
5633
|
// The projections must have mutually exclusive clip regions on the sphere,
|
|
5634
5634
|
// as this will avoid emitting interleaving lines and polygons.
|
|
5635
5635
|
,geoAlbersUsaTerritories:
|
|
@@ -5739,7 +5739,7 @@ function(){var n,e,a,r,o,s,l,h,i,x=bb(),u=vb().rotate([154,0]).center([-2,58.5])
|
|
|
5739
5739
|
' * k - epsilon, y '+
|
|
5740
5740
|
(y1<0?'+ ':'- ') + Math.abs(y1.toFixed(4))+
|
|
5741
5741
|
' * k - epsilon]])');
|
|
5742
|
-
*/a=x.translate(t).clipExtent([[e-.455*n,i-.238*n],[e+.455*n,i+.238*n]]).stream(p),r=u.translate([e-.307*n,i+.201*n]).clipExtent([[e-.425*n+G,i+.12*n+G],[e-.214*n-G,i+.233*n-G]]).stream(p),o=c.translate([e-.205*n,i+.212*n]).clipExtent([[e-.214*n+G,i+.166*n+G],[e-.115*n-G,i+.233*n-G]]).stream(p),s=g.translate([e+.35*n,i+.224*n]).clipExtent([[e+.312*n+G,i+.2064*n+G],[e+.385*n-G,i+.233*n-G]]).stream(p),l=d.translate([e-.492*n,i+.09*n]).clipExtent([[e-.4243*n+G,i+.0903*n+G],[e-.3233*n-G,i+.1197*n-G]]).stream(p),h=f.translate([e-.408*n,i+.018*n]).clipExtent([[e-.4244*n+G,i-.0519*n+G],[e-.3824*n-G,i+.0895*n-G]]).stream(p),m()):x.translate()},_.fitExtent=function(t,n){return
|
|
5742
|
+
*/a=x.translate(t).clipExtent([[e-.455*n,i-.238*n],[e+.455*n,i+.238*n]]).stream(p),r=u.translate([e-.307*n,i+.201*n]).clipExtent([[e-.425*n+G,i+.12*n+G],[e-.214*n-G,i+.233*n-G]]).stream(p),o=c.translate([e-.205*n,i+.212*n]).clipExtent([[e-.214*n+G,i+.166*n+G],[e-.115*n-G,i+.233*n-G]]).stream(p),s=g.translate([e+.35*n,i+.224*n]).clipExtent([[e+.312*n+G,i+.2064*n+G],[e+.385*n-G,i+.233*n-G]]).stream(p),l=d.translate([e-.492*n,i+.09*n]).clipExtent([[e-.4243*n+G,i+.0903*n+G],[e-.3233*n-G,i+.1197*n-G]]).stream(p),h=f.translate([e-.408*n,i+.018*n]).clipExtent([[e-.4244*n+G,i-.0519*n+G],[e-.3824*n-G,i+.0895*n-G]]).stream(p),m()):x.translate()},_.fitExtent=function(t,n){return Fb(_,t,n)},_.fitSize=function(t,n){return Ib(_,t,n)},_.drawCompositionBorders=function(t){
|
|
5743
5743
|
/*
|
|
5744
5744
|
console.info("CLIP EXTENT hawaii: ", hawaii.clipExtent());
|
|
5745
5745
|
console.info("UL BBOX:", lower48.invert([hawaii.clipExtent()[0][0], hawaii.clipExtent()[0][1]]));
|
|
@@ -5783,7 +5783,7 @@ function(){var n,e,i,a,r,o,s,l,h,u,c,g,d,f,p,_=Mb().rotate([-10,-53]).parallels(
|
|
|
5783
5783
|
*/function T(t){var n=t[0],t=t[1];return p=null,i.point(n,t),p||(r.point(n,t),p)||(c.point(n,t),p)||(a.point(n,t),p)||(u.point(n,t),p)||(h.point(n,t),p)||(g.point(n,t),p)||(d.point(n,t),p)||(f.point(n,t),p)||(o.point(n,t),p)||(s.point(n,t),p)||(l.point(n,t),p)}function E(){return n=e=null,T}return T.invert=function(t){var n=_.scale(),e=_.translate(),i=(t[0]-(e[0]+.08*n))/n,e=(t[1]-e[1])/n;return(-.31<=e&&e<-.24&&.14<=i&&i<.24?m:-.24<=e&&e<-.17&&.14<=i&&i<.24?y:-.17<=e&&e<-.12&&.21<=i&&i<.24?b:-.17<=e&&e<-.14&&.14<=i&&i<.165?x:-.17<=e&&e<-.1&&.14<=i&&i<.24?v:-.1<=e&&e<-.03&&.14<=i&&i<.24?w:-.03<=e&&e<.04&&.14<=i&&i<.24?S:-.31<=e&&e<-.24&&.24<=i&&i<.34?k:-.24<=e&&e<-.17&&.24<=i&&i<.34?C:-.17<=e&&e<-.1&&.24<=i&&i<.34?M:-.1<=e&&e<-.03&&.24<=i&&i<.34?A:_).invert(t)},T.stream=function(t){return n&&e===t?n:(i=[_.stream(e=t),y.stream(t),k.stream(t),m.stream(t),S.stream(t),w.stream(t),C.stream(t),M.stream(t),A.stream(t),v.stream(t),b.stream(t),x.stream(t)],a=i.length,n={point:function(t,n){for(var e=-1;++e<a;)i[e].point(t,n)},sphere:function(){for(var t=-1;++t<a;)i[t].sphere()},lineStart:function(){for(var t=-1;++t<a;)i[t].lineStart()},lineEnd:function(){for(var t=-1;++t<a;)i[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<a;)i[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<a;)i[t].polygonEnd()}});
|
|
5784
5784
|
// The projections must have mutually exclusive clip regions on the sphere,
|
|
5785
5785
|
// as this will avoid emitting interleaving lines and polygons.
|
|
5786
|
-
var i,a},T.precision=function(t){return arguments.length?(_.precision(t),y.precision(t),k.precision(t),m.precision(t),S.precision(t),w.precision(t),C.precision(t),M.precision(t),A.precision(t),v.precision(t),b.precision(t),x.precision(t),E()):_.precision()},T.scale=function(t){return arguments.length?(_.scale(t),m.scale(3*t),y.scale(.8*t),k.scale(3.5*t),M.scale(2.7*t),v.scale(2*t),b.scale(2*t),x.scale(2*t),w.scale(3*t),S.scale(t),C.scale(5.5*t),A.scale(6*t),T.translate(_.translate())):_.scale()},T.translate=function(t){var n,e;return arguments.length?(n=_.scale(),e=+t[0],i=_.translate([e-.08*n,t=+t[1]]).clipExtent([[e-.51*n,t-.33*n],[e+.5*n,t+.33*n]]).stream(z),a=m.translate([e+.19*n,t-.275*n]).clipExtent([[e+.14*n+G,t-.31*n+G],[e+.24*n-G,t-.24*n-G]]).stream(z),r=y.translate([e+.19*n,t-.205*n]).clipExtent([[e+.14*n+G,t-.24*n+G],[e+.24*n-G,t-.17*n-G]]).stream(z),o=v.translate([e+.19*n,t-.135*n]).clipExtent([[e+.14*n+G,t-.17*n+G],[e+.24*n-G,t-.1*n-G]]).stream(z),s=b.translate([e+.225*n,t-.147*n]).clipExtent([[e+.21*n+G,t-.17*n+G],[e+.24*n-G,t-.12*n-G]]).stream(z),l=x.translate([e+.153*n,t-.15*n]).clipExtent([[e+.14*n+G,t-.17*n+G],[e+.165*n-G,t-.14*n-G]]).stream(z),h=w.translate([e+.19*n,t-.065*n]).clipExtent([[e+.14*n+G,t-.1*n+G],[e+.24*n-G,t-.03*n-G]]).stream(z),u=S.translate([e+.19*n,t+.005*n]).clipExtent([[e+.14*n+G,t-.03*n+G],[e+.24*n-G,t+.04*n-G]]).stream(z),c=k.translate([e+.29*n,t-.275*n]).clipExtent([[e+.24*n+G,t-.31*n+G],[e+.34*n-G,t-.24*n-G]]).stream(z),g=C.translate([e+.29*n,t-.205*n]).clipExtent([[e+.24*n+G,t-.24*n+G],[e+.34*n-G,t-.17*n-G]]).stream(z),d=M.translate([e+.29*n,t-.135*n]).clipExtent([[e+.24*n+G,t-.17*n+G],[e+.34*n-G,t-.1*n-G]]).stream(z),f=A.translate([e+.29*n,t-.065*n]).clipExtent([[e+.24*n+G,t-.1*n+G],[e+.34*n-G,t-.03*n-G]]).stream(z),E()):_.translate()},T.fitExtent=function(t,n){return
|
|
5786
|
+
var i,a},T.precision=function(t){return arguments.length?(_.precision(t),y.precision(t),k.precision(t),m.precision(t),S.precision(t),w.precision(t),C.precision(t),M.precision(t),A.precision(t),v.precision(t),b.precision(t),x.precision(t),E()):_.precision()},T.scale=function(t){return arguments.length?(_.scale(t),m.scale(3*t),y.scale(.8*t),k.scale(3.5*t),M.scale(2.7*t),v.scale(2*t),b.scale(2*t),x.scale(2*t),w.scale(3*t),S.scale(t),C.scale(5.5*t),A.scale(6*t),T.translate(_.translate())):_.scale()},T.translate=function(t){var n,e;return arguments.length?(n=_.scale(),e=+t[0],i=_.translate([e-.08*n,t=+t[1]]).clipExtent([[e-.51*n,t-.33*n],[e+.5*n,t+.33*n]]).stream(z),a=m.translate([e+.19*n,t-.275*n]).clipExtent([[e+.14*n+G,t-.31*n+G],[e+.24*n-G,t-.24*n-G]]).stream(z),r=y.translate([e+.19*n,t-.205*n]).clipExtent([[e+.14*n+G,t-.24*n+G],[e+.24*n-G,t-.17*n-G]]).stream(z),o=v.translate([e+.19*n,t-.135*n]).clipExtent([[e+.14*n+G,t-.17*n+G],[e+.24*n-G,t-.1*n-G]]).stream(z),s=b.translate([e+.225*n,t-.147*n]).clipExtent([[e+.21*n+G,t-.17*n+G],[e+.24*n-G,t-.12*n-G]]).stream(z),l=x.translate([e+.153*n,t-.15*n]).clipExtent([[e+.14*n+G,t-.17*n+G],[e+.165*n-G,t-.14*n-G]]).stream(z),h=w.translate([e+.19*n,t-.065*n]).clipExtent([[e+.14*n+G,t-.1*n+G],[e+.24*n-G,t-.03*n-G]]).stream(z),u=S.translate([e+.19*n,t+.005*n]).clipExtent([[e+.14*n+G,t-.03*n+G],[e+.24*n-G,t+.04*n-G]]).stream(z),c=k.translate([e+.29*n,t-.275*n]).clipExtent([[e+.24*n+G,t-.31*n+G],[e+.34*n-G,t-.24*n-G]]).stream(z),g=C.translate([e+.29*n,t-.205*n]).clipExtent([[e+.24*n+G,t-.24*n+G],[e+.34*n-G,t-.17*n-G]]).stream(z),d=M.translate([e+.29*n,t-.135*n]).clipExtent([[e+.24*n+G,t-.17*n+G],[e+.34*n-G,t-.1*n-G]]).stream(z),f=A.translate([e+.29*n,t-.065*n]).clipExtent([[e+.24*n+G,t-.1*n+G],[e+.34*n-G,t-.03*n-G]]).stream(z),E()):_.translate()},T.fitExtent=function(t,n){return Fb(T,t,n)},T.fitSize=function(t,n){return Ib(T,t,n)},T.drawCompositionBorders=function(t){
|
|
5787
5787
|
/*
|
|
5788
5788
|
console.log("var ul, ur, ld, ll;");
|
|
5789
5789
|
var projs = [guyane, martinique, guadeloupe, canaryIslands, madeira, mayotte, reunion, malta, azores, azores2, azores3];
|
|
@@ -5816,7 +5816,7 @@ function(){var n,e,a,r,o,s,l,h,u,c,g,d,f,p,i,_=Mb().rotate([-3,-46.2]).parallels
|
|
|
5816
5816
|
*/function T(t){var n=t[0],t=t[1];return i=null,a.point(n,t),i||(r.point(n,t),i)||(o.point(n,t),i)||(s.point(n,t),i)||(l.point(n,t),i)||(h.point(n,t),i)||(u.point(n,t),i)||(c.point(n,t),i)||(g.point(n,t),i)||(d.point(n,t),i)||(f.point(n,t),i)||(p.point(n,t),i)}function E(){return n=e=null,T}return T.invert=function(t){var n=_.scale(),e=_.translate(),i=(t[0]-e[0])/n,e=(t[1]-e[1])/n;return(.029<=e&&e<.0864&&-.14<=i&&i<-.0996?m:0<=e&&e<.029&&-.14<=i&&i<-.0996?y:-.032<=e&&e<0&&-.14<=i&&i<-.0996?v:-.052<=e&&e<-.032&&-.14<=i&&i<-.0996?b:-.076<=e&&e<.052&&-.14<=i&&i<-.0996?x:-.076<=e&&e<-.052&&.0967<=i&&i<.1371?w:-.052<=e&&e<-.02&&.0967<=i&&i<.1371?S:-.02<=e&&e<.012&&.0967<=i&&i<.1371?k:.012<=e&&e<.033&&.0967<=i&&i<.1371?C:.033<=e&&e<.0864&&.0967<=i&&i<.1371?M:_).invert(t)},T.stream=function(t){return n&&e===t?n:(i=[_.stream(e=t),m.stream(t),y.stream(t),v.stream(t),b.stream(t),x.stream(t),w.stream(t),S.stream(t),k.stream(t),C.stream(t),M.stream(t),A.stream(t)],a=i.length,n={point:function(t,n){for(var e=-1;++e<a;)i[e].point(t,n)},sphere:function(){for(var t=-1;++t<a;)i[t].sphere()},lineStart:function(){for(var t=-1;++t<a;)i[t].lineStart()},lineEnd:function(){for(var t=-1;++t<a;)i[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<a;)i[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<a;)i[t].polygonEnd()}});
|
|
5817
5817
|
// The projections must have mutually exclusive clip regions on the sphere,
|
|
5818
5818
|
// as this will avoid emitting interleaving lines and polygons.
|
|
5819
|
-
var i,a},T.precision=function(t){return arguments.length?(_.precision(t),m.precision(t),y.precision(t),v.precision(t),b.precision(t),x.precision(t),w.precision(t),S.precision(t),k.precision(t),C.precision(t),M.precision(t),A.precision(t),E()):_.precision()},T.scale=function(t){return arguments.length?(_.scale(t),m.scale(.6*t),y.scale(1.6*t),v.scale(1.4*t),b.scale(5*t),x.scale(1.3*t),w.scale(1.6*t),S.scale(1.2*t),k.scale(.3*t),C.scale(2.7*t),M.scale(.5*t),A.scale(.06*t),T.translate(_.translate())):_.scale()},T.translate=function(t){var n,e,i;return arguments.length?(n=_.scale(),e=+t[0],i=+t[1],a=_.translate(t).clipExtent([[e-.0996*n,i-.0908*n],[e+.0967*n,i+.0864*n]]).stream(z),r=m.translate([e-.12*n,i+.0575*n]).clipExtent([[e-.14*n+G,i+.029*n+G],[e-.0996*n-G,i+.0864*n-G]]).stream(z),o=y.translate([e-.12*n,i+.013*n]).clipExtent([[e-.14*n+G,i+0*n+G],[e-.0996*n-G,i+.029*n-G]]).stream(z),s=v.translate([e-.12*n,i-.014*n]).clipExtent([[e-.14*n+G,i-.032*n+G],[e-.0996*n-G,i+0*n-G]]).stream(z),l=b.translate([e-.12*n,i-.044*n]).clipExtent([[e-.14*n+G,i-.052*n+G],[e-.0996*n-G,i-.032*n-G]]).stream(z),h=x.translate([e-.12*n,i-.065*n]).clipExtent([[e-.14*n+G,i-.076*n+G],[e-.0996*n-G,i-.052*n-G]]).stream(z),u=w.translate([e+.117*n,i-.064*n]).clipExtent([[e+.0967*n+G,i-.076*n+G],[e+.1371*n-G,i-.052*n-G]]).stream(z),c=S.translate([e+.116*n,i-.0355*n]).clipExtent([[e+.0967*n+G,i-.052*n+G],[e+.1371*n-G,i-.02*n-G]]).stream(z),g=k.translate([e+.116*n,i-.0048*n]).clipExtent([[e+.0967*n+G,i-.02*n+G],[e+.1371*n-G,i+.012*n-G]]).stream(z),d=C.translate([e+.116*n,i+.022*n]).clipExtent([[e+.0967*n+G,i+.012*n+G],[e+.1371*n-G,i+.033*n-G]]).stream(z),p=A.translate([e+.11*n,i+.045*n]).clipExtent([[e+.0967*n+G,i+.033*n+G],[e+.1371*n-G,i+.06*n-G]]).stream(z),f=M.translate([e+.115*n,i+.075*n]).clipExtent([[e+.0967*n+G,i+.06*n+G],[e+.1371*n-G,i+.0864*n-G]]).stream(z),E()):_.translate()},T.fitExtent=function(t,n){return
|
|
5819
|
+
var i,a},T.precision=function(t){return arguments.length?(_.precision(t),m.precision(t),y.precision(t),v.precision(t),b.precision(t),x.precision(t),w.precision(t),S.precision(t),k.precision(t),C.precision(t),M.precision(t),A.precision(t),E()):_.precision()},T.scale=function(t){return arguments.length?(_.scale(t),m.scale(.6*t),y.scale(1.6*t),v.scale(1.4*t),b.scale(5*t),x.scale(1.3*t),w.scale(1.6*t),S.scale(1.2*t),k.scale(.3*t),C.scale(2.7*t),M.scale(.5*t),A.scale(.06*t),T.translate(_.translate())):_.scale()},T.translate=function(t){var n,e,i;return arguments.length?(n=_.scale(),e=+t[0],i=+t[1],a=_.translate(t).clipExtent([[e-.0996*n,i-.0908*n],[e+.0967*n,i+.0864*n]]).stream(z),r=m.translate([e-.12*n,i+.0575*n]).clipExtent([[e-.14*n+G,i+.029*n+G],[e-.0996*n-G,i+.0864*n-G]]).stream(z),o=y.translate([e-.12*n,i+.013*n]).clipExtent([[e-.14*n+G,i+0*n+G],[e-.0996*n-G,i+.029*n-G]]).stream(z),s=v.translate([e-.12*n,i-.014*n]).clipExtent([[e-.14*n+G,i-.032*n+G],[e-.0996*n-G,i+0*n-G]]).stream(z),l=b.translate([e-.12*n,i-.044*n]).clipExtent([[e-.14*n+G,i-.052*n+G],[e-.0996*n-G,i-.032*n-G]]).stream(z),h=x.translate([e-.12*n,i-.065*n]).clipExtent([[e-.14*n+G,i-.076*n+G],[e-.0996*n-G,i-.052*n-G]]).stream(z),u=w.translate([e+.117*n,i-.064*n]).clipExtent([[e+.0967*n+G,i-.076*n+G],[e+.1371*n-G,i-.052*n-G]]).stream(z),c=S.translate([e+.116*n,i-.0355*n]).clipExtent([[e+.0967*n+G,i-.052*n+G],[e+.1371*n-G,i-.02*n-G]]).stream(z),g=k.translate([e+.116*n,i-.0048*n]).clipExtent([[e+.0967*n+G,i-.02*n+G],[e+.1371*n-G,i+.012*n-G]]).stream(z),d=C.translate([e+.116*n,i+.022*n]).clipExtent([[e+.0967*n+G,i+.012*n+G],[e+.1371*n-G,i+.033*n-G]]).stream(z),p=A.translate([e+.11*n,i+.045*n]).clipExtent([[e+.0967*n+G,i+.033*n+G],[e+.1371*n-G,i+.06*n-G]]).stream(z),f=M.translate([e+.115*n,i+.075*n]).clipExtent([[e+.0967*n+G,i+.06*n+G],[e+.1371*n-G,i+.0864*n-G]]).stream(z),E()):_.translate()},T.fitExtent=function(t,n){return Fb(T,t,n)},T.fitSize=function(t,n){return Ib(T,t,n)},T.drawCompositionBorders=function(t){
|
|
5820
5820
|
/*
|
|
5821
5821
|
console.log("var ul, ur, ld, ll;");
|
|
5822
5822
|
var projs = [guyane, martinique, guadeloupe, saintBarthelemy, stPierreMiquelon, mayotte, reunion, nouvelleCaledonie, wallisFutuna, polynesie, polynesie2];
|
|
@@ -5839,7 +5839,7 @@ var i,a},T.precision=function(t){return arguments.length?(_.precision(t),m.preci
|
|
|
5839
5839
|
|
|
5840
5840
|
}*/var n=_([-7.938886725111036,43.7219460918835]),e=_([-4.832080896458295,44.12930268549372]),i=_([-4.205299743793263,40.98096346967365]),a=_([-7.071796453126152,40.610037319181444]);t.moveTo(n[0],n[1]),t.lineTo(e[0],e[1]),t.lineTo(i[0],i[1]),t.lineTo(a[0],a[1]),t.closePath(),n=_([-8.42751373617692,45.32889452553031]),e=_([-5.18599305777107,45.7566442062976]),i=_([-4.832080905154431,44.129302726751426]),a=_([-7.938886737126192,43.72194613263854]),t.moveTo(n[0],n[1]),t.lineTo(e[0],e[1]),t.lineTo(i[0],i[1]),t.lineTo(a[0],a[1]),t.closePath(),n=_([-9.012656899657046,47.127733821030176]),e=_([-5.6105244772793155,47.579777861410626]),i=_([-5.185993067168585,45.756644248170346]),a=_([-8.427513749141811,45.32889456686326]),t.moveTo(n[0],n[1]),t.lineTo(e[0],e[1]),t.lineTo(i[0],i[1]),t.lineTo(a[0],a[1]),t.closePath(),n=_([-9.405747558985553,48.26506375557457]),e=_([-5.896175018439575,48.733352850851624]),i=_([-5.610524487556043,47.57977790393761]),a=_([-9.012656913808351,47.127733862971255]),t.moveTo(n[0],n[1]),t.lineTo(e[0],e[1]),t.lineTo(i[0],i[1]),t.lineTo(a[0],a[1]),t.closePath(),n=_([-9.908436061346974,49.642448789505856]),e=_([-6.262026716233124,50.131426841787174]),i=_([-5.896175029331232,48.73335289377258]),a=_([-9.40574757396393,48.26506379787767]),t.moveTo(n[0],n[1]),t.lineTo(e[0],e[1]),t.lineTo(i[0],i[1]),t.lineTo(a[0],a[1]),t.closePath(),n=_([11.996907706504462,50.16039028163579]),e=_([15.649907879773343,49.68279246765253]),i=_([15.156712840526632,48.30371557625831]),a=_([11.64122661754411,48.761078240546816]),t.moveTo(n[0],n[1]),t.lineTo(e[0],e[1]),t.lineTo(i[0],i[1]),t.lineTo(a[0],a[1]),t.closePath(),n=_([11.641226606955788,48.7610781975889]),e=_([15.156712825832164,48.30371553390465]),i=_([14.549932166241172,46.4866532486199]),a=_([11.204443787952183,46.91899233914248]),t.moveTo(n[0],n[1]),t.lineTo(e[0],e[1]),t.lineTo(i[0],i[1]),t.lineTo(a[0],a[1]),t.closePath(),n=_([11.204443778297161,46.918992296823646]),e=_([14.549932152815039,46.486653206856396]),i=_([13.994409796764009,44.695833444323256]),a=_([10.805306599253848,45.105133870684924]),t.moveTo(n[0],n[1]),t.lineTo(e[0],e[1]),t.lineTo(i[0],i[1]),t.lineTo(a[0],a[1]),t.closePath(),n=_([10.805306590412085,45.10513382903308]),e=_([13.99440978444733,44.695833403183606]),i=_([13.654633799024392,43.53552468558152]),a=_([10.561516803980956,43.930671459798624]),t.moveTo(n[0],n[1]),t.lineTo(e[0],e[1]),t.lineTo(i[0],i[1]),t.lineTo(a[0],a[1]),t.closePath(),n=_([10.561516795617383,43.93067141859757]),e=_([13.654633787361952,43.5355246448671]),i=_([12.867691604239901,40.640701985019405]),a=_([9.997809515987688,41.00288343254471]),t.moveTo(n[0],n[1]),t.lineTo(e[0],e[1]),t.lineTo(i[0],i[1]),t.lineTo(a[0],a[1]),t.closePath(),n=_([10.8,42.4]),e=_([12.8,42.13]),t.moveTo(n[0],n[1]),t.lineTo(e[0],e[1])},T.getCompositionBorders=function(){var t=qb();return this.drawCompositionBorders(t),t.toString()},T.scale(2700)},geoConicConformalNetherlands:
|
|
5841
5841
|
// A composite projection for the Netherlands, configured by default for 960×500.
|
|
5842
|
-
function(){var n,e,a,r,o,i,h=Mb().rotate([-5.5,-52.2]).parallels([0,60]),s=wb().center([-68.25,12.2]),l=wb().center([-63.1,17.5]),u={point:function(t,n){i=[t,n]}};function c(t){var[t,n]=t;return i=null,a.point(t,n),i||(r.point(t,n),i)||(o.point(t,n),i)}function g(){return n=e=null,c}return c.invert=function(t){var n=h.scale(),e=h.translate(),i=(t[0]-e[0])/n,e=(t[1]-e[1])/n;return(-.0067<=e&&e<.0015&&-.0232<=i&&i<-.0154?s:-.022<=e&&e<-.014&&-.023<=i&&i<-.014?l:h).invert(t)},c.stream=function(t){return n&&e===t?n:(i=[h.stream(e=t),s.stream(t),l.stream(t)],a=i.length,n={point:function(t,n){for(var e=-1;++e<a;)i[e].point(t,n)},sphere:function(){for(var t=-1;++t<a;)i[t].sphere()},lineStart:function(){for(var t=-1;++t<a;)i[t].lineStart()},lineEnd:function(){for(var t=-1;++t<a;)i[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<a;)i[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<a;)i[t].polygonEnd()}});var i,a},c.precision=function(t){return arguments.length?(h.precision(t),s.precision(t),l.precision(t),g()):h.precision()},c.scale=function(t){return arguments.length?(h.scale(t),s.scale(t),l.scale(t),c.translate(h.translate())):h.scale()},c.translate=function(t){var n,e,i;return arguments.length?(n=h.scale(),e=+t[0],i=+t[1],a=h.translate(t).clipExtent([[e-.0245*n,i-.026*n],[e+.023*n,i+.026*n]]).stream(u),r=s.translate([e-.0186*n,i-.00325*n]).clipExtent([[e-.0232*n+G,i-.0067*n+G],[e-.0154*n-G,i+.0015*n-G]]).stream(u),o=l.translate([e-.0185*n,i-.017*n]).clipExtent([[e-.023*n+G,i-.022*n+G],[e-.014*n-G,i-.014*n-G]]).stream(u),g()):h.translate()},c.fitExtent=function(t,n){return
|
|
5842
|
+
function(){var n,e,a,r,o,i,h=Mb().rotate([-5.5,-52.2]).parallels([0,60]),s=wb().center([-68.25,12.2]),l=wb().center([-63.1,17.5]),u={point:function(t,n){i=[t,n]}};function c(t){var[t,n]=t;return i=null,a.point(t,n),i||(r.point(t,n),i)||(o.point(t,n),i)}function g(){return n=e=null,c}return c.invert=function(t){var n=h.scale(),e=h.translate(),i=(t[0]-e[0])/n,e=(t[1]-e[1])/n;return(-.0067<=e&&e<.0015&&-.0232<=i&&i<-.0154?s:-.022<=e&&e<-.014&&-.023<=i&&i<-.014?l:h).invert(t)},c.stream=function(t){return n&&e===t?n:(i=[h.stream(e=t),s.stream(t),l.stream(t)],a=i.length,n={point:function(t,n){for(var e=-1;++e<a;)i[e].point(t,n)},sphere:function(){for(var t=-1;++t<a;)i[t].sphere()},lineStart:function(){for(var t=-1;++t<a;)i[t].lineStart()},lineEnd:function(){for(var t=-1;++t<a;)i[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<a;)i[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<a;)i[t].polygonEnd()}});var i,a},c.precision=function(t){return arguments.length?(h.precision(t),s.precision(t),l.precision(t),g()):h.precision()},c.scale=function(t){return arguments.length?(h.scale(t),s.scale(t),l.scale(t),c.translate(h.translate())):h.scale()},c.translate=function(t){var n,e,i;return arguments.length?(n=h.scale(),e=+t[0],i=+t[1],a=h.translate(t).clipExtent([[e-.0245*n,i-.026*n],[e+.023*n,i+.026*n]]).stream(u),r=s.translate([e-.0186*n,i-.00325*n]).clipExtent([[e-.0232*n+G,i-.0067*n+G],[e-.0154*n-G,i+.0015*n-G]]).stream(u),o=l.translate([e-.0185*n,i-.017*n]).clipExtent([[e-.023*n+G,i-.022*n+G],[e-.014*n-G,i-.014*n-G]]).stream(u),g()):h.translate()},c.fitExtent=function(t,n){return Fb(c,t,n)},c.fitSize=function(t,n){return Ib(c,t,n)},c.drawCompositionBorders=function(t){
|
|
5843
5843
|
/*
|
|
5844
5844
|
console.table({
|
|
5845
5845
|
"Clip extent": ["Bonaire", bonaire.clipExtent()],
|
|
@@ -5954,7 +5954,7 @@ var i,a},c.precision=function(t){return arguments.length?(h.precision(t),s.preci
|
|
|
5954
5954
|
' * k - epsilon, y '+
|
|
5955
5955
|
(y1<0?'+ ':'- ') + Math.abs(y1.toFixed(4))+
|
|
5956
5956
|
' * k - epsilon]])');
|
|
5957
|
-
*/a=h.translate(t).clipExtent([[e-.0115*n,i-.1138*n],[e+.2105*n,i+.0673*n]]).stream(u),r=s.translate([e-.0265*n,i+.025*n]).clipExtent([[e-.0388*n+G,i+.0093*n+G],[e-.0116*n-G,i+.0368*n-G]]).stream(u),o=l.translate([e-.045*n,i+-.02*n]).clipExtent([[e-.0778*n+G,i-.0413*n+G],[e-.0117*n-G,i+.0091*n-G]]).stream(u),g()):h.translate()},c.fitExtent=function(t,n){return
|
|
5957
|
+
*/a=h.translate(t).clipExtent([[e-.0115*n,i-.1138*n],[e+.2105*n,i+.0673*n]]).stream(u),r=s.translate([e-.0265*n,i+.025*n]).clipExtent([[e-.0388*n+G,i+.0093*n+G],[e-.0116*n-G,i+.0368*n-G]]).stream(u),o=l.translate([e-.045*n,i+-.02*n]).clipExtent([[e-.0778*n+G,i-.0413*n+G],[e-.0117*n-G,i+.0091*n-G]]).stream(u),g()):h.translate()},c.fitExtent=function(t,n){return Fb(c,t,n)},c.fitSize=function(t,n){return Ib(c,t,n)},c.drawCompositionBorders=function(t){
|
|
5958
5958
|
/*
|
|
5959
5959
|
console.info("CLIP EXTENT MADEIRA: ", madeira.clipExtent());
|
|
5960
5960
|
console.info("UL BBOX:", iberianPeninsule.invert([madeira.clipExtent()[0][0], madeira.clipExtent()[0][1]]));
|
|
@@ -5997,7 +5997,7 @@ function(){var n,e,a,r,i,o=Mb().rotate([5,-38.6]).parallels([0,60]),s=Mb().rotat
|
|
|
5997
5997
|
y1 = (y - c1[1]) / k;
|
|
5998
5998
|
|
|
5999
5999
|
console.info('Canry Islands: p0: ' + x0 + ', ' + y0 + ' , p1: ' + x1 + ' - ' + y1);
|
|
6000
|
-
*/a=o.translate(t).clipExtent([[e-.06857*n,i-.1288*n],[e+.13249*n,i+.06*n]]).stream(l),r=s.translate([e+.1*n,i-.094*n]).clipExtent([[e-.1331*n+G,i+.053457*n+G],[e-.0354*n-G,i+.08969*n-G]]).stream(l),u()):o.translate()},h.fitExtent=function(t,n){return
|
|
6000
|
+
*/a=o.translate(t).clipExtent([[e-.06857*n,i-.1288*n],[e+.13249*n,i+.06*n]]).stream(l),r=s.translate([e+.1*n,i-.094*n]).clipExtent([[e-.1331*n+G,i+.053457*n+G],[e-.0354*n-G,i+.08969*n-G]]).stream(l),u()):o.translate()},h.fitExtent=function(t,n){return Fb(h,t,n)},h.fitSize=function(t,n){return Ib(h,t,n)},h.drawCompositionBorders=function(t){
|
|
6001
6001
|
/*
|
|
6002
6002
|
console.info("CLIP EXTENT: ", canaryIslands.clipExtent());
|
|
6003
6003
|
console.info("UL BBOX:", iberianPeninsule.invert([canaryIslands.clipExtent()[0][0], canaryIslands.clipExtent()[0][1]]));
|
|
@@ -6098,7 +6098,7 @@ var i,a},c.precision=function(t){return arguments.length?(h.precision(t),s.preci
|
|
|
6098
6098
|
' * k - epsilon, y '+
|
|
6099
6099
|
(y1<0?'+ ':'- ') + Math.abs(y1.toFixed(4))+
|
|
6100
6100
|
' * k - epsilon]])');
|
|
6101
|
-
*/a=h.translate(t).clipExtent([[e-.1352*n,i-.1091*n],[e+.117*n,i+.098*n]]).stream(u),r=s.translate([e-.0425*n,i-.005*n]).clipExtent([[e-.135*n+G,i-.1093*n+G],[e-.0397*n-G,i-.027*n-G]]).stream(u),o=l.translate(t).clipExtent([[e-.0399*n+G,i+.0471*n+G],[e+.051*n-G,i+.1114*n-G]]).stream(u),g()):h.translate()},c.fitExtent=function(t,n){return
|
|
6101
|
+
*/a=h.translate(t).clipExtent([[e-.1352*n,i-.1091*n],[e+.117*n,i+.098*n]]).stream(u),r=s.translate([e-.0425*n,i-.005*n]).clipExtent([[e-.135*n+G,i-.1093*n+G],[e-.0397*n-G,i-.027*n-G]]).stream(u),o=l.translate(t).clipExtent([[e-.0399*n+G,i+.0471*n+G],[e+.051*n-G,i+.1114*n-G]]).stream(u),g()):h.translate()},c.fitExtent=function(t,n){return Fb(c,t,n)},c.fitSize=function(t,n){return Ib(c,t,n)},c.drawCompositionBorders=function(t){
|
|
6102
6102
|
/*
|
|
6103
6103
|
console.info("CLIP EXTENT hokkaido: ", hokkaido.clipExtent());
|
|
6104
6104
|
console.info("UL BBOX:", mainland.invert([hokkaido.clipExtent()[0][0], hokkaido.clipExtent()[0][1]]));
|
|
@@ -6164,7 +6164,7 @@ function(){var n,e,a,r,i,o=wb().rotate([80,1.5]),s=wb().rotate([90.73,1]),l={poi
|
|
|
6164
6164
|
(x1<0?'+ ':'- ') + Math.abs(x1.toFixed(4))+
|
|
6165
6165
|
' * k - epsilon, y '+
|
|
6166
6166
|
(y1<0?'+ ':'- ') + Math.abs(y1.toFixed(4))+
|
|
6167
|
-
' * k - epsilon]])');*/a=o.translate(t).clipExtent([[e-.0262*n,i-.0734*n],[e+.1741*n,i+.079*n]]).stream(l),r=s.translate([e-.06*n,i-.04*n]).clipExtent([[e-.0857*n+G,i-.0676*n+G],[e-.0263*n-G,i-.026*n-G]]).stream(l),u()):o.translate()},h.fitExtent=function(t,n){return
|
|
6167
|
+
' * k - epsilon]])');*/a=o.translate(t).clipExtent([[e-.0262*n,i-.0734*n],[e+.1741*n,i+.079*n]]).stream(l),r=s.translate([e-.06*n,i-.04*n]).clipExtent([[e-.0857*n+G,i-.0676*n+G],[e-.0263*n-G,i-.026*n-G]]).stream(l),u()):o.translate()},h.fitExtent=function(t,n){return Fb(h,t,n)},h.fitSize=function(t,n){return Ib(h,t,n)},h.drawCompositionBorders=function(t){
|
|
6168
6168
|
/*
|
|
6169
6169
|
console.info("CLIP EXTENT: ", galapagos.clipExtent());
|
|
6170
6170
|
console.info("UL BBOX:", mainland.invert([galapagos.clipExtent()[0][0], galapagos.clipExtent()[0][1]]));
|
|
@@ -6179,7 +6179,7 @@ function(){var n,e,a,r,i,o=wb().rotate([80,1.5]),s=wb().rotate([90.73,1]),l={poi
|
|
|
6179
6179
|
function(){var n,e,a,r,o,i,s=wb().rotate([-9.5,-1.5]),l=wb().rotate([-8.6,-3.5]),h=wb().rotate([-5.6,1.45]),u={point:function(t,n){i=[t,n]}};function c(t){var n=t[0],t=t[1];return i=null,a.point(n,t),i||(r.point(n,t),i)||(o.point(n,t),i)}function g(){return n=e=null,c}return c.invert=function(t){var n=s.scale(),e=s.translate(),i=(t[0]-e[0])/n,e=(t[1]-e[1])/n;return(-.02<=e&&e<0&&-.038<=i&&i<-.005?l:0<=e&&e<.02&&-.038<=i&&i<-.005?h:s).invert(t)},c.stream=function(t){return n&&e===t?n:(i=[s.stream(e=t),l.stream(t),h.stream(t)],a=i.length,n={point:function(t,n){for(var e=-1;++e<a;)i[e].point(t,n)},sphere:function(){for(var t=-1;++t<a;)i[t].sphere()},lineStart:function(){for(var t=-1;++t<a;)i[t].lineStart()},lineEnd:function(){for(var t=-1;++t<a;)i[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<a;)i[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<a;)i[t].polygonEnd()}});
|
|
6180
6180
|
// The projections must have mutually exclusive clip regions on the sphere,
|
|
6181
6181
|
// as this will avoid emitting interleaving lines and polygons.
|
|
6182
|
-
var i,a},c.precision=function(t){return arguments.length?(s.precision(t),l.precision(t),h.precision(t),g()):s.precision()},c.scale=function(t){return arguments.length?(s.scale(t),l.scale(1.5*t),h.scale(4*t),c.translate(s.translate())):s.scale()},c.translate=function(t){var n,e,i;return arguments.length?(n=s.scale(),e=+t[0],i=+t[1],a=s.translate(t).clipExtent([[e-.005*n,i-.02*n],[e+.038*n,i+.02*n]]).stream(u),r=l.translate([e-.025*n,i-.01*n]).clipExtent([[e-.038*n+G,i-.02*n+G],[e-.005*n-G,i+0*n-G]]).stream(u),o=h.translate([e-.025*n,i+.01*n]).clipExtent([[e-.038*n+G,i-0*n+G],[e-.005*n-G,i+.02*n-G]]).stream(u),g()):s.translate()},c.fitExtent=function(t,n){return
|
|
6182
|
+
var i,a},c.precision=function(t){return arguments.length?(s.precision(t),l.precision(t),h.precision(t),g()):s.precision()},c.scale=function(t){return arguments.length?(s.scale(t),l.scale(1.5*t),h.scale(4*t),c.translate(s.translate())):s.scale()},c.translate=function(t){var n,e,i;return arguments.length?(n=s.scale(),e=+t[0],i=+t[1],a=s.translate(t).clipExtent([[e-.005*n,i-.02*n],[e+.038*n,i+.02*n]]).stream(u),r=l.translate([e-.025*n,i-.01*n]).clipExtent([[e-.038*n+G,i-.02*n+G],[e-.005*n-G,i+0*n-G]]).stream(u),o=h.translate([e-.025*n,i+.01*n]).clipExtent([[e-.038*n+G,i-0*n+G],[e-.005*n-G,i+.02*n-G]]).stream(u),g()):s.translate()},c.fitExtent=function(t,n){return Fb(c,t,n)},c.fitSize=function(t,n){return Ib(c,t,n)},c.drawCompositionBorders=function(t){
|
|
6183
6183
|
/*
|
|
6184
6184
|
console.log("var ul, ur, ld, ll;");
|
|
6185
6185
|
var projs = [continent, bioko, annobon];
|
|
@@ -6202,7 +6202,7 @@ var i,a},c.precision=function(t){return arguments.length?(s.precision(t),l.preci
|
|
|
6202
6202
|
|
|
6203
6203
|
}*/var n=s([9.21327272751682,2.645820439454123]),e=s([11.679126293239872,2.644755519268689]),i=s([11.676845389029227,.35307824637606433]),a=s([9.213572917774014,.35414205204417754]);t.moveTo(n[0],n[1]),t.lineTo(e[0],e[1]),t.lineTo(i[0],i[1]),t.lineTo(a[0],a[1]),t.closePath(),n=s([7.320873711543669,2.64475551449975]),e=s([9.213272722738658,2.645820434679803]),i=s([9.213422896480349,1.4999812505283054]),a=s([7.322014760520787,1.4989168878985566]),t.moveTo(n[0],n[1]),t.lineTo(e[0],e[1]),t.lineTo(i[0],i[1]),t.lineTo(a[0],a[1]),t.closePath(),n=s([7.3220147605302905,1.4989168783492766]),e=s([9.213422896481598,1.499981240979021]),i=s([9.213572912999604,.354142056817247]),a=s([7.323154615739809,.353078251154504]),t.moveTo(n[0],n[1]),t.lineTo(e[0],e[1]),t.lineTo(i[0],i[1]),t.lineTo(a[0],a[1]),t.closePath()},c.getCompositionBorders=function(){var t=qb();return this.drawCompositionBorders(t),t.toString()},c.scale(12e3)},geoMercatorMalaysia:
|
|
6204
6204
|
// A composite projection for Malaysia, configured by default for 960×500.
|
|
6205
|
-
function(){var n,e,a,r,i,o=wb().center([105.25,4]),s=wb().center([118.65,2.86]),l={point:function(t,n){i=[t,n]}};function h(t){var n=t[0],t=t[1];return i=null,a.point(n,t),i||(r.point(n,t),i)}function u(){return n=e=null,h}return h.invert=function(t){var n=o.scale(),e=o.translate(),i=(t[0]-e[0])/n,e=(t[1]-e[1])/n;return(-.0521<=e&&e<.0229&&-.0111<=i&&i<.1?s:o).invert(t)},h.stream=function(t){return n&&e===t?n:(i=[o.stream(e=t),s.stream(t)],a=i.length,n={point:function(t,n){for(var e=-1;++e<a;)i[e].point(t,n)},sphere:function(){for(var t=-1;++t<a;)i[t].sphere()},lineStart:function(){for(var t=-1;++t<a;)i[t].lineStart()},lineEnd:function(){for(var t=-1;++t<a;)i[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<a;)i[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<a;)i[t].polygonEnd()}});var i,a},h.precision=function(t){return arguments.length?(o.precision(t),s.precision(t),u()):o.precision()},h.scale=function(t){return arguments.length?(o.scale(t),s.scale(.615*t),h.translate(o.translate())):o.scale()},h.translate=function(t){var n,e,i;return arguments.length?(n=o.scale(),e=+t[0],i=+t[1],a=o.translate(t).clipExtent([[e-.11*n,i-.0521*n],[e-.0111*n,i+.0521*n]]).stream(l),r=s.translate([e+.09*n,i-0*n]).clipExtent([[e-.0111*n+G,i-.0521*n+G],[e+.1*n-G,i+.024*n-G]]).stream(l),u()):o.translate()},h.fitExtent=function(t,n){return
|
|
6205
|
+
function(){var n,e,a,r,i,o=wb().center([105.25,4]),s=wb().center([118.65,2.86]),l={point:function(t,n){i=[t,n]}};function h(t){var n=t[0],t=t[1];return i=null,a.point(n,t),i||(r.point(n,t),i)}function u(){return n=e=null,h}return h.invert=function(t){var n=o.scale(),e=o.translate(),i=(t[0]-e[0])/n,e=(t[1]-e[1])/n;return(-.0521<=e&&e<.0229&&-.0111<=i&&i<.1?s:o).invert(t)},h.stream=function(t){return n&&e===t?n:(i=[o.stream(e=t),s.stream(t)],a=i.length,n={point:function(t,n){for(var e=-1;++e<a;)i[e].point(t,n)},sphere:function(){for(var t=-1;++t<a;)i[t].sphere()},lineStart:function(){for(var t=-1;++t<a;)i[t].lineStart()},lineEnd:function(){for(var t=-1;++t<a;)i[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<a;)i[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<a;)i[t].polygonEnd()}});var i,a},h.precision=function(t){return arguments.length?(o.precision(t),s.precision(t),u()):o.precision()},h.scale=function(t){return arguments.length?(o.scale(t),s.scale(.615*t),h.translate(o.translate())):o.scale()},h.translate=function(t){var n,e,i;return arguments.length?(n=o.scale(),e=+t[0],i=+t[1],a=o.translate(t).clipExtent([[e-.11*n,i-.0521*n],[e-.0111*n,i+.0521*n]]).stream(l),r=s.translate([e+.09*n,i-0*n]).clipExtent([[e-.0111*n+G,i-.0521*n+G],[e+.1*n-G,i+.024*n-G]]).stream(l),u()):o.translate()},h.fitExtent=function(t,n){return Fb(h,t,n)},h.fitSize=function(t,n){return Ib(h,t,n)},h.drawCompositionBorders=function(t){var n=o([106.3214,2.0228]),e=o([105.1843,2.3761]),i=o([104.2151,3.3618]),a=o([104.215,4.5651]);t.moveTo(n[0],n[1]),t.lineTo(e[0],e[1]),t.lineTo(i[0],i[1]),t.lineTo(a[0],a[1])},h.getCompositionBorders=function(){var t=qb();return this.drawCompositionBorders(t),t.toString()},h.scale(4800)},geoTransverseMercatorChile:
|
|
6206
6206
|
// A composite projection for Chile, configured by default for 960×500.
|
|
6207
6207
|
function(){t=Sb(Pb),l=t.center,h=t.rotate,t.center=function(t){return arguments.length?l([-t[1],t[0]]):[(t=l())[1],-t[0]]},t.rotate=function(t){return arguments.length?h([t[0],t[1],2<t.length?t[2]+90:90]):[(t=h())[0],t[1],t[2]-90]};var n,e,a,r,o,s,i,t,l,h,d=h([0,0,90]).scale(159.155).rotate([72,37]),u=pb(Nb).scale(250).clipAngle(142).rotate([72,0]),c=wb().rotate([80,33.5]),g=wb().rotate([110,25]),f={point:function(t,n){i=[t,n]}};
|
|
6208
6208
|
/*
|
|
@@ -6326,7 +6326,7 @@ function(){t=Sb(Pb),l=t.center,h=t.rotate,t.center=function(t){return arguments.
|
|
|
6326
6326
|
' * k - epsilon, y '+
|
|
6327
6327
|
(y1<0?'+ ':'- ') + Math.abs(y1.toFixed(4))+
|
|
6328
6328
|
' * k - epsilon]])');
|
|
6329
|
-
*/a=d.translate(t).clipExtent([[e-.059*n,i-.3835*n],[e+.4498*n,i+.3375*n]]).stream(f),r=u.translate([e-.087*n,i+.17*n]).clipExtent([[e-.1166*n+G,i+.2582*n+G],[e-.06*n-G,i+.32*n-G]]).stream(f),o=c.translate([e-.092*n,i-0*n]).clipExtent([[e-.114*n+G,i-.013*n+G],[e-.0594*n-G,i+.0133*n-G]]).stream(f),s=g.translate([e-.089*n,i-.0265*n]).clipExtent([[e-.089*n+G,i+.0154*n+G],[e-.0588*n-G,i+.0391*n-G]]).stream(f),_()):d.translate()},p.fitExtent=function(t,n){return
|
|
6329
|
+
*/a=d.translate(t).clipExtent([[e-.059*n,i-.3835*n],[e+.4498*n,i+.3375*n]]).stream(f),r=u.translate([e-.087*n,i+.17*n]).clipExtent([[e-.1166*n+G,i+.2582*n+G],[e-.06*n-G,i+.32*n-G]]).stream(f),o=c.translate([e-.092*n,i-0*n]).clipExtent([[e-.114*n+G,i-.013*n+G],[e-.0594*n-G,i+.0133*n-G]]).stream(f),s=g.translate([e-.089*n,i-.0265*n]).clipExtent([[e-.089*n+G,i+.0154*n+G],[e-.0588*n-G,i+.0391*n-G]]).stream(f),_()):d.translate()},p.fitExtent=function(t,n){return Fb(p,t,n)},p.fitSize=function(t,n){return Ib(p,t,n)},p.drawCompositionBorders=function(t){
|
|
6330
6330
|
/*
|
|
6331
6331
|
console.info("CLIP EXTENT antarctic: ", antarctic.clipExtent());
|
|
6332
6332
|
console.info("UL BBOX:", mainland.invert([antarctic.clipExtent()[0][0], antarctic.clipExtent()[0][1]]));
|
|
@@ -6367,7 +6367,7 @@ return n}function l(t){return t.map(s)}return null==e&&null==i?{type:"Feature",p
|
|
|
6367
6367
|
/**
|
|
6368
6368
|
Extends the draw behavior of the abstract Viz class.
|
|
6369
6369
|
@private
|
|
6370
|
-
*/_draw(t){super._draw(t);var t=this._height-this._margin.top-this._margin.bottom,n=this._width-this._margin.left-this._margin.right,i=(this._container=this._select.selectAll("svg.d3plus-geomap").data([0]),this._container=this._container.enter().append("svg").attr("class","d3plus-geomap").attr("opacity",0).attr("width",n).attr("height",t).attr("x",this._margin.left).attr("y",this._margin.top).style("background-color",this._ocean||"transparent").merge(this._container),this._container.transition(this._transition).attr("opacity",1).attr("width",n).attr("height",t).attr("x",this._margin.left).attr("y",this._margin.top),this._container.selectAll("rect.d3plus-geomap-ocean").data([0]));i.enter().append("rect").attr("class","d3plus-geomap-ocean").merge(i).attr("width",n).attr("height",t).attr("fill",this._ocean||"transparent"),this._tileGroup=this._container.selectAll("g.d3plus-geomap-tileGroup").data([0]),this._tileGroup=this._tileGroup.enter().append("g").attr("class","d3plus-geomap-tileGroup").merge(this._tileGroup),this._zoomGroup=this._container.selectAll("g.d3plus-geomap-zoomGroup").data([0]),this._zoomGroup=this._zoomGroup.enter().append("g").attr("class","d3plus-geomap-zoomGroup").merge(this._zoomGroup);let e=this._zoomGroup.selectAll("g.d3plus-geomap-paths").data([0]);e=e.enter().append("g").attr("class","d3plus-geomap-paths").merge(e);i=this._coordData=this._topojson?n6(this._topojson,this._topojsonKey):{type:"FeatureCollection",features:[]};this._topojsonFilter&&(i.features=i.features.filter(this._topojsonFilter));let s=this._path=Qb.geoPath().projection(this._projection);var a=this._filteredData.filter((t,n)=>this._point(t,n)instanceof Array);let r=this._filteredData.filter((t,n)=>!(this._point(t,n)instanceof Array)).reduce((t,n)=>(t[this._id(n)]=n,t),{});var o=i.features.reduce((t,n)=>{var e=this._topojsonId(n);return t.push({__d3plus__:!0,data:r[e],feature:n,id:e}),t},[]);let l=Ts["scale"+this._pointSizeScale.charAt(0).toUpperCase()+this._pointSizeScale.slice(1)]().domain(Hi(a,(t,n)=>this._pointSize(t,n))).range([this._pointSizeMin,this._pointSizeMax]);if(!this._zoomSet){i=this._fitObject?n6(this._fitObject,this._fitKey):i;if(this._extentBounds={type:"FeatureCollection",features:this._fitFilter?i.features.filter(this._fitFilter):i.features.slice()},this._extentBounds.features=this._extentBounds.features.reduce((t,o)=>{if(o.geometry){let e={type:o.type,id:o.id,geometry:{coordinates:o.geometry.coordinates,type:o.geometry.type}};if("MultiPolygon"===o.geometry.type&&1<o.geometry.coordinates.length){let i=[],a=[],n=(o.geometry.coordinates.forEach(t=>{e.geometry.coordinates=[t],i.push(s.area(e))}),e.geometry.coordinates=[o.geometry.coordinates[i.indexOf(Ot(i))]],s.centroid(e)),r=(o.geometry.coordinates.forEach(t=>{e.geometry.coordinates=[t],a.push(Ru(s.centroid(e),n))}),aa(i.reduce((t,n,e)=>(n&&t.push(i[e]/n),t),[]),.9));e.geometry.coordinates=o.geometry.coordinates.filter((t,n)=>{var e=a[n];return 0===e||i[n]/e>=r})}t.push(e)}return t},[]),!this._extentBounds.features.length&&a.length){let e=[[void 0,void 0],[void 0,void 0]];a.forEach((t,n)=>{t=this._projection(this._point(t,n));(void 0===e[0][0]||t[0]<e[0][0])&&(e[0][0]=t[0]),(void 0===e[1][0]||t[0]>e[1][0])&&(e[1][0]=t[0]),(void 0===e[0][1]||t[1]<e[0][1])&&(e[0][1]=t[1]),(void 0===e[1][1]||t[1]>e[1][1])&&(e[1][1]=t[1])}),this._extentBounds={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:e.map(t=>this._projection.invert(t))}}]};i=Ot(a,(t,n)=>l(this._pointSize(t,n)));this._projectionPadding.top+=i,this._projectionPadding.right+=i,this._projectionPadding.bottom+=i,this._projectionPadding.left+=i}this._zoomBehavior.extent([[0,0],[n,t]]).scaleExtent([1,this._zoomMax]).translateExtent([[0,0],[n,t]]),this._zoomSet=!0}this._projection=this._projection.fitExtent(this._extentBounds.features.length?[[this._projectionPadding.left,this._projectionPadding.top],[n-this._projectionPadding.right,t-this._projectionPadding.bottom]]:[[0,0],[n,t]],this._extentBounds.features.length?this._extentBounds:{type:"Sphere"}),this._shapes.push((new Sc).data(o).d(t=>s(t.feature)).select(e.node()).x(0).y(0).config(
|
|
6370
|
+
*/_draw(t){super._draw(t);var t=this._height-this._margin.top-this._margin.bottom,n=this._width-this._margin.left-this._margin.right,i=(this._container=this._select.selectAll("svg.d3plus-geomap").data([0]),this._container=this._container.enter().append("svg").attr("class","d3plus-geomap").attr("opacity",0).attr("width",n).attr("height",t).attr("x",this._margin.left).attr("y",this._margin.top).style("background-color",this._ocean||"transparent").merge(this._container),this._container.transition(this._transition).attr("opacity",1).attr("width",n).attr("height",t).attr("x",this._margin.left).attr("y",this._margin.top),this._container.selectAll("rect.d3plus-geomap-ocean").data([0]));i.enter().append("rect").attr("class","d3plus-geomap-ocean").merge(i).attr("width",n).attr("height",t).attr("fill",this._ocean||"transparent"),this._tileGroup=this._container.selectAll("g.d3plus-geomap-tileGroup").data([0]),this._tileGroup=this._tileGroup.enter().append("g").attr("class","d3plus-geomap-tileGroup").merge(this._tileGroup),this._zoomGroup=this._container.selectAll("g.d3plus-geomap-zoomGroup").data([0]),this._zoomGroup=this._zoomGroup.enter().append("g").attr("class","d3plus-geomap-zoomGroup").merge(this._zoomGroup);let e=this._zoomGroup.selectAll("g.d3plus-geomap-paths").data([0]);e=e.enter().append("g").attr("class","d3plus-geomap-paths").merge(e);i=this._coordData=this._topojson?n6(this._topojson,this._topojsonKey):{type:"FeatureCollection",features:[]};this._topojsonFilter&&(i.features=i.features.filter(this._topojsonFilter));let s=this._path=Qb.geoPath().projection(this._projection);var a=this._filteredData.filter((t,n)=>this._point(t,n)instanceof Array);let r=this._filteredData.filter((t,n)=>!(this._point(t,n)instanceof Array)).reduce((t,n)=>(t[this._id(n)]=n,t),{});var o=i.features.reduce((t,n)=>{var e=this._topojsonId(n);return t.push({__d3plus__:!0,data:r[e],feature:n,id:e}),t},[]);let l=Ts["scale"+this._pointSizeScale.charAt(0).toUpperCase()+this._pointSizeScale.slice(1)]().domain(Hi(a,(t,n)=>this._pointSize(t,n))).range([this._pointSizeMin,this._pointSizeMax]);if(!this._zoomSet){i=this._fitObject?n6(this._fitObject,this._fitKey):i;if(this._extentBounds={type:"FeatureCollection",features:this._fitFilter?i.features.filter(this._fitFilter):i.features.slice()},this._extentBounds.features=this._extentBounds.features.reduce((t,o)=>{if(o.geometry){let e={type:o.type,id:o.id,geometry:{coordinates:o.geometry.coordinates,type:o.geometry.type}};if("MultiPolygon"===o.geometry.type&&1<o.geometry.coordinates.length){let i=[],a=[],n=(o.geometry.coordinates.forEach(t=>{e.geometry.coordinates=[t],i.push(s.area(e))}),e.geometry.coordinates=[o.geometry.coordinates[i.indexOf(Ot(i))]],s.centroid(e)),r=(o.geometry.coordinates.forEach(t=>{e.geometry.coordinates=[t],a.push(Ru(s.centroid(e),n))}),aa(i.reduce((t,n,e)=>(n&&t.push(i[e]/n),t),[]),.9));e.geometry.coordinates=o.geometry.coordinates.filter((t,n)=>{var e=a[n];return 0===e||i[n]/e>=r})}t.push(e)}return t},[]),!this._extentBounds.features.length&&a.length){let e=[[void 0,void 0],[void 0,void 0]];a.forEach((t,n)=>{t=this._projection(this._point(t,n));(void 0===e[0][0]||t[0]<e[0][0])&&(e[0][0]=t[0]),(void 0===e[1][0]||t[0]>e[1][0])&&(e[1][0]=t[0]),(void 0===e[0][1]||t[1]<e[0][1])&&(e[0][1]=t[1]),(void 0===e[1][1]||t[1]>e[1][1])&&(e[1][1]=t[1])}),this._extentBounds={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:e.map(t=>this._projection.invert(t))}}]};i=Ot(a,(t,n)=>l(this._pointSize(t,n)));this._projectionPadding.top+=i,this._projectionPadding.right+=i,this._projectionPadding.bottom+=i,this._projectionPadding.left+=i}this._zoomBehavior.extent([[0,0],[n,t]]).scaleExtent([1,this._zoomMax]).translateExtent([[0,0],[n,t]]),this._zoomSet=!0}this._projection=this._projection.fitExtent(this._extentBounds.features.length?[[this._projectionPadding.left,this._projectionPadding.top],[n-this._projectionPadding.right,t-this._projectionPadding.bottom]]:[[0,0],[n,t]],this._extentBounds.features.length?this._extentBounds:{type:"Sphere"}),this._shapes.push((new Sc).data(o).d(t=>s(t.feature)).select(e.node()).x(0).y(0).config(Lt.bind(this)(this._shapeConfig,"shape","Path")).render());let h=this._zoomGroup.selectAll("g.d3plus-geomap-pins").data([0]);h=h.enter().append("g").attr("class","d3plus-geomap-pins").merge(h);var u=(new _c).config(Lt.bind(this)(this._shapeConfig,"shape","Circle")).data(a).r((t,n)=>l(this._pointSize(t,n))).select(h.node()).sort((t,n)=>this._pointSize(n)-this._pointSize(t)).x((t,n)=>this._projection(this._point(t,n))[0]).y((t,n)=>this._projection(this._point(t,n))[1]),i=Object.keys(this._on),c=i.filter(t=>t.includes(".Circle")),g=i.filter(t=>!t.includes(".")),d=i.filter(t=>t.includes(".shape"));for(let t=0;t<g.length;t++)u.on(g[t],this._on[g[t]]);for(let t=0;t<d.length;t++)u.on(d[t],this._on[d[t]]);for(let t=0;t<c.length;t++)u.on(c[t],this._on[c[t]]);return this._shapes.push(u.render()),this}
|
|
6371
6371
|
/**
|
|
6372
6372
|
@memberof Geomap
|
|
6373
6373
|
@desc Topojson files sometimes include small geographies that negatively impact how the library determines the default zoom level (for example, a small island or territory far off the coast that is barely visible to the eye). The fitFilter method can be used to remove specific geographies from the logic used to determine the zooming.
|
|
@@ -6404,13 +6404,13 @@ return n}function l(t){return t.map(s)}return null==e&&null==i?{type:"Feature",p
|
|
|
6404
6404
|
@desc The accessor to be used when detecting coordinate points in the objects passed to the [data](https://d3plus.org/docs/#Viz.data) method. Values are expected to be in the format `[longitude, latitude]`, which is in-line with d3's expected coordinate mapping.
|
|
6405
6405
|
@param {Function|Array} [*value*]
|
|
6406
6406
|
@chainable
|
|
6407
|
-
*/point(t){return arguments.length?(this._point="function"==typeof t?t:
|
|
6407
|
+
*/point(t){return arguments.length?(this._point="function"==typeof t?t:Bt(t),this):this._point}
|
|
6408
6408
|
/**
|
|
6409
6409
|
@memberof Geomap
|
|
6410
6410
|
@desc The accessor or static value to be used for sizing coordinate points.
|
|
6411
6411
|
@param {Function|Number} [*value*]
|
|
6412
6412
|
@chainable
|
|
6413
|
-
*/pointSize(t){return arguments.length?(this._pointSize="function"==typeof t?t:
|
|
6413
|
+
*/pointSize(t){return arguments.length?(this._pointSize="function"==typeof t?t:Bt(t),this):this._pointSize}
|
|
6414
6414
|
/**
|
|
6415
6415
|
@memberof Geomap
|
|
6416
6416
|
@desc The maximum pixel radius used in the scale for sizing coordinate points.
|
|
@@ -6467,7 +6467,7 @@ return n}function l(t){return t.map(s)}return null==e&&null==i?{type:"Feature",p
|
|
|
6467
6467
|
@desc The function is used to set default color of the map.
|
|
6468
6468
|
@param {String|Function} *value* = string
|
|
6469
6469
|
@chainable
|
|
6470
|
-
*/topojsonFill(t){return arguments.length?(this._topojsonFill="function"==typeof t?t:
|
|
6470
|
+
*/topojsonFill(t){return arguments.length?(this._topojsonFill="function"==typeof t?t:Bt(t),this):this._topojsonFill}
|
|
6471
6471
|
/**
|
|
6472
6472
|
@memberof Geomap
|
|
6473
6473
|
@desc If the [topojson](#Geomap.topojson) being used contains boundaries that should not be shown, this method can be used to filter them out of the final output. The *value* passed can be a single id to remove, an array of ids, or a filter function.
|
|
@@ -6492,12 +6492,12 @@ return n}function l(t){return t.map(s)}return null==e&&null==i?{type:"Feature",p
|
|
|
6492
6492
|
@memberof Geomap
|
|
6493
6493
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
6494
6494
|
@private
|
|
6495
|
-
*/constructor(){super(),this._fitObject=!1,this._noDataMessage=!1,this._ocean="#d4dadc",this._point=p("point"),this._pointSize=
|
|
6495
|
+
*/constructor(){super(),this._fitObject=!1,this._noDataMessage=!1,this._ocean="#d4dadc",this._point=p("point"),this._pointSize=Bt(1),this._pointSizeMax=10,this._pointSizeMin=5,this._pointSizeScale="linear",this._projection=Qb.geoMercator(),this._projectionPadding=mi(20),this._shape=Bt("Circle"),this._shapeConfig=Et(this._shapeConfig,{ariaLabel:(t,n)=>this._drawLabel(t,n)+", "+this._pointSize(t,n),hoverOpacity:1,Path:{ariaLabel:(t,n)=>{var e=this._colorScale?", "+this._colorScale(t,n):"";return this._drawLabel(t,n)+e+"."},fill:(t,n)=>{if(this._colorScale&&!this._coordData.features.includes(t)){var e=this._colorScale(t);if(null!=e){if(this._colorScaleClass._colorScale)return this._colorScaleClass._colorScale(e);{let t=this._colorScaleClass.color();return t=t instanceof Array?t[t.length-1]:t}}}return this._topojsonFill(t,n)},on:{mouseenter:(t,n,e,i)=>this._coordData.features.includes(t)?null:this._on.mouseenter.bind(this)(t,n,e,i),"mousemove.shape":(t,n,e,i)=>this._coordData.features.includes(t)?null:this._on["mousemove.shape"].bind(this)(t,n,e,i),mouseleave:(t,n,e,i)=>this._coordData.features.includes(t)?null:this._on.mouseleave.bind(this)(t,n,e,i)},stroke:(t,n)=>zn("function"==typeof this._shapeConfig.Path.fill?this._shapeConfig.Path.fill(t,n):this._shapeConfig.Path.fill).darker(),strokeWidth:1}}),this._tiles=!0,this._tileGen=(()=>{let h=0,u=0,c=960,g=500,d=!0,f=!0,p=256,_=$b,m=Vb,y=0;function n(){var t=+_.apply(this,arguments),n=m.apply(this,arguments),e=Math.log2(t/p),i=Math.round(Math.max(e+y,0)),e=Math.pow(2,e-i)*p,a=+n[0]-t/2,n=+n[1]-t/2,r=Math.max(d?0:-1/0,Math.floor((h-a)/e)),o=Math.min(d?1<<i:1/0,Math.ceil((c-a)/e)),t=Math.max(f?0:-1/0,Math.floor((u-n)/e)),s=Math.min(f?1<<i:1/0,Math.ceil((g-n)/e)),l=[];for(let n=t;n<s;++n)for(let t=r;t<o;++t)l.push([t,n,i]);return l.translate=[a/e,n/e],l.scale=e,l}return n.size=function(t){return arguments.length?(h=u=0,c=+t[0],g=+t[1],n):[c-h,g-u]},n.extent=function(t){return arguments.length?(h=+t[0][0],u=+t[0][1],c=+t[1][0],g=+t[1][1],n):[[h,u],[c,g]]},n.scale=function(t){return arguments.length?(_="function"==typeof t?t:Yb(+t),n):_},n.translate=function(t){return arguments.length?(m="function"==typeof t?t:Yb([+t[0],+t[1]]),n):m},n.zoomDelta=function(t){return arguments.length?(y=+t,n):y},n.tileSize=function(t){return arguments.length?(p=+t,n):p},n.clamp=function(t){return arguments.length?(d=f=!!t,n):d&&f},n.clampX=function(t){return arguments.length?(d=!!t,n):d},n.clampY=function(t){return arguments.length?(f=!!t,n):f},n})(),this.tileUrl("https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}@2x.png"),this._topojson=!1,this._topojsonFill=Bt("#f5f5f3"),this._topojsonFilter=t=>!["010"].includes(t.id),this._topojsonId=p("id"),this._zoom=!0,this._zoomSet=!1}}class i6 extends Rf{
|
|
6496
6496
|
/**
|
|
6497
6497
|
@memberof LinePlot
|
|
6498
6498
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from Plot.
|
|
6499
6499
|
@private
|
|
6500
|
-
*/constructor(){super(),this._discrete="x",this._shape=
|
|
6500
|
+
*/constructor(){super(),this._discrete="x",this._shape=Bt("Line")}}
|
|
6501
6501
|
/**
|
|
6502
6502
|
@module matrixData
|
|
6503
6503
|
@private
|
|
@@ -6506,7 +6506,7 @@ return n}function l(t){return t.map(s)}return null==e&&null==i?{type:"Feature",p
|
|
|
6506
6506
|
@memberof Matrix
|
|
6507
6507
|
@desc Extends the draw behavior of the abstract Viz class.
|
|
6508
6508
|
@private
|
|
6509
|
-
*/_draw(l){var{rowValues:h,columnValues:u,shapeData:c}=a6.bind(this)(this._filteredData);if(h.length&&u.length){let t=this._height-this._margin.top-this._margin.bottom,e=this._select,i=this._transition,n=this._width-this._margin.left-this._margin.right;var g={opacity:0},d={opacity:1},f=n/u.length<120,p=(t,n)=>Pt("g.d3plus-Matrix-"+t,Object.assign({parent:e,transition:i},n)).node(),_=(this._rowAxis.select(p("row",{enter:g,update:g})).domain(h).height(t-this._margin.top-this._margin.bottom-this._padding.bottom-this._padding.top).maxSize(n/4).width(n).config(this._rowConfig).render(),this._rowAxis.outerBounds().width),m=(this._padding.left+=_,`translate(0, ${this._margin.top})`),g=Object.assign({transform:m},g),g=(this._columnAxis.select(p("column",{enter:g,update:g})).domain(u).range([this._margin.left+this._padding.left,n-this._margin.right+this._padding.right]).height(t).maxSize(t/4).width(n).labelRotation(f).config(this._columnConfig).render(),this._columnAxis.outerBounds().height),f=(this._padding.top+=g,super._draw(l),`translate(${this._margin.left}, ${this._margin.top})`),m=`translate(0, ${this._margin.top})`,l=Object.assign({transform:m},d);this._rowAxis.select(p("row",{update:Object.assign({transform:f},d)})).height(t-this._margin.top-this._margin.bottom-this._padding.bottom).maxSize(_).range([g+this._columnAxis.padding(),void 0]).render(),this._columnAxis.select(p("column",{update:l})).range([this._margin.left+this._padding.left+this._rowAxis.padding(),n-this._margin.right+this._padding.right]).maxSize(g).render();let a=this._rowAxis._getPosition.bind(this._rowAxis),r=this._columnAxis._getPosition.bind(this._columnAxis),o=1<h.length?a(h[1])-a(h[0]):this._rowAxis.height(),s=1<u.length?r(u[1])-r(u[0]):this._columnAxis.width();m=`translate(0, ${this._margin.top})`,f=
|
|
6509
|
+
*/_draw(l){var{rowValues:h,columnValues:u,shapeData:c}=a6.bind(this)(this._filteredData);if(h.length&&u.length){let t=this._height-this._margin.top-this._margin.bottom,e=this._select,i=this._transition,n=this._width-this._margin.left-this._margin.right;var g={opacity:0},d={opacity:1},f=n/u.length<120,p=(t,n)=>Pt("g.d3plus-Matrix-"+t,Object.assign({parent:e,transition:i},n)).node(),_=(this._rowAxis.select(p("row",{enter:g,update:g})).domain(h).height(t-this._margin.top-this._margin.bottom-this._padding.bottom-this._padding.top).maxSize(n/4).width(n).config(this._rowConfig).render(),this._rowAxis.outerBounds().width),m=(this._padding.left+=_,`translate(0, ${this._margin.top})`),g=Object.assign({transform:m},g),g=(this._columnAxis.select(p("column",{enter:g,update:g})).domain(u).range([this._margin.left+this._padding.left,n-this._margin.right+this._padding.right]).height(t).maxSize(t/4).width(n).labelRotation(f).config(this._columnConfig).render(),this._columnAxis.outerBounds().height),f=(this._padding.top+=g,super._draw(l),`translate(${this._margin.left}, ${this._margin.top})`),m=`translate(0, ${this._margin.top})`,l=Object.assign({transform:m},d);this._rowAxis.select(p("row",{update:Object.assign({transform:f},d)})).height(t-this._margin.top-this._margin.bottom-this._padding.bottom).maxSize(_).range([g+this._columnAxis.padding(),void 0]).render(),this._columnAxis.select(p("column",{update:l})).range([this._margin.left+this._padding.left+this._rowAxis.padding(),n-this._margin.right+this._padding.right]).maxSize(g).render();let a=this._rowAxis._getPosition.bind(this._rowAxis),r=this._columnAxis._getPosition.bind(this._columnAxis),o=1<h.length?a(h[1])-a(h[0]):this._rowAxis.height(),s=1<u.length?r(u[1])-r(u[0]):this._columnAxis.width();m=`translate(0, ${this._margin.top})`,f=Lt.bind(this)(this._shapeConfig,"shape","Rect");this._shapes.push((new mc).data(c).select(Pt("g.d3plus-Matrix-cells",{parent:this._select,enter:{transform:m},update:{transform:m}}).node()).config({height:o-this._cellPadding,width:s-this._cellPadding,x:t=>r(t.column)+s/2,y:t=>a(t.row)+o/2}).config(f).render())}return this}
|
|
6510
6510
|
/**
|
|
6511
6511
|
@memberof Matrix
|
|
6512
6512
|
@desc The pixel padding in between each cell.
|
|
@@ -6574,7 +6574,7 @@ return n}function l(t){return t.map(s)}return null==e&&null==i?{type:"Feature",p
|
|
|
6574
6574
|
@memberof Matrix
|
|
6575
6575
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
6576
6576
|
@private
|
|
6577
|
-
*/constructor(){super(),this._cellPadding=2,this._column=p("column"),this._columnAxis=new Nc,this._columnConfig=Et({orient:"top"},r6),this._columnSort=(t,n)=>(""+t).localeCompare(""+n),this._label=(t,n)=>
|
|
6577
|
+
*/constructor(){super(),this._cellPadding=2,this._column=p("column"),this._columnAxis=new Nc,this._columnConfig=Et({orient:"top"},r6),this._columnSort=(t,n)=>(""+t).localeCompare(""+n),this._label=(t,n)=>Bi.bind(this)("row",t,n)+" / "+Bi.bind(this)("column",t,n);let o=this._on["mousemove.shape"];this._on["mousemove.shape"]=(t,n,e,i)=>{o(t,n,e,i);let a=Bi.bind(this)("row",t,n),r=Bi.bind(this)("column",t,n);this.hover((t,n)=>Bi.bind(this)("row",t,n)===a||Bi.bind(this)("column",t,n)===r)},this._row=p("row"),this._rowAxis=new Nc,this._rowConfig=Et({orient:"left"},r6),this._rowSort=(t,n)=>(""+t).localeCompare(""+n)}}function s6(t,n,e,i){if(!isNaN(n)&&!isNaN(e)){// ignore invalid points
|
|
6578
6578
|
var a,r,o,s,l,h,u,c,g,d=t._root,f={data:i},p=t._x0,_=t._y0,m=t._x1,y=t._y1;
|
|
6579
6579
|
// If the tree is empty, initialize the root as a leaf.
|
|
6580
6580
|
if(d){
|
|
@@ -6640,7 +6640,7 @@ if(t.length){for(i=a=r=0;r<4;++r)(n=t[r])&&(e=Math.abs(n.value))&&(o+=n.value,s+
|
|
|
6640
6640
|
// Limit forces for very close nodes; randomize direction if coincident.
|
|
6641
6641
|
if(o*o/_<s)return s<p&&(0===a&&(s+=(a=p6(u))*a),0===r&&(s+=(r=p6(u))*r),s<f&&(s=Math.sqrt(f*s)),h.vx+=a*t.value*c/s,h.vy+=r*t.value*c/s),!0;
|
|
6642
6642
|
// Limit forces for very close nodes; randomize direction if coincident.
|
|
6643
|
-
if(!(t.length||p<=s))for((t.data!==h||t.next)&&(0===a&&(s+=(a=p6(u))*a),0===r&&(s+=(r=p6(u))*r),s<f)&&(s=Math.sqrt(f*s));t.data!==h&&(o=g[t.data.index]*c/s,h.vx+=a*o,h.vy+=r*o),t=t.next;);}v=Hi(r.map(t=>t.fx)),y=Hi(r.map(t=>t.fy));let k=$a().domain(v).range([0,i]),C=$a().domain(y).range([0,n]);var v=(v[1]-v[0])/(y[1]-y[0])||1,y=i/n,M=(y<v?(M=n*y/v,C.range([(n-M)/2,n-(n-M)/2])):(M=i*v/y,k.range([(i-M)/2,i-(i-M)/2])),r.forEach(t=>{t.x=k(t.fx),t.y=C(t.fy)}),Hi(r.map(t=>t.r))),A=this._sizeMax||Ot([1,Dt(oa(r.map(n=>r.map(t=>n===t?null:Ru([n.x,n.y],[t.x,t.y])))))/2]);let z=Ts["scale"+this._sizeScale.charAt(0).toUpperCase()+this._sizeScale.slice(1)]().domain(M).range([M[0]===M[1]?A:Dt([A/2,this._sizeMin]),A]),T=k.domain(),E=C.domain();var N=T[1]-T[0],P=E[1]-E[0],
|
|
6643
|
+
if(!(t.length||p<=s))for((t.data!==h||t.next)&&(0===a&&(s+=(a=p6(u))*a),0===r&&(s+=(r=p6(u))*r),s<f)&&(s=Math.sqrt(f*s));t.data!==h&&(o=g[t.data.index]*c/s,h.vx+=a*o,h.vy+=r*o),t=t.next;);}v=Hi(r.map(t=>t.fx)),y=Hi(r.map(t=>t.fy));let k=$a().domain(v).range([0,i]),C=$a().domain(y).range([0,n]);var v=(v[1]-v[0])/(y[1]-y[0])||1,y=i/n,M=(y<v?(M=n*y/v,C.range([(n-M)/2,n-(n-M)/2])):(M=i*v/y,k.range([(i-M)/2,i-(i-M)/2])),r.forEach(t=>{t.x=k(t.fx),t.y=C(t.fy)}),Hi(r.map(t=>t.r))),A=this._sizeMax||Ot([1,Dt(oa(r.map(n=>r.map(t=>n===t?null:Ru([n.x,n.y],[t.x,t.y])))))/2]);let z=Ts["scale"+this._sizeScale.charAt(0).toUpperCase()+this._sizeScale.slice(1)]().domain(M).range([M[0]===M[1]?A:Dt([A/2,this._sizeMin]),A]),T=k.domain(),E=C.domain();var N=T[1]-T[0],P=E[1]-E[0],L=(r.forEach(t=>{var n=z(t.r);T[0]>k.invert(t.x-n)&&(T[0]=k.invert(t.x-n)),T[1]<k.invert(t.x+n)&&(T[1]=k.invert(t.x+n)),E[0]>C.invert(t.y-n)&&(E[0]=C.invert(t.y-n)),E[1]<C.invert(t.y+n)&&(E[1]=C.invert(t.y+n))}),T[1]-T[0]);A*=Dt([N/L,P/(E[1]-E[0])]),z.range([M[0]===M[1]?A:Dt([A/2,this._sizeMin]),A]),k.domain(T),C.domain(E);let B=(y<v?i:n)/2;r.forEach(t=>{t.x=k(t.fx),t.fx=t.x,t.y=C(t.fy),t.fy=t.y,t.r=z(t.r)||B,t.width=2*t.r,t.height=2*t.r}),this._container=this._select.selectAll("svg.d3plus-network").data([0]),this._container=this._container.enter().append("svg").attr("class","d3plus-network").attr("opacity",0).attr("width",i).attr("height",n).attr("x",this._margin.left).attr("y",this._margin.top).style("background-color","transparent").merge(this._container),this._container.transition().duration(t).attr("opacity",1).attr("width",i).attr("height",n).attr("x",this._margin.left).attr("y",this._margin.top);N=this._container.selectAll("rect.d3plus-network-hitArea").data([0]),N.enter().append("rect").attr("class","d3plus-network-hitArea").merge(N).attr("width",i).attr("height",n).attr("fill","transparent").on("click",()=>{this._focus&&(this.active(!1),this._focus=void 0,this._zoomToBounds(null))}),this._zoomGroup=this._container.selectAll("g.d3plus-network-zoomGroup").data([0]),L=this._zoomGroup=this._zoomGroup.enter().append("g").attr("class","d3plus-network-zoomGroup").merge(this._zoomGroup),P=Hi(m,t=>t.size);if(P[0]!==P[1]){let n=Ts["scale"+this._linkSizeScale.charAt(0).toUpperCase()+this._linkSizeScale.slice(1)]().domain(P).range([this._linkSizeMin,z.range()[0]]);m.forEach(t=>{t.size=n(t.size)})}M=Lt.bind(this)(this._shapeConfig,"edge","Path");delete M.on,this._shapes.push((new Sc).config(M).strokeWidth(t=>t.size).activeStyle({"stroke-width":t=>t.size}).d(t=>`M${t.source.x},${t.source.y} ${t.target.x},`+t.target.y).data(m).select(Pt("g.d3plus-network-links",{parent:L,duration:t,enter:{transform:e},update:{transform:e}}).node()).render());let O={label:t=>!!(r.length<=this._dataCutoff||this._hover&&this._hover(t)||this._active&&this._active(t))&&this._drawLabel(t.data||t.node,t.i),select:Pt("g.d3plus-network-nodes",{parent:L,duration:t,enter:{transform:e},update:{transform:e}}).node()};return ca().key(t=>t.shape).entries(r).forEach(t=>{this._shapes.push((new kc[t.key]).config(Lt.bind(this)(this._shapeConfig,"shape",t.key)).config(O).config(O[t.key]||{}).data(t.values).render())}),this}
|
|
6644
6644
|
/**
|
|
6645
6645
|
@memberof Network
|
|
6646
6646
|
@desc If *value* is specified, sets the hover method to the specified function and returns the current class instance.
|
|
@@ -6664,7 +6664,7 @@ if(!(t.length||p<=s))for((t.data!==h||t.next)&&(0===a&&(s+=(a=p6(u))*a),0===r&&(
|
|
|
6664
6664
|
@desc Defines the thickness of the links connecting each node. The value provided can be either a pixel Number to be used for all links, or an accessor function that returns a specific data value to be used in an automatically calculated linear scale.
|
|
6665
6665
|
@param {Function|Name} [*value* = 1]
|
|
6666
6666
|
@chainable
|
|
6667
|
-
*/linkSize(t){return arguments.length?(this._linkSize="function"==typeof t?t:
|
|
6667
|
+
*/linkSize(t){return arguments.length?(this._linkSize="function"==typeof t?t:Bt(t),this):this._linkSize}
|
|
6668
6668
|
/**
|
|
6669
6669
|
@memberof Network
|
|
6670
6670
|
@desc Defines the minimum pixel stroke width used in link sizing.
|
|
@@ -6732,9 +6732,9 @@ if(!(t.length||p<=s))for((t.data!==h||t.next)&&(0===a&&(s+=(a=p6(u))*a),0===r&&(
|
|
|
6732
6732
|
@memberof Network
|
|
6733
6733
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
6734
6734
|
@private
|
|
6735
|
-
*/constructor(){super(),this._links=[],this._linkSize=
|
|
6735
|
+
*/constructor(){super(),this._links=[],this._linkSize=Bt(1),this._linkSizeMin=1,this._linkSizeScale="sqrt",this._noDataMessage=!1,this._nodeGroupBy=[p("id")],this._nodes=[],this._on["click.shape"]=(t,o,n,e)=>{if(this._tooltipClass.data([]).render(),this._hover&&this._drawDepth>=this._groupBy.length-1){let r=M6.bind(this)(t,o);if(this._focus&&this._focus===r)this.active(!1),this._on.mouseenter.bind(this)(t,o,n,e),this._focus=void 0,this._zoomToBounds(null);else{this.hover(!1);t=this._linkLookup[r],o=this._nodeLookup[r];let e=[r],n=[o.x-o.r,o.x+o.r],i=[o.y-o.r,o.y+o.r],a=(t.forEach(t=>{e.push(t.id),t.x-t.r<n[0]&&(n[0]=t.x-t.r),t.x+t.r>n[1]&&(n[1]=t.x+t.r),t.y-t.r<i[0]&&(i[0]=t.y-t.r),t.y+t.r>i[1]&&(i[1]=t.y+t.r)}),this.active((t,n)=>t.source&&t.target?t.source.id===r||t.target.id===r:e.includes(M6.bind(this)(t,n))),this._focus=r,Gd(this._container.node()));n=n.map(t=>t*a.k+a.x),i=i.map(t=>t*a.k+a.y),this._zoomToBounds([[n[0],i[0]],[n[1],i[1]]])}}},this._on["click.legend"]=(t,n,e,i)=>{var r=this._id(t),o=(o=this._ids(t))[o.length-1];if(this._hover&&this._drawDepth>=this._groupBy.length-1){if(this._focus&&this._focus===r)this.active(!1),this._focus=void 0,this._zoomToBounds(null);else{this.hover(!1);var s=r.map(t=>this._nodeLookup[t]);let e=[""+o],n=[s[0].x-s[0].r,s[0].x+s[0].r],i=[s[0].y-s[0].r,s[0].y+s[0].r],a=(s.forEach(t=>{e.push(t.id),t.x-t.r<n[0]&&(n[0]=t.x-t.r),t.x+t.r>n[1]&&(n[1]=t.x+t.r),t.y-t.r<i[0]&&(i[0]=t.y-t.r),t.y+t.r>i[1]&&(i[1]=t.y+t.r)}),this.active((t,n)=>t.source&&t.target?e.includes(t.source.id)&&e.includes(t.target.id):(t=this._ids(t,n),e.includes(""+t[t.length-1]))),this._focus=r,Gd(this._container.node()));n=n.map(t=>t*a.k+a.x),i=i.map(t=>t*a.k+a.y),this._zoomToBounds([[n[0],i[0]],[n[1],i[1]]])}this._on.mouseenter.bind(this)(t,n,e,i),this._on["mousemove.legend"].bind(this)(t,n,e,i)}},this._on.mouseenter=()=>{},this._on["mouseleave.shape"]=()=>{this.hover(!1)};let u=this._on["mousemove.shape"];this._on["mousemove.shape"]=(t,n,e,i)=>{u(t,n,e,i);let a=M6.bind(this)(t,n),r=this._linkLookup[a]||[],o=this._nodeLookup[a],s=[a],l=[o.x-o.r,o.x+o.r],h=[o.y-o.r,o.y+o.r];r.forEach(t=>{s.push(t.id),t.x-t.r<l[0]&&(l[0]=t.x-t.r),t.x+t.r>l[1]&&(l[1]=t.x+t.r),t.y-t.r<h[0]&&(h[0]=t.y-t.r),t.y+t.r>h[1]&&(h[1]=t.y+t.r)}),this.hover((t,n)=>t.source&&t.target?t.source.id===a||t.target.id===a:s.includes(""+this._ids(t,n)[this._drawDepth]))},this._sizeMin=5,this._sizeScale="sqrt",this._shape=Bt("Circle"),this._shapeConfig=Et(this._shapeConfig,{ariaLabel:(t,n)=>{var e=this._size?", "+this._size(t,n):"";return this._drawLabel(t,n)+e+"."},labelConfig:{duration:0,fontMin:1,fontResize:!0,labelPadding:0,textAnchor:"middle",verticalAlign:"middle"},Path:{fill:"none",label:!1,stroke:"#eee"}}),this._x=p("x"),this._y=p("y"),this._zoom=!0}}function z6(t){var n=0,e=t.children,i=e&&e.length;if(i)for(;0<=--i;)n+=e[i].value;else n=1;t.value=n}function T6(t,n){t instanceof Map?(t=[void 0,t],void 0===n&&(n=N6)):void 0===n&&(n=E6);for(var e,i,a,r,o,t=new B6(t),s=[t];e=s.pop();)if((a=n(e.data))&&(o=(a=Array.from(a)).length))for(e.children=a,r=o-1;0<=r;--r)s.push(i=a[r]=new B6(a[r])),i.parent=e,i.depth=e.depth+1;return t.eachBefore(L6)}function E6(t){return t.children}function N6(t){return Array.isArray(t)?t[1]:null}function P6(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function L6(t){for(var n=0;t.height=n,(t=t.parent)&&t.height<++n;);}function B6(t){this.data=t,this.depth=this.height=0,this.parent=null}function O6(t){if("function"!=typeof t)throw new Error;return t}function D6(){return 0}function j6(t){return function(){return t}}
|
|
6736
6736
|
// https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use
|
|
6737
|
-
|
|
6737
|
+
B6.prototype=T6.prototype={constructor:B6,count:function(){return this.eachAfter(z6)},each:function(t,n){let e=-1;for(var i of this)t.call(n,i,++e,this);return this},eachAfter:function(t,n){for(var e,i,a,r=this,o=[r],s=[],l=-1;r=o.pop();)if(s.push(r),e=r.children)for(i=0,a=e.length;i<a;++i)o.push(e[i]);for(;r=s.pop();)t.call(n,r,++l,this);return this},eachBefore:function(t,n){for(var e,i,a,r=[this],o=-1;e=r.pop();)if(t.call(n,e,++o,this),i=e.children)for(a=i.length-1;0<=a;--a)r.push(i[a]);return this},find:function(t,n){let e=-1;for(var i of this)if(t.call(n,i,++e,this))return i},sum:function(a){return this.eachAfter(function(t){for(var n=+a(t.data)||0,e=t.children,i=e&&e.length;0<=--i;)n+=e[i].value;t.value=n})},sort:function(n){return this.eachBefore(function(t){t.children&&t.children.sort(n)})},path:function(t){for(var n=this,e=((t,n)=>{if(t===n)return t;var e=t.ancestors(),i=n.ancestors(),a=null;for(t=e.pop(),n=i.pop();t===n;)a=t,t=e.pop(),n=i.pop();return a})(n,t),i=[n];n!==e;)n=n.parent,i.push(n);for(var a=i.length;t!==e;)i.splice(a,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){return Array.from(this)},leaves:function(){var n=[];return this.eachBefore(function(t){t.children||n.push(t)}),n},links:function(){var n=this,e=[];return n.each(function(t){t!==n&&e.push({source:t.parent,target:t})}),e},copy:function(){return T6(this).eachBefore(P6)},[Symbol.iterator]:function*(){var t,n,e,i,a,r=[this];do{for(n=r.reverse(),r=[];t=n.pop();)if(yield t,e=t.children)for(i=0,a=e.length;i<a;++i)r.push(e[i])}while(r.length)}};let R6=1664525,F6=1013904223,I6=4294967296;function H6(t,n){for(var e,i,a=0,r=(t=((t,n)=>{let e=t.length,i,a;for(;e;)a=n()*e--|0,i=t[e],t[e]=t[a],t[a]=i;return t})(Array.from(t),n)).length,o=[];a<r;)e=t[a],i&&K6(i,e)?++a:(i=(t=>{switch(t.length){case 1:return(t=>({x:t.x,y:t.y,r:t.r}))(t[0]);case 2:return W6(t[0],t[1]);case 3:return q6(t[0],t[1],t[2])}})(o=((t,n)=>{var e,i;if(U6(n,t))return[n];
|
|
6738
6738
|
// If we get here then B must have at least one element.
|
|
6739
6739
|
for(e=0;e<t.length;++e)if(G6(n,t[e])&&U6(W6(t[e],n),t))return[t[e],n];
|
|
6740
6740
|
// If we get here then B must have at least two elements.
|
|
@@ -6763,7 +6763,7 @@ o=Y6(d);(a=a.next)!==i;)(s=Y6(a))<o&&(d=a,o=s);i=d.next}
|
|
|
6763
6763
|
for(d=[i._],a=i;(a=a.next)!==i;)d.push(a._);
|
|
6764
6764
|
// Translate the circles to put the enclosing circle around the origin.
|
|
6765
6765
|
for(a=H6(d,n),l=0;l<r;++l)(d=t[l]).x-=a.x,d.y-=a.y;return a.r}function J6(t){return Math.sqrt(t.value)}function Q6(){var e=null,i=1,a=1,r=D6;function n(t){var n=(// 2^32
|
|
6766
|
-
()=>{let t=1;return()=>(t=(R6*t+
|
|
6766
|
+
()=>{let t=1;return()=>(t=(R6*t+F6)%I6)/I6})();return t.x=i/2,t.y=a/2,e?t.eachBefore(t9(e)).eachAfter(n9(r,.5,n)).eachBefore(e9(1)):t.eachBefore(t9(J6)).eachAfter(n9(D6,1,n)).eachAfter(n9(r,t.r/Math.min(i,a),n)).eachBefore(e9(Math.min(i,a)/(2*t.r))),t}return n.radius=function(t){return arguments.length?(e=null==(t=t)?null:O6(t),n):e},n.size=function(t){return arguments.length?(i=+t[0],a=+t[1],n):[i,a]},n.padding=function(t){return arguments.length?(r="function"==typeof t?t:j6(+t),n):r},n}function t9(n){return function(t){t.children||(t.r=Math.max(0,+n(t)||0))}}function n9(o,s,l){return function(t){if(n=t.children){var n,e,i,a=n.length,r=o(t)*s||0;if(r)for(e=0;e<a;++e)n[e].r+=r;if(i=X6(n,l),r)for(e=0;e<a;++e)n[e].r-=r;t.r=i+r}}}function e9(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function i9(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function a9(t,n,e,i,a){for(var r,o=t.children,s=-1,l=o.length,h=t.value&&(i-n)/t.value;++s<l;)(r=o[s]).y0=e,r.y1=a,r.x0=n,r.x1=n+=r.value*h}function r9(t,n){return t.parent===n.parent?1:2}
|
|
6767
6767
|
// function radialSeparation(a, b) {
|
|
6768
6768
|
// return (a.parent === b.parent ? 1 : 2) / a.depth;
|
|
6769
6769
|
// }
|
|
@@ -6815,7 +6815,7 @@ function c(t){var n=t.children,e=t.parent.children,i=t.i?e[t.i-1]:null;if(n){for
|
|
|
6815
6815
|
// returns the specified (default) ancestor.
|
|
6816
6816
|
(t,n,e)=>t.a.parent===n.parent?t.a:e)(o,t,e),t,i),l+=i,h+=i),u+=o.m,l+=a.m,c+=s.m,h+=r.m;o&&!s9(r)&&(r.t=o,r.m+=u-h),a&&!o9(s)&&(s.t=a,s.m+=l-c,e=t)}return e})(t,i,t.parent.A||e[0])}
|
|
6817
6817
|
// Computes all real x-coordinates by summing up the modifiers recursively.
|
|
6818
|
-
function d(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function f(t){t.x*=l,t.y=t.depth*h}return n.separation=function(t){return arguments.length?(g=t,n):g},n.size=function(t){return arguments.length?(u=!1,l=+t[0],h=+t[1],n):u?null:[l,h]},n.nodeSize=function(t){return arguments.length?(u=!0,l=+t[0],h=+t[1],n):u?[l,h]:null},n}function u9(t,n,e,i,a){for(var r,o=t.children,s=-1,l=o.length,h=t.value&&(a-e)/t.value;++s<l;)(r=o[s]).x0=n,r.x1=i,r.y0=e,r.y1=e+=r.value*h}l9.prototype=Object.create(
|
|
6818
|
+
function d(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function f(t){t.x*=l,t.y=t.depth*h}return n.separation=function(t){return arguments.length?(g=t,n):g},n.size=function(t){return arguments.length?(u=!1,l=+t[0],h=+t[1],n):u?null:[l,h]},n.nodeSize=function(t){return arguments.length?(u=!0,l=+t[0],h=+t[1],n):u?[l,h]:null},n}function u9(t,n,e,i,a){for(var r,o=t.children,s=-1,l=o.length,h=t.value&&(a-e)/t.value;++s<l;)(r=o[s]).x0=n,r.x1=i,r.y0=e,r.y1=e+=r.value*h}l9.prototype=Object.create(B6.prototype);lh=(1+Math.sqrt(5))/2;function c9(t,n,e,i,a,r){for(var o,s,l,h,u,c,g,d,f,p,_,m=[],y=n.children,v=0,b=0,x=y.length,w=n.value;v<x;){
|
|
6819
6819
|
// Find the next non-empty node.
|
|
6820
6820
|
for(l=a-e,h=r-i;!(u=y[b++].value)&&b<x;);
|
|
6821
6821
|
// Keep adding nodes while the aspect ratio maintains or improves.
|
|
@@ -6825,7 +6825,7 @@ m.push(o={value:u,dice:l<h,children:y.slice(v,b)}),o.dice?a9(o,e,i,a,w?i+=h*u/w:
|
|
|
6825
6825
|
/**
|
|
6826
6826
|
Extends the draw behavior of the abstract Viz class.
|
|
6827
6827
|
@private
|
|
6828
|
-
*/_draw(t){super._draw(t);var t=this._height-this._margin.top-this._margin.bottom,n=this._width-this._margin.left-this._margin.right,e=Math.min(t,n),n=`translate(${(n-e)/2}, ${(t-e)/2})`;let i=ca();for(let t=0;t<=this._drawDepth;t++)i.key(this._groupBy[t]);i=i.entries(this._filteredData);t=this._pack.padding(this._layoutPadding).size([e,e])(T6({key:i.key,values:i},t=>t.values).sum(this._sum).sort(this._sort)).descendants().filter((t,n)=>(t.__d3plus__=!0,t.i=n,t.id=t.parent?t.parent.data.key:"root",t.data.__d3plusOpacity__=t.height?this._packOpacity(t.data,n):1,t.data.__d3plusTooltip__=!t.height,!t.children||1<t.children.length));return this._shapes.push((new _c).data(t).select(Pt("g.d3plus-Pack",{parent:this._select,enter:{transform:n},update:{transform:n}}).node()).config(
|
|
6828
|
+
*/_draw(t){super._draw(t);var t=this._height-this._margin.top-this._margin.bottom,n=this._width-this._margin.left-this._margin.right,e=Math.min(t,n),n=`translate(${(n-e)/2}, ${(t-e)/2})`;let i=ca();for(let t=0;t<=this._drawDepth;t++)i.key(this._groupBy[t]);i=i.entries(this._filteredData);t=this._pack.padding(this._layoutPadding).size([e,e])(T6({key:i.key,values:i},t=>t.values).sum(this._sum).sort(this._sort)).descendants().filter((t,n)=>(t.__d3plus__=!0,t.i=n,t.id=t.parent?t.parent.data.key:"root",t.data.__d3plusOpacity__=t.height?this._packOpacity(t.data,n):1,t.data.__d3plusTooltip__=!t.height,!t.children||1<t.children.length));return this._shapes.push((new _c).data(t).select(Pt("g.d3plus-Pack",{parent:this._select,enter:{transform:n},update:{transform:n}}).node()).config(Lt.bind(this)(this._shapeConfig,"shape","Circle")).render()),this}
|
|
6829
6829
|
/**
|
|
6830
6830
|
@memberof Pack
|
|
6831
6831
|
@desc If *value* is specified, sets the hover method to the specified function and returns the current class instance.
|
|
@@ -6841,7 +6841,7 @@ m.push(o={value:u,dice:l<h,children:y.slice(v,b)}),o.dice?a9(o,e,i,a,w?i+=h*u/w:
|
|
|
6841
6841
|
@memberof Pack
|
|
6842
6842
|
@desc If *value* is specified, sets the padding accessor to the specified function or number and returns the current class instance. If *value* is not specified, returns the current pack opacity accessor.
|
|
6843
6843
|
@param {Function|Number} [*value*]
|
|
6844
|
-
*/packOpacity(t){return arguments.length?(this._packOpacity="function"==typeof t?t:
|
|
6844
|
+
*/packOpacity(t){return arguments.length?(this._packOpacity="function"==typeof t?t:Bt(t),this):this._packOpacity}
|
|
6845
6845
|
/**
|
|
6846
6846
|
@memberof Pack
|
|
6847
6847
|
@desc If *comparator* is specified, sets the sort order for the pack using the specified comparator function. If *comparator* is not specified, returns the current group sort order, which defaults to descending order by the associated input data's numeric value attribute.
|
|
@@ -6864,12 +6864,12 @@ m.push(o={value:u,dice:l<h,children:y.slice(v,b)}),o.dice?a9(o,e,i,a,w?i+=h*u/w:
|
|
|
6864
6864
|
@memberof Pack
|
|
6865
6865
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
6866
6866
|
@private
|
|
6867
|
-
*/constructor(){super(),this._layoutPadding=1;let e=this._legend,o=(this._legend=(t,n)=>n.length!==this._filteredData.length&&e.bind(this)(t,n),this._on.mouseenter=()=>{},this._on["mousemove.legend"]),r=(this._on["mousemove.legend"]=(e,t,n,i)=>{o(e,t,n,i);let a=this._ids(e,t),r=f9(e);this.hover(n=>(Object.keys(n).filter(t=>"value"!==t).every(t=>e[t]&&e[t].includes(n[t]))?r.push(n):a.includes(n.key)&&r.push(...f9(n,[n])),r.includes(n)))},this._on["mousemove.shape"]);this._on["mousemove.shape"]=(t,n,e,i)=>{t.__d3plusTooltip__&&r(t,n,e,i);let a=f9(t,[t]);this.hover(t=>a.includes(t))},this._pack=Q6(),this._packOpacity=
|
|
6867
|
+
*/constructor(){super(),this._layoutPadding=1;let e=this._legend,o=(this._legend=(t,n)=>n.length!==this._filteredData.length&&e.bind(this)(t,n),this._on.mouseenter=()=>{},this._on["mousemove.legend"]),r=(this._on["mousemove.legend"]=(e,t,n,i)=>{o(e,t,n,i);let a=this._ids(e,t),r=f9(e);this.hover(n=>(Object.keys(n).filter(t=>"value"!==t).every(t=>e[t]&&e[t].includes(n[t]))?r.push(n):a.includes(n.key)&&r.push(...f9(n,[n])),r.includes(n)))},this._on["mousemove.shape"]);this._on["mousemove.shape"]=(t,n,e,i)=>{t.__d3plusTooltip__&&r(t,n,e,i);let a=f9(t,[t]);this.hover(t=>a.includes(t))},this._pack=Q6(),this._packOpacity=Bt(.25),this._shape=Bt("Circle"),this._shapeConfig=Et(this._shapeConfig,{Circle:{label:t=>!(!t.parent||t.children)&&t.id,labelConfig:{fontResize:!0},opacity:t=>t.__d3plusOpacity__}}),this._sort=(t,n)=>n.value-t.value,this._sum=p("value")}}class _9 extends Sf{
|
|
6868
6868
|
/**
|
|
6869
6869
|
@memberof Priestley
|
|
6870
6870
|
@desc Extends the render behavior of the abstract Viz class.
|
|
6871
6871
|
@private
|
|
6872
|
-
*/_draw(r){if(super._draw(r),this._filteredData){r=this._filteredData.map((t,n)=>({__d3plus__:!0,data:t,end:"time"===this._axisConfig.scale?Nt(this._end(t,n)):this._end(t,n),i:n,id:this._id(t,n),start:"time"===this._axisConfig.scale?Nt(this._start(t,n)):this._start(t,n)})).filter(t=>0<t.end-t.start).sort((t,n)=>t.start-n.start);let t;if(1<this._groupBy.length&&0<this._drawDepth){var o=ca();for(let n=0;n<this._drawDepth;n++)o.key(t=>this._groupBy[n](t.data,t.i));t=o.entries(r)}else t=[{values:r}];let i=0;t.forEach(t=>{let e=[];t.values.forEach(n=>{var t=(e=e.map(t=>!(t<=n.start)&&t)).indexOf(!1);t<0?(n.lane=i+e.length,e.push(n.end)):(e[t]=n.end,n.lane=i+t)}),i+=e.length});var s={domain:[Dt(r,t=>t.start)||0,Ot(r,t=>t.end)||0],height:this._height-this._margin.top-this._margin.bottom,width:this._width-this._margin.left-this._margin.right},l=`translate(${this._margin.left}, ${this._margin.top})`,s=(this._axisTest.config(s).config(this._axisConfig).select(Pt("g.d3plus-priestley-axis-test",{parent:this._select,enter:{opacity:0}}).node()).render(),this._axis.config(s).config(this._axisConfig).select(Pt("g.d3plus-priestley-axis",{parent:this._select,enter:{transform:l},update:{transform:l}}).node()).render(),this._axisTest._padding);let n=this._axis._d3Scale,e=xa().domain(jt(0,i,1)).paddingInner(this._paddingInner).paddingOuter(this._paddingOuter).rangeRound([this._height-this._margin.bottom-this._axisTest.outerBounds().height-s,this._margin.top+s]),a=e.bandwidth();this._shapes.push((new mc).data(r).duration(this._duration).height(a).label((t,n)=>this._drawLabel(t.data,n)).select(Pt("g.d3plus-priestley-shapes",{parent:this._select}).node()).width(t=>{t=Math.abs(n(t.end)-n(t.start));return 2<t?t-2:t}).x(t=>n(t.start)+(n(t.end)-n(t.start))/2).y(t=>e(t.lane)+a/2).config(
|
|
6872
|
+
*/_draw(r){if(super._draw(r),this._filteredData){r=this._filteredData.map((t,n)=>({__d3plus__:!0,data:t,end:"time"===this._axisConfig.scale?Nt(this._end(t,n)):this._end(t,n),i:n,id:this._id(t,n),start:"time"===this._axisConfig.scale?Nt(this._start(t,n)):this._start(t,n)})).filter(t=>0<t.end-t.start).sort((t,n)=>t.start-n.start);let t;if(1<this._groupBy.length&&0<this._drawDepth){var o=ca();for(let n=0;n<this._drawDepth;n++)o.key(t=>this._groupBy[n](t.data,t.i));t=o.entries(r)}else t=[{values:r}];let i=0;t.forEach(t=>{let e=[];t.values.forEach(n=>{var t=(e=e.map(t=>!(t<=n.start)&&t)).indexOf(!1);t<0?(n.lane=i+e.length,e.push(n.end)):(e[t]=n.end,n.lane=i+t)}),i+=e.length});var s={domain:[Dt(r,t=>t.start)||0,Ot(r,t=>t.end)||0],height:this._height-this._margin.top-this._margin.bottom,width:this._width-this._margin.left-this._margin.right},l=`translate(${this._margin.left}, ${this._margin.top})`,s=(this._axisTest.config(s).config(this._axisConfig).select(Pt("g.d3plus-priestley-axis-test",{parent:this._select,enter:{opacity:0}}).node()).render(),this._axis.config(s).config(this._axisConfig).select(Pt("g.d3plus-priestley-axis",{parent:this._select,enter:{transform:l},update:{transform:l}}).node()).render(),this._axisTest._padding);let n=this._axis._d3Scale,e=xa().domain(jt(0,i,1)).paddingInner(this._paddingInner).paddingOuter(this._paddingOuter).rangeRound([this._height-this._margin.bottom-this._axisTest.outerBounds().height-s,this._margin.top+s]),a=e.bandwidth();this._shapes.push((new mc).data(r).duration(this._duration).height(a).label((t,n)=>this._drawLabel(t.data,n)).select(Pt("g.d3plus-priestley-shapes",{parent:this._select}).node()).width(t=>{t=Math.abs(n(t.end)-n(t.start));return 2<t?t-2:t}).x(t=>n(t.start)+(n(t.end)-n(t.start))/2).y(t=>e(t.lane)+a/2).config(Lt.bind(this)(this._shapeConfig,"shape","Rect")).render())}return this}
|
|
6873
6873
|
/**
|
|
6874
6874
|
@memberof Priestley
|
|
6875
6875
|
@desc If *value* is specified, sets the config method for the axis and returns the current class instance. If *value* is not specified, returns the current axis configuration.
|
|
@@ -6908,7 +6908,7 @@ m.push(o={value:u,dice:l<h,children:y.slice(v,b)}),o.dice?a9(o,e,i,a,w?i+=h*u/w:
|
|
|
6908
6908
|
/**
|
|
6909
6909
|
Extends the draw behavior of the abstract Viz class.
|
|
6910
6910
|
@private
|
|
6911
|
-
*/_draw(t){super._draw(t);let h=this._height-this._margin.top-this._margin.bottom,u=this._width-this._margin.left-this._margin.right,c=Dt([h,u])/2-this._outerPadding,n=`translate(${u/2}, ${h/2})`;var t=ca().key(this._metric).entries(this._filteredData),e=ca().key(this._id).key(this._metric).entries(this._filteredData);let i=Ot(e.map(t=>t.values.map(t=>sa(t.values,(t,n)=>this._value(t,n)))).flat());var a=Array.from(Array(this._levels).keys()).map(t=>({id:t,r:c*((t+1)/this._levels)})),r=
|
|
6911
|
+
*/_draw(t){super._draw(t);let h=this._height-this._margin.top-this._margin.bottom,u=this._width-this._margin.left-this._margin.right,c=Dt([h,u])/2-this._outerPadding,n=`translate(${u/2}, ${h/2})`;var t=ca().key(this._metric).entries(this._filteredData),e=ca().key(this._id).key(this._metric).entries(this._filteredData);let i=Ot(e.map(t=>t.values.map(t=>sa(t.values,(t,n)=>this._value(t,n)))).flat());var a=Array.from(Array(this._levels).keys()).map(t=>({id:t,r:c*((t+1)/this._levels)})),r=Lt.bind(this)(this._axisConfig.shapeConfig,"shape","Circle");delete r.label,(new _c).data(a).select(Pt("g.d3plus-Radar-radial-circles",{parent:this._select,enter:{transform:n},update:{transform:n}}).node()).config(r).render();let g=t.length;var a=t.map((t,n)=>{var e=this._outerPadding,i=2*(1.4*(this._shapeConfig.labelConfig.fontSize&&this._shapeConfig.labelConfig.fontSize(t,n)||11)),a=parseInt(360-360/g*n/90,10)%4+1,r=m9/g*n;let o=360/g*n,s="start",l=10;2!=a&&3!=a||(l=-e-10,s="end",o+=180);a={x:l,y:-i/2,width:e,height:i};return{__d3plus__:!0,data:cu(t.values,this._aggs),i:n,id:t.key,angle:o,textAnchor:s,labelBounds:a,rotateAnchor:[-l,i/2],x:c*Math.cos(r),y:c*Math.sin(r)}}).sort((t,n)=>t.key-n.key),r=((new mc).data(a).rotate(t=>t.angle||0).width(0).height(0).x(t=>t.x).y(t=>t.y).label(t=>t.id).labelBounds(t=>t.labelBounds).labelConfig(this._axisConfig.shapeConfig.labelConfig).select(Pt("g.d3plus-Radar-text",{parent:this._select,enter:{transform:n},update:{transform:n}}).node()).render(),(new Sc).data(a).d(t=>`M0,0 ${-t.x},`+-t.y).select(Pt("g.d3plus-Radar-axis",{parent:this._select,enter:{transform:n},update:{transform:n}}).node()).config(Lt.bind(this)(this._axisConfig.shapeConfig,"shape","Path")).render(),e.map(t=>{var n=t.values.map((t,n)=>{t=sa(t.values,(t,n)=>this._value(t,n))/i*c,n=m9/g*n;return{x:t*Math.cos(n),y:t*Math.sin(n)}}),e=`M ${n[0].x} ${n[0].y} ${n.map(t=>`L ${t.x} `+t.y).join(" ")} L ${n[0].x} `+n[0].y;return{arr:t.values.map(t=>cu(t.values,this._aggs)),id:t.key,points:n,d:e,__d3plus__:!0,data:cu(t.values.map(t=>cu(t.values,this._aggs)),this._aggs)}})),o=Lt.bind(this)(this._shapeConfig,"shape","Path"),s=Object.keys(o.on);o.on={};for(let t=0;t<s.length;t++){let l=s[t];o.on[l]=(t,n,e,i)=>{var a=t.points.map(t=>t.x+u/2),r=t.points.map(t=>t.y+h/2);let o=vt(i,this._select.node());a=a.map(t=>Math.abs(t-o[0]));let s=r.map(t=>Math.abs(t-o[1]));r=a.map((t,n)=>t+s[n]);this._on[l].bind(this)(t.arr[r.indexOf(Dt(r))],n,e,i)}}return this._shapes.push((new Sc).data(r).d(t=>t.d).select(Pt("g.d3plus-Radar-items",{parent:this._select,enter:{transform:n},update:{transform:n}}).node()).config(o).render()),this}
|
|
6912
6912
|
/**
|
|
6913
6913
|
@memberof Radar
|
|
6914
6914
|
@desc Sets the config method used for the radial spokes, circles, and labels.
|
|
@@ -6940,7 +6940,7 @@ m.push(o={value:u,dice:l<h,children:y.slice(v,b)}),o.dice?a9(o,e,i,a,w?i+=h*u/w:
|
|
|
6940
6940
|
@memberof Radar
|
|
6941
6941
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from Viz.
|
|
6942
6942
|
@private
|
|
6943
|
-
*/constructor(){super(),this._axisConfig={shapeConfig:{fill:
|
|
6943
|
+
*/constructor(){super(),this._axisConfig={shapeConfig:{fill:Bt("none"),labelConfig:{fontColor:"#999",padding:0,textAnchor:(t,n,e)=>e.textAnchor,verticalAlign:"middle"},stroke:"#eee",strokeWidth:Bt(1)}},this._discrete="metric",this._levels=6,this._metric=p("metric"),this._outerPadding=100,this._shape=Bt("Path"),this._value=p("value")}}let v9=2*Math.PI;class b9 extends Sf{
|
|
6944
6944
|
/**
|
|
6945
6945
|
@memberof RadialMatrix
|
|
6946
6946
|
@desc Extends the draw behavior of the abstract Viz class.
|
|
@@ -6949,7 +6949,7 @@ m.push(o={value:u,dice:l<h,children:y.slice(v,b)}),o.dice?a9(o,e,i,a,w?i+=h*u/w:
|
|
|
6949
6949
|
/**
|
|
6950
6950
|
* Extracts the axis config "labels" Array, if it exists, it filters
|
|
6951
6951
|
* the column labels by the values included in the Array.
|
|
6952
|
-
*/l=this._columnConfig.labels instanceof Array?n.filter(t=>this._columnConfig.labels.includes(t.key)):n;this._columnLabels.data(l).x(t=>t.x).y(t=>t.y).text(t=>t.key).width(100).height(50).config(this._columnConfig.shapeConfig.labelConfig).select(Pt("g.d3plus-RadialMatrix-columns",{parent:g,transition:d,enter:{transform:t},update:{transform:t}}).node()).render();let e=this._innerRadius(o),i=(o-e)/h.length,a=1<n.length?n[1].radians-n[0].radians:v9,r=h.slice().reverse();f=nl().padAngle(this._cellPadding/o).innerRadius(t=>e+r.indexOf(t.row)*i+this._cellPadding/2).outerRadius(t=>e+(r.indexOf(t.row)+1)*i-this._cellPadding/2).startAngle(t=>n[u.indexOf(t.column)].radians-a/2).endAngle(t=>n[u.indexOf(t.column)].radians+a/2);this._shapes.push((new Sc).data(c).d(f).select(Pt("g.d3plus-RadialMatrix-arcs",{parent:g,transition:d,enter:{transform:t},update:{transform:t}}).node()).config({id:t=>this._ids(t).join("-"),x:0,y:0}).config(
|
|
6952
|
+
*/l=this._columnConfig.labels instanceof Array?n.filter(t=>this._columnConfig.labels.includes(t.key)):n;this._columnLabels.data(l).x(t=>t.x).y(t=>t.y).text(t=>t.key).width(100).height(50).config(this._columnConfig.shapeConfig.labelConfig).select(Pt("g.d3plus-RadialMatrix-columns",{parent:g,transition:d,enter:{transform:t},update:{transform:t}}).node()).render();let e=this._innerRadius(o),i=(o-e)/h.length,a=1<n.length?n[1].radians-n[0].radians:v9,r=h.slice().reverse();f=nl().padAngle(this._cellPadding/o).innerRadius(t=>e+r.indexOf(t.row)*i+this._cellPadding/2).outerRadius(t=>e+(r.indexOf(t.row)+1)*i-this._cellPadding/2).startAngle(t=>n[u.indexOf(t.column)].radians-a/2).endAngle(t=>n[u.indexOf(t.column)].radians+a/2);this._shapes.push((new Sc).data(c).d(f).select(Pt("g.d3plus-RadialMatrix-arcs",{parent:g,transition:d,enter:{transform:t},update:{transform:t}}).node()).config({id:t=>this._ids(t).join("-"),x:0,y:0}).config(Lt.bind(this)(this._shapeConfig,"shape","Path")).render())}return this}
|
|
6953
6953
|
/**
|
|
6954
6954
|
@memberof RadialMatrix
|
|
6955
6955
|
@desc The pixel padding in between each cell.
|
|
@@ -6992,7 +6992,7 @@ m.push(o={value:u,dice:l<h,children:y.slice(v,b)}),o.dice?a9(o,e,i,a,w?i+=h*u/w:
|
|
|
6992
6992
|
function(outerRadius) {
|
|
6993
6993
|
return outerRadius / 5;
|
|
6994
6994
|
}
|
|
6995
|
-
*/innerRadius(t){return arguments.length?(this._innerRadius="function"==typeof t?t:
|
|
6995
|
+
*/innerRadius(t){return arguments.length?(this._innerRadius="function"==typeof t?t:Bt(t),this):this._innerRadius}
|
|
6996
6996
|
/**
|
|
6997
6997
|
@memberof RadialMatrix
|
|
6998
6998
|
@desc Determines which key in your data should be used for each row in the matrix. Can be either a String that matches a key used in every data point, or an accessor function that receives a data point and it's index in the data array, and is expected to return it's row value.
|
|
@@ -7020,11 +7020,11 @@ m.push(o={value:u,dice:l<h,children:y.slice(v,b)}),o.dice?a9(o,e,i,a,w?i+=h*u/w:
|
|
|
7020
7020
|
@memberof RadialMatrix
|
|
7021
7021
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
7022
7022
|
@private
|
|
7023
|
-
*/constructor(){super(),this._cellPadding=2,this._column=p("column"),this._columnConfig={shapeConfig:{labelConfig:{fontColor:"#000",padding:5,textAnchor:t=>[0,180].includes(t.angle)?"middle":[2,3].includes(t.quadrant)?"end":"start",verticalAlign:t=>[90,270].includes(t.angle)?"middle":[2,1].includes(t.quadrant)?"bottom":"top"}}},this._columnSort=(t,n)=>(""+t).localeCompare(""+n),this._innerRadius=t=>t/5,this._label=(t,n)=>
|
|
7023
|
+
*/constructor(){super(),this._cellPadding=2,this._column=p("column"),this._columnConfig={shapeConfig:{labelConfig:{fontColor:"#000",padding:5,textAnchor:t=>[0,180].includes(t.angle)?"middle":[2,3].includes(t.quadrant)?"end":"start",verticalAlign:t=>[90,270].includes(t.angle)?"middle":[2,1].includes(t.quadrant)?"bottom":"top"}}},this._columnSort=(t,n)=>(""+t).localeCompare(""+n),this._innerRadius=t=>t/5,this._label=(t,n)=>Bi.bind(this)("row",t,n)+" / "+Bi.bind(this)("column",t,n);let o=this._on["mousemove.shape"];this._on["mousemove.shape"]=(t,n,e,i)=>{o(t,n,e,i);let a=Bi.bind(this)("row",t,n),r=Bi.bind(this)("column",t,n);this.hover((t,n)=>Bi.bind(this)("row",t,n)===a||Bi.bind(this)("column",t,n)===r)},this._row=p("row"),this._rowSort=(t,n)=>(""+t).localeCompare(""+n),this._columnLabels=new Ic}}class x9 extends Sf{
|
|
7024
7024
|
/**
|
|
7025
7025
|
Extends the draw behavior of the abstract Viz class.
|
|
7026
7026
|
@private
|
|
7027
|
-
*/_draw(e){super._draw(e);let a=this._filteredData.reduce((t,n,e)=>(t[this._id(n,e)]=n,t),{}),l=this._nodes;!this._nodes.length&&this._links.length&&(e=Array.from(new Set(this._links.reduce((t,n)=>t.concat([n.source,n.target]),[]))),l=e.map(t=>"object"==typeof t?t:{id:t})),l=l.reduce((t,n,e)=>(t[this._nodeGroupBy?this._nodeGroupBy[this._drawDepth](n,e):this._id(n,e)]=n,t),{}),l=Array.from(new Set(Object.keys(a).concat(Object.keys(l)))).map((t,n)=>{var e=a[t],i=l[t];return void 0!==i&&{__d3plus__:!0,data:e||i,i:n,id:t,node:i,shape:void 0!==e&&void 0!==this._shape(e)?this._shape(e):this._shape(i)}}).filter(t=>t);let i=this._nodeLookup=l.reduce((t,n)=>(t[n.id]=n,t),{});e=this._links.map(e=>{var t=["source","target"].reduce((t,n)=>(t[n]="number"==typeof e[n]?l[e[n]]:i[e[n].id||e[n]],t),{});return t.size=this._linkSize(e),t});let r=e.reduce((t,n)=>(t[n.source.id]||(t[n.source.id]=[]),t[n.source.id].push(n),t[n.target.id]||(t[n.target.id]=[]),t[n.target.id].push(n),t),{}),t=this._duration,h=this._height-this._margin.top-this._margin.bottom,n=`translate(${this._margin.left}, ${this._margin.top})`,u=this._width-this._margin.left-this._margin.right,c=[],o=Dt([h,u])/2,g=o/3,d=g,f=2*g,p=i[this._center],s=(p.x=u/2,p.y=h/2,p.r=this._sizeMin?Ot([this._sizeMin,.65*d]):this._sizeMax?Dt([this._sizeMax,.65*d]):.65*d,[p]),_=[],m=(r[this._center].forEach(t=>{var n=t.source.id===this._center?t.target:t.source;n.edges=r[n.id].filter(t=>t.source.id!==this._center||t.target.id!==this._center),n.edge=t,s.push(n),_.push(n)}),_.sort((t,n)=>t.edges.length-n.edges.length),[]),y=0,v=(_.forEach(t=>{let e=t.id;t.edges=t.edges.filter(t=>!s.includes(t.source)&&t.target.id===e||!s.includes(t.target)&&t.source.id===e),y+=t.edges.length||1,t.edges.forEach(t=>{var{source:t,target:n}=t,t=n.id===e?t:n;s.push(t)})}),2*Math.PI),b=0;_.forEach((i,t)=>{let a=i.edges.length||1;var n=v/y*a;0===t&&(b-=n/2);let r=b+n/2-v/4;i.radians=r,i.x=u/2+d*Math.cos(r),i.y=h/2+d*Math.sin(r),b+=n,i.edges.forEach((t,n)=>{var t=t.source.id===i.id?t.target:t.source,e=v/y,e=r-e*a/2+e/2+e*n;t.radians=e,t.x=u/2+f*Math.cos(e),t.y=h/2+f*Math.sin(e),m.push(t)})});var x=g/2,w=g/4;let S=x/2-4,k=(x/2-4<8&&(S=Dt([x/2,8])),w/2-4);(k=(k=w/2-4<4?Dt([w/2,4]):k)>g/10?g/10:k)>S&&10<k&&(k=.75*S),S>1.5*k&&(S=1.5*k),S=Math.floor(S),k=Math.floor(k);let C;this._size?((x=Hi(a,t=>t.size))[0]===x[1]&&(x[0]=0),C=$a().domain(x).rangeRound([3,Dt([S,k])]),w=p.size,p.r=C(w)):C=$a().domain([1,2]).rangeRound([S,k]),m.forEach(t=>{t.ring=2;var n=this._size?t.size:2;t.r=this._sizeMin?Ot([this._sizeMin,C(n)]):this._sizeMax?Dt([this._sizeMax,C(n)]):C(n)}),_.forEach(t=>{t.ring=1;var n=this._size?t.size:1;t.r=this._sizeMin?Ot([this._sizeMin,C(n)]):this._sizeMax?Dt([this._sizeMax,C(n)]):C(n)}),l=[p].concat(_).concat(m),_.forEach(s=>{let e=s.edge;["source","target"].forEach(n=>{e[n]=l.find(t=>t.id===e[n].id)}),c.push(e),r[s.id].forEach(o=>{let n=o.source.id===s.id?o.target:o.source;if(n.id!==p.id){let r=m.find(t=>t.id===n.id);if(r=r||_.find(t=>t.id===n.id)){o.spline=!0;let e=u/2,i=h/2,a=d+.5*(f-d);["source","target"].forEach((n,t)=>{o[n+"X"]=o[n].x+Math.cos(2===o[n].ring?o[n].radians+Math.PI:o[n].radians)*o[n].r,o[n+"Y"]=o[n].y+Math.sin(2===o[n].ring?o[n].radians+Math.PI:o[n].radians)*o[n].r,o[n+"BisectX"]=e+a*Math.cos(o[n].radians),o[n+"BisectY"]=i+a*Math.sin(o[n].radians),o[n]=l.find(t=>t.id===o[n].id),void 0===o[n].edges&&(o[n].edges={});t=(0===t?o.target:o.source).id;o[n].id===s.id?o[n].edges[t]={angle:s.radians+Math.PI,radius:g/2}:o[n].edges[t]={angle:r.radians,radius:g/2}}),c.push(o)}}})}),l.forEach(i=>{if(i.id!==this._center){var a=1.4*(this._shapeConfig.labelConfig.fontSize&&this._shapeConfig.labelConfig.fontSize(i)||11),r=2*a,o=g-i.r;let t=i.radians*(180/Math.PI),n=i.r+5,e="start";(t<-90||90<t)&&(n=-i.r-o-5,e="end",t+=180),i.labelBounds={x:n,y:-a/2,width:o,height:r},i.rotate=t,i.textAnchor=e}else i.labelBounds={x:-d/2,y:-d/2,width:d,height:d}}),this._linkLookup=e.reduce((t,n)=>(t[n.source.id]||(t[n.source.id]=[]),t[n.source.id].push(n.target),t[n.target.id]||(t[n.target.id]=[]),t[n.target.id].push(n.source),t),{});x=Hi(e,t=>t.size);if(x[0]!==x[1]){let t=Dt(l,t=>t.r),n=Ts["scale"+this._linkSizeScale.charAt(0).toUpperCase()+this._linkSizeScale.slice(1)]().domain(x).range([this._linkSizeMin,t]);e.forEach(t=>{t.size=n(t.size)})}w=
|
|
7027
|
+
*/_draw(e){super._draw(e);let a=this._filteredData.reduce((t,n,e)=>(t[this._id(n,e)]=n,t),{}),l=this._nodes;!this._nodes.length&&this._links.length&&(e=Array.from(new Set(this._links.reduce((t,n)=>t.concat([n.source,n.target]),[]))),l=e.map(t=>"object"==typeof t?t:{id:t})),l=l.reduce((t,n,e)=>(t[this._nodeGroupBy?this._nodeGroupBy[this._drawDepth](n,e):this._id(n,e)]=n,t),{}),l=Array.from(new Set(Object.keys(a).concat(Object.keys(l)))).map((t,n)=>{var e=a[t],i=l[t];return void 0!==i&&{__d3plus__:!0,data:e||i,i:n,id:t,node:i,shape:void 0!==e&&void 0!==this._shape(e)?this._shape(e):this._shape(i)}}).filter(t=>t);let i=this._nodeLookup=l.reduce((t,n)=>(t[n.id]=n,t),{});e=this._links.map(e=>{var t=["source","target"].reduce((t,n)=>(t[n]="number"==typeof e[n]?l[e[n]]:i[e[n].id||e[n]],t),{});return t.size=this._linkSize(e),t});let r=e.reduce((t,n)=>(t[n.source.id]||(t[n.source.id]=[]),t[n.source.id].push(n),t[n.target.id]||(t[n.target.id]=[]),t[n.target.id].push(n),t),{}),t=this._duration,h=this._height-this._margin.top-this._margin.bottom,n=`translate(${this._margin.left}, ${this._margin.top})`,u=this._width-this._margin.left-this._margin.right,c=[],o=Dt([h,u])/2,g=o/3,d=g,f=2*g,p=i[this._center],s=(p.x=u/2,p.y=h/2,p.r=this._sizeMin?Ot([this._sizeMin,.65*d]):this._sizeMax?Dt([this._sizeMax,.65*d]):.65*d,[p]),_=[],m=(r[this._center].forEach(t=>{var n=t.source.id===this._center?t.target:t.source;n.edges=r[n.id].filter(t=>t.source.id!==this._center||t.target.id!==this._center),n.edge=t,s.push(n),_.push(n)}),_.sort((t,n)=>t.edges.length-n.edges.length),[]),y=0,v=(_.forEach(t=>{let e=t.id;t.edges=t.edges.filter(t=>!s.includes(t.source)&&t.target.id===e||!s.includes(t.target)&&t.source.id===e),y+=t.edges.length||1,t.edges.forEach(t=>{var{source:t,target:n}=t,t=n.id===e?t:n;s.push(t)})}),2*Math.PI),b=0;_.forEach((i,t)=>{let a=i.edges.length||1;var n=v/y*a;0===t&&(b-=n/2);let r=b+n/2-v/4;i.radians=r,i.x=u/2+d*Math.cos(r),i.y=h/2+d*Math.sin(r),b+=n,i.edges.forEach((t,n)=>{var t=t.source.id===i.id?t.target:t.source,e=v/y,e=r-e*a/2+e/2+e*n;t.radians=e,t.x=u/2+f*Math.cos(e),t.y=h/2+f*Math.sin(e),m.push(t)})});var x=g/2,w=g/4;let S=x/2-4,k=(x/2-4<8&&(S=Dt([x/2,8])),w/2-4);(k=(k=w/2-4<4?Dt([w/2,4]):k)>g/10?g/10:k)>S&&10<k&&(k=.75*S),S>1.5*k&&(S=1.5*k),S=Math.floor(S),k=Math.floor(k);let C;this._size?((x=Hi(a,t=>t.size))[0]===x[1]&&(x[0]=0),C=$a().domain(x).rangeRound([3,Dt([S,k])]),w=p.size,p.r=C(w)):C=$a().domain([1,2]).rangeRound([S,k]),m.forEach(t=>{t.ring=2;var n=this._size?t.size:2;t.r=this._sizeMin?Ot([this._sizeMin,C(n)]):this._sizeMax?Dt([this._sizeMax,C(n)]):C(n)}),_.forEach(t=>{t.ring=1;var n=this._size?t.size:1;t.r=this._sizeMin?Ot([this._sizeMin,C(n)]):this._sizeMax?Dt([this._sizeMax,C(n)]):C(n)}),l=[p].concat(_).concat(m),_.forEach(s=>{let e=s.edge;["source","target"].forEach(n=>{e[n]=l.find(t=>t.id===e[n].id)}),c.push(e),r[s.id].forEach(o=>{let n=o.source.id===s.id?o.target:o.source;if(n.id!==p.id){let r=m.find(t=>t.id===n.id);if(r=r||_.find(t=>t.id===n.id)){o.spline=!0;let e=u/2,i=h/2,a=d+.5*(f-d);["source","target"].forEach((n,t)=>{o[n+"X"]=o[n].x+Math.cos(2===o[n].ring?o[n].radians+Math.PI:o[n].radians)*o[n].r,o[n+"Y"]=o[n].y+Math.sin(2===o[n].ring?o[n].radians+Math.PI:o[n].radians)*o[n].r,o[n+"BisectX"]=e+a*Math.cos(o[n].radians),o[n+"BisectY"]=i+a*Math.sin(o[n].radians),o[n]=l.find(t=>t.id===o[n].id),void 0===o[n].edges&&(o[n].edges={});t=(0===t?o.target:o.source).id;o[n].id===s.id?o[n].edges[t]={angle:s.radians+Math.PI,radius:g/2}:o[n].edges[t]={angle:r.radians,radius:g/2}}),c.push(o)}}})}),l.forEach(i=>{if(i.id!==this._center){var a=1.4*(this._shapeConfig.labelConfig.fontSize&&this._shapeConfig.labelConfig.fontSize(i)||11),r=2*a,o=g-i.r;let t=i.radians*(180/Math.PI),n=i.r+5,e="start";(t<-90||90<t)&&(n=-i.r-o-5,e="end",t+=180),i.labelBounds={x:n,y:-a/2,width:o,height:r},i.rotate=t,i.textAnchor=e}else i.labelBounds={x:-d/2,y:-d/2,width:d,height:d}}),this._linkLookup=e.reduce((t,n)=>(t[n.source.id]||(t[n.source.id]=[]),t[n.source.id].push(n.target),t[n.target.id]||(t[n.target.id]=[]),t[n.target.id].push(n.source),t),{});x=Hi(e,t=>t.size);if(x[0]!==x[1]){let t=Dt(l,t=>t.r),n=Ts["scale"+this._linkSizeScale.charAt(0).toUpperCase()+this._linkSizeScale.slice(1)]().domain(x).range([this._linkSizeMin,t]);e.forEach(t=>{t.size=n(t.size)})}w=Lt.bind(this)(this._shapeConfig,"edge","Path");delete w.on,this._shapes.push((new Sc).config(w).strokeWidth(t=>t.size).id(t=>t.source.id+"_"+t.target.id).d(t=>t.spline?`M${t.sourceX},${t.sourceY}C${t.sourceBisectX},${t.sourceBisectY} ${t.targetBisectX},${t.targetBisectY} ${t.targetX},`+t.targetY:`M${t.source.x},${t.source.y} ${t.target.x},`+t.target.y).data(c).select(Pt("g.d3plus-rings-links",{parent:this._select,duration:t,enter:{transform:n},update:{transform:n}}).node()).render());let M=this,A={label:t=>!!(l.length<=this._dataCutoff||this._hover&&this._hover(t)||this._active&&this._active(t))&&this._drawLabel(t.data||t.node,t.i),labelBounds:t=>t.labelBounds,labelConfig:{fontColor:t=>t.id===this._center?Lt.bind(M)(M._shapeConfig,"shape",t.key).labelConfig.fontColor(t):Gh(Lt.bind(M)(M._shapeConfig,"shape",t.key).fill(t)),fontResize:t=>t.id===this._center,padding:0,textAnchor:t=>i[t.id].textAnchor||Lt.bind(M)(M._shapeConfig,"shape",t.key).labelConfig.textAnchor,verticalAlign:t=>t.id===this._center?"middle":"top"},rotate:t=>i[t.id].rotate||0,select:Pt("g.d3plus-rings-nodes",{parent:this._select,duration:t,enter:{transform:n},update:{transform:n}}).node()};return ca().key(t=>t.shape).entries(l).forEach(t=>{this._shapes.push((new kc[t.key]).config(Lt.bind(this)(this._shapeConfig,"shape",t.key)).config(A).data(t.values).render())}),this}
|
|
7028
7028
|
/**
|
|
7029
7029
|
@memberof Rings
|
|
7030
7030
|
@desc Sets the center node to be the node with the given id.
|
|
@@ -7054,7 +7054,7 @@ m.push(o={value:u,dice:l<h,children:y.slice(v,b)}),o.dice?a9(o,e,i,a,w?i+=h*u/w:
|
|
|
7054
7054
|
@desc Defines the thickness of the links connecting each node. The value provided can be either a pixel Number to be used for all links, or an accessor function that returns a specific data value to be used in an automatically calculated linear scale.
|
|
7055
7055
|
@param {Function|Name} [*value* = 1]
|
|
7056
7056
|
@chainable
|
|
7057
|
-
*/linkSize(t){return arguments.length?(this._linkSize="function"==typeof t?t:
|
|
7057
|
+
*/linkSize(t){return arguments.length?(this._linkSize="function"==typeof t?t:Bt(t),this):this._linkSize}
|
|
7058
7058
|
/**
|
|
7059
7059
|
@memberof Network
|
|
7060
7060
|
@desc Defines the minimum pixel stroke width used in link sizing.
|
|
@@ -7110,12 +7110,12 @@ m.push(o={value:u,dice:l<h,children:y.slice(v,b)}),o.dice?a9(o,e,i,a,w?i+=h*u/w:
|
|
|
7110
7110
|
@memberof Rings
|
|
7111
7111
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
7112
7112
|
@private
|
|
7113
|
-
*/constructor(){super(),this._links=[],this._linkSize=
|
|
7113
|
+
*/constructor(){super(),this._links=[],this._linkSize=Bt(1),this._linkSizeMin=1,this._linkSizeScale="sqrt",this._noDataMessage=!1,this._nodes=[],this._on.mouseenter=()=>{},this._on["mouseleave.shape"]=()=>{this.hover(!1)};let e=this._on["mousemove.shape"];this._on["mousemove.shape"]=(o,s,t,n)=>{if(e(o,s,t,n),this._focus&&this._focus===o.id)this.hover(!1),this._on.mouseenter.bind(this)(o,s,t,n),this._focus=void 0;else{let t=this._nodeGroupBy&&this._nodeGroupBy[this._drawDepth](o,s)?this._nodeGroupBy[this._drawDepth](o,s):this._id(o,s),n=this._linkLookup[t],e=this._nodeLookup[t],i=[e.id],a=[e.x-e.r,e.x+e.r],r=[e.y-e.r,e.y+e.r];n.forEach(t=>{i.push(t.id),t.x-t.r<a[0]&&(a[0]=t.x-t.r),t.x+t.r>a[1]&&(a[1]=t.x+t.r),t.y-t.r<r[0]&&(r[0]=t.y-t.r),t.y+t.r>r[1]&&(r[1]=t.y+t.r)}),this.hover((t,n)=>t.source&&t.target?t.source.id===e.id||t.target.id===e.id:i.includes(this._ids(t,n)[this._drawDepth]))}},this._on["click.shape"]=t=>{this._center=t.id,
|
|
7114
7114
|
// Need to resets margins and padding because we are
|
|
7115
7115
|
// skipping over the default render method and using
|
|
7116
7116
|
// _draw directly.
|
|
7117
|
-
this._margin={bottom:0,left:0,right:0,top:0},this._padding={bottom:0,left:0,right:0,top:0},this._draw()},this._sizeMin=5,this._sizeScale="sqrt",this._shape=
|
|
7118
|
-
function n(){var t,n,a={nodes:
|
|
7117
|
+
this._margin={bottom:0,left:0,right:0,top:0},this._padding={bottom:0,left:0,right:0,top:0},this._draw()},this._sizeMin=5,this._sizeScale="sqrt",this._shape=Bt("Circle"),this._shapeConfig=Et(this._shapeConfig,{ariaLabel:(t,n)=>{var e=this._size?", "+this._size(t,n):"";return this._drawLabel(t,n)+e+"."},labelConfig:{duration:0,fontMin:1,fontResize:!0,labelPadding:0,textAnchor:"middle",verticalAlign:"middle"},Path:{fill:"none",label:!1,stroke:"#eee",strokeWidth:1}})}}function w9(n,e){let i;if(void 0===e)for(var t of n)null!=t&&(i<t||void 0===i&&t>=t)&&(i=t);else{let t=-1;for(var a of n)null!=(a=e(a,++t,n))&&(i<a||void 0===i&&a>=a)&&(i=a)}return i}function S9(n,e){let i;if(void 0===e)for(var t of n)null!=t&&(i>t||void 0===i&&t>=t)&&(i=t);else{let t=-1;for(var a of n)null!=(a=e(a,++t,n))&&(i>a||void 0===i&&a>=a)&&(i=a)}return i}function k9(n,e){let i=0;if(void 0===e)for(var t of n)(t=+t)&&(i+=t);else{let t=-1;for(var a of n)(a=+e(a,++t,n))&&(i+=a)}return i}function C9(t){return t.target.depth}function M9(t,n){return t.sourceLinks.length?t.depth:n-1}function A9(t){return function(){return t}}function z9(t,n){return E9(t.source,n.source)||t.index-n.index}function T9(t,n){return E9(t.target,n.target)||t.index-n.index}function E9(t,n){return t.y0-n.y0}function N9(t){return t.value}function P9(t){return t.index}function L9(t){return t.nodes}function B9(t){return t.links}function O9(t,n){t=t.get(n);if(t)return t;throw new Error("missing: "+n)}function D9({nodes:t}){for(var e of t){let t=e.y0,n=t;for(var i of e.sourceLinks)i.y0=t+i.width/2,t+=i.width;for(var a of e.targetLinks)a.y1=n+a.width/2,n+=a.width}}function j9(){let S=0,k=0,C=1,M=1,A=24,z=8,T,E=P9,N=M9,P,L,B=L9,O=B9,D=6;// extent
|
|
7118
|
+
function n(){var t,n,a={nodes:B.apply(null,arguments),links:O.apply(null,arguments)},{nodes:e,links:r}=[a][0];for([t,n]of e.entries())n.index=t,n.sourceLinks=[],n.targetLinks=[];var i,o,s=new Map(e.map((t,n)=>[E(t,n,e),t]));for([i,o]of r.entries()){o.index=i;let{source:t,target:n}=o;"object"!=typeof t&&(t=o.source=O9(s,t)),"object"!=typeof n&&(n=o.target=O9(s,n)),t.sourceLinks.push(o),n.targetLinks.push(o)}if(null!=L)for(var{sourceLinks:l,targetLinks:h}of e)l.sort(L),h.sort(L);var u,r=a.nodes;for(u of r)u.value=void 0===u.fixedValue?Math.max(k9(u.sourceLinks,N9),k9(u.targetLinks,N9)):u.fixedValue;{let t=(r=a.nodes).length,n=new Set(r),e=new Set,i=0;for(;n.size;){for(var c of n){c.depth=i;for(var{target:g}of c.sourceLinks)e.add(g)}if(++i>t)throw new Error("circular link");n=e,e=new Set}}{let t=(r=a.nodes).length,n=new Set(r),e=new Set,i=0;for(;n.size;){for(var d of n){d.height=i;for(var{source:f}of d.targetLinks)e.add(f)}if(++i>t)throw new Error("circular link");n=e,e=new Set}}var p,r=a,_=(({nodes:t})=>{var n,e=w9(t,t=>t.depth)+1,i=(C-S-A)/(e-1),a=new Array(e);for(n of t){var r=Math.max(0,Math.min(e-1,Math.floor(N.call(null,n,e))));n.layer=r,n.x0=S+r*i,n.x1=n.x0+A,a[r]?a[r].push(n):a[r]=[n]}if(P)for(var o of a)o.sort(P);return a})(r),r=(T=Math.min(z,(M-k)/(w9(_,t=>t.length)-1)),_),m=S9(r,t=>(M-k-(t.length-1)*T)/k9(t,N9));for(p of r){let n=k;for(var y of p){y.y0=n,y.y1=n+y.value*m,n=y.y1+T;for(var v of y.sourceLinks)v.width=v.value*m}n=(M-n+T)/(p.length+1);for(let t=0;t<p.length;++t){var b=p[t];b.y0+=n*(t+1),b.y1+=n*(t+1)}(t=>{if(void 0===L)for(var{sourceLinks:n,targetLinks:e}of t)n.sort(T9),e.sort(z9)}
|
|
7119
7119
|
// Returns the target.y0 that would produce an ideal link from source to target.
|
|
7120
7120
|
)(p)}for(let t=0;t<D;++t){var x=Math.pow(.99,t),w=Math.max(1-x,(t+1)/D);(
|
|
7121
7121
|
// Reposition each node based on its outgoing (source) links.
|
|
@@ -7127,28 +7127,28 @@ function n(){var t,n,a={nodes:L.apply(null,arguments),links:O.apply(null,argumen
|
|
|
7127
7127
|
// Push any overlapping nodes down.
|
|
7128
7128
|
function a(t,n,e,i){for(;e<t.length;++e){var a=t[e],r=(n-a.y0)*i;1e-6<r&&(a.y0+=r,a.y1+=r),n=a.y1+T}}
|
|
7129
7129
|
// Push any overlapping nodes up.
|
|
7130
|
-
function r(t,n,e,i){for(;0<=e;--e){var a=t[e],r=(a.y1-n)*i;1e-6<r&&(a.y0-=r,a.y1-=r),n=a.y0-T}}function R({sourceLinks:n,targetLinks:e}){if(void 0===
|
|
7130
|
+
function r(t,n,e,i){for(;0<=e;--e){var a=t[e],r=(a.y1-n)*i;1e-6<r&&(a.y0-=r,a.y1-=r),n=a.y0-T}}function R({sourceLinks:n,targetLinks:e}){if(void 0===L){for(let{source:{sourceLinks:t}}of e)t.sort(T9);for(let{target:{targetLinks:t}}of n)t.sort(z9)}}return n.update=function(t){return D9(t),t},n.nodeId=function(t){return arguments.length?(E="function"==typeof t?t:A9(t),n):E},n.nodeAlign=function(t){return arguments.length?(N="function"==typeof t?t:A9(t),n):N},n.nodeSort=function(t){return arguments.length?(P=t,n):P},n.nodeWidth=function(t){return arguments.length?(A=+t,n):A},n.nodePadding=function(t){return arguments.length?(z=T=+t,n):z},n.nodes=function(t){return arguments.length?(B="function"==typeof t?t:A9(t),n):B},n.links=function(t){return arguments.length?(O="function"==typeof t?t:A9(t),n):O},n.linkSort=function(t){return arguments.length?(L=t,n):L},n.size=function(t){return arguments.length?(S=k=0,C=+t[0],M=+t[1],n):[C-S,M-k]},n.extent=function(t){return arguments.length?(S=+t[0][0],C=+t[1][0],k=+t[0][1],M=+t[1][1],n):[[S,k],[C,M]]},n.iterations=function(t){return arguments.length?(D=+t,n):D},n}var R9=Math.PI,F9=2*R9,I9=1e-6,H9=F9-I9;function G9(){this._x0=this._y0=this._x1=this._y1=null,// end of current subpath
|
|
7131
7131
|
this._=""}function K9(){return new G9}function U9(t){return function(){return t}}function W9(t){return t[0]}function q9(t){return t[1]}G9.prototype=K9.prototype={constructor:G9,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,e,i){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+i)},bezierCurveTo:function(t,n,e,i,a,r){this._+="C"+ +t+","+ +n+","+ +e+","+ +i+","+(this._x1=+a)+","+(this._y1=+r)},arcTo:function(t,n,e,i,a){var r,o,s=this._x1,l=this._y1,h=(e=+e)-(t=+t),u=(i=+i)-(n=+n),c=s-t,g=l-n,d=c*c+g*g;
|
|
7132
7132
|
// Is the radius negative? Error.
|
|
7133
7133
|
if((a=+a)<0)throw new Error("negative radius: "+a);
|
|
7134
7134
|
// Is this path empty? Move to (x1,y1).
|
|
7135
|
-
null===this._x1?this._+="M"+(this._x1=t)+","+(this._y1=n):
|
|
7135
|
+
null===this._x1?this._+="M"+(this._x1=t)+","+(this._y1=n):I9<d&&(Math.abs(g*h-u*c)>I9&&a?(o=h*h+u*u,i=(e=e-s)*e+(s=i-l)*s,l=Math.sqrt(o),r=Math.sqrt(d),d=(o=a*Math.tan((R9-Math.acos((o+d-i)/(2*l*r)))/2))/r,i=o/l,
|
|
7136
7136
|
// If the start tangent is not coincident with (x0,y0), line to.
|
|
7137
|
-
Math.abs(d-1)>
|
|
7137
|
+
Math.abs(d-1)>I9&&(this._+="L"+(t+d*c)+","+(n+d*g)),this._+="A"+a+","+a+",0,0,"+ +(c*s<g*e)+","+(this._x1=t+i*h)+","+(this._y1=n+i*u)):this._+="L"+(this._x1=t)+","+(this._y1=n))},arc:function(t,n,e,i,a,r){t=+t,n=+n,r=!!r;var o=(e=+e)*Math.cos(i),s=e*Math.sin(i),l=t+o,h=n+s,u=1^r,r=r?i-a:a-i;
|
|
7138
7138
|
// Is the radius negative? Error.
|
|
7139
7139
|
if(e<0)throw new Error("negative radius: "+e);
|
|
7140
7140
|
// Is this path empty? Move to (x0,y0).
|
|
7141
|
-
null===this._x1?this._+="M"+l+","+h:(Math.abs(this._x1-l)>
|
|
7141
|
+
null===this._x1?this._+="M"+l+","+h:(Math.abs(this._x1-l)>I9||Math.abs(this._y1-h)>I9)&&(this._+="L"+l+","+h),
|
|
7142
7142
|
// Is this arc empty? We’re done.
|
|
7143
7143
|
e&&(
|
|
7144
7144
|
// Is this a complete circle? Draw two arcs to complete the circle.
|
|
7145
7145
|
H9<(
|
|
7146
7146
|
// Does the angle go the wrong way? Flip the direction.
|
|
7147
|
-
r=r<0?r%
|
|
7147
|
+
r=r<0?r%F9+F9:r)?this._+="A"+e+","+e+",0,1,"+u+","+(t-o)+","+(n-s)+"A"+e+","+e+",0,1,"+u+","+(this._x1=l)+","+(this._y1=h):I9<r&&(this._+="A"+e+","+e+",0,"+ +(R9<=r)+","+u+","+(this._x1=t+e*Math.cos(a))+","+(this._y1=n+e*Math.sin(a))))},rect:function(t,n,e,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +i+"h"+-e+"Z"},toString:function(){return this._}};var $9=Array.prototype.slice;function V9(t){return t.source}function Y9(t){return t.target}function Z9(t,n,e,i,a){t.moveTo(n,e),t.bezierCurveTo(n=(n+i)/2,e,n,a,i,a)}function X9(){return a=Z9,r=V9,o=Y9,s=W9,l=q9,h=null,n.source=function(t){return arguments.length?(r=t,n):r},n.target=function(t){return arguments.length?(o=t,n):o},n.x=function(t){return arguments.length?(s="function"==typeof t?t:U9(+t),n):s},n.y=function(t){return arguments.length?(l="function"==typeof t?t:U9(+t),n):l},n.context=function(t){return arguments.length?(h=null==t?null:t,n):h},n;function n(){var t,n=$9.call(arguments),e=r.apply(this,n),i=o.apply(this,n);if(h=h||(t=K9()),a(h,+s.apply(this,(n[0]=e,n)),+l.apply(this,n),+s.apply(this,(n[0]=i,n)),+l.apply(this,n)),t)return h=null,t+""||null}var a,r,o,s,l,h}function J9(t){return[t.source.x1,t.y0]}function Q9(t){return[t.target.x0,t.y1]}let tx={center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?S9(t.sourceLinks,C9)-1:0},justify:M9,left:function(t){return t.depth},right:function(t,n){return n-1-t.height}};class nx extends Sf{
|
|
7148
7148
|
/**
|
|
7149
7149
|
Extends the draw behavior of the abstract Viz class.
|
|
7150
7150
|
@private
|
|
7151
|
-
*/_draw(t){super._draw(t);var t=this._height-this._margin.top-this._margin.bottom,n=this._width-this._margin.left-this._margin.right,e=(Array.isArray(this._nodes)?this._nodes:this._links.reduce((t,n)=>(t.includes(n[this._linksSource])||t.push(n[this._linksSource]),t.includes(n[this._linksTarget])||t.push(n[this._linksTarget]),t),[]).map(t=>({id:t}))).map((t,n)=>({__d3plus__:!0,data:t,i:n,id:this._nodeId(t,n),node:t,shape:"Rect"}));let i=this._nodeLookup=e.reduce((t,n,e)=>(t[n.id]=e,t),{});var a=this._links.map((e,t)=>{var n=[this._linksSource,this._linksTarget].reduce((t,n)=>(t[n]=i[e[n]],t),{});return{source:n[this._linksSource],target:n[this._linksTarget],value:this._value(e,t)}});this._linkLookup=a.reduce((t,n)=>(t[n.source]||(t[n.source]=[]),t[n.source].push(n.target),t[n.target]||(t[n.target]=[]),t[n.target].push(n.source),t),{});let r=`translate(${this._margin.left}, ${this._margin.top})`;return this._sankey.nodeAlign(this._nodeAlign).nodePadding(this._nodePadding).nodeWidth(this._nodeWidth).nodes(e).nodeSort(this._nodeSort).links(a).linkSort(this._linkSort).iterations(this._iterations).size([n,t])(),this._shapes.push((new Sc).config(this._shapeConfig.Path).data(a).d(this._path).select(Pt("g.d3plus-Links",{parent:this._select,enter:{transform:r},update:{transform:r}}).node()).render()),ca().key(t=>t.shape).entries(e).forEach(t=>{this._shapes.push((new kc[t.key]).data(t.values).height(t=>t.y1-t.y0).width(t=>t.x1-t.x0).x(t=>(t.x1+t.x0)/2).y(t=>(t.y1+t.y0)/2).select(Pt("g.d3plus-sankey-nodes",{parent:this._select,enter:{transform:r},update:{transform:r}}).node()).config(
|
|
7151
|
+
*/_draw(t){super._draw(t);var t=this._height-this._margin.top-this._margin.bottom,n=this._width-this._margin.left-this._margin.right,e=(Array.isArray(this._nodes)?this._nodes:this._links.reduce((t,n)=>(t.includes(n[this._linksSource])||t.push(n[this._linksSource]),t.includes(n[this._linksTarget])||t.push(n[this._linksTarget]),t),[]).map(t=>({id:t}))).map((t,n)=>({__d3plus__:!0,data:t,i:n,id:this._nodeId(t,n),node:t,shape:"Rect"}));let i=this._nodeLookup=e.reduce((t,n,e)=>(t[n.id]=e,t),{});var a=this._links.map((e,t)=>{var n=[this._linksSource,this._linksTarget].reduce((t,n)=>(t[n]=i[e[n]],t),{});return{source:n[this._linksSource],target:n[this._linksTarget],value:this._value(e,t)}});this._linkLookup=a.reduce((t,n)=>(t[n.source]||(t[n.source]=[]),t[n.source].push(n.target),t[n.target]||(t[n.target]=[]),t[n.target].push(n.source),t),{});let r=`translate(${this._margin.left}, ${this._margin.top})`;return this._sankey.nodeAlign(this._nodeAlign).nodePadding(this._nodePadding).nodeWidth(this._nodeWidth).nodes(e).nodeSort(this._nodeSort).links(a).linkSort(this._linkSort).iterations(this._iterations).size([n,t])(),this._shapes.push((new Sc).config(this._shapeConfig.Path).data(a).d(this._path).select(Pt("g.d3plus-Links",{parent:this._select,enter:{transform:r},update:{transform:r}}).node()).render()),ca().key(t=>t.shape).entries(e).forEach(t=>{this._shapes.push((new kc[t.key]).data(t.values).height(t=>t.y1-t.y0).width(t=>t.x1-t.x0).x(t=>(t.x1+t.x0)/2).y(t=>(t.y1+t.y0)/2).select(Pt("g.d3plus-sankey-nodes",{parent:this._select,enter:{transform:r},update:{transform:r}}).node()).config(Lt.bind(this)(this._shapeConfig,"shape",t.key)).render())}),this}
|
|
7152
7152
|
/**
|
|
7153
7153
|
@memberof Sankey
|
|
7154
7154
|
@desc If *value* is specified, sets the hover method to the specified function and returns the current class instance.
|
|
@@ -7239,7 +7239,7 @@ r=r<0?r%I9+I9:r)?this._+="A"+e+","+e+",0,1,"+u+","+(t-o)+","+(n-s)+"A"+e+","+e+"
|
|
|
7239
7239
|
@memberof Sankey
|
|
7240
7240
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
7241
7241
|
@private
|
|
7242
|
-
*/constructor(){super(),this._iterations=6,this._nodeId=p("id"),this._nodeSort=void 0,this._links=p("links"),this._linkSort=void 0,this._linksSource="source",this._linksTarget="target",this._noDataMessage=!1,this._nodes=p("nodes"),this._nodeAlign=tx.justify,this._nodePadding=8,this._nodeWidth=30,this._on.mouseenter=()=>{},this._on["mouseleave.shape"]=()=>{this.hover(!1)};let n=this._on["mousemove.shape"];this._on["mousemove.shape"]=(a,r,o,t)=>{if(n(a,r,o,t),this._focus&&this._focus===a.id)this.hover(!1),this._on.mouseenter.bind(this)(a,r,o,t),this._focus=void 0;else{let e=this._nodeId(a,r),t=this._nodeLookup[e],n=Object.keys(this._nodeLookup).reduce((t,n)=>(t[this._nodeLookup[n]]=isNaN(n)?n:parseInt(n,10),t),{});o=this._linkLookup[t];let i=[e];o.forEach(t=>{i.push(n[t])}),this.hover((t,n)=>t.source&&t.target?t.source.id===e||t.target.id===e:i.includes(this._nodeId(t,n)))}},this._path=X9().source(J9).target(Q9),this._sankey=j9(),this._shape=
|
|
7242
|
+
*/constructor(){super(),this._iterations=6,this._nodeId=p("id"),this._nodeSort=void 0,this._links=p("links"),this._linkSort=void 0,this._linksSource="source",this._linksTarget="target",this._noDataMessage=!1,this._nodes=p("nodes"),this._nodeAlign=tx.justify,this._nodePadding=8,this._nodeWidth=30,this._on.mouseenter=()=>{},this._on["mouseleave.shape"]=()=>{this.hover(!1)};let n=this._on["mousemove.shape"];this._on["mousemove.shape"]=(a,r,o,t)=>{if(n(a,r,o,t),this._focus&&this._focus===a.id)this.hover(!1),this._on.mouseenter.bind(this)(a,r,o,t),this._focus=void 0;else{let e=this._nodeId(a,r),t=this._nodeLookup[e],n=Object.keys(this._nodeLookup).reduce((t,n)=>(t[this._nodeLookup[n]]=isNaN(n)?n:parseInt(n,10),t),{});o=this._linkLookup[t];let i=[e];o.forEach(t=>{i.push(n[t])}),this.hover((t,n)=>t.source&&t.target?t.source.id===e||t.target.id===e:i.includes(this._nodeId(t,n)))}},this._path=X9().source(J9).target(Q9),this._sankey=j9(),this._shape=Bt("Rect"),this._shapeConfig=Et(this._shapeConfig,{Path:{fill:"none",hoverStyle:{"stroke-width":t=>Math.max(1,Math.abs(t.source.y1-t.source.y0)*(t.value/t.source.value)-2)},label:!1,stroke:"#DBDBDB",strokeOpacity:.5,strokeWidth:t=>Math.max(1,Math.abs(t.source.y1-t.source.y0)*(t.value/t.source.value)-2)},Rect:{}}),this._value=Bt(1)}}class ex extends Ff{
|
|
7243
7243
|
/**
|
|
7244
7244
|
@memberof StackedArea
|
|
7245
7245
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from Plot.
|
|
@@ -7252,7 +7252,7 @@ r=r<0?r%I9+I9:r)?this._+="A"+e+","+e+",0,1,"+u+","+(t-o)+","+(n-s)+"A"+e+","+e+"
|
|
|
7252
7252
|
/**
|
|
7253
7253
|
Merges the values of a given nest branch.
|
|
7254
7254
|
@private
|
|
7255
|
-
*/t.forEach((t,n)=>{t.data.key&&t.data.values&&(t.data=function n(t){return cu(t.values.map(t=>t.key&&t.values?n(t):t),e._aggs)}(t.data)),t.__d3plus__=!0,t.i=n});let a=this._shapeConfig.r;"function"!=typeof a&&(a=
|
|
7255
|
+
*/t.forEach((t,n)=>{t.data.key&&t.data.values&&(t.data=function n(t){return cu(t.values.map(t=>t.key&&t.values?n(t):t),e._aggs)}(t.data)),t.__d3plus__=!0,t.i=n});let a=this._shapeConfig.r;"function"!=typeof a&&(a=Bt(a));var h=Ot(t,t=>1===t.depth?a(t.data,t.i):0),u=Ot(t,t=>t.children?0:a(t.data,t.i)),c=Hi(t,t=>t.y);this._labelHeight=Dt([o?50:100,(c[1]-h-u)/(this._groupBy.length+1)]),this._labelWidths=gu(t,t=>t.depth).map(a=>a.values.reduce((t,n,e)=>{var i=e<a.values.length-1?a.values[e+1].x:l+this._margin[s],e=e?a.values[e-1].x:this._margin[s];return Dt([t,i-n.x,n.x-e])},l));let g=$a().domain(c).range([h+this._labelHeight,n-u-this._labelHeight]),d=(t.forEach(t=>{var n=g(t.y);r?(t.y=t.x,t.x=n):t.y=n}),{parent:this._select,enter:{transform:i},update:{transform:i}}),f=(this._shapes.push((new Sc).data(t.filter(t=>1<t.depth).map(t=>Et({},t))).select(Pt("g.d3plus-Tree-Links",d).node()).config(Lt.bind(this)(this._shapeConfig,"shape","Path")).config({d:t=>{let n=this._shapeConfig.r;"function"==typeof n&&(n=n(t.data,t.i));var e=t.parent.x-t.x+(o?0:n),t=t.parent.y-t.y+(o?n:0),i=o?0:-n,a=o?-n:0;return o?`M${i},${a}C${i},${(a+t)/2} ${e},${(a+t)/2} ${e},`+t:`M${i},${a}C${(i+e)/2},${a} ${(i+e)/2},${t} ${e},`+t},id:(t,n)=>this._ids(t,n)[t.depth-1]}).render()),{id:(t,n)=>this._ids(t,n)[t.depth-1],label:(t,n)=>this._label?this._label(t.data,n):(n=this._ids(t,n).slice(0,t.depth))[n.length-1],labelConfig:{textAnchor:(t,n,e)=>o?"middle":e.children&&e.depth!==this._drawDepth+1?"end":"start",verticalAlign:(t,n,e)=>o?1===e.depth?"bottom":"top":"middle"},hitArea:(t,n,e)=>{var i=this._labelHeight,e=e.r||(o?e.height/2:e.width/2),a=this._labelWidths[t.depth-1];return{width:o?a:2*e+a,height:r?i:2*e+i,x:o?-a/2:t.children&&t.depth!==this._groupBy.length?-(e+a):-e,y:r?-i/2:t.children&&t.depth!==this._groupBy.length?-(e+this._labelHeight):-e}},labelBounds:(t,n,e)=>{var i=this._labelHeight,a=o?"height":"width",e=e.r||(o?e.height/2:e.width/2),r=this._labelWidths[t.depth-1];return{[o?"width":"height"]:r,[a]:i,[o?"x":"y"]:-r/2,[o?"y":"x"]:t.children&&t.depth!==this._groupBy.length?-(e+i):e}}});c=gu(t,t=>this._shape(t.data));let p=c.map(t=>t.key);h=this._previousShapes.filter(t=>!p.includes(t));return c.concat(h.map(t=>({key:t,values:[]}))).forEach(({key:t,values:n})=>{this._shapes.push((new kc[t]).data(n).select(Pt("g.d3plus-Tree-"+t,d).node()).config(Lt.bind(this)(this._shapeConfig,"shape",t)).config(f).render())}),this._previousShapes=p,this}
|
|
7256
7256
|
/**
|
|
7257
7257
|
@memberof Tree
|
|
7258
7258
|
@desc Changes the orientation of the entire Tree, either "vertical" (top to bottom) or "horizontal" (left to right).
|
|
@@ -7274,7 +7274,7 @@ r=r<0?r%I9+I9:r)?this._+="A"+e+","+e+",0,1,"+u+","+(t-o)+","+(n-s)+"A"+e+","+e+"
|
|
|
7274
7274
|
@memberof Tree
|
|
7275
7275
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
7276
7276
|
@private
|
|
7277
|
-
*/constructor(){super(),this._orient="vertical",this._separation=(t,n)=>t.parent===n.parent?1:2,this._legendTooltip=Et(this._legendTooltip,{title:hf.bind(this)}),this._previousShapes=[],this._shape=
|
|
7277
|
+
*/constructor(){super(),this._orient="vertical",this._separation=(t,n)=>t.parent===n.parent?1:2,this._legendTooltip=Et(this._legendTooltip,{title:hf.bind(this)}),this._previousShapes=[],this._shape=Bt("Circle"),this._shapeConfig=Et(this._shapeConfig,{ariaLabel:(t,n)=>this._treeData?`${this._treeData[n].depth}. ${this._drawLabel(t,n)}.`:"",labelConfig:{fontColor:Rh.dark},Path:{fill:"none",stroke:Rh.missing,strokeWidth:2},r:Bt(7),width:Bt(12),height:Bt(12)}),this._tooltipConfig=Et(this._tooltipConfig,{title:(t,n,e)=>this._drawLabel(t,n,e.depth-1)}),this._tree=h9()}}let ax={treemapBinary:function(t,n,e,i,a){var r,o,p=t.children,s=p.length,_=new Array(s+1);for(_[0]=o=r=0;r<s;++r)_[r+1]=o+=p[r].value;!function t(n,e,i,a,r,o,s){if(e-1<=n)return(l=p[n]).x0=a,l.y0=r,l.x1=o,void(l.y1=s);var l=_[n],h=i/2+l,u=n+1,c=e-1;for(;u<c;){var g=u+c>>>1;_[g]<h?u=1+g:c=g}h-_[u-1]<_[u]-h&&n+1<u&&--u;var l=_[u]-l,d=i-l;{var f;s-r<o-a?(t(n,u,l,a,r,f=i?(a*d+o*l)/i:o,s),t(u,e,d,f,r,o,s)):(t(n,u,l,a,r,o,f=i?(r*d+s*l)/i:s),t(u,e,d,a,f,o,s))}}(0,s,t.value,n,e,i,a)},treemapDice:a9,treemapSlice:u9,treemapSliceDice:function(t,n,e,i,a){(1&t.depth?u9:a9)(t,n,e,i,a)},treemapSquarify:g9,treemapResquarify:d9};class rx extends Sf{
|
|
7278
7278
|
/**
|
|
7279
7279
|
@memberof Treemap
|
|
7280
7280
|
@desc Extends the draw behavior of the abstract Viz class.
|
|
@@ -7284,7 +7284,7 @@ r=r<0?r%I9+I9:r)?this._+="A"+e+","+e+",0,1,"+u+","+(t-o)+","+(n-s)+"A"+e+","+e+"
|
|
|
7284
7284
|
@memberof Treemap
|
|
7285
7285
|
@desc Flattens and merges treemap data.
|
|
7286
7286
|
@private
|
|
7287
|
-
*/t.children&&!function n(e){for(let t=0;t<e.length;t++){var i,a=e[t];a.depth<=o._drawDepth?n(a.children):(i=1===a.data.values.length?o._filteredData.indexOf(a.data.values[0]):void 0,a.__d3plus__=!0,a.id=a.data.key,a.i=-1<i?i:void 0,a.data=cu(a.data.values,o._aggs),a.x=a.x0+(a.x1-a.x0)/2,a.y=a.y0+(a.y1-a.y0)/2,r.push(a))}}(t.children),this._rankData=r.sort(this._sort).map(t=>t.data);let e=t.value;r.forEach(t=>{t.share=this._sum(t.data,t.i)/e});var t=`translate(${this._margin.left}, ${this._margin.top})`,i=
|
|
7287
|
+
*/t.children&&!function n(e){for(let t=0;t<e.length;t++){var i,a=e[t];a.depth<=o._drawDepth?n(a.children):(i=1===a.data.values.length?o._filteredData.indexOf(a.data.values[0]):void 0,a.__d3plus__=!0,a.id=a.data.key,a.i=-1<i?i:void 0,a.data=cu(a.data.values,o._aggs),a.x=a.x0+(a.x1-a.x0)/2,a.y=a.y0+(a.y1-a.y0)/2,r.push(a))}}(t.children),this._rankData=r.sort(this._sort).map(t=>t.data);let e=t.value;r.forEach(t=>{t.share=this._sum(t.data,t.i)/e});var t=`translate(${this._margin.left}, ${this._margin.top})`,i=Lt.bind(this)(this._shapeConfig,"shape","Rect");let s=i.labelConfig.fontMax,l=i.labelConfig.fontMin,h=i.labelConfig.padding;return this._shapes.push((new mc).data(r).label(t=>[this._drawLabel(t.data,t.i),Hu(100*t.share,this._locale)+"%"]).select(Pt("g.d3plus-Treemap",{parent:this._select,enter:{transform:t},update:{transform:t}}).node()).config({height:t=>t.y1-t.y0,labelBounds:(t,n,e)=>{var i=e.height;let a=Math.min(s,.5*(i-2*h));return a<l&&(a=0),[{width:e.width,height:i-a,x:-e.width/2,y:-i/2},{width:e.width,height:a+2*h,x:-e.width/2,y:i/2-a-2*h}]},labelConfig:{textAnchor:(t,n,e)=>{let i,a=e;for(;void 0===i&&a;)void 0!==a.l&&(i=a.l),a=a.__d3plusParent__;return i?"middle":"start"},verticalAlign:(t,n,e)=>{let i,a=e;for(;void 0===i&&a;)void 0!==a.l&&(i=a.l),a=a.__d3plusParent__;return i?"bottom":"top"}},width:t=>t.x1-t.x0}).config(i).render()),this}
|
|
7288
7288
|
/**
|
|
7289
7289
|
* Applies the threshold algorithm for Treemaps.
|
|
7290
7290
|
* @param {Array} data The data to process.
|
|
@@ -7301,7 +7301,7 @@ r=r<0?r%I9+I9:r)?this._+="A"+e+","+e+",0,1,"+u+","+(t-o)+","+(n-s)+"A"+e+","+e+"
|
|
|
7301
7301
|
@memberof Treemap
|
|
7302
7302
|
@desc If *value* is specified, sets the inner and outer padding accessor to the specified function or number and returns the current class instance. If *value* is not specified, returns the current padding accessor.
|
|
7303
7303
|
@param {Function|Number} [*value*]
|
|
7304
|
-
*/layoutPadding(t){return arguments.length?(this._layoutPadding="function"==typeof t?t:
|
|
7304
|
+
*/layoutPadding(t){return arguments.length?(this._layoutPadding="function"==typeof t?t:Bt(t),this):this._layoutPadding}
|
|
7305
7305
|
/**
|
|
7306
7306
|
@memberof Treemap
|
|
7307
7307
|
@desc If *comparator* is specified, sets the sort order for the treemap using the specified comparator function. If *comparator* is not specified, returns the current group sort order, which defaults to descending order by the associated input data's numeric value attribute.
|
|
@@ -7331,5 +7331,5 @@ r=r<0?r%I9+I9:r)?this._+="A"+e+","+e+",0,1,"+u+","+(t-o)+","+(n-s)+"A"+e+","+e+"
|
|
|
7331
7331
|
@memberof Treemap
|
|
7332
7332
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
7333
7333
|
@private
|
|
7334
|
-
*/constructor(){super(),this._layoutPadding=1;let e=this._legend;function n(t){return t.x0=t.y0=0,t.x1=r,t.y1=s,t.eachBefore(i),l=[0],a&&t.eachBefore(i9),t}function i(t){var n=l[t.depth],e=t.x0+n,i=t.y0+n,a=t.x1-n,r=t.y1-n;a<e&&(e=a=(e+a)/2),r<i&&(i=r=(i+r)/2),t.x0=e,t.y0=i,t.x1=a,t.y1=r,t.children&&(n=l[t.depth+1]=h(t)/2,e+=d(t)-n,i+=u(t)-n,(a-=c(t)-n)<e&&(e=a=(e+a)/2),(r-=g(t)-n)<i&&(i=r=(i+r)/2),o(t,e,i,a,r))}var o,a,r,s,l,h,u,c,g,d;this._legend=(t,n)=>n.length!==this._filteredData.length&&e.bind(this)(t,n),this._legendSort=(t,n)=>this._sum(n)-this._sum(t),this._legendTooltip=Et({},this._legendTooltip,{tbody:[]}),this._shapeConfig=Et({},this._shapeConfig,{ariaLabel:(t,n)=>(this._rankData?this._rankData.indexOf(t)+1+". ":"")+this._drawLabel(t,n)+`, ${this._sum(t,n)}.`,labelConfig:{fontMax:32,fontMin:8,fontResize:!0,padding:5}}),this._sort=(t,n)=>{var e=f(t),i=f(n);return e&&!i?1:!e&&i?-1:n.value-t.value},this._sum=p("value"),this._thresholdKey=this._sum,this._tile=g9,this._tooltipConfig=Et({},this._tooltipConfig,{tbody:[[()=>this._translate("Share"),(t,n,e)=>Hu(100*e.share,this._locale)+"%"]]}),this._treemap=(o=g9,a=!1,s=r=1,l=[0],d=g=c=u=h=D6,n.round=function(t){return arguments.length?(a=!!t,n):a},n.size=function(t){return arguments.length?(r=+t[0],s=+t[1],n):[r,s]},n.tile=function(t){return arguments.length?(o=O6(t),n):o},n.padding=function(t){return arguments.length?n.paddingInner(t).paddingOuter(t):n.paddingInner()},n.paddingInner=function(t){return arguments.length?(h="function"==typeof t?t:j6(+t),n):h},n.paddingOuter=function(t){return arguments.length?n.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):n.paddingTop()},n.paddingTop=function(t){return arguments.length?(u="function"==typeof t?t:j6(+t),n):u},n.paddingRight=function(t){return arguments.length?(c="function"==typeof t?t:j6(+t),n):c},n.paddingBottom=function(t){return arguments.length?(g="function"==typeof t?t:j6(+t),n):g},n.paddingLeft=function(t){return arguments.length?(d="function"==typeof t?t:j6(+t),n):d},n.round(!0));let f=t=>t.children&&1===t.children.length&&t.children[0].data._isAggregation}}t.Area=fc,t.AreaPlot=
|
|
7334
|
+
*/constructor(){super(),this._layoutPadding=1;let e=this._legend;function n(t){return t.x0=t.y0=0,t.x1=r,t.y1=s,t.eachBefore(i),l=[0],a&&t.eachBefore(i9),t}function i(t){var n=l[t.depth],e=t.x0+n,i=t.y0+n,a=t.x1-n,r=t.y1-n;a<e&&(e=a=(e+a)/2),r<i&&(i=r=(i+r)/2),t.x0=e,t.y0=i,t.x1=a,t.y1=r,t.children&&(n=l[t.depth+1]=h(t)/2,e+=d(t)-n,i+=u(t)-n,(a-=c(t)-n)<e&&(e=a=(e+a)/2),(r-=g(t)-n)<i&&(i=r=(i+r)/2),o(t,e,i,a,r))}var o,a,r,s,l,h,u,c,g,d;this._legend=(t,n)=>n.length!==this._filteredData.length&&e.bind(this)(t,n),this._legendSort=(t,n)=>this._sum(n)-this._sum(t),this._legendTooltip=Et({},this._legendTooltip,{tbody:[]}),this._shapeConfig=Et({},this._shapeConfig,{ariaLabel:(t,n)=>(this._rankData?this._rankData.indexOf(t)+1+". ":"")+this._drawLabel(t,n)+`, ${this._sum(t,n)}.`,labelConfig:{fontMax:32,fontMin:8,fontResize:!0,padding:5}}),this._sort=(t,n)=>{var e=f(t),i=f(n);return e&&!i?1:!e&&i?-1:n.value-t.value},this._sum=p("value"),this._thresholdKey=this._sum,this._tile=g9,this._tooltipConfig=Et({},this._tooltipConfig,{tbody:[[()=>this._translate("Share"),(t,n,e)=>Hu(100*e.share,this._locale)+"%"]]}),this._treemap=(o=g9,a=!1,s=r=1,l=[0],d=g=c=u=h=D6,n.round=function(t){return arguments.length?(a=!!t,n):a},n.size=function(t){return arguments.length?(r=+t[0],s=+t[1],n):[r,s]},n.tile=function(t){return arguments.length?(o=O6(t),n):o},n.padding=function(t){return arguments.length?n.paddingInner(t).paddingOuter(t):n.paddingInner()},n.paddingInner=function(t){return arguments.length?(h="function"==typeof t?t:j6(+t),n):h},n.paddingOuter=function(t){return arguments.length?n.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):n.paddingTop()},n.paddingTop=function(t){return arguments.length?(u="function"==typeof t?t:j6(+t),n):u},n.paddingRight=function(t){return arguments.length?(c="function"==typeof t?t:j6(+t),n):c},n.paddingBottom=function(t){return arguments.length?(g="function"==typeof t?t:j6(+t),n):g},n.paddingLeft=function(t){return arguments.length?(d="function"==typeof t?t:j6(+t),n):d},n.round(!0));let f=t=>t.children&&1===t.children.length&&t.children[0].data._isAggregation}}t.Area=fc,t.AreaPlot=Ff,t.Axis=Nc,t.AxisBottom=Pc,t.AxisLeft=Lc,t.AxisRight=Bc,t.AxisTop=Oc,t.Bar=pc,t.BarChart=If,t.BaseClass=Li,t.Box=wc,t.BoxWhisker=Hf,t.BumpChart=Gf,t.Circle=_c,t.ColorScale=jc,t.Donut=Uf,t.Geomap=e6,t.Image=Yu,t.Legend=Dc,t.Line=yc,t.LinePlot=i6,t.Matrix=o6,t.Message=Rc,t.Network=A6,t.Pack=p9,t.Path=Sc,t.Pie=Kf,t.Plot=Rf,t.Priestley=_9,t.RESET=Ti,t.Radar=y9,t.RadialMatrix=b9,t.Rect=mc,t.Rings=x9,t.Sankey=nx,t.Shape=Xu,t.StackedArea=ex,t.TextBox=Ic,t.Timeline=yg,t.Tooltip=Ed,t.Tree=ix,t.Treemap=rx,t.Viz=Sf,t.Whisker=bc,t.accessor=p,t.configPrep=Lt,t.constant=Bt,t.uuid=Ni});
|
|
7335
7335
|
//# sourceMappingURL=d3plus-core.full.js.map
|