Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

d3plus-text

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3plus-text - npm Package Compare versions

Comparing version 0.4.4 to 0.4.5

2

.rollup.full.js

@@ -12,3 +12,3 @@ import buble from "rollup-plugin-buble";

moduleName: "d3plus_text",
plugins: [json(), deps({"jsnext": true}), buble()]
plugins: [json(), deps({"jsnext": true}), buble({exclude: "node_modules/d3-*/**"})]
};

@@ -1,2 +0,2 @@

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define("d3plus-text",["exports"],n):n(t.d3plus_text=t.d3plus_text||{})}(this,function(t){"use strict";function n(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),er.hasOwnProperty(n)?{space:er[n],local:t}:t}function e(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===nr&&n.documentElement.namespaceURI===nr?n.createElement(t):n.createElementNS(e,t)}}function r(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function i(t){var i=n(t);return(i.local?r:e)(i)}function o(t,n,e){return t=u(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function u(t,n,e){return function(r){var i=sr;sr=r;try{t.call(this,this.__data__,n,e)}finally{sr=i}}}function a(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}})}function s(t){return function(){var n=this,e=this.__on;if(e){for(var r,i=0,o=-1,u=e.length;u>i;++i)r=e[i],t.type&&r.type!==t.type||r.name!==t.name?e[++o]=r:n.removeEventListener(r.type,r.listener,r.capture);++o?e.length=o:delete this.__on}}}function l(t,n,e){var r=ar.hasOwnProperty(t.type)?o:u;return function(i,o,u){var a,s=this,l=this.__on,c=r(n,o,u);if(l)for(var f=0,h=l.length;h>f;++f)if((a=l[f]).type===t.type&&a.name===t.name)return s.removeEventListener(a.type,a.listener,a.capture),s.addEventListener(a.type,a.listener=c,a.capture=e),void(a.value=n);this.addEventListener(t.type,c,e),a={type:t.type,name:t.name,value:n,listener:c,capture:e},l?l.push(a):this.__on=[a]}}function c(t,n,e){var r,i,o=this,u=a(t+""),c=u.length;if(!(arguments.length<2)){for(f=n?l:s,null==e&&(e=!1),r=0;c>r;++r)o.each(f(u[r],n,e));return this}var f=this.node().__on;if(f)for(var h,p=0,d=f.length;d>p;++p)for(r=0,h=f[p];c>r;++r)if((i=u[r]).type===h.type&&i.name===h.name)return h.value}function f(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function h(t){return function(){return this.querySelector(t)}}function p(t){var n=this;"function"!=typeof t&&(t=h(t));for(var e=n._groups,r=e.length,i=new Array(r),o=0;r>o;++o)for(var u,a,s=e[o],l=s.length,c=i[o]=new Array(l),f=0;l>f;++f)(u=s[f])&&(a=t.call(u,u.__data__,f,s))&&("__data__"in u&&(a.__data__=u.__data__),c[f]=a);return new Et(i,this._parents)}function d(t){return function(){return this.querySelectorAll(t)}}function g(t){var n=this;"function"!=typeof t&&(t=d(t));for(var e=n._groups,r=e.length,i=[],o=[],u=0;r>u;++u)for(var a,s=e[u],l=s.length,c=0;l>c;++c)(a=s[c])&&(i.push(t.call(a,a.__data__,c,s)),o.push(a));return new Et(i,o)}function y(t){var n=this;"function"!=typeof t&&(t=ur(t));for(var e=n._groups,r=e.length,i=new Array(r),o=0;r>o;++o)for(var u,a=e[o],s=a.length,l=i[o]=new Array(s),c=0;s>c;++c)(u=a[c])&&t.call(u,u.__data__,c,a)&&(l[c]=u);return new Et(i,this._parents)}function v(t){return function(){return t}}function m(t,n,e,r,i,o){for(var u,a=0,s=n.length,l=o.length;l>a;++a)(u=n[a])?(u.__data__=o[a],r[a]=u):e[a]=new b(t,o[a]);for(;s>a;++a)(u=n[a])&&(i[a]=u)}function _(t,n,e,r,i,o,u){var a,s,l,c={},f=n.length,h=o.length,p=new Array(f);for(a=0;f>a;++a)(s=n[a])&&(p[a]=l=cr+u.call(s,s.__data__,a,n),c[l]||(c[l]=s));for(a=0;h>a;++a)l=cr+u.call(t,o[a],a,o),(s=c[l])?s!==!0&&(r[a]=s,s.__data__=o[a]):e[a]=new b(t,o[a]),c[l]=!0;for(a=0;f>a;++a)(s=n[a])&&c[p[a]]!==!0&&(i[a]=s)}function w(t,n){if(!t)return p=new Array(this.size()),l=-1,this.each(function(t){p[++l]=t}),p;var e=n?_:m,r=this._parents,i=this._groups;"function"!=typeof t&&(t=v(t));for(var o=i.length,u=new Array(o),a=new Array(o),s=new Array(o),l=0;o>l;++l){var c=r[l],f=i[l],h=f.length,p=t.call(c,c&&c.__data__,l,r),d=p.length,g=a[l]=new Array(d),y=u[l]=new Array(d),w=s[l]=new Array(h);e(c,f,g,y,w,p,n);for(var b,x,M=0,N=0;d>M;++M)if(b=g[M]){for(M>=N&&(N=M+1);!(x=y[N])&&++N<d;);b._next=x||null}}return u=new Et(u,r),u._enter=a,u._exit=s,u}function b(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function x(t){return new Array(t.length)}function M(){return new Et(this._enter||this._groups.map(x),this._parents)}function N(){return new Et(this._exit||this._groups.map(x),this._parents)}function A(t){for(var n=this,e=n._groups,r=t._groups,i=e.length,o=r.length,u=Math.min(i,o),a=new Array(i),s=0;u>s;++s)for(var l,c=e[s],f=r[s],h=c.length,p=a[s]=new Array(h),d=0;h>d;++d)(l=c[d]||f[d])&&(p[d]=l);for(;i>s;++s)a[s]=e[s];return new Et(a,this._parents)}function k(){for(var t=this,n=t._groups,e=-1,r=n.length;++e<r;)for(var i,o=n[e],u=o.length-1,a=o[u];--u>=0;)(i=o[u])&&(a&&a!==i.nextSibling&&a.parentNode.insertBefore(i,a),a=i);return this}function S(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}var e=this;t||(t=E);for(var r=e._groups,i=r.length,o=new Array(i),u=0;i>u;++u){for(var a,s=r[u],l=s.length,c=o[u]=new Array(l),f=0;l>f;++f)(a=s[f])&&(c[f]=a);c.sort(n)}return new Et(o,this._parents).order()}function E(t,n){return n>t?-1:t>n?1:t>=n?0:NaN}function P(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function C(){var t=new Array(this.size()),n=-1;return this.each(function(){t[++n]=this}),t}function q(){for(var t=this,n=t._groups,e=0,r=n.length;r>e;++e)for(var i=n[e],o=0,u=i.length;u>o;++o){var a=i[o];if(a)return a}return null}function z(){var t=0;return this.each(function(){++t}),t}function T(){return!this.node()}function I(t){for(var n=this,e=n._groups,r=0,i=e.length;i>r;++r)for(var o,u=e[r],a=0,s=u.length;s>a;++a)(o=u[a])&&t.call(o,o.__data__,a,u);return this}function O(t){return function(){this.removeAttribute(t)}}function X(t){return function(){this.removeAttributeNS(t.space,t.local)}}function V(t,n){return function(){this.setAttribute(t,n)}}function j(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function L(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function D(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 H(t,e){var r=n(t);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((null==e?r.local?X:O:"function"==typeof e?r.local?D:L:r.local?j:V)(r,e))}function R(t){return function(){this.style.removeProperty(t)}}function $(t,n,e){return function(){this.style.setProperty(t,n,e)}}function Y(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function F(t,n,e){var r;return arguments.length>1?this.each((null==n?R:"function"==typeof n?Y:$)(t,n,null==e?"":e)):f(r=this.node()).getComputedStyle(r,null).getPropertyValue(t)}function B(t){return function(){delete this[t]}}function U(t,n){return function(){this[t]=n}}function W(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function J(t,n){return arguments.length>1?this.each((null==n?B:"function"==typeof n?W:U)(t,n)):this.node()[t]}function K(t){return t.trim().split(/^|\s+/)}function G(t){return t.classList||new Q(t)}function Q(t){this._node=t,this._names=K(t.getAttribute("class")||"")}function Z(t,n){for(var e=G(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function tt(t,n){for(var e=G(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function nt(t){return function(){Z(this,t)}}function et(t){return function(){tt(this,t)}}function rt(t,n){return function(){(n.apply(this,arguments)?Z:tt)(this,t)}}function it(t,n){var e=K(t+"");if(arguments.length<2){for(var r=G(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?rt:n?nt:et)(e,n))}function ot(){this.textContent=""}function ut(t){return function(){this.textContent=t}}function at(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function st(t){return arguments.length?this.each(null==t?ot:("function"==typeof t?at:ut)(t)):this.node().textContent}function lt(){this.innerHTML=""}function ct(t){return function(){this.innerHTML=t}}function ft(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function ht(t){return arguments.length?this.each(null==t?lt:("function"==typeof t?ft:ct)(t)):this.node().innerHTML}function pt(){this.parentNode.appendChild(this)}function dt(){return this.each(pt)}function gt(){this.parentNode.insertBefore(this,this.parentNode.firstChild)}function yt(){return this.each(gt)}function vt(t){return function(){return this.appendChild(t.apply(this,arguments))}}function mt(t,n){return function(){return this.insertBefore(t.apply(this,arguments),n.apply(this,arguments)||null)}}function _t(){return null}function wt(t,n){var e="function"==typeof t?t:i(t);return this.select(arguments.length<2?vt(e):mt(e,null==n?_t:"function"==typeof n?n:h(n)))}function bt(){var t=this.parentNode;t&&t.removeChild(this)}function xt(){return this.each(bt)}function Mt(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Nt(t,n,e){var r=f(t),i=r.CustomEvent;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)}function At(t,n){return function(){return Nt(this,t,n)}}function kt(t,n){return function(){return Nt(this,t,n.apply(this,arguments))}}function St(t,n){return this.each(("function"==typeof n?kt:At)(t,n))}function Et(t,n){this._groups=t,this._parents=n}function Pt(){return new Et([[document.documentElement]],fr)}function Ct(t){return"string"==typeof t?new Et([[document.querySelector(t)]],[document.documentElement]):new Et([[t]],fr)}function qt(){for(var t,n=arguments,e=0,r=n.length,i={};r>e;++e){if(!(t=n[e]+"")||t in i)throw new Error;i[t]=[]}return new zt(i)}function zt(t){this._=t}function Tt(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;return{type:t,name:e}})}function It(t,n){for(var e,r=0,i=t.length;i>r;++r)if((e=t[r]).name===n)return e.value}function Ot(t,n,e){for(var r=0,i=t.length;i>r;++r)if(t[r].name===n){t[r]=hr,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}function Xt(){return wr||(Mr(Vt),wr=xr.now()+br)}function Vt(){wr=0}function jt(){this._call=this._time=this._next=null}function Lt(t,n,e){var r=new jt;return r.restart(t,n,e),r}function Dt(){Xt(),++gr;for(var t,n=pr;n;)(t=wr-n._time)>=0&&n._call.call(null,t),n=n._next;--gr}function Ht(t){wr=(_r=t||xr.now())+br,gr=yr=0;try{Dt()}finally{gr=0,$t(),wr=0}}function Rt(){var t=xr.now(),n=t-_r;n>mr&&(br-=n,_r=t)}function $t(){for(var t,n=pr,e=1/0;n;)n._call?(e>n._time&&(e=n._time),n=(t=n)._next):n=t?t._next=n._next:pr=n._next;dr=t,Yt(e)}function Yt(t){if(!gr){yr&&(yr=clearTimeout(yr));var n=t-wr;n>24?(1/0>t&&(yr=setTimeout(Ht,n)),vr&&(vr=clearInterval(vr))):(vr||(vr=setInterval(Rt,mr)),gr=1,Mr(Ht))}}function Ft(t,n,e){var r=new jt;return n=null==n?0:+n,r.restart(function(e){r.stop(),t(e+n)},n,e),r}function Bt(t,n,e,r,i,o){var u=t.__transition;if(u){if(e in u)return}else t.__transition={};Kt(t,e,{name:n,index:r,group:i,on:Nr,tween:Ar,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:kr})}function Ut(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>kr)throw new Error("too late");return e}function Wt(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>Er)throw new Error("too late");return e}function Jt(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("too late");return e}function Kt(t,n,e){function r(t){e.state=Sr,e.delay<=t?i(t-e.delay):e.timer.restart(i,e.delay,e.time)}function i(r){var i,s,l,c;for(i in a)c=a[i],c.name===e.name&&(c.state===Pr?(c.state=qr,c.timer.stop(),c.on.call("interrupt",t,t.__data__,c.index,c.group),delete a[i]):n>+i&&(c.state=qr,c.timer.stop(),delete a[i]));if(Ft(function(){e.state===Pr&&(e.timer.restart(o,e.delay,e.time),o(r))}),e.state=Er,e.on.call("start",t,t.__data__,e.index,e.group),e.state===Er){for(e.state=Pr,u=new Array(l=e.tween.length),i=0,s=-1;l>i;++i)(c=e.tween[i].value.call(t,t.__data__,e.index,e.group))&&(u[++s]=c);u.length=s+1}}function o(r){for(var i=r<e.duration?e.ease.call(null,r/e.duration):(e.state=Cr,1),o=-1,s=u.length;++o<s;)u[o].call(null,i);if(e.state===Cr){e.state=qr,e.timer.stop(),e.on.call("end",t,t.__data__,e.index,e.group);for(o in a)if(+o!==n)return void delete a[n];delete t.__transition}}var u,a=t.__transition;a[n]=e,e.timer=Lt(r,0,e.time)}function Gt(t){return t=null==t?null:t+"",this.each(function(){var n,e,r,i=this.__transition,o=!0;if(i){for(r in i)(n=i[r]).name===t?(e=n.state===Pr,n.state=qr,n.timer.stop(),e&&n.on.call("interrupt",this,this.__data__,n.index,n.group),delete i[r]):o=!1;o&&delete this.__transition}})}function Qt(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Zt(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function tn(){}function nn(t){var n;return t=(t+"").trim().toLowerCase(),(n=Ir.exec(t))?(n=parseInt(n[1],16),new an(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1)):(n=Or.exec(t))?en(parseInt(n[1],16)):(n=Xr.exec(t))?new an(n[1],n[2],n[3],1):(n=Vr.exec(t))?new an(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=jr.exec(t))?rn(n[1],n[2],n[3],n[4]):(n=Lr.exec(t))?rn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Dr.exec(t))?sn(n[1],n[2]/100,n[3]/100,1):(n=Hr.exec(t))?sn(n[1],n[2]/100,n[3]/100,n[4]):Rr.hasOwnProperty(t)?en(Rr[t]):"transparent"===t?new an(NaN,NaN,NaN,0):null}function en(t){return new an(t>>16&255,t>>8&255,255&t,1)}function rn(t,n,e,r){return 0>=r&&(t=n=e=NaN),new an(t,n,e,r)}function on(t){return t instanceof tn||(t=nn(t)),t?(t=t.rgb(),new an(t.r,t.g,t.b,t.opacity)):new an}function un(t,n,e,r){return 1===arguments.length?on(t):new an(t,n,e,null==r?1:r)}function an(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function sn(t,n,e,r){return 0>=r?t=n=e=NaN:0>=e||e>=1?t=n=NaN:0>=n&&(t=NaN),new fn(t,n,e,r)}function ln(t){if(t instanceof fn)return new fn(t.h,t.s,t.l,t.opacity);if(t instanceof tn||(t=nn(t)),!t)return new fn;if(t instanceof fn)return t;t=t.rgb();var n=t.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*(r>e):e===o?(r-n)/a+2:(n-e)/a+4,a/=.5>s?o+i:2-o-i,u*=60):a=s>0&&1>s?0:u,new fn(u,a,s,t.opacity)}function cn(t,n,e,r){return 1===arguments.length?ln(t):new fn(t,n,e,null==r?1:r)}function fn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function hn(t,n,e){return 255*(60>t?n+(e-n)*t/60:180>t?e:240>t?n+(e-n)*(240-t)/60:n)}function pn(t){if(t instanceof gn)return new gn(t.l,t.a,t.b,t.opacity);if(t instanceof xn){var n=t.h*$r;return new gn(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof an||(t=on(t));var e=_n(t.r),r=_n(t.g),i=_n(t.b),o=yn((.4124564*e+.3575761*r+.1804375*i)/Br),u=yn((.2126729*e+.7151522*r+.072175*i)/Ur),a=yn((.0193339*e+.119192*r+.9503041*i)/Wr);return new gn(116*u-16,500*(o-u),200*(u-a),t.opacity)}function dn(t,n,e,r){return 1===arguments.length?pn(t):new gn(t,n,e,null==r?1:r)}function gn(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function yn(t){return t>Qr?Math.pow(t,1/3):t/Gr+Jr}function vn(t){return t>Kr?t*t*t:Gr*(t-Jr)}function mn(t){return 255*(.0031308>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function _n(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function wn(t){if(t instanceof xn)return new xn(t.h,t.c,t.l,t.opacity);t instanceof gn||(t=pn(t));var n=Math.atan2(t.b,t.a)*Yr;return new xn(0>n?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function bn(t,n,e,r){return 1===arguments.length?wn(t):new xn(t,n,e,null==r?1:r)}function xn(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}function Mn(t){if(t instanceof An)return new An(t.h,t.s,t.l,t.opacity);t instanceof an||(t=on(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(ui*r+ii*n-oi*e)/(ui+ii-oi),o=r-i,u=(ri*(e-i)-ni*o)/ei,a=Math.sqrt(u*u+o*o)/(ri*i*(1-i)),s=a?Math.atan2(u,o)*Yr-120:NaN;return new An(0>s?s+360:s,a,i,t.opacity)}function Nn(t,n,e,r){return 1===arguments.length?Mn(t):new An(t,n,e,null==r?1:r)}function An(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function kn(t){return function(){return t}}function Sn(t,n){return function(e){return t+e*n}}function En(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)}}function Pn(t,n){var e=n-t;return e?Sn(t,e>180||-180>e?e-360*Math.round(e/360):e):kn(isNaN(t)?n:t)}function Cn(t){return 1===(t=+t)?qn:function(n,e){return e-n?En(n,e,t):kn(isNaN(n)?e:n)}}function qn(t,n){var e=n-t;return e?Sn(t,e):kn(isNaN(t)?n:t)}function zn(t,n){return t=+t,n-=t,function(e){return t+n*e}}function Tn(t){return function(){return t}}function In(t){return function(n){return t(n)+""}}function On(t,n){var e,r,i,o=hi.lastIndex=pi.lastIndex=0,u=-1,a=[],s=[];for(t+="",n+="";(e=hi.exec(t))&&(r=pi.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:zn(e,r)})),o=pi.lastIndex;return o<n.length&&(i=n.slice(o),a[u]?a[u]+=i:a[++u]=i),a.length<2?s[0]?In(s[0].x):Tn(n):(n=s.length,function(t){for(var e,r=0;n>r;++r)a[(e=s[r]).i]=e.x(t);return a.join("")})}function Xn(t,n,e,r,i,o){if(t*r===n*e)return null;var u=Math.sqrt(t*t+n*n);t/=u,n/=u;var a=t*e+n*r;e-=t*a,r-=n*a;var s=Math.sqrt(e*e+r*r);return e/=s,r/=s,a/=s,n*e>t*r&&(t=-t,n=-n,a=-a,u=-u),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*di,skewX:Math.atan(a)*di,scaleX:u,scaleY:s}}function Vn(t){if("none"===t)return gi;ai||(ai=document.createElement("DIV"),si=document.documentElement,li=document.defaultView),ai.style.transform=t,t=li.getComputedStyle(si.appendChild(ai),null).getPropertyValue("transform"),si.removeChild(ai);var n=t.slice(7,-1).split(",");return Xn(+n[0],+n[1],+n[2],+n[3],+n[4],+n[5])}function jn(t){ci||(ci=document.createElementNS("http://www.w3.org/2000/svg","g")),ci.setAttribute("transform",null==t?"":t);var n=ci.transform.baseVal.consolidate().matrix;return Xn(n.a,n.b,n.c,n.d,n.e,n.f)}function Ln(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}function o(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:zn(t,i)},{i:s-2,x:zn(r,o)})}else(i||o)&&u.push("translate("+i+n+o+e)}function u(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:zn(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}function a(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:zn(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}function s(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:zn(t,e)},{i:a-2,x:zn(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}return function(n,e){var r=[],i=[];return n=t(n),e=t(e),o(n.translateX,n.translateY,e.translateX,e.translateY,r,i),u(n.rotate,e.rotate,r,i),a(n.skewX,e.skewX,r,i),s(n.scaleX,n.scaleY,e.scaleX,e.scaleY,r,i),n=e=null,function(t){for(var n,e=-1,o=i.length;++e<o;)r[(n=i[e]).i]=n.x(t);return r.join("")}}}function Dn(t,n){var e,r;return function(){var i=Wt(this,t),o=i.tween;if(o!==e){r=e=o;for(var u=0,a=r.length;a>u;++u)if(r[u].name===n){r=r.slice(),r.splice(u,1);break}}i.tween=r}}function Hn(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=Wt(this,t),u=o.tween;if(u!==r){i=(r=u).slice();for(var a={name:n,value:e},s=0,l=i.length;l>s;++s)if(i[s].name===n){i[s]=a;break}s===l&&i.push(a)}o.tween=i}}function Rn(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=Jt(this.node(),e).tween,o=0,u=i.length;u>o;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?Dn:Hn)(e,t,n))}function $n(t,n,e){var r=t._id;return t.each(function(){var t=Wt(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)}),function(t){return Jt(t,r).value[n]}}function Yn(t,n){var e;return("number"==typeof n?zn:n instanceof nn?fi:(e=nn(n))?(n=e,fi):On)(t,n)}function Fn(t){return function(){this.removeAttribute(t)}}function Bn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Un(t,n,e){var r,i;return function(){var o=this.getAttribute(t);return o===e?null:o===r?i:i=n(r=o,e)}}function Wn(t,n,e){var r,i;return function(){var o=this.getAttributeNS(t.space,t.local);return o===e?null:o===r?i:i=n(r=o,e)}}function Jn(t,n,e){var r,i,o;return function(){var u,a=e(this);return null==a?void this.removeAttribute(t):(u=this.getAttribute(t),u===a?null:u===r&&a===i?o:o=n(r=u,i=a))}}function Kn(t,n,e){var r,i,o;return function(){var u,a=e(this);return null==a?void this.removeAttributeNS(t.space,t.local):(u=this.getAttributeNS(t.space,t.local),u===a?null:u===r&&a===i?o:o=n(r=u,i=a))}}function Gn(t,e){var r=n(t),i="transform"===r?vi:Yn;return this.attrTween(t,"function"==typeof e?(r.local?Kn:Jn)(r,i,$n(this,"attr."+t,e)):null==e?(r.local?Bn:Fn)(r):(r.local?Wn:Un)(r,i,e))}function Qn(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttributeNS(t.space,t.local,r(n))}}return e._value=n,e}function Zn(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttribute(t,r(n))}}return e._value=n,e}function te(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;var i=n(t);return this.tween(r,(i.local?Qn:Zn)(i,e))}function ne(t,n){return function(){Ut(this,t).delay=+n.apply(this,arguments)}}function ee(t,n){return n=+n,function(){Ut(this,t).delay=n}}function re(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?ne:ee)(n,t)):Jt(this.node(),n).delay}function ie(t,n){return function(){Wt(this,t).duration=+n.apply(this,arguments)}}function oe(t,n){return n=+n,function(){Wt(this,t).duration=n}}function ue(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?ie:oe)(n,t)):Jt(this.node(),n).duration}function ae(t,n){if("function"!=typeof n)throw new Error;return function(){Wt(this,t).ease=n}}function se(t){var n=this._id;return arguments.length?this.each(ae(n,t)):Jt(this.node(),n).ease}function le(t){var n=this;"function"!=typeof t&&(t=ur(t));for(var e=n._groups,r=e.length,i=new Array(r),o=0;r>o;++o)for(var u,a=e[o],s=a.length,l=i[o]=new Array(s),c=0;s>c;++c)(u=a[c])&&t.call(u,u.__data__,c,a)&&(l[c]=u);return new Ce(i,this._parents,this._name,this._id)}function ce(t){var n=this;if(t._id!==this._id)throw new Error;for(var e=n._groups,r=t._groups,i=e.length,o=r.length,u=Math.min(i,o),a=new Array(i),s=0;u>s;++s)for(var l,c=e[s],f=r[s],h=c.length,p=a[s]=new Array(h),d=0;h>d;++d)(l=c[d]||f[d])&&(p[d]=l);for(;i>s;++s)a[s]=e[s];return new Ce(a,this._parents,this._name,this._id)}function fe(t){return(t+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t})}function he(t,n,e){var r,i,o=fe(n)?Ut:Wt;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}function pe(t,n){var e=this._id;return arguments.length<2?Jt(this.node(),e).on.on(t):this.each(he(e,t,n))}function de(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function ge(){return this.on("end.remove",de(this._id))}function ye(t){var n=this,e=this._name,r=this._id;"function"!=typeof t&&(t=h(t));for(var i=n._groups,o=i.length,u=new Array(o),a=0;o>a;++a)for(var s,l,c=i[a],f=c.length,p=u[a]=new Array(f),d=0;f>d;++d)(s=c[d])&&(l=t.call(s,s.__data__,d,c))&&("__data__"in s&&(l.__data__=s.__data__),p[d]=l,Bt(p[d],e,r,d,p,Jt(s,r)));return new Ce(u,this._parents,e,r)}function ve(t){var n=this,e=this._name,r=this._id;"function"!=typeof t&&(t=d(t));for(var i=n._groups,o=i.length,u=[],a=[],s=0;o>s;++s)for(var l,c=i[s],f=c.length,h=0;f>h;++h)if(l=c[h]){for(var p,g=t.call(l,l.__data__,h,c),y=Jt(l,r),v=0,m=g.length;m>v;++v)(p=g[v])&&Bt(p,e,r,v,g,y);u.push(g),a.push(l)}return new Ce(u,a,e,r)}function me(){return new mi(this._groups,this._parents)}function _e(t,n){var e,r,i;return function(){var o=f(this).getComputedStyle(this,null),u=o.getPropertyValue(t),a=(this.style.removeProperty(t),o.getPropertyValue(t));return u===a?null:u===e&&a===r?i:i=n(e=u,r=a)}}function we(t){return function(){this.style.removeProperty(t)}}function be(t,n,e){var r,i;return function(){var o=f(this).getComputedStyle(this,null).getPropertyValue(t);return o===e?null:o===r?i:i=n(r=o,e)}}function xe(t,n,e){var r,i,o;return function(){var u=f(this).getComputedStyle(this,null),a=u.getPropertyValue(t),s=e(this);return null==s&&(this.style.removeProperty(t),s=u.getPropertyValue(t)),a===s?null:a===r&&s===i?o:o=n(r=a,i=s)}}function Me(t,n,e){var r="transform"==(t+="")?yi:Yn;return null==n?this.styleTween(t,_e(t,r)).on("end.style."+t,we(t)):this.styleTween(t,"function"==typeof n?xe(t,r,$n(this,"style."+t,n)):be(t,r,n),e)}function Ne(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}function Ae(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,Ne(t,n,null==e?"":e))}function ke(t){return function(){this.textContent=t}}function Se(t){return function(){var n=t(this);this.textContent=null==n?"":n}}function Ee(t){return this.tween("text","function"==typeof t?Se($n(this,"text",t)):ke(null==t?"":t+""))}function Pe(){for(var t=this,n=this._name,e=this._id,r=ze(),i=t._groups,o=i.length,u=0;o>u;++u)for(var a,s=i[u],l=s.length,c=0;l>c;++c)if(a=s[c]){var f=Jt(a,e);Bt(a,n,r,c,s,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new Ce(i,this._parents,n,r)}function Ce(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function qe(t){return Pt().transition(t)}function ze(){return++_i}function Te(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}function Ie(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return ki.time=Xt(),ki;return e}function Oe(t){var n,e,r=this;t instanceof Ce?(n=t._id,t=t._name):(n=ze(),(e=ki).time=Xt(),t=null==t?null:t+"");for(var i=r._groups,o=i.length,u=0;o>u;++u)for(var a,s=i[u],l=s.length,c=0;l>c;++c)(a=s[c])&&Bt(a,t,n,c,s,e||Ie(a,n));return new Ce(i,this._parents,t,n)}function Xe(t,n){return n>t?-1:t>n?1:t>=n?0:NaN}function Ve(t){return 1===t.length&&(t=je(t)),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);i>r;){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);i>r;){var o=r+i>>>1;t(n[o],e)>0?i=o:r=o+1}return r}}}function je(t){return function(n,e){return Xe(t(n),e)}}function Le(t,n){var e,r,i=-1,o=t.length;if(null==n){for(;++i<o;)if(null!=(r=t[i])&&r>=r){e=r;break}for(;++i<o;)null!=(r=t[i])&&r>e&&(e=r)}else{for(;++i<o;)if(null!=(r=n(t[i],i,t))&&r>=r){e=r;break}for(;++i<o;)null!=(r=n(t[i],i,t))&&r>e&&(e=r)}return e}function De(t,n){var e,r,i=-1,o=t.length;if(null==n){for(;++i<o;)if(null!=(r=t[i])&&r>=r){e=r;break}for(;++i<o;)null!=(r=t[i])&&e>r&&(e=r)}else{for(;++i<o;)if(null!=(r=n(t[i],i,t))&&r>=r){e=r;break}for(;++i<o;)null!=(r=n(t[i],i,t))&&e>r&&(e=r)}return e}function He(t,n){var e,r=0,i=t.length,o=-1;if(null==n)for(;++o<i;)(e=+t[o])&&(r+=e);else for(;++o<i;)(e=+n(t[o],o,t))&&(r+=e);return r}function Re(t){return function(){return t}}function $e(t){return void 0===t?t="undefined":"string"==typeof t||t instanceof String||(t=JSON.stringify(t)),t}function Ye(t){return $e(t).match(Ei)}function Fe(t,n){void 0===n&&(n={"font-size":10,"font-family":"sans-serif"});var e=document.createElement("canvas").getContext("2d"),r=[];if("font-style"in n&&r.push(n["font-style"]),"font-variant"in n&&r.push(n["font-variant"]),"font-weight"in n&&r.push(n["font-weight"]),"font-size"in n){var i=n["font-size"]+"px";"line-height"in n&&(i+="/"+n["line-height"]+"px"),r.push(i)}return"font-family"in n&&r.push(n["font-family"]),e.font=r.join(" "),t instanceof Array?t.map(function(t){return e.measureText(t).width}):e.measureText(t).width}function Be(){function t(t){t=$e(t),void 0===n&&(n=Math.ceil(1.1*r));for(var s=u(t),l={"font-family":e,"font-size":r,"line-height":n},c=1,f="",h=!1,p=0,d=[""],g=Fe(s,l),y=Fe(" ",l),v=0;v<s.length;v++){var m=s[v],_=t.charAt(f.length+m.length),w=g[s.indexOf(m)];if(" "===_&&(m+=_),p+w>a-r){if(d[c-1]=d[c-1].trimRight(),c++,n*c>i||w>a&&!o){h=!0;break}p=0,d.push(m)}else d[c-1]+=m;f+=m,p+=w," "===_&&(p+=y)}return{lines:d,sentence:t,truncated:h}}var n,e="sans-serif",r=10,i=200,o=!1,u=Ye,a=200;return t.fontFamily=function(n){return arguments.length?(e=n,t):e},t.fontSize=function(n){return arguments.length?(r=n,t):r},t.height=function(n){return arguments.length?(i=n,t):i},t.lineHeight=function(e){return arguments.length?(n=e,t):n},t.overflow=function(n){return arguments.length?(o=n,t):o},t.split=function(n){return arguments.length?(u=n,t):u},t.width=function(n){return arguments.length?(a=n,t):a},t}function Ue(t){return t.height||200}function We(t,n){return t.id||""+n}function Je(t){return t.text}function Ke(t){return t.width||200}function Ge(t){return t.x||0}function Qe(t){return t.y||0}function Ze(t){function n(t){return t+"..."}function e(n){void 0===o&&e.select(Pi.select("body").append("svg").style("width",window.innerWidth+"px").style("height",window.innerHeight+"px").node()),void 0===i&&(i=Re(Math.ceil(1.1*p())));var N=o.selectAll(".d3plus-text-box").data(t,g);return N.exit().remove(),N.enter().append("text").attr("class","d3plus-text-box").attr("id",function(t,n){return"d3plus-text-box-"+g(t,n)}).merge(N).attr("y",function(t,n){return M(t,n)+"px"}).attr("fill",function(t,n){return r(t,n)}).attr("text-anchor",function(t,n){return _(t,n)}).attr("font-family",function(t,n){return l(t,n)}).each(function(t,n){function e(){if(P>M)return void(k=[]);M>E&&(M=E),g&&(N=1.1*M,V.fontSize(M).lineHeight(N),S["font-size"]=M,S["line-height"]=N);var t=V(q);k=t.lines,A=k.length+1,t.truncated&&(g?(M--,P>M?k=[]:e()):2!==A||k[A-2].length?k[A-2]=s(k[A-2]):k=[])}function r(e){e.text(function(t){return t.trimRight()}).attr("x",x(t,n)+"px").attr("dx",X+"px").attr("dy",N+"px")}var o,g=h(t,n),M=g?c(t,n):p(t,n),N=g?1.1*M:i(t,n),A=1,k=[""],S={"font-family":l(t,n),"font-size":M,"line-height":N},E=c(t,n),P=f(t,n),C=d(t,n),q=m(t,n),z=_(t,n),T=w(t,n),I=b(t,n),O=v(q,n),X="start"===z?0:"end"===z?I:I/2,V=Be().fontFamily(S["font-family"]).fontSize(M).lineHeight(N).height(C).overflow(y(t,n)).width(I);if(C>N||g){if(g){o=Fe(O,S);var j=1.165+I/C*.1,L=I*C,D=Pi.max(o),H=Pi.sum(o,function(t){return t*N})*j;if(D>I||H>L){var R=Math.sqrt(L/H),$=I/D,Y=Pi.min([R,$]);M=Math.floor(M*Y)}var F=Math.floor(.8*C);M>F&&(M=F)}e(),Pi.select(this).attr("font-size",M+"px").style("font-size",M+"px")}var B=A*N,U="top"===T?0:"middle"===T?C/2-B/2:C-B;U-=.2*N,Pi.select(this).transition().duration(a).attr("transform","translate(0,"+U+")");var W=Pi.select(this).selectAll("tspan").data(k);W.transition().duration(a).call(r),W.exit().transition().duration(a).attr("opacity",0).remove(),W.enter().append("tspan").attr("dominant-baseline","alphabetic").style("baseline-shift","0%").attr("opacity",0).call(r).transition().duration(a).delay(u).attr("opacity",1)}),n&&setTimeout(n,a+100),e}void 0===t&&(t=[]);var r,i,o,u=0,a=0,s=n,l=Re("sans-serif"),c=Re(50),f=Re(8),h=Re(!1),p=Re(10),d=Ue,g=We,y=Re(!1),v=Ye,m=Je,_=Re("start"),w=Re("top"),b=Ke,x=Ge,M=Qe;return e.data=function(n){return arguments.length?(t=n,e):t},e.delay=function(t){return arguments.length?(u=t,e):u},e.duration=function(t){return arguments.length?(a=t,e):a},e.ellipsis=function(t){return arguments.length?(s="function"==typeof t?t:Re(t),e):s},e.fontColor=function(t){return arguments.length?(r="function"==typeof t?t:Re(t),e):r},e.fontFamily=function(t){return arguments.length?(l="function"==typeof t?t:Re(t),e):l},e.fontMax=function(t){return arguments.length?(c="function"==typeof t?t:Re(t),
e):c},e.fontMin=function(t){return arguments.length?(f="function"==typeof t?t:Re(t),e):f},e.fontResize=function(t){return arguments.length?(h="function"==typeof t?t:Re(t),e):h},e.fontSize=function(t){return arguments.length?(p="function"==typeof t?t:Re(t),e):p},e.height=function(t){return arguments.length?(d="function"==typeof t?t:Re(t),e):d},e.id=function(t){return arguments.length?(g="function"==typeof t?t:Re(t),e):g},e.lineHeight=function(t){return arguments.length?(i="function"==typeof t?t:Re(t),e):i},e.overflow=function(t){return arguments.length?(y="function"==typeof t?t:Re(t),e):y},e.select=function(t){return arguments.length?(o=Pi.select(t),void 0===r&&e.fontColor(o.style("font-color")),void 0===l&&e.fontFamily(o.style("font-family")),void 0===p&&e.fontSize(parseFloat(o.style("font-size"),10)),e):o},e.split=function(t){return arguments.length?(v=t,e):v},e.text=function(t){return arguments.length?(m="function"==typeof t?t:Re(t),e):m},e.textAnchor=function(t){return arguments.length?(_="function"==typeof t?t:Re(t),e):_},e.verticalAlign=function(t){return arguments.length?(w="function"==typeof t?t:Re(t),e):w},e.width=function(t){return arguments.length?(b="function"==typeof t?t:Re(t),e):b},e.x=function(t){return arguments.length?(x="function"==typeof t?t:Re(t),e):x},e.y=function(t){return arguments.length?(M="function"==typeof t?t:Re(t),e):M},t.length?e():e}var tr="0.4.4",nr="http://www.w3.org/1999/xhtml",er={svg:"http://www.w3.org/2000/svg",xhtml:nr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},rr=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var ir=document.documentElement;if(!ir.matches){var or=ir.webkitMatchesSelector||ir.msMatchesSelector||ir.mozMatchesSelector||ir.oMatchesSelector;rr=function(t){return function(){return or.call(this,t)}}}}var ur=rr,ar={},sr=null;if("undefined"!=typeof document){var lr=document.documentElement;"onmouseenter"in lr||(ar={mouseenter:"mouseover",mouseleave:"mouseout"})}var cr="$";b.prototype={constructor:b,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)}},Q.prototype={add:function(t){var n=this._names.indexOf(t);0>n&&(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 fr=[null];Et.prototype=Pt.prototype={constructor:Et,select:p,selectAll:g,filter:y,data:w,enter:M,exit:N,merge:A,order:k,sort:S,call:P,nodes:C,node:q,size:z,empty:T,each:I,attr:H,style:F,property:J,classed:it,text:st,html:ht,raise:dt,lower:yt,append:wt,remove:xt,datum:Mt,on:c,dispatch:St};var hr=("undefined"!=typeof navigator&&/WebKit/.test(navigator.userAgent)?-1:0,{value:function(){}});zt.prototype=qt.prototype={constructor:zt,on:function(t,n){var e,r=this._,i=Tt(t+"",r),o=-1,u=i.length;{if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error;for(;++o<u;)if(e=(t=i[o]).type)r[e]=Ot(r[e],t.name,n);else if(null==n)for(e in r)r[e]=Ot(r[e],t.name,null);return this}for(;++o<u;)if((e=(t=i[o]).type)&&(e=It(r[e],t.name)))return e}},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new zt(t)},call:function(t,n){var e=arguments;if((r=arguments.length-2)>0)for(var r,i=new Array(r),o=0;r>o;++o)i[o]=e[o+2];this.apply(t,n,i)},apply:function(t,n,e){var r=this;if(!this._.hasOwnProperty(t))throw new Error;for(var i=r._[t],o=0,u=i.length;u>o;++o)i[o].value.apply(n,e)}};var pr,dr,gr=0,yr=0,vr=0,mr=1e3,_r=0,wr=0,br=0,xr="object"==typeof performance?performance:Date,Mr="function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){return setTimeout(t,17)};jt.prototype=Lt.prototype={constructor:jt,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Xt():+e)+(null==n?0:+n),this._call||(dr?dr._next=this:pr=this,dr=this),this._call=t,this._time=e,Yt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Yt())}};var Nr=qt("start","end","interrupt"),Ar=[],kr=0,Sr=1,Er=2,Pr=3,Cr=4,qr=5,zr=.7,Tr=1/zr,Ir=/^#([0-9a-f]{3})$/,Or=/^#([0-9a-f]{6})$/,Xr=/^rgb\(\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*\)$/,Vr=/^rgb\(\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*\)$/,jr=/^rgba\(\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*,\s*([-+]?\d+(?:\.\d+)?)\s*\)$/,Lr=/^rgba\(\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)\s*\)$/,Dr=/^hsl\(\s*([-+]?\d+(?:\.\d+)?)\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*\)$/,Hr=/^hsla\(\s*([-+]?\d+(?:\.\d+)?)\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)\s*\)$/,Rr={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};Qt(tn,nn,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),Qt(an,un,Zt(tn,{brighter:function(t){return t=null==t?Tr:Math.pow(Tr,t),new an(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?zr:Math.pow(zr,t),new an(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(1===t?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),Qt(fn,cn,Zt(tn,{brighter:function(t){return t=null==t?Tr:Math.pow(Tr,t),new fn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?zr:Math.pow(zr,t),new fn(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+(.5>e?e:1-e)*n,i=2*e-r;return new an(hn(t>=240?t-240:t+120,i,r),hn(t,i,r),hn(120>t?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}}));var $r=Math.PI/180,Yr=180/Math.PI,Fr=18,Br=.95047,Ur=1,Wr=1.08883,Jr=4/29,Kr=6/29,Gr=3*Kr*Kr,Qr=Kr*Kr*Kr;Qt(gn,dn,Zt(tn,{brighter:function(t){return new gn(this.l+Fr*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new gn(this.l-Fr*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=Ur*vn(t),n=Br*vn(n),e=Wr*vn(e),new an(mn(3.2404542*n-1.5371385*t-.4985314*e),mn(-.969266*n+1.8760108*t+.041556*e),mn(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),Qt(xn,bn,Zt(tn,{brighter:function(t){return new xn(this.h,this.c,this.l+Fr*(null==t?1:t),this.opacity)},darker:function(t){return new xn(this.h,this.c,this.l-Fr*(null==t?1:t),this.opacity)},rgb:function(){return pn(this).rgb()}}));var Zr=-.14861,ti=1.78277,ni=-.29227,ei=-.90649,ri=1.97294,ii=ri*ei,oi=ri*ti,ui=ti*ni-ei*Zr;Qt(An,Nn,Zt(tn,{brighter:function(t){return t=null==t?Tr:Math.pow(Tr,t),new An(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?zr:Math.pow(zr,t),new An(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*$r,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new an(255*(n+e*(Zr*r+ti*i)),255*(n+e*(ni*r+ei*i)),255*(n+e*(ri*r)),this.opacity)}}));var ai,si,li,ci,fi=function Ci(t){function n(t,n){var r=e((t=un(t)).r,(n=un(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),u=e(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+""}}var e=Cn(t);return n.gamma=Ci,n}(1),hi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pi=new RegExp(hi.source,"g"),di=180/Math.PI,gi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},yi=Ln(Vn,"px, ","px)","deg)"),vi=Ln(jn,", ",")",")");!function qi(t){function n(n,e){var r=Pn((n=Nn(n)).h,(e=Nn(e)).h),i=qn(n.s,e.s),o=qn(n.l,e.l),u=qn(n.opacity,e.opacity);return function(e){return n.h=r(e),n.s=i(e),n.l=o(Math.pow(e,t)),n.opacity=u(e),n+""}}return t=+t,n.gamma=qi,n}(1),function zi(t){function n(n,e){var r=qn((n=Nn(n)).h,(e=Nn(e)).h),i=qn(n.s,e.s),o=qn(n.l,e.l),u=qn(n.opacity,e.opacity);return function(e){return n.h=r(e),n.s=i(e),n.l=o(Math.pow(e,t)),n.opacity=u(e),n+""}}return t=+t,n.gamma=zi,n}(1);var mi=Pt.prototype.constructor,_i=0,wi=Pt.prototype;Ce.prototype=qe.prototype={constructor:Ce,select:ye,selectAll:ve,filter:le,merge:ce,selection:me,transition:Pe,call:wi.call,nodes:wi.nodes,node:wi.node,size:wi.size,empty:wi.empty,each:wi.each,on:pe,attr:Gn,attrTween:te,style:Me,styleTween:Ae,text:Ee,remove:ge,tween:Rn,delay:re,duration:ue,ease:se};var bi=3,xi=(function Ti(t){function n(n){return Math.pow(n,t)}return t=+t,n.exponent=Ti,n}(bi),function Ii(t){function n(n){return 1-Math.pow(1-n,t)}return t=+t,n.exponent=Ii,n}(bi),function Oi(t){function n(n){return((n*=2)<=1?Math.pow(n,t):2-Math.pow(2-n,t))/2}return t=+t,n.exponent=Oi,n}(bi),1.70158),Mi=(function Xi(t){function n(n){return n*n*((t+1)*n-t)}return t=+t,n.overshoot=Xi,n}(xi),function Vi(t){function n(n){return--n*n*((t+1)*n+t)+1}return t=+t,n.overshoot=Vi,n}(xi),function ji(t){function n(n){return((n*=2)<1?n*n*((t+1)*n-t):(n-=2)*n*((t+1)*n+t)+2)/2}return t=+t,n.overshoot=ji,n}(xi),2*Math.PI),Ni=1,Ai=.3,ki=(function Li(t,n){function e(e){return t*Math.pow(2,10*--e)*Math.sin((r-e)/n)}var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Mi);return e.amplitude=function(t){return Li(t,n*Mi)},e.period=function(n){return Li(t,n)},e}(Ni,Ai),function Di(t,n){function e(e){return 1-t*Math.pow(2,-10*(e=+e))*Math.sin((e+r)/n)}var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Mi);return e.amplitude=function(t){return Di(t,n*Mi)},e.period=function(n){return Di(t,n)},e}(Ni,Ai),function Hi(t,n){function e(e){return((e=2*e-1)<0?t*Math.pow(2,10*e)*Math.sin((r-e)/n):2-t*Math.pow(2,-10*e)*Math.sin((r+e)/n))/2}var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Mi);return e.amplitude=function(t){return Hi(t,n*Mi)},e.period=function(n){return Hi(t,n)},e}(Ni,Ai),{time:null,delay:0,duration:250,ease:Te});Pt.prototype.interrupt=Gt,Pt.prototype.transition=Oe;var Si=(Ve(Xe),["-","/",";",":","&"]),Ei=new RegExp("[^\\s\\"+Si.join("\\")+"]+\\"+Si.join("?\\")+"?","g"),Pi={max:Le,min:De,select:Ct,sum:He,transition:qe};t.version=tr,t.box=Ze,t.split=Ye,t.stringify=$e,t.width=Fe,t.wrap=Be});
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define("d3plus-text",["exports"],n):n(t.d3plus_text=t.d3plus_text||{})}(this,function(t){"use strict";function n(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),er.hasOwnProperty(n)?{space:er[n],local:t}:t}function e(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===nr&&n.documentElement.namespaceURI===nr?n.createElement(t):n.createElementNS(e,t)}}function r(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function i(t){var i=n(t);return(i.local?r:e)(i)}function o(t,n,e){return t=u(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function u(t,n,e){return function(r){var i=sr;sr=r;try{t.call(this,this.__data__,n,e)}finally{sr=i}}}function a(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}})}function s(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;o>r;++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 l(t,n,e){var r=ar.hasOwnProperty(t.type)?o:u;return function(i,o,u){var a,s=this.__on,l=r(n,o,u);if(s)for(var c=0,f=s.length;f>c;++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 c(t,n,e){var r,i,o=a(t+""),u=o.length;{if(!(arguments.length<2)){for(c=n?l:s,null==e&&(e=!1),r=0;u>r;++r)this.each(c(o[r],n,e));return this}var c=this.node().__on;if(c)for(var f,h=0,p=c.length;p>h;++h)for(r=0,f=c[h];u>r;++r)if((i=o[r]).type===f.type&&i.name===f.name)return f.value}}function f(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function h(t){return function(){return this.querySelector(t)}}function p(t){"function"!=typeof t&&(t=h(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;e>i;++i)for(var o,u,a=n[i],s=a.length,l=r[i]=new Array(s),c=0;s>c;++c)(o=a[c])&&(u=t.call(o,o.__data__,c,a))&&("__data__"in o&&(u.__data__=o.__data__),l[c]=u);return new Et(r,this._parents)}function d(t){return function(){return this.querySelectorAll(t)}}function g(t){"function"!=typeof t&&(t=d(t));for(var n=this._groups,e=n.length,r=[],i=[],o=0;e>o;++o)for(var u,a=n[o],s=a.length,l=0;s>l;++l)(u=a[l])&&(r.push(t.call(u,u.__data__,l,a)),i.push(u));return new Et(r,i)}function y(t){"function"!=typeof t&&(t=ur(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;e>i;++i)for(var o,u=n[i],a=u.length,s=r[i]=new Array(a),l=0;a>l;++l)(o=u[l])&&t.call(o,o.__data__,l,u)&&(s[l]=o);return new Et(r,this._parents)}function v(t){return function(){return t}}function m(t,n,e,r,i,o){for(var u,a=0,s=n.length,l=o.length;l>a;++a)(u=n[a])?(u.__data__=o[a],r[a]=u):e[a]=new b(t,o[a]);for(;s>a;++a)(u=n[a])&&(i[a]=u)}function _(t,n,e,r,i,o,u){var a,s,l,c={},f=n.length,h=o.length,p=new Array(f);for(a=0;f>a;++a)(s=n[a])&&(p[a]=l=cr+u.call(s,s.__data__,a,n),c[l]||(c[l]=s));for(a=0;h>a;++a)l=cr+u.call(t,o[a],a,o),(s=c[l])?s!==!0&&(r[a]=s,s.__data__=o[a]):e[a]=new b(t,o[a]),c[l]=!0;for(a=0;f>a;++a)(s=n[a])&&c[p[a]]!==!0&&(i[a]=s)}function w(t,n){if(!t)return p=new Array(this.size()),l=-1,this.each(function(t){p[++l]=t}),p;var e=n?_:m,r=this._parents,i=this._groups;"function"!=typeof t&&(t=v(t));for(var o=i.length,u=new Array(o),a=new Array(o),s=new Array(o),l=0;o>l;++l){var c=r[l],f=i[l],h=f.length,p=t.call(c,c&&c.__data__,l,r),d=p.length,g=a[l]=new Array(d),y=u[l]=new Array(d),w=s[l]=new Array(h);e(c,f,g,y,w,p,n);for(var b,x,M=0,N=0;d>M;++M)if(b=g[M]){for(M>=N&&(N=M+1);!(x=y[N])&&++N<d;);b._next=x||null}}return u=new Et(u,r),u._enter=a,u._exit=s,u}function b(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function x(t){return new Array(t.length)}function M(){return new Et(this._enter||this._groups.map(x),this._parents)}function N(){return new Et(this._exit||this._groups.map(x),this._parents)}function A(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;o>a;++a)for(var s,l=n[a],c=e[a],f=l.length,h=u[a]=new Array(f),p=0;f>p;++p)(s=l[p]||c[p])&&(h[p]=s);for(;r>a;++a)u[a]=n[a];return new Et(u,this._parents)}function k(){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&&u!==r.nextSibling&&u.parentNode.insertBefore(r,u),u=r);return this}function S(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=E);for(var e=this._groups,r=e.length,i=new Array(r),o=0;r>o;++o){for(var u,a=e[o],s=a.length,l=i[o]=new Array(s),c=0;s>c;++c)(u=a[c])&&(l[c]=u);l.sort(n)}return new Et(i,this._parents).order()}function E(t,n){return n>t?-1:t>n?1:t>=n?0:NaN}function P(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function C(){var t=new Array(this.size()),n=-1;return this.each(function(){t[++n]=this}),t}function q(){for(var t=this._groups,n=0,e=t.length;e>n;++n)for(var r=t[n],i=0,o=r.length;o>i;++i){var u=r[i];if(u)return u}return null}function z(){var t=0;return this.each(function(){++t}),t}function T(){return!this.node()}function I(t){for(var n=this._groups,e=0,r=n.length;r>e;++e)for(var i,o=n[e],u=0,a=o.length;a>u;++u)(i=o[u])&&t.call(i,i.__data__,u,o);return this}function O(t){return function(){this.removeAttribute(t)}}function X(t){return function(){this.removeAttributeNS(t.space,t.local)}}function V(t,n){return function(){this.setAttribute(t,n)}}function j(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function L(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function D(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 H(t,e){var r=n(t);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((null==e?r.local?X:O:"function"==typeof e?r.local?D:L:r.local?j:V)(r,e))}function R(t){return function(){this.style.removeProperty(t)}}function $(t,n,e){return function(){this.style.setProperty(t,n,e)}}function Y(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function F(t,n,e){var r;return arguments.length>1?this.each((null==n?R:"function"==typeof n?Y:$)(t,n,null==e?"":e)):f(r=this.node()).getComputedStyle(r,null).getPropertyValue(t)}function B(t){return function(){delete this[t]}}function U(t,n){return function(){this[t]=n}}function W(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function J(t,n){return arguments.length>1?this.each((null==n?B:"function"==typeof n?W:U)(t,n)):this.node()[t]}function K(t){return t.trim().split(/^|\s+/)}function G(t){return t.classList||new Q(t)}function Q(t){this._node=t,this._names=K(t.getAttribute("class")||"")}function Z(t,n){for(var e=G(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function tt(t,n){for(var e=G(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function nt(t){return function(){Z(this,t)}}function et(t){return function(){tt(this,t)}}function rt(t,n){return function(){(n.apply(this,arguments)?Z:tt)(this,t)}}function it(t,n){var e=K(t+"");if(arguments.length<2){for(var r=G(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?rt:n?nt:et)(e,n))}function ot(){this.textContent=""}function ut(t){return function(){this.textContent=t}}function at(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function st(t){return arguments.length?this.each(null==t?ot:("function"==typeof t?at:ut)(t)):this.node().textContent}function lt(){this.innerHTML=""}function ct(t){return function(){this.innerHTML=t}}function ft(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function ht(t){return arguments.length?this.each(null==t?lt:("function"==typeof t?ft:ct)(t)):this.node().innerHTML}function pt(){this.parentNode.appendChild(this)}function dt(){return this.each(pt)}function gt(){this.parentNode.insertBefore(this,this.parentNode.firstChild)}function yt(){return this.each(gt)}function vt(t){return function(){return this.appendChild(t.apply(this,arguments))}}function mt(t,n){return function(){return this.insertBefore(t.apply(this,arguments),n.apply(this,arguments)||null)}}function _t(){return null}function wt(t,n){var e="function"==typeof t?t:i(t);return this.select(arguments.length<2?vt(e):mt(e,null==n?_t:"function"==typeof n?n:h(n)))}function bt(){var t=this.parentNode;t&&t.removeChild(this)}function xt(){return this.each(bt)}function Mt(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Nt(t,n,e){var r=f(t),i=r.CustomEvent;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)}function At(t,n){return function(){return Nt(this,t,n)}}function kt(t,n){return function(){return Nt(this,t,n.apply(this,arguments))}}function St(t,n){return this.each(("function"==typeof n?kt:At)(t,n))}function Et(t,n){this._groups=t,this._parents=n}function Pt(){return new Et([[document.documentElement]],fr)}function Ct(t){return"string"==typeof t?new Et([[document.querySelector(t)]],[document.documentElement]):new Et([[t]],fr)}function qt(){for(var t,n=0,e=arguments.length,r={};e>n;++n){if(!(t=arguments[n]+"")||t in r)throw new Error;r[t]=[]}return new zt(r)}function zt(t){this._=t}function Tt(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;return{type:t,name:e}})}function It(t,n){for(var e,r=0,i=t.length;i>r;++r)if((e=t[r]).name===n)return e.value}function Ot(t,n,e){for(var r=0,i=t.length;i>r;++r)if(t[r].name===n){t[r]=hr,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}function Xt(){return wr||(Mr(Vt),wr=xr.now()+br)}function Vt(){wr=0}function jt(){this._call=this._time=this._next=null}function Lt(t,n,e){var r=new jt;return r.restart(t,n,e),r}function Dt(){Xt(),++gr;for(var t,n=pr;n;)(t=wr-n._time)>=0&&n._call.call(null,t),n=n._next;--gr}function Ht(t){wr=(_r=t||xr.now())+br,gr=yr=0;try{Dt()}finally{gr=0,$t(),wr=0}}function Rt(){var t=xr.now(),n=t-_r;n>mr&&(br-=n,_r=t)}function $t(){for(var t,n=pr,e=1/0;n;)n._call?(e>n._time&&(e=n._time),n=(t=n)._next):n=t?t._next=n._next:pr=n._next;dr=t,Yt(e)}function Yt(t){if(!gr){yr&&(yr=clearTimeout(yr));var n=t-wr;n>24?(1/0>t&&(yr=setTimeout(Ht,n)),vr&&(vr=clearInterval(vr))):(vr||(vr=setInterval(Rt,mr)),gr=1,Mr(Ht))}}function Ft(t,n,e){var r=new jt;return n=null==n?0:+n,r.restart(function(e){r.stop(),t(e+n)},n,e),r}function Bt(t,n,e,r,i,o){var u=t.__transition;if(u){if(e in u)return}else t.__transition={};Kt(t,e,{name:n,index:r,group:i,on:Nr,tween:Ar,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:kr})}function Ut(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>kr)throw new Error("too late");return e}function Wt(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>Er)throw new Error("too late");return e}function Jt(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("too late");return e}function Kt(t,n,e){function r(t){e.state=Sr,e.delay<=t?i(t-e.delay):e.timer.restart(i,e.delay,e.time)}function i(r){var i,s,l,c;for(i in a)c=a[i],c.name===e.name&&(c.state===Pr?(c.state=qr,c.timer.stop(),c.on.call("interrupt",t,t.__data__,c.index,c.group),delete a[i]):n>+i&&(c.state=qr,c.timer.stop(),delete a[i]));if(Ft(function(){e.state===Pr&&(e.timer.restart(o,e.delay,e.time),o(r))}),e.state=Er,e.on.call("start",t,t.__data__,e.index,e.group),e.state===Er){for(e.state=Pr,u=new Array(l=e.tween.length),i=0,s=-1;l>i;++i)(c=e.tween[i].value.call(t,t.__data__,e.index,e.group))&&(u[++s]=c);u.length=s+1}}function o(r){for(var i=r<e.duration?e.ease.call(null,r/e.duration):(e.state=Cr,1),o=-1,s=u.length;++o<s;)u[o].call(null,i);if(e.state===Cr){e.state=qr,e.timer.stop(),e.on.call("end",t,t.__data__,e.index,e.group);for(o in a)if(+o!==n)return void delete a[n];delete t.__transition}}var u,a=t.__transition;a[n]=e,e.timer=Lt(r,0,e.time)}function Gt(t){return t=null==t?null:t+"",this.each(function(){var n,e,r,i=this.__transition,o=!0;if(i){for(r in i)(n=i[r]).name===t?(e=n.state===Pr,n.state=qr,n.timer.stop(),e&&n.on.call("interrupt",this,this.__data__,n.index,n.group),delete i[r]):o=!1;o&&delete this.__transition}})}function Qt(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Zt(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function tn(){}function nn(t){var n;return t=(t+"").trim().toLowerCase(),(n=Ir.exec(t))?(n=parseInt(n[1],16),new an(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1)):(n=Or.exec(t))?en(parseInt(n[1],16)):(n=Xr.exec(t))?new an(n[1],n[2],n[3],1):(n=Vr.exec(t))?new an(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=jr.exec(t))?rn(n[1],n[2],n[3],n[4]):(n=Lr.exec(t))?rn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Dr.exec(t))?sn(n[1],n[2]/100,n[3]/100,1):(n=Hr.exec(t))?sn(n[1],n[2]/100,n[3]/100,n[4]):Rr.hasOwnProperty(t)?en(Rr[t]):"transparent"===t?new an(NaN,NaN,NaN,0):null}function en(t){return new an(t>>16&255,t>>8&255,255&t,1)}function rn(t,n,e,r){return 0>=r&&(t=n=e=NaN),new an(t,n,e,r)}function on(t){return t instanceof tn||(t=nn(t)),t?(t=t.rgb(),new an(t.r,t.g,t.b,t.opacity)):new an}function un(t,n,e,r){return 1===arguments.length?on(t):new an(t,n,e,null==r?1:r)}function an(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function sn(t,n,e,r){return 0>=r?t=n=e=NaN:0>=e||e>=1?t=n=NaN:0>=n&&(t=NaN),new fn(t,n,e,r)}function ln(t){if(t instanceof fn)return new fn(t.h,t.s,t.l,t.opacity);if(t instanceof tn||(t=nn(t)),!t)return new fn;if(t instanceof fn)return t;t=t.rgb();var n=t.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*(r>e):e===o?(r-n)/a+2:(n-e)/a+4,a/=.5>s?o+i:2-o-i,u*=60):a=s>0&&1>s?0:u,new fn(u,a,s,t.opacity)}function cn(t,n,e,r){return 1===arguments.length?ln(t):new fn(t,n,e,null==r?1:r)}function fn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function hn(t,n,e){return 255*(60>t?n+(e-n)*t/60:180>t?e:240>t?n+(e-n)*(240-t)/60:n)}function pn(t){if(t instanceof gn)return new gn(t.l,t.a,t.b,t.opacity);if(t instanceof xn){var n=t.h*$r;return new gn(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof an||(t=on(t));var e=_n(t.r),r=_n(t.g),i=_n(t.b),o=yn((.4124564*e+.3575761*r+.1804375*i)/Br),u=yn((.2126729*e+.7151522*r+.072175*i)/Ur),a=yn((.0193339*e+.119192*r+.9503041*i)/Wr);return new gn(116*u-16,500*(o-u),200*(u-a),t.opacity)}function dn(t,n,e,r){return 1===arguments.length?pn(t):new gn(t,n,e,null==r?1:r)}function gn(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function yn(t){return t>Qr?Math.pow(t,1/3):t/Gr+Jr}function vn(t){return t>Kr?t*t*t:Gr*(t-Jr)}function mn(t){return 255*(.0031308>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function _n(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function wn(t){if(t instanceof xn)return new xn(t.h,t.c,t.l,t.opacity);t instanceof gn||(t=pn(t));var n=Math.atan2(t.b,t.a)*Yr;return new xn(0>n?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function bn(t,n,e,r){return 1===arguments.length?wn(t):new xn(t,n,e,null==r?1:r)}function xn(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}function Mn(t){if(t instanceof An)return new An(t.h,t.s,t.l,t.opacity);t instanceof an||(t=on(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(ui*r+ii*n-oi*e)/(ui+ii-oi),o=r-i,u=(ri*(e-i)-ni*o)/ei,a=Math.sqrt(u*u+o*o)/(ri*i*(1-i)),s=a?Math.atan2(u,o)*Yr-120:NaN;return new An(0>s?s+360:s,a,i,t.opacity)}function Nn(t,n,e,r){return 1===arguments.length?Mn(t):new An(t,n,e,null==r?1:r)}function An(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function kn(t){return function(){return t}}function Sn(t,n){return function(e){return t+e*n}}function En(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)}}function Pn(t,n){var e=n-t;return e?Sn(t,e>180||-180>e?e-360*Math.round(e/360):e):kn(isNaN(t)?n:t)}function Cn(t){return 1===(t=+t)?qn:function(n,e){return e-n?En(n,e,t):kn(isNaN(n)?e:n)}}function qn(t,n){var e=n-t;return e?Sn(t,e):kn(isNaN(t)?n:t)}function zn(t,n){return t=+t,n-=t,function(e){return t+n*e}}function Tn(t){return function(){return t}}function In(t){return function(n){return t(n)+""}}function On(t,n){var e,r,i,o=hi.lastIndex=pi.lastIndex=0,u=-1,a=[],s=[];for(t+="",n+="";(e=hi.exec(t))&&(r=pi.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:zn(e,r)})),o=pi.lastIndex;return o<n.length&&(i=n.slice(o),a[u]?a[u]+=i:a[++u]=i),a.length<2?s[0]?In(s[0].x):Tn(n):(n=s.length,function(t){for(var e,r=0;n>r;++r)a[(e=s[r]).i]=e.x(t);return a.join("")})}function Xn(t,n,e,r,i,o){if(t*r===n*e)return null;var u=Math.sqrt(t*t+n*n);t/=u,n/=u;var a=t*e+n*r;e-=t*a,r-=n*a;var s=Math.sqrt(e*e+r*r);return e/=s,r/=s,a/=s,n*e>t*r&&(t=-t,n=-n,a=-a,u=-u),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*di,skewX:Math.atan(a)*di,scaleX:u,scaleY:s}}function Vn(t){if("none"===t)return gi;ai||(ai=document.createElement("DIV"),si=document.documentElement,li=document.defaultView),ai.style.transform=t,t=li.getComputedStyle(si.appendChild(ai),null).getPropertyValue("transform"),si.removeChild(ai);var n=t.slice(7,-1).split(",");return Xn(+n[0],+n[1],+n[2],+n[3],+n[4],+n[5])}function jn(t){ci||(ci=document.createElementNS("http://www.w3.org/2000/svg","g")),ci.setAttribute("transform",null==t?"":t);var n=ci.transform.baseVal.consolidate().matrix;return Xn(n.a,n.b,n.c,n.d,n.e,n.f)}function Ln(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}function o(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:zn(t,i)},{i:s-2,x:zn(r,o)})}else(i||o)&&u.push("translate("+i+n+o+e)}function u(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:zn(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}function a(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:zn(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}function s(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:zn(t,e)},{i:a-2,x:zn(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}return function(n,e){var r=[],i=[];return n=t(n),e=t(e),o(n.translateX,n.translateY,e.translateX,e.translateY,r,i),u(n.rotate,e.rotate,r,i),a(n.skewX,e.skewX,r,i),s(n.scaleX,n.scaleY,e.scaleX,e.scaleY,r,i),n=e=null,function(t){for(var n,e=-1,o=i.length;++e<o;)r[(n=i[e]).i]=n.x(t);return r.join("")}}}function Dn(t,n){var e,r;return function(){var i=Wt(this,t),o=i.tween;if(o!==e){r=e=o;for(var u=0,a=r.length;a>u;++u)if(r[u].name===n){r=r.slice(),r.splice(u,1);break}}i.tween=r}}function Hn(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=Wt(this,t),u=o.tween;if(u!==r){i=(r=u).slice();for(var a={name:n,value:e},s=0,l=i.length;l>s;++s)if(i[s].name===n){i[s]=a;break}s===l&&i.push(a)}o.tween=i}}function Rn(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=Jt(this.node(),e).tween,o=0,u=i.length;u>o;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?Dn:Hn)(e,t,n))}function $n(t,n,e){var r=t._id;return t.each(function(){var t=Wt(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)}),function(t){return Jt(t,r).value[n]}}function Yn(t,n){var e;return("number"==typeof n?zn:n instanceof nn?fi:(e=nn(n))?(n=e,fi):On)(t,n)}function Fn(t){return function(){this.removeAttribute(t)}}function Bn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Un(t,n,e){var r,i;return function(){var o=this.getAttribute(t);return o===e?null:o===r?i:i=n(r=o,e)}}function Wn(t,n,e){var r,i;return function(){var o=this.getAttributeNS(t.space,t.local);return o===e?null:o===r?i:i=n(r=o,e)}}function Jn(t,n,e){var r,i,o;return function(){var u,a=e(this);return null==a?void this.removeAttribute(t):(u=this.getAttribute(t),u===a?null:u===r&&a===i?o:o=n(r=u,i=a))}}function Kn(t,n,e){var r,i,o;return function(){var u,a=e(this);return null==a?void this.removeAttributeNS(t.space,t.local):(u=this.getAttributeNS(t.space,t.local),u===a?null:u===r&&a===i?o:o=n(r=u,i=a))}}function Gn(t,e){var r=n(t),i="transform"===r?vi:Yn;return this.attrTween(t,"function"==typeof e?(r.local?Kn:Jn)(r,i,$n(this,"attr."+t,e)):null==e?(r.local?Bn:Fn)(r):(r.local?Wn:Un)(r,i,e))}function Qn(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttributeNS(t.space,t.local,r(n))}}return e._value=n,e}function Zn(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttribute(t,r(n))}}return e._value=n,e}function te(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;var i=n(t);return this.tween(r,(i.local?Qn:Zn)(i,e))}function ne(t,n){return function(){Ut(this,t).delay=+n.apply(this,arguments)}}function ee(t,n){return n=+n,function(){Ut(this,t).delay=n}}function re(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?ne:ee)(n,t)):Jt(this.node(),n).delay}function ie(t,n){return function(){Wt(this,t).duration=+n.apply(this,arguments)}}function oe(t,n){return n=+n,function(){Wt(this,t).duration=n}}function ue(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?ie:oe)(n,t)):Jt(this.node(),n).duration}function ae(t,n){if("function"!=typeof n)throw new Error;return function(){Wt(this,t).ease=n}}function se(t){var n=this._id;return arguments.length?this.each(ae(n,t)):Jt(this.node(),n).ease}function le(t){"function"!=typeof t&&(t=ur(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;e>i;++i)for(var o,u=n[i],a=u.length,s=r[i]=new Array(a),l=0;a>l;++l)(o=u[l])&&t.call(o,o.__data__,l,u)&&(s[l]=o);return new Ce(r,this._parents,this._name,this._id)}function ce(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;o>a;++a)for(var s,l=n[a],c=e[a],f=l.length,h=u[a]=new Array(f),p=0;f>p;++p)(s=l[p]||c[p])&&(h[p]=s);for(;r>a;++a)u[a]=n[a];return new Ce(u,this._parents,this._name,this._id)}function fe(t){return(t+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t})}function he(t,n,e){var r,i,o=fe(n)?Ut:Wt;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}function pe(t,n){var e=this._id;return arguments.length<2?Jt(this.node(),e).on.on(t):this.each(he(e,t,n))}function de(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function ge(){return this.on("end.remove",de(this._id))}function ye(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=h(t));for(var r=this._groups,i=r.length,o=new Array(i),u=0;i>u;++u)for(var a,s,l=r[u],c=l.length,f=o[u]=new Array(c),p=0;c>p;++p)(a=l[p])&&(s=t.call(a,a.__data__,p,l))&&("__data__"in a&&(s.__data__=a.__data__),f[p]=s,Bt(f[p],n,e,p,f,Jt(a,e)));return new Ce(o,this._parents,n,e)}function ve(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;i>a;++a)for(var s,l=r[a],c=l.length,f=0;c>f;++f)if(s=l[f]){for(var h,p=t.call(s,s.__data__,f,l),g=Jt(s,e),y=0,v=p.length;v>y;++y)(h=p[y])&&Bt(h,n,e,y,p,g);o.push(p),u.push(s)}return new Ce(o,u,n,e)}function me(){return new mi(this._groups,this._parents)}function _e(t,n){var e,r,i;return function(){var o=f(this).getComputedStyle(this,null),u=o.getPropertyValue(t),a=(this.style.removeProperty(t),o.getPropertyValue(t));return u===a?null:u===e&&a===r?i:i=n(e=u,r=a)}}function we(t){return function(){this.style.removeProperty(t)}}function be(t,n,e){var r,i;return function(){var o=f(this).getComputedStyle(this,null).getPropertyValue(t);return o===e?null:o===r?i:i=n(r=o,e)}}function xe(t,n,e){var r,i,o;return function(){var u=f(this).getComputedStyle(this,null),a=u.getPropertyValue(t),s=e(this);return null==s&&(this.style.removeProperty(t),s=u.getPropertyValue(t)),a===s?null:a===r&&s===i?o:o=n(r=a,i=s)}}function Me(t,n,e){var r="transform"==(t+="")?yi:Yn;return null==n?this.styleTween(t,_e(t,r)).on("end.style."+t,we(t)):this.styleTween(t,"function"==typeof n?xe(t,r,$n(this,"style."+t,n)):be(t,r,n),e)}function Ne(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}function Ae(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,Ne(t,n,null==e?"":e))}function ke(t){return function(){this.textContent=t}}function Se(t){return function(){var n=t(this);this.textContent=null==n?"":n}}function Ee(t){return this.tween("text","function"==typeof t?Se($n(this,"text",t)):ke(null==t?"":t+""))}function Pe(){for(var t=this._name,n=this._id,e=ze(),r=this._groups,i=r.length,o=0;i>o;++o)for(var u,a=r[o],s=a.length,l=0;s>l;++l)if(u=a[l]){var c=Jt(u,n);Bt(u,t,e,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Ce(r,this._parents,t,e)}function Ce(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function qe(t){return Pt().transition(t)}function ze(){return++_i}function Te(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}function Ie(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return ki.time=Xt(),ki;return e}function Oe(t){var n,e;t instanceof Ce?(n=t._id,t=t._name):(n=ze(),(e=ki).time=Xt(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;i>o;++o)for(var u,a=r[o],s=a.length,l=0;s>l;++l)(u=a[l])&&Bt(u,t,n,l,a,e||Ie(u,n));return new Ce(r,this._parents,t,n)}function Xe(t,n){return n>t?-1:t>n?1:t>=n?0:NaN}function Ve(t){return 1===t.length&&(t=je(t)),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);i>r;){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);i>r;){var o=r+i>>>1;t(n[o],e)>0?i=o:r=o+1}return r}}}function je(t){return function(n,e){return Xe(t(n),e)}}function Le(t,n){var e,r,i=-1,o=t.length;if(null==n){for(;++i<o;)if(null!=(r=t[i])&&r>=r){e=r;break}for(;++i<o;)null!=(r=t[i])&&r>e&&(e=r)}else{for(;++i<o;)if(null!=(r=n(t[i],i,t))&&r>=r){e=r;break}for(;++i<o;)null!=(r=n(t[i],i,t))&&r>e&&(e=r)}return e}function De(t,n){var e,r,i=-1,o=t.length;if(null==n){for(;++i<o;)if(null!=(r=t[i])&&r>=r){e=r;break}for(;++i<o;)null!=(r=t[i])&&e>r&&(e=r)}else{for(;++i<o;)if(null!=(r=n(t[i],i,t))&&r>=r){e=r;break}for(;++i<o;)null!=(r=n(t[i],i,t))&&e>r&&(e=r)}return e}function He(t,n){var e,r=0,i=t.length,o=-1;if(null==n)for(;++o<i;)(e=+t[o])&&(r+=e);else for(;++o<i;)(e=+n(t[o],o,t))&&(r+=e);return r}function Re(t){return function(){return t}}function $e(t){return void 0===t?t="undefined":"string"==typeof t||t instanceof String||(t=JSON.stringify(t)),t}function Ye(t){return $e(t).match(Ei)}function Fe(t,n){void 0===n&&(n={"font-size":10,"font-family":"sans-serif"});var e=document.createElement("canvas").getContext("2d"),r=[];if("font-style"in n&&r.push(n["font-style"]),"font-variant"in n&&r.push(n["font-variant"]),"font-weight"in n&&r.push(n["font-weight"]),"font-size"in n){var i=n["font-size"]+"px";"line-height"in n&&(i+="/"+n["line-height"]+"px"),r.push(i)}return"font-family"in n&&r.push(n["font-family"]),e.font=r.join(" "),t instanceof Array?t.map(function(t){return e.measureText(t).width}):e.measureText(t).width}function Be(){function t(t){t=$e(t),void 0===n&&(n=Math.ceil(1.1*r));for(var s=u(t),l={"font-family":e,"font-size":r,"line-height":n},c=1,f="",h=!1,p=0,d=[""],g=Fe(s,l),y=Fe(" ",l),v=0;v<s.length;v++){var m=s[v],_=t.charAt(f.length+m.length),w=g[s.indexOf(m)];if(" "===_&&(m+=_),p+w>a-r){if(d[c-1]=d[c-1].trimRight(),c++,n*c>i||w>a&&!o){h=!0;break}p=0,d.push(m)}else d[c-1]+=m;f+=m,p+=w," "===_&&(p+=y)}return{lines:d,sentence:t,truncated:h,words:s}}var n,e="sans-serif",r=10,i=200,o=!1,u=Ye,a=200;return t.fontFamily=function(n){return arguments.length?(e=n,t):e},t.fontSize=function(n){return arguments.length?(r=n,t):r},t.height=function(n){return arguments.length?(i=n,t):i},t.lineHeight=function(e){return arguments.length?(n=e,t):n},t.overflow=function(n){return arguments.length?(o=n,t):o},t.split=function(n){return arguments.length?(u=n,t):u},t.width=function(n){return arguments.length?(a=n,t):a},t}function Ue(t){return t.height||200}function We(t,n){return t.id||""+n}function Je(t){return t.text}function Ke(t){return t.width||200}function Ge(t){return t.x||0}function Qe(t){return t.y||0}function Ze(t){function n(t){return t+"..."}function e(n){void 0===o&&e.select(Pi.select("body").append("svg").style("width",window.innerWidth+"px").style("height",window.innerHeight+"px").node()),void 0===i&&(i=function(t,n){return 1.1*p(t,n)});var N=o.selectAll(".d3plus-text-box").data(t,g);return N.exit().remove(),N.enter().append("text").attr("class","d3plus-text-box").attr("id",function(t,n){return"d3plus-text-box-"+g(t,n)}).merge(N).attr("y",function(t,n){return M(t,n)+"px"}).attr("fill",function(t,n){return r(t,n)}).attr("text-anchor",function(t,n){return _(t,n)}).attr("font-family",function(t,n){return l(t,n)}).each(function(t,n){function e(){if(P>M)return void(k=[]);M>E&&(M=E),g&&(N=1.1*M,V.fontSize(M).lineHeight(N),S["font-size"]=M,S["line-height"]=N);var t=V(q);k=t.lines,A=k.length+1,t.truncated&&(g?(M--,P>M?k=[]:e()):2!==A||k[A-2].length?k[A-2]=s(k[A-2]):k=[])}function r(e){e.text(function(t){return t.trimRight()}).attr("x",x(t,n)+"px").attr("dx",X+"px").attr("dy",N+"px")}var o,g=h(t,n),M=g?c(t,n):p(t,n),N=g?1.1*M:i(t,n),A=1,k=[""],S={"font-family":l(t,n),"font-size":M,"line-height":N},E=c(t,n),P=f(t,n),C=d(t,n),q=m(t,n),z=_(t,n),T=w(t,n),I=b(t,n),O=v(q,n),X="start"===z?0:"end"===z?I:I/2,V=Be().fontFamily(S["font-family"]).fontSize(M).lineHeight(N).height(C).overflow(y(t,n)).width(I);if(C>N||g){if(g){o=Fe(O,S);var j=1.165+I/C*.1,L=I*C,D=Pi.max(o),H=Pi.sum(o,function(t){return t*N})*j;if(D>I||H>L){var R=Math.sqrt(L/H),$=I/D,Y=Pi.min([R,$]);M=Math.floor(M*Y)}var F=Math.floor(.8*C);M>F&&(M=F)}e(),Pi.select(this).attr("font-size",M+"px").style("font-size",M+"px")}var B=A*N,U="top"===T?0:"middle"===T?C/2-B/2:C-B;U-=.2*N,Pi.select(this).transition().duration(a).attr("transform","translate(0,"+U+")");var W=Pi.select(this).selectAll("tspan").data(k);W.transition().duration(a).call(r),W.exit().transition().duration(a).attr("opacity",0).remove(),W.enter().append("tspan").attr("dominant-baseline","alphabetic").style("baseline-shift","0%").attr("opacity",0).call(r).transition().duration(a).delay(u).attr("opacity",1)}),n&&setTimeout(n,a+100),e}void 0===t&&(t=[]);var r,i,o,u=0,a=0,s=n,l=Re("sans-serif"),c=Re(50),f=Re(8),h=Re(!1),p=Re(10),d=Ue,g=We,y=Re(!1),v=Ye,m=Je,_=Re("start"),w=Re("top"),b=Ke,x=Ge,M=Qe;return e.data=function(n){return arguments.length?(t=n,e):t},e.delay=function(t){return arguments.length?(u=t,e):u},e.duration=function(t){return arguments.length?(a=t,e):a},e.ellipsis=function(t){return arguments.length?(s="function"==typeof t?t:Re(t),e):s},e.fontColor=function(t){return arguments.length?(r="function"==typeof t?t:Re(t),e):r},e.fontFamily=function(t){return arguments.length?(l="function"==typeof t?t:Re(t),e):l},e.fontMax=function(t){return arguments.length?(c="function"==typeof t?t:Re(t),e):c},e.fontMin=function(t){return arguments.length?(f="function"==typeof t?t:Re(t),
e):f},e.fontResize=function(t){return arguments.length?(h="function"==typeof t?t:Re(t),e):h},e.fontSize=function(t){return arguments.length?(p="function"==typeof t?t:Re(t),e):p},e.height=function(t){return arguments.length?(d="function"==typeof t?t:Re(t),e):d},e.id=function(t){return arguments.length?(g="function"==typeof t?t:Re(t),e):g},e.lineHeight=function(t){return arguments.length?(i="function"==typeof t?t:Re(t),e):i},e.overflow=function(t){return arguments.length?(y="function"==typeof t?t:Re(t),e):y},e.select=function(t){return arguments.length?(o=Pi.select(t),void 0===r&&e.fontColor(o.style("font-color")),void 0===l&&e.fontFamily(o.style("font-family")),void 0===p&&e.fontSize(parseFloat(o.style("font-size"),10)),e):o},e.split=function(t){return arguments.length?(v=t,e):v},e.text=function(t){return arguments.length?(m="function"==typeof t?t:Re(t),e):m},e.textAnchor=function(t){return arguments.length?(_="function"==typeof t?t:Re(t),e):_},e.verticalAlign=function(t){return arguments.length?(w="function"==typeof t?t:Re(t),e):w},e.width=function(t){return arguments.length?(b="function"==typeof t?t:Re(t),e):b},e.x=function(t){return arguments.length?(x="function"==typeof t?t:Re(t),e):x},e.y=function(t){return arguments.length?(M="function"==typeof t?t:Re(t),e):M},t.length?e():e}var tr="0.4.5",nr="http://www.w3.org/1999/xhtml",er={svg:"http://www.w3.org/2000/svg",xhtml:nr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},rr=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var ir=document.documentElement;if(!ir.matches){var or=ir.webkitMatchesSelector||ir.msMatchesSelector||ir.mozMatchesSelector||ir.oMatchesSelector;rr=function(t){return function(){return or.call(this,t)}}}}var ur=rr,ar={},sr=null;if("undefined"!=typeof document){var lr=document.documentElement;"onmouseenter"in lr||(ar={mouseenter:"mouseover",mouseleave:"mouseout"})}var cr="$";b.prototype={constructor:b,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)}},Q.prototype={add:function(t){var n=this._names.indexOf(t);0>n&&(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 fr=[null];Et.prototype=Pt.prototype={constructor:Et,select:p,selectAll:g,filter:y,data:w,enter:M,exit:N,merge:A,order:k,sort:S,call:P,nodes:C,node:q,size:z,empty:T,each:I,attr:H,style:F,property:J,classed:it,text:st,html:ht,raise:dt,lower:yt,append:wt,remove:xt,datum:Mt,on:c,dispatch:St};var hr=("undefined"!=typeof navigator&&/WebKit/.test(navigator.userAgent)?-1:0,{value:function(){}});zt.prototype=qt.prototype={constructor:zt,on:function(t,n){var e,r=this._,i=Tt(t+"",r),o=-1,u=i.length;{if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error;for(;++o<u;)if(e=(t=i[o]).type)r[e]=Ot(r[e],t.name,n);else if(null==n)for(e in r)r[e]=Ot(r[e],t.name,null);return this}for(;++o<u;)if((e=(t=i[o]).type)&&(e=It(r[e],t.name)))return e}},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new zt(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r=new Array(e),i=0;e>i;++i)r[i]=arguments[i+2];this.apply(t,n,r)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error;for(var r=this._[t],i=0,o=r.length;o>i;++i)r[i].value.apply(n,e)}};var pr,dr,gr=0,yr=0,vr=0,mr=1e3,_r=0,wr=0,br=0,xr="object"==typeof performance?performance:Date,Mr="function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){return setTimeout(t,17)};jt.prototype=Lt.prototype={constructor:jt,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Xt():+e)+(null==n?0:+n),this._call||(dr?dr._next=this:pr=this,dr=this),this._call=t,this._time=e,Yt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Yt())}};var Nr=qt("start","end","interrupt"),Ar=[],kr=0,Sr=1,Er=2,Pr=3,Cr=4,qr=5,zr=.7,Tr=1/zr,Ir=/^#([0-9a-f]{3})$/,Or=/^#([0-9a-f]{6})$/,Xr=/^rgb\(\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*\)$/,Vr=/^rgb\(\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*\)$/,jr=/^rgba\(\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*,\s*([-+]?\d+(?:\.\d+)?)\s*\)$/,Lr=/^rgba\(\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)\s*\)$/,Dr=/^hsl\(\s*([-+]?\d+(?:\.\d+)?)\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*\)$/,Hr=/^hsla\(\s*([-+]?\d+(?:\.\d+)?)\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)\s*\)$/,Rr={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};Qt(tn,nn,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),Qt(an,un,Zt(tn,{brighter:function(t){return t=null==t?Tr:Math.pow(Tr,t),new an(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?zr:Math.pow(zr,t),new an(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(1===t?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),Qt(fn,cn,Zt(tn,{brighter:function(t){return t=null==t?Tr:Math.pow(Tr,t),new fn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?zr:Math.pow(zr,t),new fn(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+(.5>e?e:1-e)*n,i=2*e-r;return new an(hn(t>=240?t-240:t+120,i,r),hn(t,i,r),hn(120>t?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}}));var $r=Math.PI/180,Yr=180/Math.PI,Fr=18,Br=.95047,Ur=1,Wr=1.08883,Jr=4/29,Kr=6/29,Gr=3*Kr*Kr,Qr=Kr*Kr*Kr;Qt(gn,dn,Zt(tn,{brighter:function(t){return new gn(this.l+Fr*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new gn(this.l-Fr*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=Ur*vn(t),n=Br*vn(n),e=Wr*vn(e),new an(mn(3.2404542*n-1.5371385*t-.4985314*e),mn(-.969266*n+1.8760108*t+.041556*e),mn(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),Qt(xn,bn,Zt(tn,{brighter:function(t){return new xn(this.h,this.c,this.l+Fr*(null==t?1:t),this.opacity)},darker:function(t){return new xn(this.h,this.c,this.l-Fr*(null==t?1:t),this.opacity)},rgb:function(){return pn(this).rgb()}}));var Zr=-.14861,ti=1.78277,ni=-.29227,ei=-.90649,ri=1.97294,ii=ri*ei,oi=ri*ti,ui=ti*ni-ei*Zr;Qt(An,Nn,Zt(tn,{brighter:function(t){return t=null==t?Tr:Math.pow(Tr,t),new An(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?zr:Math.pow(zr,t),new An(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*$r,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new an(255*(n+e*(Zr*r+ti*i)),255*(n+e*(ni*r+ei*i)),255*(n+e*(ri*r)),this.opacity)}}));var ai,si,li,ci,fi=function Ci(t){function n(t,n){var r=e((t=un(t)).r,(n=un(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),u=e(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+""}}var e=Cn(t);return n.gamma=Ci,n}(1),hi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pi=new RegExp(hi.source,"g"),di=180/Math.PI,gi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},yi=Ln(Vn,"px, ","px)","deg)"),vi=Ln(jn,", ",")",")");!function qi(t){function n(n,e){var r=Pn((n=Nn(n)).h,(e=Nn(e)).h),i=qn(n.s,e.s),o=qn(n.l,e.l),u=qn(n.opacity,e.opacity);return function(e){return n.h=r(e),n.s=i(e),n.l=o(Math.pow(e,t)),n.opacity=u(e),n+""}}return t=+t,n.gamma=qi,n}(1),function zi(t){function n(n,e){var r=qn((n=Nn(n)).h,(e=Nn(e)).h),i=qn(n.s,e.s),o=qn(n.l,e.l),u=qn(n.opacity,e.opacity);return function(e){return n.h=r(e),n.s=i(e),n.l=o(Math.pow(e,t)),n.opacity=u(e),n+""}}return t=+t,n.gamma=zi,n}(1);var mi=Pt.prototype.constructor,_i=0,wi=Pt.prototype;Ce.prototype=qe.prototype={constructor:Ce,select:ye,selectAll:ve,filter:le,merge:ce,selection:me,transition:Pe,call:wi.call,nodes:wi.nodes,node:wi.node,size:wi.size,empty:wi.empty,each:wi.each,on:pe,attr:Gn,attrTween:te,style:Me,styleTween:Ae,text:Ee,remove:ge,tween:Rn,delay:re,duration:ue,ease:se};var bi=3,xi=(function Ti(t){function n(n){return Math.pow(n,t)}return t=+t,n.exponent=Ti,n}(bi),function Ii(t){function n(n){return 1-Math.pow(1-n,t)}return t=+t,n.exponent=Ii,n}(bi),function Oi(t){function n(n){return((n*=2)<=1?Math.pow(n,t):2-Math.pow(2-n,t))/2}return t=+t,n.exponent=Oi,n}(bi),1.70158),Mi=(function Xi(t){function n(n){return n*n*((t+1)*n-t)}return t=+t,n.overshoot=Xi,n}(xi),function Vi(t){function n(n){return--n*n*((t+1)*n+t)+1}return t=+t,n.overshoot=Vi,n}(xi),function ji(t){function n(n){return((n*=2)<1?n*n*((t+1)*n-t):(n-=2)*n*((t+1)*n+t)+2)/2}return t=+t,n.overshoot=ji,n}(xi),2*Math.PI),Ni=1,Ai=.3,ki=(function Li(t,n){function e(e){return t*Math.pow(2,10*--e)*Math.sin((r-e)/n)}var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Mi);return e.amplitude=function(t){return Li(t,n*Mi)},e.period=function(n){return Li(t,n)},e}(Ni,Ai),function Di(t,n){function e(e){return 1-t*Math.pow(2,-10*(e=+e))*Math.sin((e+r)/n)}var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Mi);return e.amplitude=function(t){return Di(t,n*Mi)},e.period=function(n){return Di(t,n)},e}(Ni,Ai),function Hi(t,n){function e(e){return((e=2*e-1)<0?t*Math.pow(2,10*e)*Math.sin((r-e)/n):2-t*Math.pow(2,-10*e)*Math.sin((r+e)/n))/2}var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Mi);return e.amplitude=function(t){return Hi(t,n*Mi)},e.period=function(n){return Hi(t,n)},e}(Ni,Ai),{time:null,delay:0,duration:250,ease:Te});Pt.prototype.interrupt=Gt,Pt.prototype.transition=Oe;var Si=(Ve(Xe),["-","/",";",":","&"]),Ei=new RegExp("[^\\s\\"+Si.join("\\")+"]+\\"+Si.join("?\\")+"?","g"),Pi={max:Le,min:De,select:Ct,sum:He,transition:qe};t.version=tr,t.box=Ze,t.split=Ye,t.stringify=$e,t.width=Fe,t.wrap=Be});

@@ -7,3 +7,3 @@ (function (global, factory) {

var version = "0.4.4";
var version = "0.4.5";

@@ -136,3 +136,3 @@ /**

"lines": lineData,
sentence: sentence, truncated: truncated
sentence: sentence, truncated: truncated, words: words
};

@@ -329,3 +329,3 @@

if (select === void 0) box.select(d3.select("body").append("svg").style("width", ((window.innerWidth) + "px")).style("height", ((window.innerHeight) + "px")).node());
if (lineHeight === void 0) lineHeight = constant(Math.ceil(fontSize() * 1.1));
if (lineHeight === void 0) lineHeight = function (d, i) { return fontSize(d, i) * 1.1; };

@@ -332,0 +332,0 @@ var boxes = select.selectAll(".d3plus-text-box").data(data, id);

@@ -1,1 +0,1 @@

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-selection"),require("d3-transition"),require("d3-array")):"function"==typeof define&&define.amd?define("d3plus-text",["exports","d3-selection","d3-transition","d3-array"],n):n(t.d3plus_text=t.d3plus_text||{},t.d3_selection,t.d3_transition,t.d3_array)}(this,function(t,n,e,i){"use strict";function r(t){return function(){return t}}function o(t){return void 0===t?t="undefined":"string"==typeof t||t instanceof String||(t=JSON.stringify(t)),t}function f(t){return o(t).match(m)}function u(t,n){void 0===n&&(n={"font-size":10,"font-family":"sans-serif"});var e=document.createElement("canvas").getContext("2d"),i=[];if("font-style"in n&&i.push(n["font-style"]),"font-variant"in n&&i.push(n["font-variant"]),"font-weight"in n&&i.push(n["font-weight"]),"font-size"in n){var r=n["font-size"]+"px";"line-height"in n&&(r+="/"+n["line-height"]+"px"),i.push(r)}return"font-family"in n&&i.push(n["font-family"]),e.font=i.join(" "),t instanceof Array?t.map(function(t){return e.measureText(t).width}):e.measureText(t).width}function a(){function t(t){t=o(t),void 0===n&&(n=Math.ceil(1.1*i));for(var f=l(t),s={"font-family":e,"font-size":i,"line-height":n},h=1,d="",p=!1,g=0,y=[""],x=u(f,s),m=u(" ",s),v=0;v<f.length;v++){var w=f[v],z=t.charAt(d.length+w.length),b=x[f.indexOf(w)];if(" "===z&&(w+=z),g+b>c-i){if(y[h-1]=y[h-1].trimRight(),h++,n*h>r||b>c&&!a){p=!0;break}g=0,y.push(w)}else y[h-1]+=w;d+=w,g+=b," "===z&&(g+=m)}return{lines:y,sentence:t,truncated:p}}var n,e="sans-serif",i=10,r=200,a=!1,l=f,c=200;return t.fontFamily=function(n){return arguments.length?(e=n,t):e},t.fontSize=function(n){return arguments.length?(i=n,t):i},t.height=function(n){return arguments.length?(r=n,t):r},t.lineHeight=function(e){return arguments.length?(n=e,t):n},t.overflow=function(n){return arguments.length?(a=n,t):a},t.split=function(n){return arguments.length?(l=n,t):l},t.width=function(n){return arguments.length?(c=n,t):c},t}function l(t){return t.height||200}function c(t,n){return t.id||""+n}function s(t){return t.text}function h(t){return t.width||200}function d(t){return t.x||0}function p(t){return t.y||0}function g(t){function n(t){return t+"..."}function e(n){void 0===g&&e.select(v.select("body").append("svg").style("width",window.innerWidth+"px").style("height",window.innerHeight+"px").node()),void 0===o&&(o=r(Math.ceil(1.1*S())));var f=g.selectAll(".d3plus-text-box").data(t,F);return f.exit().remove(),f.enter().append("text").attr("class","d3plus-text-box").attr("id",function(t,n){return"d3plus-text-box-"+F(t,n)}).merge(f).attr("y",function(t,n){return E(t,n)+"px"}).attr("fill",function(t,n){return i(t,n)}).attr("text-anchor",function(t,n){return q(t,n)}).attr("font-family",function(t,n){return w(t,n)}).each(function(t,n){function e(){if(g>l)return void(h=[]);l>p&&(l=p),f&&(c=1.1*l,B.fontSize(l).lineHeight(c),d["font-size"]=l,d["line-height"]=c);var t=B(E);h=t.lines,s=h.length+1,t.truncated&&(f?(l--,g>l?h=[]:e()):2!==s||h[s-2].length?h[s-2]=m(h[s-2]):h=[])}function i(e){e.text(function(t){return t.trimRight()}).attr("x",T(t,n)+"px").attr("dx",W+"px").attr("dy",c+"px")}var r,f=M(t,n),l=f?z(t,n):S(t,n),c=f?1.1*l:o(t,n),s=1,h=[""],d={"font-family":w(t,n),"font-size":l,"line-height":c},p=z(t,n),g=b(t,n),F=A(t,n),E=j(t,n),O=q(t,n),k=R(t,n),J=C(t,n),N=_(E,n),W="start"===O?0:"end"===O?J:J/2,B=a().fontFamily(d["font-family"]).fontSize(l).lineHeight(c).height(F).overflow(H(t,n)).width(J);if(F>c||f){if(f){r=u(N,d);var D=1.165+J/F*.1,G=J*F,I=v.max(r),K=v.sum(r,function(t){return t*c})*D;if(I>J||K>G){var L=Math.sqrt(G/K),P=J/I,Q=v.min([L,P]);l=Math.floor(l*Q)}var U=Math.floor(.8*F);l>U&&(l=U)}e(),v.select(this).attr("font-size",l+"px").style("font-size",l+"px")}var V=s*c,X="top"===k?0:"middle"===k?F/2-V/2:F-V;X-=.2*c,v.select(this).transition().duration(x).attr("transform","translate(0,"+X+")");var Y=v.select(this).selectAll("tspan").data(h);Y.transition().duration(x).call(i),Y.exit().transition().duration(x).attr("opacity",0).remove(),Y.enter().append("tspan").attr("dominant-baseline","alphabetic").style("baseline-shift","0%").attr("opacity",0).call(i).transition().duration(x).delay(y).attr("opacity",1)}),n&&setTimeout(n,x+100),e}void 0===t&&(t=[]);var i,o,g,y=0,x=0,m=n,w=r("sans-serif"),z=r(50),b=r(8),M=r(!1),S=r(10),A=l,F=c,H=r(!1),_=f,j=s,q=r("start"),R=r("top"),C=h,T=d,E=p;return e.data=function(n){return arguments.length?(t=n,e):t},e.delay=function(t){return arguments.length?(y=t,e):y},e.duration=function(t){return arguments.length?(x=t,e):x},e.ellipsis=function(t){return arguments.length?(m="function"==typeof t?t:r(t),e):m},e.fontColor=function(t){return arguments.length?(i="function"==typeof t?t:r(t),e):i},e.fontFamily=function(t){return arguments.length?(w="function"==typeof t?t:r(t),e):w},e.fontMax=function(t){return arguments.length?(z="function"==typeof t?t:r(t),e):z},e.fontMin=function(t){return arguments.length?(b="function"==typeof t?t:r(t),e):b},e.fontResize=function(t){return arguments.length?(M="function"==typeof t?t:r(t),e):M},e.fontSize=function(t){return arguments.length?(S="function"==typeof t?t:r(t),e):S},e.height=function(t){return arguments.length?(A="function"==typeof t?t:r(t),e):A},e.id=function(t){return arguments.length?(F="function"==typeof t?t:r(t),e):F},e.lineHeight=function(t){return arguments.length?(o="function"==typeof t?t:r(t),e):o},e.overflow=function(t){return arguments.length?(H="function"==typeof t?t:r(t),e):H},e.select=function(t){return arguments.length?(g=v.select(t),void 0===i&&e.fontColor(g.style("font-color")),void 0===w&&e.fontFamily(g.style("font-family")),void 0===S&&e.fontSize(parseFloat(g.style("font-size"),10)),e):g},e.split=function(t){return arguments.length?(_=t,e):_},e.text=function(t){return arguments.length?(j="function"==typeof t?t:r(t),e):j},e.textAnchor=function(t){return arguments.length?(q="function"==typeof t?t:r(t),e):q},e.verticalAlign=function(t){return arguments.length?(R="function"==typeof t?t:r(t),e):R},e.width=function(t){return arguments.length?(C="function"==typeof t?t:r(t),e):C},e.x=function(t){return arguments.length?(T="function"==typeof t?t:r(t),e):T},e.y=function(t){return arguments.length?(E="function"==typeof t?t:r(t),e):E},t.length?e():e}var y="0.4.4",x=["-","/",";",":","&"],m=new RegExp("[^\\s\\"+x.join("\\")+"]+\\"+x.join("?\\")+"?","g"),v={max:i.max,min:i.min,select:n.select,sum:i.sum,transition:e.transition};t.version=y,t.box=g,t.split=f,t.stringify=o,t.width=u,t.wrap=a});
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-selection"),require("d3-transition"),require("d3-array")):"function"==typeof define&&define.amd?define("d3plus-text",["exports","d3-selection","d3-transition","d3-array"],n):n(t.d3plus_text=t.d3plus_text||{},t.d3_selection,t.d3_transition,t.d3_array)}(this,function(t,n,e,i){"use strict";function r(t){return function(){return t}}function o(t){return void 0===t?t="undefined":"string"==typeof t||t instanceof String||(t=JSON.stringify(t)),t}function f(t){return o(t).match(m)}function u(t,n){void 0===n&&(n={"font-size":10,"font-family":"sans-serif"});var e=document.createElement("canvas").getContext("2d"),i=[];if("font-style"in n&&i.push(n["font-style"]),"font-variant"in n&&i.push(n["font-variant"]),"font-weight"in n&&i.push(n["font-weight"]),"font-size"in n){var r=n["font-size"]+"px";"line-height"in n&&(r+="/"+n["line-height"]+"px"),i.push(r)}return"font-family"in n&&i.push(n["font-family"]),e.font=i.join(" "),t instanceof Array?t.map(function(t){return e.measureText(t).width}):e.measureText(t).width}function a(){function t(t){t=o(t),void 0===n&&(n=Math.ceil(1.1*i));for(var f=l(t),s={"font-family":e,"font-size":i,"line-height":n},h=1,d="",p=!1,g=0,y=[""],x=u(f,s),m=u(" ",s),v=0;v<f.length;v++){var w=f[v],z=t.charAt(d.length+w.length),b=x[f.indexOf(w)];if(" "===z&&(w+=z),g+b>c-i){if(y[h-1]=y[h-1].trimRight(),h++,n*h>r||b>c&&!a){p=!0;break}g=0,y.push(w)}else y[h-1]+=w;d+=w,g+=b," "===z&&(g+=m)}return{lines:y,sentence:t,truncated:p,words:f}}var n,e="sans-serif",i=10,r=200,a=!1,l=f,c=200;return t.fontFamily=function(n){return arguments.length?(e=n,t):e},t.fontSize=function(n){return arguments.length?(i=n,t):i},t.height=function(n){return arguments.length?(r=n,t):r},t.lineHeight=function(e){return arguments.length?(n=e,t):n},t.overflow=function(n){return arguments.length?(a=n,t):a},t.split=function(n){return arguments.length?(l=n,t):l},t.width=function(n){return arguments.length?(c=n,t):c},t}function l(t){return t.height||200}function c(t,n){return t.id||""+n}function s(t){return t.text}function h(t){return t.width||200}function d(t){return t.x||0}function p(t){return t.y||0}function g(t){function n(t){return t+"..."}function e(n){void 0===g&&e.select(v.select("body").append("svg").style("width",window.innerWidth+"px").style("height",window.innerHeight+"px").node()),void 0===o&&(o=function(t,n){return 1.1*A(t,n)});var r=g.selectAll(".d3plus-text-box").data(t,F);return r.exit().remove(),r.enter().append("text").attr("class","d3plus-text-box").attr("id",function(t,n){return"d3plus-text-box-"+F(t,n)}).merge(r).attr("y",function(t,n){return E(t,n)+"px"}).attr("fill",function(t,n){return i(t,n)}).attr("text-anchor",function(t,n){return q(t,n)}).attr("font-family",function(t,n){return w(t,n)}).each(function(t,n){function e(){if(g>l)return void(h=[]);l>p&&(l=p),f&&(c=1.1*l,B.fontSize(l).lineHeight(c),d["font-size"]=l,d["line-height"]=c);var t=B(E);h=t.lines,s=h.length+1,t.truncated&&(f?(l--,g>l?h=[]:e()):2!==s||h[s-2].length?h[s-2]=m(h[s-2]):h=[])}function i(e){e.text(function(t){return t.trimRight()}).attr("x",T(t,n)+"px").attr("dx",W+"px").attr("dy",c+"px")}var r,f=S(t,n),l=f?z(t,n):A(t,n),c=f?1.1*l:o(t,n),s=1,h=[""],d={"font-family":w(t,n),"font-size":l,"line-height":c},p=z(t,n),g=b(t,n),F=M(t,n),E=j(t,n),O=q(t,n),k=R(t,n),J=C(t,n),N=_(E,n),W="start"===O?0:"end"===O?J:J/2,B=a().fontFamily(d["font-family"]).fontSize(l).lineHeight(c).height(F).overflow(H(t,n)).width(J);if(F>c||f){if(f){r=u(N,d);var D=1.165+J/F*.1,G=J*F,I=v.max(r),K=v.sum(r,function(t){return t*c})*D;if(I>J||K>G){var L=Math.sqrt(G/K),P=J/I,Q=v.min([L,P]);l=Math.floor(l*Q)}var U=Math.floor(.8*F);l>U&&(l=U)}e(),v.select(this).attr("font-size",l+"px").style("font-size",l+"px")}var V=s*c,X="top"===k?0:"middle"===k?F/2-V/2:F-V;X-=.2*c,v.select(this).transition().duration(x).attr("transform","translate(0,"+X+")");var Y=v.select(this).selectAll("tspan").data(h);Y.transition().duration(x).call(i),Y.exit().transition().duration(x).attr("opacity",0).remove(),Y.enter().append("tspan").attr("dominant-baseline","alphabetic").style("baseline-shift","0%").attr("opacity",0).call(i).transition().duration(x).delay(y).attr("opacity",1)}),n&&setTimeout(n,x+100),e}void 0===t&&(t=[]);var i,o,g,y=0,x=0,m=n,w=r("sans-serif"),z=r(50),b=r(8),S=r(!1),A=r(10),M=l,F=c,H=r(!1),_=f,j=s,q=r("start"),R=r("top"),C=h,T=d,E=p;return e.data=function(n){return arguments.length?(t=n,e):t},e.delay=function(t){return arguments.length?(y=t,e):y},e.duration=function(t){return arguments.length?(x=t,e):x},e.ellipsis=function(t){return arguments.length?(m="function"==typeof t?t:r(t),e):m},e.fontColor=function(t){return arguments.length?(i="function"==typeof t?t:r(t),e):i},e.fontFamily=function(t){return arguments.length?(w="function"==typeof t?t:r(t),e):w},e.fontMax=function(t){return arguments.length?(z="function"==typeof t?t:r(t),e):z},e.fontMin=function(t){return arguments.length?(b="function"==typeof t?t:r(t),e):b},e.fontResize=function(t){return arguments.length?(S="function"==typeof t?t:r(t),e):S},e.fontSize=function(t){return arguments.length?(A="function"==typeof t?t:r(t),e):A},e.height=function(t){return arguments.length?(M="function"==typeof t?t:r(t),e):M},e.id=function(t){return arguments.length?(F="function"==typeof t?t:r(t),e):F},e.lineHeight=function(t){return arguments.length?(o="function"==typeof t?t:r(t),e):o},e.overflow=function(t){return arguments.length?(H="function"==typeof t?t:r(t),e):H},e.select=function(t){return arguments.length?(g=v.select(t),void 0===i&&e.fontColor(g.style("font-color")),void 0===w&&e.fontFamily(g.style("font-family")),void 0===A&&e.fontSize(parseFloat(g.style("font-size"),10)),e):g},e.split=function(t){return arguments.length?(_=t,e):_},e.text=function(t){return arguments.length?(j="function"==typeof t?t:r(t),e):j},e.textAnchor=function(t){return arguments.length?(q="function"==typeof t?t:r(t),e):q},e.verticalAlign=function(t){return arguments.length?(R="function"==typeof t?t:r(t),e):R},e.width=function(t){return arguments.length?(C="function"==typeof t?t:r(t),e):C},e.x=function(t){return arguments.length?(T="function"==typeof t?t:r(t),e):T},e.y=function(t){return arguments.length?(E="function"==typeof t?t:r(t),e):E},t.length?e():e}var y="0.4.5",x=["-","/",";",":","&"],m=new RegExp("[^\\s\\"+x.join("\\")+"]+\\"+x.join("?\\")+"?","g"),v={max:i.max,min:i.min,select:n.select,sum:i.sum,transition:e.transition};t.version=y,t.box=g,t.split=f,t.stringify=o,t.width=u,t.wrap=a});
{
"name": "d3plus-text",
"version": "0.4.4",
"version": "0.4.5",
"description": "SVG text functions, including line wrapping with automatic font scaling.",

@@ -39,3 +39,3 @@ "main": "build/d3plus-text.js",

"rollup": "^0.26.0",
"rollup-plugin-buble": "^0.6.0",
"rollup-plugin-buble": "^0.7.0",
"rollup-plugin-json": "^2.0.0",

@@ -42,0 +42,0 @@ "rollup-plugin-node-resolve": "^1.5.0",

@@ -53,3 +53,3 @@ # d3plus-text

### Custom Builds
The source code is written using standard `import` and `export` statements. Create a custom build using [Rollup](https://github.com/rollup/rollup) or your preferred bundler. Take a look at the [index.js](https://github.com/d3plus/d3plus-text/blob/master/index.js) file to see the modules exported.
The source code is written using standard `import` and `export` statements. Create a custom build using [Rollup](https://github.com/rollup/rollup) or your preferred bundler. Take a look at the [index.js](https://github.com/d3plus/d3plus-text/blob/master/index.js) file to see the modules exported.

@@ -56,0 +56,0 @@ ---

@@ -127,3 +127,3 @@ import {select as d3Select} from "d3-selection";

if (select === void 0) box.select(d3.select("body").append("svg").style("width", `${window.innerWidth}px`).style("height", `${window.innerHeight}px`).node());
if (lineHeight === void 0) lineHeight = constant(Math.ceil(fontSize() * 1.1));
if (lineHeight === void 0) lineHeight = (d, i) => fontSize(d, i) * 1.1;

@@ -130,0 +130,0 @@ const boxes = select.selectAll(".d3plus-text-box").data(data, id);

@@ -69,3 +69,3 @@ import {default as measure} from "./width";

"lines": lineData,
sentence, truncated
sentence, truncated, words
};

@@ -72,0 +72,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc