Skip to content

Instantly share code, notes, and snippets.

@micahscopes
Forked from mbostock/.block
Last active March 21, 2017 06:32
Show Gist options
  • Save micahscopes/0481ea69ab0d9310458250fb70bf35e4 to your computer and use it in GitHub Desktop.
Save micahscopes/0481ea69ab0d9310458250fb70bf35e4 to your computer and use it in GitHub Desktop.
D3 rollup-plugin-node-resolve trouble with browser: true and d3-request
license: gpl-3.0
.DS_Store
node_modules
npm-debug.log
d3.js

Another demonstration of a custom D3 bundle using Rollup. This demonstrates importing d3-transition, which modifies selection.prototype to define selection.transition:

import "d3-transition";

(There are other features in d3-transition, but they are not imported here because they are not used.) Note that you must also import selection from d3-selection; otherwise, Rollup doesn’t know that it needs to include the imported code from d3-transition. Rollup isn’t perfect at detecting which code needs to be included (and which code shouldn’t be included), so sometimes you need to give it a hand.

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.d3=t.d3||{})}(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)),Ye.hasOwnProperty(n)?{space:Ye[n],local:t}:t}function e(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===$e&&n.documentElement.namespaceURI===$e?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(n,e,r){return function(i){var o=t.event;t.event=i;try{n.call(this,this.__data__,e,r)}finally{t.event=o}}}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;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?n.length=i:delete this.__on}}}function l(t,n,e){var r=Ue.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,h=s.length;c<h;++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;r<u;++r)this.each(c(o[r],n,e));return this}var c=this.node().__on;if(c)for(var h,f=0,p=c.length;f<p;++f)for(r=0,h=c[f];r<u;++r)if((i=o[r]).type===h.type&&i.name===h.name)return h.value}}function h(){}function f(t){return null==t?h:function(){return this.querySelector(t)}}function p(t){"function"!=typeof t&&(t=f(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u,a=n[i],s=a.length,l=r[i]=new Array(s),c=0;c<s;++c)(o=a[c])&&(u=t.call(o,o.__data__,c,a))&&("__data__"in o&&(u.__data__=o.__data__),l[c]=u);return new Pt(r,this._parents)}function d(){return[]}function y(t){return null==t?d:function(){return this.querySelectorAll(t)}}function v(t){"function"!=typeof t&&(t=y(t));for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var u,a=n[o],s=a.length,l=0;l<s;++l)(u=a[l])&&(r.push(t.call(u,u.__data__,l,a)),i.push(u));return new Pt(r,i)}function _(t){"function"!=typeof t&&(t=He(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],a=u.length,s=r[i]=[],l=0;l<a;++l)(o=u[l])&&t.call(o,o.__data__,l,u)&&s.push(o);return new Pt(r,this._parents)}function g(t){return new Array(t.length)}function m(){return new Pt(this._enter||this._groups.map(g),this._parents)}function w(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function b(t){return function(){return t}}function x(t,n,e,r,i,o){for(var u,a=0,s=n.length,l=o.length;a<l;++a)(u=n[a])?(u.__data__=o[a],r[a]=u):e[a]=new w(t,o[a]);for(;a<s;++a)(u=n[a])&&(i[a]=u)}function M(t,n,e,r,i,o,u){var a,s,l,c={},h=n.length,f=o.length,p=new Array(h);for(a=0;a<h;++a)(s=n[a])&&(p[a]=l=Ge+u.call(s,s.__data__,a,n),l in c?i[a]=s:c[l]=s);for(a=0;a<f;++a)l=Ge+u.call(t,o[a],a,o),(s=c[l])?(r[a]=s,s.__data__=o[a],c[l]=null):e[a]=new w(t,o[a]);for(a=0;a<h;++a)(s=n[a])&&c[p[a]]===s&&(i[a]=s)}function N(t,n){if(!t)return p=new Array(this.size()),l=-1,this.each(function(t){p[++l]=t}),p;var e=n?M:x,r=this._parents,i=this._groups;"function"!=typeof t&&(t=b(t));for(var o=i.length,u=new Array(o),a=new Array(o),s=new Array(o),l=0;l<o;++l){var c=r[l],h=i[l],f=h.length,p=t.call(c,c&&c.__data__,l,r),d=p.length,y=a[l]=new Array(d),v=u[l]=new Array(d),_=s[l]=new Array(f);e(c,h,y,v,_,p,n);for(var g,m,w=0,N=0;w<d;++w)if(g=y[w]){for(w>=N&&(N=w+1);!(m=v[N])&&++N<d;);g._next=m||null}}return u=new Pt(u,r),u._enter=a,u._exit=s,u}function A(){return new Pt(this._exit||this._groups.map(g),this._parents)}function k(t){for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var s,l=n[a],c=e[a],h=l.length,f=u[a]=new Array(h),p=0;p<h;++p)(s=l[p]||c[p])&&(f[p]=s);for(;a<r;++a)u[a]=n[a];return new Pt(u,this._parents)}function E(){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=P);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var u,a=e[o],s=a.length,l=i[o]=new Array(s),c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(n)}return new Pt(i,this._parents).order()}function P(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function q(){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 I(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var u=r[i];if(u)return u}return null}function O(){var t=0;return this.each(function(){++t}),t}function X(){return!this.node()}function T(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],u=0,a=o.length;u<a;++u)(i=o[u])&&t.call(i,i.__data__,u,o);return this}function V(t){return function(){this.removeAttribute(t)}}function L(t){return function(){this.removeAttributeNS(t.space,t.local)}}function j(t,n){return function(){this.setAttribute(t,n)}}function D(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function $(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function Y(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 z(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?L:V:"function"==typeof e?r.local?Y:$:r.local?D:j)(r,e))}function B(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function R(t){return function(){this.style.removeProperty(t)}}function H(t,n,e){return function(){this.style.setProperty(t,n,e)}}function U(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?U:H)(t,n,null==e?"":e)):B(r=this.node()).getComputedStyle(r,null).getPropertyValue(t)}function G(t){return function(){delete this[t]}}function J(t,n){return function(){this[t]=n}}function K(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function Q(t,n){return arguments.length>1?this.each((null==n?G:"function"==typeof n?K:J)(t,n)):this.node()[t]}function W(t){return t.trim().split(/^|\s+/)}function Z(t){return t.classList||new tt(t)}function tt(t){this._node=t,this._names=W(t.getAttribute("class")||"")}function nt(t,n){for(var e=Z(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function et(t,n){for(var e=Z(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function rt(t){return function(){nt(this,t)}}function it(t){return function(){et(this,t)}}function ot(t,n){return function(){(n.apply(this,arguments)?nt:et)(this,t)}}function ut(t,n){var e=W(t+"");if(arguments.length<2){for(var r=Z(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?ot:n?rt:it)(e,n))}function at(){this.textContent=""}function st(t){return function(){this.textContent=t}}function lt(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function ct(t){return arguments.length?this.each(null==t?at:("function"==typeof t?lt:st)(t)):this.node().textContent}function ht(){this.innerHTML=""}function ft(t){return function(){this.innerHTML=t}}function pt(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function dt(t){return arguments.length?this.each(null==t?ht:("function"==typeof t?pt:ft)(t)):this.node().innerHTML}function yt(){this.nextSibling&&this.parentNode.appendChild(this)}function vt(){return this.each(yt)}function _t(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function gt(){return this.each(_t)}function mt(t){var n="function"==typeof t?t:i(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function wt(){return null}function bt(t,n){var e="function"==typeof t?t:i(t),r=null==n?wt:"function"==typeof n?n:f(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})}function xt(){var t=this.parentNode;t&&t.removeChild(this)}function Mt(){return this.each(xt)}function Nt(t){return arguments.length?this.property("__data__",t):this.node().__data__}function At(t,n,e){var r=B(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 kt(t,n){return function(){return At(this,t,n)}}function Et(t,n){return function(){return At(this,t,n.apply(this,arguments))}}function St(t,n){return this.each(("function"==typeof n?Et:kt)(t,n))}function Pt(t,n){this._groups=t,this._parents=n}function qt(){return new Pt([[document.documentElement]],Je)}function Ct(t){return"string"==typeof t?new Pt([[document.querySelector(t)]],[document.documentElement]):new Pt([[t]],Je)}function It(t){return"string"==typeof t?new Pt([document.querySelectorAll(t)],[document.documentElement]):new Pt([null==t?[]:t],Je)}function Ot(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new Xt(r)}function Xt(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("unknown type: "+t);return{type:t,name:e}})}function Vt(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function Lt(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=Ke,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}function jt(){return ir||(ar(Dt),ir=ur.now()+or)}function Dt(){ir=0}function $t(){this._call=this._time=this._next=null}function Yt(t,n,e){var r=new $t;return r.restart(t,n,e),r}function zt(){jt(),++Ze;for(var t,n=Qe;n;)(t=ir-n._time)>=0&&n._call.call(null,t),n=n._next;--Ze}function Bt(){ir=(rr=ur.now())+or,Ze=tr=0;try{zt()}finally{Ze=0,Ht(),ir=0}}function Rt(){var t=ur.now(),n=t-rr;n>er&&(or-=n,rr=t)}function Ht(){for(var t,n,e=Qe,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Qe=n);We=t,Ut(r)}function Ut(t){if(!Ze){tr&&(tr=clearTimeout(tr));var n=t-ir;n>24?(t<1/0&&(tr=setTimeout(Bt,n)),nr&&(nr=clearInterval(nr))):(nr||(nr=setInterval(Rt,er)),Ze=1,ar(Bt))}}function Ft(t,n,e){var r=new $t;return n=null==n?0:+n,r.restart(function(e){r.stop(),t(e+n)},n,e),r}function Gt(t,n,e,r,i,o){var u=t.__transition;if(u){if(e in u)return}else t.__transition={};Wt(t,e,{name:n,index:r,group:i,on:sr,tween:lr,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:cr})}function Jt(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>cr)throw new Error("too late");return e}function Kt(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>fr)throw new Error("too late");return e}function Qt(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("too late");return e}function Wt(t,n,e){function r(t){e.state=hr,e.timer.restart(i,e.delay,e.time),e.delay<=t&&i(t-e.delay)}function i(r){var l,c,h,f;if(e.state!==hr)return u();for(l in s)if(f=s[l],f.name===e.name){if(f.state===pr)return Ft(i);f.state===dr?(f.state=vr,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete s[l]):+l<n&&(f.state=vr,f.timer.stop(),delete s[l])}if(Ft(function(){e.state===pr&&(e.state=dr,e.timer.restart(o,e.delay,e.time),o(r))}),e.state=fr,e.on.call("start",t,t.__data__,e.index,e.group),e.state===fr){for(e.state=pr,a=new Array(h=e.tween.length),l=0,c=-1;l<h;++l)(f=e.tween[l].value.call(t,t.__data__,e.index,e.group))&&(a[++c]=f);a.length=c+1}}function o(n){for(var r=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(u),e.state=yr,1),i=-1,o=a.length;++i<o;)a[i].call(null,r);e.state===yr&&(e.on.call("end",t,t.__data__,e.index,e.group),u())}function u(){e.state=vr,e.timer.stop(),delete s[n];for(var r in s)return;delete t.__transition}var a,s=t.__transition;s[n]=e,e.timer=Yt(r,0,e.time)}function Zt(t,n){var e,r,i,o=t.__transition,u=!0;if(o){n=null==n?null:n+"";for(i in o)(e=o[i]).name===n?(r=e.state===pr,e.state=vr,e.timer.stop(),r&&e.on.call("interrupt",t,t.__data__,e.index,e.group),delete o[i]):u=!1;u&&delete t.__transition}}function tn(t){return this.each(function(){Zt(this,t)})}function nn(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function en(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function rn(){}function on(t){var n;return t=(t+"").trim().toLowerCase(),(n=mr.exec(t))?(n=parseInt(n[1],16),new cn(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1)):(n=wr.exec(t))?un(parseInt(n[1],16)):(n=br.exec(t))?new cn(n[1],n[2],n[3],1):(n=xr.exec(t))?new cn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Mr.exec(t))?an(n[1],n[2],n[3],n[4]):(n=Nr.exec(t))?an(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Ar.exec(t))?hn(n[1],n[2]/100,n[3]/100,1):(n=kr.exec(t))?hn(n[1],n[2]/100,n[3]/100,n[4]):Er.hasOwnProperty(t)?un(Er[t]):"transparent"===t?new cn(NaN,NaN,NaN,0):null}function un(t){return new cn(t>>16&255,t>>8&255,255&t,1)}function an(t,n,e,r){return r<=0&&(t=n=e=NaN),new cn(t,n,e,r)}function sn(t){return t instanceof rn||(t=on(t)),t?(t=t.rgb(),new cn(t.r,t.g,t.b,t.opacity)):new cn}function ln(t,n,e,r){return 1===arguments.length?sn(t):new cn(t,n,e,null==r?1:r)}function cn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function hn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new dn(t,n,e,r)}function fn(t){if(t instanceof dn)return new dn(t.h,t.s,t.l,t.opacity);if(t instanceof rn||(t=on(t)),!t)return new dn;if(t instanceof dn)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*(e<r):e===o?(r-n)/a+2:(n-e)/a+4,a/=s<.5?o+i:2-o-i,u*=60):a=s>0&&s<1?0:u,new dn(u,a,s,t.opacity)}function pn(t,n,e,r){return 1===arguments.length?fn(t):new dn(t,n,e,null==r?1:r)}function dn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function yn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function vn(t){if(t instanceof gn)return new gn(t.l,t.a,t.b,t.opacity);if(t instanceof An){var n=t.h*Sr;return new gn(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof cn||(t=sn(t));var e=xn(t.r),r=xn(t.g),i=xn(t.b),o=mn((.4124564*e+.3575761*r+.1804375*i)/Cr),u=mn((.2126729*e+.7151522*r+.072175*i)/Ir),a=mn((.0193339*e+.119192*r+.9503041*i)/Or);return new gn(116*u-16,500*(o-u),200*(u-a),t.opacity)}function _n(t,n,e,r){return 1===arguments.length?vn(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 mn(t){return t>Lr?Math.pow(t,1/3):t/Vr+Xr}function wn(t){return t>Tr?t*t*t:Vr*(t-Xr)}function bn(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function xn(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Mn(t){if(t instanceof An)return new An(t.h,t.c,t.l,t.opacity);t instanceof gn||(t=vn(t));var n=Math.atan2(t.b,t.a)*Pr;return new An(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,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.c=+n,this.l=+e,this.opacity=+r}function kn(t){if(t instanceof Sn)return new Sn(t.h,t.s,t.l,t.opacity);t instanceof cn||(t=sn(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(Hr*r+Br*n-Rr*e)/(Hr+Br-Rr),o=r-i,u=(zr*(e-i)-$r*o)/Yr,a=Math.sqrt(u*u+o*o)/(zr*i*(1-i)),s=a?Math.atan2(u,o)*Pr-120:NaN;return new Sn(s<0?s+360:s,a,i,t.opacity)}function En(t,n,e,r){return 1===arguments.length?kn(t):new Sn(t,n,e,null==r?1:r)}function Sn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Pn(t){return function(){return t}}function qn(t,n){return function(e){return t+e*n}}function Cn(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 In(t,n){var e=n-t;return e?qn(t,e>180||e<-180?e-360*Math.round(e/360):e):Pn(isNaN(t)?n:t)}function On(t){return 1===(t=+t)?Xn:function(n,e){return e-n?Cn(n,e,t):Pn(isNaN(n)?e:n)}}function Xn(t,n){var e=n-t;return e?qn(t,e):Pn(isNaN(t)?n:t)}function Tn(t,n){return t=+t,n-=t,function(e){return t+n*e}}function Vn(t){return function(){return t}}function Ln(t){return function(n){return t(n)+""}}function jn(t,n){var e,r,i,o=Qr.lastIndex=Wr.lastIndex=0,u=-1,a=[],s=[];for(t+="",n+="";(e=Qr.exec(t))&&(r=Wr.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:Tn(e,r)})),o=Wr.lastIndex;return o<n.length&&(i=n.slice(o),a[u]?a[u]+=i:a[++u]=i),a.length<2?s[0]?Ln(s[0].x):Vn(n):(n=s.length,function(t){for(var e,r=0;r<n;++r)a[(e=s[r]).i]=e.x(t);return a.join("")})}function Dn(t,n,e,r,i,o){var u,a,s;return(u=Math.sqrt(t*t+n*n))&&(t/=u,n/=u),(s=t*e+n*r)&&(e-=t*s,r-=n*s),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,s/=a),t*r<n*e&&(t=-t,n=-n,s=-s,u=-u),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*Zr,skewX:Math.atan(s)*Zr,scaleX:u,scaleY:a}}function $n(t){return"none"===t?ti:(Ur||(Ur=document.createElement("DIV"),Fr=document.documentElement,Gr=document.defaultView),Ur.style.transform=t,t=Gr.getComputedStyle(Fr.appendChild(Ur),null).getPropertyValue("transform"),Fr.removeChild(Ur),t=t.slice(7,-1).split(","),Dn(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}function Yn(t){return null==t?ti:(Jr||(Jr=document.createElementNS("http://www.w3.org/2000/svg","g")),Jr.setAttribute("transform",t),(t=Jr.transform.baseVal.consolidate())?(t=t.matrix,Dn(t.a,t.b,t.c,t.d,t.e,t.f)):ti)}function zn(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:Tn(t,i)},{i:s-2,x:Tn(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:Tn(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:Tn(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:Tn(t,e)},{i:a-2,x:Tn(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 Bn(t){return function n(e){function r(n,r){var i=t((n=En(n)).h,(r=En(r)).h),o=Xn(n.s,r.s),u=Xn(n.l,r.l),a=Xn(n.opacity,r.opacity);return function(t){return n.h=i(t),n.s=o(t),n.l=u(Math.pow(t,e)),n.opacity=a(t),n+""}}return e=+e,r.gamma=n,r}(1)}function Rn(t,n){var e,r;return function(){var i=Kt(this,t),o=i.tween;if(o!==e){r=e=o;for(var u=0,a=r.length;u<a;++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=Kt(this,t),u=o.tween;if(u!==r){i=(r=u).slice();for(var a={name:n,value:e},s=0,l=i.length;s<l;++s)if(i[s].name===n){i[s]=a;break}s===l&&i.push(a)}o.tween=i}}function Un(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=Qt(this.node(),e).tween,o=0,u=i.length;o<u;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?Rn:Hn)(e,t,n))}function Fn(t,n,e){var r=t._id;return t.each(function(){var t=Kt(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)}),function(t){return Qt(t,r).value[n]}}function Gn(t,n){var e;return("number"==typeof n?Tn:n instanceof on?Kr:(e=on(n))?(n=e,Kr):jn)(t,n)}function Jn(t){return function(){this.removeAttribute(t)}}function Kn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Qn(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 Zn(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 te(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 ne(t,e){var r=n(t),i="transform"===r?ei:Gn;return this.attrTween(t,"function"==typeof e?(r.local?te:Zn)(r,i,Fn(this,"attr."+t,e)):null==e?(r.local?Kn:Jn)(r):(r.local?Wn:Qn)(r,i,e))}function ee(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 re(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 ie(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?ee:re)(i,e))}function oe(t,n){return function(){Jt(this,t).delay=+n.apply(this,arguments)}}function ue(t,n){return n=+n,function(){Jt(this,t).delay=n}}function ae(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?oe:ue)(n,t)):Qt(this.node(),n).delay}function se(t,n){return function(){Kt(this,t).duration=+n.apply(this,arguments)}}function le(t,n){return n=+n,function(){Kt(this,t).duration=n}}function ce(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?se:le)(n,t)):Qt(this.node(),n).duration}function he(t,n){if("function"!=typeof n)throw new Error;return function(){Kt(this,t).ease=n}}function fe(t){var n=this._id;return arguments.length?this.each(he(n,t)):Qt(this.node(),n).ease}function pe(t){"function"!=typeof t&&(t=He(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],a=u.length,s=r[i]=[],l=0;l<a;++l)(o=u[l])&&t.call(o,o.__data__,l,u)&&s.push(o);return new Xe(r,this._parents,this._name,this._id)}function de(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var s,l=n[a],c=e[a],h=l.length,f=u[a]=new Array(h),p=0;p<h;++p)(s=l[p]||c[p])&&(f[p]=s);for(;a<r;++a)u[a]=n[a];return new Xe(u,this._parents,this._name,this._id)}function ye(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 ve(t,n,e){var r,i,o=ye(n)?Jt:Kt;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}function _e(t,n){var e=this._id;return arguments.length<2?Qt(this.node(),e).on.on(t):this.each(ve(e,t,n))}function ge(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function me(){return this.on("end.remove",ge(this._id))}function we(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=f(t));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var a,s,l=r[u],c=l.length,h=o[u]=new Array(c),p=0;p<c;++p)(a=l[p])&&(s=t.call(a,a.__data__,p,l))&&("__data__"in a&&(s.__data__=a.__data__),h[p]=s,Gt(h[p],n,e,p,h,Qt(a,e)));return new Xe(o,this._parents,n,e)}function be(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=y(t));for(var r=this._groups,i=r.length,o=[],u=[],a=0;a<i;++a)for(var s,l=r[a],c=l.length,h=0;h<c;++h)if(s=l[h]){for(var f,p=t.call(s,s.__data__,h,l),d=Qt(s,e),v=0,_=p.length;v<_;++v)(f=p[v])&&Gt(f,n,e,v,p,d);o.push(p),u.push(s)}return new Xe(o,u,n,e)}function xe(){return new ri(this._groups,this._parents)}function Me(t,n){var e,r,i;return function(){var o=B(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 Ne(t){return function(){this.style.removeProperty(t)}}function Ae(t,n,e){var r,i;return function(){var o=B(this).getComputedStyle(this,null).getPropertyValue(t);return o===e?null:o===r?i:i=n(r=o,e)}}function ke(t,n,e){var r,i,o;return function(){var u=B(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 Ee(t,n,e){var r="transform"==(t+="")?ni:Gn;return null==n?this.styleTween(t,Me(t,r)).on("end.style."+t,Ne(t)):this.styleTween(t,"function"==typeof n?ke(t,r,Fn(this,"style."+t,n)):Ae(t,r,n),e)}function Se(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 Pe(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,Se(t,n,null==e?"":e))}function qe(t){return function(){this.textContent=t}}function Ce(t){return function(){var n=t(this);this.textContent=null==n?"":n}}function Ie(t){return this.tween("text","function"==typeof t?Ce(Fn(this,"text",t)):qe(null==t?"":t+""))}function Oe(){for(var t=this._name,n=this._id,e=Ve(),r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],s=a.length,l=0;l<s;++l)if(u=a[l]){var c=Qt(u,n);Gt(u,t,e,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Xe(r,this._parents,t,e)}function Xe(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function Te(t){return qt().transition(t)}function Ve(){return++ii}function Le(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}function je(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return hi.time=jt(),hi;return e}function De(t){var n,e;t instanceof Xe?(n=t._id,t=t._name):(n=Ve(),(e=hi).time=jt(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],s=a.length,l=0;l<s;++l)(u=a[l])&&Gt(u,t,n,l,a,e||je(u,n));return new Xe(r,this._parents,t,n)}var $e="http://www.w3.org/1999/xhtml",Ye={svg:"http://www.w3.org/2000/svg",xhtml:$e,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},ze=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var Be=document.documentElement;if(!Be.matches){var Re=Be.webkitMatchesSelector||Be.msMatchesSelector||Be.mozMatchesSelector||Be.oMatchesSelector;ze=function(t){return function(){return Re.call(this,t)}}}}var He=ze,Ue={};if(t.event=null,"undefined"!=typeof document){var Fe=document.documentElement;"onmouseenter"in Fe||(Ue={mouseenter:"mouseover",mouseleave:"mouseout"})}w.prototype={constructor:w,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)}};var Ge="$";tt.prototype={add:function(t){var n=this._names.indexOf(t);n<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Je=[null];Pt.prototype=qt.prototype={constructor:Pt,select:p,selectAll:v,filter:_,data:N,enter:m,exit:A,merge:k,order:E,sort:S,call:q,nodes:C,node:I,size:O,empty:X,each:T,attr:z,style:F,property:Q,classed:ut,text:ct,html:dt,raise:vt,lower:gt,append:mt,insert:bt,remove:Mt,datum:Nt,on:c,dispatch:St};var Ke={value:function(){}};Xt.prototype=Ot.prototype={constructor:Xt,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("invalid callback: "+n);for(;++o<u;)if(e=(t=i[o]).type)r[e]=Lt(r[e],t.name,n);else if(null==n)for(e in r)r[e]=Lt(r[e],t.name,null);return this}for(;++o<u;)if((e=(t=i[o]).type)&&(e=Vt(r[e],t.name)))return e}},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new Xt(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=this._[t],o=0,e=r.length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var Qe,We,Ze=0,tr=0,nr=0,er=1e3,rr=0,ir=0,or=0,ur="object"==typeof performance&&performance.now?performance:Date,ar="function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){setTimeout(t,17)};$t.prototype=Yt.prototype={constructor:$t,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?jt():+e)+(null==n?0:+n),this._next||We===this||(We?We._next=this:Qe=this,We=this),this._call=t,this._time=e,Ut()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ut())}};var sr=Ot("start","end","interrupt"),lr=[],cr=0,hr=1,fr=2,pr=3,dr=4,yr=5,vr=6,_r=.7,gr=1/_r,mr=/^#([0-9a-f]{3})$/,wr=/^#([0-9a-f]{6})$/,br=/^rgb\(\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*\)$/,xr=/^rgb\(\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*\)$/,Mr=/^rgba\(\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*,\s*([-+]?\d+(?:\.\d+)?)\s*\)$/,Nr=/^rgba\(\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)\s*\)$/,Ar=/^hsl\(\s*([-+]?\d+(?:\.\d+)?)\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*\)$/,kr=/^hsla\(\s*([-+]?\d+(?:\.\d+)?)\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)\s*\)$/,Er={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};nn(rn,on,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),nn(cn,ln,en(rn,{brighter:function(t){return t=null==t?gr:Math.pow(gr,t),new cn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?_r:Math.pow(_r,t),new cn(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+")")}})),nn(dn,pn,en(rn,{brighter:function(t){return t=null==t?gr:Math.pow(gr,t),new dn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?_r:Math.pow(_r,t),new dn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new cn(yn(t>=240?t-240:t+120,i,r),yn(t,i,r),yn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var Sr=Math.PI/180,Pr=180/Math.PI,qr=18,Cr=.95047,Ir=1,Or=1.08883,Xr=4/29,Tr=6/29,Vr=3*Tr*Tr,Lr=Tr*Tr*Tr;nn(gn,_n,en(rn,{brighter:function(t){return new gn(this.l+qr*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new gn(this.l-qr*(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=Ir*wn(t),n=Cr*wn(n),e=Or*wn(e),new cn(bn(3.2404542*n-1.5371385*t-.4985314*e),bn(-.969266*n+1.8760108*t+.041556*e),bn(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),nn(An,Nn,en(rn,{brighter:function(t){return new An(this.h,this.c,this.l+qr*(null==t?1:t),this.opacity)},darker:function(t){return new An(this.h,this.c,this.l-qr*(null==t?1:t),this.opacity)},rgb:function(){return vn(this).rgb()}}));var jr=-.14861,Dr=1.78277,$r=-.29227,Yr=-.90649,zr=1.97294,Br=zr*Yr,Rr=zr*Dr,Hr=Dr*$r-Yr*jr;nn(Sn,En,en(rn,{brighter:function(t){return t=null==t?gr:Math.pow(gr,t),new Sn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?_r:Math.pow(_r,t),new Sn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*Sr,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new cn(255*(n+e*(jr*r+Dr*i)),255*(n+e*($r*r+Yr*i)),255*(n+e*(zr*r)),this.opacity)}}));var Ur,Fr,Gr,Jr,Kr=function t(n){function e(t,n){var e=r((t=ln(t)).r,(n=ln(n)).r),i=r(t.g,n.g),o=r(t.b,n.b),u=r(t.opacity,n.opacity);return function(n){return t.r=e(n),t.g=i(n),t.b=o(n),t.opacity=u(n),t+""}}var r=On(n);return e.gamma=t,e}(1),Qr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Wr=new RegExp(Qr.source,"g"),Zr=180/Math.PI,ti={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},ni=zn($n,"px, ","px)","deg)"),ei=zn(Yn,", ",")",")");Bn(In);var ri=(Bn(Xn),qt.prototype.constructor),ii=0,oi=qt.prototype;Xe.prototype=Te.prototype={constructor:Xe,select:we,selectAll:be,filter:pe,merge:de,selection:xe,transition:Oe,call:oi.call,nodes:oi.nodes,node:oi.node,size:oi.size,empty:oi.empty,each:oi.each,on:_e,attr:ne,attrTween:ie,style:Ee,styleTween:Pe,text:Ie,remove:me,tween:Un,delay:ae,duration:ce,ease:fe};var ui=3,ai=(function t(n){function e(t){return Math.pow(t,n)}return n=+n,e.exponent=t,e}(ui),function t(n){function e(t){return 1-Math.pow(1-t,n)}return n=+n,e.exponent=t,e}(ui),function t(n){function e(t){return((t*=2)<=1?Math.pow(t,n):2-Math.pow(2-t,n))/2}return n=+n,e.exponent=t,e}(ui),1.70158),si=(function t(n){function e(t){return t*t*((n+1)*t-n)}return n=+n,e.overshoot=t,e}(ai),function t(n){function e(t){return--t*t*((n+1)*t+n)+1}return n=+n,e.overshoot=t,e}(ai),function t(n){function e(t){return((t*=2)<1?t*t*((n+1)*t-n):(t-=2)*t*((n+1)*t+n)+2)/2}return n=+n,e.overshoot=t,e}(ai),2*Math.PI),li=1,ci=.3,hi=(function t(n,e){function r(t){return n*Math.pow(2,10*--t)*Math.sin((i-t)/e)}var i=Math.asin(1/(n=Math.max(1,n)))*(e/=si);return r.amplitude=function(n){return t(n,e*si)},r.period=function(e){return t(n,e)},r}(li,ci),function t(n,e){function r(t){return 1-n*Math.pow(2,-10*(t=+t))*Math.sin((t+i)/e)}var i=Math.asin(1/(n=Math.max(1,n)))*(e/=si);return r.amplitude=function(n){return t(n,e*si)},r.period=function(e){return t(n,e)},r}(li,ci),function t(n,e){function r(t){return((t=2*t-1)<0?n*Math.pow(2,10*t)*Math.sin((i-t)/e):2-n*Math.pow(2,-10*t)*Math.sin((i+t)/e))/2}var i=Math.asin(1/(n=Math.max(1,n)))*(e/=si);return r.amplitude=function(n){return t(n,e*si)},r.period=function(e){return t(n,e)},r}(li,ci),{time:null,delay:0,duration:250,ease:Le});qt.prototype.interrupt=tn,qt.prototype.transition=De,t.selection=qt,t.select=Ct,t.selectAll=It,Object.defineProperty(t,"__esModule",{value:!0})});
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="d3.min.js"></script>
<script>
d3.select("body").append("h1")
.text("Hello, world!")
.style("text-align", "center")
.style("line-height", "320px")
.style("font-size", "100px")
.style("transform", "rotate(-180deg) scale(0.001, 0.001)")
.transition()
.duration(1500)
.style("transform", null);
</script>
export {
event,
selection,
select,
selectAll
} from "d3-selection";
export { json } from "d3-request";
import "d3-transition";
{
"name": "d3-custom-example",
"version": "0.0.1",
"scripts": {
"prepublish": "rollup -c && uglifyjs d3.js -c -m -o d3.min.js"
},
"devDependencies": {
"d3-selection": "1",
"d3-transition": "1",
"rollup": "0.34",
"rollup-plugin-node-resolve": "1",
"uglify-js": "2"
}
}
import npm from "rollup-plugin-node-resolve";
export default {
entry: "index.js",
format: "umd",
moduleName: "d3",
plugins: [
npm({
jsnext: true,
browser: true
})
],
dest: "d3.js"
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment