UNPKG

plotly.js

Version:

The open source javascript graphing library that powers plotly

18 lines 1.58 MB
/** * plotly.js (gl2d - minified) v3.3.1 * Copyright 2012-2025, Plotly, Inc. * All rights reserved. * Licensed under the MIT license */ ( function(root, factory) { if (typeof module === "object" && module.exports) { module.exports = factory(); } else { root.moduleName = factory(); } } (typeof self !== "undefined" ? self : this, () => { "use strict";var Plotly=(()=>{var zne=Object.create;var P1=Object.defineProperty,Gne=Object.defineProperties,Une=Object.getOwnPropertyDescriptor,Hne=Object.getOwnPropertyDescriptors,Vne=Object.getOwnPropertyNames,yM=Object.getOwnPropertySymbols,Yne=Object.getPrototypeOf,bM=Object.prototype.hasOwnProperty,Wne=Object.prototype.propertyIsEnumerable;var gM=(e,r,t)=>r in e?P1(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,h0=(e,r)=>{for(var t in r||(r={}))bM.call(r,t)&&gM(e,t,r[t]);if(yM)for(var t of yM(r))Wne.call(r,t)&&gM(e,t,r[t]);return e},Mg=(e,r)=>Gne(e,Hne(r));var Sg=(e,r)=>()=>(e&&(r=e(e=0)),r);var P=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),jne=(e,r)=>{for(var t in r)P1(e,t,{get:r[t],enumerable:!0})},xM=(e,r,t,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Vne(r))!bM.call(e,n)&&n!==t&&P1(e,n,{get:()=>r[n],enumerable:!(a=Une(r,n))||a.enumerable});return e};var Xne=(e,r,t)=>(t=e!=null?zne(Yne(e)):{},xM(r||!e||!e.__esModule?P1(t,"default",{value:e,enumerable:!0}):t,e)),Zne=e=>xM(P1({},"__esModule",{value:!0}),e);var Eg=P(_M=>{"use strict";_M.version="3.3.1"});var AM=P((wM,kg)=>{(function(r,t,a){t[r]=t[r]||a(),typeof kg!="undefined"&&kg.exports&&(kg.exports=t[r])})("Promise",typeof window!="undefined"?window:wM,function(){"use strict";var r,t,a,n=Object.prototype.toString,i=typeof setImmediate!="undefined"?function(A){return setImmediate(A)}:setTimeout;try{Object.defineProperty({},"x",{}),r=function(A,_,x,T){return Object.defineProperty(A,_,{value:x,writable:!0,configurable:T!==!1})}}catch(b){r=function(_,x,T){return _[x]=T,_}}a=function(){var A,_,x;function T(E,S){this.fn=E,this.self=S,this.next=void 0}return{add:function(S,k){x=new T(S,k),_?_.next=x:A=x,_=x,x=void 0},drain:function(){var S=A;for(A=_=t=void 0;S;)S.fn.call(S.self),S=S.next}}}();function o(b,A){a.add(b,A),t||(t=i(a.drain))}function l(b){var A,_=typeof b;return b!=null&&(_=="object"||_=="function")&&(A=b.then),typeof A=="function"?A:!1}function s(){for(var b=0;b<this.chain.length;b++)f(this,this.state===1?this.chain[b].success:this.chain[b].failure,this.chain[b]);this.chain.length=0}function f(b,A,_){var x,T;try{A===!1?_.reject(b.msg):(A===!0?x=b.msg:x=A.call(void 0,b.msg),x===_.promise?_.reject(TypeError("Promise-chain cycle")):(T=l(x))?T.call(x,_.resolve,_.reject):_.resolve(x))}catch(E){_.reject(E)}}function u(b){var A,_=this;if(!_.triggered){_.triggered=!0,_.def&&(_=_.def);try{(A=l(b))?o(function(){var x=new d(_);try{A.call(b,function(){u.apply(x,arguments)},function(){c.apply(x,arguments)})}catch(T){c.call(x,T)}}):(_.msg=b,_.state=1,_.chain.length>0&&o(s,_))}catch(x){c.call(new d(_),x)}}}function c(b){var A=this;A.triggered||(A.triggered=!0,A.def&&(A=A.def),A.msg=b,A.state=2,A.chain.length>0&&o(s,A))}function v(b,A,_,x){for(var T=0;T<A.length;T++)(function(S){b.resolve(A[S]).then(function(F){_(S,F)},x)})(T)}function d(b){this.def=b,this.triggered=!1}function p(b){this.promise=b,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function y(b){if(typeof b!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var A=new p(this);this.then=function(x,T){var E={success:typeof x=="function"?x:!0,failure:typeof T=="function"?T:!1};return E.promise=new this.constructor(function(k,F){if(typeof k!="function"||typeof F!="function")throw TypeError("Not a function");E.resolve=k,E.reject=F}),A.chain.push(E),A.state!==0&&o(s,A),E.promise},this.catch=function(x){return this.then(void 0,x)};try{b.call(void 0,function(x){u.call(A,x)},function(x){c.call(A,x)})}catch(_){c.call(A,_)}}var m=r({},"constructor",y,!1);return y.prototype=m,r(m,"__NPO__",0,!1),r(y,"resolve",function(A){var _=this;return A&&typeof A=="object"&&A.__NPO__===1?A:new _(function(T,E){if(typeof T!="function"||typeof E!="function")throw TypeError("Not a function");T(A)})}),r(y,"reject",function(A){return new this(function(x,T){if(typeof x!="function"||typeof T!="function")throw TypeError("Not a function");T(A)})}),r(y,"all",function(A){var _=this;return n.call(A)!="[object Array]"?_.reject(TypeError("Not an array")):A.length===0?_.resolve([]):new _(function(T,E){if(typeof T!="function"||typeof E!="function")throw TypeError("Not a function");var S=A.length,k=Array(S),F=0;v(_,A,function(O,q){k[O]=q,++F===S&&T(k)},E)})}),r(y,"race",function(A){var _=this;return n.call(A)!="[object Array]"?_.reject(TypeError("Not an array")):new _(function(T,E){if(typeof T!="function"||typeof E!="function")throw TypeError("Not a function");v(_,A,function(k,F){T(F)},E)})}),y})});var da=P((gEe,Cg)=>{(function(){var e={version:"3.8.2"},r=[].slice,t=function(h){return r.call(h)},a=self.document;function n(h){return h&&(h.ownerDocument||h.document||h).documentElement}function i(h){return h&&(h.ownerDocument&&h.ownerDocument.defaultView||h.document&&h||h.defaultView)}if(a)try{t(a.documentElement.childNodes)[0].nodeType}catch(h){t=function(g){for(var w=g.length,C=new Array(w);w--;)C[w]=g[w];return C}}if(Date.now||(Date.now=function(){return+new Date}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(h){var o=this.Element.prototype,l=o.setAttribute,s=o.setAttributeNS,f=this.CSSStyleDeclaration.prototype,u=f.setProperty;o.setAttribute=function(g,w){l.call(this,g,w+"")},o.setAttributeNS=function(g,w,C){s.call(this,g,w,C+"")},f.setProperty=function(g,w,C){u.call(this,g,w+"",C)}}e.ascending=c;function c(h,g){return h<g?-1:h>g?1:h>=g?0:NaN}e.descending=function(h,g){return g<h?-1:g>h?1:g>=h?0:NaN},e.min=function(h,g){var w=-1,C=h.length,L,D;if(arguments.length===1){for(;++w<C;)if((D=h[w])!=null&&D>=D){L=D;break}for(;++w<C;)(D=h[w])!=null&&L>D&&(L=D)}else{for(;++w<C;)if((D=g.call(h,h[w],w))!=null&&D>=D){L=D;break}for(;++w<C;)(D=g.call(h,h[w],w))!=null&&L>D&&(L=D)}return L},e.max=function(h,g){var w=-1,C=h.length,L,D;if(arguments.length===1){for(;++w<C;)if((D=h[w])!=null&&D>=D){L=D;break}for(;++w<C;)(D=h[w])!=null&&D>L&&(L=D)}else{for(;++w<C;)if((D=g.call(h,h[w],w))!=null&&D>=D){L=D;break}for(;++w<C;)(D=g.call(h,h[w],w))!=null&&D>L&&(L=D)}return L},e.extent=function(h,g){var w=-1,C=h.length,L,D,G;if(arguments.length===1){for(;++w<C;)if((D=h[w])!=null&&D>=D){L=G=D;break}for(;++w<C;)(D=h[w])!=null&&(L>D&&(L=D),G<D&&(G=D))}else{for(;++w<C;)if((D=g.call(h,h[w],w))!=null&&D>=D){L=G=D;break}for(;++w<C;)(D=g.call(h,h[w],w))!=null&&(L>D&&(L=D),G<D&&(G=D))}return[L,G]};function v(h){return h===null?NaN:+h}function d(h){return!isNaN(h)}e.sum=function(h,g){var w=0,C=h.length,L,D=-1;if(arguments.length===1)for(;++D<C;)d(L=+h[D])&&(w+=L);else for(;++D<C;)d(L=+g.call(h,h[D],D))&&(w+=L);return w},e.mean=function(h,g){var w=0,C=h.length,L,D=-1,G=C;if(arguments.length===1)for(;++D<C;)d(L=v(h[D]))?w+=L:--G;else for(;++D<C;)d(L=v(g.call(h,h[D],D)))?w+=L:--G;if(G)return w/G},e.quantile=function(h,g){var w=(h.length-1)*g+1,C=Math.floor(w),L=+h[C-1],D=w-C;return D?L+D*(h[C]-L):L},e.median=function(h,g){var w=[],C=h.length,L,D=-1;if(arguments.length===1)for(;++D<C;)d(L=v(h[D]))&&w.push(L);else for(;++D<C;)d(L=v(g.call(h,h[D],D)))&&w.push(L);if(w.length)return e.quantile(w.sort(c),.5)},e.variance=function(h,g){var w=h.length,C=0,L,D,G=0,R=-1,X=0;if(arguments.length===1)for(;++R<w;)d(L=v(h[R]))&&(D=L-C,C+=D/++X,G+=D*(L-C));else for(;++R<w;)d(L=v(g.call(h,h[R],R)))&&(D=L-C,C+=D/++X,G+=D*(L-C));if(X>1)return G/(X-1)},e.deviation=function(){var h=e.variance.apply(this,arguments);return h&&Math.sqrt(h)};function p(h){return{left:function(g,w,C,L){for(arguments.length<3&&(C=0),arguments.length<4&&(L=g.length);C<L;){var D=C+L>>>1;h(g[D],w)<0?C=D+1:L=D}return C},right:function(g,w,C,L){for(arguments.length<3&&(C=0),arguments.length<4&&(L=g.length);C<L;){var D=C+L>>>1;h(g[D],w)>0?L=D:C=D+1}return C}}}var y=p(c);e.bisectLeft=y.left,e.bisect=e.bisectRight=y.right,e.bisector=function(h){return p(h.length===1?function(g,w){return c(h(g),w)}:h)},e.shuffle=function(h,g,w){(C=arguments.length)<3&&(w=h.length,C<2&&(g=0));for(var C=w-g,L,D;C;)D=Math.random()*C--|0,L=h[C+g],h[C+g]=h[D+g],h[D+g]=L;return h},e.permute=function(h,g){for(var w=g.length,C=new Array(w);w--;)C[w]=h[g[w]];return C},e.pairs=function(h){for(var g=0,w=h.length-1,C,L=h[0],D=new Array(w<0?0:w);g<w;)D[g]=[C=L,L=h[++g]];return D},e.transpose=function(h){if(!(D=h.length))return[];for(var g=-1,w=e.min(h,m),C=new Array(w);++g<w;)for(var L=-1,D,G=C[g]=new Array(D);++L<D;)G[L]=h[L][g];return C};function m(h){return h.length}e.zip=function(){return e.transpose(arguments)},e.keys=function(h){var g=[];for(var w in h)g.push(w);return g},e.values=function(h){var g=[];for(var w in h)g.push(h[w]);return g},e.entries=function(h){var g=[];for(var w in h)g.push({key:w,value:h[w]});return g},e.merge=function(h){for(var g=h.length,w,C=-1,L=0,D,G;++C<g;)L+=h[C].length;for(D=new Array(L);--g>=0;)for(G=h[g],w=G.length;--w>=0;)D[--L]=G[w];return D};var b=Math.abs;e.range=function(h,g,w){if(arguments.length<3&&(w=1,arguments.length<2&&(g=h,h=0)),(g-h)/w===1/0)throw new Error("infinite range");var C=[],L=A(b(w)),D=-1,G;if(h*=L,g*=L,w*=L,w<0)for(;(G=h+w*++D)>g;)C.push(G/L);else for(;(G=h+w*++D)<g;)C.push(G/L);return C};function A(h){for(var g=1;h*g%1;)g*=10;return g}function _(h,g){for(var w in g)Object.defineProperty(h.prototype,w,{value:g[w],enumerable:!1})}e.map=function(h,g){var w=new x;if(h instanceof x)h.forEach(function(R,X){w.set(R,X)});else if(Array.isArray(h)){var C=-1,L=h.length,D;if(arguments.length===1)for(;++C<L;)w.set(C,h[C]);else for(;++C<L;)w.set(g.call(h,D=h[C],C),D)}else for(var G in h)w.set(G,h[G]);return w};function x(){this._=Object.create(null)}var T="__proto__",E="\0";_(x,{has:F,get:function(h){return this._[S(h)]},set:function(h,g){return this._[S(h)]=g},remove:I,keys:O,values:function(){var h=[];for(var g in this._)h.push(this._[g]);return h},entries:function(){var h=[];for(var g in this._)h.push({key:k(g),value:this._[g]});return h},size:q,empty:H,forEach:function(h){for(var g in this._)h.call(this,k(g),this._[g])}});function S(h){return(h+="")===T||h[0]===E?E+h:h}function k(h){return(h+="")[0]===E?h.slice(1):h}function F(h){return S(h)in this._}function I(h){return(h=S(h))in this._&&delete this._[h]}function O(){var h=[];for(var g in this._)h.push(k(g));return h}function q(){var h=0;for(var g in this._)++h;return h}function H(){for(var h in this._)return!1;return!0}e.nest=function(){var h={},g=[],w=[],C,L;function D(R,X,ie){if(ie>=g.length)return L?L.call(h,X):C?X.sort(C):X;for(var oe=-1,ye=X.length,ge=g[ie++],Ye,Qe,Me,Fe=new x,Ge;++oe<ye;)(Ge=Fe.get(Ye=ge(Qe=X[oe])))?Ge.push(Qe):Fe.set(Ye,[Qe]);return R?(Qe=R(),Me=function(Ke,ar){Qe.set(Ke,D(R,ar,ie))}):(Qe={},Me=function(Ke,ar){Qe[Ke]=D(R,ar,ie)}),Fe.forEach(Me),Qe}function G(R,X){if(X>=g.length)return R;var ie=[],oe=w[X++];return R.forEach(function(ye,ge){ie.push({key:ye,values:G(ge,X)})}),oe?ie.sort(function(ye,ge){return oe(ye.key,ge.key)}):ie}return h.map=function(R,X){return D(X,R,0)},h.entries=function(R){return G(D(e.map,R,0),0)},h.key=function(R){return g.push(R),h},h.sortKeys=function(R){return w[g.length-1]=R,h},h.sortValues=function(R){return C=R,h},h.rollup=function(R){return L=R,h},h},e.set=function(h){var g=new j;if(h)for(var w=0,C=h.length;w<C;++w)g.add(h[w]);return g};function j(){this._=Object.create(null)}_(j,{has:F,add:function(h){return this._[S(h+="")]=!0,h},remove:I,values:O,size:q,empty:H,forEach:function(h){for(var g in this._)h.call(this,k(g))}}),e.behavior={};function le(h){return h}e.rebind=function(h,g){for(var w=1,C=arguments.length,L;++w<C;)h[L=arguments[w]]=te(h,g,g[L]);return h};function te(h,g,w){return function(){var C=w.apply(g,arguments);return C===g?h:C}}function Q(h,g){if(g in h)return g;g=g.charAt(0).toUpperCase()+g.slice(1);for(var w=0,C=J.length;w<C;++w){var L=J[w]+g;if(L in h)return L}}var J=["webkit","ms","moz","Moz","o","O"];function Z(){}e.dispatch=function(){for(var h=new ae,g=-1,w=arguments.length;++g<w;)h[arguments[g]]=ue(h);return h};function ae(){}ae.prototype.on=function(h,g){var w=h.indexOf("."),C="";if(w>=0&&(C=h.slice(w+1),h=h.slice(0,w)),h)return arguments.length<2?this[h].on(C):this[h].on(C,g);if(arguments.length===2){if(g==null)for(h in this)this.hasOwnProperty(h)&&this[h].on(C,null);return this}};function ue(h){var g=[],w=new x;function C(){for(var L=g,D=-1,G=L.length,R;++D<G;)(R=L[D].on)&&R.apply(this,arguments);return h}return C.on=function(L,D){var G=w.get(L),R;return arguments.length<2?G&&G.on:(G&&(G.on=null,g=g.slice(0,R=g.indexOf(G)).concat(g.slice(R+1)),w.remove(L)),D&&g.push(w.set(L,{on:D})),h)},C}e.event=null;function Le(){e.event.preventDefault()}function Be(){for(var h=e.event,g;g=h.sourceEvent;)h=g;return h}function Ee(h){for(var g=new ae,w=0,C=arguments.length;++w<C;)g[arguments[w]]=ue(g);return g.of=function(L,D){return function(G){try{var R=G.sourceEvent=e.event;G.target=h,e.event=G,g[G.type].apply(L,D)}finally{e.event=R}}},g}e.requote=function(h){return h.replace(Xe,"\\$&")};var Xe=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Ae={}.__proto__?function(h,g){h.__proto__=g}:function(h,g){for(var w in g)h[w]=g[w]};function rr(h){return Ae(h,Ue),h}var ze=function(h,g){return g.querySelector(h)},We=function(h,g){return g.querySelectorAll(h)},$e=function(h,g){var w=h.matches||h[Q(h,"matchesSelector")];return $e=function(C,L){return w.call(C,L)},$e(h,g)};typeof Sizzle=="function"&&(ze=function(h,g){return Sizzle(h,g)[0]||null},We=Sizzle,$e=Sizzle.matchesSelector),e.selection=function(){return e.select(a.documentElement)};var Ue=e.selection.prototype=[];Ue.select=function(h){var g=[],w,C,L,D;h=ee(h);for(var G=-1,R=this.length;++G<R;){g.push(w=[]),w.parentNode=(L=this[G]).parentNode;for(var X=-1,ie=L.length;++X<ie;)(D=L[X])?(w.push(C=h.call(D,D.__data__,X,G)),C&&"__data__"in D&&(C.__data__=D.__data__)):w.push(null)}return rr(g)};function ee(h){return typeof h=="function"?h:function(){return ze(h,this)}}Ue.selectAll=function(h){var g=[],w,C;h=de(h);for(var L=-1,D=this.length;++L<D;)for(var G=this[L],R=-1,X=G.length;++R<X;)(C=G[R])&&(g.push(w=t(h.call(C,C.__data__,R,L))),w.parentNode=C);return rr(g)};function de(h){return typeof h=="function"?h:function(){return We(h,this)}}var ne="http://www.w3.org/1999/xhtml",je={svg:"http://www.w3.org/2000/svg",xhtml:ne,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};e.ns={prefix:je,qualify:function(h){var g=h.indexOf(":"),w=h;return g>=0&&(w=h.slice(0,g))!=="xmlns"&&(h=h.slice(g+1)),je.hasOwnProperty(w)?{space:je[w],local:h}:h}},Ue.attr=function(h,g){if(arguments.length<2){if(typeof h=="string"){var w=this.node();return h=e.ns.qualify(h),h.local?w.getAttributeNS(h.space,h.local):w.getAttribute(h)}for(g in h)this.each(ur(g,h[g]));return this}return this.each(ur(h,g))};function ur(h,g){h=e.ns.qualify(h);function w(){this.removeAttribute(h)}function C(){this.removeAttributeNS(h.space,h.local)}function L(){this.setAttribute(h,g)}function D(){this.setAttributeNS(h.space,h.local,g)}function G(){var X=g.apply(this,arguments);X==null?this.removeAttribute(h):this.setAttribute(h,X)}function R(){var X=g.apply(this,arguments);X==null?this.removeAttributeNS(h.space,h.local):this.setAttributeNS(h.space,h.local,X)}return g==null?h.local?C:w:typeof g=="function"?h.local?R:G:h.local?D:L}function er(h){return h.trim().replace(/\s+/g," ")}Ue.classed=function(h,g){if(arguments.length<2){if(typeof h=="string"){var w=this.node(),C=(h=Pr(h)).length,L=-1;if(g=w.classList){for(;++L<C;)if(!g.contains(h[L]))return!1}else for(g=w.getAttribute("class");++L<C;)if(!Lr(h[L]).test(g))return!1;return!0}for(g in h)this.each(_r(g,h[g]));return this}return this.each(_r(h,g))};function Lr(h){return new RegExp("(?:^|\\s+)"+e.requote(h)+"(?:\\s+|$)","g")}function Pr(h){return(h+"").trim().split(/^|\s+/)}function _r(h,g){h=Pr(h).map(Ir);var w=h.length;function C(){for(var D=-1;++D<w;)h[D](this,g)}function L(){for(var D=-1,G=g.apply(this,arguments);++D<w;)h[D](this,G)}return typeof g=="function"?L:C}function Ir(h){var g=Lr(h);return function(w,C){if(L=w.classList)return C?L.add(h):L.remove(h);var L=w.getAttribute("class")||"";C?(g.lastIndex=0,g.test(L)||w.setAttribute("class",er(L+" "+h))):w.setAttribute("class",er(L.replace(g," ")))}}Ue.style=function(h,g,w){var C=arguments.length;if(C<3){if(typeof h!="string"){C<2&&(g="");for(w in h)this.each(Yr(w,h[w],g));return this}if(C<2){var L=this.node();return i(L).getComputedStyle(L,null).getPropertyValue(h)}w=""}return this.each(Yr(h,g,w))};function Yr(h,g,w){function C(){this.style.removeProperty(h)}function L(){this.style.setProperty(h,g,w)}function D(){var G=g.apply(this,arguments);G==null?this.style.removeProperty(h):this.style.setProperty(h,G,w)}return g==null?C:typeof g=="function"?D:L}Ue.property=function(h,g){if(arguments.length<2){if(typeof h=="string")return this.node()[h];for(g in h)this.each(Kr(g,h[g]));return this}return this.each(Kr(h,g))};function Kr(h,g){function w(){delete this[h]}function C(){this[h]=g}function L(){var D=g.apply(this,arguments);D==null?delete this[h]:this[h]=D}return g==null?w:typeof g=="function"?L:C}Ue.text=function(h){return arguments.length?this.each(typeof h=="function"?function(){var g=h.apply(this,arguments);this.textContent=g==null?"":g}:h==null?function(){this.textContent=""}:function(){this.textContent=h}):this.node().textContent},Ue.html=function(h){return arguments.length?this.each(typeof h=="function"?function(){var g=h.apply(this,arguments);this.innerHTML=g==null?"":g}:h==null?function(){this.innerHTML=""}:function(){this.innerHTML=h}):this.node().innerHTML},Ue.append=function(h){return h=wr(h),this.select(function(){return this.appendChild(h.apply(this,arguments))})};function wr(h){function g(){var C=this.ownerDocument,L=this.namespaceURI;return L===ne&&C.documentElement.namespaceURI===ne?C.createElement(h):C.createElementNS(L,h)}function w(){return this.ownerDocument.createElementNS(h.space,h.local)}return typeof h=="function"?h:(h=e.ns.qualify(h)).local?w:g}Ue.insert=function(h,g){return h=wr(h),g=ee(g),this.select(function(){return this.insertBefore(h.apply(this,arguments),g.apply(this,arguments)||null)})},Ue.remove=function(){return this.each(Vr)};function Vr(){var h=this.parentNode;h&&h.removeChild(this)}Ue.data=function(h,g){var w=-1,C=this.length,L,D;if(!arguments.length){for(h=new Array(C=(L=this[0]).length);++w<C;)(D=L[w])&&(h[w]=D.__data__);return h}function G(oe,ye){var ge,Ye=oe.length,Qe=ye.length,Me=Math.min(Ye,Qe),Fe=new Array(Qe),Ge=new Array(Qe),Ke=new Array(Ye),ar,De;if(g){var Dr=new x,zr=new Array(Ye),it;for(ge=-1;++ge<Ye;)(ar=oe[ge])&&(Dr.has(it=g.call(ar,ar.__data__,ge))?Ke[ge]=ar:Dr.set(it,ar),zr[ge]=it);for(ge=-1;++ge<Qe;)(ar=Dr.get(it=g.call(ye,De=ye[ge],ge)))?ar!==!0&&(Fe[ge]=ar,ar.__data__=De):Ge[ge]=Wr(De),Dr.set(it,!0);for(ge=-1;++ge<Ye;)ge in zr&&Dr.get(zr[ge])!==!0&&(Ke[ge]=oe[ge])}else{for(ge=-1;++ge<Me;)ar=oe[ge],De=ye[ge],ar?(ar.__data__=De,Fe[ge]=ar):Ge[ge]=Wr(De);for(;ge<Qe;++ge)Ge[ge]=Wr(ye[ge]);for(;ge<Ye;++ge)Ke[ge]=oe[ge]}Ge.update=Fe,Ge.parentNode=Fe.parentNode=Ke.parentNode=oe.parentNode,R.push(Ge),X.push(Fe),ie.push(Ke)}var R=kt([]),X=rr([]),ie=rr([]);if(typeof h=="function")for(;++w<C;)G(L=this[w],h.call(L,L.parentNode.__data__,w));else for(;++w<C;)G(L=this[w],h);return X.enter=function(){return R},X.exit=function(){return ie},X};function Wr(h){return{__data__:h}}Ue.datum=function(h){return arguments.length?this.property("__data__",h):this.property("__data__")},Ue.filter=function(h){var g=[],w,C,L;typeof h!="function"&&(h=Re(h));for(var D=0,G=this.length;D<G;D++){g.push(w=[]),w.parentNode=(C=this[D]).parentNode;for(var R=0,X=C.length;R<X;R++)(L=C[R])&&h.call(L,L.__data__,R,D)&&w.push(L)}return rr(g)};function Re(h){return function(){return $e(this,h)}}Ue.order=function(){for(var h=-1,g=this.length;++h<g;)for(var w=this[h],C=w.length-1,L=w[C],D;--C>=0;)(D=w[C])&&(L&&L!==D.nextSibling&&L.parentNode.insertBefore(D,L),L=D);return this},Ue.sort=function(h){h=lr.apply(this,arguments);for(var g=-1,w=this.length;++g<w;)this[g].sort(h);return this.order()};function lr(h){return arguments.length||(h=c),function(g,w){return g&&w?h(g.__data__,w.__data__):!g-!w}}Ue.each=function(h){return st(this,function(g,w,C){h.call(g,g.__data__,w,C)})};function st(h,g){for(var w=0,C=h.length;w<C;w++)for(var L=h[w],D=0,G=L.length,R;D<G;D++)(R=L[D])&&g(R,D,w);return h}Ue.call=function(h){var g=t(arguments);return h.apply(g[0]=this,g),this},Ue.empty=function(){return!this.node()},Ue.node=function(){for(var h=0,g=this.length;h<g;h++)for(var w=this[h],C=0,L=w.length;C<L;C++){var D=w[C];if(D)return D}return null},Ue.size=function(){var h=0;return st(this,function(){++h}),h};function kt(h){return Ae(h,Ar),h}var Ar=[];e.selection.enter=kt,e.selection.enter.prototype=Ar,Ar.append=Ue.append,Ar.empty=Ue.empty,Ar.node=Ue.node,Ar.call=Ue.call,Ar.size=Ue.size,Ar.select=function(h){for(var g=[],w,C,L,D,G,R=-1,X=this.length;++R<X;){L=(D=this[R]).update,g.push(w=[]),w.parentNode=D.parentNode;for(var ie=-1,oe=D.length;++ie<oe;)(G=D[ie])?(w.push(L[ie]=C=h.call(D.parentNode,G.__data__,ie,R)),C.__data__=G.__data__):w.push(null)}return rr(g)},Ar.insert=function(h,g){return arguments.length<2&&(g=tr(this)),Ue.insert.call(this,h,g)};function tr(h){var g,w;return function(C,L,D){var G=h[D].update,R=G.length,X;for(D!=w&&(w=D,g=0),L>=g&&(g=L+1);!(X=G[g])&&++g<R;);return X}}e.select=function(h){var g;return typeof h=="string"?(g=[ze(h,a)],g.parentNode=a.documentElement):(g=[h],g.parentNode=n(h)),rr([g])},e.selectAll=function(h){var g;return typeof h=="string"?(g=t(We(h,a)),g.parentNode=a.documentElement):(g=t(h),g.parentNode=null),rr([g])},Ue.on=function(h,g,w){var C=arguments.length;if(C<3){if(typeof h!="string"){C<2&&(g=!1);for(w in h)this.each(cr(w,h[w],g));return this}if(C<2)return(C=this.node()["__on"+h])&&C._;w=!1}return this.each(cr(h,g,w))};function cr(h,g,w){var C="__on"+h,L=h.indexOf("."),D=ot;L>0&&(h=h.slice(0,L));var G=Hr.get(h);G&&(h=G,D=jr);function R(){var oe=this[C];oe&&(this.removeEventListener(h,oe,oe.$),delete this[C])}function X(){var oe=D(g,t(arguments));R.call(this),this.addEventListener(h,this[C]=oe,oe.$=w),oe._=g}function ie(){var oe=new RegExp("^__on([^.]+)"+e.requote(h)+"$"),ye;for(var ge in this)if(ye=ge.match(oe)){var Ye=this[ge];this.removeEventListener(ye[1],Ye,Ye.$),delete this[ge]}}return L?g?X:R:g?Z:ie}var Hr=e.map({mouseenter:"mouseover",mouseleave:"mouseout"});a&&Hr.forEach(function(h){"on"+h in a&&Hr.remove(h)});function ot(h,g){return function(w){var C=e.event;e.event=w,g[0]=this.__data__;try{h.apply(this,g)}finally{e.event=C}}}function jr(h,g){var w=ot(h,g);return function(C){var L=this,D=C.relatedTarget;(!D||D!==L&&!(D.compareDocumentPosition(L)&8))&&w.call(L,C)}}var at,xt=0;function Xr(h){var g=".dragsuppress-"+ ++xt,w="click"+g,C=e.select(i(h)).on("touchmove"+g,Le).on("dragstart"+g,Le).on("selectstart"+g,Le);if(at==null&&(at="onselectstart"in h?!1:Q(h.style,"userSelect")),at){var L=n(h).style,D=L[at];L[at]="none"}return function(G){if(C.on(g,null),at&&(L[at]=D),G){var R=function(){C.on(w,null)};C.on(w,function(){Le(),R()},!0),setTimeout(R,0)}}}e.mouse=function(h){return gr(h,Be())};var nt=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function gr(h,g){g.changedTouches&&(g=g.changedTouches[0]);var w=h.ownerSVGElement||h;if(w.createSVGPoint){var C=w.createSVGPoint();if(nt<0){var L=i(h);if(L.scrollX||L.scrollY){w=e.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var D=w[0][0].getScreenCTM();nt=!(D.f||D.e),w.remove()}}return nt?(C.x=g.pageX,C.y=g.pageY):(C.x=g.clientX,C.y=g.clientY),C=C.matrixTransform(h.getScreenCTM().inverse()),[C.x,C.y]}var G=h.getBoundingClientRect();return[g.clientX-G.left-h.clientLeft,g.clientY-G.top-h.clientTop]}e.touch=function(h,g,w){if(arguments.length<3&&(w=g,g=Be().changedTouches),g){for(var C=0,L=g.length,D;C<L;++C)if((D=g[C]).identifier===w)return gr(h,D)}},e.behavior.drag=function(){var h=Ee(L,"drag","dragstart","dragend"),g=null,w=D(Z,e.mouse,i,"mousemove","mouseup"),C=D(Se,e.touch,le,"touchmove","touchend");function L(){this.on("mousedown.drag",w).on("touchstart.drag",C)}function D(G,R,X,ie,oe){return function(){var ye=this,ge=e.event.target.correspondingElement||e.event.target,Ye=ye.parentNode,Qe=h.of(ye,arguments),Me=0,Fe=G(),Ge=".drag"+(Fe==null?"":"-"+Fe),Ke,ar=e.select(X(ge)).on(ie+Ge,zr).on(oe+Ge,it),De=Xr(ge),Dr=R(Ye,Fe);g?(Ke=g.apply(ye,arguments),Ke=[Ke.x-Dr[0],Ke.y-Dr[1]]):Ke=[0,0],Qe({type:"dragstart"});function zr(){var yt=R(Ye,Fe),Ct,Lt;yt&&(Ct=yt[0]-Dr[0],Lt=yt[1]-Dr[1],Me|=Ct|Lt,Dr=yt,Qe({type:"drag",x:yt[0]+Ke[0],y:yt[1]+Ke[1],dx:Ct,dy:Lt}))}function it(){R(Ye,Fe)&&(ar.on(ie+Ge,null).on(oe+Ge,null),De(Me),Qe({type:"dragend"}))}}}return L.origin=function(G){return arguments.length?(g=G,L):g},e.rebind(L,h,"on")};function Se(){return e.event.changedTouches[0].identifier}e.touches=function(h,g){return arguments.length<2&&(g=Be().touches),g?t(g).map(function(w){var C=gr(h,w);return C.identifier=w.identifier,C}):[]};var Ne=1e-6,pr=Ne*Ne,xr=Math.PI,ht=2*xr,Tt=ht-Ne,wt=xr/2,It=xr/180,ta=180/xr;function Ma(h){return h>0?1:h<0?-1:0}function Ba(h,g,w){return(g[0]-h[0])*(w[1]-h[1])-(g[1]-h[1])*(w[0]-h[0])}function an(h){return h>1?0:h<-1?xr:Math.acos(h)}function Va(h){return h>1?wt:h<-1?-wt:Math.asin(h)}function xn(h){return((h=Math.exp(h))-1/h)/2}function Rn(h){return((h=Math.exp(h))+1/h)/2}function hi(h){return((h=Math.exp(2*h))-1)/(h+1)}function hn(h){return(h=Math.sin(h/2))*h}var Xn=Math.SQRT2,Et=2,Pa=4;e.interpolateZoom=function(h,g){var w=h[0],C=h[1],L=h[2],D=g[0],G=g[1],R=g[2],X=D-w,ie=G-C,oe=X*X+ie*ie,ye,ge;if(oe<pr)ge=Math.log(R/L)/Xn,ye=function(Ke){return[w+Ke*X,C+Ke*ie,L*Math.exp(Xn*Ke*ge)]};else{var Ye=Math.sqrt(oe),Qe=(R*R-L*L+Pa*oe)/(2*L*Et*Ye),Me=(R*R-L*L-Pa*oe)/(2*R*Et*Ye),Fe=Math.log(Math.sqrt(Qe*Qe+1)-Qe),Ge=Math.log(Math.sqrt(Me*Me+1)-Me);ge=(Ge-Fe)/Xn,ye=function(Ke){var ar=Ke*ge,De=Rn(Fe),Dr=L/(Et*Ye)*(De*hi(Xn*ar+Fe)-xn(Fe));return[w+Dr*X,C+Dr*ie,L*De/Rn(Xn*ar+Fe)]}}return ye.duration=ge*1e3,ye},e.behavior.zoom=function(){var h={x:0,y:0,k:1},g,w,C,L=[960,500],D=ia,G=250,R=0,X="mousedown.zoom",ie="mousemove.zoom",oe="mouseup.zoom",ye,ge="touchstart.zoom",Ye,Qe=Ee(ar,"zoomstart","zoom","zoomend"),Me,Fe,Ge,Ke;$a||($a="onwheel"in a?(Ia=function(){return-e.event.deltaY*(e.event.deltaMode?120:1)},"wheel"):"onmousewheel"in a?(Ia=function(){return e.event.wheelDelta},"mousewheel"):(Ia=function(){return-e.event.detail},"MozMousePixelScroll"));function ar(dt){dt.on(X,Nt).on($a+".zoom",_n).on("dblclick.zoom",Ca).on(ge,ma)}ar.event=function(dt){dt.each(function(){var Yt=Qe.of(this,arguments),jt=h;ml?e.select(this).transition().each("start.zoom",function(){h=this.__chart__||{x:0,y:0,k:1},Lt(Yt)}).tween("zoom:zoom",function(){var va=L[0],Ya=L[1],Dn=w?w[0]:va/2,$n=w?w[1]:Ya/2,Qn=e.interpolateZoom([(Dn-h.x)/h.k,($n-h.y)/h.k,va/h.k],[(Dn-jt.x)/jt.k,($n-jt.y)/jt.k,va/jt.k]);return function(Li){var M=Qn(Li),B=va/M[2];this.__chart__=h={x:Dn-M[0]*B,y:$n-M[1]*B,k:B},Vt(Yt)}}).each("interrupt.zoom",function(){qt(Yt)}).each("end.zoom",function(){qt(Yt)}):(this.__chart__=h,Lt(Yt),Vt(Yt),qt(Yt))})},ar.translate=function(dt){return arguments.length?(h={x:+dt[0],y:+dt[1],k:h.k},Ct(),ar):[h.x,h.y]},ar.scale=function(dt){return arguments.length?(h={x:h.x,y:h.y,k:null},zr(+dt),Ct(),ar):h.k},ar.scaleExtent=function(dt){return arguments.length?(D=dt==null?ia:[+dt[0],+dt[1]],ar):D},ar.center=function(dt){return arguments.length?(C=dt&&[+dt[0],+dt[1]],ar):C},ar.size=function(dt){return arguments.length?(L=dt&&[+dt[0],+dt[1]],ar):L},ar.duration=function(dt){return arguments.length?(G=+dt,ar):G},ar.x=function(dt){return arguments.length?(Fe=dt,Me=dt.copy(),h={x:0,y:0,k:1},ar):Fe},ar.y=function(dt){return arguments.length?(Ke=dt,Ge=dt.copy(),h={x:0,y:0,k:1},ar):Ke};function De(dt){return[(dt[0]-h.x)/h.k,(dt[1]-h.y)/h.k]}function Dr(dt){return[dt[0]*h.k+h.x,dt[1]*h.k+h.y]}function zr(dt){h.k=Math.max(D[0],Math.min(D[1],dt))}function it(dt,Yt){Yt=Dr(Yt),h.x+=dt[0]-Yt[0],h.y+=dt[1]-Yt[1]}function yt(dt,Yt,jt,va){dt.__chart__={x:h.x,y:h.y,k:h.k},zr(Math.pow(2,va)),it(w=Yt,jt),dt=e.select(dt),G>0&&(dt=dt.transition().duration(G)),dt.call(ar.event)}function Ct(){Fe&&Fe.domain(Me.range().map(function(dt){return(dt-h.x)/h.k}).map(Me.invert)),Ke&&Ke.domain(Ge.range().map(function(dt){return(dt-h.y)/h.k}).map(Ge.invert))}function Lt(dt){R++||dt({type:"zoomstart"})}function Vt(dt){Ct(),dt({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function qt(dt){--R||(dt({type:"zoomend"}),w=null)}function Nt(){var dt=this,Yt=Qe.of(dt,arguments),jt=0,va=e.select(i(dt)).on(ie,$n).on(oe,Qn),Ya=De(e.mouse(dt)),Dn=Xr(dt);Ac.call(dt),Lt(Yt);function $n(){jt=1,it(e.mouse(dt),Ya),Vt(Yt)}function Qn(){va.on(ie,null).on(oe,null),Dn(jt),qt(Yt)}}function ma(){var dt=this,Yt=Qe.of(dt,arguments),jt={},va=0,Ya,Dn=".zoom-"+e.event.changedTouches[0].identifier,$n="touchmove"+Dn,Qn="touchend"+Dn,Li=[],M=e.select(dt),B=Xr(dt);he(),Lt(Yt),M.on(X,null).on(ge,he);function V(){var _e=e.touches(dt);return Ya=h.k,_e.forEach(function(He){He.identifier in jt&&(jt[He.identifier]=De(He))}),_e}function he(){var _e=e.event.target;e.select(_e).on($n,xe).on(Qn,we),Li.push(_e);for(var He=e.event.changedTouches,or=0,ir=He.length;or<ir;++or)jt[He[or].identifier]=null;var sr=V(),Qr=Date.now();if(sr.length===1){if(Qr-Ye<500){var Fr=sr[0];yt(dt,Fr,jt[Fr.identifier],Math.floor(Math.log(h.k)/Math.LN2)+1),Le()}Ye=Qr}else if(sr.length>1){var Fr=sr[0],yr=sr[1],Pe=Fr[0]-yr[0],fe=Fr[1]-yr[1];va=Pe*Pe+fe*fe}}function xe(){var _e=e.touches(dt),He,or,ir,sr;Ac.call(dt);for(var Qr=0,Fr=_e.length;Qr<Fr;++Qr,sr=null)if(ir=_e[Qr],sr=jt[ir.identifier]){if(or)break;He=ir,or=sr}if(sr){var yr=(yr=ir[0]-He[0])*yr+(yr=ir[1]-He[1])*yr,Pe=va&&Math.sqrt(yr/va);He=[(He[0]+ir[0])/2,(He[1]+ir[1])/2],or=[(or[0]+sr[0])/2,(or[1]+sr[1])/2],zr(Pe*Ya)}Ye=null,it(He,or),Vt(Yt)}function we(){if(e.event.touches.length){for(var _e=e.event.changedTouches,He=0,or=_e.length;He<or;++He)delete jt[_e[He].identifier];for(var ir in jt)return void V()}e.selectAll(Li).on(Dn,null),M.on(X,Nt).on(ge,ma),B(),qt(Yt)}}function _n(){var dt=Qe.of(this,arguments);ye?clearTimeout(ye):(Ac.call(this),g=De(w=C||e.mouse(this)),Lt(dt)),ye=setTimeout(function(){ye=null,qt(dt)},50),Le(),zr(Math.pow(2,Ia()*.002)*h.k),it(w,g),Vt(dt)}function Ca(){var dt=e.mouse(this),Yt=Math.log(h.k)/Math.LN2;yt(this,dt,De(dt),e.event.shiftKey?Math.ceil(Yt)-1:Math.floor(Yt)+1)}return e.rebind(ar,Qe,"on")};var ia=[0,1/0],Ia,$a;e.color=Qa;function Qa(){}Qa.prototype.toString=function(){return this.rgb()+""},e.hsl=fa;function fa(h,g,w){return this instanceof fa?(this.h=+h,this.s=+g,void(this.l=+w)):arguments.length<2?h instanceof fa?new fa(h.h,h.s,h.l):$t(""+h,ca,fa):new fa(h,g,w)}var Tn=fa.prototype=new Qa;Tn.brighter=function(h){return h=Math.pow(.7,arguments.length?h:1),new fa(this.h,this.s,this.l/h)},Tn.darker=function(h){return h=Math.pow(.7,arguments.length?h:1),new fa(this.h,this.s,h*this.l)},Tn.rgb=function(){return Ka(this.h,this.s,this.l)};function Ka(h,g,w){var C,L;h=isNaN(h)?0:(h%=360)<0?h+360:h,g=isNaN(g)||g<0?0:g>1?1:g,w=w<0?0:w>1?1:w,L=w<=.5?w*(1+g):w+g-w*g,C=2*w-L;function D(R){return R>360?R-=360:R<0&&(R+=360),R<60?C+(L-C)*R/60:R<180?L:R<240?C+(L-C)*(240-R)/60:C}function G(R){return Math.round(D(R)*255)}return new di(G(h+120),G(h),G(h-120))}e.hcl=en;function en(h,g,w){return this instanceof en?(this.h=+h,this.c=+g,void(this.l=+w)):arguments.length<2?h instanceof en?new en(h.h,h.c,h.l):h instanceof dn?Oo(h.l,h.a,h.b):Oo((h=_t((h=e.rgb(h)).r,h.g,h.b)).l,h.a,h.b):new en(h,g,w)}var lo=en.prototype=new Qa;lo.brighter=function(h){return new en(this.h,this.c,Math.min(100,this.l+nn*(arguments.length?h:1)))},lo.darker=function(h){return new en(this.h,this.c,Math.max(0,this.l-nn*(arguments.length?h:1)))},lo.rgb=function(){return Oi(this.h,this.c,this.l).rgb()};function Oi(h,g,w){return isNaN(h)&&(h=0),isNaN(g)&&(g=0),new dn(w,Math.cos(h*=It)*g,Math.sin(h)*g)}e.lab=dn;function dn(h,g,w){return this instanceof dn?(this.l=+h,this.a=+g,void(this.b=+w)):arguments.length<2?h instanceof dn?new dn(h.l,h.a,h.b):h instanceof en?Oi(h.h,h.c,h.l):_t((h=di(h)).r,h.g,h.b):new dn(h,g,w)}var nn=18,Zn=.95047,fs=1,us=1.08883,kl=dn.prototype=new Qa;kl.brighter=function(h){return new dn(Math.min(100,this.l+nn*(arguments.length?h:1)),this.a,this.b)},kl.darker=function(h){return new dn(Math.max(0,this.l-nn*(arguments.length?h:1)),this.a,this.b)},kl.rgb=function(){return Zu(this.l,this.a,this.b)};function Zu(h,g,w){var C=(h+16)/116,L=C+g/500,D=C-w/200;return L=Yf(L)*Zn,C=Yf(C)*fs,D=Yf(D)*us,new di(ji(3.2404542*L-1.5371385*C-.4985314*D),ji(-.969266*L+1.8760108*C+.041556*D),ji(.0556434*L-.2040259*C+1.0572252*D))}function Oo(h,g,w){return h>0?new en(Math.atan2(w,g)*ta,Math.sqrt(g*g+w*w),h):new en(NaN,NaN,h)}function Yf(h){return h>.206893034?h*h*h:(h-4/29)/7.787037}function Wf(h){return h>.008856?Math.pow(h,1/3):7.787037*h+4/29}function ji(h){return Math.round(255*(h<=.00304?12.92*h:1.055*Math.pow(h,1/2.4)-.055))}e.rgb=di;function di(h,g,w){return this instanceof di?(this.r=~~h,this.g=~~g,void(this.b=~~w)):arguments.length<2?h instanceof di?new di(h.r,h.g,h.b):$t(""+h,di,Ka):new di(h,g,w)}function Bi(h){return new di(h>>16,h>>8&255,h&255)}function Cl(h){return Bi(h)+""}var pi=di.prototype=new Qa;pi.brighter=function(h){h=Math.pow(.7,arguments.length?h:1);var g=this.r,w=this.g,C=this.b,L=30;return!g&&!w&&!C?new di(L,L,L):(g&&g<L&&(g=L),w&&w<L&&(w=L),C&&C<L&&(C=L),new di(Math.min(255,g/h),Math.min(255,w/h),Math.min(255,C/h)))},pi.darker=function(h){return h=Math.pow(.7,arguments.length?h:1),new di(h*this.r,h*this.g,h*this.b)},pi.hsl=function(){return ca(this.r,this.g,this.b)},pi.toString=function(){return"#"+Pt(this.r)+Pt(this.g)+Pt(this.b)};function Pt(h){return h<16?"0"+Math.max(0,h).toString(16):Math.min(255,h).toString(16)}function $t(h,g,w){var C=0,L=0,D=0,G,R,X;if(G=/([a-z]+)\((.*)\)/.exec(h=h.toLowerCase()),G)switch(R=G[2].split(","),G[1]){case"hsl":return w(parseFloat(R[0]),parseFloat(R[1])/100,parseFloat(R[2])/100);case"rgb":return g(za(R[0]),za(R[1]),za(R[2]))}return(X=Pn.get(h))?g(X.r,X.g,X.b):(h!=null&&h.charAt(0)==="#"&&!isNaN(X=parseInt(h.slice(1),16))&&(h.length===4?(C=(X&3840)>>4,C=C>>4|C,L=X&240,L=L>>4|L,D=X&15,D=D<<4|D):h.length===7&&(C=(X&16711680)>>16,L=(X&65280)>>8,D=X&255)),g(C,L,D))}function ca(h,g,w){var C=Math.min(h/=255,g/=255,w/=255),L=Math.max(h,g,w),D=L-C,G,R,X=(L+C)/2;return D?(R=X<.5?D/(L+C):D/(2-L-C),h==L?G=(g-w)/D+(g<w?6:0):g==L?G=(w-h)/D+2:G=(h-g)/D+4,G*=60):(G=NaN,R=X>0&&X<1?0:G),new fa(G,R,X)}function _t(h,g,w){h=Jn(h),g=Jn(g),w=Jn(w);var C=Wf((.4124564*h+.3575761*g+.1804375*w)/Zn),L=Wf((.2126729*h+.7151522*g+.072175*w)/fs),D=Wf((.0193339*h+.119192*g+.9503041*w)/us);return dn(116*L-16,500*(C-L),200*(L-D))}function Jn(h){return(h/=255)<=.04045?h/12.92:Math.pow((h+.055)/1.055,2.4)}function za(h){var g=parseFloat(h);return h.charAt(h.length-1)==="%"?Math.round(g*2.55):g}var Pn=e.map({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});Pn.forEach(function(h,g){Pn.set(h,Bi(g))});function ra(h){return typeof h=="function"?h:function(){return h}}e.functor=ra,e.xhr=Ao(le);function Ao(h){return function(g,w,C){return arguments.length===2&&typeof w=="function"&&(C=w,w=null),ol(g,w,h,C)}}function ol(h,g,w,C){var L={},D=e.dispatch("beforesend","progress","load","error"),G={},R=new XMLHttpRequest,X=null;self.XDomainRequest&&!("withCredentials"in R)&&/^(http(s)?:)?\/\//.test(h)&&(R=new XDomainRequest),"onload"in R?R.onload=R.onerror=ie:R.onreadystatechange=function(){R.readyState>3&&ie()};function ie(){var oe=R.status,ye;if(!oe&&Qp(R)||oe>=200&&oe<300||oe===304){try{ye=w.call(L,R)}catch(ge){D.error.call(L,ge);return}D.load.call(L,ye)}else D.error.call(L,R)}return R.onprogress=function(oe){var ye=e.event;e.event=oe;try{D.progress.call(L,R)}finally{e.event=ye}},L.header=function(oe,ye){return oe=(oe+"").toLowerCase(),arguments.length<2?G[oe]:(ye==null?delete G[oe]:G[oe]=ye+"",L)},L.mimeType=function(oe){return arguments.length?(g=oe==null?null:oe+"",L):g},L.responseType=function(oe){return arguments.length?(X=oe,L):X},L.response=function(oe){return w=oe,L},["get","post"].forEach(function(oe){L[oe]=function(){return L.send.apply(L,[oe].concat(t(arguments)))}}),L.send=function(oe,ye,ge){if(arguments.length===2&&typeof ye=="function"&&(ge=ye,ye=null),R.open(oe,h,!0),g!=null&&!("accept"in G)&&(G.accept=g+",*/*"),R.setRequestHeader)for(var Ye in G)R.setRequestHeader(Ye,G[Ye]);return g!=null&&R.overrideMimeType&&R.overrideMimeType(g),X!=null&&(R.responseType=X),ge!=null&&L.on("error",ge).on("load",function(Qe){ge(null,Qe)}),D.beforesend.call(L,R),R.send(ye==null?null:ye),L},L.abort=function(){return R.abort(),L},e.rebind(L,D,"on"),C==null?L:L.get(Si(C))}function Si(h){return h.length===1?function(g,w){h(g==null?w:null)}:h}function Qp(h){var g=h.responseType;return g&&g!=="text"?h.response:h.responseText}e.dsv=function(h,g){var w=new RegExp('["'+h+` ]`),C=h.charCodeAt(0);function L(ie,oe,ye){arguments.length<3&&(ye=oe,oe=null);var ge=ol(ie,g,oe==null?D:G(oe),ye);return ge.row=function(Ye){return arguments.length?ge.response((oe=Ye)==null?D:G(Ye)):oe},ge}function D(ie){return L.parse(ie.responseText)}function G(ie){return function(oe){return L.parse(oe.responseText,ie)}}L.parse=function(ie,oe){var ye;return L.parseRows(ie,function(ge,Ye){if(ye)return ye(ge,Ye-1);var Qe=function(Me){for(var Fe={},Ge=ge.length,Ke=0;Ke<Ge;++Ke)Fe[ge[Ke]]=Me[Ke];return Fe};ye=oe?function(Me,Fe){return oe(Qe(Me),Fe)}:Qe})},L.parseRows=function(ie,oe){var ye={},ge={},Ye=[],Qe=ie.length,Me=0,Fe=0,Ge,Ke;function ar(){if(Me>=Qe)return ge;if(Ke)return Ke=!1,ye;var Dr=Me;if(ie.charCodeAt(Dr)===34){for(var zr=Dr;zr++<Qe;)if(ie.charCodeAt(zr)===34){if(ie.charCodeAt(zr+1)!==34)break;++zr}Me=zr+2;var it=ie.charCodeAt(zr+1);return it===13?(Ke=!0,ie.charCodeAt(zr+2)===10&&++Me):it===10&&(Ke=!0),ie.slice(Dr+1,zr).replace(/""/g,'"')}for(;Me<Qe;){var it=ie.charCodeAt(Me++),yt=1;if(it===10)Ke=!0;else if(it===13)Ke=!0,ie.charCodeAt(Me)===10&&(++Me,++yt);else if(it!==C)continue;return ie.slice(Dr,Me-yt)}return ie.slice(Dr)}for(;(Ge=ar())!==ge;){for(var De=[];Ge!==ye&&Ge!==ge;)De.push(Ge),Ge=ar();oe&&(De=oe(De,Fe++))==null||Ye.push(De)}return Ye},L.format=function(ie){if(Array.isArray(ie[0]))return L.formatRows(ie);var oe=new j,ye=[];return ie.forEach(function(ge){for(var Ye in ge)oe.has(Ye)||ye.push(oe.add(Ye))}),[ye.map(X).join(h)].concat(ie.map(function(ge){return ye.map(function(Ye){return X(ge[Ye])}).join(h)})).join(` `)},L.formatRows=function(ie){return ie.map(R).join(` `)};function R(ie){return ie.map(X).join(h)}function X(ie){return w.test(ie)?'"'+ie.replace(/\"/g,'""')+'"':ie}return L},e.csv=e.dsv(",","text/csv"),e.tsv=e.dsv(" ","text/tab-separated-values");var Mn,Ll,Bo,mi,tf=this[Q(this,"requestAnimationFrame")]||function(h){setTimeout(h,17)};e.timer=function(){zo.apply(this,arguments)};function zo(h,g,w){var C=arguments.length;C<2&&(g=0),C<3&&(w=Date.now());var L=w+g,D={c:h,t:L,n:null};return Ll?Ll.n=D:Mn=D,Ll=D,Bo||(mi=clearTimeout(mi),Bo=1,tf(To)),D}function To(){var h=Dl(),g=Ju()-h;g>24?(isFinite(g)&&(clearTimeout(mi),mi=setTimeout(To,g)),Bo=0):(Bo=1,tf(To))}e.timer.flush=function(){Dl(),Ju()};function Dl(){for(var h=Date.now(),g=Mn;g;)h>=g.t&&g.c(h-g.t)&&(g.c=null),g=g.n;return h}function Ju(){for(var h,g=Mn,w=1/0;g;)g.c?(g.t<w&&(w=g.t),g=(h=g).n):g=h?h.n=g.n:Mn=g.n;return Ll=h,w}e.round=function(h,g){return g?Math.round(h*(g=Math.pow(10,g)))/g:Math.round(h)},e.geom={};function Go(h){return h[0]}function cs(h){return h[1]}e.geom.hull=function(h){var g=Go,w=cs;if(arguments.length)return C(h);function C(L){if(L.length<3)return[];var D=ra(g),G=ra(w),R,X=L.length,ie=[],oe=[];for(R=0;R<X;R++)ie.push([+D.call(this,L[R],R),+G.call(this,L[R],R),R]);for(ie.sort(Kp),R=0;R<X;R++)oe.push([ie[R][0],-ie[R][1]]);var ye=Sh(ie),ge=Sh(oe),Ye=ge[0]===ye[0],Qe=ge[ge.length-1]===ye[ye.length-1],Me=[];for(R=ye.length-1;R>=0;--R)Me.push(L[ie[ye[R]][2]]);for(R=+Ye;R<ge.length-Qe;++R)Me.push(L[ie[ge[R]][2]]);return Me}return C.x=function(L){return arguments.length?(g=L,C):g},C.y=function(L){return arguments.length?(w=L,C):w},C};function Sh(h){for(var g=h.length,w=[0,1],C=2,L=2;L<g;L++){for(;C>1&&Ba(h[w[C-2]],h[w[C-1]],h[L])<=0;)--C;w[C++]=L}return w.slice(0,C)}function Kp(h,g){return h[0]-g[0]||h[1]-g[1]}e.geom.polygon=function(h){return Ae(h,$u),h};var $u=e.geom.polygon.prototype=[];$u.area=function(){for(var h=-1,g=this.length,w,C=this[g-1],L=0;++h<g;)w=C,C=this[h],L+=w[1]*C[0]-w[0]*C[1];return L*.5},$u.centroid=function(h){var g=-1,w=this.length,C=0,L=0,D,G=this[w-1],R;for(arguments.length||(h=-1/(6*this.area()));++g<w;)D=G,G=this[g],R=D[0]*G[1]-G[0]*D[1],C+=(D[0]+G[0])*R,L+=(D[1]+G[1])*R;return[C*h,L*h]},$u.clip=function(h){for(var g,w=Fl(h),C=-1,L=this.length-Fl(this),D,G,R=this[L-1],X,ie,oe;++C<L;){for(g=h.slice(),h.length=0,X=this[C],ie=g[(G=g.length-w)-1],D=-1;++D<G;)oe=g[D],Dv(oe,R,X)?(Dv(ie,R,X)||h.push(vs(ie,oe,R,X)),h.push(oe)):Dv(ie,R,X)&&h.push(vs(ie,oe,R,X)),ie=oe;w&&h.push(h[0]),R=X}return h};function Dv(h,g,w){return(w[0]-g[0])*(h[1]-g[1])<(w[1]-g[1])*(h[0]-g[0])}function vs(h,g,w,C){var L=h[0],D=w[0],G=g[0]-L,R=C[0]-D,X=h[1],ie=w[1],oe=g[1]-X,ye=C[1]-ie,ge=(R*(X-ie)-ye*(L-D))/(ye*G-R*oe);return[L+ge*G,X+ge*oe]}function Fl(h){var g=h[0],w=h[h.length-1];return!(g[0]-w[0]||g[1]-w[1])}var Uo,Mo,yi,af=[],hs,ll,nf=[];function Fv(){sf(this),this.edge=this.site=this.circle=null}function Qu(h){var g=af.pop()||new Fv;return g.site=h,g}function jf(h){lf(h),yi.remove(h),af.push(h),sf(h)}function qv(h){var g=h.circle,w=g.x,C=g.cy,L={x:w,y:C},D=h.P,G=h.N,R=[h];jf(h);for(var X=D;X.circle&&b(w-X.circle.x)<Ne&&b(C-X.circle.cy)<Ne;)D=X.P,R.unshift(X),jf(X),X=D;R.unshift(X),lf(X);for(var ie=G;ie.circle&&b(w-ie.circle.x)<Ne&&b(C-ie.circle.cy)<Ne;)G=ie.N,R.push(ie),jf(ie),ie=G;R.push(ie),lf(ie);var oe=R.length,ye;for(ye=1;ye<oe;++ye)ie=R[ye],X=R[ye-1],ql(ie.edge,X.site,ie.site,L);X=R[0],ie=R[oe-1],ie.edge=Jf(X.site,ie.site,null,L),zi(X),zi(ie)}function Rv(h){for(var g=h.x,w=h.y,C,L,D,G,R=yi._;R;)if(D=Ku(R,w)-g,D>Ne)R=R.L;else if(G=g-Pv(R,w),G>Ne){if(!R.R){C=R;break}R=R.R}else{D>-Ne?(C=R.P,L=R):G>-Ne?(C=R,L=R.N):C=L=R;break}var X=Qu(h);if(yi.insert(C,X),!(!C&&!L)){if(C===L){lf(C),L=Qu(C.site),yi.insert(X,L),X.edge=L.edge=Jf(C.site,X.site),zi(C),zi(L);return}if(!L){X.edge=Jf(C.site,X.site);return}lf(C),lf(L);var ie=C.site,oe=ie.x,ye=ie.y,ge=h.x-oe,Ye=h.y-ye,Qe=L.site,Me=Qe.x-oe,Fe=Qe.y-ye,Ge=2*(ge*Fe-Ye*Me),Ke=ge*ge+Ye*Ye,ar=Me*Me+Fe*Fe,De={x:(Fe*Ke-Ye*ar)/Ge+oe,y:(ge*ar-Me*Ke)/Ge+ye};ql(L.edge,ie,Qe,De),X.edge=Jf(ie,h,null,De),L.edge=Jf(h,Qe,null,De),zi(C),zi(L)}}function Ku(h,g){var w=h.site,C=w.x,L=w.y,D=L-g;if(!D)return C;var G=h.P;if(!G)return-1/0;w=G.site;var R=w.x,X=w.y,ie=X-g;if(!ie)return R;var oe=R-C,ye=1/D-1/ie,ge=oe/ie;return ye?(-ge+Math.sqrt(ge*ge-2*ye*(oe*oe/(-2*ie)-X+ie/2+L-D/2)))/ye+C:(C+R)/2}function Pv(h,g){var w=h.N;if(w)return Ku(w,g);var C=h.site;return C.y===g?C.x:1/0}function ec(h){this.site=h,this.edges=[]}ec.prototype.prepare=function(){for(var h=this.edges,g=h.length,w;g--;)w=h[g].edge,(!w.b||!w.a)&&h.splice(g,1);return h.sort(of),h.length};function So(h){for(var g=h[0][0],w=h[1][0],C=h[0][1],L=h[1][1],D,G,R,X,ie=Mo,oe=ie.length,ye,ge,Ye,Qe,Me,Fe;oe--;)if(ye=ie[oe],!(!ye||!ye.prepare()))for(Ye=ye.edges,Qe=Ye.length,ge=0;ge<Qe;)Fe=Ye[ge].end(),R=Fe.x,X=Fe.y,Me=Ye[++ge%Qe].start(),D=Me.x,G=Me.y,(b(R-D)>Ne||b(X-G)>Ne)&&(Ye.splice(ge,0,new rc(t1(ye.site,Fe,b(R-g)<Ne&&L-X>Ne?{x:g,y:b(D-g)<Ne?G:L}:b(X-L)<Ne&&w-R>Ne?{x:b(G-L)<Ne?D:w,y:L}:b(R-w)<Ne&&X-C>Ne?{x:w,y:b(D-w)<Ne?G:C}:b(X-C)<Ne&&R-g>Ne?{x:b(G-C)<Ne?D:g,y:C}:null),ye.site,null)),++Qe)}function of(h,g){return g.angle-h.angle}function Xf(){sf(this),this.x=this.y=this.arc=this.site=this.cy=null}function zi(h){var g=h.P,w=h.N;if(!(!g||!w)){var C=g.site,L=h.site,D=w.site;if(C!==D){var G=L.x,R=L.y,X=C.x-G,ie=C.y-R,oe=D.x-G,Fe=D.y-R,ye=2*(X*Fe-ie*oe);if(!(ye>=-pr)){var ge=X*X+ie*ie,Ye=oe*oe+Fe*Fe,Qe=(Fe*ge-ie*Ye)/ye,Me=(X*Ye-oe*ge)/ye,Fe=Me+R,Ge=nf.pop()||new Xf;Ge.arc=h,Ge.site=L,Ge.x=Qe+G,Ge.y=Fe+Math.sqrt(Qe*Qe+Me*Me),Ge.cy=Fe,h.circle=Ge;for(var Ke=null,ar=ll._;ar;)if(Ge.y<ar.y||Ge.y===ar.y&&Ge.x<=ar.x)if(ar.L)ar=ar.L;else{Ke=ar.P;break}else if(ar.R)ar=ar.R;else{Ke=ar;break}ll.insert(Ke,Ge),Ke||(hs=Ge)}}}}function lf(h){var g=h.circle;g&&(g.P||(hs=g.N),ll.remove(g),nf.push(g),sf(g),h.circle=null)}function e1(h,g,w,C){return function(L){var D=L.a,G=L.b,R=D.x,X=D.y,ie=G.x,oe=G.y,ye=0,ge=1,Ye=ie-R,Qe=oe-X,Me;if(Me=h-R,!(!Ye&&Me>0)){if(Me/=Ye,Ye<0){if(Me<ye)return;Me<ge&&(ge=Me)}else if(Ye>0){if(Me>ge)return;Me>ye&&(ye=Me)}if(Me=w-R,!(!Ye&&Me<0)){if(Me/=Ye,Ye<0){if(Me>ge)return;Me>ye&&(ye=Me)}else if(Ye>0){if(Me<ye)return;Me<ge&&(ge=Me)}if(Me=g-X,!(!Qe&&Me>0)){if(Me/=Qe,Qe<0){if(Me<ye)return;Me<ge&&(ge=Me)}else if(Qe>0){if(Me>ge)return;Me>ye&&(ye=Me)}if(Me=C-X,!(!Qe&&Me<0)){if(Me/=Qe,Qe<0){if(Me>ge)return;Me>ye&&(ye=Me)}else if(Qe>0){if(Me<ye)return;Me<ge&&(ge=Me)}return ye>0&&(L.a={x:R+ye*Ye,y:X+ye*Qe}),ge<1&&(L.b={x:R+ge*Ye,y:X+ge*Qe}),L}}}}}}function r1(h){for(var g=Uo,w=e1(h[0][0],h[0][1],h[1][0],h[1][1]),C=g.length,L;C--;)L=g[C],(!Zf(L,h)||!w(L)||b(L.a.x-L.b.x)<Ne&&b(L.a.y-L.b.y)<Ne)&&(L.a=L.b=null,g.splice(C,1))}function Zf(h,g){var w=h.b;if(w)return!0;var C=h.a,L=g[0][0],D=g[1][0],G=g[0][1],R=g[1][1],X=h.l,ie=h.r,oe=X.x,ye=X.y,ge=ie.x,Ye=ie.y,Qe=(oe+ge)/2,Me=(ye+Ye)/2,Fe,Ge;if(Ye===ye){if(Qe<L||Qe>=D)return;if(oe>ge){if(!C)C={x:Qe,y:G};else if(C.y>=R)return;w={x:Qe,y:R}}else{if(!C)C={x:Qe,y:R};else if(C.y<G)return;w={x:Qe,y:G}}}else if(Fe=(oe-ge)/(Ye-ye),Ge=Me-Fe*Qe,Fe<-1||Fe>1)if(oe>ge){if(!C)C={x:(G-Ge)/Fe,y:G};else if(C.y>=R)return;w={x:(R-Ge)/Fe,y:R}}else{if(!C)C={x:(R-Ge)/Fe,y:R};else if(C.y<G)return;w={x:(G-Ge)/Fe,y:G}}else if(ye<Ye){if(!C)C={x:L,y:Fe*L+Ge};else if(C.x>=D)return;w={x:D,y:Fe*D+Ge}}else{if(!C)C={x:D,y:Fe*D+Ge};else if(C.x<L)return;w={x:L,y:Fe*L+Ge}}return h.a=C,h.b=w,!0}function Eh(h,g){this.l=h,this.r=g,this.a=this.b=null}function Jf(h,g,w,C){var L=new Eh(h,g);return Uo.push(L),w&&ql(L,h,g,w),C&&ql(L,g,h,C),Mo[h.i].edges.push(new rc(L,h,g)),Mo[g.i].edges.push(new rc(L,g,h)),L}function t1(h,g,w){var C=new Eh(h,null);return C.a=g,C.b=w,Uo.push(C),C}function ql(h,g,w,C){!h.a&&!h.b?(h.a=C,h.l=g,h.r=w):h.l===w?h.b=C:h.a=C}function rc(h,g,w){var C=h.a,L=h.b;this.edge=h,this.site=g,this.angle=w?Math.atan2(w.y-g.y,w.x-g.x):h.l===g?Math.atan2(L.x-C.x,C.y-L.y):Math.atan2(C.x-L.x,L.y-C.y)}rc.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}};function ds(){this._=null}function sf(h){h.U=h.C=h.L=h.R=h.P=h.N=null}ds.prototype={insert:function(h,g){var w,C,L;if(h){if(g.P=h,g.N=h.N,h.N&&(h.N.P=g),h.N=g,h.R){for(h=h.R;h.L;)h=h.L;h.L=g}else h.R=g;w=h}else this._?(h=kh(this._),g.P=null,g.N=h,h.P=h.L=g,w=h):(g.P=g.N=null,this._=g,w=null);for(g.L=g.R=null,g.U=w,g.C=!0,h=g;w&&w.C;)C=w.U,w===C.L?(L=C.R,L&&L.C?(w.C=L.C=!1,C.C=!0,h=C):(h===w.R&&(ps(this,w),h=w,w=h.U),w.C=!1,C.C=!0,sl(this,C))):(L=C.L,L&&L.C?(w.C=L.C=!1,C.C=!0,h=C):(h===w.L&&(sl(this,w),h=w,w=h.U),w.C=!1,C.C=!0,ps(this,C)