Repository navigation
Expand file tree
/
Copy pathforcedirected.js
More file actions
1 lines (1 loc) · 85.4 KB
/
Copy pathforcedirected.js
File metadata and controls
1 lines (1 loc) · 85.4 KB
1
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.forcedirected=n():t.forcedirected=n()}(window,(function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(r,i,function(n){return t[n]}.bind(null,i));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=61)}({61:function(t,n,e){"use strict";e.r(n);var r=function(t,n){return t<n?-1:t>n?1:t>=n?0:NaN},i=function(t){return 1===t.length&&(t=function(t){return function(n,e){return r(t(n),e)}}(t)),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var o=r+i>>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var o=r+i>>>1;t(n[o],e)>0?i=o:r=o+1}return r}}}(r);i.right,i.left;var o=Array.prototype;o.slice,o.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2),Array.prototype.slice;var u={value:function(){}};function a(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new s(r)}function s(t){this._=t}function l(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function c(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=u,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}s.prototype=a.prototype={constructor:s,on:function(t,n){var e,r=this._,i=function(t,n){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}(t+"",r),o=-1,u=i.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o<u;)if(e=(t=i[o]).type)r[e]=c(r[e],t.name,n);else if(null==n)for(e in r)r[e]=c(r[e],t.name,null);return this}for(;++o<u;)if((e=(t=i[o]).type)&&(e=l(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new s(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var f=a;function h(){}var g=function(t){return null==t?h:function(){return this.querySelector(t)}};function p(){return[]}var d=function(t){return null==t?p:function(){return this.querySelectorAll(t)}},v=function(t){return function(){return this.matches(t)}},y=function(t){return new Array(t.length)};function m(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}m.prototype={constructor:m,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function _(t,n,e,r,i,o){for(var u,a=0,s=n.length,l=o.length;a<l;++a)(u=n[a])?(u.__data__=o[a],r[a]=u):e[a]=new m(t,o[a]);for(;a<s;++a)(u=n[a])&&(i[a]=u)}function w(t,n,e,r,i,o,u){var a,s,l,c={},f=n.length,h=o.length,g=new Array(f);for(a=0;a<f;++a)(s=n[a])&&(g[a]=l="$"+u.call(s,s.__data__,a,n),l in c?i[a]=s:c[l]=s);for(a=0;a<h;++a)(s=c[l="$"+u.call(t,o[a],a,o)])?(r[a]=s,s.__data__=o[a],c[l]=null):e[a]=new m(t,o[a]);for(a=0;a<f;++a)(s=n[a])&&c[g[a]]===s&&(i[a]=s)}function x(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}var b="http://www.w3.org/1999/xhtml",M={svg:"http://www.w3.org/2000/svg",xhtml:b,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},C=function(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),M.hasOwnProperty(n)?{space:M[n],local:t}:t},T=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function N(t,n){return t.style.getPropertyValue(n)||T(t).getComputedStyle(t,null).getPropertyValue(n)}function k(t){return t.trim().split(/^|\s+/)}function A(t){return t.classList||new U(t)}function U(t){this._node=t,this._names=k(t.getAttribute("class")||"")}function L(t,n){for(var e=A(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function D(t,n){for(var e=A(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function S(){this.textContent=""}function E(){this.innerHTML=""}function P(){this.nextSibling&&this.parentNode.appendChild(this)}function Y(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}U.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var R=function(t){var n=C(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===b&&n.documentElement.namespaceURI===b?n.createElement(t):n.createElementNS(e,t)}})(n)};function F(){return null}function q(){var t=this.parentNode;t&&t.removeChild(this)}function H(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function z(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}var j={},O=null;function X(t,n,e){return t=$(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function $(t,n,e){return function(r){var i=O;O=r;try{t.call(this,this.__data__,n,e)}finally{O=i}}}function I(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?n.length=i:delete this.__on}}}function V(t,n,e){var r=j.hasOwnProperty(t.type)?X:$;return function(i,o,u){var a,s=this.__on,l=r(n,o,u);if(s)for(var c=0,f=s.length;c<f;++c)if((a=s[c]).type===t.type&&a.name===t.name)return this.removeEventListener(a.type,a.listener,a.capture),this.addEventListener(a.type,a.listener=l,a.capture=e),void(a.value=n);this.addEventListener(t.type,l,e),a={type:t.type,name:t.name,value:n,listener:l,capture:e},s?s.push(a):this.__on=[a]}}function Z(t,n,e,r){var i=O;t.sourceEvent=O,O=t;try{return n.apply(e,r)}finally{O=i}}function B(t,n,e){var r=T(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(j={mouseenter:"mouseover",mouseleave:"mouseout"}));var W=[null];function G(t,n){this._groups=t,this._parents=n}function Q(){return new G([[document.documentElement]],W)}G.prototype=Q.prototype={constructor:G,select:function(t){"function"!=typeof t&&(t=g(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u,a=n[i],s=a.length,l=r[i]=new Array(s),c=0;c<s;++c)(o=a[c])&&(u=t.call(o,o.__data__,c,a))&&("__data__"in o&&(u.__data__=o.__data__),l[c]=u);return new G(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=d(t));for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var u,a=n[o],s=a.length,l=0;l<s;++l)(u=a[l])&&(r.push(t.call(u,u.__data__,l,a)),i.push(u));return new G(r,i)},filter:function(t){"function"!=typeof t&&(t=v(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],a=u.length,s=r[i]=[],l=0;l<a;++l)(o=u[l])&&t.call(o,o.__data__,l,u)&&s.push(o);return new G(r,this._parents)},data:function(t,n){if(!t)return g=new Array(this.size()),l=-1,this.each((function(t){g[++l]=t})),g;var e=n?w:_,r=this._parents,i=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var o=i.length,u=new Array(o),a=new Array(o),s=new Array(o),l=0;l<o;++l){var c=r[l],f=i[l],h=f.length,g=t.call(c,c&&c.__data__,l,r),p=g.length,d=a[l]=new Array(p),v=u[l]=new Array(p);e(c,f,d,v,s[l]=new Array(h),g,n);for(var y,m,x=0,b=0;x<p;++x)if(y=d[x]){for(x>=b&&(b=x+1);!(m=v[b])&&++b<p;);y._next=m||null}}return(u=new G(u,r))._enter=a,u._exit=s,u},enter:function(){return new G(this._enter||this._groups.map(y),this._parents)},exit:function(){return new G(this._exit||this._groups.map(y),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=n&&(i=n(i)),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var s,l=n[a],c=e[a],f=l.length,h=u[a]=new Array(f),g=0;g<f;++g)(s=l[g]||c[g])&&(h[g]=s);for(;a<r;++a)u[a]=n[a];return new G(u,this._parents)},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,u=i[o];--o>=0;)(r=i[o])&&(u&&4^r.compareDocumentPosition(u)&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=x);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var u,a=e[o],s=a.length,l=i[o]=new Array(s),c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(n)}return new G(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),n=-1;return this.each((function(){t[++n]=this})),t},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var u=r[i];if(u)return u}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],u=0,a=o.length;u<a;++u)(i=o[u])&&t.call(i,i.__data__,u,o);return this},attr:function(t,n){var e=C(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}}:"function"==typeof n?e.local?function(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}:function(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}:e.local?function(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}:function(t,n){return function(){this.setAttribute(t,n)}})(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof n?function(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}:function(t,n,e){return function(){this.style.setProperty(t,n,e)}})(t,n,null==e?"":e)):N(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?function(t){return function(){delete this[t]}}:"function"==typeof n?function(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}:function(t,n){return function(){this[t]=n}})(t,n)):this.node()[t]},classed:function(t,n){var e=k(t+"");if(arguments.length<2){for(var r=A(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?function(t,n){return function(){(n.apply(this,arguments)?L:D)(this,t)}}:n?function(t){return function(){L(this,t)}}:function(t){return function(){D(this,t)}})(e,n))},text:function(t){return arguments.length?this.each(null==t?S:("function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}:function(t){return function(){this.textContent=t}})(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?E:("function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}:function(t){return function(){this.innerHTML=t}})(t)):this.node().innerHTML},raise:function(){return this.each(P)},lower:function(){return this.each(Y)},append:function(t){var n="function"==typeof t?t:R(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:R(t),r=null==n?F:"function"==typeof n?n:g(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(q)},clone:function(t){return this.select(t?z:H)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=function(t){return t.trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),u=o.length;if(!(arguments.length<2)){for(a=n?V:I,null==e&&(e=!1),r=0;r<u;++r)this.each(a(o[r],n,e));return this}var a=this.node().__on;if(a)for(var s,l=0,c=a.length;l<c;++l)for(r=0,s=a[l];r<u;++r)if((i=o[r]).type===s.type&&i.name===s.name)return s.value},dispatch:function(t,n){return this.each(("function"==typeof n?function(t,n){return function(){return B(this,t,n.apply(this,arguments))}}:function(t,n){return function(){return B(this,t,n)}})(t,n))}};var J=Q,K=function(t){return"string"==typeof t?new G([[document.querySelector(t)]],[document.documentElement]):new G([[t]],W)};function tt(){O.stopImmediatePropagation()}var nt=function(){O.preventDefault(),O.stopImmediatePropagation()},et=function(t){var n=t.document.documentElement,e=K(t).on("dragstart.drag",nt,!0);"onselectstart"in n?e.on("selectstart.drag",nt,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")};var rt=function(t,n,e){t.prototype=n.prototype=e,e.constructor=t};function it(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function ot(){}var ut="\\s*([+-]?\\d+)\\s*",at="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",st="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",lt=/^#([0-9a-f]{3,8})$/,ct=new RegExp("^rgb\\("+[ut,ut,ut]+"\\)$"),ft=new RegExp("^rgb\\("+[st,st,st]+"\\)$"),ht=new RegExp("^rgba\\("+[ut,ut,ut,at]+"\\)$"),gt=new RegExp("^rgba\\("+[st,st,st,at]+"\\)$"),pt=new RegExp("^hsl\\("+[at,st,st]+"\\)$"),dt=new RegExp("^hsla\\("+[at,st,st,at]+"\\)$"),vt={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 yt(){return this.rgb().formatHex()}function mt(){return this.rgb().formatRgb()}function _t(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=lt.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?wt(n):3===e?new Mt(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?xt(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?xt(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=ct.exec(t))?new Mt(n[1],n[2],n[3],1):(n=ft.exec(t))?new Mt(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=ht.exec(t))?xt(n[1],n[2],n[3],n[4]):(n=gt.exec(t))?xt(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=pt.exec(t))?kt(n[1],n[2]/100,n[3]/100,1):(n=dt.exec(t))?kt(n[1],n[2]/100,n[3]/100,n[4]):vt.hasOwnProperty(t)?wt(vt[t]):"transparent"===t?new Mt(NaN,NaN,NaN,0):null}function wt(t){return new Mt(t>>16&255,t>>8&255,255&t,1)}function xt(t,n,e,r){return r<=0&&(t=n=e=NaN),new Mt(t,n,e,r)}function bt(t,n,e,r){return 1===arguments.length?function(t){return t instanceof ot||(t=_t(t)),t?new Mt((t=t.rgb()).r,t.g,t.b,t.opacity):new Mt}(t):new Mt(t,n,e,null==r?1:r)}function Mt(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function Ct(){return"#"+Nt(this.r)+Nt(this.g)+Nt(this.b)}function Tt(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Nt(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function kt(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new Ut(t,n,e,r)}function At(t){if(t instanceof Ut)return new Ut(t.h,t.s,t.l,t.opacity);if(t instanceof ot||(t=_t(t)),!t)return new Ut;if(t instanceof Ut)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),u=NaN,a=o-i,s=(o+i)/2;return a?(u=n===o?(e-r)/a+6*(e<r):e===o?(r-n)/a+2:(n-e)/a+4,a/=s<.5?o+i:2-o-i,u*=60):a=s>0&&s<1?0:u,new Ut(u,a,s,t.opacity)}function Ut(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Lt(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function Dt(t,n,e,r,i){var o=t*t,u=o*t;return((1-3*t+3*o-u)*n+(4-6*o+3*u)*e+(1+3*t+3*o-3*u)*r+u*i)/6}rt(ot,_t,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:yt,formatHex:yt,formatHsl:function(){return At(this).formatHsl()},formatRgb:mt,toString:mt}),rt(Mt,bt,it(ot,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Mt(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Mt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ct,formatHex:Ct,formatRgb:Tt,toString:Tt})),rt(Ut,(function(t,n,e,r){return 1===arguments.length?At(t):new Ut(t,n,e,null==r?1:r)}),it(ot,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ut(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ut(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new Mt(Lt(t>=240?t-240:t+120,i,r),Lt(t,i,r),Lt(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var St=function(t){return function(){return t}};function Et(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):St(isNaN(t)?n:t)}var Pt=function t(n){var e=function(t){return 1==(t=+t)?Et:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):St(isNaN(n)?e:n)}}(n);function r(t,n){var r=e((t=bt(t)).r,(n=bt(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),u=Et(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=u(n),t+""}}return r.gamma=t,r}(1);function Yt(t){return function(n){var e,r,i=n.length,o=new Array(i),u=new Array(i),a=new Array(i);for(e=0;e<i;++e)r=bt(n[e]),o[e]=r.r||0,u[e]=r.g||0,a[e]=r.b||0;return o=t(o),u=t(u),a=t(a),r.opacity=1,function(t){return r.r=o(t),r.g=u(t),r.b=a(t),r+""}}}Yt((function(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],u=r>0?t[r-1]:2*i-o,a=r<n-1?t[r+2]:2*o-i;return Dt((e-r/n)*n,u,i,o,a)}})),Yt((function(t){var n=t.length;return function(e){var r=Math.floor(((e%=1)<0?++e:e)*n),i=t[(r+n-1)%n],o=t[r%n],u=t[(r+1)%n],a=t[(r+2)%n];return Dt((e-r/n)*n,i,o,u,a)}}));var Rt,Ft,qt=function(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}},Ht=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zt=new RegExp(Ht.source,"g"),jt=function(t,n){var e,r,i,o=Ht.lastIndex=zt.lastIndex=0,u=-1,a=[],s=[];for(t+="",n+="";(e=Ht.exec(t))&&(r=zt.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),a[u]?a[u]+=i:a[++u]=i),(e=e[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,s.push({i:u,x:qt(e,r)})),o=zt.lastIndex;return o<n.length&&(i=n.slice(o),a[u]?a[u]+=i:a[++u]=i),a.length<2?s[0]?function(t){return function(n){return t(n)+""}}(s[0].x):function(t){return function(){return t}}(n):(n=s.length,function(t){for(var e,r=0;r<n;++r)a[(e=s[r]).i]=e.x(t);return a.join("")})},Ot=function(){for(var t,n=O;t=n.sourceEvent;)n=t;return n},Xt=function(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var i=t.getBoundingClientRect();return[n.clientX-i.left-t.clientLeft,n.clientY-i.top-t.clientTop]},$t=function(t,n,e){arguments.length<3&&(e=n,n=Ot().changedTouches);for(var r,i=0,o=n?n.length:0;i<o;++i)if((r=n[i]).identifier===e)return Xt(t,r);return null},It=function(t){var n=Ot();return n.changedTouches&&(n=n.changedTouches[0]),Xt(t,n)},Vt=0,Zt=0,Bt=0,Wt=0,Gt=0,Qt=0,Jt="object"==typeof performance&&performance.now?performance:Date,Kt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function tn(){return Gt||(Kt(nn),Gt=Jt.now()+Qt)}function nn(){Gt=0}function en(){this._call=this._time=this._next=null}function rn(t,n,e){var r=new en;return r.restart(t,n,e),r}function on(){Gt=(Wt=Jt.now())+Qt,Vt=Zt=0;try{!function(){tn(),++Vt;for(var t,n=Rt;n;)(t=Gt-n._time)>=0&&n._call.call(null,t),n=n._next;--Vt}()}finally{Vt=0,function(){for(var t,n,e=Rt,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Rt=n);Ft=t,an(r)}(),Gt=0}}function un(){var t=Jt.now(),n=t-Wt;n>1e3&&(Qt-=n,Wt=t)}function an(t){Vt||(Zt&&(Zt=clearTimeout(Zt)),t-Gt>24?(t<1/0&&(Zt=setTimeout(on,t-Jt.now()-Qt)),Bt&&(Bt=clearInterval(Bt))):(Bt||(Wt=Jt.now(),Bt=setInterval(un,1e3)),Vt=1,Kt(on)))}en.prototype=rn.prototype={constructor:en,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?tn():+e)+(null==n?0:+n),this._next||Ft===this||(Ft?Ft._next=this:Rt=this,Ft=this),this._call=t,this._time=e,an()},stop:function(){this._call&&(this._call=null,this._time=1/0,an())}};var sn=function(t,n,e){var r=new en;return n=null==n?0:+n,r.restart((function(e){r.stop(),t(e+n)}),n,e),r},ln=f("start","end","cancel","interrupt"),cn=[],fn=function(t,n,e,r,i,o){var u=t.__transition;if(u){if(e in u)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(s){var l,c,f,h;if(1!==e.state)return a();for(l in i)if((h=i[l]).name===e.name){if(3===h.state)return sn(o);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[l]):+l<n&&(h.state=6,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete i[l])}if(sn((function(){3===e.state&&(e.state=4,e.timer.restart(u,e.delay,e.time),u(s))})),e.state=2,e.on.call("start",t,t.__data__,e.index,e.group),2===e.state){for(e.state=3,r=new Array(f=e.tween.length),l=0,c=-1;l<f;++l)(h=e.tween[l].value.call(t,t.__data__,e.index,e.group))&&(r[++c]=h);r.length=c+1}}function u(n){for(var i=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(a),e.state=5,1),o=-1,u=r.length;++o<u;)r[o].call(t,i);5===e.state&&(e.on.call("end",t,t.__data__,e.index,e.group),a())}function a(){for(var r in e.state=6,e.timer.stop(),delete i[n],i)return;delete t.__transition}i[n]=e,e.timer=rn((function(t){e.state=1,e.timer.restart(o,e.delay,e.time),e.delay<=t&&o(t-e.delay)}),0,e.time)}(t,e,{name:n,index:r,group:i,on:ln,tween:cn,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})};function hn(t,n){var e=pn(t,n);if(e.state>0)throw new Error("too late; already scheduled");return e}function gn(t,n){var e=pn(t,n);if(e.state>3)throw new Error("too late; already running");return e}function pn(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}var dn,vn,yn,mn,_n=180/Math.PI,wn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},xn=function(t,n,e,r,i,o){var u,a,s;return(u=Math.sqrt(t*t+n*n))&&(t/=u,n/=u),(s=t*e+n*r)&&(e-=t*s,r-=n*s),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,s/=a),t*r<n*e&&(t=-t,n=-n,s=-s,u=-u),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*_n,skewX:Math.atan(s)*_n,scaleX:u,scaleY:a}};function bn(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}return function(o,u){var a=[],s=[];return o=t(o),u=t(u),function(t,r,i,o,u,a){if(t!==i||r!==o){var s=u.push("translate(",null,n,null,e);a.push({i:s-4,x:qt(t,i)},{i:s-2,x:qt(r,o)})}else(i||o)&&u.push("translate("+i+n+o+e)}(o.translateX,o.translateY,u.translateX,u.translateY,a,s),function(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:qt(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,u.rotate,a,s),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:qt(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,u.skewX,a,s),function(t,n,e,r,o,u){if(t!==e||n!==r){var a=o.push(i(o)+"scale(",null,",",null,")");u.push({i:a-4,x:qt(t,e)},{i:a-2,x:qt(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,u.scaleX,u.scaleY,a,s),o=u=null,function(t){for(var n,e=-1,r=s.length;++e<r;)a[(n=s[e]).i]=n.x(t);return a.join("")}}}var Mn=bn((function(t){return"none"===t?wn:(dn||(dn=document.createElement("DIV"),vn=document.documentElement,yn=document.defaultView),dn.style.transform=t,t=yn.getComputedStyle(vn.appendChild(dn),null).getPropertyValue("transform"),vn.removeChild(dn),t=t.slice(7,-1).split(","),xn(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),Cn=bn((function(t){return null==t?wn:(mn||(mn=document.createElementNS("http://www.w3.org/2000/svg","g")),mn.setAttribute("transform",t),(t=mn.transform.baseVal.consolidate())?(t=t.matrix,xn(t.a,t.b,t.c,t.d,t.e,t.f)):wn)}),", ",")",")");function Tn(t,n,e){var r=t._id;return t.each((function(){var t=gn(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)})),function(t){return pn(t,r).value[n]}}var Nn=function(t,n){var e;return("number"==typeof n?qt:n instanceof _t?Pt:(e=_t(n))?(n=e,Pt):jt)(t,n)},kn=J.prototype.constructor;function An(t){return function(){this.style.removeProperty(t)}}var Un=0;function Ln(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function Dn(){return++Un}var Sn=J.prototype;Ln.prototype=function(t){return J().transition(t)}.prototype={constructor:Ln,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=g(t));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var a,s,l=r[u],c=l.length,f=o[u]=new Array(c),h=0;h<c;++h)(a=l[h])&&(s=t.call(a,a.__data__,h,l))&&("__data__"in a&&(s.__data__=a.__data__),f[h]=s,fn(f[h],n,e,h,f,pn(a,e)));return new Ln(o,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=d(t));for(var r=this._groups,i=r.length,o=[],u=[],a=0;a<i;++a)for(var s,l=r[a],c=l.length,f=0;f<c;++f)if(s=l[f]){for(var h,g=t.call(s,s.__data__,f,l),p=pn(s,e),v=0,y=g.length;v<y;++v)(h=g[v])&&fn(h,n,e,v,g,p);o.push(g),u.push(s)}return new Ln(o,u,n,e)},filter:function(t){"function"!=typeof t&&(t=v(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],a=u.length,s=r[i]=[],l=0;l<a;++l)(o=u[l])&&t.call(o,o.__data__,l,u)&&s.push(o);return new Ln(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var s,l=n[a],c=e[a],f=l.length,h=u[a]=new Array(f),g=0;g<f;++g)(s=l[g]||c[g])&&(h[g]=s);for(;a<r;++a)u[a]=n[a];return new Ln(u,this._parents,this._name,this._id)},selection:function(){return new kn(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=Dn(),r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],s=a.length,l=0;l<s;++l)if(u=a[l]){var c=pn(u,n);fn(u,t,e,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Ln(r,this._parents,t,e)},call:Sn.call,nodes:Sn.nodes,node:Sn.node,size:Sn.size,empty:Sn.empty,each:Sn.each,on:function(t,n){var e=this._id;return arguments.length<2?pn(this.node(),e).on.on(t):this.each(function(t,n,e){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?hn:gn;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}(e,t,n))},attr:function(t,n){var e=C(t),r="transform"===e?Cn:Nn;return this.attrTween(t,"function"==typeof n?(e.local?function(t,n,e){var r,i,o;return function(){var u,a,s=e(this);if(null!=s)return(u=this.getAttributeNS(t.space,t.local))===(a=s+"")?null:u===r&&a===i?o:(i=a,o=n(r=u,s));this.removeAttributeNS(t.space,t.local)}}:function(t,n,e){var r,i,o;return function(){var u,a,s=e(this);if(null!=s)return(u=this.getAttribute(t))===(a=s+"")?null:u===r&&a===i?o:(i=a,o=n(r=u,s));this.removeAttribute(t)}})(e,r,Tn(this,"attr."+t,n)):null==n?(e.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(e):(e.local?function(t,n,e){var r,i,o=e+"";return function(){var u=this.getAttributeNS(t.space,t.local);return u===o?null:u===r?i:i=n(r=u,e)}}:function(t,n,e){var r,i,o=e+"";return function(){var u=this.getAttribute(t);return u===o?null:u===r?i:i=n(r=u,e)}})(e,r,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=C(t);return this.tween(e,(r.local?function(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}(t,i)),e}return i._value=n,i}:function(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}(t,i)),e}return i._value=n,i})(r,n))},style:function(t,n,e){var r="transform"==(t+="")?Mn:Nn;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=N(this,t),u=(this.style.removeProperty(t),N(this,t));return o===u?null:o===e&&u===r?i:i=n(e=o,r=u)}}(t,r)).on("end.style."+t,An(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var u=N(this,t),a=e(this),s=a+"";return null==a&&(this.style.removeProperty(t),s=a=N(this,t)),u===s?null:u===r&&s===i?o:(i=s,o=n(r=u,a))}}(t,r,Tn(this,"style."+t,n))).each(function(t,n){var e,r,i,o,u="style."+n,a="end."+u;return function(){var s=gn(this,t),l=s.on,c=null==s.value[u]?o||(o=An(n)):void 0;l===e&&i===c||(r=(e=l).copy()).on(a,i=c),s.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var u=N(this,t);return u===o?null:u===r?i:i=n(r=u,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}(t,o,e)),r}return o._value=n,o}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Tn(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,function(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&function(t){return function(n){this.textContent=t.call(this,n)}}(r)),n}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=pn(this.node(),e).tween,o=0,u=i.length;o<u;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?function(t,n){var e,r;return function(){var i=gn(this,t),o=i.tween;if(o!==e)for(var u=0,a=(r=e=o).length;u<a;++u)if(r[u].name===n){(r=r.slice()).splice(u,1);break}i.tween=r}}:function(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=gn(this,t),u=o.tween;if(u!==r){i=(r=u).slice();for(var a={name:n,value:e},s=0,l=i.length;s<l;++s)if(i[s].name===n){i[s]=a;break}s===l&&i.push(a)}o.tween=i}})(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?function(t,n){return function(){hn(this,t).delay=+n.apply(this,arguments)}}:function(t,n){return n=+n,function(){hn(this,t).delay=n}})(n,t)):pn(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?function(t,n){return function(){gn(this,t).duration=+n.apply(this,arguments)}}:function(t,n){return n=+n,function(){gn(this,t).duration=n}})(n,t)):pn(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(function(t,n){if("function"!=typeof n)throw new Error;return function(){gn(this,t).ease=n}}(n,t)):pn(this.node(),n).ease},end:function(){var t,n,e=this,r=e._id,i=e.size();return new Promise((function(o,u){var a={value:u},s={value:function(){0==--i&&o()}};e.each((function(){var e=gn(this,r),i=e.on;i!==t&&((n=(t=i).copy())._.cancel.push(a),n._.interrupt.push(a),n._.end.push(s)),e.on=n}))}))}};var En={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Pn(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return En.time=tn(),En;return e}function Yn(t){return{type:t}}J.prototype.interrupt=function(t){return this.each((function(){!function(t,n){var e,r,i,o=t.__transition,u=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[i]):u=!1;u&&delete t.__transition}}(this,t)}))},J.prototype.transition=function(t){var n,e;t instanceof Ln?(n=t._id,t=t._name):(n=Dn(),(e=En).time=tn(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],s=a.length,l=0;l<s;++l)(u=a[l])&&fn(u,t,n,l,a,e||Pn(u,n));return new Ln(r,this._parents,t,n)},["w","e"].map(Yn),["n","s"].map(Yn),["n","w","e","s","nw","ne","sw","se"].map(Yn),Math.cos,Math.sin,Math.PI,Math.max,Array.prototype.slice;var Rn=Math.PI,Fn=2*Rn,qn=Fn-1e-6;function Hn(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function zn(){}function jn(t,n){var e=new zn;if(t instanceof zn)t.each((function(t,n){e.set(n,t)}));else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i<o;)e.set(i,t[i]);else for(;++i<o;)e.set(n(r=t[i],i,t),r)}else if(t)for(var u in t)e.set(u,t[u]);return e}Hn.prototype=function(){return new Hn}.prototype={constructor:Hn,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,r){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+r)},bezierCurveTo:function(t,n,e,r,i,o){this._+="C"+ +t+","+ +n+","+ +e+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,n,e,r,i){t=+t,n=+n,e=+e,r=+r,i=+i;var o=this._x1,u=this._y1,a=e-t,s=r-n,l=o-t,c=u-n,f=l*l+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(f>1e-6)if(Math.abs(c*a-s*l)>1e-6&&i){var h=e-o,g=r-u,p=a*a+s*s,d=h*h+g*g,v=Math.sqrt(p),y=Math.sqrt(f),m=i*Math.tan((Rn-Math.acos((p+f-d)/(2*v*y)))/2),_=m/y,w=m/v;Math.abs(_-1)>1e-6&&(this._+="L"+(t+_*l)+","+(n+_*c)),this._+="A"+i+","+i+",0,0,"+ +(c*h>l*g)+","+(this._x1=t+w*a)+","+(this._y1=n+w*s)}else this._+="L"+(this._x1=t)+","+(this._y1=n)},arc:function(t,n,e,r,i,o){t=+t,n=+n,o=!!o;var u=(e=+e)*Math.cos(r),a=e*Math.sin(r),s=t+u,l=n+a,c=1^o,f=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+s+","+l:(Math.abs(this._x1-s)>1e-6||Math.abs(this._y1-l)>1e-6)&&(this._+="L"+s+","+l),e&&(f<0&&(f=f%Fn+Fn),f>qn?this._+="A"+e+","+e+",0,1,"+c+","+(t-u)+","+(n-a)+"A"+e+","+e+",0,1,"+c+","+(this._x1=s)+","+(this._y1=l):f>1e-6&&(this._+="A"+e+","+e+",0,"+ +(f>=Rn)+","+c+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}},zn.prototype=jn.prototype={constructor:zn,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,n){return this["$"+t]=n,this},remove:function(t){var n="$"+t;return n in this&&delete this[n]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)"$"===n[0]&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)"$"===n[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var n in this)"$"===n[0]&&t(this[n],n.slice(1),this)}};var On=jn;function Xn(){}var $n=On.prototype;Xn.prototype=function(t,n){var e=new Xn;if(t instanceof Xn)t.each((function(t){e.add(t)}));else if(t){var r=-1,i=t.length;if(null==n)for(;++r<i;)e.add(t[r]);else for(;++r<i;)e.add(n(t[r],r,t))}return e}.prototype={constructor:Xn,has:$n.has,add:function(t){return this["$"+(t+="")]=t,this},remove:$n.remove,clear:$n.clear,values:$n.keys,size:$n.size,empty:$n.empty,each:$n.each},Array.prototype.slice;var In=function(t){return function(){return t}};function Vn(t,n,e,r,i,o,u,a,s,l){this.target=t,this.type=n,this.subject=e,this.identifier=r,this.active=i,this.x=o,this.y=u,this.dx=a,this.dy=s,this._=l}function Zn(){return!O.ctrlKey&&!O.button}function Bn(){return this.parentNode}function Wn(t){return null==t?{x:O.x,y:O.y}:t}function Gn(){return navigator.maxTouchPoints||"ontouchstart"in this}Vn.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var Qn=function(t){return function(){return t}},Jn=function(){return 1e-6*(Math.random()-.5)};function Kn(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,o,u,a,s,l,c,f,h,g=t._root,p={data:r},d=t._x0,v=t._y0,y=t._x1,m=t._y1;if(!g)return t._root=p,t;for(;g.length;)if((l=n>=(o=(d+y)/2))?d=o:y=o,(c=e>=(u=(v+m)/2))?v=u:m=u,i=g,!(g=g[f=c<<1|l]))return i[f]=p,t;if(a=+t._x.call(null,g.data),s=+t._y.call(null,g.data),n===a&&e===s)return p.next=g,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(l=n>=(o=(d+y)/2))?d=o:y=o,(c=e>=(u=(v+m)/2))?v=u:m=u}while((f=c<<1|l)==(h=(s>=u)<<1|a>=o));return i[h]=g,i[f]=p,t}var te=function(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i};function ne(t){return t[0]}function ee(t){return t[1]}function re(t,n,e){var r=new ie(null==n?ne:n,null==e?ee:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function ie(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function oe(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var ue=re.prototype=ie.prototype;function ae(t){return t.index}function se(t,n){var e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function le(t){return t.x}function ce(t){return t.y}ue.copy=function(){var t,n,e=new ie(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=oe(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=oe(n));return e},ue.add=function(t){var n=+this._x.call(null,t),e=+this._y.call(null,t);return Kn(this.cover(n,e),n,e,t)},ue.addAll=function(t){var n,e,r,i,o=t.length,u=new Array(o),a=new Array(o),s=1/0,l=1/0,c=-1/0,f=-1/0;for(e=0;e<o;++e)isNaN(r=+this._x.call(null,n=t[e]))||isNaN(i=+this._y.call(null,n))||(u[e]=r,a[e]=i,r<s&&(s=r),r>c&&(c=r),i<l&&(l=i),i>f&&(f=i));if(s>c||l>f)return this;for(this.cover(s,l).cover(c,f),e=0;e<o;++e)Kn(this,u[e],a[e],t[e]);return this},ue.cover=function(t,n){if(isNaN(t=+t)||isNaN(n=+n))return this;var e=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(e))i=(e=Math.floor(t))+1,o=(r=Math.floor(n))+1;else{for(var u,a,s=i-e,l=this._root;e>t||t>=i||r>n||n>=o;)switch(a=(n<r)<<1|t<e,(u=new Array(4))[a]=l,l=u,s*=2,a){case 0:i=e+s,o=r+s;break;case 1:e=i-s,o=r+s;break;case 2:i=e+s,r=o-s;break;case 3:e=i-s,r=o-s}this._root&&this._root.length&&(this._root=l)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this},ue.data=function(){var t=[];return this.visit((function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)})),t},ue.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},ue.find=function(t,n,e){var r,i,o,u,a,s,l,c=this._x0,f=this._y0,h=this._x1,g=this._y1,p=[],d=this._root;for(d&&p.push(new te(d,c,f,h,g)),null==e?e=1/0:(c=t-e,f=n-e,h=t+e,g=n+e,e*=e);s=p.pop();)if(!(!(d=s.node)||(i=s.x0)>h||(o=s.y0)>g||(u=s.x1)<c||(a=s.y1)<f))if(d.length){var v=(i+u)/2,y=(o+a)/2;p.push(new te(d[3],v,y,u,a),new te(d[2],i,y,v,a),new te(d[1],v,o,u,y),new te(d[0],i,o,v,y)),(l=(n>=y)<<1|t>=v)&&(s=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=s)}else{var m=t-+this._x.call(null,d.data),_=n-+this._y.call(null,d.data),w=m*m+_*_;if(w<e){var x=Math.sqrt(e=w);c=t-x,f=n-x,h=t+x,g=n+x,r=d.data}}return r},ue.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(u=+this._y.call(null,t)))return this;var n,e,r,i,o,u,a,s,l,c,f,h,g=this._root,p=this._x0,d=this._y0,v=this._x1,y=this._y1;if(!g)return this;if(g.length)for(;;){if((l=o>=(a=(p+v)/2))?p=a:v=a,(c=u>=(s=(d+y)/2))?d=s:y=s,n=g,!(g=g[f=c<<1|l]))return this;if(!g.length)break;(n[f+1&3]||n[f+2&3]||n[f+3&3])&&(e=n,h=f)}for(;g.data!==t;)if(r=g,!(g=g.next))return this;return(i=g.next)&&delete g.next,r?(i?r.next=i:delete r.next,this):n?(i?n[f]=i:delete n[f],(g=n[0]||n[1]||n[2]||n[3])&&g===(n[3]||n[2]||n[1]||n[0])&&!g.length&&(e?e[h]=g:this._root=g),this):(this._root=i,this)},ue.removeAll=function(t){for(var n=0,e=t.length;n<e;++n)this.remove(t[n]);return this},ue.root=function(){return this._root},ue.size=function(){var t=0;return this.visit((function(n){if(!n.length)do{++t}while(n=n.next)})),t},ue.visit=function(t){var n,e,r,i,o,u,a=[],s=this._root;for(s&&a.push(new te(s,this._x0,this._y0,this._x1,this._y1));n=a.pop();)if(!t(s=n.node,r=n.x0,i=n.y0,o=n.x1,u=n.y1)&&s.length){var l=(r+o)/2,c=(i+u)/2;(e=s[3])&&a.push(new te(e,l,c,o,u)),(e=s[2])&&a.push(new te(e,r,c,l,u)),(e=s[1])&&a.push(new te(e,l,i,o,c)),(e=s[0])&&a.push(new te(e,r,i,l,c))}return this},ue.visitAfter=function(t){var n,e=[],r=[];for(this._root&&e.push(new te(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var i=n.node;if(i.length){var o,u=n.x0,a=n.y0,s=n.x1,l=n.y1,c=(u+s)/2,f=(a+l)/2;(o=i[0])&&e.push(new te(o,u,a,c,f)),(o=i[1])&&e.push(new te(o,c,a,s,f)),(o=i[2])&&e.push(new te(o,u,f,c,l)),(o=i[3])&&e.push(new te(o,c,f,s,l))}r.push(n)}for(;n=r.pop();)t(n.node,n.x0,n.y0,n.x1,n.y1);return this},ue.x=function(t){return arguments.length?(this._x=t,this):this._x},ue.y=function(t){return arguments.length?(this._y=t,this):this._y};var fe=Math.PI*(3-Math.sqrt(5));function he(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]}var ge=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function pe(t){if(!(n=ge.exec(t)))throw new Error("invalid format: "+t);var n;return new de({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}function de(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+""}pe.prototype=de.prototype,de.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 ve,ye,me,_e=function(t,n){var e=he(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},we={"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return _e(100*t,n)},r:_e,s:function(t,n){var e=he(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(ve=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,u=r.length;return o===u?r:o>u?r+new Array(o-u+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+he(t,Math.max(0,n+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},xe=function(t){return t},be=Array.prototype.map,Me=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];ye=function(t){var n=void 0===t.grouping||void 0===t.thousands?xe:function(t,n){return function(e,r){for(var i=e.length,o=[],u=0,a=t[0],s=0;i>0&&a>0&&(s+a+1>r&&(a=Math.max(1,r-s)),o.push(e.substring(i-=a,i+a)),!((s+=a+1)>r));)a=t[u=(u+1)%t.length];return o.reverse().join(n)}}(be.call(t.grouping,Number),t.thousands+""),e=void 0===t.currency?"":t.currency[0]+"",r=void 0===t.currency?"":t.currency[1]+"",i=void 0===t.decimal?".":t.decimal+"",o=void 0===t.numerals?xe:function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(be.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",a=void 0===t.minus?"-":t.minus+"",s=void 0===t.nan?"NaN":t.nan+"";function l(t){var l=(t=pe(t)).fill,c=t.align,f=t.sign,h=t.symbol,g=t.zero,p=t.width,d=t.comma,v=t.precision,y=t.trim,m=t.type;"n"===m?(d=!0,m="g"):we[m]||(void 0===v&&(v=12),y=!0,m="g"),(g||"0"===l&&"="===c)&&(g=!0,l="0",c="=");var _="$"===h?e:"#"===h&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",w="$"===h?r:/[%p]/.test(m)?u:"",x=we[m],b=/[defgprs%]/.test(m);function M(t){var e,r,u,h=_,M=w;if("c"===m)M=x(t)+M,t="";else{var C=(t=+t)<0||1/t<0;if(t=isNaN(t)?s:x(Math.abs(t),v),y&&(t=function(t){t:for(var n,e=t.length,r=1,i=-1;r<e;++r)switch(t[r]){case".":i=n=r;break;case"0":0===i&&(i=r),n=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(n+1):t}(t)),C&&0==+t&&"+"!==f&&(C=!1),h=(C?"("===f?f:a:"-"===f||"("===f?"":f)+h,M=("s"===m?Me[8+ve/3]:"")+M+(C&&"("===f?")":""),b)for(e=-1,r=t.length;++e<r;)if(48>(u=t.charCodeAt(e))||u>57){M=(46===u?i+t.slice(e+1):t.slice(e))+M,t=t.slice(0,e);break}}d&&!g&&(t=n(t,1/0));var T=h.length+t.length+M.length,N=T<p?new Array(p-T+1).join(l):"";switch(d&&g&&(t=n(N+t,N.length?p-M.length:1/0),N=""),c){case"<":t=h+t+M+N;break;case"=":t=h+N+t+M;break;case"^":t=N.slice(0,T=N.length>>1)+h+t+M+N.slice(T);break;default:t=N+h+t+M}return o(t)}return v=void 0===v?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),M.toString=function(){return t+""},M}return{format:l,formatPrefix:function(t,n){var e=l(((t=pe(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=he(Math.abs(t)))?t[1]:NaN}(n)/3))),i=Math.pow(10,-r),o=Me[8+r/3];return function(t){return e(i*t)+o}}}}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),me=ye.format,ye.formatPrefix;var Ce=function(){return Math.random()},Te=(function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,1===arguments.length?(e=t,t=0):e-=t,function(){return n()*e+t}}return e.source=t,e}(Ce),function t(n){function e(t,e){var r,i;return t=null==t?0:+t,e=null==e?1:+e,function(){var o;if(null!=r)o=r,r=null;else do{r=2*n()-1,o=2*n()-1,i=r*r+o*o}while(!i||i>1);return t+e*o*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(Ce)),Ne=(function t(n){function e(){var t=Te.source(n).apply(this,arguments);return function(){return Math.exp(t())}}return e.source=t,e}(Ce),function t(n){function e(t){return function(){for(var e=0,r=0;r<t;++r)e+=n();return e}}return e.source=t,e}(Ce));function ke(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}(function t(n){function e(t){var e=Ne.source(n)(t);return function(){return e()/t}}return e.source=t,e})(Ce),function t(n){function e(t){return function(){return-Math.log(1-n())/t}}return e.source=t,e}(Ce);var Ae=Array.prototype,Ue=(Ae.map,Ae.slice),Le={name:"implicit"};var De=new Date,Se=new Date;function Ee(t,n,e,r){function i(n){return t(n=0===arguments.length?new Date:new Date(+n)),n}return i.floor=function(n){return t(n=new Date(+n)),n},i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n<e-t?n:e},i.offset=function(t,e){return n(t=new Date(+t),null==e?1:Math.floor(e)),t},i.range=function(e,r,o){var u,a=[];if(e=i.ceil(e),o=null==o?1:Math.floor(o),!(e<r&&o>0))return a;do{a.push(u=new Date(+e)),n(e,o),t(e)}while(u<e&&e<r);return a},i.filter=function(e){return Ee((function(n){if(n>=n)for(;t(n),!e(n);)n.setTime(n-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););}))},e&&(i.count=function(n,r){return De.setTime(+n),Se.setTime(+r),t(De),t(Se),Math.floor(e(De,Se))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}var Pe=Ee((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n)}),(function(t,n){return n.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));Pe.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Ee((function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)}),(function(n,e){n.setFullYear(n.getFullYear()+e*t)})):null};var Ye=Pe,Re=((Pe.range,Ee((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,n){t.setMonth(t.getMonth()+n)}),(function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()}))).range,6e4),Fe=6048e5;function qe(t){return Ee((function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+7*n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Re)/Fe}))}var He=qe(0),ze=qe(1),je=qe(2),Oe=qe(3),Xe=qe(4),$e=qe(5),Ie=qe(6),Ve=(He.range,ze.range,je.range,Oe.range,Xe.range,$e.range,Ie.range,Ee((function(t){t.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Re)/864e5}),(function(t){return t.getDate()-1}))),Ze=Ve,Be=((((Ve.range,Ee((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-t.getMinutes()*Re)}),(function(t,n){t.setTime(+t+36e5*n)}),(function(t,n){return(n-t)/36e5}),(function(t){return t.getHours()}))).range,Ee((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,n){t.setTime(+t+n*Re)}),(function(t,n){return(n-t)/Re}),(function(t){return t.getMinutes()}))).range,Ee((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,n){t.setTime(+t+1e3*n)}),(function(t,n){return(n-t)/1e3}),(function(t){return t.getUTCSeconds()}))).range,Ee((function(){}),(function(t,n){t.setTime(+t+n)}),(function(t,n){return n-t})));function We(t){return Ee((function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+7*n)}),(function(t,n){return(n-t)/Fe}))}Be.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Ee((function(n){n.setTime(Math.floor(n/t)*t)}),(function(n,e){n.setTime(+n+e*t)}),(function(n,e){return(e-n)/t})):Be:null},Be.range;var Ge=We(0),Qe=We(1),Je=We(2),Ke=We(3),tr=We(4),nr=We(5),er=We(6),rr=(Ge.range,Qe.range,Je.range,Ke.range,tr.range,nr.range,er.range,Ee((function(t){t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+n)}),(function(t,n){return(n-t)/864e5}),(function(t){return t.getUTCDate()-1}))),ir=rr,or=(rr.range,Ee((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)}),(function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()})));or.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Ee((function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)}),(function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)})):null};var ur=or;function ar(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function sr(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function lr(t,n,e){return{y:t,m:n,d:e,H:0,M:0,S:0,L:0}}or.range;var cr,fr={"-":"",_:" ",0:"0"},hr=/^\s*\d+/,gr=/^%/,pr=/[\\^$*+?|[\]().{}]/g;function dr(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<e?new Array(e-o+1).join(n)+i:i)}function vr(t){return t.replace(pr,"\\$&")}function yr(t){return new RegExp("^(?:"+t.map(vr).join("|")+")","i")}function mr(t){for(var n={},e=-1,r=t.length;++e<r;)n[t[e].toLowerCase()]=e;return n}function _r(t,n,e){var r=hr.exec(n.slice(e,e+1));return r?(t.w=+r[0],e+r[0].length):-1}function wr(t,n,e){var r=hr.exec(n.slice(e,e+1));return r?(t.u=+r[0],e+r[0].length):-1}function xr(t,n,e){var r=hr.exec(n.slice(e,e+2));return r?(t.U=+r[0],e+r[0].length):-1}function br(t,n,e){var r=hr.exec(n.slice(e,e+2));return r?(t.V=+r[0],e+r[0].length):-1}function Mr(t,n,e){var r=hr.exec(n.slice(e,e+2));return r?(t.W=+r[0],e+r[0].length):-1}function Cr(t,n,e){var r=hr.exec(n.slice(e,e+4));return r?(t.y=+r[0],e+r[0].length):-1}function Tr(t,n,e){var r=hr.exec(n.slice(e,e+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),e+r[0].length):-1}function Nr(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function kr(t,n,e){var r=hr.exec(n.slice(e,e+1));return r?(t.q=3*r[0]-3,e+r[0].length):-1}function Ar(t,n,e){var r=hr.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function Ur(t,n,e){var r=hr.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function Lr(t,n,e){var r=hr.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function Dr(t,n,e){var r=hr.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function Sr(t,n,e){var r=hr.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function Er(t,n,e){var r=hr.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function Pr(t,n,e){var r=hr.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function Yr(t,n,e){var r=hr.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function Rr(t,n,e){var r=gr.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function Fr(t,n,e){var r=hr.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function qr(t,n,e){var r=hr.exec(n.slice(e));return r?(t.s=+r[0],e+r[0].length):-1}function Hr(t,n){return dr(t.getDate(),n,2)}function zr(t,n){return dr(t.getHours(),n,2)}function jr(t,n){return dr(t.getHours()%12||12,n,2)}function Or(t,n){return dr(1+Ze.count(Ye(t),t),n,3)}function Xr(t,n){return dr(t.getMilliseconds(),n,3)}function $r(t,n){return Xr(t,n)+"000"}function Ir(t,n){return dr(t.getMonth()+1,n,2)}function Vr(t,n){return dr(t.getMinutes(),n,2)}function Zr(t,n){return dr(t.getSeconds(),n,2)}function Br(t){var n=t.getDay();return 0===n?7:n}function Wr(t,n){return dr(He.count(Ye(t)-1,t),n,2)}function Gr(t){var n=t.getDay();return n>=4||0===n?Xe(t):Xe.ceil(t)}function Qr(t,n){return t=Gr(t),dr(Xe.count(Ye(t),t)+(4===Ye(t).getDay()),n,2)}function Jr(t){return t.getDay()}function Kr(t,n){return dr(ze.count(Ye(t)-1,t),n,2)}function ti(t,n){return dr(t.getFullYear()%100,n,2)}function ni(t,n){return dr((t=Gr(t)).getFullYear()%100,n,2)}function ei(t,n){return dr(t.getFullYear()%1e4,n,4)}function ri(t,n){var e=t.getDay();return dr((t=e>=4||0===e?Xe(t):Xe.ceil(t)).getFullYear()%1e4,n,4)}function ii(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+dr(n/60|0,"0",2)+dr(n%60,"0",2)}function oi(t,n){return dr(t.getUTCDate(),n,2)}function ui(t,n){return dr(t.getUTCHours(),n,2)}function ai(t,n){return dr(t.getUTCHours()%12||12,n,2)}function si(t,n){return dr(1+ir.count(ur(t),t),n,3)}function li(t,n){return dr(t.getUTCMilliseconds(),n,3)}function ci(t,n){return li(t,n)+"000"}function fi(t,n){return dr(t.getUTCMonth()+1,n,2)}function hi(t,n){return dr(t.getUTCMinutes(),n,2)}function gi(t,n){return dr(t.getUTCSeconds(),n,2)}function pi(t){var n=t.getUTCDay();return 0===n?7:n}function di(t,n){return dr(Ge.count(ur(t)-1,t),n,2)}function vi(t){var n=t.getUTCDay();return n>=4||0===n?tr(t):tr.ceil(t)}function yi(t,n){return t=vi(t),dr(tr.count(ur(t),t)+(4===ur(t).getUTCDay()),n,2)}function mi(t){return t.getUTCDay()}function _i(t,n){return dr(Qe.count(ur(t)-1,t),n,2)}function wi(t,n){return dr(t.getUTCFullYear()%100,n,2)}function xi(t,n){return dr((t=vi(t)).getUTCFullYear()%100,n,2)}function bi(t,n){return dr(t.getUTCFullYear()%1e4,n,4)}function Mi(t,n){var e=t.getUTCDay();return dr((t=e>=4||0===e?tr(t):tr.ceil(t)).getUTCFullYear()%1e4,n,4)}function Ci(){return"+0000"}function Ti(){return"%"}function Ni(t){return+t}function ki(t){return Math.floor(+t/1e3)}(cr=function(t){var n=t.dateTime,e=t.date,r=t.time,i=t.periods,o=t.days,u=t.shortDays,a=t.months,s=t.shortMonths,l=yr(i),c=mr(i),f=yr(o),h=mr(o),g=yr(u),p=mr(u),d=yr(a),v=mr(a),y=yr(s),m=mr(s),_={a:function(t){return u[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return s[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:Hr,e:Hr,f:$r,g:ni,G:ri,H:zr,I:jr,j:Or,L:Xr,m:Ir,M:Vr,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Ni,s:ki,S:Zr,u:Br,U:Wr,V:Qr,w:Jr,W:Kr,x:null,X:null,y:ti,Y:ei,Z:ii,"%":Ti},w={a:function(t){return u[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return s[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:oi,e:oi,f:ci,g:xi,G:Mi,H:ui,I:ai,j:si,L:li,m:fi,M:hi,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Ni,s:ki,S:gi,u:pi,U:di,V:yi,w:mi,W:_i,x:null,X:null,y:wi,Y:bi,Z:Ci,"%":Ti},x={a:function(t,n,e){var r=g.exec(n.slice(e));return r?(t.w=p[r[0].toLowerCase()],e+r[0].length):-1},A:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.w=h[r[0].toLowerCase()],e+r[0].length):-1},b:function(t,n,e){var r=y.exec(n.slice(e));return r?(t.m=m[r[0].toLowerCase()],e+r[0].length):-1},B:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.m=v[r[0].toLowerCase()],e+r[0].length):-1},c:function(t,e,r){return C(t,n,e,r)},d:Ur,e:Ur,f:Yr,g:Tr,G:Cr,H:Dr,I:Dr,j:Lr,L:Pr,m:Ar,M:Sr,p:function(t,n,e){var r=l.exec(n.slice(e));return r?(t.p=c[r[0].toLowerCase()],e+r[0].length):-1},q:kr,Q:Fr,s:qr,S:Er,u:wr,U:xr,V:br,w:_r,W:Mr,x:function(t,n,r){return C(t,e,n,r)},X:function(t,n,e){return C(t,r,n,e)},y:Tr,Y:Cr,Z:Nr,"%":Rr};function b(t,n){return function(e){var r,i,o,u=[],a=-1,s=0,l=t.length;for(e instanceof Date||(e=new Date(+e));++a<l;)37===t.charCodeAt(a)&&(u.push(t.slice(s,a)),null!=(i=fr[r=t.charAt(++a)])?r=t.charAt(++a):i="e"===r?" ":"0",(o=n[r])&&(r=o(e,i)),u.push(r),s=a+1);return u.push(t.slice(s,a)),u.join("")}}function M(t,n){return function(e){var r,i,o=lr(1900,void 0,1);if(C(o,t,e+="",0)!=e.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(!n||"Z"in o||(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=(r=sr(lr(o.y,0,1))).getUTCDay())>4||0===i?Qe.ceil(r):Qe(r),r=ir.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(r=(i=(r=ar(lr(o.y,0,1))).getDay())>4||0===i?ze.ceil(r):ze(r),r=Ze.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?sr(lr(o.y,0,1)).getUTCDay():ar(lr(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,sr(o)):ar(o)}}function C(t,n,e,r){for(var i,o,u=0,a=n.length,s=e.length;u<a;){if(r>=s)return-1;if(37===(i=n.charCodeAt(u++))){if(i=n.charAt(u++),!(o=x[i in fr?n.charAt(u++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return _.x=b(e,_),_.X=b(r,_),_.c=b(n,_),w.x=b(e,w),w.X=b(r,w),w.c=b(n,w),{format:function(t){var n=b(t+="",_);return n.toString=function(){return t},n},parse:function(t){var n=M(t+="",!1);return n.toString=function(){return t},n},utcFormat:function(t){var n=b(t+="",w);return n.toString=function(){return t},n},utcParse:function(t){var n=M(t+="",!0);return n.toString=function(){return t},n}}}({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"]})).format,cr.parse,cr.utcFormat,cr.utcParse,((Ee((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCMonth(t.getUTCMonth()+n)}),(function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})).range,Ee((function(t){t.setUTCMinutes(0,0,0)}),(function(t,n){t.setTime(+t+36e5*n)}),(function(t,n){return(n-t)/36e5}),(function(t){return t.getUTCHours()}))).range,Ee((function(t){t.setUTCSeconds(0,0)}),(function(t,n){t.setTime(+t+n*Re)}),(function(t,n){return(n-t)/Re}),(function(t){return t.getUTCMinutes()}))).range;var Ai=function(t){for(var n=t.length/6|0,e=new Array(n),r=0;r<n;)e[r]="#"+t.slice(6*r,6*++r);return e}("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");function Ui(){this._=null}function Li(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Di(t,n){var e=n,r=n.R,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function Si(t,n){var e=n,r=n.L,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function Ei(t){for(;t.L;)t=t.L;return t}Ui.prototype={constructor:Ui,insert:function(t,n){var e,r,i;if(t){if(n.P=t,n.N=t.N,t.N&&(t.N.P=n),t.N=n,t.R){for(t=t.R;t.L;)t=t.L;t.L=n}else t.R=n;e=t}else this._?(t=Ei(this._),n.P=null,n.N=t,t.P=t.L=n,e=t):(n.P=n.N=null,this._=n,e=null);for(n.L=n.R=null,n.U=e,n.C=!0,t=n;e&&e.C;)e===(r=e.U).L?(i=r.R)&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.R&&(Di(this,e),e=(t=e).U),e.C=!1,r.C=!0,Si(this,r)):(i=r.L)&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.L&&(Si(this,e),e=(t=e).U),e.C=!1,r.C=!0,Di(this,r)),e=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var n,e,r,i=t.U,o=t.L,u=t.R;if(e=o?u?Ei(u):o:u,i?i.L===t?i.L=e:i.R=e:this._=e,o&&u?(r=e.C,e.C=t.C,e.L=o,o.U=e,e!==u?(i=e.U,e.U=t.U,t=e.R,i.L=t,e.R=u,u.U=e):(e.U=i,i=e,t=e.R)):(r=t.C,t=e),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((n=i.R).C&&(n.C=!1,i.C=!0,Di(this,i),n=i.R),n.L&&n.L.C||n.R&&n.R.C){n.R&&n.R.C||(n.L.C=!1,n.C=!0,Si(this,n),n=i.R),n.C=i.C,i.C=n.R.C=!1,Di(this,i),t=this._;break}}else if((n=i.L).C&&(n.C=!1,i.C=!0,Si(this,i),n=i.L),n.L&&n.L.C||n.R&&n.R.C){n.L&&n.L.C||(n.R.C=!1,n.C=!0,Di(this,n),n=i.L),n.C=i.C,i.C=n.L.C=!1,Si(this,i),t=this._;break}n.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var Pi=Ui;function Yi(t,n,e,r){var i=[null,null],o=ro.push(i)-1;return i.left=t,i.right=n,e&&Fi(i,t,n,e),r&&Fi(i,n,t,r),no[t.index].halfedges.push(o),no[n.index].halfedges.push(o),i}function Ri(t,n,e){var r=[n,e];return r.left=t,r}function Fi(t,n,e,r){t[0]||t[1]?t.left===e?t[1]=r:t[0]=r:(t[0]=r,t.left=n,t.right=e)}function qi(t,n,e,r,i){var o,u=t[0],a=t[1],s=u[0],l=u[1],c=0,f=1,h=a[0]-s,g=a[1]-l;if(o=n-s,h||!(o>0)){if(o/=h,h<0){if(o<c)return;o<f&&(f=o)}else if(h>0){if(o>f)return;o>c&&(c=o)}if(o=r-s,h||!(o<0)){if(o/=h,h<0){if(o>f)return;o>c&&(c=o)}else if(h>0){if(o<c)return;o<f&&(f=o)}if(o=e-l,g||!(o>0)){if(o/=g,g<0){if(o<c)return;o<f&&(f=o)}else if(g>0){if(o>f)return;o>c&&(c=o)}if(o=i-l,g||!(o<0)){if(o/=g,g<0){if(o>f)return;o>c&&(c=o)}else if(g>0){if(o<c)return;o<f&&(f=o)}return!(c>0||f<1)||(c>0&&(t[0]=[s+c*h,l+c*g]),f<1&&(t[1]=[s+f*h,l+f*g]),!0)}}}}}function Hi(t,n,e,r,i){var o=t[1];if(o)return!0;var u,a,s=t[0],l=t.left,c=t.right,f=l[0],h=l[1],g=c[0],p=c[1],d=(f+g)/2,v=(h+p)/2;if(p===h){if(d<n||d>=r)return;if(f>g){if(s){if(s[1]>=i)return}else s=[d,e];o=[d,i]}else{if(s){if(s[1]<e)return}else s=[d,i];o=[d,e]}}else if(a=v-(u=(f-g)/(p-h))*d,u<-1||u>1)if(f>g){if(s){if(s[1]>=i)return}else s=[(e-a)/u,e];o=[(i-a)/u,i]}else{if(s){if(s[1]<e)return}else s=[(i-a)/u,i];o=[(e-a)/u,e]}else if(h<p){if(s){if(s[0]>=r)return}else s=[n,u*n+a];o=[r,u*r+a]}else{if(s){if(s[0]<n)return}else s=[r,u*r+a];o=[n,u*n+a]}return t[0]=s,t[1]=o,!0}function zi(t,n){var e=t.site,r=n.left,i=n.right;return e===i&&(i=r,r=e),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(e===r?(r=n[1],i=n[0]):(r=n[0],i=n[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function ji(t,n){return n[+(n.left!==t.site)]}function Oi(t,n){return n[+(n.left===t.site)]}var Xi,$i=[];function Ii(t){var n=t.P,e=t.N;if(n&&e){var r=n.site,i=t.site,o=e.site;if(r!==o){var u=i[0],a=i[1],s=r[0]-u,l=r[1]-a,c=o[0]-u,f=o[1]-a,h=2*(s*f-l*c);if(!(h>=-oo)){var g=s*s+l*l,p=c*c+f*f,d=(f*g-l*p)/h,v=(s*p-c*g)/h,y=$i.pop()||new function(){Li(this),this.x=this.y=this.arc=this.site=this.cy=null};y.arc=t,y.site=i,y.x=d+u,y.y=(y.cy=v+a)+Math.sqrt(d*d+v*v),t.circle=y;for(var m=null,_=eo._;_;)if(y.y<_.y||y.y===_.y&&y.x<=_.x){if(!_.L){m=_.P;break}_=_.L}else{if(!_.R){m=_;break}_=_.R}eo.insert(m,y),m||(Xi=y)}}}}function Vi(t){var n=t.circle;n&&(n.P||(Xi=n.N),eo.remove(n),$i.push(n),Li(n),t.circle=null)}var Zi=[];function Bi(t){var n=Zi.pop()||new function(){Li(this),this.edge=this.site=this.circle=null};return n.site=t,n}function Wi(t){Vi(t),to.remove(t),Zi.push(t),Li(t)}function Gi(t){var n=t.circle,e=n.x,r=n.cy,i=[e,r],o=t.P,u=t.N,a=[t];Wi(t);for(var s=o;s.circle&&Math.abs(e-s.circle.x)<io&&Math.abs(r-s.circle.cy)<io;)o=s.P,a.unshift(s),Wi(s),s=o;a.unshift(s),Vi(s);for(var l=u;l.circle&&Math.abs(e-l.circle.x)<io&&Math.abs(r-l.circle.cy)<io;)u=l.N,a.push(l),Wi(l),l=u;a.push(l),Vi(l);var c,f=a.length;for(c=1;c<f;++c)l=a[c],s=a[c-1],Fi(l.edge,s.site,l.site,i);s=a[0],(l=a[f-1]).edge=Yi(s.site,l.site,null,i),Ii(s),Ii(l)}function Qi(t){for(var n,e,r,i,o=t[0],u=t[1],a=to._;a;)if((r=Ji(a,u)-o)>io)a=a.L;else{if(!((i=o-Ki(a,u))>io)){r>-io?(n=a.P,e=a):i>-io?(n=a,e=a.N):n=e=a;break}if(!a.R){n=a;break}a=a.R}!function(t){no[t.index]={site:t,halfedges:[]}}(t);var s=Bi(t);if(to.insert(n,s),n||e){if(n===e)return Vi(n),e=Bi(n.site),to.insert(s,e),s.edge=e.edge=Yi(n.site,s.site),Ii(n),void Ii(e);if(e){Vi(n),Vi(e);var l=n.site,c=l[0],f=l[1],h=t[0]-c,g=t[1]-f,p=e.site,d=p[0]-c,v=p[1]-f,y=2*(h*v-g*d),m=h*h+g*g,_=d*d+v*v,w=[(v*m-g*_)/y+c,(h*_-d*m)/y+f];Fi(e.edge,l,p,w),s.edge=Yi(l,t,null,w),e.edge=Yi(t,p,null,w),Ii(n),Ii(e)}else s.edge=Yi(n.site,s.site)}}function Ji(t,n){var e=t.site,r=e[0],i=e[1],o=i-n;if(!o)return r;var u=t.P;if(!u)return-1/0;var a=(e=u.site)[0],s=e[1],l=s-n;if(!l)return a;var c=a-r,f=1/o-1/l,h=c/l;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*l)-s+l/2+i-o/2)))/f+r:(r+a)/2}function Ki(t,n){var e=t.N;if(e)return Ji(e,n);var r=t.site;return r[1]===n?r[0]:1/0}var to,no,eo,ro,io=1e-6,oo=1e-12;function uo(t,n,e){return(t[0]-e[0])*(n[1]-t[1])-(t[0]-n[0])*(e[1]-t[1])}function ao(t,n){return n[1]-t[1]||n[0]-t[0]}function so(t,n){var e,r,i,o=t.sort(ao).pop();for(ro=[],no=new Array(t.length),to=new Pi,eo=new Pi;;)if(i=Xi,o&&(!i||o[1]<i.y||o[1]===i.y&&o[0]<i.x))o[0]===e&&o[1]===r||(Qi(o),e=o[0],r=o[1]),o=t.pop();else{if(!i)break;Gi(i.arc)}if(function(){for(var t,n,e,r,i=0,o=no.length;i<o;++i)if((t=no[i])&&(r=(n=t.halfedges).length)){var u=new Array(r),a=new Array(r);for(e=0;e<r;++e)u[e]=e,a[e]=zi(t,ro[n[e]]);for(u.sort((function(t,n){return a[n]-a[t]})),e=0;e<r;++e)a[e]=n[u[e]];for(e=0;e<r;++e)n[e]=a[e]}}(),n){var u=+n[0][0],a=+n[0][1],s=+n[1][0],l=+n[1][1];!function(t,n,e,r){for(var i,o=ro.length;o--;)Hi(i=ro[o],t,n,e,r)&&qi(i,t,n,e,r)&&(Math.abs(i[0][0]-i[1][0])>io||Math.abs(i[0][1]-i[1][1])>io)||delete ro[o]}(u,a,s,l),function(t,n,e,r){var i,o,u,a,s,l,c,f,h,g,p,d,v=no.length,y=!0;for(i=0;i<v;++i)if(o=no[i]){for(u=o.site,a=(s=o.halfedges).length;a--;)ro[s[a]]||s.splice(a,1);for(a=0,l=s.length;a<l;)p=(g=Oi(o,ro[s[a]]))[0],d=g[1],f=(c=ji(o,ro[s[++a%l]]))[0],h=c[1],(Math.abs(p-f)>io||Math.abs(d-h)>io)&&(s.splice(a,0,ro.push(Ri(u,g,Math.abs(p-t)<io&&r-d>io?[t,Math.abs(f-t)<io?h:r]:Math.abs(d-r)<io&&e-p>io?[Math.abs(h-r)<io?f:e,r]:Math.abs(p-e)<io&&d-n>io?[e,Math.abs(f-e)<io?h:n]:Math.abs(d-n)<io&&p-t>io?[Math.abs(h-n)<io?f:t,n]:null))-1),++l);l&&(y=!1)}if(y){var m,_,w,x=1/0;for(i=0,y=null;i<v;++i)(o=no[i])&&(w=(m=(u=o.site)[0]-t)*m+(_=u[1]-n)*_)<x&&(x=w,y=o);if(y){var b=[t,n],M=[t,r],C=[e,r],T=[e,n];y.halfedges.push(ro.push(Ri(u=y.site,b,M))-1,ro.push(Ri(u,M,C))-1,ro.push(Ri(u,C,T))-1,ro.push(Ri(u,T,b))-1)}}for(i=0;i<v;++i)(o=no[i])&&(o.halfedges.length||delete no[i])}(u,a,s,l)}this.edges=ro,this.cells=no,to=eo=ro=no=null}function lo(t,n,e){this.k=t,this.x=n,this.y=e}so.prototype={constructor:so,polygons:function(){var t=this.edges;return this.cells.map((function(n){var e=n.halfedges.map((function(e){return ji(n,t[e])}));return e.data=n.site.data,e}))},triangles:function(){var t=[],n=this.edges;return this.cells.forEach((function(e,r){if(o=(i=e.halfedges).length)for(var i,o,u,a=e.site,s=-1,l=n[i[o-1]],c=l.left===a?l.right:l.left;++s<o;)u=c,c=(l=n[i[s]]).left===a?l.right:l.left,u&&c&&r<u.index&&r<c.index&&uo(a,u,c)<0&&t.push([a.data,u.data,c.data])})),t},links:function(){return this.edges.filter((function(t){return t.right})).map((function(t){return{source:t.left.data,target:t.right.data}}))},find:function(t,n,e){for(var r,i,o=this,u=o._found||0,a=o.cells.length;!(i=o.cells[u]);)if(++u>=a)return null;var s=t-i.site[0],l=n-i.site[1],c=s*s+l*l;do{i=o.cells[r=u],u=null,i.halfedges.forEach((function(e){var r=o.edges[e],a=r.left;if(a!==i.site&&a||(a=r.right)){var s=t-a[0],l=n-a[1],f=s*s+l*l;f<c&&(c=f,u=a.index)}}))}while(null!==u);return o._found=r,null==e||c<=e*e?i.site:null}},Math.SQRT2,lo.prototype={constructor:lo,scale:function(t){return 1===t?this:new lo(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new lo(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+")"}},new lo(1,0,0),lo.prototype;var co={id:"force-directed",label:"Force Directed Graph",options:{color_range:{type:"array",label:"Color Range",display:"colors",default:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"]},link_color:{type:"string",label:"Link Color",default:["black"]},font_size:{type:"string",label:"Font Size",default:["10px"]},font_color:{type:"string",label:"Font Color",default:["black"]},font_weight:{type:"string",label:"Font Weight",default:["normal"]},circle_radius:{type:"string",label:"Circle Radius",default:5},linkDistance:{type:"string",label:"Link Distance",default:30},labels:{type:"boolean",label:"Show Labels",default:!1},labelTypes:{type:"string",label:"Label Node Types",default:[]}},create:function(t,n){t.style.fontFamily='"Open Sans", "Helvetica", sans-serif',this.svg=K(t).append("svg")},update:function(t,n,e,r,i){if(function(t,n,e){var r=function(n,e,r,i,o){return!(!t.addError||!t.clearErrors||(r<i?(t.addError({title:"Not Enough "+e+"s",message:"This visualization requires "+(i===o?"exactly":"at least")+" "+i+" "+e.toLowerCase()+(1===i?"":"s")+".",group:n}),1):r>o?(t.addError({title:"Too Many "+e+"s",message:"This visualization requires "+(i===o?"exactly":"no more than")+" "+o+" "+e.toLowerCase()+(1===i?"":"s")+".",group:n}),1):(t.clearErrors(n),0)))},i=n.fields,o=i.pivots,u=i.dimensions,a=i.measure_like;return r("pivot-req","Pivot",o.length,e.min_pivots,e.max_pivots)&&r("dim-req","Dimension",u.length,e.min_dimensions,e.max_dimensions)&&r("mes-req","Measure",a.length,e.min_measures,e.max_measures)}(this,r,{min_pivots:0,max_pivots:0,min_dimensions:4,max_dimensions:4,min_measures:1,max_measures:1})&&e.color_range){this.svg.selectAll("*").remove();var o=n.clientHeight+20,u=n.clientWidth,a=5;e.circle_radius&&(a=e.circle_radius);var s=30;e.linkDistance&&(s=e.linkDistance);var l=r.fields.dimension_like,c=r.fields.measure_like[0],h=(me(",d"),function t(){var n=On(),e=[],r=[],i=Le;function o(t){var o=t+"",u=n.get(o);if(!u){if(i!==Le)return i;n.set(o,u=e.push(t))}return r[(u-1)%r.length]}return o.domain=function(t){if(!arguments.length)return e.slice();e=[],n=On();for(var r,i,u=-1,a=t.length;++u<a;)n.has(i=(r=t[u])+"")||n.set(i,e.push(r));return o},o.range=function(t){return arguments.length?(r=Ue.call(t),o):r.slice()},o.unknown=function(t){return arguments.length?(i=t,o):i},o.copy=function(){return t(e,r).unknown(i)},ke.apply(o,arguments),o}()),g=h.range(Ai);null!=e.color_range&&(g=h.range(e.color_range));var p=[],d=[],v=[];t.forEach((function(t){if(-1==p.indexOf(t[l[0].name].value)){p.push(t[l[0].name].value);var n={id:t[l[0].name].value,group:t[l[1].name].value};d.push(n)}-1==p.indexOf(t[l[2].name].value)&&(p.push(t[l[2].name].value),n={id:t[l[2].name].value,group:t[l[3].name].value},d.push(n));var e={source:t[l[0].name].value,target:t[l[2].name].value,value:t[c.name].value};v.push(e)}));var y=function(){var t,n,e,r,i=Qn(-30),o=1,u=1/0,a=.81;function s(r){var i,o=t.length,u=re(t,le,ce).visitAfter(c);for(e=r,i=0;i<o;++i)n=t[i],u.visit(f)}function l(){if(t){var n,e,o=t.length;for(r=new Array(o),n=0;n<o;++n)e=t[n],r[e.index]=+i(e,n,t)}}function c(t){var n,e,i,o,u,a=0,s=0;if(t.length){for(i=o=u=0;u<4;++u)(n=t[u])&&(e=Math.abs(n.value))&&(a+=n.value,s+=e,i+=e*n.x,o+=e*n.y);t.x=i/s,t.y=o/s}else{(n=t).x=n.data.x,n.y=n.data.y;do{a+=r[n.data.index]}while(n=n.next)}t.value=a}function f(t,i,s,l){if(!t.value)return!0;var c=t.x-n.x,f=t.y-n.y,h=l-i,g=c*c+f*f;if(h*h/a<g)return g<u&&(0===c&&(g+=(c=Jn())*c),0===f&&(g+=(f=Jn())*f),g<o&&(g=Math.sqrt(o*g)),n.vx+=c*t.value*e/g,n.vy+=f*t.value*e/g),!0;if(!(t.length||g>=u)){(t.data!==n||t.next)&&(0===c&&(g+=(c=Jn())*c),0===f&&(g+=(f=Jn())*f),g<o&&(g=Math.sqrt(o*g)));do{t.data!==n&&(h=r[t.data.index]*e/g,n.vx+=c*h,n.vy+=f*h)}while(t=t.next)}}return s.initialize=function(n){t=n,l()},s.strength=function(t){return arguments.length?(i="function"==typeof t?t:Qn(+t),l(),s):i},s.distanceMin=function(t){return arguments.length?(o=t*t,s):Math.sqrt(o)},s.distanceMax=function(t){return arguments.length?(u=t*t,s):Math.sqrt(u)},s.theta=function(t){return arguments.length?(a=t*t,s):Math.sqrt(a)},s}(),m=function(t){var n,e=1,r=.001,i=1-Math.pow(r,1/300),o=0,u=.6,a=On(),s=rn(c),l=f("tick","end");function c(){h(),l.call("tick",n),e<r&&(s.stop(),l.call("end",n))}function h(r){var s,l,c=t.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(e+=(o-e)*i,a.each((function(t){t(e)})),s=0;s<c;++s)null==(l=t[s]).fx?l.x+=l.vx*=u:(l.x=l.fx,l.vx=0),null==l.fy?l.y+=l.vy*=u:(l.y=l.fy,l.vy=0);return n}function g(){for(var n,e=0,r=t.length;e<r;++e){if((n=t[e]).index=e,null!=n.fx&&(n.x=n.fx),null!=n.fy&&(n.y=n.fy),isNaN(n.x)||isNaN(n.y)){var i=10*Math.sqrt(e),o=e*fe;n.x=i*Math.cos(o),n.y=i*Math.sin(o)}(isNaN(n.vx)||isNaN(n.vy))&&(n.vx=n.vy=0)}}function p(n){return n.initialize&&n.initialize(t),n}return null==t&&(t=[]),g(),n={tick:h,restart:function(){return s.restart(c),n},stop:function(){return s.stop(),n},nodes:function(e){return arguments.length?(t=e,g(),a.each(p),n):t},alpha:function(t){return arguments.length?(e=+t,n):e},alphaMin:function(t){return arguments.length?(r=+t,n):r},alphaDecay:function(t){return arguments.length?(i=+t,n):+i},alphaTarget:function(t){return arguments.length?(o=+t,n):o},velocityDecay:function(t){return arguments.length?(u=1-t,n):1-u},force:function(t,e){return arguments.length>1?(null==e?a.remove(t):a.set(t,p(e)),n):a.get(t)},find:function(n,e,r){var i,o,u,a,s,l=0,c=t.length;for(null==r?r=1/0:r*=r,l=0;l<c;++l)(u=(i=n-(a=t[l]).x)*i+(o=e-a.y)*o)<r&&(s=a,r=u);return s},on:function(t,e){return arguments.length>1?(l.on(t,e),n):l.on(t)}}}(d).force("link",function(t){var n,e,r,i,o,u=ae,a=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},s=Qn(30),l=1;function c(r){for(var i=0,u=t.length;i<l;++i)for(var a,s,c,f,h,g,p,d=0;d<u;++d)s=(a=t[d]).source,f=(c=a.target).x+c.vx-s.x-s.vx||Jn(),h=c.y+c.vy-s.y-s.vy||Jn(),f*=g=((g=Math.sqrt(f*f+h*h))-e[d])/g*r*n[d],h*=g,c.vx-=f*(p=o[d]),c.vy-=h*p,s.vx+=f*(p=1-p),s.vy+=h*p}function f(){if(r){var a,s,l=r.length,c=t.length,f=On(r,u);for(a=0,i=new Array(l);a<c;++a)(s=t[a]).index=a,"object"!=typeof s.source&&(s.source=se(f,s.source)),"object"!=typeof s.target&&(s.target=se(f,s.target)),i[s.source.index]=(i[s.source.index]||0)+1,i[s.target.index]=(i[s.target.index]||0)+1;for(a=0,o=new Array(c);a<c;++a)s=t[a],o[a]=i[s.source.index]/(i[s.source.index]+i[s.target.index]);n=new Array(c),h(),e=new Array(c),g()}}function h(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+a(t[e],e,t)}function g(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+s(t[n],n,t)}return null==t&&(t=[]),c.initialize=function(t){r=t,f()},c.links=function(n){return arguments.length?(t=n,f(),c):t},c.id=function(t){return arguments.length?(u=t,c):u},c.iterations=function(t){return arguments.length?(l=+t,c):l},c.strength=function(t){return arguments.length?(a="function"==typeof t?t:Qn(+t),h(),c):a},c.distance=function(t){return arguments.length?(s="function"==typeof t?t:Qn(+t),g(),c):s},c}(v).distance(s).id((function(t){return t.id}))).force("charge",y).force("center",function(t,n){var e;function r(){var r,i,o=e.length,u=0,a=0;for(r=0;r<o;++r)u+=(i=e[r]).x,a+=i.y;for(u=u/o-t,a=a/o-n,r=0;r<o;++r)(i=e[r]).x-=u,i.y-=a}return null==t&&(t=0),null==n&&(n=0),r.initialize=function(t){e=t},r.x=function(n){return arguments.length?(t=+n,r):t},r.y=function(t){return arguments.length?(n=+t,r):n},r}(u/2,o/2)),_=this.svg.attr("width","100%").attr("height",o),w=_.append("g").attr("stroke",e.link_color).attr("stroke-opacity",.6).selectAll("line").data(v).enter().append("line").attr("stroke-width",(function(t){return Math.sqrt(t.value)})),x=_.append("g").attr("class","nodes").selectAll(".node").data(d).enter().append("g").attr("class","node").call(function(t){return function(){var t,n,e,r,i=Zn,o=Bn,u=Wn,a=Gn,s={},l=f("start","drag","end"),c=0,h=0;function g(t){t.on("mousedown.drag",p).filter(a).on("touchstart.drag",y).on("touchmove.drag",m).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(){if(!r&&i.apply(this,arguments)){var u=w("mouse",o.apply(this,arguments),It,this,arguments);u&&(K(O.view).on("mousemove.drag",d,!0).on("mouseup.drag",v,!0),et(O.view),tt(),e=!1,t=O.clientX,n=O.clientY,u("start"))}}function d(){if(nt(),!e){var r=O.clientX-t,i=O.clientY-n;e=r*r+i*i>h}s.mouse("drag")}function v(){K(O.view).on("mousemove.drag mouseup.drag",null),function(t,n){var e=t.document.documentElement,r=K(t).on("dragstart.drag",null);n&&(r.on("click.drag",nt,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}(O.view,e),nt(),s.mouse("end")}function y(){if(i.apply(this,arguments)){var t,n,e=O.changedTouches,r=o.apply(this,arguments),u=e.length;for(t=0;t<u;++t)(n=w(e[t].identifier,r,$t,this,arguments))&&(tt(),n("start"))}}function m(){var t,n,e=O.changedTouches,r=e.length;for(t=0;t<r;++t)(n=s[e[t].identifier])&&(nt(),n("drag"))}function _(){var t,n,e=O.changedTouches,i=e.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),t=0;t<i;++t)(n=s[e[t].identifier])&&(tt(),n("end"))}function w(t,n,e,r,i){var o,a,f,h=e(n,t),p=l.copy();if(Z(new Vn(g,"beforestart",o,t,c,h[0],h[1],0,0,p),(function(){return null!=(O.subject=o=u.apply(r,i))&&(a=o.x-h[0]||0,f=o.y-h[1]||0,!0)})))return function u(l){var d,v=h;switch(l){case"start":s[t]=u,d=c++;break;case"end":delete s[t],--c;case"drag":h=e(n,t),d=c}Z(new Vn(g,l,o,t,d,h[0]+a,h[1]+f,h[0]-v[0],h[1]-v[1],p),p.apply,p,[l,r,i])}}return g.filter=function(t){return arguments.length?(i="function"==typeof t?t:In(!!t),g):i},g.container=function(t){return arguments.length?(o="function"==typeof t?t:In(t),g):o},g.subject=function(t){return arguments.length?(u="function"==typeof t?t:In(t),g):u},g.touchable=function(t){return arguments.length?(a="function"==typeof t?t:In(!!t),g):a},g.on=function(){var t=l.on.apply(l,arguments);return t===l?g:t},g.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,g):Math.sqrt(h)},g}().on("start",(function(n){O.active||t.alphaTarget(.3).restart(),n.fx=n.x,n.fy=n.y})).on("drag",(function(t){t.fx=O.x,t.fy=O.y})).on("end",(function(n){O.active||t.alphaTarget(0),n.fx=null,n.fy=null}))}(m)),b=(x.append("circle").attr("stroke","#fff").attr("stroke-width",1.5).attr("r",a).attr("fill",(function(t){return g(t.group)})),[]);e.labelTypes&&e.labelTypes.length&&(b=e.labelTypes.split(",")),e.labelTypes&&e.labelTypes.length?(x.append("text").style("font-size",e.font_size).style("fill",e.font_color).attr("y",-1*e.circle_radius-3+"px").style("text-anchor","middle").style("font-weight",e.font_weight).text((function(t){return b.indexOf(t.group)>-1?t.id:null})),x.append("title").text((function(t){return-1==b.indexOf(t.group)?t.id:null}))):e.labels?x.append("text").style("font-size",e.font_size).style("fill",e.font_color).attr("y",-1*e.circle_radius-3+"px").style("text-anchor","middle").style("font-weight",e.font_weight).text((function(t){return t.id})):x.append("title").text((function(t){return t.id})),m.on("tick",(function(){w.attr("x1",(function(t){return isNaN(t.source.x)?0:t.source.x})).attr("y1",(function(t){return isNaN(t.source.y)?0:t.source.y})).attr("x2",(function(t){return isNaN(t.target.x)?0:t.target.x})).attr("y2",(function(t){return isNaN(t.target.y)?0:t.target.y})),x.attr("cx",(function(t){return t.x=Math.max(a,Math.min(u-a,t.x))})).attr("cy",(function(t){return t.y=Math.max(a,Math.min(o-a,t.y))})).attr("transform",(function(t){return isNaN(t.x)?"":"translate("+t.x+","+t.y+")"}))}))}}};looker.plugins.visualizations.add(co)}})}));