Created
October 4, 2019 21:22
-
-
Save anupkalburgi/834b1dcd6995ea90d74ce3664ed877f3 to your computer and use it in GitHub Desktop.
Quickstart Visual
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head><title>DAML Visualization</title><meta charset="utf-8"></head> | |
| <body> | |
| <div id='viz'></div> | |
| <script> | |
| !function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:NaN}function r(n){return null===n?NaN:+n}function u(n){return!isNaN(n)}function i(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function a(n){return n.length}function o(n){for(var t=1;n*t%1;)t*=10;return t}function l(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function c(){this._=Object.create(null)}function s(n){return(n+="")===xa||n[0]===ba?ba+n:n}function f(n){return(n+="")[0]===ba?n.slice(1):n}function h(n){return s(n)in this._}function g(n){return(n=s(n))in this._&&delete this._[n]}function p(){var n=[];for(var t in this._)n.push(f(t));return n}function v(){var n=0;for(var t in this._)++n;return n}function d(){for(var n in this._)return!1;return!0}function m(){this._=Object.create(null)}function y(n){return n}function M(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function x(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=_a.length;r>e;++e){var u=_a[e]+t;if(u in n)return u}}function b(){}function _(){}function w(n){function t(){for(var t,r=e,u=-1,i=r.length;++u<i;)(t=r[u].on)&&t.apply(this,arguments);return n}var e=[],r=new c;return t.on=function(t,u){var i,a=r.get(t);return arguments.length<2?a&&a.on:(a&&(a.on=null,e=e.slice(0,i=e.indexOf(a)).concat(e.slice(i+1)),r.remove(t)),u&&e.push(r.set(t,{on:u})),n)},t}function S(){oa.event.preventDefault()}function k(){for(var n,t=oa.event;n=t.sourceEvent;)t=n;return t}function N(n){for(var t=new _,e=0,r=arguments.length;++e<r;)t[arguments[e]]=w(t);return t.of=function(e,r){return function(u){try{var i=u.sourceEvent=oa.event;u.target=n,oa.event=u,t[u.type].apply(e,r)}finally{oa.event=i}}},t}function E(n){return Sa(n,Aa),n}function A(n){return"function"==typeof n?n:function(){return ka(n,this)}}function C(n){return"function"==typeof n?n:function(){return Na(n,this)}}function z(n,t){function e(){this.removeAttribute(n)}function r(){this.removeAttributeNS(n.space,n.local)}function u(){this.setAttribute(n,t)}function i(){this.setAttributeNS(n.space,n.local,t)}function a(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}function o(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}return n=oa.ns.qualify(n),null==t?n.local?r:e:"function"==typeof t?n.local?o:a:n.local?i:u}function L(n){return n.trim().replace(/\s+/g," ")}function q(n){return new RegExp("(?:^|\\s+)"+oa.requote(n)+"(?:\\s+|$)","g")}function T(n){return(n+"").trim().split(/^|\s+/)}function R(n,t){function e(){for(var e=-1;++e<u;)n[e](this,t)}function r(){for(var e=-1,r=t.apply(this,arguments);++e<u;)n[e](this,r)}n=T(n).map(D);var u=n.length;return"function"==typeof t?r:e}function D(n){var t=q(n);return function(e,r){if(u=e.classList)return r?u.add(n):u.remove(n);var u=e.getAttribute("class")||"";r?(t.lastIndex=0,t.test(u)||e.setAttribute("class",L(u+" "+n))):e.setAttribute("class",L(u.replace(t," ")))}}function P(n,t,e){function r(){this.style.removeProperty(n)}function u(){this.style.setProperty(n,t,e)}function i(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}return null==t?r:"function"==typeof t?i:u}function U(n,t){function e(){delete this[n]}function r(){this[n]=t}function u(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}return null==t?e:"function"==typeof t?u:r}function j(n){function t(){var t=this.ownerDocument,e=this.namespaceURI;return e&&e!==t.documentElement.namespaceURI?t.createElementNS(e,n):t.createElement(n)}function e(){return this.ownerDocument.createElementNS(n.space,n.local)}return"function"==typeof n?n:(n=oa.ns.qualify(n)).local?e:t}function F(){var n=this.parentNode;n&&n.removeChild(this)}function H(n){return{__data__:n}}function O(n){return function(){return Ea(this,n)}}function I(n){return arguments.length||(n=e),function(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}}function Y(n,t){for(var e=0,r=n.length;r>e;e++)for(var u,i=n[e],a=0,o=i.length;o>a;a++)(u=i[a])&&t(u,a,e);return n}function Z(n){return Sa(n,za),n}function V(n){var t,e;return function(r,u,i){var a,o=n[i].update,l=o.length;for(i!=e&&(e=i,t=0),u>=t&&(t=u+1);!(a=o[t])&&++t<l;);return a}}function X(n,t,e){function r(){var t=this[a];t&&(this.removeEventListener(n,t,t.$),delete this[a])}function u(){var u=l(t,ca(arguments));r.call(this),this.addEventListener(n,this[a]=u,u.$=e),u._=t}function i(){var t,e=new RegExp("^__on([^.]+)"+oa.requote(n)+"$");for(var r in this)if(t=r.match(e)){var u=this[r];this.removeEventListener(t[1],u,u.$),delete this[r]}}var a="__on"+n,o=n.indexOf("."),l=$;o>0&&(n=n.slice(0,o));var c=La.get(n);return c&&(n=c,l=B),o?t?u:r:t?b:i}function $(n,t){return function(e){var r=oa.event;oa.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{oa.event=r}}}function B(n,t){var e=$(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function W(e){var r=".dragsuppress-"+ ++Ta,u="click"+r,i=oa.select(t(e)).on("touchmove"+r,S).on("dragstart"+r,S).on("selectstart"+r,S);if(null==qa&&(qa="onselectstart"in e?!1:x(e.style,"userSelect")),qa){var a=n(e).style,o=a[qa];a[qa]="none"}return function(n){if(i.on(r,null),qa&&(a[qa]=o),n){var t=function(){i.on(u,null)};i.on(u,function(){S(),t()},!0),setTimeout(t,0)}}}function J(n,e){e.changedTouches&&(e=e.changedTouches[0]);var r=n.ownerSVGElement||n;if(r.createSVGPoint){var u=r.createSVGPoint();if(0>Ra){var i=t(n);if(i.scrollX||i.scrollY){r=oa.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var a=r[0][0].getScreenCTM();Ra=!(a.f||a.e),r.remove()}}return Ra?(u.x=e.pageX,u.y=e.pageY):(u.x=e.clientX,u.y=e.clientY),u=u.matrixTransform(n.getScreenCTM().inverse()),[u.x,u.y]}var o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}function G(){return oa.event.changedTouches[0].identifier}function K(n){return n>0?1:0>n?-1:0}function Q(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function nn(n){return n>1?0:-1>n?Ua:Math.acos(n)}function tn(n){return n>1?Ha:-1>n?-Ha:Math.asin(n)}function en(n){return((n=Math.exp(n))-1/n)/2}function rn(n){return((n=Math.exp(n))+1/n)/2}function un(n){return((n=Math.exp(2*n))-1)/(n+1)}function an(n){return(n=Math.sin(n/2))*n}function on(){}function ln(n,t,e){return this instanceof ln?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof ln?new ln(n.h,n.s,n.l):_n(""+n,wn,ln):new ln(n,t,e)}function cn(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?i+(a-i)*n/60:180>n?a:240>n?i+(a-i)*(240-n)/60:i}function u(n){return Math.round(255*r(n))}var i,a;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,a=.5>=e?e*(1+t):e+t-e*t,i=2*e-a,new yn(u(n+120),u(n),u(n-120))}function sn(n,t,e){return this instanceof sn?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof sn?new sn(n.h,n.c,n.l):n instanceof hn?pn(n.l,n.a,n.b):pn((n=Sn((n=oa.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new sn(n,t,e)}function fn(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new hn(e,Math.cos(n*=Oa)*t,Math.sin(n)*t)}function hn(n,t,e){return this instanceof hn?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof hn?new hn(n.l,n.a,n.b):n instanceof sn?fn(n.h,n.c,n.l):Sn((n=yn(n)).r,n.g,n.b):new hn(n,t,e)}function gn(n,t,e){var r=(n+16)/116,u=r+t/500,i=r-e/200;return u=vn(u)*Ka,r=vn(r)*Qa,i=vn(i)*no,new yn(mn(3.2404542*u-1.5371385*r-.4985314*i),mn(-.969266*u+1.8760108*r+.041556*i),mn(.0556434*u-.2040259*r+1.0572252*i))}function pn(n,t,e){return n>0?new sn(Math.atan2(e,t)*Ia,Math.sqrt(t*t+e*e),n):new sn(NaN,NaN,n)}function vn(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function dn(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function mn(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function yn(n,t,e){return this instanceof yn?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof yn?new yn(n.r,n.g,n.b):_n(""+n,yn,cn):new yn(n,t,e)}function Mn(n){return new yn(n>>16,n>>8&255,255&n)}function xn(n){return Mn(n)+""}function bn(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function _n(n,t,e){var r,u,i,a=0,o=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(n=n.toLowerCase()))switch(u=r[2].split(","),r[1]){case"hsl":return e(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(Nn(u[0]),Nn(u[1]),Nn(u[2]))}return(i=ro.get(n))?t(i.r,i.g,i.b):(null==n||"#"!==n.charAt(0)||isNaN(i=parseInt(n.slice(1),16))||(4===n.length?(a=(3840&i)>>4,a=a>>4|a,o=240&i,o=o>>4|o,l=15&i,l=l<<4|l):7===n.length&&(a=(16711680&i)>>16,o=(65280&i)>>8,l=255&i)),t(a,o,l))}function wn(n,t,e){var r,u,i=Math.min(n/=255,t/=255,e/=255),a=Math.max(n,t,e),o=a-i,l=(a+i)/2;return o?(u=.5>l?o/(a+i):o/(2-a-i),r=n==a?(t-e)/o+(e>t?6:0):t==a?(e-n)/o+2:(n-t)/o+4,r*=60):(r=NaN,u=l>0&&1>l?0:r),new ln(r,u,l)}function Sn(n,t,e){n=kn(n),t=kn(t),e=kn(e);var r=dn((.4124564*n+.3575761*t+.1804375*e)/Ka),u=dn((.2126729*n+.7151522*t+.072175*e)/Qa),i=dn((.0193339*n+.119192*t+.9503041*e)/no);return hn(116*u-16,500*(r-u),200*(u-i))}function kn(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Nn(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function En(n){return"function"==typeof n?n:function(){return n}}function An(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),Cn(t,e,n,r)}}function Cn(n,t,e,r){function u(){var n,t=l.status;if(!t&&Ln(l)||t>=200&&300>t||304===t){try{n=e.call(i,l)}catch(r){return void a.error.call(i,r)}a.load.call(i,n)}else a.error.call(i,l)}var i={},a=oa.dispatch("beforesend","progress","load","error"),o={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(n)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=u:l.onreadystatechange=function(){l.readyState>3&&u()},l.onprogress=function(n){var t=oa.event;oa.event=n;try{a.progress.call(i,l)}finally{oa.event=t}},i.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?o[n]:(null==t?delete o[n]:o[n]=t+"",i)},i.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",i):t},i.responseType=function(n){return arguments.length?(c=n,i):c},i.response=function(n){return e=n,i},["get","post"].forEach(function(n){i[n]=function(){return i.send.apply(i,[n].concat(ca(arguments)))}}),i.send=function(e,r,u){if(2===arguments.length&&"function"==typeof r&&(u=r,r=null),l.open(e,n,!0),null==t||"accept"in o||(o.accept=t+",*/*"),l.setRequestHeader)for(var s in o)l.setRequestHeader(s,o[s]);return null!=t&&l.overrideMimeType&&l.overrideMimeType(t),null!=c&&(l.responseType=c),null!=u&&i.on("error",u).on("load",function(n){u(null,n)}),a.beforesend.call(i,l),l.send(null==r?null:r),i},i.abort=function(){return l.abort(),i},oa.rebind(i,a,"on"),null==r?i:i.get(zn(r))}function zn(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function Ln(n){var t=n.responseType;return t&&"text"!==t?n.response:n.responseText}function qn(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var u=e+t,i={c:n,t:u,n:null};return io?io.n=i:uo=i,io=i,ao||(oo=clearTimeout(oo),ao=1,lo(Tn)),i}function Tn(){var n=Rn(),t=Dn()-n;t>24?(isFinite(t)&&(clearTimeout(oo),oo=setTimeout(Tn,t)),ao=0):(ao=1,lo(Tn))}function Rn(){for(var n=Date.now(),t=uo;t;)n>=t.t&&t.c(n-t.t)&&(t.c=null),t=t.n;return n}function Dn(){for(var n,t=uo,e=1/0;t;)t.c?(t.t<e&&(e=t.t),t=(n=t).n):t=n?n.n=t.n:uo=t.n;return io=n,e}function Pn(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function Un(n,t){var e=Math.pow(10,3*Ma(8-t));return{scale:t>8?function(n){return n/e}:function(n){return n*e},symbol:n}}function jn(n){var t=n.decimal,e=n.thousands,r=n.grouping,u=n.currency,i=r&&e?function(n,t){for(var u=n.length,i=[],a=0,o=r[0],l=0;u>0&&o>0&&(l+o+1>t&&(o=Math.max(1,t-l)),i.push(n.substring(u-=o,u+o)),!((l+=o+1)>t));)o=r[a=(a+1)%r.length];return i.reverse().join(e)}:y;return function(n){var e=so.exec(n),r=e[1]||" ",a=e[2]||">",o=e[3]||"-",l=e[4]||"",c=e[5],s=+e[6],f=e[7],h=e[8],g=e[9],p=1,v="",d="",m=!1,y=!0;switch(h&&(h=+h.substring(1)),(c||"0"===r&&"="===a)&&(c=r="0",a="="),g){case"n":f=!0,g="g";break;case"%":p=100,d="%",g="f";break;case"p":p=100,d="%",g="r";break;case"b":case"o":case"x":case"X":"#"===l&&(v="0"+g.toLowerCase());case"c":y=!1;case"d":m=!0,h=0;break;case"s":p=-1,g="r"}"$"===l&&(v=u[0],d=u[1]),"r"!=g||h||(g="g"),null!=h&&("g"==g?h=Math.max(1,Math.min(21,h)):("e"==g||"f"==g)&&(h=Math.max(0,Math.min(20,h)))),g=fo.get(g)||Fn;var M=c&&f;return function(n){var e=d;if(m&&n%1)return"";var u=0>n||0===n&&0>1/n?(n=-n,"-"):"-"===o?"":o;if(0>p){var l=oa.formatPrefix(n,h);n=l.scale(n),e=l.symbol+d}else n*=p;n=g(n,h);var x,b,_=n.lastIndexOf(".");if(0>_){var w=y?n.lastIndexOf("e"):-1;0>w?(x=n,b=""):(x=n.substring(0,w),b=n.substring(w))}else x=n.substring(0,_),b=t+n.substring(_+1);!c&&f&&(x=i(x,1/0));var S=v.length+x.length+b.length+(M?0:u.length),k=s>S?new Array(S=s-S+1).join(r):"";return M&&(x=i(k+x,k.length?s-b.length:1/0)),u+=v,n=x+b,("<"===a?u+n+k:">"===a?k+u+n:"^"===a?k.substring(0,S>>=1)+u+n+k.substring(S):u+(M?n:k+n))+e}}}function Fn(n){return n+""}function Hn(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function On(n,t,e){function r(t){var e=n(t),r=i(e,1);return r-t>t-e?e:r}function u(e){return t(e=n(new go(e-1)),1),e}function i(n,e){return t(n=new go(+n),e),n}function a(n,r,i){var a=u(n),o=[];if(i>1)for(;r>a;)e(a)%i||o.push(new Date(+a)),t(a,1);else for(;r>a;)o.push(new Date(+a)),t(a,1);return o}function o(n,t,e){try{go=Hn;var r=new Hn;return r._=n,a(r,t,e)}finally{go=Date}}n.floor=n,n.round=r,n.ceil=u,n.offset=i,n.range=a;var l=n.utc=In(n);return l.floor=l,l.round=In(r),l.ceil=In(u),l.offset=In(i),l.range=o,n}function In(n){return function(t,e){try{go=Hn;var r=new Hn;return r._=t,n(r,e)._}finally{go=Date}}}function Yn(n){function t(n){function t(t){for(var e,u,i,a=[],o=-1,l=0;++o<r;)37===n.charCodeAt(o)&&(a.push(n.slice(l,o)),null!=(u=vo[e=n.charAt(++o)])&&(e=n.charAt(++o)),(i=A[e])&&(e=i(t,null==u?"e"===e?" ":"0":u)),a.push(e),l=o+1);return a.push(n.slice(l,o)),a.join("")}var r=n.length;return t.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},u=e(r,n,t,0);if(u!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var i=null!=r.Z&&go!==Hn,a=new(i?Hn:go);return"j"in r?a.setFullYear(r.y,0,r.j):"W"in r||"U"in r?("w"in r||(r.w="W"in r?1:0),a.setFullYear(r.y,0,1),a.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(a.getDay()+5)%7:r.w+7*r.U-(a.getDay()+6)%7)):a.setFullYear(r.y,r.m,r.d),a.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),i?a._:a},t.toString=function(){return n},t}function e(n,t,e,r){for(var u,i,a,o=0,l=t.length,c=e.length;l>o;){if(r>=c)return-1;if(u=t.charCodeAt(o++),37===u){if(a=t.charAt(o++),i=C[a in vo?t.charAt(o++):a],!i||(r=i(n,e,r))<0)return-1}else if(u!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){_.lastIndex=0;var r=_.exec(t.slice(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){x.lastIndex=0;var r=x.exec(t.slice(e));return r?(n.w=b.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){N.lastIndex=0;var r=N.exec(t.slice(e));return r?(n.m=E.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,e){S.lastIndex=0;var r=S.exec(t.slice(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,r){return e(n,A.c.toString(),t,r)}function l(n,t,r){return e(n,A.x.toString(),t,r)}function c(n,t,r){return e(n,A.X.toString(),t,r)}function s(n,t,e){var r=M.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var f=n.dateTime,h=n.date,g=n.time,p=n.periods,v=n.days,d=n.shortDays,m=n.months,y=n.shortMonths;t.utc=function(n){function e(n){try{go=Hn;var t=new go;return t._=n,r(t)}finally{go=Date}}var r=t(n);return e.parse=function(n){try{go=Hn;var t=r.parse(n);return t&&t._}finally{go=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=ct;var M=oa.map(),x=Vn(v),b=Xn(v),_=Vn(d),w=Xn(d),S=Vn(m),k=Xn(m),N=Vn(y),E=Xn(y);p.forEach(function(n,t){M.set(n.toLowerCase(),t)});var A={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return y[n.getMonth()]},B:function(n){return m[n.getMonth()]},c:t(f),d:function(n,t){return Zn(n.getDate(),t,2)},e:function(n,t){return Zn(n.getDate(),t,2)},H:function(n,t){return Zn(n.getHours(),t,2)},I:function(n,t){return Zn(n.getHours()%12||12,t,2)},j:function(n,t){return Zn(1+ho.dayOfYear(n),t,3)},L:function(n,t){return Zn(n.getMilliseconds(),t,3)},m:function(n,t){return Zn(n.getMonth()+1,t,2)},M:function(n,t){return Zn(n.getMinutes(),t,2)},p:function(n){return p[+(n.getHours()>=12)]},S:function(n,t){return Zn(n.getSeconds(),t,2)},U:function(n,t){return Zn(ho.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return Zn(ho.mondayOfYear(n),t,2)},x:t(h),X:t(g),y:function(n,t){return Zn(n.getFullYear()%100,t,2)},Y:function(n,t){return Zn(n.getFullYear()%1e4,t,4)},Z:ot,"%":function(){return"%"}},C={a:r,A:u,b:i,B:a,c:o,d:tt,e:tt,H:rt,I:rt,j:et,L:at,m:nt,M:ut,p:s,S:it,U:Bn,w:$n,W:Wn,x:l,X:c,y:Gn,Y:Jn,Z:Kn,"%":lt};return t}function Zn(n,t,e){var r=0>n?"-":"",u=(r?-n:n)+"",i=u.length;return r+(e>i?new Array(e-i+1).join(t)+u:u)}function Vn(n){return new RegExp("^(?:"+n.map(oa.requote).join("|")+")","i")}function Xn(n){for(var t=new c,e=-1,r=n.length;++e<r;)t.set(n[e].toLowerCase(),e);return t}function $n(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+1));return r?(n.w=+r[0],e+r[0].length):-1}function Bn(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e));return r?(n.U=+r[0],e+r[0].length):-1}function Wn(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e));return r?(n.W=+r[0],e+r[0].length):-1}function Jn(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+4));return r?(n.y=+r[0],e+r[0].length):-1}function Gn(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+2));return r?(n.y=Qn(+r[0]),e+r[0].length):-1}function Kn(n,t,e){return/^[+-]\d{4}$/.test(t=t.slice(e,e+5))?(n.Z=-t,e+5):-1}function Qn(n){return n+(n>68?1900:2e3)}function nt(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function tt(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function et(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function rt(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function ut(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function it(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function at(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function ot(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=Ma(t)/60|0,u=Ma(t)%60;return e+Zn(r,"0",2)+Zn(u,"0",2)}function lt(n,t,e){yo.lastIndex=0;var r=yo.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function ct(n){for(var t=n.length,e=-1;++e<t;)n[e][0]=this(n[e][0]);return function(t){for(var e=0,r=n[e];!r[1](t);)r=n[++e];return r[0](t)}}function st(){}function ft(n,t,e){var r=e.s=n+t,u=r-n,i=r-u;e.t=n-i+(t-u)}function ht(n,t){n&&_o.hasOwnProperty(n.type)&&_o[n.type](n,t)}function gt(n,t,e){var r,u=-1,i=n.length-e;for(t.lineStart();++u<i;)r=n[u],t.point(r[0],r[1],r[2]);t.lineEnd()}function pt(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)gt(n[e],t,1);t.polygonEnd()}function vt(){function n(n,t){n*=Oa,t=t*Oa/2+Ua/4;var e=n-r,a=e>=0?1:-1,o=a*e,l=Math.cos(t),c=Math.sin(t),s=i*c,f=u*l+s*Math.cos(o),h=s*a*Math.sin(o);So.add(Math.atan2(h,f)),r=n,u=l,i=c}var t,e,r,u,i;ko.point=function(a,o){ko.point=n,r=(t=a)*Oa,u=Math.cos(o=(e=o)*Oa/2+Ua/4),i=Math.sin(o)},ko.lineEnd=function(){n(t,e)}}function dt(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function mt(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function yt(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Mt(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function xt(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function bt(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function _t(n){return[Math.atan2(n[1],n[0]),tn(n[2])]}function wt(n,t){return Ma(n[0]-t[0])<Da&&Ma(n[1]-t[1])<Da}function St(n,t){n*=Oa;var e=Math.cos(t*=Oa);kt(e*Math.cos(n),e*Math.sin(n),Math.sin(t))}function kt(n,t,e){++No,Ao+=(n-Ao)/No,Co+=(t-Co)/No,zo+=(e-zo)/No}function Nt(){function n(n,u){n*=Oa;var i=Math.cos(u*=Oa),a=i*Math.cos(n),o=i*Math.sin(n),l=Math.sin(u),c=Math.atan2(Math.sqrt((c=e*l-r*o)*c+(c=r*a-t*l)*c+(c=t*o-e*a)*c),t*a+e*o+r*l);Eo+=c,Lo+=c*(t+(t=a)),qo+=c*(e+(e=o)),To+=c*(r+(r=l)),kt(t,e,r)}var t,e,r;Uo.point=function(u,i){u*=Oa;var a=Math.cos(i*=Oa);t=a*Math.cos(u),e=a*Math.sin(u),r=Math.sin(i),Uo.point=n,kt(t,e,r)}}function Et(){Uo.point=St}function At(){function n(n,t){n*=Oa;var e=Math.cos(t*=Oa),a=e*Math.cos(n),o=e*Math.sin(n),l=Math.sin(t),c=u*l-i*o,s=i*a-r*l,f=r*o-u*a,h=Math.sqrt(c*c+s*s+f*f),g=r*a+u*o+i*l,p=h&&-nn(g)/h,v=Math.atan2(h,g);Ro+=p*c,Do+=p*s,Po+=p*f,Eo+=v,Lo+=v*(r+(r=a)),qo+=v*(u+(u=o)),To+=v*(i+(i=l)),kt(r,u,i)}var t,e,r,u,i;Uo.point=function(a,o){t=a,e=o,Uo.point=n,a*=Oa;var l=Math.cos(o*=Oa);r=l*Math.cos(a),u=l*Math.sin(a),i=Math.sin(o),kt(r,u,i)},Uo.lineEnd=function(){n(t,e),Uo.lineEnd=Et,Uo.point=St}}function Ct(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.invert&&t.invert&&(e.invert=function(e,r){return e=t.invert(e,r),e&&n.invert(e[0],e[1])}),e}function zt(){return!0}function Lt(n,t,e,r,u){var i=[],a=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,e=n[0],r=n[t];if(wt(e,r)){u.lineStart();for(var o=0;t>o;++o)u.point((e=n[o])[0],e[1]);return void u.lineEnd()}var l=new Tt(e,n,null,!0),c=new Tt(e,null,l,!1);l.o=c,i.push(l),a.push(c),l=new Tt(r,n,null,!1),c=new Tt(r,null,l,!0),l.o=c,i.push(l),a.push(c)}}),a.sort(t),qt(i),qt(a),i.length){for(var o=0,l=e,c=a.length;c>o;++o)a[o].e=l=!l;for(var s,f,h=i[0];;){for(var g=h,p=!0;g.v;)if((g=g.n)===h)return;s=g.z,u.lineStart();do{if(g.v=g.o.v=!0,g.e){if(p)for(var o=0,c=s.length;c>o;++o)u.point((f=s[o])[0],f[1]);else r(g.x,g.n.x,1,u);g=g.n}else{if(p){s=g.p.z;for(var o=s.length-1;o>=0;--o)u.point((f=s[o])[0],f[1])}else r(g.x,g.p.x,-1,u);g=g.p}g=g.o,s=g.z,p=!p}while(!g.v);u.lineEnd()}}}function qt(n){if(t=n.length){for(var t,e,r=0,u=n[0];++r<t;)u.n=e=n[r],e.p=u,u=e;u.n=e=n[0],e.p=u}}function Tt(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Rt(n,t,e,r){return function(u,i){function a(t,e){var r=u(t,e);n(t=r[0],e=r[1])&&i.point(t,e)}function o(n,t){var e=u(n,t);d.point(e[0],e[1])}function l(){y.point=o,d.lineStart()}function c(){y.point=a,d.lineEnd()}function s(n,t){v.push([n,t]);var e=u(n,t);x.point(e[0],e[1])}function f(){x.lineStart(),v=[]}function h(){s(v[0][0],v[0][1]),x.lineEnd();var n,t=x.clean(),e=M.buffer(),r=e.length;if(v.pop(),p.push(v),v=null,r)if(1&t){n=e[0];var u,r=n.length-1,a=-1;if(r>0){for(b||(i.polygonStart(),b=!0),i.lineStart();++a<r;)i.point((u=n[a])[0],u[1]);i.lineEnd()}}else r>1&&2&t&&e.push(e.pop().concat(e.shift())),g.push(e.filter(Dt))}var g,p,v,d=t(i),m=u.invert(r[0],r[1]),y={point:a,lineStart:l,lineEnd:c,polygonStart:function(){y.point=s,y.lineStart=f,y.lineEnd=h,g=[],p=[]},polygonEnd:function(){y.point=a,y.lineStart=l,y.lineEnd=c,g=oa.merge(g);var n=Ot(m,p);g.length?(b||(i.polygonStart(),b=!0),Lt(g,Ut,n,e,i)):n&&(b||(i.polygonStart(),b=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),b&&(i.polygonEnd(),b=!1),g=p=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}},M=Pt(),x=t(M),b=!1;return y}}function Dt(n){return n.length>1}function Pt(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:b,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Ut(n,t){return((n=n.x)[0]<0?n[1]-Ha-Da:Ha-n[1])-((t=t.x)[0]<0?t[1]-Ha-Da:Ha-t[1])}function jt(n){var t,e=NaN,r=NaN,u=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(i,a){var o=i>0?Ua:-Ua,l=Ma(i-e);Ma(l-Ua)<Da?(n.point(e,r=(r+a)/2>0?Ha:-Ha),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(o,r),n.point(i,r),t=0):u!==o&&l>=Ua&&(Ma(e-u)<Da&&(e-=u*Da),Ma(i-o)<Da&&(i-=o*Da),r=Ft(e,r,i,a),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(o,r),t=0),n.point(e=i,r=a),u=o},lineEnd:function(){n.lineEnd(),e=r=NaN},clean:function(){return 2-t}}}function Ft(n,t,e,r){var u,i,a=Math.sin(n-e);return Ma(a)>Da?Math.atan((Math.sin(t)*(i=Math.cos(r))*Math.sin(e)-Math.sin(r)*(u=Math.cos(t))*Math.sin(n))/(u*i*a)):(t+r)/2}function Ht(n,t,e,r){var u;if(null==n)u=e*Ha,r.point(-Ua,u),r.point(0,u),r.point(Ua,u),r.point(Ua,0),r.point(Ua,-u),r.point(0,-u),r.point(-Ua,-u),r.point(-Ua,0),r.point(-Ua,u);else if(Ma(n[0]-t[0])>Da){var i=n[0]<t[0]?Ua:-Ua;u=e*i/2,r.point(-i,u),r.point(0,u),r.point(i,u)}else r.point(t[0],t[1])}function Ot(n,t){var e=n[0],r=n[1],u=[Math.sin(e),-Math.cos(e),0],i=0,a=0;So.reset();for(var o=0,l=t.length;l>o;++o){var c=t[o],s=c.length;if(s)for(var f=c[0],h=f[0],g=f[1]/2+Ua/4,p=Math.sin(g),v=Math.cos(g),d=1;;){d===s&&(d=0),n=c[d];var m=n[0],y=n[1]/2+Ua/4,M=Math.sin(y),x=Math.cos(y),b=m-h,_=b>=0?1:-1,w=_*b,S=w>Ua,k=p*M;if(So.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),i+=S?b+_*ja:b,S^h>=e^m>=e){var N=yt(dt(f),dt(n));bt(N);var E=yt(u,N);bt(E);var A=(S^b>=0?-1:1)*tn(E[2]);(r>A||r===A&&(N[0]||N[1]))&&(a+=S^b>=0?1:-1)}if(!d++)break;h=m,p=M,v=x,f=n}}return(-Da>i||Da>i&&0>So)^1&a}function It(n){function t(n,t){return Math.cos(n)*Math.cos(t)>i}function e(n){var e,i,l,c,s;return{lineStart:function(){c=l=!1,s=1},point:function(f,h){var g,p=[f,h],v=t(f,h),d=a?v?0:u(f,h):v?u(f+(0>f?Ua:-Ua),h):0;if(!e&&(c=l=v)&&n.lineStart(),v!==l&&(g=r(e,p),(wt(e,g)||wt(p,g))&&(p[0]+=Da,p[1]+=Da,v=t(p[0],p[1]))),v!==l)s=0,v?(n.lineStart(),g=r(p,e),n.point(g[0],g[1])):(g=r(e,p),n.point(g[0],g[1]),n.lineEnd()),e=g;else if(o&&e&&a^v){var m;d&i||!(m=r(p,e,!0))||(s=0,a?(n.lineStart(),n.point(m[0][0],m[0][1]),n.point(m[1][0],m[1][1]),n.lineEnd()):(n.point(m[1][0],m[1][1]),n.lineEnd(),n.lineStart(),n.point(m[0][0],m[0][1])))}!v||e&&wt(e,p)||n.point(p[0],p[1]),e=p,l=v,i=d},lineEnd:function(){l&&n.lineEnd(),e=null},clean:function(){return s|(c&&l)<<1}}}function r(n,t,e){var r=dt(n),u=dt(t),a=[1,0,0],o=yt(r,u),l=mt(o,o),c=o[0],s=l-c*c;if(!s)return!e&&n;var f=i*l/s,h=-i*c/s,g=yt(a,o),p=xt(a,f),v=xt(o,h);Mt(p,v);var d=g,m=mt(p,d),y=mt(d,d),M=m*m-y*(mt(p,p)-1);if(!(0>M)){var x=Math.sqrt(M),b=xt(d,(-m-x)/y);if(Mt(b,p),b=_t(b),!e)return b;var _,w=n[0],S=t[0],k=n[1],N=t[1];w>S&&(_=w,w=S,S=_);var E=S-w,A=Ma(E-Ua)<Da,C=A||Da>E;if(!A&&k>N&&(_=k,k=N,N=_),C?A?k+N>0^b[1]<(Ma(b[0]-w)<Da?k:N):k<=b[1]&&b[1]<=N:E>Ua^(w<=b[0]&&b[0]<=S)){var z=xt(d,(-m+x)/y);return Mt(z,p),[b,_t(z)]}}}function u(t,e){var r=a?n:Ua-n,u=0;return-r>t?u|=1:t>r&&(u|=2),-r>e?u|=4:e>r&&(u|=8),u}var i=Math.cos(n),a=i>0,o=Ma(i)>Da,l=ve(n,6*Oa);return Rt(t,e,l,a?[0,-n]:[-Ua,n-Ua])}function Yt(n,t,e,r){return function(u){var i,a=u.a,o=u.b,l=a.x,c=a.y,s=o.x,f=o.y,h=0,g=1,p=s-l,v=f-c;if(i=n-l,p||!(i>0)){if(i/=p,0>p){if(h>i)return;g>i&&(g=i)}else if(p>0){if(i>g)return;i>h&&(h=i)}if(i=e-l,p||!(0>i)){if(i/=p,0>p){if(i>g)return;i>h&&(h=i)}else if(p>0){if(h>i)return;g>i&&(g=i)}if(i=t-c,v||!(i>0)){if(i/=v,0>v){if(h>i)return;g>i&&(g=i)}else if(v>0){if(i>g)return;i>h&&(h=i)}if(i=r-c,v||!(0>i)){if(i/=v,0>v){if(i>g)return;i>h&&(h=i)}else if(v>0){if(h>i)return;g>i&&(g=i)}return h>0&&(u.a={x:l+h*p,y:c+h*v}),1>g&&(u.b={x:l+g*p,y:c+g*v}),u}}}}}}function Zt(n,t,e,r){function u(r,u){return Ma(r[0]-n)<Da?u>0?0:3:Ma(r[0]-e)<Da?u>0?2:1:Ma(r[1]-t)<Da?u>0?1:0:u>0?3:2}function i(n,t){return a(n.x,t.x)}function a(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(o){function l(n){for(var t=0,e=d.length,r=n[1],u=0;e>u;++u)for(var i,a=1,o=d[u],l=o.length,c=o[0];l>a;++a)i=o[a],c[1]<=r?i[1]>r&&Q(c,i,n)>0&&++t:i[1]<=r&&Q(c,i,n)<0&&--t,c=i;return 0!==t}function c(i,o,l,c){var s=0,f=0;if(null==i||(s=u(i,l))!==(f=u(o,l))||a(i,o)<0^l>0){do c.point(0===s||3===s?n:e,s>1?r:t);while((s=(s+l+4)%4)!==f)}else c.point(o[0],o[1])}function s(u,i){return u>=n&&e>=u&&i>=t&&r>=i}function f(n,t){s(n,t)&&o.point(n,t)}function h(){C.point=p,d&&d.push(m=[]),S=!0,w=!1,b=_=NaN}function g(){v&&(p(y,M),x&&w&&E.rejoin(),v.push(E.buffer())),C.point=f,w&&o.lineEnd()}function p(n,t){n=Math.max(-Fo,Math.min(Fo,n)),t=Math.max(-Fo,Math.min(Fo,t));var e=s(n,t);if(d&&m.push([n,t]),S)y=n,M=t,x=e,S=!1,e&&(o.lineStart(),o.point(n,t));else if(e&&w)o.point(n,t);else{var r={a:{x:b,y:_},b:{x:n,y:t}};A(r)?(w||(o.lineStart(),o.point(r.a.x,r.a.y)),o.point(r.b.x,r.b.y),e||o.lineEnd(),k=!1):e&&(o.lineStart(),o.point(n,t),k=!1)}b=n,_=t,w=e}var v,d,m,y,M,x,b,_,w,S,k,N=o,E=Pt(),A=Yt(n,t,e,r),C={point:f,lineStart:h,lineEnd:g,polygonStart:function(){o=E,v=[],d=[],k=!0},polygonEnd:function(){o=N,v=oa.merge(v);var t=l([n,r]),e=k&&t,u=v.length;(e||u)&&(o.polygonStart(),e&&(o.lineStart(),c(null,null,1,o),o.lineEnd()),u&&Lt(v,i,t,c,o),o.polygonEnd()),v=d=m=null}};return C}}function Vt(n){var t=0,e=Ua/3,r=oe(n),u=r(t,e);return u.parallels=function(n){return arguments.length?r(t=n[0]*Ua/180,e=n[1]*Ua/180):[t/Ua*180,e/Ua*180]},u}function Xt(n,t){function e(n,t){var e=Math.sqrt(i-2*u*Math.sin(t))/u;return[e*Math.sin(n*=u),a-e*Math.cos(n)]}var r=Math.sin(n),u=(r+Math.sin(t))/2,i=1+r*(2*u-r),a=Math.sqrt(i)/u;return e.invert=function(n,t){var e=a-t;return[Math.atan2(n,e)/u,tn((i-(n*n+e*e)*u*u)/(2*u))]},e}function $t(){function n(n,t){Oo+=u*n-r*t,r=n,u=t}var t,e,r,u;Xo.point=function(i,a){Xo.point=n,t=r=i,e=u=a},Xo.lineEnd=function(){n(t,e)}}function Bt(n,t){Io>n&&(Io=n),n>Zo&&(Zo=n),Yo>t&&(Yo=t),t>Vo&&(Vo=t)}function Wt(){function n(n,t){a.push("M",n,",",t,i)}function t(n,t){a.push("M",n,",",t),o.point=e}function e(n,t){a.push("L",n,",",t)}function r(){o.point=n}function u(){a.push("Z")}var i=Jt(4.5),a=[],o={point:n,lineStart:function(){o.point=t},lineEnd:r,polygonStart:function(){o.lineEnd=u},polygonEnd:function(){o.lineEnd=r,o.point=n},pointRadius:function(n){return i=Jt(n),o},result:function(){if(a.length){var n=a.join("");return a=[],n}}};return o}function Jt(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Gt(n,t){Ao+=n,Co+=t,++zo}function Kt(){function n(n,r){var u=n-t,i=r-e,a=Math.sqrt(u*u+i*i);Lo+=a*(t+n)/2,qo+=a*(e+r)/2,To+=a,Gt(t=n,e=r)}var t,e;Bo.point=function(r,u){Bo.point=n,Gt(t=r,e=u)}}function Qt(){Bo.point=Gt}function ne(){function n(n,t){var e=n-r,i=t-u,a=Math.sqrt(e*e+i*i);Lo+=a*(r+n)/2,qo+=a*(u+t)/2,To+=a,a=u*n-r*t,Ro+=a*(r+n),Do+=a*(u+t),Po+=3*a,Gt(r=n,u=t)}var t,e,r,u;Bo.point=function(i,a){Bo.point=n,Gt(t=r=i,e=u=a)},Bo.lineEnd=function(){n(t,e)}}function te(n){function t(t,e){n.moveTo(t+a,e),n.arc(t,e,a,0,ja)}function e(t,e){n.moveTo(t,e),o.point=r}function r(t,e){n.lineTo(t,e)}function u(){o.point=t}function i(){n.closePath()}var a=4.5,o={point:t,lineStart:function(){o.point=e},lineEnd:u,polygonStart:function(){o.lineEnd=i},polygonEnd:function(){o.lineEnd=u,o.point=t},pointRadius:function(n){return a=n,o},result:b};return o}function ee(n){function t(n){return(o?r:e)(n)}function e(t){return ie(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){M=NaN,S.point=i,t.lineStart()}function i(e,r){var i=dt([e,r]),a=n(e,r);u(M,x,y,b,_,w,M=a[0],x=a[1],y=e,b=i[0],_=i[1],w=i[2],o,t),t.point(M,x)}function a(){S.point=e,t.lineEnd()}function l(){ | |
| r(),S.point=c,S.lineEnd=s}function c(n,t){i(f=n,h=t),g=M,p=x,v=b,d=_,m=w,S.point=i}function s(){u(M,x,y,b,_,w,g,p,f,v,d,m,o,t),S.lineEnd=a,a()}var f,h,g,p,v,d,m,y,M,x,b,_,w,S={point:e,lineStart:r,lineEnd:a,polygonStart:function(){t.polygonStart(),S.lineStart=l},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function u(t,e,r,o,l,c,s,f,h,g,p,v,d,m){var y=s-t,M=f-e,x=y*y+M*M;if(x>4*i&&d--){var b=o+g,_=l+p,w=c+v,S=Math.sqrt(b*b+_*_+w*w),k=Math.asin(w/=S),N=Ma(Ma(w)-1)<Da||Ma(r-h)<Da?(r+h)/2:Math.atan2(_,b),E=n(N,k),A=E[0],C=E[1],z=A-t,L=C-e,q=M*z-y*L;(q*q/x>i||Ma((y*z+M*L)/x-.5)>.3||a>o*g+l*p+c*v)&&(u(t,e,r,o,l,c,A,C,N,b/=S,_/=S,w,d,m),m.point(A,C),u(A,C,N,b,_,w,s,f,h,g,p,v,d,m))}}var i=.5,a=Math.cos(30*Oa),o=16;return t.precision=function(n){return arguments.length?(o=(i=n*n)>0&&16,t):Math.sqrt(i)},t}function re(n){var t=ee(function(t,e){return n([t*Ia,e*Ia])});return function(n){return le(t(n))}}function ue(n){this.stream=n}function ie(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function ae(n){return oe(function(){return n})()}function oe(n){function t(n){return n=o(n[0]*Oa,n[1]*Oa),[n[0]*h+l,c-n[1]*h]}function e(n){return n=o.invert((n[0]-l)/h,(c-n[1])/h),n&&[n[0]*Ia,n[1]*Ia]}function r(){o=Ct(a=fe(m,M,x),i);var n=i(v,d);return l=g-n[0]*h,c=p+n[1]*h,u()}function u(){return s&&(s.valid=!1,s=null),t}var i,a,o,l,c,s,f=ee(function(n,t){return n=i(n,t),[n[0]*h+l,c-n[1]*h]}),h=150,g=480,p=250,v=0,d=0,m=0,M=0,x=0,b=jo,_=y,w=null,S=null;return t.stream=function(n){return s&&(s.valid=!1),s=le(b(a,f(_(n)))),s.valid=!0,s},t.clipAngle=function(n){return arguments.length?(b=null==n?(w=n,jo):It((w=+n)*Oa),u()):w},t.clipExtent=function(n){return arguments.length?(S=n,_=n?Zt(n[0][0],n[0][1],n[1][0],n[1][1]):y,u()):S},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],r()):[g,p]},t.center=function(n){return arguments.length?(v=n[0]%360*Oa,d=n[1]%360*Oa,r()):[v*Ia,d*Ia]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Oa,M=n[1]%360*Oa,x=n.length>2?n[2]%360*Oa:0,r()):[m*Ia,M*Ia,x*Ia]},oa.rebind(t,f,"precision"),function(){return i=n.apply(this,arguments),t.invert=i.invert&&e,r()}}function le(n){return ie(n,function(t,e){n.point(t*Oa,e*Oa)})}function ce(n,t){return[n,t]}function se(n,t){return[n>Ua?n-ja:-Ua>n?n+ja:n,t]}function fe(n,t,e){return n?t||e?Ct(ge(n),pe(t,e)):ge(n):t||e?pe(t,e):se}function he(n){return function(t,e){return t+=n,[t>Ua?t-ja:-Ua>t?t+ja:t,e]}}function ge(n){var t=he(n);return t.invert=he(-n),t}function pe(n,t){function e(n,t){var e=Math.cos(t),o=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),s=c*r+o*u;return[Math.atan2(l*i-s*a,o*r-c*u),tn(s*i+l*a)]}var r=Math.cos(n),u=Math.sin(n),i=Math.cos(t),a=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),o=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),s=c*i-l*a;return[Math.atan2(l*i+c*a,o*r+s*u),tn(s*r-o*u)]},e}function ve(n,t){var e=Math.cos(n),r=Math.sin(n);return function(u,i,a,o){var l=a*t;null!=u?(u=de(e,u),i=de(e,i),(a>0?i>u:u>i)&&(u+=a*ja)):(u=n+a*ja,i=n-.5*l);for(var c,s=u;a>0?s>i:i>s;s-=l)o.point((c=_t([e,-r*Math.cos(s),-r*Math.sin(s)]))[0],c[1])}}function de(n,t){var e=dt(t);e[0]-=n,bt(e);var r=nn(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Da)%(2*Math.PI)}function me(n,t,e){var r=oa.range(n,t-Da,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function ye(n,t,e){var r=oa.range(n,t-Da,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function Me(n){return n.source}function xe(n){return n.target}function be(n,t,e,r){var u=Math.cos(t),i=Math.sin(t),a=Math.cos(r),o=Math.sin(r),l=u*Math.cos(n),c=u*Math.sin(n),s=a*Math.cos(e),f=a*Math.sin(e),h=2*Math.asin(Math.sqrt(an(r-t)+u*a*an(e-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,e=Math.sin(h-n)*g,r=e*l+t*s,u=e*c+t*f,a=e*i+t*o;return[Math.atan2(u,r)*Ia,Math.atan2(a,Math.sqrt(r*r+u*u))*Ia]}:function(){return[n*Ia,t*Ia]};return p.distance=h,p}function _e(){function n(n,u){var i=Math.sin(u*=Oa),a=Math.cos(u),o=Ma((n*=Oa)-t),l=Math.cos(o);Wo+=Math.atan2(Math.sqrt((o=a*Math.sin(o))*o+(o=r*i-e*a*l)*o),e*i+r*a*l),t=n,e=i,r=a}var t,e,r;Jo.point=function(u,i){t=u*Oa,e=Math.sin(i*=Oa),r=Math.cos(i),Jo.point=n},Jo.lineEnd=function(){Jo.point=Jo.lineEnd=b}}function we(n,t){function e(t,e){var r=Math.cos(t),u=Math.cos(e),i=n(r*u);return[i*u*Math.sin(t),i*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),u=t(r),i=Math.sin(u),a=Math.cos(u);return[Math.atan2(n*i,r*a),Math.asin(r&&e*i/r)]},e}function Se(n,t){function e(n,t){a>0?-Ha+Da>t&&(t=-Ha+Da):t>Ha-Da&&(t=Ha-Da);var e=a/Math.pow(u(t),i);return[e*Math.sin(i*n),a-e*Math.cos(i*n)]}var r=Math.cos(n),u=function(n){return Math.tan(Ua/4+n/2)},i=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(u(t)/u(n)),a=r*Math.pow(u(n),i)/i;return i?(e.invert=function(n,t){var e=a-t,r=K(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(a/r,1/i))-Ha]},e):Ne}function ke(n,t){function e(n,t){var e=i-t;return[e*Math.sin(u*n),i-e*Math.cos(u*n)]}var r=Math.cos(n),u=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),i=r/u+n;return Ma(u)<Da?ce:(e.invert=function(n,t){var e=i-t;return[Math.atan2(n,e)/u,i-K(u)*Math.sqrt(n*n+e*e)]},e)}function Ne(n,t){return[n,Math.log(Math.tan(Ua/4+t/2))]}function Ee(n){var t,e=ae(n),r=e.scale,u=e.translate,i=e.clipExtent;return e.scale=function(){var n=r.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.translate=function(){var n=u.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.clipExtent=function(n){var a=i.apply(e,arguments);if(a===e){if(t=null==n){var o=Ua*r(),l=u();i([[l[0]-o,l[1]-o],[l[0]+o,l[1]+o]])}}else t&&(a=null);return a},e.clipExtent(null)}function Ae(n,t){return[Math.log(Math.tan(Ua/4+t/2)),-n]}function Ce(n){return n[0]}function ze(n){return n[1]}function Le(n){for(var t=n.length,e=[0,1],r=2,u=2;t>u;u++){for(;r>1&&Q(n[e[r-2]],n[e[r-1]],n[u])<=0;)--r;e[r++]=u}return e.slice(0,r)}function qe(n,t){return n[0]-t[0]||n[1]-t[1]}function Te(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Re(n,t,e,r){var u=n[0],i=e[0],a=t[0]-u,o=r[0]-i,l=n[1],c=e[1],s=t[1]-l,f=r[1]-c,h=(o*(l-c)-f*(u-i))/(f*a-o*s);return[u+h*a,l+h*s]}function De(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function Pe(){rr(this),this.edge=this.site=this.circle=null}function Ue(n){var t=ll.pop()||new Pe;return t.site=n,t}function je(n){Be(n),il.remove(n),ll.push(n),rr(n)}function Fe(n){var t=n.circle,e=t.x,r=t.cy,u={x:e,y:r},i=n.P,a=n.N,o=[n];je(n);for(var l=i;l.circle&&Ma(e-l.circle.x)<Da&&Ma(r-l.circle.cy)<Da;)i=l.P,o.unshift(l),je(l),l=i;o.unshift(l),Be(l);for(var c=a;c.circle&&Ma(e-c.circle.x)<Da&&Ma(r-c.circle.cy)<Da;)a=c.N,o.push(c),je(c),c=a;o.push(c),Be(c);var s,f=o.length;for(s=1;f>s;++s)c=o[s],l=o[s-1],nr(c.edge,l.site,c.site,u);l=o[0],c=o[f-1],c.edge=Ke(l.site,c.site,null,u),$e(l),$e(c)}function He(n){for(var t,e,r,u,i=n.x,a=n.y,o=il._;o;)if(r=Oe(o,a)-i,r>Da)o=o.L;else{if(u=i-Ie(o,a),!(u>Da)){r>-Da?(t=o.P,e=o):u>-Da?(t=o,e=o.N):t=e=o;break}if(!o.R){t=o;break}o=o.R}var l=Ue(n);if(il.insert(t,l),t||e){if(t===e)return Be(t),e=Ue(t.site),il.insert(l,e),l.edge=e.edge=Ke(t.site,l.site),$e(t),void $e(e);if(!e)return void(l.edge=Ke(t.site,l.site));Be(t),Be(e);var c=t.site,s=c.x,f=c.y,h=n.x-s,g=n.y-f,p=e.site,v=p.x-s,d=p.y-f,m=2*(h*d-g*v),y=h*h+g*g,M=v*v+d*d,x={x:(d*y-g*M)/m+s,y:(h*M-v*y)/m+f};nr(e.edge,c,p,x),l.edge=Ke(c,n,null,x),e.edge=Ke(n,p,null,x),$e(t),$e(e)}}function Oe(n,t){var e=n.site,r=e.x,u=e.y,i=u-t;if(!i)return r;var a=n.P;if(!a)return-(1/0);e=a.site;var o=e.x,l=e.y,c=l-t;if(!c)return o;var s=o-r,f=1/i-1/c,h=s/c;return f?(-h+Math.sqrt(h*h-2*f*(s*s/(-2*c)-l+c/2+u-i/2)))/f+r:(r+o)/2}function Ie(n,t){var e=n.N;if(e)return Oe(e,t);var r=n.site;return r.y===t?r.x:1/0}function Ye(n){this.site=n,this.edges=[]}function Ze(n){for(var t,e,r,u,i,a,o,l,c,s,f=n[0][0],h=n[1][0],g=n[0][1],p=n[1][1],v=ul,d=v.length;d--;)if(i=v[d],i&&i.prepare())for(o=i.edges,l=o.length,a=0;l>a;)s=o[a].end(),r=s.x,u=s.y,c=o[++a%l].start(),t=c.x,e=c.y,(Ma(r-t)>Da||Ma(u-e)>Da)&&(o.splice(a,0,new tr(Qe(i.site,s,Ma(r-f)<Da&&p-u>Da?{x:f,y:Ma(t-f)<Da?e:p}:Ma(u-p)<Da&&h-r>Da?{x:Ma(e-p)<Da?t:h,y:p}:Ma(r-h)<Da&&u-g>Da?{x:h,y:Ma(t-h)<Da?e:g}:Ma(u-g)<Da&&r-f>Da?{x:Ma(e-g)<Da?t:f,y:g}:null),i.site,null)),++l)}function Ve(n,t){return t.angle-n.angle}function Xe(){rr(this),this.x=this.y=this.arc=this.site=this.cy=null}function $e(n){var t=n.P,e=n.N;if(t&&e){var r=t.site,u=n.site,i=e.site;if(r!==i){var a=u.x,o=u.y,l=r.x-a,c=r.y-o,s=i.x-a,f=i.y-o,h=2*(l*f-c*s);if(!(h>=-Pa)){var g=l*l+c*c,p=s*s+f*f,v=(f*g-c*p)/h,d=(l*p-s*g)/h,f=d+o,m=cl.pop()||new Xe;m.arc=n,m.site=u,m.x=v+a,m.y=f+Math.sqrt(v*v+d*d),m.cy=f,n.circle=m;for(var y=null,M=ol._;M;)if(m.y<M.y||m.y===M.y&&m.x<=M.x){if(!M.L){y=M.P;break}M=M.L}else{if(!M.R){y=M;break}M=M.R}ol.insert(y,m),y||(al=m)}}}}function Be(n){var t=n.circle;t&&(t.P||(al=t.N),ol.remove(t),cl.push(t),rr(t),n.circle=null)}function We(n){for(var t,e=rl,r=Yt(n[0][0],n[0][1],n[1][0],n[1][1]),u=e.length;u--;)t=e[u],(!Je(t,n)||!r(t)||Ma(t.a.x-t.b.x)<Da&&Ma(t.a.y-t.b.y)<Da)&&(t.a=t.b=null,e.splice(u,1))}function Je(n,t){var e=n.b;if(e)return!0;var r,u,i=n.a,a=t[0][0],o=t[1][0],l=t[0][1],c=t[1][1],s=n.l,f=n.r,h=s.x,g=s.y,p=f.x,v=f.y,d=(h+p)/2,m=(g+v)/2;if(v===g){if(a>d||d>=o)return;if(h>p){if(i){if(i.y>=c)return}else i={x:d,y:l};e={x:d,y:c}}else{if(i){if(i.y<l)return}else i={x:d,y:c};e={x:d,y:l}}}else if(r=(h-p)/(v-g),u=m-r*d,-1>r||r>1)if(h>p){if(i){if(i.y>=c)return}else i={x:(l-u)/r,y:l};e={x:(c-u)/r,y:c}}else{if(i){if(i.y<l)return}else i={x:(c-u)/r,y:c};e={x:(l-u)/r,y:l}}else if(v>g){if(i){if(i.x>=o)return}else i={x:a,y:r*a+u};e={x:o,y:r*o+u}}else{if(i){if(i.x<a)return}else i={x:o,y:r*o+u};e={x:a,y:r*a+u}}return n.a=i,n.b=e,!0}function Ge(n,t){this.l=n,this.r=t,this.a=this.b=null}function Ke(n,t,e,r){var u=new Ge(n,t);return rl.push(u),e&&nr(u,n,t,e),r&&nr(u,t,n,r),ul[n.i].edges.push(new tr(u,n,t)),ul[t.i].edges.push(new tr(u,t,n)),u}function Qe(n,t,e){var r=new Ge(n,null);return r.a=t,r.b=e,rl.push(r),r}function nr(n,t,e,r){n.a||n.b?n.l===e?n.b=r:n.a=r:(n.a=r,n.l=t,n.r=e)}function tr(n,t,e){var r=n.a,u=n.b;this.edge=n,this.site=t,this.angle=e?Math.atan2(e.y-t.y,e.x-t.x):n.l===t?Math.atan2(u.x-r.x,r.y-u.y):Math.atan2(r.x-u.x,u.y-r.y)}function er(){this._=null}function rr(n){n.U=n.C=n.L=n.R=n.P=n.N=null}function ur(n,t){var e=t,r=t.R,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function ir(n,t){var e=t,r=t.L,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function ar(n){for(;n.L;)n=n.L;return n}function or(n,t){var e,r,u,i=n.sort(lr).pop();for(rl=[],ul=new Array(n.length),il=new er,ol=new er;;)if(u=al,i&&(!u||i.y<u.y||i.y===u.y&&i.x<u.x))(i.x!==e||i.y!==r)&&(ul[i.i]=new Ye(i),He(i),e=i.x,r=i.y),i=n.pop();else{if(!u)break;Fe(u.arc)}t&&(We(t),Ze(t));var a={cells:ul,edges:rl};return il=ol=rl=ul=null,a}function lr(n,t){return t.y-n.y||t.x-n.x}function cr(n,t,e){return(n.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-n.y)}function sr(n){return n.x}function fr(n){return n.y}function hr(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function gr(n,t,e,r,u,i){if(!n(t,e,r,u,i)){var a=.5*(e+u),o=.5*(r+i),l=t.nodes;l[0]&&gr(n,l[0],e,r,a,o),l[1]&&gr(n,l[1],a,r,u,o),l[2]&&gr(n,l[2],e,o,a,i),l[3]&&gr(n,l[3],a,o,u,i)}}function pr(n,t,e,r,u,i,a){var o,l=1/0;return function c(n,s,f,h,g){if(!(s>i||f>a||r>h||u>g)){if(p=n.point){var p,v=t-n.x,d=e-n.y,m=v*v+d*d;if(l>m){var y=Math.sqrt(l=m);r=t-y,u=e-y,i=t+y,a=e+y,o=p}}for(var M=n.nodes,x=.5*(s+h),b=.5*(f+g),_=t>=x,w=e>=b,S=w<<1|_,k=S+4;k>S;++S)if(n=M[3&S])switch(3&S){case 0:c(n,s,f,x,b);break;case 1:c(n,x,f,h,b);break;case 2:c(n,s,b,x,g);break;case 3:c(n,x,b,h,g)}}}(n,r,u,i,a),o}function vr(n,t){n=oa.rgb(n),t=oa.rgb(t);var e=n.r,r=n.g,u=n.b,i=t.r-e,a=t.g-r,o=t.b-u;return function(n){return"#"+bn(Math.round(e+i*n))+bn(Math.round(r+a*n))+bn(Math.round(u+o*n))}}function dr(n,t){var e,r={},u={};for(e in n)e in t?r[e]=Mr(n[e],t[e]):u[e]=n[e];for(e in t)e in n||(u[e]=t[e]);return function(n){for(e in r)u[e]=r[e](n);return u}}function mr(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function yr(n,t){var e,r,u,i=fl.lastIndex=hl.lastIndex=0,a=-1,o=[],l=[];for(n+="",t+="";(e=fl.exec(n))&&(r=hl.exec(t));)(u=r.index)>i&&(u=t.slice(i,u),o[a]?o[a]+=u:o[++a]=u),(e=e[0])===(r=r[0])?o[a]?o[a]+=r:o[++a]=r:(o[++a]=null,l.push({i:a,x:mr(e,r)})),i=hl.lastIndex;return i<t.length&&(u=t.slice(i),o[a]?o[a]+=u:o[++a]=u),o.length<2?l[0]?(t=l[0].x,function(n){return t(n)+""}):function(){return t}:(t=l.length,function(n){for(var e,r=0;t>r;++r)o[(e=l[r]).i]=e.x(n);return o.join("")})}function Mr(n,t){for(var e,r=oa.interpolators.length;--r>=0&&!(e=oa.interpolators[r](n,t)););return e}function xr(n,t){var e,r=[],u=[],i=n.length,a=t.length,o=Math.min(n.length,t.length);for(e=0;o>e;++e)r.push(Mr(n[e],t[e]));for(;i>e;++e)u[e]=n[e];for(;a>e;++e)u[e]=t[e];return function(n){for(e=0;o>e;++e)u[e]=r[e](n);return u}}function br(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function _r(n){return function(t){return 1-n(1-t)}}function wr(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function Sr(n){return n*n}function kr(n){return n*n*n}function Nr(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function Er(n){return function(t){return Math.pow(t,n)}}function Ar(n){return 1-Math.cos(n*Ha)}function Cr(n){return Math.pow(2,10*(n-1))}function zr(n){return 1-Math.sqrt(1-n*n)}function Lr(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/ja*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*ja/t)}}function qr(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Tr(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Rr(n,t){n=oa.hcl(n),t=oa.hcl(t);var e=n.h,r=n.c,u=n.l,i=t.h-e,a=t.c-r,o=t.l-u;return isNaN(a)&&(a=0,r=isNaN(r)?t.c:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return fn(e+i*n,r+a*n,u+o*n)+""}}function Dr(n,t){n=oa.hsl(n),t=oa.hsl(t);var e=n.h,r=n.s,u=n.l,i=t.h-e,a=t.s-r,o=t.l-u;return isNaN(a)&&(a=0,r=isNaN(r)?t.s:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return cn(e+i*n,r+a*n,u+o*n)+""}}function Pr(n,t){n=oa.lab(n),t=oa.lab(t);var e=n.l,r=n.a,u=n.b,i=t.l-e,a=t.a-r,o=t.b-u;return function(n){return gn(e+i*n,r+a*n,u+o*n)+""}}function Ur(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function jr(n){var t=[n.a,n.b],e=[n.c,n.d],r=Hr(t),u=Fr(t,e),i=Hr(Or(e,t,-u))||0;t[0]*e[1]<e[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,u*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-e[0],e[1]))*Ia,this.translate=[n.e,n.f],this.scale=[r,i],this.skew=i?Math.atan2(u,i)*Ia:0}function Fr(n,t){return n[0]*t[0]+n[1]*t[1]}function Hr(n){var t=Math.sqrt(Fr(n,n));return t&&(n[0]/=t,n[1]/=t),t}function Or(n,t,e){return n[0]+=e*t[0],n[1]+=e*t[1],n}function Ir(n){return n.length?n.pop()+",":""}function Yr(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var u=e.push("translate(",null,",",null,")");r.push({i:u-4,x:mr(n[0],t[0])},{i:u-2,x:mr(n[1],t[1])})}else(t[0]||t[1])&&e.push("translate("+t+")")}function Zr(n,t,e,r){n!==t?(n-t>180?t+=360:t-n>180&&(n+=360),r.push({i:e.push(Ir(e)+"rotate(",null,")")-2,x:mr(n,t)})):t&&e.push(Ir(e)+"rotate("+t+")")}function Vr(n,t,e,r){n!==t?r.push({i:e.push(Ir(e)+"skewX(",null,")")-2,x:mr(n,t)}):t&&e.push(Ir(e)+"skewX("+t+")")}function Xr(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var u=e.push(Ir(e)+"scale(",null,",",null,")");r.push({i:u-4,x:mr(n[0],t[0])},{i:u-2,x:mr(n[1],t[1])})}else(1!==t[0]||1!==t[1])&&e.push(Ir(e)+"scale("+t+")")}function $r(n,t){var e=[],r=[];return n=oa.transform(n),t=oa.transform(t),Yr(n.translate,t.translate,e,r),Zr(n.rotate,t.rotate,e,r),Vr(n.skew,t.skew,e,r),Xr(n.scale,t.scale,e,r),n=t=null,function(n){for(var t,u=-1,i=r.length;++u<i;)e[(t=r[u]).i]=t.x(n);return e.join("")}}function Br(n,t){return t=(t-=n=+n)||1/t,function(e){return(e-n)/t}}function Wr(n,t){return t=(t-=n=+n)||1/t,function(e){return Math.max(0,Math.min(1,(e-n)/t))}}function Jr(n){for(var t=n.source,e=n.target,r=Kr(t,e),u=[t];t!==r;)t=t.parent,u.push(t);for(var i=u.length;e!==r;)u.splice(i,0,e),e=e.parent;return u}function Gr(n){for(var t=[],e=n.parent;null!=e;)t.push(n),n=e,e=e.parent;return t.push(n),t}function Kr(n,t){if(n===t)return n;for(var e=Gr(n),r=Gr(t),u=e.pop(),i=r.pop(),a=null;u===i;)a=u,u=e.pop(),i=r.pop();return a}function Qr(n){n.fixed|=2}function nu(n){n.fixed&=-7}function tu(n){n.fixed|=4,n.px=n.x,n.py=n.y}function eu(n){n.fixed&=-5}function ru(n,t,e){var r=0,u=0;if(n.charge=0,!n.leaf)for(var i,a=n.nodes,o=a.length,l=-1;++l<o;)i=a[l],null!=i&&(ru(i,t,e),n.charge+=i.charge,r+=i.charge*i.cx,u+=i.charge*i.cy);if(n.point){n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5);var c=t*e[n.point.index];n.charge+=n.pointCharge=c,r+=c*n.point.x,u+=c*n.point.y}n.cx=r/n.charge,n.cy=u/n.charge}function uu(n,t){return oa.rebind(n,t,"sort","children","value"),n.nodes=n,n.links=su,n}function iu(n,t){for(var e=[n];null!=(n=e.pop());)if(t(n),(u=n.children)&&(r=u.length))for(var r,u;--r>=0;)e.push(u[r])}function au(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(i=n.children)&&(u=i.length))for(var u,i,a=-1;++a<u;)e.push(i[a]);for(;null!=(n=r.pop());)t(n)}function ou(n){return n.children}function lu(n){return n.value}function cu(n,t){return t.value-n.value}function su(n){return oa.merge(n.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function fu(n){return n.x}function hu(n){return n.y}function gu(n,t,e){n.y0=t,n.y=e}function pu(n){return oa.range(n.length)}function vu(n){for(var t=-1,e=n[0].length,r=[];++t<e;)r[t]=0;return r}function du(n){for(var t,e=1,r=0,u=n[0][1],i=n.length;i>e;++e)(t=n[e][1])>u&&(r=e,u=t);return r}function mu(n){return n.reduce(yu,0)}function yu(n,t){return n+t[1]}function Mu(n,t){return xu(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function xu(n,t){for(var e=-1,r=+n[0],u=(n[1]-r)/t,i=[];++e<=t;)i[e]=u*e+r;return i}function bu(n){return[oa.min(n),oa.max(n)]}function _u(n,t){return n.value-t.value}function wu(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function Su(n,t){n._pack_next=t,t._pack_prev=n}function ku(n,t){var e=t.x-n.x,r=t.y-n.y,u=n.r+t.r;return.999*u*u>e*e+r*r}function Nu(n){function t(n){s=Math.min(n.x-n.r,s),f=Math.max(n.x+n.r,f),h=Math.min(n.y-n.r,h),g=Math.max(n.y+n.r,g)}if((e=n.children)&&(c=e.length)){var e,r,u,i,a,o,l,c,s=1/0,f=-(1/0),h=1/0,g=-(1/0);if(e.forEach(Eu),r=e[0],r.x=-r.r,r.y=0,t(r),c>1&&(u=e[1],u.x=u.r,u.y=0,t(u),c>2))for(i=e[2],zu(r,u,i),t(i),wu(r,i),r._pack_prev=i,wu(i,u),u=r._pack_next,a=3;c>a;a++){zu(r,u,i=e[a]);var p=0,v=1,d=1;for(o=u._pack_next;o!==u;o=o._pack_next,v++)if(ku(o,i)){p=1;break}if(1==p)for(l=r._pack_prev;l!==o._pack_prev&&!ku(l,i);l=l._pack_prev,d++);p?(d>v||v==d&&u.r<r.r?Su(r,u=o):Su(r=l,u),a--):(wu(r,i),u=i,t(i))}var m=(s+f)/2,y=(h+g)/2,M=0;for(a=0;c>a;a++)i=e[a],i.x-=m,i.y-=y,M=Math.max(M,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=M,e.forEach(Au)}}function Eu(n){n._pack_next=n._pack_prev=n}function Au(n){delete n._pack_next,delete n._pack_prev}function Cu(n,t,e,r){var u=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,u)for(var i=-1,a=u.length;++i<a;)Cu(u[i],t,e,r)}function zu(n,t,e){var r=n.r+e.r,u=t.x-n.x,i=t.y-n.y;if(r&&(u||i)){var a=t.r+e.r,o=u*u+i*i;a*=a,r*=r;var l=.5+(r-a)/(2*o),c=Math.sqrt(Math.max(0,2*a*(r+o)-(r-=o)*r-a*a))/(2*o);e.x=n.x+l*u+c*i,e.y=n.y+l*i-c*u}else e.x=n.x+r,e.y=n.y}function Lu(n,t){return n.parent==t.parent?1:2}function qu(n){var t=n.children;return t.length?t[0]:n.t}function Tu(n){var t,e=n.children;return(t=e.length)?e[t-1]:n.t}function Ru(n,t,e){var r=e/(t.i-n.i);t.c-=r,t.s+=e,n.c+=r,t.z+=e,t.m+=e}function Du(n){for(var t,e=0,r=0,u=n.children,i=u.length;--i>=0;)t=u[i],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Pu(n,t,e){return n.a.parent===t.parent?n.a:e}function Uu(n){return 1+oa.max(n,function(n){return n.y})}function ju(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Fu(n){var t=n.children;return t&&t.length?Fu(t[0]):n}function Hu(n){var t,e=n.children;return e&&(t=e.length)?Hu(e[t-1]):n}function Ou(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Iu(n,t){var e=n.x+t[3],r=n.y+t[0],u=n.dx-t[1]-t[3],i=n.dy-t[0]-t[2];return 0>u&&(e+=u/2,u=0),0>i&&(r+=i/2,i=0),{x:e,y:r,dx:u,dy:i}}function Yu(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Zu(n){return n.rangeExtent?n.rangeExtent():Yu(n.range())}function Vu(n,t,e,r){var u=e(n[0],n[1]),i=r(t[0],t[1]);return function(n){return i(u(n))}}function Xu(n,t){var e,r=0,u=n.length-1,i=n[r],a=n[u];return i>a&&(e=r,r=u,u=e,e=i,i=a,a=e),n[r]=t.floor(i),n[u]=t.ceil(a),n}function $u(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:wl}function Bu(n,t,e,r){var u=[],i=[],a=0,o=Math.min(n.length,t.length)-1;for(n[o]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++a<=o;)u.push(e(n[a-1],n[a])),i.push(r(t[a-1],t[a]));return function(t){var e=oa.bisect(n,t,1,o)-1;return i[e](u[e](t))}}function Wu(n,t,e,r){function u(){var u=Math.min(n.length,t.length)>2?Bu:Vu,l=r?Wr:Br;return a=u(n,t,l,e),o=u(t,n,l,Mr),i}function i(n){return a(n)}var a,o;return i.invert=function(n){return o(n)},i.domain=function(t){return arguments.length?(n=t.map(Number),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.rangeRound=function(n){return i.range(n).interpolate(Ur)},i.clamp=function(n){return arguments.length?(r=n,u()):r},i.interpolate=function(n){return arguments.length?(e=n,u()):e},i.ticks=function(t){return Qu(n,t)},i.tickFormat=function(t,e){return ni(n,t,e)},i.nice=function(t){return Gu(n,t),u()},i.copy=function(){return Wu(n,t,e,r)},u()}function Ju(n,t){return oa.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Gu(n,t){return Xu(n,$u(Ku(n,t)[2])),Xu(n,$u(Ku(n,t)[2])),n}function Ku(n,t){null==t&&(t=10);var e=Yu(n),r=e[1]-e[0],u=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),i=t/r*u;return.15>=i?u*=10:.35>=i?u*=5:.75>=i&&(u*=2),e[0]=Math.ceil(e[0]/u)*u,e[1]=Math.floor(e[1]/u)*u+.5*u,e[2]=u,e}function Qu(n,t){return oa.range.apply(oa,Ku(n,t))}function ni(n,t,e){var r=Ku(n,t);if(e){var u=so.exec(e);if(u.shift(),"s"===u[8]){var i=oa.formatPrefix(Math.max(Ma(r[0]),Ma(r[1])));return u[7]||(u[7]="."+ti(i.scale(r[2]))),u[8]="f",e=oa.format(u.join("")),function(n){return e(i.scale(n))+i.symbol}}u[7]||(u[7]="."+ei(u[8],r)),e=u.join("")}else e=",."+ti(r[2])+"f";return oa.format(e)}function ti(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function ei(n,t){var e=ti(t[2]);return n in Sl?Math.abs(e-ti(Math.max(Ma(t[0]),Ma(t[1]))))+ +("e"!==n):e-2*("%"===n)}function ri(n,t,e,r){function u(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function i(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function a(t){return n(u(t))}return a.invert=function(t){return i(n.invert(t))},a.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(u)),a):r},a.base=function(e){return arguments.length?(t=+e,n.domain(r.map(u)),a):t},a.nice=function(){var t=Xu(r.map(u),e?Math:Nl);return n.domain(t),r=t.map(i),a},a.ticks=function(){var n=Yu(r),a=[],o=n[0],l=n[1],c=Math.floor(u(o)),s=Math.ceil(u(l)),f=t%1?2:t;if(isFinite(s-c)){if(e){for(;s>c;c++)for(var h=1;f>h;h++)a.push(i(c)*h);a.push(i(c))}else for(a.push(i(c));c++<s;)for(var h=f-1;h>0;h--)a.push(i(c)*h);for(c=0;a[c]<o;c++);for(s=a.length;a[s-1]>l;s--);a=a.slice(c,s)}return a},a.tickFormat=function(n,e){if(!arguments.length)return kl;arguments.length<2?e=kl:"function"!=typeof e&&(e=oa.format(e));var r=Math.max(1,t*n/a.ticks().length);return function(n){var a=n/i(Math.round(u(n)));return t-.5>a*t&&(a*=t),r>=a?e(n):""}},a.copy=function(){return ri(n.copy(),t,e,r)},Ju(a,n)}function ui(n,t,e){function r(t){return n(u(t))}var u=ii(t),i=ii(1/t);return r.invert=function(t){return i(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(u)),r):e},r.ticks=function(n){return Qu(e,n)},r.tickFormat=function(n,t){return ni(e,n,t)},r.nice=function(n){return r.domain(Gu(e,n))},r.exponent=function(a){return arguments.length?(u=ii(t=a),i=ii(1/t),n.domain(e.map(u)),r):t},r.copy=function(){return ui(n.copy(),t,e)},Ju(r,n)}function ii(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function ai(n,t){function e(e){return i[((u.get(e)||("range"===t.t?u.set(e,n.push(e)):NaN))-1)%i.length]}function r(t,e){return oa.range(n.length).map(function(n){return t+e*n})}var u,i,a;return e.domain=function(r){if(!arguments.length)return n;n=[],u=new c;for(var i,a=-1,o=r.length;++a<o;)u.has(i=r[a])||u.set(i,n.push(i));return e[t.t].apply(e,t.a)},e.range=function(n){return arguments.length?(i=n,a=0,t={t:"range",a:arguments},e):i},e.rangePoints=function(u,o){arguments.length<2&&(o=0);var l=u[0],c=u[1],s=n.length<2?(l=(l+c)/2,0):(c-l)/(n.length-1+o);return i=r(l+s*o/2,s),a=0,t={t:"rangePoints",a:arguments},e},e.rangeRoundPoints=function(u,o){arguments.length<2&&(o=0);var l=u[0],c=u[1],s=n.length<2?(l=c=Math.round((l+c)/2),0):(c-l)/(n.length-1+o)|0;return i=r(l+Math.round(s*o/2+(c-l-(n.length-1+o)*s)/2),s),a=0,t={t:"rangeRoundPoints",a:arguments},e},e.rangeBands=function(u,o,l){arguments.length<2&&(o=0),arguments.length<3&&(l=o);var c=u[1]<u[0],s=u[c-0],f=u[1-c],h=(f-s)/(n.length-o+2*l);return i=r(s+h*l,h),c&&i.reverse(),a=h*(1-o),t={t:"rangeBands",a:arguments},e},e.rangeRoundBands=function(u,o,l){arguments.length<2&&(o=0),arguments.length<3&&(l=o);var c=u[1]<u[0],s=u[c-0],f=u[1-c],h=Math.floor((f-s)/(n.length-o+2*l));return i=r(s+Math.round((f-s-(n.length-o)*h)/2),h),c&&i.reverse(),a=Math.round(h*(1-o)),t={t:"rangeRoundBands",a:arguments},e},e.rangeBand=function(){return a},e.rangeExtent=function(){return Yu(t.a[0])},e.copy=function(){return ai(n,t)},e.domain(n)}function oi(n,t){function i(){var e=0,r=t.length;for(o=[];++e<r;)o[e-1]=oa.quantile(n,e/r);return a}function a(n){return isNaN(n=+n)?void 0:t[oa.bisect(o,n)]}var o;return a.domain=function(t){return arguments.length?(n=t.map(r).filter(u).sort(e),i()):n},a.range=function(n){return arguments.length?(t=n,i()):t},a.quantiles=function(){return o},a.invertExtent=function(e){return e=t.indexOf(e),0>e?[NaN,NaN]:[e>0?o[e-1]:n[0],e<o.length?o[e]:n[n.length-1]]},a.copy=function(){return oi(n,t)},i()}function li(n,t,e){function r(t){return e[Math.max(0,Math.min(a,Math.floor(i*(t-n))))]}function u(){return i=e.length/(t-n),a=e.length-1,r}var i,a;return r.domain=function(e){return arguments.length?(n=+e[0],t=+e[e.length-1],u()):[n,t]},r.range=function(n){return arguments.length?(e=n,u()):e},r.invertExtent=function(t){return t=e.indexOf(t),t=0>t?NaN:t/i+n,[t,t+1/i]},r.copy=function(){return li(n,t,e)},u()}function ci(n,t){function e(e){return e>=e?t[oa.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return ci(n,t)},e}function si(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Qu(n,t)},t.tickFormat=function(t,e){return ni(n,t,e)},t.copy=function(){return si(n)},t}function fi(){return 0}function hi(n){return n.innerRadius}function gi(n){return n.outerRadius}function pi(n){return n.startAngle}function vi(n){return n.endAngle}function di(n){return n&&n.padAngle}function mi(n,t,e,r){return(n-e)*t-(t-r)*n>0?0:1}function yi(n,t,e,r,u){var i=n[0]-t[0],a=n[1]-t[1],o=(u?r:-r)/Math.sqrt(i*i+a*a),l=o*a,c=-o*i,s=n[0]+l,f=n[1]+c,h=t[0]+l,g=t[1]+c,p=(s+h)/2,v=(f+g)/2,d=h-s,m=g-f,y=d*d+m*m,M=e-r,x=s*g-h*f,b=(0>m?-1:1)*Math.sqrt(Math.max(0,M*M*y-x*x)),_=(x*m-d*b)/y,w=(-x*d-m*b)/y,S=(x*m+d*b)/y,k=(-x*d+m*b)/y,N=_-p,E=w-v,A=S-p,C=k-v;return N*N+E*E>A*A+C*C&&(_=S,w=k),[[_-l,w-c],[_*e/M,w*e/M]]}function Mi(n){function t(t){function a(){c.push("M",i(n(s),o))}for(var l,c=[],s=[],f=-1,h=t.length,g=En(e),p=En(r);++f<h;)u.call(this,l=t[f],f)?s.push([+g.call(this,l,f),+p.call(this,l,f)]):s.length&&(a(),s=[]);return s.length&&a(),c.length?c.join(""):null}var e=Ce,r=ze,u=zt,i=xi,a=i.key,o=.7;return t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t.defined=function(n){return arguments.length?(u=n,t):u},t.interpolate=function(n){return arguments.length?(a="function"==typeof n?i=n:(i=ql.get(n)||xi).key,t):a},t.tension=function(n){return arguments.length?(o=n,t):o},t}function xi(n){return n.length>1?n.join("L"):n+"Z"}function bi(n){return n.join("L")+"Z"}function _i(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r[0]+(r=n[t])[0])/2,"V",r[1]);return e>1&&u.push("H",r[0]),u.join("")}function wi(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("V",(r=n[t])[1],"H",r[0]);return u.join("")}function Si(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r=n[t])[0],"V",r[1]);return u.join("")}function ki(n,t){return n.length<4?xi(n):n[1]+Ai(n.slice(1,-1),Ci(n,t))}function Ni(n,t){return n.length<3?bi(n):n[0]+Ai((n.push(n[0]),n),Ci([n[n.length-2]].concat(n,[n[1]]),t))}function Ei(n,t){return n.length<3?xi(n):n[0]+Ai(n,Ci(n,t))}function Ai(n,t){if(t.length<1||n.length!=t.length&&n.length!=t.length+2)return xi(n);var e=n.length!=t.length,r="",u=n[0],i=n[1],a=t[0],o=a,l=1;if(e&&(r+="Q"+(i[0]-2*a[0]/3)+","+(i[1]-2*a[1]/3)+","+i[0]+","+i[1],u=n[1],l=2),t.length>1){o=t[1],i=n[l],l++,r+="C"+(u[0]+a[0])+","+(u[1]+a[1])+","+(i[0]-o[0])+","+(i[1]-o[1])+","+i[0]+","+i[1];for(var c=2;c<t.length;c++,l++)i=n[l],o=t[c],r+="S"+(i[0]-o[0])+","+(i[1]-o[1])+","+i[0]+","+i[1]}if(e){var s=n[l];r+="Q"+(i[0]+2*o[0]/3)+","+(i[1]+2*o[1]/3)+","+s[0]+","+s[1]}return r}function Ci(n,t){for(var e,r=[],u=(1-t)/2,i=n[0],a=n[1],o=1,l=n.length;++o<l;)e=i,i=a,a=n[o],r.push([u*(a[0]-e[0]),u*(a[1]-e[1])]);return r}function zi(n){if(n.length<3)return xi(n);var t=1,e=n.length,r=n[0],u=r[0],i=r[1],a=[u,u,u,(r=n[1])[0]],o=[i,i,i,r[1]],l=[u,",",i,"L",Ri(Dl,a),",",Ri(Dl,o)];for(n.push(n[e-1]);++t<=e;)r=n[t],a.shift(),a.push(r[0]),o.shift(),o.push(r[1]),Di(l,a,o);return n.pop(),l.push("L",r),l.join("")}function Li(n){if(n.length<4)return xi(n);for(var t,e=[],r=-1,u=n.length,i=[0],a=[0];++r<3;)t=n[r],i.push(t[0]),a.push(t[1]);for(e.push(Ri(Dl,i)+","+Ri(Dl,a)),--r;++r<u;)t=n[r],i.shift(),i.push(t[0]),a.shift(),a.push(t[1]),Di(e,i,a);return e.join("")}function qi(n){for(var t,e,r=-1,u=n.length,i=u+4,a=[],o=[];++r<4;)e=n[r%u],a.push(e[0]),o.push(e[1]);for(t=[Ri(Dl,a),",",Ri(Dl,o)],--r;++r<i;)e=n[r%u],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),Di(t,a,o);return t.join("")}function Ti(n,t){var e=n.length-1;if(e)for(var r,u,i=n[0][0],a=n[0][1],o=n[e][0]-i,l=n[e][1]-a,c=-1;++c<=e;)r=n[c],u=c/e,r[0]=t*r[0]+(1-t)*(i+u*o),r[1]=t*r[1]+(1-t)*(a+u*l);return zi(n)}function Ri(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function Di(n,t,e){n.push("C",Ri(Tl,t),",",Ri(Tl,e),",",Ri(Rl,t),",",Ri(Rl,e),",",Ri(Dl,t),",",Ri(Dl,e))}function Pi(n,t){return(t[1]-n[1])/(t[0]-n[0])}function Ui(n){for(var t=0,e=n.length-1,r=[],u=n[0],i=n[1],a=r[0]=Pi(u,i);++t<e;)r[t]=(a+(a=Pi(u=i,i=n[t+1])))/2;return r[t]=a,r}function ji(n){for(var t,e,r,u,i=[],a=Ui(n),o=-1,l=n.length-1;++o<l;)t=Pi(n[o],n[o+1]),Ma(t)<Da?a[o]=a[o+1]=0:(e=a[o]/t,r=a[o+1]/t,u=e*e+r*r,u>9&&(u=3*t/Math.sqrt(u),a[o]=u*e,a[o+1]=u*r));for(o=-1;++o<=l;)u=(n[Math.min(l,o+1)][0]-n[Math.max(0,o-1)][0])/(6*(1+a[o]*a[o])),i.push([u||0,a[o]*u||0]);return i}function Fi(n){return n.length<3?xi(n):n[0]+Ai(n,ji(n))}function Hi(n){for(var t,e,r,u=-1,i=n.length;++u<i;)t=n[u],e=t[0],r=t[1]-Ha,t[0]=e*Math.cos(r),t[1]=e*Math.sin(r);return n}function Oi(n){function t(t){function l(){v.push("M",o(n(m),f),s,c(n(d.reverse()),f),"Z")}for(var h,g,p,v=[],d=[],m=[],y=-1,M=t.length,x=En(e),b=En(u),_=e===r?function(){ | |
| return g}:En(r),w=u===i?function(){return p}:En(i);++y<M;)a.call(this,h=t[y],y)?(d.push([g=+x.call(this,h,y),p=+b.call(this,h,y)]),m.push([+_.call(this,h,y),+w.call(this,h,y)])):d.length&&(l(),d=[],m=[]);return d.length&&l(),v.length?v.join(""):null}var e=Ce,r=Ce,u=0,i=ze,a=zt,o=xi,l=o.key,c=o,s="L",f=.7;return t.x=function(n){return arguments.length?(e=r=n,t):r},t.x0=function(n){return arguments.length?(e=n,t):e},t.x1=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(u=i=n,t):i},t.y0=function(n){return arguments.length?(u=n,t):u},t.y1=function(n){return arguments.length?(i=n,t):i},t.defined=function(n){return arguments.length?(a=n,t):a},t.interpolate=function(n){return arguments.length?(l="function"==typeof n?o=n:(o=ql.get(n)||xi).key,c=o.reverse||o,s=o.closed?"M":"L",t):l},t.tension=function(n){return arguments.length?(f=n,t):f},t}function Ii(n){return n.radius}function Yi(n){return[n.x,n.y]}function Zi(n){return function(){var t=n.apply(this,arguments),e=t[0],r=t[1]-Ha;return[e*Math.cos(r),e*Math.sin(r)]}}function Vi(){return 64}function Xi(){return"circle"}function $i(n){var t=Math.sqrt(n/Ua);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Bi(n){return function(){var t,e,r;(t=this[n])&&(r=t[e=t.active])&&(r.timer.c=null,r.timer.t=NaN,--t.count?delete t[e]:delete this[n],t.active+=.5,r.event&&r.event.interrupt.call(this,this.__data__,r.index))}}function Wi(n,t,e){return Sa(n,Il),n.namespace=t,n.id=e,n}function Ji(n,t,e,r){var u=n.id,i=n.namespace;return Y(n,"function"==typeof e?function(n,a,o){n[i][u].tween.set(t,r(e.call(n,n.__data__,a,o)))}:(e=r(e),function(n){n[i][u].tween.set(t,e)}))}function Gi(n){return null==n&&(n=""),function(){this.textContent=n}}function Ki(n){return null==n?"__transition__":"__transition_"+n+"__"}function Qi(n,t,e,r,u){function i(n){var t=v.delay;return s.t=t+l,n>=t?a(n-t):void(s.c=a)}function a(e){var u=p.active,i=p[u];i&&(i.timer.c=null,i.timer.t=NaN,--p.count,delete p[u],i.event&&i.event.interrupt.call(n,n.__data__,i.index));for(var a in p)if(r>+a){var c=p[a];c.timer.c=null,c.timer.t=NaN,--p.count,delete p[a]}s.c=o,qn(function(){return s.c&&o(e||1)&&(s.c=null,s.t=NaN),1},0,l),p.active=r,v.event&&v.event.start.call(n,n.__data__,t),g=[],v.tween.forEach(function(e,r){(r=r.call(n,n.__data__,t))&&g.push(r)}),h=v.ease,f=v.duration}function o(u){for(var i=u/f,a=h(i),o=g.length;o>0;)g[--o].call(n,a);return i>=1?(v.event&&v.event.end.call(n,n.__data__,t),--p.count?delete p[r]:delete n[e],1):void 0}var l,s,f,h,g,p=n[e]||(n[e]={active:0,count:0}),v=p[r];v||(l=u.time,s=qn(i,0,l),v=p[r]={tween:new c,time:l,timer:s,delay:u.delay,duration:u.duration,ease:u.ease,index:t},u=null,++p.count)}function na(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function ta(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function ea(n){return n.toISOString()}function ra(n,t,e){function r(t){return n(t)}function u(n,e){var r=n[1]-n[0],u=r/e,i=oa.bisect(Gl,u);return i==Gl.length?[t.year,Ku(n.map(function(n){return n/31536e6}),e)[2]]:i?t[u/Gl[i-1]<Gl[i]/u?i-1:i]:[nc,Ku(n,e)[2]]}return r.invert=function(t){return ua(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t),r):n.domain().map(ua)},r.nice=function(n,t){function e(e){return!isNaN(e)&&!n.range(e,ua(+e+1),t).length}var i=r.domain(),a=Yu(i),o=null==n?u(a,10):"number"==typeof n&&u(a,n);return o&&(n=o[0],t=o[1]),r.domain(Xu(i,t>1?{floor:function(t){for(;e(t=n.floor(t));)t=ua(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=ua(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Yu(r.domain()),i=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(e[0],ua(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return ra(n.copy(),t,e)},Ju(r,n)}function ua(n){return new Date(n)}function ia(n){return JSON.parse(n.responseText)}function aa(n){var t=sa.createRange();return t.selectNode(sa.body),t.createContextualFragment(n.responseText)}var oa={version:"3.5.15"},la=[].slice,ca=function(n){return la.call(n)},sa=this.document;if(sa)try{ca(sa.documentElement.childNodes)[0].nodeType}catch(fa){ca=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),sa)try{sa.createElement("DIV").style.setProperty("opacity",0,"")}catch(ha){var ga=this.Element.prototype,pa=ga.setAttribute,va=ga.setAttributeNS,da=this.CSSStyleDeclaration.prototype,ma=da.setProperty;ga.setAttribute=function(n,t){pa.call(this,n,t+"")},ga.setAttributeNS=function(n,t,e){va.call(this,n,t,e+"")},da.setProperty=function(n,t,e){ma.call(this,n,t+"",e)}}oa.ascending=e,oa.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:NaN},oa.min=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(r=n[u])&&r>=r){e=r;break}for(;++u<i;)null!=(r=n[u])&&e>r&&(e=r)}else{for(;++u<i;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=r;break}for(;++u<i;)null!=(r=t.call(n,n[u],u))&&e>r&&(e=r)}return e},oa.max=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(r=n[u])&&r>=r){e=r;break}for(;++u<i;)null!=(r=n[u])&&r>e&&(e=r)}else{for(;++u<i;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=r;break}for(;++u<i;)null!=(r=t.call(n,n[u],u))&&r>e&&(e=r)}return e},oa.extent=function(n,t){var e,r,u,i=-1,a=n.length;if(1===arguments.length){for(;++i<a;)if(null!=(r=n[i])&&r>=r){e=u=r;break}for(;++i<a;)null!=(r=n[i])&&(e>r&&(e=r),r>u&&(u=r))}else{for(;++i<a;)if(null!=(r=t.call(n,n[i],i))&&r>=r){e=u=r;break}for(;++i<a;)null!=(r=t.call(n,n[i],i))&&(e>r&&(e=r),r>u&&(u=r))}return[e,u]},oa.sum=function(n,t){var e,r=0,i=n.length,a=-1;if(1===arguments.length)for(;++a<i;)u(e=+n[a])&&(r+=e);else for(;++a<i;)u(e=+t.call(n,n[a],a))&&(r+=e);return r},oa.mean=function(n,t){var e,i=0,a=n.length,o=-1,l=a;if(1===arguments.length)for(;++o<a;)u(e=r(n[o]))?i+=e:--l;else for(;++o<a;)u(e=r(t.call(n,n[o],o)))?i+=e:--l;return l?i/l:void 0},oa.quantile=function(n,t){var e=(n.length-1)*t+1,r=Math.floor(e),u=+n[r-1],i=e-r;return i?u+i*(n[r]-u):u},oa.median=function(n,t){var i,a=[],o=n.length,l=-1;if(1===arguments.length)for(;++l<o;)u(i=r(n[l]))&&a.push(i);else for(;++l<o;)u(i=r(t.call(n,n[l],l)))&&a.push(i);return a.length?oa.quantile(a.sort(e),.5):void 0},oa.variance=function(n,t){var e,i,a=n.length,o=0,l=0,c=-1,s=0;if(1===arguments.length)for(;++c<a;)u(e=r(n[c]))&&(i=e-o,o+=i/++s,l+=i*(e-o));else for(;++c<a;)u(e=r(t.call(n,n[c],c)))&&(i=e-o,o+=i/++s,l+=i*(e-o));return s>1?l/(s-1):void 0},oa.deviation=function(){var n=oa.variance.apply(this,arguments);return n?Math.sqrt(n):n};var ya=i(e);oa.bisectLeft=ya.left,oa.bisect=oa.bisectRight=ya.right,oa.bisector=function(n){return i(1===n.length?function(t,r){return e(n(t),r)}:n)},oa.shuffle=function(n,t,e){(i=arguments.length)<3&&(e=n.length,2>i&&(t=0));for(var r,u,i=e-t;i;)u=Math.random()*i--|0,r=n[i+t],n[i+t]=n[u+t],n[u+t]=r;return n},oa.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},oa.pairs=function(n){for(var t,e=0,r=n.length-1,u=n[0],i=new Array(0>r?0:r);r>e;)i[e]=[t=u,u=n[++e]];return i},oa.transpose=function(n){if(!(u=n.length))return[];for(var t=-1,e=oa.min(n,a),r=new Array(e);++t<e;)for(var u,i=-1,o=r[t]=new Array(u);++i<u;)o[i]=n[i][t];return r},oa.zip=function(){return oa.transpose(arguments)},oa.keys=function(n){var t=[];for(var e in n)t.push(e);return t},oa.values=function(n){var t=[];for(var e in n)t.push(n[e]);return t},oa.entries=function(n){var t=[];for(var e in n)t.push({key:e,value:n[e]});return t},oa.merge=function(n){for(var t,e,r,u=n.length,i=-1,a=0;++i<u;)a+=n[i].length;for(e=new Array(a);--u>=0;)for(r=n[u],t=r.length;--t>=0;)e[--a]=r[t];return e};var Ma=Math.abs;oa.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e===1/0)throw new Error("infinite range");var r,u=[],i=o(Ma(e)),a=-1;if(n*=i,t*=i,e*=i,0>e)for(;(r=n+e*++a)>t;)u.push(r/i);else for(;(r=n+e*++a)<t;)u.push(r/i);return u},oa.map=function(n,t){var e=new c;if(n instanceof c)n.forEach(function(n,t){e.set(n,t)});else if(Array.isArray(n)){var r,u=-1,i=n.length;if(1===arguments.length)for(;++u<i;)e.set(u,n[u]);else for(;++u<i;)e.set(t.call(n,r=n[u],u),r)}else for(var a in n)e.set(a,n[a]);return e};var xa="__proto__",ba="\x00";l(c,{has:h,get:function(n){return this._[s(n)]},set:function(n,t){return this._[s(n)]=t},remove:g,keys:p,values:function(){var n=[];for(var t in this._)n.push(this._[t]);return n},entries:function(){var n=[];for(var t in this._)n.push({key:f(t),value:this._[t]});return n},size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,f(t),this._[t])}}),oa.nest=function(){function n(t,a,o){if(o>=i.length)return r?r.call(u,a):e?a.sort(e):a;for(var l,s,f,h,g=-1,p=a.length,v=i[o++],d=new c;++g<p;)(h=d.get(l=v(s=a[g])))?h.push(s):d.set(l,[s]);return t?(s=t(),f=function(e,r){s.set(e,n(t,r,o))}):(s={},f=function(e,r){s[e]=n(t,r,o)}),d.forEach(f),s}function t(n,e){if(e>=i.length)return n;var r=[],u=a[e++];return n.forEach(function(n,u){r.push({key:n,values:t(u,e)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var e,r,u={},i=[],a=[];return u.map=function(t,e){return n(e,t,0)},u.entries=function(e){return t(n(oa.map,e,0),0)},u.key=function(n){return i.push(n),u},u.sortKeys=function(n){return a[i.length-1]=n,u},u.sortValues=function(n){return e=n,u},u.rollup=function(n){return r=n,u},u},oa.set=function(n){var t=new m;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},l(m,{has:h,add:function(n){return this._[s(n+="")]=!0,n},remove:g,values:p,size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,f(t))}}),oa.behavior={},oa.rebind=function(n,t){for(var e,r=1,u=arguments.length;++r<u;)n[e=arguments[r]]=M(n,t,t[e]);return n};var _a=["webkit","ms","moz","Moz","o","O"];oa.dispatch=function(){for(var n=new _,t=-1,e=arguments.length;++t<e;)n[arguments[t]]=w(n);return n},_.prototype.on=function(n,t){var e=n.indexOf("."),r="";if(e>=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},oa.event=null,oa.requote=function(n){return n.replace(wa,"\\$&")};var wa=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Sa={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},ka=function(n,t){return t.querySelector(n)},Na=function(n,t){return t.querySelectorAll(n)},Ea=function(n,t){var e=n.matches||n[x(n,"matchesSelector")];return(Ea=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(ka=function(n,t){return Sizzle(n,t)[0]||null},Na=Sizzle,Ea=Sizzle.matchesSelector),oa.selection=function(){return oa.select(sa.documentElement)};var Aa=oa.selection.prototype=[];Aa.select=function(n){var t,e,r,u,i=[];n=A(n);for(var a=-1,o=this.length;++a<o;){i.push(t=[]),t.parentNode=(r=this[a]).parentNode;for(var l=-1,c=r.length;++l<c;)(u=r[l])?(t.push(e=n.call(u,u.__data__,l,a)),e&&"__data__"in u&&(e.__data__=u.__data__)):t.push(null)}return E(i)},Aa.selectAll=function(n){var t,e,r=[];n=C(n);for(var u=-1,i=this.length;++u<i;)for(var a=this[u],o=-1,l=a.length;++o<l;)(e=a[o])&&(r.push(t=ca(n.call(e,e.__data__,o,u))),t.parentNode=e);return E(r)};var Ca={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};oa.ns={prefix:Ca,qualify:function(n){var t=n.indexOf(":"),e=n;return t>=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),Ca.hasOwnProperty(e)?{space:Ca[e],local:n}:n}},Aa.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=oa.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(z(t,n[t]));return this}return this.each(z(n,t))},Aa.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=T(n)).length,u=-1;if(t=e.classList){for(;++u<r;)if(!t.contains(n[u]))return!1}else for(t=e.getAttribute("class");++u<r;)if(!q(n[u]).test(t))return!1;return!0}for(t in n)this.each(R(t,n[t]));return this}return this.each(R(n,t))},Aa.style=function(n,e,r){var u=arguments.length;if(3>u){if("string"!=typeof n){2>u&&(e="");for(r in n)this.each(P(r,n[r],e));return this}if(2>u){var i=this.node();return t(i).getComputedStyle(i,null).getPropertyValue(n)}r=""}return this.each(P(n,e,r))},Aa.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(U(t,n[t]));return this}return this.each(U(n,t))},Aa.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},Aa.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},Aa.append=function(n){return n=j(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},Aa.insert=function(n,t){return n=j(n),t=A(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},Aa.remove=function(){return this.each(F)},Aa.data=function(n,t){function e(n,e){var r,u,i,a=n.length,f=e.length,h=Math.min(a,f),g=new Array(f),p=new Array(f),v=new Array(a);if(t){var d,m=new c,y=new Array(a);for(r=-1;++r<a;)(u=n[r])&&(m.has(d=t.call(u,u.__data__,r))?v[r]=u:m.set(d,u),y[r]=d);for(r=-1;++r<f;)(u=m.get(d=t.call(e,i=e[r],r)))?u!==!0&&(g[r]=u,u.__data__=i):p[r]=H(i),m.set(d,!0);for(r=-1;++r<a;)r in y&&m.get(y[r])!==!0&&(v[r]=n[r])}else{for(r=-1;++r<h;)u=n[r],i=e[r],u?(u.__data__=i,g[r]=u):p[r]=H(i);for(;f>r;++r)p[r]=H(e[r]);for(;a>r;++r)v[r]=n[r]}p.update=g,p.parentNode=g.parentNode=v.parentNode=n.parentNode,o.push(p),l.push(g),s.push(v)}var r,u,i=-1,a=this.length;if(!arguments.length){for(n=new Array(a=(r=this[0]).length);++i<a;)(u=r[i])&&(n[i]=u.__data__);return n}var o=Z([]),l=E([]),s=E([]);if("function"==typeof n)for(;++i<a;)e(r=this[i],n.call(r,r.parentNode.__data__,i));else for(;++i<a;)e(r=this[i],n);return l.enter=function(){return o},l.exit=function(){return s},l},Aa.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")},Aa.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=O(n));for(var i=0,a=this.length;a>i;i++){u.push(t=[]),t.parentNode=(e=this[i]).parentNode;for(var o=0,l=e.length;l>o;o++)(r=e[o])&&n.call(r,r.__data__,o,i)&&t.push(r)}return E(u)},Aa.order=function(){for(var n=-1,t=this.length;++n<t;)for(var e,r=this[n],u=r.length-1,i=r[u];--u>=0;)(e=r[u])&&(i&&i!==e.nextSibling&&i.parentNode.insertBefore(e,i),i=e);return this},Aa.sort=function(n){n=I.apply(this,arguments);for(var t=-1,e=this.length;++t<e;)this[t].sort(n);return this.order()},Aa.each=function(n){return Y(this,function(t,e,r){n.call(t,t.__data__,e,r)})},Aa.call=function(n){var t=ca(arguments);return n.apply(t[0]=this,t),this},Aa.empty=function(){return!this.node()},Aa.node=function(){for(var n=0,t=this.length;t>n;n++)for(var e=this[n],r=0,u=e.length;u>r;r++){var i=e[r];if(i)return i}return null},Aa.size=function(){var n=0;return Y(this,function(){++n}),n};var za=[];oa.selection.enter=Z,oa.selection.enter.prototype=za,za.append=Aa.append,za.empty=Aa.empty,za.node=Aa.node,za.call=Aa.call,za.size=Aa.size,za.select=function(n){for(var t,e,r,u,i,a=[],o=-1,l=this.length;++o<l;){r=(u=this[o]).update,a.push(t=[]),t.parentNode=u.parentNode;for(var c=-1,s=u.length;++c<s;)(i=u[c])?(t.push(r[c]=e=n.call(u.parentNode,i.__data__,c,o)),e.__data__=i.__data__):t.push(null)}return E(a)},za.insert=function(n,t){return arguments.length<2&&(t=V(this)),Aa.insert.call(this,n,t)},oa.select=function(t){var e;return"string"==typeof t?(e=[ka(t,sa)],e.parentNode=sa.documentElement):(e=[t],e.parentNode=n(t)),E([e])},oa.selectAll=function(n){var t;return"string"==typeof n?(t=ca(Na(n,sa)),t.parentNode=sa.documentElement):(t=ca(n),t.parentNode=null),E([t])},Aa.on=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(X(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(X(n,t,e))};var La=oa.map({mouseenter:"mouseover",mouseleave:"mouseout"});sa&&La.forEach(function(n){"on"+n in sa&&La.remove(n)});var qa,Ta=0;oa.mouse=function(n){return J(n,k())};var Ra=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;oa.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=k().changedTouches),t)for(var r,u=0,i=t.length;i>u;++u)if((r=t[u]).identifier===e)return J(n,r)},oa.behavior.drag=function(){function n(){this.on("mousedown.drag",i).on("touchstart.drag",a)}function e(n,t,e,i,a){return function(){function o(){var n,e,r=t(h,v);r&&(n=r[0]-M[0],e=r[1]-M[1],p|=n|e,M=r,g({type:"drag",x:r[0]+c[0],y:r[1]+c[1],dx:n,dy:e}))}function l(){t(h,v)&&(m.on(i+d,null).on(a+d,null),y(p),g({type:"dragend"}))}var c,s=this,f=oa.event.target.correspondingElement||oa.event.target,h=s.parentNode,g=r.of(s,arguments),p=0,v=n(),d=".drag"+(null==v?"":"-"+v),m=oa.select(e(f)).on(i+d,o).on(a+d,l),y=W(f),M=t(h,v);u?(c=u.apply(s,arguments),c=[c.x-M[0],c.y-M[1]]):c=[0,0],g({type:"dragstart"})}}var r=N(n,"drag","dragstart","dragend"),u=null,i=e(b,oa.mouse,t,"mousemove","mouseup"),a=e(G,oa.touch,y,"touchmove","touchend");return n.origin=function(t){return arguments.length?(u=t,n):u},oa.rebind(n,r,"on")},oa.touches=function(n,t){return arguments.length<2&&(t=k().touches),t?ca(t).map(function(t){var e=J(n,t);return e.identifier=t.identifier,e}):[]};var Da=1e-6,Pa=Da*Da,Ua=Math.PI,ja=2*Ua,Fa=ja-Da,Ha=Ua/2,Oa=Ua/180,Ia=180/Ua,Ya=Math.SQRT2,Za=2,Va=4;oa.interpolateZoom=function(n,t){var e,r,u=n[0],i=n[1],a=n[2],o=t[0],l=t[1],c=t[2],s=o-u,f=l-i,h=s*s+f*f;if(Pa>h)r=Math.log(c/a)/Ya,e=function(n){return[u+n*s,i+n*f,a*Math.exp(Ya*n*r)]};else{var g=Math.sqrt(h),p=(c*c-a*a+Va*h)/(2*a*Za*g),v=(c*c-a*a-Va*h)/(2*c*Za*g),d=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(v*v+1)-v);r=(m-d)/Ya,e=function(n){var t=n*r,e=rn(d),o=a/(Za*g)*(e*un(Ya*t+d)-en(d));return[u+o*s,i+o*f,a*e/rn(Ya*t+d)]}}return e.duration=1e3*r,e},oa.behavior.zoom=function(){function n(n){n.on(L,f).on($a+".zoom",g).on("dblclick.zoom",p).on(R,h)}function e(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function r(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function u(n){k.k=Math.max(A[0],Math.min(A[1],n))}function i(n,t){t=r(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function a(t,e,r,a){t.__chart__={x:k.x,y:k.y,k:k.k},u(Math.pow(2,a)),i(d=e,r),t=oa.select(t),C>0&&(t=t.transition().duration(C)),t.call(n.event)}function o(){b&&b.domain(x.range().map(function(n){return(n-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-k.y)/k.k}).map(_.invert))}function l(n){z++||n({type:"zoomstart"})}function c(n){o(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function s(n){--z||(n({type:"zoomend"}),d=null)}function f(){function n(){o=1,i(oa.mouse(u),h),c(a)}function r(){f.on(q,null).on(T,null),g(o),s(a)}var u=this,a=D.of(u,arguments),o=0,f=oa.select(t(u)).on(q,n).on(T,r),h=e(oa.mouse(u)),g=W(u);Ol.call(u),l(a)}function h(){function n(){var n=oa.touches(p);return g=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=e(n))}),n}function t(){var t=oa.event.target;oa.select(t).on(x,r).on(b,o),_.push(t);for(var e=oa.event.changedTouches,u=0,i=e.length;i>u;++u)d[e[u].identifier]=null;var l=n(),c=Date.now();if(1===l.length){if(500>c-M){var s=l[0];a(p,s,d[s.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),S()}M=c}else if(l.length>1){var s=l[0],f=l[1],h=s[0]-f[0],g=s[1]-f[1];m=h*h+g*g}}function r(){var n,t,e,r,a=oa.touches(p);Ol.call(p);for(var o=0,l=a.length;l>o;++o,r=null)if(e=a[o],r=d[e.identifier]){if(t)break;n=e,t=r}if(r){var s=(s=e[0]-n[0])*s+(s=e[1]-n[1])*s,f=m&&Math.sqrt(s/m);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],u(f*g)}M=null,i(n,t),c(v)}function o(){if(oa.event.touches.length){for(var t=oa.event.changedTouches,e=0,r=t.length;r>e;++e)delete d[t[e].identifier];for(var u in d)return void n()}oa.selectAll(_).on(y,null),w.on(L,f).on(R,h),N(),s(v)}var g,p=this,v=D.of(p,arguments),d={},m=0,y=".zoom-"+oa.event.changedTouches[0].identifier,x="touchmove"+y,b="touchend"+y,_=[],w=oa.select(p),N=W(p);t(),l(v),w.on(L,null).on(R,t)}function g(){var n=D.of(this,arguments);y?clearTimeout(y):(Ol.call(this),v=e(d=m||oa.mouse(this)),l(n)),y=setTimeout(function(){y=null,s(n)},50),S(),u(Math.pow(2,.002*Xa())*k.k),i(d,v),c(n)}function p(){var n=oa.mouse(this),t=Math.log(k.k)/Math.LN2;a(this,n,e(n),oa.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}var v,d,m,y,M,x,b,_,w,k={x:0,y:0,k:1},E=[960,500],A=Ba,C=250,z=0,L="mousedown.zoom",q="mousemove.zoom",T="mouseup.zoom",R="touchstart.zoom",D=N(n,"zoomstart","zoom","zoomend");return $a||($a="onwheel"in sa?(Xa=function(){return-oa.event.deltaY*(oa.event.deltaMode?120:1)},"wheel"):"onmousewheel"in sa?(Xa=function(){return oa.event.wheelDelta},"mousewheel"):(Xa=function(){return-oa.event.detail},"MozMousePixelScroll")),n.event=function(n){n.each(function(){var n=D.of(this,arguments),t=k;Fl?oa.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},l(n)}).tween("zoom:zoom",function(){var e=E[0],r=E[1],u=d?d[0]:e/2,i=d?d[1]:r/2,a=oa.interpolateZoom([(u-k.x)/k.k,(i-k.y)/k.k,e/k.k],[(u-t.x)/t.k,(i-t.y)/t.k,e/t.k]);return function(t){var r=a(t),o=e/r[2];this.__chart__=k={x:u-r[0]*o,y:i-r[1]*o,k:o},c(n)}}).each("interrupt.zoom",function(){s(n)}).each("end.zoom",function(){s(n)}):(this.__chart__=k,l(n),c(n),s(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},o(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:null},u(+t),o(),n):k.k},n.scaleExtent=function(t){return arguments.length?(A=null==t?Ba:[+t[0],+t[1]],n):A},n.center=function(t){return arguments.length?(m=t&&[+t[0],+t[1]],n):m},n.size=function(t){return arguments.length?(E=t&&[+t[0],+t[1]],n):E},n.duration=function(t){return arguments.length?(C=+t,n):C},n.x=function(t){return arguments.length?(b=t,x=t.copy(),k={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),k={x:0,y:0,k:1},n):w},oa.rebind(n,D,"on")};var Xa,$a,Ba=[0,1/0];oa.color=on,on.prototype.toString=function(){return this.rgb()+""},oa.hsl=ln;var Wa=ln.prototype=new on;Wa.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,this.l/n)},Wa.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,n*this.l)},Wa.rgb=function(){return cn(this.h,this.s,this.l)},oa.hcl=sn;var Ja=sn.prototype=new on;Ja.brighter=function(n){return new sn(this.h,this.c,Math.min(100,this.l+Ga*(arguments.length?n:1)))},Ja.darker=function(n){return new sn(this.h,this.c,Math.max(0,this.l-Ga*(arguments.length?n:1)))},Ja.rgb=function(){return fn(this.h,this.c,this.l).rgb()},oa.lab=hn;var Ga=18,Ka=.95047,Qa=1,no=1.08883,to=hn.prototype=new on;to.brighter=function(n){return new hn(Math.min(100,this.l+Ga*(arguments.length?n:1)),this.a,this.b)},to.darker=function(n){return new hn(Math.max(0,this.l-Ga*(arguments.length?n:1)),this.a,this.b)},to.rgb=function(){return gn(this.l,this.a,this.b)},oa.rgb=yn;var eo=yn.prototype=new on;eo.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,u=30;return t||e||r?(t&&u>t&&(t=u),e&&u>e&&(e=u),r&&u>r&&(r=u),new yn(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new yn(u,u,u)},eo.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new yn(n*this.r,n*this.g,n*this.b)},eo.hsl=function(){return wn(this.r,this.g,this.b)},eo.toString=function(){return"#"+bn(this.r)+bn(this.g)+bn(this.b)};var ro=oa.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});ro.forEach(function(n,t){ro.set(n,Mn(t))}),oa.functor=En,oa.xhr=An(y),oa.dsv=function(n,t){function e(n,e,i){arguments.length<3&&(i=e,e=null);var a=Cn(n,t,null==e?r:u(e),i);return a.row=function(n){return arguments.length?a.response(null==(e=n)?r:u(n)):e},a}function r(n){return e.parse(n.responseText)}function u(n){return function(t){return e.parse(t.responseText,n)}}function i(t){return t.map(a).join(n)}function a(n){return o.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var o=new RegExp('["'+n+"\n]"),l=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var u=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(u(n),e)}:u})},e.parseRows=function(n,t){function e(){if(s>=c)return a;if(u)return u=!1,i;var t=s;if(34===n.charCodeAt(t)){for(var e=t;e++<c;)if(34===n.charCodeAt(e)){if(34!==n.charCodeAt(e+1))break;++e}s=e+2;var r=n.charCodeAt(e+1);return 13===r?(u=!0,10===n.charCodeAt(e+2)&&++s):10===r&&(u=!0),n.slice(t+1,e).replace(/""/g,'"')}for(;c>s;){var r=n.charCodeAt(s++),o=1;if(10===r)u=!0;else if(13===r)u=!0,10===n.charCodeAt(s)&&(++s,++o);else if(r!==l)continue;return n.slice(t,s-o)}return n.slice(t)}for(var r,u,i={},a={},o=[],c=n.length,s=0,f=0;(r=e())!==a;){for(var h=[];r!==i&&r!==a;)h.push(r),r=e();t&&null==(h=t(h,f++))||o.push(h)}return o},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new m,u=[];return t.forEach(function(n){for(var t in n)r.has(t)||u.push(r.add(t))}),[u.map(a).join(n)].concat(t.map(function(t){return u.map(function(n){return a(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(i).join("\n")},e},oa.csv=oa.dsv(",","text/csv"),oa.tsv=oa.dsv(" ","text/tab-separated-values");var uo,io,ao,oo,lo=this[x(this,"requestAnimationFrame")]||function(n){setTimeout(n,17)};oa.timer=function(){qn.apply(this,arguments)},oa.timer.flush=function(){Rn(),Dn()},oa.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var co=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Un);oa.formatPrefix=function(n,t){var e=0;return(n=+n)&&(0>n&&(n*=-1),t&&(n=oa.round(n,Pn(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),co[8+e/3]};var so=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,fo=oa.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=oa.round(n,Pn(n,t))).toFixed(Math.max(0,Math.min(20,Pn(n*(1+1e-15),t))))}}),ho=oa.time={},go=Date;Hn.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){po.setUTCDate.apply(this._,arguments)},setDay:function(){po.setUTCDay.apply(this._,arguments)},setFullYear:function(){po.setUTCFullYear.apply(this._,arguments)},setHours:function(){po.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){po.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){po.setUTCMinutes.apply(this._,arguments)},setMonth:function(){po.setUTCMonth.apply(this._,arguments)},setSeconds:function(){po.setUTCSeconds.apply(this._,arguments)},setTime:function(){po.setTime.apply(this._,arguments)}};var po=Date.prototype;ho.year=On(function(n){return n=ho.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),ho.years=ho.year.range,ho.years.utc=ho.year.utc.range,ho.day=On(function(n){var t=new go(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),ho.days=ho.day.range,ho.days.utc=ho.day.utc.range,ho.dayOfYear=function(n){var t=ho.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=ho[n]=On(function(n){return(n=ho.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=ho.year(n).getDay();return Math.floor((ho.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});ho[n+"s"]=e.range,ho[n+"s"].utc=e.utc.range,ho[n+"OfYear"]=function(n){var e=ho.year(n).getDay();return Math.floor((ho.dayOfYear(n)+(e+t)%7)/7)}}),ho.week=ho.sunday,ho.weeks=ho.sunday.range,ho.weeks.utc=ho.sunday.utc.range,ho.weekOfYear=ho.sundayOfYear;var vo={"-":"",_:" ",0:"0"},mo=/^\s*\d+/,yo=/^%/;oa.locale=function(n){return{numberFormat:jn(n),timeFormat:Yn(n)}};var Mo=oa.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"], | |
| shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});oa.format=Mo.numberFormat,oa.geo={},st.prototype={s:0,t:0,add:function(n){ft(n,this.t,xo),ft(xo.s,this.s,this),this.s?this.t+=xo.t:this.s=xo.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var xo=new st;oa.geo.stream=function(n,t){n&&bo.hasOwnProperty(n.type)?bo[n.type](n,t):ht(n,t)};var bo={Feature:function(n,t){ht(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,u=e.length;++r<u;)ht(e[r].geometry,t)}},_o={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){gt(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)gt(e[r],t,0)},Polygon:function(n,t){pt(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)pt(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,u=e.length;++r<u;)ht(e[r],t)}};oa.geo.area=function(n){return wo=0,oa.geo.stream(n,ko),wo};var wo,So=new st,ko={sphere:function(){wo+=4*Ua},point:b,lineStart:b,lineEnd:b,polygonStart:function(){So.reset(),ko.lineStart=vt},polygonEnd:function(){var n=2*So;wo+=0>n?4*Ua+n:n,ko.lineStart=ko.lineEnd=ko.point=b}};oa.geo.bounds=function(){function n(n,t){M.push(x=[s=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,e){var r=dt([t*Oa,e*Oa]);if(m){var u=yt(m,r),i=[u[1],-u[0],0],a=yt(i,u);bt(a),a=_t(a);var l=t-p,c=l>0?1:-1,v=a[0]*Ia*c,d=Ma(l)>180;if(d^(v>c*p&&c*t>v)){var y=a[1]*Ia;y>g&&(g=y)}else if(v=(v+360)%360-180,d^(v>c*p&&c*t>v)){var y=-a[1]*Ia;f>y&&(f=y)}else f>e&&(f=e),e>g&&(g=e);d?p>t?o(s,t)>o(s,h)&&(h=t):o(t,h)>o(s,h)&&(s=t):h>=s?(s>t&&(s=t),t>h&&(h=t)):t>p?o(s,t)>o(s,h)&&(h=t):o(t,h)>o(s,h)&&(s=t)}else n(t,e);m=r,p=t}function e(){b.point=t}function r(){x[0]=s,x[1]=h,b.point=n,m=null}function u(n,e){if(m){var r=n-p;y+=Ma(r)>180?r+(r>0?360:-360):r}else v=n,d=e;ko.point(n,e),t(n,e)}function i(){ko.lineStart()}function a(){u(v,d),ko.lineEnd(),Ma(y)>Da&&(s=-(h=180)),x[0]=s,x[1]=h,m=null}function o(n,t){return(t-=n)<0?t+360:t}function l(n,t){return n[0]-t[0]}function c(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var s,f,h,g,p,v,d,m,y,M,x,b={point:n,lineStart:e,lineEnd:r,polygonStart:function(){b.point=u,b.lineStart=i,b.lineEnd=a,y=0,ko.polygonStart()},polygonEnd:function(){ko.polygonEnd(),b.point=n,b.lineStart=e,b.lineEnd=r,0>So?(s=-(h=180),f=-(g=90)):y>Da?g=90:-Da>y&&(f=-90),x[0]=s,x[1]=h}};return function(n){g=h=-(s=f=1/0),M=[],oa.geo.stream(n,b);var t=M.length;if(t){M.sort(l);for(var e,r=1,u=M[0],i=[u];t>r;++r)e=M[r],c(e[0],u)||c(e[1],u)?(o(u[0],e[1])>o(u[0],u[1])&&(u[1]=e[1]),o(e[0],u[1])>o(u[0],u[1])&&(u[0]=e[0])):i.push(u=e);for(var a,e,p=-(1/0),t=i.length-1,r=0,u=i[t];t>=r;u=e,++r)e=i[r],(a=o(u[1],e[0]))>p&&(p=a,s=e[0],h=u[1])}return M=x=null,s===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[s,f],[h,g]]}}(),oa.geo.centroid=function(n){No=Eo=Ao=Co=zo=Lo=qo=To=Ro=Do=Po=0,oa.geo.stream(n,Uo);var t=Ro,e=Do,r=Po,u=t*t+e*e+r*r;return Pa>u&&(t=Lo,e=qo,r=To,Da>Eo&&(t=Ao,e=Co,r=zo),u=t*t+e*e+r*r,Pa>u)?[NaN,NaN]:[Math.atan2(e,t)*Ia,tn(r/Math.sqrt(u))*Ia]};var No,Eo,Ao,Co,zo,Lo,qo,To,Ro,Do,Po,Uo={sphere:b,point:St,lineStart:Nt,lineEnd:Et,polygonStart:function(){Uo.lineStart=At},polygonEnd:function(){Uo.lineStart=Nt}},jo=Rt(zt,jt,Ht,[-Ua,-Ua/2]),Fo=1e9;oa.geo.clipExtent=function(){var n,t,e,r,u,i,a={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(o){return arguments.length?(i=Zt(n=+o[0][0],t=+o[0][1],e=+o[1][0],r=+o[1][1]),u&&(u.valid=!1,u=null),a):[[n,t],[e,r]]}};return a.extent([[0,0],[960,500]])},(oa.geo.conicEqualArea=function(){return Vt(Xt)}).raw=Xt,oa.geo.albers=function(){return oa.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},oa.geo.albersUsa=function(){function n(n){var i=n[0],a=n[1];return t=null,e(i,a),t||(r(i,a),t)||u(i,a),t}var t,e,r,u,i=oa.geo.albers(),a=oa.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o=oa.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=i.scale(),e=i.translate(),r=(n[0]-e[0])/t,u=(n[1]-e[1])/t;return(u>=.12&&.234>u&&r>=-.425&&-.214>r?a:u>=.166&&.234>u&&r>=-.214&&-.115>r?o:i).invert(n)},n.stream=function(n){var t=i.stream(n),e=a.stream(n),r=o.stream(n);return{point:function(n,u){t.point(n,u),e.point(n,u),r.point(n,u)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(i.precision(t),a.precision(t),o.precision(t),n):i.precision()},n.scale=function(t){return arguments.length?(i.scale(t),a.scale(.35*t),o.scale(t),n.translate(i.translate())):i.scale()},n.translate=function(t){if(!arguments.length)return i.translate();var c=i.scale(),s=+t[0],f=+t[1];return e=i.translate(t).clipExtent([[s-.455*c,f-.238*c],[s+.455*c,f+.238*c]]).stream(l).point,r=a.translate([s-.307*c,f+.201*c]).clipExtent([[s-.425*c+Da,f+.12*c+Da],[s-.214*c-Da,f+.234*c-Da]]).stream(l).point,u=o.translate([s-.205*c,f+.212*c]).clipExtent([[s-.214*c+Da,f+.166*c+Da],[s-.115*c-Da,f+.234*c-Da]]).stream(l).point,n},n.scale(1070)};var Ho,Oo,Io,Yo,Zo,Vo,Xo={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Oo=0,Xo.lineStart=$t},polygonEnd:function(){Xo.lineStart=Xo.lineEnd=Xo.point=b,Ho+=Ma(Oo/2)}},$o={point:Bt,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Bo={point:Gt,lineStart:Kt,lineEnd:Qt,polygonStart:function(){Bo.lineStart=ne},polygonEnd:function(){Bo.point=Gt,Bo.lineStart=Kt,Bo.lineEnd=Qt}};oa.geo.path=function(){function n(n){return n&&("function"==typeof o&&i.pointRadius(+o.apply(this,arguments)),a&&a.valid||(a=u(i)),oa.geo.stream(n,a)),i.result()}function t(){return a=null,n}var e,r,u,i,a,o=4.5;return n.area=function(n){return Ho=0,oa.geo.stream(n,u(Xo)),Ho},n.centroid=function(n){return Ao=Co=zo=Lo=qo=To=Ro=Do=Po=0,oa.geo.stream(n,u(Bo)),Po?[Ro/Po,Do/Po]:To?[Lo/To,qo/To]:zo?[Ao/zo,Co/zo]:[NaN,NaN]},n.bounds=function(n){return Zo=Vo=-(Io=Yo=1/0),oa.geo.stream(n,u($o)),[[Io,Yo],[Zo,Vo]]},n.projection=function(n){return arguments.length?(u=(e=n)?n.stream||re(n):y,t()):e},n.context=function(n){return arguments.length?(i=null==(r=n)?new Wt:new te(n),"function"!=typeof o&&i.pointRadius(o),t()):r},n.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(i.pointRadius(+t),+t),n):o},n.projection(oa.geo.albersUsa()).context(null)},oa.geo.transform=function(n){return{stream:function(t){var e=new ue(t);for(var r in n)e[r]=n[r];return e}}},ue.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},oa.geo.projection=ae,oa.geo.projectionMutator=oe,(oa.geo.equirectangular=function(){return ae(ce)}).raw=ce.invert=ce,oa.geo.rotation=function(n){function t(t){return t=n(t[0]*Oa,t[1]*Oa),t[0]*=Ia,t[1]*=Ia,t}return n=fe(n[0]%360*Oa,n[1]*Oa,n.length>2?n[2]*Oa:0),t.invert=function(t){return t=n.invert(t[0]*Oa,t[1]*Oa),t[0]*=Ia,t[1]*=Ia,t},t},se.invert=ce,oa.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=fe(-n[0]*Oa,-n[1]*Oa,0).invert,u=[];return e(null,null,1,{point:function(n,e){u.push(n=t(n,e)),n[0]*=Ia,n[1]*=Ia}}),{type:"Polygon",coordinates:[u]}}var t,e,r=[0,0],u=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=ve((t=+r)*Oa,u*Oa),n):t},n.precision=function(r){return arguments.length?(e=ve(t*Oa,(u=+r)*Oa),n):u},n.angle(90)},oa.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Oa,u=n[1]*Oa,i=t[1]*Oa,a=Math.sin(r),o=Math.cos(r),l=Math.sin(u),c=Math.cos(u),s=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((e=f*a)*e+(e=c*s-l*f*o)*e),l*s+c*f*o)},oa.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return oa.range(Math.ceil(i/d)*d,u,d).map(h).concat(oa.range(Math.ceil(c/m)*m,l,m).map(g)).concat(oa.range(Math.ceil(r/p)*p,e,p).filter(function(n){return Ma(n%d)>Da}).map(s)).concat(oa.range(Math.ceil(o/v)*v,a,v).filter(function(n){return Ma(n%m)>Da}).map(f))}var e,r,u,i,a,o,l,c,s,f,h,g,p=10,v=p,d=90,m=360,y=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(g(l).slice(1),h(u).reverse().slice(1),g(c).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(i=+t[0][0],u=+t[1][0],c=+t[0][1],l=+t[1][1],i>u&&(t=i,i=u,u=t),c>l&&(t=c,c=l,l=t),n.precision(y)):[[i,c],[u,l]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),o>a&&(t=o,o=a,a=t),n.precision(y)):[[r,o],[e,a]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],m=+t[1],n):[d,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],v=+t[1],n):[p,v]},n.precision=function(t){return arguments.length?(y=+t,s=me(o,a,90),f=ye(r,e,y),h=me(c,l,90),g=ye(i,u,y),n):y},n.majorExtent([[-180,-90+Da],[180,90-Da]]).minorExtent([[-180,-80-Da],[180,80+Da]])},oa.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||u.apply(this,arguments)]}}var t,e,r=Me,u=xe;return n.distance=function(){return oa.geo.distance(t||r.apply(this,arguments),e||u.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(u=t,e="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},oa.geo.interpolate=function(n,t){return be(n[0]*Oa,n[1]*Oa,t[0]*Oa,t[1]*Oa)},oa.geo.length=function(n){return Wo=0,oa.geo.stream(n,Jo),Wo};var Wo,Jo={sphere:b,point:b,lineStart:_e,lineEnd:b,polygonStart:b,polygonEnd:b},Go=we(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(oa.geo.azimuthalEqualArea=function(){return ae(Go)}).raw=Go;var Ko=we(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},y);(oa.geo.azimuthalEquidistant=function(){return ae(Ko)}).raw=Ko,(oa.geo.conicConformal=function(){return Vt(Se)}).raw=Se,(oa.geo.conicEquidistant=function(){return Vt(ke)}).raw=ke;var Qo=we(function(n){return 1/n},Math.atan);(oa.geo.gnomonic=function(){return ae(Qo)}).raw=Qo,Ne.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Ha]},(oa.geo.mercator=function(){return Ee(Ne)}).raw=Ne;var nl=we(function(){return 1},Math.asin);(oa.geo.orthographic=function(){return ae(nl)}).raw=nl;var tl=we(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(oa.geo.stereographic=function(){return ae(tl)}).raw=tl,Ae.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Ha]},(oa.geo.transverseMercator=function(){var n=Ee(Ae),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=Ae,oa.geom={},oa.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,u=En(e),i=En(r),a=n.length,o=[],l=[];for(t=0;a>t;t++)o.push([+u.call(this,n[t],t),+i.call(this,n[t],t),t]);for(o.sort(qe),t=0;a>t;t++)l.push([o[t][0],-o[t][1]]);var c=Le(o),s=Le(l),f=s[0]===c[0],h=s[s.length-1]===c[c.length-1],g=[];for(t=c.length-1;t>=0;--t)g.push(n[o[c[t]][2]]);for(t=+f;t<s.length-h;++t)g.push(n[o[s[t]][2]]);return g}var e=Ce,r=ze;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t)},oa.geom.polygon=function(n){return Sa(n,el),n};var el=oa.geom.polygon.prototype=[];el.area=function(){for(var n,t=-1,e=this.length,r=this[e-1],u=0;++t<e;)n=r,r=this[t],u+=n[1]*r[0]-n[0]*r[1];return.5*u},el.centroid=function(n){var t,e,r=-1,u=this.length,i=0,a=0,o=this[u-1];for(arguments.length||(n=-1/(6*this.area()));++r<u;)t=o,o=this[r],e=t[0]*o[1]-o[0]*t[1],i+=(t[0]+o[0])*e,a+=(t[1]+o[1])*e;return[i*n,a*n]},el.clip=function(n){for(var t,e,r,u,i,a,o=De(n),l=-1,c=this.length-De(this),s=this[c-1];++l<c;){for(t=n.slice(),n.length=0,u=this[l],i=t[(r=t.length-o)-1],e=-1;++e<r;)a=t[e],Te(a,s,u)?(Te(i,s,u)||n.push(Re(i,a,s,u)),n.push(a)):Te(i,s,u)&&n.push(Re(i,a,s,u)),i=a;o&&n.push(n[0]),s=u}return n};var rl,ul,il,al,ol,ll=[],cl=[];Ye.prototype.prepare=function(){for(var n,t=this.edges,e=t.length;e--;)n=t[e].edge,n.b&&n.a||t.splice(e,1);return t.sort(Ve),t.length},tr.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}},er.prototype={insert:function(n,t){var e,r,u;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=ar(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)r=e.U,e===r.L?(u=r.R,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.R&&(ur(this,e),n=e,e=n.U),e.C=!1,r.C=!0,ir(this,r))):(u=r.L,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.L&&(ir(this,e),n=e,e=n.U),e.C=!1,r.C=!0,ur(this,r))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t,e,r,u=n.U,i=n.L,a=n.R;if(e=i?a?ar(a):i:a,u?u.L===n?u.L=e:u.R=e:this._=e,i&&a?(r=e.C,e.C=n.C,e.L=i,i.U=e,e!==a?(u=e.U,e.U=n.U,n=e.R,u.L=n,e.R=a,a.U=e):(e.U=u,u=e,n=e.R)):(r=n.C,n=e),n&&(n.U=u),!r){if(n&&n.C)return void(n.C=!1);do{if(n===this._)break;if(n===u.L){if(t=u.R,t.C&&(t.C=!1,u.C=!0,ur(this,u),t=u.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,ir(this,t),t=u.R),t.C=u.C,u.C=t.R.C=!1,ur(this,u),n=this._;break}}else if(t=u.L,t.C&&(t.C=!1,u.C=!0,ir(this,u),t=u.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,ur(this,t),t=u.L),t.C=u.C,u.C=t.L.C=!1,ir(this,u),n=this._;break}t.C=!0,n=u,u=u.U}while(!n.C);n&&(n.C=!1)}}},oa.geom.voronoi=function(n){function t(n){var t=new Array(n.length),r=o[0][0],u=o[0][1],i=o[1][0],a=o[1][1];return or(e(n),o).cells.forEach(function(e,o){var l=e.edges,c=e.site,s=t[o]=l.length?l.map(function(n){var t=n.start();return[t.x,t.y]}):c.x>=r&&c.x<=i&&c.y>=u&&c.y<=a?[[r,a],[i,a],[i,u],[r,u]]:[];s.point=n[o]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(i(n,t)/Da)*Da,y:Math.round(a(n,t)/Da)*Da,i:t}})}var r=Ce,u=ze,i=r,a=u,o=sl;return n?t(n):(t.links=function(n){return or(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return or(e(n)).cells.forEach(function(e,r){for(var u,i,a=e.site,o=e.edges.sort(Ve),l=-1,c=o.length,s=o[c-1].edge,f=s.l===a?s.r:s.l;++l<c;)u=s,i=f,s=o[l].edge,f=s.l===a?s.r:s.l,r<i.i&&r<f.i&&cr(a,i,f)<0&&t.push([n[r],n[i.i],n[f.i]])}),t},t.x=function(n){return arguments.length?(i=En(r=n),t):r},t.y=function(n){return arguments.length?(a=En(u=n),t):u},t.clipExtent=function(n){return arguments.length?(o=null==n?sl:n,t):o===sl?null:o},t.size=function(n){return arguments.length?t.clipExtent(n&&[[0,0],n]):o===sl?null:o&&o[1]},t)};var sl=[[-1e6,-1e6],[1e6,1e6]];oa.geom.delaunay=function(n){return oa.geom.voronoi().triangles(n)},oa.geom.quadtree=function(n,t,e,r,u){function i(n){function i(n,t,e,r,u,i,a,o){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var l=n.x,s=n.y;if(null!=l)if(Ma(l-e)+Ma(s-r)<.01)c(n,t,e,r,u,i,a,o);else{var f=n.point;n.x=n.y=n.point=null,c(n,f,l,s,u,i,a,o),c(n,t,e,r,u,i,a,o)}else n.x=e,n.y=r,n.point=t}else c(n,t,e,r,u,i,a,o)}function c(n,t,e,r,u,a,o,l){var c=.5*(u+o),s=.5*(a+l),f=e>=c,h=r>=s,g=h<<1|f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=hr()),f?u=c:o=c,h?a=s:l=s,i(n,t,e,r,u,a,o,l)}var s,f,h,g,p,v,d,m,y,M=En(o),x=En(l);if(null!=t)v=t,d=e,m=r,y=u;else if(m=y=-(v=d=1/0),f=[],h=[],p=n.length,a)for(g=0;p>g;++g)s=n[g],s.x<v&&(v=s.x),s.y<d&&(d=s.y),s.x>m&&(m=s.x),s.y>y&&(y=s.y),f.push(s.x),h.push(s.y);else for(g=0;p>g;++g){var b=+M(s=n[g],g),_=+x(s,g);v>b&&(v=b),d>_&&(d=_),b>m&&(m=b),_>y&&(y=_),f.push(b),h.push(_)}var w=m-v,S=y-d;w>S?y=d+w:m=v+S;var k=hr();if(k.add=function(n){i(k,n,+M(n,++g),+x(n,g),v,d,m,y)},k.visit=function(n){gr(n,k,v,d,m,y)},k.find=function(n){return pr(k,n[0],n[1],v,d,m,y)},g=-1,null==t){for(;++g<p;)i(k,n[g],f[g],h[g],v,d,m,y);--g}else n.forEach(k.add);return f=h=n=s=null,k}var a,o=Ce,l=ze;return(a=arguments.length)?(o=sr,l=fr,3===a&&(u=e,r=t,e=t=0),i(n)):(i.x=function(n){return arguments.length?(o=n,i):o},i.y=function(n){return arguments.length?(l=n,i):l},i.extent=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=+n[0][0],e=+n[0][1],r=+n[1][0],u=+n[1][1]),i):null==t?null:[[t,e],[r,u]]},i.size=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=e=0,r=+n[0],u=+n[1]),i):null==t?null:[r-t,u-e]},i)},oa.interpolateRgb=vr,oa.interpolateObject=dr,oa.interpolateNumber=mr,oa.interpolateString=yr;var fl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hl=new RegExp(fl.source,"g");oa.interpolate=Mr,oa.interpolators=[function(n,t){var e=typeof t;return("string"===e?ro.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?vr:yr:t instanceof on?vr:Array.isArray(t)?xr:"object"===e&&isNaN(t)?dr:mr)(n,t)}],oa.interpolateArray=xr;var gl=function(){return y},pl=oa.map({linear:gl,poly:Er,quad:function(){return Sr},cubic:function(){return kr},sin:function(){return Ar},exp:function(){return Cr},circle:function(){return zr},elastic:Lr,back:qr,bounce:function(){return Tr}}),vl=oa.map({"in":y,out:_r,"in-out":wr,"out-in":function(n){return wr(_r(n))}});oa.ease=function(n){var t=n.indexOf("-"),e=t>=0?n.slice(0,t):n,r=t>=0?n.slice(t+1):"in";return e=pl.get(e)||gl,r=vl.get(r)||y,br(r(e.apply(null,la.call(arguments,1))))},oa.interpolateHcl=Rr,oa.interpolateHsl=Dr,oa.interpolateLab=Pr,oa.interpolateRound=Ur,oa.transform=function(n){var t=sa.createElementNS(oa.ns.prefix.svg,"g");return(oa.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new jr(e?e.matrix:dl)})(n)},jr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var dl={a:1,b:0,c:0,d:1,e:0,f:0};oa.interpolateTransform=$r,oa.layout={},oa.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++e<r;)t.push(Jr(n[e]));return t}},oa.layout.chord=function(){function n(){var n,c,f,h,g,p={},v=[],d=oa.range(i),m=[];for(e=[],r=[],n=0,h=-1;++h<i;){for(c=0,g=-1;++g<i;)c+=u[h][g];v.push(c),m.push(oa.range(i)),n+=c}for(a&&d.sort(function(n,t){return a(v[n],v[t])}),o&&m.forEach(function(n,t){n.sort(function(n,e){return o(u[t][n],u[t][e])})}),n=(ja-s*i)/n,c=0,h=-1;++h<i;){for(f=c,g=-1;++g<i;){var y=d[h],M=m[y][g],x=u[y][M],b=c,_=c+=x*n;p[y+"-"+M]={index:y,subindex:M,startAngle:b,endAngle:_,value:x}}r[y]={index:y,startAngle:f,endAngle:c,value:v[y]},c+=s}for(h=-1;++h<i;)for(g=h-1;++g<i;){var w=p[h+"-"+g],S=p[g+"-"+h];(w.value||S.value)&&e.push(w.value<S.value?{source:S,target:w}:{source:w,target:S})}l&&t()}function t(){e.sort(function(n,t){return l((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var e,r,u,i,a,o,l,c={},s=0;return c.matrix=function(n){return arguments.length?(i=(u=n)&&u.length,e=r=null,c):u},c.padding=function(n){return arguments.length?(s=n,e=r=null,c):s},c.sortGroups=function(n){return arguments.length?(a=n,e=r=null,c):a},c.sortSubgroups=function(n){return arguments.length?(o=n,e=null,c):o},c.sortChords=function(n){return arguments.length?(l=n,e&&t(),c):l},c.chords=function(){return e||n(),e},c.groups=function(){return r||n(),r},c},oa.layout.force=function(){function n(n){return function(t,e,r,u){if(t.point!==n){var i=t.cx-n.x,a=t.cy-n.y,o=u-e,l=i*i+a*a;if(l>o*o/m){if(v>l){var c=t.charge/l;n.px-=i*c,n.py-=a*c}return!0}if(t.point&&l&&v>l){var c=t.pointCharge/l;n.px-=i*c,n.py-=a*c}}return!t.charge}}function t(n){n.px=oa.event.x,n.py=oa.event.y,l.resume()}var e,r,u,i,a,o,l={},c=oa.dispatch("start","tick","end"),s=[1,1],f=.9,h=ml,g=yl,p=-30,v=Ml,d=.1,m=.64,M=[],x=[];return l.tick=function(){if((u*=.99)<.005)return e=null,c.end({type:"end",alpha:u=0}),!0;var t,r,l,h,g,v,m,y,b,_=M.length,w=x.length;for(r=0;w>r;++r)l=x[r],h=l.source,g=l.target,y=g.x-h.x,b=g.y-h.y,(v=y*y+b*b)&&(v=u*a[r]*((v=Math.sqrt(v))-i[r])/v,y*=v,b*=v,g.x-=y*(m=h.weight+g.weight?h.weight/(h.weight+g.weight):.5),g.y-=b*m,h.x+=y*(m=1-m),h.y+=b*m);if((m=u*d)&&(y=s[0]/2,b=s[1]/2,r=-1,m))for(;++r<_;)l=M[r],l.x+=(y-l.x)*m,l.y+=(b-l.y)*m;if(p)for(ru(t=oa.geom.quadtree(M),u,o),r=-1;++r<_;)(l=M[r]).fixed||t.visit(n(l));for(r=-1;++r<_;)l=M[r],l.fixed?(l.x=l.px,l.y=l.py):(l.x-=(l.px-(l.px=l.x))*f,l.y-=(l.py-(l.py=l.y))*f);c.tick({type:"tick",alpha:u})},l.nodes=function(n){return arguments.length?(M=n,l):M},l.links=function(n){return arguments.length?(x=n,l):x},l.size=function(n){return arguments.length?(s=n,l):s},l.linkDistance=function(n){return arguments.length?(h="function"==typeof n?n:+n,l):h},l.distance=l.linkDistance,l.linkStrength=function(n){return arguments.length?(g="function"==typeof n?n:+n,l):g},l.friction=function(n){return arguments.length?(f=+n,l):f},l.charge=function(n){return arguments.length?(p="function"==typeof n?n:+n,l):p},l.chargeDistance=function(n){return arguments.length?(v=n*n,l):Math.sqrt(v)},l.gravity=function(n){return arguments.length?(d=+n,l):d},l.theta=function(n){return arguments.length?(m=n*n,l):Math.sqrt(m)},l.alpha=function(n){return arguments.length?(n=+n,u?n>0?u=n:(e.c=null,e.t=NaN,e=null,c.end({type:"end",alpha:u=0})):n>0&&(c.start({type:"start",alpha:u=n}),e=qn(l.tick)),l):u},l.start=function(){function n(n,r){if(!e){for(e=new Array(u),l=0;u>l;++l)e[l]=[];for(l=0;c>l;++l){var i=x[l];e[i.source.index].push(i.target),e[i.target.index].push(i.source)}}for(var a,o=e[t],l=-1,s=o.length;++l<s;)if(!isNaN(a=o[l][n]))return a;return Math.random()*r}var t,e,r,u=M.length,c=x.length,f=s[0],v=s[1];for(t=0;u>t;++t)(r=M[t]).index=t,r.weight=0;for(t=0;c>t;++t)r=x[t],"number"==typeof r.source&&(r.source=M[r.source]),"number"==typeof r.target&&(r.target=M[r.target]),++r.source.weight,++r.target.weight;for(t=0;u>t;++t)r=M[t],isNaN(r.x)&&(r.x=n("x",f)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof h)for(t=0;c>t;++t)i[t]=+h.call(this,x[t],t);else for(t=0;c>t;++t)i[t]=h;if(a=[],"function"==typeof g)for(t=0;c>t;++t)a[t]=+g.call(this,x[t],t);else for(t=0;c>t;++t)a[t]=g;if(o=[],"function"==typeof p)for(t=0;u>t;++t)o[t]=+p.call(this,M[t],t);else for(t=0;u>t;++t)o[t]=p;return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){return r||(r=oa.behavior.drag().origin(y).on("dragstart.force",Qr).on("drag.force",t).on("dragend.force",nu)),arguments.length?void this.on("mouseover.force",tu).on("mouseout.force",eu).call(r):r},oa.rebind(l,c,"on")};var ml=20,yl=1,Ml=1/0;oa.layout.hierarchy=function(){function n(u){var i,a=[u],o=[];for(u.depth=0;null!=(i=a.pop());)if(o.push(i),(c=e.call(n,i,i.depth))&&(l=c.length)){for(var l,c,s;--l>=0;)a.push(s=c[l]),s.parent=i,s.depth=i.depth+1;r&&(i.value=0),i.children=c}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return au(u,function(n){var e,u;t&&(e=n.children)&&e.sort(t),r&&(u=n.parent)&&(u.value+=n.value)}),o}var t=cu,e=ou,r=lu;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(iu(t,function(n){n.children&&(n.value=0)}),au(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},oa.layout.partition=function(){function n(t,e,r,u){var i=t.children;if(t.x=e,t.y=t.depth*u,t.dx=r,t.dy=u,i&&(a=i.length)){var a,o,l,c=-1;for(r=t.value?r/t.value:0;++c<a;)n(o=i[c],e,l=o.value*r,u),e+=l}}function t(n){var e=n.children,r=0;if(e&&(u=e.length))for(var u,i=-1;++i<u;)r=Math.max(r,t(e[i]));return 1+r}function e(e,i){var a=r.call(this,e,i);return n(a[0],0,u[0],u[1]/t(a[0])),a}var r=oa.layout.hierarchy(),u=[1,1];return e.size=function(n){return arguments.length?(u=n,e):u},uu(e,r)},oa.layout.pie=function(){function n(a){var o,l=a.length,c=a.map(function(e,r){return+t.call(n,e,r)}),s=+("function"==typeof r?r.apply(this,arguments):r),f=("function"==typeof u?u.apply(this,arguments):u)-s,h=Math.min(Math.abs(f)/l,+("function"==typeof i?i.apply(this,arguments):i)),g=h*(0>f?-1:1),p=oa.sum(c),v=p?(f-l*g)/p:0,d=oa.range(l),m=[];return null!=e&&d.sort(e===xl?function(n,t){return c[t]-c[n]}:function(n,t){return e(a[n],a[t])}),d.forEach(function(n){m[n]={data:a[n],value:o=c[n],startAngle:s,endAngle:s+=o*v+g,padAngle:h}}),m}var t=Number,e=xl,r=0,u=ja,i=0;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(u=t,n):u},n.padAngle=function(t){return arguments.length?(i=t,n):i},n};var xl={};oa.layout.stack=function(){function n(o,l){if(!(h=o.length))return o;var c=o.map(function(e,r){return t.call(n,e,r)}),s=c.map(function(t){return t.map(function(t,e){return[i.call(n,t,e),a.call(n,t,e)]})}),f=e.call(n,s,l);c=oa.permute(c,f),s=oa.permute(s,f);var h,g,p,v,d=r.call(n,s,l),m=c[0].length;for(p=0;m>p;++p)for(u.call(n,c[0][p],v=d[p],s[0][p][1]),g=1;h>g;++g)u.call(n,c[g][p],v+=s[g-1][p][1],s[g][p][1]);return o}var t=y,e=pu,r=vu,u=gu,i=fu,a=hu;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:bl.get(t)||pu,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:_l.get(t)||vu,n):r},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(a=t,n):a},n.out=function(t){return arguments.length?(u=t,n):u},n};var bl=oa.map({"inside-out":function(n){var t,e,r=n.length,u=n.map(du),i=n.map(mu),a=oa.range(r).sort(function(n,t){return u[n]-u[t]}),o=0,l=0,c=[],s=[];for(t=0;r>t;++t)e=a[t],l>o?(o+=i[e],c.push(e)):(l+=i[e],s.push(e));return s.reverse().concat(c)},reverse:function(n){return oa.range(n.length).reverse()},"default":pu}),_l=oa.map({silhouette:function(n){var t,e,r,u=n.length,i=n[0].length,a=[],o=0,l=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];r>o&&(o=r),a.push(r)}for(e=0;i>e;++e)l[e]=(o-a[e])/2;return l},wiggle:function(n){var t,e,r,u,i,a,o,l,c,s=n.length,f=n[0],h=f.length,g=[];for(g[0]=l=c=0,e=1;h>e;++e){for(t=0,u=0;s>t;++t)u+=n[t][e][1];for(t=0,i=0,o=f[e][0]-f[e-1][0];s>t;++t){for(r=0,a=(n[t][e][1]-n[t][e-1][1])/(2*o);t>r;++r)a+=(n[r][e][1]-n[r][e-1][1])/o;i+=a*n[t][e][1]}g[e]=l-=u?i/u*o:0,c>l&&(c=l)}for(e=0;h>e;++e)g[e]-=c;return g},expand:function(n){var t,e,r,u=n.length,i=n[0].length,a=1/u,o=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];if(r)for(t=0;u>t;t++)n[t][e][1]/=r;else for(t=0;u>t;t++)n[t][e][1]=a}for(e=0;i>e;++e)o[e]=0;return o},zero:vu});oa.layout.histogram=function(){function n(n,i){for(var a,o,l=[],c=n.map(e,this),s=r.call(this,c,i),f=u.call(this,s,c,i),i=-1,h=c.length,g=f.length-1,p=t?1:1/h;++i<g;)a=l[i]=[],a.dx=f[i+1]-(a.x=f[i]),a.y=0;if(g>0)for(i=-1;++i<h;)o=c[i],o>=s[0]&&o<=s[1]&&(a=l[oa.bisect(f,o,1,g)-1],a.y+=p,a.push(n[i]));return l}var t=!0,e=Number,r=bu,u=Mu;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=En(t),n):r},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return xu(n,t)}:En(t),n):u},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},oa.layout.pack=function(){function n(n,i){var a=e.call(this,n,i),o=a[0],l=u[0],c=u[1],s=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(o.x=o.y=0,au(o,function(n){n.r=+s(n.value)}),au(o,Nu),r){var f=r*(t?1:Math.max(2*o.r/l,2*o.r/c))/2;au(o,function(n){n.r+=f}),au(o,Nu),au(o,function(n){n.r-=f})}return Cu(o,l/2,c/2,t?1:1/Math.max(2*o.r/l,2*o.r/c)),a}var t,e=oa.layout.hierarchy().sort(_u),r=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},uu(n,e)},oa.layout.tree=function(){function n(n,u){var s=a.call(this,n,u),f=s[0],h=t(f);if(au(h,e),h.parent.m=-h.z,iu(h,r),c)iu(f,i);else{var g=f,p=f,v=f;iu(f,function(n){n.x<g.x&&(g=n),n.x>p.x&&(p=n),n.depth>v.depth&&(v=n)});var d=o(g,p)/2-g.x,m=l[0]/(p.x+o(p,g)/2+d),y=l[1]/(v.depth||1);iu(f,function(n){n.x=(n.x+d)*m,n.y=n.depth*y})}return s}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var u,i=t.children,a=0,o=i.length;o>a;++a)r.push((i[a]=u={_:i[a],parent:t,children:(u=i[a].children)&&u.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=u);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){Du(n);var i=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+o(n._,r._),n.m=n.z-i):n.z=i}else r&&(n.z=r.z+o(n._,r._));n.parent.A=u(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function u(n,t,e){if(t){for(var r,u=n,i=n,a=t,l=u.parent.children[0],c=u.m,s=i.m,f=a.m,h=l.m;a=Tu(a),u=qu(u),a&&u;)l=qu(l),i=Tu(i),i.a=n,r=a.z+f-u.z-c+o(a._,u._),r>0&&(Ru(Pu(a,n,e),n,r),c+=r,s+=r),f+=a.m,c+=u.m,h+=l.m,s+=i.m;a&&!Tu(i)&&(i.t=a,i.m+=f-s),u&&!qu(l)&&(l.t=u,l.m+=c-h,e=n)}return e}function i(n){n.x*=l[0],n.y=n.depth*l[1]}var a=oa.layout.hierarchy().sort(null).value(null),o=Lu,l=[1,1],c=null;return n.separation=function(t){return arguments.length?(o=t,n):o},n.size=function(t){return arguments.length?(c=null==(l=t)?i:null,n):c?null:l},n.nodeSize=function(t){return arguments.length?(c=null==(l=t)?null:i,n):c?l:null},uu(n,a)},oa.layout.cluster=function(){function n(n,i){var a,o=t.call(this,n,i),l=o[0],c=0;au(l,function(n){var t=n.children;t&&t.length?(n.x=ju(t),n.y=Uu(t)):(n.x=a?c+=e(n,a):0,n.y=0,a=n)});var s=Fu(l),f=Hu(l),h=s.x-e(s,f)/2,g=f.x+e(f,s)/2;return au(l,u?function(n){n.x=(n.x-l.x)*r[0],n.y=(l.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(g-h)*r[0],n.y=(1-(l.y?n.y/l.y:1))*r[1]}),o}var t=oa.layout.hierarchy().sort(null).value(null),e=Lu,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},uu(n,t)},oa.layout.treemap=function(){function n(n,t){for(var e,r,u=-1,i=n.length;++u<i;)r=(e=n[u]).value*(0>t?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var i=e.children;if(i&&i.length){var a,o,l,c=f(e),s=[],h=i.slice(),p=1/0,v="slice"===g?c.dx:"dice"===g?c.dy:"slice-dice"===g?1&e.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(n(h,c.dx*c.dy/e.value),s.area=0;(l=h.length)>0;)s.push(a=h[l-1]),s.area+=a.area,"squarify"!==g||(o=r(s,v))<=p?(h.pop(),p=o):(s.area-=s.pop().area,u(s,v,c,!1),v=Math.min(c.dx,c.dy),s.length=s.area=0,p=1/0);s.length&&(u(s,v,c,!0),s.length=s.area=0),i.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var i,a=f(t),o=r.slice(),l=[];for(n(o,a.dx*a.dy/t.value),l.area=0;i=o.pop();)l.push(i),l.area+=i.area,null!=i.z&&(u(l,i.z?a.dx:a.dy,a,!o.length),l.length=l.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,u=0,i=1/0,a=-1,o=n.length;++a<o;)(e=n[a].area)&&(i>e&&(i=e),e>u&&(u=e));return r*=r,t*=t,r?Math.max(t*u*p/r,r/(t*i*p)):1/0}function u(n,t,e,r){var u,i=-1,a=n.length,o=e.x,c=e.y,s=t?l(n.area/t):0; | |
| if(t==e.dx){for((r||s>e.dy)&&(s=e.dy);++i<a;)u=n[i],u.x=o,u.y=c,u.dy=s,o+=u.dx=Math.min(e.x+e.dx-o,s?l(u.area/s):0);u.z=!0,u.dx+=e.x+e.dx-o,e.y+=s,e.dy-=s}else{for((r||s>e.dx)&&(s=e.dx);++i<a;)u=n[i],u.x=o,u.y=c,u.dx=s,c+=u.dy=Math.min(e.y+e.dy-c,s?l(u.area/s):0);u.z=!1,u.dy+=e.y+e.dy-c,e.x+=s,e.dx-=s}}function i(r){var u=a||o(r),i=u[0];return i.x=i.y=0,i.value?(i.dx=c[0],i.dy=c[1]):i.dx=i.dy=0,a&&o.revalue(i),n([i],i.dx*i.dy/i.value),(a?e:t)(i),h&&(a=u),u}var a,o=oa.layout.hierarchy(),l=Math.round,c=[1,1],s=null,f=Ou,h=!1,g="squarify",p=.5*(1+Math.sqrt(5));return i.size=function(n){return arguments.length?(c=n,i):c},i.padding=function(n){function t(t){var e=n.call(i,t,t.depth);return null==e?Ou(t):Iu(t,"number"==typeof e?[e,e,e,e]:e)}function e(t){return Iu(t,n)}if(!arguments.length)return s;var r;return f=null==(s=n)?Ou:"function"==(r=typeof n)?t:"number"===r?(n=[n,n,n,n],e):e,i},i.round=function(n){return arguments.length?(l=n?Math.round:Number,i):l!=Number},i.sticky=function(n){return arguments.length?(h=n,a=null,i):h},i.ratio=function(n){return arguments.length?(p=n,i):p},i.mode=function(n){return arguments.length?(g=n+"",i):g},uu(i,o)},oa.random={normal:function(n,t){var e=arguments.length;return 2>e&&(t=1),1>e&&(n=0),function(){var e,r,u;do e=2*Math.random()-1,r=2*Math.random()-1,u=e*e+r*r;while(!u||u>1);return n+t*e*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=oa.random.normal.apply(oa,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=oa.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},oa.scale={};var wl={floor:y,ceil:y};oa.scale.linear=function(){return Wu([0,1],[0,1],Mr,!1)};var Sl={s:1,g:1,p:1,r:1,e:1};oa.scale.log=function(){return ri(oa.scale.linear().domain([0,1]),10,!0,[1,10])};var kl=oa.format(".0e"),Nl={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};oa.scale.pow=function(){return ui(oa.scale.linear(),1,[0,1])},oa.scale.sqrt=function(){return oa.scale.pow().exponent(.5)},oa.scale.ordinal=function(){return ai([],{t:"range",a:[[]]})},oa.scale.category10=function(){return oa.scale.ordinal().range(El)},oa.scale.category20=function(){return oa.scale.ordinal().range(Al)},oa.scale.category20b=function(){return oa.scale.ordinal().range(Cl)},oa.scale.category20c=function(){return oa.scale.ordinal().range(zl)};var El=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(xn),Al=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(xn),Cl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(xn),zl=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(xn);oa.scale.quantile=function(){return oi([],[])},oa.scale.quantize=function(){return li(0,1,[0,1])},oa.scale.threshold=function(){return ci([.5],[0,1])},oa.scale.identity=function(){return si([0,1])},oa.svg={},oa.svg.arc=function(){function n(){var n=Math.max(0,+e.apply(this,arguments)),c=Math.max(0,+r.apply(this,arguments)),s=a.apply(this,arguments)-Ha,f=o.apply(this,arguments)-Ha,h=Math.abs(f-s),g=s>f?0:1;if(n>c&&(p=c,c=n,n=p),h>=Fa)return t(c,g)+(n?t(n,1-g):"")+"Z";var p,v,d,m,y,M,x,b,_,w,S,k,N=0,E=0,A=[];if((m=(+l.apply(this,arguments)||0)/2)&&(d=i===Ll?Math.sqrt(n*n+c*c):+i.apply(this,arguments),g||(E*=-1),c&&(E=tn(d/c*Math.sin(m))),n&&(N=tn(d/n*Math.sin(m)))),c){y=c*Math.cos(s+E),M=c*Math.sin(s+E),x=c*Math.cos(f-E),b=c*Math.sin(f-E);var C=Math.abs(f-s-2*E)<=Ua?0:1;if(E&&mi(y,M,x,b)===g^C){var z=(s+f)/2;y=c*Math.cos(z),M=c*Math.sin(z),x=b=null}}else y=M=0;if(n){_=n*Math.cos(f-N),w=n*Math.sin(f-N),S=n*Math.cos(s+N),k=n*Math.sin(s+N);var L=Math.abs(s-f+2*N)<=Ua?0:1;if(N&&mi(_,w,S,k)===1-g^L){var q=(s+f)/2;_=n*Math.cos(q),w=n*Math.sin(q),S=k=null}}else _=w=0;if(h>Da&&(p=Math.min(Math.abs(c-n)/2,+u.apply(this,arguments)))>.001){v=c>n^g?0:1;var T=p,R=p;if(Ua>h){var D=null==S?[_,w]:null==x?[y,M]:Re([y,M],[S,k],[x,b],[_,w]),P=y-D[0],U=M-D[1],j=x-D[0],F=b-D[1],H=1/Math.sin(Math.acos((P*j+U*F)/(Math.sqrt(P*P+U*U)*Math.sqrt(j*j+F*F)))/2),O=Math.sqrt(D[0]*D[0]+D[1]*D[1]);R=Math.min(p,(n-O)/(H-1)),T=Math.min(p,(c-O)/(H+1))}if(null!=x){var I=yi(null==S?[_,w]:[S,k],[y,M],c,T,g),Y=yi([x,b],[_,w],c,T,g);p===T?A.push("M",I[0],"A",T,",",T," 0 0,",v," ",I[1],"A",c,",",c," 0 ",1-g^mi(I[1][0],I[1][1],Y[1][0],Y[1][1]),",",g," ",Y[1],"A",T,",",T," 0 0,",v," ",Y[0]):A.push("M",I[0],"A",T,",",T," 0 1,",v," ",Y[0])}else A.push("M",y,",",M);if(null!=S){var Z=yi([y,M],[S,k],n,-R,g),V=yi([_,w],null==x?[y,M]:[x,b],n,-R,g);p===R?A.push("L",V[0],"A",R,",",R," 0 0,",v," ",V[1],"A",n,",",n," 0 ",g^mi(V[1][0],V[1][1],Z[1][0],Z[1][1]),",",1-g," ",Z[1],"A",R,",",R," 0 0,",v," ",Z[0]):A.push("L",V[0],"A",R,",",R," 0 0,",v," ",Z[0])}else A.push("L",_,",",w)}else A.push("M",y,",",M),null!=x&&A.push("A",c,",",c," 0 ",C,",",g," ",x,",",b),A.push("L",_,",",w),null!=S&&A.push("A",n,",",n," 0 ",L,",",1-g," ",S,",",k);return A.push("Z"),A.join("")}function t(n,t){return"M0,"+n+"A"+n+","+n+" 0 1,"+t+" 0,"+-n+"A"+n+","+n+" 0 1,"+t+" 0,"+n}var e=hi,r=gi,u=fi,i=Ll,a=pi,o=vi,l=di;return n.innerRadius=function(t){return arguments.length?(e=En(t),n):e},n.outerRadius=function(t){return arguments.length?(r=En(t),n):r},n.cornerRadius=function(t){return arguments.length?(u=En(t),n):u},n.padRadius=function(t){return arguments.length?(i=t==Ll?Ll:En(t),n):i},n.startAngle=function(t){return arguments.length?(a=En(t),n):a},n.endAngle=function(t){return arguments.length?(o=En(t),n):o},n.padAngle=function(t){return arguments.length?(l=En(t),n):l},n.centroid=function(){var n=(+e.apply(this,arguments)+ +r.apply(this,arguments))/2,t=(+a.apply(this,arguments)+ +o.apply(this,arguments))/2-Ha;return[Math.cos(t)*n,Math.sin(t)*n]},n};var Ll="auto";oa.svg.line=function(){return Mi(y)};var ql=oa.map({linear:xi,"linear-closed":bi,step:_i,"step-before":wi,"step-after":Si,basis:zi,"basis-open":Li,"basis-closed":qi,bundle:Ti,cardinal:Ei,"cardinal-open":ki,"cardinal-closed":Ni,monotone:Fi});ql.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Tl=[0,2/3,1/3,0],Rl=[0,1/3,2/3,0],Dl=[0,1/6,2/3,1/6];oa.svg.line.radial=function(){var n=Mi(Hi);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},wi.reverse=Si,Si.reverse=wi,oa.svg.area=function(){return Oi(y)},oa.svg.area.radial=function(){var n=Oi(Hi);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},oa.svg.chord=function(){function n(n,o){var l=t(this,i,n,o),c=t(this,a,n,o);return"M"+l.p0+r(l.r,l.p1,l.a1-l.a0)+(e(l,c)?u(l.r,l.p1,l.r,l.p0):u(l.r,l.p1,c.r,c.p0)+r(c.r,c.p1,c.a1-c.a0)+u(c.r,c.p1,l.r,l.p0))+"Z"}function t(n,t,e,r){var u=t.call(n,e,r),i=o.call(n,u,r),a=l.call(n,u,r)-Ha,s=c.call(n,u,r)-Ha;return{r:i,a0:a,a1:s,p0:[i*Math.cos(a),i*Math.sin(a)],p1:[i*Math.cos(s),i*Math.sin(s)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>Ua)+",1 "+t}function u(n,t,e,r){return"Q 0,0 "+r}var i=Me,a=xe,o=Ii,l=pi,c=vi;return n.radius=function(t){return arguments.length?(o=En(t),n):o},n.source=function(t){return arguments.length?(i=En(t),n):i},n.target=function(t){return arguments.length?(a=En(t),n):a},n.startAngle=function(t){return arguments.length?(l=En(t),n):l},n.endAngle=function(t){return arguments.length?(c=En(t),n):c},n},oa.svg.diagonal=function(){function n(n,u){var i=t.call(this,n,u),a=e.call(this,n,u),o=(i.y+a.y)/2,l=[i,{x:i.x,y:o},{x:a.x,y:o},a];return l=l.map(r),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var t=Me,e=xe,r=Yi;return n.source=function(e){return arguments.length?(t=En(e),n):t},n.target=function(t){return arguments.length?(e=En(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},oa.svg.diagonal.radial=function(){var n=oa.svg.diagonal(),t=Yi,e=n.projection;return n.projection=function(n){return arguments.length?e(Zi(t=n)):t},n},oa.svg.symbol=function(){function n(n,r){return(Pl.get(t.call(this,n,r))||$i)(e.call(this,n,r))}var t=Xi,e=Vi;return n.type=function(e){return arguments.length?(t=En(e),n):t},n.size=function(t){return arguments.length?(e=En(t),n):e},n};var Pl=oa.map({circle:$i,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*jl)),e=t*jl;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/Ul),e=t*Ul/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/Ul),e=t*Ul/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});oa.svg.symbolTypes=Pl.keys();var Ul=Math.sqrt(3),jl=Math.tan(30*Oa);Aa.transition=function(n){for(var t,e,r=Fl||++Yl,u=Ki(n),i=[],a=Hl||{time:Date.now(),ease:Nr,delay:0,duration:250},o=-1,l=this.length;++o<l;){i.push(t=[]);for(var c=this[o],s=-1,f=c.length;++s<f;)(e=c[s])&&Qi(e,s,u,r,a),t.push(e)}return Wi(i,u,r)},Aa.interrupt=function(n){return this.each(null==n?Ol:Bi(Ki(n)))};var Fl,Hl,Ol=Bi(Ki()),Il=[],Yl=0;Il.call=Aa.call,Il.empty=Aa.empty,Il.node=Aa.node,Il.size=Aa.size,oa.transition=function(n,t){return n&&n.transition?Fl?n.transition(t):n:oa.selection().transition(n)},oa.transition.prototype=Il,Il.select=function(n){var t,e,r,u=this.id,i=this.namespace,a=[];n=A(n);for(var o=-1,l=this.length;++o<l;){a.push(t=[]);for(var c=this[o],s=-1,f=c.length;++s<f;)(r=c[s])&&(e=n.call(r,r.__data__,s,o))?("__data__"in r&&(e.__data__=r.__data__),Qi(e,s,i,u,r[i][u]),t.push(e)):t.push(null)}return Wi(a,i,u)},Il.selectAll=function(n){var t,e,r,u,i,a=this.id,o=this.namespace,l=[];n=C(n);for(var c=-1,s=this.length;++c<s;)for(var f=this[c],h=-1,g=f.length;++h<g;)if(r=f[h]){i=r[o][a],e=n.call(r,r.__data__,h,c),l.push(t=[]);for(var p=-1,v=e.length;++p<v;)(u=e[p])&&Qi(u,p,o,a,i),t.push(u)}return Wi(l,o,a)},Il.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=O(n));for(var i=0,a=this.length;a>i;i++){u.push(t=[]);for(var e=this[i],o=0,l=e.length;l>o;o++)(r=e[o])&&n.call(r,r.__data__,o,i)&&t.push(r)}return Wi(u,this.namespace,this.id)},Il.tween=function(n,t){var e=this.id,r=this.namespace;return arguments.length<2?this.node()[r][e].tween.get(n):Y(this,null==t?function(t){t[r][e].tween.remove(n)}:function(u){u[r][e].tween.set(n,t)})},Il.attr=function(n,t){function e(){this.removeAttribute(o)}function r(){this.removeAttributeNS(o.space,o.local)}function u(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(o);return e!==n&&(t=a(e,n),function(n){this.setAttribute(o,t(n))})})}function i(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(o.space,o.local);return e!==n&&(t=a(e,n),function(n){this.setAttributeNS(o.space,o.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var a="transform"==n?$r:Mr,o=oa.ns.qualify(n);return Ji(this,"attr."+n,t,o.local?i:u)},Il.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(u));return r&&function(n){this.setAttribute(u,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(u.space,u.local));return r&&function(n){this.setAttributeNS(u.space,u.local,r(n))}}var u=oa.ns.qualify(n);return this.tween("attr."+n,u.local?r:e)},Il.style=function(n,e,r){function u(){this.style.removeProperty(n)}function i(e){return null==e?u:(e+="",function(){var u,i=t(this).getComputedStyle(this,null).getPropertyValue(n);return i!==e&&(u=Mr(i,e),function(t){this.style.setProperty(n,u(t),r)})})}var a=arguments.length;if(3>a){if("string"!=typeof n){2>a&&(e="");for(r in n)this.style(r,n[r],e);return this}r=""}return Ji(this,"style."+n,e,i)},Il.styleTween=function(n,e,r){function u(u,i){var a=e.call(this,u,i,t(this).getComputedStyle(this,null).getPropertyValue(n));return a&&function(t){this.style.setProperty(n,a(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+n,u)},Il.text=function(n){return Ji(this,"text",n,Gi)},Il.remove=function(){var n=this.namespace;return this.each("end.transition",function(){var t;this[n].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Il.ease=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].ease:("function"!=typeof n&&(n=oa.ease.apply(oa,arguments)),Y(this,function(r){r[e][t].ease=n}))},Il.delay=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].delay:Y(this,"function"==typeof n?function(r,u,i){r[e][t].delay=+n.call(r,r.__data__,u,i)}:(n=+n,function(r){r[e][t].delay=n}))},Il.duration=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].duration:Y(this,"function"==typeof n?function(r,u,i){r[e][t].duration=Math.max(1,n.call(r,r.__data__,u,i))}:(n=Math.max(1,n),function(r){r[e][t].duration=n}))},Il.each=function(n,t){var e=this.id,r=this.namespace;if(arguments.length<2){var u=Hl,i=Fl;try{Fl=e,Y(this,function(t,u,i){Hl=t[r][e],n.call(t,t.__data__,u,i)})}finally{Hl=u,Fl=i}}else Y(this,function(u){var i=u[r][e];(i.event||(i.event=oa.dispatch("start","end","interrupt"))).on(n,t)});return this},Il.transition=function(){for(var n,t,e,r,u=this.id,i=++Yl,a=this.namespace,o=[],l=0,c=this.length;c>l;l++){o.push(n=[]);for(var t=this[l],s=0,f=t.length;f>s;s++)(e=t[s])&&(r=e[a][u],Qi(e,s,a,i,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),n.push(e)}return Wi(o,a,i)},oa.svg.axis=function(){function n(n){n.each(function(){var n,c=oa.select(this),s=this.__chart__||e,f=this.__chart__=e.copy(),h=null==l?f.ticks?f.ticks.apply(f,o):f.domain():l,g=null==t?f.tickFormat?f.tickFormat.apply(f,o):y:t,p=c.selectAll(".tick").data(h,f),v=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Da),d=oa.transition(p.exit()).style("opacity",Da).remove(),m=oa.transition(p.order()).style("opacity",1),M=Math.max(u,0)+a,x=Zu(f),b=c.selectAll(".domain").data([0]),_=(b.enter().append("path").attr("class","domain"),oa.transition(b));v.append("line"),v.append("text");var w,S,k,N,E=v.select("line"),A=m.select("line"),C=p.select("text").text(g),z=v.select("text"),L=m.select("text"),q="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(n=na,w="x",k="y",S="x2",N="y2",C.attr("dy",0>q?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+x[0]+","+q*i+"V0H"+x[1]+"V"+q*i)):(n=ta,w="y",k="x",S="y2",N="x2",C.attr("dy",".32em").style("text-anchor",0>q?"end":"start"),_.attr("d","M"+q*i+","+x[0]+"H0V"+x[1]+"H"+q*i)),E.attr(N,q*u),z.attr(k,q*M),A.attr(S,0).attr(N,q*u),L.attr(w,0).attr(k,q*M),f.rangeBand){var T=f,R=T.rangeBand()/2;s=f=function(n){return T(n)+R}}else s.rangeBand?s=f:d.call(n,f,s);v.call(n,s,f),m.call(n,f,f)})}var t,e=oa.scale.linear(),r=Zl,u=6,i=6,a=3,o=[10],l=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Vl?t+"":Zl,n):r},n.ticks=function(){return arguments.length?(o=ca(arguments),n):o},n.tickValues=function(t){return arguments.length?(l=t,n):l},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(u=+t,i=+arguments[e-1],n):u},n.innerTickSize=function(t){return arguments.length?(u=+t,n):u},n.outerTickSize=function(t){return arguments.length?(i=+t,n):i},n.tickPadding=function(t){return arguments.length?(a=+t,n):a},n.tickSubdivide=function(){return arguments.length&&n},n};var Zl="bottom",Vl={top:1,right:1,bottom:1,left:1};oa.svg.brush=function(){function n(t){t.each(function(){var t=oa.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",i).on("touchstart.brush",i),a=t.selectAll(".background").data([0]);a.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var o=t.selectAll(".resize").data(v,y);o.exit().remove(),o.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return Xl[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),o.style("display",n.empty()?"none":null);var l,f=oa.transition(t),h=oa.transition(a);c&&(l=Zu(c),h.attr("x",l[0]).attr("width",l[1]-l[0]),r(f)),s&&(l=Zu(s),h.attr("y",l[0]).attr("height",l[1]-l[0]),u(f)),e(f)})}function e(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+f[+/e$/.test(n)]+","+h[+/^s/.test(n)]+")"})}function r(n){n.select(".extent").attr("x",f[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function u(n){n.select(".extent").attr("y",h[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function i(){function i(){32==oa.event.keyCode&&(C||(M=null,L[0]-=f[1],L[1]-=h[1],C=2),S())}function v(){32==oa.event.keyCode&&2==C&&(L[0]+=f[1],L[1]+=h[1],C=0,S())}function d(){var n=oa.mouse(b),t=!1;x&&(n[0]+=x[0],n[1]+=x[1]),C||(oa.event.altKey?(M||(M=[(f[0]+f[1])/2,(h[0]+h[1])/2]),L[0]=f[+(n[0]<M[0])],L[1]=h[+(n[1]<M[1])]):M=null),E&&m(n,c,0)&&(r(k),t=!0),A&&m(n,s,1)&&(u(k),t=!0),t&&(e(k),w({type:"brush",mode:C?"move":"resize"}))}function m(n,t,e){var r,u,i=Zu(t),l=i[0],c=i[1],s=L[e],v=e?h:f,d=v[1]-v[0];return C&&(l-=s,c-=d+s),r=(e?p:g)?Math.max(l,Math.min(c,n[e])):n[e],C?u=(r+=s)+d:(M&&(s=Math.max(l,Math.min(c,2*M[e]-r))),r>s?(u=r,r=s):u=s),v[0]!=r||v[1]!=u?(e?o=null:a=null,v[0]=r,v[1]=u,!0):void 0}function y(){d(),k.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),oa.select("body").style("cursor",null),q.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),z(),w({type:"brushend"})}var M,x,b=this,_=oa.select(oa.event.target),w=l.of(b,arguments),k=oa.select(b),N=_.datum(),E=!/^(n|s)$/.test(N)&&c,A=!/^(e|w)$/.test(N)&&s,C=_.classed("extent"),z=W(b),L=oa.mouse(b),q=oa.select(t(b)).on("keydown.brush",i).on("keyup.brush",v);if(oa.event.changedTouches?q.on("touchmove.brush",d).on("touchend.brush",y):q.on("mousemove.brush",d).on("mouseup.brush",y),k.interrupt().selectAll("*").interrupt(),C)L[0]=f[0]-L[0],L[1]=h[0]-L[1];else if(N){var T=+/w$/.test(N),R=+/^n/.test(N);x=[f[1-T]-L[0],h[1-R]-L[1]],L[0]=f[T],L[1]=h[R]}else oa.event.altKey&&(M=L.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),oa.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),d()}var a,o,l=N(n,"brushstart","brush","brushend"),c=null,s=null,f=[0,0],h=[0,0],g=!0,p=!0,v=$l[0];return n.event=function(n){n.each(function(){var n=l.of(this,arguments),t={x:f,y:h,i:a,j:o},e=this.__chart__||t;this.__chart__=t,Fl?oa.select(this).transition().each("start.brush",function(){a=e.i,o=e.j,f=e.x,h=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=xr(f,t.x),r=xr(h,t.y);return a=o=null,function(u){f=t.x=e(u),h=t.y=r(u),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){a=t.i,o=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,v=$l[!c<<1|!s],n):c},n.y=function(t){return arguments.length?(s=t,v=$l[!c<<1|!s],n):s},n.clamp=function(t){return arguments.length?(c&&s?(g=!!t[0],p=!!t[1]):c?g=!!t:s&&(p=!!t),n):c&&s?[g,p]:c?g:s?p:null},n.extent=function(t){var e,r,u,i,l;return arguments.length?(c&&(e=t[0],r=t[1],s&&(e=e[0],r=r[0]),a=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(l=e,e=r,r=l),(e!=f[0]||r!=f[1])&&(f=[e,r])),s&&(u=t[0],i=t[1],c&&(u=u[1],i=i[1]),o=[u,i],s.invert&&(u=s(u),i=s(i)),u>i&&(l=u,u=i,i=l),(u!=h[0]||i!=h[1])&&(h=[u,i])),n):(c&&(a?(e=a[0],r=a[1]):(e=f[0],r=f[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(l=e,e=r,r=l))),s&&(o?(u=o[0],i=o[1]):(u=h[0],i=h[1],s.invert&&(u=s.invert(u),i=s.invert(i)),u>i&&(l=u,u=i,i=l))),c&&s?[[e,u],[r,i]]:c?[e,r]:s&&[u,i])},n.clear=function(){return n.empty()||(f=[0,0],h=[0,0],a=o=null),n},n.empty=function(){return!!c&&f[0]==f[1]||!!s&&h[0]==h[1]},oa.rebind(n,l,"on")};var Xl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},$l=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Bl=ho.format=Mo.timeFormat,Wl=Bl.utc,Jl=Wl("%Y-%m-%dT%H:%M:%S.%LZ");Bl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?ea:Jl,ea.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},ea.toString=Jl.toString,ho.second=On(function(n){return new go(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),ho.seconds=ho.second.range,ho.seconds.utc=ho.second.utc.range,ho.minute=On(function(n){return new go(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),ho.minutes=ho.minute.range,ho.minutes.utc=ho.minute.utc.range,ho.hour=On(function(n){var t=n.getTimezoneOffset()/60;return new go(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),ho.hours=ho.hour.range,ho.hours.utc=ho.hour.utc.range,ho.month=On(function(n){return n=ho.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),ho.months=ho.month.range,ho.months.utc=ho.month.utc.range;var Gl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Kl=[[ho.second,1],[ho.second,5],[ho.second,15],[ho.second,30],[ho.minute,1],[ho.minute,5],[ho.minute,15],[ho.minute,30],[ho.hour,1],[ho.hour,3],[ho.hour,6],[ho.hour,12],[ho.day,1],[ho.day,2],[ho.week,1],[ho.month,1],[ho.month,3],[ho.year,1]],Ql=Bl.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",zt]]),nc={range:function(n,t,e){return oa.range(Math.ceil(n/e)*e,+t,e).map(ua)},floor:y,ceil:y};Kl.year=ho.year,ho.scale=function(){return ra(oa.scale.linear(),Kl,Ql)};var tc=Kl.map(function(n){return[n[0].utc,n[1]]}),ec=Wl.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",zt]]);tc.year=ho.year.utc,ho.scale.utc=function(){return ra(oa.scale.linear(),tc,ec)},oa.text=An(function(n){return n.responseText}),oa.json=function(n,t){return Cn(n,"application/json",ia,t)},oa.html=function(n,t){return Cn(n,"text/html",aa,t)},oa.xml=An(function(n){return n.responseXML}),"function"==typeof define&&define.amd?(this.d3=oa,define(oa)):"object"==typeof module&&module.exports?module.exports=oa:this.d3=oa}(); | |
| </script> | |
| <script> | |
| !function e(t,r,n){function a(i,s){if(!r[i]){if(!t[i]){var l="function"==typeof require&&require;if(!s&&l)return l(i,!0);if(o)return o(i,!0);var u=new Error("Cannot find module '"+i+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[i]={exports:{}};t[i][0].call(c.exports,function(e){var r=t[i][1][e];return a(r?r:e)},c,c.exports,e,t,r,n)}return r[i].exports}for(var o="function"==typeof require&&require,i=0;i<n.length;i++)a(n[i]);return a}({1:[function(e,t,r){"use strict";function n(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t<r;++t)l[t]=e[t],u[e.charCodeAt(t)]=t;u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63}function a(e){var t,r,n,a,o,i,s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[s-2]?2:"="===e[s-1]?1:0,i=new c(3*s/4-o),n=o>0?s-4:s;var l=0;for(t=0,r=0;t<n;t+=4,r+=3)a=u[e.charCodeAt(t)]<<18|u[e.charCodeAt(t+1)]<<12|u[e.charCodeAt(t+2)]<<6|u[e.charCodeAt(t+3)],i[l++]=a>>16&255,i[l++]=a>>8&255,i[l++]=255&a;return 2===o?(a=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,i[l++]=255&a):1===o&&(a=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,i[l++]=a>>8&255,i[l++]=255&a),i}function o(e){return l[e>>18&63]+l[e>>12&63]+l[e>>6&63]+l[63&e]}function i(e,t,r){for(var n,a=[],i=t;i<r;i+=3)n=(e[i]<<16)+(e[i+1]<<8)+e[i+2],a.push(o(n));return a.join("")}function s(e){for(var t,r=e.length,n=r%3,a="",o=[],s=16383,u=0,c=r-n;u<c;u+=s)o.push(i(e,u,u+s>c?c:u+s));return 1===n?(t=e[r-1],a+=l[t>>2],a+=l[t<<4&63],a+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],a+=l[t>>10],a+=l[t>>4&63],a+=l[t<<2&63],a+="="),o.push(a),o.join("")}r.toByteArray=a,r.fromByteArray=s;var l=[],u=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array;n()},{}],2:[function(e,t,r){(function(t){"use strict";function n(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function a(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=i.prototype):(null===e&&(e=new i(t)),e.length=t),e}function i(e,t,r){if(!(i.TYPED_ARRAY_SUPPORT||this instanceof i))return new i(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return c(this,e)}return s(this,e,t,r)}function s(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?p(e,t,r,n):"string"==typeof t?f(e,t,r):h(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number')}function u(e,t,r,n){return l(t),t<=0?o(e,t):void 0!==r?"string"==typeof n?o(e,t).fill(r,n):o(e,t).fill(r):o(e,t)}function c(e,t){if(l(t),e=o(e,t<0?0:0|v(t)),!i.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function f(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!i.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|m(t,r);e=o(e,n);var a=e.write(t,r);return a!==n&&(e=e.slice(0,a)),e}function d(e,t){var r=0|v(t.length);e=o(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function p(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),i.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=i.prototype):e=d(e,t),e}function h(e,t){if(i.isBuffer(t)){var r=0|v(t.length);return e=o(e,r),0===e.length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||Q(t.length)?o(e,0):d(e,t);if("Buffer"===t.type&&$(t.data))return d(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function v(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function g(e){return+e!=e&&(e=0),i.alloc(+e)}function m(e,t){if(i.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(e).length;default:if(n)return H(e).length;t=(""+t).toLowerCase(),n=!0}}function y(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return E(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return O(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function x(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,a){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(a)return-1;r=e.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof t&&(t=i.from(t,n)),i.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,a);if("number"==typeof t)return t=255&t,i.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,a);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,a){function o(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}var i=1,s=e.length,l=t.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;i=2,s/=2,l/=2,r/=2}var u;if(a){var c=-1;for(u=r;u<s;u++)if(o(e,u)===o(t,c===-1?0:u-c)){if(c===-1&&(c=u),u-c+1===l)return c*i}else c!==-1&&(u-=u-c),c=-1}else for(r+l>s&&(r=s-l),u=r;u>=0;u--){for(var f=!0,d=0;d<l;d++)if(o(e,u+d)!==o(t,d)){f=!1;break}if(f)return u}return-1}function _(e,t,r,n){r=Number(r)||0;var a=e.length-r;n?(n=Number(n),n>a&&(n=a)):n=a;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var i=0;i<n;++i){var s=parseInt(t.substr(2*i,2),16);if(isNaN(s))return i;e[r+i]=s}return i}function k(e,t,r,n){return W(H(t,e.length-r),e,r,n)}function z(e,t,r,n){return W(X(t),e,r,n)}function A(e,t,r,n){return z(e,t,r,n)}function j(e,t,r,n){return W(J(t),e,r,n)}function M(e,t,r,n){return W(G(t,e.length-r),e,r,n)}function O(e,t,r){return 0===t&&r===e.length?K.fromByteArray(e):K.fromByteArray(e.slice(t,r))}function E(e,t,r){r=Math.min(e.length,r);for(var n=[],a=t;a<r;){var o=e[a],i=null,s=o>239?4:o>223?3:o>191?2:1;if(a+s<=r){var l,u,c,f;switch(s){case 1:o<128&&(i=o);break;case 2:l=e[a+1],128===(192&l)&&(f=(31&o)<<6|63&l,f>127&&(i=f));break;case 3:l=e[a+1],u=e[a+2],128===(192&l)&&128===(192&u)&&(f=(15&o)<<12|(63&l)<<6|63&u,f>2047&&(f<55296||f>57343)&&(i=f));break;case 4:l=e[a+1],u=e[a+2],c=e[a+3],128===(192&l)&&128===(192&u)&&128===(192&c)&&(f=(15&o)<<18|(63&l)<<12|(63&u)<<6|63&c,f>65535&&f<1114112&&(i=f))}}null===i?(i=65533,s=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),a+=s}return F(n)}function F(e){var t=e.length;if(t<=ee)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=ee));return r}function S(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;a<r;++a)n+=String.fromCharCode(127&e[a]);return n}function T(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;a<r;++a)n+=String.fromCharCode(e[a]);return n}function B(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var a="",o=t;o<r;++o)a+=Y(e[o]);return a}function C(e,t,r){for(var n=e.slice(t,r),a="",o=0;o<n.length;o+=2)a+=String.fromCharCode(n[o]+256*n[o+1]);return a}function q(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,a,o){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function P(e,t,r,n){t<0&&(t=65535+t+1);for(var a=0,o=Math.min(e.length-r,2);a<o;++a)e[r+a]=(t&255<<8*(n?a:1-a))>>>8*(n?a:1-a)}function I(e,t,r,n){t<0&&(t=4294967295+t+1);for(var a=0,o=Math.min(e.length-r,4);a<o;++a)e[r+a]=t>>>8*(n?a:3-a)&255}function D(e,t,r,n,a,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function V(e,t,r,n,a){return a||D(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(e,t,r,n,23,4),r+4}function R(e,t,r,n,a){return a||D(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(e,t,r,n,52,8),r+8}function U(e){if(e=L(e).replace(te,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function L(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Y(e){return e<16?"0"+e.toString(16):e.toString(16)}function H(e,t){t=t||1/0;for(var r,n=e.length,a=null,o=[],i=0;i<n;++i){if(r=e.charCodeAt(i),r>55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(i+1===n){(t-=3)>-1&&o.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),a=r;continue}r=(a-55296<<10|r-56320)+65536}else a&&(t-=3)>-1&&o.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function X(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function G(e,t){for(var r,n,a,o=[],i=0;i<e.length&&!((t-=2)<0);++i)r=e.charCodeAt(i),n=r>>8,a=r%256,o.push(a),o.push(n);return o}function J(e){return K.toByteArray(U(e))}function W(e,t,r,n){for(var a=0;a<n&&!(a+r>=t.length||a>=e.length);++a)t[a+r]=e[a];return a}function Q(e){return e!==e}var K=e("base64-js"),Z=e("ieee754"),$=e("isarray");r.Buffer=i,r.SlowBuffer=g,r.INSPECT_MAX_BYTES=50,i.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:n(),r.kMaxLength=a(),i.poolSize=8192,i._augment=function(e){return e.__proto__=i.prototype,e},i.from=function(e,t,r){return s(null,e,t,r)},i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0})),i.alloc=function(e,t,r){return u(null,e,t,r)},i.allocUnsafe=function(e){return c(null,e)},i.allocUnsafeSlow=function(e){return c(null,e)},i.isBuffer=function(e){return!(null==e||!e._isBuffer)},i.compare=function(e,t){if(!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,a=0,o=Math.min(r,n);a<o;++a)if(e[a]!==t[a]){r=e[a],n=t[a];break}return r<n?-1:n<r?1:0},i.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(e,t){if(!$(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return i.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=i.allocUnsafe(t),a=0;for(r=0;r<e.length;++r){var o=e[r];if(!i.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,a),a+=o.length}return n},i.byteLength=m,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)x(this,t,t+1);return this},i.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)x(this,t,t+3),x(this,t+1,t+2);return this},i.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)x(this,t,t+7),x(this,t+1,t+6),x(this,t+2,t+5),x(this,t+3,t+4);return this},i.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?E(this,0,e):y.apply(this,arguments)},i.prototype.equals=function(e){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===i.compare(this,e)},i.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},i.prototype.compare=function(e,t,r,n,a){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),t<0||r>e.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&t>=r)return 0;if(n>=a)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,a>>>=0,this===e)return 0;for(var o=a-n,s=r-t,l=Math.min(o,s),u=this.slice(n,a),c=e.slice(t,r),f=0;f<l;++f)if(u[f]!==c[f]){o=u[f],s=c[f];break}return o<s?-1:s<o?1:0},i.prototype.includes=function(e,t,r){return this.indexOf(e,t,r)!==-1},i.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},i.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},i.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t=0|t,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0)}var a=this.length-t;if((void 0===r||r>a)&&(r=a),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return k(this,e,t,r);case"ascii":return z(this,e,t,r);case"latin1":case"binary":return A(this,e,t,r);case"base64":return j(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ee=4096;i.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),t<e&&(t=e);var n;if(i.TYPED_ARRAY_SUPPORT)n=this.subarray(e,t),n.__proto__=i.prototype;else{var a=t-e;n=new i(a,(void 0));for(var o=0;o<a;++o)n[o]=this[o+e]}return n},i.prototype.readUIntLE=function(e,t,r){e=0|e,t=0|t,r||q(e,t,this.length);for(var n=this[e],a=1,o=0;++o<t&&(a*=256);)n+=this[e+o]*a;return n},i.prototype.readUIntBE=function(e,t,r){e=0|e,t=0|t,r||q(e,t,this.length);for(var n=this[e+--t],a=1;t>0&&(a*=256);)n+=this[e+--t]*a;return n},i.prototype.readUInt8=function(e,t){return t||q(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,t){return t||q(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,t){return t||q(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,t){return t||q(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUInt32BE=function(e,t){return t||q(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,r){e=0|e,t=0|t,r||q(e,t,this.length);for(var n=this[e],a=1,o=0;++o<t&&(a*=256);)n+=this[e+o]*a;return a*=128,n>=a&&(n-=Math.pow(2,8*t)),n},i.prototype.readIntBE=function(e,t,r){e=0|e,t=0|t,r||q(e,t,this.length);for(var n=t,a=1,o=this[e+--n];n>0&&(a*=256);)o+=this[e+--n]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*t)),o},i.prototype.readInt8=function(e,t){return t||q(e,1,this.length),128&this[e]?(255-this[e]+1)*-1:this[e]},i.prototype.readInt16LE=function(e,t){t||q(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(e,t){t||q(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(e,t){return t||q(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return t||q(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return t||q(e,4,this.length),Z.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return t||q(e,4,this.length),Z.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return t||q(e,8,this.length),Z.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return t||q(e,8,this.length),Z.read(this,e,!1,52,8)},i.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t=0|t,r=0|r,!n){var a=Math.pow(2,8*r)-1;N(this,e,t,r,a,0)}var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},i.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t=0|t,r=0|r,!n){var a=Math.pow(2,8*r)-1;N(this,e,t,r,a,0)}var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},i.prototype.writeUInt8=function(e,t,r){return e=+e,t=0|t,r||N(this,e,t,1,255,0),i.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},i.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=0|t,r||N(this,e,t,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},i.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=0|t,r||N(this,e,t,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},i.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=0|t,r||N(this,e,t,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):I(this,e,t,!0),t+4},i.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=0|t,r||N(this,e,t,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},i.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=0|t,!n){var a=Math.pow(2,8*r-1);N(this,e,t,r,a-1,-a)}var o=0,i=1,s=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/i>>0)-s&255;return t+r},i.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=0|t,!n){var a=Math.pow(2,8*r-1);N(this,e,t,r,a-1,-a)}var o=r-1,i=1,s=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/i>>0)-s&255;return t+r},i.prototype.writeInt8=function(e,t,r){return e=+e,t=0|t,r||N(this,e,t,1,127,-128),i.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,r){return e=+e,t=0|t,r||N(this,e,t,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},i.prototype.writeInt16BE=function(e,t,r){return e=+e,t=0|t,r||N(this,e,t,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},i.prototype.writeInt32LE=function(e,t,r){return e=+e,t=0|t,r||N(this,e,t,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):I(this,e,t,!0),t+4},i.prototype.writeInt32BE=function(e,t,r){return e=+e,t=0|t,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),i.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},i.prototype.writeFloatLE=function(e,t,r){return V(this,e,t,!0,r)},i.prototype.writeFloatBE=function(e,t,r){return V(this,e,t,!1,r)},i.prototype.writeDoubleLE=function(e,t,r){return R(this,e,t,!0,r)},i.prototype.writeDoubleBE=function(e,t,r){return R(this,e,t,!1,r)},i.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var a,o=n-r;if(this===e&&r<t&&t<n)for(a=o-1;a>=0;--a)e[a+t]=this[a+r];else if(o<1e3||!i.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)e[a+t]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},i.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var a=e.charCodeAt(0);a<256&&(e=a)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e=255&e);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var s=i.isBuffer(e)?e:H(new i(e,n).toString()),l=s.length;for(o=0;o<r-t;++o)this[o+t]=s[o%l]}return this};var te=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":1,ieee754:5,isarray:6}],3:[function(e,t,r){t.exports=e("./lib/heap")},{"./lib/heap":4}],4:[function(e,t,r){(function(){var e,n,a,o,i,s,l,u,c,f,d,p,h,v,g;a=Math.floor,f=Math.min,n=function(e,t){return e<t?-1:e>t?1:0},c=function(e,t,r,o,i){var s;if(null==r&&(r=0),null==i&&(i=n),r<0)throw new Error("lo must be non-negative");for(null==o&&(o=e.length);r<o;)s=a((r+o)/2),i(t,e[s])<0?o=s:r=s+1;return[].splice.apply(e,[r,r-r].concat(t)),t},s=function(e,t,r){return null==r&&(r=n),e.push(t),v(e,0,e.length-1,r)},i=function(e,t){var r,a;return null==t&&(t=n),r=e.pop(),e.length?(a=e[0],e[0]=r,g(e,0,t)):a=r,a},u=function(e,t,r){var a;return null==r&&(r=n),a=e[0],e[0]=t,g(e,0,r),a},l=function(e,t,r){var a;return null==r&&(r=n),e.length&&r(e[0],t)<0&&(a=[e[0],t],t=a[0],e[0]=a[1],g(e,0,r)),t},o=function(e,t){var r,o,i,s,l,u;for(null==t&&(t=n),s=function(){u=[];for(var t=0,r=a(e.length/2);0<=r?t<r:t>r;0<=r?t++:t--)u.push(t);return u}.apply(this).reverse(),l=[],o=0,i=s.length;o<i;o++)r=s[o],l.push(g(e,r,t));return l},h=function(e,t,r){var a;if(null==r&&(r=n),a=e.indexOf(t),a!==-1)return v(e,0,a,r),g(e,a,r)},d=function(e,t,r){var a,i,s,u,c;if(null==r&&(r=n),i=e.slice(0,t),!i.length)return i;for(o(i,r),c=e.slice(t),s=0,u=c.length;s<u;s++)a=c[s],l(i,a,r);return i.sort(r).reverse()},p=function(e,t,r){var a,s,l,u,d,p,h,v,g,m;if(null==r&&(r=n),10*t<=e.length){if(u=e.slice(0,t).sort(r),!u.length)return u;for(l=u[u.length-1],v=e.slice(t),d=0,h=v.length;d<h;d++)a=v[d],r(a,l)<0&&(c(u,a,0,null,r),u.pop(),l=u[u.length-1]);return u}for(o(e,r),m=[],s=p=0,g=f(t,e.length);0<=g?p<g:p>g;s=0<=g?++p:--p)m.push(i(e,r));return m},v=function(e,t,r,a){var o,i,s;for(null==a&&(a=n),o=e[r];r>t&&(s=r-1>>1,i=e[s],a(o,i)<0);)e[r]=i,r=s;return e[r]=o},g=function(e,t,r){var a,o,i,s,l;for(null==r&&(r=n),o=e.length,l=t,i=e[t],a=2*t+1;a<o;)s=a+1,s<o&&!(r(e[a],e[s])<0)&&(a=s),e[t]=e[a],t=a,a=2*t+1;return e[t]=i,v(e,l,t,r)},e=function(){function e(e){this.cmp=null!=e?e:n,this.nodes=[]}return e.push=s,e.pop=i,e.replace=u,e.pushpop=l,e.heapify=o,e.updateItem=h,e.nlargest=d,e.nsmallest=p,e.prototype.push=function(e){return s(this.nodes,e,this.cmp)},e.prototype.pop=function(){return i(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return this.nodes.indexOf(e)!==-1},e.prototype.replace=function(e){return u(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return l(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return o(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return h(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return 0===this.nodes.length},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t;return t=new e,t.nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.prototype.top=e.prototype.peek,e.prototype.front=e.prototype.peek,e.prototype.has=e.prototype.contains,e.prototype.copy=e.prototype.clone,e}(),function(e,n){return"function"==typeof define&&define.amd?define([],n):"object"==typeof r?t.exports=n():e.Heap=n()}(this,function(){return e})}).call(this)},{}],5:[function(e,t,r){r.read=function(e,t,r,n,a){var o,i,s=8*a-n-1,l=(1<<s)-1,u=l>>1,c=-7,f=r?a-1:0,d=r?-1:1,p=e[t+f];for(f+=d,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+e[t+f],f+=d,c-=8);for(i=o&(1<<-c)-1,o>>=-c,c+=n;c>0;i=256*i+e[t+f],f+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return i?NaN:(p?-1:1)*(1/0);i+=Math.pow(2,n),o-=u}return(p?-1:1)*i*Math.pow(2,o-n)},r.write=function(e,t,r,n,a,o){var i,s,l,u=8*o-a-1,c=(1<<u)-1,f=c>>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,h=n?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,i=c):(i=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-i))<1&&(i--,l*=2),t+=i+f>=1?d/l:d*Math.pow(2,1-f),t*l>=2&&(i++,l/=2),i+f>=c?(s=0,i=c):i+f>=1?(s=(t*l-1)*Math.pow(2,a),i+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,a),i=0));a>=8;e[r+p]=255&s,p+=h,s/=256,a-=8);for(i=i<<a|s,u+=a;u>0;e[r+p]=255&i,p+=h,i/=256,u-=8);e[r+p-h]|=128*v}},{}],6:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},{}],7:[function(require,module,exports){(function(global){"use strict";var numeric="undefined"==typeof exports?function(){}:exports;"undefined"!=typeof global&&(global.numeric=numeric),numeric.version="1.2.6",numeric.bench=function(e,t){var r,n,a,o;for("undefined"==typeof t&&(t=15),a=.5,r=new Date;;){for(a*=2,o=a;o>3;o-=4)e(),e(),e(),e();for(;o>0;)e(),o--;if(n=new Date,n-r>t)break}for(o=a;o>3;o-=4)e(),e(),e(),e();for(;o>0;)e(),o--;return n=new Date,1e3*(3*a-1)/(n-r)},numeric._myIndexOf=function(e){var t,r=this.length;for(t=0;t<r;++t)if(this[t]===e)return t;return-1},numeric.myIndexOf=Array.prototype.indexOf?Array.prototype.indexOf:numeric._myIndexOf,numeric.Function=Function,numeric.precision=4,numeric.largeArray=50,numeric.prettyPrint=function(e){function t(e){if(0===e)return"0";if(isNaN(e))return"NaN";if(e<0)return"-"+t(-e);if(isFinite(e)){var r=Math.floor(Math.log(e)/Math.log(10)),n=e/Math.pow(10,r),a=n.toPrecision(numeric.precision);return 10===parseFloat(a)&&(r++,n=1,a=n.toPrecision(numeric.precision)),parseFloat(a).toString()+"e"+r.toString()}return"Infinity"}function r(e){var a;if("undefined"==typeof e)return n.push(Array(numeric.precision+8).join(" ")),!1;if("string"==typeof e)return n.push('"'+e+'"'),!1;if("boolean"==typeof e)return n.push(e.toString()),!1;if("number"==typeof e){var o=t(e),i=e.toPrecision(numeric.precision),s=parseFloat(e.toString()).toString(),l=[o,i,s,parseFloat(i).toString(),parseFloat(s).toString()];for(a=1;a<l.length;a++)l[a].length<o.length&&(o=l[a]);return n.push(Array(numeric.precision+8-o.length).join(" ")+o),!1}if(null===e)return n.push("null"),!1;if("function"==typeof e){n.push(e.toString());var u=!1;for(a in e)e.hasOwnProperty(a)&&(u?n.push(",\n"):n.push("\n{"),u=!0,n.push(a),n.push(": \n"),r(e[a]));return u&&n.push("}\n"),!0}if(e instanceof Array){if(e.length>numeric.largeArray)return n.push("...Large Array..."),!0;var u=!1;for(n.push("["),a=0;a<e.length;a++)a>0&&(n.push(","),u&&n.push("\n ")),u=r(e[a]);return n.push("]"),!0}n.push("{");var u=!1;for(a in e)e.hasOwnProperty(a)&&(u&&n.push(",\n"),u=!0,n.push(a),n.push(": \n"),r(e[a]));return n.push("}"),!0}var n=[];return r(e),n.join("")},numeric.parseDate=function(e){function t(e){if("string"==typeof e)return Date.parse(e.replace(/-/g,"/"));if(!(e instanceof Array))throw new Error("parseDate: parameter must be arrays of strings");var r,n=[];for(r=0;r<e.length;r++)n[r]=t(e[r]);return n}return t(e)},numeric.parseFloat=function(e){function t(e){if("string"==typeof e)return parseFloat(e);if(!(e instanceof Array))throw new Error("parseFloat: parameter must be arrays of strings");var r,n=[];for(r=0;r<e.length;r++)n[r]=t(e[r]);return n}return t(e)},numeric.parseCSV=function(e){var t,r,n=e.split("\n"),a=[],o=/(([^'",]*)|('[^']*')|("[^"]*")),/g,i=/^\s*(([+-]?[0-9]+(\.[0-9]*)?(e[+-]?[0-9]+)?)|([+-]?[0-9]*(\.[0-9]+)?(e[+-]?[0-9]+)?))\s*$/,s=function(e){return e.substr(0,e.length-1)},l=0;for(r=0;r<n.length;r++){var u,c=(n[r]+",").match(o);if(c.length>0){for(a[l]=[],t=0;t<c.length;t++)u=s(c[t]),i.test(u)?a[l][t]=parseFloat(u):a[l][t]=u;l++}}return a},numeric.toCSV=function(e){var t,r,n,a,o,i,s=numeric.dim(e);for(n=s[0],a=s[1],i=[],t=0;t<n;t++){for(o=[],r=0;r<n;r++)o[r]=e[t][r].toString();i[t]=o.join(", ")}return i.join("\n")+"\n"},numeric.getURL=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(),t},numeric.imageURL=function(e){function t(e){var t,r,n,a,o,i,s,l,u=e.length,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f="";for(t=0;t<u;t+=3)r=e[t],n=e[t+1],a=e[t+2],o=r>>2,i=((3&r)<<4)+(n>>4),s=((15&n)<<2)+(a>>6),l=63&a,t+1>=u?s=l=64:t+2>=u&&(l=64),f+=c.charAt(o)+c.charAt(i)+c.charAt(s)+c.charAt(l);return f}function r(e,t,r){"undefined"==typeof t&&(t=0),"undefined"==typeof r&&(r=e.length);var n,a=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],o=-1,i=0; | |
| e.length;for(n=t;n<r;n++)i=255&(o^e[n]),o=o>>>8^a[i];return o^-1}var n,a,o,i,s,l,u,c,f,d,p=e[0].length,h=e[0][0].length,v=[137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,h>>24&255,h>>16&255,h>>8&255,255&h,p>>24&255,p>>16&255,p>>8&255,255&p,8,2,0,0,0,-1,-2,-3,-4,-5,-6,-7,-8,73,68,65,84,8,29];for(d=r(v,12,29),v[29]=d>>24&255,v[30]=d>>16&255,v[31]=d>>8&255,v[32]=255&d,n=1,a=0,u=0;u<p;u++){for(u<p-1?v.push(0):v.push(1),s=3*h+1+(0===u)&255,l=3*h+1+(0===u)>>8&255,v.push(s),v.push(l),v.push(255&~s),v.push(255&~l),0===u&&v.push(0),c=0;c<h;c++)for(o=0;o<3;o++)s=e[o][u][c],s=s>255?255:s<0?0:Math.round(s),n=(n+s)%65521,a=(a+n)%65521,v.push(s);v.push(0)}return f=(a<<16)+n,v.push(f>>24&255),v.push(f>>16&255),v.push(f>>8&255),v.push(255&f),i=v.length-41,v[33]=i>>24&255,v[34]=i>>16&255,v[35]=i>>8&255,v[36]=255&i,d=r(v,37),v.push(d>>24&255),v.push(d>>16&255),v.push(d>>8&255),v.push(255&d),v.push(0),v.push(0),v.push(0),v.push(0),v.push(73),v.push(69),v.push(78),v.push(68),v.push(174),v.push(66),v.push(96),v.push(130),"data:image/png;base64,"+t(v)},numeric._dim=function(e){for(var t=[];"object"==typeof e;)t.push(e.length),e=e[0];return t},numeric.dim=function(e){var t,r;return"object"==typeof e?(t=e[0],"object"==typeof t?(r=t[0],"object"==typeof r?numeric._dim(e):[e.length,t.length]):[e.length]):[]},numeric.mapreduce=function(e,t){return Function("x","accum","_s","_k",'if(typeof accum === "undefined") accum = '+t+';\nif(typeof x === "number") { var xi = x; '+e+'; return accum; }\nif(typeof _s === "undefined") _s = numeric.dim(x);\nif(typeof _k === "undefined") _k = 0;\nvar _n = _s[_k];\nvar i,xi;\nif(_k < _s.length-1) {\n for(i=_n-1;i>=0;i--) {\n accum = arguments.callee(x[i],accum,_s,_k+1);\n } return accum;\n}\nfor(i=_n-1;i>=1;i-=2) { \n xi = x[i];\n '+e+";\n xi = x[i-1];\n "+e+";\n}\nif(i === 0) {\n xi = x[i];\n "+e+"\n}\nreturn accum;")},numeric.mapreduce2=function(e,t){return Function("x","var n = x.length;\nvar i,xi;\n"+t+";\nfor(i=n-1;i!==-1;--i) { \n xi = x[i];\n "+e+";\n}\nreturn accum;")},numeric.same=function e(t,r){var n,a;if(!(t instanceof Array&&r instanceof Array))return!1;if(a=t.length,a!==r.length)return!1;for(n=0;n<a;n++)if(t[n]!==r[n]){if("object"!=typeof t[n])return!1;if(!e(t[n],r[n]))return!1}return!0},numeric.rep=function(e,t,r){"undefined"==typeof r&&(r=0);var n,a=e[r],o=Array(a);if(r===e.length-1){for(n=a-2;n>=0;n-=2)o[n+1]=t,o[n]=t;return n===-1&&(o[0]=t),o}for(n=a-1;n>=0;n--)o[n]=numeric.rep(e,t,r+1);return o},numeric.dotMMsmall=function(e,t){var r,n,a,o,i,s,l,u,c,f,d;for(o=e.length,i=t.length,s=t[0].length,l=Array(o),r=o-1;r>=0;r--){for(u=Array(s),c=e[r],a=s-1;a>=0;a--){for(f=c[i-1]*t[i-1][a],n=i-2;n>=1;n-=2)d=n-1,f+=c[n]*t[n][a]+c[d]*t[d][a];0===n&&(f+=c[0]*t[0][a]),u[a]=f}l[r]=u}return l},numeric._getCol=function(e,t,r){var n,a=e.length;for(n=a-1;n>0;--n)r[n]=e[n][t],--n,r[n]=e[n][t];0===n&&(r[0]=e[0][t])},numeric.dotMMbig=function(e,t){var r,n,a,o,i=numeric._getCol,s=t.length,l=Array(s),u=e.length,c=t[0].length,f=new Array(u),d=numeric.dotVV;for(--s,--u,n=u;n!==-1;--n)f[n]=Array(c);for(--c,n=c;n!==-1;--n)for(i(t,n,l),a=u;a!==-1;--a)o=0,r=e[a],f[a][n]=d(r,l);return f},numeric.dotMV=function(e,t){var r,n=e.length,a=(t.length,Array(n)),o=numeric.dotVV;for(r=n-1;r>=0;r--)a[r]=o(e[r],t);return a},numeric.dotVM=function(e,t){var r,n,a,o,i,s,l;for(a=e.length,o=t[0].length,i=Array(o),n=o-1;n>=0;n--){for(s=e[a-1]*t[a-1][n],r=a-2;r>=1;r-=2)l=r-1,s+=e[r]*t[r][n]+e[l]*t[l][n];0===r&&(s+=e[0]*t[0][n]),i[n]=s}return i},numeric.dotVV=function(e,t){var r,n,a=e.length,o=e[a-1]*t[a-1];for(r=a-2;r>=1;r-=2)n=r-1,o+=e[r]*t[r]+e[n]*t[n];return 0===r&&(o+=e[0]*t[0]),o},numeric.dot=function(e,t){var r=numeric.dim;switch(1e3*r(e).length+r(t).length){case 2002:return t.length<10?numeric.dotMMsmall(e,t):numeric.dotMMbig(e,t);case 2001:return numeric.dotMV(e,t);case 1002:return numeric.dotVM(e,t);case 1001:return numeric.dotVV(e,t);case 1e3:return numeric.mulVS(e,t);case 1:return numeric.mulSV(e,t);case 0:return e*t;default:throw new Error("numeric.dot only works on vectors and matrices")}},numeric.diag=function(e){var t,r,n,a,o=e.length,i=Array(o);for(t=o-1;t>=0;t--){for(a=Array(o),r=t+2,n=o-1;n>=r;n-=2)a[n]=0,a[n-1]=0;for(n>t&&(a[n]=0),a[t]=e[t],n=t-1;n>=1;n-=2)a[n]=0,a[n-1]=0;0===n&&(a[0]=0),i[t]=a}return i},numeric.getDiag=function(e){var t,r=Math.min(e.length,e[0].length),n=Array(r);for(t=r-1;t>=1;--t)n[t]=e[t][t],--t,n[t]=e[t][t];return 0===t&&(n[0]=e[0][0]),n},numeric.identity=function(e){return numeric.diag(numeric.rep([e],1))},numeric.pointwise=function(e,t,r){"undefined"==typeof r&&(r="");var n,a,o=[],i=/\[i\]$/,s="",l=!1;for(n=0;n<e.length;n++)i.test(e[n])?(a=e[n].substring(0,e[n].length-3),s=a):a=e[n],"ret"===a&&(l=!0),o.push(a);return o[e.length]="_s",o[e.length+1]="_k",o[e.length+2]='if(typeof _s === "undefined") _s = numeric.dim('+s+');\nif(typeof _k === "undefined") _k = 0;\nvar _n = _s[_k];\nvar i'+(l?"":", ret = Array(_n)")+";\nif(_k < _s.length-1) {\n for(i=_n-1;i>=0;i--) ret[i] = arguments.callee("+e.join(",")+",_s,_k+1);\n return ret;\n}\n"+r+"\nfor(i=_n-1;i!==-1;--i) {\n "+t+"\n}\nreturn ret;",Function.apply(null,o)},numeric.pointwise2=function(e,t,r){"undefined"==typeof r&&(r="");var n,a,o=[],i=/\[i\]$/,s="",l=!1;for(n=0;n<e.length;n++)i.test(e[n])?(a=e[n].substring(0,e[n].length-3),s=a):a=e[n],"ret"===a&&(l=!0),o.push(a);return o[e.length]="var _n = "+s+".length;\nvar i"+(l?"":", ret = Array(_n)")+";\n"+r+"\nfor(i=_n-1;i!==-1;--i) {\n"+t+"\n}\nreturn ret;",Function.apply(null,o)},numeric._biforeach=function e(t,r,n,a,o){if(a===n.length-1)return void o(t,r);var i,s=n[a];for(i=s-1;i>=0;i--)e("object"==typeof t?t[i]:t,"object"==typeof r?r[i]:r,n,a+1,o)},numeric._biforeach2=function e(t,r,n,a,o){if(a===n.length-1)return o(t,r);var i,s=n[a],l=Array(s);for(i=s-1;i>=0;--i)l[i]=e("object"==typeof t?t[i]:t,"object"==typeof r?r[i]:r,n,a+1,o);return l},numeric._foreach=function e(t,r,n,a){if(n===r.length-1)return void a(t);var o,i=r[n];for(o=i-1;o>=0;o--)e(t[o],r,n+1,a)},numeric._foreach2=function e(t,r,n,a){if(n===r.length-1)return a(t);var o,i=r[n],s=Array(i);for(o=i-1;o>=0;o--)s[o]=e(t[o],r,n+1,a);return s},numeric.ops2={add:"+",sub:"-",mul:"*",div:"/",mod:"%",and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">=",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"},numeric.opseq={addeq:"+=",subeq:"-=",muleq:"*=",diveq:"/=",modeq:"%=",lshifteq:"<<=",rshifteq:">>=",rrshifteq:">>>=",bandeq:"&=",boreq:"|=",bxoreq:"^="},numeric.mathfuns=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan","isNaN","isFinite"],numeric.mathfuns2=["atan2","pow","max","min"],numeric.ops1={neg:"-",not:"!",bnot:"~",clone:""},numeric.mapreducers={any:["if(xi) return true;","var accum = false;"],all:["if(!xi) return false;","var accum = true;"],sum:["accum += xi;","var accum = 0;"],prod:["accum *= xi;","var accum = 1;"],norm2Squared:["accum += xi*xi;","var accum = 0;"],norminf:["accum = max(accum,abs(xi));","var accum = 0, max = Math.max, abs = Math.abs;"],norm1:["accum += abs(xi)","var accum = 0, abs = Math.abs;"],sup:["accum = max(accum,xi);","var accum = -Infinity, max = Math.max;"],inf:["accum = min(accum,xi);","var accum = Infinity, min = Math.min;"]},function(){var e,t;for(e=0;e<numeric.mathfuns2.length;++e)t=numeric.mathfuns2[e],numeric.ops2[t]=t;for(e in numeric.ops2)if(numeric.ops2.hasOwnProperty(e)){t=numeric.ops2[e];var r,n,a="";numeric.myIndexOf.call(numeric.mathfuns2,e)!==-1?(a="var "+t+" = Math."+t+";\n",r=function(e,r,n){return e+" = "+t+"("+r+","+n+")"},n=function(e,r){return e+" = "+t+"("+e+","+r+")"}):(r=function(e,r,n){return e+" = "+r+" "+t+" "+n},n=numeric.opseq.hasOwnProperty(e+"eq")?function(e,r){return e+" "+t+"= "+r}:function(e,r){return e+" = "+e+" "+t+" "+r}),numeric[e+"VV"]=numeric.pointwise2(["x[i]","y[i]"],r("ret[i]","x[i]","y[i]"),a),numeric[e+"SV"]=numeric.pointwise2(["x","y[i]"],r("ret[i]","x","y[i]"),a),numeric[e+"VS"]=numeric.pointwise2(["x[i]","y"],r("ret[i]","x[i]","y"),a),numeric[e]=Function("var n = arguments.length, i, x = arguments[0], y;\nvar VV = numeric."+e+"VV, VS = numeric."+e+"VS, SV = numeric."+e+'SV;\nvar dim = numeric.dim;\nfor(i=1;i!==n;++i) { \n y = arguments[i];\n if(typeof x === "object") {\n if(typeof y === "object") x = numeric._biforeach2(x,y,dim(x),0,VV);\n else x = numeric._biforeach2(x,y,dim(x),0,VS);\n } else if(typeof y === "object") x = numeric._biforeach2(x,y,dim(y),0,SV);\n else '+n("x","y")+"\n}\nreturn x;\n"),numeric[t]=numeric[e],numeric[e+"eqV"]=numeric.pointwise2(["ret[i]","x[i]"],n("ret[i]","x[i]"),a),numeric[e+"eqS"]=numeric.pointwise2(["ret[i]","x"],n("ret[i]","x"),a),numeric[e+"eq"]=Function("var n = arguments.length, i, x = arguments[0], y;\nvar V = numeric."+e+"eqV, S = numeric."+e+'eqS\nvar s = numeric.dim(x);\nfor(i=1;i!==n;++i) { \n y = arguments[i];\n if(typeof y === "object") numeric._biforeach(x,y,s,0,V);\n else numeric._biforeach(x,y,s,0,S);\n}\nreturn x;\n')}for(e=0;e<numeric.mathfuns2.length;++e)t=numeric.mathfuns2[e],delete numeric.ops2[t];for(e=0;e<numeric.mathfuns.length;++e)t=numeric.mathfuns[e],numeric.ops1[t]=t;for(e in numeric.ops1)numeric.ops1.hasOwnProperty(e)&&(a="",t=numeric.ops1[e],numeric.myIndexOf.call(numeric.mathfuns,e)!==-1&&Math.hasOwnProperty(t)&&(a="var "+t+" = Math."+t+";\n"),numeric[e+"eqV"]=numeric.pointwise2(["ret[i]"],"ret[i] = "+t+"(ret[i]);",a),numeric[e+"eq"]=Function("x",'if(typeof x !== "object") return '+t+"x\nvar i;\nvar V = numeric."+e+"eqV;\nvar s = numeric.dim(x);\nnumeric._foreach(x,s,0,V);\nreturn x;\n"),numeric[e+"V"]=numeric.pointwise2(["x[i]"],"ret[i] = "+t+"(x[i]);",a),numeric[e]=Function("x",'if(typeof x !== "object") return '+t+"(x)\nvar i;\nvar V = numeric."+e+"V;\nvar s = numeric.dim(x);\nreturn numeric._foreach2(x,s,0,V);\n"));for(e=0;e<numeric.mathfuns.length;++e)t=numeric.mathfuns[e],delete numeric.ops1[t];for(e in numeric.mapreducers)numeric.mapreducers.hasOwnProperty(e)&&(t=numeric.mapreducers[e],numeric[e+"V"]=numeric.mapreduce2(t[0],t[1]),numeric[e]=Function("x","s","k",t[1]+'if(typeof x !== "object") { xi = x;\n'+t[0]+';\n return accum;\n}if(typeof s === "undefined") s = numeric.dim(x);\nif(typeof k === "undefined") k = 0;\nif(k === s.length-1) return numeric.'+e+"V(x);\nvar xi;\nvar n = x.length, i;\nfor(i=n-1;i!==-1;--i) {\n xi = arguments.callee(x[i]);\n"+t[0]+";\n}\nreturn accum;\n"))}(),numeric.truncVV=numeric.pointwise(["x[i]","y[i]"],"ret[i] = round(x[i]/y[i])*y[i];","var round = Math.round;"),numeric.truncVS=numeric.pointwise(["x[i]","y"],"ret[i] = round(x[i]/y)*y;","var round = Math.round;"),numeric.truncSV=numeric.pointwise(["x","y[i]"],"ret[i] = round(x/y[i])*y[i];","var round = Math.round;"),numeric.trunc=function(e,t){return"object"==typeof e?"object"==typeof t?numeric.truncVV(e,t):numeric.truncVS(e,t):"object"==typeof t?numeric.truncSV(e,t):Math.round(e/t)*t},numeric.inv=function(e){var t,r,n,a,o,i,s,e,l=numeric.dim(e),u=Math.abs,c=l[0],f=l[1],d=numeric.clone(e),p=numeric.identity(c);for(i=0;i<f;++i){var h=-1,v=-1;for(o=i;o!==c;++o)s=u(d[o][i]),s>v&&(h=o,v=s);for(r=d[h],d[h]=d[i],d[i]=r,a=p[h],p[h]=p[i],p[i]=a,e=r[i],s=i;s!==f;++s)r[s]/=e;for(s=f-1;s!==-1;--s)a[s]/=e;for(o=c-1;o!==-1;--o)if(o!==i){for(t=d[o],n=p[o],e=t[i],s=i+1;s!==f;++s)t[s]-=r[s]*e;for(s=f-1;s>0;--s)n[s]-=a[s]*e,--s,n[s]-=a[s]*e;0===s&&(n[0]-=a[0]*e)}}return p},numeric.det=function(e){var t=numeric.dim(e);if(2!==t.length||t[0]!==t[1])throw new Error("numeric: det() only works on square matrices");var r,n,a,o,i,s,l,u,c=t[0],f=1,d=numeric.clone(e);for(n=0;n<c-1;n++){for(a=n,r=n+1;r<c;r++)Math.abs(d[r][n])>Math.abs(d[a][n])&&(a=r);for(a!==n&&(l=d[a],d[a]=d[n],d[n]=l,f*=-1),o=d[n],r=n+1;r<c;r++){for(i=d[r],s=i[n]/o[n],a=n+1;a<c-1;a+=2)u=a+1,i[a]-=o[a]*s,i[u]-=o[u]*s;a!==c&&(i[a]-=o[a]*s)}if(0===o[n])return 0;f*=o[n]}return f*d[n][n]},numeric.transpose=function(e){var t,r,n,a,o,i=e.length,s=e[0].length,l=Array(s);for(r=0;r<s;r++)l[r]=Array(i);for(t=i-1;t>=1;t-=2){for(a=e[t],n=e[t-1],r=s-1;r>=1;--r)o=l[r],o[t]=a[r],o[t-1]=n[r],--r,o=l[r],o[t]=a[r],o[t-1]=n[r];0===r&&(o=l[0],o[t]=a[0],o[t-1]=n[0])}if(0===t){for(n=e[0],r=s-1;r>=1;--r)l[r][0]=n[r],--r,l[r][0]=n[r];0===r&&(l[0][0]=n[0])}return l},numeric.negtranspose=function(e){var t,r,n,a,o,i=e.length,s=e[0].length,l=Array(s);for(r=0;r<s;r++)l[r]=Array(i);for(t=i-1;t>=1;t-=2){for(a=e[t],n=e[t-1],r=s-1;r>=1;--r)o=l[r],o[t]=-a[r],o[t-1]=-n[r],--r,o=l[r],o[t]=-a[r],o[t-1]=-n[r];0===r&&(o=l[0],o[t]=-a[0],o[t-1]=-n[0])}if(0===t){for(n=e[0],r=s-1;r>=1;--r)l[r][0]=-n[r],--r,l[r][0]=-n[r];0===r&&(l[0][0]=-n[0])}return l},numeric._random=function e(t,r){var n,a,o=t[r],i=Array(o);if(r===t.length-1){for(a=Math.random,n=o-1;n>=1;n-=2)i[n]=a(),i[n-1]=a();return 0===n&&(i[0]=a()),i}for(n=o-1;n>=0;n--)i[n]=e(t,r+1);return i},numeric.random=function(e){return numeric._random(e,0)},numeric.norm2=function(e){return Math.sqrt(numeric.norm2Squared(e))},numeric.linspace=function(e,t,r){if("undefined"==typeof r&&(r=Math.max(Math.round(t-e)+1,1)),r<2)return 1===r?[e]:[];var n,a=Array(r);for(r--,n=r;n>=0;n--)a[n]=(n*t+(r-n)*e)/r;return a},numeric.getBlock=function(e,t,r){function n(e,o){var i,s=t[o],l=r[o]-s,u=Array(l);if(o===a.length-1){for(i=l;i>=0;i--)u[i]=e[i+s];return u}for(i=l;i>=0;i--)u[i]=n(e[i+s],o+1);return u}var a=numeric.dim(e);return n(e,0)},numeric.setBlock=function(e,t,r,n){function a(e,n,i){var s,l=t[i],u=r[i]-l;if(i===o.length-1)for(s=u;s>=0;s--)e[s+l]=n[s];for(s=u;s>=0;s--)a(e[s+l],n[s],i+1)}var o=numeric.dim(e);return a(e,n,0),e},numeric.getRange=function(e,t,r){var n,a,o,i,s=t.length,l=r.length,u=Array(s);for(n=s-1;n!==-1;--n)for(u[n]=Array(l),o=u[n],i=e[t[n]],a=l-1;a!==-1;--a)o[a]=i[r[a]];return u},numeric.blockMatrix=function(e){var t=numeric.dim(e);if(t.length<4)return numeric.blockMatrix([e]);var r,n,a,o,i,s=t[0],l=t[1];for(r=0,n=0,a=0;a<s;++a)r+=e[a][0].length;for(o=0;o<l;++o)n+=e[0][o][0].length;var u=Array(r);for(a=0;a<r;++a)u[a]=Array(n);var c,f,d,p,h,v=0;for(a=0;a<s;++a){for(c=n,o=l-1;o!==-1;--o)for(i=e[a][o],c-=i[0].length,d=i.length-1;d!==-1;--d)for(h=i[d],f=u[v+d],p=h.length-1;p!==-1;--p)f[c+p]=h[p];v+=e[a][0].length}return u},numeric.tensor=function(e,t){if("number"==typeof e||"number"==typeof t)return numeric.mul(e,t);var r=numeric.dim(e),n=numeric.dim(t);if(1!==r.length||1!==n.length)throw new Error("numeric: tensor product is only defined for vectors");var a,o,i,s,l=r[0],u=n[0],c=Array(l);for(o=l-1;o>=0;o--){for(a=Array(u),s=e[o],i=u-1;i>=3;--i)a[i]=s*t[i],--i,a[i]=s*t[i],--i,a[i]=s*t[i],--i,a[i]=s*t[i];for(;i>=0;)a[i]=s*t[i],--i;c[o]=a}return c},numeric.T=function(e,t){this.x=e,this.y=t},numeric.t=function(e,t){return new numeric.T(e,t)},numeric.Tbinop=function(e,t,r,n,a){numeric.indexOf;if("string"!=typeof a){var o;a="";for(o in numeric)numeric.hasOwnProperty(o)&&(e.indexOf(o)>=0||t.indexOf(o)>=0||r.indexOf(o)>=0||n.indexOf(o)>=0)&&o.length>1&&(a+="var "+o+" = numeric."+o+";\n")}return Function(["y"],"var x = this;\nif(!(y instanceof numeric.T)) { y = new numeric.T(y); }\n"+a+"\nif(x.y) { if(y.y) { return new numeric.T("+n+");\n }\n return new numeric.T("+r+");\n}\nif(y.y) {\n return new numeric.T("+t+");\n}\nreturn new numeric.T("+e+");\n")},numeric.T.prototype.add=numeric.Tbinop("add(x.x,y.x)","add(x.x,y.x),y.y","add(x.x,y.x),x.y","add(x.x,y.x),add(x.y,y.y)"),numeric.T.prototype.sub=numeric.Tbinop("sub(x.x,y.x)","sub(x.x,y.x),neg(y.y)","sub(x.x,y.x),x.y","sub(x.x,y.x),sub(x.y,y.y)"),numeric.T.prototype.mul=numeric.Tbinop("mul(x.x,y.x)","mul(x.x,y.x),mul(x.x,y.y)","mul(x.x,y.x),mul(x.y,y.x)","sub(mul(x.x,y.x),mul(x.y,y.y)),add(mul(x.x,y.y),mul(x.y,y.x))"),numeric.T.prototype.reciprocal=function(){var e=numeric.mul,t=numeric.div;if(this.y){var r=numeric.add(e(this.x,this.x),e(this.y,this.y));return new numeric.T(t(this.x,r),t(numeric.neg(this.y),r))}return new T(t(1,this.x))},numeric.T.prototype.div=function e(t){if(t instanceof numeric.T||(t=new numeric.T(t)),t.y)return this.mul(t.reciprocal());var e=numeric.div;return this.y?new numeric.T(e(this.x,t.x),e(this.y,t.x)):new numeric.T(e(this.x,t.x))},numeric.T.prototype.dot=numeric.Tbinop("dot(x.x,y.x)","dot(x.x,y.x),dot(x.x,y.y)","dot(x.x,y.x),dot(x.y,y.x)","sub(dot(x.x,y.x),dot(x.y,y.y)),add(dot(x.x,y.y),dot(x.y,y.x))"),numeric.T.prototype.transpose=function(){var e=numeric.transpose,t=this.x,r=this.y;return r?new numeric.T(e(t),e(r)):new numeric.T(e(t))},numeric.T.prototype.transjugate=function(){var e=numeric.transpose,t=this.x,r=this.y;return r?new numeric.T(e(t),numeric.negtranspose(r)):new numeric.T(e(t))},numeric.Tunop=function(e,t,r){return"string"!=typeof r&&(r=""),Function("var x = this;\n"+r+"\nif(x.y) { "+t+";\n}\n"+e+";\n")},numeric.T.prototype.exp=numeric.Tunop("return new numeric.T(ex)","return new numeric.T(mul(cos(x.y),ex),mul(sin(x.y),ex))","var ex = numeric.exp(x.x), cos = numeric.cos, sin = numeric.sin, mul = numeric.mul;"),numeric.T.prototype.conj=numeric.Tunop("return new numeric.T(x.x);","return new numeric.T(x.x,numeric.neg(x.y));"),numeric.T.prototype.neg=numeric.Tunop("return new numeric.T(neg(x.x));","return new numeric.T(neg(x.x),neg(x.y));","var neg = numeric.neg;"),numeric.T.prototype.sin=numeric.Tunop("return new numeric.T(numeric.sin(x.x))","return x.exp().sub(x.neg().exp()).div(new numeric.T(0,2));"),numeric.T.prototype.cos=numeric.Tunop("return new numeric.T(numeric.cos(x.x))","return x.exp().add(x.neg().exp()).div(2);"),numeric.T.prototype.abs=numeric.Tunop("return new numeric.T(numeric.abs(x.x));","return new numeric.T(numeric.sqrt(numeric.add(mul(x.x,x.x),mul(x.y,x.y))));","var mul = numeric.mul;"),numeric.T.prototype.log=numeric.Tunop("return new numeric.T(numeric.log(x.x));","var theta = new numeric.T(numeric.atan2(x.y,x.x)), r = x.abs();\nreturn new numeric.T(numeric.log(r.x),theta.x);"),numeric.T.prototype.norm2=numeric.Tunop("return numeric.norm2(x.x);","var f = numeric.norm2Squared;\nreturn Math.sqrt(f(x.x)+f(x.y));"),numeric.T.prototype.inv=function(){var e=this;if("undefined"==typeof e.y)return new numeric.T(numeric.inv(e.x));var t,r,n,a,o,i,s,l,u,c,f,t,r,n,d,p,h,v,g,m,y,x=e.x.length,b=numeric.identity(x),w=numeric.rep([x,x],0),_=numeric.clone(e.x),k=numeric.clone(e.y);for(t=0;t<x;t++){for(h=_[t][t],v=k[t][t],d=h*h+v*v,n=t,r=t+1;r<x;r++)h=_[r][t],v=k[r][t],p=h*h+v*v,p>d&&(n=r,d=p);for(n!==t&&(y=_[t],_[t]=_[n],_[n]=y,y=k[t],k[t]=k[n],k[n]=y,y=b[t],b[t]=b[n],b[n]=y,y=w[t],w[t]=w[n],w[n]=y),a=_[t],o=k[t],l=b[t],u=w[t],h=a[t],v=o[t],r=t+1;r<x;r++)g=a[r],m=o[r],a[r]=(g*h+m*v)/d,o[r]=(m*h-g*v)/d;for(r=0;r<x;r++)g=l[r],m=u[r],l[r]=(g*h+m*v)/d,u[r]=(m*h-g*v)/d;for(r=t+1;r<x;r++){for(i=_[r],s=k[r],c=b[r],f=w[r],h=i[t],v=s[t],n=t+1;n<x;n++)g=a[n],m=o[n],i[n]-=g*h-m*v,s[n]-=m*h+g*v;for(n=0;n<x;n++)g=l[n],m=u[n],c[n]-=g*h-m*v,f[n]-=m*h+g*v}}for(t=x-1;t>0;t--)for(l=b[t],u=w[t],r=t-1;r>=0;r--)for(c=b[r],f=w[r],h=_[r][t],v=k[r][t],n=x-1;n>=0;n--)g=l[n],m=u[n],c[n]-=h*g-v*m,f[n]-=h*m+v*g;return new numeric.T(b,w)},numeric.T.prototype.get=function(e){var t,r=this.x,n=this.y,a=0,o=e.length;if(n){for(;a<o;)t=e[a],r=r[t],n=n[t],a++;return new numeric.T(r,n)}for(;a<o;)t=e[a],r=r[t],a++;return new numeric.T(r)},numeric.T.prototype.set=function(e,t){var r,n=this.x,a=this.y,o=0,i=e.length,s=t.x,l=t.y;if(0===i)return l?this.y=l:a&&(this.y=void 0),this.x=n,this;if(l){for(a||(a=numeric.rep(numeric.dim(n),0),this.y=a);o<i-1;)r=e[o],n=n[r],a=a[r],o++;return r=e[o],n[r]=s,a[r]=l,this}if(a){for(;o<i-1;)r=e[o],n=n[r],a=a[r],o++;return r=e[o],n[r]=s,s instanceof Array?a[r]=numeric.rep(numeric.dim(s),0):a[r]=0,this}for(;o<i-1;)r=e[o],n=n[r],o++;return r=e[o],n[r]=s,this},numeric.T.prototype.getRows=function(e,t){var r,n,a=t-e+1,o=Array(a),i=this.x,s=this.y;for(r=e;r<=t;r++)o[r-e]=i[r];if(s){for(n=Array(a),r=e;r<=t;r++)n[r-e]=s[r];return new numeric.T(o,n)}return new numeric.T(o)},numeric.T.prototype.setRows=function(e,t,r){var n,a=this.x,o=this.y,i=r.x,s=r.y;for(n=e;n<=t;n++)a[n]=i[n-e];if(s)for(o||(o=numeric.rep(numeric.dim(a),0),this.y=o),n=e;n<=t;n++)o[n]=s[n-e];else if(o)for(n=e;n<=t;n++)o[n]=numeric.rep([i[n-e].length],0);return this},numeric.T.prototype.getRow=function(e){var t=this.x,r=this.y;return r?new numeric.T(t[e],r[e]):new numeric.T(t[e])},numeric.T.prototype.setRow=function(e,t){var r=this.x,n=this.y,a=t.x,o=t.y;return r[e]=a,o?(n||(n=numeric.rep(numeric.dim(r),0),this.y=n),n[e]=o):n&&(n=numeric.rep([a.length],0)),this},numeric.T.prototype.getBlock=function(e,t){var r=this.x,n=this.y,a=numeric.getBlock;return n?new numeric.T(a(r,e,t),a(n,e,t)):new numeric.T(a(r,e,t))},numeric.T.prototype.setBlock=function(e,t,r){r instanceof numeric.T||(r=new numeric.T(r));var n=this.x,a=this.y,o=numeric.setBlock,i=r.x,s=r.y;return s?(a||(this.y=numeric.rep(numeric.dim(this),0),a=this.y),o(n,e,t,i),o(a,e,t,s),this):(o(n,e,t,i),void(a&&o(a,e,t,numeric.rep(numeric.dim(i),0))))},numeric.T.rep=function(e,t){var r=numeric.T;t instanceof r||(t=new r(t));var n=t.x,a=t.y,o=numeric.rep;return a?new r(o(e,n),o(e,a)):new r(o(e,n))},numeric.T.diag=function e(t){t instanceof numeric.T||(t=new numeric.T(t));var r=t.x,n=t.y,e=numeric.diag;return n?new numeric.T(e(r),e(n)):new numeric.T(e(r))},numeric.T.eig=function(){if(this.y)throw new Error("eig: not implemented for complex matrices.");return numeric.eig(this.x)},numeric.T.identity=function(e){return new numeric.T(numeric.identity(e))},numeric.T.prototype.getDiag=function(){var e=numeric,t=this.x,r=this.y;return r?new e.T(e.getDiag(t),e.getDiag(r)):new e.T(e.getDiag(t))},numeric.house=function(e){var t=numeric.clone(e),r=e[0]>=0?1:-1,n=r*numeric.norm2(e);t[0]+=n;var a=numeric.norm2(t);if(0===a)throw new Error("eig: internal error");return numeric.div(t,a)},numeric.toUpperHessenberg=function(e){var t=numeric.dim(e);if(2!==t.length||t[0]!==t[1])throw new Error("numeric: toUpperHessenberg() only works on square matrices");var r,n,a,o,i,s,l,u,c,f,d=t[0],p=numeric.clone(e),h=numeric.identity(d);for(n=0;n<d-2;n++){for(o=Array(d-n-1),r=n+1;r<d;r++)o[r-n-1]=p[r][n];if(numeric.norm2(o)>0){for(i=numeric.house(o),s=numeric.getBlock(p,[n+1,n],[d-1,d-1]),l=numeric.tensor(i,numeric.dot(i,s)),r=n+1;r<d;r++)for(u=p[r],c=l[r-n-1],a=n;a<d;a++)u[a]-=2*c[a-n];for(s=numeric.getBlock(p,[0,n+1],[d-1,d-1]),l=numeric.tensor(numeric.dot(s,i),i),r=0;r<d;r++)for(u=p[r],c=l[r],a=n+1;a<d;a++)u[a]-=2*c[a-n-1];for(s=Array(d-n-1),r=n+1;r<d;r++)s[r-n-1]=h[r];for(l=numeric.tensor(i,numeric.dot(i,s)),r=n+1;r<d;r++)for(f=h[r],c=l[r-n-1],a=0;a<d;a++)f[a]-=2*c[a]}}return{H:p,Q:h}},numeric.epsilon=2.220446049250313e-16,numeric.QRFrancis=function(e,t){"undefined"==typeof t&&(t=1e4),e=numeric.clone(e);var r,n,a,o,i,s,l,u,c,f,d,p,h,v,g,m,y,x,b=(numeric.clone(e),numeric.dim(e)),w=b[0],_=numeric.identity(w);if(w<3)return{Q:_,B:[[0,w-1]]};var k=numeric.epsilon;for(x=0;x<t;x++){for(m=0;m<w-1;m++)if(Math.abs(e[m+1][m])<k*(Math.abs(e[m][m])+Math.abs(e[m+1][m+1]))){var z=numeric.QRFrancis(numeric.getBlock(e,[0,0],[m,m]),t),A=numeric.QRFrancis(numeric.getBlock(e,[m+1,m+1],[w-1,w-1]),t);for(p=Array(m+1),g=0;g<=m;g++)p[g]=_[g];for(h=numeric.dot(z.Q,p),g=0;g<=m;g++)_[g]=h[g];for(p=Array(w-m-1),g=m+1;g<w;g++)p[g-m-1]=_[g];for(h=numeric.dot(A.Q,p),g=m+1;g<w;g++)_[g]=h[g-m-1];return{Q:_,B:z.B.concat(numeric.add(A.B,m+1))}}if(a=e[w-2][w-2],o=e[w-2][w-1],i=e[w-1][w-2],s=e[w-1][w-1],u=a+s,l=a*s-o*i,c=numeric.getBlock(e,[0,0],[2,2]),u*u>=4*l){var j,M;j=.5*(u+Math.sqrt(u*u-4*l)),M=.5*(u-Math.sqrt(u*u-4*l)),c=numeric.add(numeric.sub(numeric.dot(c,c),numeric.mul(c,j+M)),numeric.diag(numeric.rep([3],j*M)))}else c=numeric.add(numeric.sub(numeric.dot(c,c),numeric.mul(c,u)),numeric.diag(numeric.rep([3],l)));for(r=[c[0][0],c[1][0],c[2][0]],n=numeric.house(r),p=[e[0],e[1],e[2]],h=numeric.tensor(n,numeric.dot(n,p)),g=0;g<3;g++)for(d=e[g],v=h[g],y=0;y<w;y++)d[y]-=2*v[y];for(p=numeric.getBlock(e,[0,0],[w-1,2]),h=numeric.tensor(numeric.dot(p,n),n),g=0;g<w;g++)for(d=e[g],v=h[g],y=0;y<3;y++)d[y]-=2*v[y];for(p=[_[0],_[1],_[2]],h=numeric.tensor(n,numeric.dot(n,p)),g=0;g<3;g++)for(f=_[g],v=h[g],y=0;y<w;y++)f[y]-=2*v[y];var O;for(m=0;m<w-2;m++){for(y=m;y<=m+1;y++)if(Math.abs(e[y+1][y])<k*(Math.abs(e[y][y])+Math.abs(e[y+1][y+1]))){var z=numeric.QRFrancis(numeric.getBlock(e,[0,0],[y,y]),t),A=numeric.QRFrancis(numeric.getBlock(e,[y+1,y+1],[w-1,w-1]),t);for(p=Array(y+1),g=0;g<=y;g++)p[g]=_[g];for(h=numeric.dot(z.Q,p),g=0;g<=y;g++)_[g]=h[g];for(p=Array(w-y-1),g=y+1;g<w;g++)p[g-y-1]=_[g];for(h=numeric.dot(A.Q,p),g=y+1;g<w;g++)_[g]=h[g-y-1];return{Q:_,B:z.B.concat(numeric.add(A.B,y+1))}}for(O=Math.min(w-1,m+3),r=Array(O-m),g=m+1;g<=O;g++)r[g-m-1]=e[g][m];for(n=numeric.house(r),p=numeric.getBlock(e,[m+1,m],[O,w-1]),h=numeric.tensor(n,numeric.dot(n,p)),g=m+1;g<=O;g++)for(d=e[g],v=h[g-m-1],y=m;y<w;y++)d[y]-=2*v[y-m];for(p=numeric.getBlock(e,[0,m+1],[w-1,O]),h=numeric.tensor(numeric.dot(p,n),n),g=0;g<w;g++)for(d=e[g],v=h[g],y=m+1;y<=O;y++)d[y]-=2*v[y-m-1];for(p=Array(O-m),g=m+1;g<=O;g++)p[g-m-1]=_[g];for(h=numeric.tensor(n,numeric.dot(n,p)),g=m+1;g<=O;g++)for(f=_[g],v=h[g-m-1],y=0;y<w;y++)f[y]-=2*v[y]}}throw new Error("numeric: eigenvalue iteration does not converge -- increase maxiter?")},numeric.eig=function(e,t){var r,n,a,o,i,s,l,u,c,f,d,p,h,v,g,m,y,x=numeric.toUpperHessenberg(e),b=numeric.QRFrancis(x.H,t),w=numeric.T,_=e.length,k=b.B,z=numeric.dot(b.Q,numeric.dot(x.H,numeric.transpose(b.Q))),A=new w(numeric.dot(b.Q,x.Q)),j=k.length,M=Math.sqrt;for(n=0;n<j;n++)if(r=k[n][0],r===k[n][1]);else{if(o=r+1,i=z[r][r],s=z[r][o],l=z[o][r],u=z[o][o],0===s&&0===l)continue;c=-i-u,f=i*u-s*l,d=c*c-4*f,d>=0?(p=c<0?-.5*(c-M(d)):-.5*(c+M(d)),m=(i-p)*(i-p)+s*s,y=l*l+(u-p)*(u-p),m>y?(m=M(m),v=(i-p)/m,g=s/m):(y=M(y),v=l/y,g=(u-p)/y),a=new w([[g,-v],[v,g]]),A.setRows(r,o,a.dot(A.getRows(r,o)))):(p=-.5*c,h=.5*M(-d),m=(i-p)*(i-p)+s*s,y=l*l+(u-p)*(u-p),m>y?(m=M(m+h*h),v=(i-p)/m,g=s/m,p=0,h/=m):(y=M(y+h*h),v=l/y,g=(u-p)/y,p=h/y,h=0),a=new w([[g,-v],[v,g]],[[p,h],[h,-p]]),A.setRows(r,o,a.dot(A.getRows(r,o))))}var O=A.dot(e).dot(A.transjugate()),_=e.length,E=numeric.T.identity(_);for(o=0;o<_;o++)if(o>0)for(n=o-1;n>=0;n--){var F=O.get([n,n]),S=O.get([o,o]);numeric.neq(F.x,S.x)||numeric.neq(F.y,S.y)?(p=O.getRow(n).getBlock([n],[o-1]),h=E.getRow(o).getBlock([n],[o-1]),E.set([o,n],O.get([n,o]).neg().sub(p.dot(h)).div(F.sub(S)))):E.setRow(o,E.getRow(n))}for(o=0;o<_;o++)p=E.getRow(o),E.setRow(o,p.div(p.norm2()));return E=E.transpose(),E=A.transjugate().dot(E),{lambda:O.getDiag(),E:E}},numeric.ccsSparse=function(e){var t,r,n,a,o=e.length,i=[];for(n=o-1;n!==-1;--n){r=e[n];for(a in r){for(a=parseInt(a);a>=i.length;)i[i.length]=0;0!==r[a]&&i[a]++}}var t=i.length,s=Array(t+1);for(s[0]=0,n=0;n<t;++n)s[n+1]=s[n]+i[n];var l=Array(s[t]),u=Array(s[t]);for(n=o-1;n!==-1;--n){r=e[n];for(a in r)0!==r[a]&&(i[a]--,l[s[a]+i[a]]=n,u[s[a]+i[a]]=r[a])}return[s,l,u]},numeric.ccsFull=function(e){var t,r,n,a,o=e[0],i=e[1],s=e[2],l=numeric.ccsDim(e),u=l[0],c=l[1],f=numeric.rep([u,c],0);for(t=0;t<c;t++)for(n=o[t],a=o[t+1],r=n;r<a;++r)f[i[r]][t]=s[r];return f},numeric.ccsTSolve=function(e,t,r,n,a){function o(e){var t;if(0===r[e]){for(r[e]=1,t=i[e];t<i[e+1];++t)o(s[t]);a[f]=e,++f}}var i=e[0],s=e[1],l=e[2],u=i.length-1,c=Math.max,f=0;"undefined"==typeof n&&(r=numeric.rep([u],0)),"undefined"==typeof n&&(n=numeric.linspace(0,r.length-1)),"undefined"==typeof a&&(a=[]);var d,p,h,v,g,m,y;for(d=n.length-1;d!==-1;--d)o(n[d]);for(a.length=f,d=a.length-1;d!==-1;--d)r[a[d]]=0;for(d=n.length-1;d!==-1;--d)p=n[d],r[p]=t[p];for(d=a.length-1;d!==-1;--d){for(p=a[d],h=i[p],v=c(i[p+1],h),g=h;g!==v;++g)if(s[g]===p){r[p]/=l[g];break}for(y=r[p],g=h;g!==v;++g)m=s[g],m!==p&&(r[m]-=y*l[g])}return r},numeric.ccsDFS=function(e){this.k=Array(e),this.k1=Array(e),this.j=Array(e)},numeric.ccsDFS.prototype.dfs=function(e,t,r,n,a,o){var i,s,l,u=0,c=a.length,f=this.k,d=this.k1,p=this.j;if(0===n[e])for(n[e]=1,p[0]=e,f[0]=s=t[e],d[0]=l=t[e+1];;)if(s>=l){if(a[c]=p[u],0===u)return;++c,--u,s=f[u],l=d[u]}else i=o[r[s]],0===n[i]?(n[i]=1,f[u]=s,++u,p[u]=i,s=t[i],d[u]=l=t[i+1]):++s},numeric.ccsLPSolve=function(e,t,r,n,a,o,i){var s,l,u,c,f,d,p,h,v,g=e[0],m=e[1],y=e[2],x=(g.length-1,t[0]),b=t[1],w=t[2];for(l=x[a],u=x[a+1],n.length=0,s=l;s<u;++s)i.dfs(o[b[s]],g,m,r,n,o);for(s=n.length-1;s!==-1;--s)r[n[s]]=0;for(s=l;s!==u;++s)c=o[b[s]],r[c]=w[s];for(s=n.length-1;s!==-1;--s){for(c=n[s],f=g[c],d=g[c+1],p=f;p<d;++p)if(o[m[p]]===c){r[c]/=y[p];break}for(v=r[c],p=f;p<d;++p)h=o[m[p]],h!==c&&(r[h]-=v*y[p])}return r},numeric.ccsLUP1=function(e,t){var r,n,a,o,i,s,l,u=e[0].length-1,c=[numeric.rep([u+1],0),[],[]],f=[numeric.rep([u+1],0),[],[]],d=c[0],p=c[1],h=c[2],v=f[0],g=f[1],m=f[2],y=numeric.rep([u],0),x=numeric.rep([u],0),b=numeric.ccsLPSolve,w=(Math.max,Math.abs),_=numeric.linspace(0,u-1),k=numeric.linspace(0,u-1),z=new numeric.ccsDFS(u);for("undefined"==typeof t&&(t=1),r=0;r<u;++r){for(b(c,e,y,x,r,k,z),o=-1,i=-1,n=x.length-1;n!==-1;--n)a=x[n],a<=r||(s=w(y[a]),s>o&&(i=a,o=s));for(w(y[r])<t*o&&(n=_[r],o=_[i],_[r]=o,k[o]=r,_[i]=n,k[n]=i,o=y[r],y[r]=y[i],y[i]=o),o=d[r],i=v[r],l=y[r],p[o]=_[r],h[o]=1,++o,n=x.length-1;n!==-1;--n)a=x[n],s=y[a],x[n]=0,y[a]=0,a<=r?(g[i]=a,m[i]=s,++i):(p[o]=_[a],h[o]=s/l,++o);d[r+1]=o,v[r+1]=i}for(n=p.length-1;n!==-1;--n)p[n]=k[p[n]];return{L:c,U:f,P:_,Pinv:k}},numeric.ccsDFS0=function(e){this.k=Array(e),this.k1=Array(e),this.j=Array(e)},numeric.ccsDFS0.prototype.dfs=function(e,t,r,n,a,o,i){var s,l,u,c=0,f=a.length,d=this.k,p=this.k1,h=this.j;if(0===n[e])for(n[e]=1,h[0]=e,d[0]=l=t[o[e]],p[0]=u=t[o[e]+1];;){if(isNaN(l))throw new Error("Ow!");if(l>=u){if(a[f]=o[h[c]],0===c)return;++f,--c,l=d[c],u=p[c]}else s=r[l],0===n[s]?(n[s]=1,d[c]=l,++c,h[c]=s,s=o[s],l=t[s],p[c]=u=t[s+1]):++l}},numeric.ccsLPSolve0=function(e,t,r,n,a,o,i,s){var l,u,c,f,d,p,h,v,g,m=e[0],y=e[1],x=e[2],b=(m.length-1,t[0]),w=t[1],_=t[2];for(u=b[a],c=b[a+1],n.length=0,l=u;l<c;++l)s.dfs(w[l],m,y,r,n,o,i);for(l=n.length-1;l!==-1;--l)f=n[l],r[i[f]]=0;for(l=u;l!==c;++l)f=w[l],r[f]=_[l];for(l=n.length-1;l!==-1;--l){for(f=n[l],v=i[f],d=m[f],p=m[f+1],h=d;h<p;++h)if(y[h]===v){r[v]/=x[h];break}for(g=r[v],h=d;h<p;++h)r[y[h]]-=g*x[h];r[v]=g}},numeric.ccsLUP0=function(e,t){var r,n,a,o,i,s,l,u=e[0].length-1,c=[numeric.rep([u+1],0),[],[]],f=[numeric.rep([u+1],0),[],[]],d=c[0],p=c[1],h=c[2],v=f[0],g=f[1],m=f[2],y=numeric.rep([u],0),x=numeric.rep([u],0),b=numeric.ccsLPSolve0,w=(Math.max,Math.abs),_=numeric.linspace(0,u-1),k=numeric.linspace(0,u-1),z=new numeric.ccsDFS0(u);for("undefined"==typeof t&&(t=1),r=0;r<u;++r){for(b(c,e,y,x,r,k,_,z),o=-1,i=-1,n=x.length-1;n!==-1;--n)a=x[n],a<=r||(s=w(y[_[a]]),s>o&&(i=a,o=s));for(w(y[_[r]])<t*o&&(n=_[r],o=_[i],_[r]=o,k[o]=r,_[i]=n,k[n]=i),o=d[r],i=v[r],l=y[_[r]],p[o]=_[r],h[o]=1,++o,n=x.length-1;n!==-1;--n)a=x[n],s=y[_[a]],x[n]=0,y[_[a]]=0,a<=r?(g[i]=a,m[i]=s,++i):(p[o]=_[a],h[o]=s/l,++o);d[r+1]=o,v[r+1]=i}for(n=p.length-1;n!==-1;--n)p[n]=k[p[n]];return{L:c,U:f,P:_,Pinv:k}},numeric.ccsLUP=numeric.ccsLUP0,numeric.ccsDim=function(e){return[numeric.sup(e[1])+1,e[0].length-1]},numeric.ccsGetBlock=function(e,t,r){var n=numeric.ccsDim(e),a=n[0],o=n[1];"undefined"==typeof t?t=numeric.linspace(0,a-1):"number"==typeof t&&(t=[t]),"undefined"==typeof r?r=numeric.linspace(0,o-1):"number"==typeof r&&(r=[r]);var i,s,l,u,c,f=t.length,d=r.length,p=numeric.rep([o],0),h=[],v=[],g=[p,h,v],m=e[0],y=e[1],x=e[2],b=numeric.rep([a],0),w=0,_=numeric.rep([a],0);for(s=0;s<d;++s){u=r[s];var k=m[u],z=m[u+1];for(i=k;i<z;++i)l=y[i],_[l]=1,b[l]=x[i];for(i=0;i<f;++i)c=t[i],_[c]&&(h[w]=i,v[w]=b[t[i]],++w);for(i=k;i<z;++i)l=y[i],_[l]=0;p[s+1]=w}return g},numeric.ccsDot=function(e,t){var r,n,a,o,i,s,l,u,c,f,d,p=e[0],h=e[1],v=e[2],g=t[0],m=t[1],y=t[2],x=numeric.ccsDim(e),b=numeric.ccsDim(t),w=x[0],_=(x[1],b[1]),k=numeric.rep([w],0),z=numeric.rep([w],0),A=Array(w),j=numeric.rep([_],0),M=[],O=[],E=[j,M,O];for(a=0;a!==_;++a){for(o=g[a],i=g[a+1],c=0,n=o;n<i;++n)for(f=m[n],d=y[n],s=p[f],l=p[f+1],r=s;r<l;++r)u=h[r],0===z[u]&&(A[c]=u,z[u]=1,c+=1),k[u]=k[u]+v[r]*d;for(o=j[a],i=o+c,j[a+1]=i,n=c-1;n!==-1;--n)d=o+n,r=A[n],M[d]=r,O[d]=k[r],z[r]=0,k[r]=0;j[a+1]=j[a]+c}return E},numeric.ccsLUPSolve=function(e,t){var r=e.L,n=e.U,a=(e.P,t[0]),o=!1; | |
| "object"!=typeof a&&(t=[[0,t.length],numeric.linspace(0,t.length-1),t],a=t[0],o=!0);var i,s,l,u,c,f,d=t[1],p=t[2],h=r[0].length-1,v=a.length-1,g=numeric.rep([h],0),m=Array(h),y=numeric.rep([h],0),x=Array(h),b=numeric.rep([v+1],0),w=[],_=[],k=numeric.ccsTSolve,z=0;for(i=0;i<v;++i){for(c=0,l=a[i],u=a[i+1],s=l;s<u;++s)f=e.Pinv[d[s]],x[c]=f,y[f]=p[s],++c;for(x.length=c,k(r,y,g,x,m),s=x.length-1;s!==-1;--s)y[x[s]]=0;if(k(n,g,y,m,x),o)return y;for(s=m.length-1;s!==-1;--s)g[m[s]]=0;for(s=x.length-1;s!==-1;--s)f=x[s],w[z]=f,_[z]=y[f],y[f]=0,++z;b[i+1]=z}return[b,w,_]},numeric.ccsbinop=function(e,t){return"undefined"==typeof t&&(t=""),Function("X","Y","var Xi = X[0], Xj = X[1], Xv = X[2];\nvar Yi = Y[0], Yj = Y[1], Yv = Y[2];\nvar n = Xi.length-1,m = Math.max(numeric.sup(Xj),numeric.sup(Yj))+1;\nvar Zi = numeric.rep([n+1],0), Zj = [], Zv = [];\nvar x = numeric.rep([m],0),y = numeric.rep([m],0);\nvar xk,yk,zk;\nvar i,j,j0,j1,k,p=0;\n"+t+"for(i=0;i<n;++i) {\n j0 = Xi[i]; j1 = Xi[i+1];\n for(j=j0;j!==j1;++j) {\n k = Xj[j];\n x[k] = 1;\n Zj[p] = k;\n ++p;\n }\n j0 = Yi[i]; j1 = Yi[i+1];\n for(j=j0;j!==j1;++j) {\n k = Yj[j];\n y[k] = Yv[j];\n if(x[k] === 0) {\n Zj[p] = k;\n ++p;\n }\n }\n Zi[i+1] = p;\n j0 = Xi[i]; j1 = Xi[i+1];\n for(j=j0;j!==j1;++j) x[Xj[j]] = Xv[j];\n j0 = Zi[i]; j1 = Zi[i+1];\n for(j=j0;j!==j1;++j) {\n k = Zj[j];\n xk = x[k];\n yk = y[k];\n"+e+"\n Zv[j] = zk;\n }\n j0 = Xi[i]; j1 = Xi[i+1];\n for(j=j0;j!==j1;++j) x[Xj[j]] = 0;\n j0 = Yi[i]; j1 = Yi[i+1];\n for(j=j0;j!==j1;++j) y[Yj[j]] = 0;\n}\nreturn [Zi,Zj,Zv];")},function(){var k,A,B,C;for(k in numeric.ops2)A=isFinite(eval("1"+numeric.ops2[k]+"0"))?"[Y[0],Y[1],numeric."+k+"(X,Y[2])]":"NaN",B=isFinite(eval("0"+numeric.ops2[k]+"1"))?"[X[0],X[1],numeric."+k+"(X[2],Y)]":"NaN",C=isFinite(eval("1"+numeric.ops2[k]+"0"))&&isFinite(eval("0"+numeric.ops2[k]+"1"))?"numeric.ccs"+k+"MM(X,Y)":"NaN",numeric["ccs"+k+"MM"]=numeric.ccsbinop("zk = xk "+numeric.ops2[k]+"yk;"),numeric["ccs"+k]=Function("X","Y",'if(typeof X === "number") return '+A+';\nif(typeof Y === "number") return '+B+";\nreturn "+C+";\n")}(),numeric.ccsScatter=function(e){var t,r=e[0],n=e[1],a=e[2],o=numeric.sup(n)+1,i=r.length,s=numeric.rep([o],0),l=Array(i),u=Array(i),c=numeric.rep([o],0);for(t=0;t<i;++t)c[n[t]]++;for(t=0;t<o;++t)s[t+1]=s[t]+c[t];var f,d,p=s.slice(0);for(t=0;t<i;++t)d=n[t],f=p[d],l[f]=r[t],u[f]=a[t],p[d]=p[d]+1;return[s,l,u]},numeric.ccsGather=function(e){var t,r,n,a,o,i=e[0],s=e[1],l=e[2],u=i.length-1,c=s.length,f=Array(c),d=Array(c),p=Array(c);for(o=0,t=0;t<u;++t)for(n=i[t],a=i[t+1],r=n;r!==a;++r)d[o]=t,f[o]=s[r],p[o]=l[r],++o;return[f,d,p]},numeric.sdim=function e(t,r,n){if("undefined"==typeof r&&(r=[]),"object"!=typeof t)return r;"undefined"==typeof n&&(n=0),n in r||(r[n]=0),t.length>r[n]&&(r[n]=t.length);var a;for(a in t)t.hasOwnProperty(a)&&e(t[a],r,n+1);return r},numeric.sclone=function e(t,r,n){"undefined"==typeof r&&(r=0),"undefined"==typeof n&&(n=numeric.sdim(t).length);var a,o=Array(t.length);if(r===n-1){for(a in t)t.hasOwnProperty(a)&&(o[a]=t[a]);return o}for(a in t)t.hasOwnProperty(a)&&(o[a]=e(t[a],r+1,n));return o},numeric.sdiag=function(e){var t,r,n=e.length,a=Array(n);for(t=n-1;t>=1;t-=2)r=t-1,a[t]=[],a[t][t]=e[t],a[r]=[],a[r][r]=e[r];return 0===t&&(a[0]=[],a[0][0]=e[t]),a},numeric.sidentity=function(e){return numeric.sdiag(numeric.rep([e],1))},numeric.stranspose=function(e){var t,r,n,a=[];e.length;for(t in e)if(e.hasOwnProperty(t)){n=e[t];for(r in n)n.hasOwnProperty(r)&&("object"!=typeof a[r]&&(a[r]=[]),a[r][t]=n[r])}return a},numeric.sLUP=function(e,t){throw new Error("The function numeric.sLUP had a bug in it and has been removed. Please use the new numeric.ccsLUP function instead.")},numeric.sdotMM=function(e,t){var r,n,a,o,i,s,l,u=e.length,c=(t.length,numeric.stranspose(t)),f=c.length,d=Array(u);for(a=u-1;a>=0;a--){for(l=[],r=e[a],i=f-1;i>=0;i--){s=0,n=c[i];for(o in r)r.hasOwnProperty(o)&&o in n&&(s+=r[o]*n[o]);s&&(l[i]=s)}d[a]=l}return d},numeric.sdotMV=function(e,t){var r,n,a,o,i=e.length,s=Array(i);for(n=i-1;n>=0;n--){r=e[n],o=0;for(a in r)r.hasOwnProperty(a)&&t[a]&&(o+=r[a]*t[a]);o&&(s[n]=o)}return s},numeric.sdotVM=function(e,t){var r,n,a,o,i=[];for(r in e)if(e.hasOwnProperty(r)){a=t[r],o=e[r];for(n in a)a.hasOwnProperty(n)&&(i[n]||(i[n]=0),i[n]+=o*a[n])}return i},numeric.sdotVV=function(e,t){var r,n=0;for(r in e)e[r]&&t[r]&&(n+=e[r]*t[r]);return n},numeric.sdot=function(e,t){var r=numeric.sdim(e).length,n=numeric.sdim(t).length,a=1e3*r+n;switch(a){case 0:return e*t;case 1001:return numeric.sdotVV(e,t);case 2001:return numeric.sdotMV(e,t);case 1002:return numeric.sdotVM(e,t);case 2002:return numeric.sdotMM(e,t);default:throw new Error("numeric.sdot not implemented for tensors of order "+r+" and "+n)}},numeric.sscatter=function(e){var t,r,n,a,o=e[0].length,i=e.length,s=[];for(r=o-1;r>=0;--r)if(e[i-1][r]){for(a=s,n=0;n<i-2;n++)t=e[n][r],a[t]||(a[t]=[]),a=a[t];a[e[n][r]]=e[n+1][r]}return s},numeric.sgather=function e(t,r,n){"undefined"==typeof r&&(r=[]),"undefined"==typeof n&&(n=[]);var a,o,i;a=n.length;for(o in t)if(t.hasOwnProperty(o))if(n[a]=parseInt(o),i=t[o],"number"==typeof i){if(i){if(0===r.length)for(o=a+1;o>=0;--o)r[o]=[];for(o=a;o>=0;--o)r[o].push(n[o]);r[a+1].push(i)}}else e(i,r,n);return n.length>a&&n.pop(),r},numeric.cLU=function(e){var t,r,n,a,o,i,s=e[0],l=e[1],u=e[2],c=s.length,f=0;for(t=0;t<c;t++)s[t]>f&&(f=s[t]);f++;var d,p,h,v=Array(f),g=Array(f),m=numeric.rep([f],1/0),y=numeric.rep([f],-(1/0));for(n=0;n<c;n++)t=s[n],r=l[n],r<m[t]&&(m[t]=r),r>y[t]&&(y[t]=r);for(t=0;t<f-1;t++)y[t]>y[t+1]&&(y[t+1]=y[t]);for(t=f-1;t>=1;t--)m[t]<m[t-1]&&(m[t-1]=m[t]);var x=0,b=0;for(t=0;t<f;t++)g[t]=numeric.rep([y[t]-m[t]+1],0),v[t]=numeric.rep([t-m[t]],0),x+=t-m[t]+1,b+=y[t]-t+1;for(n=0;n<c;n++)t=s[n],g[t][l[n]-m[t]]=u[n];for(t=0;t<f-1;t++)for(a=t-m[t],d=g[t],r=t+1;m[r]<=t&&r<f;r++)if(o=t-m[r],i=y[t]-t,p=g[r],h=p[o]/d[a]){for(n=1;n<=i;n++)p[n+o]-=h*d[n+a];v[r][t-m[r]]=h}var c,w,_,d=[],p=[],k=[],z=[],A=[],j=[];for(c=0,w=0,t=0;t<f;t++){for(a=m[t],o=y[t],_=g[t],r=t;r<=o;r++)_[r-a]&&(d[c]=t,p[c]=r,k[c]=_[r-a],c++);for(_=v[t],r=a;r<t;r++)_[r-a]&&(z[w]=t,A[w]=r,j[w]=_[r-a],w++);z[w]=t,A[w]=t,j[w]=1,w++}return{U:[d,p,k],L:[z,A,j]}},numeric.cLUsolve=function(e,t){var r,n,a=e.L,o=e.U,i=numeric.clone(t),s=a[0],l=a[1],u=a[2],c=o[0],f=o[1],d=o[2],p=c.length,h=(s.length,i.length);for(n=0,r=0;r<h;r++){for(;l[n]<r;)i[r]-=u[n]*i[l[n]],n++;n++}for(n=p-1,r=h-1;r>=0;r--){for(;f[n]>r;)i[r]-=d[n]*i[f[n]],n--;i[r]/=d[n],n--}return i},numeric.cgrid=function(e,t){"number"==typeof e&&(e=[e,e]);var r,n,a,o=numeric.rep(e,-1);if("function"!=typeof t)switch(t){case"L":t=function(t,r){return t>=e[0]/2||r<e[1]/2};break;default:t=function(e,t){return!0}}for(a=0,r=1;r<e[0]-1;r++)for(n=1;n<e[1]-1;n++)t(r,n)&&(o[r][n]=a,a++);return o},numeric.cdelsq=function(e){var t,r,n,a,o,i=[[-1,0],[0,-1],[0,1],[1,0]],s=numeric.dim(e),l=s[0],u=s[1],c=[],f=[],d=[];for(t=1;t<l-1;t++)for(r=1;r<u-1;r++)if(!(e[t][r]<0)){for(n=0;n<4;n++)a=t+i[n][0],o=r+i[n][1],e[a][o]<0||(c.push(e[t][r]),f.push(e[a][o]),d.push(-1));c.push(e[t][r]),f.push(e[t][r]),d.push(4)}return[c,f,d]},numeric.cdotMV=function(e,t){var r,n,a,o=e[0],i=e[1],s=e[2],l=o.length;for(a=0,n=0;n<l;n++)o[n]>a&&(a=o[n]);for(a++,r=numeric.rep([a],0),n=0;n<l;n++)r[o[n]]+=s[n]*t[i[n]];return r},numeric.Spline=function(e,t,r,n,a){this.x=e,this.yl=t,this.yr=r,this.kl=n,this.kr=a},numeric.Spline.prototype._at=function(e,t){var e,r,n,a,o=this.x,i=this.yl,s=this.yr,l=this.kl,u=this.kr,c=numeric.add,f=numeric.sub,d=numeric.mul;r=f(d(l[t],o[t+1]-o[t]),f(s[t+1],i[t])),n=c(d(u[t+1],o[t]-o[t+1]),f(s[t+1],i[t])),a=(e-o[t])/(o[t+1]-o[t]);var p=a*(1-a);return c(c(c(d(1-a,i[t]),d(a,s[t+1])),d(r,p*(1-a))),d(n,p*a))},numeric.Spline.prototype.at=function(e){if("number"==typeof e){var t,r,n,a=this.x,o=a.length,i=Math.floor;for(t=0,r=o-1;r-t>1;)n=i((t+r)/2),a[n]<=e?t=n:r=n;return this._at(e,t)}var s,o=e.length,l=Array(o);for(s=o-1;s!==-1;--s)l[s]=this.at(e[s]);return l},numeric.Spline.prototype.diff=function(){var e,t,r,n=this.x,a=this.yl,o=this.yr,i=this.kl,s=this.kr,l=a.length,u=i,c=s,f=Array(l),d=Array(l),p=numeric.add,h=numeric.mul,v=numeric.div,g=numeric.sub;for(e=l-1;e!==-1;--e)t=n[e+1]-n[e],r=g(o[e+1],a[e]),f[e]=v(p(h(r,6),h(i[e],-4*t),h(s[e+1],-2*t)),t*t),d[e+1]=v(p(h(r,-6),h(i[e],2*t),h(s[e+1],4*t)),t*t);return new numeric.Spline(n,u,c,f,d)},numeric.Spline.prototype.roots=function(){function e(e){return e*e}var t=[],r=this.x,n=this.yl,a=this.yr,o=this.kl,i=this.kr;"number"==typeof n[0]&&(n=[n],a=[a],o=[o],i=[i]);var s,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S=n.length,T=r.length-1,t=Array(S),B=Math.sqrt;for(s=0;s!==S;++s){for(c=n[s],f=a[s],d=o[s],p=i[s],h=[],l=0;l!==T;l++){for(l>0&&f[l]*c[l]<0&&h.push(r[l]),_=r[l+1]-r[l],k=r[l],m=c[l],y=f[l+1],v=d[l]/_,g=p[l+1]/_,w=e(v-g+3*(m-y))+12*g*m,x=g+3*m+2*v-3*y,b=3*(g+v+2*(m-y)),w<=0?(A=x/b,z=A>r[l]&&A<r[l+1]?[r[l],A,r[l+1]]:[r[l],r[l+1]]):(A=(x-B(w))/b,j=(x+B(w))/b,z=[r[l]],A>r[l]&&A<r[l+1]&&z.push(A),j>r[l]&&j<r[l+1]&&z.push(j),z.push(r[l+1])),O=z[0],A=this._at(O,l),u=0;u<z.length-1;u++)if(E=z[u+1],j=this._at(E,l),0!==A)if(0===j||A*j>0)O=E,A=j;else{for(var C=0;;){if(F=(A*E-j*O)/(A-j),F<=O||F>=E)break;if(M=this._at(F,l),M*j>0)E=F,j=M,C===-1&&(A*=.5),C=-1;else{if(!(M*A>0))break;O=F,A=M,1===C&&(j*=.5),C=1}}h.push(F),O=z[u+1],A=this._at(O,l)}else h.push(O),O=E,A=j;0===j&&h.push(E)}t[s]=h}return"number"==typeof this.yl[0]?t[0]:t},numeric.spline=function(e,t,r,n){var a,o=e.length,i=[],s=[],l=[],u=numeric.sub,c=numeric.mul,f=numeric.add;for(a=o-2;a>=0;a--)s[a]=e[a+1]-e[a],l[a]=u(t[a+1],t[a]);"string"!=typeof r&&"string"!=typeof n||(r=n="periodic");var d=[[],[],[]];switch(typeof r){case"undefined":i[0]=c(3/(s[0]*s[0]),l[0]),d[0].push(0,0),d[1].push(0,1),d[2].push(2/s[0],1/s[0]);break;case"string":i[0]=f(c(3/(s[o-2]*s[o-2]),l[o-2]),c(3/(s[0]*s[0]),l[0])),d[0].push(0,0,0),d[1].push(o-2,0,1),d[2].push(1/s[o-2],2/s[o-2]+2/s[0],1/s[0]);break;default:i[0]=r,d[0].push(0),d[1].push(0),d[2].push(1)}for(a=1;a<o-1;a++)i[a]=f(c(3/(s[a-1]*s[a-1]),l[a-1]),c(3/(s[a]*s[a]),l[a])),d[0].push(a,a,a),d[1].push(a-1,a,a+1),d[2].push(1/s[a-1],2/s[a-1]+2/s[a],1/s[a]);switch(typeof n){case"undefined":i[o-1]=c(3/(s[o-2]*s[o-2]),l[o-2]),d[0].push(o-1,o-1),d[1].push(o-2,o-1),d[2].push(1/s[o-2],2/s[o-2]);break;case"string":d[1][d[1].length-1]=0;break;default:i[o-1]=n,d[0].push(o-1),d[1].push(o-1),d[2].push(1)}i="number"!=typeof i[0]?numeric.transpose(i):[i];var p=Array(i.length);if("string"==typeof r)for(a=p.length-1;a!==-1;--a)p[a]=numeric.ccsLUPSolve(numeric.ccsLUP(numeric.ccsScatter(d)),i[a]),p[a][o-1]=p[a][0];else for(a=p.length-1;a!==-1;--a)p[a]=numeric.cLUsolve(numeric.cLU(d),i[a]);return p="number"==typeof t[0]?p[0]:numeric.transpose(p),new numeric.Spline(e,t,t,p,p)},numeric.fftpow2=function e(t,r){var n=t.length;if(1!==n){var a,o,i=Math.cos,s=Math.sin,l=Array(n/2),u=Array(n/2),c=Array(n/2),f=Array(n/2);for(o=n/2,a=n-1;a!==-1;--a)--o,c[o]=t[a],f[o]=r[a],--a,l[o]=t[a],u[o]=r[a];e(l,u),e(c,f),o=n/2;var d,p,h,v=-6.283185307179586/n;for(a=n-1;a!==-1;--a)--o,o===-1&&(o=n/2-1),d=v*a,p=i(d),h=s(d),t[a]=l[o]+p*c[o]-h*f[o],r[a]=u[o]+p*f[o]+h*c[o]}},numeric._ifftpow2=function e(t,r){var n=t.length;if(1!==n){var a,o,i=Math.cos,s=Math.sin,l=Array(n/2),u=Array(n/2),c=Array(n/2),f=Array(n/2);for(o=n/2,a=n-1;a!==-1;--a)--o,c[o]=t[a],f[o]=r[a],--a,l[o]=t[a],u[o]=r[a];e(l,u),e(c,f),o=n/2;var d,p,h,v=6.283185307179586/n;for(a=n-1;a!==-1;--a)--o,o===-1&&(o=n/2-1),d=v*a,p=i(d),h=s(d),t[a]=l[o]+p*c[o]-h*f[o],r[a]=u[o]+p*f[o]+h*c[o]}},numeric.ifftpow2=function(e,t){numeric._ifftpow2(e,t),numeric.diveq(e,e.length),numeric.diveq(t,t.length)},numeric.convpow2=function(e,t,r,n){numeric.fftpow2(e,t),numeric.fftpow2(r,n);var a,o,i,s,l,u=e.length;for(a=u-1;a!==-1;--a)o=e[a],s=t[a],i=r[a],l=n[a],e[a]=o*i-s*l,t[a]=o*l+s*i;numeric.ifftpow2(e,t)},numeric.T.prototype.fft=function(){var e,t,r=this.x,n=this.y,a=r.length,o=Math.log,i=o(2),s=Math.ceil(o(2*a-1)/i),l=Math.pow(2,s),u=numeric.rep([l],0),c=numeric.rep([l],0),f=Math.cos,d=Math.sin,p=-3.141592653589793/a,h=numeric.rep([l],0),v=numeric.rep([l],0);Math.floor(a/2);for(e=0;e<a;e++)h[e]=r[e];if("undefined"!=typeof n)for(e=0;e<a;e++)v[e]=n[e];for(u[0]=1,e=1;e<=l/2;e++)t=p*e*e,u[e]=f(t),c[e]=d(t),u[l-e]=f(t),c[l-e]=d(t);var g=new numeric.T(h,v),m=new numeric.T(u,c);return g=g.mul(m),numeric.convpow2(g.x,g.y,numeric.clone(m.x),numeric.neg(m.y)),g=g.mul(m),g.x.length=a,g.y.length=a,g},numeric.T.prototype.ifft=function(){var e,t,r=this.x,n=this.y,a=r.length,o=Math.log,i=o(2),s=Math.ceil(o(2*a-1)/i),l=Math.pow(2,s),u=numeric.rep([l],0),c=numeric.rep([l],0),f=Math.cos,d=Math.sin,p=3.141592653589793/a,h=numeric.rep([l],0),v=numeric.rep([l],0);Math.floor(a/2);for(e=0;e<a;e++)h[e]=r[e];if("undefined"!=typeof n)for(e=0;e<a;e++)v[e]=n[e];for(u[0]=1,e=1;e<=l/2;e++)t=p*e*e,u[e]=f(t),c[e]=d(t),u[l-e]=f(t),c[l-e]=d(t);var g=new numeric.T(h,v),m=new numeric.T(u,c);return g=g.mul(m),numeric.convpow2(g.x,g.y,numeric.clone(m.x),numeric.neg(m.y)),g=g.mul(m),g.x.length=a,g.y.length=a,g.div(a)},numeric.gradient=function(e,t){var r=t.length,n=e(t);if(isNaN(n))throw new Error("gradient: f(x) is a NaN!");var a,o,i,s,l,u,c,f,d,p,h=Math.max,v=numeric.clone(t),g=Array(r),h=(numeric.div,numeric.sub,Math.max),m=.001,y=Math.abs,x=Math.min,b=0;for(a=0;a<r;a++)for(var w=h(1e-6*n,1e-8);;){if(++b,b>20)throw new Error("Numerical gradient fails");if(v[a]=t[a]+w,o=e(v),v[a]=t[a]-w,i=e(v),v[a]=t[a],isNaN(o)||isNaN(i))w/=16;else{if(g[a]=(o-i)/(2*w),l=t[a]-w,u=t[a],c=t[a]+w,f=(o-n)/w,d=(n-i)/w,p=h(y(g[a]),y(n),y(o),y(i),y(l),y(u),y(c),1e-8),s=x(h(y(f-g[a]),y(d-g[a]),y(f-d))/p,w/p),!(s>m))break;w/=16}}return g},numeric.uncmin=function(e,t,r,n,a,o,i){var s=numeric.gradient;"undefined"==typeof i&&(i={}),"undefined"==typeof r&&(r=1e-8),"undefined"==typeof n&&(n=function(t){return s(e,t)}),"undefined"==typeof a&&(a=1e3),t=numeric.clone(t);var l,u,c=t.length,f=e(t);if(isNaN(f))throw new Error("uncmin: f(x0) is a NaN!");var d=Math.max,p=numeric.norm2;r=d(r,numeric.epsilon);var h,v,g,m,y,x,b,w,_,k,z=i.Hinv||numeric.identity(c),A=numeric.dot,j=(numeric.inv,numeric.sub),M=numeric.add,O=numeric.tensor,E=numeric.div,F=numeric.mul,S=numeric.all,T=numeric.isFinite,B=numeric.neg,C=0,q="";for(v=n(t);C<a;){if("function"==typeof o&&o(C,t,f,v,z)){q="Callback returned true";break}if(!S(T(v))){q="Gradient has Infinity or NaN";break}if(h=B(A(z,v)),!S(T(h))){q="Search direction has Infinity or NaN";break}if(k=p(h),k<r){q="Newton step smaller than tol";break}for(_=1,u=A(v,h),y=t;C<a&&!(_*k<r)&&(m=F(h,_),y=M(t,m),l=e(y),l-f>=.1*_*u||isNaN(l));)_*=.5,++C;if(_*k<r){q="Line search step size smaller than tol";break}if(C===a){q="maxit reached during line search";break}g=n(y),x=j(g,v),w=A(x,m),b=A(z,x),z=j(M(z,F((w+A(x,b))/(w*w),O(m,m))),E(M(O(b,m),O(m,b)),w)),t=y,f=l,v=g,++C}return{solution:t,f:f,gradient:v,invHessian:z,iterations:C,message:q}},numeric.Dopri=function(e,t,r,n,a,o,i){this.x=e,this.y=t,this.f=r,this.ymid=n,this.iterations=a,this.events=i,this.message=o},numeric.Dopri.prototype._at=function(e,t){function r(e){return e*e}var n,a,o,i,s,l,e,u,c,f,d,p=this,h=p.x,v=p.y,g=p.f,m=p.ymid,y=(h.length,Math.floor,.5),x=numeric.add,b=numeric.mul,w=numeric.sub;return n=h[t],a=h[t+1],i=v[t],s=v[t+1],u=a-n,o=n+y*u,l=m[t],c=w(g[t],b(i,1/(n-o)+2/(n-a))),f=w(g[t+1],b(s,1/(a-o)+2/(a-n))),d=[r(e-a)*(e-o)/r(n-a)/(n-o),r(e-n)*r(e-a)/r(n-o)/r(a-o),r(e-n)*(e-o)/r(a-n)/(a-o),(e-n)*r(e-a)*(e-o)/r(n-a)/(n-o),(e-a)*r(e-n)*(e-o)/r(n-a)/(a-o)],x(x(x(x(b(i,d[0]),b(l,d[1])),b(s,d[2])),b(c,d[3])),b(f,d[4]))},numeric.Dopri.prototype.at=function(e){var t,r,n,a=Math.floor;if("number"!=typeof e){var o=e.length,i=Array(o);for(t=o-1;t!==-1;--t)i[t]=this.at(e[t]);return i}var s=this.x;for(t=0,r=s.length-1;r-t>1;)n=a(.5*(t+r)),s[n]<=e?t=n:r=n;return this._at(e,t)},numeric.dopri=function(e,t,r,n,a,o,i){"undefined"==typeof a&&(a=1e-6),"undefined"==typeof o&&(o=1e3);var s,l,u,c,f,d,p,h,v,g,m,y,x,b=[e],w=[r],_=[n(e,r)],k=[],z=.2,A=[.075,.225],j=[44/45,-56/15,32/9],M=[19372/6561,-25360/2187,64448/6561,-212/729],O=[9017/3168,-355/33,46732/5247,49/176,-5103/18656],E=[35/384,0,500/1113,125/192,-2187/6784,11/84],F=[.10013431883002395,0,.3918321794184259,-.02982460176594817,.05893268337240795,-.04497888809104361,.023904308236133973],S=[.2,.3,.8,8/9,1,1],T=[-71/57600,0,71/16695,-71/1920,17253/339200,-22/525,.025],B=0,C=(t-e)/10,q=0,N=numeric.add,P=numeric.mul,I=(Math.max,Math.min),D=Math.abs,V=numeric.norminf,R=Math.pow,U=numeric.any,L=numeric.lt,Y=numeric.and,H=(numeric.sub,new numeric.Dopri(b,w,_,k,(-1),""));for("function"==typeof i&&(m=i(e,r));e<t&&q<o;)if(++q,e+C>t&&(C=t-e),s=n(e+S[0]*C,N(r,P(z*C,_[B]))),l=n(e+S[1]*C,N(N(r,P(A[0]*C,_[B])),P(A[1]*C,s))),u=n(e+S[2]*C,N(N(N(r,P(j[0]*C,_[B])),P(j[1]*C,s)),P(j[2]*C,l))),c=n(e+S[3]*C,N(N(N(N(r,P(M[0]*C,_[B])),P(M[1]*C,s)),P(M[2]*C,l)),P(M[3]*C,u))),f=n(e+S[4]*C,N(N(N(N(N(r,P(O[0]*C,_[B])),P(O[1]*C,s)),P(O[2]*C,l)),P(O[3]*C,u)),P(O[4]*C,c))),v=N(N(N(N(N(r,P(_[B],C*E[0])),P(l,C*E[2])),P(u,C*E[3])),P(c,C*E[4])),P(f,C*E[5])),d=n(e+C,v),p=N(N(N(N(N(P(_[B],C*T[0]),P(l,C*T[2])),P(u,C*T[3])),P(c,C*T[4])),P(f,C*T[5])),P(d,C*T[6])),g="number"==typeof p?D(p):V(p),g>a){if(C=.2*C*R(a/g,.25),e+C===e){H.msg="Step size became too small";break}}else{if(k[B]=N(N(N(N(N(N(r,P(_[B],C*F[0])),P(l,C*F[2])),P(u,C*F[3])),P(c,C*F[4])),P(f,C*F[5])),P(d,C*F[6])),++B,b[B]=e+C,w[B]=v,_[B]=d,"function"==typeof i){var X,G,J=e,W=e+.5*C;if(y=i(W,k[B-1]),x=Y(L(m,0),L(0,y)),U(x)||(J=W,W=e+C,m=y,y=i(W,v),x=Y(L(m,0),L(0,y))),U(x)){for(var Q,K,Z=0,$=1,ee=1;;){if("number"==typeof m)G=(ee*y*J-$*m*W)/(ee*y-$*m);else for(G=W,h=m.length-1;h!==-1;--h)m[h]<0&&y[h]>0&&(G=I(G,(ee*y[h]*J-$*m[h]*W)/(ee*y[h]-$*m[h])));if(G<=J||G>=W)break;X=H._at(G,B-1),K=i(G,X),Q=Y(L(m,0),L(0,K)),U(Q)?(W=G,y=K,x=Q,ee=1,Z===-1?$*=.5:$=1,Z=-1):(J=G,m=K,$=1,1===Z?ee*=.5:ee=1,Z=1)}return v=H._at(.5*(e+G),B-1),H.f[B]=n(G,X),H.x[B]=G,H.y[B]=X,H.ymid[B-1]=v,H.events=x,H.iterations=q,H}}e+=C,r=v,m=y,C=I(.8*C*R(a/g,.25),4*C)}return H.iterations=q,H},numeric.LU=function(e,t){t=t||!1;var r,n,a,o,i,s,l,u,c,f=Math.abs,d=e.length,p=d-1,h=new Array(d);for(t||(e=numeric.clone(e)),a=0;a<d;++a){for(l=a,s=e[a],c=f(s[a]),n=a+1;n<d;++n)o=f(e[n][a]),c<o&&(c=o,l=n);for(h[a]=l,l!=a&&(e[a]=e[l],e[l]=s,s=e[a]),i=s[a],r=a+1;r<d;++r)e[r][a]/=i;for(r=a+1;r<d;++r){for(u=e[r],n=a+1;n<p;++n)u[n]-=u[a]*s[n],++n,u[n]-=u[a]*s[n];n===p&&(u[n]-=u[a]*s[n])}}return{LU:e,P:h}},numeric.LUsolve=function(e,t){var r,n,a,o,i,s=e.LU,l=s.length,u=numeric.clone(t),c=e.P;for(r=l-1;r!==-1;--r)u[r]=t[r];for(r=0;r<l;++r)for(a=c[r],c[r]!==r&&(i=u[r],u[r]=u[a],u[a]=i),o=s[r],n=0;n<r;++n)u[r]-=u[n]*o[n];for(r=l-1;r>=0;--r){for(o=s[r],n=r+1;n<l;++n)u[r]-=u[n]*o[n];u[r]/=o[r]}return u},numeric.solve=function(e,t,r){return numeric.LUsolve(numeric.LU(e,r),t)},numeric.echelonize=function(e){var t,r,n,a,o,i,s,l,u=numeric.dim(e),c=u[0],f=u[1],d=numeric.identity(c),p=Array(c),h=Math.abs,v=numeric.diveq;for(e=numeric.clone(e),t=0;t<c;++t){for(n=0,o=e[t],i=d[t],r=1;r<f;++r)h(o[n])<h(o[r])&&(n=r);for(p[t]=n,v(i,o[n]),v(o,o[n]),r=0;r<c;++r)if(r!==t){for(s=e[r],l=s[n],a=f-1;a!==-1;--a)s[a]-=o[a]*l;for(s=d[r],a=c-1;a!==-1;--a)s[a]-=i[a]*l}}return{I:d,A:e,P:p}},numeric.__solveLP=function(e,t,r,n,a,o,i){var s,l,u,c,f=numeric.sum,d=(numeric.log,numeric.mul),p=numeric.sub,h=numeric.dot,v=numeric.div,g=numeric.add,m=e.length,y=r.length,x=!1,b=0,w=1,_=(numeric.transpose(t),numeric.svd,numeric.transpose),k=(numeric.leq,Math.sqrt),z=Math.abs,A=(numeric.muleq,numeric.norminf,numeric.any,Math.min),j=numeric.all,M=numeric.gt,O=Array(m),E=Array(y),F=(numeric.rep([y],1),numeric.solve),S=p(r,h(t,o)),T=h(e,e);for(u=b;u<a;++u){var B,C;for(B=y-1;B!==-1;--B)E[B]=v(t[B],S[B]);var q=_(E);for(B=m-1;B!==-1;--B)O[B]=f(q[B]);w=.25*z(T/h(e,O));var N=100*k(T/h(O,O));for((!isFinite(w)||w>N)&&(w=N),c=g(e,d(w,O)),l=h(q,E),B=m-1;B!==-1;--B)l[B][B]+=1;C=F(l,v(c,w),!0);var P=v(S,h(t,C)),I=1;for(B=y-1;B!==-1;--B)P[B]<0&&(I=A(I,-.999*P[B]));if(s=p(o,d(C,I)),S=p(r,h(t,s)),!j(M(S,0)))return{solution:o,message:"",iterations:u};if(o=s,w<n)return{solution:s,message:"",iterations:u};if(i){var D=h(e,c),V=h(t,c);for(x=!0,B=y-1;B!==-1;--B)if(D*V[B]<0){x=!1;break}}else x=!(o[m-1]>=0);if(x)return{solution:s,message:"Unbounded",iterations:u}}return{solution:o,message:"maximum iteration count exceeded",iterations:u}},numeric._solveLP=function(e,t,r,n,a){var o,i=e.length,s=r.length,l=(numeric.sum,numeric.log,numeric.mul,numeric.sub),u=numeric.dot,c=(numeric.div,numeric.add,numeric.rep([i],0).concat([1])),f=numeric.rep([s,1],-1),d=numeric.blockMatrix([[t,f]]),p=r,o=numeric.rep([i],0).concat(Math.max(0,numeric.sup(numeric.neg(r)))+1),h=numeric.__solveLP(c,d,p,n,a,o,!1),v=numeric.clone(h.solution);v.length=i;var g=numeric.inf(l(r,u(t,v)));if(g<0)return{solution:NaN,message:"Infeasible",iterations:h.iterations};var m=numeric.__solveLP(e,t,r,n,a-h.iterations,v,!0);return m.iterations+=h.iterations,m},numeric.solveLP=function(e,t,r,n,a,o,i){if("undefined"==typeof i&&(i=1e3),"undefined"==typeof o&&(o=numeric.epsilon),"undefined"==typeof n)return numeric._solveLP(e,t,r,o,i);var s,l=n.length,u=n[0].length,c=t.length,f=numeric.echelonize(n),d=numeric.rep([u],0),p=f.P,h=[];for(s=p.length-1;s!==-1;--s)d[p[s]]=1;for(s=u-1;s!==-1;--s)0===d[s]&&h.push(s);var v=numeric.getRange,g=numeric.linspace(0,l-1),m=numeric.linspace(0,c-1),y=v(n,g,h),x=v(t,m,p),b=v(t,m,h),w=numeric.dot,_=numeric.sub,k=w(x,f.I),z=_(b,w(k,y)),A=_(r,w(k,a)),j=Array(p.length),M=Array(h.length);for(s=p.length-1;s!==-1;--s)j[s]=e[p[s]];for(s=h.length-1;s!==-1;--s)M[s]=e[h[s]];var O=_(M,w(j,w(f.I,y))),E=numeric._solveLP(O,z,A,o,i),F=E.solution;if(F!==F)return E;var S=w(f.I,_(a,w(y,F))),T=Array(e.length);for(s=p.length-1;s!==-1;--s)T[p[s]]=S[s];for(s=h.length-1;s!==-1;--s)T[h[s]]=F[s];return{solution:T,message:E.message,iterations:E.iterations}},numeric.MPStoLP=function(e){function t(t){throw new Error("MPStoLP: "+t+"\nLine "+r+": "+e[r]+"\nCurrent state: "+s[i]+"\n")}e instanceof String&&e.split("\n");var r,n,a,o,i=0,s=["Initial state","NAME","ROWS","COLUMNS","RHS","BOUNDS","ENDATA"],l=e.length,u=0,c={},f=[],d=0,p={},h=0,v=[],g=[],m=[];for(r=0;r<l;++r){a=e[r];var y=a.match(/\S*/g),x=[];for(n=0;n<y.length;++n)""!==y[n]&&x.push(y[n]);if(0!==x.length){for(n=0;n<s.length&&a.substr(0,s[n].length)!==s[n];++n);if(n<s.length){if(i=n,1===n&&(o=x[1]),6===n)return{name:o,c:v,A:numeric.transpose(g),b:m,rows:c,vars:p}}else switch(i){case 0:case 1:t("Unexpected line");case 2:switch(x[0]){case"N":0===u?u=x[1]:t("Two or more N rows");break;case"L":c[x[1]]=d,f[d]=1,m[d]=0,++d;break;case"G":c[x[1]]=d,f[d]=-1,m[d]=0,++d;break;case"E":c[x[1]]=d,f[d]=0,m[d]=0,++d;break;default:t("Parse error "+numeric.prettyPrint(x))}break;case 3:p.hasOwnProperty(x[0])||(p[x[0]]=h,v[h]=0,g[h]=numeric.rep([d],0),++h);var b=p[x[0]];for(n=1;n<x.length;n+=2)if(x[n]!==u){var w=c[x[n]];g[b][w]=(f[w]<0?-1:1)*parseFloat(x[n+1])}else v[b]=parseFloat(x[n+1]);break;case 4:for(n=1;n<x.length;n+=2)m[c[x[n]]]=(f[c[x[n]]]<0?-1:1)*parseFloat(x[n+1]);break;case 5:break;case 6:t("Internal error")}}}t("Reached end of file without ENDATA")},numeric.seedrandom={pow:Math.pow,random:Math.random},function(e,t,r,n,a,o,i){function s(e){var t,n,a=this,o=e.length,i=0,s=a.i=a.j=a.m=0;for(a.S=[],a.c=[],o||(e=[o++]);i<r;)a.S[i]=i++;for(i=0;i<r;i++)t=a.S[i],s=c(s+t+e[i%o]),n=a.S[s],a.S[i]=n,a.S[s]=t;a.g=function(e){var t=a.S,n=c(a.i+1),o=t[n],i=c(a.j+o),s=t[i];t[n]=s,t[i]=o;for(var l=t[c(o+s)];--e;)n=c(n+1),o=t[n],i=c(i+o),s=t[i],t[n]=s,t[i]=o,l=l*r+t[c(o+s)];return a.i=n,a.j=i,l},a.g(r)}function l(e,t,r,n,a){if(r=[],a=typeof e,t&&"object"==a)for(n in e)if(n.indexOf("S")<5)try{r.push(l(e[n],t-1))}catch(e){}return r.length?r:e+("string"!=a?"\0":"")}function u(e,t,r,n){for(e+="",r=0,n=0;n<e.length;n++)t[c(n)]=c((r^=19*t[c(n)])+e.charCodeAt(n));e="";for(n in t)e+=String.fromCharCode(t[n]);return e}function c(e){return e&r-1}t.seedrandom=function(c,f){var d,p=[];return c=u(l(f?[c,e]:arguments.length?c:[(new Date).getTime(),e,window],3),p),d=new s(p),u(d.S,e),t.random=function(){for(var e=d.g(n),t=i,s=0;e<a;)e=(e+s)*r,t*=r,s=d.g(1);for(;e>=o;)e/=2,t/=2,s>>>=1;return(e+s)/t},c},i=t.pow(r,n),a=t.pow(2,a),o=2*a,u(t.random(),e)}([],numeric.seedrandom,256,6,52),function(e){function t(e){if("object"!=typeof e)return e;var r,n=[],a=e.length;for(r=0;r<a;r++)n[r+1]=t(e[r]);return n}function r(e){if("object"!=typeof e)return e;var t,n=[],a=e.length;for(t=1;t<a;t++)n[t-1]=r(e[t]);return n}function n(e,t,r){var n,a,o,i,s;for(o=1;o<=r;o+=1){for(e[o][o]=1/e[o][o],s=-e[o][o],n=1;n<o;n+=1)e[n][o]=s*e[n][o];if(i=o+1,r<i)break;for(a=i;a<=r;a+=1)for(s=e[o][a],e[o][a]=0,n=1;n<=o;n+=1)e[n][a]=e[n][a]+s*e[n][o]}}function a(e,t,r,n){var a,o,i,s;for(o=1;o<=r;o+=1){for(s=0,a=1;a<o;a+=1)s+=e[a][o]*n[a];n[o]=(n[o]-s)/e[o][o]}for(i=1;i<=r;i+=1)for(o=r+1-i,n[o]=n[o]/e[o][o],s=-n[o],a=1;a<o;a+=1)n[a]=n[a]+s*e[a][o]}function o(e,t,r,n){var a,o,i,s,l,u;for(o=1;o<=r;o+=1){if(n[1]=o,u=0,i=o-1,i<1){if(u=e[o][o]-u,u<=0)break;e[o][o]=Math.sqrt(u)}else{for(s=1;s<=i;s+=1){for(l=e[s][o],a=1;a<s;a+=1)l-=e[a][o]*e[a][s];l/=e[s][s],e[s][o]=l,u+=l*l}if(u=e[o][o]-u,u<=0)break;e[o][o]=Math.sqrt(u)}n[1]=0}}function i(e,t,r,i,s,l,u,c,f,d,p,h,v,g,m,y){function x(){for(g[1]=g[1]+1,j=B,z=1;z<=d;z+=1){for(j+=1,D=-c[z],A=1;A<=i;A+=1)D+=u[A][z]*s[A];if(Math.abs(D)<G&&(D=0),z>p)m[j]=D;else if(m[j]=-Math.abs(D),D>0){for(A=1;A<=i;A+=1)u[A][z]=-u[A][z];c[z]=-c[z]}}for(z=1;z<=v;z+=1)m[B+h[z]]=0;for(q=0,I=0,z=1;z<=d;z+=1)m[B+z]<I*m[P+z]&&(q=z,I=m[B+z]/m[P+z]);return 0===q?999:0}function b(){for(z=1;z<=i;z+=1){for(D=0,A=1;A<=i;A+=1)D+=e[A][z]*u[A][q];m[z]=D}for(M=F,z=1;z<=i;z+=1)m[M+z]=0;for(A=v+1;A<=i;A+=1)for(z=1;z<=i;z+=1)m[M+z]=m[M+z]+e[z][A]*m[A];for(H=!0,z=v;z>=1;z-=1){for(D=m[z],j=T+z*(z+3)/2,M=j-z,A=z+1;A<=v;A+=1)D-=m[j]*m[S+A],j+=A;if(D/=m[M],m[S+z]=D,h[z]<p)break;if(D<0)break;H=!1,E=z}if(!H)for(V=m[C+E]/m[S+E],z=1;z<=v&&!(h[z]<p)&&!(m[S+z]<0);z+=1)I=m[C+z]/m[S+z],I<V&&(V=I,E=z);for(D=0,z=F+1;z<=F+i;z+=1)D+=m[z]*m[z];if(Math.abs(D)<=G){if(H)return y[1]=1,999;for(z=1;z<=v;z+=1)m[C+z]=m[C+z]-V*m[S+z];return m[C+v+1]=m[C+v+1]+V,700}for(D=0,z=1;z<=i;z+=1)D+=m[F+z]*u[z][q];for(R=-m[B+q]/D,X=!0,H||V<R&&(R=V,X=!1),z=1;z<=i;z+=1)s[z]=s[z]+R*m[F+z],Math.abs(s[z])<G&&(s[z]=0);for(l[1]=l[1]+R*D*(R/2+m[C+v+1]),z=1;z<=v;z+=1)m[C+z]=m[C+z]-R*m[S+z];if(m[C+v+1]=m[C+v+1]+R,!X){for(D=-c[q],A=1;A<=i;A+=1)D+=s[A]*u[A][q];if(q>p)m[B+q]=D;else if(m[B+q]=-Math.abs(D),D>0){for(A=1;A<=i;A+=1)u[A][q]=-u[A][q];c[q]=-c[q]}return 700}for(v+=1,h[v]=q,j=T+(v-1)*v/2+1,z=1;z<=v-1;z+=1)m[j]=m[z],j+=1;if(v===i)m[j]=m[i];else{for(z=i;z>=v+1&&0!==m[z]&&(U=Math.max(Math.abs(m[z-1]),Math.abs(m[z])),L=Math.min(Math.abs(m[z-1]),Math.abs(m[z])),I=m[z-1]>=0?Math.abs(U*Math.sqrt(1+L*L/(U*U))):-Math.abs(U*Math.sqrt(1+L*L/(U*U))),U=m[z-1]/I,L=m[z]/I,1!==U);z-=1)if(0===U)for(m[z-1]=L*I,A=1;A<=i;A+=1)I=e[A][z-1],e[A][z-1]=e[A][z],e[A][z]=I;else for(m[z-1]=I,Y=L/(1+U),A=1;A<=i;A+=1)I=U*e[A][z-1]+L*e[A][z],e[A][z]=Y*(e[A][z-1]+I)-e[A][z],e[A][z-1]=I;m[j]=m[v]}return 0}function w(){if(j=T+E*(E+1)/2+1,M=j+E,0===m[M])return 798;if(U=Math.max(Math.abs(m[M-1]),Math.abs(m[M])),L=Math.min(Math.abs(m[M-1]),Math.abs(m[M])),I=m[M-1]>=0?Math.abs(U*Math.sqrt(1+L*L/(U*U))):-Math.abs(U*Math.sqrt(1+L*L/(U*U))),U=m[M-1]/I,L=m[M]/I,1===U)return 798;if(0===U){for(z=E+1;z<=v;z+=1)I=m[M-1],m[M-1]=m[M],m[M]=I,M+=z;for(z=1;z<=i;z+=1)I=e[z][E],e[z][E]=e[z][E+1],e[z][E+1]=I}else{for(Y=L/(1+U),z=E+1;z<=v;z+=1)I=U*m[M-1]+L*m[M],m[M]=Y*(m[M-1]+I)-m[M],m[M-1]=I,M+=z;for(z=1;z<=i;z+=1)I=U*e[z][E]+L*e[z][E+1],e[z][E+1]=Y*(e[z][E]+I)-e[z][E+1],e[z][E]=I}return 0}function _(){for(M=j-E,z=1;z<=E;z+=1)m[M]=m[j],j+=1,M+=1;return m[C+E]=m[C+E+1],h[E]=h[E+1],E+=1,E<v?797:0}function k(){return m[C+v]=m[C+v+1],m[C+v+1]=0,h[v]=0,v-=1,g[2]=g[2]+1,0}var z,A,j,M,O,E,F,S,T,B,C,q,N,P,I,D,V,R,U,L,Y,H,X,G,J,W,Q;N=Math.min(i,d),j=2*i+N*(N+5)/2+2*d+1,G=1e-60;do G+=G,J=1+.1*G,W=1+.2*G;while(J<=1||W<=1);for(z=1;z<=i;z+=1)m[z]=t[z];for(z=i+1;z<=j;z+=1)m[z]=0;for(z=1;z<=d;z+=1)h[z]=0;if(O=[],0===y[1]){if(o(e,r,i,O),0!==O[1])return void(y[1]=2);a(e,r,i,t),n(e,r,i)}else{for(A=1;A<=i;A+=1)for(s[A]=0,z=1;z<=A;z+=1)s[A]=s[A]+e[z][A]*t[z];for(A=1;A<=i;A+=1)for(t[A]=0,z=A;z<=i;z+=1)t[A]=t[A]+e[A][z]*s[z]}for(l[1]=0,A=1;A<=i;A+=1)for(s[A]=t[A],l[1]=l[1]+m[A]*s[A],m[A]=0,z=A+1;z<=i;z+=1)e[z][A]=0;for(l[1]=-l[1]/2,y[1]=0,F=i,S=F+i,C=S+N,T=C+N+1,B=T+N*(N+1)/2,P=B+d,z=1;z<=d;z+=1){for(D=0,A=1;A<=i;A+=1)D+=u[A][z]*u[A][z];m[P+z]=Math.sqrt(D)}for(v=0,g[1]=0,g[2]=0,Q=0;;){if(Q=x(),999===Q)return;for(;;){if(Q=b(),0===Q)break;if(999===Q)return;if(700===Q)if(E===v)k();else{for(;;)if(w(),Q=_(),797!==Q)break;k()}}}}function s(e,n,a,o,s,l){e=t(e),n=t(n),a=t(a);var u,c,f,d,p,h,v=[],g=[],m=[],y=[],x=[];if(s=s||0,l=l?t(l):[void 0,0],o=o?t(o):[],c=e.length-1,f=a[1].length-1,!o)for(u=1;u<=f;u+=1)o[u]=0;for(u=1;u<=f;u+=1)g[u]=0;for(d=0,p=Math.min(c,f),u=1;u<=c;u+=1)m[u]=0;for(v[1]=0,u=1;u<=2*c+p*(p+5)/2+2*f+1;u+=1)y[u]=0;for(u=1;u<=2;u+=1)x[u]=0;return i(e,n,c,c,m,v,a,o,c,f,s,g,d,x,y,l),h="",1===l[1]&&(h="constraints are inconsistent, no solution!"),2===l[1]&&(h="matrix D in quadratic function is not positive definite!"),{solution:r(m),value:r(v),unconstrained_solution:r(n),iterations:r(x),iact:r(g),message:h}}e.solveQP=s}(numeric),numeric.svd=function(e){function t(e,t){return e=Math.abs(e),t=Math.abs(t),e>t?e*Math.sqrt(1+t*t/e/e):0==t?e:t*Math.sqrt(1+e*e/t/t)}var r,n=numeric.epsilon,a=1e-64/n,o=50,i=0,s=0,l=0,u=0,c=0,f=numeric.clone(e),d=f.length,p=f[0].length;if(d<p)throw"Need more rows than columns";var h=new Array(p),v=new Array(p);for(s=0;s<p;s++)h[s]=v[s]=0;var g=numeric.rep([p,p],0),m=0,y=0,x=0,b=0,w=0,_=0,k=0;for(s=0;s<p;s++){for(h[s]=y,k=0,c=s+1,l=s;l<d;l++)k+=f[l][s]*f[l][s];if(k<=a)y=0;else for(m=f[s][s],y=Math.sqrt(k),m>=0&&(y=-y),x=m*y-k,f[s][s]=m-y,l=c;l<p;l++){for(k=0,u=s;u<d;u++)k+=f[u][s]*f[u][l];for(m=k/x,u=s;u<d;u++)f[u][l]+=m*f[u][s]}for(v[s]=y,k=0,l=c;l<p;l++)k+=f[s][l]*f[s][l];if(k<=a)y=0;else{for(m=f[s][s+1],y=Math.sqrt(k),m>=0&&(y=-y),x=m*y-k,f[s][s+1]=m-y,l=c;l<p;l++)h[l]=f[s][l]/x;for(l=c;l<d;l++){for(k=0,u=c;u<p;u++)k+=f[l][u]*f[s][u];for(u=c;u<p;u++)f[l][u]+=k*h[u]}}w=Math.abs(v[s])+Math.abs(h[s]),w>b&&(b=w)}for(s=p-1;s!=-1;s+=-1){if(0!=y){for(x=y*f[s][s+1],l=c;l<p;l++)g[l][s]=f[s][l]/x;for(l=c;l<p;l++){for(k=0,u=c;u<p;u++)k+=f[s][u]*g[u][l];for(u=c;u<p;u++)g[u][l]+=k*g[u][s]}}for(l=c;l<p;l++)g[s][l]=0,g[l][s]=0;g[s][s]=1,y=h[s],c=s}for(s=p-1;s!=-1;s+=-1){for(c=s+1,y=v[s],l=c;l<p;l++)f[s][l]=0;if(0!=y){for(x=f[s][s]*y,l=c;l<p;l++){for(k=0,u=c;u<d;u++)k+=f[u][s]*f[u][l];for(m=k/x,u=s;u<d;u++)f[u][l]+=m*f[u][s]}for(l=s;l<d;l++)f[l][s]=f[l][s]/y}else for(l=s;l<d;l++)f[l][s]=0;f[s][s]+=1}for(n*=b,u=p-1;u!=-1;u+=-1)for(var z=0;z<o;z++){var A=!1;for(c=u;c!=-1;c+=-1){if(Math.abs(h[c])<=n){A=!0;break}if(Math.abs(v[c-1])<=n)break}if(!A){i=0,k=1;var j=c-1;for(s=c;s<u+1&&(m=k*h[s],h[s]=i*h[s],!(Math.abs(m)<=n));s++)for(y=v[s],x=t(m,y),v[s]=x,i=y/x,k=-m/x,l=0;l<d;l++)w=f[l][j],_=f[l][s],f[l][j]=w*i+_*k,f[l][s]=-w*k+_*i}if(_=v[u],c==u){if(_<0)for(v[u]=-_,l=0;l<p;l++)g[l][u]=-g[l][u];break}if(z>=o-1)throw"Error: no convergence.";for(b=v[c],w=v[u-1],y=h[u-1],x=h[u],m=((w-_)*(w+_)+(y-x)*(y+x))/(2*x*w),y=t(m,1),m=m<0?((b-_)*(b+_)+x*(w/(m-y)-x))/b:((b-_)*(b+_)+x*(w/(m+y)-x))/b,i=1,k=1,s=c+1;s<u+1;s++){for(y=h[s],w=v[s],x=k*y,y=i*y,_=t(m,x),h[s-1]=_,i=m/_,k=x/_,m=b*i+y*k,y=-b*k+y*i,x=w*k,w*=i,l=0;l<p;l++)b=g[l][s-1],_=g[l][s],g[l][s-1]=b*i+_*k,g[l][s]=-b*k+_*i;for(_=t(m,x),v[s-1]=_,i=m/_,k=x/_,m=i*y+k*w,b=-k*y+i*w,l=0;l<d;l++)w=f[l][s-1],_=f[l][s],f[l][s-1]=w*i+_*k,f[l][s]=-w*k+_*i}h[c]=0,h[u]=m,v[u]=b}for(s=0;s<v.length;s++)v[s]<n&&(v[s]=0);for(s=0;s<p;s++)for(l=s-1;l>=0;l--)if(v[l]<v[s]){for(i=v[l],v[l]=v[s],v[s]=i,u=0;u<f.length;u++)r=f[u][s],f[u][s]=f[u][l],f[u][l]=r;for(u=0;u<g.length;u++)r=g[u][s],g[u][s]=g[u][l],g[u][l]=r;s=l}return{U:f,S:v,V:g}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],8:[function(e,t,r){!function(){"use strict";function e(e,t){var r=e.x-t.x,n=e.y-t.y;return r*r+n*n}function r(e,t,r){ | |
| var n=t.x,a=t.y,o=r.x-n,i=r.y-a;if(0!==o||0!==i){var s=((e.x-n)*o+(e.y-a)*i)/(o*o+i*i);s>1?(n=r.x,a=r.y):s>0&&(n+=o*s,a+=i*s)}return o=e.x-n,i=e.y-a,o*o+i*i}function n(t,r){for(var n,a=t[0],o=[a],i=1,s=t.length;i<s;i++)n=t[i],e(n,a)>r&&(o.push(n),a=n);return a!==n&&o.push(n),o}function a(e,t){var n,a,o,i,s=e.length,l="undefined"!=typeof Uint8Array?Uint8Array:Array,u=new l(s),c=0,f=s-1,d=[],p=[];for(u[c]=u[f]=1;f;){for(a=0,n=c+1;n<f;n++)o=r(e[n],e[c],e[f]),o>a&&(i=n,a=o);a>t&&(u[i]=1,d.push(c,i,i,f)),f=d.pop(),c=d.pop()}for(n=0;n<s;n++)u[n]&&p.push(e[n]);return p}function o(e,t,r){var o=void 0!==t?t*t:1;return e=r?e:n(e,o),e=a(e,o)}"function"==typeof define&&define.amd?define(function(){return o}):"undefined"!=typeof t?t.exports=o:"undefined"!=typeof self?self.simplify=o:window.simplify=o}()},{}],9:[function(e,t,r){"use strict";function n(e,t,r,n){this.points=e,this.ids=t,this.dimension=n,this.length=r}function a(e){var t,r,a;if(Array.isArray(e)){if(t=e.length,0===t)return new n(null,null,0,0);r=e[0].length,a=i(f.mallocDouble(t*(r+1)),[t,r+1]),l(e,a.hi(t,r))}else{t=e.shape[0],r=e.shape[1];var o=e.dtype;o="int8"===o||"int16"===o||"int32"===o?"int32":"uint8"===o||"uint8_clamped"===o||"buffer"===o||"uint16"===o||"uint32"===o?"uint32":"float32"===o?"float32":"float64",a=i(f.malloc(t*(r+1)),[t,r+1]),u.assign(a.hi(t,r),e)}for(var h=0;h<t;++h)a.set(h,r,h);for(var v=c.malloc([t,r],e.dtype),g=f.mallocInt32(t),m=0,y=v.data,x=a.data,b=(p.log2(p.nextPow2(t)),s.compile(a.order,!0,a.dtype)),w=[a];m<t;){var _=w.shift(),k=_,z=0|k.shape[0];if(z>1){var A,j=p.log2(m+1)%r,M=d.root(z);A=b(k,M,function(e,t){return e.get(j)-t.get(j)});for(var O=v.index(m,0),E=A.offset,h=0;h<r;++h)y[O++]=x[E++];g[m]=x[E],m+=1,w.push(k.hi(M)),z>2&&w.push(k.lo(M+1))}else{for(var E=k.offset,O=v.index(m,0),h=0;h<r;++h)y[O+h]=x[E++];g[m]=x[E],m+=1}}return f.free(a.data),new n(v,g,t,r)}function o(e){var t=e.p,r=e.i;if(t){for(var a=t.length,o=f.mallocFloat64(a),s=0;s<a;++s)o[s]=t[s];for(var l=r.length,u=f.mallocInt32(l),s=0;s<l;++s)u[s]=r[s];var c=a/l|0;return new n(i(o,[l,c]),u,l,c)}return new n(null,null,0,e.d)}t.exports=a,t.exports.deserialize=o;var i=e("ndarray"),s=e("ndarray-select"),l=e("ndarray-pack"),u=e("ndarray-ops"),c=e("ndarray-scratch"),f=e("typedarray-pool"),d=e("inorder-tree-layout"),p=e("bit-twiddle"),h=e("./lib/heap.js"),v=n.prototype;v.serialize=function(){return this.length>0?{p:Array.prototype.slice.call(this.points.data,0,this.length*this.dimension),i:Array.prototype.slice.call(this.ids,0,this.length)}:{d:this.dimension}},v.range=function(e,t,r){var n=this.length;if(!(n<1)){for(var a=this.dimension,o=0;o<a;++o)if(t[o]<e[o])return;var i,s=this.points,u=this.ids,d=c.malloc([n,2,a]),h=f.mallocInt32(n),v=d.data,g=s.data,m=1,y=0;for(h[0]=0,l(e,d.pick(0,0)),l(t,d.pick(0,1));y<m;){for(var x=h[y],b=p.log2(x+1)%a,w=d.index(y,0,0),_=d.index(y,1,0),k=s.index(x,0),z=!0,o=0;o<a;++o){var A=g[k+o];if(A<v[w+o]||v[_+o]<A){z=!1;break}}if(z&&(i=r(u[x]),void 0!==i))break;var j=g[k+b],M=v[_+b],O=v[w+b];if(O<=j){var E=2*x+1;if(E<n){h[m]=E;for(var F=d.index(m,0,0),o=0;o<a;++o)v[F+o]=v[w+o];for(var S=d.index(m,1,0),o=0;o<a;++o)v[S+o]=v[_+o];v[S+b]=Math.min(M,j),m+=1}}if(j<=M){var T=2*(x+1);if(T<n){h[m]=T;for(var F=d.index(m,0,0),o=0;o<a;++o)v[F+o]=v[w+o];for(var S=d.index(m,1,0),o=0;o<a;++o)v[S+o]=v[_+o];v[F+b]=Math.max(O,j),m+=1}}y+=1}return c.free(d),f.free(h),i}},v.rnn=function(e,t,r){if(!(t<0)){var n=this.length;if(!(n<1)){var a,o=this.dimension,i=this.points,s=this.ids,l=c.malloc([n,o]),u=f.mallocInt32(n),d=l.data,h=i.data,v=1,g=0,m=t*t;u[0]=0;for(var y=0;y<o;++y)l.set(0,y,0);for(;g<v;){for(var x=u[g],b=i.index(x,0),w=0,y=0;y<o;++y)w+=Math.pow(e[y]-h[b+y],2);if(w<=m&&(a=r(s[x]),void 0!==a))break;for(var _=p.log2(x+1)%o,k=0,z=l.index(g,0),y=0;y<o;++y)y!==_&&(k+=d[z+y]);var A=e[_],j=h[b+_],M=d[z+_],O=M,E=M;A<j?E=Math.max(M,Math.pow(j-A,2)):O=Math.max(M,Math.pow(j-A,2));var F=O+k,S=E+k;if(F<=m){var T=2*x+1;if(T<n){u[v]=T;for(var B=l.index(v,0),y=0;y<o;++y)d[B+y]=d[z+y];d[B+_]=O,v+=1}}if(S<=m){var C=2*(x+1);if(C<n){u[v]=C;for(var B=l.index(v,0),y=0;y<o;++y)d[B+y]=d[z+y];d[B+_]=E,v+=1}}g+=1}return c.free(l),f.free(u),a}}},v.nn=function(e,t){var r=this.length;if(r<1)return-1;if("number"==typeof t){if(t<0)return-1}else t=1/0;var n=this.dimension,a=this.points,o=a.data,i=f.mallocFloat64(n),s=new h(r,n+1),l=s.index,u=s.data;l[0]=0;for(var c=0;c<=n;++c)u[c]=0;s.count+=1;for(var d=-1,v=t;s.count>0&&!(u[0]>=v);){for(var g=l[0],m=a.index(g,0),y=0,c=0;c<n;++c)y+=Math.pow(e[c]-o[m+c],2);y<v&&(v=y,d=g);for(var x=p.log2(g+1)%n,b=0,c=0;c<n;++c){var w=u[c+1];c!==x&&(b+=w),i[c]=w}var _=e[x],k=o[m+x],z=i[x],A=z,j=z;_<k?j=Math.max(z,Math.pow(k-_,2)):A=Math.max(z,Math.pow(k-_,2));var M=A+b,O=j+b;if(s.pop(),M<v){var E=2*g+1;if(E<r){var F=s.count;l[F]=E;var S=F*(n+1);u[S]=M;for(var c=1;c<=n;++c)u[S+c]=i[c-1];u[S+x+1]=A,s.push()}}if(O<v){var T=2*(g+1);if(T<r){var F=s.count;l[F]=T;var S=F*(n+1);u[S]=O;for(var c=1;c<=n;++c)u[S+c]=i[c-1];u[S+x+1]=j,s.push()}}}return f.freeFloat64(i),s.dispose(),d<0?-1:this.ids[d]},v.knn=function(e,t,r){if("number"==typeof r){if(r<0)return[]}else r=1/0;var n=this.length;if(n<1)return[];if("number"==typeof t){if(t<=0)return[];t=0|Math.min(t,n)}else t=n;var a=this.ids,o=this.dimension,i=this.points,s=i.data,l=f.mallocFloat64(o),u=new h(t,1),c=u.index,d=u.data,v=new h(n,o+1),g=v.index,m=v.data;g[0]=0;for(var y=0;y<=o;++y)m[y]=0;v.count+=1;for(var x=r;v.count>0&&!(m[0]>=x);){for(var b=g[0],w=i.index(b,0),_=0,y=0;y<o;++y)_+=Math.pow(e[y]-s[w+y],2);if(_<x){u.count>=t&&u.pop();var k=u.count;c[k]=b,d[k]=-_,u.push(),u.count>=t&&(x=-d[0])}for(var z=p.log2(b+1)%o,A=0,y=0;y<o;++y){var j=m[y+1];y!==z&&(A+=j),l[y]=j}var M=e[z],O=s[w+z],E=l[z],F=E,S=E;M<O?S=Math.max(E,Math.pow(O-M,2)):F=Math.max(E,Math.pow(O-M,2));var T=F+A,B=S+A;if(v.pop(),T<x){var C=2*b+1;if(C<n){var q=v.count;g[q]=C;var N=q*(o+1);m[N]=T;for(var y=1;y<=o;++y)m[N+y]=l[y-1];m[N+z+1]=F,v.push()}}if(B<x){var P=2*(b+1);if(P<n){var q=v.count;g[q]=P;var N=q*(o+1);m[N]=B;for(var y=1;y<=o;++y)m[N+y]=l[y-1];m[N+z+1]=S,v.push()}}}f.freeFloat64(l),v.dispose();for(var I=new Array(u.count),a=this.ids,y=u.count-1;y>=0;--y)I[y]=a[c[0]],u.pop();return u.dispose(),I},v.dispose=function(){f.free(this.points.data),f.freeInt32(this.ids),this.points=null,this.ids=null,this.length=0}},{"./lib/heap.js":10,"bit-twiddle":11,"inorder-tree-layout":12,ndarray:27,"ndarray-ops":14,"ndarray-pack":19,"ndarray-scratch":25,"ndarray-select":26,"typedarray-pool":31}],10:[function(e,t,r){"use strict";function n(e){return 1&e?e-1>>1:(e>>1)-1}function a(e,t){this.count=0,this.dataSize=t,this.index=o.mallocInt32(e),this.data=o.mallocFloat64(e*t)}t.exports=a;var o=e("typedarray-pool"),i=a.prototype;i.heapSwap=function(e,t){var r=this.data,n=this.index,a=this.dataSize,o=n[e];n[e]=n[t],n[t]=o;for(var i=a*e,s=a*t,l=0;l<a;++l){var u=r[i];r[i]=r[s],r[s]=u,i+=1,s+=1}},i.heapUp=function(e){for(var t=this.dataSize,r=(this.index,this.data),a=r[t*e];e>0;){var o=n(e);if(o>=0){var i=r[t*o];if(a<i){this.heapSwap(e,o),e=o;continue}}break}},i.heapDown=function(e){for(var t=this.dataSize,r=(this.index,this.data),n=this.count,a=r[t*e];;){var o=a,i=2*e+1,s=2*(e+1),l=e;if(i<n){var u=r[t*i];u<o&&(l=i,o=u)}if(s<n){var c=r[t*s];c<o&&(l=s)}if(l===e)break;this.heapSwap(e,l),e=l}},i.pop=function(){this.count-=1,this.heapSwap(0,this.count),this.heapDown(0)},i.push=function(){this.heapUp(this.count),this.count+=1},i.dispose=function(){o.freeInt32(this.index),o.freeFloat64(this.data)}},{"typedarray-pool":31}],11:[function(e,t,r){"use strict";"use restrict";function n(e){var t=32;return e&=-e,e&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}var a=32;r.INT_BITS=a,r.INT_MAX=2147483647,r.INT_MIN=-1<<a-1,r.sign=function(e){return(e>0)-(e<0)},r.abs=function(e){var t=e>>a-1;return(e^t)-t},r.min=function(e,t){return t^(e^t)&-(e<t)},r.max=function(e,t){return e^(e^t)&-(e<t)},r.isPow2=function(e){return!(e&e-1||!e)},r.log2=function(e){var t,r;return t=(e>65535)<<4,e>>>=t,r=(e>255)<<3,e>>>=r,t|=r,r=(e>15)<<2,e>>>=r,t|=r,r=(e>3)<<1,e>>>=r,t|=r,t|e>>1},r.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},r.popCount=function(e){return e-=e>>>1&1431655765,e=(858993459&e)+(e>>>2&858993459),16843009*(e+(e>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1},r.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e-(e>>>1)},r.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,e&=15,27030>>>e&1};var o=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,a=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--a;e[t]=n<<a&255}}(o),r.reverse=function(e){return o[255&e]<<24|o[e>>>8&255]<<16|o[e>>>16&255]<<8|o[e>>>24&255]},r.interleave2=function(e,t){return e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1},r.deinterleave2=function(e,t){return e=e>>>t&1431655765,e=858993459&(e|e>>>1),e=252645135&(e|e>>>2),e=16711935&(e|e>>>4),e=65535&(e|e>>>16),e<<16>>16},r.interleave3=function(e,t,r){return e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e|=t<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),e|r<<2},r.deinterleave3=function(e,t){return e=e>>>t&1227133513,e=3272356035&(e|e>>>2),e=251719695&(e|e>>>4),e=4278190335&(e|e>>>8),e=1023&(e|e>>>16),e<<22>>22},r.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>n(e)+1}},{}],12:[function(e,t,r){"use strict";function n(e){var t=(v.nextPow2(e+1)>>>1)-1,r=e-t;return v.nextPow2(r)-1>=t?t:(t>>>1)+r}function a(e){return 0}function o(e){return e-1}function i(e,t){if(e<=0)return 0;var r=n(e);return t>r?i(e-r-1,t-r-1):t===r?v.log2(e):i(r,t)}function s(e,t){return Math.max(t-1,0)}function l(e,t){return Math.min(t+1,e-1)}function u(e,t){if(e<=0)return-1;var r=n(e);if(t>r){var a=u(e-r-1,t-r-1);return a<0?r:a+r+1}if(t===r)return-1;var a=u(r,t);return a<0?r:a}function c(e,t){if(e<=0)return 0;var r=n(e);return t>r?c(e-r-1,t-r-1)+r+1:t===r?n(t):c(r,t)}function f(e,t){if(e<=0)return 0;var r=n(e);return t>r?f(e-r-1,t-r-1)+r+1:t===r?n(e-r-1)+r+1:f(r,t)}function d(e,t){return 0===i(e,t)}function p(e,t){e|=0,t|=0;for(var r=0;e>1;){var a=n(e);if(t>a)r+=a+1,e-=a+1,t-=a+1;else{if(t===a)break;e=a}}return r}function h(e,t){e|=0,t|=0;for(var r=0;e>1;){var a=n(e);if(t>a)r+=a+1,e-=a+1,t-=a+1;else{if(t===a){r+=e-1;break}e=a}}return r}var v=e("bit-twiddle");r.root=n,r.begin=a,r.end=o,r.height=i,r.prev=s,r.next=l,r.parent=u,r.left=c,r.right=f,r.leaf=d,r.lo=p,r.hi=h},{"bit-twiddle":13}],13:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],14:[function(e,t,r){"use strict";function n(e){if(!e)return s;for(var t=0;t<e.args.length;++t){var r=e.args[t];0===t?e.args[t]={name:r,lvalue:!0,rvalue:!!e.rvalue,count:e.count||1}:e.args[t]={name:r,lvalue:!1,rvalue:!0,count:1}}return e.thisVars||(e.thisVars=[]),e.localVars||(e.localVars=[]),e}function a(e){return i({args:e.args,pre:n(e.pre),body:n(e.body),post:n(e.proc),funcName:e.funcName})}function o(e){for(var t=[],r=0;r<e.args.length;++r)t.push("a"+r);var n=new Function("P",["return function ",e.funcName,"_ndarrayops(",t.join(","),") {P(",t.join(","),");return a0}"].join(""));return n(a(e))}var i=e("cwise-compiler"),s={body:"",args:[],thisVars:[],localVars:[]},l={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};!function(){for(var e in l){var t=l[e];r[e]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+t+"c"},funcName:e}),r[e+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+t+"=b"},rvalue:!0,funcName:e+"eq"}),r[e+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+t+"s"},funcName:e+"s"}),r[e+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+t+"=s"},rvalue:!0,funcName:e+"seq"})}}();var u={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var e in u){var t=u[e];r[e]=o({args:["array","array"],body:{args:["a","b"],body:"a="+t+"b"},funcName:e}),r[e+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+t+"a"},rvalue:!0,count:2,funcName:e+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var e in c){var t=c[e];r[e]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+t+"c"},funcName:e}),r[e+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+t+"s"},funcName:e+"s"}),r[e+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+t+"b"},rvalue:!0,count:2,funcName:e+"eq"}),r[e+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+t+"s"},rvalue:!0,count:2,funcName:e+"seq"})}}();var f=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var e=0;e<f.length;++e){var t=f[e];r[t]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:t}),r[t+"eq"]=o({args:["array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"eq"})}}();var d=["max","min","atan2","pow"];!function(){for(var e=0;e<d.length;++e){var t=d[e];r[t]=o({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:t}),r[t+"s"]=o({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:t+"s"}),r[t+"eq"]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=o({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"seq"})}}();var p=["atan2","pow"];!function(){for(var e=0;e<p.length;++e){var t=p[e];r[t+"op"]=o({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:t+"op"}),r[t+"ops"]=o({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:t+"ops"}),r[t+"opeq"]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"opeq"}),r[t+"opseq"]=o({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"opseq"})}}(),r.any=i({args:["array"],pre:s,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"}),r.all=i({args:["array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"}),r.sum=i({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"}),r.prod=i({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"}),r.norm2squared=i({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"}),r.norm2=i({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"}),r.norminf=i({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=i({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=i({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=i({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.argmin=i({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.argmax=i({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=o({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=o({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=o({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=i({args:["array","array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":15}],15:[function(e,t,r){"use strict";function n(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function a(e){var t=new n;t.pre=e.pre,t.body=e.body,t.post=e.post;var r=e.args.slice(0);t.argTypes=r;for(var a=0;a<r.length;++a){var i=r[a];if("array"===i||"object"==typeof i&&i.blockIndices){if(t.argTypes[a]="array",t.arrayArgs.push(a),t.arrayBlockIndices.push(i.blockIndices?i.blockIndices:0),t.shimArgs.push("array"+a),a<t.pre.args.length&&t.pre.args[a].count>0)throw new Error("cwise: pre() block may not reference array args");if(a<t.post.args.length&&t.post.args[a].count>0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===i)t.scalarArgs.push(a),t.shimArgs.push("scalar"+a);else if("index"===i){if(t.indexArgs.push(a),a<t.pre.args.length&&t.pre.args[a].count>0)throw new Error("cwise: pre() block may not reference array index");if(a<t.body.args.length&&t.body.args[a].lvalue)throw new Error("cwise: body() block may not write to array index");if(a<t.post.args.length&&t.post.args[a].count>0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===i){if(t.shapeArgs.push(a),a<t.pre.args.length&&t.pre.args[a].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(a<t.body.args.length&&t.body.args[a].lvalue)throw new Error("cwise: body() block may not write to array shape");if(a<t.post.args.length&&t.post.args[a].lvalue)throw new Error("cwise: post() block may not write to array shape")}else{if("object"!=typeof i||!i.offset)throw new Error("cwise: Unknown argument type "+r[a]);t.argTypes[a]="offset",t.offsetArgs.push({array:i.array,offset:i.offset}),t.offsetArgIndex.push(a)}}if(t.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(t.pre.args.length>r.length)throw new Error("cwise: Too many arguments in pre() block");if(t.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(t.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return t.debug=!!e.printCode||!!e.debug,t.funcName=e.funcName||"cwise",t.blockSize=e.blockSize||64,o(t)}var o=e("./lib/thunk.js");t.exports=a},{"./lib/thunk.js":17}],16:[function(e,t,r){"use strict";function n(e,t,r){var n,a,o=e.length,i=t.arrayArgs.length,s=t.indexArgs.length>0,l=[],u=[],c=0,f=0;for(n=0;n<o;++n)u.push(["i",n,"=0"].join(""));for(a=0;a<i;++a)for(n=0;n<o;++n)f=c,c=e[n],0===n?u.push(["d",a,"s",n,"=t",a,"p",c].join("")):u.push(["d",a,"s",n,"=(t",a,"p",c,"-s",f,"*t",a,"p",f,")"].join(""));for(l.push("var "+u.join(",")),n=o-1;n>=0;--n)c=e[n],l.push(["for(i",n,"=0;i",n,"<s",c,";++i",n,"){"].join(""));for(l.push(r),n=0;n<o;++n){for(f=c,c=e[n],a=0;a<i;++a)l.push(["p",a,"+=d",a,"s",n].join(""));s&&(n>0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",c,"]"].join(""))),l.push("}")}return l.join("\n")}function a(e,t,r,a){for(var o=t.length,i=r.arrayArgs.length,s=r.blockSize,l=r.indexArgs.length>0,u=[],c=0;c<i;++c)u.push(["var offset",c,"=p",c].join(""));for(var c=e;c<o;++c)u.push(["for(var j"+c+"=SS[",t[c],"]|0;j",c,">0;){"].join("")),u.push(["if(j",c,"<",s,"){"].join("")),u.push(["s",t[c],"=j",c].join("")),u.push(["j",c,"=0"].join("")),u.push(["}else{s",t[c],"=",s].join("")),u.push(["j",c,"-=",s,"}"].join("")),l&&u.push(["index[",t[c],"]=j",c].join(""));for(var c=0;c<i;++c){for(var f=["offset"+c],d=e;d<o;++d)f.push(["j",d,"*t",c,"p",t[d]].join(""));u.push(["p",c,"=(",f.join("+"),")"].join(""))}u.push(n(t,r,a));for(var c=e;c<o;++c)u.push("}");return u.join("\n")}function o(e){for(var t=0,r=e[0].length;t<r;){for(var n=1;n<e.length;++n)if(e[n][t]!==e[0][t])return t;++t}return t}function i(e,t,r){for(var n=e.body,a=[],o=[],i=0;i<e.args.length;++i){var s=e.args[i];if(!(s.count<=0)){var l=new RegExp(s.name,"g"),u="",c=t.arrayArgs.indexOf(i);switch(t.argTypes[i]){case"offset":var f=t.offsetArgIndex.indexOf(i),d=t.offsetArgs[f];c=d.array,u="+q"+f;case"array":u="p"+c+u;var p="l"+i,h="a"+c;if(0===t.arrayBlockIndices[c])1===s.count?"generic"===r[c]?s.lvalue?(a.push(["var ",p,"=",h,".get(",u,")"].join("")),n=n.replace(l,p),o.push([h,".set(",u,",",p,")"].join(""))):n=n.replace(l,[h,".get(",u,")"].join("")):n=n.replace(l,[h,"[",u,"]"].join("")):"generic"===r[c]?(a.push(["var ",p,"=",h,".get(",u,")"].join("")),n=n.replace(l,p),s.lvalue&&o.push([h,".set(",u,",",p,")"].join(""))):(a.push(["var ",p,"=",h,"[",u,"]"].join("")),n=n.replace(l,p),s.lvalue&&o.push([h,"[",u,"]=",p].join("")));else{for(var v=[s.name],g=[u],m=0;m<Math.abs(t.arrayBlockIndices[c]);m++)v.push("\\s*\\[([^\\]]+)\\]"),g.push("$"+(m+1)+"*t"+c+"b"+m);if(l=new RegExp(v.join(""),"g"),u=g.join("+"),"generic"===r[c])throw new Error("cwise: Generic arrays not supported in combination with blocks!");n=n.replace(l,[h,"[",u,"]"].join(""))}break;case"scalar":n=n.replace(l,"Y"+t.scalarArgs.indexOf(i));break;case"index":n=n.replace(l,"index");break;case"shape":n=n.replace(l,"shape")}}}return[a.join("\n"),n,o.join("\n")].join("\n").trim()}function s(e){for(var t=new Array(e.length),r=!0,n=0;n<e.length;++n){var a=e[n],o=a.match(/\d+/);o=o?o[0]:"",0===a.charAt(0)?t[n]="u"+a.charAt(1)+o:t[n]=a.charAt(0)+o,n>0&&(r=r&&t[n]===t[n-1])}return r?t[0]:t.join("")}function l(e,t){for(var r=t[1].length-Math.abs(e.arrayBlockIndices[0])|0,l=new Array(e.arrayArgs.length),c=new Array(e.arrayArgs.length),f=0;f<e.arrayArgs.length;++f)c[f]=t[2*f],l[f]=t[2*f+1];for(var d=[],p=[],h=[],v=[],g=[],f=0;f<e.arrayArgs.length;++f){e.arrayBlockIndices[f]<0?(h.push(0),v.push(r),d.push(r),p.push(r+e.arrayBlockIndices[f])):(h.push(e.arrayBlockIndices[f]),v.push(e.arrayBlockIndices[f]+r),d.push(0),p.push(e.arrayBlockIndices[f]));for(var m=[],y=0;y<l[f].length;y++)h[f]<=l[f][y]&&l[f][y]<v[f]&&m.push(l[f][y]-h[f]);g.push(m)}for(var x=["SS"],b=["'use strict'"],w=[],y=0;y<r;++y)w.push(["s",y,"=SS[",y,"]"].join(""));for(var f=0;f<e.arrayArgs.length;++f){x.push("a"+f),x.push("t"+f),x.push("p"+f);for(var y=0;y<r;++y)w.push(["t",f,"p",y,"=t",f,"[",h[f]+y,"]"].join(""));for(var y=0;y<Math.abs(e.arrayBlockIndices[f]);++y)w.push(["t",f,"b",y,"=t",f,"[",d[f]+y,"]"].join(""))}for(var f=0;f<e.scalarArgs.length;++f)x.push("Y"+f);if(e.shapeArgs.length>0&&w.push("shape=SS.slice(0)"),e.indexArgs.length>0){for(var _=new Array(r),f=0;f<r;++f)_[f]="0";w.push(["index=[",_.join(","),"]"].join(""))}for(var f=0;f<e.offsetArgs.length;++f){for(var k=e.offsetArgs[f],z=[],y=0;y<k.offset.length;++y)0!==k.offset[y]&&(1===k.offset[y]?z.push(["t",k.array,"p",y].join("")):z.push([k.offset[y],"*t",k.array,"p",y].join("")));0===z.length?w.push("q"+f+"=0"):w.push(["q",f,"=",z.join("+")].join(""))}var A=u([].concat(e.pre.thisVars).concat(e.body.thisVars).concat(e.post.thisVars));w=w.concat(A),b.push("var "+w.join(","));for(var f=0;f<e.arrayArgs.length;++f)b.push("p"+f+"|=0");e.pre.body.length>3&&b.push(i(e.pre,e,c));var j=i(e.body,e,c),M=o(g);M<r?b.push(a(M,g[0],e,j)):b.push(n(g[0],e,j)),e.post.body.length>3&&b.push(i(e.post,e,c)),e.debug&&console.log("-----Generated cwise routine for ",t,":\n"+b.join("\n")+"\n----------");var O=[e.funcName||"unnamed","_cwise_loop_",l[0].join("s"),"m",M,s(c)].join(""),E=new Function(["function ",O,"(",x.join(","),"){",b.join("\n"),"} return ",O].join(""));return E()}var u=e("uniq");t.exports=l},{uniq:18}],17:[function(e,t,r){"use strict";function n(e){var t=["'use strict'","var CACHED={}"],r=[],n=e.funcName+"_cwise_thunk";t.push(["return function ",n,"(",e.shimArgs.join(","),"){"].join(""));for(var o=[],i=[],s=[["array",e.arrayArgs[0],".shape.slice(",Math.max(0,e.arrayBlockIndices[0]),e.arrayBlockIndices[0]<0?","+e.arrayBlockIndices[0]+")":")"].join("")],l=[],u=[],c=0;c<e.arrayArgs.length;++c){var f=e.arrayArgs[c];r.push(["t",f,"=array",f,".dtype,","r",f,"=array",f,".order"].join("")),o.push("t"+f),o.push("r"+f),i.push("t"+f),i.push("r"+f+".join()"),s.push("array"+f+".data"),s.push("array"+f+".stride"),s.push("array"+f+".offset|0"),c>0&&(l.push("array"+e.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(e.arrayBlockIndices[0])-Math.abs(e.arrayBlockIndices[c]))),u.push("array"+e.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,e.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,e.arrayBlockIndices[c])+"]"))}e.arrayArgs.length>1&&(t.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),t.push("for(var shapeIndex=array"+e.arrayArgs[0]+".shape.length-"+Math.abs(e.arrayBlockIndices[0])+"; shapeIndex-->0;) {"),t.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),t.push("}"));for(var c=0;c<e.scalarArgs.length;++c)s.push("scalar"+e.scalarArgs[c]);r.push(["type=[",i.join(","),"].join()"].join("")),r.push("proc=CACHED[type]"),t.push("var "+r.join(",")),t.push(["if(!proc){","CACHED[type]=proc=compile([",o.join(","),"])}","return proc(",s.join(","),")}"].join("")),e.debug&&console.log("-----Generated thunk:\n"+t.join("\n")+"\n----------");var d=new Function("compile",t.join("\n"));return d(a.bind(void 0,e))}var a=e("./compile.js");t.exports=n},{"./compile.js":16}],18:[function(e,t,r){"use strict";function n(e,t){for(var r=1,n=e.length,a=e[0],o=e[0],i=1;i<n;++i)if(o=a,a=e[i],t(a,o)){if(i===r){r++;continue}e[r++]=a}return e.length=r,e}function a(e){for(var t=1,r=e.length,n=e[0],a=e[0],o=1;o<r;++o,a=n)if(a=n,n=e[o],n!==a){if(o===t){t++;continue}e[t++]=n}return e.length=t,e}function o(e,t,r){return 0===e.length?e:t?(r||e.sort(t),n(e,t)):(r||e.sort(),a(e))}t.exports=o},{}],19:[function(e,t,r){"use strict";var n=e("ndarray"),a=e("./doConvert.js");t.exports=function(e,t){for(var r=[],o=e,i=1;o instanceof Array;)r.push(o.length),i*=o.length,o=o[0];return 0===r.length?n():(t||(t=n(new Float64Array(i),r)),a(t,e),t)}},{"./doConvert.js":20,ndarray:27}],20:[function(e,t,r){t.exports=e("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":21}],21:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./lib/thunk.js":23,dup:15}],22:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{dup:16,uniq:24}],23:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{"./compile.js":22,dup:17}],24:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{dup:18}],25:[function(e,t,r){"use strict";function n(e){var t=e.dtype;"generic"!==t&&"array"!==t||(t="double");var r=f.malloc(e.size,t),n=u(r,e.shape);return c.assign(n,e),n}function a(e,t){t||(t="double");for(var r=1,n=new Array(e.length),a=e.length-1;a>=0;--a)n[a]=r,r*=e[a];return u(f.malloc(r,t),e,n,0)}function o(e){"generic"!==e.dtype&&"array"!==e.dtype&&f.free(e.data)}function i(e,t){t||(t="double");for(var r=1,n=new Array(e.length),a=e.length-1;a>=0;--a)n[a]=r,r*=e[a];for(var o=f.malloc(r,t),a=0;a<r;++a)o[a]=0;return u(o,e,n,0)}function s(e,t){t||(t="double");for(var r=1,n=new Array(e.length),a=e.length-1;a>=0;--a)n[a]=r,r*=e[a];for(var o=f.malloc(r,t),a=0;a<r;++a)o[a]=1;return u(o,e,n,0)}function l(e,t){var r,n;t||(t="double");var a=1,o=new Array(e.length);for(r=e.length-1;r>=0;--r)o[r]=a,a*=e[r];var i=f.malloc(a,t);for(r=0;r<a;++r)i[r]=0;var s=1/0,l=0;for(r=e.length-1;r>=0;r--)l+=o[r],s=Math.min(s,e[r]); | |
| for(r=0,n=0;r<s;r++,n+=l)i[n]=1;return u(i,e,o,0)}var u=e("ndarray"),c=e("ndarray-ops"),f=e("typedarray-pool");r.clone=n,r.malloc=a,r.free=o,r.zeros=i,r.ones=s,r.eye=l},{ndarray:27,"ndarray-ops":14,"typedarray-pool":31}],26:[function(e,t,r){"use strict";function n(e){return"s"+e}function a(e){return"t"+e}function o(e){return"u"+e}function i(e){return"v"+e}function s(e){return"i"+e}function l(e){return"p"+e}function u(e){return"x"+e}function c(e){var t=e.slice();return t.splice(e.indexOf(0),1),t.unshift(0),t}function f(e,t,r){function f(r,o,c){if(t)j.push(l(0),".offset=",y,"+",a(e[0]),"*(",o,");",l(1),".offset=",y,"+",a(e[0]),"*(",c,");",r,"=",g,"(",l(0),",",l(1),");");else{j.push(u(0),"=",y,"+",a(0),"*(",o,");",u(1),"=",y,"+",a(0),"*(",c,");"),p>1&&j.push("_cmp:");for(var f=p-1;f>0;--f)j.push("for(",s(f),"=0;",s(f),"<",n(f),";",s(f),"++){");z?j.push(r,"=",m,".get(",u(0),")-",m,".get(",u(1),");"):j.push(r,"=",m,"[",u(0),"]-",m,"[",u(1),"];"),p>1&&j.push("if(",r,")break _cmp;");for(var f=1;f<p;++f)j.push(u(0),"+=",i(f),";",u(1),"+=",i(f),"}")}}function d(t,r){j.push(u(0),"=",y,"+",a(e[0]),"*(",t,");",u(1),"=",y,"+",a(e[0]),"*(",r,");");for(var i=p-1;i>0;--i)j.push("for(",s(e[i]),"=0;",s(e[i]),"<",n(e[i]),";",s(e[i]),"++){");z?j.push(b,"=",m,".get(",u(0),");",m,".set(",u(0),",",m,".get(",u(1),"));",m,".set(",u(1),",",b,");"):j.push(b,"=",m,"[",u(0),"];",m,"[",u(0),"]=",m,"[",u(1),"];",m,"[",u(1),"]=",b,";");for(var i=1;i<p;++i)j.push(u(0),"+=",o(e[i]),";",u(1),"+=",o(e[i]),"}")}e=c(e);var p=e.length,z="generic"===r,A="ndSelect"+r+e.join("_")+"_"+(t?"cmp":"lex"),j=[],M=[h,v];t&&M.push(g);for(var O=[m+"="+h+".data",y+"="+h+".offset|0",x+"=Math.random",b],E=0;E<2;++E)O.push(u(E)+"=0");for(var E=0;E<p;++E)O.push(n(E)+"="+h+".shape["+E+"]|0",a(E)+"="+h+".stride["+E+"]|0",s(E)+"=0");for(var E=1;E<p;++E)E>1?O.push(i(E)+"=("+a(E)+"-"+n(E-1)+"*"+a(E-1)+")|0",o(e[E])+"=("+a(e[E])+"-"+n(e[E-1])+"*"+a(e[E-1])+")|0"):O.push(i(E)+"="+a(E),o(e[E])+"="+a(e[E]));if(t)for(var E=0;E<2;++E)O.push(l(E)+"="+h+".pick(0)");O.push(k+"=0",w+"=0",_+"="+n(e[0])+"-1"),j.push("while(",w,"<",_,"){",k,"=(",x,"()*(",_,"-",w,"+1)+",w,")|0;"),d(k,_),j.push(k,"=",w,";","for(",s(0),"=",w,";",s(0),"<",_,";",s(0),"++){"),f(b,s(0),_),j.push("if(",b,"<0){"),d(k,s(0)),j.push(k,"++;"),j.push("}}"),d(k,_),j.push("if(",k,"===",v,"){",w,"=",k,";","break;","}else if(",v,"<",k,"){",_,"=",k,"-1;","}else{",w,"=",k,"+1;","}","}"),t?j.push(l(0),".offset=",y,"+",w,"*",a(0),";","return ",l(0),";"):j.push("return ",h,".pick(",w,");");var F=["'use strict';function ",A,"(",M,"){","var ",O.join(),";",j.join(""),"};return ",A].join(""),S=new Function(F);return S()}function d(e,t,r){var n=e.join()+t+r,a=z[n];return a?a:z[n]=f(e,t,r)}function p(e,t,r){if(t|=0,0===e.dimension||e.shape[0]<=t||t<0)return null;var n=!!r,a=d(e.order,n,e.dtype);return n?a(e,t,r):a(e,t)}t.exports=p,t.exports.compile=d;var h="a",v="K",g="C",m="d",y="o",x="R",b="T",w="L",_="H",k="X",z={}},{}],27:[function(e,t,r){function n(e,t){return e[0]-t[0]}function a(){var e,t=this.stride,r=new Array(t.length);for(e=0;e<r.length;++e)r[e]=[Math.abs(t[e]),e];r.sort(n);var a=new Array(r.length);for(e=0;e<a.length;++e)a[e]=r[e][1];return a}function o(e,t){var r=["View",t,"d",e].join("");t<0&&(r="View_Nil"+e);var n="generic"===e;if(t===-1){var o="function "+r+"(a){this.data=a;};var proto="+r+".prototype;proto.dtype='"+e+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+r+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+r+"(a){return new "+r+"(a);}",i=new Function(o);return i()}if(0===t){var o="function "+r+"(a,d) {this.data = a;this.offset = d};var proto="+r+".prototype;proto.dtype='"+e+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+r+"_copy() {return new "+r+"(this.data,this.offset)};proto.pick=function "+r+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+r+"_get(){return "+(n?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+r+"_set(v){return "+(n?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+r+"(a,b,c,d){return new "+r+"(a,d)}",i=new Function("TrivialArray",o);return i(f[e][0])}var o=["'use strict'"],s=l(t),u=s.map(function(e){return"i"+e}),c="this.offset+"+s.map(function(e){return"this.stride["+e+"]*i"+e}).join("+"),d=s.map(function(e){return"b"+e}).join(","),p=s.map(function(e){return"c"+e}).join(",");o.push("function "+r+"(a,"+d+","+p+",d){this.data=a","this.shape=["+d+"]","this.stride=["+p+"]","this.offset=d|0}","var proto="+r+".prototype","proto.dtype='"+e+"'","proto.dimension="+t),o.push("Object.defineProperty(proto,'size',{get:function "+r+"_size(){return "+s.map(function(e){return"this.shape["+e+"]"}).join("*"),"}})"),1===t?o.push("proto.order=[0]"):(o.push("Object.defineProperty(proto,'order',{get:"),t<4?(o.push("function "+r+"_order(){"),2===t?o.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===t&&o.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):o.push("ORDER})")),o.push("proto.set=function "+r+"_set("+u.join(",")+",v){"),n?o.push("return this.data.set("+c+",v)}"):o.push("return this.data["+c+"]=v}"),o.push("proto.get=function "+r+"_get("+u.join(",")+"){"),n?o.push("return this.data.get("+c+")}"):o.push("return this.data["+c+"]}"),o.push("proto.index=function "+r+"_index(",u.join(),"){return "+c+"}"),o.push("proto.hi=function "+r+"_hi("+u.join(",")+"){return new "+r+"(this.data,"+s.map(function(e){return["(typeof i",e,"!=='number'||i",e,"<0)?this.shape[",e,"]:i",e,"|0"].join("")}).join(",")+","+s.map(function(e){return"this.stride["+e+"]"}).join(",")+",this.offset)}");var h=s.map(function(e){return"a"+e+"=this.shape["+e+"]"}),v=s.map(function(e){return"c"+e+"=this.stride["+e+"]"});o.push("proto.lo=function "+r+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+h.join(",")+","+v.join(","));for(var g=0;g<t;++g)o.push("if(typeof i"+g+"==='number'&&i"+g+">=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");o.push("return new "+r+"(this.data,"+s.map(function(e){return"a"+e}).join(",")+","+s.map(function(e){return"c"+e}).join(",")+",b)}"),o.push("proto.step=function "+r+"_step("+u.join(",")+"){var "+s.map(function(e){return"a"+e+"=this.shape["+e+"]"}).join(",")+","+s.map(function(e){return"b"+e+"=this.stride["+e+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var g=0;g<t;++g)o.push("if(typeof i"+g+"==='number'){d=i"+g+"|0;if(d<0){c+=b"+g+"*(a"+g+"-1);a"+g+"=ceil(-a"+g+"/d)}else{a"+g+"=ceil(a"+g+"/d)}b"+g+"*=d}");o.push("return new "+r+"(this.data,"+s.map(function(e){return"a"+e}).join(",")+","+s.map(function(e){return"b"+e}).join(",")+",c)}");for(var m=new Array(t),y=new Array(t),g=0;g<t;++g)m[g]="a[i"+g+"]",y[g]="b[i"+g+"]";o.push("proto.transpose=function "+r+"_transpose("+u+"){"+u.map(function(e,t){return e+"=("+e+"===undefined?"+t+":"+e+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+r+"(this.data,"+m.join(",")+","+y.join(",")+",this.offset)}"),o.push("proto.pick=function "+r+"_pick("+u+"){var a=[],b=[],c=this.offset");for(var g=0;g<t;++g)o.push("if(typeof i"+g+"==='number'&&i"+g+">=0){c=(c+this.stride["+g+"]*i"+g+")|0}else{a.push(this.shape["+g+"]);b.push(this.stride["+g+"])}");o.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),o.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(e){return"shape["+e+"]"}).join(",")+","+s.map(function(e){return"stride["+e+"]"}).join(",")+",offset)}");var i=new Function("CTOR_LIST","ORDER",o.join("\n"));return i(f[e],a)}function i(e){if(u(e))return"buffer";if(c)switch(Object.prototype.toString.call(e)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped"}return Array.isArray(e)?"array":"generic"}function s(e,t,r,n){if(void 0===e){var a=f.array[0];return a([])}"number"==typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var s=t.length;if(void 0===r){r=new Array(s);for(var l=s-1,u=1;l>=0;--l)r[l]=u,u*=t[l]}if(void 0===n){n=0;for(var l=0;l<s;++l)r[l]<0&&(n-=(t[l]-1)*r[l])}for(var c=i(e),d=f[c];d.length<=s+1;)d.push(o(c,d.length-1));var a=d[s+1];return a(e,t,r,n)}var l=e("iota-array"),u=e("is-buffer"),c="undefined"!=typeof Float64Array,f={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};t.exports=s},{"iota-array":28,"is-buffer":29}],28:[function(e,t,r){"use strict";function n(e){for(var t=new Array(e),r=0;r<e;++r)t[r]=r;return t}t.exports=n},{}],29:[function(e,t,r){t.exports=function(e){return!(null==e||!(e._isBuffer||e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)))}},{}],30:[function(e,t,r){"use strict";function n(e,t,r){var a=0|e[r];if(a<=0)return[];var o,i=new Array(a);if(r===e.length-1)for(o=0;o<a;++o)i[o]=t;else for(o=0;o<a;++o)i[o]=n(e,t,r+1);return i}function a(e,t){var r,n;for(r=new Array(e),n=0;n<e;++n)r[n]=t;return r}function o(e,t){switch("undefined"==typeof t&&(t=0),typeof e){case"number":if(e>0)return a(0|e,t);break;case"object":if("number"==typeof e.length)return n(e,t,0)}return[]}t.exports=o},{}],31:[function(e,t,r){(function(t,n){"use strict";function a(e){if(e){var t=e.length||e.byteLength,r=y.log2(t);_[r].push(e)}}function o(e){a(e.buffer)}function i(e){var e=y.nextPow2(e),t=y.log2(e),r=_[t];return r.length>0?r.pop():new ArrayBuffer(e)}function s(e){return new Uint8Array(i(e),0,e)}function l(e){return new Uint16Array(i(2*e),0,e)}function u(e){return new Uint32Array(i(4*e),0,e)}function c(e){return new Int8Array(i(e),0,e)}function f(e){return new Int16Array(i(2*e),0,e)}function d(e){return new Int32Array(i(4*e),0,e)}function p(e){return new Float32Array(i(4*e),0,e)}function h(e){return new Float64Array(i(8*e),0,e)}function v(e){return b?new Uint8ClampedArray(i(e),0,e):s(e)}function g(e){return new DataView(i(e),0,e)}function m(e){e=y.nextPow2(e);var t=y.log2(e),r=k[t];return r.length>0?r.pop():new n(e)}var y=e("bit-twiddle"),x=e("dup");t.__TYPEDARRAY_POOL||(t.__TYPEDARRAY_POOL={UINT8:x([32,0]),UINT16:x([32,0]),UINT32:x([32,0]),INT8:x([32,0]),INT16:x([32,0]),INT32:x([32,0]),FLOAT:x([32,0]),DOUBLE:x([32,0]),DATA:x([32,0]),UINT8C:x([32,0]),BUFFER:x([32,0])});var b="undefined"!=typeof Uint8ClampedArray,w=t.__TYPEDARRAY_POOL;w.UINT8C||(w.UINT8C=x([32,0])),w.BUFFER||(w.BUFFER=x([32,0]));var _=w.DATA,k=w.BUFFER;r.free=function(e){if(n.isBuffer(e))k[y.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var t=e.length||e.byteLength,r=0|y.log2(t);_[r].push(e)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=o,r.freeArrayBuffer=a,r.freeBuffer=function(e){k[y.log2(e.length)].push(e)},r.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return i(e);switch(t){case"uint8":return s(e);case"uint16":return l(e);case"uint32":return u(e);case"int8":return c(e);case"int16":return f(e);case"int32":return d(e);case"float":case"float32":return p(e);case"double":case"float64":return h(e);case"uint8_clamped":return v(e);case"buffer":return m(e);case"data":case"dataview":return g(e);default:return null}return null},r.mallocArrayBuffer=i,r.mallocUint8=s,r.mallocUint16=l,r.mallocUint32=u,r.mallocInt8=c,r.mallocInt16=f,r.mallocInt32=d,r.mallocFloat32=r.mallocFloat=p,r.mallocFloat64=r.mallocDouble=h,r.mallocUint8Clamped=v,r.mallocDataView=g,r.mallocBuffer=m,r.clearCache=function(){for(var e=0;e<32;++e)w.UINT8[e].length=0,w.UINT16[e].length=0,w.UINT32[e].length=0,w.INT8[e].length=0,w.INT16[e].length=0,w.INT32[e].length=0,w.FLOAT[e].length=0,w.DOUBLE[e].length=0,w.UINT8C[e].length=0,_[e].length=0,k[e].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"bit-twiddle":11,buffer:2,dup:30}],32:[function(e,t,r){var n;n=e("../color/sort.coffee"),t.exports=function(e,t,r,a,o,i,s){var l,u,c;for(a||(a="asc"),o instanceof Array||(o=[o]),r instanceof Array||(r=[r]),i&&void 0!==s&&"number"!=typeof s&&(s=i.id.nesting.indexOf(s)),c=0,l=0;l<r.length&&(u=r[l],e=i&&e.d3plus&&e.d3plus.sortKeys?e.d3plus.sortKeys[u]:e[u],t=i&&t.d3plus&&t.d3plus.sortKeys?t.d3plus.sortKeys[u]:t[u],c=i&&o.indexOf(u)>=0?n(e,t):e<t?-1:1,0===c&&l!==r.length-1);)l++;return"asc"===a?c:-c}},{"../color/sort.coffee":49}],33:[function(e,t,r){t.exports=function(e,t){var r;return e instanceof Array&&(r=void 0===t||null===t?t:t.constructor,e.indexOf(t)>=0||e.indexOf(r)>=0)}},{}],34:[function(e,t,r){var n,a;n=e("./comparator.coffee"),a=e("../core/fetch/sort.coffee"),t.exports=function(e,t,r,o,i,s){var l,u,c,f;if(!e||e.length<=1)return e||[];if(i)for(t||(t=i.order.value||i.size.value||i.id.value),r||(r=i.order.sort.value),o||(o=i.color.value||[]),c=0,f=e.length;c<f;c++)l=e[c],l.d3plus||(l.d3plus={}),u="d3plus"in l&&"d3plus"in l.d3plus?l.d3plus:l,l.d3plus.sortKeys=a(i,u,t,o,s);return e.sort(function(e,a){return n(e,a,t,r,o,i,s)})}},{"../core/fetch/sort.coffee":65,"./comparator.coffee":32}],35:[function(e,t,r){t.exports=function(e,t){return void 0===t?e:t===!1?[]:t instanceof Array?t:(e instanceof Array||(e=[]),e.indexOf(t)>=0?e.splice(e.indexOf(t),1):e.push(t),e)}},{}],36:[function(e,t,r){var n;n=function(e){var t,r,a,o;if(o=n.tested,e in o)return o[e];for(r=0,a=!1;r<document.styleSheets.length;){if(t=document.styleSheets[r],t.href&&t.href.indexOf(e)>=0){a=!0;break}r++}return a},n.tested={},t.exports=n},{}],37:[function(e,t,r){t.exports=/(MSIE|Trident\/|Edge\/)/i.test(navigator.userAgent)},{}],38:[function(e,t,r){var n,a;n=e("./ie.js"),a=e("./touch.coffee"),a?t.exports={click:"click",down:"touchstart",up:"touchend",over:n?"mouseenter":"mouseover",out:n?"mouseleave":"mouseout",move:"mousemove"}:t.exports={click:"click",down:"mousedown",up:"mouseup",over:n?"mouseenter":"mouseover",out:n?"mouseleave":"mouseout",move:"mousemove"}},{"./ie.js":37,"./touch.coffee":43}],39:[function(e,t,r){var n;n=function(){var e;return e="-webkit-transform"in document.body.style?"-webkit-":"-moz-transform"in document.body.style?"-moz-":"-ms-transform"in document.body.style?"-ms-":"-o-transform"in document.body.style?"-o-":"",n=function(){return e},e},t.exports=n},{}],40:[function(e,t,r){t.exports="rtl"===d3.select("html").attr("dir")},{}],41:[function(e,t,r){t.exports={y:function(){return void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop},x:function(){return void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft}}},{}],42:[function(e,t,r){var n;n=function(){var e,t,r,a,o;return e=document.createElement("p"),e.style.width="100%",e.style.height="200px",t=document.createElement("div"),t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),document.body.appendChild(t),a=e.offsetWidth,t.style.overflow="scroll",o=e.offsetWidth,a===o&&(o=t.clientWidth),document.body.removeChild(t),r=a-o,n=function(){return r},r},t.exports=n},{}],43:[function(e,t,r){t.exports=!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)},{}],44:[function(e,t,r){t.exports=function(e){var t;return t=d3.hsl(e),t.l>.45&&(t.s>.8&&(t.s=.8),t.l=.45),t.toString()}},{}],45:[function(e,t,r){t.exports=function(e,t){var r;return void 0===t&&(t=.5),r=d3.hsl(e),t=(1-r.l)*t,r.l+=t,r.s-=t,r.toString()}},{}],46:[function(e,t,r){t.exports=function(e,t,r,n){var a,o,i;return r||(r=1),n||(n=1),e=d3.rgb(e),t=d3.rgb(t),i=(r*e.r+n*t.r-r*n*t.r)/(r+n-r*n),o=(r*e.g+n*t.g-r*n*t.g)/(r+n-r*n),a=(r*e.b+n*t.b-r*n*t.b)/(r+n-r*n),d3.rgb(i,o,a).toString()}},{}],47:[function(e,t,r){var n;n=e("./scale.coffee"),t.exports=function(e,t){var r;return r=e||Math.floor(20*Math.random()),(t=t||n)(r)}},{"./scale.coffee":48}],48:[function(e,t,r){t.exports=d3.scale.ordinal().range(["#b22200","#282F6B","#EACE3F","#B35C1E","#224F20","#5F487C","#759143","#419391","#993F88","#e89c89","#ffee8d","#afd5e8","#f7ba77","#a5c697","#c5b5e5","#d1d392","#bbefd0","#e099cf"])},{}],49:[function(e,t,r){t.exports=function(e,t){var r,n;return r=d3.hsl(e),n=d3.hsl(t),e=0===r.s?361:r.h,t=0===n.s?361:n.h,e===t?r.l-n.l:e-t}},{}],50:[function(e,t,r){t.exports=function(e){var t,r,n,a,o;return a=d3.rgb(e),n=a.r,r=a.g,t=a.b,o=(299*n+587*r+114*t)/1e3,o>=128?"#444444":"#f7f7f7"}},{}],51:[function(e,t,r){t.exports=function(e){var t,r,n;return e+="",e=e.replace(RegExp(" ","g"),""),0===e.indexOf("rgb")&&(e=e.split("(")[1].split(")")[0].split(",").slice(0,3).join(",")),0===e.indexOf("hsl")&&(e=e.split(",")[2].split(")")[0]),r=d3.rgb(e).toString(),t=["black","#000","#000000","0%","0,0,0"],n=t.indexOf(e)>=0,"#000000"!==r||n}},{}],52:[function(e,t,r){var n,a,o;n=e("../../client/ie.js"),o=e("./wiki.coffee"),a=function(e,t,r){r=r||"",n||"undefined"!=typeof InstallTrigger?console.log("[ D3plus ] "+t):0===e.indexOf("group")?console[e]("%c[ D3plus ]%c "+t,"font-weight: 800;color: #b35c1e;margin-left: 0px;","font-weight:200;"+r):console[e]("%c"+t,r+"font-weight:200;")},a.comment=function(e){this("log",e,"color:#aaa;")},a.error=function(e,t){this("groupCollapsed","ERROR: "+e,"font-weight:800;color:#D74B03;"),this.stack(),this.wiki(t),this.groupEnd()},a.group=function(e){this("group",e,"color:#888;")},a.groupCollapsed=function(e){this("groupCollapsed",e,"color:#888;")},a.groupEnd=function(){n||console.groupEnd()},a.log=function(e){this("log",e,"color:#444444;")},a.stack=function(){var e,t,r,a,o,i,s;n||(e=new Error,e.stack&&(i=e.stack.split("\n"),i=i.filter(function(e){return 0!==e.indexOf("Error")&&e.indexOf("d3plus.js:")<0&&e.indexOf("d3plus.min.js:")<0}),i.length&&i[0].length&&(o=window.chrome?"at ":"@",s=i[0],s.indexOf(o)>=0&&(s=s.split(o)[1]),i=s.split(":"),3===i.length&&i.pop(),t=i.pop(),a=i.join(":").split("/"),a=a[a.length-1],r="line "+t+" of "+a+": "+s,this("log",r,"color:#D74B03;"))))},a.time=function(e){n||console.time(e)},a.timeEnd=function(e){n||console.timeEnd(e)},a.warning=function(e,t){this("groupCollapsed",e,"color:#888;"),this.stack(),this.wiki(t),this.groupEnd()},a.wiki=function(e){e&&(e in o&&(e=d3plus.repo+"wiki/"+o[e]),this("log","documentation: "+e,"color:#aaa;"))},t.exports=a},{"../../client/ie.js":37,"./wiki.coffee":53}],53:[function(e,t,r){t.exports={active:"Visualizations#active",aggs:"Visualizations#aggs",alt:"Forms#alt",attrs:"Visualizations#attrs",axes:"Visualizations#axes",background:"Visualizations#background",color:"Visualizations#color",cols:"Visualizations#cols",config:"Visualizations#config",container:"Visualizations#container",coords:"Visualizations#coords",csv:"Visualizations#csv",data:"Visualizations#data",depth:"Visualizations#depth",descs:"Visualizations#descs",dev:"Visualizations#dev",draw:"Visualizations#draw",edges:"Visualizations#edges",error:"Visualizations#error",focus:"Visualizations#focus",font:"Visualizations#font",footer:"Visualizations#footer",format:"Visualizations#format",height:"Visualizations#height",history:"Visualizations#history",hover:"Forms#hover",icon:"Visualizations#icon",id:"Visualizations#id",keywords:"Forms#keywords",labels:"Visualizations#labels",legend:"Visualizations#legend",links:"Visualizations#links",margin:"Visualizations#margin",messages:"Visualizations#messages",method:"Methods",mouse:"Visualizations#mouse",nodes:"Visualizations#nodes",open:"Forms#open",order:"Visualizations#order",remove:"Forms#remove",search:"Forms#search",select:"Forms#select",selectAll:"Forms#selectAll",shape:"Visualizations#shape",size:"Visualizations#size",temp:"Visualizations#temp",text:"Visualizations#text",time:"Visualizations#time",timeline:"Visualizations#timeline",timing:"Visualizations#timing",title:"Visualizations#title",tooltip:"Visualizations#tooltip",total:"Visualizations#total",type:"Visualizations#type",ui:"Visualizations#ui",width:"Visualizations#width",x:"Visualizations#x",y:"Visualizations#y",zoom:"Visualizations#zoom"}},{}],54:[function(e,t,r){var n=e("../../util/buckets.coffee"),a=e("../fetch/value.coffee"),o=e("../console/print.coffee");t.exports=function(e){if(e.dev.value&&o.time("getting color data range"),e.color.domain.value)var t=e.color.domain.value;else{var t=[];e.data.pool.forEach(function(r){var n=parseFloat(a(e,r,e.color.value));"number"==typeof n&&!isNaN(n)&&t.indexOf(n)<0&&t.push(n)})}if(e.dev.value&&o.timeEnd("getting color data range"),t.length>1){if(e.dev.value&&o.time("calculating color scale"),t=d3.extent(t),t[0]<0&&t[1]>0){var r=e.color.range;3==r.length&&(t.push(t[1]),t[1]=0)}else if(t[1]>0&&t[0]>=0){var r=e.color.heatmap;t=n(t,r.length)}else{var r=e.color.range.slice(0);t[0]<0?r.pop():r.shift()}e.color.valueScale=d3.scale.sqrt().domain(t).range(r).interpolate(d3.interpolateRgb),e.dev.value&&o.timeEnd("calculating color scale")}else e.color.valueScale=null}},{"../../util/buckets.coffee":204,"../console/print.coffee":52,"../fetch/value.coffee":67}],55:[function(e,t,r){var n=e("../fetch/value.coffee"),a=e("../console/print.coffee"),o=e("../../object/validate.coffee");t.exports=function(e,t){e.dev.value&&a.time("filtering data");var r=d3.keys(e.data.keys||{});"attrs"in e&&(r=r.concat(d3.keys(e.attrs.keys||{}))),t=t.filter(function(t){var r=n(e,t,e.id.value);return null!==r});var i=e.types[e.type.value].requirements||[];e.data.filters.forEach(function(a){r.indexOf(e[a].value)>=0&&i.indexOf(a)>=0&&(t=t.filter(function(t){var r=n(e,t,e[a].value);return"y"===a&&e.y2.value&&null===r?r=n(e,t,e.y2.value):"x"===a&&e.x2.value&&null===r&&(r=n(e,t,e.x2.value)),"size"===a?"number"==typeof r:null!==r}))});var s=e.data.solo.length?"solo":"mute";return e.data[s].length?e.data[s].forEach(function(r){function i(t){var n=e[r][s].value,a=!1;return n.forEach(function(e){"function"==typeof e?a=e(t):e===t&&(a=!0)}),"solo"===s?a:!a}function l(t,a){if(!a&&e[r].nesting){var s=e[r].nesting;o(s)&&(s=d3.values(s));for(var l=0;l<s.length;l++){var u=t.filter(function(t){return i(n(e,t,s[l]))});u.length&&(t=u)}}else t=t.filter(function(t){return i(n(e,t,e[r].value))});return t}t=l(t),"id"===r&&("nodes"in e&&e.nodes.value&&(e.dev.value&&a.time("filtering nodes"),e.nodes.restricted=l(e.nodes.value),e.dev.value&&a.timeEnd("filtering nodes")),"edges"in e&&e.edges.value&&(e.dev.value&&a.time("filtering edges"),e.edges.restricted=e.edges.value.filter(function(t){var r=l([t[e.edges.source],t[e.edges.target]]);return 2===r.length}),e.dev.value&&a.timeEnd("filtering edges")))}):"nodes"in e&&(e.nodes.restricted=void 0,e.edges.restricted=void 0),e.dev.value&&a.timeEnd("filtering data"),t}},{"../../object/validate.coffee":172,"../console/print.coffee":52,"../fetch/value.coffee":67}],56:[function(e,t,r){var n=e("./nest.js"),a=e("../fetch/value.coffee"),o=e("../console/print.coffee"),i=e("../../util/uniques.coffee");t.exports=function(e){var t;if(e.data.time={values:[]},e.time&&e.time.value){e.dev.value&&(t="analyzing time periods",o.time(t)),e.data.time.values=i(e.data.value,e.time.value,a,e),e.data.time.values.sort(function(e,t){return e-t});var r=[];e.data.time.values.forEach(function(t,n){if(0!==n){var a=e.data.time.values[n-1];r.push(t-a),n===e.data.time.values.length-1&&(e.data.time.total=t-e.data.time.values[0])}}),r=d3.min(r),e.data.time.step=r;var s=["Milliseconds","Seconds","Minutes","Hours","Date","Month","FullYear"],l=[1e3,60,60,24,30,12,1];e.data.time.periods=s;var u=function(t,r,n){return e.data.time.stepDivider||(arr=l.slice(0,n),arr.length?e.data.time.stepDivider=arr.reduce(function(e,t){return e*t}):e.data.time.stepDivider=1),Math.round(Math.floor(r-t)/e.data.time.stepDivider)},c=e.data.time.total;s.forEach(function(t,n){var a="Date"===t?28:l[n];if(!e.data.time.stepType&&(n===s.length-1||Math.round(r)<a)){e.data.time.stepType=t;var o=e.data.time.values[0],i=e.data.time.values[e.data.time.values.length-1];e.data.time.stepIntervals=u(o,i,n)}!e.data.time.totalType&&(n===s.length-1||Math.round(c)<a)&&(e.data.time.totalType=t),r/=a,c/=a}),e.data.time.values.forEach(function(t,r){if(0!==r){var n=e.data.time.values[0];e.data.time.dataSteps.push(u(n,t,s.indexOf(e.data.time.stepType)))}else e.data.time.dataSteps=[0]});var f=e.time.format.value,d=e.format.locale.value,p=[function(e){return e.getMilliseconds()},function(e){return e.getSeconds()},function(e){return e.getMinutes()},function(e){return e.getHours()},function(e){return 1!=e.getDate()},function(e){return e.getMonth()},function(e){return!0}];e.data.time.functions=p;var h=function(e,t,r){if(e===t)return r&&d.timeFormat[e+"Small"]?d.timeFormat[e+"Small"]:d.timeFormat[e];if(s.indexOf(e)>=4||s.indexOf(t)<=3)return d.timeFormat[t+"-"+e];var n;return n="Date"===t?d.timeFormat[t]:d.timeFormat[t+"-Date"],"Hours"===e?n+" "+d.timeFormat[e]:n+" "+d.timeFormat["Hours-"+e]};if(e.data.time.getFormat=h,f)"string"==typeof f?e.data.time.format=d3.locale(d.format).timeFormat(f):"function"==typeof f?e.data.time.format=f:f instanceof Array&&(e.data.time.format=d3.locale(d.format).timeFormat.multi(f)),e.data.time.multiFormat=e.data.time.format;else{for(var v=e.data.time.stepType,g=e.data.time.totalType,m=[],y=s.indexOf(v);y<=s.indexOf(g);y++){var x=y-1<s.indexOf(v)?s[y]:s[y-1],b=s[y]===x&&v!==g,w=h(x,s[y],b);m.push([w,p[y]])}e.data.time.format=d3.locale(d.format).timeFormat(h(v,g)),m.length>1?(m[m.length-1][1]=function(e){return!0},e.data.time.multiFormat=d3.locale(d.format).timeFormat.multi(m)):e.data.time.multiFormat=e.data.time.format}e.data.time.ticks=[];for(var _=d3.min(e.data.time.values),k=d3.max(e.data.time.values),z=0;z<=e.data.time.stepIntervals;z++){var A=new Date(_);A["set"+e.data.time.stepType](A["get"+e.data.time.stepType]()+z),A<=k&&e.data.time.ticks.push(A)}e.dev.value&&o.timeEnd(t)}if(e.dev.value&&(t="nesting data by time and depths",o.time(t)),e.data.nested={},0===e.data.time.values.length)e.data.nested.all={},e.id.nesting.forEach(function(t,r){var a=e.id.nesting.slice(0,r+1);e.data.nested.all[t]=n(e,e.data.value,a)});else{var j=e.data.value.reduce(function(t,r){var n=a(e,r,e.time.value).getTime();return n in t||(t[n]=[]),t[n].push(r),t},{});e.data.time.values.forEach(function(t){var r=t.getTime();e.data.nested[r]={},e.id.nesting.forEach(function(t,a){var o=e.id.nesting.slice(0,a+1);e.data.nested[r][t]=n(e,j[r],o)})})}e.dev.value&&o.timeEnd(t)}},{"../../util/uniques.coffee":210,"../console/print.coffee":52,"../fetch/value.coffee":67,"./nest.js":60}],57:[function(e,t,r){var n;n=e("../fetch/value.coffee"),t.exports=function(e,t,r){var a,o,i,s,l,u,c,f,d,p;if(o=d3.nest(),e.id.grouping.value)for(void 0===r&&(r=e.id.nesting),i=s=0,u=r.length;s<u;i=++s)f=r[i],i<e.depth.value&&!function(t){return o.key(function(r){return n(e,r.d3plus,t)})}(f);for(d=[],l=0,c=t.length;l<c;l++)a=t[l],p=e.size.value?n(e,a,e.size.value):1,p&&"number"==typeof p&&p>0&&(delete a.d3plus.r,delete a.d3plus.x,delete a.d3plus.y,d.push({d3plus:a,id:a[e.id.value],value:p}));return o.entries(d)}},{"../fetch/value.coffee":67}],58:[function(e,t,r){var n,a,o=[].indexOf||function(e){for(var t=0,r=this.length;t<r;t++)if(t in this&&this[t]===e)return t;return-1};n=e("../console/print.coffee"),a=e("../../object/validate.coffee"),t.exports=function(e,t){var r,i,s,l,u,c,f,d,p;if(f=t+" key analysis",e.dev.value&&n.time(f),e[t].keys={},r=function(n){var i,s,l,u,c,f,d;if(n instanceof Array){for(c=[],s=0,u=n.length;s<u;s++)i=n[s],c.push(r(i));return c}if(a(n)){f=[];for(l in n)d=n[l],0===l.indexOf("d3plus")||o.call(e[t].keys,l)>=0||null===d?f.push(void 0):f.push(e[t].keys[l]=typeof d);return f}},a(e[t].value)){l=d3.keys(e[t].value).length===e.id.nesting.length,u=e[t].value;for(i in u)if(d=u[i],l&&e.id.nesting.indexOf(i)>=0&&a(d))for(s in d)p=d[s],r(p);else r(d)}else{c=e[t].value;for(i in c)d=c[i],r(d)}if(e.dev.value)return n.time(f)}},{"../../object/validate.coffee":172,"../console/print.coffee":52}],59:[function(e,t,r){var n,a;n=e("../console/print.coffee"),a=e("../../object/validate.coffee"),t.exports=function(e,t,r){var o,i,s,l;return o=e.dev.value,o&&n.time("loading "+t),l=e[t].url,e[t].filetype.value?i=e[t].filetype.value:(i=l.slice(l.length-5).split("."),i=i.length>1&&i[1],i?("txt"===i&&(i="text"),e[t].filetype.accepted.indexOf(i)<0&&(i="json")):i="json"),(s="dsv"===i?d3.dsv(e[t].delimiter.value,"text/plain"):d3[i])(l,function(s,u){var c,f;if(!s&&u){if("function"==typeof e[t].callback){if(f=e[t].callback(u))if(a(f)&&t in f)for(c in f)c in e&&(e[c].value=f[c]);else e[t].value=f}else e[t].value=u;["json"].indexOf(i)<0&&e[t].value.forEach(function(e){var t;t=[];for(c in e)isNaN(e[c])?"false"===e[c].toLowerCase()?t.push(e[c]=!1):"true"===e[c].toLowerCase()?t.push(e[c]=!0):"null"===e[c].toLowerCase()?t.push(e[c]=null):"undefined"===e[c].toLowerCase()?t.push(e[c]=void 0):t.push(void 0):t.push(e[c]=parseFloat(e[c]));return t}),e[t].changed=!0,e[t].loaded=!0}else e.error.internal='Could not load data from: "'+l+'"';return o&&n.timeEnd("loading "+t),r()})}},{"../../object/validate.coffee":172,"../console/print.coffee":52}],60:[function(e,t,r){var n=e("../fetch/value.coffee"),a=e("../../object/validate.coffee"),o=e("../../util/uniques.coffee"),i=function(e,t,r,a){void 0===a&&(a=!0);var i=d3.nest(),c=[],f="temp"in e?["active","temp","total"]:[];r.length?r.forEach(function(t,r){i.key(function(r){return n(e,r,t)})}):i.key(function(e){return!0}),a&&e.axes&&e.axes.discrete&&(!e.time||e[e.axes.discrete].value!==e.time.value)&&i.key(function(t){return n(e,t,e[e.axes.discrete].value)});var d=r.length&&e.id.nesting.indexOf(r[r.length-1])>=0,p=r.length&&d?r.length-1:0;d?e.id.nesting[p]:e.depth.value;i.rollup(function(t){if(1===t.length&&"d3plus"in t[0])return c.push(t[0]),t[0];t=t.reduce(function(e,t){return t.values instanceof Array?e.concat(t.values):(e.push(t),e)},[]);var a={d3plus:{data:{},depth:p}},i=d3.sum(t,function(e){return"d3plus"in e&&e.d3plus.merged?1:0});if(i===t.length)for(var u=0;u<t.length;u++){var d=t[u];a.d3plus.merged||(a.d3plus.merged=[]),a.d3plus.merged=a.d3plus.merged.concat(d.d3plus.merged),d.d3plus.text&&(a.d3plus.text=d.d3plus.text)}for(var h=0;h<f.length;h++){var v=f[h],g=e.aggs&&e.aggs.value[m]?e.aggs.value[m]:"sum";"d3plus"in t[0]&&v in t[0].d3plus?a.d3plus[v]=d3.sum(t,function(e){return e.d3plus[v]}):"function"==typeof g?a.d3plus[v]=g(t):a.d3plus[v]=d3[g](t,function(t){var r="total"===v?1:0;return e[v].value&&(r=n(e,t,e[v].value),"number"!=typeof r&&(r=r?1:0)),r})}for(var m in e.data.keys){if(m in a.d3plus.data)a[m]=a.d3plus[m];else{var y=e.aggs&&e.aggs.value[m]?e.aggs.value[m]:"sum",x=typeof y,b=e.data.keys[m],w=e.id.nesting.indexOf(m)>=0,_="time"in e&&m===e.time.value;if(m in a.d3plus.data)a[m]=a.d3plus[m];else if("function"===x)a[m]=e.aggs.value[m](t);else if(_)a[m]=l(o(t,m));else if(e.axes&&e.axes.discrete&&e[e.axes.discrete].value===m)a[m]=o(t,m);else if("number"!==b||"string"!==x||w){var k=s(t,m),z=1===k.length?k[0][m]:o(k,m);if(1===k.length)a[m]=z;else if(z&&z.length)z instanceof Array||(z=[z]),w&&e.id.nesting.indexOf(m)>p?a[m]=k:a[m]=z;else if(w){var A=e.id.nesting.indexOf(m)-1;A>=p&&(!("endPoint"in a.d3plus)||a.d3plus.endPoint>p)&&(a.d3plus.endPoint=p)}}else{var j=t.map(function(e){return e[m]});j=j.filter(function(e){return typeof e===b}),j.length&&(a[m]=d3[y](j)); | |
| }}m in a&&a[m]instanceof Array&&1===a[m].length&&(a[m]=a[m][0])}for(var M=0;M<r.length;M++){var O=r[M];O in a||(a[O]=n(e,t[0],O))}return c.push(a),a});var h=function(t,n,a){if(t.children){"number"==e.data.keys[r[n]]&&(t.key=parseFloat(t.key)),a[r[n]]=t.key,delete t.key;for(var o in a)t[o]=a[o];n++,t.children.forEach(function(e){h(e,n,a)})}};return i=i.entries(t).map(u).map(function(e){return h(e,0,{}),e}),c},s=function(e,t){function r(e){e instanceof Array?e.forEach(r):a(e)&&t in e&&(e[t]instanceof Array?e[t].forEach(r):n.push(e))}var n=[];return r(e),n},l=function(e){function t(e){for(var n=0;n<e.length;n++){var a=e[n];a&&(a.constructor===Array?t(a):r.push(a))}}var r=[];return t(e),o(r)},u=function(e){return e.values&&e.values.length?(e.children=e.values.map(function(e){return u(e)}),delete e.values,e):e.values?e.values:e};t.exports=i},{"../../object/validate.coffee":172,"../../util/uniques.coffee":210,"../fetch/value.coffee":67}],61:[function(e,t,r){var n=e("../../array/sort.coffee"),a=e("./nest.js"),o=e("../fetch/value.coffee"),i=(e("../fetch/color.coffee"),e("../fetch/text.js"));t.exports=function(e,t,r){var s;if(s=e.size.threshold.value===!1?0:"number"==typeof e.size.threshold.value?e.size.threshold.value:"function"==typeof e.size.threshold.value?e.size.threshold.value(e):"number"==typeof e.types[e.type.value].threshold?e.types[e.type.value].threshold:"function"==typeof e.types[e.type.value].threshold?e.types[e.type.value].threshold(e):.02,"number"==typeof s&&s>0){var l=[],u=0===e.depth.value?0:{},c=[],f=[],d=[],p={},h=d3.nest();r&&h.key(function(t){return o(e,t,r)}),h.rollup(function(t){var n=t.length;e.aggs.value[e.size.value]?"function"==typeof e.aggs.value[e.size.value]?n=e.aggs.value[e.size.value](t):"string"==typeof e.aggs.value[e.size.value]&&(n=d3[e.aggs.value[e.size.value]](t,function(t){return o(e,t,e.size.value)})):n=d3.sum(t,function(t){return o(e,t,e.size.value)});var a=r?o(e,t[0],r):"all";return p[a]=n,n}).entries(t),t.forEach(function(t){var n=o(e,t,e.id.value),a=o(e,t,e.size.value),i=r?o(e,t,r):"all",u=a/p[i]>=s;if(u&&l.indexOf(n)<0&&(l.push(n),e.depth.value)){var c=o(e,t,e.id.nesting[e.depth.value-1]);f.indexOf(c)<0&&f.push(c)}});var v=t.filter(function(t){var r=o(e,t,e.id.value),n=l.indexOf(r)>=0,a=e.depth.value?o(e,t,e.id.nesting[e.depth.value-1]):null;if(null!==a&&f.indexOf(a)<0&&d.indexOf(a)<0&&d.push(a),!n){var i=o(e,t,e.size.value);i>0&&(0===e.depth.value?i>u&&(u=i):(a in u||(u[a]=0),i>u[a]&&(u[a]=i)),c.push(t))}return n});if(c.length>1){c=n(c,e.size.value,"desc",[],e);var g=e.id.nesting.slice(0,e.depth.value);e.types[e.type.value].requirements.indexOf(e.axes.discrete)>=0&&g.push(e[e.axes.discrete].value);var m=a(e,c,g);m.forEach(function(t){var r=e.id.nesting[e.depth.value-1],n=o(e,t,r);if(children=r?c.filter(function(t){return o(e,t,r)===n}):c,children.length>1){e.id.nesting.forEach(function(r,n){if(e.depth.value==n){var a=t[r];"string"==typeof a?t[r]="d3plus_other_"+a:t[r]="d3plus_other"}else n>e.depth.value&&delete t[r]}),e.color.value&&"string"===e.color.type&&(0===e.depth.value?t[e.color.value]=e.color.missing:t[e.color.value]=o(e,n,e.color.value,r)),e.icon.value&&(t[e.icon.value]=o(e,n,e.icon.value,r)),n&&(t.d3plus.depth=e.depth.value);var a;0===e.depth.value?(a=e.format.value(e.format.locale.value.ui.values,{key:"threshold",vars:e}),a+=" < "+e.format.value(u,{key:e.size.value,vars:e})):(a=i(e,t,e.depth.value-1),a=a.length?a[0].split(" < ")[0]:e.format.value(e.format.locale.value.ui.values,{key:"threshold",vars:e}),d.indexOf(n)<0&&(a+=" < "+e.format.value(u[n],{key:e.size.value,vars:e}))),d.indexOf(n)<0&&(a+=" ("+e.format.value(100*s,{key:"share",vars:e})+")"),t.d3plus.threshold=u,t.d3plus.merged=children,e.text.value&&(t[e.text.value]=a),t.d3plus.text=a}})}else m=c;return v.concat(m)}return t}},{"../../array/sort.coffee":34,"../fetch/color.coffee":63,"../fetch/text.js":66,"../fetch/value.coffee":67,"./nest.js":60}],62:[function(e,t,r){var n;n=e("../../font/sizes.coffee"),t.exports=function(e,t){var r,a,o,i,s,l,u,c,f,d,p,h,v,g,m,y,x,b;if(b=t.values||e.data.time.ticks,g=t.style||{},s=t.limit||e.width.value,m={},c=e.data.time.periods,v=e.data.time.stepType,y=e.data.time.totalType,o=e.data.time.functions,i=e.data.time.getFormat,l=e.format.locale.value.format,e.time.format.value)m.format=e.data.time.format,m.values=b,m.sizes=n(b.map(function(e){return m.format(e)}),g);else for(u=c.indexOf(v);u<=c.indexOf(y);){if(x=b.filter(function(e){var t,r;if(u===c.indexOf(v))return!0;if(t=!0,r=u-1,u<0)return!0;for(;r>=c.indexOf(v)&&t;)t=!o[r](e),r--;return t}),c[u]===y)a=d3.locale(l).timeFormat(i(c[u],y));else{for(f=u,a=[];f<=c.indexOf(y);)d=f-1<c.indexOf(v)?f:f-1,d=c[d],h=c[f]===d&&v!==y,r=i(d,c[f],h),a.push([r,o[f]]),f++;a[a.length-1][1]=function(){return!0},a=d3.locale(l).timeFormat.multi(a)}if(p=n(x.map(function(e){return a(e)}),g),d3.sum(p,function(e){return e.width})<s||u===c.indexOf(y)){m.format=a,m.values=x,m.sizes=p;break}u++}return m}},{"../../font/sizes.coffee":102}],63:[function(e,t,r){var n,a,o,i,s,l,u;n=e("./value.coffee"),i=e("../../color/random.coffee"),l=e("../../color/validate.coffee"),u=e("../../object/validate.coffee"),s=e("../../util/uniques.coffee"),t.exports=function(e,t,r){var i,l,c,f,d,p;if(d=u(t),d&&"d3plus"in t&&"color"in t.d3plus)return t.d3plus.color;if(void 0===r&&(r=e.id.value),"number"==typeof r&&(r=e.id.nesting[r]),e.color.value){for(c=[],f=e.id.nesting.indexOf(r);f>=0;){if(l=e.id.nesting[f],p=s(t,e.color.value,n,e,l),1===p.length&&(p=p[0]),!(p instanceof Array)&&void 0!==p&&null!==p){i=a(e,t,p,r),c.indexOf(i)<0&&c.push(i);break}f--}return 1===c.length?c[0]:e.color.missing}return o(e,t,r)},a=function(e,t,r,n){return r?e.color.valueScale?e.color.valueScale(r):l(r)?r:o(e,r,n):e.color.value&&"function"==typeof e.color.valueScale?e.color.valueScale(0):o(e,t,n)},o=function(e,t,r){return u(t)&&(t=n(e,t,r)),t instanceof Array&&(t=t[0]),i(t,e.color.scale.value)}},{"../../color/random.coffee":47,"../../color/validate.coffee":51,"../../object/validate.coffee":172,"../../util/uniques.coffee":210,"./value.coffee":67}],64:[function(e,t,r){var n=e("../data/filter.js"),a=e("../data/nest.js"),o=e("../console/print.coffee"),i=e("../../string/format.js"),s=e("../../string/list.coffee");t.exports=function(e,t,r){if(!e.data.value)return[];void 0===r&&(r=e.depth.value);var l=e.id.nesting[r];if(!t||t instanceof Array||(t=[t]),!t&&"time"in e){t=[];var u=e.time.solo.value.length?"solo":"mute",c=e.time[u].value;if(c.length){t=[];for(var f=0;f<c.length;f++){var d=c[f];if("function"==typeof d)for(var p=0;p<e.data.time.values.length;p++){var h=e.data.time.values[p].getTime();d(h)&&t.push(h)}else if(d.constructor===Date)t.push(new Date(d).getTime());else{d+="",4===d.length&&parseInt(d)+""===d&&(d+="/01/01");var v=new Date(d);"Invalid Date"!==v&&t.push(v.getTime())}}"mute"===u&&(t=e.data.time.values.filter(function(e){return t.indexOf(e.getTime())<0}))}else t.push("all")}else t=["all"];if(t.indexOf("all")>=0&&e.data.time.values.length){t=e.data.time.values.slice(0);for(var g=0;g<t.length;g++)t[g]=t[g].getTime()}var m=[e.type.value,l,r].concat(e.data.filters).concat(t),y=e.data.solo.length?"solo":"mute",x=d3.keys(e.data.cache),b=e.types[e.type.value].filter||void 0;if(e.data[y].length)for(var w=0;w<e.data[y].length;w++){var _=e.data[y][w],k=e[_][y].value.slice(0);k.unshift(_),k.unshift(y),m=m.concat(k)}e.axes&&e.axes.discrete&&m.push(e.axes.discrete),m=m.join("_"),e.data.cacheID=m;for(var z=0;z<x.length;z++){var A=x[z].split("_").slice(1).join("_");if(A===m){m=(new Date).getTime()+"_"+m,e.data.cache[m]=e.data.cache[x[z]],delete e.data.cache[x[z]];break}}var j;if(e.data.cache[m])return e.dev.value&&o.comment("data already cached"),j=e.data.cache[m].data,"nodes"in e&&(e.nodes.restricted=e.data.cache[m].nodes,e.edges.restricted=e.data.cache[m].edges),"function"==typeof b&&(j=b(e,j)),j;var M=[];if(j=[],e.data.value&&e.data.value.length)for(var O=0;O<t.length;O++){var E=t[O];e.data.nested[E]?j=j.concat(e.data.nested[E][l]):M.push(E)}if(0===j.length&&M.length&&!e.error.internal){M.length>1&&(M=d3.extent(M)),M=M.map(function(t){return e.data.time.format(new Date(t))}),M=M.join(" - ");var F=e.format.locale.value.error.dataYear,S=e.format.locale.value.ui.and;M=s(M,S),e.error.internal=i(F,M),e.time.missing=!0}else{if(e.time&&(e.time.missing=!1),t.length>1){var T=!1;if(["x","y","x2","y2"].forEach(function(t){e[t].value===e.time.value&&"discrete"===e[t].scale.value&&(T=!0)}),!T){var B=e.id.nesting.slice(0,r+1);j=a(e,j,B)}}j=j?n(e,j):[],20===x.length&&(x.sort(),delete e.data.cache[x[0]]),m=(new Date).getTime()+"_"+m,e.data.cache[m]={data:j},"nodes"in e&&(e.data.cache[m].nodes=e.nodes.restricted,e.data.cache[m].edges=e.edges.restricted),"function"==typeof b&&(j=b(e,j)),e.dev.value&&o.comment("storing data in cache")}return j}},{"../../string/format.js":173,"../../string/list.coffee":174,"../console/print.coffee":52,"../data/filter.js":55,"../data/nest.js":60}],65:[function(e,t,r){var n,a,o;o=e("./value.coffee"),n=e("./color.coffee"),a=e("./text.js"),t.exports=function(e,t,r,i,s){var l,u,c,f,d,p;for(r instanceof Array||(r=[r]),i instanceof Array||(i=[i]),e&&(void 0===s?s=e.id.value:"number"!=typeof s&&(s=e.id.nesting.indexOf(s))),d={},u=0,f=r.length;u<f;u++)c=r[u],p=e?i.indexOf(c)>=0?n(e,t,s):c===e.text.value?a(e,t,s):3===d3.keys(t).length&&t.d3plus&&t.key&&t.values?o(e,t.values.map(function(e){return e.d3plus}),c,s):o(e,t,c,s):t[c],[e.data.keys[c],e.attrs.keys[c]].indexOf("number")>=0?(l=e.order.agg.value||e.aggs.value[c]||"sum",l.constructor===String&&(l=d3[l]),p instanceof Array||(p=[p]),p=l(p)):(p instanceof Array&&(p=p[0]),p="string"==typeof p?p.toLowerCase():p),d[c]=p;return d}},{"./color.coffee":63,"./text.js":66,"./value.coffee":67}],66:[function(e,t,r){var n=e("./value.coffee"),a=e("../../object/validate.coffee"),o=e("../../util/uniques.coffee");t.exports=function(e,t,r){"number"!=typeof r&&(r=e.depth.value);var i,s=e.id.nesting[r];e.text.nesting&&a(e.text.nesting)?i=e.text.nesting[s]?e.text.nesting[s]:e.text.value:(i=[],e.text.value&&r===e.depth.value&&i.push(e.text.value),i.push(s)),i instanceof Array||(i=[i]);var l=[];if(a(t)&&"d3plus"in t&&t.d3plus.text)l.push(t.d3plus.text.toString()),l.push(e.format.value(t.d3plus.text.toString(),{vars:e,data:t}));else{var u=a(t)?t:void 0;u&&t[e.id.value]instanceof Array?t=t[e.id.value]:t instanceof Array||(t=[t]),i.forEach(function(r){var a=o(t,r,n,e,s);a.length&&(a.length>1&&(a=a.filter(function(e){return e instanceof Array||"string"==typeof e&&e.indexOf(" < ")<0})),a=a.map(function(t){return t instanceof Array?(t=t.filter(function(e){return e}),t.map(function(t){return e.format.value(t.toString(),{vars:e,data:u,key:r})})):t?e.format.value(t.toString(),{vars:e,data:u,key:r}):void 0}),1===a.length&&(a=a[0]),l.push(a))})}return l}},{"../../object/validate.coffee":172,"../../util/uniques.coffee":210,"./value.coffee":67}],67:[function(e,t,r){var n,a,o,i,s,l,u,c,f,d;f=e("../../object/validate.coffee"),c=e("../../util/uniques.coffee"),u=function(e,t,r,i){var s,l,u,d;if(l=f(t),"function"==typeof r&&l)return r(t,e);if(l){if(r in t)return t[r];if(s=e.data.cacheID+"_"+i,n(t,s,e),r in t.d3plus.data[s])return t.d3plus.data[s][r];if(i in t)t=t[i];else{if(!(e.id.value in t))return null;if(t=t[e.id.value],i!==r&&(u=o(e,t,i,e.id.value)),null!==u&&void 0!==u||(u=a(e,t,i,e.id.value)),null===u||void 0===u)return null;if(i===r)return u;t=u}}return t instanceof Array&&!f(t[0])&&(t=c(t)),t instanceof Array&&f(t[0])&&(d=c(t,r),d.length)?d:(d=o(e,t,r,i))?d:d=a(e,t,r,i)},o=function(e,t,r,n){var a;return e.data.viz instanceof Array&&r in e.data.keys&&(a=c(l(e.data.viz,t,n),r)),a&&a.length?a:null},a=function(e,t,r,n){var a,o,i,s;if("attrs"in e&&e.attrs.value&&r in e.attrs.keys)if(a=f(e.attrs.value)&&n in e.attrs.value?e.attrs.value[n]:e.attrs.value,a instanceof Array){if(i=c(l(a,t,n),r),i.length)return i}else if(t instanceof Array){if(a=[function(){var e,r,n;if(o in a){for(n=[],e=0,r=t.length;e<r;e++)o=t[e],n.push(a[o]);return n}}()],a.length&&(s=c(a,r),s.length))return s}else if(t in a)return a[t][r];return null},l=function(e,t,r){return t instanceof Array?e.filter(function(e){return t.indexOf(e[r])>=0}):e.filter(function(e){return e[r]===t})},n=function(e,t,r){return"d3plus"in e||(e.d3plus={}),"data"in e.d3plus||(e.d3plus.data={}),!(r.data.changed||r.attrs&&r.attrs.changed)&&t in e.d3plus.data||(e.d3plus.data[t]={}),e},d=function(e,t,r,n,a){var o,i,s,l,u,c,d;if(null===a)return a;c="time"in e&&e.time.value===n,a instanceof Array||(a=[a]);for(s=l=0,u=a.length;l<u;s=++l)d=a[s],c&&null!==d&&d.constructor!==Date&&(d+="",4===d.length&&parseInt(d)+""===d&&(d+="/01/01"),i=new Date(d),"Invalid Date"!==i&&(a[s]=i));return 1===a.length&&(a=a[0]),null===a||!f(t)||"string"!=typeof n||n in t||(o=e.data.cacheID+"_"+r,t.d3plus.data[o][n]=a),a},s=function(e,t,r,n){var a,o,i,s,l;for(l=[],o=0,i=t.length;o<i;o++)a=t[o],f(a)?(s=u(e,a,r,n),l.push(d(e,a,n,r,s))):l.push(a);return"number"!=typeof l[0]&&(l=c(l)),1===l.length?l[0]:l},i=function(e,t,r,n){var a,o;return r?"number"==typeof r?r:(a=f(t),n||(n=e.id.value),a&&t.values instanceof Array?o=s(e,t.values,r,n):a&&t[r]instanceof Array?o=s(e,t[r],r,n):t instanceof Array?o=s(e,t,r,n):(o=u(e,t,r,n),o=d(e,t,n,r,o)),o):null},t.exports=i},{"../../object/validate.coffee":172,"../../util/uniques.coffee":210}],68:[function(e,t,r){t.exports=function(e){var t,r,n;return["div","svg"].indexOf(e)<0&&(e="div"),r={position:"absolute",left:"-9999px",top:"-9999px",visibility:"hidden",display:"block"},t="div"===e?{}:{position:"absolute"},n=d3.select("body").selectAll(e+".d3plus_tester").data([0]),n.enter().append(e).attr("class","d3plus_tester").style(r).attr(t),n}},{}],69:[function(e,t,r){t.exports={format:{decimal:",",thousands:".",grouping:[3],currency:[""," €"],dateTime:"%A, der %e. %B %Y, %X",date:"%d.%m.%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],shortDays:["So","Mo","Di","Mi","Do","Fr","Sa"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],shortMonths:["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"]},error:{accepted:"{0} ist kein gültiger {1} für {2}-Darstellungen. Benutzen Sie bitte: {3}.",connections:"Keine Verbindungen verfügbar für {0}.",data:"Keine Daten verfügbar",dataYear:"Für {0} sind keine Daten verfügbar.",lib:"{0}-Darstellungen erfordern das Laden der Bibliothek {1}.",libs:"{0}-Darstellungen erfordern das Laden folgender Bibliotheken: {1}.",method:"{0}-Darstellungen erfordern die Methode {1}.",methods:"Weitere Einstellungen für folgende Methoden {1} sind bei {0}-Darstellungen erforderlich."},lowercase:["ein","ein","und","wie","bei","aber","durch","für","von","wenn","in","in","in der Nähe","noch","von","auf","auf","oder","pro","das","die","zu","mit","über","gegen","gegen."],method:{active:"aktive Segmente",color:"Farbe",depth:"Tiefe",dev:"ausführlich",focus:"Fokus",icon:"Symbol",id:"Kennung",height:"Höhe",labels:"Beschriftungen",legend:"Legende",margin:"Rand",messages:"Statusmeldungen",order:"Reihenfolge",search:"Suche",shape:"Form",size:"Größe",style:"Stil",temp:"temporäre Segmente",text:"Text",time:"Zeit",timeline:"Zeitleiste",total:"Segmente gesamt",type:"Typ",width:"Breite",x:"x-Achse",y:"y-Achse",zoom:"Zoom",mode:"Modus",mute:"ausblenden",solo:"isolieren"},time:["Datum","Tag","Monat","Zeit","Jahr"],visualization:{bubbles:"Blasen",chart:"Diagramm",geo_map:"Karte",line:"Liniendiagramm",network:"Netzwerk",rings:"Ringe",scatter:"Punktdiagramm",stacked:"Gestapelte Fläche",tree_map:"Baumdiagramm",bar:"Balkendiagramm",box:"Boxplot",paths:"Pfade",pie:"Kreisdiagramm",table:"Tabelle"},ui:{and:"und",back:"zurück",collapse:"Zum Ausblenden klicken",error:"Fehler",expand:"Zum Einblenden klicken",loading:"Lade...",more:"{0} weitere",moreInfo:"Für zusätzliche Informationen klicken",noResults:"Keine Ergebnisse für {0} gefunden.",primary:"Primäre Verbindungen",share:"teilen",total:"gesamt",values:"Werte",including:"einschließlich",or:"oder",iqr:"Interquartilsabstände {0}",max:"Maximalwert",min:"Minimalwert",percentile:"Perzentil P{0}",tukey_bottom:"Unterer Ausreißer",tukey_top:"Oberer Ausreißer",quartile_first:"Unteres Quartil Q1",quartile_third:"Oberes Quartil Q3",median:"Medianwert"},message:{data:"analysiere Daten",draw:"Darstellung wird gerendert",initializing:"initialisiere {0}",loading:"Daten werden geladen",tooltipReset:"Tooltips zurücksetzen",ui:"aktualisiere Oberfläche"},uppercase:["CEO","CEOs","CFO","CFOs","CNC","COO","COOs","CPU","CPUs","BIP","HVAC","ID","IT","FuE","TV","UI"]}},{}],70:[function(e,t,r){t.exports={dev:{accepted:"{0} is not an accepted value for {1}, please use one of the following: {2}.",deprecated:"the {0} method has been removed, please update your code to use {1}.",noChange:"{0} was not updated because it did not change.",noContainer:"cannot find a container on the page matching {0}.",of:"of",oldStyle:"style properties for {0} have now been embedded directly into .{1}().",sameEdge:"edges cannot link to themselves. automatically removing self-referencing edge {0}.",set:"{0} has been set.",setLong:"{0} has been set to {1}.",setContainer:"please define a container div using .container()"},error:{accepted:"{0} is not an accepted {1} for {2} visualizations, please use one of the following: {3}.",connections:"no connections available for {0}.",data:"no data available",dataYear:"no data available for {0}.",lib:"{0} visualizations require loading the {1} library.",libs:"{0} visualizations require loading the following libraries: {1}.",method:"{0} visualizations require setting the {1} method.",methods:"{0} visualizations require setting the following methods: {1}."},format:{decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%A, %B %-d, %Y %X",date:"%-m/%-d/%Y",time:"%I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},lowercase:["a","an","and","as","at","but","by","for","from","if","in","into","near","nor","of","on","onto","or","per","that","the","to","with","via","vs","vs."],message:{data:"analyzing data",draw:"drawing visualization",initializing:"initializing {0}",loading:"loading data",tooltipReset:"resetting tooltips",ui:"updating ui"},method:{active:"active segments",color:"color",depth:"depth",dev:"verbose",focus:"focus",icon:"icon",id:"id",height:"height",labels:"labels",legend:"legend",margin:"margin",messages:"status messages",mode:"mode",mute:"hide",order:"order",search:"search",shape:"shape",size:"size",solo:"isolate",style:"style",temp:"temporary segments",text:"text",time:"time",timeline:"timeline",total:"total segments",type:"type",width:"width",x:"x axis",y:"y axis",zoom:"zoom"},time:["date","day","month","time","year"],timeFormat:{FullYear:"%Y",Month:"%B",MonthSmall:"%b",Date:"%A %-d",DateSmall:"%-d",Hours:"%I %p",Minutes:"%I:%M",Seconds:"%Ss",Milliseconds:"%Lms","FullYear-Month":"%b %Y","FullYear-Date":"%-m/%-d/%Y","Month-Date":"%b %-d","Hours-Minutes":"%I:%M %p","Hours-Seconds":"%I:%M:%S %p","Hours-Milliseconds":"%H:%M:%S.%L","Minutes-Seconds":"%I:%M:%S %p","Minutes-Milliseconds":"%H:%M:%S.%L","Seconds-Milliseconds":"%H:%M:%S.%L"},ui:{and:"and",back:"back",collapse:"click to collapse",error:"error",expand:"click to expand",including:"including",iqr:"interquartile range for {0}",loading:"loading...",max:"maximum",median:"median",min:"minimum",more:"{0} more",moreInfo:"click for more info",or:"or",noResults:"no results matching {0}.",percentile:"{0} percentile",primary:"primary connections",quartile_first:"first quartile",quartile_third:"third quartile",share:"share",total:"total",tukey_bottom:"bottom tukey",tukey_top:"top tukey",values:"values"},uppercase:["CEO","CEOs","CFO","CFOs","CNC","COO","COOs","CPU","CPUs","GDP","HVAC","ID","IT","R&D","TV","UI"],visualization:{bar:"Bar Chart",box:"Box Plot",bubbles:"Bubbles",chart:"Chart",geo_map:"Geo Map",line:"Line Plot",network:"Network",paths:"Paths",pie:"Pie Chart",rings:"Rings",scatter:"Scatter Plot",stacked:"Stacked Area",table:"Table",tree_map:"Tree Map"}}},{}],71:[function(e,t,r){t.exports={format:{decimal:",",thousands:".",grouping:[3],currency:[""," €"],dateTime:"%A, %e de %B de %Y, %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],shortDays:["dom","lun","mar","mié","jue","vie","sáb"],months:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],shortMonths:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"]},dev:{accepted:"{0} no es un valor aceptado para {1}, por favor utilice uno de los siguientes: {2}.",deprecated:"el método {0} ha sido eliminado, por favor, actualiza tu código para utilizar {1}.",noChange:"{0} no se actualiza porque no cambió.",noContainer:"no se puede encontrar un contenedor en la página correspondiente a {0}.",of:"de",oldStyle:"propiedades de estilo para {0} ahora se han incorporado directamente en. {1} ().",sameEdge:"los vínculos no se pueden enlazar con si mismos. eliminando automáticamente el vínculo {0} que se autorreferencia.",set:"{0} se ha establecido.",setLong:"{0} ha sido establecido a {1}.",setContainer:"defina un div contenedor utilizando .container ()"},error:{accepted:"{0} no es un {1} aceptado para visualizaciones de {2}, por favor utilice uno de los siguientes: {3}.",connections:"no hay conexiones disponibles para {0}.",data:"No hay datos disponibles",dataYear:"no hay datos disponibles para {0}.",lib:"{0} visualizaciones requieren cargar las siguientes librerías: {1}.",libs:"{0} visualizaciones requieren cargar las siguientes librerías: {1}.",method:"{0} visualizaciones requieren establecer el método {1}.",methods:"{0} visualizaciones requieren establecer los siguientes métodos: {1}."},lowercase:["una","y","en","pero","en","de","o","el","la","los","las","para","a","con"],method:{active:"segmentos activos",color:"color",depth:"profundidad",dev:"detallado",focus:"foco",icon:"ícono",id:"id",height:"alto",labels:"rótulo",legend:"leyenda",margin:"margen",messages:"mensajes de estado",order:"orden",search:"búsqueda",shape:"forma",size:"tamaño",style:"estilo",temp:"segmentos temporales",text:"texto",time:"tiempo",timeline:"línea de tiempo",total:"segmentos totales",type:"tipo",width:"anchura",x:"eje x",y:"eje Y",zoom:"zoom",mode:"modo",mute:"ocultar",solo:"aislar"},time:["fecha","día","mes","hora","año"],visualization:{bubbles:"Burbujas",chart:"Gráfico",geo_map:"Mapa",line:"Gráfico de linea",network:"Red",rings:"Anillos",scatter:"Gráfico De Dispersión",stacked:"Área Apilada",tree_map:"Tree Map",bar:"Gráfico De Barras",box:"Diagrama de Cajas",paths:"Caminos",pie:"Gráfico de Pastel",table:"Tabla"},ui:{and:"y",back:"atrás",collapse:"click para cerrar",error:"error",expand:"haga clic para ampliar",loading:"Cargando ...",more:"{0} más",moreInfo:"clic para más información",noResults:"no se encontraron resultados para {0}.",primary:"relaciones principales",share:"porcentaje",total:"total",values:"valores",including:"Incluyendo",or:"o",iqr:"rango intercuartil para {0}",max:"máximo",min:"mínimo",percentile:"{0} percentil",tukey_bottom:"Tukey inferior",tukey_top:"la parte superior de Tukey",quartile_first:"primer cuartil",quartile_third:"tercer cuartil",median:"mediana"},message:{data:"analizando los datos",draw:"visualizando",initializing:"inicializando {0}",loading:"cargando datos",tooltipReset:"restableciendo las descripciones emergentes",ui:"actualizando la interfaz de usuario"},uppercase:["CEO","CEOs","CFO","CFOs","CNC","COO","COOs","CPU","CPUs","PIB","HVAC","ID","TI","I&D","TV","UI"]}},{}],72:[function(e,t,r){t.exports={format:{decimal:",",thousands:".",grouping:[3],currency:[""," €"],dateTime:"%A, le %e %B %Y, %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],shortDays:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],months:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],shortMonths:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."]},dev:{accepted:"{0} n'est pas une option valide pour {1}, les valeurs possibles sont: {2}.",deprecated:"{0} a été éliminé de la version courante, mettez à jour votre code source avec {1}.",noChange:"{0} n'a pas été mis à jour car inchangé.",noContainer:"impossible de trouver un contenant correspondant à {0}.",of:"de",oldStyle:"les propriétés de {0} ont été imbriquées dans .{1}().",sameEdge:"un arc ne peut pas boucler sur lui même. L'auto-référence est automatiquement éliminée {0}.",set:"{0} a été mis à jour.",setLong:"{0} a été mis à jour à {1}.",setContainer:"merci de choisir un div qui utilise .container()"},error:{accepted:"{0} n'est pas correct {1} pour {2} visualisations, merci d'utilisez une des options suivantes: {3}.",connections:"Pas de connections disponibles pour {0}.",data:"Pas de données disponibles",dataYear:"Pas de données disponibles pour {0}.",lib:"La visualisation de {0} nécessite le chargement de la librairie {1}.",libs:"La visualisation de {0} nécessite le chargement des librairies {1}.",method:"La visualisation du {0} exige la définition de {1}.",methods:"La visualisation du {0} exige les définitions de {1}."},lowercase:["un","une","de","des","et","mais","les","ou","pour","avec","comme","par","vers","si","dans","près","ni","dessus","que","le","la","via","sinon","alors"],method:{active:"segments actifs",color:"couleur",depth:"profondeur",dev:"verbeux",focus:"focus",icon:"ícone",id:"id",height:"hauteur",labels:"labels",legend:"légende",margin:"marge",messages:"messages",order:"ordre",search:"recherche",shape:"format",size:"taille",style:"style",temp:"segments temporaires",text:"texte",time:"temps",timeline:"ligne temporelle",total:"segments totaux",type:"type",width:"largeur",x:"axe x",y:"axe y",zoom:"zoom",mode:"mode",mute:"cacher",solo:"isoler"},time:["année","date","jour","heure","mois"],visualization:{bubbles:"Bulles",chart:"Graphique",geo_map:"Carte",line:"Courbes",network:"Réseau",rings:"Anneaux",scatter:"Nuage de points",stacked:"Aires empilées",tree_map:"Arbre",bar:"Diagramme en barres",box:"Boîtes à Moustaches",paths:"Chemins",pie:"Camembert",table:"Table"},ui:{and:"et",back:"retour",collapse:"clic pour réduire",error:"erreur",expand:"clic pour agrandir",loading:"chargement ...",more:"plus {0}",moreInfo:"clic pour plus d'information",noResults:"pas de résultat correspondant à {0}.",primary:"connections primaires",share:"part",total:"total",values:"valeurs",including:"incluant",or:"ou",iqr:"gamme interquartile pour {0}",max:"maximum",min:"le minimum",percentile:"{0} percentile",tukey_bottom:"tukey bas",tukey_top:"top tukey",quartile_first:"premier quartile",quartile_third:"le troisième quartile",median:"médian"},message:{data:"analyse des données",draw:"tracé en cours",initializing:"Initialisation {0}",loading:"chargement",tooltipReset:"réinitialisation des bulles",ui:"rafraichissement de l'interface"},uppercase:["CEO","CEOs","CFO","CFOs","CNC","COO","COOs","CPU","CPUs","PIB","HVAC","ID","IT","TV","UI"]}},{}],73:[function(e,t,r){t.exports={format:{decimal:".",thousands:",",grouping:[3],currency:["₩",""],dateTime:"%Y/%m/%d %a %X",date:"%Y/%m/%d",time:"%H:%M:%S",periods:["오전","오후"],days:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],shortDays:["일","월","화","수","목","금","토"],months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],shortMonths:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},error:{accepted:"{0}하지 허용 {1} {2} 시각화는 다음 중 하나를 사용하십시오에 대해 : {3}.",connections:"{0}에 대한 연결이 없음.",data:"자료 없음",dataYear:"{0}에 대한 자료가 없음.",lib:"{0} 시각화는 {1} 라이브러리를로드 할 필요합니다.",libs:"{0} 시각화는 다음과 같은 라이브러리를로드 할 필요 : {1}.",method:"{0} 시각화를 위해 {1} 메서드를 설정해야 한다.",methods:"{0} 시각화를 위해 다음과 같은 메서드를 설정해야한다: {1}."},lowercase:[""],method:{active:"활성 세그먼트",color:"색",depth:"깊이",dev:"풀어서",focus:"집중하다",icon:"상",id:"신분증",height:"높이",labels:"라벨",legend:"범례",margin:"여유",messages:"상태 메시지",order:"주문",search:"수색",shape:"모양",size:"크기",style:"스타일",temp:"임시 세그먼트",text:"본문",time:"시각",timeline:"타임 라인",total:"총 세그먼트",type:"유형",width:"폭",x:"X 축",y:"Y 축",zoom:"줌",mode:"모드",mute:"숨김",solo:"독주"},time:["날짜","요일","월","시간","년"],visualization:{bubbles:"버블 차트",chart:"차트",geo_map:"지도형",line:"선형 그래프",network:"네트워크 그래프",rings:"반지",scatter:"산포도",stacked:"누적 된 지역",tree_map:"트리 맵",bar:"막대 차트",box:"박스 플롯",paths:"경로",pie:"파이 차트",table:"탁자"},ui:{and:"과",back:"뒤로",collapse:"축소하려면 클릭",error:"오류",expand:"확장하려면 클릭",loading:"로드 중 ...",more:"{0} 이상",moreInfo:"추가 정보를 위해 클릭하십시오",noResults:"일치하는 결과값이 없음 {0}.",primary:"기본 연결",share:"비중",total:"합계",values:"값",including:"...을 포함하여",or:"또는",iqr:"대한 사 분위 범위 {0}",max:"최고",min:"최저한의",percentile:"{0} 백분위 수",tukey_bottom:"바닥 Tukey에",tukey_top:"상단 Tukey에",quartile_first:"1 분위",quartile_third:"3 분위",median:"중앙값"},message:{data:"데이터 분석 중",draw:"데이터 시각화 중",initializing:"초기화 {0}",loading:"데이터 로딩 중",tooltipReset:"툴팁을 재설정",ui:"UI 업데이트 중"},uppercase:["CEO","최고 경영자","최고 재무 책임자 (CFO)","CFO는","CNC","COO","구구","CPU","CPU에","GDP","HVAC","ID","IT","R & D","TV","UI"]}},{}],74:[function(e,t,r){t.exports={format:{decimal:",",thousands:".",grouping:[3],currency:[""," ден."],dateTime:"%A, %e %B %Y г. %X",date:"%d.%m.%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["недела","понеделник","вторник","среда","четврток","петок","сабота"],shortDays:["нед","пон","вто","сре","чет","пет","саб"],months:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],shortMonths:["јан","фев","мар","апр","мај","јун","јул","авг","сеп","окт","ное","дек"]},error:{accepted:"{0} не е прифатлива за {1} {2} визуелизација, ве молиме користете една од следниве: {3}.",connections:"не е достапна за врски {0}.",data:"нема податоци",dataYear:"Не е достапен за податоци {0}.",lib:"{0} визуализации бараат вчитување на библиотеката {1} .",libs:"{0} визуализации бараат вчитување на следниве библиотеки: {1}.",method:"{0} визуализации бара поставување на {1} методот.",methods:"{0} визуализации бараат поставување на следниве методи: {1}."},lowercase:["a","и","во","но","на","или","да","се","со"],method:{active:"активни сегменти",color:"боја",depth:"длабочина",dev:"опширно",focus:"фокус",icon:"икона",id:"проект",height:"височина",labels:"етикети",legend:"легенда",margin:"маргина",messages:"пораки за статусот",order:"со цел",search:"барај",shape:"форма",size:"големина",style:"стил",temp:"привремени сегменти",text:"текст",time:"време",timeline:"времеплов",total:"Вкупно сегменти",type:"тип",width:"ширина",x:"x оската",y:"Y оската",zoom:"зум",mode:"режим",mute:"се скрие",solo:"изолирање"},time:["датум","ден","месец","време","година"],visualization:{bubbles:"меурчиња",chart:"Графикон",geo_map:"Гео мапа",line:"Линиски график",network:"мрежа",rings:"прстени",scatter:"Распрскан график",stacked:"Наредена површина",tree_map:"Мапа во вид на дрво",bar:"бар шема",box:"правоаголен дијаграм",paths:"патеки",pie:"пита графикон",table:"Табела"},ui:{and:"и",back:"назад",collapse:"кликни за да се собере",error:"грешка",expand:"Кликни за проширување",loading:"Се вчитува ...",more:"{0} повеќе",moreInfo:"кликнете за повеќе информации",noResults:"Не се пронајдени резултати за појавување на {0}.",primary:"основните врски",share:"удел",total:"Вкупниот",values:"вредности",including:"Вклучувајќи",or:"или",iqr:"interquartile опсег за {0}",max:"максималната",min:"минимум",percentile:"{0} перцентил",tukey_bottom:"дното Tukey",tukey_top:"Топ Tukey",quartile_first:"првиот квартал",quartile_third:"третиот квартал",median:"средната"},message:{data:"анализа на податоци",draw:"цртање на визуелизација", | |
| initializing:"иницијализација {0}",loading:"податоци за товарење",tooltipReset:"ресетирање на објаснувањата",ui:"ажурирање на кориничкиот интерфејс"},uppercase:["CEO","CEOs","CFO","CFOs","CNC","COO","COOs","CPU","CPUs","GDP","HVAC","ID","IT","R&D","TV","UI"]}},{}],75:[function(e,t,r){t.exports={format:{decimal:",",thousands:".",grouping:[3],currency:["R$",""],dateTime:"%A, %e de %B de %Y. %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],shortDays:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],shortMonths:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"]},dev:{accepted:"{0} não é um valor válido para {1}, por favor use um dos seguintes procedimentos: {2}.",deprecated:"{0} método foi removido, por favor atualize seu código para utilizar {1}.",noChange:"{0} não foi atualizado porque ele não mudou.",noContainer:"Não foi possível encontrar um local na página correspondente a {0}.",of:"do",oldStyle:"propriedades de estilo para {0} já foram incorporados diretamente no. {1} ().",sameEdge:"bordas não podem vincular a si mesmos. removendo automaticamente borda de auto-referência {0}.",set:"{0} foi definido.",setLong:"{0} foi definido para {1}.",setContainer:"por favor, defina um div utilizando .container()"},error:{accepted:"{0} não é um {1} reconhecido para visualizações {2}, favor usar um dos seguintes procedimentos: {3}.",connections:"Não há conexões disponíveis para {0}.",data:"Não há dados disponíveis",dataYear:"Não há dados disponíveis para {0}.",lib:"A visualização {0} necessita que seja carregado a biblioteca {1}.",libs:"A visualização {0} necessita que seja carregado as bibliotecas {1}.",method:"A visualização {0} exige a definição do método {1}.",methods:"A visualização {0} exige a definição dos métodos {1}."},lowercase:["um","uma","e","como","em","no","na","mas","por","para","pelo","pela","de","do","da","se","perto","nem","ou","que","o","a","com","v"],method:{active:"segmentos activos",color:"cor",depth:"profundidade",dev:"verboso",focus:"foco",icon:"ícone",id:"identificador",height:"altura",labels:"etiquetas",legend:"legenda",margin:"margem",messages:"mensagens de status",order:"ordenar",search:"pesquisar",shape:"forma",size:"tamanho",style:"estilo",temp:"segmentos temporários",text:"texto",time:"Tempo",timeline:"cronograma",total:"segmentos totais",type:"digitar",width:"largura",x:"eixo x",y:"eixo y",zoom:"zoom",mode:"modo",mute:"ocultar",solo:"isolar"},time:["data","dia","mês","hora","ano"],visualization:{bubbles:"Bolhas",chart:"Gráfico",geo_map:"Mapa",line:"Gráfico de Linha",network:"Rede",rings:"Anéis",scatter:"dispersão",stacked:"Evolução",tree_map:"Tree Map",bar:"Gráfico de Barras",box:"box Plot",paths:"caminhos",pie:"Carta de torta",table:"Mesa"},ui:{and:"e",back:"voltar",collapse:"clique para entrar em colapso",error:"erro",expand:"clique para expandir",loading:"carregando ...",more:"mais {0}",moreInfo:"Clique para mais informações",noResults:"nenhum resultado para {0}.",primary:"conexões primárias",share:"participação",total:"total",values:"valores",including:"Incluindo",or:"ou",iqr:"intervalo interquartil para {0}",max:"máximo",min:"mínimo",percentile:"{0} percentil",tukey_bottom:"tukey bottom",tukey_top:"tukey topo",quartile_first:"primeiro quartil",quartile_third:"terceiro quartil",median:"mediana"},message:{data:"analisando dados",draw:"desenhando visualização",initializing:"inicializando {0}",loading:"carregando dados",tooltipReset:"redefinindo as dicas",ui:"atualizando interface"},uppercase:["CEO","CEOs","CFO","CFOs","CNC","COO","COOs","CPU","CPUs","PIB","HVAC","ID","TI","P&D","TV","IU"]}},{}],76:[function(e,t,r){t.exports={format:{decimal:",",thousands:".",grouping:[3],currency:["€",""],dateTime:"%A, %e de %B de %Y. %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],shortDays:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],shortMonths:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"]},error:{accepted:"{0} não é uma {1} válida para a visualização {2}, por favor escolha uma das seguintes: {3}.",connections:"não existem ligações disponíveis para {0}.",data:"não existem dados disponíveis",dataYear:"não existem dados disponíveis para {0}.",lib:"a visualização {0} necessita que a biblioteca {1} seja carregada.",libs:"a visualização {0} necessita que as seguintes bibliotecas sejam carregadas: {1}.",method:"A visualização {0} exige a definição do método {1}.",methods:"A visualização {0} exige a definição dos seguintes métodos {1}."},lowercase:["um","uma","e","como","em","no","na","mas","por","para","pelo","pela","de","do","da","se","perto","nem","ou","que","o","a","com","v"],method:{active:"segmentos activos",color:"cor",depth:"profundidade",dev:"verboso",focus:"foco",icon:"ícone",id:"identificador",height:"altura",labels:"etiquetas",legend:"legenda",margin:"margem",messages:"estado",order:"ordenar",search:"pesquisar",shape:"forma",size:"tamanho",style:"estilo",temp:"segmentos temporários",text:"texto",time:"tempo",timeline:"linha temporal",total:"segmentos totais",type:"digitar",width:"largura",x:"eixo dos xx",y:"eixo dos yy",zoom:"zoom",mode:"modo",mute:"ocultar",solo:"isolar"},time:["data","dia","mês","hora","ano"],visualization:{bubbles:"Bolhas",chart:"Diagrama",geo_map:"Mapa",line:"Gráfico de Linha",network:"Grafo",rings:"Anéis",scatter:"Gráfico de Dispersão",stacked:"Gráfico de Área",tree_map:"Tree Map",bar:"Gráfico de Barras",box:"Diagrama de Caixa e Bigodes",paths:"caminhos",pie:"Gráfico de Setores",table:"Mesa"},ui:{and:"e",back:"voltar",collapse:"Clique para colapsar",error:"erro",expand:"clique para expandir",loading:"a carregar ...",more:"mais {0}",moreInfo:"Clique para mais informações",noResults:"nenhum resultado para {0}.",primary:"ligações principais",share:"proporção",total:"total",values:"valores",including:"Incluindo",or:"ou",iqr:"intervalo interquartil para {0}",max:"máximo",min:"mínimo",percentile:"{0} percentil",tukey_bottom:"tukey bottom",tukey_top:"tukey topo",quartile_first:"primeiro quartil",quartile_third:"terceiro quartil",median:"mediana"},message:{data:"a analisar os dados",draw:"a desenhar a visualização",initializing:"a inicializar {0}",loading:"a carregar os dados",tooltipReset:"a actualizar as caixas de informação",ui:"a actualizar o interface"},uppercase:["CEO","CEOs","CFO","CFOs","CNC","COO","COOs","CPU","CPUs","PIB","HVAC","ID","TI","I&D","TV","IU"]}},{}],77:[function(e,t,r){t.exports={format:{decimal:",",thousands:" ",grouping:[3],currency:[""," руб."],dateTime:"%A, %e %B %Y г. %X",date:"%d.%m.%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],shortDays:["вс","пн","вт","ср","чт","пт","сб"],months:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"],shortMonths:["янв","фев","мар","апр","май","июн","июл","авг","сен","окт","ноя","дек"]},error:{accepted:"{0} не является обслуживаемым {1} для {2} визуализаций, пожалуйста, используйте одно из следующих действий: {3}.",connections:"нет соединений, доступных для {0}.",data:"данные недоступны",dataYear:"нет данных для {0}.",lib:"{0} визуализаций требуют загрузки {1} библиотеки.",libs:"{0} визуализаций требует загрузки следующие библиотеки: {1}.",method:"{0} визуализаций требуют установки {1} метод.",methods:"{0} визуализаций требуют установки следующих методов: {1}."},lowercase:["и","как","в","но","для","из","если в","в","недалеко","ни","на","на","или","в","что","к","с","с помощью","против","против"],method:{active:"активные сегменты",color:"цвет",depth:"глубина",dev:"подробный",focus:"фокус",icon:"значок",id:"Я бы",height:"высота",labels:"надписи",legend:"легенда",margin:"поле",messages:"сообщения о состоянии",order:"заказ",search:"поиск",shape:"форма",size:"размер",style:"стиль",temp:"временные сегменты",text:"текст",time:"время",timeline:"график",total:"всего сегментов",type:"тип",width:"ширина",x:"ось х",y:"ось Y",zoom:"масштаб",mode:"Режим",mute:"скрывать",solo:"изолировать"},time:["дата","день недели","месяц","время","год"],visualization:{bubbles:"Пузыри",chart:"Диаграмма",geo_map:"Карта Geo",line:"линия Участок",network:"сеть",rings:"Кольца",scatter:"Scatter Plot",stacked:"Stacked Площадь",tree_map:"Дерево Карта",bar:"гистограмма",box:"Box Участок",paths:"пути",pie:"Круговая диаграмма",table:"Таблица"},ui:{and:"а также",back:"назад",collapse:"нажмите, чтобы свернуть",error:"ошибка",expand:"нажмите, чтобы развернуть",loading:"загрузка ...",more:"{0} более",moreInfo:"нажмите для получения дополнительной информации",noResults:"нет результатов, соответствующих {0}.",primary:"первичные соединения",share:"доля",total:"Всего",values:"значения",including:"в том числе",or:"или",iqr:"межквартильный диапазон для {0}",max:"максимальная",min:"минимальный",percentile:"{0} процентиль",tukey_bottom:"нижний Тьюки",tukey_top:"сверху Тьюки",quartile_first:"первый квартиль",quartile_third:"третий квартиль",median:"медиана"},message:{data:"данные анализа",draw:"рисование визуализация",initializing:"инициализацией {0}",loading:"Загрузка данных",tooltipReset:"сброс всплывающих подсказок",ui:"обновление пользовательского интерфейса"},uppercase:["ID"]}},{}],78:[function(e,t,r){t.exports={format:{decimal:".",thousands:",",grouping:[3],currency:["¥",""],dateTime:"%A %B %e %Y %X",date:"%Y/%-m/%-d",time:"%H:%M:%S",periods:["上午","下午"],days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],shortDays:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],shortMonths:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},error:{accepted:"{0}对于{2}的可视化效果并不是一个可接受的{1}, 请使用如下的一个:{3}.",connections:"没有对{0}可用的连接。",data:"无可用数据",dataYear:"没有数据对{0}可用。",lib:"{0}的可视化要求装载{1}库。",libs:"{0}的可视化需要加载以下库:{1}。",method:"{0}的可视化要求设置{1}方法。",methods:"{0}的可视化要求设置以下方法:{1}。"},lowercase:["一个","和","在","但是","在...里","的","或者","这","向","与...一起"],method:{active:"活跃段",color:"颜色",depth:"深度",dev:"详细",focus:"焦点",icon:"图标",id:"身份认证",height:"高度",labels:"标签",legend:"图例注释",margin:"外边距",messages:"状态消息",order:"规则",search:"搜索",shape:"形状",size:"大小",style:"样式",temp:"暂时性区段",text:"文本",time:"时间",timeline:"时间轴",total:"总段",type:"类型",width:"宽度",x:"X轴",y:"Y轴",zoom:"缩放",mode:"模式",mute:"隐藏",solo:"隔离"},time:["日","星期","月","时间","年"],visualization:{bubbles:"气泡",chart:"图表",geo_map:"地理地图",line:"线图",network:"网络",rings:"特性",scatter:"散点图",stacked:"堆积面积图",tree_map:"树图",bar:"条图",box:"箱形图",paths:"路径",pie:"饼形图",table:"表"},ui:{and:"和",back:"后面",collapse:"点击合并",error:"错误",expand:"单击以展开",loading:"载入中...",more:"{0}更多",moreInfo:"点击了解更多信息",noResults:"没有结果匹配{0}。",primary:"主要连接",share:"共享",total:"总",values:"值",including:"包括",or:"要么",iqr:"间距范围为{0}",max:"最大值",min:"最低限度",percentile:"{0}百分",tukey_bottom:"底部杜克",tukey_top:"顶部杜克",quartile_first:"第一个四分位数",quartile_third:"第三个四分位数",median:"中位数"},message:{data:"分析数据",draw:"绘制可视化",initializing:"初始化{0}",loading:"加载数据",tooltipReset:"重置工具提示",ui:"更新UI"},uppercase:["CEO","CEOs","CFO","CFOs","CNC","COO","COOs","CPU","CPUs","GDP","HVAC","ID","电视","用户界面","研发"]}},{}],79:[function(e,t,r){t.exports={de_DE:e("./languages/de_DE.js"),en_US:e("./languages/en_US.coffee"),es_ES:e("./languages/es_ES.js"),fr_FR:e("./languages/fr_FR.js"),ko_KR:e("./languages/ko_KR.js"),mk_MK:e("./languages/mk_MK.js"),pt_BR:e("./languages/pt_BR.js"),pt_PT:e("./languages/pt_PT.js"),ru_RU:e("./languages/ru_RU.js"),zh_CN:e("./languages/zh_CN.js")}},{"./languages/de_DE.js":69,"./languages/en_US.coffee":70,"./languages/es_ES.js":71,"./languages/fr_FR.js":72,"./languages/ko_KR.js":73,"./languages/mk_MK.js":74,"./languages/pt_BR.js":75,"./languages/pt_PT.js":76,"./languages/ru_RU.js":77,"./languages/zh_CN.js":78}],80:[function(e,t,r){var n,a,o,i,s,l,u,c,f;a=e("../../util/copy.coffee"),s=e("../console/print.coffee"),l=e("./process/detect.coffee"),u=e("./set.coffee"),c=e("../../string/format.js"),f=e("../../object/validate.coffee"),t.exports=function(e,t){var r,n,s;s=[];for(r in t)n=t[r],e[r]=a(n),e[r].initialized=i(e,e[r],r),s.push(e.self[r]=o(e,r));return s},i=function(e,t,r,n){var a,o,u,d,p;t.previous=!1,t.changed=!1,t.initialized=!1,t.callback=!1,"init"in t&&!("value"in t)&&(t.value=t.init(e),delete t.init),"process"in t&&(t.value=l(e,t,t.value));for(p in t)if("deprecates"===p)for(o=t[p]instanceof Array?t[p]:[t[p]],u=0,d=o.length;u<d;u++)a=o[u],e.self[a]=function(t,r){return function(a){var o,i,l;return l=e.format.locale.value.dev.deprecated,t="."+t+"()",i=n?'"'+r+'" in .'+n+"()":"."+r+"()",o=n||r,s.error(c(l,t,i),o),e.self}}(a,r);else"global"===p?r in e||(e[r]=[]):"value"!==p&&f(t[p])&&i(e,t[p],p,r);return!0},o=function(e,t){return function(r,a){var o,i,l,u,d,p,h,v;if(o="accepted"in e[t]?e[t].accepted:null,"function"==typeof o&&(o=o(e)),o instanceof Array||(o=[o]),r===Object)return e[t];if(!arguments.length&&o.indexOf(void 0)<0)return"value"in e[t]?e[t].value:e[t];if("style"===t&&"object"==typeof r){v=e.format.locale.value.dev.oldStyle;for(p in r)s.warning(c(v,'"'+p+'"',p),p),e.self[p](r[p])}if("font"===t){"string"==typeof r&&(r={family:r}),h=!0,l=function(e,t,r,n){f(e[r])&&t in e[r]&&(f(e[r][t])?e[r][t].process?e[r][t].value=e[r][t].process(n):e[r][t].value=n:e[r][t]=n)},i=function(e,t,r){var n;if(f(e)){if(h)for(n in e)l(e,t,n,r);else"font"in e&&l(e,t,"font",r);h=!1;for(n in e)i(e[n],t,r)}};for(u in r)d=r[u],"secondary"!==u&&(f(d)&&(d=d.value),d&&i(e,u,d))}return n(e,t,e,t,r),"function"==typeof a&&(e[t].callback=a),e[t].chainable===!1?e[t].value:e.self}},n=function(e,t,r,a,o){var i,s,l,c;if(["accepted","changed","initialized","previous","process"].indexOf(a)<0)if(c=f(o),l=f(r[a])&&"objectAccess"in r[a]&&r[a].objectAccess===!1,i=c&&(l||!("value"in o)&&(!f(r[a])||!(d3.keys(o)[0]in r[a]))),null===o||!c||i)u(e,t,r,a,o);else if(c)for(s in o)n(e,t,r[a],s,o[s])}},{"../../object/validate.coffee":172,"../../string/format.js":173,"../../util/copy.coffee":207,"../console/print.coffee":52,"./process/detect.coffee":88,"./set.coffee":94}],81:[function(e,t,r){t.exports=function(e){return e||(e=!1),{accepted:[!1,Array,Function,Number,Object,String],callback:{accepted:[!1,Function],value:!1},global:e,process:Array,value:[]}}},{}],82:[function(e,t,r){var n;n=e("../../../client/rtl.coffee"),t.exports=function(e){var t;return t=["left","center","right"],e===!1&&t.unshift(!1),t.indexOf(e)<0&&(e="left"),{accepted:t,process:function(e){return n?"left"===e?"right":"right"===e?"left":e:e},value:e}}},{"../../../client/rtl.coffee":40}],83:[function(e,t,r){t.exports=function(e){var t;return t=["line-through","none","overline","underline"],e===!1&&t.unshift(!1),t.indexOf(e)<0&&(e="none"),{accepted:t,value:e}}},{}],84:[function(e,t,r){var n,a;a=e("../../../font/validate.coffee"),n=["Helvetica Neue","HelveticaNeue","Helvetica","Arial","sans-serif"],t.exports=function(e){return void 0===e&&(e=n),{process:a,value:e}}},{"../../../font/validate.coffee":103}],85:[function(e,t,r){t.exports=function(e){var t;return t=["top","middle","bottom"],e===!1&&t.unshift(!1),t.indexOf(e)<0&&(e="bottom"),{accepted:t,mapping:{top:"0ex",middle:"0.5ex",bottom:"1ex"},process:function(e){return this.text=e,this.mapping[e]},value:e}}},{}],86:[function(e,t,r){t.exports=function(e){var t;return t=["capitalize","lowercase","none","uppercase"],e===!1&&t.unshift(!1),t.indexOf(e)<0&&(e="none"),{accepted:t,value:e}}},{}],87:[function(e,t,r){t.exports=function(e,t,r){var n;return t.history&&t.history.reset(),e.constructor===String?e.indexOf("/")>=0?(r.url=e,[]):(n=d3.selectAll(e),n.size()?n:(e.indexOf(".")>=0&&(r.url=e),[])):e}},{}],88:[function(e,t,r){var n,a;n=e("../../../util/copy.coffee"),a=e("../../../array/update.coffee"),t.exports=function(e,t,r){return t.process===Array?a(n(t.value),r):"object"==typeof t.process&&"string"==typeof r?t.process[r]:"function"==typeof t.process?t.process(r,e,t):r}},{"../../../array/update.coffee":35,"../../../util/copy.coffee":207}],89:[function(e,t,r){var n;n=e("../../../client/css.coffee"),t.exports=function(e,t,r){return e===!1||e.indexOf("fa-")<0||0===e.indexOf("fa-")&&n("font-awesome")?e:r.fallback}},{"../../../client/css.coffee":36}],90:[function(e,t,r){t.exports=function(e,t){var r,n,a,o,i,s,l,u,c,f,d,p,h;if("string"==typeof e){for(e=e.split(" "),r=n=0,i=e.length;n<i;r=++n)h=e[r],e[r]=parseFloat(h,10);e=1===e.length?e[0]:2===e.length?{top:e[0],right:e[1],bottom:e[0],left:e[1]}:3===e.length?{top:e[0],right:e[1],bottom:e[2],left:e[1]}:4===e.length?{top:e[0],right:e[1],bottom:e[2],left:e[3]}:0}if(p=["top","right","bottom","left"],"number"==typeof e)for(a=0,s=p.length;a<s;a++)d=p[a],t[d]=e;else for(o=0,l=p.length;o<l;o++)d=p[o],t[d]=e[d];for(t.css="",f=[],r=c=0,u=p.length;c<u;r=++c)d=p[r],r&&(t.css+=" "),f.push(t.css+=t[d]+"px");return f}},{}],91:[function(e,t,r){var n,a,o,i;n=e("../../array/contains.coffee"),a=e("../../string/format.js"),o=e("../../string/list.coffee"),i=e("../console/print.coffee"),t.exports=function(e,t,r,s,l){var u,c,f,d,p,h,v,g;if("function"==typeof t&&(t=t(e)),t instanceof Array||(t=[t]),c=n(t,r),c===!1&&void 0!==r){for(h=[],g=JSON.stringify(r),"string"!=typeof r&&(g='"'+g+'"'),d=0,p=t.length;d<p;d++)u=t[d],"string"==typeof u?h.push('"'+u+'"'):"function"==typeof u?h.push(u.toString().split("()")[0].substring(9)):void 0===u?h.push("undefined"):h.push(JSON.stringify(u));h=o(h,e.format.locale.value.ui.or),e.type&&["mode","shape"].indexOf(s)>=0?(v=e.format.locale.value.error.accepted,f=e.format.locale.value.visualization[e.type.value]||e.type.value,i.warning(a(v,g,s,f,h),s)):(v=e.format.locale.value.dev.accepted,i.warning(a(v,g,l,h),s))}return!c}},{"../../array/contains.coffee":33,"../../string/format.js":173,"../../string/list.coffee":174,"../console/print.coffee":52}],92:[function(e,t,r){t.exports=function(e){var t;return t=["auto","optimizeSpeed","crispEdges","geometricPrecision"],t.indexOf(e)>=0||(e="crispEdges"),{accepted:t,value:e}}},{}],93:[function(e,t,r){var n,a;a=e("../../object/validate.coffee"),n=function(e,t){var r;e.changed&&(e.changed=!1),"draw"===t&&(e.frozen=!1,e.update=!0,e.first=!1);for(r in e)r.indexOf("d3plus")<0&&a(e[r])&&n(e[r],r)},t.exports=n},{"../../object/validate.coffee":172}],94:[function(e,t,r){var n,a,o,i,s,l,u,c,f;n=e("../../util/copy.coffee"),a=e("../../util/d3selection.coffee"),f=e("../../object/validate.coffee"),o=e("../../object/merge.coffee"),i=e("../console/print.coffee"),s=e("./process/detect.coffee"),l=e("./rejected.coffee"),u=e("../../string/format.js"),c=e("../../array/update.coffee"),t.exports=function(e,t,r,d,p){var h,v,g,m,y,x,b,w,_,k,z,A,j,M;if(A="value"!==d&&d&&d!==t?'"'+d+'" '+e.format.locale.value.dev.of+" ."+t+"()":"."+t+"()",h="value"===d&&"accepted"in r?r.accepted:f(r[d])&&"accepted"in r[d]?r[d].accepted:[p],!l(e,h,p,t,A)){if(f(r[d])&&"value"in r[d]&&(k=d,r=r[d],d="value"),"value"===d&&"process"in r&&(p=s(e,r,p)),r[d]instanceof Array||r[d]!==p||void 0===p){if(r.changed=!0,r.loaded&&(r.loaded=!1),"history"in e&&"draw"!==t&&(v=n(r),v.method=t,e.history.chain.push(v)),r.previous=r[d],"id"in e&&"value"===d&&"nesting"in r)if("id"!==t){if("object"!=typeof r.nesting&&(r.nesting={}),f(p)){for(x in p)"string"==typeof p[x]&&(p[x]=[p[x]]);r.nesting=o(r.nesting,p),e.id.value in r.nesting||(r.nesting[e.id.value]=p[d3.keys(p)[0]])}else p instanceof Array?r.nesting[e.id.value]=p:r.nesting[e.id.value]=[p];r[d]=r.nesting[e.id.value][0]}else p instanceof Array?(r.nesting=p,"depth"in e&&e.depth.value<p.length?r[d]=p[e.depth.value]:(r[d]=p[0],"depth"in e&&(e.depth.value=0))):(r[d]=p,r.nesting=[p],"depth"in e&&(e.depth.value=0));else"depth"===t?(p>=e.id.nesting.length?e.depth.value=e.id.nesting.length-1:p<0?e.depth.value=0:e.depth.value=p,e.id.value=e.id.nesting[e.depth.value],"object"==typeof e.text.nesting&&(_=e.text.nesting[e.id.value],_&&(e.text.nesting[e.id.value]="string"==typeof _?[_]:_,e.text.value=_ instanceof Array?_[0]:_))):f(r[d])&&f(p)?r[d]=o(r[d],p):r[d]=p;"value"===d&&r.global&&(y=r[d].length>0,b=k||d,b in e&&(y&&e.data[b].indexOf(t)<0||!y&&e.data[b].indexOf(t)>=0)&&(e.data[b]=c(e.data[b],t))),"value"===d&&r.dataFilter&&e.data&&e.data.filters.indexOf(t)<0&&e.data.filters.push(t),e.dev.value&&r.changed&&void 0!==r[d]&&(w=r[d]instanceof Array&&r[d].length>10,m=a(r[d]),j="function"==typeof r[d],M=w||m||j?null:"string"==typeof r[d]?r[d]:JSON.stringify(r[d]),null!==M&&M.length<260?(z=e.format.locale.value.dev.setLong,i.log(u(z,A,'"'+M+'"'))):(z=e.format.locale.value.dev.set,i.log(u(z,A))))}else z=e.format.locale.value.dev.noChange,e.dev.value&&i.comment(u(z,A));"value"===d&&r.callback&&!r.url&&(g="function"==typeof r.callback?r.callback:r.callback.value,g&&g(p,e.self))}}},{"../../array/update.coffee":35,"../../object/merge.coffee":171,"../../object/validate.coffee":172,"../../string/format.js":173,"../../util/copy.coffee":207,"../../util/d3selection.coffee":208,"../console/print.coffee":52,"./process/detect.coffee":88,"./rejected.coffee":91}],95:[function(e,t,r){var n=e("../console/print.coffee"),a=e("../../string/format.js");t.exports=function(e){if(e.dev.value){var t="analyzing edges list";n.time(t)}var r=e.types[e.type.value].requirements;r instanceof Array||(r=[r]);var o=r.indexOf("nodes")>=0&&!e.nodes.value;if(o){e.nodes.value=[];var i=[];e.nodes.changed=!0}e.edges.value.forEach(function(t){["source","target"].forEach(function(r){var n=typeof t[e.edges[r]];if("object"!==n)if("number"!==n||o||"number"===e.data.keys[e.id.value])if(o&&i.indexOf(t[e.edges[r]])>=0)t[e.edges[r]]=e.nodes.value.filter(function(n){return n[e.id.value]===t[e.edges[r]]})[0];else{var a={};a[e.id.value]=t[e.edges[r]],t[e.edges[r]]=a}else t[e.edges[r]]=e.nodes.value[t[e.edges[r]]];var s=t[e.edges[r]];o&&i.indexOf(s[e.id.value])<0&&(i.push(s[e.id.value]),e.nodes.value.push(s))}),"keys"in e.data||(e.data.keys={}),e.id.value in e.data.keys||(e.data.keys[e.id.value]=typeof t[e.edges.source][e.id.value])}),e.edges.value=e.edges.value.filter(function(t){var r=t[e.edges.source][e.id.value],o=t[e.edges.target][e.id.value];if(r===o){var i=e.format.locale.value.dev.sameEdge;return n.warning(a(i,'"'+r+'"'),"edges"),!1}return!0}),e.edges.linked=!0,e.dev.value&&n.timeEnd(t)}},{"../../string/format.js":173,"../console/print.coffee":52}],96:[function(e,t,r){var n=e("./hideElement.js");t.exports=function(e){function t(e,t){[].forEach.call(t.attributes,function(t){if(/^data-/.test(t.name)){var r=t.name.substr(5).replace(/-(.)/g,function(e,t){return t.toUpperCase()});e[r]=t.value}}),r.forEach(function(r){null!==t.getAttribute(r)&&(e[r]=t.getAttribute(r))})}var r=[e.color.value,e.icon.value,e.keywords.value,e.alt.value,"style"];e.text.value||e.self.text("text"),r=r.concat(e.id.nesting),e.self.data({element:e.data.value});var a=e.data.element.value.node().tagName.toLowerCase(),o=e.data.element.value.attr("type"),i=[];if("select"===a){var s=e.data.element.value.node().id;s&&e.self.container({id:s}),e.data.element.value.selectAll("option").each(function(r,n){var a={};if(a.text=d3.select(this).text(),t(a,this),i.push(a),this.selected)for(var n=e.id.nesting.length-1;n>=0;n--){var o=e.id.nesting[n];if(o in a){e.self.focus(a[o]);break}}})}else if("input"===a&&"radio"===o){var l=e.data.element.value.node().getAttribute("name");l&&e.self.container({id:l}),e.data.element.value.each(function(r,a){var o={};t(o,this);var s=o[e.id.value]||this.id||!1;if(s&&isNaN(parseFloat(s))){var l=d3.select("label[for="+s+"]");l.empty()||(o.text=l.html(),l.call(n))}i.push(o),this.checked&&e.self.focus(o[e.id.value])})}!e.focus.value.length&&i.length&&(e.data.element.value.node().selectedIndex=0,e.self.focus(i[0][e.id.value]));var u=d3.select("legend[for="+e.container.id+"]");u.empty()||(e.self.title(u.html()),u.call(n));var c=!!e.container.value&&e.container.value.node().tagName.toLowerCase();return e.container.value!==!1&&"body"!==c||(e.container.value=d3.select(e.data.element.value.node().parentNode)),e.data.element.value.call(n),i}},{"./hideElement.js":97}],97:[function(e,t,r){t.exports=function(e){e.style("position","absolute","important").style("clip","rect(1px 1px 1px 1px)","important").style("clip","rect(1px, 1px, 1px, 1px)","important").style("width","1px","important").style("height","1px","important").style("margin","-1px","important").style("padding","0","important").style("border","0","important").style("overflow","hidden","important")}},{}],98:[function(e,t,r){var n=e("../console/print.coffee");t.exports=function(e){if("network"===e.type.value){if(e.dev.value){var t="analyzing node positions";n.time(t)}var r=e.nodes.value.filter(function(e){return"number"==typeof e.x&&"number"==typeof e.y}).length;if(r===e.nodes.value.length)e.nodes.positions=!0;else{var a=d3.layout.force().size([e.width.viz,e.height.viz]).nodes(e.nodes.value).links(e.edges.value),o=e.edges.strength.value;o&&("string"==typeof o?a.linkStrength(function(e){return e[o]}):a.linkStrength(o));var i=50,s=.01;a.start();for(var l=i;l>0&&(a.tick(),!(a.alpha()<s));--l);a.stop(),e.nodes.positions=!0}e.dev.value&&n.timeEnd(t)}}},{"../console/print.coffee":52}],99:[function(e,t,r){var n;n=e("numeric"),t.exports=function(e,t){var r,a,o,i,s,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M;for(null==t&&(t={}),null==t.maxDegree&&(t.maxDegree=5),r=e.length,x=Number.MAX_VALUE,s=null,o=function(){var r,n,a;for(a=[],c=r=1,n=t.maxDegree+1;1<=n?r<n:r>n;c=1<=n?++r:--r)a.push(function(){var t,r,n;for(n=[],r=0,t=e.length;r<t;r++)y=e[r],n.push(Math.pow(y[0],c));return n}());return a}(),j=function(){var t,r,n;for(n=[],t=0,r=e.length;t<r;t++)y=e[t],n.push(y[1]);return n}(),d=v=0,w=1<<t.maxDegree;0<=w?v<w:v>w;d=0<=w?++v:--v){for(i=[function(){var e,t,n;for(n=[],b=e=0,t=r;0<=t?e<t:e>t;b=0<=t?++e:--e)n.push(1);return n}()],f=[0],p=m=0,_=t.maxDegree;0<=_?m<_:m>_;p=0<=_?++m:--m)(d&1<<p)>0&&(i.push(o[p]),f.push(p+1));a=n.transpose(i),h=f.length,l=n.dot(n.dot(n.inv(n.dot(i,a)),i),j),M=n.dot(a,l),k=n.sub(j,M),A=n.dot(k,k),z=A/(r-h),g=-.5*r*Math.log(2*Math.PI)-.5*r*Math.log(z)-A/(2*z),u=-2*g+h*(Math.log(r)-Math.log(2*Math.PI)),u<x&&(x=u,s=[f,l,M])}return s}},{numeric:7}],100:[function(e,t,r){var n;n=e("static-kdtree"),t.exports=function(e,t){var r,a,o,i,s,l,u,c,f,d,p,h;return null==t&&(t=10),h=n(e),u=function(){var r,n,a;for(a=[],r=0,n=e.length;r<n;r++)c=e[r],a.push(h.knn(c,t+1).slice(1));return a}(),p=function(t,r){var n,a,o,i,s,l;for(n=e[t],a=e[r],i=0,t=s=0,l=n.length;0<=l?s<l:s>l;t=0<=l?++s:--s)o=n[t]-a[t],i+=o*o;return i},i=function(){var r,n,o;for(o=[],a=r=0,n=e.length;0<=n?r<n:r>n;a=0<=n?++r:--r)o.push(p(a,u[a][t-1]));return o}(),f=function(e,t){return Math.max(p(e,t),i[t])},s=function(e){var r,n,a,o,i;for(o=0,i=u[e],n=0,a=i.length;n<a;n++)r=i[n],o+=f(e,r);return t/o},l=function(){var t,r,n;for(n=[],a=t=0,r=e.length;0<=r?t<r:t>r;a=0<=r?++t:--t)n.push(s(a));return n}(),d=function(){var n,i,s,c,f,d;for(d=[],a=n=0,c=e.length;0<=c?n<c:n>c;a=0<=c?++n:--n){for(r=0,f=u[a],i=0,s=f.length;i<s;i++)o=f[i],r+=l[o];r/=t,d.push([a,r/l[a]])}return d}(),d.sort(function(e,t){return t[1]-e[1]})}},{"static-kdtree":9}],101:[function(e,t,r){t.exports=function(e){var t,r,n;return r=d3.median(e),t=d3.median(e.map(function(e){return Math.abs(e-r)})),n=e.map(function(e,n){return[n,Math.abs(e-r)/t]}),n.sort(function(e,t){return t[1]-e[1]})}},{}],102:[function(e,t,r){var n;n=e("../core/font/tester.coffee"),t.exports=function(e,t,r){var a,o,i,s,l,u,c;return r||(r={}),t=t||{},u=r.parent||n("svg").append("text"),s=[],e instanceof Array||(e=[e]),c=u.selectAll("tspan").data(e),a={left:"0px",position:"absolute",top:"0px",x:0,y:0},l=0,"letter-spacing"in t&&(l=parseFloat(t["letter-spacing"]),delete t["letter-spacing"]),i=function(e){var t;return t=0,l&&(t=(d3.select(e).text().length-1)*l),e.getComputedTextLength()+t},o=function(e){return e.parentNode.getBBox().height||e.getBoundingClientRect().height},c.enter().append("tspan").text(String).style(t).attr(a).each(function(e){if("function"==typeof r.mod)return r.mod(this)}).each(function(e){var t,r,n;return t=d3.select(this).selectAll("tspan"),t.size()?(n=[],t.each(function(){return n.push(i(this))}),n=d3.max(n)):n=i(this),r=o(this),s.push({height:r,text:e,width:n})}),c.remove(),r.parent||u.remove(),s}},{"../core/font/tester.coffee":68}],103:[function(e,t,r){var n,a;n=e("../core/font/tester.coffee"),a=function(e){var t,r,o,i,s,l,u,c,f,d,p,h,v,g;for(e instanceof Array||(e=e.split(",")),s=0,u=e.length;s<u;s++)o=e[s],o.trim();if(i=e.join(", "),t=a.complete,i in t)return t[i];for(p=function(e){return v.append("span").style("font-family",e).style("font-size","32px").style("padding","0px").style("margin","0px").text("abcdefghiABCDEFGHI_!@#$%^&*()_+1234567890")},h=function(e,t){var r,n,a;return r=p(e),n=r.node().offsetWidth,a=t.node().offsetWidth,r.remove(),n!==a},v=n("div"),f=p("monospace"),d=p("sans-serif"),l=0,c=e.length;l<c;l++)if(r=e[l],g=h(r+",monospace",f),g||(g=h(r+",sans-serif",d)),g){g=r;break}return g||(g="sans-serif"),f.remove(),d.remove(),t[i]=g,g},a.complete={},t.exports=a},{"../core/font/tester.coffee":68}],104:[function(e,t,r){var n=e("../array/sort.coffee"),a=e("../core/methods/attach.coffee"),o=e("../core/data/format.js"),i=e("../core/data/keys.coffee"),s=e("../core/data/load.coffee"),l=e("../core/fetch/data.js"),u=e("../client/ie.js"),c=e("../core/methods/reset.coffee"),f=e("../core/console/print.coffee");t.exports=function(){var t={types:{auto:e("./types/auto.js"),button:e("./types/button/button.coffee"),drop:e("./types/drop/drop.coffee"),toggle:e("./types/toggle.js")}};return t.self=function(e){var r=t.data.value instanceof Array&&t.data.value.length>t.data.large;if(t.draw.timing=t.draw.first||r||u?0:t.timing.ui,t.data.value instanceof Array){if(t.dev.value&&f.group('drawing "'+t.type.value+'"'),t.data.changed&&(t.data.cache={},i(t,"data"),o(t)),t.data.viz=l(t),t.data.sort.value&&(t.data.changed||t.order.changed||t.order.sort.changed)&&n(t.data.viz,t.order.value||t.text.value,t.order.sort.value,t.color.value,t),t.focus.value===!1&&["auto","button"].indexOf(t.type.value)<0){var a=t.data.element.value;if(a&&"select"===a.node().tagName.toLowerCase()){var d=a.property("selectedIndex");d=d<0?0:d;var p=a.selectAll("option")[0][d],h=p.getAttribute("data-"+t.id.value)||p.getAttribute(t.id.value);h&&(t.focus.value=h)}t.focus.value===!1&&t.data.viz.length&&(t.focus.value=t.data.viz[0][t.id.value]),t.dev.value&&t.focus.value!==!1&&f.log('"value" set to "'+t.focus.value+'"')}var v=function(e,r){r="number"!=typeof r?1===t.id.nesting.length?0:t.id.nesting.length-1:r;var n=t.id.nesting[r];return r>0&&(!(n in e)||e[n]instanceof Array)?v(e,r-1):n};if(t.data.changed){"auto"===t.search.value?t.data.viz.length>10?(t.search.enabled=!0,t.dev.value&&f.log("Search enabled.")):(t.search.enabled=!1,t.dev.value&&f.log("Search disabled.")):t.search.enabled=t.search.value;var g=t.data.element.value?t.data.element.value.node().tagName.toLowerCase():"";if(t.data.element.value&&"select"===g){var m=[];for(var y in t.data.nested.all)m=m.concat(t.data.nested.all[y]);options=t.data.element.value.selectAll("option").data(m,function(e){var t=!!e&&v(e);return!!(e&&t in e)&&e[t]}),options.exit().remove(),options.enter().append("option"),options.each(function(e){var r=v(e),n=r===t.id.value?t.text.value||t.id.value:t.text.nesting!==!0&&r in t.text.nesting?t.text.nesting[r]:r;for(var a in e)"object"!=typeof e[a]&&(a===n&&d3.select(this).html(e[a]),["alt","value"].indexOf(a)>=0?d3.select(this).attr(a,e[a]):d3.select(this).attr("data-"+a,e[a]));e[r]===t.focus.value?this.selected=!0:this.selected=!1})}}else if(t.focus.changed&&t.data.element.value){var x=t.data.element.value.node().tagName.toLowerCase();if("select"===x)t.data.element.value.selectAll("option").each(function(e){e[v(e)]===t.focus.value?this.selected=!0:this.selected=!1});else{var x=t.data.element.value.attr("type").toLowerCase();"radio"===x&&t.data.element.value.each(function(e){ | |
| this.value===t.focus.value?this.checked=!0:this.checked=!1})}}if("auto"!==t.type.value){if(!t.container.ui){t.container.ui=t.container.value.selectAll("div#d3plus_"+t.type.value+"_"+t.container.id).data(["container"]);var b=t.data.element.value?t.data.element.value[0][0]:null;if(b)if(b.id)b="#"+b.id;else{var w=b.getAttribute(t.id.value)?t.id.value:"data-"+t.id.value;b=b.getAttribute(w)?"["+w+"="+b.getAttribute(w)+"]":null}t.container.ui.enter().insert("div",b).attr("id","d3plus_"+t.type.value+"_"+t.container.id).style("position","relative").style("overflow","visible").style("vertical-align","top")}t.container.ui.style("display",t.ui.display.value),t.container.ui.transition().duration(t.draw.timing).style("margin",t.ui.margin.css);var _=t.container.ui.selectAll("div.d3plus_title").data(t.title.value?[t.title.value]:[]);_.enter().insert("div","#d3plus_"+t.type.value+"_"+t.container.id).attr("class","d3plus_title").style("display","inline-block"),_.style("color",t.font.color).style("font-family",t.font.family.value).style("font-size",t.font.size+"px").style("font-weight",t.font.weight).style("padding",t.ui.padding.css).style("border-color","transparent").style("border-style","solid").style("border-width",t.ui.border+"px").text(String).each(function(e){t.margin.left=this.offsetWidth})}if(t.data.value.length){var k=t.format.locale.value.visualization[t.type.value];t.dev.value&&f.time("drawing "+k),t.types[t.type.value](t),t.dev.value&&f.timeEnd("drawing "+k)}else!t.data.url||t.data.loaded&&!t.data.stream||s(t,"data",t.self.draw);t.dev.value&&f.timeEnd("total draw time"),c(t)}},a(t,{active:e("./methods/active.coffee"),alt:e("./methods/alt.coffee"),color:e("./methods/color.coffee"),config:e("./methods/config.coffee"),container:e("./methods/container.coffee"),data:e("./methods/data.js"),depth:e("./methods/depth.coffee"),dev:e("./methods/dev.coffee"),draw:e("./methods/draw.js"),focus:e("./methods/focus.coffee"),font:e("./methods/font.coffee"),format:e("./methods/format.coffee"),height:e("./methods/height.coffee"),history:e("./methods/history.coffee"),hover:e("./methods/hover.coffee"),icon:e("./methods/icon.coffee"),id:e("./methods/id.coffee"),keywords:e("./methods/keywords.coffee"),margin:e("./methods/margin.coffee"),open:e("./methods/open.coffee"),order:e("./methods/order.coffee"),remove:e("./methods/remove.coffee"),search:e("./methods/search.coffee"),select:e("./methods/select.coffee"),selectAll:e("./methods/selectAll.coffee"),text:e("./methods/text.coffee"),timing:e("./methods/timing.coffee"),title:e("./methods/title.coffee"),type:e("./methods/type.coffee"),ui:e("./methods/ui.coffee"),width:e("./methods/width.coffee")}),t.self}},{"../array/sort.coffee":34,"../client/ie.js":37,"../core/console/print.coffee":52,"../core/data/format.js":56,"../core/data/keys.coffee":58,"../core/data/load.coffee":59,"../core/fetch/data.js":64,"../core/methods/attach.coffee":80,"../core/methods/reset.coffee":93,"./methods/active.coffee":105,"./methods/alt.coffee":106,"./methods/color.coffee":107,"./methods/config.coffee":108,"./methods/container.coffee":109,"./methods/data.js":110,"./methods/depth.coffee":111,"./methods/dev.coffee":112,"./methods/draw.js":113,"./methods/focus.coffee":114,"./methods/font.coffee":115,"./methods/format.coffee":116,"./methods/height.coffee":117,"./methods/history.coffee":118,"./methods/hover.coffee":119,"./methods/icon.coffee":120,"./methods/id.coffee":121,"./methods/keywords.coffee":122,"./methods/margin.coffee":123,"./methods/open.coffee":124,"./methods/order.coffee":125,"./methods/remove.coffee":126,"./methods/search.coffee":127,"./methods/select.coffee":128,"./methods/selectAll.coffee":129,"./methods/text.coffee":130,"./methods/timing.coffee":131,"./methods/title.coffee":132,"./methods/type.coffee":133,"./methods/ui.coffee":134,"./methods/width.coffee":135,"./types/auto.js":136,"./types/button/button.coffee":137,"./types/drop/drop.coffee":142,"./types/toggle.js":159}],105:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Array,Function,Number,String],value:!1}},{"../../core/methods/filter.coffee":81}],106:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],mute:n(!0),solo:n(!0),value:"alt"}},{"../../core/methods/filter.coffee":81}],107:[function(e,t,r){t.exports={accepted:[String],value:"color"}},{}],108:[function(e,t,r){t.exports={accepted:[Object],objectAccess:!1,process:function(e,t){var r,n;for(r in e)n=e[r],r in t.self&&t.self[r](n);return e},value:{}}},{}],109:[function(e,t,r){var n;n=e("../../util/d3selection.coffee"),t.exports={accepted:[!1,Array,Object,String],element:!1,id:"default",process:function(e){return e===!1?d3.select("body"):n(e)?e:e instanceof Array?d3.select(e[0][0]):(this.selector=e,d3.select(e))},value:d3.select("body")}},{"../../util/d3selection.coffee":208}],110:[function(e,t,r){var n=e("../../util/d3selection.coffee"),a=e("../../core/methods/process/data.coffee");t.exports={accepted:[!1,Array,Function,String],delimiter:{accepted:[String],value:"|"},element:{process:function(e,t){var r=!1;return n(e)?r=e:"string"!=typeof e||d3.select(e).empty()||(r=d3.select(e)),r&&t.self.container(d3.select(r.node().parentNode)),r},value:!1},filetype:{accepted:[!1,"json","xml","html","csv","dsv","tsv","txt"],value:!1},filters:[],large:400,mute:[],process:function(e,t){return"default"===t.container.id&&e.length&&t.self.container({id:"default"+e.length}),a(e,t,this)},solo:[],sort:{accepted:[Boolean],value:!1},value:!1}},{"../../core/methods/process/data.coffee":87,"../../util/d3selection.coffee":208}],111:[function(e,t,r){t.exports={accepted:[Number],value:0}},{}],112:[function(e,t,r){t.exports={accepted:[Boolean],value:!1}},{}],113:[function(e,t,r){var n=e("../../util/d3selection.coffee"),a=e("../../core/parse/hideElement.js"),o=e("../../core/parse/element.js"),i=e("../../core/console/print.coffee"),s=e("../../string/format.js");t.exports={accepted:[void 0,Function],first:!0,frozen:!1,process:function(e,t){if(this.initialized===!1)return this.initialized=!0,e;if(!t.data.value||t.data.value instanceof Array&&!n(t.data.value)?t.data.element.value&&t.data.element.value.call(a):t.data.value=o(t),void 0===e&&"function"==typeof this.value&&(e=this.value),t.container.value===!1){var r=t.format.locale.value.dev.setContainer;i.warning(r,"container")}else if(t.container.value.empty()){var r=t.format.locale.value.dev.noContainer,l=t.container.selector||"";i.warning(s(r,'"'+l+'"'),"container")}else t.dev.value&&i.time("total draw time"),t.container.value.call(t.self);if("function"==typeof e&&t.history.chain.length){var u={};t.history.chain.forEach(function(e){var t=e.method;delete e.method,u[t]=e}),e(u),t.history.chain=[]}return e},update:!0,value:void 0}},{"../../core/console/print.coffee":52,"../../core/parse/element.js":96,"../../core/parse/hideElement.js":97,"../../string/format.js":173,"../../util/d3selection.coffee":208}],114:[function(e,t,r){t.exports={accepted:[!1,Number,String],deprecates:"highlight",process:function(e,t){var r,n,a,o,i,s,l,u,c,f;if(n=t.data.element.value,n&&["string","number"].indexOf(typeof e)>=0)if(a=n.node().tagName.toLowerCase(),o=n.attr("type"),"select"===a)for(f=n.selectAll("option"),i=s=0,u=f.length;s<u;i=++s)r=f[i],r&&r[t.id.value]===e&&(n.node().selectedIndex=i);else if("input"===a&&"radio"===o)for(l=0,c=n.length;l<c;l++)r=n[l],this.checked=r&&r[t.id.value]===e;return e},value:!1}},{}],115:[function(e,t,r){var n,a,o,i;o=e("../../core/methods/font/family.coffee"),n=e("../../core/methods/font/align.coffee"),a=e("../../core/methods/font/decoration.coffee"),i=e("../../core/methods/font/transform.coffee"),t.exports={align:n(),color:"#444444",decoration:a(),family:o(),secondary:{align:n(),color:"#444444",decoration:a(),family:o(),size:12,spacing:0,transform:i(),weight:200},size:12,spacing:0,transform:i(),weight:200}},{"../../core/methods/font/align.coffee":82,"../../core/methods/font/decoration.coffee":83,"../../core/methods/font/family.coffee":84,"../../core/methods/font/transform.coffee":86}],116:[function(e,t,r){var n,a,o,i;n=e("../../number/format.coffee"),a=e("../../core/locale/locale.coffee"),o=e("../../object/merge.coffee"),i=e("../../string/title.coffee"),t.exports={accepted:[Function,String],affixes:{accepted:[Object],objectAccess:!1,value:{}},deprecates:["number_format","text_format"],locale:{accepted:function(){return d3.keys(a)},process:function(e){var t,r;return t="en_US",r=a[t],e!==t&&(r=o(r,a[e])),this.language=e,r},value:"en_US"},number:{accepted:[!1,Function],value:!1},process:function(e,t){if("string"==typeof e)t.self.format({locale:e});else if("function"==typeof e)return e;return this.value},text:{accepted:[!1,Function],value:!1},value:function(e,t){var r,a,o;return t||(t={}),o=t.vars||{},o.time&&o.time.value&&t.key===o.time.value?(a=e.constructor===Date?e:new Date(e),o.data.time.format(a)):"number"==typeof e?(r=this.number.value||n)(e,t):"string"==typeof e?(r=this.text.value||i)(e,t):JSON.stringify(e)}}},{"../../core/locale/locale.coffee":79,"../../number/format.coffee":170,"../../object/merge.coffee":171,"../../string/title.coffee":176}],117:[function(e,t,r){t.exports={accepted:[!1,Number],max:600,secondary:!1,value:!1}},{}],118:[function(e,t,r){t.exports={back:function(){if(this.states.length)return this.states.pop()()},chain:[],reset:function(){var e;for(e=[];this.states.length;)e.push(this.states.pop()());return e},states:[]}},{}],119:[function(e,t,r){t.exports={accepted:[Boolean,Number,String],value:!1}},{}],120:[function(e,t,r){var n;n=e("../../core/methods/process/icon.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],back:{accepted:[!1,String],fallback:"❮",opacity:1,process:n,rotate:0,value:"fa-angle-left"},button:{accepted:[!1,String],fallback:!1,opacity:1,process:n,rotate:0,value:!1},drop:{accepted:[!1,String],fallback:"❯",opacity:1,process:n,rotate:0,value:"fa-angle-down"},next:{accepted:[!1,String],fallback:"❯",opacity:1,process:n,rotate:0,value:"fa-angle-right"},select:{accepted:[!1,String],fallback:"✓",opacity:1,process:n,rotate:0,value:"fa-check"},style:{accepted:[Object,String],value:"default"},value:"icon"}},{"../../core/methods/process/icon.coffee":89}],121:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[Array,String],dataFilter:!0,mute:n(!0),nesting:["value"],solo:n(!0),value:"value"}},{"../../core/methods/filter.coffee":81}],122:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],mute:n(!0),solo:n(!0),value:"keywords"}},{"../../core/methods/filter.coffee":81}],123:[function(e,t,r){var n;n=e("../../core/methods/process/margin.coffee"),t.exports={accepted:[Number,Object,String],process:function(e){var t;return void 0===e&&(e=this.value),t=e,n(e,this),t},value:0}},{"../../core/methods/process/margin.coffee":90}],124:[function(e,t,r){t.exports={accepted:[Boolean],flipped:{accepted:[Boolean],value:!1},value:!1}},{}],125:[function(e,t,r){t.exports={accepted:[!1,Function,String],sort:{accepted:["asc","desc"],deprecates:["sort"],value:"asc"},value:!1}},{}],126:[function(e,t,r){t.exports={accepted:[void 0,Function],process:function(e,t){this.initialized&&t.container.ui.remove(),delete t.container.ui},value:void 0}},{}],127:[function(e,t,r){t.exports={accepted:["auto",Boolean],process:function(e){return"Boolean"==typeof e&&(this.enabled=e),e},term:"",value:"auto"}},{}],128:[function(e,t,r){t.exports={accepted:[String],chainable:!1,process:function(e,t){var r;return r=t.container.value,r&&e?r.select(e):e},value:void 0}},{}],129:[function(e,t,r){t.exports={accepted:[String],chainable:!1,process:function(e,t){var r;return r=t.container.value,r&&e?r.selectAll(e):e},value:void 0}},{}],130:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,String],nesting:!0,mute:n(!0),solo:n(!0),secondary:{accepted:[!1,String],nesting:!0,value:!1},value:!1}},{"../../core/methods/filter.coffee":81}],131:[function(e,t,r){t.exports={mouseevents:60,ui:200}},{}],132:[function(e,t,r){var n,a,o,i;n=e("../../core/methods/font/decoration.coffee"),a=e("../../core/methods/font/family.coffee"),i=e("../../core/methods/font/transform.coffee"),o=e("../../string/strip.js"),t.exports={accepted:[!1,Function,String],font:{align:"center",color:"#444444",decoration:n(),family:a(),size:16,transform:i(),weight:400},link:!1,process:function(e,t){var r;return 0===t.container.id.indexOf("default")&&e&&(r=o(e).toLowerCase(),t.self.container({id:r})),e},value:!1}},{"../../core/methods/font/decoration.coffee":83,"../../core/methods/font/family.coffee":84,"../../core/methods/font/transform.coffee":86,"../../string/strip.js":175}],133:[function(e,t,r){t.exports={accepted:function(e){return d3.keys(e.types)},value:"auto"}},{}],134:[function(e,t,r){var n,a,o,i,s;o=e("../../core/methods/font/family.coffee"),n=e("../../core/methods/font/align.coffee"),a=e("../../core/methods/font/decoration.coffee"),i=e("../../core/methods/process/margin.coffee"),s=e("../../core/methods/font/transform.coffee"),t.exports={align:n("center"),border:1,color:{primary:{process:function(e,t){var r;return r=this.value,t.ui.color.secondary.value||(t.ui.color.secondary.value=d3.rgb(r).darker(.75).toString()),e},value:"#ffffff"},secondary:{value:!1}},display:{acceped:["block","inline-block"],value:"inline-block"},font:{align:n("center"),color:"#444",decoration:a(),family:o(),size:11,transform:s(),weight:200},margin:{process:function(e){var t;return void 0===e&&(e=this.value),t=e,i(e,this),t},value:5},padding:{process:function(e){var t;return void 0===e&&(e=this.value),t=e,i(e,this),t},value:5}}},{"../../core/methods/font/align.coffee":82,"../../core/methods/font/decoration.coffee":83,"../../core/methods/font/family.coffee":84,"../../core/methods/font/transform.coffee":86,"../../core/methods/process/margin.coffee":90}],135:[function(e,t,r){t.exports={accepted:[!1,Number],secondary:!1,value:!1}},{}],136:[function(e,t,r){t.exports=function(e){var t=e.data.value.length;1===t?e.self.type("button").draw():t<5?e.self.type("toggle").draw():e.self.type("drop").draw()}},{}],137:[function(e,t,r){t.exports=function(t){var r,n,a,o,i,s,l,u;return s=e("../../../core/console/print.coffee"),a=e("./functions/color.coffee"),o=e("./functions/icons.js"),i=e("./functions/mouseevents.coffee"),l=e("./functions/style.js"),r=t.container.ui.selectAll("div.d3plus_node").data(t.data.viz,function(e){return e[t.id.value]}),t.dev.value&&s.time("enter"),r.enter().append("div").attr("class","d3plus_node").call(a,t).call(l,t).call(o,t).call(i,t),t.dev.value&&s.timeEnd("enter"),t.draw.update||t.draw.timing?(t.dev.value&&s.time("ordering"),r.order(),t.dev.value&&s.timeEnd("ordering"),u=r):(n=[t.focus.previous,t.focus.value,t.hover.previous,t.hover.value].filter(function(e){return e}),u=r.filter(function(e){return n.indexOf(e[t.id.value])>=0})),t.dev.value&&s.time("update"),u.classed("d3plus_button_active",function(e){return t.focus.value===e[t.id.value]}),t.draw.timing?u.transition().duration(t.draw.timing).call(a,t).call(l,t):u.call(a,t).call(l,t),u.call(o,t).call(i,t),t.dev.value&&s.timeEnd("update"),r.exit().remove()}},{"../../../core/console/print.coffee":52,"./functions/color.coffee":138,"./functions/icons.js":139,"./functions/mouseevents.coffee":140,"./functions/style.js":141}],138:[function(e,t,r){t.exports=function(t,r){var n,a,o;return n=e("../../../../color/legible.coffee"),a=e("../../../../color/lighter.coffee"),o=e("../../../../color/text.coffee"),t.style("background-color",function(e){var t;return t=r.focus.value===e[r.id.value]?r.ui.color.secondary.value:r.ui.color.primary.value,r.hover.value===e[r.id.value]&&(t=d3.rgb(t).darker(.15).toString()),t}).style("color",function(e){var t,a,i,s;return s=r.focus.value===e[r.id.value]?.75:1,i=e[r.icon.value]&&r.data.viz.length<r.data.large,!i&&e[r.color.value]?a=n(e[r.color.value]):(t=r.focus.value===e[r.id.value]?r.ui.color.secondary.value:r.ui.color.primary.value,r.hover.value===e[r.id.value]&&(t=d3.rgb(t).darker(.15).toString()),a=o(t)),a=d3.rgb(a),"rgba("+a.r+","+a.g+","+a.b+","+s+")"}).style("border-color",r.ui.color.secondary.value)}},{"../../../../color/legible.coffee":44,"../../../../color/lighter.coffee":45,"../../../../color/text.coffee":50}],139:[function(e,t,r){var n=e("../../../../client/prefix.coffee"),a=e("../../../../client/rtl.coffee");t.exports=function(e,t){var r="right"===t.font.align.value&&!a||a&&"right"===t.font.align.value;e.each(function(e,o){var i=["label"];e[t.icon.value]&&t.data.viz.length<=t.data.large&&i.push("icon");var s=t.icon.button.value;e[t.id.value]===t.focus.value&&t.icon.select.value?(s=t.icon.select.value,i.push("selected")):s&&e.d3plus.icon!==!1&&i.push("selected");var l=0,u=d3.select(this).selectAll("div.d3plus_button_element").data(i,function(e){return e});u.enter().append("div").style("display",function(e){return"label"===e?"block":"absolute"}),u.order().attr("class",function(e){var t="";return"selected"===e&&0===s.indexOf("fa-")&&(t=" fa "+s),"d3plus_button_element d3plus_button_"+e+t}).html(function(r){if("label"===r){var n=t.text.value&&t.text.value in e&&!(e[t.text.value]instanceof Array)?t.text.value:t.id.value;return t.format.value(e[n])}return"selected"===r&&s.indexOf("fa-")<0?s:""}).style("background-image",function(r){return"icon"===r?"url('"+e[t.icon.value]+"')":"none"}).style("background-color",function(r){return"icon"===r&&"knockout"===e.style?e[t.color.value]||t.ui.color.primary.value:"transparent"}).style("background-size","100%").style("text-align",function(e){return"label"===e?t.font.align.value:"center"}).style("position",function(e){return"label"==e?"static":"absolute"}).style("width",function(e){return"label"===e?"auto":(l=t.height.value?t.height.value-(t.ui.padding.top+t.ui.padding.bottom)-2*t.ui.border:t.font.size+t.ui.border,l+"px")}).style("height",function(e){return"icon"===e?l+"px":"auto"}).style("margin-top",function(e){if("label"===e)return"0px";if(this.offsetHeight||this.getBoundingClientRect().height)var r=this.offsetHeight||this.getBoundingClientRect().height;else if("selected"===e)var r=t.font.size;else var r=l;return-r/2+"px"}).style("top",function(e){return"label"===e?"auto":"50%"}).style("left",function(e){return"icon"===e&&!r||"selected"===e&&r?t.ui.padding.left+"px":"auto"}).style("right",function(e){return"icon"===e&&r||"selected"===e&&!r?t.ui.padding.right+"px":"auto"}).style(n()+"transition",function(e){return"selected"===e?t.draw.timing/1e3+"s":"none"}).style(n()+"transform",function(e){var r="selected"===e?t.icon.select.rotate:"none";return"string"==typeof r?r:"rotate("+r+"deg)"}).style("opacity",function(e){return"selected"===e?t.icon.select.opacity:1}),u.exit().remove();var c=d3.select(this).selectAll(".d3plus_button_label");if(l>0){var f=t.ui.padding;f=3===i.length?f.top+"px "+(2*f.right+l)+"px "+f.bottom+"px "+(2*f.left+l)+"px":i.indexOf("icon")>=0&&!a||i.indexOf("selected")>=0&&a?f.top+"px "+f.right+"px "+f.bottom+"px "+(2*f.left+l)+"px":f.top+"px "+(2*f.right+l)+"px "+f.bottom+"px "+f.left+"px",c.style("padding",f)}else c.style("padding",t.ui.padding.css);if("number"==typeof t.width.value){var d=t.width.value;d-=parseFloat(c.style("padding-left"),10),d-=parseFloat(c.style("padding-right"),10),d-=2*t.ui.border,d+="px"}else var d="auto";c.style("width",d)})}},{"../../../../client/prefix.coffee":39,"../../../../client/rtl.coffee":40}],140:[function(e,t,r){t.exports=function(t,r,n){var a,o;return n=e("./color.coffee"),a=e("../../../../client/pointer.coffee"),o=e("../../../../client/ie.js"),t.on(a.over,function(e,t){return r.self.hover(e[r.id.value]),o||!r.draw.timing?d3.select(this).style("cursor","pointer").call(n,r):d3.select(this).style("cursor","pointer").transition().duration(r.timing.mouseevents).call(n,r)}).on(a.out,function(e){return r.self.hover(!1),o||!r.draw.timing?d3.select(this).style("cursor","auto").call(n,r):d3.select(this).style("cursor","auto").transition().duration(r.timing.mouseevents).call(n,r)}).on(a.click,function(e){return r.focus.value!==!1?r.self.focus(e[r.id.value]).draw():r.focus.callback?r.focus.callback(e,r.self):void 0})}},{"../../../../client/ie.js":37,"../../../../client/pointer.coffee":38,"./color.coffee":138}],141:[function(e,t,r){t.exports=function(e,t){e.style("position","relative").style("margin",t.ui.margin.css).style("display",t.ui.display.value).style("border-style","solid").style("border-width",t.ui.border+"px").style("font-family",t.font.family.value).style("font-size",t.font.size+"px").style("font-weight",t.font.weight).style("letter-spacing",t.font.spacing+"px")}},{}],142:[function(e,t,r){t.exports=function(t){var r,n,a,o,i,s,l,u,c,f,d;return a=e("./functions/element.coffee"),o=e("./functions/keyboard.coffee"),d=e("./functions/window.js"),f=e("./functions/width.js"),r=e("./functions/button.js"),l=e("./functions/selector.js"),u=e("./functions/title.js"),s=e("./functions/search.js"),i=e("./functions/list.js"),n=e("./functions/data.js"),c=e("./functions/update.js"),t.margin.top=0,t.margin.title=0,a(t),o(t),d(t),f(t),r(t),l(t),u(t),s(t),i(t),n(t),c(t)}},{"./functions/button.js":145,"./functions/data.js":146,"./functions/element.coffee":147,"./functions/keyboard.coffee":150,"./functions/list.js":151,"./functions/search.js":153,"./functions/selector.js":154,"./functions/title.js":155,"./functions/update.js":156,"./functions/width.js":157,"./functions/window.js":158}],143:[function(e,t,r){t.exports=function(e,t,r){var n=[],r=r||e.active.value;if(r instanceof Array)for(var a=0;a<r.length;a++)n.push(this(e,t,r[a]));else{var o=typeof r;"number"===o?n.push(e.depth.value===r):"function"===o?n.push(r(t)):n.push(t===r)}return n.indexOf(!0)>=0}},{}],144:[function(e,t,r){var n=e("../../../../core/console/print.coffee");t.exports=function(e){e.dev.value&&n.time("rotating arrow");var t="❯"===e.icon.drop.value?90:0;if(e.open.value!=e.open.flipped.value)var r=180+t;else var r=t;e.container.button.icon({select:{opacity:e.open.value?.5:1,rotate:r}}).draw(),e.dev.value&&n.timeEnd("rotating arrow")}},{"../../../../core/console/print.coffee":52}],145:[function(e,t,r){var n=e("../../../../util/copy.coffee"),a=e("../../../../client/pointer.coffee"),o=e("../../../form.js"),i=e("../../../../core/console/print.coffee");t.exports=function(e){if("button"in e.container||(e.dev.value&&i.time("creating main button"),e.container.button=o().container(e.container.ui).type("button").ui({margin:0}),e.dev.value&&i.timeEnd("creating main button")),e.focus.changed||e.data.changed||e.depth.changed){var t=e.depth.value,r=n(e.data.value.filter(function(r){for(var n=!1,a=0;a<e.id.nesting.length;a++){var o=e.id.nesting[a];if(n=o in r&&r[o]===e.focus.value){t=a;break}}return n})[0]);r||(r=e.container.button.data()[0]||e.data.viz[0]),e.container.button.data([r]).id(e.id.nesting).depth(t)}var s=e.hover.value===!0&&e.focus.value;e.container.button.draw({update:e.draw.update}).focus("").font(e.font).format(e.format).hover(s).icon({button:e.icon.drop.value,select:e.icon.drop.value,value:e.icon.value}).text(e.text.value).timing({ui:e.draw.timing}).ui({border:e.ui.border,color:e.ui.color,padding:e.ui.padding.css}).width(e.width.value).draw();var l=e.container.button.container(Object).ui;e.margin.top+=l.node().offsetHeight||l.node().getBoundingClientRect().height,l.on(a.click,function(){e.self.open(!e.open.value).draw()})}},{"../../../../client/pointer.coffee":38,"../../../../core/console/print.coffee":52,"../../../../util/copy.coffee":207,"../../../form.js":104}],146:[function(e,t,r){var n=e("../../../../string/format.js"),a=e("../../../../string/strip.js");t.exports=function(e){if(e.data.url&&!e.data.loaded){var t={};t[e.text.value||e.id.value]=e.format.value(e.format.locale.value.ui.loading),e.data.filtered=[t],e.data.changed="loading"!==e.data.lastFilter,e.data.lastFilter="loading"}else if(e.open.value)if(e.search.term){var r=a(e.search.term).split("_"),o=[e.id.value,e.text.value,e.alt.value,e.keywords.value];o=o.filter(function(e){return e}),r=r.filter(function(e){return""!==e});var i=[],s=[],l=[],u=[];if(e.id.nesting.forEach(function(t){u=u.concat(e.data.nested.all[t])}),u.forEach(function(t){var n=!1;o.forEach(function(o){if(!n&&o in t&&"string"==typeof t[o]){var u=t[o].toLowerCase();if([e.text.value,e.id.value].indexOf(o)>=0&&0===u.indexOf(e.search.term))i.push(t),n=!0;else if(u.indexOf(e.search.term)>=0)s.push(t),n=!0;else{var c=a(u).split("_");for(var f in c){if(n)break;for(var d in r)if(0===c[f].indexOf(r[d])){l.push(t),n=!0;break}}}}})}),e.data.filtered=d3.merge([i,s,l]),e.data.filtered.forEach(function(e,t){e.d3plus_order=t}),e.data.changed=!0,e.data.lastFilter="search",0===e.data.filtered.length){var c={},f=e.format.value(e.format.locale.value.ui.noResults);c[e.text.value||e.id.value]=n(f,'"'+e.search.term+'"'),e.data.filtered=[c]}}else e.data.filtered=e.data.viz,e.data.changed="viz"!==e.data.lastFilter,e.data.lastFilter="viz",e.id.nesting.length>1&&e.depth.value<e.id.nesting.length-1&&(e.data.filtered=e.data.filtered.filter(function(t){return"endPoint"in t.d3plus&&t.d3plus.endPoint===e.depth.value&&(t.d3plus.icon=!1),!0}),e.data.changed="depth"!==e.data.lastFilter,e.data.lastFilter="depth");else e.data.filtered=[]}},{"../../../../string/format.js":173,"../../../../string/strip.js":175}],147:[function(e,t,r){t.exports=function(e){if(e.data.element.value)return e.data.element.value.on("focus."+e.container.id,function(){return e.self.hover(!0).draw()}),e.data.element.value.on("blur."+e.container.id,function(){var t;if(t=!e.search.enabled||d3.event.relatedTarget!==e.container.value.select("input").node())return e.self.open(!1).hover(!1).draw()}),e.data.element.value.on("change."+e.container.id,function(){return e.self.focus(this.value).draw()}),e.data.element.value.on("keydown.cancel_"+e.container.id,function(){if(9!==d3.event.keyCode)return d3.event.preventDefault()})}},{}],148:[function(e,t,r){t.exports=function(e){var t=e.height.secondary,r=e.container.button.container().node().getBoundingClientRect(),n=window.innerHeight-r.bottom-2*e.ui.border-e.ui.margin.top-e.ui.margin.bottom-e.ui.padding.top-e.ui.padding.bottom;n<3*r.height&&(n=r.top-10,e.self.open({flipped:!0})),"number"!=typeof t&&(t=n),t>e.height.max&&(t=e.height.max),e.self.height({secondary:t})}},{}],149:[function(e,t,r){var n,a,o,i;n=e("./active.js"),a=e("../../../../util/copy.coffee"),o=e("../../../form.js"),i=e("../../../../core/console/print.coffee"),t.exports=function(e){var t,r,s;e.open.value&&(e.dev.value&&i.time("updating list items"),"items"in e.container||(e.container.items=o().container(e.container.list).type("button").ui({border:0,display:"block",margin:0}).width(!1)),r=e.draw.timing?e.data.large:1,s=a(e.order),s.value=e.search.term.length?"d3plus_order":e.order.value,t=e.depth.value===e.id.nesting.length-1,(e.focus.changed||e.container.items.focus()===!1)&&e.container.items.focus(e.focus.value,function(t){var r,a,o,i;a=e.data.filtered.filter(function(r){return r[e.id.value]===t})[0],e.depth.value<e.id.nesting.length-1&&e.id.nesting[e.depth.value+1]in a?(o=e.depth.value,i=e.id.solo.value,e.history.states.push(function(){return e.self.depth(o).id({solo:i}).draw()}),e.self.depth(e.depth.value+1).id({solo:[t]}).draw()):(e.depth.changed||e.self.open(!1),r=t!==e.focus.value,r&&e.active.value&&(r=n(e,t)),r&&e.self.focus(t).draw())}),e.container.items.active(e.active.value).data({large:r,sort:e.data.sort.value,value:e.data.filtered}).draw({update:e.draw.update}).font(e.font.secondary).format(e.format).hover(e.hover.value).id(e.id.value).icon({button:!t&&e.icon.next,select:!!t&&e.icon.select,value:e.icon.value}).order(s).text(e.text.secondary.value||e.text.value).timing({ui:e.draw.timing}).ui({color:{primary:1===e.id.nesting.length?e.ui.color.primary.value:e.ui.color.secondary.value,secondary:e.ui.color.secondary.value},padding:e.ui.padding.css}).draw(),e.dev.value&&i.timeEnd("updating list items"))}},{"../../../../core/console/print.coffee":52,"../../../../util/copy.coffee":207,"../../../form.js":104,"./active.js":143}],150:[function(e,t,r){t.exports=function(e){return d3.select(window).on("keydown."+e.container.id,function(){var t,r,n,a,o,i,s,l,u,c,f,d,p;if(u=d3.event.keyCode,e.open.value||e.hover.value===!0){for(f=e.hover.value===!0?"focus":"hover",s=!1,d=e.data.filtered,i=l=0,c=d.length;l<c;i=++l)if(t=d[i],t[e.id.value]===e[f].value){s=i;break}if(9===u&&e.open.value&&(!e.search.enabled||e.search.enabled&&!d3.event.shiftKey))return e.self.open(!1).hover(!1).draw();if([38,40].indexOf(u)>=0)return s===!1?s=0:38===u?e.open.value&&(s<=0?s=e.data.filtered.length-1:s-=1):40===u&&e.open.value&&(s>=e.data.filtered.length-1?s=0:s+=1),o="boolean"!=typeof e.hover.value?e.data.filtered[s][e.id.value]:e.focus.value,e.self.hover(o).open(!0).draw();if(13===u)return"boolean"!=typeof e.hover.value?(r=e.data.filtered.filter(function(t){return t[e.id.value]===e.hover.value})[0],n=e.depth.value,n<e.id.nesting.length-1&&e.id.nesting[n+1]in r?(p=e.id.solo.value,a=function(){return e.self.depth(n).id({solo:p}).draw()},e.history.states.push(a),e.self.depth(e.depth.value+1).id({solo:[e.hover.value]}).draw()):e.self.focus(e.hover.value).hover(!0).draw()):e.self.hover(e.focus.value).open(!0).draw();if(27===u){if(e.open.value)return e.self.open(!1).hover(!0).draw();if(e.hover.value===!0)return e.self.hover(!1).draw()}}})}},{}],151:[function(e,t,r){var n=e("../../../../core/console/print.coffee");t.exports=function(e){e.dev.value&&n.time("populating list"),e.container.list=e.container.selector.selectAll("div.d3plus_drop_list").data(["list"]),e.container.list.enter().append("div").attr("class","d3plus_drop_list").attr("id","d3plus_drop_list_"+e.container.id).style("overflow-y","auto").style("overflow-x","hidden"),e.dev.value&&n.timeEnd("populating list")}},{"../../../../core/console/print.coffee":52}],152:[function(e,t,r){var n=e("../../../../core/console/print.coffee");t.exports=function(e){if(e.open.value){e.dev.value&&n.time("calculating height");var t=!1;if("none"==e.container.selector.style("display"))var t=!0;t&&e.container.selector.style("display","block");var r=e.container.selector.style("height"),a=e.container.selector.property("scrollTop"),o=e.container.list.style("max-height"),i=e.container.list.property("scrollTop");e.container.selector.style("height","auto"),e.container.list.style("max-height","200000px"),e.container.listHeight=parseFloat(e.container.selector.style("height"),10),e.container.list.style("max-height",o).property("scrollTop",i),e.container.selector.style("height",r).property("scrollTop",a);var s=!1;if(e.container.listHeight>e.height.secondary&&(e.container.listHeight=e.height.secondary,s=!0),t&&e.container.selector.style("display","none"),e.dev.value&&n.timeEnd("calculating height"),s){e.dev.value&&n.time("calculating scroll position");var l=e.container.list.select("div").selectAll("div.d3plus_node"),u=l[0][0],c="boolean"!=typeof e.hover.value?e.hover.value:e.focus.value;l.each(function(t,r){t[e.id.value]===c&&(u=this)});var t=!1;"none"===e.container.selector.style("display")&&(t=!0,e.container.selector.style("display","block"));var f=u.offsetTop,d=u.offsetHeight||u.getBoundingClientRect().height,p=e.container.list.property("scrollTop");t&&e.container.selector.style("display","none"),t||e.data.changed||e.depth.changed?e.container.listScroll=f:(e.container.listScroll=p,f<p?e.container.listScroll=f:f+d>p+e.height.secondary-e.search.height&&(e.container.listScroll=f-(e.height.secondary-d-e.search.height))),e.dev.value&&n.timeEnd("calculating scroll position")}else e.container.listScroll=0}else e.container.listScroll=e.container.list.property("scrollTop"),e.container.listHeight=0}},{"../../../../core/console/print.coffee":52}],153:[function(e,t,r){var n=e("../../../../client/prefix.coffee"),a=e("../../../../core/console/print.coffee");t.exports=function(t){function r(e){e.style("padding",t.ui.padding.css).style("display","block").style("background-color",d3.rgb(t.ui.color.primary.value).darker(.15).toString()); | |
| }function o(e){var r=t.width.secondary-2*t.ui.padding.left-2*t.ui.padding.right+2*t.ui.border;e.style("padding",t.ui.padding.left/2+t.ui.padding.right/2+"px").style("width",r+"px").style("border-width","0px").style("font-family",t.font.secondary.family.value).style("font-size",t.font.secondary.size+"px").style("font-weight",t.font.secondary.weight).style("text-align",t.font.secondary.align).style("outline","none").style(n()+"border-radius","0").attr("placeholder",t.format.value(t.format.locale.value.method.search))}t.dev.value&&a.time("creating search");var i=e("./data.js"),s=e("./items.coffee"),l=e("./update.js");t.container.search=t.container.selector.selectAll("div.d3plus_drop_search").data(t.search.enabled?["search"]:[]),t.draw.timing?(t.container.search.transition().duration(t.draw.timing).call(r),t.container.search.select("input").transition().duration(t.draw.timing).call(o)):(t.container.search.call(r),t.container.search.select("input").call(o)),t.container.search.enter().insert("div","#d3plus_drop_list_"+t.container.id).attr("class","d3plus_drop_search").attr("id","d3plus_drop_search_"+t.container.id).call(r).append("input").attr("id","d3plus_drop_input_"+t.container.id).style("-webkit-appearance","none").call(o),t.container.search.select("input").on("keyup."+t.container.id,function(e){var r=this.value;t.search.term!==r&&(t.search.term=r,i(t),s(t),l(t))}),t.container.search.exit().remove();var u=t.container.selector.style("display");t.container.selector.style("display","block"),t.search.height=t.search.enabled?t.container.search.node().offsetHeight||t.container.search.node().getBoundingClientRect().height:0,t.container.selector.style("display",u),t.search.enabled&&(t.margin.title+=t.search.height),t.dev.value&&a.timeEnd("creating search")}},{"../../../../client/prefix.coffee":39,"../../../../core/console/print.coffee":52,"./data.js":146,"./items.coffee":149,"./update.js":156}],154:[function(e,t,r){t.exports=function(e){e.container.selector=e.container.ui.selectAll("div.d3plus_drop_selector").data(["selector"]),e.container.selector.enter().append("div").attr("class","d3plus_drop_selector").style("position","absolute").style("top","0px").style("z-index","-1").style("overflow","hidden"),e.container.selector.style("padding",e.ui.border+"px")}},{}],155:[function(e,t,r){var n=e("../../../../client/pointer.coffee"),a=e("../../../../color/lighter.coffee"),o=e("../../../../core/console/print.coffee"),i=e("../../../../color/text.coffee");t.exports=function(e){function t(t){t.style("padding",e.ui.padding.css).style("display","block").style("background-color",e.ui.color.secondary.value).style("font-family",e.font.secondary.family.value).style("font-size",e.font.secondary.size+"px").style("font-weight",e.font.secondary.weight).style("text-align",e.font.secondary.align).style("color",i(e.ui.color.secondary.value))}function r(t){if(!t.empty()){var r=0===e.icon.back.value.indexOf("fa-")?" fa "+e.icon.back.value:"";r="d3plus_drop_back"+r;var n=0===e.icon.back.value.indexOf("fa-")?"":e.icon.back.value;t.style("position","absolute").attr("class",r).style("top",e.ui.padding.top+e.font.secondary.size/2/2.5+"px").html(n)}}function s(t){var r=u?e.focus.value:e.format.locale.value.ui.back;t.text(e.format.value(r)).style("padding","0px "+(e.ui.padding.left+e.ui.padding.right)+"px")}if(e.open.value){e.dev.value&&o.time("creating title and back button");var l=1===e.id.solo.value.length&&e.depth.value>0,u=l,c=e.container.button.data(Object).viz[0];u=!0;for(var f=0;f<e.id.nesting.length;f++){var d=e.id.nesting[f];if(d in c&&c[d]===e.focus.value){u=!1;break}}e.container.title=e.container.selector.selectAll("div.d3plus_drop_title").data(l?["title"]:[]),e.draw.timing?(e.container.title.transition().duration(e.draw.timing).call(t),e.container.title.select("div.d3plus_drop_title_text").transition().duration(e.draw.timing).call(s)):(e.container.title.call(t),e.container.title.select("div.d3plus_drop_title_text").call(s)),e.container.title.select("span.d3plus_drop_back").call(r);var p=e.container.title.enter().insert("div","#d3plus_drop_list_"+e.container.id).attr("class","d3plus_drop_title").attr("id","d3plus_drop_title_"+e.container.id).call(t);p.append("span").attr("id","d3plus_drop_back_"+e.container.id).attr("class","d3plus_drop_back").call(r),p.append("div").attr("id","d3plus_drop_title_text_"+e.container.id).attr("class","d3plus_drop_title_text").call(s),e.container.title.on(n.over,function(t,r){var n=a(e.ui.color.secondary.value);d3.select(this).style("cursor","pointer").transition().duration(e.timing.mouseevents).style("background-color",n).style("color",i(n))}).on(n.out,function(t){var r=e.ui.color.secondary.value;d3.select(this).style("cursor","auto").transition().duration(e.timing.mouseevents).style("background-color",r).style("color",i(r))}).on(n.click,function(t){e.history.back()}),e.container.title.exit().remove(),l&&(e.margin.title+=e.container.title.node().offsetHeight||e.container.title.node().getBoundingClientRect().height),e.dev.value&&o.timeEnd("creating title and back button")}}},{"../../../../client/pointer.coffee":38,"../../../../color/lighter.coffee":45,"../../../../color/text.coffee":50,"../../../../core/console/print.coffee":52}],156:[function(e,t,r){var n=e("./items.coffee"),a=e("./height.js"),o=e("../../../../core/console/print.coffee"),i=e("./scroll.js"),s=e("./arrow.js");t.exports=function(e){function t(t){var r=e.open.flipped.value;t.style("top",function(){return r?"auto":e.margin.top-e.ui.border+"px"}).style("bottom",function(){return r?e.margin.top+e.ui.border+"px":"auto"})}function r(r){r.style("left",function(){return"left"===e.font.align.value?e.margin.left+"px":"center"===e.font.align.value?e.margin.left-(e.width.secondary-e.width.value)/2+"px":"auto"}).style("right",function(){return"right"===e.font.align.value?"0px":"auto"}).style("height",e.container.listHeight+"px").style("padding",e.ui.border+"px").style("background-color",e.ui.color.secondary.value).style("z-index",function(){return e.open.value?"9999":"-1"}).style("width",e.width.secondary-2*e.ui.border+"px").style("opacity",e.open.value?1:0).call(t)}function l(r){r.style("display",e.open.value?null:"none").call(t),e.search.enabled&&e.open.value&&e.container.selector.select("div.d3plus_drop_search input").node().focus()}function u(e){return function(){var t=d3.interpolateNumber(this.scrollTop,e);return function(e){this.scrollTop=t(e)}}}e.draw.timing?e.container.ui.transition().duration(e.draw.timing).each("start",function(){e.open.value&&d3.select(this).style("z-index",9999)}).style("margin",e.ui.margin.css).each("end",function(){e.open.value||d3.select(this).style("z-index","auto")}):e.container.ui.style("margin",e.ui.margin.css).style("z-index",function(){return e.open.value?9999:"auto"}),n(e),a(e),i(e),s(e),e.dev.value&&o.time("drawing list");var c=e.open.value?e.height.secondary-e.margin.title:0;e.draw.timing?(e.container.selector.transition().duration(e.draw.timing).each("start",function(){d3.select(this).style("display",e.open.value?"block":null)}).call(r).each("end",function(){d3.select(this).transition().duration(e.draw.timing).call(l)}),e.container.list.transition().duration(e.draw.timing).style("width",e.width.secondary-2*e.ui.border+"px").style("max-height",c+"px").tween("scroll",u(e.container.listScroll))):(e.container.selector.call(r).call(l),e.container.list.style("width",e.width.secondary-2*e.ui.border+"px").style("max-height",c+"px").property("scrollTop",e.container.listScroll)),e.dev.value&&o.timeEnd("drawing list")}},{"../../../../core/console/print.coffee":52,"./arrow.js":144,"./height.js":148,"./items.coffee":149,"./scroll.js":152}],157:[function(e,t,r){var n=e("../../../../util/copy.coffee"),a=e("../../../../core/font/tester.coffee"),o=e("../../../form.js"),i=e("../../../../core/console/print.coffee"),s=e("../../../../object/validate.coffee");t.exports=function(e){function t(t){var n="primary"===t?"value":t,s="value"===n?e.icon.drop.value:e.icon.select.value||e.icon.drop.value,l="value"===n?e.text.value:e.text.secondary.value||e.text.value,u="value"===n?e.font:e.font.secondary;e.dev.value&&i.time("calculating "+t+" width");var c=o().container(a()).data({large:9999,value:r}).draw({update:!1}).font(u).format(e.format).icon({button:s,value:e.icon.value}).id(e.id.value).timing({ui:0}).text(l||e.id.value).type("button").ui({border:"primary"===t?e.ui.border:0,display:"inline-block",margin:0,padding:e.ui.padding.css}).width(!1).draw(),f=[];c.selectAll("div.d3plus_node").each(function(e){f.push(this.offsetWidth+1)}).remove();var d={};d[n]=d3.max(f),e.self.width(d),e.dev.value&&i.timeEnd("calculating "+t+" width")}var r=[];for(var l in e.data.nested.all){var u=e.data.nested.all[l],c=s(e.text.nesting)&&l in e.text.nesting?e.text.nesting[l][0]:l;[e.id.value,e.text.value].indexOf(c)<0&&(u=n(u),u.forEach(function(t){t[e.text.value||e.id.value]=t[c]})),r=r.concat(u)}"number"!=typeof e.width.value&&t("primary"),"number"!=typeof e.width.secondary&&(e.text.secondary.value&&e.text.value!==e.text.secondary.value?t("secondary"):e.self.width({secondary:e.width.value}))}},{"../../../../core/console/print.coffee":52,"../../../../core/font/tester.coffee":68,"../../../../object/validate.coffee":172,"../../../../util/copy.coffee":207,"../../../form.js":104}],158:[function(e,t,r){var n=e("../../../../util/child.coffee"),a=function(e,t){if(void 0===t)var t=window;d3.select(t).on("click."+e.container.id,function(){var t=d3.event.target||d3.event.toElement,r=t.parentNode;r&&["d3plus_node","d3plus_drop_title"].indexOf(r.className)>=0&&(t=r.parentNode),t&&r&&!n(e.container.ui,t)&&(e.open.value||e.hover.value)&&e.self.open(!1).hover(!1).draw()});try{var r=window.parent.location.host===window.location.host}catch(e){var r=!1}r&&t.self!==window.top&&a(e,t.parent)};t.exports=a},{"../../../../util/child.coffee":205}],159:[function(e,t,r){var n=e("../form.js");t.exports=function(e){"buttons"in e.container||(e.container.buttons=n().container(e.container.ui).type("button"));var t=e.data.viz.length,r=!!e.width.value&&e.width.value/t,a=e.container.ui.selectAll("div.d3plus_toggle").data(e.data.viz,function(t){return t[e.id.value]});a.exit().remove(),a.enter().append("div").attr("class","d3plus_toggle").style("display","inline-block").style("vertical-align","top"),a.order().each(function(t){"form"in t.d3plus||(t.d3plus.form=n().container(d3.select(this)));var a=e.id.nesting.length>e.depth.value?e.id.nesting[e.depth.value+1]:e.id.value;t[a]instanceof Array?t.d3plus.form.container({id:e.container.id+"_"+t[e.id.value]}).data(t[a]).id(e.id.nesting.slice(1)).type("drop"):t.d3plus.form.data([t]).id(e.id.value).type("button"),t.d3plus.form.color(e.color).focus(e.focus.value,function(t){t!==e.focus.value&&e.self.focus(t).draw()}).hover(e.hover.value).icon({select:!1,value:e.icon.value}).font(e.font).format(e.format).order(e.order).text(e.text.value).ui({border:e.ui.border,color:e.ui.color,display:"inline-block",margin:0,padding:e.ui.padding.css}).width(r).draw()}),e.data.element.value&&e.data.element.value.on("focus."+e.container.id,function(){e.self.focus(this.value).hover(this.value).draw()}).on("blur."+e.container.id,function(){e.self.hover(!1).draw()})}},{"../form.js":104}],160:[function(e,t,r){var n,a,o,i,s,l,u,c,f,d,p;d=e("simplify-js"),t.exports=function(e,t){var r,a,i,l,u,f,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,B,C,q,N,P,I,D,V,R,U,L,Y,H,X,G,J,W,Q,K,Z,$,ee,te,re,ne,ae,oe,ie,se,le,ue,ce,fe,de,pe,he,ve,ge,me,ye,xe,be;if(e.length<3)return null;if(w=[],v=.5,u=5,null==t&&(t={}),null==t.maxAspectRatio&&(t.maxAspectRatio=15),null==t.minWidth&&(t.minWidth=0),null==t.minHeight&&(t.minHeight=0),null==t.tolerance&&(t.tolerance=.02),null==t.nTries&&(t.nTries=20),null!=t.angle&&(t.angle instanceof Array?f=t.angle:"number"==typeof t.angle?f=[t.angle]:"string"!=typeof t.angle||isNaN(t.angle)||(f=[Number(t.angle)])),null==f&&(f=d3.range(-90,90+u,u)),null!=t.aspectRatio&&(t.aspectRatio instanceof Array?g=t.aspectRatio:"number"==typeof t.aspectRatio?g=[t.aspectRatio]:"string"!=typeof t.aspectRatio||isNaN(t.aspectRatio)||(g=[Number(t.aspectRatio)])),null!=t.origin&&t.origin instanceof Array&&(W=t.origin[0]instanceof Array?t.origin:[t.origin]),h=Math.abs(d3.geom.polygon(e).area()),0===h)return null;if(re=d3.extent(e,function(e){return e[0]}),Y=re[0],D=re[1],ne=d3.extent(e,function(e){return e[1]}),H=ne[0],V=ne[1],ge=Math.min(D-Y,V-H)*t.tolerance,ve=function(){var t,r,n;for(n=[],t=0,r=e.length;t<r;t++)Q=e[t],n.push({x:Q[0],y:Q[1]});return n}(),ge>0&&(ve=d(ve,ge),e=function(){var e,t,r;for(r=[],e=0,t=ve.length;e<t;e++)Q=ve[e],r.push([Q.x,Q.y]);return r}()),t.vdebug&&w.push({type:"simplify",poly:e}),ae=d3.extent(e,function(e){return e[0]}),Y=ae[0],D=ae[1],oe=d3.extent(e,function(e){return e[1]}),H=oe[0],V=oe[1],m=[[Y,H],[D,H],[D,V],[Y,V]],ie=[D-Y,V-H],x=ie[0],y=ie[1],ye=Math.min(x,y)/50,null==W)for(W=[],b=d3.geom.polygon(e).centroid(),o(b,e)&&W.push(b);W.length<t.nTries;)pe=Math.random()*x+Y,he=Math.random()*y+H,de=[pe,he],o(de,e)&&W.push(de);for(t.vdebug&&w.push({type:"origins",points:W}),C=0,P=null,A=0,E=f.length;A<E;A++)for(i=f[A],l=-i*Math.PI/180,t.vdebug&&w.push({type:"angle",angle:i}),k=j=0,F=W.length;j<F;k=++j)for(G=W[k],se=n(e,G,l),Z=se[0],ee=se[1],le=n(e,G,l+Math.PI/2),K=le[0],$=le[1],X=[],null!=Z&&null!=ee&&X.push([(Z[0]+ee[0])/2,(Z[1]+ee[1])/2]),null!=K&&null!=$&&X.push([(K[0]+$[0])/2,(K[1]+$[1])/2]),t.vdebug&&w.push({type:"modifOrigin",idx:k,p1W:Z,p2W:ee,p1H:K,p2H:$,modifOrigins:X}),M=0,S=X.length;M<S;M++)if(J=X[M],t.vdebug&&w.push({type:"origin",cx:J[0],cy:J[1]}),ue=n(e,J,l),Z=ue[0],ee=ue[1],null!==Z&&null!==ee&&(L=Math.min(p(J,Z),p(J,ee)),I=2*Math.sqrt(L),ce=n(e,J,l+Math.PI/2),K=ce[0],$=ce[1],null!==K&&null!==$&&(U=Math.min(p(J,K),p(J,$)),N=2*Math.sqrt(U),!(I*N<C))))for(null!=g?a=g:(R=Math.max(1,t.minWidth/N,C/(N*N)),q=Math.min(t.maxAspectRatio,I/t.minHeight,I*I/C),a=d3.range(R,q+v,v)),B=0,T=a.length;B<T;B++)if(r=a[B],O=Math.max(t.minWidth,Math.sqrt(C*r)),fe=Math.min(I,N*r),!(fe*N<C))for(fe-O>=ye&&t.vdebug&&w.push({type:"aRatio",aRatio:r});fe-O>=ye;)me=(O+fe)/2,_=me/r,xe=J[0],be=J[1],te=[[xe-me/2,be-_/2],[xe+me/2,be-_/2],[xe+me/2,be+_/2],[xe-me/2,be+_/2]],te=c(te,l,J),s(te,e)?(z=!0,C=me*_,P={cx:xe,cy:be,width:me,height:_,angle:i},O=me):(z=!1,fe=me),t.vdebug&&w.push({type:"rectangle",cx:xe,cy:be,width:me,height:_,areaFraction:me*_/h,angle:i,insidePoly:z});return[P,C,w]},p=function(e,t){var r,n;return r=t[0]-e[0],n=t[1]-e[1],r*r+n*n},l=function(e,t,r){var n,a,o,i,s;return s=t[1]<r[1]?[t,r]:[r,t],n=s[0],a=s[1],e[1]!==a[1]&&e[1]!==n[1]||(e[1]+=Number.MIN_VALUE),!(e[1]>a[1]||e[1]<n[1])&&(!(e[0]>n[0]&&e[0]>a[0])&&(e[0]<n[0]&&e[0]<a[0]||(o=(a[1]-n[1])/(a[0]-n[0]),i=(e[1]-n[1])/(e[0]-n[0]),i>o)))},o=function(e,t){var r,n,a,o,i;for(o=-1,i=t.length,n=t[i-1],a=0;++o<i;)r=n,n=t[o],l(e,r,n)&&a++;return a%2!==0},i=function(e,t,r){var n,a,o;return n=1e-9,a=e[0],o=e[1],!(a<Math.min(t[0],r[0])-n||a>Math.max(t[0],r[0])+n||o<Math.min(t[1],r[1])-n||o>Math.max(t[1],r[1])+n)},a=function(e,t,r,n){var a,o,i,s,l,u,c,f,d,p;return f=1e-9,s=e[0]-t[0],u=e[1]-t[1],l=r[0]-n[0],c=r[1]-n[1],i=s*c-u*l,Math.abs(i)<f?null:(a=e[0]*t[1]-e[1]*t[0],o=r[0]*n[1]-r[1]*n[0],d=(a*l-o*s)/i,p=(a*c-o*u)/i,[d,p])},f=function(e,t,r,n){var o;return o=a(e,t,r,n),null!=o&&(i(o,e,t)&&i(o,r,n))},s=function(e,t){var r,n,a,i,s,l,u,c;for(s=-1,u=e.length,c=t.length,a=e[u-1];++s<u;)for(r=a,a=e[s],l=-1,i=t[c-1];++l<c;)if(n=i,i=t[l],f(r,a,n,i))return!1;return o(e[0],t)},u=function(e,t,r){var n,a,o,i;return null==r&&(r=[0,0]),o=e[0]-r[0],i=e[1]-r[1],n=Math.cos(t),a=Math.sin(t),[n*o-a*i+r[0],a*o+n*i+r[1]]},c=function(e,t,r){var n,a,o,i;for(i=[],n=0,a=e.length;n<a;n++)o=e[n],i.push(u(o,t,r));return i},n=function(e,t,r){var n,o,s,l,u,c,f,d,h,v,g,m,y,x,b;for(u=1e-9,t=[t[0]+u*Math.cos(r),t[1]+u*Math.sin(r)],x=t[0],b=t[1],m=[x+Math.cos(r),b+Math.sin(r)],f=0,Math.abs(m[0]-x)<u&&(f=1),c=-1,v=e.length,o=e[v-1],d=Number.MAX_VALUE,h=Number.MAX_VALUE,s=null,l=null;++c<v;)n=o,o=e[c],g=a(t,m,n,o),null!=g&&i(g,n,o)&&(y=p(t,g),g[f]<t[f]?y<d&&(d=y,s=g):g[f]>t[f]&&y<h&&(h=y,l=g));return[s,l]}},{"simplify-js":8}],161:[function(e,t,r){t.exports=function(e,t,r){var n,a,o,i;return a={x:0,y:0},e<0&&(e=2*Math.PI+e),"square"===r?(o=45*(Math.PI/180),e<=Math.PI?e<Math.PI/2?e<o?(a.x+=t,i=Math.tan(e)*t,a.y+=i):(a.y+=t,n=t/Math.tan(e),a.x+=n):e<Math.PI-o?(a.y+=t,n=t/Math.tan(Math.PI-e),a.x-=n):(a.x-=t,i=Math.tan(Math.PI-e)*t,a.y+=i):e<3*Math.PI/2?e<o+Math.PI?(a.x-=t,i=Math.tan(e-Math.PI)*t,a.y-=i):(a.y-=t,n=t/Math.tan(e-Math.PI),a.x-=n):e<2*Math.PI-o?(a.y-=t,n=t/Math.tan(2*Math.PI-e),a.x+=n):(a.x+=t,i=Math.tan(2*Math.PI-e)*t,a.y-=i)):(a.x+=t*Math.cos(e),a.y+=t*Math.sin(e)),a}},{}],162:[function(e,t,r){var n;n=e("../geom/offset.coffee"),t.exports=function(e){var t,r,a,o,i,s,l,u,c,f,d,p,h,v,g,m;if(!e)return[];for(e=e.slice(1).slice(0,-1).split(/L|A/),f=[],a=0,i=e.length;a<i;a++)if(c=e[a],c=c.split(" "),1===c.length)f.push(c[0].split(",").map(function(e){return parseFloat(e)}));else{for(d=f[f.length-1],o=c.pop().split(",").map(function(e){return parseFloat(e)}),p=parseFloat(c.shift().split(",")[0]),m=Math.sqrt(Math.pow(o[0]-d[0],2)+Math.pow(o[1]-d[1],2)),t=Math.acos((p*p+p*p-m*m)/(2*p*p)),u="1"===c[1].split(",")[0],u&&(t=2*Math.PI-t),s=t/(2*Math.PI)*(p*Math.PI*2),h=s/5,v=Math.atan2(-d[1],-d[0])-Math.PI,g=t/h,r=g;r<t;)l=n(v+r,p),f.push([l.x,l.y]),r+=g;f.push(o)}return f}},{"../geom/offset.coffee":161}],163:[function(e,t,r){var n,a,o;n={},n.version="1.9.8 - Cornflower",n.repo="https://github.com/alexandersimoes/d3plus/",n.array={comparator:e("./array/comparator.coffee"),contains:e("./array/contains.coffee"),sort:e("./array/sort.coffee"),update:e("./array/update.coffee")},n.client={css:e("./client/css.coffee"),ie:e("./client/ie.js"),pointer:e("./client/pointer.coffee"),prefix:e("./client/prefix.coffee"),rtl:e("./client/rtl.coffee"),scroll:e("./client/scroll.js"),scrollbar:e("./client/scrollbar.coffee"),touch:e("./client/touch.coffee")},n.color={legible:e("./color/legible.coffee"),lighter:e("./color/lighter.coffee"),mix:e("./color/mix.coffee"),random:e("./color/random.coffee"),scale:e("./color/scale.coffee"),sort:e("./color/sort.coffee"),text:e("./color/text.coffee"),validate:e("./color/validate.coffee")},n.data={bestRegress:e("./data/bestRegress.coffee"),lof:e("./data/lof.coffee"),mad:e("./data/mad.coffee")},n.font={sizes:e("./font/sizes.coffee"),validate:e("./font/validate.coffee")},n.form=e("./form/form.js"),n.geom={largestRect:e("./geom/largestRect.coffee"),offset:e("./geom/offset.coffee"),path2poly:e("./geom/path2poly.coffee")},n.network={cluster:e("./network/cluster.coffee"),distance:e("./network/distance.coffee"),normalize:e("./network/normalize.coffee"),shortestPath:e("./network/shortestPath.coffee"),smallestGap:e("./network/smallestGap.coffee"),subgraph:e("./network/subgraph.coffee")},n.number={format:e("./number/format.coffee")},n.object={merge:e("./object/merge.coffee"),validate:e("./object/validate.coffee")},n.string={format:e("./string/format.js"),list:e("./string/list.coffee"),strip:e("./string/strip.js"),title:e("./string/title.coffee")},n.textwrap=e("./textwrap/textwrap.coffee"),n.tooltip={create:e("./tooltip/create.js"),move:e("./tooltip/move.coffee"),remove:e("./tooltip/remove.coffee")},n.util={buckets:e("./util/buckets.coffee"),child:e("./util/child.coffee"),closest:e("./util/closest.coffee"),copy:e("./util/copy.coffee"),d3selection:e("./util/d3selection.coffee"),dataurl:e("./util/dataURL.coffee"),uniques:e("./util/uniques.coffee")},n.viz=e("./viz/viz.coffee"),o=e("./client/css.coffee"),a=e("./core/console/print.coffee"),o("d3plus.css")&&a.warning("d3plus.css has been deprecated, you do not need to load this file.",n.repo+"releases/tag/v1.4.0"),"undefined"!=typeof window&&(window.d3plus=n),t.exports=n},{"./array/comparator.coffee":32,"./array/contains.coffee":33,"./array/sort.coffee":34,"./array/update.coffee":35,"./client/css.coffee":36,"./client/ie.js":37,"./client/pointer.coffee":38,"./client/prefix.coffee":39,"./client/rtl.coffee":40,"./client/scroll.js":41,"./client/scrollbar.coffee":42,"./client/touch.coffee":43,"./color/legible.coffee":44,"./color/lighter.coffee":45,"./color/mix.coffee":46,"./color/random.coffee":47,"./color/scale.coffee":48,"./color/sort.coffee":49,"./color/text.coffee":50,"./color/validate.coffee":51,"./core/console/print.coffee":52,"./data/bestRegress.coffee":99,"./data/lof.coffee":100,"./data/mad.coffee":101,"./font/sizes.coffee":102,"./font/validate.coffee":103,"./form/form.js":104,"./geom/largestRect.coffee":160,"./geom/offset.coffee":161,"./geom/path2poly.coffee":162,"./network/cluster.coffee":164,"./network/distance.coffee":165,"./network/normalize.coffee":166,"./network/shortestPath.coffee":167,"./network/smallestGap.coffee":168,"./network/subgraph.coffee":169,"./number/format.coffee":170,"./object/merge.coffee":171,"./object/validate.coffee":172,"./string/format.js":173,"./string/list.coffee":174,"./string/strip.js":175,"./string/title.coffee":176,"./textwrap/textwrap.coffee":200,"./tooltip/create.js":201,"./tooltip/move.coffee":202,"./tooltip/remove.coffee":203,"./util/buckets.coffee":204,"./util/child.coffee":205,"./util/closest.coffee":206,"./util/copy.coffee":207,"./util/d3selection.coffee":208,"./util/dataURL.coffee":209,"./util/uniques.coffee":210,"./viz/viz.coffee":333}],164:[function(e,t,r){var n;n=e("./normalize.coffee"),t.exports=function(e,t){var r,a,o,i,s,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,B,C;if(v=[],null==t&&(t={}),(null==t.nodes||"object"!=typeof t.nodes)&&(S=n(e,t),e=S[0],t=S[1],null===t))return null;d=t.distance,O=t.nodeid,C=t.startpoint,h=t.endpoint,E=t.nodes,F={};for(m in E)F[m]={node:E[m].node,degree:0};for(z=0,k={},g=0,w=e.length;g<w;g++)p=e[g],a=O(C(p)),o=O(h(p)),a in k||(k[a]={}),o in k||(k[o]={}),o in k[a]||(k[a][o]=0,k[o][a]=0,z++,F[a].degree+=1,F[o].degree+=1);u={},r=0;for(m in F)M=F[m],u[m]={score:M.degree/(2*z),nodes:[m]};for(a in k)for(o in k[a])k[a][o]=1/(2*z)-F[a].degree*F[o].degree/(4*z*z);for(y=0;y<1e3;){f=-1,A=void 0,j=void 0;for(a in k)for(o in k[a])k[a][o]>f&&(f=k[a][o],A=a,j=o);if(f<0)break;for(b in k[A])b!==j&&(b in k[j]?k[j][b]+=k[A][b]:k[j][b]=k[A][b]-2*u[j].score*u[b].score,k[b][j]=k[j][b]),delete k[b][A];for(b in k[j])b in k[A]||b===j||(k[j][b]-=2*u[A].score*u[b].score,k[b][j]=k[j][b]);for(T=u[A].nodes,x=0,_=T.length;x<_;x++)M=T[x],u[j].nodes.push(M);u[j].score+=u[A].score,t.vdebug&&v.push({type:"merge",father:j,child:A,nodes:u[j].nodes}),delete u[A],delete k[A],r+=f,y++}return l=function(){var e;e=[];for(i in u)c=u[i],e.push([i,c.nodes.length]);return e}(),l.sort(function(e,t){return t[1]-e[1]}),B=function(){var e,t,r;for(r=[],e=0,t=l.length;e<t;e++)s=l[e],r.push(u[s[0]].nodes);return r}(),[B,v]}},{"./normalize.coffee":166}],165:[function(e,t,r){t.exports=function(e,t){var r,n;return e instanceof Array||(e=[e.x,e.y]),t instanceof Array||(t=[t.x,t.y]),r=Math.abs(e[0]-t[0]),n=Math.abs(e[1]-t[1]),Math.sqrt(r*r+n*n)}},{}],166:[function(e,t,r){var n;n=e("../core/console/print.coffee"),t.exports=function(e,t){var r,a,o,i,s,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,B;if(F=t.source,T=t.target,i=t.directed,s=t.distance,j=t.nodeid,S=t.startpoint,c=t.endpoint,r=t.K,B=t.vdebug,i||(i=!1),null==r&&(r=1),null==j?j=function(e){return e}:"string"==typeof j&&(j=function(e){return function(t){return t[e]}}(j)),null!=F&&"object"==typeof F&&(F=j(F)),null!=T&&"object"==typeof T&&(T=j(T)),null==S?S=function(e){return e.source}:"string"==typeof S&&(S=function(e){return function(t){return t[e]}}(S)),null==c?c=function(e){return e.target}:"string"==typeof c&&(c=function(e){return function(t){return t[e]}}(c)),null==s)s=function(e){return 1};else if("number"==typeof s)s=function(e){return function(t){return e}}(s);else if("string"==typeof s)s=function(e){return function(t){return t[e]}}(s);else if(s instanceof Array){for(u={},d=m=0,b=e.length;m<b;d=++m)l=e[d],a=j(S(l)),o=j(c(l)),u[a+"_"+o]=s[d];s=function(e){return a=j(S(e)),o=j(c(e)),u[a+"_"+o]}}for(M={},y=0,w=e.length;y<w;y++){for(l=e[y],z=S(l),A=c(l),v=j(z),g=j(A),O=[z,A],x=0,_=O.length;x<_;x++)k=O[x],p=j(k),p in M||(M[p]={node:k,outedges:[]});M[v].outedges.push(l),i||M[g].outedges.push(l)}return f=null,0===e.length?f="The length of edges is 0":r<0?f="K can not have negative value":null==s(e[0])?f="Check the distance function/attribute":null==S(e[0])?f="Check the startpoint function/attribute":null==c(e[0])?f="Check the endpoint function/attribute":(h=j(S(e[0])),null==h||"string"!=(E=typeof h)&&"number"!==E?f="Check the nodeid function/attribute":null==F||F in M?null==T||T in M||(f="The target is not in the graph"):f="The source is not in the graph"),null!=f?(n.error(f),null):[e,{source:F,target:T,directed:i,distance:s,nodeid:j,startpoint:S,endpoint:c,K:r,nodes:M,vdebug:B}]}},{"../core/console/print.coffee":52}],167:[function(e,t,r){var n,a;n=e("heap"),a=e("./normalize.coffee"),t.exports=function(e,t,r){var o,i,s,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,B;if(null==r&&(r={}),r.source=t,(null==r.nodes||"object"!=typeof r.nodes)&&(A=a(e,r),e=A[0],r=A[1],null===r))return null;t=r.source,S=r.target,u=r.directed,c=r.distance,_=r.nodeid,F=r.startpoint,d=r.endpoint,o=r.K,k=r.nodes;for(g in k)w=k[g],w.count=0;for(h=new n(function(e,t){return e.distance-t.distance}),B={},null==S&&(B[t]=!0),h.push({edge:null,target:t,distance:0}),b=0,E=[];!h.empty()&&(b=Math.max(b,h.size()),z=h.pop(),T=z.target,k[T].count++,null==S?E.push(z):T===S&&E.push(z),E.length!==o);)if(k[T].count<=o)for(j=k[T].outedges,v=0,y=j.length;v<y;v++){if(f=j[v],i=_(F(f)),l=_(d(f)),u||l!==T||(M=[l,i],i=M[0],l=M[1]),null==S){if(B[l])continue;B[l]=!0}s=z.distance+c(f),h.push({edge:f,previous:z,target:l,distance:s})}for(p=function(t){for(e=[];null!=t.edge;)e.push(t.edge),t=t.previous;return e.reverse()},m=0,x=E.length;m<x;m++)O=E[m],null!=S&&(delete O.target,O.edges=p(O)),delete O.edge,delete O.previous;return E}},{"./normalize.coffee":166,heap:3}],168:[function(e,t,r){var n;n=e("./distance.coffee"),t.exports=function(e,t){var r,a;return t||(t={}),r=[],a=d3.geom.quadtree().x(function(e){return t.accessor?t.accessor(e)[0]:e[0]}).y(function(e){return t.accessor?t.accessor(e)[1]:e[1]}),a(e).visit(function(e){var a,o,i,s,l,u,c,f;if(!e.leaf)for(c=e.nodes,a=0,i=c.length;a<i;a++)if(l=c[a],l&&l.point)if(t.origin)r.push(n(l,t));else for(f=e.nodes,o=0,s=f.length;o<s;o++)u=f[o],u&&u.point&&u.point!==l.point&&r.push(n(l,u));return!1}),t.all?r.sort(function(e,t){return e-t}):d3.min(r)}},{"./distance.coffee":165}],169:[function(e,t,r){var n;n=e("./normalize.coffee"),t.exports=function(e,t,r){var a,o,i,s,l,u,c,f,d,p,h,v;return null==r&&(r={}),r.source=t,null!=r.nodes&&"object"==typeof r.nodes||(p=n(e,r),e=p[0],r=p[1],null!==r)?(t=r.source,i=r.directed,s=r.distance,f=r.nodeid,h=r.startpoint,u=r.endpoint,a=r.K,d=r.nodes,v={},v[t]=!0,o=function(e,t){var r,n,l,c,p,g,m,y,x;for(m=d[e].outedges,x=[],c=0,p=m.length;c<p;c++)l=m[c],r=f(h(l)),n=f(u(l)),i||n!==e||(y=[n,r],r=y[0],n=y[1]),n in v?x.push(void 0):(g=t+s(l),g<=a?(v[n]=!0,x.push(o(n,g))):x.push(void 0));return x},o(t,0),{nodes:function(){var e;e=[];for(c in v)e.push(d[c].node);return e}(),edges:function(){var t,r,n;for(n=[],t=0,r=e.length;t<r;t++)l=e[t],f(h(l))in v&&f(u(l))in v&&n.push(l);return n}()}):null}},{"./normalize.coffee":166}],170:[function(e,t,r){var n;n=e("../core/locale/languages/en_US.coffee"),t.exports=function(e,t){var r,a,o,i,s,l,u,c,f,d,p,h;return void 0===e||null===e||e===!1?"":(t||(t={}),l="locale"in t?t.locale:n,d=l.time.slice(),a=d3.locale(l.format),t||(t={}),p=t.vars||{},o=t.key,i=!("labels"in t)||t.labels,s=e.toString().split(".")[0].length,p.time&&p.time.value&&d.push(p.time.value),"string"==typeof o&&d.indexOf(o.toLowerCase())>=0?u=e:"share"===o?(u=0===e?0:e>=100?a.numberFormat(",f")(e):e>99?a.numberFormat(".3g")(e):a.numberFormat(".2g")(e),u+="%"):e<10&&e>-10?(s=e.toString().split("."),c=1,s.length>1&&(c=d3.min([parseFloat(s[1]).toString().length,2]),-1<e&&e<1||(h=s[1].length-parseFloat(s[1]).toString().length,c+=1+h)),u=a.numberFormat("."+c+"g")(e)):s>3?(f=d3.formatPrefix(e).symbol,f=f.replace("G","B"),e=d3.formatPrefix(e).scale(e),e=a.numberFormat(".3g")(e),e=e.replace(l.format.decimal,"."),e=parseFloat(e)+"",e=e.replace(".",l.format.decimal),u=e+f):u=3===s?a.numberFormat(",f")(e):0===e?0:e===parseInt(e,10)?a.numberFormat(".2")(e):a.numberFormat(".3g")(e),u.length>2&&""+u.indexOf(".0")===u.length-2&&(u=u.slice(0,u.length-2)),i&&o&&"format"in p&&o in p.format.affixes.value?(r=p.format.affixes.value[o],r[0]+u+r[1]):u)}},{"../core/locale/languages/en_US.coffee":70}],171:[function(e,t,r){var n,a;n=e("../util/d3selection.coffee"),a=e("./validate.coffee"),t.exports=function(e,t){var r,o;return r=function(e,t,o){var i,s,l;s=[];for(i in e)l=e[i],"undefined"!=typeof l?!o&&a(l)?("object"!=typeof t[i]&&(t[i]={}),s.push(r(l,t[i],0===i.indexOf("d3plus")))):!n(l)&&l instanceof Array?s.push(t[i]=l.slice(0)):s.push(t[i]=l):s.push(void 0);return s},o={},e&&r(e,o),t&&r(t,o),o}},{"../util/d3selection.coffee":208,"./validate.coffee":172}],172:[function(e,t,r){t.exports=function(e){return e&&e.constructor===Object}},{}],173:[function(e,t,r){t.exports=function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return t.unkeyed_index=0,t.replace(/\{(\w*)\}/g,function(r,n){if(""===n&&(n=t.unkeyed_index,t.unkeyed_index++),n==+n)return"undefined"!==e[n]?e[n]:r;for(var a=0;a<e.length;a++)if("object"==typeof e[a]&&"undefined"!=typeof e[a][n])return e[a][n];return r}.bind(t))}},{}],174:[function(e,t,r){var n,a;n=e("./format.js"),a=e("../core/locale/languages/en_US.coffee").ui,t.exports=function(e,t,r,o){var i;return e instanceof Array?(e=e.slice(0),t||(t=a.and),o||(o=a.moreText),2===e.length?e.join(" "+t+" "):(r&&e.length>r&&(i=e.length-r+1,e=e.slice(0,r-1),e[r-1]=n(o,i)),e.length>1&&(e[e.length-1]=t+" "+e[e.length-1]),e.join(", "))):e}},{"../core/locale/languages/en_US.coffee":70,"./format.js":173}],175:[function(e,t,r){t.exports=function(e){var t=["!","@","#","$","%","^","&","*","(",")","[","]","{","}",".",",","/","\\","|","'",'"',";",":","<",">","?","=","+"],r=[[/[\300-\306]/g,"A"],[/[\340-\346]/g,"a"],[/[\310-\313]/g,"E"],[/[\350-\353]/g,"e"],[/[\314-\317]/g,"I"],[/[\354-\357]/g,"i"],[/[\322-\330]/g,"O"],[/[\362-\370]/g,"o"],[/[\331-\334]/g,"U"],[/[\371-\374]/g,"u"],[/[\321]/g,"N"],[/[\361]/g,"n"],[/[\307]/g,"C"],[/[\347]/g,"c"]];return e+="",""+e.replace(/[^A-Za-z0-9\-_]/g,function(e){if(" "===e)return"_";if(t.indexOf(e)>=0)return"";for(var n=e,a=0;a<r.length;a++)if(new RegExp(r[a][0]).test(e)){n=r[a][1];break}return n})}},{}],176:[function(e,t,r){var n;n=e("../core/locale/languages/en_US.coffee"),t.exports=function(e,t){var r,a,o,i,s;return e?(t||(t={}),o=t.key,"."===e.charAt(e.length-1)?e.charAt(0).toUpperCase()+e.substr(1):(i="locale"in this?this.locale.value:n,s=i.lowercase.map(function(e){return e.toLowerCase()}),a=i.uppercase,a=a.concat(a.map(function(e){return e+"s"})),r=a.map(function(e){return e.toLowerCase()}),e.replace(/[^\s!-#%&(-\x2A,-:;\x3F@\x5B-\x5D_\x7B}\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]*/g,function(t,n){ | |
| var o,i;return t?(o=r.indexOf(t.toLowerCase()),i=o>=0?a[o]:s.indexOf(t.toLowerCase())>=0&&0!==n&&n!==e.length-1?t.toLowerCase():t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()):""}))):""}},{"../core/locale/languages/en_US.coffee":70}],177:[function(e,t,r){var n,a;n=e("./foreign.coffee"),a=e("./tspan.coffee"),t.exports=function(e){e.text.html.value?n(e):a(e)}},{"./foreign.coffee":178,"./tspan.coffee":181}],178:[function(e,t,r){t.exports=function(e){var t,r,n,a,o;o=e.container.value,n=o.attr("font-family")||o.style("font-family"),t=e.align.value||o.attr("text-anchor")||o.style("text-anchor"),r=o.attr("fill")||o.style("fill"),a=o.attr("opacity")||o.style("opacity"),t="end"===t?"right":"middle"===t?"center":"left",d3.select(o.node().parentNode).append("foreignObject").attr("width",e.width.value+"px").attr("height",e.height.value+"px").attr("x","0px").attr("y","0px").append("xhtml:div").style("font-family",n).style("font-size",e.size.value[1]+"px").style("color",r).style("text-align",t).style("opacity",a).text(e.text.current)}},{}],179:[function(e,t,r){t.exports=function(e){var t,r,n,a,o,i,s,l,u,c;if(r=e.container.value,a=r.node().previousElementSibling,i=a?a.tagName.toLowerCase():"",a&&(a=d3.select(a)),e.container.x=e.x.value||parseFloat(r.attr("x"),10),e.container.y=e.y.value||parseFloat(r.attr("y"),10),a&&(e.shape.accepted.indexOf(i)>=0&&e.self.shape(i),"rect"===i?(u=parseFloat(a.attr("x"),10)||0,c=parseFloat(a.attr("y"),10)||0,e.padding.value===!1&&(t=Math.abs(u-e.container.x),t&&e.self.padding(t)),e.container.x||(e.container.x=u+e.padding.value),e.container.y||(e.container.y=c+e.padding.value),e.width.value||(l=parseFloat(a.attr("width")),e.self.width(l)),e.height.value||(n=parseFloat(a.attr("height")),e.self.height(n))):"circle"===i?(o=parseFloat(a.attr("r"),10),u=parseFloat(a.attr("cx"),10)||0,u-=o,c=parseFloat(a.attr("cy"),10)||0,c-=o,e.padding.value===!1&&(t=Math.abs(u-e.container.x),t&&e.self.padding(t)),e.container.x||(e.container.x=u+e.padding.value),e.container.y||(e.container.y=c+e.padding.value),e.width.value||e.self.width(2*o,10),e.height.value||e.self.height(2*o,10)):(e.width.value||e.self.width(500),e.height.value||e.self.height(500))),e.container.x||(e.container.x=0),e.container.y||(e.container.y=0),e.width.inner=e.width.value-2*e.padding.value,e.height.inner=e.height.value-2*e.padding.value,s=r.attr("font-size")||r.style("font-size"),s=parseFloat(s,10),e.container.fontSize=s,e.container.dy=parseFloat(r.attr("dy"),10),!e.size.value)return e.resize.value?e.self.size([4,80]):e.self.size([s/2,s])}},{}],180:[function(e,t,r){t.exports=function(e){var t;if(e.text.value||(t=e.container.value.text(),t&&(t.indexOf("tspan")>=0&&(t.replace(/\<\/tspan\>\<tspan\>/g," "),t.replace(/\<\/tspan\>/g,""),t.replace(/\<tspan\>/g,"")),t=t.replace(/(\r\n|\n|\r)/gm,""),t=t.replace(/^\s+|\s+$/g,""),e.self.text(t))),e.text.value instanceof Array?e.text.phrases=e.text.value.filter(function(e){return["string","number"].indexOf(typeof e)>=0}):e.text.phrases=[e.text.value+""],!e.align.value)return e.container.align=e.container.value.style("text-anchor")||e.container.value.attr("text-anchor")}},{}],181:[function(e,t,r){var n;n=e("../../client/rtl.coffee"),t.exports=function(e){var t,r,a,o,i,s,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T;return d=function(t){var n;return n=!v||t?e.container.value.append("tspan"):e.container.value.insert("tspan","tspan"),n.attr("x",E+"px").attr("dy",r+"px").style("baseline-shift","0%").attr("dominant-baseline","alphabetic")},f=e.rotate.value===-90||90===e.rotate.value,j=f?e.height.inner:e.width.inner,s=f?e.width.inner:e.height.inner,t="circle"===e.shape.value?"middle":e.align.value||e.container.align||"start",F="end"===t||"start"===t&&n?j:"middle"===t?j/2:0,A=e.valign.value||"top",E=e.container.x+F,o=e.resize.value?e.size.value[1]:e.container.fontSize||e.size.value[0],r=e.container.dy||1.1*o,_=null,h=null,M=null,v=!1,T=0,"circle"===e.shape.value&&("middle"===A?T=s/r%1*r/2:"end"===A&&(T=s/r%1*r)),e.container.value.attr("text-anchor",t).attr("font-size",o+"px").style("font-size",o+"px").attr("x",e.container.x).attr("y",e.container.y),z=function(){if(_.remove(),v?(l++,_=e.container.value.select("tspan")):(l--,_=d3.select(e.container.value.node().lastChild)),!_.empty())return M=_.text().match(/[^\s-]+-?/g),a()},u=function(){var t;return"circle"===e.shape.value?(t=(l-1)*r+T,t>s/2&&(t+=r),2*Math.sqrt(t*(2*(j/2)-t))):j},a=function(){var t,r;return M&&M.length?(r=M.pop(),t=r.charAt(r.length-1),1===r.length&&e.text.split.value.indexOf(r)>=0?a():(e.text.split.value.indexOf(t)>=0&&(r=r.substr(0,r.length-1)),_.text(M.join(" ")+" "+r+"..."),_.node().getComputedTextLength()>u()?a():void 0)):z()},p=function(t){var r,n,a,o;if(r=_.text(),o="",v){if(o=e.text.current.charAt(e.text.current.length-h.length-1)," "===o)for(a="",n=2;" "===o;)a+=" ",o=e.text.current.charAt(e.text.current.length-h.length-n),n++;else a="";h=t+a+h,_.text(t+a+r)}else{if(o=e.text.current.charAt(h.length)," "===o)for(a="",n=1;" "===o;)a+=" ",o=e.text.current.charAt(h.length+n),n++;else a="";h+=a+t,_.text(r+a+t)}if(Math.floor(_.node().getComputedTextLength())>u()||"\n"===o)return _.text(r),r.length&&(_=d()),_.text(t),v?l--:l++},w=1,l=null,c=null,O=function(){var t,n,a,o,i,u;for(e.container.value.text("").html(""),M=e.text.words.slice(),v&&M.reverse(),h="",_=d(!0),l=w,n=0,a=M.length;n<a;n++){if(u=M[n],l*r>s){z();break}for(p(u),i=!0;i;){for(o=e.text.current.charAt(h.length),t=1;" "===o;)o=e.text.current.charAt(h.length+t),t++;i=e.text.split.value.indexOf(o)>=0,i&&p(o)}}return l*r>s&&z(),c=Math.abs(l-w)+1},O(),c=0,e.container.value.selectAll("tspan").each(function(){if(d3.select(this).text().length)return c++}),"circle"===e.shape.value&&(b=s-c*r,b>r&&("middle"===A?(w=(b/r/2>>0)+1,O()):"bottom"===A&&(v=!0,w=s/r>>0,O()))),c=0,e.container.value.selectAll("tspan").each(function(){if(d3.select(this).text().length)return c++}),"top"===A?S=0:(i=c*r,S="middle"===A?s/2-i/2:s-i),S-=.2*r,k="translate(0,"+S+")",180===e.rotate.value||e.rotate.value===-180?(y=e.container.x+j/2,x=e.container.y+s/2):(g=e.rotate.value<0?j:s,y=e.container.x+g/2,x=e.container.y+g/2),m="rotate("+e.rotate.value+", "+y+", "+x+")",e.container.value.attr("transform",m+k)}},{"../../client/rtl.coffee":40}],182:[function(e,t,r){var n,a,o,i;n=e("./flow.coffee"),a=e("../../font/sizes.coffee"),i=function(e){var t;e.text.phrases.length&&(e.text.current=e.text.phrases.shift()+"",e.text.words=e.text.current.match(e.text.split.break),t=e.text.current.charAt(0),t!==e.text.words[0].charAt(0)&&(e.text.words[0]=t+e.text.words[0]),e.container.value.html(""),e.resize.value?o(e):n(e))},t.exports=i,o=function(e){var t,r,o,s,l,u,c,f,d,p,h,v,g,m,y,x,b;for(b=[],c=0;c<e.text.words.length;)t=c===e.text.words.length-1?"":" ",b.push(e.text.words[c]+t),c++;p=e.rotate.value===-90||90===e.rotate.value,y=p?e.height.inner:e.width.inner,l=p?e.width.inner:e.height.inner,h=Math.floor(e.size.value[1]),f="circle"===e.shape.value?.75*y:y,g=a(b,{"font-size":h+"px"},{parent:e.container.value}),d=d3.max(g,function(e){return e.width}),r=1.165+y/l*.11,m=d3.sum(g,function(t){var r;return r=e.container.dy||1.2*h,t.width*r})*r,s="circle"===e.shape.value?Math.PI*Math.pow(y/2,2):f*l,(d>f||m>s)&&(o=Math.sqrt(s/m),x=f/d,v=d3.min([o,x]),h=d3.max([e.size.value[0],Math.floor(h*v)])),u=Math.floor(.8*l),h>u&&(h=u),d*(h/e.size.value[1])<=f?(h!==e.size.value[1]&&e.self.size([e.size.value[0],h]),n(e)):i(e)}},{"../../font/sizes.coffee":102,"./flow.coffee":177}],183:[function(e,t,r){t.exports={accepted:[!1,"start","middle","end","left","center","right"],process:function(e){var t;return t=["left","center","right"].indexOf(e),t>=0&&(e=this.accepted[t+1]),e},value:!1}},{}],184:[function(e,t,r){arguments[4][108][0].apply(r,arguments)},{dup:108}],185:[function(e,t,r){var n;n=e("../../util/d3selection.coffee"),t.exports={accepted:[!1,Array,Object,String],element:!1,id:"default",process:function(e){return e!==!1&&(n(e)?e:e instanceof Array?d3.select(e[0][0]):(this.selector=e,d3.select(e)))},value:!1}},{"../../util/d3selection.coffee":208}],186:[function(e,t,r){arguments[4][112][0].apply(r,arguments)},{dup:112}],187:[function(e,t,r){var n,a;n=e("../../core/console/print.coffee"),a=e("../../string/format.js"),t.exports={accepted:[void 0],process:function(e,t){var r,o;return this.initialized===!1?e:(t.container.value===!1?(o=t.format.locale.value.dev.setContainer,n.warning(o,"container")):t.container.value.empty()?(o=t.format.locale.value.dev.noContainer,r=t.container.selector||"",n.warning(a(o,'"'+r+'"'),"container")):(t.dev.value&&n.time("total draw time"),t.container.value.call(t.self)),e)},value:void 0}},{"../../core/console/print.coffee":52,"../../string/format.js":173}],188:[function(e,t,r){var n,a;n=e("../../core/locale/locale.coffee"),a=e("../../object/merge.coffee"),t.exports={accepted:[Function,String],locale:{accepted:function(){return d3.keys(n)},process:function(e){var t,r;return t="en_US",r=n[t],e!==t&&(r=a(r,n[e])),this.language=e,r},value:"en_US"},process:function(e,t){if(this.initialized&&"string"==typeof e)t.self.format({locale:e});else if("function"==typeof e)return e;return this.value},value:"en_US"}},{"../../core/locale/locale.coffee":79,"../../object/merge.coffee":171}],189:[function(e,t,r){t.exports={accepted:[!1,Number],value:!1}},{}],190:[function(e,t,r){arguments[4][189][0].apply(r,arguments)},{dup:189}],191:[function(e,t,r){arguments[4][112][0].apply(r,arguments)},{dup:112}],192:[function(e,t,r){t.exports={accepted:[-180,-90,0,90,180],value:0}},{}],193:[function(e,t,r){t.exports={accepted:["circle","square"],value:!1}},{}],194:[function(e,t,r){t.exports={accepted:[Array,!1],value:!1}},{}],195:[function(e,t,r){t.exports={accepted:[!1,Array,Number,String],html:{accepted:[Boolean],value:!1},init:function(e){var t;return t=this.split.value,this.split.break=new RegExp("[^\\s\\"+t.join("\\")+"]+\\"+t.join("?\\")+"?","g"),!1},split:{accepted:[Array],process:function(e){return this.break=new RegExp("[^\\s\\"+e.join("\\")+"]+\\"+e.join("?\\")+"?","g"),e},value:["-","/",";",":","&"]}}},{}],196:[function(e,t,r){t.exports={accepted:[!1,"top","middle","bottom"],value:!1}},{}],197:[function(e,t,r){arguments[4][189][0].apply(r,arguments)},{dup:189}],198:[function(e,t,r){arguments[4][189][0].apply(r,arguments)},{dup:189}],199:[function(e,t,r){arguments[4][189][0].apply(r,arguments)},{dup:189}],200:[function(e,t,r){var n,a,o,i,s;n=e("../core/methods/attach.coffee"),o=e("./helpers/parseSize.coffee"),a=e("../core/console/print.coffee"),i=e("./helpers/parseText.coffee"),s=e("./helpers/wrap.coffee"),t.exports=function(){var t;return t={self:function(e){return e.each(function(){o(t),t.size.value[0]<=t.height.inner?(i(t),s(t)):t.container.value.html(""),t.dev.value&&a.timeEnd("total draw time")}),t.self}},n(t,{align:e("./methods/align.coffee"),config:e("./methods/config.coffee"),container:e("./methods/container.coffee"),dev:e("./methods/dev.coffee"),draw:e("./methods/draw.coffee"),format:e("./methods/format.coffee"),height:e("./methods/height.coffee"),padding:e("./methods/padding.coffee"),resize:e("./methods/resize.coffee"),rotate:e("./methods/rotate.coffee"),text:e("./methods/text.coffee"),shape:e("./methods/shape.coffee"),size:e("./methods/size.coffee"),valign:e("./methods/valign.coffee"),width:e("./methods/width.coffee"),x:e("./methods/x.coffee"),y:e("./methods/y.coffee")}),t.self}},{"../core/console/print.coffee":52,"../core/methods/attach.coffee":80,"./helpers/parseSize.coffee":179,"./helpers/parseText.coffee":180,"./helpers/wrap.coffee":182,"./methods/align.coffee":183,"./methods/config.coffee":184,"./methods/container.coffee":185,"./methods/dev.coffee":186,"./methods/draw.coffee":187,"./methods/format.coffee":188,"./methods/height.coffee":189,"./methods/padding.coffee":190,"./methods/resize.coffee":191,"./methods/rotate.coffee":192,"./methods/shape.coffee":193,"./methods/size.coffee":194,"./methods/text.coffee":195,"./methods/valign.coffee":196,"./methods/width.coffee":197,"./methods/x.coffee":198,"./methods/y.coffee":199}],201:[function(e,t,r){function n(){d3.selectAll("div.d3plus_tooltip_data_desc").style("height","0px"),d3.selectAll("div.d3plus_tooltip_data_help").style("background-color","#ccc")}var a=e("../core/locale/languages/en_US.coffee"),o=e("../client/pointer.coffee"),i=e("../color/legible.coffee"),s=e("./move.coffee"),l=e("../client/prefix.coffee"),u=e("../client/rtl.coffee"),c=e("./remove.coffee"),f=e("../client/scroll.js"),d=e("../client/scrollbar.coffee"),p=e("../string/list.coffee"),h=e("../color/text.coffee");t.exports=function(e){var t=e.fullscreen?250:200,r=l();e.width=e.width||t,e.max_width=e.max_width||386,e.id=e.id||"default",e.size=e.fullscreen||e.html?"large":"small",e.offset=e.offset||0,e.arrow_offset=e.arrow?8:0,e.x=e.x||0,e.y=e.y||0,e.parent=e.parent||d3.select("body"),e.curtain=e.curtain||"#fff",e.curtainopacity=e.curtainopacity||.8,e.background=e.background||"#fff",e.fontcolor=e.fontcolor||"#444",e.fontfamily=e.fontfamily||"sans-serif",e.fontweight=e.fontweight||"normal",e.fontsize=e.fontsize||"12px",e.style=e.style||"default",e.zindex="small"==e.size?2e3:500,e.locale=e.locale||a,e.stacked=e.stacked||!1;var v=e.parent?e.parent.node().offsetHeight||e.parent.node().getBoundingClientRect().height:0;if(e.iconsize||(e.iconsize="small"==e.size?22:50),e.parent.node()===document.body){e.limit=[window.innerWidth+f.x(),window.innerHeight+f.y()];var g=d();document.body.scrollHeight>window.innerHeight&&(e.limit[0]-=g)}else e.limit=[parseFloat(e.parent.style("width"),10),parseFloat(e.parent.style("height"),10)];if(e.title instanceof Array){var m=e.locale.ui.and,y=e.locale.ui.more;e.title=p(e.title,m,3,y)}if(c(e.id),e.anchor={},e.fullscreen)e.anchor.x="center",e.anchor.y="center",e.x=e.parent?e.parent.node().offsetWidth/2:window.innerWidth/2,e.y=e.parent?v/2:window.innerHeight/2;else if(e.align){var x=e.align.split(" ");e.anchor.y=x[0],x[1]?e.anchor.x=x[1]:e.anchor.x="center"}else e.anchor.x="center",e.anchor.y="top";var b=e.width-30;if(e.fullscreen){e.parent.append("div").attr("id","d3plus_tooltip_curtain_"+e.id).attr("class","d3plus_tooltip_curtain").style("background-color",e.curtain).style("opacity",e.curtainopacity).style("position","absolute").style("z-index",499).style("top","0px").style("right","0px").style("bottom","0px").style("left","0px").on(o.click,function(){c(e.id)})}var w=e.parent.append("div").datum(e).attr("id","d3plus_tooltip_id_"+e.id).attr("class","d3plus_tooltip d3plus_tooltip_"+e.size).style("color",e.fontcolor).style("font-family",e.fontfamily).style("font-weight",e.fontweight).style("font-size",e.fontsize+"px").style(r+"box-shadow","0px 1px 3px rgba(0, 0, 0, 0.25)").style("position","absolute").on(o.out,n);e.max_height&&w.style("max-height",e.max_height+"px"),e.fixed?(w.style("z-index",500),e.mouseevents=!0):w.style("z-index",2e3);var _=w.append("div").datum(e).attr("class","d3plus_tooltip_container").style("background-color",e.background).style("padding","6px");if(e.fullscreen&&e.html&&!e.stacked){z=e.parent?.75*e.parent.node().offsetWidth:.75*window.innerWidth,P=e.parent?.75*v:.75*window.innerHeight,_.style("width",z+"px").style("height",P+"px");var k=_.append("div").attr("class","d3plus_tooltip_body").style("padding-right","6px").style("display","inline-block").style("z-index",1).style("width",e.width+"px")}else{if("auto"==e.width){var z="auto";_.style("max-width",e.max_width+"px")}else var z=e.width-14+"px";var k=_.style("width",z)}if(e.title||e.icon)var A=k.append("div").attr("class","d3plus_tooltip_header").style("position","relative").style("z-index",1);if(e.fullscreen){w.append("div").attr("class","d3plus_tooltip_close").style("background-color",e.color).style("color",h(e.color)).style("position","absolute").style(r+"box-shadow","0 1px 3px rgba(0, 0, 0, 0.25)").style("font-size","20px").style("height","18px").style("line-height","14px").style("text-align","center").style("right","16px").style("top","-10px").style("width","18px").style("z-index",10).html("×").on(o.over,function(){d3.select(this).style("cursor","pointer").style(r+"box-shadow","0 1px 3px rgba(0, 0, 0, 0.5)")}).on(o.out,function(){d3.select(this).style("cursor","auto").style(r+"box-shadow","0 1px 3px rgba(0, 0, 0, 0.25)")}).on(o.click,function(){c(e.id)});d3.select("body").on("keydown.esc_"+e.id,function(){27===d3.event.keyCode&&(c(e.id),d3.select("body").on("keydown.esc_"+e.id,null))})}if(e.mouseevents){if(e.mouseevents!==!0){var j=d3.select(e.mouseevents).on(o.out),M=function(){var t=d3.event.toElement||d3.event.relatedTarget;if(t)var r="string"==typeof t.className?t.className:t.className.baseVal,a=0==r.indexOf("d3plus_tooltip");else var a=!1;t&&(O(w.node(),t)||O(e.mouseevents,t)||a)||(j(d3.select(e.mouseevents).datum()),n(),d3.select(e.mouseevents).on(o.out,j))},O=function(e,t){for(var r=t.parentNode;null!==r;){if(r==e)return!0;r=r.parentNode}return!1};d3.select(e.mouseevents).on(o.out,M),w.on(o.out,M);var E=d3.select(e.mouseevents).on(o.move);E&&w.on(o.move,E)}}else w.style("pointer-events","none");if(e.arrow){w.append("div").attr("class","d3plus_tooltip_arrow").style("background-color",e.background).style(r+"box-shadow","0px 1px 3px rgba(0, 0, 0, 0.25)").style("position","absolute").style("bottom","-5px").style("height","10px").style("left","50%").style("margin-left","-5px").style("width","10px").style(r+"transform","rotate(45deg)").style("z-index",-1)}if(e.icon){var F=A.append("div").attr("class","d3plus_tooltip_icon").style("width",e.iconsize+"px").style("height",e.iconsize+"px").style("z-index",1).style("background-position","50%").style("background-size","100%").style("background-image","url("+e.icon+")").style("display","inline-block").style("margin","0px 3px 3px 0px");"knockout"==e.style&&F.style("background-color",e.color),b-=F.node().offsetWidth}if(e.title){var S=e.max_width-6;e.icon&&(S-=e.iconsize+6),S+="px";A.append("div").attr("class","d3plus_tooltip_title").style("max-width",S).style("color",e.icon?e.fontcolor:i(e.color)).style("vertical-align","top").style("width",b+"px").style("display","inline-block").style("overflow","hidden").style("text-overflow","ellipsis").style("word-wrap","break-word").style("z-index",1).style("font-size","large"===e.size?"18px":"16px").style("line-height","large"===e.size?"20px":"17px").style("padding","large"===e.size?"3px 6px":"3px").text(e.title)}if(e.description){k.append("div").attr("class","d3plus_tooltip_description").style("font-size","12px").style("padding","6px").text(e.description)}if(e.data||e.html&&!e.fullscreen)var T=k.append("div").attr("class","d3plus_tooltip_data_container").style("overflow-y","auto").style("z-index",-1);if(e.data){var B=0,C={},q=null;e.data.forEach(function(t,a){t.group&&q!=t.group&&(q=t.group,T.append("div").attr("class","d3plus_tooltip_data_title").style("font-size","12px").style("font-weight","bold").style("padding","6px 3px 0px 3px").text(t.group));var s=T.append("div").attr("class","d3plus_tooltip_data_block").style("font-size","12px").style("padding","3px 6px").style("position","relative").datum(t);t.highlight===!0?s.style("color",i(e.color)):(t.allColors||t.highlight!==e.color)&&s.style("color",i(t.highlight));var c=s.append("div").attr("class","d3plus_tooltip_data_name").style("display","inline-block").html(t.name).on(o.out,function(){d3.event.stopPropagation()});if(t.link&&c.style("cursor","pointer").on(o.click,t.link),t.value instanceof Array){var f=e.locale.ui.and,d=e.locale.ui.more;t.value=list(t.value,f,3,d)}var p=s.append("div").attr("class","d3plus_tooltip_data_value").style("display","block").style("position","absolute").style("text-align","right").style("top","3px").html(t.value).on(o.out,function(){d3.event.stopPropagation()});if(u?p.style("left","6px"):p.style("right","6px"),e.mouseevents&&t.desc){var h=s.append("div").attr("class","d3plus_tooltip_data_desc").style("color","#888").style("overflow","hidden").style(r+"transition","height 0.5s").style("width","85%").text(t.desc).on(o.out,function(){d3.event.stopPropagation()}),v=h.node().offsetHeight||h.node().getBoundingClientRect().height;h.style("height","0px");var g=c.append("div").attr("class","d3plus_tooltip_data_help").style("background-color","#ccc").style(r+"border-radius","5px").style("color","#fff").style("cursor","pointer").style("display","inline-block").style("font-size","8px").style("font-weight","bold").style("height","10px").style("margin","3px 0px 0px 3px").style("padding-right","1px").style("text-align","center").style("width","10px").style("vertical-align","top").style(l+"transition","background-color 0.5s").text("?").on(o.over,function(){var e=d3.select(this.parentNode.parentNode).style("color");d3.select(this).style("background-color",e),h.style("height",v+"px")}).on(o.out,function(){d3.event.stopPropagation()});c.style("cursor","pointer").on(o.over,function(){n();var e=d3.select(this.parentNode).style("color");g.style("background-color",e),h.style("height",v+"px")}),s.on(o.out,function(){d3.event.stopPropagation(),n()})}var m=parseFloat(p.style("width"),10);m>e.width/2&&(m=e.width/2),m>B&&(B=m),a!=e.data.length-1&&(t.group&&t.group==e.data[a+1].group||!t.group&&!e.data[a+1].group)&&T.append("div").attr("class","d3plus_tooltip_data_seperator").style("background-color","#ddd").style("display","block").style("height","1px").style("margin","0px 3px")}),T.selectAll(".d3plus_tooltip_data_name").style("width",function(){var e=parseFloat(d3.select(this.parentNode).style("width"),10);return e-B-30+"px"}),T.selectAll(".d3plus_tooltip_data_value").style("width",B+"px").each(function(e){var t=parseFloat(d3.select(this).style("height"),10);C[e.name]=t}),T.selectAll(".d3plus_tooltip_data_name").style("min-height",function(e){return C[e.name]+"px"})}!e.html||e.fullscreen&&!e.stacked||(T.append("div").html(e.html),e.js&&e.js(_));var N=k.append("div").attr("class","d3plus_tooltip_footer").style("font-size","10px").style("position","relative").style("text-align","center");if(e.footer&&N.html(e.footer),e.height=w.node().offsetHeight||w.node().getBoundingClientRect().height,e.html&&e.fullscreen&&!e.stacked){var P=e.height-12,z=w.node().offsetWidth-e.width-44;_.append("div").attr("class","d3plus_tooltip_html").style("width",z+"px").style("height",P+"px").style("display","inline-block").style("vertical-align","top").style("overflow-y","auto").style("padding","0px 12px").style("position","absolute").html(e.html),e.js&&e.js(_)}if(e.width=w.node().offsetWidth,"center"!=e.anchor.y?e.height+=e.arrow_offset:e.width+=e.arrow_offset,e.data||(!e.fullscreen||e.stacked)&&e.html){if(!e.fullscreen||e.stacked)var I=e.fixed?v-e.y-10:v-10,P=e.height<I?e.height:I;else var P=e.height;P-=parseFloat(_.style("padding-top"),10),P-=parseFloat(_.style("padding-bottom"),10),A&&(P-=A.node().offsetHeight||A.node().getBoundingClientRect().height,P-=parseFloat(A.style("padding-top"),10),P-=parseFloat(A.style("padding-bottom"),10)),N&&(P-=N.node().offsetHeight||N.node().getBoundingClientRect().height,P-=parseFloat(N.style("padding-top"),10),P-=parseFloat(N.style("padding-bottom"),10)),T.style("max-height",P+"px")}e.height=w.node().offsetHeight||w.node().getBoundingClientRect().height,s(e.x,e.y,e.id)}},{"../client/pointer.coffee":38,"../client/prefix.coffee":39,"../client/rtl.coffee":40,"../client/scroll.js":41,"../client/scrollbar.coffee":42,"../color/legible.coffee":44,"../color/text.coffee":50,"../core/locale/languages/en_US.coffee":70,"../string/list.coffee":174,"./move.coffee":202,"./remove.coffee":203}],202:[function(e,t,r){var n,a;a=e("../client/scroll.js"),t.exports=function(e,t,r){var o,i,s;return r||(r="default"),s=d3.select("div#d3plus_tooltip_id_"+r),s.node()&&(o=s.datum(),o.cx=e,o.cy=t,o.fixed||(i="body"===o.parent.node().tagName.toLowerCase()?[a.x(),a.y()]:[0,0],"center"!==o.anchor.y?("right"===o.anchor.x?o.x=o.cx-o.arrow_offset-4:"center"===o.anchor.x?o.x=o.cx-o.width/2:"left"===o.anchor.x&&(o.x=o.cx-o.width+o.arrow_offset+2),"bottom"===o.anchor.y?o.flip=o.cy+o.height+o.offset<=o.limit[1]:"top"===o.anchor.y&&(o.flip=o.cy-o.height-o.offset<i[1]),o.flip?o.y=o.cy+o.offset+o.arrow_offset:o.y=o.cy-o.height-o.offset-o.arrow_offset):(o.y=o.cy-o.height/2,"right"===o.anchor.x?o.flip=o.cx+o.width+o.offset<=o.limit[0]:"left"===o.anchor.x&&(o.flip=o.cx-o.width-o.offset<i[0]),"center"===o.anchor.x?(o.flip=!1,o.x=o.cx-o.width/2):o.flip?o.x=o.cx+o.offset+o.arrow_offset:o.x=o.cx-o.width-o.offset),o.x<i[0]?o.x=i[0]:o.x+o.width>o.limit[0]&&(o.x=o.limit[0]-o.width),o.y<i[1]?o.y=i[1]:o.y+o.height>o.limit[1]&&(o.y=o.limit[1]-o.height)),s.style("top",o.y+"px").style("left",o.x+"px"),o.arrow&&s.selectAll(".d3plus_tooltip_arrow").call(n)),s},n=function(e){return e.style("bottom",function(e){return"center"===e.anchor.y||e.flip?"auto":"-5px"}).style("right",function(e){return"center"!==e.anchor.y||e.flip?"auto":"-5px"}).style("top",function(e){return"center"!==e.anchor.y&&e.flip?"-5px":"center"===e.anchor.y?"50%":"auto"}).style("left",function(e){return"center"===e.anchor.y&&e.flip?"-5px":"center"!==e.anchor.y?"50%":"auto"}).style("margin-left",function(e){var t;return"center"===e.anchor.y?"auto":(t="right"===e.anchor.x?-e.width/2+e.arrow_offset/2:"left"===e.anchor.x?e.width/2-2*e.arrow_offset-5:-5,e.cx-e.width/2-5<t?(t=e.cx-e.width/2-5,t<2-e.width/2&&(t=2-e.width/2)):-(e.limit[0]-e.cx-e.width/2+5)>t&&(t=-(e.limit[0]-e.cx-e.width/2+5),t>e.width/2-11&&(t=e.width/2-11)),t+"px")}).style("margin-top",function(e){var t;return"center"!==e.anchor.y?"auto":(t="bottom"===e.anchor.y?-e.height/2+e.arrow_offset/2-1:"top"===e.anchor.y?e.height/2-2*e.arrow_offset-2:-9,e.cy-e.height/2-e.arrow_offset<t?(t=e.cy-e.height/2-e.arrow_offset,t<4-e.height/2&&(t=4-e.height/2)):-(e.limit[1]-e.cy-e.height/2+e.arrow_offset)>t&&(t=-(e.limit[1]-e.cy-e.height/2+e.arrow_offset),t>e.height/2-22&&(t=e.height/2-22)),t+"px")})}},{"../client/scroll.js":41}],203:[function(e,t,r){t.exports=function(e){return e?(d3.selectAll("div#d3plus_tooltip_curtain_"+e).remove(),d3.selectAll("div#d3plus_tooltip_id_"+e).remove()):(d3.selectAll("div.d3plus_tooltip_curtain").remove(),d3.selectAll("div.d3plus_tooltip").remove())}},{}],204:[function(e,t,r){t.exports=function(e,t){var r,n;return r=[],n=1/(t-1)*(e[1]-e[0]),d3.range(e[0],e[1]+n,n)}},{}],205:[function(e,t,r){var n;n=e("./d3selection.coffee"),t.exports=function(e,t){var r;if(!e||!t)return!1;for(n(e)&&(e=e.node()),n(e)&&(t=t.node()),r=t.parentNode;null!==r;){if(r===e)return!0;r=r.parentNode}return!1}},{"./d3selection.coffee":208}],206:[function(e,t,r){t.exports=function(e,t){var r,n;return t.constructor===String?(n=e.indexOf(t),n>-1?e[n]:e[0]):(r=e[0],e.forEach(function(e){if(Math.abs(t-e)<Math.abs(t-r))return r=e}),r)}},{}],207:[function(e,t,r){var n,a,o;a=e("../object/merge.coffee"),o=e("../object/validate.coffee"),n=function(e){var t;return o(e)?a(e):e instanceof Array?(t=[],e.forEach(function(e){return t.push(n(e))}),t):e},t.exports=n},{"../object/merge.coffee":171,"../object/validate.coffee":172}],208:[function(e,t,r){var n;n=e("../client/ie.js"),t.exports=function(e){return n?"object"==typeof e&&e instanceof Array&&"size"in e&&"select"in e:e instanceof d3.selection}},{"../client/ie.js":37}],209:[function(e,t,r){t.exports=function(e,t){var r;r=new Image,r.src=e,r.crossOrigin="Anonymous",r.onload=function(){var e,r;e=document.createElement("canvas"),e.width=this.width,e.height=this.height,r=e.getContext("2d"),r.drawImage(this,0,0),t.call(this,e.toDataURL("image/png")),e=null}}},{}],210:[function(e,t,r){var n,a;n=e("../object/validate.coffee"),a=function(e,t,r,o,i,s){var l,u,c,f,d,p,h,v,g,m,y,x,b,w;if(void 0===e)return[];if(o&&void 0===i&&(i=o.id.value),s=!0===s&&void 0===s,e instanceof Array||(e=[e]),m=[],void 0===t)return e.reduce(function(e,t){var r;return r=JSON.stringify(t),m.indexOf(r)<0&&(e.indexOf(t)<0&&e.push(t),m.push(r)),e},[]);if(w=[],l=function(e){var t;if(void 0!==e&&null!==e&&(t=JSON.stringify(e),m.indexOf(t)<0))return w.push(e),m.push(t)},"function"==typeof r&&o)for(c=0,p=e.length;c<p;c++)for(u=e[c],b=a(r(o,u,t,i)),f=0,h=b.length;f<h;f++)x=b[f],l(x);else if("function"==typeof t)for(d=0,v=e.length;d<v;d++)u=e[d],b=t(u),l(b);else for(y=0,g=e.length;y<g;y++)u=e[y],n(u)&&(b=u[t],l(b));return s?w.sort(function(e,t){return e-t}):w},t.exports=a},{"../object/validate.coffee":172}],211:[function(e,t,r){t.exports=function(e){var t,r,n,a,o;for(e.container.value.style("position",function(){var e,t;return e=d3.select(this).style("position"),t=["absolute","fixed"].indexOf(e)>=0,t?e:"relative"}),e.container.changed&&e.container.value.html(""),a=["width","height"],r=0,n=a.length;r<n;r++)o=a[r],e[o].value||(t=function(r){var n,a;return void 0===r.tagName||["BODY","HTML"].indexOf(r.tagName)>=0?(a=window["inner"+o.charAt(0).toUpperCase()+o.slice(1)],n=document!==r&&d3.select(r),n&&("width"===o?(a-=parseFloat(n.style("margin-left"),10),a-=parseFloat(n.style("margin-right"),10),a-=parseFloat(n.style("padding-left"),10),a-=parseFloat(n.style("padding-right"),10)):(a-=parseFloat(n.style("margin-top"),10),a-=parseFloat(n.style("margin-bottom"),10),a-=parseFloat(n.style("padding-top"),10),a-=parseFloat(n.style("padding-bottom"),10))),e[o].value=a<=20?e[o].small:a):(a=parseFloat(d3.select(r).style(o),10),"number"==typeof a&&a>0?e[o].value=a:"BODY"!==r.tagName?t(r.parentNode):void 0)},t(e.container.value.node()),1===d3.selectAll("body > *:not(script)").size()&&d3.select("body").style("overflow","hidden"));e.container.value.style("width",e.width.value+"px").style("height",e.height.value+"px")}},{}],212:[function(e,t,r){var n=e("../../core/data/format.js"),a=e("../../core/data/color.js"),o=e("../../core/data/keys.coffee"),i=e("../../core/data/load.coffee"),s=e("./ui/drawer.js"),l=e("./ui/legend.js"),u=e("./ui/timeline.coffee"),c=e("./errorCheck.js"),f=e("../../core/fetch/data.js"),d=e("./finish.js"),p=e("./focus/tooltip.coffee"),h=e("./ui/history.coffee"),v=e("../../core/parse/edges.js"),g=e("../../core/parse/nodes.js"),m=e("../../core/console/print.coffee"),y=e("../../tooltip/remove.coffee"),x=e("./types/run.coffee"),b=e("./shapes/draw.js"),w=e("../../string/format.js"),_=e("./svg/enter.js"),k=e("./svg/update.js"),z=e("./ui/titles.js"),A=e("../../object/validate.coffee");t.exports=function(e){var t=[],r=e.type.value,j=e.format.locale.value,M=j.message.ui,O=j.message.draw,E=["data","attrs","coords","nodes","edges"];if(E.forEach(function(r){e.error.value||e[r].loaded||!e[r].url||t.push({function:function(e,t){i(e,r,t)},message:j.message.loading,wait:!0})}),e.draw.update){var F=j.visualization[r]||r,S=e.types[r].setup||!1,T=e.types[r].requirements||[],B=w(j.message.initializing,F),C=j.message.data;T instanceof Array||(T=[T]),F=F.toLowerCase(),e.error.value||"function"!=typeof S||t.push({function:function(e){if(e.dev.value){var t="running "+F+" setup";m.time(t)}S(e),e.dev.value&&m.timeEnd(t)},message:B}),e.container.changed&&t.push({function:_,message:B}),r in e.g.apps||t.push({function:function(e){if(e.dev.value){var t="creating "+F+" group";m.time(t)}e.g.apps[r]=e.g.app.append("g").attr("id",r).attr("opacity",0),e.dev.value&&m.timeEnd(t)},message:B}),e.data.changed&&t.push({function:function(e){e.data.cache={},delete e.nodes.restricted,delete e.edges.restricted,o(e,"data")},message:C}),e.attrs.changed&&t.push({function:function(e){o(e,"attrs")},message:C}),t.push({function:function(e){if(!e.color.type||e.color.changed||e.data.changed||e.attrs.changed||e.id.changed||e.depth.changed||e.id.solo.changed||!e.time.fixed.value&&(e.time.solo.changed||e.time.mute.changed)){if(e.color.valueScale=!1,e.dev.value){var t="checking color type";m.time(t)}if(e.color.type=!1,e.color.value){var r=e.color.value;A(r)&&(r=r[e.id.value]?r[e.id.value]:r[d3.keys(r)[0]]),e.data.keys&&r in e.data.keys?e.color.type=e.data.keys[r]:e.attrs.keys&&r in e.attrs.keys&&(e.color.type=e.attrs.keys[r])}else e.data.keys&&(e.color.type=e.data.keys[e.id.value]);e.dev.value&&m.timeEnd(t)}},message:C}),T.indexOf("edges")>=0&&e.edges.value&&(!e.edges.linked||e.edges.changed)&&t.push({function:v,message:C}),T.indexOf("nodes")>=0&&e.edges.value&&(!e.nodes.positions||e.nodes.changed||e.type.changed)&&t.push({ | |
| function:g,message:C}),(e.data.changed||e.time.changed||e.time.format.changed||e.type.changed||e.id.changed||e.x.scale.changed&&[e.x.scale.value,e.x.scale.previous].indexOf("discrete")>=0||e.y.scale.changed&&[e.y.scale.value,e.y.scale.previous].indexOf("discrete")>=0)&&t.push({function:n,message:C}),e.error.value||t.push({function:function(e){var t=e.time.fixed.value?["all"]:null;if(e.dev.value){var r=t?"fetching pool data":"fetching data";m.time(r)}e.data.pool=f(e,t),e.dev.value&&m.timeEnd(r),t?(e.dev.value&&m.time("fetching data for current year"),e.data.viz=f(e),e.dev.value&&m.timeEnd("fetching data for current year")):e.data.viz=e.data.pool,e.draw.timing=e.data.viz.length<e.data.large?e.timing.transitions:0},message:C}),e.error.value||t.push({check:function(e){return e.color.value&&"number"===e.color.type&&e.color.valueScale===!1},function:a,message:C})}return t.push({function:function(e){if(e.dev.value){var t=e.format.locale.value.message.tooltipReset;m.time(t)}e.type.previous&&r!==e.type.previous&&y(e.type.previous),y(r),e.dev.value&&m.timeEnd(t)},message:M}),e.error.value||t.push({function:c,message:M}),t.push({function:function(e){if(e.margin.process(),z(e),!e.error.value)if(e.draw.update)s(e),u(e),l(e);else{e.dev.value&&m.time("calculating margins");var t=e.container.value.select("div#d3plus_drawer").node().offsetHeight||e.container.value.select("div#d3plus_drawer").node().getBoundingClientRect().height,r=e.g.timeline.node().getBBox();r=e.timeline.value?r.height+e.ui.padding:0;var n=e.g.legend.node().getBBox();n=e.legend.value?n.height+e.ui.padding:0,e.margin.bottom+=t+r+n,e.dev.value&&m.timeEnd("calculating margins")}h(e),e.height.viz-=e.margin.top+e.margin.bottom,e.width.viz-=e.margin.left+e.margin.right},message:M}),e.error.value||t.push({function:p,message:M}),t.push({function:k,message:O}),!e.error.value&&e.draw.update&&t.push({function:[x,b],message:O}),t.push({function:d,message:O}),t}},{"../../core/console/print.coffee":52,"../../core/data/color.js":54,"../../core/data/format.js":56,"../../core/data/keys.coffee":58,"../../core/data/load.coffee":59,"../../core/fetch/data.js":64,"../../core/parse/edges.js":95,"../../core/parse/nodes.js":98,"../../object/validate.coffee":172,"../../string/format.js":173,"../../tooltip/remove.coffee":203,"./errorCheck.js":213,"./finish.js":214,"./focus/tooltip.coffee":215,"./shapes/draw.js":225,"./svg/enter.js":238,"./svg/update.js":239,"./types/run.coffee":242,"./ui/drawer.js":243,"./ui/history.coffee":244,"./ui/legend.js":245,"./ui/timeline.coffee":247,"./ui/titles.js":248}],213:[function(e,t,r){var n=e("../../core/fetch/text.js"),a=e("../../core/console/print.coffee"),o=e("../../core/methods/rejected.coffee"),i=e("../../string/format.js"),s=e("../../string/list.coffee");t.exports=function(e){e.dev.value&&a.time("checking for errors");var t=["id"],r=e.types[e.type.value].requirements;r&&(r instanceof Array?t=t.concat(e.types[e.type.value].requirements):t.push(r));var l=[];if(t.forEach(function(t){if("string"==typeof t)e[t].value||l.push('"'+t+'"');else if("function"==typeof t){var r=t(e);!r.status&&r.text&&l.push('"'+r.text+'"')}}),l.length>1){var u=e.format.locale.value.error.methods,c=e.format.locale.value.visualization[e.type.value]||e.type.value,f=e.format.locale.value.ui.and;l=s(l,f),e.error.internal=i(u,c,l)}else if(1===l.length){var u=e.format.locale.value.error.method,c=e.format.locale.value.visualization[e.type.value]||e.type.value;e.error.internal=i(u,c,l[0])}if(!e.error.internal&&t.indexOf("edges")>=0&&t.indexOf("focus")>=0){var d=e.edges.connections(e.focus.value[0],e.id.value);if(0==d.length){var p=n(e,e.focus.value[0],e.depth.value),u=e.format.locale.value.error.connections;e.error.internal=i(u,'"'+p+'"')}}var t=["d3"];e.types[e.type.value].libs&&(t=t.concat(e.types[e.type.value].libs));var l=[];if(t.forEach(function(e){window[e]||l.push('"'+e+'"')}),l.length>1){var u=e.format.locale.value.error.libs,c=e.format.locale.value.visualization[e.type.value],f=e.format.locale.value.ui.and;l=s(l,f),e.error.internal=i(u,c,l)}else if(1===l.length){var u=e.format.locale.value.error.lib,c=e.format.locale.value.visualization[e.type.value];e.error.internal=i(u,c,l[0])}var h=e.shape.accepted(e);h instanceof Array||(h=[h]);var v=e.shape.value;if(v&&!o(e,h,v,"shape")||e.self.shape(h[0]),"modes"in e.types[e.type.value]){var g=e.types[e.type.value].modes;g instanceof Array||(g=[g]);var m=e.type.mode.value;m&&!o(e,g,m,"mode")||e.self.type({mode:g[0]})}e.dev.value&&a.timeEnd("checking for errors")}},{"../../core/console/print.coffee":52,"../../core/fetch/text.js":66,"../../core/methods/rejected.coffee":91,"../../string/format.js":173,"../../string/list.coffee":174}],214:[function(e,t,r){var n=e("./shapes/edges.js"),a=e("./shapes/paths.js"),o=e("./ui/message.js"),i=e("./focus/viz.js"),s=e("../../core/methods/reset.coffee"),l=e("../../core/console/print.coffee"),u=e("./shapes/labels.js"),c=e("../../string/title.coffee"),f=e("./zoom/bounds.coffee"),d=e("./zoom/labels.coffee"),p=e("./zoom/mouse.coffee");t.exports=function(e){if(e.draw.first?setTimeout(function(){i(e)},e.draw.timing):i(e),!e.error.value){var t=e.zoom.viewport||e.zoom.bounds;e.types[e.type.value].zoom&&e.zoom.value&&t?(e.dev.value&&l.time("calculating zoom"),e.draw.first||e.zoom.reset?f(e,t,0):(e.type.changed||e.focus.changed||e.height.changed||e.width.changed||e.nodes.changed||e.legend.changed||e.timeline.changed||e.ui.changed)&&f(e,t),e.dev.value&&l.timeEnd("calculating zoom")):(e.zoom.bounds=[[0,0],[e.width.viz,e.height.viz]],e.zoom.scale=1,f(e))}var r=e.zoom.size?e.zoom.size.width:e.width.viz,h=e.zoom.size?e.zoom.size.height:e.height.viz,v=e.zoom.bounds?e.zoom.bounds[0][0]:0,g=e.zoom.bounds?e.zoom.bounds[0][1]:0;if(e.g.overlay.attr("width",r).attr("height",h).attr("x",v).attr("y",g),e.error.value||(e.draw.update?(e.edges.path?a(e):n(e),u(e,"data"),e.edges.label&&!e.edges.path&&setTimeout(function(){u(e,"edges")},e.draw.timing+200)):(e.labels.value||e.labels.changed)&&e.types[e.type.value].zoom&&e.zoom.value&&e.draw.timing&&setTimeout(function(){d(e)},e.draw.timing)),!e.error.value){var m=e.types[e.type.value].requirements||[];m instanceof Array||(m=[m]);var y=m.indexOf("data")>=0;e.error.internal||e.data.viz&&e.returned.nodes.length||!y||(e.error.internal=e.format.locale.value.error.data)}var x=e.type.previous;if(x&&e.type.value!=x&&e.g.apps[x]&&(e.dev.value&&l.time('hiding "'+x+'"'),e.draw.timing?e.g.apps[x].transition().duration(e.draw.timing).attr("opacity",0):e.g.apps[x].attr("opacity",0),e.dev.value&&l.timeEnd()),!e.error.value){var b=y&&0===e.data.viz.length||e.error.internal||e.error.value?0:e.focus.value.length&&e.types[e.type.value].zoom&&e.zoom.value?1-e.tooltip.curtain.opacity:1,w=e.draw.timing;e.group.transition().duration(w).attr("opacity",b),e.g.data.transition().duration(w).attr("opacity",b),e.g.edges.transition().duration(w).attr("opacity",b)}e.error.value?o(e,e.error.value):e.error.internal?(e.error.internal=c(e.error.internal),l.warning(e.error.internal),o(e,e.error.internal),e.error.internal=null):o(e),setTimeout(function(){s(e),e.types[e.type.value].zoom&&e.zoom.value?(e.g.zoom.datum(e).call(e.zoom.behavior.on("zoom",p)),e.zoom.scroll.value||e.g.zoom.on("mousewheel.zoom",null).on("MozMousePixelScroll.zoom",null).on("wheel.zoom",null),e.zoom.click.value||e.g.zoom.on("dblclick.zoom",null),e.zoom.pan.value||e.g.zoom.on("mousedown.zoom",null).on("mousemove.zoom",null)):e.g.zoom.call(e.zoom.behavior.on("zoom",null)).on("dblclick.zoom",null).on("mousedown.zoom",null).on("mousemove.zoom",null).on("mousewheel.zoom",null).on("MozMousePixelScroll.zoom",null).on("touchstart.zoom",null).on("wheel.zoom",null)},e.draw.timing)}},{"../../core/console/print.coffee":52,"../../core/methods/reset.coffee":93,"../../string/title.coffee":176,"./focus/viz.js":216,"./shapes/edges.js":226,"./shapes/labels.js":228,"./shapes/paths.js":230,"./ui/message.js":246,"./zoom/bounds.coffee":249,"./zoom/labels.coffee":251,"./zoom/mouse.coffee":252}],215:[function(e,t,r){var n,a,o,i;n=e("../tooltip/create.js"),a=e("../../../core/fetch/value.coffee"),o=e("../../../core/console/print.coffee"),i=e("../../../tooltip/remove.coffee"),t.exports=function(e){var t,r,s;r=e.focus,!e.error.internal&&1===r.value.length&&r.value.length&&!e.small&&r.tooltip.value?(e.dev.value&&o.time("drawing focus tooltip"),t=e.data.pool.filter(function(t){return a(e,t,e.id.value)===r.value[0]}),t.length>=1?t=t[0]:(t={},t[e.id.value]=r.value[0]),s=e.labels.padding,n({anchor:"top left",arrow:!1,data:t,fullscreen:!1,id:"visualization_focus",length:"long",maxheight:e.height.viz-2*s,mouseevents:!0,offset:0,vars:e,width:e.tooltip.large,x:e.width.value-e.margin.right-s,y:e.margin.top+s}),e.width.viz-=e.tooltip.large+2*s,e.dev.value&&o.timeEnd("drawing focus tooltip")):i("visualization_focus")}},{"../../../core/console/print.coffee":52,"../../../core/fetch/value.coffee":67,"../../../tooltip/remove.coffee":203,"../tooltip/create.js":240}],216:[function(t,r,n){var a=t("../../../client/pointer.coffee"),o=t("../../../client/ie.js"),i=t("../../../core/fetch/value.coffee"),s=t("../../../core/console/print.coffee"),l=t("../../../util/uniques.coffee");r.exports=function(t){if(t.g.edge_focus.selectAll("g").remove(),t.g.data_focus.selectAll("g").remove(),t.focus.value.length&&t.types[t.type.value].zoom&&t.zoom.value){t.dev.value&&s.time("drawing focus elements");var r=t.g.edges.selectAll("g");if(r.size()>0){r.each(function(e){var r=e[t.edges.source][t.id.value],n=e[t.edges.target][t.id.value];if(r==t.focus.value[0]||n==t.focus.value[0]){var a=t.g.edge_focus.node().appendChild(this.cloneNode(!0));d3.select(a).datum(e).attr("opacity",1).selectAll("line, path").datum(e)}});var n=t.edges.arrows.value;t.g.edge_focus.selectAll("line, path").attr("vector-effect","non-scaling-stroke").style("stroke",t.color.focus).style("stroke-width",function(){return o&&t.types[t.type.value].zoom?0:t.edges.size.value?d3.select(this).style("stroke-width"):2*t.data.stroke.width}).attr("marker-start",function(e){var r=t.edges.arrows.direction.value;if("bucket"in e.d3plus)var a="_"+e.d3plus.bucket;else var a="";return"source"==r&&n?"url(#d3plus_edge_marker_focus"+a+")":"none"}).attr("marker-end",function(e){var r=t.edges.arrows.direction.value;if("bucket"in e.d3plus)var a="_"+e.d3plus.bucket;else var a="";return"target"==r&&n?"url(#d3plus_edge_marker_focus"+a+")":"none"}),t.g.edge_focus.selectAll("text").style("fill",t.color.focus)}var u=l(t.edges.connections(t.focus.value[0],t.id.value,!0),t.id.value,i,t);u.push(t.focus.value[0]);var c=[],f=[],d=[0],p=[0];t.g.data.selectAll("g").each(function(r){if(u.indexOf(r[t.id.value])>=0){var n=t.g.data_focus.node().appendChild(this.cloneNode(!0)),n=d3.select(n).datum(r).attr("opacity",1);"coordinates"==t.shape.value?t.zoom.viewport=t.path.bounds(t.zoom.coords[r.d3plus.id]):"d3plus"in r&&("x"in r.d3plus&&c.push(r.d3plus.x),"y"in r.d3plus&&f.push(r.d3plus.y),"r"in r.d3plus?(d.push(r.d3plus.r),p.push(r.d3plus.r)):("width"in r.d3plus&&d.push(r.d3plus.width/2),"height"in r.d3plus&&p.push(r.d3plus.height/2)));for(e in a){var o=d3.select(this).on(a[e]);o&&n.on(a[e],o)}}});if(c.length&&f.length){var h=d3.extent(c),v=d3.extent(f),g=d3.max(d),m=d3.max(p);t.zoom.viewport=[[h[0]-g,v[0]-m],[h[1]+g,v[1]+m]]}t.g.data_focus.selectAll("path").style("stroke-width",o&&t.types[t.type.value].zoom?0:2*t.data.stroke.width),t.dev.value&&s.timeEnd("drawing focus elements")}else t.zoom.viewport=!1}},{"../../../client/ie.js":37,"../../../client/pointer.coffee":38,"../../../core/console/print.coffee":52,"../../../core/fetch/value.coffee":67,"../../../util/uniques.coffee":210}],217:[function(e,t,r){var n,a,o,i;i=e("./style.coffee"),a=e("../../../geom/largestRect.coffee"),o=e("../../../geom/path2poly.coffee"),n={start:{},end:{}},t.exports=function(e,t,r,s){var l,u,c,f;l=d3.svg.arc().innerRadius(0).outerRadius(function(e){return e.d3plus.r}).startAngle(function(e){return e.d3plus.startAngle}).endAngle(function(e){return e.d3plus.endAngle}),c=function(t){var r,n;return e.labels.value&&(t.d3plus.label?t.d3plus_label=t.d3plus.label:(r=o(l(t)),n=a(r,{angle:0}),n[0]?t.d3plus_label={w:n[0].width,h:n[0].height,x:n[0].cx,y:n[0].cy}:delete t.d3plus_label)),[t]},e.draw.timing?(f=d3.svg.arc().innerRadius(0).outerRadius(function(e){return e.d3plus.r}).startAngle(function(e){return void 0===n.start[e.d3plus.id]&&(n.start[e.d3plus.id]=0),isNaN(n.start[e.d3plus.id])&&(n.start[e.d3plus.id]=e.d3plus.startAngle),n.start[e.d3plus.id]}).endAngle(function(e){return void 0===n.end[e.d3plus.id]&&(n.end[e.d3plus.id]=0),isNaN(n.end[e.d3plus.id])&&(n.end[e.d3plus.id]=e.d3plus.endAngle),n.end[e.d3plus.id]}),u=function(e,t){return e.attrTween("d",function(e){var r,a,o,i;return void 0===t?(i=e.d3plus.startAngle,r=e.d3plus.endAngle):0===t&&(i=0,r=0),o=d3.interpolate(n.start[e.d3plus.id],i),a=d3.interpolate(n.end[e.d3plus.id],r),function(t){return n.start[e.d3plus.id]=o(t),n.end[e.d3plus.id]=a(t),f(e)}})},r.append("path").attr("class","d3plus_data").call(i,e).attr("d",f),t.selectAll("path.d3plus_data").data(c).transition().duration(e.draw.timing).call(i,e).call(u),s.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(u,0)):(r.append("path").attr("class","d3plus_data"),t.selectAll("path.d3plus_data").data(c).call(i,e).attr("d",l))}},{"../../../geom/largestRect.coffee":160,"../../../geom/path2poly.coffee":162,"./style.coffee":234}],218:[function(e,t,r){var n=e("../../../core/fetch/text.js"),a=e("../../../font/sizes.coffee"),o=e("../../../geom/largestRect.coffee"),i=e("./style.coffee");t.exports=function(e,t,r,s){var l=d3.svg.area().x(function(e){return e.d3plus.x}).y0(function(e){return e.d3plus.y0}).y1(function(e){return e.d3plus.y}).interpolate(e.shape.interpolate.value),u=d3.svg.area().x(function(e){return e.d3plus.x}).y0(function(e){return e.d3plus.y0}).y1(function(e){return e.d3plus.y0}).interpolate(e.shape.interpolate.value);r.append("path").attr("class","d3plus_data").attr("d",function(e){return u(e.values)}).call(i,e);var c={"font-weight":e.labels.font.weight,"font-family":e.labels.font.family.value};t.selectAll("path.d3plus_data").data(function(t){if(e.labels.value&&t.values.length>1){var r=d3.max(t.values,function(e){return e.d3plus.y0-e.d3plus.y}),i=!1;if(r>e.labels.font.size){var s=[],l=[],u=n(e,t);t.values.forEach(function(e){s.push([e.d3plus.x,e.d3plus.y]),l.push([e.d3plus.x,e.d3plus.y0])}),s=s.concat(l.reverse());var f=null;if(u.length){var d=a(u[0],c);f=d[0].width/d[0].height}i=o(s,{angle:d3.range(-70,71,1),aspectRatio:f,tolerance:0})}if(i&&i[0]){var p={w:~~i[0].width,h:~~i[0].height,x:~~i[0].cx,y:~~i[0].cy,angle:i[0].angle*-1,padding:2,names:u};0!==i[0].angle?p.translate={x:p.x,y:p.y}:p.translate=!1,p.w>=10&&p.h>=10&&(t.d3plus_label=p)}}return[t]}),e.draw.timing?t.selectAll("path.d3plus_data").transition().duration(e.draw.timing).attr("d",function(e){return l(e.values)}).call(i,e):t.selectAll("path.d3plus_data").attr("d",function(e){return l(e.values)}).call(i,e)}},{"../../../core/fetch/text.js":66,"../../../font/sizes.coffee":102,"../../../geom/largestRect.coffee":160,"./style.coffee":234}],219:[function(e,t,r){var n=(e("../../../core/fetch/text.js"),e("../../../geom/largestRect.coffee"),e("./style.coffee"));t.exports=function(e,t,r,a){function o(e){e.attr("transform","scale(1)")}function i(e){e.attr("transform",function(e){var t=Math.min(e.d3plus.width,e.d3plus.height),r=Math.floor(t/16);return"scale("+r+")"})}r.append("path").attr("class","d3plus_data").attr("d","M5-6.844L3.594-5.407L-2,0.188l-1.594-1.594L-5-2.844L-7.844,0l1.438,1.406l3,3L-2,5.843l1.406-1.438l7-7L7.844-4L5-6.844z").call(o).call(n,e),t.selectAll("path.d3plus_data").data(function(e){return[e]}),e.draw.timing?t.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(i).call(n,e):t.selectAll("path.d3plus_data").call(i).call(n,e)}},{"../../../core/fetch/text.js":66,"../../../geom/largestRect.coffee":160,"./style.coffee":234}],220:[function(e,t,r){var n,a,o,i;a=e("../../../core/fetch/value.coffee"),n=e("../../../core/fetch/color.coffee"),o=e("../../../color/lighter.coffee"),i=e("./segments.coffee"),t.exports=function(e,t,r){var a,s,l,u;return s=e.d3plus.shape||t.shape.value,"line"===t.shape.value&&"circle"!==s?"none":"area"===t.shape.value||"active"===s||"line"===t.shape.value?n(t,e):"temp"===s?r?n(t,e):"url(#d3plus_hatch_"+e.d3plus.id+")":e.d3plus.static?o(n(t,e),.75):(a=i(t,e,"active"),l=i(t,e,"temp"),u=i(t,e,"total"),!t.active.value&&!t.temp.value||a===!0||a&&u&&a>=u&&!l||a&&!u?n(t,e):t.active.spotlight.value?t.color.missing:o(n(t,e),.75))}},{"../../../color/lighter.coffee":45,"../../../core/fetch/color.coffee":63,"../../../core/fetch/value.coffee":67,"./segments.coffee":233}],221:[function(e,t,r){var n,a,o,i,s,l,u,c;n=e("../../../util/copy.coffee"),a=e("../../../network/distance.coffee"),o=e("../../../core/fetch/text.js"),i=e("../../../font/sizes.coffee"),l=e("../../../geom/largestRect.coffee"),u=e("../../../geom/path2poly.coffee"),c=e("./style.coffee"),s={},t.exports=function(e,t,r,f){var d,p;return d=d3.geo[e.coords.projection.value](),d.center&&d.center(e.coords.center),e.zoom.scale||(e.zoom.scale=1),e.zoom.area=1/e.zoom.scale/e.zoom.scale,e.path=d3.geo.path().projection(d),e.draw.timing?t.selectAll("path.d3plus_data").attr("d",e.path).transition().duration(e.draw.timing).call(c,e):t.selectAll("path.d3plus_data").attr("d",e.path).call(c,e),r.append("path").attr("id",function(e){return e.id}).attr("class","d3plus_data").attr("d",e.path).call(c,e),p=e.old_height!==e.height.viz||e.height.changed||e.old_width!==e.width.viz||e.width.changed,e.old_height=e.height.viz,e.old_width=e.width.viz,e.coords.changed||p||e.coords.mute.changed||e.coords.solo.changed||e.type.changed||e.text.changed||e.coords.projection.changed||e.labels.changed?(e.zoom.bounds=null,e.zoom.reset=!0,e.zoom.coords={},t.each(function(t){var r,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E;if(e.coords.simplify.value&&t.geometry.coordinates.length>1){for(m=[],c=[],r=0,b=n(t),j=n(t),t.geometry.coordinates=t.geometry.coordinates.filter(function(t,n){var a;return j.geometry.coordinates=[t],a=e.path.area(j),a>0&&(c.push(a),a>r&&(b.geometry.coordinates=[t],r=a),!0)}),p=e.path.centroid(b),M=t.geometry.coordinates,y=x=0,w=M.length;x<w;y=++x)d=M[y],j.geometry.coordinates=[d],m.push(a(e.path.centroid(j),p));g=m.reduce(function(e,t,r){return t&&e.push(c[r]/t),e},[]),v=d3.quantile(g,e.coords.threshold.value),j.geometry.coordinates=t.geometry.coordinates.filter(function(e,t){var r,n;return n=m[t],r=c[t],0===n||r/n>=v}),h=b.geometry.coordinates[0],h&&"MultiPolygon"===b.geometry.type&&(h=h[0],b.geometry.coordinates[0]=h,b.geometry.type="Polygon")}else j=t,b=t,h=t.geometry.coordinates[0];return e.zoom.coords[t.d3plus.id]=j,delete t.d3plus_label,e.labels.value&&(_=o(e,t),h&&_.length&&(k=u(e.path(b)),E={"font-weight":e.labels.font.weight,"font-family":e.labels.font.family.value},z=null,1===_[0].split(" ").length&&(O=i(_[0],E)[0],z=O.width/O.height),A=l(k,{angle:0,aspectRatio:z}),A&&(A=A[0],t.d3plus_label={anchor:"middle",valign:"center",h:A.height,w:A.width,x:A.cx,y:A.cy,names:_}))),s[t.id]=t.d3plus_label,f=e.path.bounds(j),e.zoom.bounds?(e.zoom.bounds[0][0]>f[0][0]&&(e.zoom.bounds[0][0]=f[0][0]),e.zoom.bounds[0][1]>f[0][1]&&(e.zoom.bounds[0][1]=f[0][1]),e.zoom.bounds[1][0]<f[1][0]&&(e.zoom.bounds[1][0]=f[1][0]),e.zoom.bounds[1][1]<f[1][1]?e.zoom.bounds[1][1]=f[1][1]:void 0):e.zoom.bounds=f})):e.focus.value.length?void 0:(e.zoom.viewport=!1,t.each(function(e){return e.d3plus_label=s[e.id]}))}},{"../../../core/fetch/text.js":66,"../../../font/sizes.coffee":102,"../../../geom/largestRect.coffee":160,"../../../geom/path2poly.coffee":162,"../../../network/distance.coffee":165,"../../../util/copy.coffee":207,"./style.coffee":234}],222:[function(e,t,r){var n=e("./style.coffee");t.exports=function(e,t,r,a){function o(e){e.attr("d",d3.svg.symbol().type("cross").size(10))}function i(e){e.attr("d",d3.svg.symbol().type("cross").size(function(e){var t=Math.min(e.d3plus.width,e.d3plus.height);return d3.scale.pow().exponent(2)(t/2)}))}r.append("path").attr("class","d3plus_data").call(o).call(n,e),t.selectAll("path.d3plus_data").data(function(e){return[e]}),e.draw.timing?t.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(i).call(n,e):t.selectAll("path.d3plus_data").call(i).call(n,e)}},{"./style.coffee":234}],223:[function(e,t,r){var n=e("./style.coffee");t.exports=function(e,t,r,a){function o(e){e.attr("d",d3.svg.symbol().type("diamond").size(10))}function i(e){e.attr("d",d3.svg.symbol().type("diamond").size(function(e){var t=Math.min(e.d3plus.width,e.d3plus.height);return d3.scale.pow().exponent(2)(t/2)}))}r.append("path").attr("class","d3plus_data").call(o).call(n,e),t.selectAll("path.d3plus_data").data(function(e){return[e]}),e.draw.timing?t.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(i).call(n,e):t.selectAll("path.d3plus_data").call(i).call(n,e)}},{"./style.coffee":234}],224:[function(e,t,r){var n=e("./style.coffee");t.exports=function(e,t,r,a){function o(t,r,n,a){if(!r)var r=0;if("number"!=typeof n)var n=void 0;if("number"!=typeof a)var a=void 0;t.attrTween("d",function(t){if(void 0==n)var o=t.d3plus.r?t.d3plus.r:d3.max([t.d3plus.width,t.d3plus.height]);else var o=n;if(void 0==a)var i=t.d3plus.segments[t.d3plus.shape];else var i=a;e.arcs[t.d3plus.shape][t.d3plus.id]||(e.arcs[t.d3plus.shape][t.d3plus.id]={r:0},e.arcs[t.d3plus.shape][t.d3plus.id].a=2*Math.PI);var l=d3.interpolate(e.arcs[t.d3plus.shape][t.d3plus.id].r,o+r),u=d3.interpolate(e.arcs[t.d3plus.shape][t.d3plus.id].a,i);return function(r){return e.arcs[t.d3plus.shape][t.d3plus.id].r=l(r),e.arcs[t.d3plus.shape][t.d3plus.id].a=u(r),s(t)}})}function i(e){return e.d3plus.label?e.d3plus_label=e.d3plus.label:delete e.d3plus_label,[e]}e.arcs||(e.arcs={donut:{},active:{},temp:{}});var s=d3.svg.arc().startAngle(0).endAngle(function(t){var r=e.arcs[t.d3plus.shape][t.d3plus.id].a;return r>2*Math.PI?2*Math.PI:r}).innerRadius(function(t){if(t.d3plus.static)return 0;var r=e.arcs[t.d3plus.shape][t.d3plus.id].r;return r*e.data.donut.size}).outerRadius(function(t){return e.arcs[t.d3plus.shape][t.d3plus.id].r});e.draw.timing?(a.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(o,0,0).each("end",function(t){delete e.arcs[t.d3plus.shape][t.d3plus.id]}),t.selectAll("path.d3plus_data").data(i).transition().duration(e.draw.timing).call(o).call(n,e),r.append("path").attr("class","d3plus_data").transition().duration(0).call(o,0,0).call(n,e).transition().duration(e.draw.timing).call(o).call(n,e)):(a.selectAll("path.d3plus_data").each(function(t){delete e.arcs[t.d3plus.shape][t.d3plus.id]}),r.append("path").attr("class","d3plus_data"),t.selectAll("path.d3plus_data").data(i).call(o).call(n,e))}},{"./style.coffee":234}],225:[function(e,t,r){var n=e("../../../util/child.coffee"),a=e("../../../util/closest.coffee"),o=e("../tooltip/create.js"),i=e("../../../client/pointer.coffee"),s=e("../../../core/fetch/value.coffee"),l=e("../../../core/fetch/color.coffee"),u=e("../../../core/fetch/text.js"),c=e("../../../color/legible.coffee"),f=e("../../../core/console/print.coffee"),d=e("../../../tooltip/remove.coffee"),p=e("./segments.coffee"),h=e("./fill.js"),v=e("../../../string/strip.js"),g=e("../../../client/touch.coffee"),m=e("../zoom/propagation.coffee"),y=e("../../../util/uniques.coffee"),x=e("../../../object/validate.coffee"),b=e("../zoom/direction.coffee"),w={arc:e("./arc.coffee"),area:e("./area.js"),check:e("./check.js"),coordinates:e("./coordinates.coffee"),cross:e("./cross.js"),diamond:e("./diamond.js"),donut:e("./donut.js"),line:e("./line.js"),radial:e("./radial.coffee"),rect:e("./rect.coffee"),triangle_down:e("./triangle_down.js"),triangle_up:e("./triangle_up.js"),whisker:e("./whisker.coffee")};t.exports=function(e){function t(t){if(!t.d3plus.id){t.d3plus.id="";for(var r=0;r<=e.depth.value;r++)t.d3plus.id+=s(e,t,e.id.nesting[r])+"_";t.d3plus.id+=F,["x","y","x2","y2"].forEach(function(r){if("discrete"==e[r].scale.value){var n=s(e,t,e[r].value);n.constructor===Date&&(n=n.getTime()),t.d3plus.id+="_"+n}}),t.d3plus.suffix&&(t.d3plus.id+="_"+t.d3plus.suffix),t.d3plus.id=v(t.d3plus.id)}return t}function r(t,r){var n=e.types[e.type.value].scale,a=1;n&&(x[n]&&e.shape.value in n?a=n[e.shape.value]:"function"==typeof n?a=n(e,e.shape.value):"number"==typeof n&&(a=n)),a=r?a:1,t.attr("transform",function(e){if(["line","area","coordinates"].indexOf(F)<0){var t=e.d3plus.x||0,r=e.d3plus.y||0;return"translate("+t+","+r+")scale("+a+")"}return"scale("+a+")"})}function _(t){t.attr("id",function(e){return"d3plus_group_"+e.d3plus.id}).attr("class",function(t){var r=e.class.value?" "+s(e,t,e.class.value):"";return"d3plus_"+F+r})}function k(t){if(t&&e.g.edges.selectAll("g").size()>0){e.g.edge_hover.selectAll("*").remove(),e.g.edges.selectAll("g").each(function(r){var n=t[e.id.value],a=r[e.edges.source][e.id.value],o=r[e.edges.target][e.id.value];if(a==n||a=="left_"+n||a=="right_"+n||o==n||o=="left_"+n||o=="right_"+n){var i=e.g.edge_hover.node().appendChild(this.cloneNode(!0));d3.select(i).datum(r).attr("opacity",1).selectAll("line, path").datum(r)}});var r=e.edges.arrows.value;e.g.edge_hover.attr("opacity",0).selectAll("line, path").style("stroke",e.color.primary).style("stroke-width",function(t){return e.edges.path&&t.dy?Math.max(1,t.dy):e.edges.size.value?d3.select(this).style("stroke-width"):2*e.data.stroke.width}).attr("marker-start",function(t){var n=e.edges.arrows.direction.value;if("bucket"in t.d3plus)var a="_"+t.d3plus.bucket;else var a="";return"source"==n&&r?"url(#d3plus_edge_marker_highlight"+a+")":"none"}).attr("marker-end",function(t){var n=e.edges.arrows.direction.value;if("bucket"in t.d3plus)var a="_"+t.d3plus.bucket;else var a="";return"target"==n&&r?"url(#d3plus_edge_marker_highlight"+a+")":"none"}),e.g.edge_hover.selectAll("text").style("fill",e.color.primary),e.draw.timing?(e.g.edge_hover.transition().duration(e.timing.mouseevents).attr("opacity",1),e.g.edges.transition().duration(e.timing.mouseevents).attr("opacity",.5)):e.g.edge_hover.attr("opacity",1)}else e.draw.timing?(e.g.edge_hover.transition().duration(e.timing.mouseevents).attr("opacity",0).transition().selectAll("*").remove(),e.g.edges.transition().duration(e.timing.mouseevents).attr("opacity",1)):e.g.edge_hover.selectAll("*").remove()}var z=e.returned.nodes||[],A=e.returned.edges||[];e.draw.timing=z.length<e.data.large&&A.length<e.edges.large?e.timing.transitions:0;var j={arc:"arc",area:"area",check:"check",circle:"rect",coordinates:"coordinates",cross:"cross",donut:"donut",diamond:"diamond",line:"line",plus:"cross",radial:"radial",rect:"rect",square:"rect",triangle_down:"triangle_down",triangle:"triangle_up",triangle_up:"triangle_up",whisker:"whisker"},M={};z.forEach(function(t){var r=t.d3plus&&t.d3plus.shape?t.d3plus.shape:e.shape.value;r in j&&(t.d3plus&&(t.d3plus.shape=r),r=j[r],M[r]||(M[r]=[]),M[r].push(t))});for(var O in j)if(!(j[O]in M)||0===d3.keys(M).length){var E=e.g.data.selectAll("g.d3plus_"+j[O]);e.draw.timing?E.transition().duration(e.draw.timing).attr("opacity",0).remove():E.remove()}for(var F in M){var S=e.g.data.selectAll("g.d3plus_"+F).data(M[F],function(r){if(r.d3plus||(r.d3plus={}),"coordinates"===F)return r.d3plus.id=r.id,r.id;if(!r.d3plus.id)if(r.values)r.values.forEach(function(e){e=t(e),e.d3plus.shape="circle"}),r.d3plus.id=r.key;else if(r=t(r),!r.d3plus.segments){r.d3plus.segments={donut:2*Math.PI};var n=p(e,r,"active"),a=p(e,r,"temp"),o=p(e,r,"total");o&&(n?r.d3plus.segments.active=n/o*(2*Math.PI):r.d3plus.segments.active=0,a?r.d3plus.segments.temp=a/o*(2*Math.PI)+r.d3plus.segments.active:r.d3plus.segments.temp=0)}return!!r.d3plus&&r.d3plus.id});if(e.draw.timing)var T=S.exit().transition().duration(e.draw.timing).attr("opacity",0).remove();else var T=S.exit().remove();e.draw.timing?S.transition().duration(e.draw.timing).call(r).call(_):S.call(r).call(_);var B=e.draw.timing?0:1,C=S.enter().append("g").attr("opacity",B).call(r).call(_);e.draw.timing&&C.transition().duration(e.draw.timing).attr("opacity",1),S.order(),e.dev.value&&f.time('drawing "'+F+'" shapes'),w[F](e,S,C,T,r),e.dev.value&&f.timeEnd('drawing "'+F+'" shapes'),["rect","donut"].indexOf(F)>=0&&e.types[e.type.value].fill&&(e.dev.value&&f.time('filling "'+F+'" shapes'),h(e,S,C,T,r),e.dev.value&&f.timeEnd('filling "'+F+'" shapes'))}if(k(),e.tooltip.value)e.g.data.selectAll("g").on(i.over,function(t){if(g&&m(e,d3.event),d3.event.buttons||!e.mouse.value||!e.mouse.over.value||e.draw.frozen||t.d3plus&&t.d3plus.static)d(e.type.value);else{var n="function"!=typeof e.mouse.over.value;if("function"==typeof e.mouse.over.value&&(n=e.mouse.over.value(t,e.self)),n){var s=b(t.d3plus_data||t,e),l="function"==typeof e.mouse.viz||"function"==typeof e.mouse.viz[i.click]||e.zoom.value&&(e.types[e.type.value].zoom||t.d3plus.threshold&&t.d3plus.merged||1===s||s===-1&&e.history.states.length&&!e.tooltip.value.long);if(d3.select(this).style("cursor",l?"pointer":"auto").transition().duration(e.timing.mouseevents).call(r,!0),d3.select(this).selectAll(".d3plus_data").transition().duration(e.timing.mouseevents).attr("opacity",1),e.covered=!1,t.values&&e.axes.discrete){var u="x"===e.axes.discrete?0:1,c=d3.mouse(e.container.value.node())[u],f=y(t.values,function(t){return t.d3plus[e.axes.discrete]}),p=a(f,c);t.d3plus_data=t.values[f.indexOf(p)],t.d3plus=t.values[f.indexOf(p)].d3plus}var h=t.d3plus_data?t.d3plus_data:t;o({vars:e,data:h}),"function"==typeof e.mouse.viz?e.mouse.viz(t.d3plus_data||t,e):e.mouse.viz[i.over]&&e.mouse.viz[i.over](t.d3plus_data||t,e),k(t)}}}).on(i.move,function(t){if(g&&m(e,d3.event),d3.event.buttons||!e.mouse.value||!e.mouse.move.value||e.draw.frozen||t.d3plus&&t.d3plus.static)d(e.type.value);else{var r="function"!=typeof e.mouse.move.value;if("function"==typeof e.mouse.move.value&&(r=e.mouse.move.value(t,e.self)),r){var n=b(t.d3plus_data||t,e),s="function"==typeof e.mouse.viz||"function"==typeof e.mouse.viz[i.click]||e.zoom.value&&(e.types[e.type.value].zoom||t.d3plus.threshold&&t.d3plus.merged||1===n||n===-1&&e.history.states.length&&!e.tooltip.value.long);d3.select(this).style("cursor",s?"pointer":"auto");e.types[e.type.value].tooltip||"follow";if(t.values&&e.axes.discrete){var l="x"===e.axes.discrete?0:1,u=d3.mouse(e.container.value.node())[l],c=y(t.values,function(t){return t.d3plus[e.axes.discrete]}),f=a(c,u);t.d3plus_data=t.values[c.indexOf(f)],t.d3plus=t.values[c.indexOf(f)].d3plus}var p=t.d3plus_data?t.d3plus_data:t;o({vars:e,data:p}),"function"==typeof e.mouse.viz?e.mouse.viz(t.d3plus_data||t,e):e.mouse.viz[i.move]&&e.mouse.viz[i.move](t.d3plus_data||t,e)}}}).on(i.out,function(t){if(g&&m(e,d3.event),!d3.event.buttons&&e.mouse.value&&e.mouse.out.value){var a="function"!=typeof e.mouse.out.value;if("function"==typeof e.mouse.out.value&&(a=e.mouse.out.value(t,e.self)),a){var o=n(this,d3.event.toElement);o||e.draw.frozen||t.d3plus&&t.d3plus.static||(d3.select(this).transition().duration(e.timing.mouseevents).call(r),d3.select(this).selectAll(".d3plus_data").transition().duration(e.timing.mouseevents).attr("opacity",e.data.opacity),e.covered||d(e.type.value),"function"==typeof e.mouse.viz?e.mouse.viz(t.d3plus_data||t,e):e.mouse.viz[i.out]&&e.mouse.viz[i.out](t.d3plus_data||t,e),k())}}else d(e.type.value)});else{var q=function(){m(e,d3.event)};e.g.data.selectAll("g").on(i.over,q).on(i.move,q).on(i.out,q)}d3.select(window).on("scroll.d3plus",function(){d(e.type.value)}),e.g.data.selectAll("g").on(i.click,function(t){if((!e.mouse.viz||e.mouse.viz.click!==!1)&&e.mouse.value&&e.mouse.click.value&&!d3.event.defaultPrevented&&!e.draw.frozen&&(!t.d3plus||!t.d3plus.static)){var n="function"!=typeof e.mouse.click.value;if("function"==typeof e.mouse.click.value&&(n=e.mouse.click.value(t,e.self)),n){if(t.values&&e.axes.discrete){var f="x"===e.axes.discrete?0:1,p=d3.mouse(e.container.value.node())[f],h=y(t.values,function(t){return t.d3plus[e.axes.discrete]}),v=a(h,p);t.d3plus_data=t.values[h.indexOf(v)],t.d3plus=t.values[h.indexOf(v)].d3plus; | |
| }"function"==typeof e.mouse.viz?e.mouse.viz(t.d3plus_data||t,e):e.mouse.viz[i.out]?e.mouse.viz[i.out](t.d3plus_data||t,e):e.mouse.viz[i.click]&&e.mouse.viz[i.click](t.d3plus_data||t,e);var g=b(t.d3plus_data||t,e),m=e.id.solo.value,x=u(e,t)[0],w=c(l(e,t)),_=e.title.sub.value||!1,z=e.title.sub.font.color,A=e.title.total.font.color;if(t.d3plus.threshold&&t.d3plus.merged&&e.zoom.value)e.history.states.push(function(){e.self.id({solo:m}).title({sub:{font:{color:z},value:_},total:{font:{color:A}}}).draw()}),e.self.id({solo:m.concat(y(t.d3plus.merged,e.id.value,s,e))}).title({sub:{font:{color:w},value:x},total:{font:{color:w}}}).draw();else if(1===g&&e.zoom.value){var j=s(e,t.d3plus_data||t,e.id.value);e.history.states.push(function(){e.self.depth(e.depth.value-1).id({solo:m}).title({sub:{font:{color:z},value:_},total:{font:{color:A}}}).draw()}),e.self.depth(e.depth.value+1).id({solo:m.concat(j)}).title({sub:{font:{color:w},value:x},total:{font:{color:w}}}).draw()}else if(g===-1&&e.zoom.value&&e.history.states.length&&!e.tooltip.value.long)e.history.back();else if(e.types[e.type.value].zoom&&e.zoom.value)k(),d3.select(this).transition().duration(e.timing.mouseevents).call(r),d3.select(this).selectAll(".d3plus_data").transition().duration(e.timing.mouseevents).attr("opacity",e.data.opacity),d(e.type.value),e.draw.update=!1,t&&t[e.id.value]!=e.focus.value[0]?e.self.focus(t[e.id.value]).draw():e.self.focus(!1).draw();else if(e.types[e.type.value].requirements.indexOf("focus")<0){k();var M=t.d3plus_data?t.d3plus_data:t;o({vars:e,data:M})}}}})}},{"../../../client/pointer.coffee":38,"../../../client/touch.coffee":43,"../../../color/legible.coffee":44,"../../../core/console/print.coffee":52,"../../../core/fetch/color.coffee":63,"../../../core/fetch/text.js":66,"../../../core/fetch/value.coffee":67,"../../../object/validate.coffee":172,"../../../string/strip.js":175,"../../../tooltip/remove.coffee":203,"../../../util/child.coffee":205,"../../../util/closest.coffee":206,"../../../util/uniques.coffee":210,"../tooltip/create.js":240,"../zoom/direction.coffee":250,"../zoom/propagation.coffee":253,"./arc.coffee":217,"./area.js":218,"./check.js":219,"./coordinates.coffee":221,"./cross.js":222,"./diamond.js":223,"./donut.js":224,"./fill.js":227,"./line.js":229,"./radial.coffee":231,"./rect.coffee":232,"./segments.coffee":233,"./triangle_down.js":235,"./triangle_up.js":236,"./whisker.coffee":237}],226:[function(e,t,r){var n=e("../../../util/buckets.coffee"),a=e("../../../geom/offset.coffee");t.exports=function(e){function t(t){t.attr("opacity",0).style("stroke-width",0).style("stroke",e.background.value).style("fill","none")}function r(t){var r=e.edges.arrows.value;t.attr("opacity",function(t){return"number"===h?p:"function"===h?p(t,e):e.edges.opacity.scale.value(t[p])}).style("stroke-width",function(t){return e.edges.scale(t[e.edges.size.value])}).style("stroke",e.edges.color).attr("marker-start",function(t){var n=e.edges.arrows.direction.value;if("bucket"in t.d3plus)var a="_"+t.d3plus.bucket;else var a="";return"source"==n&&r?"url(#d3plus_edge_marker_default"+a+")":"none"}).attr("marker-end",function(t){var n=e.edges.arrows.direction.value;if("bucket"in t.d3plus)var a="_"+t.d3plus.bucket;else var a="";return"target"==n&&r?"url(#d3plus_edge_marker_default"+a+")":"none"}).attr("vector-effect","non-scaling-stroke").attr("pointer-events","none")}function o(t){t.attr("x1",function(t){return t[e.edges.source].d3plus.edges[t[e.edges.target][e.id.value]].x}).attr("y1",function(t){return t[e.edges.source].d3plus.edges[t[e.edges.target][e.id.value]].y}).attr("x2",function(t){return t[e.edges.target].d3plus.edges[t[e.edges.source][e.id.value]].x}).attr("y2",function(t){return t[e.edges.target].d3plus.edges[t[e.edges.source][e.id.value]].y})}function i(e){e.attr("d",function(e){return v(e.d3plus.spline)})}function s(t){if(delete t.d3plus_label,e.g.edges.selectAll("line, path").size()<e.edges.large&&e.edges.label&&t[e.edges.label]){if("spline"in t.d3plus)var r=this.getTotalLength(),n=this.getPointAtLength(r/2),a=this.getPointAtLength(r/2-.1*r),o=this.getPointAtLength(r/2+.1*r),i=Math.atan2(o.y-a.y,o.x-a.x),s=i*(180/Math.PI),l=(this.parentNode.getBBox(),.8*r),u=n.x,c=n.y;else var f=(this.getBBox(),t[e.edges.source]),d=t[e.edges.target],p={x:f.d3plus.edges[d[e.id.value]].x,y:f.d3plus.edges[d[e.id.value]].y},h={x:d.d3plus.edges[f[e.id.value]].x,y:d.d3plus.edges[f[e.id.value]].y},v=h.x-p.x,g=h.y-p.y,n={x:h.x-v/2,y:h.y-g/2},i=Math.atan2(g,v),s=i*(180/Math.PI),r=Math.sqrt(v*v+g*g),l=r,u=n.x,c=n.y;l+=2*e.labels.padding;var m=0;e.edges.arrows.value&&(m="number"==typeof e.edges.arrows.value?e.edges.arrows.value:8,m/=e.zoom.behavior.scaleExtent()[1],l-=2*m),(s<-90||s>90)&&(s-=180),l*e.zoom.behavior.scaleExtent()[0]>20&&(t.d3plus_label={x:u,y:c,translate:{x:u,y:c},w:l,h:15+2*e.labels.padding,angle:s,anchor:"middle",valign:"center",color:e.edges.color,resize:!1,names:[e.format.value(t[e.edges.label])],background:1})}}var l=e.returned.edges||[],u=e.zoom.behavior.scaleExtent()[0];if("string"==typeof e.edges.size.value){var c=d3.extent(l,function(t){return t[e.edges.size.value]}),f=d3.min(e.returned.nodes||[],function(e){return e.d3plus.r})*(2*e.edges.size.scale);e.edges.scale=d3.scale.sqrt().domain(c).range([e.edges.size.min,f*u])}else{var d="number"==typeof e.edges.size.value?e.edges.size.value:e.edges.size.min;e.edges.scale=function(){return d}}var p=e.edges.opacity.value,h=typeof p;e.edges.opacity.changed&&"string"===h&&e.edges.opacity.scale.value.domain(d3.extent(l,function(e){return e[p]})).range([e.edges.opacity.min.value,1]);var v=d3.svg.line().interpolate(e.edges.interpolate.value),g=e.edges.arrows.value?"string"==typeof e.edges.size.value?["default_0","default_1","default_2","highlight_0","highlight_1","highlight_2","focus_0","focus_1","focus_2"]:["default","highlight","focus"]:[];if("string"==typeof e.edges.size.value)for(var m=n(e.edges.scale.range(),4),y=[],x=0;x<3;x++)y.push(m[x+1]+(m[1]-m[0])*(x+2)*2);else var b="number"==typeof e.edges.arrows.value?e.edges.arrows.value:8,y="number"==typeof e.edges.size.value?e.edges.size.value/b:b;var w=e.defs.selectAll(".d3plus_edge_marker").data(g,String),_=function(t){t.attr("d",function(t){var r=t.split("_");if(2==r.length&&e.edges.scale){r=parseInt(r[1]);var n=y[r]}else var n=y;return"target"==e.edges.arrows.direction.value?"M 0,-"+n/2+" L "+.85*n+",0 L 0,"+n/2+" L 0,-"+n/2:"M 0,-"+n/2+" L -"+.85*n+",0 L 0,"+n/2+" L 0,-"+n/2}).attr("fill",function(t){var r=t.split("_")[0];return"default"==r?e.edges.color:"focus"==r?e.color.focus:e.color.primary}).attr("transform","scale("+1/u+")")};e.draw.timing?(w.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),w.select("path").transition().duration(e.draw.timing).attr("opacity",1).call(_)):(w.exit().remove(),w.select("path").attr("opacity",1).call(_));var k=e.draw.timing?0:1,z=w.enter().append("marker").attr("id",function(e){return"d3plus_edge_marker_"+e}).attr("class","d3plus_edge_marker").attr("orient","auto").attr("markerUnits","userSpaceOnUse").style("overflow","visible").append("path").attr("opacity",k).attr("vector-effect","non-scaling-stroke").call(_);e.draw.timing&&z.transition().duration(e.draw.timing).attr("opacity",1);var A="string"==typeof e.edges.size.value?n(e.edges.scale.domain(),4):null,j=e.edges.arrows.direction.value,M=l.filter(function(t){if(t.d3plus||(t.d3plus={}),t.d3plus.id="edge_"+t[e.edges.source][e.id.value]+"_"+t[e.edges.target][e.id.value],t.d3plus.spline!==!0){if(A){var r=t[e.edges.size.value];t.d3plus.bucket=r<A[1]?0:r<A[2]?1:2;var n=.85*y[t.d3plus.bucket]/u}else{delete t.d3plus.bucket;var n=.85*y/u}var o=t[e.edges.source],i=t[e.edges.target];if(!o.d3plus||!i.d3plus)return!1;var s=Math.atan2(o.d3plus.y-i.d3plus.y,o.d3plus.x-i.d3plus.x),l=Math.atan2(i.d3plus.y-o.d3plus.y,i.d3plus.x-o.d3plus.x),c="source"==j&&e.edges.arrows.value?o.d3plus.r+n:o.d3plus.r,f="target"==j&&e.edges.arrows.value?i.d3plus.r+n:i.d3plus.r,d=a(s,c,e.shape.value),p=a(l,f,e.shape.value);return"edges"in o.d3plus||(o.d3plus.edges={}),o.d3plus.edges[i[e.id.value]]={x:o.d3plus.x-d.x,y:o.d3plus.y-d.y},"edges"in i.d3plus||(i.d3plus.edges={}),i.d3plus.edges[o[e.id.value]]={x:i.d3plus.x-p.x,y:i.d3plus.y-p.y},!0}return!1}),O=e.g.edges.selectAll("g.d3plus_edge_line").data(M,function(e){return e.d3plus.id}),E=l.filter(function(t){if(t.d3plus.spline){if(A){var r=t[e.edges.size.value];t.d3plus.bucket=r<A[1]?0:r<A[2]?1:2;var n=.85*y[t.d3plus.bucket]/u}else{delete t.d3plus.bucket;var n=.85*y/u}var o=t[e.edges.source],i=t[e.edges.target],s=o.d3plus.edges?o.d3plus.edges[i[e.id.value]]||{}:{},l=i.d3plus.edges?i.d3plus.edges[o[e.id.value]]||{}:{},c=e.edges.arrows.value&&"source"==j?n:0,f=e.edges.arrows.value&&"target"==j?n:0,d=.1,p=o.d3plus.x>i.d3plus.x?1-d:1+d,h=o.d3plus.x>i.d3plus.x?1+d:1-d,v="number"==typeof s.angle?s.angle:Math.atan2(o.d3plus.y-i.d3plus.y,o.d3plus.x-i.d3plus.x)*p,g=a(v,o.d3plus.r+c,e.shape.value),m="number"==typeof l.angle?l.angle:Math.atan2(i.d3plus.y-o.d3plus.y,i.d3plus.x-o.d3plus.x)*h,x=a(m,i.d3plus.r+f,e.shape.value),b=[o.d3plus.x-g.x,o.d3plus.y-g.y],w=!!s.offset&&a(v,s.offset),_=w?[b[0]-w.x,b[1]-w.y]:b,k=[i.d3plus.x-x.x,i.d3plus.y-x.y],z=!!l.offset&&a(m,l.offset),M=z?[k[0]-z.x,k[1]-z.y]:k,O=M[0]-_[0],E=M[1]-_[1],F="number"==typeof s.radius?s.radius:Math.sqrt(O*O+E*E)/4,S="number"==typeof l.radius?l.radius:Math.sqrt(O*O+E*E)/4,T=a(v,F-o.d3plus.r-2*c),B=a(m,S-i.d3plus.r-2*f);t.d3plus.spline=[b,k];var C=Math.abs(Math.atan2(o.d3plus.y-i.d3plus.y,o.d3plus.x-i.d3plus.x)).toFixed(5),q=Math.abs(v).toFixed(5),N=Math.abs(m-Math.PI).toFixed(5);return(q!==N||[q,N].indexOf(C)<0)&&(t.d3plus.spline.splice(1,0,[_[0]-T.x,_[1]-T.y],[M[0]-B.x,M[1]-B.y]),w&&t.d3plus.spline.splice(1,0,_),z&&t.d3plus.spline.splice(t.d3plus.spline.length-1,0,M)),!0}return!1}),F=e.g.edges.selectAll("g.d3plus_edge_path").data(E,function(e){return e.d3plus.id});e.draw.timing?(O.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),F.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),O.selectAll("text.d3plus_label, rect.d3plus_label_bg").transition().duration(e.draw.timing/2).attr("opacity",0).remove(),F.selectAll("text.d3plus_label, rect.d3plus_label_bg").transition().duration(e.draw.timing/2).attr("opacity",0).remove(),O.selectAll("line").data(function(e){return[e]}).transition().duration(e.draw.timing).call(o).call(r).each("end",s),F.selectAll("path").data(function(e){return[e]}).transition().duration(e.draw.timing).call(i).call(r).each("end",s),O.enter().append("g").attr("class","d3plus_edge_line").append("line").call(o).call(t).transition().duration(e.draw.timing).call(r).each("end",s),F.enter().append("g").attr("class","d3plus_edge_path").append("path").call(i).call(t).transition().duration(e.draw.timing).call(r).each("end",s)):(O.exit().remove(),F.exit().remove(),O.selectAll("text.d3plus_label, rect.d3plus_label_bg").remove(),F.selectAll("text.d3plus_label, rect.d3plus_label_bg").remove(),O.selectAll("line").data(function(e){return[e]}).call(o).call(r).call(s),F.selectAll("path").data(function(e){return[e]}).call(i).call(r).call(s),O.enter().append("g").attr("class","d3plus_edge_line").append("line").call(o).call(t).call(r).call(s),F.enter().append("g").attr("class","d3plus_edge_path").append("path").call(i).call(t).call(r).call(s))}},{"../../../geom/offset.coffee":161,"../../../util/buckets.coffee":204}],227:[function(e,t,r){var n=e("../../../util/copy.coffee"),a=e("../../../core/fetch/color.coffee"),o=(e("../../../core/fetch/value.coffee"),e("./segments.coffee")),i=e("./style.coffee");t.exports=function(e,t,r,s){function l(e){e.attr("x",0).attr("y",0).attr("width",0).attr("height",0)}function u(t,r){r||(r=0),t.attr("x",function(e){var t=e.d3plus.r?2*e.d3plus.r:e.d3plus.width;return-t/2-r/2}).attr("y",function(e){var t=e.d3plus.r?2*e.d3plus.r:e.d3plus.height;return-t/2-r/2}).attr("width",function(e){var t=e.d3plus.r?2*e.d3plus.r:e.d3plus.width;return t+r}).attr("height",function(e){var t=e.d3plus.r?2*e.d3plus.r:e.d3plus.height;return t+r}).attr("rx",function(t){var n=t.d3plus.r?2*t.d3plus.r:t.d3plus.width,a=["circle","donut"].indexOf(e.shape.value)>=0;return a?(n+r)/2:0}).attr("ry",function(t){var n=t.d3plus.r?2*t.d3plus.r:t.d3plus.height,a=["circle","donut"].indexOf(e.shape.value)>=0;return a?(n+r)/2:0}).attr("shape-rendering",function(t){return["square"].indexOf(e.shape.value)>=0?e.shape.rendering.value:"auto"})}function c(t,r,n,a){r||(r=0),"number"!=typeof n&&(n=void 0),"number"!=typeof a&&(a=void 0),t.attrTween("d",function(t){if(void 0===n)var o=t.d3plus.r?t.d3plus.r:d3.max([t.d3plus.width,t.d3plus.height]);else var o=n;if(void 0===a)var i=t.d3plus.segments[t.d3plus.shape];else var i=a;e.arcs[t.d3plus.shape][t.d3plus.id]||(e.arcs[t.d3plus.shape][t.d3plus.id]={r:0},e.arcs[t.d3plus.shape][t.d3plus.id].a="donut"===t.d3plus.shape?2*Math.PI:0);var s=d3.interpolate(e.arcs[t.d3plus.shape][t.d3plus.id].r,o+r),l=d3.interpolate(e.arcs[t.d3plus.shape][t.d3plus.id].a,i);return function(r){return e.arcs[t.d3plus.shape][t.d3plus.id].r=s(r),e.arcs[t.d3plus.shape][t.d3plus.id].a=l(r),f(t)}})}e.arcs||(e.arcs={donut:{},active:{},temp:{}});var f=d3.svg.arc().startAngle(0).endAngle(function(t){var r=e.arcs[t.d3plus.shape][t.d3plus.id].a;return r>2*Math.PI?2*Math.PI:r}).innerRadius(function(t){if(t.d3plus.static||"donut"!==e.shape.value)return 0;var r=e.arcs[t.d3plus.shape][t.d3plus.id].r;return r*e.data.donut.size}).outerRadius(function(t){var r=e.arcs[t.d3plus.shape][t.d3plus.id].r;return"donut"===e.shape.value?r:2*r});t.each(function(t){function r(t){t.attr("stroke",h).attr("stroke-width",1).attr("shape-rendering",e.shape.rendering.value)}var s=o(e,t,"active"),f=o(e,t,"temp"),d=o(e,t,"total"),p=d3.select(this),h=a(e,t),v=[],g=[];if(d&&e.types[e.type.value].fill){if(f){var m=n(t);m.d3plus.shape="temp",v.push(m),g=["temp"]}if(s&&(s<d||f)){var m=n(t);m.d3plus.shape="active",v.push(m)}}var y=e.defs.selectAll("pattern#d3plus_hatch_"+t.d3plus.id).data(g);e.draw.timing?(y.selectAll("rect").transition().duration(e.draw.timing).style("fill",h),y.selectAll("line").transition().duration(e.draw.timing).style("stroke",h)):(y.selectAll("rect").style("fill",h),y.selectAll("line").style("stroke",h));var x=y.enter().append("pattern").attr("id","d3plus_hatch_"+t.d3plus.id).attr("patternUnits","userSpaceOnUse").attr("x","0").attr("y","0").attr("width","10").attr("height","10").append("g");x.append("rect").attr("x","0").attr("y","0").attr("width","10").attr("height","10").attr("fill",h).attr("fill-opacity",.25),x.append("line").attr("x1","0").attr("x2","10").attr("y1","0").attr("y2","10").call(r),x.append("line").attr("x1","-1").attr("x2","1").attr("y1","9").attr("y2","11").call(r),x.append("line").attr("x1","9").attr("x2","11").attr("y1","-1").attr("y2","1").call(r);var b=v.length?[t]:[],w=p.selectAll("#d3plus_clip_"+t.d3plus.id).data(b);w.enter().insert("clipPath",".d3plus_mouse").attr("id","d3plus_clip_"+t.d3plus.id).append("rect").attr("class","d3plus_clipping").call(l),e.draw.timing?(w.selectAll("rect").transition().duration(e.draw.timing).call(u),w.exit().transition().delay(e.draw.timing).remove()):(w.selectAll("rect").call(u),w.exit().remove());var _=p.selectAll("path.d3plus_fill").data(v);_.transition().duration(e.draw.timing).call(i,e).call(c),_.enter().insert("path","rect.d3plus_mouse").attr("class","d3plus_fill").attr("clip-path","url(#d3plus_clip_"+t.d3plus.id+")").transition().duration(0).call(i,e).call(c,0,void 0,0).transition().duration(e.draw.timing).call(c).call(i,e),_.exit().transition().duration(e.draw.timing).call(c,0,void 0,0).remove()})}},{"../../../core/fetch/color.coffee":63,"../../../core/fetch/value.coffee":67,"../../../util/copy.coffee":207,"./segments.coffee":233,"./style.coffee":234}],228:[function(e,t,r){var n=(e("../../../util/copy.coffee"),e("../../../core/fetch/text.js")),a=e("../../../core/fetch/value.coffee"),o=e("../../../color/mix.coffee"),i=e("../../../core/console/print.coffee"),s=(e("../../../client/rtl.coffee"),e("./segments.coffee")),l=e("./color.coffee"),u=e("../../../string/list.coffee"),c=e("../../../color/text.coffee"),f=e("../../../textwrap/textwrap.coffee");t.exports=function(e,t){var r=e.types[e.type.value].zoom?e.zoom.behavior.scaleExtent():[1,1],d=e.g[t].selectAll("g"),p=function(t){t.attr("opacity",function(t){var n=parseFloat(d3.select(this).attr("font-size"),10);return t.visible=n*(e.zoom.scale/r[1])>=2,t.visible?1:0})},h=function(t){e.draw.timing?t.transition().duration(e.draw.timing).attr("opacity",0).remove():t.remove()},v=function(t){var n="bottom"===e.labels.valign.value?"top":"bottom";t.attr("font-weight",e.labels.font.weight).attr("font-family",e.labels.font.family.value).attr("stroke","none").attr("pointer-events",function(e){return e.mouse?"auto":"none"}).attr("fill",function(t){if(t.color)return t.color;var r=l(t.parent,e),n=c(r),a=t.text?.15:1;return o(r,n,.2,a)}).each(function(t){if(t.resize instanceof Array){t.resize[0],t.resize[1]}var a=t.resize,o=!0;if(t.text){a instanceof Array||(a=[9,50],o=t.resize);var i=t.y-t.h*r[1]/2+t.padding/2;"bottom"===n&&(i+=t.h*r[1]/2),f().align("center").container(d3.select(this)).height(t.h*r[1]/2).padding(t.padding/2).resize(o).size(a).text(e.format.value(100*t.text,{key:"share",vars:e})).width(t.w*r[1]).valign(n).x(t.x-t.w*r[1]/2+t.padding/2).y(i).draw()}else{t.resize instanceof Array||(a=[7,40*(r[1]/r[0])],o=t.resize);var s="bottom"===e.labels.valign.value?t.share:0;f().align(t.anchor||e.labels.align.value).container(d3.select(this)).height(t.h*r[1]-t.share).padding(t.padding/2).resize(o).size(a).shape(t.shape||"square").text(t.names).valign(e.labels.valign.value).width(t.w*r[1]).x(t.x-t.w*r[1]/2+t.padding/2).y(t.y-t.h*r[1]/2+t.padding/2+s).draw()}}).attr("transform",function(e){var t=d3.select(this).attr("transform")||"",n=e.angle||0,a=e.translate&&e.translate.x?e.translate.x:0,o=e.translate&&e.translate.y?e.translate.y:0;return t.length&&(t=t.split(")").slice(-3).join(")")),"rotate("+n+","+a+","+o+")scale("+1/r[1]+")translate("+(e.x*r[1]-e.x)+","+(e.y*r[1]-e.y)+")"+t})};if("edges"===t||e.labels.value){if(e.dev.value){var g="drawing "+t+" labels";i.time(g)}d.each(function(t){function o(t){var r="string"==typeof l.background?l.background:"none"===e.background.value?"#ffffff":e.background.value,n="string"==typeof l.background?l.background:r,a=_.attr("transform").split(")");a.pop(),a.pop(),a.push(""),a=a.join(")"),t.attr("fill",n).attr(E).attr("transform",a)}var i=t.d3plus&&"label"in t.d3plus&&!t.d3plus.label,l=t.d3plus_label||null,c=t.d3plus_share,f=t.d3plus.text?t.d3plus.text:l&&l.names?l.names:e.labels.text.value?a(e,t,e.labels.text.value):n(e,t),d=l&&"group"in l?l.group:d3.select(this),g=0,m=e.types[e.type.value].fill;if(f instanceof Array||(f=[f]),l)if(["line","area"].indexOf(e.shape.value)>=0)var y=!0;else if(t&&"d3plus"in t)var x=s(e,t,"active"),b=s(e,t,"temp"),w=s(e,t,"total"),y=!b&&!x||x>=w||!x&&b>=w;if(i||!(l&&l.force||y)&&m)delete t.d3plus_label,d3.select(this).selectAll("text#d3plus_label_"+t.d3plus.id+", rect#d3plus_label_bg_"+t.d3plus.id).call(h),e.g.labels.selectAll("text#d3plus_label_"+t.d3plus.id+", rect#d3plus_label_bg_"+t.d3plus.id).call(h);else{if(c&&t.d3plus.share&&c.w-2*e.labels.padding>=10&&c.h-2*e.labels.padding>=10&&"middle"!=e.labels.valign.value){c.resize=e.labels.resize.value!==!1&&(!(c&&"resize"in c)||c.resize),c.padding=e.labels.padding,c.text=t.d3plus.share,c.parent=t;var _=d.selectAll("text#d3plus_share_"+t.d3plus.id).data([c],function(e){return e.w+""+e.h+e.text});e.draw.timing&&1===e.zoom.scale?(_.transition().duration(e.draw.timing/2).call(v),_.enter().append("text").attr("id","d3plus_share_"+t.d3plus.id).attr("class","d3plus_share").attr("opacity",0).call(v).transition().duration(e.draw.timing/2).delay(e.draw.timing/2).attr("opacity",1)):(_.attr("opacity",1).call(v),_.enter().append("text").attr("id","d3plus_share_"+t.d3plus.id).attr("class","d3plus_share").attr("opacity",1).call(v)),g=_.node().getBBox().height+e.labels.padding,_.exit().call(h)}else d.selectAll("text.d3plus_share").call(h);if(l&&(l.resize=e.labels.resize.value!==!1&&(!(l&&"resize"in l)||l.resize),l.padding="number"==typeof l.padding?l.padding:e.labels.padding),l&&l.w*r[1]-l.padding>=20&&l.h*r[1]-l.padding>=10&&f.length){for(var k=e.format.locale.value.ui.and,z=e.format.locale.value.ui.more,A=0;A<f.length;A++)f[A]instanceof Array&&(f[A]=u(f[A],k,3,z));l.names=f,l.share=g,l.parent=t;var _=d.selectAll("text#d3plus_label_"+t.d3plus.id).data([l],function(e){return!!e&&e.w+"_"+e.h+"_"+e.x+"_"+e.y+"_"+e.names.join("_")}),j=l.resize?void 0:e.labels.font.size*r[0]+"px";if(e.draw.timing&&1===e.zoom.scale?(_.transition().duration(e.draw.timing/2).call(v).call(p),_.enter().append("text").attr("font-size",j).attr("id","d3plus_label_"+t.d3plus.id).attr("class","d3plus_label").attr("opacity",0).call(v).transition().duration(e.draw.timing/2).delay(e.draw.timing/2).call(p)):(_.attr("opacity",1).call(v).call(p),_.enter().append("text").attr("font-size",j).attr("id","d3plus_label_"+t.d3plus.id).attr("class","d3plus_label").call(v).call(p)),_.exit().call(h),0===_.size()||0===_.selectAll("tspan").size())delete t.d3plus_label,d3.select(this).selectAll("text#d3plus_label_"+t.d3plus.id+", rect#d3plus_label_bg_"+t.d3plus.id).call(h),e.g.labels.selectAll("text#d3plus_label_"+t.d3plus.id+", rect#d3plus_label_bg_"+t.d3plus.id).call(h);else{if(l.background){var M=["background"],O=_.node().getBBox(),E={height:O.height,width:O.width,x:O.x,y:O.y>0?O.y:-O.height/2};E.width+=e.labels.padding*r[0],E.height+=e.labels.padding*r[0],E.x-=e.labels.padding*r[0]/2,E.y-=e.labels.padding*r[0]/2;var F=_.attr("transform").match(/translate\(([^a-z]+)\)/gi)[0];F=F.replace(/([^a-z])\s([^a-z])/gi,"$1,$2"),F=F.split(","),F.length>1&&(F=F[F.length-1],F=F.substring(0,F.length-1),E.y+=parseFloat(F))}else var M=[],E={};var S=d.selectAll("rect#d3plus_label_bg_"+t.d3plus.id).data(M),T="number"==typeof l.background?l.background:"string"==typeof l.background?1:.6;e.draw.timing?(S.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),S.transition().duration(e.draw.timing).attr("opacity",T).call(o),S.enter().insert("rect",".d3plus_label").attr("id","d3plus_label_bg_"+t.d3plus.id).attr("class","d3plus_label_bg").attr("opacity",0).call(o).transition().duration(e.draw.timing).attr("opacity",T)):(S.exit().remove(),S.enter().insert("rect",".d3plus_label").attr("id","d3plus_label_bg_"+t.d3plus.id).attr("class","d3plus_label_bg"),S.attr("opacity",T).call(o))}}else delete t.d3plus_label,d3.select(this).selectAll("text#d3plus_label_"+t.d3plus.id+", rect#d3plus_label_bg_"+t.d3plus.id).call(h),e.g.labels.selectAll("text#d3plus_label_"+t.d3plus.id+", rect#d3plus_label_bg_"+t.d3plus.id).call(h)}}),e.dev.value&&i.timeEnd(g)}else{if(e.dev.value){var g="removing "+t+" labels";i.time(g)}d.selectAll("text.d3plus_label, rect.d3plus_label_bg").call(h),e.g.labels.selectAll("text.d3plus_label, rect.d3plus_label_bg").call(h),e.dev.value&&i.timeEnd(g)}}},{"../../../client/rtl.coffee":40,"../../../color/mix.coffee":46,"../../../color/text.coffee":50,"../../../core/console/print.coffee":52,"../../../core/fetch/text.js":66,"../../../core/fetch/value.coffee":67,"../../../string/list.coffee":174,"../../../textwrap/textwrap.coffee":200,"../../../util/copy.coffee":207,"./color.coffee":220,"./segments.coffee":233}],229:[function(e,t,r){function n(e){e.attr("x",function(e){return e.d3plus.x}).attr("y",function(e){return e.d3plus.y}).attr("width",0).attr("height",0)}function a(e,t){void 0===t&&(t=0),e.attr("x",function(e){var r=e.d3plus.r?2*e.d3plus.r:e.d3plus.width;return e.d3plus.x-(r/2+t/2)}).attr("y",function(e){var r=e.d3plus.r?2*e.d3plus.r:e.d3plus.height;return e.d3plus.y-(r/2+t/2)}).attr("width",function(e){var r=e.d3plus.r?2*e.d3plus.r:e.d3plus.width;return r+t}).attr("height",function(e){var r=e.d3plus.r?2*e.d3plus.r:e.d3plus.height;return r+t}).attr("rx",function(e){var r=e.d3plus.r?2*e.d3plus.r:e.d3plus.width;return(r+t)/2}).attr("ry",function(e){var r=e.d3plus.r?2*e.d3plus.r:e.d3plus.height;return(r+t)/2})}function o(e,t,r,n){var o=e.draw.timing?e.timing.mouseevents:0;void 0===n&&(n=0),o?(d3.select(t.parentNode).selectAll("path.d3plus_line").transition().duration(o).style("stroke-width",function(t){var a=r;if(a.constructor!==Number){var o=c(e,t,r);a=o&&o.length?d3.max(o):e.data.stroke.width}return a+n}),d3.select(t.parentNode).selectAll("rect").transition().duration(o).style("stroke-width",function(t){var n=r;if(n.constructor!==Number){var a=c(e,t,r);n=a&&a.length?d3.max(a):e.data.stroke.width}return n}).call(a,n)):(d3.select(t.parentNode).selectAll("path.d3plus_line").style("stroke-width",function(t){var a=r;if(a.constructor!==Number){var o=c(e,t,r);a=o&&o.length?d3.max(o):e.data.stroke.width}return a+n}),d3.select(t.parentNode).selectAll("rect").style("stroke-width",function(t){var n=r;if(n.constructor!==Number){var a=c(e,t,r);n=a&&a.length?d3.max(a):e.data.stroke.width}return n}).call(a,n))}var i=e("../../../util/copy.coffee"),s=e("../../../util/closest.coffee"),l=e("../../../client/pointer.coffee"),u=e("./style.coffee"),c=e("../../../core/fetch/value.coffee");t.exports=function(e,t,r,f){var d=d3.svg.line().x(function(e){return e.d3plus.x}).y(function(e){return e.d3plus.y}).interpolate(e.shape.interpolate.value),p=e.size.value||e.data.stroke.width,h=e[e.axes.discrete],v=function(t){var r=p;if(r.constructor!==Number){var n=c(e,t,p);r=n&&n.length?d3.max(n):e.data.stroke.width}return r<15?15:r},g=h.ticks.values.map(function(e){return e.constructor===Date?e.getTime():e});t.each(function(t){var r=!1,f=[],m=[],y=i(t),x=d3.select(this);y.values=[],y.segment_key=y.key,t.values.forEach(function(n,a,o){var l=c(e,n,h.value);l.constructor===Date&&(l=l.getTime());var u=g.indexOf(s(g,l));r===!1||r===u-1?(y.values.push(n),y.segment_key+="_"+u):(y.values.length>1?f.push(y):m.push(y.values[0]),y=i(t),y.values=[n]),a===o.length-1&&(y.values.length>1?f.push(y):m.push(y.values[0])),r=u});var b=x.selectAll("path.d3plus_line").data(f,function(e){return e.d3plus||(e.d3plus={}),e.d3plus.shape="line",e.segment_key}),w=x.selectAll("rect.d3plus_anchor").data(m,function(e){return e.d3plus||(e.d3plus={}),e.d3plus.r=p,e.d3plus.id});e.draw.timing?(b.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),b.transition().duration(e.draw.timing).attr("d",function(e){return d(e.values)}).call(u,e),b.enter().append("path").attr("class","d3plus_line").style("stroke-linecap","round").attr("d",function(e){return d(e.values)}).call(u,e).attr("opacity",0).transition().duration(e.draw.timing).attr("opacity",1),w.enter().append("rect").attr("class","d3plus_anchor").attr("id",function(e){return e.d3plus.id}).call(n).call(u,e),w.transition().duration(e.draw.timing).call(a).call(u,e),w.exit().transition().duration(e.draw.timing).call(n).remove()):(b.exit().remove(),b.enter().append("path").attr("class","d3plus_line").style("stroke-linecap","round"),b.attr("d",function(e){return d(e.values)}).call(u,e),w.enter().append("rect").attr("class","d3plus_anchor").attr("id",function(e){return e.d3plus.id}),w.exit().remove(),w.call(a).call(u,e));var _=x.selectAll("path.d3plus_mouse").data(f,function(e){return e.segment_key});_.enter().append("path").attr("class","d3plus_mouse").attr("d",function(e){return d(e.values)}).style("stroke","black").style("stroke-width",v).style("fill","none").style("stroke-linecap","round").attr("opacity",0),_.on(l.over,function(t){!e.draw.frozen&&e.mouse.value&&e.mouse.over.value&&o(e,this,p,2)}).on(l.out,function(t){!e.draw.frozen&&e.mouse.value&&e.mouse.out.value&&o(e,this,p,0)}),e.draw.timing?_.transition().duration(e.draw.timing).attr("d",function(e){return d(e.values)}).style("stroke-width",v):_.attr("d",function(e){return d(e.values)}).style("stroke-width",v),_.exit().remove()})}},{"../../../client/pointer.coffee":38,"../../../core/fetch/value.coffee":67,"../../../util/closest.coffee":206,"../../../util/copy.coffee":207,"./style.coffee":234}],230:[function(e,t,r){t.exports=function(e){function t(t){t.attr("d",e.edges.path).style("stroke-width",function(e){return Math.max(1,e.dy)}).style("stroke","#ddd").style("fill","none").attr("transform",function(e){return"translate("+e.d3plus.x+","+e.d3plus.y+")"})}var r=e.returned.edges||[],n=e.g.edges.selectAll("g.d3plus_edge_path").data(r,function(t){return t.d3plus.id="path_"+t[e.edges.source][e.id.value]+"_"+t[e.edges.target][e.id.value],t.d3plus.id});e.draw.timing?(n.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),n.selectAll("text.d3plus_label, rect.d3plus_label_bg").transition().duration(e.draw.timing/2).attr("opacity",0).remove(),n.selectAll("path").data(function(e){return[e]}).transition().duration(e.draw.timing).call(t),n.enter().append("g").attr("class","d3plus_edge_path").append("path").style("stroke-width",0).transition().duration(e.draw.timing).call(t)):(n.exit().remove(),n.selectAll("text.d3plus_label, rect.d3plus_label_bg").remove(),n.selectAll("path").data(function(e){return[e]}).call(t),n.enter().append("g").attr("class","d3plus_edge_path").append("path").call(t))}},{}],231:[function(e,t,r){var n,a,o,i;i=e("./style.coffee"),o={},n={},a={r:{},a:{}},t.exports=function(e,t,r,s){var l,u,c,f,d;c=e.id.nesting[e.depth.value+1],f=d3.svg.line.radial().interpolate("linear-closed").radius(function(e){return e.d3plus.r}).angle(function(e){return e.d3plus.a}),l=function(t){return e.labels.value&&(t.d3plus.label?t.d3plus_label=t.d3plus.label:delete t.d3plus_label),[t]},e.draw.timing?(t.each(function(t){var r,n,a,o,i;for(o=t[c],i=[],n=0,a=o.length;n<a;n++)r=o[n],i.push(r.d3plus.id=r[e.id.value]+"_"+r[c]);return i}),u=d3.svg.line.radial().interpolate("linear-closed").radius(function(e,t){return void 0===o[e.d3plus.id]&&(o[e.d3plus.id]=0),isNaN(o[e.d3plus.id])&&(o[e.d3plus.id]=e.d3plus.r),o[e.d3plus.id]}).angle(function(e,t){return void 0===n[e.d3plus.id]&&(n[e.d3plus.id]=e.d3plus.a),isNaN(n[e.d3plus.id])&&(n[e.d3plus.id]=e.d3plus.a),n[e.d3plus.id]}),d=function(e,t){return e.attrTween("d",function(e){var r,i,s,l,f,d,p;for(p=e[c],s=l=0,f=p.length;l<f;s=++l)i=p[s],r=i.d3plus.a,void 0===t?d=i.d3plus.r:0===t&&(d=0),a.a[i.d3plus.id]=d3.interpolate(n[i.d3plus.id],r),a.r[i.d3plus.id]=d3.interpolate(o[i.d3plus.id],d);return function(t){var r,l,f;for(f=e[c],s=r=0,l=f.length;r<l;s=++r)i=f[s],n[i.d3plus.id]=a.a[i.d3plus.id](t),o[i.d3plus.id]=a.r[i.d3plus.id](t);return u(e[c])}})},r.append("path").attr("class","d3plus_data").call(i,e).attr("d",function(e){return u(e[c])}),t.selectAll("path.d3plus_data").data(l).transition().duration(e.draw.timing).call(i,e).call(d),s.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(d,0)):(r.append("path").attr("class","d3plus_data"),t.selectAll("path.d3plus_data").data(l).call(i,e).attr("d",function(e){return f(e[c])}))}},{"./style.coffee":234}],232:[function(e,t,r){var n;n=e("./style.coffee"),t.exports=function(e,t,r,a){var o,i,s;return o=function(t){var r,n;return e.labels.value&&!t.d3plus.label?(n=t.d3plus.r?2*t.d3plus.r:t.d3plus.width,r=t.d3plus.r?2*t.d3plus.r:t.d3plus.height,t.d3plus_label={w:n,h:r,x:0,y:0},t.d3plus_share={w:n,h:r,x:0,y:0},t.d3plus_label.shape="circle"===t.d3plus.shape?"circle":"square"):t.d3plus.label?t.d3plus_label=t.d3plus.label:delete t.d3plus_label,[t]},i=function(e){return e.attr("x",function(e){return e.d3plus.init&&"x"in e.d3plus.init?e.d3plus.init.x:e.d3plus.init&&"width"in e.d3plus.init?-e.d3plus.width/2:0}).attr("y",function(e){return e.d3plus.init&&"y"in e.d3plus.init?e.d3plus.init.y:e.d3plus.init&&"height"in e.d3plus.init?-e.d3plus.height/2:0}).attr("width",function(e){return e.d3plus.init&&"width"in e.d3plus.init?e.d3plus.init.width:0}).attr("height",function(e){return e.d3plus.init&&"height"in e.d3plus.init?e.d3plus.init.height:0})},s=function(t){return t.attr("x",function(e){var t;return t=e.d3plus.r?2*e.d3plus.r:e.d3plus.width,-t/2}).attr("y",function(e){var t;return t=e.d3plus.r?2*e.d3plus.r:e.d3plus.height,-t/2}).attr("width",function(e){return e.d3plus.r?2*e.d3plus.r:e.d3plus.width; | |
| }).attr("height",function(e){return e.d3plus.r?2*e.d3plus.r:e.d3plus.height}).attr("rx",function(e){var t,r;return t="circle"===e.d3plus.shape,r=e.d3plus.r?2*e.d3plus.r:e.d3plus.width,t?(r+2)/2:0}).attr("ry",function(e){var t,r;return r="circle"===e.d3plus.shape,t=e.d3plus.r?2*e.d3plus.r:e.d3plus.height,r?(t+2)/2:0}).attr("transform",function(e){return"rotate"in e.d3plus?"rotate("+e.d3plus.rotate+")":""}).attr("shape-rendering",function(t){return"square"!==t.d3plus.shape||"rotate"in t.d3plus?"auto":e.shape.rendering.value})},e.draw.timing?(r.append("rect").attr("class","d3plus_data").call(i).call(n,e),t.selectAll("rect.d3plus_data").data(o).transition().duration(e.draw.timing).call(s).call(n,e),a.selectAll("rect.d3plus_data").transition().duration(e.draw.timing).call(i)):(r.append("rect").attr("class","d3plus_data"),t.selectAll("rect.d3plus_data").data(o).call(s).call(n,e))}},{"./style.coffee":234}],233:[function(e,t,r){var n;n=e("../../../core/fetch/value.coffee"),t.exports=function(e,t,r){var a;return a=e[r].value,a?r in t.d3plus?t.d3plus[r]:n(e,t,a):t.d3plus[r]}},{"../../../core/fetch/value.coffee":67}],234:[function(e,t,r){var n,a,o;n=e("./color.coffee"),a=e("../../../client/ie.js"),o=e("../../../core/fetch/value.coffee"),t.exports=function(e,t){return e.attr("fill",function(e){return e.d3plus&&e.d3plus.spline?"none":n(e,t)}).style("stroke",function(e){var r;return e.d3plus&&e.d3plus.stroke?e.d3plus.stroke:(r=e.values?n(e.values[0],t):n(e,t,!0),d3.rgb(r).darker(.6))}).style("stroke-width",function(e){var r;if(a&&t.types[t.type.value].zoom)return 0;if("line"===e.d3plus.shape&&t.size.value){if(t.size.value.constructor===Number)return t.size.value;if(r=o(t,e,t.size.value),r&&r.length)return d3.max(r)}return t.data.stroke.width}).attr("opacity",t.data.opacity).attr("vector-effect","non-scaling-stroke")}},{"../../../client/ie.js":37,"../../../core/fetch/value.coffee":67,"./color.coffee":220}],235:[function(e,t,r){var n=e("./style.coffee");t.exports=function(e,t,r,a){function o(e){e.attr("d",d3.svg.symbol().type("triangle-down").size(10))}function i(e){e.attr("d",d3.svg.symbol().type("triangle-down").size(function(e){var t=Math.min(e.d3plus.width,e.d3plus.height);return d3.scale.pow().exponent(2)(t/2)}))}r.append("path").attr("class","d3plus_data").call(o).call(n,e),t.selectAll("path.d3plus_data").data(function(e){return[e]}),e.draw.timing?t.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(i).call(n,e):t.selectAll("path.d3plus_data").call(i).call(n,e)}},{"./style.coffee":234}],236:[function(e,t,r){var n=e("./style.coffee");t.exports=function(e,t,r,a){function o(e){e.attr("d",d3.svg.symbol().type("triangle-up").size(10))}function i(e){e.attr("d",d3.svg.symbol().type("triangle-up").size(function(e){var t=Math.min(e.d3plus.width,e.d3plus.height);return d3.scale.pow().exponent(2)(t/2)}))}r.append("path").attr("class","d3plus_data").call(o).call(n,e),t.selectAll("path.d3plus_data").data(function(e){return[e]}),e.draw.timing?t.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(i).call(n,e):t.selectAll("path.d3plus_data").call(i).call(n,e)}},{"./style.coffee":234}],237:[function(e,t,r){t.exports=function(e,t,r,n){var a,o,i,s,l,u,c,f,d;o=function(e){return e.d3plus.text?e.d3plus_label={w:f,h:f,x:0,y:0,background:"#fff",resize:!1,angle:["left","right"].indexOf(e.d3plus.position)>=0?90:0}:e.d3plus.label?e.d3plus_label=e.d3plus.label:delete e.d3plus_label,[e]},d=function(t){return t.style("stroke-width",e.data.stroke.width).style("stroke","#444").attr("fill","none").attr("shape-rendering",e.shape.rendering.value)},i=function(e){return e.attr("x1",0).attr("x2",0).attr("y1",0).attr("y2",0)},c=function(e){return e.attr("x1",function(e){var t,r,n;return["top","bottom"].indexOf(e.d3plus.position)>=0?0:(t=e.d3plus.offset||0,r=e.d3plus.width||0,n=t<0?-r:r,n+t)}).attr("x2",function(e){return["top","bottom"].indexOf(e.d3plus.position)>=0?0:e.d3plus.offset||0}).attr("y1",function(e){var t,r,n;return["left","right"].indexOf(e.d3plus.position)>=0?0:(r=e.d3plus.offset||0,t=e.d3plus.height||0,n=r<0?-t:t,n+r)}).attr("y2",function(e){return["left","right"].indexOf(e.d3plus.position)>=0?0:e.d3plus.offset||0}).attr("marker-start","url(#d3plus_whisker_marker)")},s=e.defs.selectAll("#d3plus_whisker_marker").data([0]),s.enter().append("marker").attr("id","d3plus_whisker_marker").attr("markerUnits","userSpaceOnUse").style("overflow","visible").append("line"),a=t.datum(),a?(u=a.d3plus.position,l=["top","bottom"].indexOf(u)>=0?"horizontal":"vertical",f="horizontal"===l?a.d3plus.width:a.d3plus.height):(l="horizontal",f=0),s.select("line").attr("x1","horizontal"===l?-f/2:0).attr("x2","horizontal"===l?f/2:0).attr("y1","vertical"===l?-f/2:0).attr("y2","vertical"===l?f/2:0).call(d).style("stroke-width",2*e.data.stroke.width),e.draw.timing?(r.append("line").attr("class","d3plus_data").call(d).call(i),t.selectAll("line.d3plus_data").data(o).transition().duration(e.draw.timing).call(d).call(c),n.selectAll("line.d3plus_data").transition().duration(e.draw.timing).call(i)):(r.append("line").attr("class","d3plus_data"),t.selectAll("line.d3plus_data").data(o).call(d).call(c))}},{}],238:[function(e,t,r){var n=e("../../../client/pointer.coffee"),a=e("../../../client/prefix.coffee"),o=e("../../../core/console/print.coffee"),i=e("../../../client/touch.coffee"),s=e("../zoom/propagation.coffee");t.exports=function(e){e.dev.value&&o.time("creating SVG elements"),e.svg=e.container.value.selectAll("svg#d3plus").data([0]),e.svg.enter().insert("svg","#d3plus_message").attr("id","d3plus").attr("width",e.width.value).attr("height",e.height.value).attr("xmlns","http://www.w3.org/2000/svg").attr("xmlns:xlink","http://www.w3.org/1999/xlink"),e.g.bg=e.svg.selectAll("rect#bg").data(["bg"]),e.g.bg.enter().append("rect").attr("id","bg").attr("fill",e.background.value).attr("stroke","none").attr("width",e.width.value).attr("height",e.height.value),e.g.timeline=e.svg.selectAll("g#timeline").data(["timeline"]),e.g.timeline.enter().append("g").attr("id","timeline").attr("transform","translate(0,"+e.height.value+")"),e.g.legend=e.svg.selectAll("g#key").data(["key"]),e.g.legend.enter().append("g").attr("id","key").attr("transform","translate(0,"+e.height.value+")"),e.g.footer=e.svg.selectAll("g#footer").data(["footer"]),e.g.footer.enter().append("g").attr("id","footer").attr("transform","translate(0,"+e.height.value+")");var t="clipping_"+e.container.id;e.g.clipping=e.svg.selectAll("#clipping").data(["clipping"]),e.g.clipping.enter().append("clipPath").attr("id",t).append("rect").attr("width",e.width.viz).attr("height",e.height.viz),e.g.container=e.svg.selectAll("g#container").data(["container"]),e.g.container.enter().append("g").attr("id","container").attr("clip-path","url(#"+t+")").attr("transform","translate("+e.margin.left+","+e.margin.top+")"),e.g.zoom=e.g.container.selectAll("g#zoom").data(["zoom"]),e.g.zoom.enter().append("g").attr("id","zoom"),e.g.viz=e.g.zoom.selectAll("g#d3plus_viz").data(["d3plus_viz"]),e.g.viz.enter().append("g").attr("id","d3plus_viz"),e.g.overlay=e.g.viz.selectAll("rect#d3plus_overlay").data([{id:"d3plus_overlay"}]),e.g.overlay.enter().append("rect").attr("id","d3plus_overlay").attr("width",e.width.value).attr("height",e.height.value).attr("opacity",0),e.g.overlay.on(n.move,function(t){i&&s(e,d3.event),e.types[e.type.value].zoom&&e.zoom.pan.value&&e.zoom.behavior.scaleExtent()[0]<e.zoom.scale?d3.select(this).style("cursor",a()+"grab"):d3.select(this).style("cursor","auto")}).on(n.up,function(t){i&&s(e,d3.event),e.types[e.type.value].zoom&&e.zoom.pan.value&&e.zoom.behavior.scaleExtent()[0]<e.zoom.scale?d3.select(this).style("cursor",a()+"grab"):d3.select(this).style("cursor","auto")}).on(n.down,function(t){i&&s(e,d3.event),e.types[e.type.value].zoom&&e.zoom.pan.value&&e.zoom.behavior.scaleExtent()[0]<e.zoom.scale?d3.select(this).style("cursor",a()+"grabbing"):d3.select(this).style("cursor","auto")}),e.g.app=e.g.viz.selectAll("g#app").data(["app"]),e.g.app.enter().append("g").attr("id","app"),e.g.edges=e.g.viz.selectAll("g#edges").data(["edges"]),e.g.edges.enter().append("g").attr("id","edges").attr("opacity",0),e.g.edge_focus=e.g.viz.selectAll("g#focus").data(["focus"]),e.g.edge_focus.enter().append("g").attr("id","focus"),e.g.edge_hover=e.g.viz.selectAll("g#edge_hover").data(["edge_hover"]),e.g.edge_hover.enter().append("g").attr("id","edge_hover").attr("opacity",0),e.g.data=e.g.viz.selectAll("g#data").data(["data"]),e.g.data.enter().append("g").attr("id","data").attr("opacity",0),e.g.data_focus=e.g.viz.selectAll("g#data_focus").data(["data_focus"]),e.g.data_focus.enter().append("g").attr("id","data_focus"),e.g.labels=e.g.viz.selectAll("g#d3plus_labels").data(["d3plus_labels"]),e.g.labels.enter().append("g").attr("id","d3plus_labels"),e.defs=e.svg.selectAll("defs").data(["defs"]),e.defs.enter().append("defs"),e.dev.value&&o.timeEnd("creating SVG elements")}},{"../../../client/pointer.coffee":38,"../../../client/prefix.coffee":39,"../../../client/touch.coffee":43,"../../../core/console/print.coffee":52,"../zoom/propagation.coffee":253}],239:[function(e,t,r){var n=e("../../../core/console/print.coffee");t.exports=function(e){e.dev.value&&n.time("updating SVG elements"),e.draw.timing?(e.container.value.transition().duration(e.draw.timing).style("width",e.width.value+"px").style("height",e.height.value+"px"),e.svg.transition().duration(e.draw.timing).attr("width",e.width.value).attr("height",e.height.value),e.g.bg.transition().duration(e.draw.timing).attr("width",e.width.value).attr("height",e.height.value).attr("fill",e.background.value),e.g.clipping.select("rect").transition().duration(e.draw.timing).attr("width",e.width.viz).attr("height",e.height.viz),e.g.container.transition().duration(e.draw.timing).attr("transform","translate("+e.margin.left+","+e.margin.top+")")):(e.container.value.style("width",e.width.value+"px").style("height",e.height.value+"px"),e.svg.attr("width",e.width.value).attr("height",e.height.value),e.g.bg.attr("width",e.width.value).attr("height",e.height.value).attr("fill",e.background.value),e.g.clipping.select("rect").attr("width",e.width.viz).attr("height",e.height.viz),e.g.container.attr("transform","translate("+e.margin.left+","+e.margin.top+")")),e.dev.value&&n.timeEnd("updating SVG elements")}},{"../../../core/console/print.coffee":52}],240:[function(e,t,r){var n=e("../../../array/sort.coffee"),a=e("../../../tooltip/create.js"),o=e("../../../core/data/nest.js"),i=e("./data.js"),s=e("../../../core/fetch/color.coffee"),l=e("../../../core/fetch/text.js"),u=e("../../../core/fetch/value.coffee"),c=e("../../../object/merge.coffee"),f=e("../../../tooltip/remove.coffee"),d=e("../shapes/segments.coffee"),p=e("../../../client/scroll.js"),h=e("../../../util/uniques.coffee"),v=e("../../../object/validate.coffee"),g=e("../zoom/direction.coffee");t.exports=function(e){function t(t){function p(e){return"string"==typeof r[e].value?r[e].value:r.format.locale.value.method[e]}var g,w="depth"in e?e.depth:y,j={},M=r.id.nesting[w+1]in m?w+1:w,O=r.id.nesting[M],B="merged"in m.d3plus?m.d3plus.merged:m[O];B instanceof Array||(B=[B]);var C=u(r,m,r.size.value);if(r.tooltip.children.value){if(B=B.slice(0),B.length>1&&v(B[0])&&(B=o(r,B,[O])),r.size.value&&v(B[0])){var q=[],N=B.filter(function(e){var t=u(r,e,r.size.value);return!(null===t||"d3plus"in e&&e.d3plus.merged)||void q.push(e)});n(N,r.size.value,"desc",[],r),B=N.concat(q)}var P=r.tooltip.children.value===!0?3:r.tooltip.children.value,I="short"===A?P:r.data.large,D=B.length,V=d3.min([D,I]);g={values:[]};for(var R=0;R<V&&B.length;R++){var U=B.shift(),L=l(r,U,M)[0],Y=v(U)?u(r,U,O,M):U;if(Y!==m[r.id.nesting[w]]&&L&&!g[L]){var H=v(U)?u(r,U,r.size.value,O):null,X=s(r,U,O);g[L]=!H||H instanceof Array?"":r.format.value(H,{key:r.size.value,vars:r,data:U});var G={};G[L]=g[L],g.values.push(G),X&&(g.d3plus_colors||(g.d3plus_colors={}),g.d3plus_colors[L]=X)}else R--}D>V&&(g.d3plusMore=D-V)}m.d3plus.tooltip&&(j=c(j,m.d3plus.tooltip)),r.tooltip.size.value&&(C&&"number"!=typeof r.size.value&&(j[p("size")]=C),r.axes.opposite&&r[r.axes.opposite].value!==r.size.value&&(j[p(r.axes.opposite)]=u(r,m,r[r.axes.opposite].value)),r.axes.opposite&&r[r.axes.opposite+"2"].value!==r.size.value&&(j[p(r.axes.opposite+"2")]=u(r,m,r[r.axes.opposite+"2"].value)),r.color.valueScale&&(j[p("color")]=u(r,m,r.color.value)));var J=d(r,m,"active"),W=d(r,m,"temp"),Q=d(r,m,"total");"number"==typeof J&&J>0&&Q&&(j[p("active")]=J+"/"+Q+" ("+r.format.value(J/Q*100,{key:"share",vars:r,data:m})+")"),"number"==typeof W&&W>0&&Q&&(j[p("temp")]=W+"/"+Q+" ("+r.format.value(W/Q*100,{key:"share",vars:r,data:m})+")"),r.tooltip.share.value&&m.d3plus.share&&(j.share=r.format.value(100*m.d3plus.share,{key:"share",vars:r,data:m}));var M="depth"in e?e.depth:y,K=e.title||l(r,m,M)[0],Z=h(m,r.icon.value,u,r,r.id.nesting[M]),$=e.titleOnly?[]:i(r,m,A,j,g,M);if(Z=1===Z.length&&"string"==typeof Z[0]&&Z[0],$.length>0||E||!m.d3plus_label&&"short"==A&&K||m.d3plus_label&&(!("visible"in m.d3plus_label)||"visible"in m.d3plus_label&&m.d3plus_label.visible===!1)){K||(K=r.format.value(Y,{key:r.id.value,vars:r}));var M="d3plus"in m&&"merged"in m.d3plus?y-1:"depth"in e?e.depth:y;if(M<0&&(M=0),M=r.id.nesting[M],"string"==typeof r.icon.style.value)var ee=r.icon.style.value;else if("object"==typeof r.icon.style.value&&r.icon.style.value[M])var ee=r.icon.style.value[M];else var ee="default";var te=r.tooltip.small;e.width?te=e.width:k&&(te=r.tooltip.large);var re=!k&&"long"!==e.length||k&&r.tooltip.fullscreen.value?d3.select("body"):r.container.value;!e.description&&m&&r.tooltip.sub.value&&(e.description=u(r,m,r.tooltip.sub.value)),a({align:z,arrow:b,locale:r.format.locale.value,background:r.tooltip.background,curtain:r.tooltip.curtain.color,curtainopacity:r.tooltip.curtain.opacity,fontcolor:r.tooltip.font.color,fontfamily:r.tooltip.font.family.value,fontsize:r.tooltip.font.size,fontweight:r.tooltip.font.weight,data:$,color:s(r,m),allColors:!0,footer:e.footer===!1?e.footer:E,fullscreen:k,html:t,js:e.js,icon:Z,id:_,max_height:e.maxheight,max_width:te,mouseevents:x,offset:T,parent:re,stacked:r.tooltip.stacked.value,style:ee,title:K,description:e.description,width:e.width||k||0!=$.length?te:"auto",x:F,y:S})}else f(_)}"d3plus"in e.data||(e.data.d3plus={});var r=e.vars,m=e.data,y="d3plus"in m&&"depth"in m.d3plus?m.d3plus.depth:r.depth.value,x=(e.ex,!!e.mouseevents&&e.mouseevents),b=!("arrow"in e)||e.arrow,w=u(r,m,r.id.value),_=e.id||r.type.value;if(!d3.event||"click"!=d3.event.type||!r.tooltip.html.value&&!r.tooltip.value.long||"fullscreen"in e){var k=!1,z=e.anchor||r.tooltip.anchor,A=e.length||"short",j=g(m,r);if(j===-1){var M=r.id.nesting[y-1];u(r,w,M)}var O="";if(r.mouse.click.value&&(!r.mouse.viz||r.mouse.viz.click!==!1))if(1===j&&r.zoom.value)var O=r.format.value(r.format.locale.value.ui.expand);else if(j===-1&&r.zoom.value&&r.history.states.length&&!r.tooltip.value.long)var O=r.format.value(r.format.locale.value.ui.collapse);else if(r.small||"short"!=A||!r.tooltip.html.value&&!r.tooltip.value.long||1===r.focus.value.length&&r.focus.value[0]==w){if("long"==A)var O=r.footer.value||""}else var O=r.format.locale.value.ui.moreInfo;var E=!!O.length&&r.format.value(O,{key:"footer",vars:r})}else{var k=!0,b=!1,x=!0,A="long",E=r.footer.value;r.covered=!0}if("x"in e)var F=e.x;else if("static"===r.types[r.type.value].tooltip){var F=m.d3plus.x;r.zoom.translate&&r.zoom.scale&&(F=r.zoom.translate[0]+F*r.zoom.scale),F+=r.margin.left,"long"!==e.length&&(S+=p.x(),F+=r.container.value.node().getBoundingClientRect().left,F+=parseFloat(r.container.value.style("padding-left"),10))}else var F=d3.mouse(d3.select("html").node())[0];if("y"in e)var S=e.y;else if("static"==r.types[r.type.value].tooltip){var S=m.d3plus.y;r.zoom.translate&&r.zoom.scale&&(S=r.zoom.translate[1]+S*r.zoom.scale),S+=r.margin.top,"long"!==e.length&&(S+=p.y(),S+=r.container.value.node().getBoundingClientRect().top,S+=parseFloat(r.container.value.style("padding-top"),10))}else var S=d3.mouse(d3.select("html").node())[1];if("offset"in e)var T=e.offset;else if("static"==r.types[r.type.value].tooltip){var T=m.d3plus.r?m.d3plus.r:m.d3plus.height/2;r.zoom.scale&&(T*=r.zoom.scale)}else var T=3;if(k||"long"===e.length)if("string"==typeof r.tooltip.html.value)t(r.tooltip.html.value);else if("function"==typeof r.tooltip.html.value)t(r.tooltip.html.value(w));else if(r.tooltip.html.value&&"object"==typeof r.tooltip.html.value&&r.tooltip.html.value.url){var B=r.tooltip.html.value.url;"function"==typeof B&&(B=B(w)),d3.json(B,function(e){var n=r.tooltip.html.value.callback?r.tooltip.html.value.callback(e):e;t(n)})}else t(e.html);else t(e.html)}},{"../../../array/sort.coffee":34,"../../../client/scroll.js":41,"../../../core/data/nest.js":60,"../../../core/fetch/color.coffee":63,"../../../core/fetch/text.js":66,"../../../core/fetch/value.coffee":67,"../../../object/merge.coffee":171,"../../../object/validate.coffee":172,"../../../tooltip/create.js":201,"../../../tooltip/remove.coffee":203,"../../../util/uniques.coffee":210,"../shapes/segments.coffee":233,"../zoom/direction.coffee":250,"./data.js":241}],241:[function(e,t,r){var n=e("../../../util/copy.coffee"),a=e("../../../core/fetch/value.coffee"),o=e("../../../core/fetch/color.coffee"),i=e("../../../core/fetch/text.js"),s=e("../../../color/legible.coffee"),l=e("../../../object/merge.coffee"),u=e("../../../client/prefix.coffee"),c=e("../../../string/format.js"),f=e("../../../object/validate.coffee");t.exports=function(e,t,r,d,p,h){function v(r,n){if(e.attrs.value[n])var o=n;else var o=null;n&&(n=e.format.value(n));var i=m[r]||a(e,t,r,o);if(f(i))w.push({name:e.format.value(r),value:e.format.value(i.value,{key:i.key,vars:e}),group:n});else if(null!=i&&"undefined"!=i&&!(i instanceof Array)&&("string"==typeof i&&i.indexOf("d3plus_other")<0||"string"!=typeof i)){var s=e.format.locale.value.ui[r]?e.format.value(e.format.locale.value.ui[r]):e.format.value(r),l=x.indexOf(r)>=0;i instanceof Array?i.forEach(function(n){n=e.format.value(n,{key:r,vars:e,data:t})}):i=e.format.value(i,{key:r,vars:e,data:t});var u={name:s,value:i,highlight:l,group:n};if(e.descs.value)if("function"==typeof e.descs.value){var c=e.descs.value(r);"string"==typeof c&&(u.desc=c)}else r in e.descs.value&&(u.desc=e.descs.value[r]);w.push(u)}}if(e.small)return[];if(!r)var r="long";if("long"==r)var g="short";else var g="long";var m={};if(d&&"string"==typeof d)d=[d];else if(d&&"object"==typeof d){m=l(m,d);var d=[];for(var y in m)d.push(y)}else if(!d)var d=[];var x=[];if(e.tooltip.value instanceof Array)var b=e.tooltip.value;else if("string"==typeof e.tooltip.value)var b=[e.tooltip.value];else{if(e.tooltip.value[e.id.nesting[h]])var b=e.tooltip.value[e.id.nesting[h]];else var b=e.tooltip.value;b instanceof Array||(b=b[r]?b[r]:b[g]?[]:l({"":[]},b)),"string"==typeof b?b=[b]:b instanceof Array||(b=l({"":[]},b))}var w=[];if(b.constructor===Array&&(b={"":b}),e.id.nesting.length&&h<e.id.nesting.length-1){var b=n(b);e.id.nesting.forEach(function(e,t){t>h&&b[e]&&delete b[e]})}for(var _ in b){b[_].constructor!==Array&&(b[_]=[b[_]]);for(var k=d.length;k>0;k--)b[_].indexOf(d[k-1])>=0&&d.splice(k-1,1)}if(e.tooltip.value.long&&"object"==typeof e.tooltip.value.long){for(var _ in e.tooltip.value.long)for(var k=d.length;k>0;k--){var z=d[k-1];e.tooltip.value.long[_].indexOf(z)>=0&&(b[_]||(b[_]=[]),b[_].push(z),d.splice(k-1,1))}}d.length&&(b[""]||(b[""]=[]),b[""]=b[""].concat(d));for(var _ in b)b[_].forEach(function(e){v(e,_)});if(p){var A=e.format.locale.value.ui.including,j=p.d3plus_colors;p.values.forEach(function(t){var r=d3.keys(t)[0];w.push({group:e.format.value(A),highlight:!(!j||!j[r])&&j[r],name:r,value:t[r]})}),p.d3plusMore&&w.push({group:e.format.value(A),highlight:!0,name:c(e.format.locale.value.ui.more,p.d3plusMore),value:""})}if(e.tooltip.connections.value&&"long"===r){var M=e.edges.connections(t[e.id.value],e.id.value,!0);M.length&&M.forEach(function(t){var r=e.data.viz.filter(function(r){return r[e.id.value]===t[e.id.value]}),r=r.length?r[0]:t,n=i(e,r)[0],a=o(e,r),l=e.tooltip.font.size,c="square"==e.shape.value?0:l;styles=["background-color: "+a,"border-color: "+s(a),"border-style: solid","border-width: "+e.data.stroke.width+"px","display: inline-block","height: "+l+"px","left: 0px","position: absolute","width: "+l+"px","top: 0px",u()+"border-radius: "+c+"px"],node="<div style='"+styles.join("; ")+";'></div>";var f=function(){e.self.focus([r[e.id.value]]).draw()};w.push({group:e.format.value(e.format.locale.value.ui.primary),highlight:!1,link:f,name:"<div id='d3plustooltipfocuslink_"+r[e.id.value]+"' class='d3plus_tooltip_focus_link' style='position:relative;padding-left:"+1.5*l+"px;'>"+node+n+"</div>"})})}return w}},{"../../../client/prefix.coffee":39,"../../../color/legible.coffee":44,"../../../core/fetch/color.coffee":63,"../../../core/fetch/text.js":66,"../../../core/fetch/value.coffee":67,"../../../object/merge.coffee":171,"../../../object/validate.coffee":172,"../../../string/format.js":173,"../../../util/copy.coffee":207}],242:[function(e,t,r){var n;n=e("../../../core/console/print.coffee"),t.exports=function(e){var t,r,a,o,i,s,l,u,c,f;if(e.group=e.g.apps[e.type.value],e.mouse.viz=!1,e.edges.path=!1,f=e.types[e.type.value],u=f.requirements||[],a=u.indexOf("data")>=0,o=!a||a&&e.data.viz.length,!e.error.internal&&o){for(t=e.format.locale.value.visualization[e.type.value],e.dev.value&&n.time("running "+t),l=e.data.viz,i=0,s=l.length;i<s;i++)r=l[i],r.d3plus&&(delete r.d3plus.shape,delete r.d3plus.label,delete r.d3plus.rotate,delete r.d3plus.share);c=f(e),e.dev.value&&n.timeEnd("running "+t)}else c=null;e.returned={nodes:[],edges:null},c instanceof Array?e.returned.nodes=c:c&&(c.nodes&&(e.returned.nodes=c.nodes),c.edges&&(e.returned.edges=c.edges))}},{"../../../core/console/print.coffee":52}],243:[function(e,t,r){var n=e("../../../util/copy.coffee"),a=e("../../../form/form.js"),o=e("../../../core/console/print.coffee"),i=e("../../../object/validate.coffee");t.exports=function(e){var t=e.ui.value&&e.ui.value.length,r=e.ui.position.value;e.dev.value&&t&&o.time("drawing custom UI elements");var s=e.container.value.selectAll("div#d3plus_drawer").data(["d3plus_drawer"]);s.enter().append("div").attr("id","d3plus_drawer");var l={};e.ui.position.accepted.forEach(function(t){l[t]=t==r?e.margin.bottom+"px":"auto"}),s.style("text-align",e.ui.align.value).style("position","absolute").style("width",e.width.value-2*e.ui.padding+"px").style("height","auto").style(l);var u=s.selectAll("div.d3plus_drawer_ui").data(t?e.ui.value:[],function(e){return e.method||!1});u.exit().remove(),u.enter().append("div").attr("class","d3plus_drawer_ui").style("display","inline-block"),u.style("padding",e.ui.padding+"px").each(function(t){t.form||(t.form=a().container(d3.select(this)).data({sort:!1}).id("id").text("text"));var r,o;"string"==typeof t.method&&t.method in e?(r=e[t.method].value,o=function(r){r!==e[t.method].value&&e.self[t.method](r).draw()}):(r=t.focus||t.value[0],i(r)&&(r=r[d3.keys(r)[0]]),"function"==typeof t.method&&(o=function(n){n!==r&&(r=n,t.focus=n,t.method(n,e.self))}));var s,l=[];t.label?s=t.label:"string"==typeof t.method&&t.method in e&&(s=e.format.locale.value.method[t.method]||t.method),t.value.forEach(function(t){var r={};i(t)?(r.id=t[d3.keys(t)[0]],r.text=e.format.value(d3.keys(t)[0])):(r.id=t,r.text=e.format.value(t)),l.push(r)});var u=n(e.ui.font);u.align=n(e.font.align),u.secondary=n(u),t.form.data(l).font(u).focus(t.value.length>1&&r).focus({callback:o}).format(e.format.locale.language).format({number:e.format.number.value,text:e.format.text.value}).title(e.format.value(s)).type(t.type||"auto").ui({align:e.ui.align.value,border:e.ui.border,color:{primary:e.ui.color.primary.value,secondary:e.ui.color.secondary.value},padding:e.ui.padding,margin:0}).width(t.width||!1).draw()});var c=s.node().offsetHeight||s.node().getBoundingClientRect().height;c&&(e.margin[r]+=c),e.dev.value&&t&&o.timeEnd("drawing custom UI elements")}},{"../../../core/console/print.coffee":52,"../../../form/form.js":104,"../../../object/validate.coffee":172,"../../../util/copy.coffee":207}],244:[function(e,t,r){var n,a,o,i;n=e("../../../client/pointer.coffee"),a=e("../../../color/lighter.coffee"),o=e("../../../core/console/print.coffee"),i=e("../../../client/css.coffee"),t.exports=function(e){var t,r,s,l,u,c,f,d,p,h,v,g,m,y,x;return!e.small&&e.history.states.length>0?(e.dev.value&&o.time("drawing back button"),t=e.container.value.selectAll("div#d3plus_back_button").data(["d3plus_back_button"]).style("position","relative").style("z-index",1900),p=e.title.sub.font.size,r=e.title.sub.font.color,u=e.title.sub.font.family.value,x=e.title.sub.font.weight,d=e.title.sub.padding,g=!1,e.title.sub.value&&["start","left"].indexOf(e.title.sub.font.align)<0?g="sub":e.title.total.value&&["start","left"].indexOf(e.title.total.font.align)<0?g="total":e.title.value&&["start","left"].indexOf(e.title.font.align)<0&&(g="title"),g?(h=function(e){var t;return t=e.attr("transform").match(/translate\(([^a-z]+)\)/gi)[0],t=t.replace(/([^a-z])\s([^a-z])/gi,"$1,$2"),t=t.split(","),t=t[t.length-1],parseFloat(t.substring(0,t.length-1))},m=e.svg.select(".d3plus_title."+g),y=h(m)+h(m.select("text"))):(y=e.margin.top-e.title.padding,f=p+2*d,e.margin.top+=f),s=parseFloat(e.container.value.style("padding-top"),10),y+=s,s=parseFloat(e.container.value.style("padding-left"),10),c=e.margin.left+p/2+s,v=function(e){return e.style("position","absolute").style("left",c+"px").style("top",y+"px").style("color",r).style("font-family",u).style("font-weight",x).style("font-size",p+"px")},l=t.enter().append("div").attr("id","d3plus_back_button").style("opacity",0).call(v).html(function(){var t;return i("font-awesome")&&0===e.icon.back.value.indexOf("fa-")?(t="<i class='fa "+e.icon.back.value,t+="' style='margin-top:2px;margin-right:4px;'></i>"):t=e.icon.back.value+" ",t+e.format.value(e.format.locale.value.ui.back)}),t.on(n.over,function(){if(!e.small&&e.history.states.length>0)return d3.select(this).style("cursor","pointer").transition().duration(e.timing.mouseevents).style("color",a(r,.25))}).on(n.out,function(){if(!e.small&&e.history.states.length>0)return d3.select(this).style("cursor","auto").transition().duration(e.timing.mouseevents).style("color",r)}).on(n.click,function(){return e.history.back()}).transition().duration(e.draw.timing).style("opacity",1).call(v),e.dev.value?o.timeEnd("drawing back button"):void 0):e.container.value.selectAll("div#d3plus_back_button").transition().duration(e.draw.timing).style("opacity",0).remove()}},{"../../../client/css.coffee":36,"../../../client/pointer.coffee":38,"../../../color/lighter.coffee":45,"../../../core/console/print.coffee":52}],245:[function(e,t,r){var n=e("../../../array/sort.coffee"),a=e("../../../util/buckets.coffee"),o=e("../../../util/copy.coffee"),i=e("../tooltip/create.js"),s=e("../../../core/data/nest.js"),l=e("../../../util/dataURL.coffee"),u=e("../../../client/pointer.coffee"),c=e("../../../core/fetch/value.coffee"),f=e("../../../core/fetch/color.coffee"),d=e("../../../core/fetch/text.js"),p=e("../../../core/console/print.coffee"),h=e("../../../tooltip/remove.coffee"),v=e("../../../color/text.coffee"),g=e("../../../util/uniques.coffee"),m=e("../../../client/scroll.js"),y=e("../../../string/strip.js"),x=e("../../../textwrap/textwrap.coffee"),b=(e("../../../client/touch.coffee"),e("../../../object/validate.coffee"));t.exports=function(e){function t(t){t.attr("transform",function(t,r){var n=B+r*(e.ui.padding+_);return"translate("+n+","+e.ui.padding+")"})}function r(t){t.attr("width",_).attr("height",_).attr("fill",function(t){d3.select(this.parentNode).select("text").remove();var r=g(t,e.icon.value,c,e,V),n=f(e,t,V);if(e.legend.icons.value&&1===r.length&&"string"==typeof r[0]){r=r[0];var a,o=y(r+"_"+n),i=e.icon.style.value,s=e.defs.selectAll("pattern#"+o).data([o]);a="string"==typeof i?e.icon.style.value:b(i)&&i[V]?i[V]:"default",n="knockout"==a?n:"none",s.select("rect").transition().duration(e.draw.timing).attr("fill",n).attr("width",_).attr("height",_),s.select("image").transition().duration(e.draw.timing).attr("width",_).attr("height",_);var u=s.enter().append("pattern").attr("id",o).attr("width",_).attr("height",_);return u.append("rect").attr("fill",n).attr("stroke","none").attr("width",_).attr("height",_),u.append("image").attr("xlink:href",r).attr("width",_).attr("height",_).each(function(e){0===r.indexOf("/")||r.indexOf(window.location.hostname)>=0?l(r,function(e){s.select("image").attr("xlink:href",e)}):s.select("image").attr("xlink:href",r)}),"url(#"+o+")"}if(e.legend.labels.value){var p;if(p=e.legend.text.value?[c(e,t,e.legend.text.value,D)]:d(e,t,D),1===p.length&&!(p[0]instanceof Array)&&p[0].length){var h=d3.select(this.parentNode).append("text"),m=e.legend.font.size;m instanceof Array||(m=[m]),h.attr("font-size",m[m.length-1]+"px").attr("font-weight",e.legend.font.weight).attr("font-family",e.legend.font.family.value).attr("stroke","none").attr("fill",v(n)).attr("x",0).attr("y",0).each(function(t){x().align("middle").container(d3.select(this)).height(_).padding(e.ui.padding).resize(m.length>1).size(m).text(p[0]).width(_).valign("middle").draw()}),h.select("tspan").empty()&&h.remove()}}return n})}var w=!0,_=0;if(!e.error.internal&&e.color.value&&!e.small&&e.legend.value)if(e.color.valueScale)if(e.color.valueScale){e.dev.value&&p.time("drawing color scale"),e.g.legend.selectAll("g.d3plus_color").transition().duration(e.draw.timing).attr("opacity",0).remove();var k=e.color.valueScale.domain(),z=e.color.valueScale.range();k.length<=2&&(k=a(k,6));var A=e.g.legend.selectAll("g.d3plus_scale").data(["scale"]);A.enter().append("g").attr("class","d3plus_scale").attr("opacity",0);var j=e.container.id+"_legend_heatmap",M=A.selectAll("#"+j).data(["heatmap"]);M.enter().append("linearGradient").attr("id",j).attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%").attr("spreadMethod","pad");var O=M.selectAll("stop").data(d3.range(0,z.length));O.enter().append("stop").attr("stop-opacity",1),O.attr("offset",function(e){return Math.round(e/(z.length-1)*100)+"%"}).attr("stop-color",function(e){return z[e]}),O.exit().remove();var E=A.selectAll("rect#gradient").data(["gradient"]);E.enter().append("rect").attr("id","gradient").attr("x",function(t){return"middle"==e.legend.align?e.width.value/2:"end"==e.legend.align?e.width.value:0}).attr("y",e.ui.padding).attr("width",0).attr("height",e.legend.gradient.height).attr("stroke",e.legend.font.color).attr("stroke-width",1).style("fill","url(#"+j+")");var F=A.selectAll("text.d3plus_tick").data(d3.range(0,k.length));F.enter().append("text").attr("class","d3plus_tick").attr("stroke","none").attr("x",function(t){return"middle"==e.legend.align?e.width.value/2:"end"==e.legend.align?e.width.value:0}).attr("y",function(t){return this.getBBox().height+e.legend.gradient.height+2*e.ui.padding});var S=0;F.order().attr("font-weight",e.legend.font.weight).attr("font-family",e.legend.font.family.value).attr("font-size",e.legend.font.size+"px").style("text-anchor",e.legend.font.align).attr("fill",e.legend.font.color).text(function(t){return e.format.value(k[t],{key:e.color.value,vars:e})}).attr("y",function(t){return this.getBBox().height+e.legend.gradient.height+2*e.ui.padding}).each(function(e){var t=Math.ceil(this.getBBox().width);t>S&&(S=t)}),S+=2*e.labels.padding;var T=S*(k.length-1);if(T+S<e.width.value){T+S<e.width.value/2&&(T=e.width.value/2,S=T/k.length,T-=S);var B;B="start"==e.legend.align?e.ui.padding:"end"==e.legend.align?e.width.value-e.ui.padding-T:e.width.value/2-T/2,F.transition().duration(e.draw.timing).attr("x",function(e){return B+S*e}),F.exit().transition().duration(e.draw.timing).attr("opacity",0).remove();var C=A.selectAll("rect.d3plus_tick").data(d3.range(0,k.length));C.enter().append("rect").attr("class","d3plus_tick").attr("x",function(t){return"middle"==e.legend.align?e.width.value/2:"end"==e.legend.align?e.width.value:0}).attr("y",e.ui.padding).attr("width",0).attr("height",e.ui.padding+e.legend.gradient.height).attr("fill",e.legend.font.color), | |
| C.transition().duration(e.draw.timing).attr("x",function(e){var t=0===e?1:0;return B+S*e-t}).attr("y",e.ui.padding).attr("width",1).attr("height",e.ui.padding+e.legend.gradient.height).attr("fill",e.legend.font.color),C.exit().transition().duration(e.draw.timing).attr("width",0).remove(),E.transition().duration(e.draw.timing).attr("x",function(t){return"middle"==e.legend.align?e.width.value/2-T/2:"end"==e.legend.align?e.width.value-T-e.ui.padding:e.ui.padding}).attr("y",e.ui.padding).attr("width",T).attr("height",e.legend.gradient.height),A.transition().duration(e.draw.timing).attr("opacity",1),e.dev.value&&p.timeEnd("drawing color scale")}else w=!1}else w=!1;else{e.dev.value&&p.time("grouping data by colors");var q;if(e.nodes.value&&e.types[e.type.value].requirements.indexOf("nodes")>=0){if(q=o(e.nodes.restriced||e.nodes.value),e.data.viz.length)for(var N=0;N<q.length;N++){var P=e.data.viz.filter(function(t){return t[e.id.value]===q[N][e.id.value]});P.length&&(q[N]=P[0])}}else q=e.data.viz;q.length&&"key"in q[0]&&"values"in q[0]&&(q=d3.merge(q.map(function(e){return e.values})));var I=function(t){return f(e,t,D)},D=0,V=e.id.value,R=e.id.nesting.indexOf(e.color.value);if(R>=0)D=R,V=e.id.nesting[R];else for(var U=0;U<=e.depth.value;U++){D=U,V=e.id.nesting[U];var L=g(q,function(t){return c(e,t,V)}),Y=g(q,I);if(L.length>=Y.length&&Y.length>1)break}var H=[e.color.value],z=s(e,q,H,!1);e.dev.value&&p.timeEnd("grouping data by color");var X=e.width.value;_=e.legend.size;var T=_*z.length+e.ui.padding*(z.length+1);if(_ instanceof Array){e.dev.value&&p.time("calculating legend size");for(var N=_[1];N>=_[0];N--)if(T=N*z.length+e.ui.padding*(z.length+1),X>=T){_=N;break}e.dev.value&&p.timeEnd("calculating legend size")}else"number"!=typeof _&&_!==!1&&(_=30);if(X<T||1==z.length)w=!1;else{if(T-=2*e.ui.padding,e.dev.value&&p.time("sorting legend"),"function"==typeof e.legend.order.value)z=e.legend.order.value(z);else{var G=e[e.legend.order.value].value,J=e.color.value;G?"color"!==e.legend.order.value&&(J=[]):G=e[e.color.value].value,n(z,G,e.legend.order.sort.value,J,e,D)}e.dev.value&&p.timeEnd("sorting legend"),e.dev.value&&p.time("drawing legend");var B;B="start"==e.legend.align?e.ui.padding:"end"==e.legend.align?X-e.ui.padding-T:X/2-T/2,e.g.legend.selectAll("g.d3plus_scale").transition().duration(e.draw.timing).attr("opacity",0).remove();var W={},Q=e.g.legend.selectAll("g.d3plus_color").data(z,function(t){var r=f(e,t,V);return r in W||(W[r]=-1),W[r]++,W[r]+"_"+r});Q.enter().append("g").attr("class","d3plus_color").attr("opacity",0).call(t).append("rect").attr("class","d3plus_color").attr("stroke","none").call(r),Q.order().transition().duration(e.draw.timing).call(t).attr("opacity",1).selectAll("rect.d3plus_color").call(r),Q.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),e.legend.tooltip.value&&Q.on(u.over,function(t,r){d3.select(this).style("cursor","pointer");var n,a=this.getBoundingClientRect(),o=a.left+_/2+m.x(),s=a.top+_/2+m.y()+5,l=c(e,t,V),f=e.id.nesting.indexOf(V);n=e.legend.title.value?c(e,t,e.legend.title.value,D):f>=0?d(e,t,f)[0]:e.format.value(c(e,t,e.color.value,V),{key:e.color.value,vars:e,data:t});var p,h;if(e.legend.filters.value&&!(l instanceof Array)){p="<div style='text-align:center;'>";var v=e.format.locale.value;p+="<div class='mute'>"+e.format.value(v.method.mute)+"</div>",p+="<div class='solo'>"+e.format.value(v.method.solo)+"</div>",p+="</div>",h=function(t){var r={border:"1px solid #ccc",display:"inline-block",margin:"1px 2px",padding:"3px 5px"};t.select(".mute").style(r).on(u.over,function(){d3.select(this).style("cursor","pointer")}).on(u.click,function(){var t=e.id.mute.value;e.history.states.push(function(){e.self.id({mute:t}).draw()}),e.self.id({mute:l}).draw()}),t.select(".solo").style(r).on(u.over,function(){d3.select(this).style("cursor","pointer")}).on(u.click,function(){var t=e.id.solo.value;e.history.states.push(function(){e.self.id({solo:t}).draw()}),e.self.id({solo:l}).draw()})}}i({data:t,html:p,js:h,depth:D,footer:!1,vars:e,x:o,y:s,mouseevents:this,title:n,titleOnly:!e.legend.data.value,offset:.4*_})}).on(u.out,function(t){h(e.type.value)}),e.dev.value&&p.timeEnd("drawing legend")}}else w=!1;if(e.legend.value&&key&&w){if(e.dev.value&&p.time("positioning legend"),_)var K=_+e.ui.padding;else var Z=e.g.legend.node().getBBox(),K=Z.height+Z.y;0===e.margin.bottom&&(e.margin.bottom+=e.ui.padding),e.margin.bottom+=K,e.g.legend.transition().duration(e.draw.timing).attr("transform","translate(0,"+(e.height.value-e.margin.bottom)+")"),e.dev.value&&p.timeEnd("positioning legend")}else e.dev.value&&p.time("hiding legend"),e.g.legend.transition().duration(e.draw.timing).attr("transform","translate(0,"+e.height.value+")"),e.dev.value&&p.timeEnd("hiding legend")}},{"../../../array/sort.coffee":34,"../../../client/pointer.coffee":38,"../../../client/scroll.js":41,"../../../client/touch.coffee":43,"../../../color/text.coffee":50,"../../../core/console/print.coffee":52,"../../../core/data/nest.js":60,"../../../core/fetch/color.coffee":63,"../../../core/fetch/text.js":66,"../../../core/fetch/value.coffee":67,"../../../object/validate.coffee":172,"../../../string/strip.js":175,"../../../textwrap/textwrap.coffee":200,"../../../tooltip/remove.coffee":203,"../../../util/buckets.coffee":204,"../../../util/copy.coffee":207,"../../../util/dataURL.coffee":209,"../../../util/uniques.coffee":210,"../tooltip/create.js":240}],246:[function(e,t,r){var n=e("../../../client/pointer.coffee"),a=e("../../../color/text.coffee");t.exports=function(e,t){function r(t){t.style(i).style("position","absolute").style("background-color",l).style("text-align","center").style("left",function(){return"center"==s?"50%":"0px"}).style("width",function(){return"center"==s?"auto":e.width.value+"px"}).style("margin-left",function(){return"center"==s?-(this.offsetWidth/2)+"px":"0px"}).style("top",function(){return"center"==s?"50%":"top"==s?"0px":"auto"}).style("bottom",function(){return"bottom"==s?"0px":"auto"}).style("margin-top",function(){if("large"==o){var e=this.offsetHeight||this.getBoundingClientRect().height;return-e/2+"px"}return"0px"})}t=e.messages.value?t:null;var o=e.messages.style.value||(t===e.error.internal?"large":e.messages.style.backup);if("large"===o)var i=e.messages,s="center";else{if(e.footer.value)var i=e.footer;else if(e.title.value)var i=e.title;else if(e.title.sub.value)var i=e.title.sub;else if(e.title.total.value)var i=e.title.total;else var i=e.title.sub;var s=i.position}var i={color:i.font.color,"font-family":i.font.family.value,"font-weight":i.font.weight,"font-size":i.font.size+"px",padding:i.padding+"px"},l=e.messages.background.value;l||(l=e.background.value,"none"!==l&&"transparent"!==l||(l=a(i.color))),e.g.message=e.container.value.selectAll("div#d3plus_message").data(["message"]);var u=e.g.message.enter().append("div").attr("id","d3plus_message").attr("opacity",0);u.append("div").attr("class","d3plus_message_text").style("display","block"),e.g.message.select(".d3plus_message_text").text(t?t:e.g.message.text());var c=navigator.onLine,f=75,d=e.g.message.selectAll(".d3plus_message_branding").data(e.messages.branding.value&&"center"===s?[0]:[]);d.enter().append("div").attr("class","d3plus_message_branding").style("margin-top","15px").style("padding-top","0px").style("display","block").style("font-size","11px").style("background-size",f+"px").style("background-position","center 10px").style("background-repeat","no-repeat").style("cursor","pointer").on(n.click,function(){window.open("http://www.d3plus.org/","_blank")});var p=d3.hsl(l).l<.5?e.messages.branding.image.dark:e.messages.branding.image.light;d.text(c?"Powered by:":"Powered by D3plus").style("background-color",c?l:"transparent").style("background-image",c?"url('"+p+"')":"none").style("min-width",c?f+"px":"auto").style("height",c?f+"px":"auto"),d.exit().remove(),e.g.message.style("display",t?"inline-block":"none").call(r).style("opacity",t?1:0)}},{"../../../client/pointer.coffee":38,"../../../color/text.coffee":50}],247:[function(e,t,r){var n,a,o,i,s,l,u,c,f,d;n=e("../../../util/closest.coffee"),a=e("../../../client/css.coffee"),i=e("../../../font/sizes.coffee"),o=e("../../../client/pointer.coffee"),s=e("../../../color/mix.coffee"),u=e("../../../client/prefix.coffee"),c=e("../../../core/console/print.coffee"),f=e("../../../color/text.coffee"),d=e("../../../core/data/time.coffee"),l=!1,t.exports=function(e){var t,r,i,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,B,C,q,N,P,I,D,V,R,U,L,Y,H,X,G,J,W,Q,K,Z,$,ee,te,re,ne,ae,oe,ie;if(!e.timeline.value||e.error.internal&&e.data.missing||e.small||!e.data.time||!(e.data.time.values.length>1))return e.g.timeline.transition().duration(e.draw.timing).attr("transform","translate(0,"+e.height.value+")");if(e.dev.value&&c.time("drawing timeline"),H={"font-weight":e.ui.font.weight,"font-family":e.ui.font.family.value,"font-size":e.ui.font.size+"px","text-anchor":"middle"},ie=e.data.time.ticks.map(function(e){return new Date(e)}),Q=d(e,{values:ie,style:H}),te=Q.values.map(Number),W=Q.format,e.time.solo.value.length)for(w=d3.extent(e.time.solo.value),b=_=0,A=w.length;_<A;b=++_)m=w[b],m.constructor!==Date&&(m+="",4===m.length&&parseInt(m)+""===m&&(m+="/01/01"),m=new Date(m),w[b]=m);else w=d3.extent(ie);if(oe=ie.slice(),ne=d3.max(Q.sizes.map(function(e){return e.height})),k=~~d3.max(Q.sizes.map(function(e){return e.width}))+1,k+=2*e.ui.padding,Z=e.timeline.height.value||ne+2*e.ui.padding,ee=k*ie.length,N=Z,U=Z-2*e.ui.padding>=ne,t=e.width.value-2*e.ui.padding,U&&e.timeline.play.value&&(t-=N+e.ui.padding),!U||te.length<ie.length||t<k*te.length){for(E=k,k=(t-k)/ie.length,ee=k*ie.length,$=1,G=~~(E/(ee/te.length))+1;G<te.length-1&&(te.length-1)%G!==0;)G++;te=te.filter(function(e,t){return t%G===0})}else $=0,M=new Date(ie[0]),V=e.data.time.stepType,M["set"+V](M["get"+V]()+ie.length),oe.push(M);return I=new Date(w[0]),I=n(oe,I),y=new Date(w[1]),$||y["set"+e.data.time.stepType](y["get"+e.data.time.stepType]()+1),y=n(oe,y),ae=oe.map(Number),O=ae.indexOf(+I),j=ae.indexOf(+y),p=[I,y],D="start"===e.timeline.align?e.ui.padding:"end"===e.timeline.align?e.width.value-e.ui.padding-ee:e.width.value/2-ee/2,U&&e.timeline.play.value&&(D+=(N+e.ui.padding)/2),R=function(){return clearInterval(l),l=!1,S.call(T,"icon")},v=function(){var e,t,r;if(null!==d3.event.sourceEvent){if(l&&R(),p=i.extent(),r=n(oe,p[0]),t=n(oe,p[1]),r===t&&(O=ae.indexOf(+r),r<p[0]||0===O?t=oe[O+1]:r=oe[O-1]),O=ae.indexOf(+r),j=ae.indexOf(+t),j-O>=1)e=[r,t];else if(O+1<=ie.length)e=[r,oe[O+1]];else{for(e=[r],b=1;b<=1;)O+b<=ie.length?e.push(oe[O+b]):e.unshift(oe[O-(O+b-ie.length)]),b++;e=[e[0],e[e.length-1]]}return p=e,L.attr("fill",Y),d3.select(this).call(i.extent(e))}},P=function(){var t;return j-O===ie.length-$?t=[]:(t=ae.filter(function(e,t){return t>=O&&t<j+$}),t=t.map(function(e){return new Date(e)})),q(),e.self.time({solo:t}).draw()},g=function(){var t,r,a,o;if(null!==d3.event.sourceEvent&&(e.time.solo.value.length?(o=d3.extent(e.time.solo.value),a=ae.indexOf(+n(oe,o[0])),r=ae.indexOf(+n(oe,o[1])),t=a!==O||r!==j):t=j-O!==ie.length-$,t))return P()},F=e.g.timeline.selectAll("rect.d3plus_timeline_play").data(U&&e.timeline.play.value?[0]:[]),C=function(t){return t.attr("width",N+1).attr("height",Z+1).attr("fill",e.ui.color.primary.value).attr("stroke",e.ui.color.primary.value).attr("stroke-width",1).attr("x",D-N-1-e.ui.padding).attr("y",e.ui.padding)},F.enter().append("rect").attr("class","d3plus_timeline_play").attr("shape-rendering","crispEdges").attr("opacity",0).call(C),F.transition().duration(e.draw.timing).call(C),F.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),S=e.g.timeline.selectAll("text.d3plus_timeline_playIcon").data(U&&e.timeline.play.value?[0]:[]),T=function(t,r){var n;return r=e.timeline.play[r],a("font-awesome")?(r=r.awesome,n="FontAwesome"):(r=r.fallback,n="inherit"),t.style("font-family",n).text(r)},B=function(t){var r;return r=Z/2+e.ui.padding+1,t.attr("fill",f(e.ui.color.primary.value)).attr("stroke","none").attr(H).attr("x",D-(N-1)/2-e.ui.padding).attr("y",r).attr("dy","0.5ex").call(T,l?"pause":"icon")},S.enter().append("text").attr("class","d3plus_timeline_playIcon").call(B).style("pointer-events","none").attr("opacity",0),S.call(B).transition().duration(e.draw.timing).attr("opacity",1),S.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),q=function(){return j-O===ie.length-$?(F.on(o.hover,null).on(o.click,null).transition().duration(e.draw.timing).attr("opacity",.3),S.transition().duration(e.draw.timing).attr("opacity",.3)):(F.on(o.over,function(){return d3.select(this).style("cursor","pointer")}).on(o.out,function(){return d3.select(this).style("cursor","auto")}).on(o.click,function(){return l?R():(S.call(T,"pause"),j===ie.length?(j-=O,O=0):(O++,j++),P(),l=setInterval(function(){return j===ie.length-$?R():(O++,j++,P())},e.timeline.play.timing.value))}).transition().duration(e.draw.timing).attr("opacity",1),S.transition().duration(e.draw.timing).attr("opacity",1))},q(),Y=function(t){var r,n,a;return n=$?t<=p[1]:t<p[1],t>=p[0]&&n?(a=1,r=f(e.ui.color.secondary.value)):(a=.5,r=f(e.ui.color.primary.value)),$&&e.background.value&&"none"!==e.background.value&&(r=d3.rgb(f(e.background.value))),r=d3.rgb(r),"rgba("+r.r+","+r.g+","+r.b+","+a+")"},r=e.g.timeline.selectAll("rect.d3plus_timeline_background").data(["background"]),r.enter().append("rect").attr("class","d3plus_timeline_background").attr("shape-rendering","crispEdges").attr("width",ee+2).attr("height",Z+2).attr("fill",e.ui.color.primary.value).attr("x",D-1).attr("y",e.ui.padding),r.transition().duration(e.draw.timing).attr("width",ee+2).attr("height",Z+2).attr("fill",e.ui.color.primary.value).attr("x",D-1).attr("y",e.ui.padding),J=e.g.timeline.selectAll("g#ticks").data(["ticks"]),J.enter().append("g").attr("id","ticks").attr("transform","translate("+e.width.value/2+","+e.ui.padding+")"),h=e.g.timeline.selectAll("g#brush").data(["brush"]),h.enter().append("g").attr("id","brush"),z=e.g.timeline.selectAll("g#labels").data(["labels"]),z.enter().append("g").attr("id","labels"),L=z.selectAll("text").data(ie,function(e,t){return t}),L.enter().append("text").attr("stroke","none").attr("y",0).attr("dy","0.5ex").attr("x",0),re=d3.time.scale().domain(d3.extent(oe)).rangeRound([0,ee]),L.order().attr(H).text(function(e,t){return te.indexOf(+e)>=0?W(e):""}).attr("opacity",function(t,r){return e.data.time.dataSteps.indexOf(r)>=0?1:.4}).attr("fill",Y).attr("transform",function(t,r){var n,a;return n=D+re(t),$||(n+=k/2),a=Z/2+e.ui.padding+1,$&&(a+=Z/2+ne),"translate("+Math.round(n)+","+Math.round(a)+")"}),L.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),i=d3.svg.brush().x(re).extent(p).on("brush",v).on("brushend",g),X=e.axes.discrete&&e[e.axes.discrete].value===e.time.value?e[e.axes.discrete].ticks.color:e.x.ticks.color,J.attr("transform","translate("+D+","+(e.ui.padding+1)+")").transition().duration(e.draw.timing).call(d3.svg.axis().scale(re).orient("top").ticks(function(){return oe}).tickFormat("").tickSize(-Z).tickPadding(0)).selectAll("line").attr("stroke-width",1).attr("shape-rendering","crispEdges").attr("stroke",function(t){return te.indexOf(+t)>=0?X:s(X,e.background.value,.4,1)}),J.selectAll("path").attr("fill","none"),h.attr("transform","translate("+D+","+(e.ui.padding+1)+")").attr("opacity",1).call(i),L.attr("pointer-events","none"),h.selectAll("rect.background").attr("fill","none").style("visibility","visible").attr("height",Z).attr("shape-rendering","crispEdges").on(o.move,function(){var t;return t=e.timeline.hover.value,["grab","grabbing"].indexOf(t)>=0&&(t=u()+t),d3.select(this).style("cursor",t)}),h.selectAll("rect.extent").attr("opacity",.75).attr("height",Z).attr("fill",e.ui.color.secondary.value).attr("shape-rendering","crispEdges").on(o.move,function(){var t;return t=e.timeline.hover.value,["grab","grabbing"].indexOf(t)>=0&&(t=u()+t),d3.select(this).style("cursor",t)}),e.timeline.handles.value?(x=h.selectAll("g.resize").selectAll("rect.d3plus_handle").data(["d3plus_handle"]),x.enter().insert("rect","rect").attr("class","d3plus_handle"),x.attr("fill",e.timeline.handles.color).attr("transform",function(t){var r;return r="resize e"===this.parentNode.className.baseVal?-e.timeline.handles.size:0,"translate("+r+",0)"}).attr("width",e.timeline.handles.size).style("visibility","visible").attr("shape-rendering","crispEdges").attr("opacity",e.timeline.handles.opacity),h.selectAll("g.resize").selectAll("rect").attr("height",Z)):h.selectAll("g.resize").remove(),K=e.g.timeline.node().getBBox(),0===e.margin.bottom&&(e.margin.bottom+=e.ui.padding),e.margin.bottom+=K.height+K.y,e.g.timeline.transition().duration(e.draw.timing).attr("transform","translate(0,"+Math.round(e.height.value-e.margin.bottom-e.ui.padding/2)+")"),e.margin.bottom+=e.ui.padding,e.dev.value?c.time("drawing timeline"):void 0}},{"../../../client/css.coffee":36,"../../../client/pointer.coffee":38,"../../../client/prefix.coffee":39,"../../../color/mix.coffee":46,"../../../color/text.coffee":50,"../../../core/console/print.coffee":52,"../../../core/data/time.coffee":62,"../../../font/sizes.coffee":102,"../../../util/closest.coffee":206}],248:[function(e,t,r){var n=e("../../../client/pointer.coffee"),a=e("../../../core/fetch/value.coffee"),o=e("../../../core/console/print.coffee"),i=e("../../../client/rtl.coffee"),s=e("../../../textwrap/textwrap.coffee");t.exports=function(e){function t(t){t.attr("font-size",function(e){return e.style.font.size}).attr("fill",function(t){return t.link?e.links.font.color:t.style.font.color}).attr("font-family",function(t){return t.link?e.links.font.family.value:t.style.font.family.value}).attr("font-weight",function(t){return t.link?e.links.font.weight:t.style.font.weight}).style("text-decoration",function(t){return t.link?e.links.font.decoration.value:t.style.font.decoration.value}).style("text-transform",function(t){return t.link?e.links.font.transform.value:t.style.font.transform.value})}function r(e){var t=e.style.font.align;return"center"==t?"middle":"left"==t&&!i||"right"==t&&i?"start":"left"==t&&i||"right"==t&&!i?"end":t}var l=e.size.value?e.size.value:"number"===e.color.type&&e.color.value;if(e.data.viz&&e.title.total.value&&!e.small)if(l){e.dev.value&&o.time("calculating total value");var u=e.data.pool;e.focus.value.length&&(u=e.data.viz.filter(function(t){return t[e.id.value]==e.focus.value[0]}));var c,f=e.aggs.value[l]||"sum";if(f.constructor===Function?c=f(u):(u=u.reduce(function(t,r){var n=a(e,r,l);return n instanceof Array?t=t.concat(n):t.push(n),t},[]),c=d3[f](u)),0!==c&&null!==c&&void 0!==c||(c=!1),"number"==typeof c){var d="";if(e.data.mute.length||e.data.solo.length||e.focus.value.length){var p=d3.sum(e.data.value,function(t){if(e.time.solo.value.length>0)var r=e.time.solo.value.indexOf(a(e,t,e.time.value))>=0;else if(e.time.mute.value.length>0)var r=e.time.solo.value.indexOf(a(e,t,e.time.value))<0;else var r=!0;if(r)return a(e,t,l)});if(p>c){var d=c/p*100,h=e.format.value(p,{key:e.size.value,vars:e});d=" ("+e.format.value(d,{key:"share",vars:e})+" of "+h+")"}}c=e.format.value(c,{key:e.size.value,vars:e});var v=e.title.total.value,g=v.prefix||e.format.value(e.format.locale.value.ui.total)+": ";c=g+c,v.suffix?c+=v.suffix:null,c+=d}e.dev.value&&o.timeEnd("calculating total value")}else var c=!1;else var c=!1;var m=[];if(e.footer.value&&m.push({link:e.footer.link,style:e.footer,type:"footer",value:e.footer.value}),!e.small){if(e.title.value){var y=e.title.value;"function"==typeof y&&(y=y(e.self)),m.push({link:e.title.link,style:e.title,type:"title",value:y})}if(e.title.sub.value){var y=e.title.sub.value;"function"==typeof y&&(y=y(e.self)),m.push({link:e.title.sub.link,style:e.title.sub,type:"sub",value:y})}e.title.total.value&&c&&m.push({link:e.title.total.link,style:e.title.total,type:"total",value:c})}e.dev.value&&o.time("drawing titles");var x=e.svg.selectAll("g.d3plus_title").data(m,function(e){return e.type}),b=e.title.width||e.width.value-e.margin.left-e.margin.right;x.enter().append("g").attr("class",function(e){return"d3plus_title "+e.type}).attr("opacity",0).append("text").attr("stroke","none").call(t),x.each(function(n){var a=d3.select(this).select("text").call(t),o=r(n);s().align(o).container(a).height(e.height.value/2).size(!1).text(n.value).width(b).draw(),n.y=e.margin[n.style.position],e.margin[n.style.position]+=this.getBBox().height+2*n.style.padding}).on(n.over,function(t){t.link&&d3.select(this).transition().duration(e.timing.mouseevents).style("cursor","pointer").select("text").attr("fill",e.links.hover.color).attr("font-family",e.links.hover.family.value).attr("font-weight",e.links.hover.weight).style("text-decoration",e.links.hover.decoration.value).style("text-transform",e.links.hover.transform.value)}).on(n.out,function(r){r.link&&d3.select(this).transition().duration(e.timing.mouseevents).style("cursor","auto").select("text").call(t)}).on(n.click,function(e){if(e.link){var t="/"!=e.link.charAt(0)?"_blank":"_self";window.open(e.link,t)}}).attr("opacity",1).attr("transform",function(t){var n=t.style.position,a="top"==n?0+t.y:e.height.value-t.y;"bottom"==n?a-=this.getBBox().height+t.style.padding:a+=t.style.padding;var o=r(t);if("start"===o)var i=e.margin.left+e.title.padding;else{d3.select(this).select("text").node().getBBox().width;i="middle"===o?e.width.value/2-b/2:e.width.value-b-e.margin.right-e.title.padding}return"translate("+i+","+a+")"}),x.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),e.margin.top>0&&(e.margin.top+=e.title.padding),e.margin.bottom>0&&(e.margin.bottom+=e.title.padding);var w=e.title.height;w&&e.margin[e.title.position]<w&&(e.margin[e.title.position]=w),e.dev.value&&o.timeEnd("drawing titles")}},{"../../../client/pointer.coffee":38,"../../../client/rtl.coffee":40,"../../../core/console/print.coffee":52,"../../../core/fetch/value.coffee":67,"../../../textwrap/textwrap.coffee":200}],249:[function(e,t,r){var n,a;n=e("./labels.coffee"),a=e("./transform.coffee"),t.exports=function(e,t,r){var o,i,s,l,u,c,f,d,p;return t||(t=e.zoom.bounds),"number"!=typeof r&&(r=e.timing.transitions),e.zoom.size={height:t[1][1]-t[0][1],width:t[1][0]-t[0][0]},p=e.types[e.type.value],s=e.coords.fit.value,o="auto"===s||p.requirements.indexOf("coords")<0?d3.max([e.zoom.size.width/e.width.viz,e.zoom.size.height/e.height.viz]):e.zoom.size[s]/e["app_"+s],u=d3.min([e.width.viz,e.height.viz]),c=p.zoom?2*e.coords.padding:0,f=(u-c)/u/o,i=e.zoom.behavior.scaleExtent(),i[0]!==i[1]&&t!==e.zoom.bounds||e.zoom.behavior.scaleExtent([f,16*f]),l=e.zoom.behavior.scaleExtent()[1],f>l&&(f=l),e.zoom.scale=f,d=[e.width.viz/2-e.zoom.size.width*f/2-t[0][0]*f,e.height.viz/2-e.zoom.size.height*f/2-t[0][1]*f],e.zoom.translate=d,e.zoom.behavior.translate(d).scale(f),e.zoom.size={height:e.zoom.bounds[1][1]-e.zoom.bounds[0][1],width:e.zoom.bounds[1][0]-e.zoom.bounds[0][0]},e.zoom.reset=!1,(e.labels.value||e.labels.changed)&&n(e),a(e,r)}},{"./labels.coffee":251,"./transform.coffee":254}],250:[function(e,t,r){t.exports=function(e,t){var r,n,a;return n=t.id.nesting.length-1,r=t.depth.value,a=t.id.nesting[r+1],t.types[t.type.value].nesting===!1?0:(e.d3plus.merged||a in e&&r<n)&&(!e||a in e)?1:!(r===n&&r>0||e&&a&&!(a in e))||!t.small&&t.tooltip.html.value?0:-1}},{}],251:[function(e,t,r){var n;n=e("../../../core/console/print.coffee"),t.exports=function(e){var t,r;if(e.dev.value&&n.time("determining label visibility"),r=e.zoom.behavior.scaleExtent(),t=function(t){return t.attr("opacity",function(t){var n;return t||(t={}),n=parseFloat(d3.select(this).attr("font-size"),10),t.visible=n*(e.zoom.scale/r[1])>=2,t.visible?1:0})},e.draw.timing?e.g.viz.selectAll("text.d3plus_label").transition().duration(e.draw.timing).call(t):e.g.viz.selectAll("text.d3plus_label").call(t),e.dev.value)return n.timeEnd("determining label visibility")}},{"../../../core/console/print.coffee":52}],252:[function(e,t,r){var n,a,o;n=e("./labels.coffee"),a=e("../../../tooltip/remove.coffee"),o=e("./transform.coffee"),t.exports=function(e){var t,r,i,s,l,u,c,f,d,p,h;return r=d3.event.sourceEvent?d3.event.sourceEvent.type:null,l=d3.event.translate,s=d3.event.scale,i=e.zoom.bounds,f=(e.width.viz-e.zoom.size.width*s)/2,c=f>0?f:0,u=f>0?e.width.viz-f:e.width.viz,h=(e.height.viz-e.zoom.size.height*s)/2,p=h>0?h:0,d=h>0?e.height.viz-h:e.height.viz,l[0]+i[0][0]*s>c?l[0]=-i[0][0]*s+c:l[0]+i[1][0]*s<u&&(l[0]=u-i[1][0]*s),l[1]+i[0][1]*s>p?l[1]=-i[0][1]*s+p:l[1]+i[1][1]*s<d&&(l[1]=d-i[1][1]*s),e.zoom.behavior.translate(l).scale(s),e.zoom.translate=l,e.zoom.scale=s,"wheel"===r&&a(e.type.value),(e.labels.value||e.labels.changed)&&("wheel"===r?(t=e.draw.timing?100:250,clearTimeout(e.zoom.wheel),e.zoom.wheel=setTimeout(function(){return n(e)},t)):n(e)),"dblclick"===r?o(e,e.timing.transitions):o(e,0)}},{"../../../tooltip/remove.coffee":203,"./labels.coffee":251,"./transform.coffee":254}],253:[function(e,t,r){t.exports=function(e,t){var r,n,a,o;n=e.zoom,t||(t=d3.event),o=n.scale>n.behavior.scaleExtent()[0],r=e.types[e.type.value].zoom&&n.value&&n.scroll.value,a=t.touches&&t.touches.length>1&&r,a||o||t.stopPropagation()}},{}],254:[function(e,t,r){t.exports=function(e,t){var r;return"number"!=typeof t&&(t=e.timing.transitions),r="translate("+e.zoom.translate+")",r+="scale("+e.zoom.scale+")",t?e.g.viz.transition().duration(t).attr("transform",r):e.g.viz.attr("transform",r)}},{}],255:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Function,Object,String],deprecates:"active_var",mute:n(!0),solo:n(!0),spotlight:{accepted:[Boolean],deprecates:"spotlight",value:!1},value:!1}},{"../../core/methods/filter.coffee":81}],256:[function(e,t,r){t.exports={accepted:[Object],deprecated:"nesting_aggs",objectAccess:!1,value:{}}},{}],257:[function(e,t,r){var n;n=e("../../core/methods/process/data.coffee"),t.exports={accepted:[!1,Array,Object,String],delimiter:{accepted:String,value:"|"},filetype:{accepted:[!1,"json","xml","html","csv","dsv","tsv","txt"],value:!1},keys:{},process:n,value:!1}},{"../../core/methods/process/data.coffee":87}],258:[function(e,t,r){var n,a;n=e("../../core/methods/process/margin.coffee"),a=e("../../core/methods/rendering.coffee"),t.exports={background:{color:"#fafafa",rendering:a(),stroke:{color:"#ccc",width:1}},margin:{accepted:[Number,Object,String],process:function(e){var t;return void 0===e&&(e=this.value),t=e,n(e,this),t},value:10},mirror:{accepted:[Boolean],deprecates:["mirror_axis","mirror_axes"],value:!1},ticks:{accepted:[Boolean],value:!0}}},{"../../core/methods/process/margin.coffee":90,"../../core/methods/rendering.coffee":92}],259:[function(e,t,r){t.exports={accepted:[String],value:"#ffffff"}},{}],260:[function(e,t,r){t.exports={accepted:[Function,String],value:!1}},{}],261:[function(e,t,r){var n,a;n=e("../../core/methods/filter.coffee"),a=e("../../color/scale.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],deprecates:"color_var",domain:{accepted:[!1,Array],value:!1},focus:"#444444",heatmap:["#282F6B","#419391","#AFD5E8","#EACE3F","#B35C1E","#B22200"],missing:"#eeeeee",mute:n(!0),primary:"#d74b03",range:["#B22200","#FFEE8D","#759143"],scale:{accepted:[Array,Function,"d3plus","category10","category20","category20b","category20c"],process:function(e){return e instanceof Array?d3.scale.ordinal().range(e):"d3plus"===e?a:"string"==typeof e?d3.scale[e]():e},value:"d3plus"},solo:n(!0),secondary:"#e5b3bb",value:!1}},{"../../color/scale.coffee":48,"../../core/methods/filter.coffee":81}],262:[function(e,t,r){t.exports={accepted:[Array,Function,String],index:{accepted:[Boolean],value:!0},process:function(e,t){return"string"==typeof e&&(e=[e]),e},value:!1}},{}],263:[function(e,t,r){arguments[4][108][0].apply(r,arguments)},{dup:108}],264:[function(e,t,r){var n;n=e("../../util/d3selection.coffee"),t.exports={accepted:[!1,Array,Object,String],id:"default",process:function(e,t){return e!==!1&&("default"===t.container.id&&t.self.container({id:"d3plus_"+ +new Date}),n(e)?e.append("div"):e instanceof Array?d3.select(e[0][0]).append("div"):(this.selector=e,d3.select(e).append("div")))},value:!1}},{"../../util/d3selection.coffee":208}],265:[function(e,t,r){var n,a;n=e("../../core/methods/filter.coffee"),a=e("../../core/methods/process/data.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],center:[0,0],filetype:{accepted:["json"],value:"json"},fit:{accepted:["auto","height","width"],value:"auto"},key:!1,mute:n(!1),padding:20,process:a,projection:{accepted:["albers","albersUsa","azimuthalEqualArea","azimuthalEquidistant","conicConformal","conicEqualArea","conicEquidistant","equirectangular","gnomonic","mercator","orthographic","stereographic","transverseMercator",Function],value:"mercator"},simplify:{accepted:[Boolean],value:!0},solo:n(!1),threshold:{accepted:[Number],value:.9},value:!1}},{"../../core/methods/filter.coffee":81,"../../core/methods/process/data.coffee":87}],266:[function(e,t,r){var n,a,o;n=e("../../core/fetch/value.coffee"),a=e("../../client/ie.js"),o=e("../../string/strip.js"),t.exports={accepted:[void 0,!0,Array,String],chainable:!1,data:[],process:function(e,t){var r,i,s,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,B,C,q,N,P,I,D,V;if(void 0===t.returned)return[];if(e=e||t.cols.value,e instanceof Array?l=e:"string"==typeof e&&(l=[e]),c=[],D=[],t.title.value?(I=t.title.value,"function"==typeof I&&(I=I(t.self)),I=o(I),O=250,I=I.substr(0,O)):I="D3plus Visualization Data",e===!0)for(l=d3.keys(t.data.keys),c.push(l),C=t.data.value,v=0,y=C.length;v<y;v++){for(f=C[v],P=[],g=0,x=l.length;g<x;g++)i=l[g],V=f[i],"string"===t.data.keys[i]&&(V='"'+V+'"'),P.push(V);c.push(P)}else{for(l||(l=[t.id.value],t.time.value&&l.push(t.time.value),t.size.value&&l.push(t.size.value),t.text.value&&l.push(t.text.value)),m=0,b=l.length;m<b;m++)i=l[m],D.push(t.format.value(i));for(c.push(D),q=t.returned.nodes,M=0,w=q.length;M<w;M++)if(F=q[M],null!=F.values&&F.values instanceof Array)for(N=F.values,E=0,_=N.length;E<_;E++){for(V=N[E],P=[],S=0,k=l.length;S<k;S++)s=l[S],V=n(t,V,s),"string"==typeof V&&(V='"'+V+'"'),P.push(V);c.push(P)}else{for(P=[],T=0,z=l.length;T<z;T++)s=l[T],P.push(n(t,F,s));c.push(P)}}for(u="data:text/csv;charset=utf-8,",h=B=0,A=c.length;B<A;h=++B)i=c[h],d=i.join(","),u+=h<c.length?d+"\n":d;return a?(r=new Blob([u],{type:"text/csv;charset=utf-8;"}),navigator.msSaveBlob(r,I+".csv")):(p=encodeURI(u),j=document.createElement("a"),j.setAttribute("href",p),j.setAttribute("download",I+".csv"),j.click()),this.data=c,l},value:void 0}},{"../../client/ie.js":37,"../../core/fetch/value.coffee":67,"../../string/strip.js":175}],267:[function(e,t,r){var n;n=e("../../core/methods/process/data.coffee"),t.exports={accepted:[!1,Array,Function,String],cache:{},delimiter:{accepted:[String],value:"|"},donut:{size:.35},filetype:{accepted:[!1,"json","xml","html","csv","dsv","tsv","txt"],value:!1},filters:[],keys:{},mute:[],large:400,opacity:.9,padding:{accepted:[Number],value:1},process:function(e,t){return n(e,t,this)},solo:[],stroke:{width:1},value:!1}},{"../../core/methods/process/data.coffee":87}],268:[function(e,t,r){t.exports={accepted:[Function,Number],value:0}},{}],269:[function(e,t,r){t.exports={accepted:[!1,Function,Object],value:!1}},{}],270:[function(e,t,r){arguments[4][112][0].apply(r,arguments)},{dup:112}],271:[function(e,t,r){var n=e("../../core/console/print.coffee"),a=e("../../string/format.js");t.exports={accepted:[void 0,Function],first:!0,frozen:!1,process:function(e,t){if(this.initialized===!1)return this.initialized=!0,e;if(void 0===e&&"function"==typeof this.value&&(e=this.value),t.container.value===!1){var r=t.format.locale.value.dev.setContainer;n.warning(r,"container")}else if(t.container.value.empty()){var r=t.format.locale.value.dev.noContainer,o=t.container.selector||"";n.warning(a(r,'"'+o+'"'),"container")}else t.dev.value&&n.time("total draw time"),t.container.value.call(t.self);if("function"==typeof e&&t.history.chain.length){var i={};t.history.chain.forEach(function(e){ | |
| var t=e.method;delete e.method,i[t]=e}),e(i),t.history.chain=[]}return e},update:!0,value:void 0}},{"../../core/console/print.coffee":52,"../../string/format.js":173}],272:[function(e,t,r){var n=e("../../core/methods/process/data.coffee");t.exports={accepted:[!1,Array,Function,String],arrows:{accepted:[Boolean,Number],direction:{accepted:["source","target"],value:"target"},value:!1},color:"#d0d0d0",connections:function(e,t,r){var n=this;if(!n.value)return[];if(!t)var t="id";var a=n.restricted||n.value,o=[];if(!e)return a;var i=a.filter(function(a){var i=!1;return a[n.source][t]==e?(i=!0,r&&o.push(a[n.target])):a[n.target][t]==e&&(i=!0,r&&o.push(a[n.source])),i});return r?o:i},delimiter:{accepted:[String],value:"|"},filetype:{accepted:[!1,"json","xml","html","csv","dsv","tsv","txt"],value:!1},interpolate:{accepted:["basis","cardinal","linear","monotone","step"],value:"basis"},label:!1,large:100,limit:{accepted:[!1,Function,Number],value:!1},opacity:{accepted:[Function,Number,String],min:{accepted:[Number],value:.25},scale:{accepted:[Function],value:d3.scale.linear()},value:1},process:n,size:{accepted:[!1,Number,String],min:1,scale:.5,value:!1},source:"source",strength:{accepted:[!1,Function,Number,String],value:!1},target:"target",value:!1}},{"../../core/methods/process/data.coffee":87}],273:[function(e,t,r){t.exports={accepted:[Boolean,String],value:!1}},{}],274:[function(e,t,r){t.exports={accepted:[!1,Array,Function,Number,String],deprecates:"highlight",process:function(e){return e===!1?[]:e instanceof Array?e:[e]},tooltip:{accepted:[Boolean],value:!0},value:[]}},{}],275:[function(e,t,r){var n,a,o,i;n=e("../../core/methods/font/align.coffee"),a=e("../../core/methods/font/decoration.coffee"),o=e("../../core/methods/font/family.coffee"),i=e("../../core/methods/font/transform.coffee"),t.exports={align:n(),color:"#444444",decoration:a(),family:o(),secondary:{align:n(),color:"#444444",decoration:a(),family:o(),size:12,spacing:0,transform:i(),weight:200},size:12,spacing:0,transform:i(),weight:200}},{"../../core/methods/font/align.coffee":82,"../../core/methods/font/decoration.coffee":83,"../../core/methods/font/family.coffee":84,"../../core/methods/font/transform.coffee":86}],276:[function(e,t,r){var n,a,o;a=e("../../core/methods/font/family.coffee"),n=e("../../core/methods/font/decoration.coffee"),o=e("../../core/methods/font/transform.coffee"),t.exports={accepted:[!1,Number,String],font:{align:"center",color:"#444",decoration:n(),family:a(),size:11,transform:o(),weight:200},link:!1,padding:0,position:"bottom",value:!1}},{"../../core/methods/font/decoration.coffee":83,"../../core/methods/font/family.coffee":84,"../../core/methods/font/transform.coffee":86}],277:[function(e,t,r){var n,a,o,i;n=e("../../number/format.coffee"),a=e("../../core/locale/locale.coffee"),o=e("../../object/merge.coffee"),i=e("../../string/title.coffee"),t.exports={accepted:[Function,String],affixes:{accepted:[Object],objectAccess:!1,value:{}},deprecates:["number_format","text_format"],locale:{accepted:function(){return d3.keys(a)},process:function(e){var t,r;return t="en_US",r=a[t],e!==t&&(r=o(r,a[e])),this.language=e,r},value:"en_US"},number:{accepted:[!1,Function],value:!1},process:function(e,t){if("string"==typeof e)t.self.format({locale:e});else if("function"==typeof e)return e;return this.value},text:{accepted:[!1,Function],value:!1},value:function(e,t){var r,a,o;return t||(t={}),t.locale||(t.locale=this.locale.value),o=t.vars||{},o.time&&o.time.value&&t.key===o.time.value?(a=e.constructor===Date?e:new Date(e),o.data.time.format(a)):"number"==typeof e?(r=this.number.value||n)(e,t):"string"==typeof e?(r=this.text.value||i)(e,t):JSON.stringify(e)}}},{"../../core/locale/locale.coffee":79,"../../number/format.coffee":170,"../../object/merge.coffee":171,"../../string/title.coffee":176}],278:[function(e,t,r){t.exports={accepted:[!1,Number],max:600,secondary:!1,small:200,value:!1}},{}],279:[function(e,t,r){var n,a,o,i,s,l,u,c;n=e("../../../core/methods/font/align.coffee"),a=e("../../../core/methods/font/decoration.coffee"),o=e("../../../core/methods/font/family.coffee"),i=e("../../../core/methods/filter.coffee"),l=e("../../../core/methods/font/position.coffee"),u=e("../../../core/methods/rendering.coffee"),c=e("../../../core/methods/font/transform.coffee"),s={x:"bottom",x2:"top",y:"left",y2:"right"},t.exports=function(e){return{accepted:[Array,Boolean,Function,Object,String],affixes:{accepted:[Boolean],separator:{accepted:[Boolean,Array],value:!0},value:!1},axis:{accepted:[Boolean],color:"#444",font:{color:!1,decoration:a(!1),family:o(""),size:!1,spacing:0,transform:c(!1),weight:!1},rendering:u(),value:!0},dataFilter:!0,deprecates:[e+"axis",e+"axis_val",e+"axis_var"],domain:{accepted:[!1,Array],value:!1},grid:{accepted:[Boolean],color:"#ccc",rendering:u(),value:!0},label:{accepted:[Boolean,String],fetch:function(t){return this.value===!0?t.format.value(t[e].value,{key:e,vars:t}):this.value},font:{color:"#444",decoration:a(),family:o(),size:12,spacing:0,transform:c(),weight:200},padding:3,value:!0},lines:{accept:[!1,Array,Number,Object],dasharray:{accepted:[Array,String],process:function(e){return e instanceof Array&&(e=e.filter(function(e){return!isNaN(e)}),e=e.length?e.join(", "):"none"),e},value:"10, 10"},color:"#888",font:{align:n("right"),color:"#444",background:{accepted:[Boolean],value:!0},decoration:a(),family:o(),padding:{accepted:[Number],value:10},position:l("middle"),size:12,transform:c(),weight:200},process:Array,rendering:u(),width:1,value:[]},mouse:{accept:[Boolean],dasharray:{accepted:[Array,String],process:function(e){return e instanceof Array&&(e=e.filter(function(e){return!isNaN(e)}),e=e.length?e.join(", "):"none"),e},value:"none"},rendering:u(),width:2,value:!0},mute:i(!0),orient:{accepted:["top","right","bottom","left"],value:s[e]},padding:{accepted:[Number],value:.1},persist:{position:{accepted:[Boolean],value:!1},size:{accepted:[Boolean],value:!0}},range:{accepted:[!1,Array],value:!1},scale:{accepted:["linear","log","discrete","share"],deprecates:["layout","unique_axis",e+"axis_scale"],process:function(t,r){var n,a,o,i;for(o=["log","discrete","share"],n=0,a=o.length;n<a;n++)i=o[n],i===t?r.axes[i]=e:r.axes[i]===e&&(r.axes[i]=!1);return"discrete"===t&&(r.axes.opposite=0===e.indexOf("x")?"y":"x"),t},value:"linear"},solo:i(!0),stacked:{accepted:[Boolean],process:function(t,r){return t||r.axes.stacked!==e?t&&(r.axes.stacked=e):r.axes.stacked=!1,t},value:!1},ticks:{accepted:[!1,Array],color:"#ccc",font:{color:"#666",decoration:a(),family:o(),size:10,spacing:0,transform:c(),weight:200},labels:{accepted:[Boolean,Array],value:!0},rendering:u(),size:10,width:1,value:!1},value:!1,zerofill:{accepted:[Boolean],value:!1}}}},{"../../../core/methods/filter.coffee":81,"../../../core/methods/font/align.coffee":82,"../../../core/methods/font/decoration.coffee":83,"../../../core/methods/font/family.coffee":84,"../../../core/methods/font/position.coffee":85,"../../../core/methods/font/transform.coffee":86,"../../../core/methods/rendering.coffee":92}],280:[function(e,t,r){t.exports={accepted:[Boolean],back:function(){if(this.states.length)return this.states.pop()()},chain:[],reset:function(){var e;for(e=[];this.states.length;)e.push(this.states.pop()());return e},states:[],value:!0}},{}],281:[function(e,t,r){var n;n=e("../../core/methods/process/icon.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],back:{accepted:[!1,String],fallback:"❮",opacity:1,process:n,rotate:0,value:"fa-angle-left"},deprecates:"icon_var",style:{accepted:[Object,String],deprecates:"icon_style",value:"default"},value:!1}},{"../../core/methods/process/icon.coffee":89}],282:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[Array,String],dataFilter:!0,deprecates:["id_var","nesting"],grouping:{accepted:[Boolean],value:!0},mute:n(!0),nesting:["id"],solo:n(!0),value:"id"}},{"../../core/methods/filter.coffee":81}],283:[function(e,t,r){var n,a,o;n=e("../../core/methods/font/decoration.coffee"),a=e("../../core/methods/font/family.coffee"),o=e("../../core/methods/font/transform.coffee"),t.exports={accepted:[Boolean],align:{accepted:["start","middle","end","left","center","right"],process:function(e){var t;return t=["left","center","right"].indexOf(e),t>=0&&(e=this.accepted[t]),e},value:"middle"},color:{accepted:[!1,String],value:!1},font:{decoration:n(),family:a(),size:11,transform:o(),weight:200},padding:7,resize:{accepted:[Boolean],value:!0},text:{accepted:[!1,Function,String],value:!1},segments:2,valign:{accepted:[!1,"top","middle","bottom"],value:"middle"},value:!0}},{"../../core/methods/font/decoration.coffee":83,"../../core/methods/font/family.coffee":84,"../../core/methods/font/transform.coffee":86}],284:[function(e,t,r){var n;n=e("../../core/methods/font/family.coffee"),t.exports={accepted:[Boolean],align:"middle",data:{accepted:[Boolean],value:!0},filters:{accepted:[Boolean],value:!1},font:{align:"middle",color:"#444444",family:n(),size:[8,14],weight:200},gradient:{height:10},icons:{accepted:[Boolean],value:!0},labels:{accepted:[Boolean],value:!0},order:{accepted:["color","id","size","text",Function],sort:{accepted:["asc","desc"],value:"asc"},value:"color"},size:[8,30],tooltip:{accepted:[Boolean],value:!0},text:{accepted:[!1,Function,String],value:!1},title:{accepted:[!1,Function,String],value:!1},value:!0}},{"../../core/methods/font/family.coffee":84}],285:[function(e,t,r){var n,a,o;n=e("../../core/methods/font/decoration.coffee"),a=e("../../core/methods/font/family.coffee"),o=e("../../core/methods/font/transform.coffee"),t.exports={font:{color:"#444444",decoration:n(),family:a(),transform:o(),weight:200},hover:{color:"#444444",decoration:n(),family:a(),transform:o(),weight:200}}},{"../../core/methods/font/decoration.coffee":83,"../../core/methods/font/family.coffee":84,"../../core/methods/font/transform.coffee":86}],286:[function(e,t,r){arguments[4][123][0].apply(r,arguments)},{"../../core/methods/process/margin.coffee":90,dup:123}],287:[function(e,t,r){var n,a,o;n=e("../../core/methods/font/decoration.coffee"),a=e("../../core/methods/font/family.coffee"),o=e("../../core/methods/font/transform.coffee"),t.exports={accepted:[Boolean,String],background:{accepted:[!1,String],value:!1},branding:{accepted:[Boolean],image:{dark:"http://d3plus.org/assets/img/icon-transparent-invert.png",light:"http://d3plus.org/assets/img/icon-transparent.png"},value:!1},font:{color:"#444",decoration:n(),family:a(),size:16,transform:o(),weight:200},padding:5,style:{accepted:[!1,"small","large"],value:!1},value:!0}},{"../../core/methods/font/decoration.coffee":83,"../../core/methods/font/family.coffee":84,"../../core/methods/font/transform.coffee":86}],288:[function(e,t,r){t.exports={accepted:[Boolean],click:{accepted:[Boolean,Function],value:!0},move:{accepted:[Boolean,Function],value:!0},out:{accepted:[Boolean,Function],value:!0},over:{accepted:[Boolean,Function],value:!0},value:!0}},{}],289:[function(e,t,r){var n;n=e("../../core/methods/process/data.coffee"),t.exports={accepted:[!1,Array,Function,String],delimiter:{accepted:[String],value:"|"},filetype:{accepted:[!1,"json","xml","html","csv","dsv","tsv","txt"],value:!1},overlap:.6,process:n,value:!1}},{"../../core/methods/process/data.coffee":87}],290:[function(e,t,r){t.exports={accepted:[Boolean,Function,String],agg:{accepted:[!1,Function,"sum","min","max","mean","median"],value:!1},deprecates:["sort"],sort:{accepted:["asc","desc"],value:"desc"},value:!1}},{}],291:[function(e,t,r){t.exports={accepted:[Boolean],value:!1,timeout:400,process:function(e,t){var r,n;return!!e&&(r=null,n=function(){var e,r,n;if(r=t.container.value.node().parentNode.getBoundingClientRect(),n=r.width,e=r.height,t.self.width(n),t.self.height(e),t.width.changed||t.height.changed)return t.self.draw()},d3.select(window).on("resize."+t.container.id,function(e){return function(t){return clearTimeout(r),r=setTimeout(n,e.timeout)}}(this)),e)}}},{}],292:[function(e,t,r){var n;n=e("../../core/methods/rendering.coffee"),t.exports={accepted:function(e){var t;return t=e.types[e.type.value].shapes,!t||t instanceof Array||(t=[t]),t.length?t:["square"]},interpolate:{accepted:["basis","basis-open","cardinal","cardinal-open","linear","monotone","step","step-before","step-after"],deprecates:"stack_type",value:"linear"},rendering:n(),value:!1}},{"../../core/methods/rendering.coffee":92}],293:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Function,Number,Object,String],dataFilter:!0,deprecates:["value","value_var"],mute:n(!0),scale:{accepted:[Function],deprecates:"size_scale",domain:{min:{accepted:[!1,Number],value:!1},max:{accepted:[!1,Number],value:!1}},range:{max:{accepted:[Function,Number],value:function(e){return Math.floor(d3.max([d3.min([e.width.viz,e.height.viz])/15,6]))}},min:{accepted:[Function,Number],value:3}},value:d3.scale.sqrt()},solo:n(!0),threshold:{accepted:[Boolean,Function,Number],value:!1},value:!1}},{"../../core/methods/filter.coffee":81}],294:[function(e,t,r){t.exports={value:!1}},{}],295:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Function,Object,String],deprecates:["else_var","else"],mute:n(!0),solo:n(!0),value:!1}},{"../../core/methods/filter.coffee":81}],296:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[Array,Boolean,Function,Object,String],deprecates:["name_array","text_var"],nesting:!0,mute:n(!0),solo:n(!0),value:!1}},{"../../core/methods/filter.coffee":81}],297:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[Array,Boolean,Function,Object,String],dataFilter:!0,deprecates:["year","year_var"],fixed:{accepted:[Boolean],deprecates:["static_axis","static_axes"],value:!0},format:{accepted:[!1,Array,Function,String],value:!1},mute:n(!1),solo:n(!1),value:!1}},{"../../core/methods/filter.coffee":81}],298:[function(e,t,r){t.exports={accepted:[Boolean],align:"middle",hover:{accepted:["all-scroll","col-resize","crosshair","default","grab","grabbing","move","pointer"],value:"pointer"},handles:{accepted:[Boolean],color:"#666",opacity:1,size:3,stroke:"#666",value:!0},height:{accepted:[!1,Number],value:!1},play:{accepted:[Boolean],icon:{accepted:[!1,String],awesome:"",fallback:"►"},pause:{accepted:[!1,String],awesome:"",fallback:"❚❚"},timing:{accepted:[Number],value:1500},value:!0},value:!0}},{}],299:[function(e,t,r){t.exports={mouseevents:60,transitions:600,ui:200}},{}],300:[function(e,t,r){var n,a,o,i;n=e("../../core/methods/font/decoration.coffee"),a=e("../../core/methods/font/family.coffee"),i=e("../../core/methods/font/transform.coffee"),o=e("../../string/strip.js"),t.exports={accepted:[!1,Function,String],font:{align:"center",color:"#444444",decoration:n(),family:a(),size:16,transform:i(),weight:400},height:!1,link:!1,padding:2,position:"top",process:function(e,t){var r;return 0===t.container.id.indexOf("default")&&e&&(r=o(e).toLowerCase(),t.self.container({id:r})),e},sub:{accepted:[!1,Function,String],deprecates:"sub_title",font:{align:"center",color:"#444444",decoration:n(),family:a(),size:12,transform:i(),weight:200},link:!1,padding:1,position:"top",value:!1},total:{accepted:[Boolean,Object],deprecates:"total_bar",font:{align:"center",color:"#444444",decoration:n(),family:a(),size:12,transform:i(),weight:200,value:!1},link:!1,padding:1,position:"top",value:!1},width:!1,value:!1}},{"../../core/methods/font/decoration.coffee":83,"../../core/methods/font/family.coffee":84,"../../core/methods/font/transform.coffee":86,"../../string/strip.js":175}],301:[function(e,t,r){var n,a;n=e("../../core/methods/font/family.coffee"),a=e("../../core/methods/font/transform.coffee"),t.exports={accepted:[Boolean,Array,Function,Object,String],anchor:"top center",background:"#ffffff",children:{accepted:[Boolean,Number],value:!0},connections:{accepted:[Boolean],value:!0},curtain:{color:"#ffffff",opacity:.8},deprecates:"tooltip_info",extent:{accepted:[Boolean],value:!0},font:{color:"#444",family:n(),size:12,transform:a(),weight:200},fullscreen:{accepted:[Boolean],value:!1},html:{accepted:[!1,Function,Object,String],deprecates:"click_function",value:!1},iqr:{accepted:[Boolean],value:!0},large:250,share:{accepted:[Boolean],value:!0},size:{accepted:[Boolean],value:!0},small:225,stacked:{accepted:[Boolean],value:!1},sub:{accepted:[!1,Function,String],value:!1},value:!0}},{"../../core/methods/font/family.coffee":84,"../../core/methods/font/transform.coffee":86}],302:[function(e,t,r){var n;n=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Function,Object,String],deprecates:["total_var"],mute:n(!0),solo:n(!0),value:!1}},{"../../core/methods/filter.coffee":81}],303:[function(e,t,r){t.exports={accepted:function(e){return d3.keys(e.types)},mode:{accepted:function(e){return e.types[e.type.value].modes||[!1]},value:!1},value:"tree_map"}},{}],304:[function(e,t,r){var n,a,o,i;o=e("../../core/methods/font/family.coffee"),n=e("../../core/methods/font/align.coffee"),a=e("../../core/methods/font/decoration.coffee"),i=e("../../core/methods/font/transform.coffee"),t.exports={accepted:[Array,Boolean],align:n("center"),border:1,color:{primary:{process:function(e,t){var r;return r=this.value,t.ui.color.secondary.value||(t.ui.color.secondary.value=d3.rgb(r).darker(.75).toString()),e},value:"#ffffff"},secondary:{value:!1}},display:{acceped:["block","inline-block"],value:"inline-block"},font:{align:"center",color:"#444",decoration:a(),family:o(),size:11,transform:i(),weight:200},margin:5,padding:5,position:{accepted:["top","right","bottom","left"],value:"bottom"},value:!1}},{"../../core/methods/font/align.coffee":82,"../../core/methods/font/decoration.coffee":83,"../../core/methods/font/family.coffee":84,"../../core/methods/font/transform.coffee":86}],305:[function(e,t,r){t.exports={accepted:[!1,Number],secondary:!1,small:200,value:!1}},{}],306:[function(e,t,r){t.exports={accepted:[Boolean],behavior:d3.behavior.zoom().scaleExtent([1,1]).duration(0),click:{accepted:[Boolean],value:!0},pan:{accepted:[Boolean],value:!0},scroll:{accepted:[Boolean],deprecates:"scroll_zoom",value:!0},value:!0}},{}],307:[function(e,t,r){var n,a,o,i,s,l,u,c;a=e("../../util/closest.coffee"),o=e("../../core/fetch/value.coffee"),i=e("./helpers/graph/draw.coffee"),s=e("./helpers/graph/nest.coffee"),l=e("../../array/sort.coffee"),u=e("./helpers/graph/stack.coffee"),c=e("../../core/data/threshold.js"),n=function(e){var t,r,n,a,s,c,f,d,p,h,v;if(i(e,{buffer:e.axes.opposite,zero:!0}),a=e.x.domain.viz.concat(e.y.domain.viz),a.indexOf(void 0)>=0)return[];for(r=l(e.data.viz,null,null,null,e),n=e[e.axes.discrete],p=e[e.axes.opposite],s=0,f=r.length;s<f;s++)for(h=r[s],h.d3plus||(h.d3plus={}),v=h.values,c=0,d=v.length;c<d;c++)t=v[c],t.d3plus||(t.d3plus={}),t.d3plus.x=n.scale.viz(o(e,t,n.value)),t.d3plus.x+=e.axes.margin.viz.left,t.d3plus.y=p.scale.viz(o(e,t,p.value)),t.d3plus.y+=e.axes.margin.viz.top,t.d3plus.merged instanceof Array&&(h.d3plus.merged||(h.d3plus.merged=[]),h.d3plus.merged=h.d3plus.merged.concat(t.d3plus.merged)),t.d3plus.text&&!h.d3plus.text&&(h.d3plus.text=t.d3plus.text);return u(e,r)},n.filter=function(e,t){return s(e,c(e,t,e[e.axes.discrete].value))},n.requirements=["data","x","y"],n.setup=function(e){var t,r,n;return e.axes.discrete||(t=e.time.value===e.y.value?"y":"x",e.self[t]({scale:"discrete"})),e[e.axes.discrete].zerofill.value||e.self[e.axes.discrete]({zerofill:!0}),e[e.axes.opposite].stacked.value||"stacked"!==e.type.value||e.self[e.axes.opposite]({stacked:!0}),n=e[e.axes.opposite],r=e.size,!n.value&&r.value||r.changed&&r.previous===n.value?e.self[e.axes.opposite](r.value):!r.value&&n.value||n.changed&&n.previous===r.value?e.self.size(n.value):void 0},n.shapes=["area"],n.threshold=function(e){return 20/e.height.viz},n.tooltip="static",t.exports=n},{"../../array/sort.coffee":34,"../../core/data/threshold.js":61,"../../core/fetch/value.coffee":67,"../../util/closest.coffee":206,"./helpers/graph/draw.coffee":314,"./helpers/graph/nest.coffee":320,"./helpers/graph/stack.coffee":321}],308:[function(e,t,r){var n,a,o,i,s,l,u,c=[].indexOf||function(e){for(var t=0,r=this.length;t<r;t++)if(t in this&&this[t]===e)return t;return-1};a=e("../../util/buckets.coffee"),o=e("../../core/fetch/value.coffee"),i=e("./helpers/graph/draw.coffee"),s=e("./helpers/graph/nest.coffee"),l=e("./helpers/graph/stack.coffee"),u=e("../../util/uniques.coffee"),n=function(e){var t,r,n,s,f,d,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,B,C,q,N,P,I,D,V,R,U,L,Y,H,X;if(d=e.axes.discrete,g="x"===d?"height":"width",Y="x"===d?"width":"height",N=e.axes.opposite,n="x"===d?"left":"top",S="x"===d?"top":"left",i(e,{buffer:!0,zero:N}),v=e.x.domain.viz.concat(e.y.domain.viz),v.indexOf(void 0)>=0)return[];if(E=e.data.viz,e.axes.stacked)for(x=0,_=E.length;x<_;x++)D=E[x],l(e,D.values);for(U=e.axes[Y]/e[e.axes.discrete].ticks.values.length,I=e[e.axes.discrete].padding.value,I<1&&(I*=U),2*I>U&&(I=.1*U),M=U-2*I,e.axes.stacked||(e[d].persist.position.value?(V=e[d].value,h=c.call(e.id.nesting,V)>=0?d3.max(E,function(e){return e.values.length}):u(E,e.id.value,o,e).length,M/=h,T=U/2-M/2-I,H=d3.scale.ordinal(),1===h?H.domain([0]).range([0]):H.domain([0,h-1]).range([-T,T])):H=d3.scale.linear()),f=[],C=e[N],B=C.scale.viz.domain().slice(),0===N.indexOf("y")&&(B=B.reverse()),B[0]<=0&&B[1]>=0?X=0:B[0]<0?X(d3.max(B)):X=d3.min(B),e[d].persist.position.value&&!e.axes.stacked&&(y=u(d3.merge(E.map(function(e){return e.values})),e.id.value,o,e,e.id.value,!1),H.domain(y),1===y.length?H.range([0]):H.range(a(H.range(),y.length))),j=d3.max(E,function(e){return e.values.length}),b=0,k=E.length;b<k;b++)for(P=E[b],e.axes.stacked?(t=1,F=M):e[d].persist.position.value?(t=h,F=M):(t=P.values.length,e[d].persist.size.value?(F=M/j,T=U/2-(j-t)*(F/2)-F/2-I):(F=M/t,T=U/2-F/2-I),H.domain([0,t-1]),H.range([-T,T])),R=P.values,m=w=0,z=R.length;w<z;m=++w){if(s=R[m],O=e.axes.stacked?0:H(e[d].persist.position.value?o(e,s,e.id.value):m%t),e.axes.stacked)L=s.d3plus[N],r=s.d3plus[N+"0"];else{if(q=o(e,s,C.value),null===q&&(C=e[N+"2"],q=o(e,s,C.value)),0===q)continue;"log"===C.scale.value&&(X=q<0?-1:1),L=C.scale.viz(q),r=C.scale.viz(X)}p=o(e,s,e[d].value),s.d3plus[d]=e[d].scale.viz(p),s.d3plus[d]+=e.axes.margin.viz[n]+O,A=r-L,s.d3plus[N]=r-A/2,e.axes.stacked||(s.d3plus[N]+=e.axes.margin.viz[S]),delete s.d3plus.r,s.d3plus[Y]=F,s.d3plus[g]=Math.abs(A),s.d3plus.init={},s.d3plus.init[N]=C.scale.viz(X),s.d3plus.init[N]-=s.d3plus[N],s.d3plus.init[N]+=e.axes.margin.viz[S],s.d3plus.init[Y]=s.d3plus[Y],e.text.value?delete s.d3plus.label:s.d3plus.label=!1,f.push(s)}return f},n.filter=function(e,t){return s(e,t,e[e.axes.discrete].value)},n.requirements=["data","x","y"],n.setup=function(e){var t,r,n;return e.axes.discrete||(t=e.time.value===e.y.value?"y":"x",e.self[t]({scale:"discrete"})),n=e[e.axes.opposite],r=e.size,!n.value&&r.value||r.changed&&r.previous===n.value?e.self[e.axes.opposite](r.value):!r.value&&n.value||n.changed&&n.previous===r.value?e.self.size(n.value):void 0},n.shapes=["square"],t.exports=n},{"../../core/fetch/value.coffee":67,"../../util/buckets.coffee":204,"../../util/uniques.coffee":210,"./helpers/graph/draw.coffee":314,"./helpers/graph/nest.coffee":320,"./helpers/graph/stack.coffee":321}],309:[function(e,t,r){var n,a,o,i,s,l;a=e("../../core/fetch/value.coffee"),o=e("./helpers/graph/draw.coffee"),i=e("../../string/format.js"),s=e("../../string/strip.js"),l=e("../../util/uniques.coffee"),n=function(e){var t,r,n,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O;return o(e,{buffer:!0}),u=e.x.domain.viz.concat(e.y.domain.viz),u.indexOf(void 0)>=0?[]:(n=e.axes.discrete,b=e.axes.opposite,r="x"===n?e.axes.margin.viz.left:e.axes.margin.viz.top,x="x"===b?e.axes.margin.viz.left:e.axes.margin.viz.top,c="x"===n?"height":"width",O="x"===n?"width":"height",j=e.axes[O]/e[n].ticks.values.length,A=e.size.value,A="number"==typeof A?A:100,j=d3.min([j-2*e.labels.padding,A]),m=e.type.mode.value,m instanceof Array||(m=[m,m]),v=function(t){var r,n,o;n={};for(r in e.data.keys)o=l(t,r,a,e),n[r]=1===o.length?o[0]:o;return n},y=!1,p=[],f=e.format.value(e.format.locale.value.ui.iqr),d=e.format.value(e.format.locale.value.ui.max),g=e.format.value(e.format.locale.value.ui.min),w=e.format.value(e.format.locale.value.ui.percentile),t=e.format.value(e.format.locale.value.ui.tukey_bottom),M=e.format.value(e.format.locale.value.ui.tukey_top),_=e.format.value(e.format.locale.value.ui.quartile_first),k=e.format.value(e.format.locale.value.ui.quartile_third),h=e.format.value(e.format.locale.value.ui.median),z=[],d3.nest().key(function(t){return a(e,t,e[n].value)}).rollup(function(o){var u,A,E,F,S,T,B,C,q,N,P,I,D,V,R,U,L,Y,H,X,G,J,W,Q,K,Z,$,ee,te,re,ne,ae;for(J=e[b].scale.viz,re=o.map(function(t){return a(e,t,e[b].value)}),re.sort(function(e,t){return e-t}),ee=l(re),C=d3.quantile(re,.25),U=d3.quantile(re,.5),W=d3.quantile(re,.75),Q={},"tukey"===m[1]?(N=C-W,K=W-1.5*N,Z=M):"extent"===m[1]?(K=d3.max(re),Z=d):"number"==typeof m[1]&&(K=d3.quantile(re,(100-m[1])/100),Z=i(w,m[1])),K=d3.min([d3.max(re),K]),e.tooltip.extent.value&&(Q[Z]={key:e[b].value,value:K}),e.tooltip.iqr.value&&(Q[k]={key:e[b].value,value:W},Q[h]={key:e[b].value,value:U},Q[_]={key:e[b].value,value:C}),"tukey"===m[0]?(N=C-W,u=C+1.5*N,A=t):"extent"===m[0]?(u=d3.min(re),A=g):"number"==typeof m[0]&&(u=d3.quantile(re,m[0]/100),Z=i(w,m[0])),u=d3.max([d3.min(re),u]),e.tooltip.extent.value&&(Q[A]={key:e[b].value,value:u}),F=[],E=[],$=[],G=[],q=0,V=o.length;q<V;q++)S=o[q],te=a(e,S,e[b].value),te>=C&&te<=W?F.push(S):te>=u&&te<C?E.push(S):te<=K&&te>W?$.push(S):G.push(S);for(I=a(e,o[0],e[n].value),ne=e[n].scale.viz(I),ne+=r,D=e.format.value(I,{key:e[n].value,vars:e}),I.constructor===Date&&(I=I.getTime()),I=s(I),F=v(F),F.d3plus={color:"white",id:"box_"+I,init:{},label:!1,shape:"square",stroke:"#444",text:i(f,D)},F.d3plus[O]=j,F.d3plus.init[O]=j,F.d3plus[c]=Math.abs(J(C)-J(W)),F.d3plus[n]=ne,ae=d3.min([J(C),J(W)])+F.d3plus[c]/2,ae+=x,F.d3plus[b]=ae,F.d3plus.tooltip=Q,z.push(F),Y={d3plus:{id:"median_line_"+I,position:"height"===c?"top":"right",shape:"whisker",static:!0}},X=e.format.value(U,{key:e[b].value,vars:e}),D={background:"#fff",names:[X],padding:0,resize:!1,x:0,y:0},T=Math.abs(J(U)-J(C)),B=Math.abs(J(U)-J(W)),H=2*d3.min([T,B]),L=2*e.data.stroke.width+2*e.labels.padding,D["width"===O?"w":"h"]=j-L,D["width"===c?"w":"h"]=H-L,Y.d3plus.label=D,Y.d3plus[O]=j,Y.d3plus[n]=ne,Y.d3plus[b]=J(U)+x,z.push(Y),E=v(E),E.d3plus={id:"bottom_whisker_line_"+I,offset:F.d3plus[c]/2,position:"height"===c?"bottom":"left",shape:"whisker",static:!0},"x"===b&&(E.d3plus.offset*=-1),E.d3plus[c]=Math.abs(J(u)-J(C)),E.d3plus[O]=j,E.d3plus[n]=ne,E.d3plus[b]=ae,z.push(E),$=v($),$.d3plus={id:"top_whisker_line_"+I,offset:F.d3plus[c]/2,position:"height"===c?"top":"right",shape:"whisker",static:!0},"y"===b&&($.d3plus.offset*=-1),$.d3plus[c]=Math.abs(J(K)-J(W)),$.d3plus[O]=j,$.d3plus[n]=ne,$.d3plus[b]=ae,z.push($),P=0,R=G.length;P<R;P++)S=G[P],S.d3plus[n]=ne,S.d3plus[b]=J(a(e,S,e.y.value)),S.d3plus[b]+=x,S.d3plus.r=4,S.d3plus.shape=e.shape.value;return y=!G.length&&K-u===0,p.push(U),z=z.concat(G),o}).entries(e.data.viz),y&&1===l(p).length?[]:z)},n.modes=["tukey","extent",Array,Number],n.requirements=["data","x","y"],n.shapes=["circle","check","cross","diamond","square","triangle","triangle_up","triangle_down"],n.setup=function(e){var t;if(!e.axes.discrete)return t=e.time.value===e.y.value?"y":"x",e.self[t]({scale:"discrete"})},t.exports=n},{"../../core/fetch/value.coffee":67,"../../string/format.js":173,"../../string/strip.js":175,"../../util/uniques.coffee":210,"./helpers/graph/draw.coffee":314}],310:[function(e,t,r){var n,a,o,i,s,l,u;n=e("../../array/sort.coffee"),s=e("../../core/fetch/value.coffee"),o=e("../../core/fetch/color.coffee"),i=e("../../core/fetch/text.js"),u=e("../../color/legible.coffee"),l=e("../../core/data/group.coffee"),a=function(e){var t,r,a,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,B,C,q,N,P,I,D,V,R,U,L;if(m=l(e,e.data.viz),m=n(m,null,null,null,e),d=m.length,d<4?(a=d,F=1):(S=e.width.viz/e.height.viz,a=Math.ceil(Math.sqrt(d*S)),F=Math.ceil(Math.sqrt(d/S))),d>0)for(;(F-1)*a>=d;)F--;for(r=e.width.viz/a,t=e.height.viz/F,e.size.value?(I=e.size.scale.domain.min.value,P=e.size.scale.domain.max.value,v="number"==typeof I?I:d3.min(e.data.viz,function(t){return s(e,t,e.size.value,e.id.value,"min")}),h="number"==typeof P?P:d3.max(e.data.viz,function(t){return s(e,t,e.size.value,e.id.value)}),p=[v,h]):p=[0,0],O=5,B=d3.min([r,t])/2-2*O,_=e.labels.value&&!e.small&&B>=40?d3.max([20,d3.min([.25*B,50])]):0,B-=_,C=d3.min([B,e.size.scale.range.min.value]),T=e.size.scale.value.domain(p).rangeRound([C,B]),M=d3.layout.pack().children(function(e){return e.values}).padding(O).radius(function(e){return T(e)}).size([r-2*O,t-2*O-_]).value(function(e){return e.value}),f=[],E=0,y=x=0,k=m.length;x<k;y=++x){for(c=m[y],N=M.nodes(c),V=r*y%e.width.viz,L=t*E,b=0,z=N.length;b<z;b++)q=N[b],q.children?(j={d3plus:{}},j[e.id.value]=q.key):j=q.d3plus,j.d3plus.depth=e.id.grouping.value?q.depth:e.depth.value,j.d3plus.x=q.x,j.d3plus.xOffset=V,j.d3plus.y=q.y,j.d3plus.yOffset=L+_,j.d3plus.r=q.r,f.push(j);(y+1)%a===0&&E++}for(g=B/d3.max(f,function(e){return e.d3plus.r}),D=M.size()[0]/2,U=M.size()[1]/2,w=0,A=f.length;w<A;w++)c=f[w],c.d3plus.x=(c.d3plus.x-D)*g+D+c.d3plus.xOffset,c.d3plus.y=(c.d3plus.y-U)*g+U+c.d3plus.yOffset,c.d3plus.r=c.d3plus.r*g,delete c.d3plus.xOffset,delete c.d3plus.yOffset,c.d3plus.static=c.d3plus.depth<e.depth.value&&e.id.grouping.value,!_||0!==c.d3plus.depth&&e.id.grouping.value!==!1?delete c.d3plus.label:(c.d3plus.text=i(e,c[e.id.value],c.d3plus.depth),R=_>3*e.labels.padding?e.labels.padding:0,c.d3plus.label={x:0,y:-(B+R+_/2),w:2*B,h:_-R,padding:0,resize:!0,color:u(o(e,c,c.d3plus.depth)),force:!0});return f.sort(function(e,t){return e.d3plus.depth-t.d3plus.depth})},a.fill=!0,a.requirements=["data"],a.scale=1.05,a.shapes=["circle","donut"],t.exports=a},{"../../array/sort.coffee":34,"../../color/legible.coffee":44,"../../core/data/group.coffee":57,"../../core/fetch/color.coffee":63,"../../core/fetch/text.js":66,"../../core/fetch/value.coffee":67}],311:[function(e,t,r){var n,a;a=e("../../../core/console/print.coffee"),n=function(e){var t,r;r={circle:"scatter",donut:"scatter",line:"line",square:"scatter",area:"stacked"},t=r[e.shape.value],a.warning('The "chart" visualization type has been deprecated and will be removed in version 2.0. Please use the "'+t+'" visualization type.'),e.self.type(t).draw()},n.shapes=["circle","donut","line","square","area"],t.exports=n},{"../../../core/console/print.coffee":52}],312:[function(e,t,r){var n;n=function(e){var t,r,n,a,o,i;return t=e.coords.value,n=e.coords.key||d3.keys(t.objects)[0],i=topojson.feature(t,t.objects[n]),r=i.features,o=e.coords.solo.value,a=e.coords.mute.value,r=r.filter(function(t){return t[e.id.value]=t.id,o.length?o.indexOf(t.id)>=0:!a.length||a.indexOf(t.id)<0})},n.libs=["topojson"],n.nesting=!1,n.requirements=["coords"],n.scale=1,n.shapes=["coordinates"],n.zoom=!0,t.exports=n},{}],313:[function(e,t,r){var n,a,o;n=e("../../../../core/fetch/color.coffee"),a=e("../../../../color/legible.coffee"),o=e("../../../../core/console/print.coffee"),t.exports=function(e){var t,r,i,s,l,u,c,f,d,p,h,v;for(t=e.axes,c=e.axes.margin.viz,s=t.stacked||!t.ticks.value?[]:e.data.viz,v=2*s.length>e.data.large?0:e.draw.timing,d=function(r,o){return 0===o.indexOf("y")?r.attr("x1",-2).attr("x2",-8).attr("y1",function(e){return e.d3plus.y-c.top}).attr("y2",function(e){return e.d3plus.y-c.top}):r.attr("x1",function(e){return e.d3plus.x-c.left}).attr("x2",function(e){return e.d3plus.x-c.left}).attr("y1",t.height+2).attr("y2",t.height+8),r.style("stroke",function(t){return a(n(e,t))}).style("stroke-width",e.data.stroke.width).attr("shape-rendering",e.shape.rendering.value)},e.dev.value&&o.time("creating axis tick groups"),h=e.group.select("g#d3plus_graph_plane").selectAll("g.d3plus_data_tick").data(s,function(r){var n;return n=t.discrete?"_"+r.d3plus[t.discrete]:"","tick_"+r[e.id.value]+"_"+r.d3plus.depth+n; | |
| }),h.enter().append("g").attr("class","d3plus_data_tick").attr("opacity",0),e.dev.value&&o.timeEnd("creating axis tick groups"),f=["x","y"],l=0,u=f.length;l<u;l++)r=f[l],e.dev.value&&v&&o.time("creating "+r+" ticks"),i=v&&r!==t.discrete?s:[],p=h.selectAll("line.d3plus_data_"+r).data(i,function(t){return"tick_"+t[e.id.value]+"_"+t.d3plus.depth}),e.dev.value&&v&&o.timeEnd("creating "+r+" ticks"),e.dev.value&&v&&o.time("styling "+r+" ticks"),v>0?p.transition().duration(v).call(d,r):p.call(d,r),p.enter().append("line").attr("class","d3plus_data_"+r).call(d,r),e.dev.value&&v&&o.timeEnd("styling "+r+" ticks");v>0?(h.transition().duration(v).attr("opacity",1),h.exit().transition().duration(v).attr("opacity",0).remove()):(h.attr("opacity",1),h.exit().remove())}},{"../../../../color/legible.coffee":44,"../../../../core/console/print.coffee":52,"../../../../core/fetch/color.coffee":63}],314:[function(e,t,r){var n,a,o,i;n=e("./includes/axes.coffee"),a=e("./includes/svg.coffee"),o=e("./includes/mouse.coffee"),i=e("./includes/plot.coffee"),t.exports=function(e,t){void 0===t&&(t={}),n(e,t),i(e,t),a(e,t),e.mouse.viz=t.mouse===!0&&o}},{"./includes/axes.coffee":315,"./includes/mouse.coffee":317,"./includes/plot.coffee":318,"./includes/svg.coffee":319}],315:[function(e,t,r){var n,a,o,i,s,l,u,c,f,d,p,h;n=e("../../../../../array/sort.coffee"),i=e("./buffer.coffee"),o=e("../../../../../util/buckets.coffee"),l=e("../../../../../core/fetch/data.js"),u=e("../../../../../core/fetch/value.coffee"),d=e("../../../../../core/console/print.coffee"),h=e("../../../../../util/uniques.coffee"),t.exports=function(e,t){var r,n,o,l,v,g,m,y,x,b,w,_;for(o=s(e),!o&&e.axes.dataset||(e.axes.dataset=c(e)),e.axes.scale=!(!t.buffer||t.buffer===!0)&&p(e,t.buffer),r=e.width.viz>e.height.viz?["y","y2","x","x2"]:["x","x2","y","y2"],v=0,m=r.length;v<m;v++)n=r[v],x=0===n.indexOf("x")?"y":"x",w=e.order.changed||e.order.sort.changed||e.order.value===!0&&e[x].changed,e[n].value&&(!e[n].ticks.values||o||w||e[n].value===e.time.value&&e.time.fixed.value)&&(e.dev.value&&d.time("calculating "+n+" axis"),e[n].reset=!0,e[n].ticks.values=!1,n===e.axes.discrete&&e[n].value!==e.time.value&&(e[n].ticks.values=h(e.axes.dataset,e[n].value,u,e)),_=t.zero===!0||0===n.indexOf(t.zero),b=a(e,n,_),0===n.indexOf("y")&&(b=b.reverse()),e[n].scale.viz=f(e,n,b),e[n].domain.viz=b,e.dev.value&&d.timeEnd("calculating "+n+" axis"));if(e.axes.mirror.value&&(l=d3.extent(e.y.domain.viz.concat(e.x.domain.viz)),e.x.domain.viz=l,e.x.scale.viz.domain(l),l=l.slice().reverse(),e.y.domain.viz=l,e.y.scale.viz.domain(l)),t.buffer)for(g=0,y=r.length;g<y;g++)n=r[g],n!==e.axes.discrete&&i(e,n,t.buffer)},s=function(e){var t,r,n,a,o,i,s,l,u,c,f,d,p;if(r=!e.time.fixed.value&&(e.time.solo.changed||e.time.mute.changed),r||(r=e.id.solo.changed||e.id.mute.changed),r)return r;for(n=["data","time","id","depth","type","width","height","x","y","x2","y2"],a=0,l=n.length;a<l;a++)if(i=n[a],e[i].changed){r=!0;break}if(r)return r;for(p=["mute","range","scale","solo","stacked","zerofill"],f=["x","y","x2","y2"],o=0,u=f.length;o<u;o++)for(t=f[o],s=0,c=p.length;s<c;s++)if(d=p[s],e[t][d].changed){r=!0;break}return r},c=function(e){var t,r;return e.time.fixed.value?(r=d3.range(0,e.id.nesting.length),d3.merge(d3.merge([function(){var n,a,o;for(o=[],n=0,a=r.length;n<a;n++)t=r[n],o.push(l(e,"all",t));return o}()]))):e.data.viz},a=function(e,t,r,a){var o,i,s,l,c,f,d,p,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,B,C,q;if(A=0===t.indexOf("x")?"y":"x",e[t].range.value&&2===e[t].range.value.length)return e[t].range.value.slice();if("share"===e[t].scale.value)return e[t].ticks.values=d3.range(0,1.1,.1),[0,1];if(e[t].stacked.value){for(T=[],j=e.axes.dataset,v=0,x=j.length;v<x;v++)d=j[v],d.values?T=T.concat(d.values):T.push(d);return c=d3.nest().key(function(t){return u(e,t,e[A].value)}).rollup(function(r){var n,a;return a=d3.sum(r,function(r){var n;return n=u(e,r,e[t].value),n>0?n:0}),n=d3.sum(r,function(r){var n;return n=u(e,r,e[t].value),n<0?n:0}),[n,a]}).entries(T),q=d3.merge(c.map(function(e){return e.values})),d3.extent(q)}if(e[t].value===e.time.value)return e.time.solo.value.length?d3.extent(e.time.solo.value).map(function(e){return e.constructor!==Date?(e+="",4===e.length&&parseInt(e)+""===e&&(e+="/01/01"),new Date(e)):e}):d3.extent(e.data.time.ticks);for(q=[],M=e.axes.dataset,g=0,b=M.length;g<b;g++)d=M[g],C=u(e,d,e[t].value),C instanceof Array?q=q.concat(C):q.push(C);if(q=q.filter(function(e){return null!==e}),t===e.axes.discrete){if(S=e.order.value===!0?e[A].value:e.order.value){for(F=e.order.sort.value,o=e.order.agg.value||e.aggs.value[S]||"max",i=typeof o,f=q.reduce(function(e,t){return e[t]=[],e},{}),O=e.axes.dataset,y=0,w=O.length;y<w;y++)if(d=O[y],d.values)for(E=d.values,k=0,_=E.length;k<_;k++)B=E[k],p=u(e,B,e[t].value),f[p].push(u(e,B,S));else p=u(e,d,e[t].value),f[p].push(u(e,d,S));for(m in f)B=f[m],"string"===i?f[m]=d3[o](B):"function"===i&&(f[m]=o(B,S));return f=n(d3.entries(f),"value",F),f=f.reduce(function(e,t){return e.push(t.key),e},[])}return q[0].constructor===String?h(q).sort(function(e,t){return""+e.localeCompare(""+t)}):h(q).sort(function(e,t){return e-t})}return q.sort(function(e,t){return e-t}),"log"===e[t].scale.value&&(0===q[0]&&(q[0]=1),0===q[q.length-1]&&(q[q.length-1]=-1)),r&&(l=q.every(function(e){return e>0}),s=q.every(function(e){return e<0}),(l||s)&&(z=l?1:-1,q.push("log"===e[t].scale.value?z:0))),d3.extent(q)},f=function(e,t,r){var n,a,i,s,l;return a=0===t.indexOf("x")?e.width.viz:e.height.viz,s=e[t].scale.value,["discrete","share"].indexOf(s)>=0&&(s="linear"),l=10,"string"==typeof r[0]?(s="ordinal",n=o([0,a],r.length)):(n=[0,a],"linear"===e[t].scale.value&&(l=Math.floor(a/(4*e[t].ticks.font.size)))),e[t].scale.ticks=l,i=d3.scale[s]().domain(r).range(n),"clamp"in i&&i.clamp(!0),i},p=function(e,t){var r,n,a;return t===!0&&(t="size"),t in e&&(t=e[t].value),a=e.size.scale.range.min.value,"function"==typeof a&&(a=a(e)),n=e.size.scale.range.max.value,"function"==typeof n&&(n=n(e)),t===!1?e.size.scale.value.domain([0,1]).rangeRound([n,n]):"number"==typeof t?e.size.scale.value.domain([0,1]).rangeRound([t,t]):t?(e.dev.value&&d.time("calculating buffer scale"),r=d3.extent(e.axes.dataset,function(r){var n;return n=u(e,r,t),n?n:0}),r[0]===r[1]&&(a=n),e.dev.value&&d.timeEnd("calculating buffer scale"),e.size.scale.value.domain(r).rangeRound([a,n])):void 0}},{"../../../../../array/sort.coffee":34,"../../../../../core/console/print.coffee":52,"../../../../../core/fetch/data.js":64,"../../../../../core/fetch/value.coffee":67,"../../../../../util/buckets.coffee":204,"../../../../../util/uniques.coffee":210,"./buffer.coffee":316}],316:[function(e,t,r){var n,a;n=e("../../../../../util/buckets.coffee"),a=e("../../../../../util/closest.coffee"),t.exports=function(e,t,r){var o,i,s,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,B,C,q,N;if("share"!==e[t].scale.value&&!e[t].range.value&&e[t].reset){if(F=e[t].scale.viz.copy(),"clamp"in F&&F.clamp(!1),t===e.axes.discrete){if(h=F.domain(),"string"==typeof h[0]){for(y=h.length;y>=0;)h.splice(y,0,"d3plus_buffer_"+y),y--;return j=F.range(),j=n(d3.extent(j),h.length),e[t].scale.viz.domain(h).range(j)}if(0===t.indexOf("y")&&(h=h.slice().reverse()),1===e[t].ticks.values.length)h=[h[0],h[0]],e[t].value===e.time.value&&1!==e.data.time.ticks.length?(u=a(e.data.time.ticks,h[0]),S=e.data.time.ticks.indexOf(u),S>0?h[0]=e.data.time.ticks[S-1]:(d=e.data.time.ticks[S+1]-u,h[0]=new Date(u.getTime()-d)),S<e.data.time.ticks.length-1?h[1]=e.data.time.ticks[S+1]:(d=u-e.data.time.ticks[S-1],h[1]=new Date(u.getTime()+d))):(h[0]-=1,h[1]+=1);else if(e.axes.scale)p=Math.abs(h[1]-h[0]),i=p/(e[t].ticks.values.length-1),i/=2,M=F.range()[1],k=1.5*e.axes.scale.range()[1],m=F.invert(-k),g=F.invert(M+k),h[0]-i<m?(h[0]=h[0]-i,h[h.length-1]=h[h.length-1]+i):(h=[m,g],0===t.indexOf("y")&&(h=h.reverse()),v=F.domain(),v=v[1]-v[0],v||(h[0]-=1,h[1]+=1));else if(e[t].value===e.time.value)p=Math.abs(h[1]-h[0]),i=p/(e[t].ticks.values.length-1),i/=2,h[0]=h[0]-i,h[1]=h[1]+i;else{for(p=Math.abs(h[1]-h[0]),o=p/2,y=h.length,A=h.slice();y>=0;)f=y?A[y-1]+o:A[y]-o,h.splice(y,0,f),y--;j=F.range(),j=n(d3.extent(j),h.length),e[t].scale.viz.domain(h).range(j)}return 0===t.indexOf("y")&&(h=h.reverse()),e[t].scale.viz.domain(h)}if("x"===r&&0===t.indexOf("x")||"y"===r&&0===t.indexOf("y")||r===!0)return h=F.domain(),l=h[0]>=0&&h[1]>=0,s=h[0]<=0&&h[1]<=0,"log"===e[t].scale.value?(N=l?1:-1,l&&0===t.indexOf("y")&&(h=h.slice().reverse()),w=Math.pow(10,parseInt(Math.abs(h[0])).toString().length-1)*N,b=h[0]%w,x=b,b&&x/w<=.1&&(x+=w*N),_=0===b?w:x,h[0]-=_,0===h[0]&&(h[0]=N),C=Math.pow(10,parseInt(Math.abs(h[1])).toString().length-1)*N,B=h[1]%C,T=Math.abs(C-B),B&&T/C<=.1&&(T+=C*N),q=0===B?C:T,h[1]+=q,0===h[1]&&(h[1]=N),l&&0===t.indexOf("y")&&(h=h.reverse())):(N=0,0===t.indexOf("y")&&(h=h.slice().reverse()),E=h.filter(function(e){return e.constructor===String}),i=.05*Math.abs(h[1]-h[0])||1,E.length||(h[0]=h[0]-i,h[1]=h[1]+i,(l&&h[0]<N||s&&h[0]>N)&&(h[0]=N),(l&&h[1]<N||s&&h[1]>N)&&(h[1]=N)),0===t.indexOf("y")&&(h=h.reverse())),e[t].scale.viz.domain(h);if(e.axes.scale)return c=!1,e.axes.mirror.value&&(z=0===t.indexOf("y")?"x":"y",c=e[z].scale.viz,O=e.width.viz>e.height.viz?"x":"y"),t===O&&c?h=c.domain().slice().reverse():(M=F.range()[1],k=e.axes.scale.range()[1],m=F.invert(1.5*-k),g=F.invert(M+1.5*k),h=[m,g],0===t.indexOf("y")&&(h=h.reverse()),v=F.domain(),v=v[1]-v[0],v||(h[0]-=1,h[1]+=1),0===t.indexOf("y")&&(h=h.reverse())),e[t].scale.viz.domain(h)}}},{"../../../../../util/buckets.coffee":204,"../../../../../util/closest.coffee":206}],317:[function(e,t,r){var n,a,o,i,s,l;n=e("../../../../../util/copy.coffee"),a=e("../../../../../client/pointer.coffee"),o=e("../../../../../core/fetch/color.coffee"),i=e("../../../../../core/fetch/value.coffee"),s=e("../../../../../color/legible.coffee"),l=e("../../../../../color/text.coffee"),t.exports=function(e,t){var r,n,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,A;return r=d3.event.type===a.click&&(t.tooltip.value.long||t.tooltip.html.value),u=[a.over,a.move].indexOf(d3.event.type)>=0,z=e.d3plus.x,A=e.d3plus.y,m=e.d3plus.r||0,b=t.types[t.type.value].scale||1,m*=b,c=t.axes,g=t.axes.margin.viz,k=t.draw.timing?t.timing.mouseevents:0,!r&&u?(n=s(o(t,e)),f=["x","y","x2","y2"].filter(function(r){var n;return n=i(t,e,t[r].value),n&&!(n instanceof Array)&&r!==t.axes.stacked&&t[r].mouse.value})):f=[],d=function(e){return e.attr("x1",function(e){return 0===e.indexOf("x")?z:z-m}).attr("y1",function(e){return 0===e.indexOf("y")?A:A+m}).attr("x2",function(e){return 0===e.indexOf("x")?z:z-m}).attr("y2",function(e){return 0===e.indexOf("y")?A:A+m}).attr("opacity",0)},p=function(e){return e.style("stroke",function(e){return"area"===t.shape.value?"white":n}).attr("stroke-dasharray",function(e){return t[e].mouse.dasharray.value}).attr("shape-rendering",function(e){return t[e].mouse.rendering.value}).style("stroke-width",function(e){return t[e].mouse.width})},h=function(r){return r.attr("x1",function(e){return 0===e.indexOf("x")?z:z-m}).attr("y1",function(e){return 0===e.indexOf("y")?A:A+m}).attr("x2",function(r){return 0===r.indexOf("x")?z:e.d3plus.x0?e.d3plus.x0:"y"===r?g.left-t[r].ticks.size:g.left+c.width+t[r].ticks.size}).attr("y2",function(r){return 0===r.indexOf("y")?A:e.d3plus.y0?e.d3plus.y0:"x"===r?c.height+g.top+t[r].ticks.size:g.top-t[r].ticks.size}).style("opacity",1)},v=t.g.labels.selectAll("line.d3plus_mouse_axis_label").data(f),k?(v.enter().append("line").attr("class","d3plus_mouse_axis_label").attr("pointer-events","none").call(d).call(p),v.transition().duration(k).call(h).call(p),v.exit().transition().duration(k).call(d).remove()):(v.call(h).call(p),v.enter().append("line").attr("class","d3plus_mouse_axis_label").attr("pointer-events","none").call(d).call(p),v.exit().remove()),w=function(r){return r.attr("font-size",function(e){return t[e].ticks.font.size+"px"}).attr("font-family",function(e){return t[e].ticks.font.family.value}).attr("font-weight",function(e){return t[e].ticks.font.weight}).attr("x",function(e){return 0===e.indexOf("x")?z:"y"===e?g.left-5-t[e].ticks.size:g.left+c.width+5+t[e].ticks.size}).attr("y",function(r){return 0===r.indexOf("y")?A:e.d3plus.y0?e.d3plus.y+(e.d3plus.y0-e.d3plus.y)/2+g.top-6:"x"===r?c.height+g.top+5+t[r].ticks.size:g.top-5-t[r].ticks.size-1.35*t[r].ticks.font.size}).attr("fill","area"===t.shape.value?"white":l(n))},_=t.g.labels.selectAll("text.d3plus_mouse_axis_label").data(f),_.enter().append("text").attr("class","d3plus_mouse_axis_label").attr("id",function(e){return e+"_d3plusmouseaxislabel"}).attr("dy",function(e){return 0===e.indexOf("y")?.35*t[e].ticks.font.size:t[e].ticks.font.size}).style("text-anchor",function(e){return"y"===e?"end":"y2"===e?"start":"middle"}).attr("opacity",0).attr("pointer-events","none").call(w),_.text(function(r){var n,a;return n=t.axes.stacked||r,a=i(t,e,t[n].value),t.format.value(a,{key:t[n].value,vars:t,labels:t[n].affixes.value})}),k?(_.transition().duration(k).delay(k).attr("opacity",1).call(w),_.exit().transition().duration(k).attr("opacity",0).remove()):(_.attr("opacity",1).call(w),_.exit().remove()),y=function(r){var a;return a=function(e){var t;return t=d3.select("text#"+e+"_d3plusmouseaxislabel"),t.size()?t.node().getBBox():{width:0,height:0}},r.attr("x",function(e){var r;return r=a(e).width,0===e.indexOf("x")?z-r/2-5:"y"===e?g.left-t[e].ticks.size-r-10:g.left+c.width+t[e].ticks.size}).attr("y",function(r){var n;return n=a(r).height,0===r.indexOf("y")?A-(n/2+5):e.d3plus.y0?e.d3plus.y+(e.d3plus.y0-e.d3plus.y)/2+g.top-(n/2+5):"x"===r?c.height+g.top+t[r].ticks.size:g.top-t[r].ticks.size-n-10}).attr("width",function(e){return a(e).width+10}).attr("height",function(e){return a(e).height+10}).style("stroke","area"===t.shape.value?"transparent":n).attr("fill",n).attr("shape-rendering",function(e){return t[e].mouse.rendering.value}).style("stroke-width",function(e){return t[e].mouse.width})},x=t.g.labels.selectAll("rect.d3plus_mouse_axis_label").data(f),k?(x.enter().insert("rect","text.d3plus_mouse_axis_label").attr("class","d3plus_mouse_axis_label").attr("pointer-events","none").attr("opacity",0).call(y),x.transition().duration(k).delay(k).attr("opacity",1).call(y),x.exit().transition().duration(k).attr("opacity",0).remove()):(x.attr("opacity",1).call(y),x.enter().insert("rect","text.d3plus_mouse_axis_label").attr("class","d3plus_mouse_axis_label").attr("pointer-events","none").call(y),x.exit().remove())}},{"../../../../../client/pointer.coffee":38,"../../../../../color/legible.coffee":44,"../../../../../color/text.coffee":50,"../../../../../core/fetch/color.coffee":63,"../../../../../core/fetch/value.coffee":67,"../../../../../util/copy.coffee":207}],318:[function(e,t,r){var n,a,o,i,s,l,u,c,f,d,p;n=e("../../../../../util/buckets.coffee"),a=e("./buffer.coffee"),i=e("../../../../../core/fetch/value.coffee"),s=e("../../../../../font/sizes.coffee"),f=e("../../../../../textwrap/textwrap.coffee"),d=e("../../../../../core/data/time.coffee"),p=e("../../../../../util/uniques.coffee"),t.exports=function(e,t){var r,n,s,l,c,f,p,h,v,g,m,y,x,b,w,_,k,z,A,j;for(e.axes.margin.viz={top:e.axes.margin.top,right:e.axes.margin.right,bottom:e.axes.margin.bottom,left:e.axes.margin.left},e.axes.height=e.height.viz,e.axes.width=e.width.viz,r=e.width.viz>e.height.viz?["y","y2","x","x2"]:["x","x2","y","y2"],c=0,h=r.length;c<h;c++)if(n=r[c],e[n].value){if(e[n].ticks.values===!1)if(e[n].value===e.time.value){for(z=e.time.solo.value,z=z.length?z.map(function(e){return e.constructor!==Date&&(e+="",4===e.length&&parseInt(e)+""===e&&(e+="/01/01"),e=new Date(e)),e}):e.data.time.values,l=d3.extent(z),w=e.data.time.stepType,z=[l[0]],k=l[0];k<l[1];)m=new Date(k),k=new Date(m["set"+w](m["get"+w]()+1)),z.push(k);e[n].ticks.values=z}else 1===n.indexOf("2")?(x=e[n.slice(0,1)].scale.viz,b=e[n].scale.viz,z=e[n.slice(0,1)].scale.ticks,e[n].ticks.values=x.ticks(z).map(function(e){return parseFloat(d3.format(".5f")(b.invert(x(e))))})):e[n].ticks.values=e[n].scale.viz.ticks(e[n].scale.ticks);e[n].ticks.values.length||(j=i(e,e.data.viz,e[n].value),j instanceof Array||(j=[j]),e[n].ticks.values=j),y=0===n.indexOf("x")?"y":"x",(1===e[n].ticks.values.length||t.buffer&&t.buffer!==y&&n===e.axes.discrete&&e[n].reset===!0)&&a(e,n,t.buffer),e[n].reset=!1,e[n].value===e.time.value?(s={"font-family":e[n].ticks.font.family.value,"font-weight":e[n].ticks.font.weight,"font-size":e[n].ticks.font.size+"px","text-transform":e[n].ticks.font.transform.value,"letter-spacing":e[n].ticks.font.spacing+"px"},A=d(e,{values:e[n].ticks.values,limit:e.width.viz,style:s}),e[n].ticks.value?e[n].ticks.visible=e[n].ticks.value.map(Number):e[n].ticks.labels.value.constructor===Array?e[n].ticks.visible=e[n].ticks.labels.value.map(Number):e[n].ticks.visible=A.values.map(Number),e[n].ticks.format=A.format):e[n].ticks.value?(e[n].ticks.values=e[n].ticks.value,e[n].ticks.labels.value.constructor===Array?e[n].ticks.visible=e[n].ticks.labels.value:e[n].ticks.visible=e[n].ticks.value):e[n].ticks.labels.value.constructor===Array?e[n].ticks.visible=e[n].ticks.labels.value:"log"===e[n].scale.value?(z=e[n].ticks.values,_=z.filter(function(e){return"1"===Math.abs(e).toString().charAt(0)}),_.length<3?e[n].ticks.visible=z:e[n].ticks.visible=_):e[n].ticks.visible=e[n].ticks.values,e[n].value===e.time.value&&(e[n].ticks.visible=e[n].ticks.visible.map(function(e){return e.constructor===Number&&(""+e).length>4?e:(e+="",4===e.length&&parseInt(e)+""===e&&(e+="/01/01"),new Date(e).getTime())}))}if(e.small)for(e.axes.width-=e.axes.margin.viz.left+e.axes.margin.viz.right,e.axes.height-=e.axes.margin.viz.top+e.axes.margin.viz.bottom,f=0,v=r.length;f<v;f++)n=r[f],e[n].label.height=0;else e.small||u(e);for(p=0,g=r.length;p<g;p++)n=r[p],e[n].axis.svg=o(e,n)},u=function(e){var t,r,a,o,i,u,c,d,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,B,C;for(b=e.x.scale.viz.domain(),F=e.y.scale.viz.domain(),e.x2.value&&(g=e.x2.scale.viz.domain()),e.y2.value&&(M=e.y2.scale.viz.domain()),d=["y","y2"],r=0,i=d.length;r<i;r++)t=d[r],e[t].value&&(c="y"===t?"left":"right",O={"font-size":e[t].ticks.font.size+"px","font-family":e[t].ticks.font.family.value,"font-weight":e[t].ticks.font.weight,"text-transform":e[t].ticks.font.transform.value,"letter-spacing":e[t].ticks.font.spacing+"px"},C=e[t].ticks.visible,"log"===e[t].scale.value?B=C.map(function(e){return l(e)}):"share"===e[t].scale.value?B=C.map(function(r){return e.format.value(100*r,{key:"share",vars:e,output:t})}):e[t].value===e.time.value?B=C.map(function(r,n){return e[t].ticks.format(new Date(r))}):("string"==typeof C[0]&&(C=e[t].scale.viz.domain().filter(function(e){return 0!==e.indexOf("d3plus_buffer_")})),B=C.map(function(r){return e.format.value(r,{key:e[t].value,vars:e,labels:e[t].affixes.value,output:t})})),e[t].ticks.labels.value?(e[t].ticks.hidden=!1,E=d3.max(s(B,O),function(e){return e.width}),E&&(E=Math.ceil(E+e.labels.padding),e.axes.margin.viz[c]+=E)):e[t].ticks.hidden=!0,S=e[t].label.fetch(e),S?(T={"font-family":e[t].label.font.family.value,"font-weight":e[t].label.font.weight,"font-size":e[t].label.font.size+"px","text-transform":e[t].label.font.transform.value,"letter-spacing":e[t].label.font.spacing+"px"},e[t].label.height=s([S],T)[0].height):e[t].label.height=0,e[t].label.value&&(e.axes.margin.viz[c]+=e[t].label.height,e.axes.margin.viz[c]+=2*e[t].label.padding));for(e.axes.width-=e.axes.margin.viz.left+e.axes.margin.viz.right,e.x.scale.viz.range(n([0,e.axes.width],b.length)),g&&e.x2.scale.viz.range(n([0,e.axes.width],g.length)),p=["x","x2"],a=0,u=p.length;a<u;a++)t=p[a],e[t].value&&(c="x"===t?"bottom":"top",e[t].ticks.labels.value?(e[t].ticks.hidden=!1,m={"font-size":e[t].ticks.font.size+"px","font-family":e[t].ticks.font.family.value,"font-weight":e[t].ticks.font.weight,"text-transform":e[t].ticks.font.transform.value,"letter-spacing":e[t].ticks.font.spacing+"px"},j=e[t].ticks.visible,"log"===e[t].scale.value?A=j.map(function(e){return l(e)}):"share"===e[t].scale.value?A=j.map(function(r){return e.format.value(100*r,{key:"share",vars:e,output:t})}):e[t].value===e.time.value?A=j.map(function(r,n){return e[t].ticks.format(new Date(r))}):("string"==typeof j[0]&&(j=e[t].scale.viz.domain().filter(function(e){return 0!==e.indexOf("d3plus_buffer_")})),A=j.map(function(r){return e.format.value(r,{key:e[t].value,vars:e,labels:e[t].affixes.value,output:t})})),z=s(A,m),x=d3.max(z,function(e){return e.width}),y=d3.max(z,function(e){return e.height}),1===j.length?k=e.axes.width:(k=e[t].scale.viz(j[1])-e[t].scale.viz(j[0]),k=Math.abs(k)),x>k&&A.join("").indexOf(" ")>0?(e[t].ticks.wrap=!0,z=s(A,m,{mod:function(t){return f().container(d3.select(t)).height(e.axes.height/2).width(k).draw()}}),x=d3.max(z,function(e){return e.width}),y=d3.max(z,function(e){return e.height})):e[t].ticks.wrap=!1,e[t].ticks.baseline="auto",x<=k?e[t].ticks.rotate=0:x<e.axes.height/2?(z=s(A,m,{mod:function(t){return f().container(d3.select(t)).width(e.axes.height/2).height(k).draw()}}),y=d3.max(z,function(e){return e.width}),x=d3.max(z,function(e){return e.height}),e[t].ticks.rotate=-90):(x=0,y=0),x&&y||(e[t].ticks.hidden=!0,e[t].ticks.rotate=0),x=Math.ceil(x),y=Math.ceil(y),e[t].ticks.maxHeight=y,e[t].ticks.maxWidth=x,y&&(e.axes.margin.viz[c]+=y+e.labels.padding),o=e[t].ticks.visible[e[t].ticks.visible.length-1],h=e[t].scale.viz(o),h+=x/2+e.axes.margin.viz.left,h>e.width.value&&(v=h-e.width.value+e.axes.margin.viz.right,e.axes.width-=v,e.axes.margin.viz.right+=v)):e[t].ticks.hidden=!0,w=e[t].label.fetch(e),w?(_={"font-family":e[t].label.font.family.value,"font-weight":e[t].label.font.weight,"font-size":e[t].label.font.size+"px","text-transform":e[t].label.font.transform.value,"letter-spacing":e[t].label.font.spacing+"px"},e[t].label.height=s([w],_)[0].height):e[t].label.height=0,e[t].label.value&&(e.axes.margin.viz[c]+=e[t].label.height,e.axes.margin.viz[c]+=2*e[t].label.padding));if(e.axes.height-=e.axes.margin.viz.top+e.axes.margin.viz.bottom,e.x.scale.viz.range(n([0,e.axes.width],b.length)),g&&e.x2.scale.viz.range(n([0,e.axes.width],g.length)),e.y.scale.viz.range(n([0,e.axes.height],F.length)),M)return e.y2.scale.viz.range(n([0,e.axes.height],M.length))},o=function(e,t){return d3.svg.axis().tickSize(e[t].ticks.size).tickPadding(5).orient(e[t].orient.value).scale(e[t].scale.viz).tickValues(e[t].ticks.values).tickFormat(function(r,n){var a,o;return e[t].ticks.hidden?null:(o=e[t].scale.value,a=r.constructor===Date?+r:r,e[t].ticks.visible.indexOf(a)>=0?"share"===o?e.format.value(100*r,{key:"share",vars:e,labels:e[t].affixes.value,output:t}):r.constructor===Date?e[t].ticks.format(r):"log"===o?l(r):e.format.value(r,{key:e[t].value,vars:e,labels:e[t].affixes.value,output:t}):null)})},c="⁰¹²³⁴⁵⁶⁷⁸⁹",l=function(e){var t,r,n;return r=Math.round(Math.log(Math.abs(e))/Math.LN10),n=Math.abs(e).toString().charAt(0),t="10 "+(r+"").split("").map(function(e){return c[e]}).join(""),"1"!==n&&(t=n+" x "+t),e<0?"-"+t:t}},{"../../../../../core/data/time.coffee":62,"../../../../../core/fetch/value.coffee":67,"../../../../../font/sizes.coffee":102,"../../../../../textwrap/textwrap.coffee":200,"../../../../../util/buckets.coffee":204,"../../../../../util/uniques.coffee":210,"./buffer.coffee":316}],319:[function(e,t,r){var n,a,o;n=e("../../../../../color/mix.coffee"),a=e("../../../../../textwrap/textwrap.coffee"),o=e("../../../../../object/validate.coffee"),t.exports=function(e){var t,r,i,s,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,B,C,q,N,P,I,D,V,R,U,L,Y,H,X,G,J,W,Q,K,Z,$,ee,te,re,ne,ae,oe,ie,se,le,ue,ce;if(h=e.x.domain.viz.concat(e.y.domain.viz),h.indexOf(void 0)>=0)return null;for(f={width:e.axes.width,height:e.axes.height,fill:e.axes.background.color,stroke:e.axes.background.stroke.color,"stroke-width":e.axes.background.stroke.width,"shape-rendering":e.axes.background.rendering.value},r={left:"start",center:"middle",right:"end"},s=e.small?[]:[0],oe=function(t,r){return t.attr("x1",function(t){return 0===r.indexOf("x")?e.x.scale.viz(t):0}).attr("x2",function(t){return 0===r.indexOf("x")?e.x.scale.viz(t):e.axes.width}).attr("y1",function(t){return 0===r.indexOf("y")?e.y.scale.viz(t):0}).attr("y2",function(t){return 0===r.indexOf("y")?e.y.scale.viz(t):e.axes.height})},ie=function(t,r,a){var o,i,s;return o=a?e[r].grid.color:e[r].ticks.color,i="log"===e[r].scale.value,s=e[r].ticks.visible||[],t.attr("stroke",function(t){var l;return 0===t?e[r].axis.color:(t.constructor===Date&&(t=+t),l=s.indexOf(t)>=0,!l||i&&"1"!==Math.abs(t).toString().charAt(0)?a&&"transparent"!==e.axes.background.color?n(o,e.axes.background.color,.4,1):"transparent"!==e.background.value?n(o,e.background.value,.4,1):n(o,"white",.4,1):o)}).attr("stroke-width",e[r].ticks.width).attr("shape-rendering",e[r].ticks.rendering.value)},v=function(t,r,n){var a;return a=0===r?"axis":"ticks",r=e[t][a].font[n],r&&(r.length||"number"==typeof r)?r:e[t].ticks.font[n]},ae=function(t,r){var a;return a="log"===e[r].scale.value,t.attr("font-size",function(e){return v(r,e,"size")+"px"}).attr("stroke","none").attr("fill",function(t){var o;return o=v(r,t,"color"),a&&"1"!==Math.abs(t).toString().charAt(0)?n(o,e.background.value,.4,1):o}).attr("font-family",function(e){return v(r,e,"family").value}).attr("font-weight",function(e){return v(r,e,"weight")}).style("text-transform",function(e){return v(r,e,"transform").value}).style("letter-spacing",function(e){return v(r,e,"spacing")+"px"})},q=function(t,r){var n,a;return n=0===r.indexOf("x")?"height":"width",a=0===r.indexOf("x")?"y":"x",t.attr(a+"1",0).attr(a+"2",e.axes[n]).attr(r+"1",function(e){return e.coords.line}).attr(r+"2",function(e){return e.coords.line}).attr("stroke",function(t){return t.color||e[r].lines.color}).attr("stroke-width",e[r].lines.width).attr("shape-rendering",e[r].lines.rendering.value).attr("stroke-dasharray",e[r].lines.dasharray.value)},T=function(t,n){var a;return a=0===n.indexOf("x")?"y":"x",t.attr(a,function(e){return e.coords.text[a]+"px"}).attr(n,function(e){return e.coords.text[n]+"px"}).attr("dy",e[n].lines.font.position.value).attr("text-anchor",r[e[n].lines.font.align.value]).attr("transform",function(e){return e.transform}).attr("font-size",e[n].lines.font.size+"px").attr("fill",function(t){return t.color||e[n].lines.color}).attr("font-family",e[n].lines.font.family.value).attr("font-weight",e[n].lines.font.weight)},L="translate("+e.axes.margin.viz.left+","+e.axes.margin.viz.top+")",U=e.group.selectAll("g#d3plus_graph_plane").data([0]),U.transition().duration(e.draw.timing).attr("transform",L),U.enter().append("g").attr("id","d3plus_graph_plane").attr("transform",L),c=U.selectAll("rect#d3plus_graph_background").data([0]),c.transition().duration(e.draw.timing).attr(f),c.enter().append("rect").attr("id","d3plus_graph_background").attr("x",0).attr("y",0).attr(f),D=U.selectAll("path#d3plus_graph_mirror").data([0]),D.enter().append("path").attr("id","d3plus_graph_mirror").attr("fill","#000").attr("fill-opacity",.03).attr("stroke-width",1).attr("stroke","#ccc").attr("stroke-dasharray","10,10").attr("opacity",0),D.transition().duration(e.draw.timing).attr("opacity",function(){return e.axes.mirror.value?1:0}).attr("d",function(){var e,t;return t=f.width,e=f.height,"M "+t+" "+e+" L 0 "+e+" L "+t+" 0 Z"}),Z=0!==e.x.ticks.rotate,ue=function(t,r){var n,o;return o="x"===r?e.axes.height:0,n=t.attr("transform","translate(0,"+o+")").call(e[r].axis.svg.scale(e[r].scale.viz)).selectAll("g.tick"),n.selectAll("line").attr("y2",function(t){var n;return t.constructor===Date&&(t=+t),n=d3.select(this).attr("y2"),e[r].ticks.visible.indexOf(t)>=0?n:n/2}),n.select("text").style("text-anchor",Z&&"x"===r?"end":Z?"start":"middle").call(ae,r).each(function(t){if(d3.select(this).attr("dy","0px").attr("font-size",function(e){return v(r,e,"size")+"px"}),t.constructor===Date&&(t=+t),!e[r].ticks.hidden&&e[r].ticks.visible.indexOf(t)>=0)return a().container(d3.select(this)).rotate(e[r].ticks.rotate).align(Z?"end":"center").valign(Z?"middle":"x"===r?"top":"bottom").width(e[r].ticks.maxWidth+2).height(e[r].ticks.maxHeight).padding(0).x(-e[r].ticks.maxWidth/2).y("x2"===r?-(e[r].ticks.maxHeight+2*e.labels.padding):0).draw()})},ce=function(t,r){var n,a;return a="y2"===r?e.axes.width:0,n=t.attr("transform","translate("+a+", 0)").call(e[r].axis.svg.scale(e[r].scale.viz)).selectAll("g.tick"),n.selectAll("line").attr("y2",function(t){var r;return t.constructor===Date&&(t=+t),r=d3.select(this).attr("y2"),e.x.ticks.visible.indexOf(t)>=0?r:r/2}),n.select("text").call(ae,r)},J=["x","x2","y","y2"],x=0,A=J.length;x<A;x++)i=J[x],ee=0===i.indexOf("x")?ue:ce,H=s.length&&e[i].value?[0]:[],l=U.selectAll("g#d3plus_graph_"+i+"ticks").data(H),l.transition().duration(e.draw.timing).call(ee,i),l.selectAll("line").transition().duration(e.draw.timing).call(ie,i),y=l.enter().append("g").attr("id","d3plus_graph_"+i+"ticks").call(ee,i),y.selectAll("path").attr("fill","none").attr("stroke","none"),y.selectAll("line").call(ie,i),l.exit().transition().duration(e.data.timing).attr("opacity",0).remove();for(z=function(t,r){return t.attr("x",0===r.indexOf("x")?e.width.viz/2:-(e.axes.height/2+e.axes.margin.viz.top)).attr("y","x"===r?e.height.viz-e[r].label.height/2-e[r].label.padding:"y2"===r?e.width.viz-e[r].label.height/2-e[r].label.padding:e[r].label.height/2+e[r].label.padding).attr("transform",0===r.indexOf("y")?"rotate(-90)":null).attr("font-family",e[r].label.font.family.value).attr("font-weight",e[r].label.font.weight).attr("font-size",e[r].label.font.size+"px").attr("fill",e[r].label.font.color).style("text-anchor","middle").attr("dominant-baseline","central").style("text-transform",e[r].label.font.transform.value).style("letter-spacing",e[r].label.font.spacing+"px")},W=["x","y"],b=0,j=W.length;b<j;b++)i=W[b],e[i].grid.value?m=e[i].ticks.value?e[i].ticks.value:e[i].ticks.values:(m=[],R="x"===i?"y":"x",e[i].ticks.values.indexOf(0)>=0&&e[R].axis.value&&(m=[0])),e[i].value===e.time.value&&(m=m.map(function(e){return e+="",4===e.length&&parseInt(e)+""===e&&(e+="/01/01"),new Date(e).getTime()})),g=U.selectAll("g#d3plus_graph_"+i+"grid").data([0]),g.enter().append("g").attr("id","d3plus_graph_"+i+"grid"),N=g.selectAll("line").data(m,function(e,t){return e.constructor===Date?e.getTime():e}),N.transition().duration(e.draw.timing).call(oe,i).call(ie,i,!0),N.enter().append("line").style("opacity",0).call(oe,i).call(ie,i,!0).transition().duration(e.draw.timing).delay(e.draw.timing/2).style("opacity",1),N.exit().transition().duration(e.draw.timing/2).style("opacity",0).remove();for(Q=["x","x2","y","y2"],w=0,M=Q.length;w<M;w++)i=Q[w],e[i].value?(u=e[i].label.fetch(e),k=s&&u&&!e.small?[0]:[],t=e.format.affixes.value[e[i].value],u&&!e[i].affixes.value&&t&&($=e[i].affixes.separator.value,$===!0?$=["[","]"]:$===!1&&($=["",""]),u+=" "+$[0]+t[0]+" "+t[1]+$[1])):(u="",k=[]),_=e.group.selectAll("text#d3plus_graph_"+i+"label").data(k),_.text(u).transition().duration(e.draw.timing).call(z,i),_.enter().append("text").attr("stroke","none").attr("id","d3plus_graph_"+i+"label").text(u).call(z,i),_.exit().transition().duration(e.data.timing).attr("opacity",0).remove();for(K=["x","y","x2","y2"],I=0,O=K.length;I<O;I++)if(i=K[I],e[i].value){for(B=U.selectAll("g#d3plus_graph_"+i+"_userlines").data([0]),B.enter().append("g").attr("id","d3plus_graph_"+i+"_userlines"),p=e[i].scale.viz.domain(),0===i.indexOf("y")&&(p=p.slice().reverse()),te=[],S=[],se=e[i].lines.value||[],V=0,E=se.length;V<E;V++)F=se[V],d=o(F)?F.position:F,le=i===e.axes.discrete?p.indexOf(d)>=0:d>=p[0]&&d<=p[1],le&&(d=o(F)?F:{position:d},d.coords={line:e[i].scale.viz(d.position)},S.push(d),d.text&&(d.axis=i,d.padding=.5*e[i].lines.font.padding.value,d.align=e[i].lines.font.align.value,Y=e[i].lines.font.position.text,re="middle"===Y?0:2*d.padding,"top"===Y&&(re=-re),0===i.indexOf("x")?(ne="left"===d.align?e.axes.height:"center"===d.align?e.axes.height/2:0,"left"===d.align&&(ne-=2*d.padding),"right"===d.align&&(ne+=2*d.padding)):(ne="left"===d.align?0:"center"===d.align?e.axes.width/2:e.axes.width,"right"===d.align&&(ne-=2*d.padding),"left"===d.align&&(ne+=2*d.padding)), | |
| d.coords.text={},d.coords.text[0===i.indexOf("x")?"y":"x"]=ne,d.coords.text[i]=e[i].scale.viz(d.position)+re,d.transform=0===i.indexOf("x")?"rotate(-90,"+d.coords.text.x+","+d.coords.text.y+")":null,te.push(d)));N=B.selectAll("line.d3plus_graph_"+i+"line").data(S,function(e){return e.position}),N.enter().append("line").attr("class","d3plus_graph_"+i+"line").attr("opacity",0).call(q,i),N.transition().duration(e.draw.timing).attr("opacity",1).call(q,i),N.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),P=B.selectAll("text.d3plus_graph_"+i+"line_text").data(te,function(e){return e.position}),P.enter().append("text").attr("class","d3plus_graph_"+i+"line_text").attr("id",function(e){var t;return t=e.position+"",t=t.replace("-","neg"),t=t.replace(".","p"),"d3plus_graph_"+i+"line_text_"+t}).attr("opacity",0).call(T,i),P.text(function(e){return e.text}).transition().duration(e.draw.timing).attr("opacity",1).call(T,i),P.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),G=function(t){var r;return r=function(e){var t;return t=e.position+"",t=t.replace("-","neg"),t=t.replace(".","p"),U.select("text#d3plus_graph_"+e.axis+"line_text_"+t).node().getBBox()},t.attr("x",function(e){return r(e).x-e.padding}).attr("y",function(e){return r(e).y-e.padding}).attr("transform",function(e){return e.transform}).attr("width",function(e){return r(e).width+2*e.padding}).attr("height",function(e){return r(e).height+2*e.padding}).attr("fill","transparent"!==e.axes.background.color?e.axes.background.color:"white")},X=e[i].lines.font.background.value?te:[],C=B.selectAll("rect.d3plus_graph_"+i+"line_rect").data(X,function(e){return e.position}),C.enter().insert("rect","text.d3plus_graph_"+i+"line_text").attr("class","d3plus_graph_"+i+"line_rect").attr("pointer-events","none").attr("opacity",0).call(G),C.transition().delay(e.draw.timing).each("end",function(t){return d3.select(this).transition().duration(e.draw.timing).attr("opacity",1).call(G)}),C.exit().transition().duration(e.draw.timing).attr("opacity",0).remove()}}},{"../../../../../color/mix.coffee":46,"../../../../../object/validate.coffee":172,"../../../../../textwrap/textwrap.coffee":200}],320:[function(e,t,r){var n,a,o;n=e("../../../../core/fetch/value.coffee"),a=e("../../../../string/strip.js"),o=e("../../../../util/uniques.coffee"),t.exports=function(e,t,r){var i,s,l,u,c,f,d;return void 0===r?r=e.id.nesting.slice(0,e.depth.value+1):r.constructor!==Array&&(r=[r]),void 0===s&&(s=[]),t||(t=e.data.viz),i=e[e.axes.discrete],u=e[e.axes.opposite],d=i.value===e.time.value,d?(f=e.data.time.ticks,l=e.time.solo.value.length?"solo":"mute",e.time[l].value.length&&(c=e.time[l].value.slice().map(function(e){return e.constructor!==Date&&(e+="",4===e.length&&parseInt(e)+""===e&&(e+="/01/01"),e=new Date(e)),+e}),f=f.filter(function(e){return"solo"===l?c.indexOf(+e)>=0:c.indexOf(+e)<0}))):f=i.ticks.values?i.ticks.values:o(t,i.value,n,e),d3.nest().key(function(t){var o,i,s,l,u;for(l="nesting",i=0,s=r.length;i<s;i++)o=r[i],u=n(e,t,o),u instanceof Array&&(u=u.join("_")),l+="_"+a(u);return l}).rollup(function(t){var r,a,s,c,p,h,v,g,m,y,x,b;if(r=o(t,i.value,n,e),b=r.length&&r[0].constructor===Date,b&&(r=r.map(Number)),i.zerofill.value)for(a="log"===i.scale.value?u.scale.viz.domain().every(function(e){return e<0})?-1:1:0,s=c=0,h=f.length;c<h;s=++c)if(x=f[s],y=d?+x:x,r.indexOf(y)<0){for(g={d3plus:{}},m=e.id.nesting,p=0,v=m.length;p<v;p++)l=m[p],l in t[0]&&(g[l]=t[0][l]);g[i.value]=x,g[u.value]=0,g[u.value]=a,t.splice(s,0,g)}return"string"==typeof t[0][i.value]?t:t.sort(function(t,r){var a,o,s,l,c;return a=n(e,t,i.value),s=n(e,r,i.value),(c=a-s)?c:(o=n(e,t,u.value),l=n(e,r,u.value),o-l)})}).entries(t)}},{"../../../../core/fetch/value.coffee":67,"../../../../string/strip.js":175,"../../../../util/uniques.coffee":210}],321:[function(e,t,r){var n;n=e("../../../../core/fetch/value.coffee"),t.exports=function(e,t){var r,a,o,i,s,l,u,c,f,d,p,h,v,g,m,y,x;for(m=e.axes.stacked||e.axes.opposite,a=e[m].scale.viz(0),v=e[m].scale.value,p="x"===m?"y":"x",u="y"===m?e.axes.margin.viz.top:e.axes.margin.viz.left,d="share"===v?"expand":"zero",g=d3.layout.stack().values(function(e){return e.values||[e]}).offset(d).x(function(e){return e.d3plus[p]}).y(function(t){return a-e[m].scale.viz(n(e,t,e[m].value))}).out(function(t,r,o){var i,s;return s=n(e,t,e[m].value),i=s<0,"share"===v?(t.d3plus[m+"0"]=(1-r)*a,t.d3plus[m]=t.d3plus[m+"0"]-o*a):(t.d3plus[m+"0"]=a,e.axes.stacked&&(t.d3plus[m+"0"]-=r),t.d3plus[m]=t.d3plus[m+"0"]-o),t.d3plus[m]+=u,t.d3plus[m+"0"]+=u}),h=[],f=[],o=0,s=t.length;o<s;o++)if(r=t[o],x=n(e,r,e[m].value),x instanceof Array){for(c=!0,i=0,l=x.length;i<l;i++)if(y=x[i],y>=0){c=!1;break}c?f.push(r):h.push(r)}else x>=0&&h.push(r),x<0&&f.push(r);return 0===h.length||0===f.length?g(t):(h.length&&(h=g(h)),f.length&&(f=g(f)),h.concat(f))}},{"../../../../core/fetch/value.coffee":67}],322:[function(e,t,r){var n,a,o,i,s,l;n=e("../../core/fetch/value.coffee"),a=e("./helpers/graph/draw.coffee"),i=e("./helpers/graph/nest.coffee"),s=e("../../array/sort.coffee"),l=e("./helpers/graph/stack.coffee"),o=function(e){var t,r,o,i,u,c,f,d,p,h,v;if(a(e,{buffer:e.axes.opposite,mouse:!0}),o=e.x.domain.viz.concat(e.y.domain.viz),o.indexOf(void 0)>=0)return[];for(r=s(e.data.viz,null,null,null,e),i=0,c=r.length;i<c;i++)for(d=r[i],p=d.values,u=0,f=p.length;u<f;u++)t=p[u],h=n(e,t,e.x.value),null!==h?(t.d3plus.x2=!1,t.d3plus.x=e.x.scale.viz(h)):(t.d3plus.x2=!0,t.d3plus.x=e.x2.scale.viz(n(e,t,e.x2.value))),t.d3plus.x+=e.axes.margin.viz.left,v=n(e,t,e.y.value),null!==v?(t.d3plus.y2=!1,t.d3plus.y=e.y.scale.viz(v)):(t.d3plus.y2=!0,t.d3plus.y=e.y2.scale.viz(n(e,t,e.y2.value))),t.d3plus.y+=e.axes.margin.viz.top;return e.axes.stacked?l(e,r):r},o.filter=function(e,t){return i(e,t)},o.requirements=["data","x","y"],o.setup=function(e){var t;e.axes.discrete||(t=e.time.value===e.y.value?"y":"x",e.self[t]({scale:"discrete"}))},o.shapes=["line"],o.tooltip="static",t.exports=o},{"../../array/sort.coffee":34,"../../core/fetch/value.coffee":67,"./helpers/graph/draw.coffee":314,"./helpers/graph/nest.coffee":320,"./helpers/graph/stack.coffee":321}],323:[function(e,t,r){var n=e("../../network/smallestGap.coffee"),a=e("../../core/fetch/value.coffee"),o=function(e){var t=e.nodes.restricted||e.nodes.value,r=e.edges.restricted||e.edges.value,o=d3.extent(t,function(e){return e.x}),i=d3.extent(t,function(e){return e.y}),s=[1,1];if("number"==typeof e.size.value?s=[e.size.value,e.size.value]:e.size.value&&(s=d3.extent(t,function(t){var r=a(e,t,e.size.value);return 0===r?null:r})),"undefined"==typeof s[0]&&(s=[1,1]),"number"==typeof e.size.value)var l=e.size.value,u=e.size.value;else{var l=n(t,{accessor:function(e){return[e.x,e.y]}}),c=l/2,f=e.size.value?e.nodes.overlap:.4;if(l*=f,e.edges.arrows.value&&(l=.5*l),s[0]===s[1]){var u=c;l=c}else{var d=o[1]+1.1*l-(o[0]-1.1*l),p=i[1]+1.1*l-(i[0]-1.1*l),h=d/p,v=e.width.viz/e.height.viz;if(v>h)var g=e.height.viz/p;else var g=e.width.viz/d;var u=.25*l;u*g<2&&(u=2/g)}}var m=e.size.scale.value.domain(s).range([u,l]);e.zoom.bounds=[[o[0]-1.1*l,i[0]-1.1*l],[o[1]+1.1*l,i[1]+1.1*l]];var y=[],x={};return t.forEach(function(t){var r=e.data.viz.filter(function(r){return r[e.id.value]==t[e.id.value]})[0],n=r||{};n[e.id.value]=t[e.id.value],n.d3plus={},n.d3plus.x=t.x,n.d3plus.y=t.y;var o=a(e,n,e.size.value);n.d3plus.r=o?m(o):m.range()[0],x[n[e.id.value]]={x:n.d3plus.x,y:n.d3plus.y,r:n.d3plus.r},y.push(n)}),y.sort(function(e,t){return t.d3plus.r-e.d3plus.r}),r.forEach(function(t,r){t.d3plus&&delete t.d3plus.spline,t[e.edges.source].d3plus={};var n=x[t[e.edges.source][e.id.value]];void 0!==n?(t[e.edges.source].d3plus.r=n.r,t[e.edges.source].d3plus.x=n.x,t[e.edges.source].d3plus.y=n.y):delete t[e.edges.source].d3plus,t[e.edges.target].d3plus={};var a=x[t[e.edges.target][e.id.value]];void 0!==a?(t[e.edges.target].d3plus.r=a.r,t[e.edges.target].d3plus.x=a.x,t[e.edges.target].d3plus.y=a.y):delete t[e.edges.target].d3plus}),{nodes:y,edges:r}};o.nesting=!1,o.requirements=["nodes","edges"],o.scale=1.05,o.shapes=["circle","square","donut"],o.tooltip="static",o.zoom=!0,t.exports=o},{"../../core/fetch/value.coffee":67,"../../network/smallestGap.coffee":168}],324:[function(e,t,r){var n,a,o,i,s=[].indexOf||function(e){for(var t=0,r=this.length;t<r;t++)if(t in this&&this[t]===e)return t;return-1};a=e("../../network/shortestPath.coffee"),n=e("../../core/fetch/value.coffee"),o=e("../../util/uniques.coffee"),i=function(e){var t,r,a,o,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,B,C,q,N,P,I,D,V,R,U,L,Y,H,X,G,J,W,Q,K,Z,$,ee,te,re,ne,ae,oe,ie,se,le,ue,ce,fe,de;for(h=[],H={},H[e.focus.value[0]]=0,H[e.focus.value[1]]=0,X={all:[[e.focus.value[0]],[e.focus.value[1]]]},Q=i.paths,Y=m=0,k=Q.length;m<k;Y=++m)for(L=Q[Y],h=h.concat(L.edges),_=e.focus.value[0],X[Y]=[_],K=L.edges,p=y=0,z=K.length;y<z;p=++y)d=K[p],d[e.edges.source]=e.data.viz.filter(function(t){return d[e.edges.source][e.id.value]===t[e.id.value]})[0],d[e.edges.target]=e.data.viz.filter(function(t){return d[e.edges.target][e.id.value]===t[e.id.value]})[0],P=d[e.edges.source][e.id.value]===_?"target":"source",I=d[e.edges[P]][e.id.value],void 0===H[I]&&(H[I]=Y),X[Y].push(I),_=I;oe=0;for(Y in X)if(L=X[Y],"all"!==Y){for(q=0,v=x=0,A=L.length;x<A;v=++x)if(g=L[v],0!==v&&v!==L.length-1&&H[g]===parseFloat(Y)){for(q=1,G=L[v-1],N=L[v+1],J=null,D=null,Z=X.all,u=S=0,j=Z.length;S<j;u=++S)l=Z[u],s.call(l,G)>=0&&(J=u),s.call(l,N)>=0&&(D=u);null!==J&&null===D?J+1===X.all.length-1?X.all.splice(J+1,0,[g]):X.all[J+1].push(g):D-J===1?X.all.splice(D,0,[g]):D-J>1&&X.all[D-1].push(g)}oe+=q}for(ae=Math.floor(e.height.viz/oe),de=[],v=0;v<oe;)v%2===0?de.push(v):de.unshift(v),v++;for(b=e.size.value&&!e.small?30:0,fe=d3.scale.ordinal().domain(de).range(d3.range(ae/2-b,e.height.viz+ae/2-b,(e.height.viz-ae)/(oe-1))),f=X.all.length,c=Math.floor(e.width.viz/f),ue=d3.scale.linear().domain([0,f-1]).rangeRound([c/2,e.width.viz-c/2]),B=5,T=.4*d3.min([c,ae-b]),se=d3.extent(e.data.viz,function(t){var r;return r=n(e,t,e.size.value),r||0}),ie=e.size.scale.value.domain(se).rangeRound([B,T]),$=e.data.viz,C=0,M=$.length;C<M;C++){for(V=$[C],null==V.d3plus&&(V.d3plus={}),ee=X.all,u=R=0,O=ee.length;R<O;u=++R)l=ee[u],te=V[e.id.value],s.call(l,te)>=0&&(V.d3plus.x=ue(u));V.d3plus.y=fe(H[V[e.id.value]]),e.size.value?(le=n(e,V,e.size.value),V.d3plus.r=le?ie(le):B):V.d3plus.r=T,V.d3plus.r<.1*c&&!e.small?V.d3plus.label={x:0,y:V.d3plus.r+2*e.labels.padding,w:.6*c,h:b+T-V.d3plus.r,resize:!1}:delete V.d3plus.label}for(re=i.paths,Y=U=0,E=re.length;U<E;Y=++U)for(L=re[Y],_=e.focus.value[0],ne=L.edges,p=W=0,F=ne.length;W<F;p=++W)d=ne[p],P=d[e.edges.source][e.id.value]===_?"target":"source",w="target"===P?"source":"target",I=d[e.edges[P]][e.id.value],H[_]!==H[I]?(d.d3plus={spline:!0},null==(t=d[e.edges.source]).d3plus&&(t.d3plus={}),null==(r=d[e.edges.source].d3plus).edges&&(r.edges={}),null==(a=d[e.edges.target]).d3plus&&(a.d3plus={}),null==(o=d[e.edges.target].d3plus).edges&&(o.edges={}),ce=d[P].d3plus.x-d[w].d3plus.x,d[w].d3plus.edges[d[P][e.id.value]]={angle:Math.PI,radius:c/2},d[P].d3plus.edges[d[w][e.id.value]]={angle:0,radius:c/2,offset:ce-c}):delete d.d3plus,_=I;return{nodes:e.data.viz,edges:h}},i.filter=function(e,t){var r,s,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z;for(u=e.edges.filtered||e.edges.value,i.paths=a(u,e.focus.value[0],{target:e.focus.value[1],distance:e.edges.size.value||void 0,nodeid:e.id.value,startpoint:e.edges.source,endpoint:e.edges.target,K:e.edges.limit.value||5}),i.nodes=[],r=[],b=i.paths,d=0,v=b.length;d<v;d++)for(x=b[d],w=x.edges,p=0,g=w.length;p<g;p++)l=w[p],k=l[e.edges.source],z=l[e.edges.target],r.indexOf(k[e.id.value])<0&&(i.nodes.push(k),r.push(k[e.id.value])),r.indexOf(z[e.id.value])<0&&(i.nodes.push(z),r.push(z[e.id.value]));for(f=o(i.nodes,e.id.value,n,e),_=[],h=0,m=f.length;h<m;h++)c=f[h],s=t.filter(function(t){return t[e.id.value]===c}),s[0]?_.push(s[0]):(y={d3plus:{}},y[e.id.value]=c,_.push(y));return _},i.nesting=!1,i.requirements=[function(e){return{status:2===e.focus.value.length,text:e.format.locale.value.method.focus+" x 2"}},"edges"],i.scale=1,i.shapes=["circle","square","donut"],i.tooltip="static",t.exports=i},{"../../core/fetch/value.coffee":67,"../../network/shortestPath.coffee":167,"../../util/uniques.coffee":210}],325:[function(e,t,r){var n,a,o,i;n=e("../../array/comparator.coffee"),a=e("../../core/data/threshold.js"),o=e("../../core/data/group.coffee"),i=function(e){var t,r,a,i,s,l,u,c,f;for(u=d3.layout.pie().value(function(e){return e.value}).sort(function(t,r){return e.order.value?n(t.d3plus,r.d3plus,[e.order.value],e.order.sort.value,[],e):e.id.nesting.length>1?n(t.d3plus,r.d3plus,e.id.nesting.concat([e.size.value]),void 0,[],e):n(t.d3plus,r.d3plus,[e.size.value],"desc",[],e)}),r=o(e,e.data.viz,[]),l=u(r),f=[],c=d3.min([e.width.viz,e.height.viz])/2-2*e.labels.padding,a=0,s=l.length;a<s;a++)t=l[a],i=t.data.d3plus,i.d3plus.startAngle=t.startAngle,i.d3plus.endAngle=t.endAngle,i.d3plus.r=c,i.d3plus.x=e.width.viz/2,i.d3plus.y=e.height.viz/2,i.d3plus.share=(t.endAngle-t.startAngle)/(2*Math.PI),f.push(i);return f},i.filter=a,i.requirements=["data","size"],i.shapes=["arc"],i.threshold=function(e){return 1600/(e.width.viz*e.height.viz)},t.exports=i},{"../../array/comparator.coffee":32,"../../core/data/group.coffee":57,"../../core/data/threshold.js":61}],326:[function(e,t,r){var n,a,o,i,s,l,u,c,f,d,p;a=e("../../array/comparator.coffee"),f=e("../../array/sort.coffee"),o=e("../../core/data/threshold.js"),i=e("../../core/fetch/text.js"),s=e("../../core/fetch/value.coffee"),l=e("../../font/sizes.coffee"),u=e("../../geom/offset.coffee"),d=e("../../textwrap/textwrap.coffee"),n=e("../../util/buckets.coffee"),p=e("../../util/uniques.coffee"),c=function(e){var t,r,a,o,c,f,h,v,g,m,y,x,b,w,_,k,z,A,j,M,O,E,F,S,T,B,C,q,N,P,I,D,V,R,U,L,Y,H,X,G,J,W,Q,K,Z,$,ee,te,re,ne,ae,oe,ie,se;for(m=e.data.viz,L=e.depth.value+1,Y=e.id.nesting[L],v=function(){var e,t,r;for(r=[],e=0,t=m.length;e<t;e++)g=m[e],r.push(g[Y]);return r}(),oe=function(){var t,r,n;for(n=[],t=0,r=m.length;t<r;t++)g=m[t],n.push(p(m,Y,s,e,L));return n}(),oe=p(d3.merge(oe)).length,o=2*Math.PI/oe,R=d3.min([e.width.viz,e.height.viz])/2,F=0,B=0,C=function(){var t,r,n;for(n=[],t=0,r=v.length;t<r;t++)f=v[t],n.push(i(e,f,L)[0]);return n}(),C=p(d3.merge(C)),e.labels.value&&(y=u(Math.PI/2,R),ee=u(o+Math.PI/2,R),F=y.x-ee.x-2*e.labels.padding,ne={fill:e.x.ticks.font.color,"font-family":e.x.ticks.font.family.value,"font-weight":e.x.ticks.font.weight,"font-size":e.x.ticks.font.size+"px"},te=l(C,ne,{mod:function(t){return d().container(d3.select(t)).width(e.height.viz/8).height(F).draw()}}),B=d3.max(te,function(e){return e.width}),R-=B,R-=2*e.labels.padding),V=function(){var t,r,n;for(n=[],t=0,r=v.length;t<r;t++)f=v[t],n.push(function(){var t,r,n;for(n=[],t=0,r=f.length;t<r;t++)g=f[t],n.push(s(e,g,e.size.value));return n}());return n}(),V=d3.max(d3.merge(V)),G=d3.scale.linear().domain([0,V]).range([0,R]),k=function(){var t,r,n;for(n=[],t=0,r=v.length;t<r;t++)f=v[t],n.push(s(e,f,Y));return n}(),k=p(d3.merge(k)),_=d3.scale.ordinal().domain(k).range(d3.range(0,k.length)),A=0,q=m.length;A<q;A++)for(g=m[A],g.d3plus.x=e.width.viz/2+e.margin.top,g.d3plus.y=e.height.viz/2+e.margin.left,J=g[Y],w=j=0,N=J.length;j<N;w=++j)t=J[w],t.d3plus||(t.d3plus={}),t.d3plus.r=G(s(e,t,e.size.value)),t.d3plus.a=_(s(e,t,Y))*o;for(z=1,W=[10,5,4,2],D=0,P=W.length;D<P;D++)if(w=W[D],R/w>=20){z=w;break}for(K=n([R/z,R],z-1).reverse(),K.length===z&&K.shift(),$=e.group.selectAll(".d3plus_radar_rings").data(K,function(e,t){return t}),Z=function(t){return t.attr("fill",function(t,r){return 0===r?e.axes.background.color:"transparent"}).attr("cx",e.width.viz/2+e.margin.top).attr("cy",e.height.viz/2+e.margin.left).attr("stroke",e.x.grid.value?e.x.grid.color:"transparent")},$.enter().append("circle").attr("class","d3plus_radar_rings").call(Z).attr("r",0),$.transition().duration(e.draw.timing).call(Z).attr("r",function(e){return e}),$.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),S=d3.scale.ordinal().domain(C).range(d3.range(0,C.length)),O=[],U=0,I=C.length;U<I;U++)M=C[U],r=o*S(M)-Math.PI/2,t=r*(180/Math.PI),t<-90||t>90?(t-=180,c=-(R+2*e.labels.padding+B),a="end"):(c=R+2*e.labels.padding,a="start"),ae=r<0||r>Math.PI,Q=r<Math.PI/2,X=R,e.labels.value&&(X+=e.labels.padding),H=u(r,X),ie=H.x,se=H.y,Q||(ie-=B),ae&&(se-=F),h=[0,Math.PI].indexOf(o*S(M))>=0,h&&(ie-=B/2),O.push({text:M,angle:t,x:c,anchor:a,offset:H});return E=e.group.selectAll("g.d3plus_radar_label_group").data([0]),E.enter().append("g").attr("class","d3plus_radar_label_group").attr("transform","translate("+e.width.viz/2+","+e.height.viz/2+")"),E.transition().duration(e.draw.timing).attr("transform","translate("+e.width.viz/2+","+e.height.viz/2+")"),re=E.selectAll(".d3plus_radar_labels").data(e.labels.value?O:[],function(e,t){return t}),T=function(e){return e.attr(ne).each(function(e,t){return d().container(d3.select(this)).height(F).width(B).align(e.anchor).text(e.text).padding(0).valign("middle").x(e.x).y(-F/2).draw()}).attr("transform",function(e){var t;return t=d3.select(this).attr("transform")||"",t.length&&(t=t.split(")").slice(-3).join(")")),"rotate("+e.angle+")"+t})},re.call(T),re.enter().append("text").attr("class","d3plus_radar_labels").attr("opacity",0).call(T).transition().duration(e.draw.timing).attr("opacity",1),re.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),x=e.group.selectAll(".d3plus_radar_lines").data(O,function(e,t){return t}),b=function(t){return t.attr("stroke",e.x.grid.color).attr("x1",e.width.viz/2+e.margin.left).attr("y1",e.height.viz/2+e.margin.top)},x.enter().append("line").attr("class","d3plus_radar_lines").call(b).attr("x2",e.width.viz/2+e.margin.left).attr("y2",e.height.viz/2+e.margin.top),x.transition().duration(e.draw.timing).call(b).attr("x2",function(t){return e.width.viz/2+e.margin.left+t.offset.x}).attr("y2",function(t){return e.height.viz/2+e.margin.top+t.offset.y}),x.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),e.mouse.viz={click:!1},m},c.requirements=["data","size"],c.shapes=["radial"],t.exports=c},{"../../array/comparator.coffee":32,"../../array/sort.coffee":34,"../../core/data/threshold.js":61,"../../core/fetch/text.js":66,"../../core/fetch/value.coffee":67,"../../font/sizes.coffee":102,"../../geom/offset.coffee":161,"../../textwrap/textwrap.coffee":200,"../../util/buckets.coffee":204,"../../util/uniques.coffee":210}],327:[function(e,t,r){var n=e("../../array/sort.coffee"),o=e("../../client/pointer.coffee"),i=e("../../core/fetch/value.coffee"),s=e("../../core/fetch/color.coffee"),l=e("../../color/legible.coffee"),u=e("../../tooltip/remove.coffee"),c=e("../../network/smallestGap.coffee"),f=e("../../color/text.coffee"),d=e("../../util/uniques.coffee"),p=function(e){var t=d3.min([e.height.viz,e.width.viz])/2,r=e.small||!e.labels.value?(t-2*e.labels.padding)/2:t/3,p=e.small||!e.labels.value?1.4*r:r,h=2*r,v=[],g=[],m=e.data.viz.filter(function(t){return t[e.id.value]===e.focus.value[0]})[0];m||(m={d3plus:{}},m[e.id.value]=e.focus.value[0]),m.d3plus.x=e.width.viz/2,m.d3plus.y=e.height.viz/2,m.d3plus.r=.65*p;var y=[],x=[e.focus.value[0]];e.edges.connections(e.focus.value[0],e.id.value).forEach(function(t){var r=t[e.edges.source][e.id.value]==e.focus.value[0]?t[e.edges.target]:t[e.edges.source],n=e.data.viz.filter(function(t){return t[e.id.value]===r[e.id.value]})[0];n||(n={d3plus:{}},n[e.id.value]=r[e.id.value]),n.d3plus.edges=e.edges.connections(n[e.id.value],e.id.value).filter(function(t){return t[e.edges.source][e.id.value]!=e.focus.value[0]&&t[e.edges.target][e.id.value]!=e.focus.value[0]}),n.d3plus.edge=t,x.push(n[e.id.value]),y.push(n)});var b=e.order.value||e.color.value||e.size.value||e.id.value;y.sort(function(t,r){var a=t.d3plus.edges.length-r.d3plus.edges.length;return a?a:n([t,r],b,e.order.sort.value,e.color.value||[],e)}),"number"==typeof e.edges.limit.value?y=y.slice(0,e.edges.limit.value):"function"==typeof e.edges.limit.value&&(y=e.edges.limit.value(y));var w=[],_=0;y.forEach(function(t){var r=t[e.id.value];t.d3plus.edges=t.d3plus.edges.filter(function(t){var n=t[e.edges.source][e.id.value],a=t[e.edges.target][e.id.value];return x.indexOf(n)<0&&a==r||x.indexOf(a)<0&&n==r}),_+=t.d3plus.edges.length||1,t.d3plus.edges.forEach(function(t){var n=t[e.edges.source],a=t[e.edges.target],o=a[e.id.value]==r?n:a;x.push(o[e.id.value])})}),n(y,b,e.order.sort.value,e.color.value||[],e);var k=0,z=2*Math.PI,A=0;y.forEach(function(t,r){var o=t.d3plus.edges.length||1,i=z/_*o;0==r&&(A=s,k-=i/2);var s=k+i/2;s-=z/4,t.d3plus.radians=s,t.d3plus.x=e.width.viz/2+p*Math.cos(s),t.d3plus.y=e.height.viz/2+p*Math.sin(s),k+=i,t.d3plus.edges.sort(function(r,a){var r=r[e.edges.source][e.id.value]==t[e.id.value]?r[e.edges.target]:r[e.edges.source],a=a[e.edges.source][e.id.value]==t[e.id.value]?a[e.edges.target]:a[e.edges.source];return n([r,a],b,e.order.sort.value,e.color.value||[],e)}),t.d3plus.edges.forEach(function(r,n){var i=r[e.edges.source][e.id.value]==t[e.id.value]?r[e.edges.target]:r[e.edges.source],l=z/_,u=e.data.viz.filter(function(t){return t[e.id.value]===i[e.id.value]})[0];u||(u={d3plus:{}},u[e.id.value]=i[e.id.value]),a=s-l*o/2+l/2+l*n,u.d3plus.radians=a,u.d3plus.x=e.width.viz/2+h*Math.cos(a),u.d3plus.y=e.height.viz/2+h*Math.sin(a),w.push(u)})});var j=c(y,{accessor:function(e){return[e.d3plus.x,e.d3plus.y]}}),M=c(w,{accessor:function(e){return[e.d3plus.x,e.d3plus.y]}});if(j||(j=r/2),M||(M=r/4),j/2-4<8)var O=d3.min([j/2,8]);else var O=j/2-4;if(M/2-4<4)var E=d3.min([M/2,4]);else var E=M/2-4;E>r/10&&(E=r/10),E>O&&E>10&&(E=.75*O),O>1.5*E&&(O=1.5*E),O=Math.floor(O),E=Math.floor(E);var F=d(y,e.id.value,i,e);F=F.concat(d(w,e.id.value,i,e)),F.push(e.focus.value[0]);var S=e.data.viz.filter(function(t){return F.indexOf(t[e.id.value])>=0});if(e.size.value){var T=d3.extent(S,function(t){return i(e,t,e.size.value)});T[0]==T[1]&&(T[0]=0);var t=d3.scale.linear().domain(T).rangeRound([3,d3.min([O,E])]),B=i(e,m,e.size.value);m.d3plus.r=t(B)}else{var t=d3.scale.linear().domain([1,2]).rangeRound([O,E]);e.edges.label&&(m.d3plus.r=1.5*t(1))}w.forEach(function(r){r.d3plus.ring=2;var n=e.size.value?i(e,r,e.size.value):2;r.d3plus.r=t(n)}),y.forEach(function(r){r.d3plus.ring=1;var n=e.size.value?i(e,r,e.size.value):1;r.d3plus.r=t(n)}),g=[m].concat(y).concat(w),y.forEach(function(t,n){var a=[e.edges.source,e.edges.target],o=t.d3plus.edge;a.forEach(function(t){o[t]=g.filter(function(r){return r[e.id.value]==o[t][e.id.value]})[0]}),delete o.d3plus,v.push(o),e.edges.connections(t[e.id.value],e.id.value).forEach(function(n){var a=n[e.edges.source][e.id.value]==t[e.id.value]?n[e.edges.target]:n[e.edges.source];if(a[e.id.value]!=m[e.id.value]){var o=w.filter(function(t){return t[e.id.value]==a[e.id.value]})[0];if(o);else{o=y.filter(function(t){return t[e.id.value]==a[e.id.value]})[0]}if(o){n.d3plus={spline:!0,translate:{x:e.width.viz/2,y:e.height.viz/2}};var i=[e.edges.source,e.edges.target];i.forEach(function(a,i){n[a]=g.filter(function(t){return t[e.id.value]==n[a][e.id.value]})[0],void 0===n[a].d3plus.edges&&(n[a].d3plus.edges={});var s=0===i?n[e.edges.target][e.id.value]:n[e.edges.source][e.id.value];n[a][e.id.value]==t[e.id.value]?n[a].d3plus.edges[s]={angle:t.d3plus.radians+Math.PI,radius:r/2}:n[a].d3plus.edges[s]={angle:o.d3plus.radians,radius:r/2}}),v.push(n)}}})});var C=!1;return e.background.value&&["transparent","none"].indexOf(e.background.value)<0&&d3.hsl(e.background.value).l<.5&&(C=f(e.background.value)),g.forEach(function(t){if(!e.small&&e.labels.value)if(t[e.id.value]!=e.focus.value[0]){t.d3plus.rotate=t.d3plus.radians*(180/Math.PI);var n=t.d3plus.rotate,a=r-3*e.labels.padding-t.d3plus.r;if(n<-90||n>90){n-=180;var o=-(t.d3plus.r+a/2+e.labels.padding),i="end"}else var o=t.d3plus.r+a/2+e.labels.padding,i="start";var u=y.indexOf(t)>=0,c=1==t.d3plus.ring?j:M;t.d3plus.label={x:o,y:0,w:a,h:c,angle:n,anchor:i,valign:"center",color:C||l(s(e,t)),resize:[8,e.labels.font.size],background:u,mouse:!0}}else if(e.size.value||e.edges.label){var c=p-2*t.d3plus.r-2*e.labels.padding;t.d3plus.label={x:0,y:t.d3plus.r+c/2,w:p,h:c,color:C||l(s(e,t)),resize:[10,40],background:!0,mouse:!0}}else delete t.d3plus.rotate,delete t.d3plus.label;else delete t.d3plus.rotate,delete t.d3plus.label}),e.mouse.viz={},e.mouse.viz[o.click]=function(t){if(t[e.id.value]!=e.focus.value[0]){u(e.type.value);var r=e.focus.value[0];e.history.states.push(function(){e.self.focus(r).draw()}),e.self.focus(t[e.id.value]).draw()}},{edges:v,nodes:g,data:S}};p.filter=function(e,t){var r=e.edges.connections(e.focus.value[0],e.id.value,!0),n=[];r.forEach(function(t){n=n.concat(e.edges.connections(t[e.id.value],e.id.value,!0))});var a=r.concat(n),o=d(a,e.id.value,i,e),s=[];return o.forEach(function(r){var n=t.filter(function(t){return t[e.id.value]==r})[0];if(n)s.push(n);else{var a={d3plus:{}};a[e.id.value]=r,s.push(a)}}),s},p.nesting=!1,p.scale=1,p.shapes=["circle","square","donut"],p.requirements=["edges","focus"],p.tooltip="static",t.exports=p},{"../../array/sort.coffee":34,"../../client/pointer.coffee":38,"../../color/legible.coffee":44,"../../color/text.coffee":50,"../../core/fetch/color.coffee":63,"../../core/fetch/value.coffee":67,"../../network/smallestGap.coffee":168,"../../tooltip/remove.coffee":203,"../../util/uniques.coffee":210}],328:[function(e,t,r){var n,a,o,i,s;n=e("./sankey.js"),a=e("../../client/pointer.coffee"),o=e("../../tooltip/remove.coffee"),s=e("../../util/uniques.coffee"),i=function(e){var t,r,i,s,l,u,c,f,d,p,h,v,g,m,y;for(s=e.focus.value[0],v=2*e.data.stroke.width,y=e.size.value.constructor===Number?e.size.value:20,i=e.edges.connections(s,e.id.value).filter(function(t){return t[e.edges.source][e.id.value]!==s||t[e.edges.target][e.id.value]!==s}),h=[],g=[],i=i.map(function(t){var r,n;return t[e.edges.target][e.id.value]===s?(r={id:"left_"+t[e.edges.source][e.id.value],dupe:"left",data:t[e.edges.source],value:t[e.edges.strength.value]},n=t[e.edges.target]):(r=t[e.edges.source],n={id:"right_"+t[e.edges.target][e.id.value],dupe:"right",data:t[e.edges.target],value:t[e.edges.strength.value]}),g.indexOf(r.id)<0&&h.push(r),g.indexOf(n.id)<0&&h.push(n),g.push(r.id),g.push(n.id),{source:r,target:n,value:t[e.edges.strength.value]||1}}),c=n().nodeWidth(y).nodePadding(e.data.padding.value).size([e.width.viz-2*v,e.height.viz-2*v]).nodes(h).links(i).layout(2),m=[],l=0,f=h.length;l<f;l++)p=h[l],t=p.data||p,t={id:t[e.id.value]},t.d3plus={x:p.x+p.dx/2+v,y:p.y+p.dy/2+v,width:p.dx,height:p.dy,suffix:p.dupe},t.id!==s&&(t[e.edges.strength.value]=p.value),m.push(t);for(e.edges.path=c.link(),u=0,d=i.length;u<d;u++)r=i[u],r.d3plus={x:v,y:v};return e.mouse.viz={},e.mouse.viz[a.click]=function(t){var r;if(t[e.id.value]!==e.focus.value[0])return o(e.type.value),r=e.focus.value[0],e.history.states.push(function(){return e.self.focus(r).draw()}),e.self.focus(t[e.id.value]).draw()},{nodes:m,edges:i}},i.requirements=["edges","focus","nodes"],i.shapes=["square"],t.exports=i},{"../../client/pointer.coffee":38,"../../tooltip/remove.coffee":203,"../../util/uniques.coffee":210,"./sankey.js":329}],329:[function(e,t,r){t.exports=function(){function e(){p.forEach(function(e){e.sourceLinks=[],e.targetLinks=[]}),h.forEach(function(e){var t=e.source,r=e.target;"number"==typeof t&&(t=e.source=p[e.source]),"number"==typeof r&&(r=e.target=p[e.target]),t.sourceLinks.push(e),r.targetLinks.push(e)})}function t(){p.forEach(function(e){e.value=Math.max(d3.sum(e.sourceLinks,l),d3.sum(e.targetLinks,l))})}function r(){for(var e,t=p,r=0;t.length;)e=[],t.forEach(function(t){t.x=r,t.dx=c,t.sourceLinks.forEach(function(t){e.indexOf(t.target)<0&&e.push(t.target)})}),t=e,++r;n(r),a((d[0]-c)/(r-1))}function n(e){p.forEach(function(t){t.sourceLinks.length||(t.x=e-1)})}function a(e){p.forEach(function(t){t.x*=e})}function o(e){function t(){var e=d3.min(i,function(e){return(d[1]-(e.length-1)*f)/d3.sum(e,l)});i.forEach(function(t){t.forEach(function(t,r){t.y=r,t.dy=t.value*e})}),h.forEach(function(t){t.dy=t.value*e})}function r(e){function t(e){return s(e.source)*e.value}i.forEach(function(r,n){r.forEach(function(r){if(r.targetLinks.length){var n=d3.sum(r.targetLinks,t)/d3.sum(r.targetLinks,l);r.y+=(n-s(r))*e}})})}function n(e){function t(e){return s(e.target)*e.value}i.slice().reverse().forEach(function(r){r.forEach(function(r){if(r.sourceLinks.length){var n=d3.sum(r.sourceLinks,t)/d3.sum(r.sourceLinks,l);r.y+=(n-s(r))*e}})})}function a(){i.forEach(function(e){var t,r,n,a=0,i=e.length;for(e.sort(o),n=0;n<i;++n)t=e[n],r=a-t.y,r>0&&(t.y+=r),a=t.y+t.dy+f;if(r=a-f-d[1],r>0)for(a=t.y-=r,n=i-2;n>=0;--n)t=e[n],r=t.y+t.dy+f-a,r>0&&(t.y-=r),a=t.y})}function o(e,t){return e.y-t.y}var i=d3.nest().key(function(e){return e.x}).sortKeys(d3.ascending).entries(p).map(function(e){return e.values});t(),a();for(var u=1;e>0;--e)n(u*=.99),a(),r(u),a()}function i(){function e(e,t){return e.source.y-t.source.y}function t(e,t){return e.target.y-t.target.y}p.forEach(function(r){r.sourceLinks.sort(t),r.targetLinks.sort(e)}),p.forEach(function(e){var t=0,r=0;e.sourceLinks.forEach(function(e){e.sy=t,t+=e.dy}),e.targetLinks.forEach(function(e){e.ty=r,r+=e.dy})})}function s(e){return e.y+e.dy/2}function l(e){return e.value}var u={},c=24,f=8,d=[1,1],p=[],h=[];return u.nodeWidth=function(e){return arguments.length?(c=+e,u):c},u.nodePadding=function(e){return arguments.length?(f=+e,u):f},u.nodes=function(e){return arguments.length?(p=e,u):p},u.links=function(e){return arguments.length?(h=e,u):h},u.size=function(e){return arguments.length?(d=e,u):d},u.layout=function(n){return e(),t(),r(),o(n),i(),u},u.relayout=function(){return i(),u},u.link=function(){function e(e){var r=e.source.x+e.source.dx,n=e.target.x,a=d3.interpolateNumber(r,n),o=a(t),i=a(1-t),s=e.source.y+e.sy+e.dy/2,l=e.target.y+e.ty+e.dy/2;return"M"+r+","+s+"C"+o+","+s+" "+i+","+l+" "+n+","+l}var t=.5;return e.curvature=function(r){return arguments.length?(t=+r,e):t},e},u}},{}],330:[function(e,t,r){var n,a,o,i,s,l;n=e("../../core/fetch/value.coffee"),a=e("./helpers/graph/draw.coffee"),o=e("../../core/console/print.coffee"),s=e("../../array/sort.coffee"),l=e("./helpers/graph/dataTicks.coffee"),i=function(e){var t,r,o,i,u;if(a(e,{buffer:"size",mouse:!0}),r=e.x.domain.viz.concat(e.y.domain.viz),r.indexOf(void 0)>=0)return[];for(u=e.data.viz,o=0,i=u.length;o<i;o++)t=u[o],t.d3plus.x=e.x.scale.viz(n(e,t,e.x.value)),t.d3plus.x+=e.axes.margin.viz.left,t.d3plus.y=e.y.scale.viz(n(e,t,e.y.value)),t.d3plus.y+=e.axes.margin.viz.top,"number"!=typeof e.size.value&&e.size.value?t.d3plus.r=e.axes.scale(n(e,t,e.size.value)):t.d3plus.r=e.axes.scale(0);return l(e),s(e.data.viz,e.order.value||e.size.value||e.id.value,"desc"===e.order.sort.value?"asc":"desc",e.color.value||[],e)},i.fill=!0,i.requirements=["data","x","y"],i.scale=1.1,i.setup=function(e){if(e.time.value&&!e.axes.discrete&&(e.time.value===e.x.value&&e.self.x({scale:"discrete"}),e.time.value===e.y.value))return e.self.y({scale:"discrete"})},i.shapes=["circle","square","donut"],i.tooltip="static",t.exports=i},{"../../array/sort.coffee":34,"../../core/console/print.coffee":52,"../../core/fetch/value.coffee":67,"./helpers/graph/dataTicks.coffee":313,"./helpers/graph/draw.coffee":314}],331:[function(e,t,r){var n=e("../../core/fetch/value.coffee"),a=e("../../util/uniques.coffee"),o=e("../../util/copy.coffee"),i=e("../../color/random.coffee"),s=function(e){var t=a(e.data.viz,e.id.value,n,e),r=a(e.cols.value);r.indexOf("label")<0&&e.cols.index.value&&r.unshift("label");var s=e.height.viz/(t.length+1),l=e.width.viz/r.length;e.group.selectAll("rect").data([0]).enter().append("rect").attr("class","background").attr("height",e.height.viz).attr("width",e.width.viz).style("fill",e.color.missing);var u=e.group.selectAll("line.horiz").data(e.data.viz);u.enter().append("line").attr("class","horiz"),u.attr("x1",0).attr("y1",function(e,t){return s*t+s}).attr("x2",e.width.viz).attr("y2",function(e,t){return s*t+s}).style("fill","#fff").style("stroke","#fff"),u.exit().remove(); | |
| var c=e.group.selectAll("line.vert").data(r);c.enter().append("line").attr("class","vert"),c.attr("x1",function(e,t){return l*t+l}).attr("y1",0).attr("x2",function(e,t){return l*t+l}).attr("y2",e.height.viz).style("fill","#fff").style("stroke","#fff"),c.exit().remove();var f=[],d={};return r.forEach(function(t,r){var n={d3plus:{x:l*r+l/2,y:s/2,width:l,height:s,id:"d3p_header_"+t.toString().replace(/ /g,"_"),shape:"square",color:"#fff",text:e.format.value(t)}};if(t==e.id.value&&(n.d3plus.color="#fff"),"label"==t&&(n.d3plus.label=!1,n.d3plus.color="#fff",n.d3plus.stroke="#fff"),f.push(n),"number"==e.data.keys[t]){var a=d3.extent(e.data.viz,function(e){return e[t]});a[0]==a[1]&&(a=[a[0]-1,a[1]]),d[t]=d3.scale.linear().domain(a).range([e.color.missing,i(t)])}else"boolean"==e.data.keys[t]&&(d[t]=function(r){return r?i(t):e.color.missing})}),e.data.viz.forEach(function(t,n){n+=1,r.forEach(function(r,a){var i=o(t);i.d3plus.id="d3p_"+i[e.id.value].toString().replace(/ /g,"_")+"_"+r,i.d3plus.x=l*a+l/2,i.d3plus.y=s*n+s/2,i.d3plus.width=l,i.d3plus.height=s,"label"==r&&(i.d3plus.shape="square",i.d3plus.color="#fff",f.push(i)),d3.keys(t).indexOf(r)>=0&&r in t&&(d[r]&&(i.d3plus.color=d[r](i[r])),i.d3plus.text=e.format.value(i[r]),"boolean"==e.data.keys[r]?i.d3plus.label=!1:"string"==e.data.keys[r]&&(i.d3plus.color=e.color.missing,i.d3plus.stroke="#fff",i.d3plus.shape="square"),f.push(i))})}),f};s.shapes=["check","cross","diamond","square","triangle","triangle_up","triangle_down"],s.requirements=["data","cols"],t.exports=s},{"../../color/random.coffee":47,"../../core/fetch/value.coffee":67,"../../util/copy.coffee":207,"../../util/uniques.coffee":210}],332:[function(e,t,r){var n,a,o,i;n=e("../../core/data/threshold.js"),a=e("../../core/data/group.coffee"),o=e("../../object/merge.coffee"),i=function(e){var t,r,n,i,s,l,u;if(n=a(e,e.data.viz),r=d3.layout.treemap().mode(e.type.mode.value).round(!0).size([e.width.viz,e.height.viz]).children(function(e){return e.values}).padding(e.data.padding.value).sort(function(e,t){var r;return r=e.value-t.value,0===r?e.id<t.id:r}).nodes({name:"root",values:n}).filter(function(e){return!e.values&&e.area}),r.length){for(u=r[0];u.parent;)u=u.parent;for(l=[],i=0,s=r.length;i<s;i++)t=r[i],t.d3plus.d3plus=o(t.d3plus.d3plus,{x:t.x+t.dx/2,y:t.y+t.dy/2,width:t.dx,height:t.dy,share:t.value/u.value}),l.push(t.d3plus)}return l},i.filter=n,i.modes=["squarify","slice","dice","slice-dice"],i.requirements=["data","size"],i.shapes=["square"],i.threshold=function(e){return 1600/(e.width.viz*e.height.viz)},t.exports=i},{"../../core/data/group.coffee":57,"../../core/data/threshold.js":61,"../../object/merge.coffee":171}],333:[function(e,t,r){var n,a,o,i,s,l,u;n=e("../core/methods/attach.coffee"),a=e("./methods/helpers/axis.coffee"),i=e("./helpers/ui/message.js"),s=e("./helpers/drawSteps.js"),l=e("../core/console/print.coffee"),o=e("./helpers/container.coffee"),u=e("../object/validate.coffee"),t.exports=function(){var t;return t={g:{apps:{}},types:{area:e("./types/area.coffee"),bar:e("./types/bar.coffee"),bubbles:e("./types/bubbles.coffee"),box:e("./types/box.coffee"),chart:e("./types/deprecated/chart.coffee"),geo_map:e("./types/geo_map.coffee"),line:e("./types/line.coffee"),network:e("./types/network.js"),paths:e("./types/paths.coffee"),pie:e("./types/pie.coffee"),radar:e("./types/radar.coffee"),rings:e("./types/rings.js"),sankey:e("./types/sankey.coffee"),scatter:e("./types/scatter.coffee"),stacked:e("./types/area.coffee"),table:e("./types/table.js"),tree_map:e("./types/tree_map.coffee")}},t.self=function(e){return e.each(function(){var e,r,n,a,u,c,f;t.draw.frozen=!0,t.error.internal=null,"timing"in t.draw||(t.draw.timing=t.timing.transitions),t.error.value&&(t.draw.timing=0),o(t),c=t.width.value<=t.width.small,u=t.height.value<=t.height.small,t.small=c||u,t.width.viz=t.width.value,t.height.viz=t.height.value,e=!1,r=function(){f.length?a():t.dev.value&&(l.groupEnd(),l.timeEnd("total draw time"),l.log("\n"))},n=function(e,n){n=n||"function",e[n]instanceof Array?e[n].forEach(function(e){e(t,r)}):"function"==typeof e[n]&&e[n](t,r),e.wait||r()},a=function(){var a,o,s,u;u=f.shift(),s=t.g.message&&e===u.message,o=!("check"in u)||u.check,"function"==typeof o&&(o=o(t)),o?s?n(u):(t.dev.value&&(e!==!1&&l.groupEnd(),l.group(u.message)),"string"==typeof t.messages.value?(e=t.messages.value,a=t.messages.value):(e=u.message,a=t.format.value(u.message)),t.draw.update?(i(t,a),t.error.value?n(u):setTimeout(function(){return n(u)},10)):n(u)):"otherwise"in u?t.error.value?n(u,"otherwise"):setTimeout(function(){return n(u,"otherwise")},10):r()},t.messages.style.backup=t.group&&"1"===t.group.attr("opacity")?"small":"large",f=s(t),a()}),t.self},n(t,{active:e("./methods/active.coffee"),aggs:e("./methods/aggs.coffee"),attrs:e("./methods/attrs.coffee"),axes:e("./methods/axes.coffee"),background:e("./methods/background.coffee"),class:e("./methods/class.coffee"),color:e("./methods/color.coffee"),cols:e("./methods/cols.js"),config:e("./methods/config.coffee"),container:e("./methods/container.coffee"),coords:e("./methods/coords.coffee"),csv:e("./methods/csv.coffee"),data:e("./methods/data.coffee"),depth:e("./methods/depth.coffee"),descs:e("./methods/descs.coffee"),dev:e("./methods/dev.coffee"),draw:e("./methods/draw.js"),edges:e("./methods/edges.js"),error:e("./methods/error.coffee"),focus:e("./methods/focus.coffee"),font:e("./methods/font.coffee"),footer:e("./methods/footer.coffee"),format:e("./methods/format.coffee"),height:e("./methods/height.coffee"),history:e("./methods/history.coffee"),icon:e("./methods/icon.coffee"),id:e("./methods/id.coffee"),labels:e("./methods/labels.coffee"),legend:e("./methods/legend.coffee"),links:e("./methods/links.coffee"),margin:e("./methods/margin.coffee"),messages:e("./methods/messages.coffee"),mouse:e("./methods/mouse.coffee"),nodes:e("./methods/nodes.coffee"),order:e("./methods/order.coffee"),resize:e("./methods/resize.coffee"),shape:e("./methods/shape.coffee"),size:e("./methods/size.coffee"),style:e("./methods/style.coffee"),temp:e("./methods/temp.coffee"),text:e("./methods/text.coffee"),time:e("./methods/time.coffee"),timeline:e("./methods/timeline.coffee"),timing:e("./methods/timing.coffee"),title:e("./methods/title.coffee"),tooltip:e("./methods/tooltip.coffee"),total:e("./methods/total.coffee"),type:e("./methods/type.coffee"),ui:e("./methods/ui.coffee"),width:e("./methods/width.coffee"),x:a("x"),x2:a("x2"),y:a("y"),y2:a("y2"),zoom:e("./methods/zoom.js")}),t.self}},{"../core/console/print.coffee":52,"../core/methods/attach.coffee":80,"../object/validate.coffee":172,"./helpers/container.coffee":211,"./helpers/drawSteps.js":212,"./helpers/ui/message.js":246,"./methods/active.coffee":255,"./methods/aggs.coffee":256,"./methods/attrs.coffee":257,"./methods/axes.coffee":258,"./methods/background.coffee":259,"./methods/class.coffee":260,"./methods/color.coffee":261,"./methods/cols.js":262,"./methods/config.coffee":263,"./methods/container.coffee":264,"./methods/coords.coffee":265,"./methods/csv.coffee":266,"./methods/data.coffee":267,"./methods/depth.coffee":268,"./methods/descs.coffee":269,"./methods/dev.coffee":270,"./methods/draw.js":271,"./methods/edges.js":272,"./methods/error.coffee":273,"./methods/focus.coffee":274,"./methods/font.coffee":275,"./methods/footer.coffee":276,"./methods/format.coffee":277,"./methods/height.coffee":278,"./methods/helpers/axis.coffee":279,"./methods/history.coffee":280,"./methods/icon.coffee":281,"./methods/id.coffee":282,"./methods/labels.coffee":283,"./methods/legend.coffee":284,"./methods/links.coffee":285,"./methods/margin.coffee":286,"./methods/messages.coffee":287,"./methods/mouse.coffee":288,"./methods/nodes.coffee":289,"./methods/order.coffee":290,"./methods/resize.coffee":291,"./methods/shape.coffee":292,"./methods/size.coffee":293,"./methods/style.coffee":294,"./methods/temp.coffee":295,"./methods/text.coffee":296,"./methods/time.coffee":297,"./methods/timeline.coffee":298,"./methods/timing.coffee":299,"./methods/title.coffee":300,"./methods/tooltip.coffee":301,"./methods/total.coffee":302,"./methods/type.coffee":303,"./methods/ui.coffee":304,"./methods/width.coffee":305,"./methods/zoom.js":306,"./types/area.coffee":307,"./types/bar.coffee":308,"./types/box.coffee":309,"./types/bubbles.coffee":310,"./types/deprecated/chart.coffee":311,"./types/geo_map.coffee":312,"./types/line.coffee":322,"./types/network.js":323,"./types/paths.coffee":324,"./types/pie.coffee":325,"./types/radar.coffee":326,"./types/rings.js":327,"./types/sankey.coffee":328,"./types/scatter.coffee":330,"./types/table.js":331,"./types/tree_map.coffee":332}]},{},[163]); | |
| </script> | |
| <script> | |
| var nodes = [{"tplName":"Iou","chcName":"Create","id":0,"fields":"issuer\nowner\ncurrency\namount\nobservers\n"},{"tplName":"Iou","chcName":"Archive","id":1,"fields":"issuer\nowner\ncurrency\namount\nobservers\n"},{"tplName":"Iou","chcName":"Iou_Split","id":2,"fields":"issuer\nowner\ncurrency\namount\nobservers\n"},{"tplName":"Iou","chcName":"Iou_Merge","id":3,"fields":"issuer\nowner\ncurrency\namount\nobservers\n"},{"tplName":"Iou","chcName":"Iou_Transfer","id":4,"fields":"issuer\nowner\ncurrency\namount\nobservers\n"},{"tplName":"Iou","chcName":"Iou_AddObserver","id":5,"fields":"issuer\nowner\ncurrency\namount\nobservers\n"},{"tplName":"Iou","chcName":"Iou_RemoveObserver","id":6,"fields":"issuer\nowner\ncurrency\namount\nobservers\n"},{"tplName":"IouTransfer","chcName":"Create","id":7,"fields":"iou.issuer\niou.owner\niou.currency\niou.amount\niou.observers\nnewOwner\n"},{"tplName":"IouTransfer","chcName":"Archive","id":8,"fields":"iou.issuer\niou.owner\niou.currency\niou.amount\niou.observers\nnewOwner\n"},{"tplName":"IouTransfer","chcName":"IouTransfer_Cancel","id":9,"fields":"iou.issuer\niou.owner\niou.currency\niou.amount\niou.observers\nnewOwner\n"},{"tplName":"IouTransfer","chcName":"IouTransfer_Reject","id":10,"fields":"iou.issuer\niou.owner\niou.currency\niou.amount\niou.observers\nnewOwner\n"},{"tplName":"IouTransfer","chcName":"IouTransfer_Accept","id":11,"fields":"iou.issuer\niou.owner\niou.currency\niou.amount\niou.observers\nnewOwner\n"},{"tplName":"IouTrade","chcName":"Create","id":12,"fields":"buyer\nseller\nbaseIouCid\nbaseIssuer\nbaseCurrency\nbaseAmount\nquoteIssuer\nquoteCurrency\nquoteAmount\n"},{"tplName":"IouTrade","chcName":"Archive","id":13,"fields":"buyer\nseller\nbaseIouCid\nbaseIssuer\nbaseCurrency\nbaseAmount\nquoteIssuer\nquoteCurrency\nquoteAmount\n"},{"tplName":"IouTrade","chcName":"IouTrade_Accept","id":14,"fields":"buyer\nseller\nbaseIouCid\nbaseIssuer\nbaseCurrency\nbaseAmount\nquoteIssuer\nquoteCurrency\nquoteAmount\n"},{"tplName":"IouTrade","chcName":"TradeProposal_Reject","id":15,"fields":"buyer\nseller\nbaseIouCid\nbaseIssuer\nbaseCurrency\nbaseAmount\nquoteIssuer\nquoteCurrency\nquoteAmount\n"}] | |
| var links = [{"weight":10,"source":2,"target":0},{"weight":10,"source":3,"target":0},{"weight":10,"source":3,"target":1},{"weight":10,"source":4,"target":7},{"weight":10,"source":5,"target":0},{"weight":10,"source":6,"target":0},{"weight":10,"source":9,"target":0},{"weight":10,"source":10,"target":0},{"weight":10,"source":11,"target":0},{"weight":10,"source":14,"target":4},{"weight":10,"source":14,"target":11}] | |
| d3plus.viz() | |
| .container('#viz') | |
| .type('network') | |
| .data(nodes) | |
| .text('chcName') | |
| .edges({ value: links, arrows: true }) | |
| .tooltip({ | |
| Template: function (d) { return d['tplName'] }, | |
| Fields: function (d) { return d['fields']; } | |
| }) | |
| .draw(); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment