Last active
January 20, 2022 21:42
-
-
Save aaizemberg/00dc5c649fe9f8a5d6a270f78d534593 to your computer and use it in GitHub Desktop.
d3plus treemap provincias y departamentos
This file contains 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
!function e(t,n,r){function a(o,l){if(!n[o]){if(!t[o]){var s="function"==typeof require&&require;if(!l&&s)return s(o,!0);if(i)return i(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[o]={exports:{}};t[o][0].call(c.exports,function(e){var n=t[o][1][e];return a(n?n:e)},c,c.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)a(r[o]);return a}({1:[function(e,t,n){"use strict";function r(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;t<n;++t)s[t]=e[t],u[e.charCodeAt(t)]=t;u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63}function a(e){var t,n,r,a,i,o,l=e.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i="="===e[l-2]?2:"="===e[l-1]?1:0,o=new c(3*l/4-i),r=i>0?l-4:l;var s=0;for(t=0,n=0;t<r;t+=4,n+=3)a=u[e.charCodeAt(t)]<<18|u[e.charCodeAt(t+1)]<<12|u[e.charCodeAt(t+2)]<<6|u[e.charCodeAt(t+3)],o[s++]=a>>16&255,o[s++]=a>>8&255,o[s++]=255&a;return 2===i?(a=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,o[s++]=255&a):1===i&&(a=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,o[s++]=a>>8&255,o[s++]=255&a),o}function i(e){return s[e>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}function o(e,t,n){for(var r,a=[],o=t;o<n;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],a.push(i(r));return a.join("")}function l(e){for(var t,n=e.length,r=n%3,a="",i=[],l=16383,u=0,c=n-r;u<c;u+=l)i.push(o(e,u,u+l>c?c:u+l));return 1===r?(t=e[n-1],a+=s[t>>2],a+=s[t<<4&63],a+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],a+=s[t>>10],a+=s[t>>4&63],a+=s[t<<2&63],a+="="),i.push(a),i.join("")}n.toByteArray=a,n.fromByteArray=l;var s=[],u=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array;r()},{}],2:[function(e,t,n){(function(t){"use strict";function r(){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 o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=o.prototype):(null===e&&(e=new o(t)),e.length=t),e}function o(e,t,n){if(!(o.TYPED_ARRAY_SUPPORT||this instanceof o))return new o(e,t,n);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 l(this,e,t,n)}function l(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?p(e,t,n,r):"string"==typeof t?f(e,t,n):h(e,t)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number')}function u(e,t,n,r){return s(t),t<=0?i(e,t):void 0!==n?"string"==typeof r?i(e,t).fill(n,r):i(e,t).fill(n):i(e,t)}function c(e,t){if(s(t),e=i(e,t<0?0:0|v(t)),!o.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!o.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|m(t,n);e=i(e,r);var a=e.write(t,n);return a!==r&&(e=e.slice(0,a)),e}function d(e,t){var n=0|v(t.length);e=i(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function p(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),o.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=o.prototype):e=d(e,t),e}function h(e,t){if(o.isBuffer(t)){var n=0|v(t.length);return e=i(e,n),0===e.length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||J(t.length)?i(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),o.alloc(+e)}function m(e,t){if(o.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 n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Z(e).length;default:if(r)return H(e).length;t=(""+t).toLowerCase(),r=!0}}function y(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,n);case"utf8":case"utf-8":return S(this,t,n);case"ascii":return N(this,t,n);case"latin1":case"binary":return F(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function x(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,a){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:w(e,t,n,r,a);if("number"==typeof t)return t=255&t,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):w(e,[t],n,r,a);throw new TypeError("val must be string, number or Buffer")}function w(e,t,n,r,a){function i(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,l=e.length,s=t.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,l/=2,s/=2,n/=2}var u;if(a){var c=-1;for(u=n;u<l;u++)if(i(e,u)===i(t,c===-1?0:u-c)){if(c===-1&&(c=u),u-c+1===s)return c*o}else c!==-1&&(u-=u-c),c=-1}else for(n+s>l&&(n=l-s),u=n;u>=0;u--){for(var f=!0,d=0;d<s;d++)if(i(e,u+d)!==i(t,d)){f=!1;break}if(f)return u}return-1}function _(e,t,n,r){n=Number(n)||0;var a=e.length-n;r?(r=Number(r),r>a&&(r=a)):r=a;var i=t.length;if(i%2!==0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var o=0;o<r;++o){var l=parseInt(t.substr(2*o,2),16);if(isNaN(l))return o;e[n+o]=l}return o}function k(e,t,n,r){return W(H(t,e.length-n),e,n,r)}function z(e,t,n,r){return W(X(t),e,n,r)}function M(e,t,n,r){return z(e,t,n,r)}function A(e,t,n,r){return W(Z(t),e,n,r)}function j(e,t,n,r){return W(G(t,e.length-n),e,n,r)}function E(e,t,n){return 0===t&&n===e.length?Q.fromByteArray(e):Q.fromByteArray(e.slice(t,n))}function S(e,t,n){n=Math.min(e.length,n);for(var r=[],a=t;a<n;){var i=e[a],o=null,l=i>239?4:i>223?3:i>191?2:1;if(a+l<=n){var s,u,c,f;switch(l){case 1:i<128&&(o=i);break;case 2:s=e[a+1],128===(192&s)&&(f=(31&i)<<6|63&s,f>127&&(o=f));break;case 3:s=e[a+1],u=e[a+2],128===(192&s)&&128===(192&u)&&(f=(15&i)<<12|(63&s)<<6|63&u,f>2047&&(f<55296||f>57343)&&(o=f));break;case 4:s=e[a+1],u=e[a+2],c=e[a+3],128===(192&s)&&128===(192&u)&&128===(192&c)&&(f=(15&i)<<18|(63&s)<<12|(63&u)<<6|63&c,f>65535&&f<1114112&&(o=f))}}null===o?(o=65533,l=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),a+=l}return O(r)}function O(e){var t=e.length;if(t<=ee)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=ee));return n}function N(e,t,n){var r="";n=Math.min(e.length,n);for(var a=t;a<n;++a)r+=String.fromCharCode(127&e[a]);return r}function F(e,t,n){var r="";n=Math.min(e.length,n);for(var a=t;a<n;++a)r+=String.fromCharCode(e[a]);return r}function C(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var a="",i=t;i<n;++i)a+=Y(e[i]);return a}function T(e,t,n){for(var r=e.slice(t,n),a="",i=0;i<r.length;i+=2)a+=String.fromCharCode(r[i]+256*r[i+1]);return a}function q(e,t,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,r,a,i){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function B(e,t,n,r){t<0&&(t=65535+t+1);for(var a=0,i=Math.min(e.length-n,2);a<i;++a)e[n+a]=(t&255<<8*(r?a:1-a))>>>8*(r?a:1-a)}function D(e,t,n,r){t<0&&(t=4294967295+t+1);for(var a=0,i=Math.min(e.length-n,4);a<i;++a)e[n+a]=t>>>8*(r?a:3-a)&255}function R(e,t,n,r,a,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function I(e,t,n,r,a){return a||R(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),K.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,a){return a||R(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),K.write(e,t,n,r,52,8),n+8}function V(e){if(e=U(e).replace(te,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function U(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 n,r=e.length,a=null,i=[],o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!a){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&i.push(239,191,189);continue}a=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),a=n;continue}n=(a-55296<<10|n-56320)+65536}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function X(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function G(e,t){for(var n,r,a,i=[],o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,a=n%256,i.push(a),i.push(r);return i}function Z(e){return Q.toByteArray(V(e))}function W(e,t,n,r){for(var a=0;a<r&&!(a+n>=t.length||a>=e.length);++a)t[a+n]=e[a];return a}function J(e){return e!==e}var Q=e("base64-js"),K=e("ieee754"),$=e("isarray");n.Buffer=o,n.SlowBuffer=g,n.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:r(),n.kMaxLength=a(),o.poolSize=8192,o._augment=function(e){return e.__proto__=o.prototype,e},o.from=function(e,t,n){return l(null,e,t,n)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(e,t,n){return u(null,e,t,n)},o.allocUnsafe=function(e){return c(null,e)},o.allocUnsafeSlow=function(e){return c(null,e)},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,a=0,i=Math.min(n,r);a<i;++a)if(e[a]!==t[a]){n=e[a],r=t[a];break}return n<r?-1:r<n?1:0},o.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}},o.concat=function(e,t){if(!$(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=o.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var i=e[n];if(!o.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,a),a+=i.length}return r},o.byteLength=m,o.prototype._isBuffer=!0,o.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},o.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},o.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},o.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?S(this,0,e):y.apply(this,arguments)},o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},o.prototype.compare=function(e,t,n,r,a){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),t<0||n>e.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,a>>>=0,this===e)return 0;for(var i=a-r,l=n-t,s=Math.min(i,l),u=this.slice(r,a),c=e.slice(t,n),f=0;f<s;++f)if(u[f]!==c[f]){i=u[f],l=c[f];break}return i<l?-1:l<i?1:0},o.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},o.prototype.indexOf=function(e,t,n){return b(this,e,t,n,!0)},o.prototype.lastIndexOf=function(e,t,n){return b(this,e,t,n,!1)},o.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=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(n)?(n=0|n,void 0===r&&(r="utf8")):(r=n,n=void 0)}var a=this.length-t;if((void 0===n||n>a)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return _(this,e,t,n);case"utf8":case"utf-8":return k(this,e,t,n);case"ascii":return z(this,e,t,n);case"latin1":case"binary":return M(this,e,t,n);case"base64":return A(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ee=4096;o.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var r;if(o.TYPED_ARRAY_SUPPORT)r=this.subarray(e,t),r.__proto__=o.prototype;else{var a=t-e;r=new o(a,(void 0));for(var i=0;i<a;++i)r[i]=this[i+e]}return r},o.prototype.readUIntLE=function(e,t,n){e=0|e,t=0|t,n||q(e,t,this.length);for(var r=this[e],a=1,i=0;++i<t&&(a*=256);)r+=this[e+i]*a;return r},o.prototype.readUIntBE=function(e,t,n){e=0|e,t=0|t,n||q(e,t,this.length);for(var r=this[e+--t],a=1;t>0&&(a*=256);)r+=this[e+--t]*a;return r},o.prototype.readUInt8=function(e,t){return t||q(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||q(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||q(e,2,this.length),this[e]<<8|this[e+1]},o.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]},o.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])},o.prototype.readIntLE=function(e,t,n){e=0|e,t=0|t,n||q(e,t,this.length);for(var r=this[e],a=1,i=0;++i<t&&(a*=256);)r+=this[e+i]*a;return a*=128,r>=a&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e=0|e,t=0|t,n||q(e,t,this.length);for(var r=t,a=1,i=this[e+--r];r>0&&(a*=256);)i+=this[e+--r]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*t)),i},o.prototype.readInt8=function(e,t){return t||q(e,1,this.length),128&this[e]?(255-this[e]+1)*-1:this[e]},o.prototype.readInt16LE=function(e,t){t||q(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){t||q(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.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},o.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]},o.prototype.readFloatLE=function(e,t){return t||q(e,4,this.length),K.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||q(e,4,this.length),K.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||q(e,8,this.length),K.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||q(e,8,this.length),K.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t=0|t,n=0|n,!r){var a=Math.pow(2,8*n)-1;P(this,e,t,n,a,0)}var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},o.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t=0|t,n=0|n,!r){var a=Math.pow(2,8*n)-1;P(this,e,t,n,a,0)}var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},o.prototype.writeUInt8=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):B(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):B(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):D(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t=0|t,!r){var a=Math.pow(2,8*n-1);P(this,e,t,n,a-1,-a)}var i=0,o=1,l=0;for(this[t]=255&e;++i<n&&(o*=256);)e<0&&0===l&&0!==this[t+i-1]&&(l=1),this[t+i]=(e/o>>0)-l&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t=0|t,!r){var a=Math.pow(2,8*n-1);P(this,e,t,n,a-1,-a)}var i=n-1,o=1,l=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===l&&0!==this[t+i+1]&&(l=1),this[t+i]=(e/o>>0)-l&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):B(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):B(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):D(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,n){return I(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return I(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var a,i=r-n;if(this===e&&n<t&&t<r)for(a=i-1;a>=0;--a)e[a+t]=this[a+n];else if(i<1e3||!o.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)e[a+t]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},o.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var a=e.charCodeAt(0);a<256&&(e=a)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e=255&e);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var i;if("number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var l=o.isBuffer(e)?e:H(new o(e,r).toString()),s=l.length;for(i=0;i<n-t;++i)this[i+t]=l[i%s]}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:6,isarray:7}],3:[function(e,t,n){!function(){function e(e){return e&&(e.ownerDocument||e.document||e).documentElement}function n(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}function r(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function a(e){return null===e?NaN:+e}function i(e){return!isNaN(e)}function o(e){return{left:function(t,n,r,a){for(arguments.length<3&&(r=0),arguments.length<4&&(a=t.length);r<a;){var i=r+a>>>1;e(t[i],n)<0?r=i+1:a=i}return r},right:function(t,n,r,a){for(arguments.length<3&&(r=0),arguments.length<4&&(a=t.length);r<a;){var i=r+a>>>1;e(t[i],n)>0?a=i:r=i+1}return r}}}function l(e){return e.length}function s(e){for(var t=1;e*t%1;)t*=10;return t}function u(e,t){for(var n in t)Object.defineProperty(e.prototype,n,{value:t[n],enumerable:!1})}function c(){this._=Object.create(null)}function f(e){return(e+="")===bo||e[0]===wo?wo+e:e}function d(e){return(e+="")[0]===wo?e.slice(1):e}function p(e){return f(e)in this._}function h(e){return(e=f(e))in this._&&delete this._[e]}function v(){var e=[];for(var t in this._)e.push(d(t));return e}function g(){var e=0;for(var t in this._)++e;return e}function m(){for(var e in this._)return!1;return!0}function y(){this._=Object.create(null)}function x(e){return e}function b(e,t,n){return function(){var r=n.apply(t,arguments);return r===t?e:r}}function w(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var n=0,r=_o.length;n<r;++n){var a=_o[n]+t;if(a in e)return a}}function _(){}function k(){}function z(e){function t(){for(var t,r=n,a=-1,i=r.length;++a<i;)(t=r[a].on)&&t.apply(this,arguments);return e}var n=[],r=new c;return t.on=function(t,a){var i,o=r.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,n=n.slice(0,i=n.indexOf(o)).concat(n.slice(i+1)),r.remove(t)),a&&n.push(r.set(t,{on:a})),e)},t}function M(){so.event.preventDefault()}function A(){for(var e,t=so.event;e=t.sourceEvent;)t=e;return t}function j(e){for(var t=new k,n=0,r=arguments.length;++n<r;)t[arguments[n]]=z(t);return t.of=function(n,r){return function(a){try{var i=a.sourceEvent=so.event;a.target=e,so.event=a,t[a.type].apply(n,r)}finally{so.event=i}}},t}function E(e){return zo(e,Eo),e}function S(e){return"function"==typeof e?e:function(){return Mo(e,this)}}function O(e){return"function"==typeof e?e:function(){return Ao(e,this)}}function N(e,t){function n(){this.removeAttribute(e)}function r(){this.removeAttributeNS(e.space,e.local)}function a(){this.setAttribute(e,t)}function i(){this.setAttributeNS(e.space,e.local,t)}function o(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}function l(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}return e=so.ns.qualify(e),null==t?e.local?r:n:"function"==typeof t?e.local?l:o:e.local?i:a}function F(e){return e.trim().replace(/\s+/g," ")}function C(e){return new RegExp("(?:^|\\s+)"+so.requote(e)+"(?:\\s+|$)","g")}function T(e){return(e+"").trim().split(/^|\s+/)}function q(e,t){function n(){for(var n=-1;++n<a;)e[n](this,t)}function r(){for(var n=-1,r=t.apply(this,arguments);++n<a;)e[n](this,r)}e=T(e).map(P);var a=e.length;return"function"==typeof t?r:n}function P(e){var t=C(e);return function(n,r){if(a=n.classList)return r?a.add(e):a.remove(e);var a=n.getAttribute("class")||"";r?(t.lastIndex=0,t.test(a)||n.setAttribute("class",F(a+" "+e))):n.setAttribute("class",F(a.replace(t," ")))}}function B(e,t,n){function r(){this.style.removeProperty(e)}function a(){this.style.setProperty(e,t,n)}function i(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}return null==t?r:"function"==typeof t?i:a}function D(e,t){function n(){delete this[e]}function r(){this[e]=t}function a(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}return null==t?n:"function"==typeof t?a:r}function R(e){function t(){var t=this.ownerDocument,n=this.namespaceURI;return n&&n!==t.documentElement.namespaceURI?t.createElementNS(n,e):t.createElement(e)}function n(){return this.ownerDocument.createElementNS(e.space,e.local)}return"function"==typeof e?e:(e=so.ns.qualify(e)).local?n:t}function I(){var e=this.parentNode;e&&e.removeChild(this)}function L(e){return{__data__:e}}function V(e){return function(){return jo(this,e)}}function U(e){return arguments.length||(e=r),function(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}}function Y(e,t){for(var n=0,r=e.length;n<r;n++)for(var a,i=e[n],o=0,l=i.length;o<l;o++)(a=i[o])&&t(a,o,n);return e}function H(e){return zo(e,Oo),e}function X(e){var t,n;return function(r,a,i){var o,l=e[i].update,s=l.length;for(i!=n&&(n=i,t=0),a>=t&&(t=a+1);!(o=l[t])&&++t<s;);return o}}function G(e,t,n){function r(){var t=this[o];t&&(this.removeEventListener(e,t,t.$),delete this[o])}function a(){var a=s(t,co(arguments));r.call(this),this.addEventListener(e,this[o]=a,a.$=n),a._=t}function i(){var t,n=new RegExp("^__on([^.]+)"+so.requote(e)+"$");for(var r in this)if(t=r.match(n)){var a=this[r];this.removeEventListener(t[1],a,a.$),delete this[r]}}var o="__on"+e,l=e.indexOf("."),s=Z;l>0&&(e=e.slice(0,l));var u=No.get(e);return u&&(e=u,s=W),l?t?a:r:t?_:i}function Z(e,t){return function(n){var r=so.event;so.event=n,t[0]=this.__data__;try{e.apply(this,t)}finally{so.event=r}}}function W(e,t){var n=Z(e,t);return function(e){var t=this,r=e.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||n.call(t,e)}}function J(t){var r=".dragsuppress-"+ ++Co,a="click"+r,i=so.select(n(t)).on("touchmove"+r,M).on("dragstart"+r,M).on("selectstart"+r,M);if(null==Fo&&(Fo=!("onselectstart"in t)&&w(t.style,"userSelect")),Fo){var o=e(t).style,l=o[Fo];o[Fo]="none"}return function(e){if(i.on(r,null),Fo&&(o[Fo]=l),e){var t=function(){i.on(a,null)};i.on(a,function(){M(),t()},!0),setTimeout(t,0)}}}function Q(e,t){t.changedTouches&&(t=t.changedTouches[0]);var r=e.ownerSVGElement||e;if(r.createSVGPoint){var a=r.createSVGPoint();if(To<0){var i=n(e);if(i.scrollX||i.scrollY){r=so.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();To=!(o.f||o.e),r.remove()}}return To?(a.x=t.pageX,a.y=t.pageY):(a.x=t.clientX,a.y=t.clientY),a=a.matrixTransform(e.getScreenCTM().inverse()),[a.x,a.y]}var l=e.getBoundingClientRect();return[t.clientX-l.left-e.clientLeft,t.clientY-l.top-e.clientTop]}function K(){return so.event.changedTouches[0].identifier}function $(e){return e>0?1:e<0?-1:0}function ee(e,t,n){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}function te(e){return e>1?0:e<-1?Bo:Math.acos(e)}function ne(e){return e>1?Io:e<-1?-Io:Math.asin(e)}function re(e){return((e=Math.exp(e))-1/e)/2}function ae(e){return((e=Math.exp(e))+1/e)/2}function ie(e){return((e=Math.exp(2*e))-1)/(e+1)}function oe(e){return(e=Math.sin(e/2))*e}function le(){}function se(e,t,n){return this instanceof se?(this.h=+e,this.s=+t,void(this.l=+n)):arguments.length<2?e instanceof se?new se(e.h,e.s,e.l):_e(""+e,ke,se):new se(e,t,n)}function ue(e,t,n){function r(e){return e>360?e-=360:e<0&&(e+=360),e<60?i+(o-i)*e/60:e<180?o:e<240?i+(o-i)*(240-e)/60:i}function a(e){return Math.round(255*r(e))}var i,o;return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)?0:t<0?0:t>1?1:t,n=n<0?0:n>1?1:n,o=n<=.5?n*(1+t):n+t-n*t,i=2*n-o,new ye(a(e+120),a(e),a(e-120))}function ce(e,t,n){return this instanceof ce?(this.h=+e,this.c=+t,void(this.l=+n)):arguments.length<2?e instanceof ce?new ce(e.h,e.c,e.l):e instanceof de?he(e.l,e.a,e.b):he((e=ze((e=so.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new ce(e,t,n)}function fe(e,t,n){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new de(n,Math.cos(e*=Lo)*t,Math.sin(e)*t)}function de(e,t,n){return this instanceof de?(this.l=+e,this.a=+t,void(this.b=+n)):arguments.length<2?e instanceof de?new de(e.l,e.a,e.b):e instanceof ce?fe(e.h,e.c,e.l):ze((e=ye(e)).r,e.g,e.b):new de(e,t,n)}function pe(e,t,n){var r=(e+16)/116,a=r+t/500,i=r-n/200;return a=ve(a)*Ko,r=ve(r)*$o,i=ve(i)*el,new ye(me(3.2404542*a-1.5371385*r-.4985314*i),me(-.969266*a+1.8760108*r+.041556*i),me(.0556434*a-.2040259*r+1.0572252*i))}function he(e,t,n){return e>0?new ce(Math.atan2(n,t)*Vo,Math.sqrt(t*t+n*n),e):new ce(NaN,NaN,e)}function ve(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function ge(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function me(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function ye(e,t,n){return this instanceof ye?(this.r=~~e,this.g=~~t,void(this.b=~~n)):arguments.length<2?e instanceof ye?new ye(e.r,e.g,e.b):_e(""+e,ye,ue):new ye(e,t,n)}function xe(e){return new ye(e>>16,e>>8&255,255&e)}function be(e){return xe(e)+""}function we(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function _e(e,t,n){var r,a,i,o=0,l=0,s=0;if(r=/([a-z]+)\((.*)\)/.exec(e=e.toLowerCase()))switch(a=r[2].split(","),r[1]){case"hsl":return n(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return t(Ae(a[0]),Ae(a[1]),Ae(a[2]))}return(i=rl.get(e))?t(i.r,i.g,i.b):(null==e||"#"!==e.charAt(0)||isNaN(i=parseInt(e.slice(1),16))||(4===e.length?(o=(3840&i)>>4,o=o>>4|o,l=240&i,l=l>>4|l,s=15&i,s=s<<4|s):7===e.length&&(o=(16711680&i)>>16,l=(65280&i)>>8,s=255&i)),t(o,l,s))}function ke(e,t,n){var r,a,i=Math.min(e/=255,t/=255,n/=255),o=Math.max(e,t,n),l=o-i,s=(o+i)/2;return l?(a=s<.5?l/(o+i):l/(2-o-i),r=e==o?(t-n)/l+(t<n?6:0):t==o?(n-e)/l+2:(e-t)/l+4,r*=60):(r=NaN,a=s>0&&s<1?0:r),new se(r,a,s)}function ze(e,t,n){e=Me(e),t=Me(t),n=Me(n);var r=ge((.4124564*e+.3575761*t+.1804375*n)/Ko),a=ge((.2126729*e+.7151522*t+.072175*n)/$o),i=ge((.0193339*e+.119192*t+.9503041*n)/el);return de(116*a-16,500*(r-a),200*(a-i))}function Me(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ae(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}function je(e){return"function"==typeof e?e:function(){return e}}function Ee(e){return function(t,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=null),Se(t,n,e,r)}}function Se(e,t,n,r){function a(){var e,t=s.status;if(!t&&Ne(s)||t>=200&&t<300||304===t){try{e=n.call(i,s)}catch(e){return void o.error.call(i,e)}o.load.call(i,e)}else o.error.call(i,s)}var i={},o=so.dispatch("beforesend","progress","load","error"),l={},s=new XMLHttpRequest,u=null; | |
return!this.XDomainRequest||"withCredentials"in s||!/^(http(s)?:)?\/\//.test(e)||(s=new XDomainRequest),"onload"in s?s.onload=s.onerror=a:s.onreadystatechange=function(){s.readyState>3&&a()},s.onprogress=function(e){var t=so.event;so.event=e;try{o.progress.call(i,s)}finally{so.event=t}},i.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?l[e]:(null==t?delete l[e]:l[e]=t+"",i)},i.mimeType=function(e){return arguments.length?(t=null==e?null:e+"",i):t},i.responseType=function(e){return arguments.length?(u=e,i):u},i.response=function(e){return n=e,i},["get","post"].forEach(function(e){i[e]=function(){return i.send.apply(i,[e].concat(co(arguments)))}}),i.send=function(n,r,a){if(2===arguments.length&&"function"==typeof r&&(a=r,r=null),s.open(n,e,!0),null==t||"accept"in l||(l.accept=t+",*/*"),s.setRequestHeader)for(var c in l)s.setRequestHeader(c,l[c]);return null!=t&&s.overrideMimeType&&s.overrideMimeType(t),null!=u&&(s.responseType=u),null!=a&&i.on("error",a).on("load",function(e){a(null,e)}),o.beforesend.call(i,s),s.send(null==r?null:r),i},i.abort=function(){return s.abort(),i},so.rebind(i,o,"on"),null==r?i:i.get(Oe(r))}function Oe(e){return 1===e.length?function(t,n){e(null==t?n:null)}:e}function Ne(e){var t=e.responseType;return t&&"text"!==t?e.response:e.responseText}function Fe(e,t,n){var r=arguments.length;r<2&&(t=0),r<3&&(n=Date.now());var a=n+t,i={c:e,t:a,n:null};return il?il.n=i:al=i,il=i,ol||(ll=clearTimeout(ll),ol=1,sl(Ce)),i}function Ce(){var e=Te(),t=qe()-e;t>24?(isFinite(t)&&(clearTimeout(ll),ll=setTimeout(Ce,t)),ol=0):(ol=1,sl(Ce))}function Te(){for(var e=Date.now(),t=al;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function qe(){for(var e,t=al,n=1/0;t;)t.c?(t.t<n&&(n=t.t),t=(e=t).n):t=e?e.n=t.n:al=t.n;return il=e,n}function Pe(e,t){return t-(e?Math.ceil(Math.log(e)/Math.LN10):1)}function Be(e,t){var n=Math.pow(10,3*xo(8-t));return{scale:t>8?function(e){return e/n}:function(e){return e*n},symbol:e}}function De(e){var t=e.decimal,n=e.thousands,r=e.grouping,a=e.currency,i=r&&n?function(e,t){for(var a=e.length,i=[],o=0,l=r[0],s=0;a>0&&l>0&&(s+l+1>t&&(l=Math.max(1,t-s)),i.push(e.substring(a-=l,a+l)),!((s+=l+1)>t));)l=r[o=(o+1)%r.length];return i.reverse().join(n)}:x;return function(e){var n=cl.exec(e),r=n[1]||" ",o=n[2]||">",l=n[3]||"-",s=n[4]||"",u=n[5],c=+n[6],f=n[7],d=n[8],p=n[9],h=1,v="",g="",m=!1,y=!0;switch(d&&(d=+d.substring(1)),(u||"0"===r&&"="===o)&&(u=r="0",o="="),p){case"n":f=!0,p="g";break;case"%":h=100,g="%",p="f";break;case"p":h=100,g="%",p="r";break;case"b":case"o":case"x":case"X":"#"===s&&(v="0"+p.toLowerCase());case"c":y=!1;case"d":m=!0,d=0;break;case"s":h=-1,p="r"}"$"===s&&(v=a[0],g=a[1]),"r"!=p||d||(p="g"),null!=d&&("g"==p?d=Math.max(1,Math.min(21,d)):"e"!=p&&"f"!=p||(d=Math.max(0,Math.min(20,d)))),p=fl.get(p)||Re;var x=u&&f;return function(e){var n=g;if(m&&e%1)return"";var a=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===l?"":l;if(h<0){var s=so.formatPrefix(e,d);e=s.scale(e),n=s.symbol+g}else e*=h;e=p(e,d);var b,w,_=e.lastIndexOf(".");if(_<0){var k=y?e.lastIndexOf("e"):-1;k<0?(b=e,w=""):(b=e.substring(0,k),w=e.substring(k))}else b=e.substring(0,_),w=t+e.substring(_+1);!u&&f&&(b=i(b,1/0));var z=v.length+b.length+w.length+(x?0:a.length),M=z<c?new Array(z=c-z+1).join(r):"";return x&&(b=i(M+b,M.length?c-w.length:1/0)),a+=v,e=b+w,("<"===o?a+e+M:">"===o?M+a+e:"^"===o?M.substring(0,z>>=1)+a+e+M.substring(z):a+(x?e:M+e))+n}}}function Re(e){return e+""}function Ie(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Le(e,t,n){function r(t){var n=e(t),r=i(n,1);return t-n<r-t?n:r}function a(n){return t(n=e(new pl(n-1)),1),n}function i(e,n){return t(e=new pl((+e)),n),e}function o(e,r,i){var o=a(e),l=[];if(i>1)for(;o<r;)n(o)%i||l.push(new Date((+o))),t(o,1);else for(;o<r;)l.push(new Date((+o))),t(o,1);return l}function l(e,t,n){try{pl=Ie;var r=new Ie;return r._=e,o(r,t,n)}finally{pl=Date}}e.floor=e,e.round=r,e.ceil=a,e.offset=i,e.range=o;var s=e.utc=Ve(e);return s.floor=s,s.round=Ve(r),s.ceil=Ve(a),s.offset=Ve(i),s.range=l,e}function Ve(e){return function(t,n){try{pl=Ie;var r=new Ie;return r._=t,e(r,n)._}finally{pl=Date}}}function Ue(e){function t(e){function t(t){for(var n,a,i,o=[],l=-1,s=0;++l<r;)37===e.charCodeAt(l)&&(o.push(e.slice(s,l)),null!=(a=vl[n=e.charAt(++l)])&&(n=e.charAt(++l)),(i=E[n])&&(n=i(t,null==a?"e"===n?" ":"0":a)),o.push(n),s=l+1);return o.push(e.slice(s,l)),o.join("")}var r=e.length;return t.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},a=n(r,e,t,0);if(a!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var i=null!=r.Z&&pl!==Ie,o=new(i?Ie:pl);return"j"in r?o.setFullYear(r.y,0,r.j):"W"in r||"U"in r?("w"in r||(r.w="W"in r?1:0),o.setFullYear(r.y,0,1),o.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(o.getDay()+5)%7:r.w+7*r.U-(o.getDay()+6)%7)):o.setFullYear(r.y,r.m,r.d),o.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),i?o._:o},t.toString=function(){return e},t}function n(e,t,n,r){for(var a,i,o,l=0,s=t.length,u=n.length;l<s;){if(r>=u)return-1;if(a=t.charCodeAt(l++),37===a){if(o=t.charAt(l++),i=S[o in vl?t.charAt(l++):o],!i||(r=i(e,n,r))<0)return-1}else if(a!=n.charCodeAt(r++))return-1}return r}function r(e,t,n){_.lastIndex=0;var r=_.exec(t.slice(n));return r?(e.w=k.get(r[0].toLowerCase()),n+r[0].length):-1}function a(e,t,n){b.lastIndex=0;var r=b.exec(t.slice(n));return r?(e.w=w.get(r[0].toLowerCase()),n+r[0].length):-1}function i(e,t,n){A.lastIndex=0;var r=A.exec(t.slice(n));return r?(e.m=j.get(r[0].toLowerCase()),n+r[0].length):-1}function o(e,t,n){z.lastIndex=0;var r=z.exec(t.slice(n));return r?(e.m=M.get(r[0].toLowerCase()),n+r[0].length):-1}function l(e,t,r){return n(e,E.c.toString(),t,r)}function s(e,t,r){return n(e,E.x.toString(),t,r)}function u(e,t,r){return n(e,E.X.toString(),t,r)}function c(e,t,n){var r=x.get(t.slice(n,n+=2).toLowerCase());return null==r?-1:(e.p=r,n)}var f=e.dateTime,d=e.date,p=e.time,h=e.periods,v=e.days,g=e.shortDays,m=e.months,y=e.shortMonths;t.utc=function(e){function n(e){try{pl=Ie;var t=new pl;return t._=e,r(t)}finally{pl=Date}}var r=t(e);return n.parse=function(e){try{pl=Ie;var t=r.parse(e);return t&&t._}finally{pl=Date}},n.toString=r.toString,n},t.multi=t.utc.multi=ut;var x=so.map(),b=He(v),w=Xe(v),_=He(g),k=Xe(g),z=He(m),M=Xe(m),A=He(y),j=Xe(y);h.forEach(function(e,t){x.set(e.toLowerCase(),t)});var E={a:function(e){return g[e.getDay()]},A:function(e){return v[e.getDay()]},b:function(e){return y[e.getMonth()]},B:function(e){return m[e.getMonth()]},c:t(f),d:function(e,t){return Ye(e.getDate(),t,2)},e:function(e,t){return Ye(e.getDate(),t,2)},H:function(e,t){return Ye(e.getHours(),t,2)},I:function(e,t){return Ye(e.getHours()%12||12,t,2)},j:function(e,t){return Ye(1+dl.dayOfYear(e),t,3)},L:function(e,t){return Ye(e.getMilliseconds(),t,3)},m:function(e,t){return Ye(e.getMonth()+1,t,2)},M:function(e,t){return Ye(e.getMinutes(),t,2)},p:function(e){return h[+(e.getHours()>=12)]},S:function(e,t){return Ye(e.getSeconds(),t,2)},U:function(e,t){return Ye(dl.sundayOfYear(e),t,2)},w:function(e){return e.getDay()},W:function(e,t){return Ye(dl.mondayOfYear(e),t,2)},x:t(d),X:t(p),y:function(e,t){return Ye(e.getFullYear()%100,t,2)},Y:function(e,t){return Ye(e.getFullYear()%1e4,t,4)},Z:lt,"%":function(){return"%"}},S={a:r,A:a,b:i,B:o,c:l,d:tt,e:tt,H:rt,I:rt,j:nt,L:ot,m:et,M:at,p:c,S:it,U:Ze,w:Ge,W:We,x:s,X:u,y:Qe,Y:Je,Z:Ke,"%":st};return t}function Ye(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",i=a.length;return r+(i<n?new Array(n-i+1).join(t)+a:a)}function He(e){return new RegExp("^(?:"+e.map(so.requote).join("|")+")","i")}function Xe(e){for(var t=new c,n=-1,r=e.length;++n<r;)t.set(e[n].toLowerCase(),n);return t}function Ge(e,t,n){gl.lastIndex=0;var r=gl.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Ze(e,t,n){gl.lastIndex=0;var r=gl.exec(t.slice(n));return r?(e.U=+r[0],n+r[0].length):-1}function We(e,t,n){gl.lastIndex=0;var r=gl.exec(t.slice(n));return r?(e.W=+r[0],n+r[0].length):-1}function Je(e,t,n){gl.lastIndex=0;var r=gl.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Qe(e,t,n){gl.lastIndex=0;var r=gl.exec(t.slice(n,n+2));return r?(e.y=$e(+r[0]),n+r[0].length):-1}function Ke(e,t,n){return/^[+-]\d{4}$/.test(t=t.slice(n,n+5))?(e.Z=-t,n+5):-1}function $e(e){return e+(e>68?1900:2e3)}function et(e,t,n){gl.lastIndex=0;var r=gl.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function tt(e,t,n){gl.lastIndex=0;var r=gl.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function nt(e,t,n){gl.lastIndex=0;var r=gl.exec(t.slice(n,n+3));return r?(e.j=+r[0],n+r[0].length):-1}function rt(e,t,n){gl.lastIndex=0;var r=gl.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function at(e,t,n){gl.lastIndex=0;var r=gl.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function it(e,t,n){gl.lastIndex=0;var r=gl.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function ot(e,t,n){gl.lastIndex=0;var r=gl.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function lt(e){var t=e.getTimezoneOffset(),n=t>0?"-":"+",r=xo(t)/60|0,a=xo(t)%60;return n+Ye(r,"0",2)+Ye(a,"0",2)}function st(e,t,n){ml.lastIndex=0;var r=ml.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function ut(e){for(var t=e.length,n=-1;++n<t;)e[n][0]=this(e[n][0]);return function(t){for(var n=0,r=e[n];!r[1](t);)r=e[++n];return r[0](t)}}function ct(){}function ft(e,t,n){var r=n.s=e+t,a=r-e,i=r-a;n.t=e-i+(t-a)}function dt(e,t){e&&wl.hasOwnProperty(e.type)&&wl[e.type](e,t)}function pt(e,t,n){var r,a=-1,i=e.length-n;for(t.lineStart();++a<i;)r=e[a],t.point(r[0],r[1],r[2]);t.lineEnd()}function ht(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)pt(e[n],t,1);t.polygonEnd()}function vt(){function e(e,t){e*=Lo,t=t*Lo/2+Bo/4;var n=e-r,o=n>=0?1:-1,l=o*n,s=Math.cos(t),u=Math.sin(t),c=i*u,f=a*s+c*Math.cos(l),d=c*o*Math.sin(l);kl.add(Math.atan2(d,f)),r=e,a=s,i=u}var t,n,r,a,i;zl.point=function(o,l){zl.point=e,r=(t=o)*Lo,a=Math.cos(l=(n=l)*Lo/2+Bo/4),i=Math.sin(l)},zl.lineEnd=function(){e(t,n)}}function gt(e){var t=e[0],n=e[1],r=Math.cos(n);return[r*Math.cos(t),r*Math.sin(t),Math.sin(n)]}function mt(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function yt(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function xt(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function bt(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function wt(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function _t(e){return[Math.atan2(e[1],e[0]),ne(e[2])]}function kt(e,t){return xo(e[0]-t[0])<qo&&xo(e[1]-t[1])<qo}function zt(e,t){e*=Lo;var n=Math.cos(t*=Lo);Mt(n*Math.cos(e),n*Math.sin(e),Math.sin(t))}function Mt(e,t,n){++Ml,jl+=(e-jl)/Ml,El+=(t-El)/Ml,Sl+=(n-Sl)/Ml}function At(){function e(e,a){e*=Lo;var i=Math.cos(a*=Lo),o=i*Math.cos(e),l=i*Math.sin(e),s=Math.sin(a),u=Math.atan2(Math.sqrt((u=n*s-r*l)*u+(u=r*o-t*s)*u+(u=t*l-n*o)*u),t*o+n*l+r*s);Al+=u,Ol+=u*(t+(t=o)),Nl+=u*(n+(n=l)),Fl+=u*(r+(r=s)),Mt(t,n,r)}var t,n,r;Pl.point=function(a,i){a*=Lo;var o=Math.cos(i*=Lo);t=o*Math.cos(a),n=o*Math.sin(a),r=Math.sin(i),Pl.point=e,Mt(t,n,r)}}function jt(){Pl.point=zt}function Et(){function e(e,t){e*=Lo;var n=Math.cos(t*=Lo),o=n*Math.cos(e),l=n*Math.sin(e),s=Math.sin(t),u=a*s-i*l,c=i*o-r*s,f=r*l-a*o,d=Math.sqrt(u*u+c*c+f*f),p=r*o+a*l+i*s,h=d&&-te(p)/d,v=Math.atan2(d,p);Cl+=h*u,Tl+=h*c,ql+=h*f,Al+=v,Ol+=v*(r+(r=o)),Nl+=v*(a+(a=l)),Fl+=v*(i+(i=s)),Mt(r,a,i)}var t,n,r,a,i;Pl.point=function(o,l){t=o,n=l,Pl.point=e,o*=Lo;var s=Math.cos(l*=Lo);r=s*Math.cos(o),a=s*Math.sin(o),i=Math.sin(l),Mt(r,a,i)},Pl.lineEnd=function(){e(t,n),Pl.lineEnd=jt,Pl.point=zt}}function St(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return n=t.invert(n,r),n&&e.invert(n[0],n[1])}),n}function Ot(){return!0}function Nt(e,t,n,r,a){var i=[],o=[];if(e.forEach(function(e){if(!((t=e.length-1)<=0)){var t,n=e[0],r=e[t];if(kt(n,r)){a.lineStart();for(var l=0;l<t;++l)a.point((n=e[l])[0],n[1]);return void a.lineEnd()}var s=new Ct(n,e,null,(!0)),u=new Ct(n,null,s,(!1));s.o=u,i.push(s),o.push(u),s=new Ct(r,e,null,(!1)),u=new Ct(r,null,s,(!0)),s.o=u,i.push(s),o.push(u)}}),o.sort(t),Ft(i),Ft(o),i.length){for(var l=0,s=n,u=o.length;l<u;++l)o[l].e=s=!s;for(var c,f,d=i[0];;){for(var p=d,h=!0;p.v;)if((p=p.n)===d)return;c=p.z,a.lineStart();do{if(p.v=p.o.v=!0,p.e){if(h)for(var l=0,u=c.length;l<u;++l)a.point((f=c[l])[0],f[1]);else r(p.x,p.n.x,1,a);p=p.n}else{if(h){c=p.p.z;for(var l=c.length-1;l>=0;--l)a.point((f=c[l])[0],f[1])}else r(p.x,p.p.x,-1,a);p=p.p}p=p.o,c=p.z,h=!h}while(!p.v);a.lineEnd()}}}function Ft(e){if(t=e.length){for(var t,n,r=0,a=e[0];++r<t;)a.n=n=e[r],n.p=a,a=n;a.n=n=e[0],n.p=a}}function Ct(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function Tt(e,t,n,r){return function(a,i){function o(t,n){var r=a(t,n);e(t=r[0],n=r[1])&&i.point(t,n)}function l(e,t){var n=a(e,t);g.point(n[0],n[1])}function s(){y.point=l,g.lineStart()}function u(){y.point=o,g.lineEnd()}function c(e,t){v.push([e,t]);var n=a(e,t);b.point(n[0],n[1])}function f(){b.lineStart(),v=[]}function d(){c(v[0][0],v[0][1]),b.lineEnd();var e,t=b.clean(),n=x.buffer(),r=n.length;if(v.pop(),h.push(v),v=null,r)if(1&t){e=n[0];var a,r=e.length-1,o=-1;if(r>0){for(w||(i.polygonStart(),w=!0),i.lineStart();++o<r;)i.point((a=e[o])[0],a[1]);i.lineEnd()}}else r>1&&2&t&&n.push(n.pop().concat(n.shift())),p.push(n.filter(qt))}var p,h,v,g=t(i),m=a.invert(r[0],r[1]),y={point:o,lineStart:s,lineEnd:u,polygonStart:function(){y.point=c,y.lineStart=f,y.lineEnd=d,p=[],h=[]},polygonEnd:function(){y.point=o,y.lineStart=s,y.lineEnd=u,p=so.merge(p);var e=Lt(m,h);p.length?(w||(i.polygonStart(),w=!0),Nt(p,Bt,e,n,i)):e&&(w||(i.polygonStart(),w=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),w&&(i.polygonEnd(),w=!1),p=h=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}},x=Pt(),b=t(x),w=!1;return y}}function qt(e){return e.length>1}function Pt(){var e,t=[];return{lineStart:function(){t.push(e=[])},point:function(t,n){e.push([t,n])},lineEnd:_,buffer:function(){var n=t;return t=[],e=null,n},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Bt(e,t){return((e=e.x)[0]<0?e[1]-Io-qo:Io-e[1])-((t=t.x)[0]<0?t[1]-Io-qo:Io-t[1])}function Dt(e){var t,n=NaN,r=NaN,a=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(i,o){var l=i>0?Bo:-Bo,s=xo(i-n);xo(s-Bo)<qo?(e.point(n,r=(r+o)/2>0?Io:-Io),e.point(a,r),e.lineEnd(),e.lineStart(),e.point(l,r),e.point(i,r),t=0):a!==l&&s>=Bo&&(xo(n-a)<qo&&(n-=a*qo),xo(i-l)<qo&&(i-=l*qo),r=Rt(n,r,i,o),e.point(a,r),e.lineEnd(),e.lineStart(),e.point(l,r),t=0),e.point(n=i,r=o),a=l},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}}function Rt(e,t,n,r){var a,i,o=Math.sin(e-n);return xo(o)>qo?Math.atan((Math.sin(t)*(i=Math.cos(r))*Math.sin(n)-Math.sin(r)*(a=Math.cos(t))*Math.sin(e))/(a*i*o)):(t+r)/2}function It(e,t,n,r){var a;if(null==e)a=n*Io,r.point(-Bo,a),r.point(0,a),r.point(Bo,a),r.point(Bo,0),r.point(Bo,-a),r.point(0,-a),r.point(-Bo,-a),r.point(-Bo,0),r.point(-Bo,a);else if(xo(e[0]-t[0])>qo){var i=e[0]<t[0]?Bo:-Bo;a=n*i/2,r.point(-i,a),r.point(0,a),r.point(i,a)}else r.point(t[0],t[1])}function Lt(e,t){var n=e[0],r=e[1],a=[Math.sin(n),-Math.cos(n),0],i=0,o=0;kl.reset();for(var l=0,s=t.length;l<s;++l){var u=t[l],c=u.length;if(c)for(var f=u[0],d=f[0],p=f[1]/2+Bo/4,h=Math.sin(p),v=Math.cos(p),g=1;;){g===c&&(g=0),e=u[g];var m=e[0],y=e[1]/2+Bo/4,x=Math.sin(y),b=Math.cos(y),w=m-d,_=w>=0?1:-1,k=_*w,z=k>Bo,M=h*x;if(kl.add(Math.atan2(M*_*Math.sin(k),v*b+M*Math.cos(k))),i+=z?w+_*Do:w,z^d>=n^m>=n){var A=yt(gt(f),gt(e));wt(A);var j=yt(a,A);wt(j);var E=(z^w>=0?-1:1)*ne(j[2]);(r>E||r===E&&(A[0]||A[1]))&&(o+=z^w>=0?1:-1)}if(!g++)break;d=m,h=x,v=b,f=e}}return(i<-qo||i<qo&&kl<0)^1&o}function Vt(e){function t(e,t){return Math.cos(e)*Math.cos(t)>i}function n(e){var n,i,s,u,c;return{lineStart:function(){u=s=!1,c=1},point:function(f,d){var p,h=[f,d],v=t(f,d),g=o?v?0:a(f,d):v?a(f+(f<0?Bo:-Bo),d):0;if(!n&&(u=s=v)&&e.lineStart(),v!==s&&(p=r(n,h),(kt(n,p)||kt(h,p))&&(h[0]+=qo,h[1]+=qo,v=t(h[0],h[1]))),v!==s)c=0,v?(e.lineStart(),p=r(h,n),e.point(p[0],p[1])):(p=r(n,h),e.point(p[0],p[1]),e.lineEnd()),n=p;else if(l&&n&&o^v){var m;g&i||!(m=r(h,n,!0))||(c=0,o?(e.lineStart(),e.point(m[0][0],m[0][1]),e.point(m[1][0],m[1][1]),e.lineEnd()):(e.point(m[1][0],m[1][1]),e.lineEnd(),e.lineStart(),e.point(m[0][0],m[0][1])))}!v||n&&kt(n,h)||e.point(h[0],h[1]),n=h,s=v,i=g},lineEnd:function(){s&&e.lineEnd(),n=null},clean:function(){return c|(u&&s)<<1}}}function r(e,t,n){var r=gt(e),a=gt(t),o=[1,0,0],l=yt(r,a),s=mt(l,l),u=l[0],c=s-u*u;if(!c)return!n&&e;var f=i*s/c,d=-i*u/c,p=yt(o,l),h=bt(o,f),v=bt(l,d);xt(h,v);var g=p,m=mt(h,g),y=mt(g,g),x=m*m-y*(mt(h,h)-1);if(!(x<0)){var b=Math.sqrt(x),w=bt(g,(-m-b)/y);if(xt(w,h),w=_t(w),!n)return w;var _,k=e[0],z=t[0],M=e[1],A=t[1];z<k&&(_=k,k=z,z=_);var j=z-k,E=xo(j-Bo)<qo,S=E||j<qo;if(!E&&A<M&&(_=M,M=A,A=_),S?E?M+A>0^w[1]<(xo(w[0]-k)<qo?M:A):M<=w[1]&&w[1]<=A:j>Bo^(k<=w[0]&&w[0]<=z)){var O=bt(g,(-m+b)/y);return xt(O,h),[w,_t(O)]}}}function a(t,n){var r=o?e:Bo-e,a=0;return t<-r?a|=1:t>r&&(a|=2),n<-r?a|=4:n>r&&(a|=8),a}var i=Math.cos(e),o=i>0,l=xo(i)>qo,s=gn(e,6*Lo);return Tt(t,n,s,o?[0,-e]:[-Bo,e-Bo])}function Ut(e,t,n,r){return function(a){var i,o=a.a,l=a.b,s=o.x,u=o.y,c=l.x,f=l.y,d=0,p=1,h=c-s,v=f-u;if(i=e-s,h||!(i>0)){if(i/=h,h<0){if(i<d)return;i<p&&(p=i)}else if(h>0){if(i>p)return;i>d&&(d=i)}if(i=n-s,h||!(i<0)){if(i/=h,h<0){if(i>p)return;i>d&&(d=i)}else if(h>0){if(i<d)return;i<p&&(p=i)}if(i=t-u,v||!(i>0)){if(i/=v,v<0){if(i<d)return;i<p&&(p=i)}else if(v>0){if(i>p)return;i>d&&(d=i)}if(i=r-u,v||!(i<0)){if(i/=v,v<0){if(i>p)return;i>d&&(d=i)}else if(v>0){if(i<d)return;i<p&&(p=i)}return d>0&&(a.a={x:s+d*h,y:u+d*v}),p<1&&(a.b={x:s+p*h,y:u+p*v}),a}}}}}}function Yt(e,t,n,r){function a(r,a){return xo(r[0]-e)<qo?a>0?0:3:xo(r[0]-n)<qo?a>0?2:1:xo(r[1]-t)<qo?a>0?1:0:a>0?3:2}function i(e,t){return o(e.x,t.x)}function o(e,t){var n=a(e,1),r=a(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}return function(l){function s(e){for(var t=0,n=g.length,r=e[1],a=0;a<n;++a)for(var i,o=1,l=g[a],s=l.length,u=l[0];o<s;++o)i=l[o],u[1]<=r?i[1]>r&&ee(u,i,e)>0&&++t:i[1]<=r&&ee(u,i,e)<0&&--t,u=i;return 0!==t}function u(i,l,s,u){var c=0,f=0;if(null==i||(c=a(i,s))!==(f=a(l,s))||o(i,l)<0^s>0){do u.point(0===c||3===c?e:n,c>1?r:t);while((c=(c+s+4)%4)!==f)}else u.point(l[0],l[1])}function c(a,i){return e<=a&&a<=n&&t<=i&&i<=r}function f(e,t){c(e,t)&&l.point(e,t)}function d(){S.point=h,g&&g.push(m=[]),z=!0,k=!1,w=_=NaN}function p(){v&&(h(y,x),b&&k&&j.rejoin(),v.push(j.buffer())),S.point=f,k&&l.lineEnd()}function h(e,t){e=Math.max(-Dl,Math.min(Dl,e)),t=Math.max(-Dl,Math.min(Dl,t));var n=c(e,t);if(g&&m.push([e,t]),z)y=e,x=t,b=n,z=!1,n&&(l.lineStart(),l.point(e,t));else if(n&&k)l.point(e,t);else{var r={a:{x:w,y:_},b:{x:e,y:t}};E(r)?(k||(l.lineStart(),l.point(r.a.x,r.a.y)),l.point(r.b.x,r.b.y),n||l.lineEnd(),M=!1):n&&(l.lineStart(),l.point(e,t),M=!1)}w=e,_=t,k=n}var v,g,m,y,x,b,w,_,k,z,M,A=l,j=Pt(),E=Ut(e,t,n,r),S={point:f,lineStart:d,lineEnd:p,polygonStart:function(){l=j,v=[],g=[],M=!0},polygonEnd:function(){l=A,v=so.merge(v);var t=s([e,r]),n=M&&t,a=v.length;(n||a)&&(l.polygonStart(),n&&(l.lineStart(),u(null,null,1,l),l.lineEnd()),a&&Nt(v,i,t,u,l),l.polygonEnd()),v=g=m=null}};return S}}function Ht(e){var t=0,n=Bo/3,r=sn(e),a=r(t,n);return a.parallels=function(e){return arguments.length?r(t=e[0]*Bo/180,n=e[1]*Bo/180):[t/Bo*180,n/Bo*180]},a}function Xt(e,t){function n(e,t){var n=Math.sqrt(i-2*a*Math.sin(t))/a;return[n*Math.sin(e*=a),o-n*Math.cos(e)]}var r=Math.sin(e),a=(r+Math.sin(t))/2,i=1+r*(2*a-r),o=Math.sqrt(i)/a;return n.invert=function(e,t){var n=o-t;return[Math.atan2(e,n)/a,ne((i-(e*e+n*n)*a*a)/(2*a))]},n}function Gt(){function e(e,t){Il+=a*e-r*t,r=e,a=t}var t,n,r,a;Hl.point=function(i,o){Hl.point=e,t=r=i,n=a=o},Hl.lineEnd=function(){e(t,n)}}function Zt(e,t){e<Ll&&(Ll=e),e>Ul&&(Ul=e),t<Vl&&(Vl=t),t>Yl&&(Yl=t)}function Wt(){function e(e,t){o.push("M",e,",",t,i)}function t(e,t){o.push("M",e,",",t),l.point=n}function n(e,t){o.push("L",e,",",t)}function r(){l.point=e}function a(){o.push("Z")}var i=Jt(4.5),o=[],l={point:e,lineStart:function(){l.point=t},lineEnd:r,polygonStart:function(){l.lineEnd=a},polygonEnd:function(){l.lineEnd=r,l.point=e},pointRadius:function(e){return i=Jt(e),l},result:function(){if(o.length){var e=o.join("");return o=[],e}}};return l}function Jt(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function Qt(e,t){jl+=e,El+=t,++Sl}function Kt(){function e(e,r){var a=e-t,i=r-n,o=Math.sqrt(a*a+i*i);Ol+=o*(t+e)/2,Nl+=o*(n+r)/2,Fl+=o,Qt(t=e,n=r)}var t,n;Gl.point=function(r,a){Gl.point=e,Qt(t=r,n=a)}}function $t(){Gl.point=Qt}function en(){function e(e,t){var n=e-r,i=t-a,o=Math.sqrt(n*n+i*i);Ol+=o*(r+e)/2,Nl+=o*(a+t)/2,Fl+=o,o=a*e-r*t,Cl+=o*(r+e),Tl+=o*(a+t),ql+=3*o,Qt(r=e,a=t)}var t,n,r,a;Gl.point=function(i,o){Gl.point=e,Qt(t=r=i,n=a=o)},Gl.lineEnd=function(){e(t,n)}}function tn(e){function t(t,n){e.moveTo(t+o,n),e.arc(t,n,o,0,Do)}function n(t,n){e.moveTo(t,n),l.point=r}function r(t,n){e.lineTo(t,n)}function a(){l.point=t}function i(){e.closePath()}var o=4.5,l={point:t,lineStart:function(){l.point=n},lineEnd:a,polygonStart:function(){l.lineEnd=i},polygonEnd:function(){l.lineEnd=a,l.point=t},pointRadius:function(e){return o=e,l},result:_};return l}function nn(e){function t(e){return(l?r:n)(e)}function n(t){return on(t,function(n,r){n=e(n,r),t.point(n[0],n[1])})}function r(t){function n(n,r){n=e(n,r),t.point(n[0],n[1])}function r(){x=NaN,z.point=i,t.lineStart()}function i(n,r){var i=gt([n,r]),o=e(n,r);a(x,b,y,w,_,k,x=o[0],b=o[1],y=n,w=i[0],_=i[1],k=i[2],l,t),t.point(x,b)}function o(){z.point=n,t.lineEnd()}function s(){r(),z.point=u,z.lineEnd=c}function u(e,t){i(f=e,d=t),p=x,h=b,v=w,g=_,m=k,z.point=i}function c(){a(x,b,y,w,_,k,p,h,f,v,g,m,l,t),z.lineEnd=o,o()}var f,d,p,h,v,g,m,y,x,b,w,_,k,z={point:n,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),z.lineStart=s},polygonEnd:function(){t.polygonEnd(),z.lineStart=r}};return z}function a(t,n,r,l,s,u,c,f,d,p,h,v,g,m){var y=c-t,x=f-n,b=y*y+x*x;if(b>4*i&&g--){var w=l+p,_=s+h,k=u+v,z=Math.sqrt(w*w+_*_+k*k),M=Math.asin(k/=z),A=xo(xo(k)-1)<qo||xo(r-d)<qo?(r+d)/2:Math.atan2(_,w),j=e(A,M),E=j[0],S=j[1],O=E-t,N=S-n,F=x*O-y*N;(F*F/b>i||xo((y*O+x*N)/b-.5)>.3||l*p+s*h+u*v<o)&&(a(t,n,r,l,s,u,E,S,A,w/=z,_/=z,k,g,m),m.point(E,S),a(E,S,A,w,_,k,c,f,d,p,h,v,g,m))}}var i=.5,o=Math.cos(30*Lo),l=16;return t.precision=function(e){return arguments.length?(l=(i=e*e)>0&&16,t):Math.sqrt(i)},t}function rn(e){var t=nn(function(t,n){return e([t*Vo,n*Vo])});return function(e){return un(t(e))}}function an(e){this.stream=e}function on(e,t){return{point:t,sphere:function(){e.sphere()},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}}}function ln(e){return sn(function(){return e})()}function sn(e){function t(e){return e=l(e[0]*Lo,e[1]*Lo),[e[0]*d+s,u-e[1]*d]}function n(e){return e=l.invert((e[0]-s)/d,(u-e[1])/d),e&&[e[0]*Vo,e[1]*Vo]}function r(){l=St(o=dn(m,y,b),i);var e=i(v,g);return s=p-e[0]*d,u=h+e[1]*d,a()}function a(){return c&&(c.valid=!1,c=null),t}var i,o,l,s,u,c,f=nn(function(e,t){return e=i(e,t),[e[0]*d+s,u-e[1]*d]}),d=150,p=480,h=250,v=0,g=0,m=0,y=0,b=0,w=Bl,_=x,k=null,z=null;return t.stream=function(e){return c&&(c.valid=!1),c=un(w(o,f(_(e)))),c.valid=!0,c},t.clipAngle=function(e){return arguments.length?(w=null==e?(k=e,Bl):Vt((k=+e)*Lo),a()):k},t.clipExtent=function(e){return arguments.length?(z=e,_=e?Yt(e[0][0],e[0][1],e[1][0],e[1][1]):x,a()):z},t.scale=function(e){return arguments.length?(d=+e,r()):d},t.translate=function(e){return arguments.length?(p=+e[0],h=+e[1],r()):[p,h]},t.center=function(e){return arguments.length?(v=e[0]%360*Lo,g=e[1]%360*Lo,r()):[v*Vo,g*Vo]},t.rotate=function(e){return arguments.length?(m=e[0]%360*Lo,y=e[1]%360*Lo,b=e.length>2?e[2]%360*Lo:0,r()):[m*Vo,y*Vo,b*Vo]},so.rebind(t,f,"precision"),function(){return i=e.apply(this,arguments),t.invert=i.invert&&n,r()}}function un(e){return on(e,function(t,n){e.point(t*Lo,n*Lo)})}function cn(e,t){return[e,t]}function fn(e,t){return[e>Bo?e-Do:e<-Bo?e+Do:e,t]}function dn(e,t,n){return e?t||n?St(hn(e),vn(t,n)):hn(e):t||n?vn(t,n):fn}function pn(e){return function(t,n){return t+=e,[t>Bo?t-Do:t<-Bo?t+Do:t,n]}}function hn(e){var t=pn(e);return t.invert=pn(-e),t}function vn(e,t){function n(e,t){var n=Math.cos(t),l=Math.cos(e)*n,s=Math.sin(e)*n,u=Math.sin(t),c=u*r+l*a;return[Math.atan2(s*i-c*o,l*r-u*a),ne(c*i+s*o)]}var r=Math.cos(e),a=Math.sin(e),i=Math.cos(t),o=Math.sin(t);return n.invert=function(e,t){var n=Math.cos(t),l=Math.cos(e)*n,s=Math.sin(e)*n,u=Math.sin(t),c=u*i-s*o;return[Math.atan2(s*i+u*o,l*r+c*a),ne(c*r-l*a)]},n}function gn(e,t){var n=Math.cos(e),r=Math.sin(e);return function(a,i,o,l){var s=o*t;null!=a?(a=mn(n,a),i=mn(n,i),(o>0?a<i:a>i)&&(a+=o*Do)):(a=e+o*Do,i=e-.5*s);for(var u,c=a;o>0?c>i:c<i;c-=s)l.point((u=_t([n,-r*Math.cos(c),-r*Math.sin(c)]))[0],u[1])}}function mn(e,t){var n=gt(t);n[0]-=e,wt(n);var r=te(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-qo)%(2*Math.PI)}function yn(e,t,n){var r=so.range(e,t-qo,n).concat(t);return function(e){return r.map(function(t){return[e,t]})}}function xn(e,t,n){var r=so.range(e,t-qo,n).concat(t);return function(e){return r.map(function(t){return[t,e]})}}function bn(e){return e.source}function wn(e){return e.target}function _n(e,t,n,r){var a=Math.cos(t),i=Math.sin(t),o=Math.cos(r),l=Math.sin(r),s=a*Math.cos(e),u=a*Math.sin(e),c=o*Math.cos(n),f=o*Math.sin(n),d=2*Math.asin(Math.sqrt(oe(r-t)+a*o*oe(n-e))),p=1/Math.sin(d),h=d?function(e){var t=Math.sin(e*=d)*p,n=Math.sin(d-e)*p,r=n*s+t*c,a=n*u+t*f,o=n*i+t*l;return[Math.atan2(a,r)*Vo,Math.atan2(o,Math.sqrt(r*r+a*a))*Vo]}:function(){return[e*Vo,t*Vo]};return h.distance=d,h}function kn(){function e(e,a){var i=Math.sin(a*=Lo),o=Math.cos(a),l=xo((e*=Lo)-t),s=Math.cos(l);Zl+=Math.atan2(Math.sqrt((l=o*Math.sin(l))*l+(l=r*i-n*o*s)*l),n*i+r*o*s),t=e,n=i,r=o}var t,n,r;Wl.point=function(a,i){t=a*Lo,n=Math.sin(i*=Lo),r=Math.cos(i),Wl.point=e},Wl.lineEnd=function(){Wl.point=Wl.lineEnd=_}}function zn(e,t){function n(t,n){var r=Math.cos(t),a=Math.cos(n),i=e(r*a);return[i*a*Math.sin(t),i*Math.sin(n)]}return n.invert=function(e,n){var r=Math.sqrt(e*e+n*n),a=t(r),i=Math.sin(a),o=Math.cos(a);return[Math.atan2(e*i,r*o),Math.asin(r&&n*i/r)]},n}function Mn(e,t){function n(e,t){o>0?t<-Io+qo&&(t=-Io+qo):t>Io-qo&&(t=Io-qo);var n=o/Math.pow(a(t),i);return[n*Math.sin(i*e),o-n*Math.cos(i*e)]}var r=Math.cos(e),a=function(e){return Math.tan(Bo/4+e/2)},i=e===t?Math.sin(e):Math.log(r/Math.cos(t))/Math.log(a(t)/a(e)),o=r*Math.pow(a(e),i)/i;return i?(n.invert=function(e,t){var n=o-t,r=$(i)*Math.sqrt(e*e+n*n);return[Math.atan2(e,n)/i,2*Math.atan(Math.pow(o/r,1/i))-Io]},n):jn}function An(e,t){function n(e,t){var n=i-t;return[n*Math.sin(a*e),i-n*Math.cos(a*e)]}var r=Math.cos(e),a=e===t?Math.sin(e):(r-Math.cos(t))/(t-e),i=r/a+e;return xo(a)<qo?cn:(n.invert=function(e,t){var n=i-t;return[Math.atan2(e,n)/a,i-$(a)*Math.sqrt(e*e+n*n)]},n)}function jn(e,t){return[e,Math.log(Math.tan(Bo/4+t/2))]}function En(e){var t,n=ln(e),r=n.scale,a=n.translate,i=n.clipExtent;return n.scale=function(){var e=r.apply(n,arguments);return e===n?t?n.clipExtent(null):n:e},n.translate=function(){var e=a.apply(n,arguments);return e===n?t?n.clipExtent(null):n:e},n.clipExtent=function(e){var o=i.apply(n,arguments);if(o===n){if(t=null==e){var l=Bo*r(),s=a();i([[s[0]-l,s[1]-l],[s[0]+l,s[1]+l]])}}else t&&(o=null);return o},n.clipExtent(null)}function Sn(e,t){return[Math.log(Math.tan(Bo/4+t/2)),-e]}function On(e){return e[0]}function Nn(e){return e[1]}function Fn(e){for(var t=e.length,n=[0,1],r=2,a=2;a<t;a++){for(;r>1&&ee(e[n[r-2]],e[n[r-1]],e[a])<=0;)--r;n[r++]=a}return n.slice(0,r)}function Cn(e,t){return e[0]-t[0]||e[1]-t[1]}function Tn(e,t,n){return(n[0]-t[0])*(e[1]-t[1])<(n[1]-t[1])*(e[0]-t[0])}function qn(e,t,n,r){var a=e[0],i=n[0],o=t[0]-a,l=r[0]-i,s=e[1],u=n[1],c=t[1]-s,f=r[1]-u,d=(l*(s-u)-f*(a-i))/(f*o-l*c);return[a+d*o,s+d*c]}function Pn(e){var t=e[0],n=e[e.length-1];return!(t[0]-n[0]||t[1]-n[1])}function Bn(){ar(this),this.edge=this.site=this.circle=null}function Dn(e){var t=ls.pop()||new Bn;return t.site=e,t}function Rn(e){Wn(e),as.remove(e),ls.push(e),ar(e)}function In(e){var t=e.circle,n=t.x,r=t.cy,a={x:n,y:r},i=e.P,o=e.N,l=[e];Rn(e);for(var s=i;s.circle&&xo(n-s.circle.x)<qo&&xo(r-s.circle.cy)<qo;)i=s.P,l.unshift(s),Rn(s),s=i;l.unshift(s),Wn(s);for(var u=o;u.circle&&xo(n-u.circle.x)<qo&&xo(r-u.circle.cy)<qo;)o=u.N,l.push(u),Rn(u),u=o;l.push(u),Wn(u);var c,f=l.length;for(c=1;c<f;++c)u=l[c],s=l[c-1],tr(u.edge,s.site,u.site,a);s=l[0],u=l[f-1],u.edge=$n(s.site,u.site,null,a),Zn(s),Zn(u)}function Ln(e){for(var t,n,r,a,i=e.x,o=e.y,l=as._;l;)if(r=Vn(l,o)-i,r>qo)l=l.L;else{if(a=i-Un(l,o),!(a>qo)){r>-qo?(t=l.P,n=l):a>-qo?(t=l,n=l.N):t=n=l;break}if(!l.R){t=l;break}l=l.R}var s=Dn(e);if(as.insert(t,s),t||n){if(t===n)return Wn(t),n=Dn(t.site),as.insert(s,n),s.edge=n.edge=$n(t.site,s.site),Zn(t),void Zn(n);if(!n)return void(s.edge=$n(t.site,s.site));Wn(t),Wn(n);var u=t.site,c=u.x,f=u.y,d=e.x-c,p=e.y-f,h=n.site,v=h.x-c,g=h.y-f,m=2*(d*g-p*v),y=d*d+p*p,x=v*v+g*g,b={x:(g*y-p*x)/m+c,y:(d*x-v*y)/m+f};tr(n.edge,u,h,b),s.edge=$n(u,e,null,b),n.edge=$n(e,h,null,b),Zn(t),Zn(n)}}function Vn(e,t){var n=e.site,r=n.x,a=n.y,i=a-t;if(!i)return r;var o=e.P;if(!o)return-(1/0);n=o.site;var l=n.x,s=n.y,u=s-t;if(!u)return l;var c=l-r,f=1/i-1/u,d=c/u;return f?(-d+Math.sqrt(d*d-2*f*(c*c/(-2*u)-s+u/2+a-i/2)))/f+r:(r+l)/2}function Un(e,t){var n=e.N;if(n)return Vn(n,t);var r=e.site;return r.y===t?r.x:1/0}function Yn(e){this.site=e,this.edges=[]}function Hn(e){for(var t,n,r,a,i,o,l,s,u,c,f=e[0][0],d=e[1][0],p=e[0][1],h=e[1][1],v=rs,g=v.length;g--;)if(i=v[g],i&&i.prepare())for(l=i.edges,s=l.length,o=0;o<s;)c=l[o].end(),r=c.x,a=c.y,u=l[++o%s].start(),t=u.x,n=u.y,(xo(r-t)>qo||xo(a-n)>qo)&&(l.splice(o,0,new nr(er(i.site,c,xo(r-f)<qo&&h-a>qo?{x:f,y:xo(t-f)<qo?n:h}:xo(a-h)<qo&&d-r>qo?{x:xo(n-h)<qo?t:d,y:h}:xo(r-d)<qo&&a-p>qo?{x:d,y:xo(t-d)<qo?n:p}:xo(a-p)<qo&&r-f>qo?{x:xo(n-p)<qo?t:f,y:p}:null),i.site,null)),++s)}function Xn(e,t){return t.angle-e.angle}function Gn(){ar(this),this.x=this.y=this.arc=this.site=this.cy=null}function Zn(e){var t=e.P,n=e.N;if(t&&n){var r=t.site,a=e.site,i=n.site;if(r!==i){var o=a.x,l=a.y,s=r.x-o,u=r.y-l,c=i.x-o,f=i.y-l,d=2*(s*f-u*c);if(!(d>=-Po)){var p=s*s+u*u,h=c*c+f*f,v=(f*p-u*h)/d,g=(s*h-c*p)/d,f=g+l,m=ss.pop()||new Gn;m.arc=e,m.site=a,m.x=v+o,m.y=f+Math.sqrt(v*v+g*g),m.cy=f,e.circle=m;for(var y=null,x=os._;x;)if(m.y<x.y||m.y===x.y&&m.x<=x.x){if(!x.L){y=x.P;break}x=x.L}else{if(!x.R){y=x;break}x=x.R}os.insert(y,m),y||(is=m)}}}}function Wn(e){var t=e.circle;t&&(t.P||(is=t.N),os.remove(t),ss.push(t),ar(t),e.circle=null)}function Jn(e){for(var t,n=ns,r=Ut(e[0][0],e[0][1],e[1][0],e[1][1]),a=n.length;a--;)t=n[a],(!Qn(t,e)||!r(t)||xo(t.a.x-t.b.x)<qo&&xo(t.a.y-t.b.y)<qo)&&(t.a=t.b=null,n.splice(a,1))}function Qn(e,t){var n=e.b;if(n)return!0;var r,a,i=e.a,o=t[0][0],l=t[1][0],s=t[0][1],u=t[1][1],c=e.l,f=e.r,d=c.x,p=c.y,h=f.x,v=f.y,g=(d+h)/2,m=(p+v)/2;if(v===p){if(g<o||g>=l)return;if(d>h){if(i){if(i.y>=u)return}else i={x:g,y:s};n={x:g,y:u}}else{if(i){if(i.y<s)return}else i={x:g,y:u};n={x:g,y:s}}}else if(r=(d-h)/(v-p),a=m-r*g,r<-1||r>1)if(d>h){if(i){if(i.y>=u)return}else i={x:(s-a)/r,y:s};n={x:(u-a)/r,y:u}}else{if(i){if(i.y<s)return}else i={x:(u-a)/r,y:u};n={x:(s-a)/r,y:s}}else if(p<v){if(i){if(i.x>=l)return}else i={x:o,y:r*o+a};n={x:l,y:r*l+a}}else{if(i){if(i.x<o)return}else i={x:l,y:r*l+a};n={x:o,y:r*o+a}}return e.a=i,e.b=n,!0}function Kn(e,t){this.l=e,this.r=t,this.a=this.b=null}function $n(e,t,n,r){var a=new Kn(e,t);return ns.push(a),n&&tr(a,e,t,n),r&&tr(a,t,e,r),rs[e.i].edges.push(new nr(a,e,t)),rs[t.i].edges.push(new nr(a,t,e)),a}function er(e,t,n){var r=new Kn(e,null);return r.a=t,r.b=n,ns.push(r),r}function tr(e,t,n,r){e.a||e.b?e.l===n?e.b=r:e.a=r:(e.a=r, | |
e.l=t,e.r=n)}function nr(e,t,n){var r=e.a,a=e.b;this.edge=e,this.site=t,this.angle=n?Math.atan2(n.y-t.y,n.x-t.x):e.l===t?Math.atan2(a.x-r.x,r.y-a.y):Math.atan2(r.x-a.x,a.y-r.y)}function rr(){this._=null}function ar(e){e.U=e.C=e.L=e.R=e.P=e.N=null}function ir(e,t){var n=t,r=t.R,a=n.U;a?a.L===n?a.L=r:a.R=r:e._=r,r.U=a,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function or(e,t){var n=t,r=t.L,a=n.U;a?a.L===n?a.L=r:a.R=r:e._=r,r.U=a,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function lr(e){for(;e.L;)e=e.L;return e}function sr(e,t){var n,r,a,i=e.sort(ur).pop();for(ns=[],rs=new Array(e.length),as=new rr,os=new rr;;)if(a=is,i&&(!a||i.y<a.y||i.y===a.y&&i.x<a.x))i.x===n&&i.y===r||(rs[i.i]=new Yn(i),Ln(i),n=i.x,r=i.y),i=e.pop();else{if(!a)break;In(a.arc)}t&&(Jn(t),Hn(t));var o={cells:rs,edges:ns};return as=os=ns=rs=null,o}function ur(e,t){return t.y-e.y||t.x-e.x}function cr(e,t,n){return(e.x-n.x)*(t.y-e.y)-(e.x-t.x)*(n.y-e.y)}function fr(e){return e.x}function dr(e){return e.y}function pr(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function hr(e,t,n,r,a,i){if(!e(t,n,r,a,i)){var o=.5*(n+a),l=.5*(r+i),s=t.nodes;s[0]&&hr(e,s[0],n,r,o,l),s[1]&&hr(e,s[1],o,r,a,l),s[2]&&hr(e,s[2],n,l,o,i),s[3]&&hr(e,s[3],o,l,a,i)}}function vr(e,t,n,r,a,i,o){var l,s=1/0;return function e(u,c,f,d,p){if(!(c>i||f>o||d<r||p<a)){if(h=u.point){var h,v=t-u.x,g=n-u.y,m=v*v+g*g;if(m<s){var y=Math.sqrt(s=m);r=t-y,a=n-y,i=t+y,o=n+y,l=h}}for(var x=u.nodes,b=.5*(c+d),w=.5*(f+p),_=t>=b,k=n>=w,z=k<<1|_,M=z+4;z<M;++z)if(u=x[3&z])switch(3&z){case 0:e(u,c,f,b,w);break;case 1:e(u,b,f,d,w);break;case 2:e(u,c,w,b,p);break;case 3:e(u,b,w,d,p)}}}(e,r,a,i,o),l}function gr(e,t){e=so.rgb(e),t=so.rgb(t);var n=e.r,r=e.g,a=e.b,i=t.r-n,o=t.g-r,l=t.b-a;return function(e){return"#"+we(Math.round(n+i*e))+we(Math.round(r+o*e))+we(Math.round(a+l*e))}}function mr(e,t){var n,r={},a={};for(n in e)n in t?r[n]=br(e[n],t[n]):a[n]=e[n];for(n in t)n in e||(a[n]=t[n]);return function(e){for(n in r)a[n]=r[n](e);return a}}function yr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function xr(e,t){var n,r,a,i=cs.lastIndex=fs.lastIndex=0,o=-1,l=[],s=[];for(e+="",t+="";(n=cs.exec(e))&&(r=fs.exec(t));)(a=r.index)>i&&(a=t.slice(i,a),l[o]?l[o]+=a:l[++o]=a),(n=n[0])===(r=r[0])?l[o]?l[o]+=r:l[++o]=r:(l[++o]=null,s.push({i:o,x:yr(n,r)})),i=fs.lastIndex;return i<t.length&&(a=t.slice(i),l[o]?l[o]+=a:l[++o]=a),l.length<2?s[0]?(t=s[0].x,function(e){return t(e)+""}):function(){return t}:(t=s.length,function(e){for(var n,r=0;r<t;++r)l[(n=s[r]).i]=n.x(e);return l.join("")})}function br(e,t){for(var n,r=so.interpolators.length;--r>=0&&!(n=so.interpolators[r](e,t)););return n}function wr(e,t){var n,r=[],a=[],i=e.length,o=t.length,l=Math.min(e.length,t.length);for(n=0;n<l;++n)r.push(br(e[n],t[n]));for(;n<i;++n)a[n]=e[n];for(;n<o;++n)a[n]=t[n];return function(e){for(n=0;n<l;++n)a[n]=r[n](e);return a}}function _r(e){return function(t){return t<=0?0:t>=1?1:e(t)}}function kr(e){return function(t){return 1-e(1-t)}}function zr(e){return function(t){return.5*(t<.5?e(2*t):2-e(2-2*t))}}function Mr(e){return e*e}function Ar(e){return e*e*e}function jr(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}function Er(e){return function(t){return Math.pow(t,e)}}function Sr(e){return 1-Math.cos(e*Io)}function Or(e){return Math.pow(2,10*(e-1))}function Nr(e){return 1-Math.sqrt(1-e*e)}function Fr(e,t){var n;return arguments.length<2&&(t=.45),arguments.length?n=t/Do*Math.asin(1/e):(e=1,n=t/4),function(r){return 1+e*Math.pow(2,-10*r)*Math.sin((r-n)*Do/t)}}function Cr(e){return e||(e=1.70158),function(t){return t*t*((e+1)*t-e)}}function Tr(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function qr(e,t){e=so.hcl(e),t=so.hcl(t);var n=e.h,r=e.c,a=e.l,i=t.h-n,o=t.c-r,l=t.l-a;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(i)?(i=0,n=isNaN(n)?t.h:n):i>180?i-=360:i<-180&&(i+=360),function(e){return fe(n+i*e,r+o*e,a+l*e)+""}}function Pr(e,t){e=so.hsl(e),t=so.hsl(t);var n=e.h,r=e.s,a=e.l,i=t.h-n,o=t.s-r,l=t.l-a;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(i)?(i=0,n=isNaN(n)?t.h:n):i>180?i-=360:i<-180&&(i+=360),function(e){return ue(n+i*e,r+o*e,a+l*e)+""}}function Br(e,t){e=so.lab(e),t=so.lab(t);var n=e.l,r=e.a,a=e.b,i=t.l-n,o=t.a-r,l=t.b-a;return function(e){return pe(n+i*e,r+o*e,a+l*e)+""}}function Dr(e,t){return t-=e,function(n){return Math.round(e+t*n)}}function Rr(e){var t=[e.a,e.b],n=[e.c,e.d],r=Lr(t),a=Ir(t,n),i=Lr(Vr(n,t,-a))||0;t[0]*n[1]<n[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,a*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-n[0],n[1]))*Vo,this.translate=[e.e,e.f],this.scale=[r,i],this.skew=i?Math.atan2(a,i)*Vo:0}function Ir(e,t){return e[0]*t[0]+e[1]*t[1]}function Lr(e){var t=Math.sqrt(Ir(e,e));return t&&(e[0]/=t,e[1]/=t),t}function Vr(e,t,n){return e[0]+=n*t[0],e[1]+=n*t[1],e}function Ur(e){return e.length?e.pop()+",":""}function Yr(e,t,n,r){if(e[0]!==t[0]||e[1]!==t[1]){var a=n.push("translate(",null,",",null,")");r.push({i:a-4,x:yr(e[0],t[0])},{i:a-2,x:yr(e[1],t[1])})}else(t[0]||t[1])&&n.push("translate("+t+")")}function Hr(e,t,n,r){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),r.push({i:n.push(Ur(n)+"rotate(",null,")")-2,x:yr(e,t)})):t&&n.push(Ur(n)+"rotate("+t+")")}function Xr(e,t,n,r){e!==t?r.push({i:n.push(Ur(n)+"skewX(",null,")")-2,x:yr(e,t)}):t&&n.push(Ur(n)+"skewX("+t+")")}function Gr(e,t,n,r){if(e[0]!==t[0]||e[1]!==t[1]){var a=n.push(Ur(n)+"scale(",null,",",null,")");r.push({i:a-4,x:yr(e[0],t[0])},{i:a-2,x:yr(e[1],t[1])})}else 1===t[0]&&1===t[1]||n.push(Ur(n)+"scale("+t+")")}function Zr(e,t){var n=[],r=[];return e=so.transform(e),t=so.transform(t),Yr(e.translate,t.translate,n,r),Hr(e.rotate,t.rotate,n,r),Xr(e.skew,t.skew,n,r),Gr(e.scale,t.scale,n,r),e=t=null,function(e){for(var t,a=-1,i=r.length;++a<i;)n[(t=r[a]).i]=t.x(e);return n.join("")}}function Wr(e,t){return t=(t-=e=+e)||1/t,function(n){return(n-e)/t}}function Jr(e,t){return t=(t-=e=+e)||1/t,function(n){return Math.max(0,Math.min(1,(n-e)/t))}}function Qr(e){for(var t=e.source,n=e.target,r=$r(t,n),a=[t];t!==r;)t=t.parent,a.push(t);for(var i=a.length;n!==r;)a.splice(i,0,n),n=n.parent;return a}function Kr(e){for(var t=[],n=e.parent;null!=n;)t.push(e),e=n,n=n.parent;return t.push(e),t}function $r(e,t){if(e===t)return e;for(var n=Kr(e),r=Kr(t),a=n.pop(),i=r.pop(),o=null;a===i;)o=a,a=n.pop(),i=r.pop();return o}function ea(e){e.fixed|=2}function ta(e){e.fixed&=-7}function na(e){e.fixed|=4,e.px=e.x,e.py=e.y}function ra(e){e.fixed&=-5}function aa(e,t,n){var r=0,a=0;if(e.charge=0,!e.leaf)for(var i,o=e.nodes,l=o.length,s=-1;++s<l;)i=o[s],null!=i&&(aa(i,t,n),e.charge+=i.charge,r+=i.charge*i.cx,a+=i.charge*i.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var u=t*n[e.point.index];e.charge+=e.pointCharge=u,r+=u*e.point.x,a+=u*e.point.y}e.cx=r/e.charge,e.cy=a/e.charge}function ia(e,t){return so.rebind(e,t,"sort","children","value"),e.nodes=e,e.links=fa,e}function oa(e,t){for(var n=[e];null!=(e=n.pop());)if(t(e),(a=e.children)&&(r=a.length))for(var r,a;--r>=0;)n.push(a[r])}function la(e,t){for(var n=[e],r=[];null!=(e=n.pop());)if(r.push(e),(i=e.children)&&(a=i.length))for(var a,i,o=-1;++o<a;)n.push(i[o]);for(;null!=(e=r.pop());)t(e)}function sa(e){return e.children}function ua(e){return e.value}function ca(e,t){return t.value-e.value}function fa(e){return so.merge(e.map(function(e){return(e.children||[]).map(function(t){return{source:e,target:t}})}))}function da(e){return e.x}function pa(e){return e.y}function ha(e,t,n){e.y0=t,e.y=n}function va(e){return so.range(e.length)}function ga(e){for(var t=-1,n=e[0].length,r=[];++t<n;)r[t]=0;return r}function ma(e){for(var t,n=1,r=0,a=e[0][1],i=e.length;n<i;++n)(t=e[n][1])>a&&(r=n,a=t);return r}function ya(e){return e.reduce(xa,0)}function xa(e,t){return e+t[1]}function ba(e,t){return wa(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function wa(e,t){for(var n=-1,r=+e[0],a=(e[1]-r)/t,i=[];++n<=t;)i[n]=a*n+r;return i}function _a(e){return[so.min(e),so.max(e)]}function ka(e,t){return e.value-t.value}function za(e,t){var n=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=n,n._pack_prev=t}function Ma(e,t){e._pack_next=t,t._pack_prev=e}function Aa(e,t){var n=t.x-e.x,r=t.y-e.y,a=e.r+t.r;return.999*a*a>n*n+r*r}function ja(e){function t(e){c=Math.min(e.x-e.r,c),f=Math.max(e.x+e.r,f),d=Math.min(e.y-e.r,d),p=Math.max(e.y+e.r,p)}if((n=e.children)&&(u=n.length)){var n,r,a,i,o,l,s,u,c=1/0,f=-(1/0),d=1/0,p=-(1/0);if(n.forEach(Ea),r=n[0],r.x=-r.r,r.y=0,t(r),u>1&&(a=n[1],a.x=a.r,a.y=0,t(a),u>2))for(i=n[2],Na(r,a,i),t(i),za(r,i),r._pack_prev=i,za(i,a),a=r._pack_next,o=3;o<u;o++){Na(r,a,i=n[o]);var h=0,v=1,g=1;for(l=a._pack_next;l!==a;l=l._pack_next,v++)if(Aa(l,i)){h=1;break}if(1==h)for(s=r._pack_prev;s!==l._pack_prev&&!Aa(s,i);s=s._pack_prev,g++);h?(v<g||v==g&&a.r<r.r?Ma(r,a=l):Ma(r=s,a),o--):(za(r,i),a=i,t(i))}var m=(c+f)/2,y=(d+p)/2,x=0;for(o=0;o<u;o++)i=n[o],i.x-=m,i.y-=y,x=Math.max(x,i.r+Math.sqrt(i.x*i.x+i.y*i.y));e.r=x,n.forEach(Sa)}}function Ea(e){e._pack_next=e._pack_prev=e}function Sa(e){delete e._pack_next,delete e._pack_prev}function Oa(e,t,n,r){var a=e.children;if(e.x=t+=r*e.x,e.y=n+=r*e.y,e.r*=r,a)for(var i=-1,o=a.length;++i<o;)Oa(a[i],t,n,r)}function Na(e,t,n){var r=e.r+n.r,a=t.x-e.x,i=t.y-e.y;if(r&&(a||i)){var o=t.r+n.r,l=a*a+i*i;o*=o,r*=r;var s=.5+(r-o)/(2*l),u=Math.sqrt(Math.max(0,2*o*(r+l)-(r-=l)*r-o*o))/(2*l);n.x=e.x+s*a+u*i,n.y=e.y+s*i-u*a}else n.x=e.x+r,n.y=e.y}function Fa(e,t){return e.parent==t.parent?1:2}function Ca(e){var t=e.children;return t.length?t[0]:e.t}function Ta(e){var t,n=e.children;return(t=n.length)?n[t-1]:e.t}function qa(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function Pa(e){for(var t,n=0,r=0,a=e.children,i=a.length;--i>=0;)t=a[i],t.z+=n,t.m+=n,n+=t.s+(r+=t.c)}function Ba(e,t,n){return e.a.parent===t.parent?e.a:n}function Da(e){return 1+so.max(e,function(e){return e.y})}function Ra(e){return e.reduce(function(e,t){return e+t.x},0)/e.length}function Ia(e){var t=e.children;return t&&t.length?Ia(t[0]):e}function La(e){var t,n=e.children;return n&&(t=n.length)?La(n[t-1]):e}function Va(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function Ua(e,t){var n=e.x+t[3],r=e.y+t[0],a=e.dx-t[1]-t[3],i=e.dy-t[0]-t[2];return a<0&&(n+=a/2,a=0),i<0&&(r+=i/2,i=0),{x:n,y:r,dx:a,dy:i}}function Ya(e){var t=e[0],n=e[e.length-1];return t<n?[t,n]:[n,t]}function Ha(e){return e.rangeExtent?e.rangeExtent():Ya(e.range())}function Xa(e,t,n,r){var a=n(e[0],e[1]),i=r(t[0],t[1]);return function(e){return i(a(e))}}function Ga(e,t){var n,r=0,a=e.length-1,i=e[r],o=e[a];return o<i&&(n=r,r=a,a=n,n=i,i=o,o=n),e[r]=t.floor(i),e[a]=t.ceil(o),e}function Za(e){return e?{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}:_s}function Wa(e,t,n,r){var a=[],i=[],o=0,l=Math.min(e.length,t.length)-1;for(e[l]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<=l;)a.push(n(e[o-1],e[o])),i.push(r(t[o-1],t[o]));return function(t){var n=so.bisect(e,t,1,l)-1;return i[n](a[n](t))}}function Ja(e,t,n,r){function a(){var a=Math.min(e.length,t.length)>2?Wa:Xa,s=r?Jr:Wr;return o=a(e,t,s,n),l=a(t,e,s,br),i}function i(e){return o(e)}var o,l;return i.invert=function(e){return l(e)},i.domain=function(t){return arguments.length?(e=t.map(Number),a()):e},i.range=function(e){return arguments.length?(t=e,a()):t},i.rangeRound=function(e){return i.range(e).interpolate(Dr)},i.clamp=function(e){return arguments.length?(r=e,a()):r},i.interpolate=function(e){return arguments.length?(n=e,a()):n},i.ticks=function(t){return ei(e,t)},i.tickFormat=function(t,n){return ti(e,t,n)},i.nice=function(t){return Ka(e,t),a()},i.copy=function(){return Ja(e,t,n,r)},a()}function Qa(e,t){return so.rebind(e,t,"range","rangeRound","interpolate","clamp")}function Ka(e,t){return Ga(e,Za($a(e,t)[2])),Ga(e,Za($a(e,t)[2])),e}function $a(e,t){null==t&&(t=10);var n=Ya(e),r=n[1]-n[0],a=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),i=t/r*a;return i<=.15?a*=10:i<=.35?a*=5:i<=.75&&(a*=2),n[0]=Math.ceil(n[0]/a)*a,n[1]=Math.floor(n[1]/a)*a+.5*a,n[2]=a,n}function ei(e,t){return so.range.apply(so,$a(e,t))}function ti(e,t,n){var r=$a(e,t);if(n){var a=cl.exec(n);if(a.shift(),"s"===a[8]){var i=so.formatPrefix(Math.max(xo(r[0]),xo(r[1])));return a[7]||(a[7]="."+ni(i.scale(r[2]))),a[8]="f",n=so.format(a.join("")),function(e){return n(i.scale(e))+i.symbol}}a[7]||(a[7]="."+ri(a[8],r)),n=a.join("")}else n=",."+ni(r[2])+"f";return so.format(n)}function ni(e){return-Math.floor(Math.log(e)/Math.LN10+.01)}function ri(e,t){var n=ni(t[2]);return e in ks?Math.abs(n-ni(Math.max(xo(t[0]),xo(t[1]))))+ +("e"!==e):n-2*("%"===e)}function ai(e,t,n,r){function a(e){return(n?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(t)}function i(e){return n?Math.pow(t,e):-Math.pow(t,-e)}function o(t){return e(a(t))}return o.invert=function(t){return i(e.invert(t))},o.domain=function(t){return arguments.length?(n=t[0]>=0,e.domain((r=t.map(Number)).map(a)),o):r},o.base=function(n){return arguments.length?(t=+n,e.domain(r.map(a)),o):t},o.nice=function(){var t=Ga(r.map(a),n?Math:Ms);return e.domain(t),r=t.map(i),o},o.ticks=function(){var e=Ya(r),o=[],l=e[0],s=e[1],u=Math.floor(a(l)),c=Math.ceil(a(s)),f=t%1?2:t;if(isFinite(c-u)){if(n){for(;u<c;u++)for(var d=1;d<f;d++)o.push(i(u)*d);o.push(i(u))}else for(o.push(i(u));u++<c;)for(var d=f-1;d>0;d--)o.push(i(u)*d);for(u=0;o[u]<l;u++);for(c=o.length;o[c-1]>s;c--);o=o.slice(u,c)}return o},o.tickFormat=function(e,n){if(!arguments.length)return zs;arguments.length<2?n=zs:"function"!=typeof n&&(n=so.format(n));var r=Math.max(1,t*e/o.ticks().length);return function(e){var o=e/i(Math.round(a(e)));return o*t<t-.5&&(o*=t),o<=r?n(e):""}},o.copy=function(){return ai(e.copy(),t,n,r)},Qa(o,e)}function ii(e,t,n){function r(t){return e(a(t))}var a=oi(t),i=oi(1/t);return r.invert=function(t){return i(e.invert(t))},r.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(a)),r):n},r.ticks=function(e){return ei(n,e)},r.tickFormat=function(e,t){return ti(n,e,t)},r.nice=function(e){return r.domain(Ka(n,e))},r.exponent=function(o){return arguments.length?(a=oi(t=o),i=oi(1/t),e.domain(n.map(a)),r):t},r.copy=function(){return ii(e.copy(),t,n)},Qa(r,e)}function oi(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function li(e,t){function n(n){return i[((a.get(n)||("range"===t.t?a.set(n,e.push(n)):NaN))-1)%i.length]}function r(t,n){return so.range(e.length).map(function(e){return t+n*e})}var a,i,o;return n.domain=function(r){if(!arguments.length)return e;e=[],a=new c;for(var i,o=-1,l=r.length;++o<l;)a.has(i=r[o])||a.set(i,e.push(i));return n[t.t].apply(n,t.a)},n.range=function(e){return arguments.length?(i=e,o=0,t={t:"range",a:arguments},n):i},n.rangePoints=function(a,l){arguments.length<2&&(l=0);var s=a[0],u=a[1],c=e.length<2?(s=(s+u)/2,0):(u-s)/(e.length-1+l);return i=r(s+c*l/2,c),o=0,t={t:"rangePoints",a:arguments},n},n.rangeRoundPoints=function(a,l){arguments.length<2&&(l=0);var s=a[0],u=a[1],c=e.length<2?(s=u=Math.round((s+u)/2),0):(u-s)/(e.length-1+l)|0;return i=r(s+Math.round(c*l/2+(u-s-(e.length-1+l)*c)/2),c),o=0,t={t:"rangeRoundPoints",a:arguments},n},n.rangeBands=function(a,l,s){arguments.length<2&&(l=0),arguments.length<3&&(s=l);var u=a[1]<a[0],c=a[u-0],f=a[1-u],d=(f-c)/(e.length-l+2*s);return i=r(c+d*s,d),u&&i.reverse(),o=d*(1-l),t={t:"rangeBands",a:arguments},n},n.rangeRoundBands=function(a,l,s){arguments.length<2&&(l=0),arguments.length<3&&(s=l);var u=a[1]<a[0],c=a[u-0],f=a[1-u],d=Math.floor((f-c)/(e.length-l+2*s));return i=r(c+Math.round((f-c-(e.length-l)*d)/2),d),u&&i.reverse(),o=Math.round(d*(1-l)),t={t:"rangeRoundBands",a:arguments},n},n.rangeBand=function(){return o},n.rangeExtent=function(){return Ya(t.a[0])},n.copy=function(){return li(e,t)},n.domain(e)}function si(e,t){function n(){var n=0,r=t.length;for(l=[];++n<r;)l[n-1]=so.quantile(e,n/r);return o}function o(e){if(!isNaN(e=+e))return t[so.bisect(l,e)]}var l;return o.domain=function(t){return arguments.length?(e=t.map(a).filter(i).sort(r),n()):e},o.range=function(e){return arguments.length?(t=e,n()):t},o.quantiles=function(){return l},o.invertExtent=function(n){return n=t.indexOf(n),n<0?[NaN,NaN]:[n>0?l[n-1]:e[0],n<l.length?l[n]:e[e.length-1]]},o.copy=function(){return si(e,t)},n()}function ui(e,t,n){function r(t){return n[Math.max(0,Math.min(o,Math.floor(i*(t-e))))]}function a(){return i=n.length/(t-e),o=n.length-1,r}var i,o;return r.domain=function(n){return arguments.length?(e=+n[0],t=+n[n.length-1],a()):[e,t]},r.range=function(e){return arguments.length?(n=e,a()):n},r.invertExtent=function(t){return t=n.indexOf(t),t=t<0?NaN:t/i+e,[t,t+1/i]},r.copy=function(){return ui(e,t,n)},a()}function ci(e,t){function n(n){if(n<=n)return t[so.bisect(e,n)]}return n.domain=function(t){return arguments.length?(e=t,n):e},n.range=function(e){return arguments.length?(t=e,n):t},n.invertExtent=function(n){return n=t.indexOf(n),[e[n-1],e[n]]},n.copy=function(){return ci(e,t)},n}function fi(e){function t(e){return+e}return t.invert=t,t.domain=t.range=function(n){return arguments.length?(e=n.map(t),t):e},t.ticks=function(t){return ei(e,t)},t.tickFormat=function(t,n){return ti(e,t,n)},t.copy=function(){return fi(e)},t}function di(){return 0}function pi(e){return e.innerRadius}function hi(e){return e.outerRadius}function vi(e){return e.startAngle}function gi(e){return e.endAngle}function mi(e){return e&&e.padAngle}function yi(e,t,n,r){return(e-n)*t-(t-r)*e>0?0:1}function xi(e,t,n,r,a){var i=e[0]-t[0],o=e[1]-t[1],l=(a?r:-r)/Math.sqrt(i*i+o*o),s=l*o,u=-l*i,c=e[0]+s,f=e[1]+u,d=t[0]+s,p=t[1]+u,h=(c+d)/2,v=(f+p)/2,g=d-c,m=p-f,y=g*g+m*m,x=n-r,b=c*p-d*f,w=(m<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),_=(b*m-g*w)/y,k=(-b*g-m*w)/y,z=(b*m+g*w)/y,M=(-b*g+m*w)/y,A=_-h,j=k-v,E=z-h,S=M-v;return A*A+j*j>E*E+S*S&&(_=z,k=M),[[_-s,k-u],[_*n/x,k*n/x]]}function bi(e){function t(t){function o(){u.push("M",i(e(c),l))}for(var s,u=[],c=[],f=-1,d=t.length,p=je(n),h=je(r);++f<d;)a.call(this,s=t[f],f)?c.push([+p.call(this,s,f),+h.call(this,s,f)]):c.length&&(o(),c=[]);return c.length&&o(),u.length?u.join(""):null}var n=On,r=Nn,a=Ot,i=wi,o=i.key,l=.7;return t.x=function(e){return arguments.length?(n=e,t):n},t.y=function(e){return arguments.length?(r=e,t):r},t.defined=function(e){return arguments.length?(a=e,t):a},t.interpolate=function(e){return arguments.length?(o="function"==typeof e?i=e:(i=Ns.get(e)||wi).key,t):o},t.tension=function(e){return arguments.length?(l=e,t):l},t}function wi(e){return e.length>1?e.join("L"):e+"Z"}function _i(e){return e.join("L")+"Z"}function ki(e){for(var t=0,n=e.length,r=e[0],a=[r[0],",",r[1]];++t<n;)a.push("H",(r[0]+(r=e[t])[0])/2,"V",r[1]);return n>1&&a.push("H",r[0]),a.join("")}function zi(e){for(var t=0,n=e.length,r=e[0],a=[r[0],",",r[1]];++t<n;)a.push("V",(r=e[t])[1],"H",r[0]);return a.join("")}function Mi(e){for(var t=0,n=e.length,r=e[0],a=[r[0],",",r[1]];++t<n;)a.push("H",(r=e[t])[0],"V",r[1]);return a.join("")}function Ai(e,t){return e.length<4?wi(e):e[1]+Si(e.slice(1,-1),Oi(e,t))}function ji(e,t){return e.length<3?_i(e):e[0]+Si((e.push(e[0]),e),Oi([e[e.length-2]].concat(e,[e[1]]),t))}function Ei(e,t){return e.length<3?wi(e):e[0]+Si(e,Oi(e,t))}function Si(e,t){if(t.length<1||e.length!=t.length&&e.length!=t.length+2)return wi(e);var n=e.length!=t.length,r="",a=e[0],i=e[1],o=t[0],l=o,s=1;if(n&&(r+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],a=e[1],s=2),t.length>1){l=t[1],i=e[s],s++,r+="C"+(a[0]+o[0])+","+(a[1]+o[1])+","+(i[0]-l[0])+","+(i[1]-l[1])+","+i[0]+","+i[1];for(var u=2;u<t.length;u++,s++)i=e[s],l=t[u],r+="S"+(i[0]-l[0])+","+(i[1]-l[1])+","+i[0]+","+i[1]}if(n){var c=e[s];r+="Q"+(i[0]+2*l[0]/3)+","+(i[1]+2*l[1]/3)+","+c[0]+","+c[1]}return r}function Oi(e,t){for(var n,r=[],a=(1-t)/2,i=e[0],o=e[1],l=1,s=e.length;++l<s;)n=i,i=o,o=e[l],r.push([a*(o[0]-n[0]),a*(o[1]-n[1])]);return r}function Ni(e){if(e.length<3)return wi(e);var t=1,n=e.length,r=e[0],a=r[0],i=r[1],o=[a,a,a,(r=e[1])[0]],l=[i,i,i,r[1]],s=[a,",",i,"L",qi(Ts,o),",",qi(Ts,l)];for(e.push(e[n-1]);++t<=n;)r=e[t],o.shift(),o.push(r[0]),l.shift(),l.push(r[1]),Pi(s,o,l);return e.pop(),s.push("L",r),s.join("")}function Fi(e){if(e.length<4)return wi(e);for(var t,n=[],r=-1,a=e.length,i=[0],o=[0];++r<3;)t=e[r],i.push(t[0]),o.push(t[1]);for(n.push(qi(Ts,i)+","+qi(Ts,o)),--r;++r<a;)t=e[r],i.shift(),i.push(t[0]),o.shift(),o.push(t[1]),Pi(n,i,o);return n.join("")}function Ci(e){for(var t,n,r=-1,a=e.length,i=a+4,o=[],l=[];++r<4;)n=e[r%a],o.push(n[0]),l.push(n[1]);for(t=[qi(Ts,o),",",qi(Ts,l)],--r;++r<i;)n=e[r%a],o.shift(),o.push(n[0]),l.shift(),l.push(n[1]),Pi(t,o,l);return t.join("")}function Ti(e,t){var n=e.length-1;if(n)for(var r,a,i=e[0][0],o=e[0][1],l=e[n][0]-i,s=e[n][1]-o,u=-1;++u<=n;)r=e[u],a=u/n,r[0]=t*r[0]+(1-t)*(i+a*l),r[1]=t*r[1]+(1-t)*(o+a*s);return Ni(e)}function qi(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function Pi(e,t,n){e.push("C",qi(Fs,t),",",qi(Fs,n),",",qi(Cs,t),",",qi(Cs,n),",",qi(Ts,t),",",qi(Ts,n))}function Bi(e,t){return(t[1]-e[1])/(t[0]-e[0])}function Di(e){for(var t=0,n=e.length-1,r=[],a=e[0],i=e[1],o=r[0]=Bi(a,i);++t<n;)r[t]=(o+(o=Bi(a=i,i=e[t+1])))/2;return r[t]=o,r}function Ri(e){for(var t,n,r,a,i=[],o=Di(e),l=-1,s=e.length-1;++l<s;)t=Bi(e[l],e[l+1]),xo(t)<qo?o[l]=o[l+1]=0:(n=o[l]/t,r=o[l+1]/t,a=n*n+r*r,a>9&&(a=3*t/Math.sqrt(a),o[l]=a*n,o[l+1]=a*r));for(l=-1;++l<=s;)a=(e[Math.min(s,l+1)][0]-e[Math.max(0,l-1)][0])/(6*(1+o[l]*o[l])),i.push([a||0,o[l]*a||0]);return i}function Ii(e){return e.length<3?wi(e):e[0]+Si(e,Ri(e))}function Li(e){for(var t,n,r,a=-1,i=e.length;++a<i;)t=e[a],n=t[0],r=t[1]-Io,t[0]=n*Math.cos(r),t[1]=n*Math.sin(r);return e}function Vi(e){function t(t){function s(){v.push("M",l(e(m),f),c,u(e(g.reverse()),f),"Z")}for(var d,p,h,v=[],g=[],m=[],y=-1,x=t.length,b=je(n),w=je(a),_=n===r?function(){return p}:je(r),k=a===i?function(){return h}:je(i);++y<x;)o.call(this,d=t[y],y)?(g.push([p=+b.call(this,d,y),h=+w.call(this,d,y)]),m.push([+_.call(this,d,y),+k.call(this,d,y)])):g.length&&(s(),g=[],m=[]);return g.length&&s(),v.length?v.join(""):null}var n=On,r=On,a=0,i=Nn,o=Ot,l=wi,s=l.key,u=l,c="L",f=.7;return t.x=function(e){return arguments.length?(n=r=e,t):r},t.x0=function(e){return arguments.length?(n=e,t):n},t.x1=function(e){return arguments.length?(r=e,t):r},t.y=function(e){return arguments.length?(a=i=e,t):i},t.y0=function(e){return arguments.length?(a=e,t):a},t.y1=function(e){return arguments.length?(i=e,t):i},t.defined=function(e){return arguments.length?(o=e,t):o},t.interpolate=function(e){return arguments.length?(s="function"==typeof e?l=e:(l=Ns.get(e)||wi).key,u=l.reverse||l,c=l.closed?"M":"L",t):s},t.tension=function(e){return arguments.length?(f=e,t):f},t}function Ui(e){return e.radius}function Yi(e){return[e.x,e.y]}function Hi(e){return function(){var t=e.apply(this,arguments),n=t[0],r=t[1]-Io;return[n*Math.cos(r),n*Math.sin(r)]}}function Xi(){return 64}function Gi(){return"circle"}function Zi(e){var t=Math.sqrt(e/Bo);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Wi(e){return function(){var t,n,r;(t=this[e])&&(r=t[n=t.active])&&(r.timer.c=null,r.timer.t=NaN,--t.count?delete t[n]:delete this[e],t.active+=.5,r.event&&r.event.interrupt.call(this,this.__data__,r.index))}}function Ji(e,t,n){return zo(e,Ls),e.namespace=t,e.id=n,e}function Qi(e,t,n,r){var a=e.id,i=e.namespace;return Y(e,"function"==typeof n?function(e,o,l){e[i][a].tween.set(t,r(n.call(e,e.__data__,o,l)))}:(n=r(n),function(e){e[i][a].tween.set(t,n)}))}function Ki(e){return null==e&&(e=""),function(){this.textContent=e}}function $i(e){return null==e?"__transition__":"__transition_"+e+"__"}function eo(e,t,n,r,a){function i(e){var t=v.delay;return u.t=t+s,t<=e?o(e-t):void(u.c=o)}function o(n){var a=h.active,i=h[a];i&&(i.timer.c=null,i.timer.t=NaN,--h.count,delete h[a],i.event&&i.event.interrupt.call(e,e.__data__,i.index));for(var o in h)if(+o<r){var c=h[o];c.timer.c=null,c.timer.t=NaN,--h.count,delete h[o]}u.c=l,Fe(function(){return u.c&&l(n||1)&&(u.c=null,u.t=NaN),1},0,s),h.active=r,v.event&&v.event.start.call(e,e.__data__,t),p=[],v.tween.forEach(function(n,r){(r=r.call(e,e.__data__,t))&&p.push(r)}),d=v.ease,f=v.duration}function l(a){for(var i=a/f,o=d(i),l=p.length;l>0;)p[--l].call(e,o);if(i>=1)return v.event&&v.event.end.call(e,e.__data__,t),--h.count?delete h[r]:delete e[n],1}var s,u,f,d,p,h=e[n]||(e[n]={active:0,count:0}),v=h[r];v||(s=a.time,u=Fe(i,0,s),v=h[r]={tween:new c,time:s,timer:u,delay:a.delay,duration:a.duration,ease:a.ease,index:t},a=null,++h.count)}function to(e,t,n){e.attr("transform",function(e){var r=t(e);return"translate("+(isFinite(r)?r:n(e))+",0)"})}function no(e,t,n){e.attr("transform",function(e){var r=t(e);return"translate(0,"+(isFinite(r)?r:n(e))+")"})}function ro(e){return e.toISOString()}function ao(e,t,n){function r(t){return e(t)}function a(e,n){var r=e[1]-e[0],a=r/n,i=so.bisect(Js,a);return i==Js.length?[t.year,$a(e.map(function(e){return e/31536e6}),n)[2]]:i?t[a/Js[i-1]<Js[i]/a?i-1:i]:[$s,$a(e,n)[2]]}return r.invert=function(t){return io(e.invert(t))},r.domain=function(t){return arguments.length?(e.domain(t),r):e.domain().map(io)},r.nice=function(e,t){function n(n){return!isNaN(n)&&!e.range(n,io(+n+1),t).length}var i=r.domain(),o=Ya(i),l=null==e?a(o,10):"number"==typeof e&&a(o,e);return l&&(e=l[0],t=l[1]),r.domain(Ga(i,t>1?{floor:function(t){for(;n(t=e.floor(t));)t=io(t-1);return t},ceil:function(t){for(;n(t=e.ceil(t));)t=io(+t+1);return t}}:e))},r.ticks=function(e,t){var n=Ya(r.domain()),i=null==e?a(n,10):"number"==typeof e?a(n,e):!e.range&&[{range:e},t];return i&&(e=i[0],t=i[1]),e.range(n[0],io(+n[1]+1),t<1?1:t)},r.tickFormat=function(){return n},r.copy=function(){return ao(e.copy(),t,n)},Qa(r,e)}function io(e){return new Date(e)}function oo(e){return JSON.parse(e.responseText)}function lo(e){var t=fo.createRange();return t.selectNode(fo.body),t.createContextualFragment(e.responseText)}var so={version:"3.5.15"},uo=[].slice,co=function(e){return uo.call(e)},fo=this.document;if(fo)try{co(fo.documentElement.childNodes)[0].nodeType}catch(e){co=function(e){for(var t=e.length,n=new Array(t);t--;)n[t]=e[t];return n}}if(Date.now||(Date.now=function(){return+new Date}),fo)try{fo.createElement("DIV").style.setProperty("opacity",0,"")}catch(e){var po=this.Element.prototype,ho=po.setAttribute,vo=po.setAttributeNS,go=this.CSSStyleDeclaration.prototype,mo=go.setProperty;po.setAttribute=function(e,t){ho.call(this,e,t+"")},po.setAttributeNS=function(e,t,n){vo.call(this,e,t,n+"")},go.setProperty=function(e,t,n){mo.call(this,e,t+"",n)}}so.ascending=r,so.descending=function(e,t){return t<e?-1:t>e?1:t>=e?0:NaN},so.min=function(e,t){var n,r,a=-1,i=e.length;if(1===arguments.length){for(;++a<i;)if(null!=(r=e[a])&&r>=r){n=r;break}for(;++a<i;)null!=(r=e[a])&&n>r&&(n=r)}else{for(;++a<i;)if(null!=(r=t.call(e,e[a],a))&&r>=r){n=r;break}for(;++a<i;)null!=(r=t.call(e,e[a],a))&&n>r&&(n=r)}return n},so.max=function(e,t){var n,r,a=-1,i=e.length;if(1===arguments.length){for(;++a<i;)if(null!=(r=e[a])&&r>=r){n=r;break}for(;++a<i;)null!=(r=e[a])&&r>n&&(n=r)}else{for(;++a<i;)if(null!=(r=t.call(e,e[a],a))&&r>=r){n=r;break}for(;++a<i;)null!=(r=t.call(e,e[a],a))&&r>n&&(n=r)}return n},so.extent=function(e,t){var n,r,a,i=-1,o=e.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=e[i])&&r>=r){n=a=r;break}for(;++i<o;)null!=(r=e[i])&&(n>r&&(n=r),a<r&&(a=r))}else{for(;++i<o;)if(null!=(r=t.call(e,e[i],i))&&r>=r){n=a=r;break}for(;++i<o;)null!=(r=t.call(e,e[i],i))&&(n>r&&(n=r),a<r&&(a=r))}return[n,a]},so.sum=function(e,t){var n,r=0,a=e.length,o=-1;if(1===arguments.length)for(;++o<a;)i(n=+e[o])&&(r+=n);else for(;++o<a;)i(n=+t.call(e,e[o],o))&&(r+=n);return r},so.mean=function(e,t){var n,r=0,o=e.length,l=-1,s=o;if(1===arguments.length)for(;++l<o;)i(n=a(e[l]))?r+=n:--s;else for(;++l<o;)i(n=a(t.call(e,e[l],l)))?r+=n:--s;if(s)return r/s},so.quantile=function(e,t){var n=(e.length-1)*t+1,r=Math.floor(n),a=+e[r-1],i=n-r;return i?a+i*(e[r]-a):a},so.median=function(e,t){var n,o=[],l=e.length,s=-1;if(1===arguments.length)for(;++s<l;)i(n=a(e[s]))&&o.push(n);else for(;++s<l;)i(n=a(t.call(e,e[s],s)))&&o.push(n);if(o.length)return so.quantile(o.sort(r),.5)},so.variance=function(e,t){var n,r,o=e.length,l=0,s=0,u=-1,c=0;if(1===arguments.length)for(;++u<o;)i(n=a(e[u]))&&(r=n-l,l+=r/++c,s+=r*(n-l));else for(;++u<o;)i(n=a(t.call(e,e[u],u)))&&(r=n-l,l+=r/++c,s+=r*(n-l));if(c>1)return s/(c-1)},so.deviation=function(){var e=so.variance.apply(this,arguments);return e?Math.sqrt(e):e};var yo=o(r);so.bisectLeft=yo.left,so.bisect=so.bisectRight=yo.right,so.bisector=function(e){return o(1===e.length?function(t,n){return r(e(t),n)}:e)},so.shuffle=function(e,t,n){(i=arguments.length)<3&&(n=e.length,i<2&&(t=0));for(var r,a,i=n-t;i;)a=Math.random()*i--|0,r=e[i+t],e[i+t]=e[a+t],e[a+t]=r;return e},so.permute=function(e,t){for(var n=t.length,r=new Array(n);n--;)r[n]=e[t[n]];return r},so.pairs=function(e){for(var t,n=0,r=e.length-1,a=e[0],i=new Array(r<0?0:r);n<r;)i[n]=[t=a,a=e[++n]];return i},so.transpose=function(e){if(!(a=e.length))return[];for(var t=-1,n=so.min(e,l),r=new Array(n);++t<n;)for(var a,i=-1,o=r[t]=new Array(a);++i<a;)o[i]=e[i][t];return r},so.zip=function(){return so.transpose(arguments)},so.keys=function(e){var t=[];for(var n in e)t.push(n);return t},so.values=function(e){var t=[];for(var n in e)t.push(e[n]);return t},so.entries=function(e){var t=[];for(var n in e)t.push({key:n,value:e[n]});return t},so.merge=function(e){for(var t,n,r,a=e.length,i=-1,o=0;++i<a;)o+=e[i].length;for(n=new Array(o);--a>=0;)for(r=e[a],t=r.length;--t>=0;)n[--o]=r[t];return n};var xo=Math.abs;so.range=function(e,t,n){if(arguments.length<3&&(n=1,arguments.length<2&&(t=e,e=0)),(t-e)/n===1/0)throw new Error("infinite range");var r,a=[],i=s(xo(n)),o=-1;if(e*=i,t*=i,n*=i,n<0)for(;(r=e+n*++o)>t;)a.push(r/i);else for(;(r=e+n*++o)<t;)a.push(r/i);return a},so.map=function(e,t){var n=new c;if(e instanceof c)e.forEach(function(e,t){n.set(e,t)});else if(Array.isArray(e)){var r,a=-1,i=e.length;if(1===arguments.length)for(;++a<i;)n.set(a,e[a]);else for(;++a<i;)n.set(t.call(e,r=e[a],a),r)}else for(var o in e)n.set(o,e[o]);return n};var bo="__proto__",wo="\0";u(c,{has:p,get:function(e){return this._[f(e)]},set:function(e,t){return this._[f(e)]=t},remove:h,keys:v,values:function(){var e=[];for(var t in this._)e.push(this._[t]);return e},entries:function(){var e=[];for(var t in this._)e.push({key:d(t),value:this._[t]});return e},size:g,empty:m,forEach:function(e){for(var t in this._)e.call(this,d(t),this._[t])}}),so.nest=function(){function e(t,o,l){if(l>=i.length)return r?r.call(a,o):n?o.sort(n):o;for(var s,u,f,d,p=-1,h=o.length,v=i[l++],g=new c;++p<h;)(d=g.get(s=v(u=o[p])))?d.push(u):g.set(s,[u]);return t?(u=t(),f=function(n,r){u.set(n,e(t,r,l))}):(u={},f=function(n,r){u[n]=e(t,r,l)}),g.forEach(f),u}function t(e,n){if(n>=i.length)return e;var r=[],a=o[n++];return e.forEach(function(e,a){r.push({key:e,values:t(a,n)})}),a?r.sort(function(e,t){return a(e.key,t.key)}):r}var n,r,a={},i=[],o=[];return a.map=function(t,n){return e(n,t,0)},a.entries=function(n){return t(e(so.map,n,0),0)},a.key=function(e){return i.push(e),a},a.sortKeys=function(e){return o[i.length-1]=e,a},a.sortValues=function(e){return n=e,a},a.rollup=function(e){return r=e,a},a},so.set=function(e){var t=new y;if(e)for(var n=0,r=e.length;n<r;++n)t.add(e[n]);return t},u(y,{has:p,add:function(e){return this._[f(e+="")]=!0,e},remove:h,values:v,size:g,empty:m,forEach:function(e){for(var t in this._)e.call(this,d(t))}}),so.behavior={},so.rebind=function(e,t){for(var n,r=1,a=arguments.length;++r<a;)e[n=arguments[r]]=b(e,t,t[n]);return e};var _o=["webkit","ms","moz","Moz","o","O"];so.dispatch=function(){for(var e=new k,t=-1,n=arguments.length;++t<n;)e[arguments[t]]=z(e);return e},k.prototype.on=function(e,t){var n=e.indexOf("."),r="";if(n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),e)return arguments.length<2?this[e].on(r):this[e].on(r,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(r,null); | |
return this}},so.event=null,so.requote=function(e){return e.replace(ko,"\\$&")};var ko=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,zo={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)e[n]=t[n]},Mo=function(e,t){return t.querySelector(e)},Ao=function(e,t){return t.querySelectorAll(e)},jo=function(e,t){var n=e.matches||e[w(e,"matchesSelector")];return(jo=function(e,t){return n.call(e,t)})(e,t)};"function"==typeof Sizzle&&(Mo=function(e,t){return Sizzle(e,t)[0]||null},Ao=Sizzle,jo=Sizzle.matchesSelector),so.selection=function(){return so.select(fo.documentElement)};var Eo=so.selection.prototype=[];Eo.select=function(e){var t,n,r,a,i=[];e=S(e);for(var o=-1,l=this.length;++o<l;){i.push(t=[]),t.parentNode=(r=this[o]).parentNode;for(var s=-1,u=r.length;++s<u;)(a=r[s])?(t.push(n=e.call(a,a.__data__,s,o)),n&&"__data__"in a&&(n.__data__=a.__data__)):t.push(null)}return E(i)},Eo.selectAll=function(e){var t,n,r=[];e=O(e);for(var a=-1,i=this.length;++a<i;)for(var o=this[a],l=-1,s=o.length;++l<s;)(n=o[l])&&(r.push(t=co(e.call(n,n.__data__,l,a))),t.parentNode=n);return E(r)};var So={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/"};so.ns={prefix:So,qualify:function(e){var t=e.indexOf(":"),n=e;return t>=0&&"xmlns"!==(n=e.slice(0,t))&&(e=e.slice(t+1)),So.hasOwnProperty(n)?{space:So[n],local:e}:e}},Eo.attr=function(e,t){if(arguments.length<2){if("string"==typeof e){var n=this.node();return e=so.ns.qualify(e),e.local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(t in e)this.each(N(t,e[t]));return this}return this.each(N(e,t))},Eo.classed=function(e,t){if(arguments.length<2){if("string"==typeof e){var n=this.node(),r=(e=T(e)).length,a=-1;if(t=n.classList){for(;++a<r;)if(!t.contains(e[a]))return!1}else for(t=n.getAttribute("class");++a<r;)if(!C(e[a]).test(t))return!1;return!0}for(t in e)this.each(q(t,e[t]));return this}return this.each(q(e,t))},Eo.style=function(e,t,r){var a=arguments.length;if(a<3){if("string"!=typeof e){a<2&&(t="");for(r in e)this.each(B(r,e[r],t));return this}if(a<2){var i=this.node();return n(i).getComputedStyle(i,null).getPropertyValue(e)}r=""}return this.each(B(e,t,r))},Eo.property=function(e,t){if(arguments.length<2){if("string"==typeof e)return this.node()[e];for(t in e)this.each(D(t,e[t]));return this}return this.each(D(e,t))},Eo.text=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}:null==e?function(){this.textContent=""}:function(){this.textContent=e}):this.node().textContent},Eo.html=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}:null==e?function(){this.innerHTML=""}:function(){this.innerHTML=e}):this.node().innerHTML},Eo.append=function(e){return e=R(e),this.select(function(){return this.appendChild(e.apply(this,arguments))})},Eo.insert=function(e,t){return e=R(e),t=S(t),this.select(function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)})},Eo.remove=function(){return this.each(I)},Eo.data=function(e,t){function n(e,n){var r,a,i,o=e.length,f=n.length,d=Math.min(o,f),p=new Array(f),h=new Array(f),v=new Array(o);if(t){var g,m=new c,y=new Array(o);for(r=-1;++r<o;)(a=e[r])&&(m.has(g=t.call(a,a.__data__,r))?v[r]=a:m.set(g,a),y[r]=g);for(r=-1;++r<f;)(a=m.get(g=t.call(n,i=n[r],r)))?a!==!0&&(p[r]=a,a.__data__=i):h[r]=L(i),m.set(g,!0);for(r=-1;++r<o;)r in y&&m.get(y[r])!==!0&&(v[r]=e[r])}else{for(r=-1;++r<d;)a=e[r],i=n[r],a?(a.__data__=i,p[r]=a):h[r]=L(i);for(;r<f;++r)h[r]=L(n[r]);for(;r<o;++r)v[r]=e[r]}h.update=p,h.parentNode=p.parentNode=v.parentNode=e.parentNode,l.push(h),s.push(p),u.push(v)}var r,a,i=-1,o=this.length;if(!arguments.length){for(e=new Array(o=(r=this[0]).length);++i<o;)(a=r[i])&&(e[i]=a.__data__);return e}var l=H([]),s=E([]),u=E([]);if("function"==typeof e)for(;++i<o;)n(r=this[i],e.call(r,r.parentNode.__data__,i));else for(;++i<o;)n(r=this[i],e);return s.enter=function(){return l},s.exit=function(){return u},s},Eo.datum=function(e){return arguments.length?this.property("__data__",e):this.property("__data__")},Eo.filter=function(e){var t,n,r,a=[];"function"!=typeof e&&(e=V(e));for(var i=0,o=this.length;i<o;i++){a.push(t=[]),t.parentNode=(n=this[i]).parentNode;for(var l=0,s=n.length;l<s;l++)(r=n[l])&&e.call(r,r.__data__,l,i)&&t.push(r)}return E(a)},Eo.order=function(){for(var e=-1,t=this.length;++e<t;)for(var n,r=this[e],a=r.length-1,i=r[a];--a>=0;)(n=r[a])&&(i&&i!==n.nextSibling&&i.parentNode.insertBefore(n,i),i=n);return this},Eo.sort=function(e){e=U.apply(this,arguments);for(var t=-1,n=this.length;++t<n;)this[t].sort(e);return this.order()},Eo.each=function(e){return Y(this,function(t,n,r){e.call(t,t.__data__,n,r)})},Eo.call=function(e){var t=co(arguments);return e.apply(t[0]=this,t),this},Eo.empty=function(){return!this.node()},Eo.node=function(){for(var e=0,t=this.length;e<t;e++)for(var n=this[e],r=0,a=n.length;r<a;r++){var i=n[r];if(i)return i}return null},Eo.size=function(){var e=0;return Y(this,function(){++e}),e};var Oo=[];so.selection.enter=H,so.selection.enter.prototype=Oo,Oo.append=Eo.append,Oo.empty=Eo.empty,Oo.node=Eo.node,Oo.call=Eo.call,Oo.size=Eo.size,Oo.select=function(e){for(var t,n,r,a,i,o=[],l=-1,s=this.length;++l<s;){r=(a=this[l]).update,o.push(t=[]),t.parentNode=a.parentNode;for(var u=-1,c=a.length;++u<c;)(i=a[u])?(t.push(r[u]=n=e.call(a.parentNode,i.__data__,u,l)),n.__data__=i.__data__):t.push(null)}return E(o)},Oo.insert=function(e,t){return arguments.length<2&&(t=X(this)),Eo.insert.call(this,e,t)},so.select=function(t){var n;return"string"==typeof t?(n=[Mo(t,fo)],n.parentNode=fo.documentElement):(n=[t],n.parentNode=e(t)),E([n])},so.selectAll=function(e){var t;return"string"==typeof e?(t=co(Ao(e,fo)),t.parentNode=fo.documentElement):(t=co(e),t.parentNode=null),E([t])},Eo.on=function(e,t,n){var r=arguments.length;if(r<3){if("string"!=typeof e){r<2&&(t=!1);for(n in e)this.each(G(n,e[n],t));return this}if(r<2)return(r=this.node()["__on"+e])&&r._;n=!1}return this.each(G(e,t,n))};var No=so.map({mouseenter:"mouseover",mouseleave:"mouseout"});fo&&No.forEach(function(e){"on"+e in fo&&No.remove(e)});var Fo,Co=0;so.mouse=function(e){return Q(e,A())};var To=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;so.touch=function(e,t,n){if(arguments.length<3&&(n=t,t=A().changedTouches),t)for(var r,a=0,i=t.length;a<i;++a)if((r=t[a]).identifier===n)return Q(e,r)},so.behavior.drag=function(){function e(){this.on("mousedown.drag",i).on("touchstart.drag",o)}function t(e,t,n,i,o){return function(){function l(){var e,n,r=t(d,v);r&&(e=r[0]-x[0],n=r[1]-x[1],h|=e|n,x=r,p({type:"drag",x:r[0]+u[0],y:r[1]+u[1],dx:e,dy:n}))}function s(){t(d,v)&&(m.on(i+g,null).on(o+g,null),y(h),p({type:"dragend"}))}var u,c=this,f=so.event.target.correspondingElement||so.event.target,d=c.parentNode,p=r.of(c,arguments),h=0,v=e(),g=".drag"+(null==v?"":"-"+v),m=so.select(n(f)).on(i+g,l).on(o+g,s),y=J(f),x=t(d,v);a?(u=a.apply(c,arguments),u=[u.x-x[0],u.y-x[1]]):u=[0,0],p({type:"dragstart"})}}var r=j(e,"drag","dragstart","dragend"),a=null,i=t(_,so.mouse,n,"mousemove","mouseup"),o=t(K,so.touch,x,"touchmove","touchend");return e.origin=function(t){return arguments.length?(a=t,e):a},so.rebind(e,r,"on")},so.touches=function(e,t){return arguments.length<2&&(t=A().touches),t?co(t).map(function(t){var n=Q(e,t);return n.identifier=t.identifier,n}):[]};var qo=1e-6,Po=qo*qo,Bo=Math.PI,Do=2*Bo,Ro=Do-qo,Io=Bo/2,Lo=Bo/180,Vo=180/Bo,Uo=Math.SQRT2,Yo=2,Ho=4;so.interpolateZoom=function(e,t){var n,r,a=e[0],i=e[1],o=e[2],l=t[0],s=t[1],u=t[2],c=l-a,f=s-i,d=c*c+f*f;if(d<Po)r=Math.log(u/o)/Uo,n=function(e){return[a+e*c,i+e*f,o*Math.exp(Uo*e*r)]};else{var p=Math.sqrt(d),h=(u*u-o*o+Ho*d)/(2*o*Yo*p),v=(u*u-o*o-Ho*d)/(2*u*Yo*p),g=Math.log(Math.sqrt(h*h+1)-h),m=Math.log(Math.sqrt(v*v+1)-v);r=(m-g)/Uo,n=function(e){var t=e*r,n=ae(g),l=o/(Yo*p)*(n*ie(Uo*t+g)-re(g));return[a+l*c,i+l*f,o*n/ae(Uo*t+g)]}}return n.duration=1e3*r,n},so.behavior.zoom=function(){function e(e){e.on(N,f).on(Go+".zoom",p).on("dblclick.zoom",h).on(T,d)}function t(e){return[(e[0]-z.x)/z.k,(e[1]-z.y)/z.k]}function r(e){return[e[0]*z.k+z.x,e[1]*z.k+z.y]}function a(e){z.k=Math.max(E[0],Math.min(E[1],e))}function i(e,t){t=r(t),z.x+=e[0]-t[0],z.y+=e[1]-t[1]}function o(t,n,r,o){t.__chart__={x:z.x,y:z.y,k:z.k},a(Math.pow(2,o)),i(g=n,r),t=so.select(t),S>0&&(t=t.transition().duration(S)),t.call(e.event)}function l(){w&&w.domain(b.range().map(function(e){return(e-z.x)/z.k}).map(b.invert)),k&&k.domain(_.range().map(function(e){return(e-z.y)/z.k}).map(_.invert))}function s(e){O++||e({type:"zoomstart"})}function u(e){l(),e({type:"zoom",scale:z.k,translate:[z.x,z.y]})}function c(e){--O||(e({type:"zoomend"}),g=null)}function f(){function e(){l=1,i(so.mouse(a),d),u(o)}function r(){f.on(F,null).on(C,null),p(l),c(o)}var a=this,o=q.of(a,arguments),l=0,f=so.select(n(a)).on(F,e).on(C,r),d=t(so.mouse(a)),p=J(a);Is.call(a),s(o)}function d(){function e(){var e=so.touches(h);return p=z.k,e.forEach(function(e){e.identifier in g&&(g[e.identifier]=t(e))}),e}function n(){var t=so.event.target;so.select(t).on(b,r).on(w,l),_.push(t);for(var n=so.event.changedTouches,a=0,i=n.length;a<i;++a)g[n[a].identifier]=null;var s=e(),u=Date.now();if(1===s.length){if(u-x<500){var c=s[0];o(h,c,g[c.identifier],Math.floor(Math.log(z.k)/Math.LN2)+1),M()}x=u}else if(s.length>1){var c=s[0],f=s[1],d=c[0]-f[0],p=c[1]-f[1];m=d*d+p*p}}function r(){var e,t,n,r,o=so.touches(h);Is.call(h);for(var l=0,s=o.length;l<s;++l,r=null)if(n=o[l],r=g[n.identifier]){if(t)break;e=n,t=r}if(r){var c=(c=n[0]-e[0])*c+(c=n[1]-e[1])*c,f=m&&Math.sqrt(c/m);e=[(e[0]+n[0])/2,(e[1]+n[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],a(f*p)}x=null,i(e,t),u(v)}function l(){if(so.event.touches.length){for(var t=so.event.changedTouches,n=0,r=t.length;n<r;++n)delete g[t[n].identifier];for(var a in g)return void e()}so.selectAll(_).on(y,null),k.on(N,f).on(T,d),A(),c(v)}var p,h=this,v=q.of(h,arguments),g={},m=0,y=".zoom-"+so.event.changedTouches[0].identifier,b="touchmove"+y,w="touchend"+y,_=[],k=so.select(h),A=J(h);n(),s(v),k.on(N,null).on(T,n)}function p(){var e=q.of(this,arguments);y?clearTimeout(y):(Is.call(this),v=t(g=m||so.mouse(this)),s(e)),y=setTimeout(function(){y=null,c(e)},50),M(),a(Math.pow(2,.002*Xo())*z.k),i(g,v),u(e)}function h(){var e=so.mouse(this),n=Math.log(z.k)/Math.LN2;o(this,e,t(e),so.event.shiftKey?Math.ceil(n)-1:Math.floor(n)+1)}var v,g,m,y,x,b,w,_,k,z={x:0,y:0,k:1},A=[960,500],E=Zo,S=250,O=0,N="mousedown.zoom",F="mousemove.zoom",C="mouseup.zoom",T="touchstart.zoom",q=j(e,"zoomstart","zoom","zoomend");return Go||(Go="onwheel"in fo?(Xo=function(){return-so.event.deltaY*(so.event.deltaMode?120:1)},"wheel"):"onmousewheel"in fo?(Xo=function(){return so.event.wheelDelta},"mousewheel"):(Xo=function(){return-so.event.detail},"MozMousePixelScroll")),e.event=function(e){e.each(function(){var e=q.of(this,arguments),t=z;Ds?so.select(this).transition().each("start.zoom",function(){z=this.__chart__||{x:0,y:0,k:1},s(e)}).tween("zoom:zoom",function(){var n=A[0],r=A[1],a=g?g[0]:n/2,i=g?g[1]:r/2,o=so.interpolateZoom([(a-z.x)/z.k,(i-z.y)/z.k,n/z.k],[(a-t.x)/t.k,(i-t.y)/t.k,n/t.k]);return function(t){var r=o(t),l=n/r[2];this.__chart__=z={x:a-r[0]*l,y:i-r[1]*l,k:l},u(e)}}).each("interrupt.zoom",function(){c(e)}).each("end.zoom",function(){c(e)}):(this.__chart__=z,s(e),u(e),c(e))})},e.translate=function(t){return arguments.length?(z={x:+t[0],y:+t[1],k:z.k},l(),e):[z.x,z.y]},e.scale=function(t){return arguments.length?(z={x:z.x,y:z.y,k:null},a(+t),l(),e):z.k},e.scaleExtent=function(t){return arguments.length?(E=null==t?Zo:[+t[0],+t[1]],e):E},e.center=function(t){return arguments.length?(m=t&&[+t[0],+t[1]],e):m},e.size=function(t){return arguments.length?(A=t&&[+t[0],+t[1]],e):A},e.duration=function(t){return arguments.length?(S=+t,e):S},e.x=function(t){return arguments.length?(w=t,b=t.copy(),z={x:0,y:0,k:1},e):w},e.y=function(t){return arguments.length?(k=t,_=t.copy(),z={x:0,y:0,k:1},e):k},so.rebind(e,q,"on")};var Xo,Go,Zo=[0,1/0];so.color=le,le.prototype.toString=function(){return this.rgb()+""},so.hsl=se;var Wo=se.prototype=new le;Wo.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new se(this.h,this.s,this.l/e)},Wo.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new se(this.h,this.s,e*this.l)},Wo.rgb=function(){return ue(this.h,this.s,this.l)},so.hcl=ce;var Jo=ce.prototype=new le;Jo.brighter=function(e){return new ce(this.h,this.c,Math.min(100,this.l+Qo*(arguments.length?e:1)))},Jo.darker=function(e){return new ce(this.h,this.c,Math.max(0,this.l-Qo*(arguments.length?e:1)))},Jo.rgb=function(){return fe(this.h,this.c,this.l).rgb()},so.lab=de;var Qo=18,Ko=.95047,$o=1,el=1.08883,tl=de.prototype=new le;tl.brighter=function(e){return new de(Math.min(100,this.l+Qo*(arguments.length?e:1)),this.a,this.b)},tl.darker=function(e){return new de(Math.max(0,this.l-Qo*(arguments.length?e:1)),this.a,this.b)},tl.rgb=function(){return pe(this.l,this.a,this.b)},so.rgb=ye;var nl=ye.prototype=new le;nl.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,n=this.g,r=this.b,a=30;return t||n||r?(t&&t<a&&(t=a),n&&n<a&&(n=a),r&&r<a&&(r=a),new ye(Math.min(255,t/e),Math.min(255,n/e),Math.min(255,r/e))):new ye(a,a,a)},nl.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new ye(e*this.r,e*this.g,e*this.b)},nl.hsl=function(){return ke(this.r,this.g,this.b)},nl.toString=function(){return"#"+we(this.r)+we(this.g)+we(this.b)};var rl=so.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});rl.forEach(function(e,t){rl.set(e,xe(t))}),so.functor=je,so.xhr=Ee(x),so.dsv=function(e,t){function n(e,n,i){arguments.length<3&&(i=n,n=null);var o=Se(e,t,null==n?r:a(n),i);return o.row=function(e){return arguments.length?o.response(null==(n=e)?r:a(e)):n},o}function r(e){return n.parse(e.responseText)}function a(e){return function(t){return n.parse(t.responseText,e)}}function i(t){return t.map(o).join(e)}function o(e){return l.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}var l=new RegExp('["'+e+"\n]"),s=e.charCodeAt(0);return n.parse=function(e,t){var r;return n.parseRows(e,function(e,n){if(r)return r(e,n-1);var a=new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}");r=t?function(e,n){return t(a(e),n)}:a})},n.parseRows=function(e,t){function n(){if(c>=u)return o;if(a)return a=!1,i;var t=c;if(34===e.charCodeAt(t)){for(var n=t;n++<u;)if(34===e.charCodeAt(n)){if(34!==e.charCodeAt(n+1))break;++n}c=n+2;var r=e.charCodeAt(n+1);return 13===r?(a=!0,10===e.charCodeAt(n+2)&&++c):10===r&&(a=!0),e.slice(t+1,n).replace(/""/g,'"')}for(;c<u;){var r=e.charCodeAt(c++),l=1;if(10===r)a=!0;else if(13===r)a=!0,10===e.charCodeAt(c)&&(++c,++l);else if(r!==s)continue;return e.slice(t,c-l)}return e.slice(t)}for(var r,a,i={},o={},l=[],u=e.length,c=0,f=0;(r=n())!==o;){for(var d=[];r!==i&&r!==o;)d.push(r),r=n();t&&null==(d=t(d,f++))||l.push(d)}return l},n.format=function(t){if(Array.isArray(t[0]))return n.formatRows(t);var r=new y,a=[];return t.forEach(function(e){for(var t in e)r.has(t)||a.push(r.add(t))}),[a.map(o).join(e)].concat(t.map(function(t){return a.map(function(e){return o(t[e])}).join(e)})).join("\n")},n.formatRows=function(e){return e.map(i).join("\n")},n},so.csv=so.dsv(",","text/csv"),so.tsv=so.dsv("\t","text/tab-separated-values");var al,il,ol,ll,sl=this[w(this,"requestAnimationFrame")]||function(e){setTimeout(e,17)};so.timer=function(){Fe.apply(this,arguments)},so.timer.flush=function(){Te(),qe()},so.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)};var ul=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Be);so.formatPrefix=function(e,t){var n=0;return(e=+e)&&(e<0&&(e*=-1),t&&(e=so.round(e,Pe(e,t))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),ul[8+n/3]};var cl=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,fl=so.map({b:function(e){return e.toString(2)},c:function(e){return String.fromCharCode(e)},o:function(e){return e.toString(8)},x:function(e){return e.toString(16)},X:function(e){return e.toString(16).toUpperCase()},g:function(e,t){return e.toPrecision(t)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},r:function(e,t){return(e=so.round(e,Pe(e,t))).toFixed(Math.max(0,Math.min(20,Pe(e*(1+1e-15),t))))}}),dl=so.time={},pl=Date;Ie.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(){hl.setUTCDate.apply(this._,arguments)},setDay:function(){hl.setUTCDay.apply(this._,arguments)},setFullYear:function(){hl.setUTCFullYear.apply(this._,arguments)},setHours:function(){hl.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){hl.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){hl.setUTCMinutes.apply(this._,arguments)},setMonth:function(){hl.setUTCMonth.apply(this._,arguments)},setSeconds:function(){hl.setUTCSeconds.apply(this._,arguments)},setTime:function(){hl.setTime.apply(this._,arguments)}};var hl=Date.prototype;dl.year=Le(function(e){return e=dl.day(e),e.setMonth(0,1),e},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e){return e.getFullYear()}),dl.years=dl.year.range,dl.years.utc=dl.year.utc.range,dl.day=Le(function(e){var t=new pl(2e3,0);return t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t},function(e,t){e.setDate(e.getDate()+t)},function(e){return e.getDate()-1}),dl.days=dl.day.range,dl.days.utc=dl.day.utc.range,dl.dayOfYear=function(e){var t=dl.year(e);return Math.floor((e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(e,t){t=7-t;var n=dl[e]=Le(function(e){return(e=dl.day(e)).setDate(e.getDate()-(e.getDay()+t)%7),e},function(e,t){e.setDate(e.getDate()+7*Math.floor(t))},function(e){var n=dl.year(e).getDay();return Math.floor((dl.dayOfYear(e)+(n+t)%7)/7)-(n!==t)});dl[e+"s"]=n.range,dl[e+"s"].utc=n.utc.range,dl[e+"OfYear"]=function(e){var n=dl.year(e).getDay();return Math.floor((dl.dayOfYear(e)+(n+t)%7)/7)}}),dl.week=dl.sunday,dl.weeks=dl.sunday.range,dl.weeks.utc=dl.sunday.utc.range,dl.weekOfYear=dl.sundayOfYear;var vl={"-":"",_:" ",0:"0"},gl=/^\s*\d+/,ml=/^%/;so.locale=function(e){return{numberFormat:De(e),timeFormat:Ue(e)}};var yl=so.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"]});so.format=yl.numberFormat,so.geo={},ct.prototype={s:0,t:0,add:function(e){ft(e,this.t,xl),ft(xl.s,this.s,this),this.s?this.t+=xl.t:this.s=xl.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var xl=new ct;so.geo.stream=function(e,t){e&&bl.hasOwnProperty(e.type)?bl[e.type](e,t):dt(e,t)};var bl={Feature:function(e,t){dt(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,a=n.length;++r<a;)dt(n[r].geometry,t)}},wl={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,a=n.length;++r<a;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){pt(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,a=n.length;++r<a;)pt(n[r],t,0)},Polygon:function(e,t){ht(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,a=n.length;++r<a;)ht(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,a=n.length;++r<a;)dt(n[r],t)}};so.geo.area=function(e){return _l=0,so.geo.stream(e,zl),_l};var _l,kl=new ct,zl={sphere:function(){_l+=4*Bo},point:_,lineStart:_,lineEnd:_,polygonStart:function(){kl.reset(),zl.lineStart=vt},polygonEnd:function(){var e=2*kl;_l+=e<0?4*Bo+e:e,zl.lineStart=zl.lineEnd=zl.point=_}};so.geo.bounds=function(){function e(e,t){x.push(b=[c=e,d=e]),t<f&&(f=t),t>p&&(p=t)}function t(t,n){var r=gt([t*Lo,n*Lo]);if(m){var a=yt(m,r),i=[a[1],-a[0],0],o=yt(i,a);wt(o),o=_t(o);var s=t-h,u=s>0?1:-1,v=o[0]*Vo*u,g=xo(s)>180;if(g^(u*h<v&&v<u*t)){var y=o[1]*Vo;y>p&&(p=y)}else if(v=(v+360)%360-180,g^(u*h<v&&v<u*t)){var y=-o[1]*Vo;y<f&&(f=y)}else n<f&&(f=n),n>p&&(p=n);g?t<h?l(c,t)>l(c,d)&&(d=t):l(t,d)>l(c,d)&&(c=t):d>=c?(t<c&&(c=t),t>d&&(d=t)):t>h?l(c,t)>l(c,d)&&(d=t):l(t,d)>l(c,d)&&(c=t)}else e(t,n);m=r,h=t}function n(){w.point=t}function r(){b[0]=c,b[1]=d,w.point=e,m=null}function a(e,n){if(m){var r=e-h;y+=xo(r)>180?r+(r>0?360:-360):r}else v=e,g=n;zl.point(e,n),t(e,n)}function i(){zl.lineStart()}function o(){a(v,g),zl.lineEnd(),xo(y)>qo&&(c=-(d=180)),b[0]=c,b[1]=d,m=null}function l(e,t){return(t-=e)<0?t+360:t}function s(e,t){return e[0]-t[0]}function u(e,t){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}var c,f,d,p,h,v,g,m,y,x,b,w={point:e,lineStart:n,lineEnd:r,polygonStart:function(){w.point=a,w.lineStart=i,w.lineEnd=o,y=0,zl.polygonStart()},polygonEnd:function(){zl.polygonEnd(),w.point=e,w.lineStart=n,w.lineEnd=r,kl<0?(c=-(d=180),f=-(p=90)):y>qo?p=90:y<-qo&&(f=-90),b[0]=c,b[1]=d}};return function(e){p=d=-(c=f=1/0),x=[],so.geo.stream(e,w);var t=x.length;if(t){x.sort(s);for(var n,r=1,a=x[0],i=[a];r<t;++r)n=x[r],u(n[0],a)||u(n[1],a)?(l(a[0],n[1])>l(a[0],a[1])&&(a[1]=n[1]),l(n[0],a[1])>l(a[0],a[1])&&(a[0]=n[0])):i.push(a=n);for(var o,n,h=-(1/0),t=i.length-1,r=0,a=i[t];r<=t;a=n,++r)n=i[r],(o=l(a[1],n[0]))>h&&(h=o,c=n[0],d=a[1])}return x=b=null,c===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[c,f],[d,p]]}}(),so.geo.centroid=function(e){Ml=Al=jl=El=Sl=Ol=Nl=Fl=Cl=Tl=ql=0,so.geo.stream(e,Pl);var t=Cl,n=Tl,r=ql,a=t*t+n*n+r*r;return a<Po&&(t=Ol,n=Nl,r=Fl,Al<qo&&(t=jl,n=El,r=Sl),a=t*t+n*n+r*r,a<Po)?[NaN,NaN]:[Math.atan2(n,t)*Vo,ne(r/Math.sqrt(a))*Vo]};var Ml,Al,jl,El,Sl,Ol,Nl,Fl,Cl,Tl,ql,Pl={sphere:_,point:zt,lineStart:At,lineEnd:jt,polygonStart:function(){Pl.lineStart=Et},polygonEnd:function(){Pl.lineStart=At}},Bl=Tt(Ot,Dt,It,[-Bo,-Bo/2]),Dl=1e9;so.geo.clipExtent=function(){var e,t,n,r,a,i,o={stream:function(e){return a&&(a.valid=!1),a=i(e),a.valid=!0,a},extent:function(l){return arguments.length?(i=Yt(e=+l[0][0],t=+l[0][1],n=+l[1][0],r=+l[1][1]),a&&(a.valid=!1,a=null),o):[[e,t],[n,r]]}};return o.extent([[0,0],[960,500]])},(so.geo.conicEqualArea=function(){return Ht(Xt)}).raw=Xt,so.geo.albers=function(){return so.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},so.geo.albersUsa=function(){function e(e){var i=e[0],o=e[1];return t=null,n(i,o),t||(r(i,o),t)||a(i,o),t}var t,n,r,a,i=so.geo.albers(),o=so.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=so.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(e,n){t=[e,n]}};return e.invert=function(e){var t=i.scale(),n=i.translate(),r=(e[0]-n[0])/t,a=(e[1]-n[1])/t;return(a>=.12&&a<.234&&r>=-.425&&r<-.214?o:a>=.166&&a<.234&&r>=-.214&&r<-.115?l:i).invert(e)},e.stream=function(e){var t=i.stream(e),n=o.stream(e),r=l.stream(e);return{point:function(e,a){t.point(e,a),n.point(e,a),r.point(e,a)},sphere:function(){t.sphere(),n.sphere(),r.sphere()},lineStart:function(){t.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},e.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),l.precision(t),e):i.precision()},e.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),l.scale(t),e.translate(i.translate())):i.scale()},e.translate=function(t){if(!arguments.length)return i.translate();var u=i.scale(),c=+t[0],f=+t[1];return n=i.translate(t).clipExtent([[c-.455*u,f-.238*u],[c+.455*u,f+.238*u]]).stream(s).point,r=o.translate([c-.307*u,f+.201*u]).clipExtent([[c-.425*u+qo,f+.12*u+qo],[c-.214*u-qo,f+.234*u-qo]]).stream(s).point,a=l.translate([c-.205*u,f+.212*u]).clipExtent([[c-.214*u+qo,f+.166*u+qo],[c-.115*u-qo,f+.234*u-qo]]).stream(s).point,e},e.scale(1070)};var Rl,Il,Ll,Vl,Ul,Yl,Hl={point:_,lineStart:_,lineEnd:_,polygonStart:function(){Il=0,Hl.lineStart=Gt},polygonEnd:function(){Hl.lineStart=Hl.lineEnd=Hl.point=_,Rl+=xo(Il/2)}},Xl={point:Zt,lineStart:_,lineEnd:_,polygonStart:_,polygonEnd:_},Gl={point:Qt,lineStart:Kt,lineEnd:$t,polygonStart:function(){Gl.lineStart=en},polygonEnd:function(){Gl.point=Qt,Gl.lineStart=Kt,Gl.lineEnd=$t}};so.geo.path=function(){function e(e){return e&&("function"==typeof l&&i.pointRadius(+l.apply(this,arguments)),o&&o.valid||(o=a(i)),so.geo.stream(e,o)),i.result()}function t(){return o=null,e}var n,r,a,i,o,l=4.5;return e.area=function(e){return Rl=0,so.geo.stream(e,a(Hl)),Rl},e.centroid=function(e){return jl=El=Sl=Ol=Nl=Fl=Cl=Tl=ql=0,so.geo.stream(e,a(Gl)),ql?[Cl/ql,Tl/ql]:Fl?[Ol/Fl,Nl/Fl]:Sl?[jl/Sl,El/Sl]:[NaN,NaN]},e.bounds=function(e){return Ul=Yl=-(Ll=Vl=1/0),so.geo.stream(e,a(Xl)),[[Ll,Vl],[Ul,Yl]]},e.projection=function(e){return arguments.length?(a=(n=e)?e.stream||rn(e):x,t()):n},e.context=function(e){return arguments.length?(i=null==(r=e)?new Wt:new tn(e),"function"!=typeof l&&i.pointRadius(l),t()):r},e.pointRadius=function(t){return arguments.length?(l="function"==typeof t?t:(i.pointRadius(+t),+t),e):l},e.projection(so.geo.albersUsa()).context(null)},so.geo.transform=function(e){return{stream:function(t){var n=new an(t);for(var r in e)n[r]=e[r];return n}}},an.prototype={point:function(e,t){this.stream.point(e,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()}},so.geo.projection=ln,so.geo.projectionMutator=sn,(so.geo.equirectangular=function(){return ln(cn)}).raw=cn.invert=cn,so.geo.rotation=function(e){function t(t){return t=e(t[0]*Lo,t[1]*Lo),t[0]*=Vo,t[1]*=Vo,t}return e=dn(e[0]%360*Lo,e[1]*Lo,e.length>2?e[2]*Lo:0),t.invert=function(t){return t=e.invert(t[0]*Lo,t[1]*Lo),t[0]*=Vo,t[1]*=Vo,t},t},fn.invert=cn,so.geo.circle=function(){function e(){var e="function"==typeof r?r.apply(this,arguments):r,t=dn(-e[0]*Lo,-e[1]*Lo,0).invert,a=[];return n(null,null,1,{point:function(e,n){a.push(e=t(e,n)),e[0]*=Vo,e[1]*=Vo}}),{type:"Polygon",coordinates:[a]}}var t,n,r=[0,0],a=6;return e.origin=function(t){return arguments.length?(r=t,e):r},e.angle=function(r){return arguments.length?(n=gn((t=+r)*Lo,a*Lo),e):t},e.precision=function(r){return arguments.length?(n=gn(t*Lo,(a=+r)*Lo),e):a},e.angle(90)},so.geo.distance=function(e,t){var n,r=(t[0]-e[0])*Lo,a=e[1]*Lo,i=t[1]*Lo,o=Math.sin(r),l=Math.cos(r),s=Math.sin(a),u=Math.cos(a),c=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((n=f*o)*n+(n=u*c-s*f*l)*n),s*c+u*f*l)},so.geo.graticule=function(){function e(){return{type:"MultiLineString",coordinates:t()}}function t(){return so.range(Math.ceil(i/g)*g,a,g).map(d).concat(so.range(Math.ceil(u/m)*m,s,m).map(p)).concat(so.range(Math.ceil(r/h)*h,n,h).filter(function(e){return xo(e%g)>qo}).map(c)).concat(so.range(Math.ceil(l/v)*v,o,v).filter(function(e){return xo(e%m)>qo}).map(f))}var n,r,a,i,o,l,s,u,c,f,d,p,h=10,v=h,g=90,m=360,y=2.5;return e.lines=function(){return t().map(function(e){return{type:"LineString",coordinates:e}})},e.outline=function(){return{type:"Polygon",coordinates:[d(i).concat(p(s).slice(1),d(a).reverse().slice(1),p(u).reverse().slice(1))]}},e.extent=function(t){return arguments.length?e.majorExtent(t).minorExtent(t):e.minorExtent()},e.majorExtent=function(t){return arguments.length?(i=+t[0][0],a=+t[1][0],u=+t[0][1],s=+t[1][1],i>a&&(t=i,i=a,a=t),u>s&&(t=u,u=s,s=t),e.precision(y)):[[i,u],[a,s]]},e.minorExtent=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],l=+t[0][1],o=+t[1][1],r>n&&(t=r,r=n,n=t),l>o&&(t=l,l=o,o=t),e.precision(y)):[[r,l],[n,o]]},e.step=function(t){return arguments.length?e.majorStep(t).minorStep(t):e.minorStep()},e.majorStep=function(t){return arguments.length?(g=+t[0],m=+t[1],e):[g,m]},e.minorStep=function(t){return arguments.length?(h=+t[0],v=+t[1],e):[h,v]},e.precision=function(t){return arguments.length?(y=+t,c=yn(l,o,90),f=xn(r,n,y),d=yn(u,s,90),p=xn(i,a,y),e):y},e.majorExtent([[-180,-90+qo],[180,90-qo]]).minorExtent([[-180,-80-qo],[180,80+qo]])},so.geo.greatArc=function(){function e(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),n||a.apply(this,arguments)]}}var t,n,r=bn,a=wn;return e.distance=function(){return so.geo.distance(t||r.apply(this,arguments),n||a.apply(this,arguments)); | |
},e.source=function(n){return arguments.length?(r=n,t="function"==typeof n?null:n,e):r},e.target=function(t){return arguments.length?(a=t,n="function"==typeof t?null:t,e):a},e.precision=function(){return arguments.length?e:0},e},so.geo.interpolate=function(e,t){return _n(e[0]*Lo,e[1]*Lo,t[0]*Lo,t[1]*Lo)},so.geo.length=function(e){return Zl=0,so.geo.stream(e,Wl),Zl};var Zl,Wl={sphere:_,point:_,lineStart:kn,lineEnd:_,polygonStart:_,polygonEnd:_},Jl=zn(function(e){return Math.sqrt(2/(1+e))},function(e){return 2*Math.asin(e/2)});(so.geo.azimuthalEqualArea=function(){return ln(Jl)}).raw=Jl;var Ql=zn(function(e){var t=Math.acos(e);return t&&t/Math.sin(t)},x);(so.geo.azimuthalEquidistant=function(){return ln(Ql)}).raw=Ql,(so.geo.conicConformal=function(){return Ht(Mn)}).raw=Mn,(so.geo.conicEquidistant=function(){return Ht(An)}).raw=An;var Kl=zn(function(e){return 1/e},Math.atan);(so.geo.gnomonic=function(){return ln(Kl)}).raw=Kl,jn.invert=function(e,t){return[e,2*Math.atan(Math.exp(t))-Io]},(so.geo.mercator=function(){return En(jn)}).raw=jn;var $l=zn(function(){return 1},Math.asin);(so.geo.orthographic=function(){return ln($l)}).raw=$l;var es=zn(function(e){return 1/(1+e)},function(e){return 2*Math.atan(e)});(so.geo.stereographic=function(){return ln(es)}).raw=es,Sn.invert=function(e,t){return[-t,2*Math.atan(Math.exp(e))-Io]},(so.geo.transverseMercator=function(){var e=En(Sn),t=e.center,n=e.rotate;return e.center=function(e){return e?t([-e[1],e[0]]):(e=t(),[e[1],-e[0]])},e.rotate=function(e){return e?n([e[0],e[1],e.length>2?e[2]+90:90]):(e=n(),[e[0],e[1],e[2]-90])},n([0,0,90])}).raw=Sn,so.geom={},so.geom.hull=function(e){function t(e){if(e.length<3)return[];var t,a=je(n),i=je(r),o=e.length,l=[],s=[];for(t=0;t<o;t++)l.push([+a.call(this,e[t],t),+i.call(this,e[t],t),t]);for(l.sort(Cn),t=0;t<o;t++)s.push([l[t][0],-l[t][1]]);var u=Fn(l),c=Fn(s),f=c[0]===u[0],d=c[c.length-1]===u[u.length-1],p=[];for(t=u.length-1;t>=0;--t)p.push(e[l[u[t]][2]]);for(t=+f;t<c.length-d;++t)p.push(e[l[c[t]][2]]);return p}var n=On,r=Nn;return arguments.length?t(e):(t.x=function(e){return arguments.length?(n=e,t):n},t.y=function(e){return arguments.length?(r=e,t):r},t)},so.geom.polygon=function(e){return zo(e,ts),e};var ts=so.geom.polygon.prototype=[];ts.area=function(){for(var e,t=-1,n=this.length,r=this[n-1],a=0;++t<n;)e=r,r=this[t],a+=e[1]*r[0]-e[0]*r[1];return.5*a},ts.centroid=function(e){var t,n,r=-1,a=this.length,i=0,o=0,l=this[a-1];for(arguments.length||(e=-1/(6*this.area()));++r<a;)t=l,l=this[r],n=t[0]*l[1]-l[0]*t[1],i+=(t[0]+l[0])*n,o+=(t[1]+l[1])*n;return[i*e,o*e]},ts.clip=function(e){for(var t,n,r,a,i,o,l=Pn(e),s=-1,u=this.length-Pn(this),c=this[u-1];++s<u;){for(t=e.slice(),e.length=0,a=this[s],i=t[(r=t.length-l)-1],n=-1;++n<r;)o=t[n],Tn(o,c,a)?(Tn(i,c,a)||e.push(qn(i,o,c,a)),e.push(o)):Tn(i,c,a)&&e.push(qn(i,o,c,a)),i=o;l&&e.push(e[0]),c=a}return e};var ns,rs,as,is,os,ls=[],ss=[];Yn.prototype.prepare=function(){for(var e,t=this.edges,n=t.length;n--;)e=t[n].edge,e.b&&e.a||t.splice(n,1);return t.sort(Xn),t.length},nr.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}},rr.prototype={insert:function(e,t){var n,r,a;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;n=e}else this._?(e=lr(this._),t.P=null,t.N=e,e.P=e.L=t,n=e):(t.P=t.N=null,this._=t,n=null);for(t.L=t.R=null,t.U=n,t.C=!0,e=t;n&&n.C;)r=n.U,n===r.L?(a=r.R,a&&a.C?(n.C=a.C=!1,r.C=!0,e=r):(e===n.R&&(ir(this,n),e=n,n=e.U),n.C=!1,r.C=!0,or(this,r))):(a=r.L,a&&a.C?(n.C=a.C=!1,r.C=!0,e=r):(e===n.L&&(or(this,n),e=n,n=e.U),n.C=!1,r.C=!0,ir(this,r))),n=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t,n,r,a=e.U,i=e.L,o=e.R;if(n=i?o?lr(o):i:o,a?a.L===e?a.L=n:a.R=n:this._=n,i&&o?(r=n.C,n.C=e.C,n.L=i,i.U=n,n!==o?(a=n.U,n.U=e.U,e=n.R,a.L=e,n.R=o,o.U=n):(n.U=a,a=n,e=n.R)):(r=e.C,e=n),e&&(e.U=a),!r){if(e&&e.C)return void(e.C=!1);do{if(e===this._)break;if(e===a.L){if(t=a.R,t.C&&(t.C=!1,a.C=!0,ir(this,a),t=a.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,or(this,t),t=a.R),t.C=a.C,a.C=t.R.C=!1,ir(this,a),e=this._;break}}else if(t=a.L,t.C&&(t.C=!1,a.C=!0,or(this,a),t=a.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,ir(this,t),t=a.L),t.C=a.C,a.C=t.L.C=!1,or(this,a),e=this._;break}t.C=!0,e=a,a=a.U}while(!e.C);e&&(e.C=!1)}}},so.geom.voronoi=function(e){function t(e){var t=new Array(e.length),r=l[0][0],a=l[0][1],i=l[1][0],o=l[1][1];return sr(n(e),l).cells.forEach(function(n,l){var s=n.edges,u=n.site,c=t[l]=s.length?s.map(function(e){var t=e.start();return[t.x,t.y]}):u.x>=r&&u.x<=i&&u.y>=a&&u.y<=o?[[r,o],[i,o],[i,a],[r,a]]:[];c.point=e[l]}),t}function n(e){return e.map(function(e,t){return{x:Math.round(i(e,t)/qo)*qo,y:Math.round(o(e,t)/qo)*qo,i:t}})}var r=On,a=Nn,i=r,o=a,l=us;return e?t(e):(t.links=function(e){return sr(n(e)).edges.filter(function(e){return e.l&&e.r}).map(function(t){return{source:e[t.l.i],target:e[t.r.i]}})},t.triangles=function(e){var t=[];return sr(n(e)).cells.forEach(function(n,r){for(var a,i,o=n.site,l=n.edges.sort(Xn),s=-1,u=l.length,c=l[u-1].edge,f=c.l===o?c.r:c.l;++s<u;)a=c,i=f,c=l[s].edge,f=c.l===o?c.r:c.l,r<i.i&&r<f.i&&cr(o,i,f)<0&&t.push([e[r],e[i.i],e[f.i]])}),t},t.x=function(e){return arguments.length?(i=je(r=e),t):r},t.y=function(e){return arguments.length?(o=je(a=e),t):a},t.clipExtent=function(e){return arguments.length?(l=null==e?us:e,t):l===us?null:l},t.size=function(e){return arguments.length?t.clipExtent(e&&[[0,0],e]):l===us?null:l&&l[1]},t)};var us=[[-1e6,-1e6],[1e6,1e6]];so.geom.delaunay=function(e){return so.geom.voronoi().triangles(e)},so.geom.quadtree=function(e,t,n,r,a){function i(e){function i(e,t,n,r,a,i,o,l){if(!isNaN(n)&&!isNaN(r))if(e.leaf){var s=e.x,c=e.y;if(null!=s)if(xo(s-n)+xo(c-r)<.01)u(e,t,n,r,a,i,o,l);else{var f=e.point;e.x=e.y=e.point=null,u(e,f,s,c,a,i,o,l),u(e,t,n,r,a,i,o,l)}else e.x=n,e.y=r,e.point=t}else u(e,t,n,r,a,i,o,l)}function u(e,t,n,r,a,o,l,s){var u=.5*(a+l),c=.5*(o+s),f=n>=u,d=r>=c,p=d<<1|f;e.leaf=!1,e=e.nodes[p]||(e.nodes[p]=pr()),f?a=u:l=u,d?o=c:s=c,i(e,t,n,r,a,o,l,s)}var c,f,d,p,h,v,g,m,y,x=je(l),b=je(s);if(null!=t)v=t,g=n,m=r,y=a;else if(m=y=-(v=g=1/0),f=[],d=[],h=e.length,o)for(p=0;p<h;++p)c=e[p],c.x<v&&(v=c.x),c.y<g&&(g=c.y),c.x>m&&(m=c.x),c.y>y&&(y=c.y),f.push(c.x),d.push(c.y);else for(p=0;p<h;++p){var w=+x(c=e[p],p),_=+b(c,p);w<v&&(v=w),_<g&&(g=_),w>m&&(m=w),_>y&&(y=_),f.push(w),d.push(_)}var k=m-v,z=y-g;k>z?y=g+k:m=v+z;var M=pr();if(M.add=function(e){i(M,e,+x(e,++p),+b(e,p),v,g,m,y)},M.visit=function(e){hr(e,M,v,g,m,y)},M.find=function(e){return vr(M,e[0],e[1],v,g,m,y)},p=-1,null==t){for(;++p<h;)i(M,e[p],f[p],d[p],v,g,m,y);--p}else e.forEach(M.add);return f=d=e=c=null,M}var o,l=On,s=Nn;return(o=arguments.length)?(l=fr,s=dr,3===o&&(a=n,r=t,n=t=0),i(e)):(i.x=function(e){return arguments.length?(l=e,i):l},i.y=function(e){return arguments.length?(s=e,i):s},i.extent=function(e){return arguments.length?(null==e?t=n=r=a=null:(t=+e[0][0],n=+e[0][1],r=+e[1][0],a=+e[1][1]),i):null==t?null:[[t,n],[r,a]]},i.size=function(e){return arguments.length?(null==e?t=n=r=a=null:(t=n=0,r=+e[0],a=+e[1]),i):null==t?null:[r-t,a-n]},i)},so.interpolateRgb=gr,so.interpolateObject=mr,so.interpolateNumber=yr,so.interpolateString=xr;var cs=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,fs=new RegExp(cs.source,"g");so.interpolate=br,so.interpolators=[function(e,t){var n=typeof t;return("string"===n?rl.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?gr:xr:t instanceof le?gr:Array.isArray(t)?wr:"object"===n&&isNaN(t)?mr:yr)(e,t)}],so.interpolateArray=wr;var ds=function(){return x},ps=so.map({linear:ds,poly:Er,quad:function(){return Mr},cubic:function(){return Ar},sin:function(){return Sr},exp:function(){return Or},circle:function(){return Nr},elastic:Fr,back:Cr,bounce:function(){return Tr}}),hs=so.map({in:x,out:kr,"in-out":zr,"out-in":function(e){return zr(kr(e))}});so.ease=function(e){var t=e.indexOf("-"),n=t>=0?e.slice(0,t):e,r=t>=0?e.slice(t+1):"in";return n=ps.get(n)||ds,r=hs.get(r)||x,_r(r(n.apply(null,uo.call(arguments,1))))},so.interpolateHcl=qr,so.interpolateHsl=Pr,so.interpolateLab=Br,so.interpolateRound=Dr,so.transform=function(e){var t=fo.createElementNS(so.ns.prefix.svg,"g");return(so.transform=function(e){if(null!=e){t.setAttribute("transform",e);var n=t.transform.baseVal.consolidate()}return new Rr(n?n.matrix:vs)})(e)},Rr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var vs={a:1,b:0,c:0,d:1,e:0,f:0};so.interpolateTransform=Zr,so.layout={},so.layout.bundle=function(){return function(e){for(var t=[],n=-1,r=e.length;++n<r;)t.push(Qr(e[n]));return t}},so.layout.chord=function(){function e(){var e,u,f,d,p,h={},v=[],g=so.range(i),m=[];for(n=[],r=[],e=0,d=-1;++d<i;){for(u=0,p=-1;++p<i;)u+=a[d][p];v.push(u),m.push(so.range(i)),e+=u}for(o&&g.sort(function(e,t){return o(v[e],v[t])}),l&&m.forEach(function(e,t){e.sort(function(e,n){return l(a[t][e],a[t][n])})}),e=(Do-c*i)/e,u=0,d=-1;++d<i;){for(f=u,p=-1;++p<i;){var y=g[d],x=m[y][p],b=a[y][x],w=u,_=u+=b*e;h[y+"-"+x]={index:y,subindex:x,startAngle:w,endAngle:_,value:b}}r[y]={index:y,startAngle:f,endAngle:u,value:v[y]},u+=c}for(d=-1;++d<i;)for(p=d-1;++p<i;){var k=h[d+"-"+p],z=h[p+"-"+d];(k.value||z.value)&&n.push(k.value<z.value?{source:z,target:k}:{source:k,target:z})}s&&t()}function t(){n.sort(function(e,t){return s((e.source.value+e.target.value)/2,(t.source.value+t.target.value)/2)})}var n,r,a,i,o,l,s,u={},c=0;return u.matrix=function(e){return arguments.length?(i=(a=e)&&a.length,n=r=null,u):a},u.padding=function(e){return arguments.length?(c=e,n=r=null,u):c},u.sortGroups=function(e){return arguments.length?(o=e,n=r=null,u):o},u.sortSubgroups=function(e){return arguments.length?(l=e,n=null,u):l},u.sortChords=function(e){return arguments.length?(s=e,n&&t(),u):s},u.chords=function(){return n||e(),n},u.groups=function(){return r||e(),r},u},so.layout.force=function(){function e(e){return function(t,n,r,a){if(t.point!==e){var i=t.cx-e.x,o=t.cy-e.y,l=a-n,s=i*i+o*o;if(l*l/m<s){if(s<v){var u=t.charge/s;e.px-=i*u,e.py-=o*u}return!0}if(t.point&&s&&s<v){var u=t.pointCharge/s;e.px-=i*u,e.py-=o*u}}return!t.charge}}function t(e){e.px=so.event.x,e.py=so.event.y,s.resume()}var n,r,a,i,o,l,s={},u=so.dispatch("start","tick","end"),c=[1,1],f=.9,d=gs,p=ms,h=-30,v=ys,g=.1,m=.64,y=[],b=[];return s.tick=function(){if((a*=.99)<.005)return n=null,u.end({type:"end",alpha:a=0}),!0;var t,r,s,d,p,v,m,x,w,_=y.length,k=b.length;for(r=0;r<k;++r)s=b[r],d=s.source,p=s.target,x=p.x-d.x,w=p.y-d.y,(v=x*x+w*w)&&(v=a*o[r]*((v=Math.sqrt(v))-i[r])/v,x*=v,w*=v,p.x-=x*(m=d.weight+p.weight?d.weight/(d.weight+p.weight):.5),p.y-=w*m,d.x+=x*(m=1-m),d.y+=w*m);if((m=a*g)&&(x=c[0]/2,w=c[1]/2,r=-1,m))for(;++r<_;)s=y[r],s.x+=(x-s.x)*m,s.y+=(w-s.y)*m;if(h)for(aa(t=so.geom.quadtree(y),a,l),r=-1;++r<_;)(s=y[r]).fixed||t.visit(e(s));for(r=-1;++r<_;)s=y[r],s.fixed?(s.x=s.px,s.y=s.py):(s.x-=(s.px-(s.px=s.x))*f,s.y-=(s.py-(s.py=s.y))*f);u.tick({type:"tick",alpha:a})},s.nodes=function(e){return arguments.length?(y=e,s):y},s.links=function(e){return arguments.length?(b=e,s):b},s.size=function(e){return arguments.length?(c=e,s):c},s.linkDistance=function(e){return arguments.length?(d="function"==typeof e?e:+e,s):d},s.distance=s.linkDistance,s.linkStrength=function(e){return arguments.length?(p="function"==typeof e?e:+e,s):p},s.friction=function(e){return arguments.length?(f=+e,s):f},s.charge=function(e){return arguments.length?(h="function"==typeof e?e:+e,s):h},s.chargeDistance=function(e){return arguments.length?(v=e*e,s):Math.sqrt(v)},s.gravity=function(e){return arguments.length?(g=+e,s):g},s.theta=function(e){return arguments.length?(m=e*e,s):Math.sqrt(m)},s.alpha=function(e){return arguments.length?(e=+e,a?e>0?a=e:(n.c=null,n.t=NaN,n=null,u.end({type:"end",alpha:a=0})):e>0&&(u.start({type:"start",alpha:a=e}),n=Fe(s.tick)),s):a},s.start=function(){function e(e,r){if(!n){for(n=new Array(a),s=0;s<a;++s)n[s]=[];for(s=0;s<u;++s){var i=b[s];n[i.source.index].push(i.target),n[i.target.index].push(i.source)}}for(var o,l=n[t],s=-1,c=l.length;++s<c;)if(!isNaN(o=l[s][e]))return o;return Math.random()*r}var t,n,r,a=y.length,u=b.length,f=c[0],v=c[1];for(t=0;t<a;++t)(r=y[t]).index=t,r.weight=0;for(t=0;t<u;++t)r=b[t],"number"==typeof r.source&&(r.source=y[r.source]),"number"==typeof r.target&&(r.target=y[r.target]),++r.source.weight,++r.target.weight;for(t=0;t<a;++t)r=y[t],isNaN(r.x)&&(r.x=e("x",f)),isNaN(r.y)&&(r.y=e("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof d)for(t=0;t<u;++t)i[t]=+d.call(this,b[t],t);else for(t=0;t<u;++t)i[t]=d;if(o=[],"function"==typeof p)for(t=0;t<u;++t)o[t]=+p.call(this,b[t],t);else for(t=0;t<u;++t)o[t]=p;if(l=[],"function"==typeof h)for(t=0;t<a;++t)l[t]=+h.call(this,y[t],t);else for(t=0;t<a;++t)l[t]=h;return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){return r||(r=so.behavior.drag().origin(x).on("dragstart.force",ea).on("drag.force",t).on("dragend.force",ta)),arguments.length?void this.on("mouseover.force",na).on("mouseout.force",ra).call(r):r},so.rebind(s,u,"on")};var gs=20,ms=1,ys=1/0;so.layout.hierarchy=function(){function e(a){var i,o=[a],l=[];for(a.depth=0;null!=(i=o.pop());)if(l.push(i),(u=n.call(e,i,i.depth))&&(s=u.length)){for(var s,u,c;--s>=0;)o.push(c=u[s]),c.parent=i,c.depth=i.depth+1;r&&(i.value=0),i.children=u}else r&&(i.value=+r.call(e,i,i.depth)||0),delete i.children;return la(a,function(e){var n,a;t&&(n=e.children)&&n.sort(t),r&&(a=e.parent)&&(a.value+=e.value)}),l}var t=ca,n=sa,r=ua;return e.sort=function(n){return arguments.length?(t=n,e):t},e.children=function(t){return arguments.length?(n=t,e):n},e.value=function(t){return arguments.length?(r=t,e):r},e.revalue=function(t){return r&&(oa(t,function(e){e.children&&(e.value=0)}),la(t,function(t){var n;t.children||(t.value=+r.call(e,t,t.depth)||0),(n=t.parent)&&(n.value+=t.value)})),t},e},so.layout.partition=function(){function e(t,n,r,a){var i=t.children;if(t.x=n,t.y=t.depth*a,t.dx=r,t.dy=a,i&&(o=i.length)){var o,l,s,u=-1;for(r=t.value?r/t.value:0;++u<o;)e(l=i[u],n,s=l.value*r,a),n+=s}}function t(e){var n=e.children,r=0;if(n&&(a=n.length))for(var a,i=-1;++i<a;)r=Math.max(r,t(n[i]));return 1+r}function n(n,i){var o=r.call(this,n,i);return e(o[0],0,a[0],a[1]/t(o[0])),o}var r=so.layout.hierarchy(),a=[1,1];return n.size=function(e){return arguments.length?(a=e,n):a},ia(n,r)},so.layout.pie=function(){function e(o){var l,s=o.length,u=o.map(function(n,r){return+t.call(e,n,r)}),c=+("function"==typeof r?r.apply(this,arguments):r),f=("function"==typeof a?a.apply(this,arguments):a)-c,d=Math.min(Math.abs(f)/s,+("function"==typeof i?i.apply(this,arguments):i)),p=d*(f<0?-1:1),h=so.sum(u),v=h?(f-s*p)/h:0,g=so.range(s),m=[];return null!=n&&g.sort(n===xs?function(e,t){return u[t]-u[e]}:function(e,t){return n(o[e],o[t])}),g.forEach(function(e){m[e]={data:o[e],value:l=u[e],startAngle:c,endAngle:c+=l*v+p,padAngle:d}}),m}var t=Number,n=xs,r=0,a=Do,i=0;return e.value=function(n){return arguments.length?(t=n,e):t},e.sort=function(t){return arguments.length?(n=t,e):n},e.startAngle=function(t){return arguments.length?(r=t,e):r},e.endAngle=function(t){return arguments.length?(a=t,e):a},e.padAngle=function(t){return arguments.length?(i=t,e):i},e};var xs={};so.layout.stack=function(){function e(l,s){if(!(d=l.length))return l;var u=l.map(function(n,r){return t.call(e,n,r)}),c=u.map(function(t){return t.map(function(t,n){return[i.call(e,t,n),o.call(e,t,n)]})}),f=n.call(e,c,s);u=so.permute(u,f),c=so.permute(c,f);var d,p,h,v,g=r.call(e,c,s),m=u[0].length;for(h=0;h<m;++h)for(a.call(e,u[0][h],v=g[h],c[0][h][1]),p=1;p<d;++p)a.call(e,u[p][h],v+=c[p-1][h][1],c[p][h][1]);return l}var t=x,n=va,r=ga,a=ha,i=da,o=pa;return e.values=function(n){return arguments.length?(t=n,e):t},e.order=function(t){return arguments.length?(n="function"==typeof t?t:bs.get(t)||va,e):n},e.offset=function(t){return arguments.length?(r="function"==typeof t?t:ws.get(t)||ga,e):r},e.x=function(t){return arguments.length?(i=t,e):i},e.y=function(t){return arguments.length?(o=t,e):o},e.out=function(t){return arguments.length?(a=t,e):a},e};var bs=so.map({"inside-out":function(e){var t,n,r=e.length,a=e.map(ma),i=e.map(ya),o=so.range(r).sort(function(e,t){return a[e]-a[t]}),l=0,s=0,u=[],c=[];for(t=0;t<r;++t)n=o[t],l<s?(l+=i[n],u.push(n)):(s+=i[n],c.push(n));return c.reverse().concat(u)},reverse:function(e){return so.range(e.length).reverse()},default:va}),ws=so.map({silhouette:function(e){var t,n,r,a=e.length,i=e[0].length,o=[],l=0,s=[];for(n=0;n<i;++n){for(t=0,r=0;t<a;t++)r+=e[t][n][1];r>l&&(l=r),o.push(r)}for(n=0;n<i;++n)s[n]=(l-o[n])/2;return s},wiggle:function(e){var t,n,r,a,i,o,l,s,u,c=e.length,f=e[0],d=f.length,p=[];for(p[0]=s=u=0,n=1;n<d;++n){for(t=0,a=0;t<c;++t)a+=e[t][n][1];for(t=0,i=0,l=f[n][0]-f[n-1][0];t<c;++t){for(r=0,o=(e[t][n][1]-e[t][n-1][1])/(2*l);r<t;++r)o+=(e[r][n][1]-e[r][n-1][1])/l;i+=o*e[t][n][1]}p[n]=s-=a?i/a*l:0,s<u&&(u=s)}for(n=0;n<d;++n)p[n]-=u;return p},expand:function(e){var t,n,r,a=e.length,i=e[0].length,o=1/a,l=[];for(n=0;n<i;++n){for(t=0,r=0;t<a;t++)r+=e[t][n][1];if(r)for(t=0;t<a;t++)e[t][n][1]/=r;else for(t=0;t<a;t++)e[t][n][1]=o}for(n=0;n<i;++n)l[n]=0;return l},zero:ga});so.layout.histogram=function(){function e(e,i){for(var o,l,s=[],u=e.map(n,this),c=r.call(this,u,i),f=a.call(this,c,u,i),i=-1,d=u.length,p=f.length-1,h=t?1:1/d;++i<p;)o=s[i]=[],o.dx=f[i+1]-(o.x=f[i]),o.y=0;if(p>0)for(i=-1;++i<d;)l=u[i],l>=c[0]&&l<=c[1]&&(o=s[so.bisect(f,l,1,p)-1],o.y+=h,o.push(e[i]));return s}var t=!0,n=Number,r=_a,a=ba;return e.value=function(t){return arguments.length?(n=t,e):n},e.range=function(t){return arguments.length?(r=je(t),e):r},e.bins=function(t){return arguments.length?(a="number"==typeof t?function(e){return wa(e,t)}:je(t),e):a},e.frequency=function(n){return arguments.length?(t=!!n,e):t},e},so.layout.pack=function(){function e(e,i){var o=n.call(this,e,i),l=o[0],s=a[0],u=a[1],c=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(l.x=l.y=0,la(l,function(e){e.r=+c(e.value)}),la(l,ja),r){var f=r*(t?1:Math.max(2*l.r/s,2*l.r/u))/2;la(l,function(e){e.r+=f}),la(l,ja),la(l,function(e){e.r-=f})}return Oa(l,s/2,u/2,t?1:1/Math.max(2*l.r/s,2*l.r/u)),o}var t,n=so.layout.hierarchy().sort(ka),r=0,a=[1,1];return e.size=function(t){return arguments.length?(a=t,e):a},e.radius=function(n){return arguments.length?(t=null==n||"function"==typeof n?n:+n,e):t},e.padding=function(t){return arguments.length?(r=+t,e):r},ia(e,n)},so.layout.tree=function(){function e(e,a){var c=o.call(this,e,a),f=c[0],d=t(f);if(la(d,n),d.parent.m=-d.z,oa(d,r),u)oa(f,i);else{var p=f,h=f,v=f;oa(f,function(e){e.x<p.x&&(p=e),e.x>h.x&&(h=e),e.depth>v.depth&&(v=e)});var g=l(p,h)/2-p.x,m=s[0]/(h.x+l(h,p)/2+g),y=s[1]/(v.depth||1);oa(f,function(e){e.x=(e.x+g)*m,e.y=e.depth*y})}return c}function t(e){for(var t,n={A:null,children:[e]},r=[n];null!=(t=r.pop());)for(var a,i=t.children,o=0,l=i.length;o<l;++o)r.push((i[o]=a={_:i[o],parent:t,children:(a=i[o].children)&&a.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=a);return n.children[0]}function n(e){var t=e.children,n=e.parent.children,r=e.i?n[e.i-1]:null;if(t.length){Pa(e);var i=(t[0].z+t[t.length-1].z)/2;r?(e.z=r.z+l(e._,r._),e.m=e.z-i):e.z=i}else r&&(e.z=r.z+l(e._,r._));e.parent.A=a(e,r,e.parent.A||n[0])}function r(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function a(e,t,n){if(t){for(var r,a=e,i=e,o=t,s=a.parent.children[0],u=a.m,c=i.m,f=o.m,d=s.m;o=Ta(o),a=Ca(a),o&&a;)s=Ca(s),i=Ta(i),i.a=e,r=o.z+f-a.z-u+l(o._,a._),r>0&&(qa(Ba(o,e,n),e,r),u+=r,c+=r),f+=o.m,u+=a.m,d+=s.m,c+=i.m;o&&!Ta(i)&&(i.t=o,i.m+=f-c),a&&!Ca(s)&&(s.t=a,s.m+=u-d,n=e)}return n}function i(e){e.x*=s[0],e.y=e.depth*s[1]}var o=so.layout.hierarchy().sort(null).value(null),l=Fa,s=[1,1],u=null;return e.separation=function(t){return arguments.length?(l=t,e):l},e.size=function(t){return arguments.length?(u=null==(s=t)?i:null,e):u?null:s},e.nodeSize=function(t){return arguments.length?(u=null==(s=t)?null:i,e):u?s:null},ia(e,o)},so.layout.cluster=function(){function e(e,i){var o,l=t.call(this,e,i),s=l[0],u=0;la(s,function(e){var t=e.children;t&&t.length?(e.x=Ra(t),e.y=Da(t)):(e.x=o?u+=n(e,o):0,e.y=0,o=e)});var c=Ia(s),f=La(s),d=c.x-n(c,f)/2,p=f.x+n(f,c)/2;return la(s,a?function(e){e.x=(e.x-s.x)*r[0],e.y=(s.y-e.y)*r[1]}:function(e){e.x=(e.x-d)/(p-d)*r[0],e.y=(1-(s.y?e.y/s.y:1))*r[1]}),l}var t=so.layout.hierarchy().sort(null).value(null),n=Fa,r=[1,1],a=!1;return e.separation=function(t){return arguments.length?(n=t,e):n},e.size=function(t){return arguments.length?(a=null==(r=t),e):a?null:r},e.nodeSize=function(t){return arguments.length?(a=null!=(r=t),e):a?r:null},ia(e,t)},so.layout.treemap=function(){function e(e,t){for(var n,r,a=-1,i=e.length;++a<i;)r=(n=e[a]).value*(t<0?0:t),n.area=isNaN(r)||r<=0?0:r}function t(n){var i=n.children;if(i&&i.length){var o,l,s,u=f(n),c=[],d=i.slice(),h=1/0,v="slice"===p?u.dx:"dice"===p?u.dy:"slice-dice"===p?1&n.depth?u.dy:u.dx:Math.min(u.dx,u.dy);for(e(d,u.dx*u.dy/n.value),c.area=0;(s=d.length)>0;)c.push(o=d[s-1]),c.area+=o.area,"squarify"!==p||(l=r(c,v))<=h?(d.pop(),h=l):(c.area-=c.pop().area,a(c,v,u,!1),v=Math.min(u.dx,u.dy),c.length=c.area=0,h=1/0);c.length&&(a(c,v,u,!0),c.length=c.area=0),i.forEach(t)}}function n(t){var r=t.children;if(r&&r.length){var i,o=f(t),l=r.slice(),s=[];for(e(l,o.dx*o.dy/t.value),s.area=0;i=l.pop();)s.push(i),s.area+=i.area,null!=i.z&&(a(s,i.z?o.dx:o.dy,o,!l.length),s.length=s.area=0);r.forEach(n)}}function r(e,t){for(var n,r=e.area,a=0,i=1/0,o=-1,l=e.length;++o<l;)(n=e[o].area)&&(n<i&&(i=n),n>a&&(a=n));return r*=r,t*=t,r?Math.max(t*a*h/r,r/(t*i*h)):1/0}function a(e,t,n,r){var a,i=-1,o=e.length,l=n.x,u=n.y,c=t?s(e.area/t):0;if(t==n.dx){for((r||c>n.dy)&&(c=n.dy);++i<o;)a=e[i],a.x=l,a.y=u,a.dy=c,l+=a.dx=Math.min(n.x+n.dx-l,c?s(a.area/c):0);a.z=!0,a.dx+=n.x+n.dx-l,n.y+=c,n.dy-=c}else{for((r||c>n.dx)&&(c=n.dx);++i<o;)a=e[i],a.x=l,a.y=u,a.dx=c,u+=a.dy=Math.min(n.y+n.dy-u,c?s(a.area/c):0);a.z=!1,a.dy+=n.y+n.dy-u,n.x+=c,n.dx-=c}}function i(r){var a=o||l(r),i=a[0];return i.x=i.y=0,i.value?(i.dx=u[0],i.dy=u[1]):i.dx=i.dy=0,o&&l.revalue(i),e([i],i.dx*i.dy/i.value),(o?n:t)(i),d&&(o=a),a}var o,l=so.layout.hierarchy(),s=Math.round,u=[1,1],c=null,f=Va,d=!1,p="squarify",h=.5*(1+Math.sqrt(5));return i.size=function(e){return arguments.length?(u=e,i):u},i.padding=function(e){function t(t){var n=e.call(i,t,t.depth);return null==n?Va(t):Ua(t,"number"==typeof n?[n,n,n,n]:n)}function n(t){return Ua(t,e)}if(!arguments.length)return c;var r;return f=null==(c=e)?Va:"function"==(r=typeof e)?t:"number"===r?(e=[e,e,e,e],n):n,i},i.round=function(e){return arguments.length?(s=e?Math.round:Number,i):s!=Number},i.sticky=function(e){return arguments.length?(d=e,o=null,i):d},i.ratio=function(e){return arguments.length?(h=e,i):h},i.mode=function(e){return arguments.length?(p=e+"",i):p},ia(i,l)},so.random={normal:function(e,t){var n=arguments.length;return n<2&&(t=1),n<1&&(e=0),function(){var n,r,a;do n=2*Math.random()-1,r=2*Math.random()-1,a=n*n+r*r;while(!a||a>1);return e+t*n*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var e=so.random.normal.apply(so,arguments);return function(){return Math.exp(e())}},bates:function(e){var t=so.random.irwinHall(e);return function(){return t()/e}},irwinHall:function(e){return function(){for(var t=0,n=0;n<e;n++)t+=Math.random();return t}}},so.scale={};var _s={floor:x,ceil:x};so.scale.linear=function(){return Ja([0,1],[0,1],br,!1)};var ks={s:1,g:1,p:1,r:1,e:1};so.scale.log=function(){return ai(so.scale.linear().domain([0,1]),10,!0,[1,10])};var zs=so.format(".0e"),Ms={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};so.scale.pow=function(){return ii(so.scale.linear(),1,[0,1])},so.scale.sqrt=function(){return so.scale.pow().exponent(.5)},so.scale.ordinal=function(){return li([],{t:"range",a:[[]]})},so.scale.category10=function(){return so.scale.ordinal().range(As)},so.scale.category20=function(){return so.scale.ordinal().range(js)},so.scale.category20b=function(){return so.scale.ordinal().range(Es)},so.scale.category20c=function(){return so.scale.ordinal().range(Ss)};var As=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(be),js=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(be),Es=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(be),Ss=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(be);so.scale.quantile=function(){return si([],[])},so.scale.quantize=function(){return ui(0,1,[0,1])},so.scale.threshold=function(){return ci([.5],[0,1])},so.scale.identity=function(){return fi([0,1])},so.svg={},so.svg.arc=function(){function e(){var e=Math.max(0,+n.apply(this,arguments)),u=Math.max(0,+r.apply(this,arguments)),c=o.apply(this,arguments)-Io,f=l.apply(this,arguments)-Io,d=Math.abs(f-c),p=c>f?0:1;if(u<e&&(h=u,u=e,e=h),d>=Ro)return t(u,p)+(e?t(e,1-p):"")+"Z";var h,v,g,m,y,x,b,w,_,k,z,M,A=0,j=0,E=[];if((m=(+s.apply(this,arguments)||0)/2)&&(g=i===Os?Math.sqrt(e*e+u*u):+i.apply(this,arguments),p||(j*=-1),u&&(j=ne(g/u*Math.sin(m))),e&&(A=ne(g/e*Math.sin(m)))),u){y=u*Math.cos(c+j),x=u*Math.sin(c+j),b=u*Math.cos(f-j),w=u*Math.sin(f-j);var S=Math.abs(f-c-2*j)<=Bo?0:1;if(j&&yi(y,x,b,w)===p^S){var O=(c+f)/2;y=u*Math.cos(O),x=u*Math.sin(O),b=w=null}}else y=x=0;if(e){_=e*Math.cos(f-A),k=e*Math.sin(f-A),z=e*Math.cos(c+A),M=e*Math.sin(c+A);var N=Math.abs(c-f+2*A)<=Bo?0:1;if(A&&yi(_,k,z,M)===1-p^N){var F=(c+f)/2;_=e*Math.cos(F),k=e*Math.sin(F),z=M=null}}else _=k=0;if(d>qo&&(h=Math.min(Math.abs(u-e)/2,+a.apply(this,arguments)))>.001){v=e<u^p?0:1;var C=h,T=h;if(d<Bo){var q=null==z?[_,k]:null==b?[y,x]:qn([y,x],[z,M],[b,w],[_,k]),P=y-q[0],B=x-q[1],D=b-q[0],R=w-q[1],I=1/Math.sin(Math.acos((P*D+B*R)/(Math.sqrt(P*P+B*B)*Math.sqrt(D*D+R*R)))/2),L=Math.sqrt(q[0]*q[0]+q[1]*q[1]);T=Math.min(h,(e-L)/(I-1)),C=Math.min(h,(u-L)/(I+1))}if(null!=b){var V=xi(null==z?[_,k]:[z,M],[y,x],u,C,p),U=xi([b,w],[_,k],u,C,p);h===C?E.push("M",V[0],"A",C,",",C," 0 0,",v," ",V[1],"A",u,",",u," 0 ",1-p^yi(V[1][0],V[1][1],U[1][0],U[1][1]),",",p," ",U[1],"A",C,",",C," 0 0,",v," ",U[0]):E.push("M",V[0],"A",C,",",C," 0 1,",v," ",U[0])}else E.push("M",y,",",x);if(null!=z){var Y=xi([y,x],[z,M],e,-T,p),H=xi([_,k],null==b?[y,x]:[b,w],e,-T,p);h===T?E.push("L",H[0],"A",T,",",T," 0 0,",v," ",H[1],"A",e,",",e," 0 ",p^yi(H[1][0],H[1][1],Y[1][0],Y[1][1]),",",1-p," ",Y[1],"A",T,",",T," 0 0,",v," ",Y[0]):E.push("L",H[0],"A",T,",",T," 0 0,",v," ",Y[0])}else E.push("L",_,",",k)}else E.push("M",y,",",x),null!=b&&E.push("A",u,",",u," 0 ",S,",",p," ",b,",",w),E.push("L",_,",",k),null!=z&&E.push("A",e,",",e," 0 ",N,",",1-p," ",z,",",M);return E.push("Z"),E.join("")}function t(e,t){return"M0,"+e+"A"+e+","+e+" 0 1,"+t+" 0,"+-e+"A"+e+","+e+" 0 1,"+t+" 0,"+e}var n=pi,r=hi,a=di,i=Os,o=vi,l=gi,s=mi;return e.innerRadius=function(t){return arguments.length?(n=je(t),e):n},e.outerRadius=function(t){return arguments.length?(r=je(t),e):r},e.cornerRadius=function(t){return arguments.length?(a=je(t),e):a},e.padRadius=function(t){return arguments.length?(i=t==Os?Os:je(t),e):i},e.startAngle=function(t){return arguments.length?(o=je(t),e):o},e.endAngle=function(t){return arguments.length?(l=je(t),e):l},e.padAngle=function(t){return arguments.length?(s=je(t),e):s},e.centroid=function(){var e=(+n.apply(this,arguments)+ +r.apply(this,arguments))/2,t=(+o.apply(this,arguments)+ +l.apply(this,arguments))/2-Io;return[Math.cos(t)*e,Math.sin(t)*e]},e};var Os="auto";so.svg.line=function(){return bi(x)};var Ns=so.map({linear:wi,"linear-closed":_i,step:ki,"step-before":zi,"step-after":Mi,basis:Ni,"basis-open":Fi,"basis-closed":Ci,bundle:Ti,cardinal:Ei,"cardinal-open":Ai,"cardinal-closed":ji,monotone:Ii});Ns.forEach(function(e,t){t.key=e,t.closed=/-closed$/.test(e)});var Fs=[0,2/3,1/3,0],Cs=[0,1/3,2/3,0],Ts=[0,1/6,2/3,1/6];so.svg.line.radial=function(){var e=bi(Li);return e.radius=e.x,delete e.x,e.angle=e.y,delete e.y,e},zi.reverse=Mi,Mi.reverse=zi,so.svg.area=function(){return Vi(x)},so.svg.area.radial=function(){var e=Vi(Li);return e.radius=e.x,delete e.x,e.innerRadius=e.x0,delete e.x0,e.outerRadius=e.x1,delete e.x1,e.angle=e.y,delete e.y,e.startAngle=e.y0,delete e.y0,e.endAngle=e.y1,delete e.y1,e},so.svg.chord=function(){function e(e,l){var s=t(this,i,e,l),u=t(this,o,e,l);return"M"+s.p0+r(s.r,s.p1,s.a1-s.a0)+(n(s,u)?a(s.r,s.p1,s.r,s.p0):a(s.r,s.p1,u.r,u.p0)+r(u.r,u.p1,u.a1-u.a0)+a(u.r,u.p1,s.r,s.p0))+"Z"}function t(e,t,n,r){var a=t.call(e,n,r),i=l.call(e,a,r),o=s.call(e,a,r)-Io,c=u.call(e,a,r)-Io;return{r:i,a0:o,a1:c,p0:[i*Math.cos(o),i*Math.sin(o)],p1:[i*Math.cos(c),i*Math.sin(c)]}}function n(e,t){return e.a0==t.a0&&e.a1==t.a1}function r(e,t,n){return"A"+e+","+e+" 0 "+ +(n>Bo)+",1 "+t}function a(e,t,n,r){return"Q 0,0 "+r}var i=bn,o=wn,l=Ui,s=vi,u=gi;return e.radius=function(t){return arguments.length?(l=je(t),e):l},e.source=function(t){return arguments.length?(i=je(t),e):i},e.target=function(t){return arguments.length?(o=je(t),e):o},e.startAngle=function(t){return arguments.length?(s=je(t),e):s},e.endAngle=function(t){return arguments.length?(u=je(t),e):u},e},so.svg.diagonal=function(){function e(e,a){var i=t.call(this,e,a),o=n.call(this,e,a),l=(i.y+o.y)/2,s=[i,{x:i.x,y:l},{x:o.x,y:l},o];return s=s.map(r),"M"+s[0]+"C"+s[1]+" "+s[2]+" "+s[3]}var t=bn,n=wn,r=Yi;return e.source=function(n){return arguments.length?(t=je(n),e):t},e.target=function(t){return arguments.length?(n=je(t),e):n},e.projection=function(t){return arguments.length?(r=t,e):r},e},so.svg.diagonal.radial=function(){var e=so.svg.diagonal(),t=Yi,n=e.projection;return e.projection=function(e){return arguments.length?n(Hi(t=e)):t},e},so.svg.symbol=function(){function e(e,r){return(qs.get(t.call(this,e,r))||Zi)(n.call(this,e,r))}var t=Gi,n=Xi;return e.type=function(n){return arguments.length?(t=je(n),e):t},e.size=function(t){return arguments.length?(n=je(t),e):n},e};var qs=so.map({circle:Zi,cross:function(e){var t=Math.sqrt(e/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(e){var t=Math.sqrt(e/(2*Bs)),n=t*Bs;return"M0,"+-t+"L"+n+",0 0,"+t+" "+-n+",0Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/Ps),n=t*Ps/2;return"M0,"+n+"L"+t+","+-n+" "+-t+","+-n+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Ps),n=t*Ps/2;return"M0,"+-n+"L"+t+","+n+" "+-t+","+n+"Z"}});so.svg.symbolTypes=qs.keys();var Ps=Math.sqrt(3),Bs=Math.tan(30*Lo);Eo.transition=function(e){for(var t,n,r=Ds||++Vs,a=$i(e),i=[],o=Rs||{time:Date.now(),ease:jr,delay:0,duration:250},l=-1,s=this.length;++l<s;){i.push(t=[]);for(var u=this[l],c=-1,f=u.length;++c<f;)(n=u[c])&&eo(n,c,a,r,o),t.push(n)}return Ji(i,a,r)},Eo.interrupt=function(e){return this.each(null==e?Is:Wi($i(e)))};var Ds,Rs,Is=Wi($i()),Ls=[],Vs=0;Ls.call=Eo.call,Ls.empty=Eo.empty,Ls.node=Eo.node,Ls.size=Eo.size,so.transition=function(e,t){return e&&e.transition?Ds?e.transition(t):e:so.selection().transition(e)},so.transition.prototype=Ls,Ls.select=function(e){var t,n,r,a=this.id,i=this.namespace,o=[];e=S(e);for(var l=-1,s=this.length;++l<s;){o.push(t=[]);for(var u=this[l],c=-1,f=u.length;++c<f;)(r=u[c])&&(n=e.call(r,r.__data__,c,l))?("__data__"in r&&(n.__data__=r.__data__),eo(n,c,i,a,r[i][a]),t.push(n)):t.push(null)}return Ji(o,i,a)},Ls.selectAll=function(e){var t,n,r,a,i,o=this.id,l=this.namespace,s=[];e=O(e);for(var u=-1,c=this.length;++u<c;)for(var f=this[u],d=-1,p=f.length;++d<p;)if(r=f[d]){ | |
i=r[l][o],n=e.call(r,r.__data__,d,u),s.push(t=[]);for(var h=-1,v=n.length;++h<v;)(a=n[h])&&eo(a,h,l,o,i),t.push(a)}return Ji(s,l,o)},Ls.filter=function(e){var t,n,r,a=[];"function"!=typeof e&&(e=V(e));for(var i=0,o=this.length;i<o;i++){a.push(t=[]);for(var n=this[i],l=0,s=n.length;l<s;l++)(r=n[l])&&e.call(r,r.__data__,l,i)&&t.push(r)}return Ji(a,this.namespace,this.id)},Ls.tween=function(e,t){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(e):Y(this,null==t?function(t){t[r][n].tween.remove(e)}:function(a){a[r][n].tween.set(e,t)})},Ls.attr=function(e,t){function n(){this.removeAttribute(l)}function r(){this.removeAttributeNS(l.space,l.local)}function a(e){return null==e?n:(e+="",function(){var t,n=this.getAttribute(l);return n!==e&&(t=o(n,e),function(e){this.setAttribute(l,t(e))})})}function i(e){return null==e?r:(e+="",function(){var t,n=this.getAttributeNS(l.space,l.local);return n!==e&&(t=o(n,e),function(e){this.setAttributeNS(l.space,l.local,t(e))})})}if(arguments.length<2){for(t in e)this.attr(t,e[t]);return this}var o="transform"==e?Zr:br,l=so.ns.qualify(e);return Qi(this,"attr."+e,t,l.local?i:a)},Ls.attrTween=function(e,t){function n(e,n){var r=t.call(this,e,n,this.getAttribute(a));return r&&function(e){this.setAttribute(a,r(e))}}function r(e,n){var r=t.call(this,e,n,this.getAttributeNS(a.space,a.local));return r&&function(e){this.setAttributeNS(a.space,a.local,r(e))}}var a=so.ns.qualify(e);return this.tween("attr."+e,a.local?r:n)},Ls.style=function(e,t,r){function a(){this.style.removeProperty(e)}function i(t){return null==t?a:(t+="",function(){var a,i=n(this).getComputedStyle(this,null).getPropertyValue(e);return i!==t&&(a=br(i,t),function(t){this.style.setProperty(e,a(t),r)})})}var o=arguments.length;if(o<3){if("string"!=typeof e){o<2&&(t="");for(r in e)this.style(r,e[r],t);return this}r=""}return Qi(this,"style."+e,t,i)},Ls.styleTween=function(e,t,r){function a(a,i){var o=t.call(this,a,i,n(this).getComputedStyle(this,null).getPropertyValue(e));return o&&function(t){this.style.setProperty(e,o(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+e,a)},Ls.text=function(e){return Qi(this,"text",e,Ki)},Ls.remove=function(){var e=this.namespace;return this.each("end.transition",function(){var t;this[e].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Ls.ease=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].ease:("function"!=typeof e&&(e=so.ease.apply(so,arguments)),Y(this,function(r){r[n][t].ease=e}))},Ls.delay=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].delay:Y(this,"function"==typeof e?function(r,a,i){r[n][t].delay=+e.call(r,r.__data__,a,i)}:(e=+e,function(r){r[n][t].delay=e}))},Ls.duration=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].duration:Y(this,"function"==typeof e?function(r,a,i){r[n][t].duration=Math.max(1,e.call(r,r.__data__,a,i))}:(e=Math.max(1,e),function(r){r[n][t].duration=e}))},Ls.each=function(e,t){var n=this.id,r=this.namespace;if(arguments.length<2){var a=Rs,i=Ds;try{Ds=n,Y(this,function(t,a,i){Rs=t[r][n],e.call(t,t.__data__,a,i)})}finally{Rs=a,Ds=i}}else Y(this,function(a){var i=a[r][n];(i.event||(i.event=so.dispatch("start","end","interrupt"))).on(e,t)});return this},Ls.transition=function(){for(var e,t,n,r,a=this.id,i=++Vs,o=this.namespace,l=[],s=0,u=this.length;s<u;s++){l.push(e=[]);for(var t=this[s],c=0,f=t.length;c<f;c++)(n=t[c])&&(r=n[o][a],eo(n,c,o,i,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),e.push(n)}return Ji(l,o,i)},so.svg.axis=function(){function e(e){e.each(function(){var e,u=so.select(this),c=this.__chart__||n,f=this.__chart__=n.copy(),d=null==s?f.ticks?f.ticks.apply(f,l):f.domain():s,p=null==t?f.tickFormat?f.tickFormat.apply(f,l):x:t,h=u.selectAll(".tick").data(d,f),v=h.enter().insert("g",".domain").attr("class","tick").style("opacity",qo),g=so.transition(h.exit()).style("opacity",qo).remove(),m=so.transition(h.order()).style("opacity",1),y=Math.max(a,0)+o,b=Ha(f),w=u.selectAll(".domain").data([0]),_=(w.enter().append("path").attr("class","domain"),so.transition(w));v.append("line"),v.append("text");var k,z,M,A,j=v.select("line"),E=m.select("line"),S=h.select("text").text(p),O=v.select("text"),N=m.select("text"),F="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(e=to,k="x",M="y",z="x2",A="y2",S.attr("dy",F<0?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+b[0]+","+F*i+"V0H"+b[1]+"V"+F*i)):(e=no,k="y",M="x",z="y2",A="x2",S.attr("dy",".32em").style("text-anchor",F<0?"end":"start"),_.attr("d","M"+F*i+","+b[0]+"H0V"+b[1]+"H"+F*i)),j.attr(A,F*a),O.attr(M,F*y),E.attr(z,0).attr(A,F*a),N.attr(k,0).attr(M,F*y),f.rangeBand){var C=f,T=C.rangeBand()/2;c=f=function(e){return C(e)+T}}else c.rangeBand?c=f:g.call(e,f,c);v.call(e,c,f),m.call(e,f,f)})}var t,n=so.scale.linear(),r=Us,a=6,i=6,o=3,l=[10],s=null;return e.scale=function(t){return arguments.length?(n=t,e):n},e.orient=function(t){return arguments.length?(r=t in Ys?t+"":Us,e):r},e.ticks=function(){return arguments.length?(l=co(arguments),e):l},e.tickValues=function(t){return arguments.length?(s=t,e):s},e.tickFormat=function(n){return arguments.length?(t=n,e):t},e.tickSize=function(t){var n=arguments.length;return n?(a=+t,i=+arguments[n-1],e):a},e.innerTickSize=function(t){return arguments.length?(a=+t,e):a},e.outerTickSize=function(t){return arguments.length?(i=+t,e):i},e.tickPadding=function(t){return arguments.length?(o=+t,e):o},e.tickSubdivide=function(){return arguments.length&&e},e};var Us="bottom",Ys={top:1,right:1,bottom:1,left:1};so.svg.brush=function(){function e(n){n.each(function(){var n=so.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",i).on("touchstart.brush",i),o=n.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),n.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var l=n.selectAll(".resize").data(v,x);l.exit().remove(),l.enter().append("g").attr("class",function(e){return"resize "+e}).style("cursor",function(e){return Hs[e]}).append("rect").attr("x",function(e){return/[ew]$/.test(e)?-3:null}).attr("y",function(e){return/^[ns]/.test(e)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),l.style("display",e.empty()?"none":null);var s,f=so.transition(n),d=so.transition(o);u&&(s=Ha(u),d.attr("x",s[0]).attr("width",s[1]-s[0]),r(f)),c&&(s=Ha(c),d.attr("y",s[0]).attr("height",s[1]-s[0]),a(f)),t(f)})}function t(e){e.selectAll(".resize").attr("transform",function(e){return"translate("+f[+/e$/.test(e)]+","+d[+/^s/.test(e)]+")"})}function r(e){e.select(".extent").attr("x",f[0]),e.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function a(e){e.select(".extent").attr("y",d[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",d[1]-d[0])}function i(){function i(){32==so.event.keyCode&&(S||(x=null,N[0]-=f[1],N[1]-=d[1],S=2),M())}function v(){32==so.event.keyCode&&2==S&&(N[0]+=f[1],N[1]+=d[1],S=0,M())}function g(){var e=so.mouse(w),n=!1;b&&(e[0]+=b[0],e[1]+=b[1]),S||(so.event.altKey?(x||(x=[(f[0]+f[1])/2,(d[0]+d[1])/2]),N[0]=f[+(e[0]<x[0])],N[1]=d[+(e[1]<x[1])]):x=null),j&&m(e,u,0)&&(r(z),n=!0),E&&m(e,c,1)&&(a(z),n=!0),n&&(t(z),k({type:"brush",mode:S?"move":"resize"}))}function m(e,t,n){var r,a,i=Ha(t),s=i[0],u=i[1],c=N[n],v=n?d:f,g=v[1]-v[0];if(S&&(s-=c,u-=g+c),r=(n?h:p)?Math.max(s,Math.min(u,e[n])):e[n],S?a=(r+=c)+g:(x&&(c=Math.max(s,Math.min(u,2*x[n]-r))),c<r?(a=r,r=c):a=c),v[0]!=r||v[1]!=a)return n?l=null:o=null,v[0]=r,v[1]=a,!0}function y(){g(),z.style("pointer-events","all").selectAll(".resize").style("display",e.empty()?"none":null),so.select("body").style("cursor",null),F.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),O(),k({type:"brushend"})}var x,b,w=this,_=so.select(so.event.target),k=s.of(w,arguments),z=so.select(w),A=_.datum(),j=!/^(n|s)$/.test(A)&&u,E=!/^(e|w)$/.test(A)&&c,S=_.classed("extent"),O=J(w),N=so.mouse(w),F=so.select(n(w)).on("keydown.brush",i).on("keyup.brush",v);if(so.event.changedTouches?F.on("touchmove.brush",g).on("touchend.brush",y):F.on("mousemove.brush",g).on("mouseup.brush",y),z.interrupt().selectAll("*").interrupt(),S)N[0]=f[0]-N[0],N[1]=d[0]-N[1];else if(A){var C=+/w$/.test(A),T=+/^n/.test(A);b=[f[1-C]-N[0],d[1-T]-N[1]],N[0]=f[C],N[1]=d[T]}else so.event.altKey&&(x=N.slice());z.style("pointer-events","none").selectAll(".resize").style("display",null),so.select("body").style("cursor",_.style("cursor")),k({type:"brushstart"}),g()}var o,l,s=j(e,"brushstart","brush","brushend"),u=null,c=null,f=[0,0],d=[0,0],p=!0,h=!0,v=Xs[0];return e.event=function(e){e.each(function(){var e=s.of(this,arguments),t={x:f,y:d,i:o,j:l},n=this.__chart__||t;this.__chart__=t,Ds?so.select(this).transition().each("start.brush",function(){o=n.i,l=n.j,f=n.x,d=n.y,e({type:"brushstart"})}).tween("brush:brush",function(){var n=wr(f,t.x),r=wr(d,t.y);return o=l=null,function(a){f=t.x=n(a),d=t.y=r(a),e({type:"brush",mode:"resize"})}}).each("end.brush",function(){o=t.i,l=t.j,e({type:"brush",mode:"resize"}),e({type:"brushend"})}):(e({type:"brushstart"}),e({type:"brush",mode:"resize"}),e({type:"brushend"}))})},e.x=function(t){return arguments.length?(u=t,v=Xs[!u<<1|!c],e):u},e.y=function(t){return arguments.length?(c=t,v=Xs[!u<<1|!c],e):c},e.clamp=function(t){return arguments.length?(u&&c?(p=!!t[0],h=!!t[1]):u?p=!!t:c&&(h=!!t),e):u&&c?[p,h]:u?p:c?h:null},e.extent=function(t){var n,r,a,i,s;return arguments.length?(u&&(n=t[0],r=t[1],c&&(n=n[0],r=r[0]),o=[n,r],u.invert&&(n=u(n),r=u(r)),r<n&&(s=n,n=r,r=s),n==f[0]&&r==f[1]||(f=[n,r])),c&&(a=t[0],i=t[1],u&&(a=a[1],i=i[1]),l=[a,i],c.invert&&(a=c(a),i=c(i)),i<a&&(s=a,a=i,i=s),a==d[0]&&i==d[1]||(d=[a,i])),e):(u&&(o?(n=o[0],r=o[1]):(n=f[0],r=f[1],u.invert&&(n=u.invert(n),r=u.invert(r)),r<n&&(s=n,n=r,r=s))),c&&(l?(a=l[0],i=l[1]):(a=d[0],i=d[1],c.invert&&(a=c.invert(a),i=c.invert(i)),i<a&&(s=a,a=i,i=s))),u&&c?[[n,a],[r,i]]:u?[n,r]:c&&[a,i])},e.clear=function(){return e.empty()||(f=[0,0],d=[0,0],o=l=null),e},e.empty=function(){return!!u&&f[0]==f[1]||!!c&&d[0]==d[1]},so.rebind(e,s,"on")};var Hs={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Xs=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Gs=dl.format=yl.timeFormat,Zs=Gs.utc,Ws=Zs("%Y-%m-%dT%H:%M:%S.%LZ");Gs.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?ro:Ws,ro.parse=function(e){var t=new Date(e);return isNaN(t)?null:t},ro.toString=Ws.toString,dl.second=Le(function(e){return new pl(1e3*Math.floor(e/1e3))},function(e,t){e.setTime(e.getTime()+1e3*Math.floor(t))},function(e){return e.getSeconds()}),dl.seconds=dl.second.range,dl.seconds.utc=dl.second.utc.range,dl.minute=Le(function(e){return new pl(6e4*Math.floor(e/6e4))},function(e,t){e.setTime(e.getTime()+6e4*Math.floor(t))},function(e){return e.getMinutes()}),dl.minutes=dl.minute.range,dl.minutes.utc=dl.minute.utc.range,dl.hour=Le(function(e){var t=e.getTimezoneOffset()/60;return new pl(36e5*(Math.floor(e/36e5-t)+t))},function(e,t){e.setTime(e.getTime()+36e5*Math.floor(t))},function(e){return e.getHours()}),dl.hours=dl.hour.range,dl.hours.utc=dl.hour.utc.range,dl.month=Le(function(e){return e=dl.day(e),e.setDate(1),e},function(e,t){e.setMonth(e.getMonth()+t)},function(e){return e.getMonth()}),dl.months=dl.month.range,dl.months.utc=dl.month.utc.range;var Js=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Qs=[[dl.second,1],[dl.second,5],[dl.second,15],[dl.second,30],[dl.minute,1],[dl.minute,5],[dl.minute,15],[dl.minute,30],[dl.hour,1],[dl.hour,3],[dl.hour,6],[dl.hour,12],[dl.day,1],[dl.day,2],[dl.week,1],[dl.month,1],[dl.month,3],[dl.year,1]],Ks=Gs.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%I:%M",function(e){return e.getMinutes()}],["%I %p",function(e){return e.getHours()}],["%a %d",function(e){return e.getDay()&&1!=e.getDate()}],["%b %d",function(e){return 1!=e.getDate()}],["%B",function(e){return e.getMonth()}],["%Y",Ot]]),$s={range:function(e,t,n){return so.range(Math.ceil(e/n)*n,+t,n).map(io)},floor:x,ceil:x};Qs.year=dl.year,dl.scale=function(){return ao(so.scale.linear(),Qs,Ks)};var eu=Qs.map(function(e){return[e[0].utc,e[1]]}),tu=Zs.multi([[".%L",function(e){return e.getUTCMilliseconds()}],[":%S",function(e){return e.getUTCSeconds()}],["%I:%M",function(e){return e.getUTCMinutes()}],["%I %p",function(e){return e.getUTCHours()}],["%a %d",function(e){return e.getUTCDay()&&1!=e.getUTCDate()}],["%b %d",function(e){return 1!=e.getUTCDate()}],["%B",function(e){return e.getUTCMonth()}],["%Y",Ot]]);eu.year=dl.year.utc,dl.scale.utc=function(){return ao(so.scale.linear(),eu,tu)},so.text=Ee(function(e){return e.responseText}),so.json=function(e,t){return Se(e,"application/json",oo,t)},so.html=function(e,t){return Se(e,"text/html",lo,t)},so.xml=Ee(function(e){return e.responseXML}),"function"==typeof define&&define.amd?(this.d3=so,define(so)):"object"==typeof t&&t.exports?t.exports=so:this.d3=so}()},{}],4:[function(e,t,n){t.exports=e("./lib/heap")},{"./lib/heap":5}],5:[function(e,t,n){(function(){var e,r,a,i,o,l,s,u,c,f,d,p,h,v,g;a=Math.floor,f=Math.min,r=function(e,t){return e<t?-1:e>t?1:0},c=function(e,t,n,i,o){var l;if(null==n&&(n=0),null==o&&(o=r),n<0)throw new Error("lo must be non-negative");for(null==i&&(i=e.length);n<i;)l=a((n+i)/2),o(t,e[l])<0?i=l:n=l+1;return[].splice.apply(e,[n,n-n].concat(t)),t},l=function(e,t,n){return null==n&&(n=r),e.push(t),v(e,0,e.length-1,n)},o=function(e,t){var n,a;return null==t&&(t=r),n=e.pop(),e.length?(a=e[0],e[0]=n,g(e,0,t)):a=n,a},u=function(e,t,n){var a;return null==n&&(n=r),a=e[0],e[0]=t,g(e,0,n),a},s=function(e,t,n){var a;return null==n&&(n=r),e.length&&n(e[0],t)<0&&(a=[e[0],t],t=a[0],e[0]=a[1],g(e,0,n)),t},i=function(e,t){var n,i,o,l,s,u;for(null==t&&(t=r),l=function(){u=[];for(var t=0,n=a(e.length/2);0<=n?t<n:t>n;0<=n?t++:t--)u.push(t);return u}.apply(this).reverse(),s=[],i=0,o=l.length;i<o;i++)n=l[i],s.push(g(e,n,t));return s},h=function(e,t,n){var a;if(null==n&&(n=r),a=e.indexOf(t),a!==-1)return v(e,0,a,n),g(e,a,n)},d=function(e,t,n){var a,o,l,u,c;if(null==n&&(n=r),o=e.slice(0,t),!o.length)return o;for(i(o,n),c=e.slice(t),l=0,u=c.length;l<u;l++)a=c[l],s(o,a,n);return o.sort(n).reverse()},p=function(e,t,n){var a,l,s,u,d,p,h,v,g,m;if(null==n&&(n=r),10*t<=e.length){if(u=e.slice(0,t).sort(n),!u.length)return u;for(s=u[u.length-1],v=e.slice(t),d=0,h=v.length;d<h;d++)a=v[d],n(a,s)<0&&(c(u,a,0,null,n),u.pop(),s=u[u.length-1]);return u}for(i(e,n),m=[],l=p=0,g=f(t,e.length);0<=g?p<g:p>g;l=0<=g?++p:--p)m.push(o(e,n));return m},v=function(e,t,n,a){var i,o,l;for(null==a&&(a=r),i=e[n];n>t&&(l=n-1>>1,o=e[l],a(i,o)<0);)e[n]=o,n=l;return e[n]=i},g=function(e,t,n){var a,i,o,l,s;for(null==n&&(n=r),i=e.length,s=t,o=e[t],a=2*t+1;a<i;)l=a+1,l<i&&!(n(e[a],e[l])<0)&&(a=l),e[t]=e[a],t=a,a=2*t+1;return e[t]=o,v(e,s,t,n)},e=function(){function e(e){this.cmp=null!=e?e:r,this.nodes=[]}return e.push=l,e.pop=o,e.replace=u,e.pushpop=s,e.heapify=i,e.updateItem=h,e.nlargest=d,e.nsmallest=p,e.prototype.push=function(e){return l(this.nodes,e,this.cmp)},e.prototype.pop=function(){return o(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 s(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return i(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,r){return"function"==typeof define&&define.amd?define([],r):"object"==typeof n?t.exports=r():e.Heap=r()}(this,function(){return e})}).call(this)},{}],6:[function(e,t,n){n.read=function(e,t,n,r,a){var i,o,l=8*a-r-1,s=(1<<l)-1,u=s>>1,c=-7,f=n?a-1:0,d=n?-1:1,p=e[t+f];for(f+=d,i=p&(1<<-c)-1,p>>=-c,c+=l;c>0;i=256*i+e[t+f],f+=d,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=r;c>0;o=256*o+e[t+f],f+=d,c-=8);if(0===i)i=1-u;else{if(i===s)return o?NaN:(p?-1:1)*(1/0);o+=Math.pow(2,r),i-=u}return(p?-1:1)*o*Math.pow(2,i-r)},n.write=function(e,t,n,r,a,i){var o,l,s,u=8*i-a-1,c=(1<<u)-1,f=c>>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,h=r?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-o))<1&&(o--,s*=2),t+=o+f>=1?d/s:d*Math.pow(2,1-f),t*s>=2&&(o++,s/=2),o+f>=c?(l=0,o=c):o+f>=1?(l=(t*s-1)*Math.pow(2,a),o+=f):(l=t*Math.pow(2,f-1)*Math.pow(2,a),o=0));a>=8;e[n+p]=255&l,p+=h,l/=256,a-=8);for(o=o<<a|l,u+=a;u>0;e[n+p]=255&o,p+=h,o/=256,u-=8);e[n+p-h]|=128*v}},{}],7:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],8:[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 n,r,a,i;for("undefined"==typeof t&&(t=15),a=.5,n=new Date;;){for(a*=2,i=a;i>3;i-=4)e(),e(),e(),e();for(;i>0;)e(),i--;if(r=new Date,r-n>t)break}for(i=a;i>3;i-=4)e(),e(),e(),e();for(;i>0;)e(),i--;return r=new Date,1e3*(3*a-1)/(r-n)},numeric._myIndexOf=function(e){var t,n=this.length;for(t=0;t<n;++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 n=Math.floor(Math.log(e)/Math.log(10)),r=e/Math.pow(10,n),a=r.toPrecision(numeric.precision);return 10===parseFloat(a)&&(n++,r=1,a=r.toPrecision(numeric.precision)),parseFloat(a).toString()+"e"+n.toString()}return"Infinity"}function n(e){var a;if("undefined"==typeof e)return r.push(Array(numeric.precision+8).join(" ")),!1;if("string"==typeof e)return r.push('"'+e+'"'),!1;if("boolean"==typeof e)return r.push(e.toString()),!1;if("number"==typeof e){var i=t(e),o=e.toPrecision(numeric.precision),l=parseFloat(e.toString()).toString(),s=[i,o,l,parseFloat(o).toString(),parseFloat(l).toString()];for(a=1;a<s.length;a++)s[a].length<i.length&&(i=s[a]);return r.push(Array(numeric.precision+8-i.length).join(" ")+i),!1}if(null===e)return r.push("null"),!1;if("function"==typeof e){r.push(e.toString());var u=!1;for(a in e)e.hasOwnProperty(a)&&(u?r.push(",\n"):r.push("\n{"),u=!0,r.push(a),r.push(": \n"),n(e[a]));return u&&r.push("}\n"),!0}if(e instanceof Array){if(e.length>numeric.largeArray)return r.push("...Large Array..."),!0;var u=!1;for(r.push("["),a=0;a<e.length;a++)a>0&&(r.push(","),u&&r.push("\n ")),u=n(e[a]);return r.push("]"),!0}r.push("{");var u=!1;for(a in e)e.hasOwnProperty(a)&&(u&&r.push(",\n"),u=!0,r.push(a),r.push(": \n"),n(e[a]));return r.push("}"),!0}var r=[];return n(e),r.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 n,r=[];for(n=0;n<e.length;n++)r[n]=t(e[n]);return r}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 n,r=[];for(n=0;n<e.length;n++)r[n]=t(e[n]);return r}return t(e)},numeric.parseCSV=function(e){var t,n,r=e.split("\n"),a=[],i=/(([^'",]*)|('[^']*')|("[^"]*")),/g,o=/^\s*(([+-]?[0-9]+(\.[0-9]*)?(e[+-]?[0-9]+)?)|([+-]?[0-9]*(\.[0-9]+)?(e[+-]?[0-9]+)?))\s*$/,l=function(e){return e.substr(0,e.length-1)},s=0;for(n=0;n<r.length;n++){var u,c=(r[n]+",").match(i);if(c.length>0){for(a[s]=[],t=0;t<c.length;t++)u=l(c[t]),o.test(u)?a[s][t]=parseFloat(u):a[s][t]=u;s++}}return a},numeric.toCSV=function(e){var t,n,r,a,i,o,l=numeric.dim(e);for(r=l[0],a=l[1],o=[],t=0;t<r;t++){for(i=[],n=0;n<r;n++)i[n]=e[t][n].toString();o[t]=i.join(", ")}return o.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,n,r,a,i,o,l,s,u=e.length,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f="";for(t=0;t<u;t+=3)n=e[t],r=e[t+1],a=e[t+2],i=n>>2,o=((3&n)<<4)+(r>>4),l=((15&r)<<2)+(a>>6),s=63&a,t+1>=u?l=s=64:t+2>=u&&(s=64),f+=c.charAt(i)+c.charAt(o)+c.charAt(l)+c.charAt(s);return f}function n(e,t,n){"undefined"==typeof t&&(t=0),"undefined"==typeof n&&(n=e.length);var r,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],i=-1,o=0;e.length;for(r=t;r<n;r++)o=255&(i^e[r]),i=i>>>8^a[o];return i^-1}var r,a,i,o,l,s,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=n(v,12,29),v[29]=d>>24&255,v[30]=d>>16&255,v[31]=d>>8&255,v[32]=255&d,r=1,a=0,u=0;u<p;u++){for(u<p-1?v.push(0):v.push(1),l=3*h+1+(0===u)&255,s=3*h+1+(0===u)>>8&255,v.push(l),v.push(s),v.push(255&~l),v.push(255&~s),0===u&&v.push(0),c=0;c<h;c++)for(i=0;i<3;i++)l=e[i][u][c],l=l>255?255:l<0?0:Math.round(l),r=(r+l)%65521,a=(a+r)%65521,v.push(l);v.push(0)}return f=(a<<16)+r,v.push(f>>24&255),v.push(f>>16&255),v.push(f>>8&255),v.push(255&f),o=v.length-41,v[33]=o>>24&255,v[34]=o>>16&255,v[35]=o>>8&255,v[36]=255&o,d=n(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,n;return"object"==typeof e?(t=e[0],"object"==typeof t?(n=t[0],"object"==typeof n?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,n){var r,a;if(!(t instanceof Array&&n instanceof Array))return!1;if(a=t.length,a!==n.length)return!1;for(r=0;r<a;r++)if(t[r]!==n[r]){if("object"!=typeof t[r])return!1;if(!e(t[r],n[r]))return!1}return!0},numeric.rep=function(e,t,n){"undefined"==typeof n&&(n=0);var r,a=e[n],i=Array(a);if(n===e.length-1){for(r=a-2;r>=0;r-=2)i[r+1]=t,i[r]=t;return r===-1&&(i[0]=t),i}for(r=a-1;r>=0;r--)i[r]=numeric.rep(e,t,n+1);return i},numeric.dotMMsmall=function(e,t){var n,r,a,i,o,l,s,u,c,f,d;for(i=e.length,o=t.length,l=t[0].length,s=Array(i),n=i-1;n>=0;n--){for(u=Array(l),c=e[n],a=l-1;a>=0;a--){for(f=c[o-1]*t[o-1][a],r=o-2;r>=1;r-=2)d=r-1,f+=c[r]*t[r][a]+c[d]*t[d][a];0===r&&(f+=c[0]*t[0][a]),u[a]=f}s[n]=u}return s},numeric._getCol=function(e,t,n){var r,a=e.length;for(r=a-1;r>0;--r)n[r]=e[r][t],--r,n[r]=e[r][t];0===r&&(n[0]=e[0][t])},numeric.dotMMbig=function(e,t){var n,r,a,i,o=numeric._getCol,l=t.length,s=Array(l),u=e.length,c=t[0].length,f=new Array(u),d=numeric.dotVV;for(--l,--u,r=u;r!==-1;--r)f[r]=Array(c);for(--c,r=c;r!==-1;--r)for(o(t,r,s),a=u;a!==-1;--a)i=0,n=e[a],f[a][r]=d(n,s);return f},numeric.dotMV=function(e,t){var n,r=e.length,a=(t.length,Array(r)),i=numeric.dotVV;for(n=r-1;n>=0;n--)a[n]=i(e[n],t);return a},numeric.dotVM=function(e,t){var n,r,a,i,o,l,s;for(a=e.length,i=t[0].length,o=Array(i),r=i-1;r>=0;r--){for(l=e[a-1]*t[a-1][r],n=a-2;n>=1;n-=2)s=n-1,l+=e[n]*t[n][r]+e[s]*t[s][r];0===n&&(l+=e[0]*t[0][r]),o[r]=l}return o},numeric.dotVV=function(e,t){var n,r,a=e.length,i=e[a-1]*t[a-1];for(n=a-2;n>=1;n-=2)r=n-1,i+=e[n]*t[n]+e[r]*t[r];return 0===n&&(i+=e[0]*t[0]),i},numeric.dot=function(e,t){var n=numeric.dim;switch(1e3*n(e).length+n(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,n,r,a,i=e.length,o=Array(i);for(t=i-1;t>=0;t--){for(a=Array(i),n=t+2,r=i-1;r>=n;r-=2)a[r]=0,a[r-1]=0;for(r>t&&(a[r]=0),a[t]=e[t],r=t-1;r>=1;r-=2)a[r]=0,a[r-1]=0;0===r&&(a[0]=0),o[t]=a}return o},numeric.getDiag=function(e){var t,n=Math.min(e.length,e[0].length),r=Array(n);for(t=n-1;t>=1;--t)r[t]=e[t][t],--t,r[t]=e[t][t];return 0===t&&(r[0]=e[0][0]),r},numeric.identity=function(e){return numeric.diag(numeric.rep([e],1))},numeric.pointwise=function(e,t,n){"undefined"==typeof n&&(n="");var r,a,i=[],o=/\[i\]$/,l="",s=!1;for(r=0;r<e.length;r++)o.test(e[r])?(a=e[r].substring(0,e[r].length-3),l=a):a=e[r],"ret"===a&&(s=!0),i.push(a);return i[e.length]="_s",i[e.length+1]="_k",i[e.length+2]='if(typeof _s === "undefined") _s = numeric.dim('+l+');\nif(typeof _k === "undefined") _k = 0;\nvar _n = _s[_k];\nvar i'+(s?"":", 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"+n+"\nfor(i=_n-1;i!==-1;--i) {\n "+t+"\n}\nreturn ret;",Function.apply(null,i)},numeric.pointwise2=function(e,t,n){"undefined"==typeof n&&(n="");var r,a,i=[],o=/\[i\]$/,l="",s=!1;for(r=0;r<e.length;r++)o.test(e[r])?(a=e[r].substring(0,e[r].length-3),l=a):a=e[r],"ret"===a&&(s=!0),i.push(a);return i[e.length]="var _n = "+l+".length;\nvar i"+(s?"":", ret = Array(_n)")+";\n"+n+"\nfor(i=_n-1;i!==-1;--i) {\n"+t+"\n}\nreturn ret;",Function.apply(null,i)},numeric._biforeach=function e(t,n,r,a,i){if(a===r.length-1)return void i(t,n);var o,l=r[a];for(o=l-1;o>=0;o--)e("object"==typeof t?t[o]:t,"object"==typeof n?n[o]:n,r,a+1,i)},numeric._biforeach2=function e(t,n,r,a,i){if(a===r.length-1)return i(t,n);var o,l=r[a],s=Array(l);for(o=l-1;o>=0;--o)s[o]=e("object"==typeof t?t[o]:t,"object"==typeof n?n[o]:n,r,a+1,i);return s},numeric._foreach=function e(t,n,r,a){if(r===n.length-1)return void a(t);var i,o=n[r];for(i=o-1;i>=0;i--)e(t[i],n,r+1,a)},numeric._foreach2=function e(t,n,r,a){if(r===n.length-1)return a(t);var i,o=n[r],l=Array(o);for(i=o-1;i>=0;i--)l[i]=e(t[i],n,r+1,a);return l},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 n,r,a="";numeric.myIndexOf.call(numeric.mathfuns2,e)!==-1?(a="var "+t+" = Math."+t+";\n",n=function(e,n,r){return e+" = "+t+"("+n+","+r+")"},r=function(e,n){return e+" = "+t+"("+e+","+n+")"}):(n=function(e,n,r){return e+" = "+n+" "+t+" "+r},r=numeric.opseq.hasOwnProperty(e+"eq")?function(e,n){return e+" "+t+"= "+n}:function(e,n){return e+" = "+e+" "+t+" "+n}),numeric[e+"VV"]=numeric.pointwise2(["x[i]","y[i]"],n("ret[i]","x[i]","y[i]"),a),numeric[e+"SV"]=numeric.pointwise2(["x","y[i]"],n("ret[i]","x","y[i]"),a), | |
numeric[e+"VS"]=numeric.pointwise2(["x[i]","y"],n("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 '+r("x","y")+"\n}\nreturn x;\n"),numeric[t]=numeric[e],numeric[e+"eqV"]=numeric.pointwise2(["ret[i]","x[i]"],r("ret[i]","x[i]"),a),numeric[e+"eqS"]=numeric.pointwise2(["ret[i]","x"],r("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,n,r,a,i,o,l,e,s=numeric.dim(e),u=Math.abs,c=s[0],f=s[1],d=numeric.clone(e),p=numeric.identity(c);for(o=0;o<f;++o){var h=-1,v=-1;for(i=o;i!==c;++i)l=u(d[i][o]),l>v&&(h=i,v=l);for(n=d[h],d[h]=d[o],d[o]=n,a=p[h],p[h]=p[o],p[o]=a,e=n[o],l=o;l!==f;++l)n[l]/=e;for(l=f-1;l!==-1;--l)a[l]/=e;for(i=c-1;i!==-1;--i)if(i!==o){for(t=d[i],r=p[i],e=t[o],l=o+1;l!==f;++l)t[l]-=n[l]*e;for(l=f-1;l>0;--l)r[l]-=a[l]*e,--l,r[l]-=a[l]*e;0===l&&(r[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 n,r,a,i,o,l,s,u,c=t[0],f=1,d=numeric.clone(e);for(r=0;r<c-1;r++){for(a=r,n=r+1;n<c;n++)Math.abs(d[n][r])>Math.abs(d[a][r])&&(a=n);for(a!==r&&(s=d[a],d[a]=d[r],d[r]=s,f*=-1),i=d[r],n=r+1;n<c;n++){for(o=d[n],l=o[r]/i[r],a=r+1;a<c-1;a+=2)u=a+1,o[a]-=i[a]*l,o[u]-=i[u]*l;a!==c&&(o[a]-=i[a]*l)}if(0===i[r])return 0;f*=i[r]}return f*d[r][r]},numeric.transpose=function(e){var t,n,r,a,i,o=e.length,l=e[0].length,s=Array(l);for(n=0;n<l;n++)s[n]=Array(o);for(t=o-1;t>=1;t-=2){for(a=e[t],r=e[t-1],n=l-1;n>=1;--n)i=s[n],i[t]=a[n],i[t-1]=r[n],--n,i=s[n],i[t]=a[n],i[t-1]=r[n];0===n&&(i=s[0],i[t]=a[0],i[t-1]=r[0])}if(0===t){for(r=e[0],n=l-1;n>=1;--n)s[n][0]=r[n],--n,s[n][0]=r[n];0===n&&(s[0][0]=r[0])}return s},numeric.negtranspose=function(e){var t,n,r,a,i,o=e.length,l=e[0].length,s=Array(l);for(n=0;n<l;n++)s[n]=Array(o);for(t=o-1;t>=1;t-=2){for(a=e[t],r=e[t-1],n=l-1;n>=1;--n)i=s[n],i[t]=-a[n],i[t-1]=-r[n],--n,i=s[n],i[t]=-a[n],i[t-1]=-r[n];0===n&&(i=s[0],i[t]=-a[0],i[t-1]=-r[0])}if(0===t){for(r=e[0],n=l-1;n>=1;--n)s[n][0]=-r[n],--n,s[n][0]=-r[n];0===n&&(s[0][0]=-r[0])}return s},numeric._random=function e(t,n){var r,a,i=t[n],o=Array(i);if(n===t.length-1){for(a=Math.random,r=i-1;r>=1;r-=2)o[r]=a(),o[r-1]=a();return 0===r&&(o[0]=a()),o}for(r=i-1;r>=0;r--)o[r]=e(t,n+1);return o},numeric.random=function(e){return numeric._random(e,0)},numeric.norm2=function(e){return Math.sqrt(numeric.norm2Squared(e))},numeric.linspace=function(e,t,n){if("undefined"==typeof n&&(n=Math.max(Math.round(t-e)+1,1)),n<2)return 1===n?[e]:[];var r,a=Array(n);for(n--,r=n;r>=0;r--)a[r]=(r*t+(n-r)*e)/n;return a},numeric.getBlock=function(e,t,n){function r(e,i){var o,l=t[i],s=n[i]-l,u=Array(s);if(i===a.length-1){for(o=s;o>=0;o--)u[o]=e[o+l];return u}for(o=s;o>=0;o--)u[o]=r(e[o+l],i+1);return u}var a=numeric.dim(e);return r(e,0)},numeric.setBlock=function(e,t,n,r){function a(e,r,o){var l,s=t[o],u=n[o]-s;if(o===i.length-1)for(l=u;l>=0;l--)e[l+s]=r[l];for(l=u;l>=0;l--)a(e[l+s],r[l],o+1)}var i=numeric.dim(e);return a(e,r,0),e},numeric.getRange=function(e,t,n){var r,a,i,o,l=t.length,s=n.length,u=Array(l);for(r=l-1;r!==-1;--r)for(u[r]=Array(s),i=u[r],o=e[t[r]],a=s-1;a!==-1;--a)i[a]=o[n[a]];return u},numeric.blockMatrix=function(e){var t=numeric.dim(e);if(t.length<4)return numeric.blockMatrix([e]);var n,r,a,i,o,l=t[0],s=t[1];for(n=0,r=0,a=0;a<l;++a)n+=e[a][0].length;for(i=0;i<s;++i)r+=e[0][i][0].length;var u=Array(n);for(a=0;a<n;++a)u[a]=Array(r);var c,f,d,p,h,v=0;for(a=0;a<l;++a){for(c=r,i=s-1;i!==-1;--i)for(o=e[a][i],c-=o[0].length,d=o.length-1;d!==-1;--d)for(h=o[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 n=numeric.dim(e),r=numeric.dim(t);if(1!==n.length||1!==r.length)throw new Error("numeric: tensor product is only defined for vectors");var a,i,o,l,s=n[0],u=r[0],c=Array(s);for(i=s-1;i>=0;i--){for(a=Array(u),l=e[i],o=u-1;o>=3;--o)a[o]=l*t[o],--o,a[o]=l*t[o],--o,a[o]=l*t[o],--o,a[o]=l*t[o];for(;o>=0;)a[o]=l*t[o],--o;c[i]=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,n,r,a){numeric.indexOf;if("string"!=typeof a){var i;a="";for(i in numeric)numeric.hasOwnProperty(i)&&(e.indexOf(i)>=0||t.indexOf(i)>=0||n.indexOf(i)>=0||r.indexOf(i)>=0)&&i.length>1&&(a+="var "+i+" = numeric."+i+";\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("+r+");\n }\n return new numeric.T("+n+");\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 n=numeric.add(e(this.x,this.x),e(this.y,this.y));return new numeric.T(t(this.x,n),t(numeric.neg(this.y),n))}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,n=this.y;return n?new numeric.T(e(t),e(n)):new numeric.T(e(t))},numeric.T.prototype.transjugate=function(){var e=numeric.transpose,t=this.x,n=this.y;return n?new numeric.T(e(t),numeric.negtranspose(n)):new numeric.T(e(t))},numeric.Tunop=function(e,t,n){return"string"!=typeof n&&(n=""),Function("var x = this;\n"+n+"\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,n,r,a,i,o,l,s,u,c,f,t,n,r,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,r=t,n=t+1;n<x;n++)h=_[n][t],v=k[n][t],p=h*h+v*v,p>d&&(r=n,d=p);for(r!==t&&(y=_[t],_[t]=_[r],_[r]=y,y=k[t],k[t]=k[r],k[r]=y,y=b[t],b[t]=b[r],b[r]=y,y=w[t],w[t]=w[r],w[r]=y),a=_[t],i=k[t],s=b[t],u=w[t],h=a[t],v=i[t],n=t+1;n<x;n++)g=a[n],m=i[n],a[n]=(g*h+m*v)/d,i[n]=(m*h-g*v)/d;for(n=0;n<x;n++)g=s[n],m=u[n],s[n]=(g*h+m*v)/d,u[n]=(m*h-g*v)/d;for(n=t+1;n<x;n++){for(o=_[n],l=k[n],c=b[n],f=w[n],h=o[t],v=l[t],r=t+1;r<x;r++)g=a[r],m=i[r],o[r]-=g*h-m*v,l[r]-=m*h+g*v;for(r=0;r<x;r++)g=s[r],m=u[r],c[r]-=g*h-m*v,f[r]-=m*h+g*v}}for(t=x-1;t>0;t--)for(s=b[t],u=w[t],n=t-1;n>=0;n--)for(c=b[n],f=w[n],h=_[n][t],v=k[n][t],r=x-1;r>=0;r--)g=s[r],m=u[r],c[r]-=h*g-v*m,f[r]-=h*m+v*g;return new numeric.T(b,w)},numeric.T.prototype.get=function(e){var t,n=this.x,r=this.y,a=0,i=e.length;if(r){for(;a<i;)t=e[a],n=n[t],r=r[t],a++;return new numeric.T(n,r)}for(;a<i;)t=e[a],n=n[t],a++;return new numeric.T(n)},numeric.T.prototype.set=function(e,t){var n,r=this.x,a=this.y,i=0,o=e.length,l=t.x,s=t.y;if(0===o)return s?this.y=s:a&&(this.y=void 0),this.x=r,this;if(s){for(a||(a=numeric.rep(numeric.dim(r),0),this.y=a);i<o-1;)n=e[i],r=r[n],a=a[n],i++;return n=e[i],r[n]=l,a[n]=s,this}if(a){for(;i<o-1;)n=e[i],r=r[n],a=a[n],i++;return n=e[i],r[n]=l,l instanceof Array?a[n]=numeric.rep(numeric.dim(l),0):a[n]=0,this}for(;i<o-1;)n=e[i],r=r[n],i++;return n=e[i],r[n]=l,this},numeric.T.prototype.getRows=function(e,t){var n,r,a=t-e+1,i=Array(a),o=this.x,l=this.y;for(n=e;n<=t;n++)i[n-e]=o[n];if(l){for(r=Array(a),n=e;n<=t;n++)r[n-e]=l[n];return new numeric.T(i,r)}return new numeric.T(i)},numeric.T.prototype.setRows=function(e,t,n){var r,a=this.x,i=this.y,o=n.x,l=n.y;for(r=e;r<=t;r++)a[r]=o[r-e];if(l)for(i||(i=numeric.rep(numeric.dim(a),0),this.y=i),r=e;r<=t;r++)i[r]=l[r-e];else if(i)for(r=e;r<=t;r++)i[r]=numeric.rep([o[r-e].length],0);return this},numeric.T.prototype.getRow=function(e){var t=this.x,n=this.y;return n?new numeric.T(t[e],n[e]):new numeric.T(t[e])},numeric.T.prototype.setRow=function(e,t){var n=this.x,r=this.y,a=t.x,i=t.y;return n[e]=a,i?(r||(r=numeric.rep(numeric.dim(n),0),this.y=r),r[e]=i):r&&(r=numeric.rep([a.length],0)),this},numeric.T.prototype.getBlock=function(e,t){var n=this.x,r=this.y,a=numeric.getBlock;return r?new numeric.T(a(n,e,t),a(r,e,t)):new numeric.T(a(n,e,t))},numeric.T.prototype.setBlock=function(e,t,n){n instanceof numeric.T||(n=new numeric.T(n));var r=this.x,a=this.y,i=numeric.setBlock,o=n.x,l=n.y;return l?(a||(this.y=numeric.rep(numeric.dim(this),0),a=this.y),i(r,e,t,o),i(a,e,t,l),this):(i(r,e,t,o),void(a&&i(a,e,t,numeric.rep(numeric.dim(o),0))))},numeric.T.rep=function(e,t){var n=numeric.T;t instanceof n||(t=new n(t));var r=t.x,a=t.y,i=numeric.rep;return a?new n(i(e,r),i(e,a)):new n(i(e,r))},numeric.T.diag=function e(t){t instanceof numeric.T||(t=new numeric.T(t));var n=t.x,r=t.y,e=numeric.diag;return r?new numeric.T(e(n),e(r)):new numeric.T(e(n))},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,n=this.y;return n?new e.T(e.getDiag(t),e.getDiag(n)):new e.T(e.getDiag(t))},numeric.house=function(e){var t=numeric.clone(e),n=e[0]>=0?1:-1,r=n*numeric.norm2(e);t[0]+=r;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 n,r,a,i,o,l,s,u,c,f,d=t[0],p=numeric.clone(e),h=numeric.identity(d);for(r=0;r<d-2;r++){for(i=Array(d-r-1),n=r+1;n<d;n++)i[n-r-1]=p[n][r];if(numeric.norm2(i)>0){for(o=numeric.house(i),l=numeric.getBlock(p,[r+1,r],[d-1,d-1]),s=numeric.tensor(o,numeric.dot(o,l)),n=r+1;n<d;n++)for(u=p[n],c=s[n-r-1],a=r;a<d;a++)u[a]-=2*c[a-r];for(l=numeric.getBlock(p,[0,r+1],[d-1,d-1]),s=numeric.tensor(numeric.dot(l,o),o),n=0;n<d;n++)for(u=p[n],c=s[n],a=r+1;a<d;a++)u[a]-=2*c[a-r-1];for(l=Array(d-r-1),n=r+1;n<d;n++)l[n-r-1]=h[n];for(s=numeric.tensor(o,numeric.dot(o,l)),n=r+1;n<d;n++)for(f=h[n],c=s[n-r-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 n,r,a,i,o,l,s,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),M=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(M.Q,p),g=m+1;g<w;g++)_[g]=h[g-m-1];return{Q:_,B:z.B.concat(numeric.add(M.B,m+1))}}if(a=e[w-2][w-2],i=e[w-2][w-1],o=e[w-1][w-2],l=e[w-1][w-1],u=a+l,s=a*l-i*o,c=numeric.getBlock(e,[0,0],[2,2]),u*u>=4*s){var A,j;A=.5*(u+Math.sqrt(u*u-4*s)),j=.5*(u-Math.sqrt(u*u-4*s)),c=numeric.add(numeric.sub(numeric.dot(c,c),numeric.mul(c,A+j)),numeric.diag(numeric.rep([3],A*j)))}else c=numeric.add(numeric.sub(numeric.dot(c,c),numeric.mul(c,u)),numeric.diag(numeric.rep([3],s)));for(n=[c[0][0],c[1][0],c[2][0]],r=numeric.house(n),p=[e[0],e[1],e[2]],h=numeric.tensor(r,numeric.dot(r,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,r),r),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(r,numeric.dot(r,p)),g=0;g<3;g++)for(f=_[g],v=h[g],y=0;y<w;y++)f[y]-=2*v[y];var E;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),M=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(M.Q,p),g=y+1;g<w;g++)_[g]=h[g-y-1];return{Q:_,B:z.B.concat(numeric.add(M.B,y+1))}}for(E=Math.min(w-1,m+3),n=Array(E-m),g=m+1;g<=E;g++)n[g-m-1]=e[g][m];for(r=numeric.house(n),p=numeric.getBlock(e,[m+1,m],[E,w-1]),h=numeric.tensor(r,numeric.dot(r,p)),g=m+1;g<=E;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,E]),h=numeric.tensor(numeric.dot(p,r),r),g=0;g<w;g++)for(d=e[g],v=h[g],y=m+1;y<=E;y++)d[y]-=2*v[y-m-1];for(p=Array(E-m),g=m+1;g<=E;g++)p[g-m-1]=_[g];for(h=numeric.tensor(r,numeric.dot(r,p)),g=m+1;g<=E;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 n,r,a,i,o,l,s,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))),M=new w(numeric.dot(b.Q,x.Q)),A=k.length,j=Math.sqrt;for(r=0;r<A;r++)if(n=k[r][0],n===k[r][1]);else{if(i=n+1,o=z[n][n],l=z[n][i],s=z[i][n],u=z[i][i],0===l&&0===s)continue;c=-o-u,f=o*u-l*s,d=c*c-4*f,d>=0?(p=c<0?-.5*(c-j(d)):-.5*(c+j(d)),m=(o-p)*(o-p)+l*l,y=s*s+(u-p)*(u-p),m>y?(m=j(m),v=(o-p)/m,g=l/m):(y=j(y),v=s/y,g=(u-p)/y),a=new w([[g,-v],[v,g]]),M.setRows(n,i,a.dot(M.getRows(n,i)))):(p=-.5*c,h=.5*j(-d),m=(o-p)*(o-p)+l*l,y=s*s+(u-p)*(u-p),m>y?(m=j(m+h*h),v=(o-p)/m,g=l/m,p=0,h/=m):(y=j(y+h*h),v=s/y,g=(u-p)/y,p=h/y,h=0),a=new w([[g,-v],[v,g]],[[p,h],[h,-p]]),M.setRows(n,i,a.dot(M.getRows(n,i))))}var E=M.dot(e).dot(M.transjugate()),_=e.length,S=numeric.T.identity(_);for(i=0;i<_;i++)if(i>0)for(r=i-1;r>=0;r--){var O=E.get([r,r]),N=E.get([i,i]);numeric.neq(O.x,N.x)||numeric.neq(O.y,N.y)?(p=E.getRow(r).getBlock([r],[i-1]),h=S.getRow(i).getBlock([r],[i-1]),S.set([i,r],E.get([r,i]).neg().sub(p.dot(h)).div(O.sub(N)))):S.setRow(i,S.getRow(r))}for(i=0;i<_;i++)p=S.getRow(i),S.setRow(i,p.div(p.norm2()));return S=S.transpose(),S=M.transjugate().dot(S),{lambda:E.getDiag(),E:S}},numeric.ccsSparse=function(e){var t,n,r,a,i=e.length,o=[];for(r=i-1;r!==-1;--r){n=e[r];for(a in n){for(a=parseInt(a);a>=o.length;)o[o.length]=0;0!==n[a]&&o[a]++}}var t=o.length,l=Array(t+1);for(l[0]=0,r=0;r<t;++r)l[r+1]=l[r]+o[r];var s=Array(l[t]),u=Array(l[t]);for(r=i-1;r!==-1;--r){n=e[r];for(a in n)0!==n[a]&&(o[a]--,s[l[a]+o[a]]=r,u[l[a]+o[a]]=n[a])}return[l,s,u]},numeric.ccsFull=function(e){var t,n,r,a,i=e[0],o=e[1],l=e[2],s=numeric.ccsDim(e),u=s[0],c=s[1],f=numeric.rep([u,c],0);for(t=0;t<c;t++)for(r=i[t],a=i[t+1],n=r;n<a;++n)f[o[n]][t]=l[n];return f},numeric.ccsTSolve=function(e,t,n,r,a){function i(e){var t;if(0===n[e]){for(n[e]=1,t=o[e];t<o[e+1];++t)i(l[t]);a[f]=e,++f}}var o=e[0],l=e[1],s=e[2],u=o.length-1,c=Math.max,f=0;"undefined"==typeof r&&(n=numeric.rep([u],0)),"undefined"==typeof r&&(r=numeric.linspace(0,n.length-1)),"undefined"==typeof a&&(a=[]);var d,p,h,v,g,m,y;for(d=r.length-1;d!==-1;--d)i(r[d]);for(a.length=f,d=a.length-1;d!==-1;--d)n[a[d]]=0;for(d=r.length-1;d!==-1;--d)p=r[d],n[p]=t[p];for(d=a.length-1;d!==-1;--d){for(p=a[d],h=o[p],v=c(o[p+1],h),g=h;g!==v;++g)if(l[g]===p){n[p]/=s[g];break}for(y=n[p],g=h;g!==v;++g)m=l[g],m!==p&&(n[m]-=y*s[g])}return n},numeric.ccsDFS=function(e){this.k=Array(e),this.k1=Array(e),this.j=Array(e)},numeric.ccsDFS.prototype.dfs=function(e,t,n,r,a,i){var o,l,s,u=0,c=a.length,f=this.k,d=this.k1,p=this.j;if(0===r[e])for(r[e]=1,p[0]=e,f[0]=l=t[e],d[0]=s=t[e+1];;)if(l>=s){if(a[c]=p[u],0===u)return;++c,--u,l=f[u],s=d[u]}else o=i[n[l]],0===r[o]?(r[o]=1,f[u]=l,++u,p[u]=o,l=t[o],d[u]=s=t[o+1]):++l},numeric.ccsLPSolve=function(e,t,n,r,a,i,o){var l,s,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(s=x[a],u=x[a+1],r.length=0,l=s;l<u;++l)o.dfs(i[b[l]],g,m,n,r,i);for(l=r.length-1;l!==-1;--l)n[r[l]]=0;for(l=s;l!==u;++l)c=i[b[l]],n[c]=w[l];for(l=r.length-1;l!==-1;--l){for(c=r[l],f=g[c],d=g[c+1],p=f;p<d;++p)if(i[m[p]]===c){n[c]/=y[p];break}for(v=n[c],p=f;p<d;++p)h=i[m[p]],h!==c&&(n[h]-=v*y[p])}return n},numeric.ccsLUP1=function(e,t){var n,r,a,i,o,l,s,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),n=0;n<u;++n){for(b(c,e,y,x,n,k,z),i=-1,o=-1,r=x.length-1;r!==-1;--r)a=x[r],a<=n||(l=w(y[a]),l>i&&(o=a,i=l));for(w(y[n])<t*i&&(r=_[n],i=_[o],_[n]=i,k[i]=n,_[o]=r,k[r]=o,i=y[n],y[n]=y[o],y[o]=i),i=d[n],o=v[n],s=y[n],p[i]=_[n],h[i]=1,++i,r=x.length-1;r!==-1;--r)a=x[r],l=y[a],x[r]=0,y[a]=0,a<=n?(g[o]=a,m[o]=l,++o):(p[i]=_[a],h[i]=l/s,++i);d[n+1]=i,v[n+1]=o}for(r=p.length-1;r!==-1;--r)p[r]=k[p[r]];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,n,r,a,i,o){var l,s,u,c=0,f=a.length,d=this.k,p=this.k1,h=this.j;if(0===r[e])for(r[e]=1,h[0]=e,d[0]=s=t[i[e]],p[0]=u=t[i[e]+1];;){if(isNaN(s))throw new Error("Ow!");if(s>=u){if(a[f]=i[h[c]],0===c)return;++f,--c,s=d[c],u=p[c]}else l=n[s],0===r[l]?(r[l]=1,d[c]=s,++c,h[c]=l,l=i[l],s=t[l],p[c]=u=t[l+1]):++s}},numeric.ccsLPSolve0=function(e,t,n,r,a,i,o,l){var s,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],r.length=0,s=u;s<c;++s)l.dfs(w[s],m,y,n,r,i,o);for(s=r.length-1;s!==-1;--s)f=r[s],n[o[f]]=0;for(s=u;s!==c;++s)f=w[s],n[f]=_[s];for(s=r.length-1;s!==-1;--s){for(f=r[s],v=o[f],d=m[f],p=m[f+1],h=d;h<p;++h)if(y[h]===v){n[v]/=x[h];break}for(g=n[v],h=d;h<p;++h)n[y[h]]-=g*x[h];n[v]=g}},numeric.ccsLUP0=function(e,t){var n,r,a,i,o,l,s,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),n=0;n<u;++n){for(b(c,e,y,x,n,k,_,z),i=-1,o=-1,r=x.length-1;r!==-1;--r)a=x[r],a<=n||(l=w(y[_[a]]),l>i&&(o=a,i=l));for(w(y[_[n]])<t*i&&(r=_[n],i=_[o],_[n]=i,k[i]=n,_[o]=r,k[r]=o),i=d[n],o=v[n],s=y[_[n]],p[i]=_[n],h[i]=1,++i,r=x.length-1;r!==-1;--r)a=x[r],l=y[_[a]],x[r]=0,y[_[a]]=0,a<=n?(g[o]=a,m[o]=l,++o):(p[i]=_[a],h[i]=l/s,++i);d[n+1]=i,v[n+1]=o}for(r=p.length-1;r!==-1;--r)p[r]=k[p[r]];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,n){var r=numeric.ccsDim(e),a=r[0],i=r[1];"undefined"==typeof t?t=numeric.linspace(0,a-1):"number"==typeof t&&(t=[t]),"undefined"==typeof n?n=numeric.linspace(0,i-1):"number"==typeof n&&(n=[n]);var o,l,s,u,c,f=t.length,d=n.length,p=numeric.rep([i],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(l=0;l<d;++l){u=n[l];var k=m[u],z=m[u+1];for(o=k;o<z;++o)s=y[o],_[s]=1,b[s]=x[o];for(o=0;o<f;++o)c=t[o],_[c]&&(h[w]=o,v[w]=b[t[o]],++w);for(o=k;o<z;++o)s=y[o],_[s]=0;p[l+1]=w}return g},numeric.ccsDot=function(e,t){var n,r,a,i,o,l,s,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),M=Array(w),A=numeric.rep([_],0),j=[],E=[],S=[A,j,E];for(a=0;a!==_;++a){for(i=g[a],o=g[a+1],c=0,r=i;r<o;++r)for(f=m[r],d=y[r],l=p[f],s=p[f+1],n=l;n<s;++n)u=h[n],0===z[u]&&(M[c]=u,z[u]=1,c+=1),k[u]=k[u]+v[n]*d;for(i=A[a],o=i+c,A[a+1]=o,r=c-1;r!==-1;--r)d=i+r,n=M[r],j[d]=n,E[d]=k[n],z[n]=0,k[n]=0;A[a+1]=A[a]+c}return S},numeric.ccsLUPSolve=function(e,t){var n=e.L,r=e.U,a=(e.P,t[0]),i=!1;"object"!=typeof a&&(t=[[0,t.length],numeric.linspace(0,t.length-1),t],a=t[0],i=!0);var o,l,s,u,c,f,d=t[1],p=t[2],h=n[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(o=0;o<v;++o){for(c=0,s=a[o],u=a[o+1],l=s;l<u;++l)f=e.Pinv[d[l]],x[c]=f,y[f]=p[l],++c;for(x.length=c,k(n,y,g,x,m),l=x.length-1;l!==-1;--l)y[x[l]]=0;if(k(r,g,y,m,x),i)return y;for(l=m.length-1;l!==-1;--l)g[m[l]]=0;for(l=x.length-1;l!==-1;--l)f=x[l],w[z]=f,_[z]=y[f],y[f]=0,++z;b[o+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,n=e[0],r=e[1],a=e[2],i=numeric.sup(r)+1,o=n.length,l=numeric.rep([i],0),s=Array(o),u=Array(o),c=numeric.rep([i],0);for(t=0;t<o;++t)c[r[t]]++;for(t=0;t<i;++t)l[t+1]=l[t]+c[t];var f,d,p=l.slice(0);for(t=0;t<o;++t)d=r[t],f=p[d],s[f]=n[t],u[f]=a[t],p[d]=p[d]+1;return[l,s,u]},numeric.ccsGather=function(e){var t,n,r,a,i,o=e[0],l=e[1],s=e[2],u=o.length-1,c=l.length,f=Array(c),d=Array(c),p=Array(c);for(i=0,t=0;t<u;++t)for(r=o[t],a=o[t+1],n=r;n!==a;++n)d[i]=t,f[i]=l[n],p[i]=s[n],++i;return[f,d,p]},numeric.sdim=function e(t,n,r){if("undefined"==typeof n&&(n=[]),"object"!=typeof t)return n;"undefined"==typeof r&&(r=0),r in n||(n[r]=0),t.length>n[r]&&(n[r]=t.length);var a;for(a in t)t.hasOwnProperty(a)&&e(t[a],n,r+1);return n},numeric.sclone=function e(t,n,r){"undefined"==typeof n&&(n=0),"undefined"==typeof r&&(r=numeric.sdim(t).length);var a,i=Array(t.length);if(n===r-1){for(a in t)t.hasOwnProperty(a)&&(i[a]=t[a]);return i}for(a in t)t.hasOwnProperty(a)&&(i[a]=e(t[a],n+1,r));return i},numeric.sdiag=function(e){var t,n,r=e.length,a=Array(r);for(t=r-1;t>=1;t-=2)n=t-1,a[t]=[],a[t][t]=e[t],a[n]=[],a[n][n]=e[n];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,n,r,a=[];e.length;for(t in e)if(e.hasOwnProperty(t)){r=e[t];for(n in r)r.hasOwnProperty(n)&&("object"!=typeof a[n]&&(a[n]=[]),a[n][t]=r[n])}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 n,r,a,i,o,l,s,u=e.length,c=(t.length,numeric.stranspose(t)),f=c.length,d=Array(u);for(a=u-1;a>=0;a--){for(s=[],n=e[a],o=f-1;o>=0;o--){l=0,r=c[o];for(i in n)n.hasOwnProperty(i)&&i in r&&(l+=n[i]*r[i]);l&&(s[o]=l)}d[a]=s}return d},numeric.sdotMV=function(e,t){var n,r,a,i,o=e.length,l=Array(o);for(r=o-1;r>=0;r--){n=e[r],i=0;for(a in n)n.hasOwnProperty(a)&&t[a]&&(i+=n[a]*t[a]);i&&(l[r]=i)}return l},numeric.sdotVM=function(e,t){var n,r,a,i,o=[];for(n in e)if(e.hasOwnProperty(n)){a=t[n],i=e[n];for(r in a)a.hasOwnProperty(r)&&(o[r]||(o[r]=0),o[r]+=i*a[r])}return o},numeric.sdotVV=function(e,t){var n,r=0;for(n in e)e[n]&&t[n]&&(r+=e[n]*t[n]);return r},numeric.sdot=function(e,t){var n=numeric.sdim(e).length,r=numeric.sdim(t).length,a=1e3*n+r;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 "+n+" and "+r)}},numeric.sscatter=function(e){var t,n,r,a,i=e[0].length,o=e.length,l=[];for(n=i-1;n>=0;--n)if(e[o-1][n]){for(a=l,r=0;r<o-2;r++)t=e[r][n],a[t]||(a[t]=[]),a=a[t];a[e[r][n]]=e[r+1][n]}return l},numeric.sgather=function e(t,n,r){"undefined"==typeof n&&(n=[]),"undefined"==typeof r&&(r=[]);var a,i,o;a=r.length;for(i in t)if(t.hasOwnProperty(i))if(r[a]=parseInt(i),o=t[i],"number"==typeof o){if(o){if(0===n.length)for(i=a+1;i>=0;--i)n[i]=[];for(i=a;i>=0;--i)n[i].push(r[i]);n[a+1].push(o)}}else e(o,n,r);return r.length>a&&r.pop(),n},numeric.cLU=function(e){var t,n,r,a,i,o,l=e[0],s=e[1],u=e[2],c=l.length,f=0;for(t=0;t<c;t++)l[t]>f&&(f=l[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(r=0;r<c;r++)t=l[r],n=s[r],n<m[t]&&(m[t]=n),n>y[t]&&(y[t]=n);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(r=0;r<c;r++)t=l[r],g[t][s[r]-m[t]]=u[r];for(t=0;t<f-1;t++)for(a=t-m[t],d=g[t],n=t+1;m[n]<=t&&n<f;n++)if(i=t-m[n],o=y[t]-t,p=g[n],h=p[i]/d[a]){for(r=1;r<=o;r++)p[r+i]-=h*d[r+a];v[n][t-m[n]]=h}var c,w,_,d=[],p=[],k=[],z=[],M=[],A=[];for(c=0,w=0,t=0;t<f;t++){for(a=m[t],i=y[t],_=g[t],n=t;n<=i;n++)_[n-a]&&(d[c]=t,p[c]=n,k[c]=_[n-a],c++);for(_=v[t],n=a;n<t;n++)_[n-a]&&(z[w]=t,M[w]=n,A[w]=_[n-a],w++);z[w]=t,M[w]=t,A[w]=1,w++}return{U:[d,p,k],L:[z,M,A]}},numeric.cLUsolve=function(e,t){var n,r,a=e.L,i=e.U,o=numeric.clone(t),l=a[0],s=a[1],u=a[2],c=i[0],f=i[1],d=i[2],p=c.length,h=(l.length,o.length);for(r=0,n=0;n<h;n++){for(;s[r]<n;)o[n]-=u[r]*o[s[r]],r++;r++}for(r=p-1,n=h-1;n>=0;n--){for(;f[r]>n;)o[n]-=d[r]*o[f[r]],r--;o[n]/=d[r],r--}return o},numeric.cgrid=function(e,t){"number"==typeof e&&(e=[e,e]);var n,r,a,i=numeric.rep(e,-1);if("function"!=typeof t)switch(t){case"L":t=function(t,n){return t>=e[0]/2||n<e[1]/2};break;default:t=function(e,t){return!0}}for(a=0,n=1;n<e[0]-1;n++)for(r=1;r<e[1]-1;r++)t(n,r)&&(i[n][r]=a,a++);return i},numeric.cdelsq=function(e){var t,n,r,a,i,o=[[-1,0],[0,-1],[0,1],[1,0]],l=numeric.dim(e),s=l[0],u=l[1],c=[],f=[],d=[];for(t=1;t<s-1;t++)for(n=1;n<u-1;n++)if(!(e[t][n]<0)){for(r=0;r<4;r++)a=t+o[r][0],i=n+o[r][1],e[a][i]<0||(c.push(e[t][n]),f.push(e[a][i]),d.push(-1));c.push(e[t][n]),f.push(e[t][n]),d.push(4)}return[c,f,d]},numeric.cdotMV=function(e,t){var n,r,a,i=e[0],o=e[1],l=e[2],s=i.length;for(a=0,r=0;r<s;r++)i[r]>a&&(a=i[r]);for(a++,n=numeric.rep([a],0),r=0;r<s;r++)n[i[r]]+=l[r]*t[o[r]];return n},numeric.Spline=function(e,t,n,r,a){this.x=e,this.yl=t,this.yr=n,this.kl=r,this.kr=a},numeric.Spline.prototype._at=function(e,t){var e,n,r,a,i=this.x,o=this.yl,l=this.yr,s=this.kl,u=this.kr,c=numeric.add,f=numeric.sub,d=numeric.mul;n=f(d(s[t],i[t+1]-i[t]),f(l[t+1],o[t])),r=c(d(u[t+1],i[t]-i[t+1]),f(l[t+1],o[t])),a=(e-i[t])/(i[t+1]-i[t]);var p=a*(1-a);return c(c(c(d(1-a,o[t]),d(a,l[t+1])),d(n,p*(1-a))),d(r,p*a))},numeric.Spline.prototype.at=function(e){if("number"==typeof e){var t,n,r,a=this.x,i=a.length,o=Math.floor;for(t=0,n=i-1;n-t>1;)r=o((t+n)/2),a[r]<=e?t=r:n=r;return this._at(e,t)}var l,i=e.length,s=Array(i); | |
for(l=i-1;l!==-1;--l)s[l]=this.at(e[l]);return s},numeric.Spline.prototype.diff=function(){var e,t,n,r=this.x,a=this.yl,i=this.yr,o=this.kl,l=this.kr,s=a.length,u=o,c=l,f=Array(s),d=Array(s),p=numeric.add,h=numeric.mul,v=numeric.div,g=numeric.sub;for(e=s-1;e!==-1;--e)t=r[e+1]-r[e],n=g(i[e+1],a[e]),f[e]=v(p(h(n,6),h(o[e],-4*t),h(l[e+1],-2*t)),t*t),d[e+1]=v(p(h(n,-6),h(o[e],2*t),h(l[e+1],4*t)),t*t);return new numeric.Spline(r,u,c,f,d)},numeric.Spline.prototype.roots=function(){function e(e){return e*e}var t=[],n=this.x,r=this.yl,a=this.yr,i=this.kl,o=this.kr;"number"==typeof r[0]&&(r=[r],a=[a],i=[i],o=[o]);var l,s,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,M,A,j,E,S,O,N=r.length,F=n.length-1,t=Array(N),C=Math.sqrt;for(l=0;l!==N;++l){for(c=r[l],f=a[l],d=i[l],p=o[l],h=[],s=0;s!==F;s++){for(s>0&&f[s]*c[s]<0&&h.push(n[s]),_=n[s+1]-n[s],k=n[s],m=c[s],y=f[s+1],v=d[s]/_,g=p[s+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?(M=x/b,z=M>n[s]&&M<n[s+1]?[n[s],M,n[s+1]]:[n[s],n[s+1]]):(M=(x-C(w))/b,A=(x+C(w))/b,z=[n[s]],M>n[s]&&M<n[s+1]&&z.push(M),A>n[s]&&A<n[s+1]&&z.push(A),z.push(n[s+1])),E=z[0],M=this._at(E,s),u=0;u<z.length-1;u++)if(S=z[u+1],A=this._at(S,s),0!==M)if(0===A||M*A>0)E=S,M=A;else{for(var T=0;;){if(O=(M*S-A*E)/(M-A),O<=E||O>=S)break;if(j=this._at(O,s),j*A>0)S=O,A=j,T===-1&&(M*=.5),T=-1;else{if(!(j*M>0))break;E=O,M=j,1===T&&(A*=.5),T=1}}h.push(O),E=z[u+1],M=this._at(E,s)}else h.push(E),E=S,M=A;0===A&&h.push(S)}t[l]=h}return"number"==typeof this.yl[0]?t[0]:t},numeric.spline=function(e,t,n,r){var a,i=e.length,o=[],l=[],s=[],u=numeric.sub,c=numeric.mul,f=numeric.add;for(a=i-2;a>=0;a--)l[a]=e[a+1]-e[a],s[a]=u(t[a+1],t[a]);"string"!=typeof n&&"string"!=typeof r||(n=r="periodic");var d=[[],[],[]];switch(typeof n){case"undefined":o[0]=c(3/(l[0]*l[0]),s[0]),d[0].push(0,0),d[1].push(0,1),d[2].push(2/l[0],1/l[0]);break;case"string":o[0]=f(c(3/(l[i-2]*l[i-2]),s[i-2]),c(3/(l[0]*l[0]),s[0])),d[0].push(0,0,0),d[1].push(i-2,0,1),d[2].push(1/l[i-2],2/l[i-2]+2/l[0],1/l[0]);break;default:o[0]=n,d[0].push(0),d[1].push(0),d[2].push(1)}for(a=1;a<i-1;a++)o[a]=f(c(3/(l[a-1]*l[a-1]),s[a-1]),c(3/(l[a]*l[a]),s[a])),d[0].push(a,a,a),d[1].push(a-1,a,a+1),d[2].push(1/l[a-1],2/l[a-1]+2/l[a],1/l[a]);switch(typeof r){case"undefined":o[i-1]=c(3/(l[i-2]*l[i-2]),s[i-2]),d[0].push(i-1,i-1),d[1].push(i-2,i-1),d[2].push(1/l[i-2],2/l[i-2]);break;case"string":d[1][d[1].length-1]=0;break;default:o[i-1]=r,d[0].push(i-1),d[1].push(i-1),d[2].push(1)}o="number"!=typeof o[0]?numeric.transpose(o):[o];var p=Array(o.length);if("string"==typeof n)for(a=p.length-1;a!==-1;--a)p[a]=numeric.ccsLUPSolve(numeric.ccsLUP(numeric.ccsScatter(d)),o[a]),p[a][i-1]=p[a][0];else for(a=p.length-1;a!==-1;--a)p[a]=numeric.cLUsolve(numeric.cLU(d),o[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,n){var r=t.length;if(1!==r){var a,i,o=Math.cos,l=Math.sin,s=Array(r/2),u=Array(r/2),c=Array(r/2),f=Array(r/2);for(i=r/2,a=r-1;a!==-1;--a)--i,c[i]=t[a],f[i]=n[a],--a,s[i]=t[a],u[i]=n[a];e(s,u),e(c,f),i=r/2;var d,p,h,v=-6.283185307179586/r;for(a=r-1;a!==-1;--a)--i,i===-1&&(i=r/2-1),d=v*a,p=o(d),h=l(d),t[a]=s[i]+p*c[i]-h*f[i],n[a]=u[i]+p*f[i]+h*c[i]}},numeric._ifftpow2=function e(t,n){var r=t.length;if(1!==r){var a,i,o=Math.cos,l=Math.sin,s=Array(r/2),u=Array(r/2),c=Array(r/2),f=Array(r/2);for(i=r/2,a=r-1;a!==-1;--a)--i,c[i]=t[a],f[i]=n[a],--a,s[i]=t[a],u[i]=n[a];e(s,u),e(c,f),i=r/2;var d,p,h,v=6.283185307179586/r;for(a=r-1;a!==-1;--a)--i,i===-1&&(i=r/2-1),d=v*a,p=o(d),h=l(d),t[a]=s[i]+p*c[i]-h*f[i],n[a]=u[i]+p*f[i]+h*c[i]}},numeric.ifftpow2=function(e,t){numeric._ifftpow2(e,t),numeric.diveq(e,e.length),numeric.diveq(t,t.length)},numeric.convpow2=function(e,t,n,r){numeric.fftpow2(e,t),numeric.fftpow2(n,r);var a,i,o,l,s,u=e.length;for(a=u-1;a!==-1;--a)i=e[a],l=t[a],o=n[a],s=r[a],e[a]=i*o-l*s,t[a]=i*s+l*o;numeric.ifftpow2(e,t)},numeric.T.prototype.fft=function(){var e,t,n=this.x,r=this.y,a=n.length,i=Math.log,o=i(2),l=Math.ceil(i(2*a-1)/o),s=Math.pow(2,l),u=numeric.rep([s],0),c=numeric.rep([s],0),f=Math.cos,d=Math.sin,p=-3.141592653589793/a,h=numeric.rep([s],0),v=numeric.rep([s],0);Math.floor(a/2);for(e=0;e<a;e++)h[e]=n[e];if("undefined"!=typeof r)for(e=0;e<a;e++)v[e]=r[e];for(u[0]=1,e=1;e<=s/2;e++)t=p*e*e,u[e]=f(t),c[e]=d(t),u[s-e]=f(t),c[s-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,n=this.x,r=this.y,a=n.length,i=Math.log,o=i(2),l=Math.ceil(i(2*a-1)/o),s=Math.pow(2,l),u=numeric.rep([s],0),c=numeric.rep([s],0),f=Math.cos,d=Math.sin,p=3.141592653589793/a,h=numeric.rep([s],0),v=numeric.rep([s],0);Math.floor(a/2);for(e=0;e<a;e++)h[e]=n[e];if("undefined"!=typeof r)for(e=0;e<a;e++)v[e]=r[e];for(u[0]=1,e=1;e<=s/2;e++)t=p*e*e,u[e]=f(t),c[e]=d(t),u[s-e]=f(t),c[s-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 n=t.length,r=e(t);if(isNaN(r))throw new Error("gradient: f(x) is a NaN!");var a,i,o,l,s,u,c,f,d,p,h=Math.max,v=numeric.clone(t),g=Array(n),h=(numeric.div,numeric.sub,Math.max),m=.001,y=Math.abs,x=Math.min,b=0;for(a=0;a<n;a++)for(var w=h(1e-6*r,1e-8);;){if(++b,b>20)throw new Error("Numerical gradient fails");if(v[a]=t[a]+w,i=e(v),v[a]=t[a]-w,o=e(v),v[a]=t[a],isNaN(i)||isNaN(o))w/=16;else{if(g[a]=(i-o)/(2*w),s=t[a]-w,u=t[a],c=t[a]+w,f=(i-r)/w,d=(r-o)/w,p=h(y(g[a]),y(r),y(i),y(o),y(s),y(u),y(c),1e-8),l=x(h(y(f-g[a]),y(d-g[a]),y(f-d))/p,w/p),!(l>m))break;w/=16}}return g},numeric.uncmin=function(e,t,n,r,a,i,o){var l=numeric.gradient;"undefined"==typeof o&&(o={}),"undefined"==typeof n&&(n=1e-8),"undefined"==typeof r&&(r=function(t){return l(e,t)}),"undefined"==typeof a&&(a=1e3),t=numeric.clone(t);var s,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;n=d(n,numeric.epsilon);var h,v,g,m,y,x,b,w,_,k,z=o.Hinv||numeric.identity(c),M=numeric.dot,A=(numeric.inv,numeric.sub),j=numeric.add,E=numeric.tensor,S=numeric.div,O=numeric.mul,N=numeric.all,F=numeric.isFinite,C=numeric.neg,T=0,q="";for(v=r(t);T<a;){if("function"==typeof i&&i(T,t,f,v,z)){q="Callback returned true";break}if(!N(F(v))){q="Gradient has Infinity or NaN";break}if(h=C(M(z,v)),!N(F(h))){q="Search direction has Infinity or NaN";break}if(k=p(h),k<n){q="Newton step smaller than tol";break}for(_=1,u=M(v,h),y=t;T<a&&!(_*k<n)&&(m=O(h,_),y=j(t,m),s=e(y),s-f>=.1*_*u||isNaN(s));)_*=.5,++T;if(_*k<n){q="Line search step size smaller than tol";break}if(T===a){q="maxit reached during line search";break}g=r(y),x=A(g,v),w=M(x,m),b=M(z,x),z=A(j(z,O((w+M(x,b))/(w*w),E(m,m))),S(j(E(b,m),E(m,b)),w)),t=y,f=s,v=g,++T}return{solution:t,f:f,gradient:v,invHessian:z,iterations:T,message:q}},numeric.Dopri=function(e,t,n,r,a,i,o){this.x=e,this.y=t,this.f=n,this.ymid=r,this.iterations=a,this.events=o,this.message=i},numeric.Dopri.prototype._at=function(e,t){function n(e){return e*e}var r,a,i,o,l,s,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 r=h[t],a=h[t+1],o=v[t],l=v[t+1],u=a-r,i=r+y*u,s=m[t],c=w(g[t],b(o,1/(r-i)+2/(r-a))),f=w(g[t+1],b(l,1/(a-i)+2/(a-r))),d=[n(e-a)*(e-i)/n(r-a)/(r-i),n(e-r)*n(e-a)/n(r-i)/n(a-i),n(e-r)*(e-i)/n(a-r)/(a-i),(e-r)*n(e-a)*(e-i)/n(r-a)/(r-i),(e-a)*n(e-r)*(e-i)/n(r-a)/(a-i)],x(x(x(x(b(o,d[0]),b(s,d[1])),b(l,d[2])),b(c,d[3])),b(f,d[4]))},numeric.Dopri.prototype.at=function(e){var t,n,r,a=Math.floor;if("number"!=typeof e){var i=e.length,o=Array(i);for(t=i-1;t!==-1;--t)o[t]=this.at(e[t]);return o}var l=this.x;for(t=0,n=l.length-1;n-t>1;)r=a(.5*(t+n)),l[r]<=e?t=r:n=r;return this._at(e,t)},numeric.dopri=function(e,t,n,r,a,i,o){"undefined"==typeof a&&(a=1e-6),"undefined"==typeof i&&(i=1e3);var l,s,u,c,f,d,p,h,v,g,m,y,x,b=[e],w=[n],_=[r(e,n)],k=[],z=.2,M=[.075,.225],A=[44/45,-56/15,32/9],j=[19372/6561,-25360/2187,64448/6561,-212/729],E=[9017/3168,-355/33,46732/5247,49/176,-5103/18656],S=[35/384,0,500/1113,125/192,-2187/6784,11/84],O=[.10013431883002395,0,.3918321794184259,-.02982460176594817,.05893268337240795,-.04497888809104361,.023904308236133973],N=[.2,.3,.8,8/9,1,1],F=[-71/57600,0,71/16695,-71/1920,17253/339200,-22/525,.025],C=0,T=(t-e)/10,q=0,P=numeric.add,B=numeric.mul,D=(Math.max,Math.min),R=Math.abs,I=numeric.norminf,L=Math.pow,V=numeric.any,U=numeric.lt,Y=numeric.and,H=(numeric.sub,new numeric.Dopri(b,w,_,k,(-1),""));for("function"==typeof o&&(m=o(e,n));e<t&&q<i;)if(++q,e+T>t&&(T=t-e),l=r(e+N[0]*T,P(n,B(z*T,_[C]))),s=r(e+N[1]*T,P(P(n,B(M[0]*T,_[C])),B(M[1]*T,l))),u=r(e+N[2]*T,P(P(P(n,B(A[0]*T,_[C])),B(A[1]*T,l)),B(A[2]*T,s))),c=r(e+N[3]*T,P(P(P(P(n,B(j[0]*T,_[C])),B(j[1]*T,l)),B(j[2]*T,s)),B(j[3]*T,u))),f=r(e+N[4]*T,P(P(P(P(P(n,B(E[0]*T,_[C])),B(E[1]*T,l)),B(E[2]*T,s)),B(E[3]*T,u)),B(E[4]*T,c))),v=P(P(P(P(P(n,B(_[C],T*S[0])),B(s,T*S[2])),B(u,T*S[3])),B(c,T*S[4])),B(f,T*S[5])),d=r(e+T,v),p=P(P(P(P(P(B(_[C],T*F[0]),B(s,T*F[2])),B(u,T*F[3])),B(c,T*F[4])),B(f,T*F[5])),B(d,T*F[6])),g="number"==typeof p?R(p):I(p),g>a){if(T=.2*T*L(a/g,.25),e+T===e){H.msg="Step size became too small";break}}else{if(k[C]=P(P(P(P(P(P(n,B(_[C],T*O[0])),B(s,T*O[2])),B(u,T*O[3])),B(c,T*O[4])),B(f,T*O[5])),B(d,T*O[6])),++C,b[C]=e+T,w[C]=v,_[C]=d,"function"==typeof o){var X,G,Z=e,W=e+.5*T;if(y=o(W,k[C-1]),x=Y(U(m,0),U(0,y)),V(x)||(Z=W,W=e+T,m=y,y=o(W,v),x=Y(U(m,0),U(0,y))),V(x)){for(var J,Q,K=0,$=1,ee=1;;){if("number"==typeof m)G=(ee*y*Z-$*m*W)/(ee*y-$*m);else for(G=W,h=m.length-1;h!==-1;--h)m[h]<0&&y[h]>0&&(G=D(G,(ee*y[h]*Z-$*m[h]*W)/(ee*y[h]-$*m[h])));if(G<=Z||G>=W)break;X=H._at(G,C-1),Q=o(G,X),J=Y(U(m,0),U(0,Q)),V(J)?(W=G,y=Q,x=J,ee=1,K===-1?$*=.5:$=1,K=-1):(Z=G,m=Q,$=1,1===K?ee*=.5:ee=1,K=1)}return v=H._at(.5*(e+G),C-1),H.f[C]=r(G,X),H.x[C]=G,H.y[C]=X,H.ymid[C-1]=v,H.events=x,H.iterations=q,H}}e+=T,n=v,m=y,T=D(.8*T*L(a/g,.25),4*T)}return H.iterations=q,H},numeric.LU=function(e,t){t=t||!1;var n,r,a,i,o,l,s,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(s=a,l=e[a],c=f(l[a]),r=a+1;r<d;++r)i=f(e[r][a]),c<i&&(c=i,s=r);for(h[a]=s,s!=a&&(e[a]=e[s],e[s]=l,l=e[a]),o=l[a],n=a+1;n<d;++n)e[n][a]/=o;for(n=a+1;n<d;++n){for(u=e[n],r=a+1;r<p;++r)u[r]-=u[a]*l[r],++r,u[r]-=u[a]*l[r];r===p&&(u[r]-=u[a]*l[r])}}return{LU:e,P:h}},numeric.LUsolve=function(e,t){var n,r,a,i,o,l=e.LU,s=l.length,u=numeric.clone(t),c=e.P;for(n=s-1;n!==-1;--n)u[n]=t[n];for(n=0;n<s;++n)for(a=c[n],c[n]!==n&&(o=u[n],u[n]=u[a],u[a]=o),i=l[n],r=0;r<n;++r)u[n]-=u[r]*i[r];for(n=s-1;n>=0;--n){for(i=l[n],r=n+1;r<s;++r)u[n]-=u[r]*i[r];u[n]/=i[n]}return u},numeric.solve=function(e,t,n){return numeric.LUsolve(numeric.LU(e,n),t)},numeric.echelonize=function(e){var t,n,r,a,i,o,l,s,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(r=0,i=e[t],o=d[t],n=1;n<f;++n)h(i[r])<h(i[n])&&(r=n);for(p[t]=r,v(o,i[r]),v(i,i[r]),n=0;n<c;++n)if(n!==t){for(l=e[n],s=l[r],a=f-1;a!==-1;--a)l[a]-=i[a]*s;for(l=d[n],a=c-1;a!==-1;--a)l[a]-=o[a]*s}}return{I:d,A:e,P:p}},numeric.__solveLP=function(e,t,n,r,a,i,o){var l,s,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=n.length,x=!1,b=0,w=1,_=(numeric.transpose(t),numeric.svd,numeric.transpose),k=(numeric.leq,Math.sqrt),z=Math.abs,M=(numeric.muleq,numeric.norminf,numeric.any,Math.min),A=numeric.all,j=numeric.gt,E=Array(m),S=Array(y),O=(numeric.rep([y],1),numeric.solve),N=p(n,h(t,i)),F=h(e,e);for(u=b;u<a;++u){var C,T;for(C=y-1;C!==-1;--C)S[C]=v(t[C],N[C]);var q=_(S);for(C=m-1;C!==-1;--C)E[C]=f(q[C]);w=.25*z(F/h(e,E));var P=100*k(F/h(E,E));for((!isFinite(w)||w>P)&&(w=P),c=g(e,d(w,E)),s=h(q,S),C=m-1;C!==-1;--C)s[C][C]+=1;T=O(s,v(c,w),!0);var B=v(N,h(t,T)),D=1;for(C=y-1;C!==-1;--C)B[C]<0&&(D=M(D,-.999*B[C]));if(l=p(i,d(T,D)),N=p(n,h(t,l)),!A(j(N,0)))return{solution:i,message:"",iterations:u};if(i=l,w<r)return{solution:l,message:"",iterations:u};if(o){var R=h(e,c),I=h(t,c);for(x=!0,C=y-1;C!==-1;--C)if(R*I[C]<0){x=!1;break}}else x=!(i[m-1]>=0);if(x)return{solution:l,message:"Unbounded",iterations:u}}return{solution:i,message:"maximum iteration count exceeded",iterations:u}},numeric._solveLP=function(e,t,n,r,a){var i,o=e.length,l=n.length,s=(numeric.sum,numeric.log,numeric.mul,numeric.sub),u=numeric.dot,c=(numeric.div,numeric.add,numeric.rep([o],0).concat([1])),f=numeric.rep([l,1],-1),d=numeric.blockMatrix([[t,f]]),p=n,i=numeric.rep([o],0).concat(Math.max(0,numeric.sup(numeric.neg(n)))+1),h=numeric.__solveLP(c,d,p,r,a,i,!1),v=numeric.clone(h.solution);v.length=o;var g=numeric.inf(s(n,u(t,v)));if(g<0)return{solution:NaN,message:"Infeasible",iterations:h.iterations};var m=numeric.__solveLP(e,t,n,r,a-h.iterations,v,!0);return m.iterations+=h.iterations,m},numeric.solveLP=function(e,t,n,r,a,i,o){if("undefined"==typeof o&&(o=1e3),"undefined"==typeof i&&(i=numeric.epsilon),"undefined"==typeof r)return numeric._solveLP(e,t,n,i,o);var l,s=r.length,u=r[0].length,c=t.length,f=numeric.echelonize(r),d=numeric.rep([u],0),p=f.P,h=[];for(l=p.length-1;l!==-1;--l)d[p[l]]=1;for(l=u-1;l!==-1;--l)0===d[l]&&h.push(l);var v=numeric.getRange,g=numeric.linspace(0,s-1),m=numeric.linspace(0,c-1),y=v(r,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)),M=_(n,w(k,a)),A=Array(p.length),j=Array(h.length);for(l=p.length-1;l!==-1;--l)A[l]=e[p[l]];for(l=h.length-1;l!==-1;--l)j[l]=e[h[l]];var E=_(j,w(A,w(f.I,y))),S=numeric._solveLP(E,z,M,i,o),O=S.solution;if(O!==O)return S;var N=w(f.I,_(a,w(y,O))),F=Array(e.length);for(l=p.length-1;l!==-1;--l)F[p[l]]=N[l];for(l=h.length-1;l!==-1;--l)F[h[l]]=O[l];return{solution:F,message:S.message,iterations:S.iterations}},numeric.MPStoLP=function(e){function t(t){throw new Error("MPStoLP: "+t+"\nLine "+n+": "+e[n]+"\nCurrent state: "+l[o]+"\n")}e instanceof String&&e.split("\n");var n,r,a,i,o=0,l=["Initial state","NAME","ROWS","COLUMNS","RHS","BOUNDS","ENDATA"],s=e.length,u=0,c={},f=[],d=0,p={},h=0,v=[],g=[],m=[];for(n=0;n<s;++n){a=e[n];var y=a.match(/\S*/g),x=[];for(r=0;r<y.length;++r)""!==y[r]&&x.push(y[r]);if(0!==x.length){for(r=0;r<l.length&&a.substr(0,l[r].length)!==l[r];++r);if(r<l.length){if(o=r,1===r&&(i=x[1]),6===r)return{name:i,c:v,A:numeric.transpose(g),b:m,rows:c,vars:p}}else switch(o){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(r=1;r<x.length;r+=2)if(x[r]!==u){var w=c[x[r]];g[b][w]=(f[w]<0?-1:1)*parseFloat(x[r+1])}else v[b]=parseFloat(x[r+1]);break;case 4:for(r=1;r<x.length;r+=2)m[c[x[r]]]=(f[c[x[r]]]<0?-1:1)*parseFloat(x[r+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,n,r,a,i,o){function l(e){var t,r,a=this,i=e.length,o=0,l=a.i=a.j=a.m=0;for(a.S=[],a.c=[],i||(e=[i++]);o<n;)a.S[o]=o++;for(o=0;o<n;o++)t=a.S[o],l=c(l+t+e[o%i]),r=a.S[l],a.S[o]=r,a.S[l]=t;a.g=function(e){var t=a.S,r=c(a.i+1),i=t[r],o=c(a.j+i),l=t[o];t[r]=l,t[o]=i;for(var s=t[c(i+l)];--e;)r=c(r+1),i=t[r],o=c(o+i),l=t[o],t[r]=l,t[o]=i,s=s*n+t[c(i+l)];return a.i=r,a.j=o,s},a.g(n)}function s(e,t,n,r,a){if(n=[],a=typeof e,t&&"object"==a)for(r in e)if(r.indexOf("S")<5)try{n.push(s(e[r],t-1))}catch(e){}return n.length?n:e+("string"!=a?"\0":"")}function u(e,t,n,r){for(e+="",n=0,r=0;r<e.length;r++)t[c(r)]=c((n^=19*t[c(r)])+e.charCodeAt(r));e="";for(r in t)e+=String.fromCharCode(t[r]);return e}function c(e){return e&n-1}t.seedrandom=function(c,f){var d,p=[];return c=u(s(f?[c,e]:arguments.length?c:[(new Date).getTime(),e,window],3),p),d=new l(p),u(d.S,e),t.random=function(){for(var e=d.g(r),t=o,l=0;e<a;)e=(e+l)*n,t*=n,l=d.g(1);for(;e>=i;)e/=2,t/=2,l>>>=1;return(e+l)/t},c},o=t.pow(n,r),a=t.pow(2,a),i=2*a,u(t.random(),e)}([],numeric.seedrandom,256,6,52),function(e){function t(e){if("object"!=typeof e)return e;var n,r=[],a=e.length;for(n=0;n<a;n++)r[n+1]=t(e[n]);return r}function n(e){if("object"!=typeof e)return e;var t,r=[],a=e.length;for(t=1;t<a;t++)r[t-1]=n(e[t]);return r}function r(e,t,n){var r,a,i,o,l;for(i=1;i<=n;i+=1){for(e[i][i]=1/e[i][i],l=-e[i][i],r=1;r<i;r+=1)e[r][i]=l*e[r][i];if(o=i+1,n<o)break;for(a=o;a<=n;a+=1)for(l=e[i][a],e[i][a]=0,r=1;r<=i;r+=1)e[r][a]=e[r][a]+l*e[r][i]}}function a(e,t,n,r){var a,i,o,l;for(i=1;i<=n;i+=1){for(l=0,a=1;a<i;a+=1)l+=e[a][i]*r[a];r[i]=(r[i]-l)/e[i][i]}for(o=1;o<=n;o+=1)for(i=n+1-o,r[i]=r[i]/e[i][i],l=-r[i],a=1;a<i;a+=1)r[a]=r[a]+l*e[a][i]}function i(e,t,n,r){var a,i,o,l,s,u;for(i=1;i<=n;i+=1){if(r[1]=i,u=0,o=i-1,o<1){if(u=e[i][i]-u,u<=0)break;e[i][i]=Math.sqrt(u)}else{for(l=1;l<=o;l+=1){for(s=e[l][i],a=1;a<l;a+=1)s-=e[a][i]*e[a][l];s/=e[l][l],e[l][i]=s,u+=s*s}if(u=e[i][i]-u,u<=0)break;e[i][i]=Math.sqrt(u)}r[1]=0}}function o(e,t,n,o,l,s,u,c,f,d,p,h,v,g,m,y){function x(){for(g[1]=g[1]+1,A=C,z=1;z<=d;z+=1){for(A+=1,R=-c[z],M=1;M<=o;M+=1)R+=u[M][z]*l[M];if(Math.abs(R)<G&&(R=0),z>p)m[A]=R;else if(m[A]=-Math.abs(R),R>0){for(M=1;M<=o;M+=1)u[M][z]=-u[M][z];c[z]=-c[z]}}for(z=1;z<=v;z+=1)m[C+h[z]]=0;for(q=0,D=0,z=1;z<=d;z+=1)m[C+z]<D*m[B+z]&&(q=z,D=m[C+z]/m[B+z]);return 0===q?999:0}function b(){for(z=1;z<=o;z+=1){for(R=0,M=1;M<=o;M+=1)R+=e[M][z]*u[M][q];m[z]=R}for(j=O,z=1;z<=o;z+=1)m[j+z]=0;for(M=v+1;M<=o;M+=1)for(z=1;z<=o;z+=1)m[j+z]=m[j+z]+e[z][M]*m[M];for(H=!0,z=v;z>=1;z-=1){for(R=m[z],A=F+z*(z+3)/2,j=A-z,M=z+1;M<=v;M+=1)R-=m[A]*m[N+M],A+=M;if(R/=m[j],m[N+z]=R,h[z]<p)break;if(R<0)break;H=!1,S=z}if(!H)for(I=m[T+S]/m[N+S],z=1;z<=v&&!(h[z]<p)&&!(m[N+z]<0);z+=1)D=m[T+z]/m[N+z],D<I&&(I=D,S=z);for(R=0,z=O+1;z<=O+o;z+=1)R+=m[z]*m[z];if(Math.abs(R)<=G){if(H)return y[1]=1,999;for(z=1;z<=v;z+=1)m[T+z]=m[T+z]-I*m[N+z];return m[T+v+1]=m[T+v+1]+I,700}for(R=0,z=1;z<=o;z+=1)R+=m[O+z]*u[z][q];for(L=-m[C+q]/R,X=!0,H||I<L&&(L=I,X=!1),z=1;z<=o;z+=1)l[z]=l[z]+L*m[O+z],Math.abs(l[z])<G&&(l[z]=0);for(s[1]=s[1]+L*R*(L/2+m[T+v+1]),z=1;z<=v;z+=1)m[T+z]=m[T+z]-L*m[N+z];if(m[T+v+1]=m[T+v+1]+L,!X){for(R=-c[q],M=1;M<=o;M+=1)R+=l[M]*u[M][q];if(q>p)m[C+q]=R;else if(m[C+q]=-Math.abs(R),R>0){for(M=1;M<=o;M+=1)u[M][q]=-u[M][q];c[q]=-c[q]}return 700}for(v+=1,h[v]=q,A=F+(v-1)*v/2+1,z=1;z<=v-1;z+=1)m[A]=m[z],A+=1;if(v===o)m[A]=m[o];else{for(z=o;z>=v+1&&0!==m[z]&&(V=Math.max(Math.abs(m[z-1]),Math.abs(m[z])),U=Math.min(Math.abs(m[z-1]),Math.abs(m[z])),D=m[z-1]>=0?Math.abs(V*Math.sqrt(1+U*U/(V*V))):-Math.abs(V*Math.sqrt(1+U*U/(V*V))),V=m[z-1]/D,U=m[z]/D,1!==V);z-=1)if(0===V)for(m[z-1]=U*D,M=1;M<=o;M+=1)D=e[M][z-1],e[M][z-1]=e[M][z],e[M][z]=D;else for(m[z-1]=D,Y=U/(1+V),M=1;M<=o;M+=1)D=V*e[M][z-1]+U*e[M][z],e[M][z]=Y*(e[M][z-1]+D)-e[M][z],e[M][z-1]=D;m[A]=m[v]}return 0}function w(){if(A=F+S*(S+1)/2+1,j=A+S,0===m[j])return 798;if(V=Math.max(Math.abs(m[j-1]),Math.abs(m[j])),U=Math.min(Math.abs(m[j-1]),Math.abs(m[j])),D=m[j-1]>=0?Math.abs(V*Math.sqrt(1+U*U/(V*V))):-Math.abs(V*Math.sqrt(1+U*U/(V*V))),V=m[j-1]/D,U=m[j]/D,1===V)return 798;if(0===V){for(z=S+1;z<=v;z+=1)D=m[j-1],m[j-1]=m[j],m[j]=D,j+=z;for(z=1;z<=o;z+=1)D=e[z][S],e[z][S]=e[z][S+1],e[z][S+1]=D}else{for(Y=U/(1+V),z=S+1;z<=v;z+=1)D=V*m[j-1]+U*m[j],m[j]=Y*(m[j-1]+D)-m[j],m[j-1]=D,j+=z;for(z=1;z<=o;z+=1)D=V*e[z][S]+U*e[z][S+1],e[z][S+1]=Y*(e[z][S]+D)-e[z][S+1],e[z][S]=D}return 0}function _(){for(j=A-S,z=1;z<=S;z+=1)m[j]=m[A],A+=1,j+=1;return m[T+S]=m[T+S+1],h[S]=h[S+1],S+=1,S<v?797:0}function k(){return m[T+v]=m[T+v+1],m[T+v+1]=0,h[v]=0,v-=1,g[2]=g[2]+1,0}var z,M,A,j,E,S,O,N,F,C,T,q,P,B,D,R,I,L,V,U,Y,H,X,G,Z,W,J;P=Math.min(o,d),A=2*o+P*(P+5)/2+2*d+1,G=1e-60;do G+=G,Z=1+.1*G,W=1+.2*G;while(Z<=1||W<=1);for(z=1;z<=o;z+=1)m[z]=t[z];for(z=o+1;z<=A;z+=1)m[z]=0;for(z=1;z<=d;z+=1)h[z]=0;if(E=[],0===y[1]){if(i(e,n,o,E),0!==E[1])return void(y[1]=2);a(e,n,o,t),r(e,n,o)}else{for(M=1;M<=o;M+=1)for(l[M]=0,z=1;z<=M;z+=1)l[M]=l[M]+e[z][M]*t[z];for(M=1;M<=o;M+=1)for(t[M]=0,z=M;z<=o;z+=1)t[M]=t[M]+e[M][z]*l[z]}for(s[1]=0,M=1;M<=o;M+=1)for(l[M]=t[M],s[1]=s[1]+m[M]*l[M],m[M]=0,z=M+1;z<=o;z+=1)e[z][M]=0;for(s[1]=-s[1]/2,y[1]=0,O=o,N=O+o,T=N+P,F=T+P+1,C=F+P*(P+1)/2,B=C+d,z=1;z<=d;z+=1){for(R=0,M=1;M<=o;M+=1)R+=u[M][z]*u[M][z];m[B+z]=Math.sqrt(R)}for(v=0,g[1]=0,g[2]=0,J=0;;){if(J=x(),999===J)return;for(;;){if(J=b(),0===J)break;if(999===J)return;if(700===J)if(S===v)k();else{for(;;)if(w(),J=_(),797!==J)break;k()}}}}function l(e,r,a,i,l,s){e=t(e),r=t(r),a=t(a);var u,c,f,d,p,h,v=[],g=[],m=[],y=[],x=[];if(l=l||0,s=s?t(s):[void 0,0],i=i?t(i):[],c=e.length-1,f=a[1].length-1,!i)for(u=1;u<=f;u+=1)i[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 o(e,r,c,c,m,v,a,i,c,f,l,g,d,x,y,s),h="",1===s[1]&&(h="constraints are inconsistent, no solution!"),2===s[1]&&(h="matrix D in quadratic function is not positive definite!"),{solution:n(m),value:n(v),unconstrained_solution:n(r),iterations:n(x),iact:n(g),message:h}}e.solveQP=l}(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 n,r=numeric.epsilon,a=1e-64/r,i=50,o=0,l=0,s=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(l=0;l<p;l++)h[l]=v[l]=0;var g=numeric.rep([p,p],0),m=0,y=0,x=0,b=0,w=0,_=0,k=0;for(l=0;l<p;l++){for(h[l]=y,k=0,c=l+1,s=l;s<d;s++)k+=f[s][l]*f[s][l];if(k<=a)y=0;else for(m=f[l][l],y=Math.sqrt(k),m>=0&&(y=-y),x=m*y-k,f[l][l]=m-y,s=c;s<p;s++){for(k=0,u=l;u<d;u++)k+=f[u][l]*f[u][s];for(m=k/x,u=l;u<d;u++)f[u][s]+=m*f[u][l]}for(v[l]=y,k=0,s=c;s<p;s++)k+=f[l][s]*f[l][s];if(k<=a)y=0;else{for(m=f[l][l+1],y=Math.sqrt(k),m>=0&&(y=-y),x=m*y-k,f[l][l+1]=m-y,s=c;s<p;s++)h[s]=f[l][s]/x;for(s=c;s<d;s++){for(k=0,u=c;u<p;u++)k+=f[s][u]*f[l][u];for(u=c;u<p;u++)f[s][u]+=k*h[u]}}w=Math.abs(v[l])+Math.abs(h[l]),w>b&&(b=w)}for(l=p-1;l!=-1;l+=-1){if(0!=y){for(x=y*f[l][l+1],s=c;s<p;s++)g[s][l]=f[l][s]/x;for(s=c;s<p;s++){for(k=0,u=c;u<p;u++)k+=f[l][u]*g[u][s];for(u=c;u<p;u++)g[u][s]+=k*g[u][l]}}for(s=c;s<p;s++)g[l][s]=0,g[s][l]=0;g[l][l]=1,y=h[l],c=l}for(l=p-1;l!=-1;l+=-1){for(c=l+1,y=v[l],s=c;s<p;s++)f[l][s]=0;if(0!=y){for(x=f[l][l]*y,s=c;s<p;s++){for(k=0,u=c;u<d;u++)k+=f[u][l]*f[u][s];for(m=k/x,u=l;u<d;u++)f[u][s]+=m*f[u][l]}for(s=l;s<d;s++)f[s][l]=f[s][l]/y}else for(s=l;s<d;s++)f[s][l]=0;f[l][l]+=1}for(r*=b,u=p-1;u!=-1;u+=-1)for(var z=0;z<i;z++){var M=!1;for(c=u;c!=-1;c+=-1){if(Math.abs(h[c])<=r){M=!0;break}if(Math.abs(v[c-1])<=r)break}if(!M){o=0,k=1;var A=c-1;for(l=c;l<u+1&&(m=k*h[l],h[l]=o*h[l],!(Math.abs(m)<=r));l++)for(y=v[l],x=t(m,y),v[l]=x,o=y/x,k=-m/x,s=0;s<d;s++)w=f[s][A],_=f[s][l],f[s][A]=w*o+_*k,f[s][l]=-w*k+_*o}if(_=v[u],c==u){if(_<0)for(v[u]=-_,s=0;s<p;s++)g[s][u]=-g[s][u];break}if(z>=i-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,o=1,k=1,l=c+1;l<u+1;l++){for(y=h[l],w=v[l],x=k*y,y=o*y,_=t(m,x),h[l-1]=_,o=m/_,k=x/_,m=b*o+y*k,y=-b*k+y*o,x=w*k,w*=o,s=0;s<p;s++)b=g[s][l-1],_=g[s][l],g[s][l-1]=b*o+_*k,g[s][l]=-b*k+_*o;for(_=t(m,x),v[l-1]=_,o=m/_,k=x/_,m=o*y+k*w,b=-k*y+o*w,s=0;s<d;s++)w=f[s][l-1],_=f[s][l],f[s][l-1]=w*o+_*k,f[s][l]=-w*k+_*o}h[c]=0,h[u]=m,v[u]=b}for(l=0;l<v.length;l++)v[l]<r&&(v[l]=0);for(l=0;l<p;l++)for(s=l-1;s>=0;s--)if(v[s]<v[l]){for(o=v[s],v[s]=v[l],v[l]=o,u=0;u<f.length;u++)n=f[u][l],f[u][l]=f[u][s],f[u][s]=n;for(u=0;u<g.length;u++)n=g[u][l],g[u][l]=g[u][s],g[u][s]=n;l=s}return{U:f,S:v,V:g}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],9:[function(e,t,n){!function(){"use strict";function e(e,t){var n=e.x-t.x,r=e.y-t.y;return n*n+r*r}function n(e,t,n){var r=t.x,a=t.y,i=n.x-r,o=n.y-a;if(0!==i||0!==o){var l=((e.x-r)*i+(e.y-a)*o)/(i*i+o*o);l>1?(r=n.x,a=n.y):l>0&&(r+=i*l,a+=o*l)}return i=e.x-r,o=e.y-a,i*i+o*o}function r(t,n){for(var r,a=t[0],i=[a],o=1,l=t.length;o<l;o++)r=t[o],e(r,a)>n&&(i.push(r),a=r);return a!==r&&i.push(r),i}function a(e,t){var r,a,i,o,l=e.length,s="undefined"!=typeof Uint8Array?Uint8Array:Array,u=new s(l),c=0,f=l-1,d=[],p=[];for(u[c]=u[f]=1;f;){for(a=0,r=c+1;r<f;r++)i=n(e[r],e[c],e[f]),i>a&&(o=r,a=i);a>t&&(u[o]=1,d.push(c,o,o,f)),f=d.pop(),c=d.pop()}for(r=0;r<l;r++)u[r]&&p.push(e[r]);return p}function i(e,t,n){var i=void 0!==t?t*t:1;return e=n?e:r(e,i),e=a(e,i)}"function"==typeof define&&define.amd?define(function(){return i}):"undefined"!=typeof t?t.exports=i:"undefined"!=typeof self?self.simplify=i:window.simplify=i}()},{}],10:[function(e,t,n){"use strict";function r(e,t,n,r){this.points=e,this.ids=t,this.dimension=r,this.length=n}function a(e){var t,n,a;if(Array.isArray(e)){if(t=e.length,0===t)return new r(null,null,0,0);n=e[0].length,a=o(f.mallocDouble(t*(n+1)),[t,n+1]),s(e,a.hi(t,n))}else{t=e.shape[0],n=e.shape[1];var i=e.dtype;i="int8"===i||"int16"===i||"int32"===i?"int32":"uint8"===i||"uint8_clamped"===i||"buffer"===i||"uint16"===i||"uint32"===i?"uint32":"float32"===i?"float32":"float64",a=o(f.malloc(t*(n+1)),[t,n+1]),u.assign(a.hi(t,n),e)}for(var h=0;h<t;++h)a.set(h,n,h);for(var v=c.malloc([t,n],e.dtype),g=f.mallocInt32(t),m=0,y=v.data,x=a.data,b=(p.log2(p.nextPow2(t)),l.compile(a.order,!0,a.dtype)),w=[a];m<t;){var _=w.shift(),k=_,z=0|k.shape[0];if(z>1){var M,A=p.log2(m+1)%n,j=d.root(z);M=b(k,j,function(e,t){return e.get(A)-t.get(A)});for(var E=v.index(m,0),S=M.offset,h=0;h<n;++h)y[E++]=x[S++];g[m]=x[S],m+=1,w.push(k.hi(j)),z>2&&w.push(k.lo(j+1))}else{for(var S=k.offset,E=v.index(m,0),h=0;h<n;++h)y[E+h]=x[S++];g[m]=x[S],m+=1}}return f.free(a.data),new r(v,g,t,n)}function i(e){var t=e.p,n=e.i;if(t){for(var a=t.length,i=f.mallocFloat64(a),l=0;l<a;++l)i[l]=t[l];for(var s=n.length,u=f.mallocInt32(s),l=0;l<s;++l)u[l]=n[l];var c=a/s|0;return new r(o(i,[s,c]),u,s,c)}return new r(null,null,0,e.d)}t.exports=a,t.exports.deserialize=i;var o=e("ndarray"),l=e("ndarray-select"),s=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=r.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,n){var r=this.length;if(!(r<1)){for(var a=this.dimension,i=0;i<a;++i)if(t[i]<e[i])return;var o,l=this.points,u=this.ids,d=c.malloc([r,2,a]),h=f.mallocInt32(r),v=d.data,g=l.data,m=1,y=0;for(h[0]=0,s(e,d.pick(0,0)),s(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=l.index(x,0),z=!0,i=0;i<a;++i){var M=g[k+i];if(M<v[w+i]||v[_+i]<M){z=!1;break}}if(z&&(o=n(u[x]),void 0!==o))break;var A=g[k+b],j=v[_+b],E=v[w+b];if(E<=A){var S=2*x+1;if(S<r){h[m]=S;for(var O=d.index(m,0,0),i=0;i<a;++i)v[O+i]=v[w+i];for(var N=d.index(m,1,0),i=0;i<a;++i)v[N+i]=v[_+i];v[N+b]=Math.min(j,A),m+=1}}if(A<=j){var F=2*(x+1);if(F<r){h[m]=F;for(var O=d.index(m,0,0),i=0;i<a;++i)v[O+i]=v[w+i];for(var N=d.index(m,1,0),i=0;i<a;++i)v[N+i]=v[_+i];v[O+b]=Math.max(E,A),m+=1}}y+=1}return c.free(d),f.free(h),o}},v.rnn=function(e,t,n){if(!(t<0)){var r=this.length;if(!(r<1)){var a,i=this.dimension,o=this.points,l=this.ids,s=c.malloc([r,i]),u=f.mallocInt32(r),d=s.data,h=o.data,v=1,g=0,m=t*t;u[0]=0;for(var y=0;y<i;++y)s.set(0,y,0);for(;g<v;){for(var x=u[g],b=o.index(x,0),w=0,y=0;y<i;++y)w+=Math.pow(e[y]-h[b+y],2);if(w<=m&&(a=n(l[x]),void 0!==a))break;for(var _=p.log2(x+1)%i,k=0,z=s.index(g,0),y=0;y<i;++y)y!==_&&(k+=d[z+y]);var M=e[_],A=h[b+_],j=d[z+_],E=j,S=j;M<A?S=Math.max(j,Math.pow(A-M,2)):E=Math.max(j,Math.pow(A-M,2));var O=E+k,N=S+k;if(O<=m){var F=2*x+1;if(F<r){u[v]=F;for(var C=s.index(v,0),y=0;y<i;++y)d[C+y]=d[z+y];d[C+_]=E,v+=1}}if(N<=m){var T=2*(x+1);if(T<r){u[v]=T;for(var C=s.index(v,0),y=0;y<i;++y)d[C+y]=d[z+y];d[C+_]=S,v+=1}}g+=1}return c.free(s),f.free(u),a}}},v.nn=function(e,t){var n=this.length;if(n<1)return-1;if("number"==typeof t){if(t<0)return-1}else t=1/0;var r=this.dimension,a=this.points,i=a.data,o=f.mallocFloat64(r),l=new h(n,r+1),s=l.index,u=l.data;s[0]=0;for(var c=0;c<=r;++c)u[c]=0;l.count+=1;for(var d=-1,v=t;l.count>0&&!(u[0]>=v);){for(var g=s[0],m=a.index(g,0),y=0,c=0;c<r;++c)y+=Math.pow(e[c]-i[m+c],2);y<v&&(v=y,d=g);for(var x=p.log2(g+1)%r,b=0,c=0;c<r;++c){var w=u[c+1];c!==x&&(b+=w),o[c]=w}var _=e[x],k=i[m+x],z=o[x],M=z,A=z;_<k?A=Math.max(z,Math.pow(k-_,2)):M=Math.max(z,Math.pow(k-_,2));var j=M+b,E=A+b;if(l.pop(),j<v){var S=2*g+1;if(S<n){var O=l.count;s[O]=S;var N=O*(r+1);u[N]=j;for(var c=1;c<=r;++c)u[N+c]=o[c-1];u[N+x+1]=M,l.push()}}if(E<v){var F=2*(g+1);if(F<n){var O=l.count;s[O]=F;var N=O*(r+1);u[N]=E;for(var c=1;c<=r;++c)u[N+c]=o[c-1];u[N+x+1]=A,l.push()}}}return f.freeFloat64(o),l.dispose(),d<0?-1:this.ids[d]},v.knn=function(e,t,n){if("number"==typeof n){if(n<0)return[]}else n=1/0;var r=this.length;if(r<1)return[];if("number"==typeof t){if(t<=0)return[];t=0|Math.min(t,r)}else t=r;var a=this.ids,i=this.dimension,o=this.points,l=o.data,s=f.mallocFloat64(i),u=new h(t,1),c=u.index,d=u.data,v=new h(r,i+1),g=v.index,m=v.data;g[0]=0;for(var y=0;y<=i;++y)m[y]=0;v.count+=1;for(var x=n;v.count>0&&!(m[0]>=x);){for(var b=g[0],w=o.index(b,0),_=0,y=0;y<i;++y)_+=Math.pow(e[y]-l[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)%i,M=0,y=0;y<i;++y){var A=m[y+1];y!==z&&(M+=A),s[y]=A}var j=e[z],E=l[w+z],S=s[z],O=S,N=S;j<E?N=Math.max(S,Math.pow(E-j,2)):O=Math.max(S,Math.pow(E-j,2));var F=O+M,C=N+M;if(v.pop(),F<x){var T=2*b+1;if(T<r){var q=v.count;g[q]=T;var P=q*(i+1);m[P]=F;for(var y=1;y<=i;++y)m[P+y]=s[y-1];m[P+z+1]=O,v.push()}}if(C<x){var B=2*(b+1);if(B<r){var q=v.count;g[q]=B;var P=q*(i+1);m[P]=C;for(var y=1;y<=i;++y)m[P+y]=s[y-1];m[P+z+1]=N,v.push()}}}f.freeFloat64(s),v.dispose();for(var D=new Array(u.count),a=this.ids,y=u.count-1;y>=0;--y)D[y]=a[c[0]],u.pop();return u.dispose(),D},v.dispose=function(){f.free(this.points.data),f.freeInt32(this.ids),this.points=null,this.ids=null,this.length=0}},{"./lib/heap.js":11,"bit-twiddle":12,"inorder-tree-layout":13,ndarray:28,"ndarray-ops":15,"ndarray-pack":20,"ndarray-scratch":26,"ndarray-select":27,"typedarray-pool":32}],11:[function(e,t,n){"use strict";function r(e){return 1&e?e-1>>1:(e>>1)-1}function a(e,t){this.count=0,this.dataSize=t,this.index=i.mallocInt32(e),this.data=i.mallocFloat64(e*t)}t.exports=a;var i=e("typedarray-pool"),o=a.prototype;o.heapSwap=function(e,t){var n=this.data,r=this.index,a=this.dataSize,i=r[e];r[e]=r[t],r[t]=i;for(var o=a*e,l=a*t,s=0;s<a;++s){var u=n[o];n[o]=n[l],n[l]=u,o+=1,l+=1}},o.heapUp=function(e){for(var t=this.dataSize,n=(this.index,this.data),a=n[t*e];e>0;){var i=r(e);if(i>=0){var o=n[t*i];if(a<o){this.heapSwap(e,i),e=i;continue}}break}},o.heapDown=function(e){for(var t=this.dataSize,n=(this.index,this.data),r=this.count,a=n[t*e];;){var i=a,o=2*e+1,l=2*(e+1),s=e;if(o<r){var u=n[t*o];u<i&&(s=o,i=u)}if(l<r){var c=n[t*l];c<i&&(s=l)}if(s===e)break;this.heapSwap(e,s),e=s}},o.pop=function(){this.count-=1,this.heapSwap(0,this.count),this.heapDown(0)},o.push=function(){this.heapUp(this.count),this.count+=1},o.dispose=function(){i.freeInt32(this.index),i.freeFloat64(this.data)}},{"typedarray-pool":32}],12:[function(e,t,n){"use strict";"use restrict";function r(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;n.INT_BITS=a,n.INT_MAX=2147483647,n.INT_MIN=-1<<a-1,n.sign=function(e){return(e>0)-(e<0)},n.abs=function(e){var t=e>>a-1;return(e^t)-t},n.min=function(e,t){return t^(e^t)&-(e<t)},n.max=function(e,t){return e^(e^t)&-(e<t)},n.isPow2=function(e){return!(e&e-1||!e); | |
},n.log2=function(e){var t,n;return t=(e>65535)<<4,e>>>=t,n=(e>255)<<3,e>>>=n,t|=n,n=(e>15)<<2,e>>>=n,t|=n,n=(e>3)<<1,e>>>=n,t|=n,t|e>>1},n.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},n.popCount=function(e){return e-=e>>>1&1431655765,e=(858993459&e)+(e>>>2&858993459),16843009*(e+(e>>>4)&252645135)>>>24},n.countTrailingZeros=r,n.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},n.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e-(e>>>1)},n.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,e&=15,27030>>>e&1};var i=new Array(256);!function(e){for(var t=0;t<256;++t){var n=t,r=t,a=7;for(n>>>=1;n;n>>>=1)r<<=1,r|=1&n,--a;e[t]=r<<a&255}}(i),n.reverse=function(e){return i[255&e]<<24|i[e>>>8&255]<<16|i[e>>>16&255]<<8|i[e>>>24&255]},n.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},n.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},n.interleave3=function(e,t,n){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,n&=1023,n=4278190335&(n|n<<16),n=251719695&(n|n<<8),n=3272356035&(n|n<<4),n=1227133513&(n|n<<2),e|n<<2},n.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},n.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},{}],13:[function(e,t,n){"use strict";function r(e){var t=(v.nextPow2(e+1)>>>1)-1,n=e-t;return v.nextPow2(n)-1>=t?t:(t>>>1)+n}function a(e){return 0}function i(e){return e-1}function o(e,t){if(e<=0)return 0;var n=r(e);return t>n?o(e-n-1,t-n-1):t===n?v.log2(e):o(n,t)}function l(e,t){return Math.max(t-1,0)}function s(e,t){return Math.min(t+1,e-1)}function u(e,t){if(e<=0)return-1;var n=r(e);if(t>n){var a=u(e-n-1,t-n-1);return a<0?n:a+n+1}if(t===n)return-1;var a=u(n,t);return a<0?n:a}function c(e,t){if(e<=0)return 0;var n=r(e);return t>n?c(e-n-1,t-n-1)+n+1:t===n?r(t):c(n,t)}function f(e,t){if(e<=0)return 0;var n=r(e);return t>n?f(e-n-1,t-n-1)+n+1:t===n?r(e-n-1)+n+1:f(n,t)}function d(e,t){return 0===o(e,t)}function p(e,t){e|=0,t|=0;for(var n=0;e>1;){var a=r(e);if(t>a)n+=a+1,e-=a+1,t-=a+1;else{if(t===a)break;e=a}}return n}function h(e,t){e|=0,t|=0;for(var n=0;e>1;){var a=r(e);if(t>a)n+=a+1,e-=a+1,t-=a+1;else{if(t===a){n+=e-1;break}e=a}}return n}var v=e("bit-twiddle");n.root=r,n.begin=a,n.end=i,n.height=o,n.prev=l,n.next=s,n.parent=u,n.left=c,n.right=f,n.leaf=d,n.lo=p,n.hi=h},{"bit-twiddle":14}],14:[function(e,t,n){arguments[4][12][0].apply(n,arguments)},{dup:12}],15:[function(e,t,n){"use strict";function r(e){if(!e)return l;for(var t=0;t<e.args.length;++t){var n=e.args[t];0===t?e.args[t]={name:n,lvalue:!0,rvalue:!!e.rvalue,count:e.count||1}:e.args[t]={name:n,lvalue:!1,rvalue:!0,count:1}}return e.thisVars||(e.thisVars=[]),e.localVars||(e.localVars=[]),e}function a(e){return o({args:e.args,pre:r(e.pre),body:r(e.body),post:r(e.proc),funcName:e.funcName})}function i(e){for(var t=[],n=0;n<e.args.length;++n)t.push("a"+n);var r=new Function("P",["return function ",e.funcName,"_ndarrayops(",t.join(","),") {P(",t.join(","),");return a0}"].join(""));return r(a(e))}var o=e("cwise-compiler"),l={body:"",args:[],thisVars:[],localVars:[]},s={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};!function(){for(var e in s){var t=s[e];n[e]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+t+"c"},funcName:e}),n[e+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a"+t+"=b"},rvalue:!0,funcName:e+"eq"}),n[e+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+t+"s"},funcName:e+"s"}),n[e+"seq"]=i({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];n[e]=i({args:["array","array"],body:{args:["a","b"],body:"a="+t+"b"},funcName:e}),n[e+"eq"]=i({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];n[e]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+t+"c"},funcName:e}),n[e+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+t+"s"},funcName:e+"s"}),n[e+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a=a"+t+"b"},rvalue:!0,count:2,funcName:e+"eq"}),n[e+"seq"]=i({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];n[t]=i({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}),n[t+"eq"]=i({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];n[t]=i({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}),n[t+"s"]=i({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"}),n[t+"eq"]=i({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"}),n[t+"seq"]=i({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];n[t+"op"]=i({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"}),n[t+"ops"]=i({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"}),n[t+"opeq"]=i({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"}),n[t+"opseq"]=i({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"})}}(),n.any=o({args:["array"],pre:l,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"}),n.all=o({args:["array"],pre:l,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"}),n.sum=o({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"}),n.prod=o({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"}),n.norm2squared=o({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"}),n.norm2=o({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"}),n.norminf=o({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"}),n.norm1=o({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"}),n.sup=o({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:[]}}),n.inf=o({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:[]}}),n.argmin=o({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:[]}}),n.argmax=o({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:[]}}),n.random=i({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),n.assign=i({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),n.assigns=i({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),n.equals=o({args:["array","array"],pre:l,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":16}],16:[function(e,t,n){"use strict";function r(){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 r;t.pre=e.pre,t.body=e.body,t.post=e.post;var n=e.args.slice(0);t.argTypes=n;for(var a=0;a<n.length;++a){var o=n[a];if("array"===o||"object"==typeof o&&o.blockIndices){if(t.argTypes[a]="array",t.arrayArgs.push(a),t.arrayBlockIndices.push(o.blockIndices?o.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"===o)t.scalarArgs.push(a),t.shimArgs.push("scalar"+a);else if("index"===o){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"===o){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 o||!o.offset)throw new Error("cwise: Unknown argument type "+n[a]);t.argTypes[a]="offset",t.offsetArgs.push({array:o.array,offset:o.offset}),t.offsetArgIndex.push(a)}}if(t.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(t.pre.args.length>n.length)throw new Error("cwise: Too many arguments in pre() block");if(t.body.args.length>n.length)throw new Error("cwise: Too many arguments in body() block");if(t.post.args.length>n.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,i(t)}var i=e("./lib/thunk.js");t.exports=a},{"./lib/thunk.js":18}],17:[function(e,t,n){"use strict";function r(e,t,n){var r,a,i=e.length,o=t.arrayArgs.length,l=t.indexArgs.length>0,s=[],u=[],c=0,f=0;for(r=0;r<i;++r)u.push(["i",r,"=0"].join(""));for(a=0;a<o;++a)for(r=0;r<i;++r)f=c,c=e[r],0===r?u.push(["d",a,"s",r,"=t",a,"p",c].join("")):u.push(["d",a,"s",r,"=(t",a,"p",c,"-s",f,"*t",a,"p",f,")"].join(""));for(s.push("var "+u.join(",")),r=i-1;r>=0;--r)c=e[r],s.push(["for(i",r,"=0;i",r,"<s",c,";++i",r,"){"].join(""));for(s.push(n),r=0;r<i;++r){for(f=c,c=e[r],a=0;a<o;++a)s.push(["p",a,"+=d",a,"s",r].join(""));l&&(r>0&&s.push(["index[",f,"]-=s",f].join("")),s.push(["++index[",c,"]"].join(""))),s.push("}")}return s.join("\n")}function a(e,t,n,a){for(var i=t.length,o=n.arrayArgs.length,l=n.blockSize,s=n.indexArgs.length>0,u=[],c=0;c<o;++c)u.push(["var offset",c,"=p",c].join(""));for(var c=e;c<i;++c)u.push(["for(var j"+c+"=SS[",t[c],"]|0;j",c,">0;){"].join("")),u.push(["if(j",c,"<",l,"){"].join("")),u.push(["s",t[c],"=j",c].join("")),u.push(["j",c,"=0"].join("")),u.push(["}else{s",t[c],"=",l].join("")),u.push(["j",c,"-=",l,"}"].join("")),s&&u.push(["index[",t[c],"]=j",c].join(""));for(var c=0;c<o;++c){for(var f=["offset"+c],d=e;d<i;++d)f.push(["j",d,"*t",c,"p",t[d]].join(""));u.push(["p",c,"=(",f.join("+"),")"].join(""))}u.push(r(t,n,a));for(var c=e;c<i;++c)u.push("}");return u.join("\n")}function i(e){for(var t=0,n=e[0].length;t<n;){for(var r=1;r<e.length;++r)if(e[r][t]!==e[0][t])return t;++t}return t}function o(e,t,n){for(var r=e.body,a=[],i=[],o=0;o<e.args.length;++o){var l=e.args[o];if(!(l.count<=0)){var s=new RegExp(l.name,"g"),u="",c=t.arrayArgs.indexOf(o);switch(t.argTypes[o]){case"offset":var f=t.offsetArgIndex.indexOf(o),d=t.offsetArgs[f];c=d.array,u="+q"+f;case"array":u="p"+c+u;var p="l"+o,h="a"+c;if(0===t.arrayBlockIndices[c])1===l.count?"generic"===n[c]?l.lvalue?(a.push(["var ",p,"=",h,".get(",u,")"].join("")),r=r.replace(s,p),i.push([h,".set(",u,",",p,")"].join(""))):r=r.replace(s,[h,".get(",u,")"].join("")):r=r.replace(s,[h,"[",u,"]"].join("")):"generic"===n[c]?(a.push(["var ",p,"=",h,".get(",u,")"].join("")),r=r.replace(s,p),l.lvalue&&i.push([h,".set(",u,",",p,")"].join(""))):(a.push(["var ",p,"=",h,"[",u,"]"].join("")),r=r.replace(s,p),l.lvalue&&i.push([h,"[",u,"]=",p].join("")));else{for(var v=[l.name],g=[u],m=0;m<Math.abs(t.arrayBlockIndices[c]);m++)v.push("\\s*\\[([^\\]]+)\\]"),g.push("$"+(m+1)+"*t"+c+"b"+m);if(s=new RegExp(v.join(""),"g"),u=g.join("+"),"generic"===n[c])throw new Error("cwise: Generic arrays not supported in combination with blocks!");r=r.replace(s,[h,"[",u,"]"].join(""))}break;case"scalar":r=r.replace(s,"Y"+t.scalarArgs.indexOf(o));break;case"index":r=r.replace(s,"index");break;case"shape":r=r.replace(s,"shape")}}}return[a.join("\n"),r,i.join("\n")].join("\n").trim()}function l(e){for(var t=new Array(e.length),n=!0,r=0;r<e.length;++r){var a=e[r],i=a.match(/\d+/);i=i?i[0]:"",0===a.charAt(0)?t[r]="u"+a.charAt(1)+i:t[r]=a.charAt(0)+i,r>0&&(n=n&&t[r]===t[r-1])}return n?t[0]:t.join("")}function s(e,t){for(var n=t[1].length-Math.abs(e.arrayBlockIndices[0])|0,s=new Array(e.arrayArgs.length),c=new Array(e.arrayArgs.length),f=0;f<e.arrayArgs.length;++f)c[f]=t[2*f],s[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(n),d.push(n),p.push(n+e.arrayBlockIndices[f])):(h.push(e.arrayBlockIndices[f]),v.push(e.arrayBlockIndices[f]+n),d.push(0),p.push(e.arrayBlockIndices[f]));for(var m=[],y=0;y<s[f].length;y++)h[f]<=s[f][y]&&s[f][y]<v[f]&&m.push(s[f][y]-h[f]);g.push(m)}for(var x=["SS"],b=["'use strict'"],w=[],y=0;y<n;++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<n;++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(n),f=0;f<n;++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 M=u([].concat(e.pre.thisVars).concat(e.body.thisVars).concat(e.post.thisVars));w=w.concat(M),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(o(e.pre,e,c));var A=o(e.body,e,c),j=i(g);j<n?b.push(a(j,g[0],e,A)):b.push(r(g[0],e,A)),e.post.body.length>3&&b.push(o(e.post,e,c)),e.debug&&console.log("-----Generated cwise routine for ",t,":\n"+b.join("\n")+"\n----------");var E=[e.funcName||"unnamed","_cwise_loop_",s[0].join("s"),"m",j,l(c)].join(""),S=new Function(["function ",E,"(",x.join(","),"){",b.join("\n"),"} return ",E].join(""));return S()}var u=e("uniq");t.exports=s},{uniq:19}],18:[function(e,t,n){"use strict";function r(e){var t=["'use strict'","var CACHED={}"],n=[],r=e.funcName+"_cwise_thunk";t.push(["return function ",r,"(",e.shimArgs.join(","),"){"].join(""));for(var i=[],o=[],l=[["array",e.arrayArgs[0],".shape.slice(",Math.max(0,e.arrayBlockIndices[0]),e.arrayBlockIndices[0]<0?","+e.arrayBlockIndices[0]+")":")"].join("")],s=[],u=[],c=0;c<e.arrayArgs.length;++c){var f=e.arrayArgs[c];n.push(["t",f,"=array",f,".dtype,","r",f,"=array",f,".order"].join("")),i.push("t"+f),i.push("r"+f),o.push("t"+f),o.push("r"+f+".join()"),l.push("array"+f+".data"),l.push("array"+f+".stride"),l.push("array"+f+".offset|0"),c>0&&(s.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 (!("+s.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)l.push("scalar"+e.scalarArgs[c]);n.push(["type=[",o.join(","),"].join()"].join("")),n.push("proc=CACHED[type]"),t.push("var "+n.join(",")),t.push(["if(!proc){","CACHED[type]=proc=compile([",i.join(","),"])}","return proc(",l.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=r},{"./compile.js":17}],19:[function(e,t,n){"use strict";function r(e,t){for(var n=1,r=e.length,a=e[0],i=e[0],o=1;o<r;++o)if(i=a,a=e[o],t(a,i)){if(o===n){n++;continue}e[n++]=a}return e.length=n,e}function a(e){for(var t=1,n=e.length,r=e[0],a=e[0],i=1;i<n;++i,a=r)if(a=r,r=e[i],r!==a){if(i===t){t++;continue}e[t++]=r}return e.length=t,e}function i(e,t,n){return 0===e.length?e:t?(n||e.sort(t),r(e,t)):(n||e.sort(),a(e))}t.exports=i},{}],20:[function(e,t,n){"use strict";var r=e("ndarray"),a=e("./doConvert.js");t.exports=function(e,t){for(var n=[],i=e,o=1;i instanceof Array;)n.push(i.length),o*=i.length,i=i[0];return 0===n.length?r():(t||(t=r(new Float64Array(o),n)),a(t,e),t)}},{"./doConvert.js":21,ndarray:28}],21:[function(e,t,n){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":22}],22:[function(e,t,n){arguments[4][16][0].apply(n,arguments)},{"./lib/thunk.js":24,dup:16}],23:[function(e,t,n){arguments[4][17][0].apply(n,arguments)},{dup:17,uniq:25}],24:[function(e,t,n){arguments[4][18][0].apply(n,arguments)},{"./compile.js":23,dup:18}],25:[function(e,t,n){arguments[4][19][0].apply(n,arguments)},{dup:19}],26:[function(e,t,n){"use strict";function r(e){var t=e.dtype;"generic"!==t&&"array"!==t||(t="double");var n=f.malloc(e.size,t),r=u(n,e.shape);return c.assign(r,e),r}function a(e,t){t||(t="double");for(var n=1,r=new Array(e.length),a=e.length-1;a>=0;--a)r[a]=n,n*=e[a];return u(f.malloc(n,t),e,r,0)}function i(e){"generic"!==e.dtype&&"array"!==e.dtype&&f.free(e.data)}function o(e,t){t||(t="double");for(var n=1,r=new Array(e.length),a=e.length-1;a>=0;--a)r[a]=n,n*=e[a];for(var i=f.malloc(n,t),a=0;a<n;++a)i[a]=0;return u(i,e,r,0)}function l(e,t){t||(t="double");for(var n=1,r=new Array(e.length),a=e.length-1;a>=0;--a)r[a]=n,n*=e[a];for(var i=f.malloc(n,t),a=0;a<n;++a)i[a]=1;return u(i,e,r,0)}function s(e,t){var n,r;t||(t="double");var a=1,i=new Array(e.length);for(n=e.length-1;n>=0;--n)i[n]=a,a*=e[n];var o=f.malloc(a,t);for(n=0;n<a;++n)o[n]=0;var l=1/0,s=0;for(n=e.length-1;n>=0;n--)s+=i[n],l=Math.min(l,e[n]);for(n=0,r=0;n<l;n++,r+=s)o[r]=1;return u(o,e,i,0)}var u=e("ndarray"),c=e("ndarray-ops"),f=e("typedarray-pool");n.clone=r,n.malloc=a,n.free=i,n.zeros=o,n.ones=l,n.eye=s},{ndarray:28,"ndarray-ops":15,"typedarray-pool":32}],27:[function(e,t,n){"use strict";function r(e){return"s"+e}function a(e){return"t"+e}function i(e){return"u"+e}function o(e){return"v"+e}function l(e){return"i"+e}function s(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,n){function f(n,i,c){if(t)A.push(s(0),".offset=",y,"+",a(e[0]),"*(",i,");",s(1),".offset=",y,"+",a(e[0]),"*(",c,");",n,"=",g,"(",s(0),",",s(1),");");else{A.push(u(0),"=",y,"+",a(0),"*(",i,");",u(1),"=",y,"+",a(0),"*(",c,");"),p>1&&A.push("_cmp:");for(var f=p-1;f>0;--f)A.push("for(",l(f),"=0;",l(f),"<",r(f),";",l(f),"++){");z?A.push(n,"=",m,".get(",u(0),")-",m,".get(",u(1),");"):A.push(n,"=",m,"[",u(0),"]-",m,"[",u(1),"];"),p>1&&A.push("if(",n,")break _cmp;");for(var f=1;f<p;++f)A.push(u(0),"+=",o(f),";",u(1),"+=",o(f),"}")}}function d(t,n){A.push(u(0),"=",y,"+",a(e[0]),"*(",t,");",u(1),"=",y,"+",a(e[0]),"*(",n,");");for(var o=p-1;o>0;--o)A.push("for(",l(e[o]),"=0;",l(e[o]),"<",r(e[o]),";",l(e[o]),"++){");z?A.push(b,"=",m,".get(",u(0),");",m,".set(",u(0),",",m,".get(",u(1),"));",m,".set(",u(1),",",b,");"):A.push(b,"=",m,"[",u(0),"];",m,"[",u(0),"]=",m,"[",u(1),"];",m,"[",u(1),"]=",b,";");for(var o=1;o<p;++o)A.push(u(0),"+=",i(e[o]),";",u(1),"+=",i(e[o]),"}")}e=c(e);var p=e.length,z="generic"===n,M="ndSelect"+n+e.join("_")+"_"+(t?"cmp":"lex"),A=[],j=[h,v];t&&j.push(g);for(var E=[m+"="+h+".data",y+"="+h+".offset|0",x+"=Math.random",b],S=0;S<2;++S)E.push(u(S)+"=0");for(var S=0;S<p;++S)E.push(r(S)+"="+h+".shape["+S+"]|0",a(S)+"="+h+".stride["+S+"]|0",l(S)+"=0");for(var S=1;S<p;++S)S>1?E.push(o(S)+"=("+a(S)+"-"+r(S-1)+"*"+a(S-1)+")|0",i(e[S])+"=("+a(e[S])+"-"+r(e[S-1])+"*"+a(e[S-1])+")|0"):E.push(o(S)+"="+a(S),i(e[S])+"="+a(e[S]));if(t)for(var S=0;S<2;++S)E.push(s(S)+"="+h+".pick(0)");E.push(k+"=0",w+"=0",_+"="+r(e[0])+"-1"),A.push("while(",w,"<",_,"){",k,"=(",x,"()*(",_,"-",w,"+1)+",w,")|0;"),d(k,_),A.push(k,"=",w,";","for(",l(0),"=",w,";",l(0),"<",_,";",l(0),"++){"),f(b,l(0),_),A.push("if(",b,"<0){"),d(k,l(0)),A.push(k,"++;"),A.push("}}"),d(k,_),A.push("if(",k,"===",v,"){",w,"=",k,";","break;","}else if(",v,"<",k,"){",_,"=",k,"-1;","}else{",w,"=",k,"+1;","}","}"),t?A.push(s(0),".offset=",y,"+",w,"*",a(0),";","return ",s(0),";"):A.push("return ",h,".pick(",w,");");var O=["'use strict';function ",M,"(",j,"){","var ",E.join(),";",A.join(""),"};return ",M].join(""),N=new Function(O);return N()}function d(e,t,n){var r=e.join()+t+n,a=z[r];return a?a:z[r]=f(e,t,n)}function p(e,t,n){if(t|=0,0===e.dimension||e.shape[0]<=t||t<0)return null;var r=!!n,a=d(e.order,r,e.dtype);return r?a(e,t,n):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={}},{}],28:[function(e,t,n){function r(e,t){return e[0]-t[0]}function a(){var e,t=this.stride,n=new Array(t.length);for(e=0;e<n.length;++e)n[e]=[Math.abs(t[e]),e];n.sort(r);var a=new Array(n.length);for(e=0;e<a.length;++e)a[e]=n[e][1];return a}function i(e,t){var n=["View",t,"d",e].join("");t<0&&(n="View_Nil"+e);var r="generic"===e;if(t===-1){var i="function "+n+"(a){this.data=a;};var proto="+n+".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 "+n+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+n+"(a){return new "+n+"(a);}",o=new Function(i);return o()}if(0===t){var i="function "+n+"(a,d) {this.data = a;this.offset = d};var proto="+n+".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 "+n+"_copy() {return new "+n+"(this.data,this.offset)};proto.pick=function "+n+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+n+"_get(){return "+(r?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+n+"_set(v){return "+(r?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+n+"(a,b,c,d){return new "+n+"(a,d)}",o=new Function("TrivialArray",i);return o(f[e][0])}var i=["'use strict'"],l=s(t),u=l.map(function(e){return"i"+e}),c="this.offset+"+l.map(function(e){return"this.stride["+e+"]*i"+e}).join("+"),d=l.map(function(e){return"b"+e}).join(","),p=l.map(function(e){return"c"+e}).join(",");i.push("function "+n+"(a,"+d+","+p+",d){this.data=a","this.shape=["+d+"]","this.stride=["+p+"]","this.offset=d|0}","var proto="+n+".prototype","proto.dtype='"+e+"'","proto.dimension="+t),i.push("Object.defineProperty(proto,'size',{get:function "+n+"_size(){return "+l.map(function(e){return"this.shape["+e+"]"}).join("*"),"}})"),1===t?i.push("proto.order=[0]"):(i.push("Object.defineProperty(proto,'order',{get:"),t<4?(i.push("function "+n+"_order(){"),2===t?i.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===t&&i.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];}}})")):i.push("ORDER})")),i.push("proto.set=function "+n+"_set("+u.join(",")+",v){"),r?i.push("return this.data.set("+c+",v)}"):i.push("return this.data["+c+"]=v}"),i.push("proto.get=function "+n+"_get("+u.join(",")+"){"),r?i.push("return this.data.get("+c+")}"):i.push("return this.data["+c+"]}"),i.push("proto.index=function "+n+"_index(",u.join(),"){return "+c+"}"),i.push("proto.hi=function "+n+"_hi("+u.join(",")+"){return new "+n+"(this.data,"+l.map(function(e){return["(typeof i",e,"!=='number'||i",e,"<0)?this.shape[",e,"]:i",e,"|0"].join("")}).join(",")+","+l.map(function(e){return"this.stride["+e+"]"}).join(",")+",this.offset)}");var h=l.map(function(e){return"a"+e+"=this.shape["+e+"]"}),v=l.map(function(e){return"c"+e+"=this.stride["+e+"]"});i.push("proto.lo=function "+n+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+h.join(",")+","+v.join(","));for(var g=0;g<t;++g)i.push("if(typeof i"+g+"==='number'&&i"+g+">=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");i.push("return new "+n+"(this.data,"+l.map(function(e){return"a"+e}).join(",")+","+l.map(function(e){return"c"+e}).join(",")+",b)}"),i.push("proto.step=function "+n+"_step("+u.join(",")+"){var "+l.map(function(e){return"a"+e+"=this.shape["+e+"]"}).join(",")+","+l.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)i.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}");i.push("return new "+n+"(this.data,"+l.map(function(e){return"a"+e}).join(",")+","+l.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+"]";i.push("proto.transpose=function "+n+"_transpose("+u+"){"+u.map(function(e,t){return e+"=("+e+"===undefined?"+t+":"+e+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+n+"(this.data,"+m.join(",")+","+y.join(",")+",this.offset)}"),i.push("proto.pick=function "+n+"_pick("+u+"){var a=[],b=[],c=this.offset");for(var g=0;g<t;++g)i.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+"])}");i.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),i.push("return function construct_"+n+"(data,shape,stride,offset){return new "+n+"(data,"+l.map(function(e){return"shape["+e+"]"}).join(",")+","+l.map(function(e){ | |
return"stride["+e+"]"}).join(",")+",offset)}");var o=new Function("CTOR_LIST","ORDER",i.join("\n"));return o(f[e],a)}function o(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 l(e,t,n,r){if(void 0===e){var a=f.array[0];return a([])}"number"==typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var l=t.length;if(void 0===n){n=new Array(l);for(var s=l-1,u=1;s>=0;--s)n[s]=u,u*=t[s]}if(void 0===r){r=0;for(var s=0;s<l;++s)n[s]<0&&(r-=(t[s]-1)*n[s])}for(var c=o(e),d=f[c];d.length<=l+1;)d.push(i(c,d.length-1));var a=d[l+1];return a(e,t,n,r)}var s=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=l},{"iota-array":29,"is-buffer":30}],29:[function(e,t,n){"use strict";function r(e){for(var t=new Array(e),n=0;n<e;++n)t[n]=n;return t}t.exports=r},{}],30:[function(e,t,n){t.exports=function(e){return!(null==e||!(e._isBuffer||e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)))}},{}],31:[function(e,t,n){"use strict";function r(e,t,n){var a=0|e[n];if(a<=0)return[];var i,o=new Array(a);if(n===e.length-1)for(i=0;i<a;++i)o[i]=t;else for(i=0;i<a;++i)o[i]=r(e,t,n+1);return o}function a(e,t){var n,r;for(n=new Array(e),r=0;r<e;++r)n[r]=t;return n}function i(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 r(e,t,0)}return[]}t.exports=i},{}],32:[function(e,t,n){(function(t,r){"use strict";function a(e){if(e){var t=e.length||e.byteLength,n=y.log2(t);_[n].push(e)}}function i(e){a(e.buffer)}function o(e){var e=y.nextPow2(e),t=y.log2(e),n=_[t];return n.length>0?n.pop():new ArrayBuffer(e)}function l(e){return new Uint8Array(o(e),0,e)}function s(e){return new Uint16Array(o(2*e),0,e)}function u(e){return new Uint32Array(o(4*e),0,e)}function c(e){return new Int8Array(o(e),0,e)}function f(e){return new Int16Array(o(2*e),0,e)}function d(e){return new Int32Array(o(4*e),0,e)}function p(e){return new Float32Array(o(4*e),0,e)}function h(e){return new Float64Array(o(8*e),0,e)}function v(e){return b?new Uint8ClampedArray(o(e),0,e):l(e)}function g(e){return new DataView(o(e),0,e)}function m(e){e=y.nextPow2(e);var t=y.log2(e),n=k[t];return n.length>0?n.pop():new r(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;n.free=function(e){if(r.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,n=0|y.log2(t);_[n].push(e)}},n.freeUint8=n.freeUint16=n.freeUint32=n.freeInt8=n.freeInt16=n.freeInt32=n.freeFloat32=n.freeFloat=n.freeFloat64=n.freeDouble=n.freeUint8Clamped=n.freeDataView=i,n.freeArrayBuffer=a,n.freeBuffer=function(e){k[y.log2(e.length)].push(e)},n.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return o(e);switch(t){case"uint8":return l(e);case"uint16":return s(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},n.mallocArrayBuffer=o,n.mallocUint8=l,n.mallocUint16=s,n.mallocUint32=u,n.mallocInt8=c,n.mallocInt16=f,n.mallocInt32=d,n.mallocFloat32=n.mallocFloat=p,n.mallocFloat64=n.mallocDouble=h,n.mallocUint8Clamped=v,n.mallocDataView=g,n.mallocBuffer=m,n.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":12,buffer:2,dup:31}],33:[function(e,t,n){!function(e,r){"object"==typeof n&&"undefined"!=typeof t?r(n):"function"==typeof define&&define.amd?define(["exports"],r):r(e.topojson={})}(this,function(e){"use strict";function t(){}function n(e){if(!e)return t;var n,r,a=e.scale[0],i=e.scale[1],o=e.translate[0],l=e.translate[1];return function(e,t){t||(n=r=0),e[0]=(n+=e[0])*a+o,e[1]=(r+=e[1])*i+l}}function r(e){if(!e)return t;var n,r,a=e.scale[0],i=e.scale[1],o=e.translate[0],l=e.translate[1];return function(e,t){t||(n=r=0);var s=(e[0]-o)/a|0,u=(e[1]-l)/i|0;e[0]=s-n,e[1]=u-r,n=s,r=u}}function a(e,t){for(var n,r=e.length,a=r-t;a<--r;)n=e[a],e[a++]=e[r],e[r]=n}function i(e,t){for(var n=0,r=e.length;n<r;){var a=n+r>>>1;e[a]<t?n=a+1:r=a}return n}function o(e,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return l(e,t)})}:l(e,t)}function l(e,t){var n={type:"Feature",id:t.id,properties:t.properties||{},geometry:s(e,t)};return null==t.id&&delete n.id,n}function s(e,t){function r(e,t){t.length&&t.pop();for(var n,r=f[e<0?~e:e],i=0,o=r.length;i<o;++i)t.push(n=r[i].slice()),c(n,i);e<0&&a(t,o)}function i(e){return e=e.slice(),c(e,0),e}function o(e){for(var t=[],n=0,a=e.length;n<a;++n)r(e[n],t);return t.length<2&&t.push(t[0].slice()),t}function l(e){for(var t=o(e);t.length<4;)t.push(t[0].slice());return t}function s(e){return e.map(l)}function u(e){var t=e.type;return"GeometryCollection"===t?{type:t,geometries:e.geometries.map(u)}:t in d?{type:t,coordinates:d[t](e)}:null}var c=n(e.transform),f=e.arcs,d={Point:function(e){return i(e.coordinates)},MultiPoint:function(e){return e.coordinates.map(i)},LineString:function(e){return o(e.arcs)},MultiLineString:function(e){return e.arcs.map(o)},Polygon:function(e){return s(e.arcs)},MultiPolygon:function(e){return e.arcs.map(s)}};return u(t)}function u(e,t){function n(t){var n,r=e.arcs[t<0?~t:t],a=r[0];return e.transform?(n=[0,0],r.forEach(function(e){n[0]+=e[0],n[1]+=e[1]})):n=r[r.length-1],t<0?[n,a]:[a,n]}function r(e,t){for(var n in e){var r=e[n];delete t[r.start],delete r.start,delete r.end,r.forEach(function(e){a[e<0?~e:e]=1}),l.push(r)}}var a={},i={},o={},l=[],s=-1;return t.forEach(function(n,r){var a,i=e.arcs[n<0?~n:n];i.length<3&&!i[1][0]&&!i[1][1]&&(a=t[++s],t[s]=n,t[r]=a)}),t.forEach(function(e){var t,r,a=n(e),l=a[0],s=a[1];if(t=o[l])if(delete o[t.end],t.push(e),t.end=s,r=i[s]){delete i[r.start];var u=r===t?t:t.concat(r);i[u.start=t.start]=o[u.end=r.end]=u}else i[t.start]=o[t.end]=t;else if(t=i[s])if(delete i[t.start],t.unshift(e),t.start=l,r=o[l]){delete o[r.end];var c=r===t?t:r.concat(t);i[c.start=r.start]=o[c.end=t.end]=c}else i[t.start]=o[t.end]=t;else t=[e],i[t.start=l]=o[t.end=s]=t}),r(o,i),r(i,o),t.forEach(function(e){a[e<0?~e:e]||l.push([e])}),l}function c(e){return s(e,f.apply(this,arguments))}function f(e,t,n){function r(e){var t=e<0?~e:e;(c[t]||(c[t]=[])).push({i:e,g:s})}function a(e){e.forEach(r)}function i(e){e.forEach(a)}function o(e){"GeometryCollection"===e.type?e.geometries.forEach(o):e.type in f&&(s=e,f[e.type](e.arcs))}var l=[];if(arguments.length>1){var s,c=[],f={LineString:a,MultiLineString:i,Polygon:i,MultiPolygon:function(e){e.forEach(i)}};o(t),c.forEach(arguments.length<3?function(e){l.push(e[0].i)}:function(e){n(e[0].g,e[e.length-1].g)&&l.push(e[0].i)})}else for(var d=0,p=e.arcs.length;d<p;++d)l.push(d);return{type:"MultiLineString",arcs:u(e,l)}}function d(e){var t=e[0],n=e[1],r=e[2];return Math.abs((t[0]-r[0])*(n[1]-t[1])-(t[0]-n[0])*(r[1]-t[1]))}function p(e){for(var t,n=-1,r=e.length,a=e[r-1],i=0;++n<r;)t=a,a=e[n],i+=t[0]*a[1]-t[1]*a[0];return i/2}function h(e){return s(e,v.apply(this,arguments))}function v(e,t){function n(e){e.forEach(function(t){t.forEach(function(t){(a[t=t<0?~t:t]||(a[t]=[])).push(e)})}),i.push(e)}function r(t){return p(s(e,{type:"Polygon",arcs:[t]}).coordinates[0])>0}var a={},i=[],o=[];return t.forEach(function(e){"Polygon"===e.type?n(e.arcs):"MultiPolygon"===e.type&&e.arcs.forEach(n)}),i.forEach(function(e){if(!e._){var t=[],n=[e];for(e._=1,o.push(t);e=n.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){a[e<0?~e:e].forEach(function(e){e._||(e._=1,n.push(e))})})})}}),i.forEach(function(e){delete e._}),{type:"MultiPolygon",arcs:o.map(function(t){var n,i=[];if(t.forEach(function(e){e.forEach(function(e){e.forEach(function(e){a[e<0?~e:e].length<2&&i.push(e)})})}),i=u(e,i),(n=i.length)>1)for(var o,l=r(t[0][0]),s=0;s<n;++s)if(l===r(i[s])){o=i[0],i[0]=i[s],i[s]=o;break}return i})}}function g(e){function t(e,t){e.forEach(function(e){e<0&&(e=~e);var n=a[e];n?n.push(t):a[e]=[t]})}function n(e,n){e.forEach(function(e){t(e,n)})}function r(e,t){"GeometryCollection"===e.type?e.geometries.forEach(function(e){r(e,t)}):e.type in l&&l[e.type](e.arcs,t)}var a={},o=e.map(function(){return[]}),l={LineString:t,MultiLineString:n,Polygon:n,MultiPolygon:function(e,t){e.forEach(function(e){n(e,t)})}};e.forEach(r);for(var s in a)for(var u=a[s],c=u.length,f=0;f<c;++f)for(var d=f+1;d<c;++d){var p,h=u[f],v=u[d];(p=o[h])[s=i(p,v)]!==v&&p.splice(s,0,v),(p=o[v])[s=i(p,h)]!==h&&p.splice(s,0,h)}return o}function m(e,t){return e[1][2]-t[1][2]}function y(){function e(e,t){for(;t>0;){var n=(t+1>>1)-1,a=r[n];if(m(e,a)>=0)break;r[a._=t]=a,r[e._=t=n]=e}}function t(e,t){for(;;){var n=t+1<<1,i=n-1,o=t,l=r[o];if(i<a&&m(r[i],l)<0&&(l=r[o=i]),n<a&&m(r[n],l)<0&&(l=r[o=n]),o===t)break;r[l._=t]=l,r[e._=t=o]=e}}var n={},r=[],a=0;return n.push=function(t){return e(r[t._=a]=t,a++),a},n.pop=function(){if(!(a<=0)){var e,n=r[0];return--a>0&&(e=r[a],t(r[e._=0]=e,0)),n}},n.remove=function(n){var i,o=n._;if(r[o]===n)return o!==--a&&(i=r[a],(m(i,n)<0?e:t)(r[i._=o]=i,o)),o},n}function x(e,t){function a(e){l.remove(e),e[1][2]=t(e),l.push(e)}var i=n(e.transform),o=r(e.transform),l=y();return t||(t=d),e.arcs.forEach(function(e){var n,r,s,u,c=[],f=0;for(r=0,s=e.length;r<s;++r)u=e[r],i(e[r]=[u[0],u[1],1/0],r);for(r=1,s=e.length-1;r<s;++r)n=e.slice(r-1,r+2),n[1][2]=t(n),c.push(n),l.push(n);for(r=0,s=c.length;r<s;++r)n=c[r],n.previous=c[r-1],n.next=c[r+1];for(;n=l.pop();){var d=n.previous,p=n.next;n[1][2]<f?n[1][2]=f:f=n[1][2],d&&(d.next=p,d[2]=n[2],a(d)),p&&(p.previous=d,p[0]=n[0],a(p))}e.forEach(o)}),e}var b="1.6.24";e.version=b,e.mesh=c,e.meshArcs=f,e.merge=h,e.mergeArcs=v,e.feature=o,e.neighbors=g,e.presimplify=x})},{}],34:[function(e,t,n){var r;r=e("../color/sort.coffee"),t.exports=function(e,t,n,a,i,o,l){var s,u,c;for(a||(a="asc"),i instanceof Array||(i=[i]),n instanceof Array||(n=[n]),o&&void 0!==l&&"number"!=typeof l&&(l=o.id.nesting.indexOf(l)),c=0,s=0;s<n.length&&(u=n[s],e=o&&e.d3plus&&e.d3plus.sortKeys?e.d3plus.sortKeys[u]:e[u],t=o&&t.d3plus&&t.d3plus.sortKeys?t.d3plus.sortKeys[u]:t[u],c=o&&i.indexOf(u)>=0?r(e,t):e<t?-1:1,0===c&&s!==n.length-1);)s++;return"asc"===a?c:-c}},{"../color/sort.coffee":51}],35:[function(e,t,n){t.exports=function(e,t){var n;return e instanceof Array&&(n=void 0===t||null===t?t:t.constructor,e.indexOf(t)>=0||e.indexOf(n)>=0)}},{}],36:[function(e,t,n){var r,a;r=e("./comparator.coffee"),a=e("../core/fetch/sort.coffee"),t.exports=function(e,t,n,i,o,l){var s,u,c,f;if(!e||e.length<=1)return e||[];if(o)for(t||(t=o.order.value||o.size.value||o.id.value),n||(n=o.order.sort.value),i||(i=o.color.value||[]),c=0,f=e.length;c<f;c++)s=e[c],s.d3plus||(s.d3plus={}),u="d3plus"in s&&"d3plus"in s.d3plus?s.d3plus:s,s.d3plus.sortKeys=a(o,u,t,i,l);return e.sort(function(e,a){return r(e,a,t,n,i,o,l)})}},{"../core/fetch/sort.coffee":67,"./comparator.coffee":34}],37:[function(e,t,n){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)}},{}],38:[function(e,t,n){var r;r=function(e){var t,n,a,i;if(i=r.tested,e in i)return i[e];for(n=0,a=!1;n<document.styleSheets.length;){if(t=document.styleSheets[n],t.href&&t.href.indexOf(e)>=0){a=!0;break}n++}return a},r.tested={},t.exports=r},{}],39:[function(e,t,n){t.exports=/(MSIE|Trident\/|Edge\/)/i.test(navigator.userAgent)},{}],40:[function(e,t,n){var r,a;r=e("./ie.js"),a=e("./touch.coffee"),a?t.exports={click:"click",down:"touchstart",up:"touchend",over:r?"mouseenter":"mouseover",out:r?"mouseleave":"mouseout",move:"mousemove"}:t.exports={click:"click",down:"mousedown",up:"mouseup",over:r?"mouseenter":"mouseover",out:r?"mouseleave":"mouseout",move:"mousemove"}},{"./ie.js":39,"./touch.coffee":45}],41:[function(e,t,n){var r;r=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-":"",r=function(){return e},e},t.exports=r},{}],42:[function(e,t,n){t.exports="rtl"===d3.select("html").attr("dir")},{}],43:[function(e,t,n){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}}},{}],44:[function(e,t,n){var r;r=function(){var e,t,n,a,i;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",i=e.offsetWidth,a===i&&(i=t.clientWidth),document.body.removeChild(t),n=a-i,r=function(){return n},n},t.exports=r},{}],45:[function(e,t,n){t.exports=!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)},{}],46:[function(e,t,n){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()}},{}],47:[function(e,t,n){t.exports=function(e,t){var n;return void 0===t&&(t=.5),n=d3.hsl(e),t=(1-n.l)*t,n.l+=t,n.s-=t,n.toString()}},{}],48:[function(e,t,n){t.exports=function(e,t,n,r){var a,i,o;return n||(n=1),r||(r=1),e=d3.rgb(e),t=d3.rgb(t),o=(n*e.r+r*t.r-n*r*t.r)/(n+r-n*r),i=(n*e.g+r*t.g-n*r*t.g)/(n+r-n*r),a=(n*e.b+r*t.b-n*r*t.b)/(n+r-n*r),d3.rgb(o,i,a).toString()}},{}],49:[function(e,t,n){var r;r=e("./scale.coffee"),t.exports=function(e,t){var n;return n=e||Math.floor(20*Math.random()),(t=t||r)(n)}},{"./scale.coffee":50}],50:[function(e,t,n){t.exports=d3.scale.ordinal().range(["#b22200","#282F6B","#EACE3F","#B35C1E","#224F20","#5F487C","#759143","#419391","#993F88","#e89c89","#ffee8d","#afd5e8","#f7ba77","#a5c697","#c5b5e5","#d1d392","#bbefd0","#e099cf"])},{}],51:[function(e,t,n){t.exports=function(e,t){var n,r;return n=d3.hsl(e),r=d3.hsl(t),e=0===n.s?361:n.h,t=0===r.s?361:r.h,e===t?n.l-r.l:e-t}},{}],52:[function(e,t,n){t.exports=function(e){var t,n,r,a,i;return a=d3.rgb(e),r=a.r,n=a.g,t=a.b,i=(299*r+587*n+114*t)/1e3,i>=128?"#444444":"#f7f7f7"}},{}],53:[function(e,t,n){t.exports=function(e){var t,n,r;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]),n=d3.rgb(e).toString(),t=["black","#000","#000000","0%","0,0,0"],r=t.indexOf(e)>=0,"#000000"!==n||r}},{}],54:[function(e,t,n){var r,a,i;r=e("../../client/ie.js"),i=e("./wiki.coffee"),a=function(e,t,n){n=n||"",r||"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;"+n):console[e]("%c"+t,n+"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(){r||console.groupEnd()},a.log=function(e){this("log",e,"color:#444444;")},a.stack=function(){var e,t,n,a,i,o,l;r||(e=new Error,e.stack&&(o=e.stack.split("\n"),o=o.filter(function(e){return 0!==e.indexOf("Error")&&e.indexOf("d3plus.js:")<0&&e.indexOf("d3plus.min.js:")<0}),o.length&&o[0].length&&(i=window.chrome?"at ":"@",l=o[0],l.indexOf(i)>=0&&(l=l.split(i)[1]),o=l.split(":"),3===o.length&&o.pop(),t=o.pop(),a=o.join(":").split("/"),a=a[a.length-1],n="line "+t+" of "+a+": "+l,this("log",n,"color:#D74B03;"))))},a.time=function(e){r||console.time(e)},a.timeEnd=function(e){r||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 i&&(e=d3plus.repo+"wiki/"+i[e]),this("log","documentation: "+e,"color:#aaa;"))},t.exports=a},{"../../client/ie.js":39,"./wiki.coffee":55}],55:[function(e,t,n){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"}},{}],56:[function(e,t,n){var r=e("../../util/buckets.coffee"),a=e("../fetch/value.coffee"),i=e("../console/print.coffee");t.exports=function(e){if(e.dev.value&&i.time("getting color data range"),e.color.domain.value)var t=e.color.domain.value;else{var t=[];e.data.pool.forEach(function(n){var r=parseFloat(a(e,n,e.color.value));"number"==typeof r&&!isNaN(r)&&t.indexOf(r)<0&&t.push(r)})}if(e.dev.value&&i.timeEnd("getting color data range"),t.length>1){if(e.dev.value&&i.time("calculating color scale"),t=d3.extent(t),t[0]<0&&t[1]>0){var n=e.color.range;3==n.length&&(t.push(t[1]),t[1]=0)}else if(t[1]>0&&t[0]>=0){var n=e.color.heatmap;t=r(t,n.length)}else{var n=e.color.range.slice(0);t[0]<0?n.pop():n.shift()}e.color.valueScale=d3.scale.sqrt().domain(t).range(n).interpolate(d3.interpolateRgb),e.dev.value&&i.timeEnd("calculating color scale")}else e.color.valueScale=null}},{"../../util/buckets.coffee":207,"../console/print.coffee":54,"../fetch/value.coffee":69}],57:[function(e,t,n){var r=e("../fetch/value.coffee"),a=e("../console/print.coffee"),i=e("../../object/validate.coffee");t.exports=function(e,t){e.dev.value&&a.time("filtering data");var n=d3.keys(e.data.keys||{});"attrs"in e&&(n=n.concat(d3.keys(e.attrs.keys||{}))),t=t.filter(function(t){var n=r(e,t,e.id.value);return null!==n});var o=e.types[e.type.value].requirements||[];e.data.filters.forEach(function(a){n.indexOf(e[a].value)>=0&&o.indexOf(a)>=0&&(t=t.filter(function(t){var n=r(e,t,e[a].value);return"y"===a&&e.y2.value&&null===n?n=r(e,t,e.y2.value):"x"===a&&e.x2.value&&null===n&&(n=r(e,t,e.x2.value)),"size"===a?"number"==typeof n:null!==n}))});var l=e.data.solo.length?"solo":"mute";return e.data[l].length?e.data[l].forEach(function(n){function o(t){var r=e[n][l].value,a=!1;return r.forEach(function(e){"function"==typeof e?a=e(t):e===t&&(a=!0)}),"solo"===l?a:!a}function s(t,a){if(!a&&e[n].nesting){var l=e[n].nesting;i(l)&&(l=d3.values(l));for(var s=0;s<l.length;s++){var u=t.filter(function(t){return o(r(e,t,l[s]))});u.length&&(t=u)}}else t=t.filter(function(t){return o(r(e,t,e[n].value))});return t}t=s(t),"id"===n&&("nodes"in e&&e.nodes.value&&(e.dev.value&&a.time("filtering nodes"),e.nodes.restricted=s(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 n=s([t[e.edges.source],t[e.edges.target]]);return 2===n.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":175,"../console/print.coffee":54,"../fetch/value.coffee":69}],58:[function(e,t,n){var r=e("./nest.js"),a=e("../fetch/value.coffee"),i=e("../console/print.coffee"),o=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",i.time(t)),e.data.time.values=o(e.data.value,e.time.value,a,e),e.data.time.values.sort(function(e,t){return e-t});var n=[];e.data.time.values.forEach(function(t,r){if(0!==r){var a=e.data.time.values[r-1];n.push(t-a),r===e.data.time.values.length-1&&(e.data.time.total=t-e.data.time.values[0])}}),n=d3.min(n),e.data.time.step=n;var l=["Milliseconds","Seconds","Minutes","Hours","Date","Month","FullYear"],s=[1e3,60,60,24,30,12,1];e.data.time.periods=l;var u=function(t,n,r){return e.data.time.stepDivider||(arr=s.slice(0,r),arr.length?e.data.time.stepDivider=arr.reduce(function(e,t){return e*t}):e.data.time.stepDivider=1),Math.round(Math.floor(n-t)/e.data.time.stepDivider)},c=e.data.time.total;l.forEach(function(t,r){var a="Date"===t?28:s[r];if(!e.data.time.stepType&&(r===l.length-1||Math.round(n)<a)){e.data.time.stepType=t;var i=e.data.time.values[0],o=e.data.time.values[e.data.time.values.length-1];e.data.time.stepIntervals=u(i,o,r)}!e.data.time.totalType&&(r===l.length-1||Math.round(c)<a)&&(e.data.time.totalType=t),n/=a,c/=a}),e.data.time.values.forEach(function(t,n){if(0!==n){var r=e.data.time.values[0];e.data.time.dataSteps.push(u(r,t,l.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,n){if(e===t)return n&&d.timeFormat[e+"Small"]?d.timeFormat[e+"Small"]:d.timeFormat[e];if(l.indexOf(e)>=4||l.indexOf(t)<=3)return d.timeFormat[t+"-"+e];var r;return r="Date"===t?d.timeFormat[t]:d.timeFormat[t+"-Date"],"Hours"===e?r+" "+d.timeFormat[e]:r+" "+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=l.indexOf(v);y<=l.indexOf(g);y++){var x=y-1<l.indexOf(v)?l[y]:l[y-1],b=l[y]===x&&v!==g,w=h(x,l[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 M=new Date(_);M["set"+e.data.time.stepType](M["get"+e.data.time.stepType]()+z),M<=k&&e.data.time.ticks.push(M)}e.dev.value&&i.timeEnd(t)}if(e.dev.value&&(t="nesting data by time and depths",i.time(t)),e.data.nested={},0===e.data.time.values.length)e.data.nested.all={},e.id.nesting.forEach(function(t,n){var a=e.id.nesting.slice(0,n+1);e.data.nested.all[t]=r(e,e.data.value,a)});else{var A=e.data.value.reduce(function(t,n){var r=a(e,n,e.time.value).getTime();return r in t||(t[r]=[]),t[r].push(n),t},{});e.data.time.values.forEach(function(t){var n=t.getTime();e.data.nested[n]={},e.id.nesting.forEach(function(t,a){var i=e.id.nesting.slice(0,a+1);e.data.nested[n][t]=r(e,A[n],i)})})}e.dev.value&&i.timeEnd(t)}},{"../../util/uniques.coffee":213,"../console/print.coffee":54,"../fetch/value.coffee":69,"./nest.js":62}],59:[function(e,t,n){var r;r=e("../fetch/value.coffee"),t.exports=function(e,t,n){var a,i,o,l,s,u,c,f,d,p;if(i=d3.nest(),e.id.grouping.value)for(void 0===n&&(n=e.id.nesting),o=l=0,u=n.length;l<u;o=++l)f=n[o],o<e.depth.value&&!function(t){return i.key(function(n){return r(e,n.d3plus,t)})}(f);for(d=[],s=0,c=t.length;s<c;s++)a=t[s],p=e.size.value?r(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 i.entries(d)}},{"../fetch/value.coffee":69}],60:[function(e,t,n){var r,a,i=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1};r=e("../console/print.coffee"),a=e("../../object/validate.coffee"),t.exports=function(e,t){var n,o,l,s,u,c,f,d,p;if(f=t+" key analysis",e.dev.value&&r.time(f),e[t].keys={},n=function(r){var o,l,s,u,c,f,d;if(r instanceof Array){for(c=[],l=0,u=r.length;l<u;l++)o=r[l],c.push(n(o));return c}if(a(r)){f=[];for(s in r)d=r[s],0===s.indexOf("d3plus")||i.call(e[t].keys,s)>=0||null===d?f.push(void 0):f.push(e[t].keys[s]=typeof d);return f}},a(e[t].value)){s=d3.keys(e[t].value).length===e.id.nesting.length,u=e[t].value;for(o in u)if(d=u[o],s&&e.id.nesting.indexOf(o)>=0&&a(d))for(l in d)p=d[l],n(p);else n(d)}else{c=e[t].value;for(o in c)d=c[o],n(d)}if(e.dev.value)return r.time(f)}},{"../../object/validate.coffee":175,"../console/print.coffee":54}],61:[function(e,t,n){var r,a;r=e("../console/print.coffee"),a=e("../../object/validate.coffee"),t.exports=function(e,t,n){var i,o,l,s;return i=e.dev.value,i&&r.time("loading "+t),s=e[t].url,e[t].filetype.value?o=e[t].filetype.value:(o=s.slice(s.length-5).split("."),o=o.length>1&&o[1],o?("txt"===o&&(o="text"),e[t].filetype.accepted.indexOf(o)<0&&(o="json")):o="json"),(l="dsv"===o?d3.dsv(e[t].delimiter.value,"text/plain"):d3[o])(s,function(l,u){var c,f;if(!l&&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(o)<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: "'+s+'"';return i&&r.timeEnd("loading "+t),n()})}},{"../../object/validate.coffee":175,"../console/print.coffee":54}],62:[function(e,t,n){var r=e("../fetch/value.coffee"),a=e("../../object/validate.coffee"),i=e("../../util/uniques.coffee"),o=function(e,t,n,a){void 0===a&&(a=!0);var o=d3.nest(),c=[],f="temp"in e?["active","temp","total"]:[];n.length?n.forEach(function(t,n){o.key(function(n){return r(e,n,t)})}):o.key(function(e){return!0}),a&&e.axes&&e.axes.discrete&&(!e.time||e[e.axes.discrete].value!==e.time.value)&&o.key(function(t){return r(e,t,e[e.axes.discrete].value)});var d=n.length&&e.id.nesting.indexOf(n[n.length-1])>=0,p=n.length&&d?n.length-1:0;d?e.id.nesting[p]:e.depth.value;o.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}},o=d3.sum(t,function(e){return"d3plus"in e&&e.d3plus.merged?1:0});if(o===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 n="total"===v?1:0;return e[v].value&&(n=r(e,t,e[v].value),"number"!=typeof n&&(n=n?1:0)),n})}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]=s(i(t,m));else if(e.axes&&e.axes.discrete&&e[e.axes.discrete].value===m)a[m]=i(t,m);else if("number"!==b||"string"!==x||w){var k=l(t,m),z=1===k.length?k[0][m]:i(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 M=e.id.nesting.indexOf(m)-1;M>=p&&(!("endPoint"in a.d3plus)||a.d3plus.endPoint>p)&&(a.d3plus.endPoint=p)}}else{var A=t.map(function(e){return e[m]});A=A.filter(function(e){return typeof e===b}),A.length&&(a[m]=d3[y](A))}}m in a&&a[m]instanceof Array&&1===a[m].length&&(a[m]=a[m][0])}for(var j=0;j<n.length;j++){var E=n[j];E in a||(a[E]=r(e,t[0],E))}return c.push(a),a});var h=function(t,r,a){if(t.children){"number"==e.data.keys[n[r]]&&(t.key=parseFloat(t.key)),a[n[r]]=t.key,delete t.key;for(var i in a)t[i]=a[i];r++,t.children.forEach(function(e){h(e,r,a)})}};return o=o.entries(t).map(u).map(function(e){return h(e,0,{}),e}),c},l=function(e,t){function n(e){e instanceof Array?e.forEach(n):a(e)&&t in e&&(e[t]instanceof Array?e[t].forEach(n):r.push(e))}var r=[];return n(e),r},s=function(e){function t(e){for(var r=0;r<e.length;r++){var a=e[r];a&&(a.constructor===Array?t(a):n.push(a))}}var n=[];return t(e),i(n)},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=o},{"../../object/validate.coffee":175,"../../util/uniques.coffee":213,"../fetch/value.coffee":69}],63:[function(e,t,n){var r=e("../../array/sort.coffee"),a=e("./nest.js"),i=e("../fetch/value.coffee"),o=(e("../fetch/color.coffee"),e("../fetch/text.js"));t.exports=function(e,t,n){var l;if(l=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 l&&l>0){var s=[],u=0===e.depth.value?0:{},c=[],f=[],d=[],p={},h=d3.nest();n&&h.key(function(t){return i(e,t,n)}),h.rollup(function(t){var r=t.length; | |
e.aggs.value[e.size.value]?"function"==typeof e.aggs.value[e.size.value]?r=e.aggs.value[e.size.value](t):"string"==typeof e.aggs.value[e.size.value]&&(r=d3[e.aggs.value[e.size.value]](t,function(t){return i(e,t,e.size.value)})):r=d3.sum(t,function(t){return i(e,t,e.size.value)});var a=n?i(e,t[0],n):"all";return p[a]=r,r}).entries(t),t.forEach(function(t){var r=i(e,t,e.id.value),a=i(e,t,e.size.value),o=n?i(e,t,n):"all",u=a/p[o]>=l;if(u&&s.indexOf(r)<0&&(s.push(r),e.depth.value)){var c=i(e,t,e.id.nesting[e.depth.value-1]);f.indexOf(c)<0&&f.push(c)}});var v=t.filter(function(t){var n=i(e,t,e.id.value),r=s.indexOf(n)>=0,a=e.depth.value?i(e,t,e.id.nesting[e.depth.value-1]):null;if(null!==a&&f.indexOf(a)<0&&d.indexOf(a)<0&&d.push(a),!r){var o=i(e,t,e.size.value);o>0&&(0===e.depth.value?o>u&&(u=o):(a in u||(u[a]=0),o>u[a]&&(u[a]=o)),c.push(t))}return r});if(c.length>1){c=r(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 n=e.id.nesting[e.depth.value-1],r=i(e,t,n);if(children=n?c.filter(function(t){return i(e,t,n)===r}):c,children.length>1){e.id.nesting.forEach(function(n,r){if(e.depth.value==r){var a=t[n];"string"==typeof a?t[n]="d3plus_other_"+a:t[n]="d3plus_other"}else r>e.depth.value&&delete t[n]}),e.color.value&&"string"===e.color.type&&(0===e.depth.value?t[e.color.value]=e.color.missing:t[e.color.value]=i(e,r,e.color.value,n)),e.icon.value&&(t[e.icon.value]=i(e,r,e.icon.value,n)),r&&(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=o(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(r)<0&&(a+=" < "+e.format.value(u[r],{key:e.size.value,vars:e}))),d.indexOf(r)<0&&(a+=" ("+e.format.value(100*l,{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":36,"../fetch/color.coffee":65,"../fetch/text.js":68,"../fetch/value.coffee":69,"./nest.js":62}],64:[function(e,t,n){var r;r=e("../../font/sizes.coffee"),t.exports=function(e,t){var n,a,i,o,l,s,u,c,f,d,p,h,v,g,m,y,x,b;if(b=t.values||e.data.time.ticks,g=t.style||{},l=t.limit||e.width.value,m={},c=e.data.time.periods,v=e.data.time.stepType,y=e.data.time.totalType,i=e.data.time.functions,o=e.data.time.getFormat,s=e.format.locale.value.format,e.time.format.value)m.format=e.data.time.format,m.values=b,m.sizes=r(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,n;if(u===c.indexOf(v))return!0;if(t=!0,n=u-1,u<0)return!0;for(;n>=c.indexOf(v)&&t;)t=!i[n](e),n--;return t}),c[u]===y)a=d3.locale(s).timeFormat(o(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,n=o(d,c[f],h),a.push([n,i[f]]),f++;a[a.length-1][1]=function(){return!0},a=d3.locale(s).timeFormat.multi(a)}if(p=r(x.map(function(e){return a(e)}),g),d3.sum(p,function(e){return e.width})<l||u===c.indexOf(y)){m.format=a,m.values=x,m.sizes=p;break}u++}return m}},{"../../font/sizes.coffee":104}],65:[function(e,t,n){var r,a,i,o,l,s,u;r=e("./value.coffee"),o=e("../../color/random.coffee"),s=e("../../color/validate.coffee"),u=e("../../object/validate.coffee"),l=e("../../util/uniques.coffee"),t.exports=function(e,t,n){var o,s,c,f,d,p;if(d=u(t),d&&"d3plus"in t&&"color"in t.d3plus)return t.d3plus.color;if(void 0===n&&(n=e.id.value),"number"==typeof n&&(n=e.id.nesting[n]),e.color.value){for(c=[],f=e.id.nesting.indexOf(n);f>=0;){if(s=e.id.nesting[f],p=l(t,e.color.value,r,e,s),1===p.length&&(p=p[0]),!(p instanceof Array)&&void 0!==p&&null!==p){o=a(e,t,p,n),c.indexOf(o)<0&&c.push(o);break}f--}return 1===c.length?c[0]:e.color.missing}return i(e,t,n)},a=function(e,t,n,r){return n?e.color.valueScale?e.color.valueScale(n):s(n)?n:i(e,n,r):e.color.value&&"function"==typeof e.color.valueScale?e.color.valueScale(0):i(e,t,r)},i=function(e,t,n){return u(t)&&(t=r(e,t,n)),t instanceof Array&&(t=t[0]),o(t,e.color.scale.value)}},{"../../color/random.coffee":49,"../../color/validate.coffee":53,"../../object/validate.coffee":175,"../../util/uniques.coffee":213,"./value.coffee":69}],66:[function(e,t,n){var r=e("../data/filter.js"),a=e("../data/nest.js"),i=e("../console/print.coffee"),o=e("../../string/format.js"),l=e("../../string/list.coffee");t.exports=function(e,t,n){if(!e.data.value)return[];void 0===n&&(n=e.depth.value);var s=e.id.nesting[n];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,s,n].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 M=x[z].split("_").slice(1).join("_");if(M===m){m=(new Date).getTime()+"_"+m,e.data.cache[m]=e.data.cache[x[z]],delete e.data.cache[x[z]];break}}var A;if(e.data.cache[m])return e.dev.value&&i.comment("data already cached"),A=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&&(A=b(e,A)),A;var j=[];if(A=[],e.data.value&&e.data.value.length)for(var E=0;E<t.length;E++){var S=t[E];e.data.nested[S]?A=A.concat(e.data.nested[S][s]):j.push(S)}if(0===A.length&&j.length&&!e.error.internal){j.length>1&&(j=d3.extent(j)),j=j.map(function(t){return e.data.time.format(new Date(t))}),j=j.join(" - ");var O=e.format.locale.value.error.dataYear,N=e.format.locale.value.ui.and;j=l(j,N),e.error.internal=o(O,j),e.time.missing=!0}else{if(e.time&&(e.time.missing=!1),t.length>1){var F=!1;if(["x","y","x2","y2"].forEach(function(t){e[t].value===e.time.value&&"discrete"===e[t].scale.value&&(F=!0)}),!F){var C=e.id.nesting.slice(0,n+1);A=a(e,A,C)}}A=A?r(e,A):[],20===x.length&&(x.sort(),delete e.data.cache[x[0]]),m=(new Date).getTime()+"_"+m,e.data.cache[m]={data:A},"nodes"in e&&(e.data.cache[m].nodes=e.nodes.restricted,e.data.cache[m].edges=e.edges.restricted),"function"==typeof b&&(A=b(e,A)),e.dev.value&&i.comment("storing data in cache")}return A}},{"../../string/format.js":176,"../../string/list.coffee":177,"../console/print.coffee":54,"../data/filter.js":57,"../data/nest.js":62}],67:[function(e,t,n){var r,a,i;i=e("./value.coffee"),r=e("./color.coffee"),a=e("./text.js"),t.exports=function(e,t,n,o,l){var s,u,c,f,d,p;for(n instanceof Array||(n=[n]),o instanceof Array||(o=[o]),e&&(void 0===l?l=e.id.value:"number"!=typeof l&&(l=e.id.nesting.indexOf(l))),d={},u=0,f=n.length;u<f;u++)c=n[u],p=e?o.indexOf(c)>=0?r(e,t,l):c===e.text.value?a(e,t,l):3===d3.keys(t).length&&t.d3plus&&t.key&&t.values?i(e,t.values.map(function(e){return e.d3plus}),c,l):i(e,t,c,l):t[c],[e.data.keys[c],e.attrs.keys[c]].indexOf("number")>=0?(s=e.order.agg.value||e.aggs.value[c]||"sum",s.constructor===String&&(s=d3[s]),p instanceof Array||(p=[p]),p=s(p)):(p instanceof Array&&(p=p[0]),p="string"==typeof p?p.toLowerCase():p),d[c]=p;return d}},{"./color.coffee":65,"./text.js":68,"./value.coffee":69}],68:[function(e,t,n){var r=e("./value.coffee"),a=e("../../object/validate.coffee"),i=e("../../util/uniques.coffee");t.exports=function(e,t,n){"number"!=typeof n&&(n=e.depth.value);var o,l=e.id.nesting[n];e.text.nesting&&a(e.text.nesting)?o=e.text.nesting[l]?e.text.nesting[l]:e.text.value:(o=[],e.text.value&&n===e.depth.value&&o.push(e.text.value),o.push(l)),o instanceof Array||(o=[o]);var s=[];if(a(t)&&"d3plus"in t&&t.d3plus.text)s.push(t.d3plus.text.toString()),s.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]),o.forEach(function(n){var a=i(t,n,r,e,l);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:n})})):t?e.format.value(t.toString(),{vars:e,data:u,key:n}):void 0}),1===a.length&&(a=a[0]),s.push(a))})}return s}},{"../../object/validate.coffee":175,"../../util/uniques.coffee":213,"./value.coffee":69}],69:[function(e,t,n){var r,a,i,o,l,s,u,c,f,d;f=e("../../object/validate.coffee"),c=e("../../util/uniques.coffee"),u=function(e,t,n,o){var l,s,u,d;if(s=f(t),"function"==typeof n&&s)return n(t,e);if(s){if(n in t)return t[n];if(l=e.data.cacheID+"_"+o,r(t,l,e),n in t.d3plus.data[l])return t.d3plus.data[l][n];if(o in t)t=t[o];else{if(!(e.id.value in t))return null;if(t=t[e.id.value],o!==n&&(u=i(e,t,o,e.id.value)),null!==u&&void 0!==u||(u=a(e,t,o,e.id.value)),null===u||void 0===u)return null;if(o===n)return u;t=u}}return t instanceof Array&&!f(t[0])&&(t=c(t)),t instanceof Array&&f(t[0])&&(d=c(t,n),d.length)?d:(d=i(e,t,n,o))?d:d=a(e,t,n,o)},i=function(e,t,n,r){var a;return e.data.viz instanceof Array&&n in e.data.keys&&(a=c(s(e.data.viz,t,r),n)),a&&a.length?a:null},a=function(e,t,n,r){var a,i,o,l;if("attrs"in e&&e.attrs.value&&n in e.attrs.keys)if(a=f(e.attrs.value)&&r in e.attrs.value?e.attrs.value[r]:e.attrs.value,a instanceof Array){if(o=c(s(a,t,r),n),o.length)return o}else if(t instanceof Array){if(a=[function(){var e,n,r;if(i in a){for(r=[],e=0,n=t.length;e<n;e++)i=t[e],r.push(a[i]);return r}}()],a.length&&(l=c(a,n),l.length))return l}else if(t in a)return a[t][n];return null},s=function(e,t,n){return t instanceof Array?e.filter(function(e){return t.indexOf(e[n])>=0}):e.filter(function(e){return e[n]===t})},r=function(e,t,n){return"d3plus"in e||(e.d3plus={}),"data"in e.d3plus||(e.d3plus.data={}),!(n.data.changed||n.attrs&&n.attrs.changed)&&t in e.d3plus.data||(e.d3plus.data[t]={}),e},d=function(e,t,n,r,a){var i,o,l,s,u,c,d;if(null===a)return a;c="time"in e&&e.time.value===r,a instanceof Array||(a=[a]);for(l=s=0,u=a.length;s<u;l=++s)d=a[l],c&&null!==d&&d.constructor!==Date&&(d+="",4===d.length&&parseInt(d)+""===d&&(d+="/01/01"),o=new Date(d),"Invalid Date"!==o&&(a[l]=o));return 1===a.length&&(a=a[0]),null===a||!f(t)||"string"!=typeof r||r in t||(i=e.data.cacheID+"_"+n,t.d3plus.data[i][r]=a),a},l=function(e,t,n,r){var a,i,o,l,s;for(s=[],i=0,o=t.length;i<o;i++)a=t[i],f(a)?(l=u(e,a,n,r),s.push(d(e,a,r,n,l))):s.push(a);return"number"!=typeof s[0]&&(s=c(s)),1===s.length?s[0]:s},o=function(e,t,n,r){var a,i;return n?"number"==typeof n?n:(a=f(t),r||(r=e.id.value),a&&t.values instanceof Array?i=l(e,t.values,n,r):a&&t[n]instanceof Array?i=l(e,t[n],n,r):t instanceof Array?i=l(e,t,n,r):(i=u(e,t,n,r),i=d(e,t,r,n,i)),i):null},t.exports=o},{"../../object/validate.coffee":175,"../../util/uniques.coffee":213}],70:[function(e,t,n){t.exports=function(e){var t,n,r;return["div","svg"].indexOf(e)<0&&(e="div"),n={position:"absolute",left:"-9999px",top:"-9999px",visibility:"hidden",display:"block"},t="div"===e?{}:{position:"absolute"},r=d3.select("body").selectAll(e+".d3plus_tester").data([0]),r.enter().append(e).attr("class","d3plus_tester").style(n).attr(t),r}},{}],71:[function(e,t,n){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"]}},{}],72:[function(e,t,n){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"}}},{}],73:[function(e,t,n){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"]}},{}],74:[function(e,t,n){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"]}},{}],75:[function(e,t,n){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"]}},{}],76:[function(e,t,n){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"]}},{}],77:[function(e,t,n){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"]}},{}],78:[function(e,t,n){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"]}},{}],79:[function(e,t,n){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"]}},{}],80:[function(e,t,n){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","电视","用户界面","研发"]}},{}],81:[function(e,t,n){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":71,"./languages/en_US.coffee":72,"./languages/es_ES.js":73,"./languages/fr_FR.js":74,"./languages/ko_KR.js":75,"./languages/mk_MK.js":76,"./languages/pt_BR.js":77,"./languages/pt_PT.js":78,"./languages/ru_RU.js":79,"./languages/zh_CN.js":80}],82:[function(e,t,n){var r,a,i,o,l,s,u,c,f;a=e("../../util/copy.coffee"),l=e("../console/print.coffee"),s=e("./process/detect.coffee"),u=e("./set.coffee"),c=e("../../string/format.js"),f=e("../../object/validate.coffee"),t.exports=function(e,t){var n,r,l;l=[];for(n in t)r=t[n],e[n]=a(r),e[n].initialized=o(e,e[n],n),l.push(e.self[n]=i(e,n));return l},o=function(e,t,n,r){var a,i,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=s(e,t,t.value));for(p in t)if("deprecates"===p)for(i=t[p]instanceof Array?t[p]:[t[p]],u=0,d=i.length;u<d;u++)a=i[u],e.self[a]=function(t,n){return function(a){var i,o,s;return s=e.format.locale.value.dev.deprecated,t="."+t+"()",o=r?'"'+n+'" in .'+r+"()":"."+n+"()",i=r||n,l.error(c(s,t,o),i),e.self}}(a,n);else"global"===p?n in e||(e[n]=[]):"value"!==p&&f(t[p])&&o(e,t[p],p,n);return!0},i=function(e,t){return function(n,a){var i,o,s,u,d,p,h,v;if(i="accepted"in e[t]?e[t].accepted:null,"function"==typeof i&&(i=i(e)),i instanceof Array||(i=[i]),n===Object)return e[t];if(!arguments.length&&i.indexOf(void 0)<0)return"value"in e[t]?e[t].value:e[t];if("style"===t&&"object"==typeof n){v=e.format.locale.value.dev.oldStyle;for(p in n)l.warning(c(v,'"'+p+'"',p),p),e.self[p](n[p])}if("font"===t){"string"==typeof n&&(n={family:n}),h=!0,s=function(e,t,n,r){f(e[n])&&t in e[n]&&(f(e[n][t])?e[n][t].process?e[n][t].value=e[n][t].process(r):e[n][t].value=r:e[n][t]=r)},o=function(e,t,n){var r;if(f(e)){if(h)for(r in e)s(e,t,r,n);else"font"in e&&s(e,t,"font",n);h=!1;for(r in e)o(e[r],t,n)}};for(u in n)d=n[u],"secondary"!==u&&(f(d)&&(d=d.value),d&&o(e,u,d))}return r(e,t,e,t,n),"function"==typeof a&&(e[t].callback=a),e[t].chainable===!1?e[t].value:e.self}},r=function(e,t,n,a,i){var o,l,s,c;if(["accepted","changed","initialized","previous","process"].indexOf(a)<0)if(c=f(i),s=f(n[a])&&"objectAccess"in n[a]&&n[a].objectAccess===!1,o=c&&(s||!("value"in i)&&(!f(n[a])||!(d3.keys(i)[0]in n[a]))),null===i||!c||o)u(e,t,n,a,i);else if(c)for(l in i)r(e,t,n[a],l,i[l])}},{"../../object/validate.coffee":175,"../../string/format.js":176,"../../util/copy.coffee":210,"../console/print.coffee":54,"./process/detect.coffee":90,"./set.coffee":96}],83:[function(e,t,n){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:[]}}},{}],84:[function(e,t,n){var r;r=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 r?"left"===e?"right":"right"===e?"left":e:e},value:e}}},{"../../../client/rtl.coffee":42}],85:[function(e,t,n){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}}},{}],86:[function(e,t,n){var r,a;a=e("../../../font/validate.coffee"),r=["Helvetica Neue","HelveticaNeue","Helvetica","Arial","sans-serif"],t.exports=function(e){return void 0===e&&(e=r),{process:a,value:e}}},{"../../../font/validate.coffee":105}],87:[function(e,t,n){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}}},{}],88:[function(e,t,n){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}}},{}],89:[function(e,t,n){t.exports=function(e,t,n){var r;return t.history&&t.history.reset(),e.constructor===String?e.indexOf("/")>=0?(n.url=e,[]):(r=d3.selectAll(e),r.size()?r:(e.indexOf(".")>=0&&(n.url=e),[])):e}},{}],90:[function(e,t,n){var r,a;r=e("../../../util/copy.coffee"),a=e("../../../array/update.coffee"),t.exports=function(e,t,n){return t.process===Array?a(r(t.value),n):"object"==typeof t.process&&"string"==typeof n?t.process[n]:"function"==typeof t.process?t.process(n,e,t):n}},{"../../../array/update.coffee":37,"../../../util/copy.coffee":210}],91:[function(e,t,n){var r;r=e("../../../client/css.coffee"),t.exports=function(e,t,n){return e===!1||e.indexOf("fa-")<0||0===e.indexOf("fa-")&&r("font-awesome")?e:n.fallback}},{"../../../client/css.coffee":38}],92:[function(e,t,n){t.exports=function(e,t){var n,r,a,i,o,l,s,u,c,f,d,p,h;if("string"==typeof e){for(e=e.split(" "),n=r=0,o=e.length;r<o;n=++r)h=e[n],e[n]=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,l=p.length;a<l;a++)d=p[a],t[d]=e;else for(i=0,s=p.length;i<s;i++)d=p[i],t[d]=e[d];for(t.css="",f=[],n=c=0,u=p.length;c<u;n=++c)d=p[n],n&&(t.css+=" "),f.push(t.css+=t[d]+"px");return f}},{}],93:[function(e,t,n){var r,a,i,o;r=e("../../array/contains.coffee"),a=e("../../string/format.js"),i=e("../../string/list.coffee"),o=e("../console/print.coffee"),t.exports=function(e,t,n,l,s){var u,c,f,d,p,h,v,g;if("function"==typeof t&&(t=t(e)),t instanceof Array||(t=[t]),c=r(t,n),c===!1&&void 0!==n){for(h=[],g=JSON.stringify(n),"string"!=typeof n&&(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=i(h,e.format.locale.value.ui.or),e.type&&["mode","shape"].indexOf(l)>=0?(v=e.format.locale.value.error.accepted,f=e.format.locale.value.visualization[e.type.value]||e.type.value,o.warning(a(v,g,l,f,h),l)):(v=e.format.locale.value.dev.accepted,o.warning(a(v,g,s,h),l))}return!c}},{"../../array/contains.coffee":35,"../../string/format.js":176,"../../string/list.coffee":177,"../console/print.coffee":54}],94:[function(e,t,n){t.exports=function(e){var t;return t=["auto","optimizeSpeed","crispEdges","geometricPrecision"],t.indexOf(e)>=0||(e="crispEdges"),{accepted:t,value:e}}},{}],95:[function(e,t,n){var r,a;a=e("../../object/validate.coffee"),r=function(e,t){var n;e.changed&&(e.changed=!1),"draw"===t&&(e.frozen=!1,e.update=!0,e.first=!1);for(n in e)n.indexOf("d3plus")<0&&a(e[n])&&r(e[n],n)},t.exports=r},{"../../object/validate.coffee":175}],96:[function(e,t,n){var r,a,i,o,l,s,u,c,f;r=e("../../util/copy.coffee"),a=e("../../util/d3selection.coffee"),f=e("../../object/validate.coffee"),i=e("../../object/merge.coffee"),o=e("../console/print.coffee"),l=e("./process/detect.coffee"),s=e("./rejected.coffee"),u=e("../../string/format.js"),c=e("../../array/update.coffee"),t.exports=function(e,t,n,d,p){var h,v,g,m,y,x,b,w,_,k,z,M,A,j;if(M="value"!==d&&d&&d!==t?'"'+d+'" '+e.format.locale.value.dev.of+" ."+t+"()":"."+t+"()",h="value"===d&&"accepted"in n?n.accepted:f(n[d])&&"accepted"in n[d]?n[d].accepted:[p],!s(e,h,p,t,M)){if(f(n[d])&&"value"in n[d]&&(k=d,n=n[d],d="value"),"value"===d&&"process"in n&&(p=l(e,n,p)),n[d]instanceof Array||n[d]!==p||void 0===p){if(n.changed=!0,n.loaded&&(n.loaded=!1),"history"in e&&"draw"!==t&&(v=r(n),v.method=t,e.history.chain.push(v)),n.previous=n[d],"id"in e&&"value"===d&&"nesting"in n)if("id"!==t){if("object"!=typeof n.nesting&&(n.nesting={}),f(p)){for(x in p)"string"==typeof p[x]&&(p[x]=[p[x]]);n.nesting=i(n.nesting,p),e.id.value in n.nesting||(n.nesting[e.id.value]=p[d3.keys(p)[0]])}else p instanceof Array?n.nesting[e.id.value]=p:n.nesting[e.id.value]=[p];n[d]=n.nesting[e.id.value][0]}else p instanceof Array?(n.nesting=p,"depth"in e&&e.depth.value<p.length?n[d]=p[e.depth.value]:(n[d]=p[0],"depth"in e&&(e.depth.value=0))):(n[d]=p,n.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(n[d])&&f(p)?n[d]=i(n[d],p):n[d]=p;"value"===d&&n.global&&(y=n[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&&n.dataFilter&&e.data&&e.data.filters.indexOf(t)<0&&e.data.filters.push(t),e.dev.value&&n.changed&&void 0!==n[d]&&(w=n[d]instanceof Array&&n[d].length>10,m=a(n[d]),A="function"==typeof n[d],j=w||m||A?null:"string"==typeof n[d]?n[d]:JSON.stringify(n[d]),null!==j&&j.length<260?(z=e.format.locale.value.dev.setLong,o.log(u(z,M,'"'+j+'"'))):(z=e.format.locale.value.dev.set,o.log(u(z,M))))}else z=e.format.locale.value.dev.noChange,e.dev.value&&o.comment(u(z,M));"value"===d&&n.callback&&!n.url&&(g="function"==typeof n.callback?n.callback:n.callback.value,g&&g(p,e.self))}}},{"../../array/update.coffee":37,"../../object/merge.coffee":174,"../../object/validate.coffee":175,"../../string/format.js":176,"../../util/copy.coffee":210,"../../util/d3selection.coffee":211,"../console/print.coffee":54,"./process/detect.coffee":90,"./rejected.coffee":93}],97:[function(e,t,n){var r=e("../console/print.coffee"),a=e("../../string/format.js");t.exports=function(e){if(e.dev.value){var t="analyzing edges list";r.time(t)}var n=e.types[e.type.value].requirements;n instanceof Array||(n=[n]);var i=n.indexOf("nodes")>=0&&!e.nodes.value;if(i){e.nodes.value=[];var o=[];e.nodes.changed=!0}e.edges.value.forEach(function(t){["source","target"].forEach(function(n){var r=typeof t[e.edges[n]];if("object"!==r)if("number"!==r||i||"number"===e.data.keys[e.id.value])if(i&&o.indexOf(t[e.edges[n]])>=0)t[e.edges[n]]=e.nodes.value.filter(function(r){return r[e.id.value]===t[e.edges[n]]})[0];else{var a={};a[e.id.value]=t[e.edges[n]],t[e.edges[n]]=a}else t[e.edges[n]]=e.nodes.value[t[e.edges[n]]];var l=t[e.edges[n]];i&&o.indexOf(l[e.id.value])<0&&(o.push(l[e.id.value]),e.nodes.value.push(l))}),"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 n=t[e.edges.source][e.id.value],i=t[e.edges.target][e.id.value];if(n===i){var o=e.format.locale.value.dev.sameEdge;return r.warning(a(o,'"'+n+'"'),"edges"),!1}return!0}),e.edges.linked=!0,e.dev.value&&r.timeEnd(t)}},{"../../string/format.js":176,"../console/print.coffee":54}],98:[function(e,t,n){var r=e("./hideElement.js");t.exports=function(e){function t(e,t){[].forEach.call(t.attributes,function(t){if(/^data-/.test(t.name)){var n=t.name.substr(5).replace(/-(.)/g,function(e,t){return t.toUpperCase()});e[n]=t.value}}),n.forEach(function(n){null!==t.getAttribute(n)&&(e[n]=t.getAttribute(n))})}var n=[e.color.value,e.icon.value,e.keywords.value,e.alt.value,"style"];e.text.value||e.self.text("text"),n=n.concat(e.id.nesting),e.self.data({element:e.data.value});var a=e.data.element.value.node().tagName.toLowerCase(),i=e.data.element.value.attr("type"),o=[];if("select"===a){var l=e.data.element.value.node().id;l&&e.self.container({id:l}),e.data.element.value.selectAll("option").each(function(n,r){var a={};if(a.text=d3.select(this).text(),t(a,this),o.push(a),this.selected)for(var r=e.id.nesting.length-1;r>=0;r--){var i=e.id.nesting[r];if(i in a){e.self.focus(a[i]);break}}})}else if("input"===a&&"radio"===i){var s=e.data.element.value.node().getAttribute("name");s&&e.self.container({id:s}),e.data.element.value.each(function(n,a){var i={};t(i,this);var l=i[e.id.value]||this.id||!1;if(l&&isNaN(parseFloat(l))){var s=d3.select("label[for="+l+"]");s.empty()||(i.text=s.html(),s.call(r))}o.push(i),this.checked&&e.self.focus(i[e.id.value])})}!e.focus.value.length&&o.length&&(e.data.element.value.node().selectedIndex=0,e.self.focus(o[0][e.id.value]));var u=d3.select("legend[for="+e.container.id+"]");u.empty()||(e.self.title(u.html()),u.call(r));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(r),o}},{"./hideElement.js":99}],99:[function(e,t,n){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")}},{}],100:[function(e,t,n){var r=e("../console/print.coffee");t.exports=function(e){if("network"===e.type.value){if(e.dev.value){var t="analyzing node positions";r.time(t)}var n=e.nodes.value.filter(function(e){return"number"==typeof e.x&&"number"==typeof e.y}).length;if(n===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),i=e.edges.strength.value;i&&("string"==typeof i?a.linkStrength(function(e){return e[i]}):a.linkStrength(i));var o=50,l=.01;a.start();for(var s=o;s>0&&(a.tick(),!(a.alpha()<l));--s);a.stop(),e.nodes.positions=!0}e.dev.value&&r.timeEnd(t)}}},{"../console/print.coffee":54}],101:[function(e,t,n){var r;r=e("numeric"),t.exports=function(e,t){var n,a,i,o,l,s,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,M,A,j;for(null==t&&(t={}),null==t.maxDegree&&(t.maxDegree=5),n=e.length,x=Number.MAX_VALUE,l=null,i=function(){var n,r,a;for(a=[],c=n=1,r=t.maxDegree+1;1<=r?n<r:n>r;c=1<=r?++n:--n)a.push(function(){var t,n,r;for(r=[],n=0,t=e.length;n<t;n++)y=e[n],r.push(Math.pow(y[0],c));return r}());return a}(),A=function(){var t,n,r;for(r=[],t=0,n=e.length;t<n;t++)y=e[t],r.push(y[1]);return r}(),d=v=0,w=1<<t.maxDegree;0<=w?v<w:v>w;d=0<=w?++v:--v){for(o=[function(){var e,t,r;for(r=[],b=e=0,t=n;0<=t?e<t:e>t;b=0<=t?++e:--e)r.push(1);return r}()],f=[0],p=m=0,_=t.maxDegree;0<=_?m<_:m>_;p=0<=_?++m:--m)(d&1<<p)>0&&(o.push(i[p]),f.push(p+1));a=r.transpose(o),h=f.length,s=r.dot(r.dot(r.inv(r.dot(o,a)),o),A),j=r.dot(a,s),k=r.sub(A,j),M=r.dot(k,k),z=M/(n-h),g=-.5*n*Math.log(2*Math.PI)-.5*n*Math.log(z)-M/(2*z),u=-2*g+h*(Math.log(n)-Math.log(2*Math.PI)),u<x&&(x=u,l=[f,s,j])}return l}},{numeric:8}],102:[function(e,t,n){var r;r=e("static-kdtree"),t.exports=function(e,t){var n,a,i,o,l,s,u,c,f,d,p,h;return null==t&&(t=10),h=r(e),u=function(){var n,r,a;for(a=[],n=0,r=e.length;n<r;n++)c=e[n],a.push(h.knn(c,t+1).slice(1));return a}(),p=function(t,n){var r,a,i,o,l,s;for(r=e[t],a=e[n],o=0,t=l=0,s=r.length;0<=s?l<s:l>s;t=0<=s?++l:--l)i=r[t]-a[t],o+=i*i;return o},o=function(){var n,r,i;for(i=[],a=n=0,r=e.length;0<=r?n<r:n>r;a=0<=r?++n:--n)i.push(p(a,u[a][t-1]));return i}(),f=function(e,t){return Math.max(p(e,t),o[t])},l=function(e){var n,r,a,i,o;for(i=0,o=u[e],r=0,a=o.length;r<a;r++)n=o[r],i+=f(e,n);return t/i},s=function(){var t,n,r;for(r=[],a=t=0,n=e.length;0<=n?t<n:t>n;a=0<=n?++t:--t)r.push(l(a));return r}(),d=function(){var r,o,l,c,f,d;for(d=[],a=r=0,c=e.length;0<=c?r<c:r>c;a=0<=c?++r:--r){for(n=0,f=u[a],o=0,l=f.length;o<l;o++)i=f[o],n+=s[i];n/=t,d.push([a,n/s[a]])}return d}(),d.sort(function(e,t){return t[1]-e[1]})}},{"static-kdtree":10}],103:[function(e,t,n){t.exports=function(e){var t,n,r;return n=d3.median(e),t=d3.median(e.map(function(e){return Math.abs(e-n)})),r=e.map(function(e,r){return[r,Math.abs(e-n)/t]}),r.sort(function(e,t){return t[1]-e[1]})}},{}],104:[function(e,t,n){var r;r=e("../core/font/tester.coffee"),t.exports=function(e,t,n){var a,i,o,l,s,u,c;return n||(n={}),t=t||{},u=n.parent||r("svg").append("text"),l=[],e instanceof Array||(e=[e]),c=u.selectAll("tspan").data(e),a={left:"0px",position:"absolute",top:"0px",x:0,y:0},s=0,"letter-spacing"in t&&(s=parseFloat(t["letter-spacing"]),delete t["letter-spacing"]),o=function(e){var t;return t=0,s&&(t=(d3.select(e).text().length-1)*s),e.getComputedTextLength()+t},i=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 n.mod)return n.mod(this)}).each(function(e){var t,n,r;return t=d3.select(this).selectAll("tspan"),t.size()?(r=[],t.each(function(){return r.push(o(this))}),r=d3.max(r)):r=o(this),n=i(this),l.push({height:n,text:e,width:r})}),c.remove(),n.parent||u.remove(),l}},{"../core/font/tester.coffee":70}],105:[function(e,t,n){var r,a;r=e("../core/font/tester.coffee"),a=function(e){var t,n,i,o,l,s,u,c,f,d,p,h,v,g;for(e instanceof Array||(e=e.split(",")),l=0,u=e.length;l<u;l++)i=e[l],i.trim();if(o=e.join(", "),t=a.complete,o in t)return t[o];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 n,r,a;return n=p(e),r=n.node().offsetWidth,a=t.node().offsetWidth,n.remove(),r!==a},v=r("div"),f=p("monospace"),d=p("sans-serif"),s=0,c=e.length;s<c;s++)if(n=e[s],g=h(n+",monospace",f),g||(g=h(n+",sans-serif",d)),g){g=n;break}return g||(g="sans-serif"),f.remove(),d.remove(),t[o]=g,g},a.complete={},t.exports=a},{"../core/font/tester.coffee":70}],106:[function(e,t,n){var r=e("../array/sort.coffee"),a=e("../core/methods/attach.coffee"),i=e("../core/data/format.js"),o=e("../core/data/keys.coffee"),l=e("../core/data/load.coffee"),s=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 n=t.data.value instanceof Array&&t.data.value.length>t.data.large;if(t.draw.timing=t.draw.first||n||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={},o(t,"data"),i(t)),t.data.viz=s(t),t.data.sort.value&&(t.data.changed||t.order.changed||t.order.sort.changed)&&r(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,n){n="number"!=typeof n?1===t.id.nesting.length?0:t.id.nesting.length-1:n;var r=t.id.nesting[n];return n>0&&(!(r in e)||e[r]instanceof Array)?v(e,n-1):r};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 n=v(e),r=n===t.id.value?t.text.value||t.id.value:t.text.nesting!==!0&&n in t.text.nesting?t.text.nesting[n]:n;for(var a in e)"object"!=typeof e[a]&&(a===r&&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[n]===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||l(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":36,"../client/ie.js":39,"../core/console/print.coffee":54,"../core/data/format.js":58,"../core/data/keys.coffee":60,"../core/data/load.coffee":61,"../core/fetch/data.js":66,"../core/methods/attach.coffee":82,"../core/methods/reset.coffee":95,"./methods/active.coffee":107,"./methods/alt.coffee":108,"./methods/color.coffee":109,"./methods/config.coffee":110,"./methods/container.coffee":111,"./methods/data.js":112,"./methods/depth.coffee":113,"./methods/dev.coffee":114,"./methods/draw.js":115,"./methods/focus.coffee":116,"./methods/font.coffee":117,"./methods/format.coffee":118,"./methods/height.coffee":119,"./methods/history.coffee":120,"./methods/hover.coffee":121,"./methods/icon.coffee":122,"./methods/id.coffee":123,"./methods/keywords.coffee":124,"./methods/margin.coffee":125,"./methods/open.coffee":126,"./methods/order.coffee":127,"./methods/remove.coffee":128,"./methods/search.coffee":129,"./methods/select.coffee":130,"./methods/selectAll.coffee":131,"./methods/text.coffee":132,"./methods/timing.coffee":133,"./methods/title.coffee":134,"./methods/type.coffee":135,"./methods/ui.coffee":136,"./methods/width.coffee":137,"./types/auto.js":138,"./types/button/button.coffee":139,"./types/drop/drop.coffee":144,"./types/toggle.js":161}],107:[function(e,t,n){var r;r=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Array,Function,Number,String],value:!1}},{"../../core/methods/filter.coffee":83}],108:[function(e,t,n){var r;r=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],mute:r(!0),solo:r(!0),value:"alt"}},{"../../core/methods/filter.coffee":83}],109:[function(e,t,n){t.exports={accepted:[String],value:"color"}},{}],110:[function(e,t,n){t.exports={accepted:[Object],objectAccess:!1,process:function(e,t){var n,r;for(n in e)r=e[n],n in t.self&&t.self[n](r);return e},value:{}}},{}],111:[function(e,t,n){var r;r=e("../../util/d3selection.coffee"),t.exports={accepted:[!1,Array,Object,String],element:!1,id:"default",process:function(e){return e===!1?d3.select("body"):r(e)?e:e instanceof Array?d3.select(e[0][0]):(this.selector=e,d3.select(e))},value:d3.select("body")}},{"../../util/d3selection.coffee":211}],112:[function(e,t,n){var r=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 n=!1;return r(e)?n=e:"string"!=typeof e||d3.select(e).empty()||(n=d3.select(e)),n&&t.self.container(d3.select(n.node().parentNode)),n},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":89,"../../util/d3selection.coffee":211}],113:[function(e,t,n){t.exports={accepted:[Number],value:0}},{}],114:[function(e,t,n){t.exports={accepted:[Boolean],value:!1}},{}],115:[function(e,t,n){var r=e("../../util/d3selection.coffee"),a=e("../../core/parse/hideElement.js"),i=e("../../core/parse/element.js"),o=e("../../core/console/print.coffee"),l=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&&!r(t.data.value)?t.data.element.value&&t.data.element.value.call(a):t.data.value=i(t),void 0===e&&"function"==typeof this.value&&(e=this.value),t.container.value===!1){var n=t.format.locale.value.dev.setContainer;o.warning(n,"container")}else if(t.container.value.empty()){var n=t.format.locale.value.dev.noContainer,s=t.container.selector||"";o.warning(l(n,'"'+s+'"'),"container")}else t.dev.value&&o.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":54,"../../core/parse/element.js":98,"../../core/parse/hideElement.js":99,"../../string/format.js":176,"../../util/d3selection.coffee":211}],116:[function(e,t,n){t.exports={accepted:[!1,Number,String],deprecates:"highlight",process:function(e,t){var n,r,a,i,o,l,s,u,c,f;if(r=t.data.element.value,r&&["string","number"].indexOf(typeof e)>=0)if(a=r.node().tagName.toLowerCase(),i=r.attr("type"),"select"===a)for(f=r.selectAll("option"),o=l=0,u=f.length;l<u;o=++l)n=f[o],n&&n[t.id.value]===e&&(r.node().selectedIndex=o);else if("input"===a&&"radio"===i)for(s=0,c=r.length;s<c;s++)n=r[s],this.checked=n&&n[t.id.value]===e;return e},value:!1}},{}],117:[function(e,t,n){var r,a,i,o;i=e("../../core/methods/font/family.coffee"),r=e("../../core/methods/font/align.coffee"),a=e("../../core/methods/font/decoration.coffee"),o=e("../../core/methods/font/transform.coffee"),t.exports={align:r(),color:"#444444",decoration:a(),family:i(),secondary:{align:r(),color:"#444444",decoration:a(),family:i(),size:12,spacing:0,transform:o(),weight:200},size:12,spacing:0,transform:o(),weight:200}},{"../../core/methods/font/align.coffee":84,"../../core/methods/font/decoration.coffee":85,"../../core/methods/font/family.coffee":86,"../../core/methods/font/transform.coffee":88}],118:[function(e,t,n){var r,a,i,o;r=e("../../number/format.coffee"),a=e("../../core/locale/locale.coffee"),i=e("../../object/merge.coffee"),o=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,n;return t="en_US",n=a[t],e!==t&&(n=i(n,a[e])),this.language=e,n},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 n,a,i;return t||(t={}),i=t.vars||{},i.time&&i.time.value&&t.key===i.time.value?(a=e.constructor===Date?e:new Date(e),i.data.time.format(a)):"number"==typeof e?(n=this.number.value||r)(e,t):"string"==typeof e?(n=this.text.value||o)(e,t):JSON.stringify(e)}}},{"../../core/locale/locale.coffee":81,"../../number/format.coffee":173,"../../object/merge.coffee":174,"../../string/title.coffee":179}],119:[function(e,t,n){t.exports={accepted:[!1,Number],max:600,secondary:!1,value:!1}},{}],120:[function(e,t,n){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:[]}},{}],121:[function(e,t,n){t.exports={accepted:[Boolean,Number,String],value:!1}},{}],122:[function(e,t,n){var r;r=e("../../core/methods/process/icon.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],back:{accepted:[!1,String],fallback:"❮",opacity:1,process:r,rotate:0,value:"fa-angle-left"},button:{accepted:[!1,String],fallback:!1,opacity:1,process:r,rotate:0,value:!1},drop:{accepted:[!1,String],fallback:"❯",opacity:1,process:r,rotate:0,value:"fa-angle-down"},next:{accepted:[!1,String],fallback:"❯",opacity:1,process:r,rotate:0,value:"fa-angle-right"},select:{accepted:[!1,String],fallback:"✓",opacity:1,process:r,rotate:0,value:"fa-check"},style:{accepted:[Object,String],value:"default"},value:"icon"}},{"../../core/methods/process/icon.coffee":91}],123:[function(e,t,n){var r;r=e("../../core/methods/filter.coffee"),t.exports={accepted:[Array,String],dataFilter:!0,mute:r(!0),nesting:["value"],solo:r(!0),value:"value"}},{"../../core/methods/filter.coffee":83}],124:[function(e,t,n){var r;r=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],mute:r(!0),solo:r(!0),value:"keywords"}},{"../../core/methods/filter.coffee":83}],125:[function(e,t,n){var r;r=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,r(e,this),t},value:0}},{"../../core/methods/process/margin.coffee":92}],126:[function(e,t,n){t.exports={accepted:[Boolean],flipped:{accepted:[Boolean],value:!1},value:!1}},{}],127:[function(e,t,n){t.exports={accepted:[!1,Function,String],sort:{accepted:["asc","desc"],deprecates:["sort"],value:"asc"},value:!1}},{}],128:[function(e,t,n){t.exports={accepted:[void 0,Function],process:function(e,t){this.initialized&&t.container.ui.remove(),delete t.container.ui},value:void 0}},{}],129:[function(e,t,n){t.exports={accepted:["auto",Boolean],process:function(e){return"Boolean"==typeof e&&(this.enabled=e),e},term:"",value:"auto"}},{}],130:[function(e,t,n){t.exports={accepted:[String],chainable:!1,process:function(e,t){var n;return n=t.container.value,n&&e?n.select(e):e},value:void 0}},{}],131:[function(e,t,n){t.exports={accepted:[String],chainable:!1,process:function(e,t){var n;return n=t.container.value,n&&e?n.selectAll(e):e},value:void 0}},{}],132:[function(e,t,n){var r;r=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,String],nesting:!0,mute:r(!0),solo:r(!0),secondary:{accepted:[!1,String],nesting:!0,value:!1},value:!1}},{"../../core/methods/filter.coffee":83}],133:[function(e,t,n){t.exports={mouseevents:60,ui:200}},{}],134:[function(e,t,n){var r,a,i,o;r=e("../../core/methods/font/decoration.coffee"),a=e("../../core/methods/font/family.coffee"),o=e("../../core/methods/font/transform.coffee"),i=e("../../string/strip.js"),t.exports={accepted:[!1,Function,String],font:{align:"center",color:"#444444",decoration:r(),family:a(),size:16,transform:o(),weight:400},link:!1,process:function(e,t){var n;return 0===t.container.id.indexOf("default")&&e&&(n=i(e).toLowerCase(),t.self.container({id:n})),e},value:!1}},{"../../core/methods/font/decoration.coffee":85,"../../core/methods/font/family.coffee":86,"../../core/methods/font/transform.coffee":88,"../../string/strip.js":178}],135:[function(e,t,n){t.exports={accepted:function(e){return d3.keys(e.types)},value:"auto"}},{}],136:[function(e,t,n){var r,a,i,o,l;i=e("../../core/methods/font/family.coffee"),r=e("../../core/methods/font/align.coffee"),a=e("../../core/methods/font/decoration.coffee"),o=e("../../core/methods/process/margin.coffee"),l=e("../../core/methods/font/transform.coffee"),t.exports={align:r("center"),border:1,color:{primary:{process:function(e,t){var n;return n=this.value,t.ui.color.secondary.value||(t.ui.color.secondary.value=d3.rgb(n).darker(.75).toString()),e},value:"#ffffff"},secondary:{value:!1}},display:{acceped:["block","inline-block"],value:"inline-block"},font:{align:r("center"),color:"#444",decoration:a(),family:i(),size:11,transform:l(),weight:200},margin:{process:function(e){var t;return void 0===e&&(e=this.value),t=e,o(e,this),t},value:5},padding:{process:function(e){var t;return void 0===e&&(e=this.value),t=e,o(e,this),t},value:5}}},{"../../core/methods/font/align.coffee":84,"../../core/methods/font/decoration.coffee":85,"../../core/methods/font/family.coffee":86,"../../core/methods/font/transform.coffee":88,"../../core/methods/process/margin.coffee":92}],137:[function(e,t,n){t.exports={accepted:[!1,Number],secondary:!1,value:!1}},{}],138:[function(e,t,n){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()}},{}],139:[function(e,t,n){t.exports=function(t){var n,r,a,i,o,l,s,u;return l=e("../../../core/console/print.coffee"),a=e("./functions/color.coffee"),i=e("./functions/icons.js"),o=e("./functions/mouseevents.coffee"),s=e("./functions/style.js"),n=t.container.ui.selectAll("div.d3plus_node").data(t.data.viz,function(e){return e[t.id.value]}),t.dev.value&&l.time("enter"),n.enter().append("div").attr("class","d3plus_node").call(a,t).call(s,t).call(i,t).call(o,t),t.dev.value&&l.timeEnd("enter"),t.draw.update||t.draw.timing?(t.dev.value&&l.time("ordering"),n.order(),t.dev.value&&l.timeEnd("ordering"),u=n):(r=[t.focus.previous,t.focus.value,t.hover.previous,t.hover.value].filter(function(e){return e}),u=n.filter(function(e){return r.indexOf(e[t.id.value])>=0})),t.dev.value&&l.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(s,t):u.call(a,t).call(s,t),u.call(i,t).call(o,t),t.dev.value&&l.timeEnd("update"),n.exit().remove()}},{"../../../core/console/print.coffee":54,"./functions/color.coffee":140,"./functions/icons.js":141,"./functions/mouseevents.coffee":142,"./functions/style.js":143}],140:[function(e,t,n){t.exports=function(t,n){var r,a,i;return r=e("../../../../color/legible.coffee"),a=e("../../../../color/lighter.coffee"),i=e("../../../../color/text.coffee"),t.style("background-color",function(e){var t;return t=n.focus.value===e[n.id.value]?n.ui.color.secondary.value:n.ui.color.primary.value,n.hover.value===e[n.id.value]&&(t=d3.rgb(t).darker(.15).toString()),t}).style("color",function(e){var t,a,o,l;return l=n.focus.value===e[n.id.value]?.75:1,o=e[n.icon.value]&&n.data.viz.length<n.data.large,!o&&e[n.color.value]?a=r(e[n.color.value]):(t=n.focus.value===e[n.id.value]?n.ui.color.secondary.value:n.ui.color.primary.value,n.hover.value===e[n.id.value]&&(t=d3.rgb(t).darker(.15).toString()),a=i(t)),a=d3.rgb(a),"rgba("+a.r+","+a.g+","+a.b+","+l+")"}).style("border-color",n.ui.color.secondary.value)}},{"../../../../color/legible.coffee":46,"../../../../color/lighter.coffee":47,"../../../../color/text.coffee":52}],141:[function(e,t,n){var r=e("../../../../client/prefix.coffee"),a=e("../../../../client/rtl.coffee");t.exports=function(e,t){var n="right"===t.font.align.value&&!a||a&&"right"===t.font.align.value;e.each(function(e,i){var o=["label"];e[t.icon.value]&&t.data.viz.length<=t.data.large&&o.push("icon");var l=t.icon.button.value;e[t.id.value]===t.focus.value&&t.icon.select.value?(l=t.icon.select.value,o.push("selected")):l&&e.d3plus.icon!==!1&&o.push("selected");var s=0,u=d3.select(this).selectAll("div.d3plus_button_element").data(o,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===l.indexOf("fa-")&&(t=" fa "+l),"d3plus_button_element d3plus_button_"+e+t}).html(function(n){if("label"===n){var r=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[r])}return"selected"===n&&l.indexOf("fa-")<0?l:""}).style("background-image",function(n){return"icon"===n?"url('"+e[t.icon.value]+"')":"none"}).style("background-color",function(n){return"icon"===n&&"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":(s=t.height.value?t.height.value-(t.ui.padding.top+t.ui.padding.bottom)-2*t.ui.border:t.font.size+t.ui.border,s+"px")}).style("height",function(e){return"icon"===e?s+"px":"auto"}).style("margin-top",function(e){if("label"===e)return"0px";if(this.offsetHeight||this.getBoundingClientRect().height)var n=this.offsetHeight||this.getBoundingClientRect().height;else if("selected"===e)var n=t.font.size;else var n=s;return-n/2+"px"}).style("top",function(e){return"label"===e?"auto":"50%"}).style("left",function(e){return"icon"===e&&!n||"selected"===e&&n?t.ui.padding.left+"px":"auto"}).style("right",function(e){return"icon"===e&&n||"selected"===e&&!n?t.ui.padding.right+"px":"auto"}).style(r()+"transition",function(e){return"selected"===e?t.draw.timing/1e3+"s":"none"}).style(r()+"transform",function(e){var n="selected"===e?t.icon.select.rotate:"none";return"string"==typeof n?n:"rotate("+n+"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(s>0){var f=t.ui.padding;f=3===o.length?f.top+"px "+(2*f.right+s)+"px "+f.bottom+"px "+(2*f.left+s)+"px":o.indexOf("icon")>=0&&!a||o.indexOf("selected")>=0&&a?f.top+"px "+f.right+"px "+f.bottom+"px "+(2*f.left+s)+"px":f.top+"px "+(2*f.right+s)+"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":41,"../../../../client/rtl.coffee":42}],142:[function(e,t,n){t.exports=function(t,n,r){var a,i;return r=e("./color.coffee"),a=e("../../../../client/pointer.coffee"),i=e("../../../../client/ie.js"),t.on(a.over,function(e,t){return n.self.hover(e[n.id.value]),i||!n.draw.timing?d3.select(this).style("cursor","pointer").call(r,n):d3.select(this).style("cursor","pointer").transition().duration(n.timing.mouseevents).call(r,n)}).on(a.out,function(e){return n.self.hover(!1),i||!n.draw.timing?d3.select(this).style("cursor","auto").call(r,n):d3.select(this).style("cursor","auto").transition().duration(n.timing.mouseevents).call(r,n)}).on(a.click,function(e){return n.focus.value!==!1?n.self.focus(e[n.id.value]).draw():n.focus.callback?n.focus.callback(e,n.self):void 0})}},{"../../../../client/ie.js":39,"../../../../client/pointer.coffee":40,"./color.coffee":140}],143:[function(e,t,n){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")}},{}],144:[function(e,t,n){t.exports=function(t){var n,r,a,i,o,l,s,u,c,f,d;return a=e("./functions/element.coffee"),i=e("./functions/keyboard.coffee"),d=e("./functions/window.js"),f=e("./functions/width.js"),n=e("./functions/button.js"),s=e("./functions/selector.js"),u=e("./functions/title.js"),l=e("./functions/search.js"),o=e("./functions/list.js"),r=e("./functions/data.js"),c=e("./functions/update.js"),t.margin.top=0,t.margin.title=0,a(t),i(t),d(t),f(t),n(t),s(t),u(t),l(t),o(t),r(t),c(t)}},{"./functions/button.js":147,"./functions/data.js":148,"./functions/element.coffee":149,"./functions/keyboard.coffee":152,"./functions/list.js":153,"./functions/search.js":155,"./functions/selector.js":156,"./functions/title.js":157,"./functions/update.js":158,"./functions/width.js":159,"./functions/window.js":160}],145:[function(e,t,n){t.exports=function(e,t,n){var r=[],n=n||e.active.value;if(n instanceof Array)for(var a=0;a<n.length;a++)r.push(this(e,t,n[a]));else{var i=typeof n;"number"===i?r.push(e.depth.value===n):"function"===i?r.push(n(t)):r.push(t===n)}return r.indexOf(!0)>=0}},{}],146:[function(e,t,n){var r=e("../../../../core/console/print.coffee");t.exports=function(e){e.dev.value&&r.time("rotating arrow");var t="❯"===e.icon.drop.value?90:0;if(e.open.value!=e.open.flipped.value)var n=180+t;else var n=t;e.container.button.icon({select:{opacity:e.open.value?.5:1,rotate:n}}).draw(),e.dev.value&&r.timeEnd("rotating arrow")}},{"../../../../core/console/print.coffee":54}],147:[function(e,t,n){var r=e("../../../../util/copy.coffee"),a=e("../../../../client/pointer.coffee"),i=e("../../../form.js"),o=e("../../../../core/console/print.coffee");t.exports=function(e){if("button"in e.container||(e.dev.value&&o.time("creating main button"),e.container.button=i().container(e.container.ui).type("button").ui({margin:0}),e.dev.value&&o.timeEnd("creating main button")),e.focus.changed||e.data.changed||e.depth.changed){var t=e.depth.value,n=r(e.data.value.filter(function(n){for(var r=!1,a=0;a<e.id.nesting.length;a++){var i=e.id.nesting[a];if(r=i in n&&n[i]===e.focus.value){t=a;break}}return r})[0]);n||(n=e.container.button.data()[0]||e.data.viz[0]),e.container.button.data([n]).id(e.id.nesting).depth(t)}var l=e.hover.value===!0&&e.focus.value;e.container.button.draw({update:e.draw.update}).focus("").font(e.font).format(e.format).hover(l).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 s=e.container.button.container(Object).ui;e.margin.top+=s.node().offsetHeight||s.node().getBoundingClientRect().height,s.on(a.click,function(){e.self.open(!e.open.value).draw()})}},{"../../../../client/pointer.coffee":40,"../../../../core/console/print.coffee":54,"../../../../util/copy.coffee":210,"../../../form.js":106}],148:[function(e,t,n){var r=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 n=a(e.search.term).split("_"),i=[e.id.value,e.text.value,e.alt.value,e.keywords.value];i=i.filter(function(e){return e}),n=n.filter(function(e){return""!==e});var o=[],l=[],s=[],u=[];if(e.id.nesting.forEach(function(t){u=u.concat(e.data.nested.all[t])}),u.forEach(function(t){var r=!1;i.forEach(function(i){if(!r&&i in t&&"string"==typeof t[i]){var u=t[i].toLowerCase();if([e.text.value,e.id.value].indexOf(i)>=0&&0===u.indexOf(e.search.term))o.push(t),r=!0;else if(u.indexOf(e.search.term)>=0)l.push(t),r=!0;else{var c=a(u).split("_");for(var f in c){if(r)break;for(var d in n)if(0===c[f].indexOf(n[d])){s.push(t),r=!0;break}}}}})}),e.data.filtered=d3.merge([o,l,s]),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]=r(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":176,"../../../../string/strip.js":178}],149:[function(e,t,n){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()})}},{}],150:[function(e,t,n){t.exports=function(e){var t=e.height.secondary,n=e.container.button.container().node().getBoundingClientRect(),r=window.innerHeight-n.bottom-2*e.ui.border-e.ui.margin.top-e.ui.margin.bottom-e.ui.padding.top-e.ui.padding.bottom;r<3*n.height&&(r=n.top-10,e.self.open({flipped:!0})),"number"!=typeof t&&(t=r),t>e.height.max&&(t=e.height.max),e.self.height({secondary:t})}},{}],151:[function(e,t,n){var r,a,i,o;r=e("./active.js"),a=e("../../../../util/copy.coffee"),i=e("../../../form.js"),o=e("../../../../core/console/print.coffee"),t.exports=function(e){var t,n,l;e.open.value&&(e.dev.value&&o.time("updating list items"),"items"in e.container||(e.container.items=i().container(e.container.list).type("button").ui({border:0,display:"block",margin:0}).width(!1)),n=e.draw.timing?e.data.large:1,l=a(e.order),l.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 n,a,i,o;a=e.data.filtered.filter(function(n){return n[e.id.value]===t})[0],e.depth.value<e.id.nesting.length-1&&e.id.nesting[e.depth.value+1]in a?(i=e.depth.value,o=e.id.solo.value,e.history.states.push(function(){return e.self.depth(i).id({solo:o}).draw()}),e.self.depth(e.depth.value+1).id({solo:[t]}).draw()):(e.depth.changed||e.self.open(!1),n=t!==e.focus.value,n&&e.active.value&&(n=r(e,t)),n&&e.self.focus(t).draw())}),e.container.items.active(e.active.value).data({large:n,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(l).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&&o.timeEnd("updating list items"))}},{"../../../../core/console/print.coffee":54,"../../../../util/copy.coffee":210,"../../../form.js":106,"./active.js":145}],152:[function(e,t,n){t.exports=function(e){return d3.select(window).on("keydown."+e.container.id,function(){var t,n,r,a,i,o,l,s,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",l=!1,d=e.data.filtered,o=s=0,c=d.length;s<c;o=++s)if(t=d[o],t[e.id.value]===e[f].value){l=o;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 l===!1?l=0:38===u?e.open.value&&(l<=0?l=e.data.filtered.length-1:l-=1):40===u&&e.open.value&&(l>=e.data.filtered.length-1?l=0:l+=1),i="boolean"!=typeof e.hover.value?e.data.filtered[l][e.id.value]:e.focus.value,e.self.hover(i).open(!0).draw();if(13===u)return"boolean"!=typeof e.hover.value?(n=e.data.filtered.filter(function(t){return t[e.id.value]===e.hover.value})[0],r=e.depth.value,r<e.id.nesting.length-1&&e.id.nesting[r+1]in n?(p=e.id.solo.value,a=function(){return e.self.depth(r).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()}}})}},{}],153:[function(e,t,n){var r=e("../../../../core/console/print.coffee");t.exports=function(e){e.dev.value&&r.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&&r.timeEnd("populating list")}},{"../../../../core/console/print.coffee":54}],154:[function(e,t,n){var r=e("../../../../core/console/print.coffee");t.exports=function(e){if(e.open.value){e.dev.value&&r.time("calculating height");var t=!1;if("none"==e.container.selector.style("display"))var t=!0;t&&e.container.selector.style("display","block");var n=e.container.selector.style("height"),a=e.container.selector.property("scrollTop"),i=e.container.list.style("max-height"),o=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",i).property("scrollTop",o),e.container.selector.style("height",n).property("scrollTop",a);var l=!1;if(e.container.listHeight>e.height.secondary&&(e.container.listHeight=e.height.secondary,l=!0),t&&e.container.selector.style("display","none"),e.dev.value&&r.timeEnd("calculating height"),l){e.dev.value&&r.time("calculating scroll position");var s=e.container.list.select("div").selectAll("div.d3plus_node"),u=s[0][0],c="boolean"!=typeof e.hover.value?e.hover.value:e.focus.value;s.each(function(t,n){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&&r.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":54}],155:[function(e,t,n){var r=e("../../../../client/prefix.coffee"),a=e("../../../../core/console/print.coffee");t.exports=function(t){function n(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 i(e){var n=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",n+"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(r()+"border-radius","0").attr("placeholder",t.format.value(t.format.locale.value.method.search))}t.dev.value&&a.time("creating search");var o=e("./data.js"),l=e("./items.coffee"),s=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(n),t.container.search.select("input").transition().duration(t.draw.timing).call(i)):(t.container.search.call(n),t.container.search.select("input").call(i)),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(n).append("input").attr("id","d3plus_drop_input_"+t.container.id).style("-webkit-appearance","none").call(i),t.container.search.select("input").on("keyup."+t.container.id,function(e){var n=this.value;t.search.term!==n&&(t.search.term=n,o(t),l(t),s(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":41,"../../../../core/console/print.coffee":54,"./data.js":148,"./items.coffee":151,"./update.js":158}],156:[function(e,t,n){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")}},{}],157:[function(e,t,n){var r=e("../../../../client/pointer.coffee"),a=e("../../../../color/lighter.coffee"),i=e("../../../../core/console/print.coffee"),o=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",o(e.ui.color.secondary.value))}function n(t){if(!t.empty()){var n=0===e.icon.back.value.indexOf("fa-")?" fa "+e.icon.back.value:"";n="d3plus_drop_back"+n;var r=0===e.icon.back.value.indexOf("fa-")?"":e.icon.back.value;t.style("position","absolute").attr("class",n).style("top",e.ui.padding.top+e.font.secondary.size/2/2.5+"px").html(r)}}function l(t){var n=u?e.focus.value:e.format.locale.value.ui.back;t.text(e.format.value(n)).style("padding","0px "+(e.ui.padding.left+e.ui.padding.right)+"px")}if(e.open.value){e.dev.value&&i.time("creating title and back button");var s=1===e.id.solo.value.length&&e.depth.value>0,u=s,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(s?["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(l)):(e.container.title.call(t),e.container.title.select("div.d3plus_drop_title_text").call(l)),e.container.title.select("span.d3plus_drop_back").call(n);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(n),p.append("div").attr("id","d3plus_drop_title_text_"+e.container.id).attr("class","d3plus_drop_title_text").call(l),e.container.title.on(r.over,function(t,n){var r=a(e.ui.color.secondary.value);d3.select(this).style("cursor","pointer").transition().duration(e.timing.mouseevents).style("background-color",r).style("color",o(r))}).on(r.out,function(t){var n=e.ui.color.secondary.value;d3.select(this).style("cursor","auto").transition().duration(e.timing.mouseevents).style("background-color",n).style("color",o(n))}).on(r.click,function(t){e.history.back()}),e.container.title.exit().remove(),s&&(e.margin.title+=e.container.title.node().offsetHeight||e.container.title.node().getBoundingClientRect().height),e.dev.value&&i.timeEnd("creating title and back button")}}},{"../../../../client/pointer.coffee":40,"../../../../color/lighter.coffee":47,"../../../../color/text.coffee":52,"../../../../core/console/print.coffee":54}],158:[function(e,t,n){var r=e("./items.coffee"),a=e("./height.js"),i=e("../../../../core/console/print.coffee"),o=e("./scroll.js"),l=e("./arrow.js");t.exports=function(e){function t(t){var n=e.open.flipped.value;t.style("top",function(){return n?"auto":e.margin.top-e.ui.border+"px"}).style("bottom",function(){return n?e.margin.top+e.ui.border+"px":"auto"})}function n(n){n.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 s(n){n.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"}),r(e),a(e),o(e),l(e),e.dev.value&&i.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(n).each("end",function(){d3.select(this).transition().duration(e.draw.timing).call(s)}),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(n).call(s),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&&i.timeEnd("drawing list")}},{"../../../../core/console/print.coffee":54,"./arrow.js":146,"./height.js":150,"./items.coffee":151,"./scroll.js":154}],159:[function(e,t,n){var r=e("../../../../util/copy.coffee"),a=e("../../../../core/font/tester.coffee"),i=e("../../../form.js"),o=e("../../../../core/console/print.coffee"),l=e("../../../../object/validate.coffee");t.exports=function(e){function t(t){var r="primary"===t?"value":t,l="value"===r?e.icon.drop.value:e.icon.select.value||e.icon.drop.value,s="value"===r?e.text.value:e.text.secondary.value||e.text.value,u="value"===r?e.font:e.font.secondary;e.dev.value&&o.time("calculating "+t+" width");var c=i().container(a()).data({large:9999,value:n}).draw({update:!1}).font(u).format(e.format).icon({button:l,value:e.icon.value}).id(e.id.value).timing({ui:0}).text(s||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[r]=d3.max(f),e.self.width(d),e.dev.value&&o.timeEnd("calculating "+t+" width")}var n=[];for(var s in e.data.nested.all){var u=e.data.nested.all[s],c=l(e.text.nesting)&&s in e.text.nesting?e.text.nesting[s][0]:s;[e.id.value,e.text.value].indexOf(c)<0&&(u=r(u),u.forEach(function(t){t[e.text.value||e.id.value]=t[c]})),n=n.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":54,"../../../../core/font/tester.coffee":70,"../../../../object/validate.coffee":175,"../../../../util/copy.coffee":210,"../../../form.js":106}],160:[function(e,t,n){var r=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,n=t.parentNode;n&&["d3plus_node","d3plus_drop_title"].indexOf(n.className)>=0&&(t=n.parentNode),t&&n&&!r(e.container.ui,t)&&(e.open.value||e.hover.value)&&e.self.open(!1).hover(!1).draw()});try{var n=window.parent.location.host===window.location.host}catch(e){var n=!1}n&&t.self!==window.top&&a(e,t.parent)};t.exports=a},{"../../../../util/child.coffee":208}],161:[function(e,t,n){var r=e("../form.js");t.exports=function(e){"buttons"in e.container||(e.container.buttons=r().container(e.container.ui).type("button"));var t=e.data.viz.length,n=!!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=r().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(n).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":106}],162:[function(e,t,n){var r,a,i,o,l,s,u,c,f,d,p;d=e("simplify-js"),t.exports=function(e,t){var n,a,o,s,u,f,h,v,g,m,y,x,b,w,_,k,z,M,A,j,E,S,O,N,F,C,T,q,P,B,D,R,I,L,V,U,Y,H,X,G,Z,W,J,Q,K,$,ee,te,ne,re,ae,ie,oe,le,se,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(ne=d3.extent(e,function(e){return e[0]}),Y=ne[0],R=ne[1],re=d3.extent(e,function(e){return e[1]}),H=re[0],I=re[1],ge=Math.min(R-Y,I-H)*t.tolerance,ve=function(){var t,n,r;for(r=[],t=0,n=e.length;t<n;t++)J=e[t],r.push({x:J[0],y:J[1]});return r}(),ge>0&&(ve=d(ve,ge),e=function(){var e,t,n;for(n=[],e=0,t=ve.length;e<t;e++)J=ve[e],n.push([J.x,J.y]);return n}()),t.vdebug&&w.push({type:"simplify",poly:e}),ae=d3.extent(e,function(e){return e[0]}),Y=ae[0],R=ae[1],ie=d3.extent(e,function(e){return e[1]}),H=ie[0],I=ie[1],m=[[Y,H],[R,H],[R,I],[Y,I]],oe=[R-Y,I-H],x=oe[0],y=oe[1],ye=Math.min(x,y)/50,null==W)for(W=[],b=d3.geom.polygon(e).centroid(),i(b,e)&&W.push(b);W.length<t.nTries;)pe=Math.random()*x+Y,he=Math.random()*y+H,de=[pe,he],i(de,e)&&W.push(de);for(t.vdebug&&w.push({type:"origins",points:W}),T=0,B=null,M=0,S=f.length;M<S;M++)for(o=f[M],s=-o*Math.PI/180,t.vdebug&&w.push({type:"angle",angle:o}),k=A=0,O=W.length;A<O;k=++A)for(G=W[k],le=r(e,G,s),K=le[0],ee=le[1],se=r(e,G,s+Math.PI/2),Q=se[0],$=se[1],X=[],null!=K&&null!=ee&&X.push([(K[0]+ee[0])/2,(K[1]+ee[1])/2]),null!=Q&&null!=$&&X.push([(Q[0]+$[0])/2,(Q[1]+$[1])/2]),t.vdebug&&w.push({type:"modifOrigin",idx:k,p1W:K,p2W:ee,p1H:Q,p2H:$,modifOrigins:X}),j=0,N=X.length;j<N;j++)if(Z=X[j],t.vdebug&&w.push({type:"origin",cx:Z[0],cy:Z[1]}),ue=r(e,Z,s),K=ue[0],ee=ue[1],null!==K&&null!==ee&&(U=Math.min(p(Z,K),p(Z,ee)),D=2*Math.sqrt(U),ce=r(e,Z,s+Math.PI/2),Q=ce[0],$=ce[1],null!==Q&&null!==$&&(V=Math.min(p(Z,Q),p(Z,$)),P=2*Math.sqrt(V),!(D*P<T))))for(null!=g?a=g:(L=Math.max(1,t.minWidth/P,T/(P*P)),q=Math.min(t.maxAspectRatio,D/t.minHeight,D*D/T),a=d3.range(L,q+v,v)),C=0,F=a.length;C<F;C++)if(n=a[C],E=Math.max(t.minWidth,Math.sqrt(T*n)),fe=Math.min(D,P*n),!(fe*P<T))for(fe-E>=ye&&t.vdebug&&w.push({type:"aRatio",aRatio:n});fe-E>=ye;)me=(E+fe)/2,_=me/n,xe=Z[0],be=Z[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,s,Z),l(te,e)?(z=!0,T=me*_,B={cx:xe,cy:be,width:me,height:_,angle:o},E=me):(z=!1,fe=me),t.vdebug&&w.push({type:"rectangle",cx:xe,cy:be,width:me,height:_,areaFraction:me*_/h,angle:o,insidePoly:z});return[B,T,w]},p=function(e,t){var n,r;return n=t[0]-e[0],r=t[1]-e[1],n*n+r*r},s=function(e,t,n){var r,a,i,o,l;return l=t[1]<n[1]?[t,n]:[n,t],r=l[0],a=l[1],e[1]!==a[1]&&e[1]!==r[1]||(e[1]+=Number.MIN_VALUE),!(e[1]>a[1]||e[1]<r[1])&&(!(e[0]>r[0]&&e[0]>a[0])&&(e[0]<r[0]&&e[0]<a[0]||(i=(a[1]-r[1])/(a[0]-r[0]),o=(e[1]-r[1])/(e[0]-r[0]),o>i)))},i=function(e,t){var n,r,a,i,o;for(i=-1,o=t.length,r=t[o-1],a=0;++i<o;)n=r,r=t[i],s(e,n,r)&&a++;return a%2!==0},o=function(e,t,n){var r,a,i;return r=1e-9,a=e[0],i=e[1],!(a<Math.min(t[0],n[0])-r||a>Math.max(t[0],n[0])+r||i<Math.min(t[1],n[1])-r||i>Math.max(t[1],n[1])+r)},a=function(e,t,n,r){var a,i,o,l,s,u,c,f,d,p;return f=1e-9,l=e[0]-t[0],u=e[1]-t[1],s=n[0]-r[0],c=n[1]-r[1],o=l*c-u*s,Math.abs(o)<f?null:(a=e[0]*t[1]-e[1]*t[0],i=n[0]*r[1]-n[1]*r[0],d=(a*s-i*l)/o,p=(a*c-i*u)/o,[d,p])},f=function(e,t,n,r){var i;return i=a(e,t,n,r),null!=i&&(o(i,e,t)&&o(i,n,r))},l=function(e,t){var n,r,a,o,l,s,u,c;for(l=-1,u=e.length,c=t.length,a=e[u-1];++l<u;)for(n=a,a=e[l],s=-1,o=t[c-1];++s<c;)if(r=o,o=t[s],f(n,a,r,o))return!1;return i(e[0],t)},u=function(e,t,n){var r,a,i,o;return null==n&&(n=[0,0]),i=e[0]-n[0],o=e[1]-n[1],r=Math.cos(t),a=Math.sin(t),[r*i-a*o+n[0],a*i+r*o+n[1]]},c=function(e,t,n){var r,a,i,o;for(o=[],r=0,a=e.length;r<a;r++)i=e[r],o.push(u(i,t,n));return o},r=function(e,t,n){var r,i,l,s,u,c,f,d,h,v,g,m,y,x,b;for(u=1e-9,t=[t[0]+u*Math.cos(n),t[1]+u*Math.sin(n)],x=t[0],b=t[1],m=[x+Math.cos(n),b+Math.sin(n)],f=0,Math.abs(m[0]-x)<u&&(f=1),c=-1,v=e.length,i=e[v-1],d=Number.MAX_VALUE,h=Number.MAX_VALUE,l=null,s=null;++c<v;)r=i,i=e[c],g=a(t,m,r,i),null!=g&&o(g,r,i)&&(y=p(t,g),g[f]<t[f]?y<d&&(d=y,l=g):g[f]>t[f]&&y<h&&(h=y,s=g));return[l,s]}},{"simplify-js":9}],163:[function(e,t,n){t.exports=function(e,t,n){var r,a,i,o;return a={x:0,y:0},e<0&&(e=2*Math.PI+e),"square"===n?(i=45*(Math.PI/180),e<=Math.PI?e<Math.PI/2?e<i?(a.x+=t,o=Math.tan(e)*t,a.y+=o):(a.y+=t,r=t/Math.tan(e),a.x+=r):e<Math.PI-i?(a.y+=t,r=t/Math.tan(Math.PI-e),a.x-=r):(a.x-=t,o=Math.tan(Math.PI-e)*t,a.y+=o):e<3*Math.PI/2?e<i+Math.PI?(a.x-=t,o=Math.tan(e-Math.PI)*t,a.y-=o):(a.y-=t,r=t/Math.tan(e-Math.PI),a.x-=r):e<2*Math.PI-i?(a.y-=t,r=t/Math.tan(2*Math.PI-e),a.x+=r):(a.x+=t,o=Math.tan(2*Math.PI-e)*t,a.y-=o)):(a.x+=t*Math.cos(e),a.y+=t*Math.sin(e)),a}},{}],164:[function(e,t,n){var r;r=e("../geom/offset.coffee"),t.exports=function(e){var t,n,a,i,o,l,s,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,o=e.length;a<o;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],i=c.pop().split(",").map(function(e){return parseFloat(e)}),p=parseFloat(c.shift().split(",")[0]),m=Math.sqrt(Math.pow(i[0]-d[0],2)+Math.pow(i[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),l=t/(2*Math.PI)*(p*Math.PI*2),h=l/5,v=Math.atan2(-d[1],-d[0])-Math.PI,g=t/h,n=g;n<t;)s=r(v+n,p),f.push([s.x,s.y]),n+=g;f.push(i)}return f}},{"../geom/offset.coffee":163}],165:[function(e,t,n){var r,a,i;r={},r.version="1.9.8 - Cornflower",r.repo="https://github.com/alexandersimoes/d3plus/",r.array={comparator:e("./array/comparator.coffee"),contains:e("./array/contains.coffee"),sort:e("./array/sort.coffee"),update:e("./array/update.coffee")},r.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")},r.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")},r.data={bestRegress:e("./data/bestRegress.coffee"),lof:e("./data/lof.coffee"),mad:e("./data/mad.coffee")},r.font={sizes:e("./font/sizes.coffee"),validate:e("./font/validate.coffee")},r.form=e("./form/form.js"),r.geom={largestRect:e("./geom/largestRect.coffee"),offset:e("./geom/offset.coffee"),path2poly:e("./geom/path2poly.coffee")},r.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")},r.number={format:e("./number/format.coffee")},r.object={merge:e("./object/merge.coffee"),validate:e("./object/validate.coffee")},r.string={format:e("./string/format.js"),list:e("./string/list.coffee"),strip:e("./string/strip.js"),title:e("./string/title.coffee")},r.textwrap=e("./textwrap/textwrap.coffee"),r.tooltip={create:e("./tooltip/create.js"),move:e("./tooltip/move.coffee"),remove:e("./tooltip/remove.coffee")},r.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")},r.viz=e("./viz/viz.coffee"),i=e("./client/css.coffee"),a=e("./core/console/print.coffee"),i("d3plus.css")&&a.warning("d3plus.css has been deprecated, you do not need to load this file.",r.repo+"releases/tag/v1.4.0"),"undefined"!=typeof window&&(window.d3plus=r),t.exports=r},{"./array/comparator.coffee":34,"./array/contains.coffee":35,"./array/sort.coffee":36,"./array/update.coffee":37,"./client/css.coffee":38,"./client/ie.js":39,"./client/pointer.coffee":40,"./client/prefix.coffee":41,"./client/rtl.coffee":42,"./client/scroll.js":43,"./client/scrollbar.coffee":44,"./client/touch.coffee":45,"./color/legible.coffee":46,"./color/lighter.coffee":47,"./color/mix.coffee":48,"./color/random.coffee":49,"./color/scale.coffee":50,"./color/sort.coffee":51,"./color/text.coffee":52,"./color/validate.coffee":53,"./core/console/print.coffee":54,"./data/bestRegress.coffee":101,"./data/lof.coffee":102,"./data/mad.coffee":103,"./font/sizes.coffee":104,"./font/validate.coffee":105,"./form/form.js":106,"./geom/largestRect.coffee":162,"./geom/offset.coffee":163,"./geom/path2poly.coffee":164,"./network/cluster.coffee":167,"./network/distance.coffee":168,"./network/normalize.coffee":169,"./network/shortestPath.coffee":170,"./network/smallestGap.coffee":171,"./network/subgraph.coffee":172,"./number/format.coffee":173,"./object/merge.coffee":174,"./object/validate.coffee":175,"./string/format.js":176,"./string/list.coffee":177,"./string/strip.js":178,"./string/title.coffee":179,"./textwrap/textwrap.coffee":203,"./tooltip/create.js":204,"./tooltip/move.coffee":205,"./tooltip/remove.coffee":206,"./util/buckets.coffee":207,"./util/child.coffee":208,"./util/closest.coffee":209,"./util/copy.coffee":210,"./util/d3selection.coffee":211,"./util/dataURL.coffee":212,"./util/uniques.coffee":213,"./viz/viz.coffee":336}],166:[function(e,t,n){window.d3=e("d3"),window.topojson=e("topojson")},{d3:3,topojson:33}],167:[function(e,t,n){var r;r=e("./normalize.coffee"),t.exports=function(e,t){var n,a,i,o,l,s,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,M,A,j,E,S,O,N,F,C,T;if(v=[],null==t&&(t={}),(null==t.nodes||"object"!=typeof t.nodes)&&(N=r(e,t),e=N[0],t=N[1],null===t))return null;d=t.distance,E=t.nodeid,T=t.startpoint,h=t.endpoint,S=t.nodes,O={};for(m in S)O[m]={node:S[m].node,degree:0};for(z=0,k={},g=0,w=e.length;g<w;g++)p=e[g],a=E(T(p)),i=E(h(p)),a in k||(k[a]={}),i in k||(k[i]={}),i in k[a]||(k[a][i]=0,k[i][a]=0,z++,O[a].degree+=1,O[i].degree+=1);u={},n=0;for(m in O)j=O[m],u[m]={score:j.degree/(2*z),nodes:[m]};for(a in k)for(i in k[a])k[a][i]=1/(2*z)-O[a].degree*O[i].degree/(4*z*z);for(y=0;y<1e3;){f=-1,M=void 0,A=void 0;for(a in k)for(i in k[a])k[a][i]>f&&(f=k[a][i],M=a,A=i);if(f<0)break;for(b in k[M])b!==A&&(b in k[A]?k[A][b]+=k[M][b]:k[A][b]=k[M][b]-2*u[A].score*u[b].score,k[b][A]=k[A][b]),delete k[b][M];for(b in k[A])b in k[M]||b===A||(k[A][b]-=2*u[M].score*u[b].score,k[b][A]=k[A][b]);for(F=u[M].nodes,x=0,_=F.length;x<_;x++)j=F[x],u[A].nodes.push(j);u[A].score+=u[M].score,t.vdebug&&v.push({type:"merge",father:A,child:M,nodes:u[A].nodes}),delete u[M],delete k[M],n+=f,y++}return s=function(){var e;e=[];for(o in u)c=u[o],e.push([o,c.nodes.length]);return e}(),s.sort(function(e,t){return t[1]-e[1]}),C=function(){var e,t,n;for(n=[],e=0,t=s.length;e<t;e++)l=s[e],n.push(u[l[0]].nodes);return n}(),[C,v]}},{"./normalize.coffee":169}],168:[function(e,t,n){t.exports=function(e,t){var n,r;return e instanceof Array||(e=[e.x,e.y]),t instanceof Array||(t=[t.x,t.y]),n=Math.abs(e[0]-t[0]),r=Math.abs(e[1]-t[1]),Math.sqrt(n*n+r*r)}},{}],169:[function(e,t,n){var r;r=e("../core/console/print.coffee"),t.exports=function(e,t){var n,a,i,o,l,s,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,M,A,j,E,S,O,N,F,C;if(O=t.source,F=t.target,o=t.directed,l=t.distance,A=t.nodeid,N=t.startpoint,c=t.endpoint,n=t.K,C=t.vdebug,o||(o=!1),null==n&&(n=1),null==A?A=function(e){return e}:"string"==typeof A&&(A=function(e){return function(t){return t[e]}}(A)),null!=O&&"object"==typeof O&&(O=A(O)),null!=F&&"object"==typeof F&&(F=A(F)),null==N?N=function(e){return e.source}:"string"==typeof N&&(N=function(e){return function(t){return t[e]}}(N)),null==c?c=function(e){return e.target}:"string"==typeof c&&(c=function(e){return function(t){return t[e]}}(c)),null==l)l=function(e){return 1};else if("number"==typeof l)l=function(e){return function(t){return e}}(l);else if("string"==typeof l)l=function(e){return function(t){return t[e]}}(l);else if(l instanceof Array){for(u={},d=m=0,b=e.length;m<b;d=++m)s=e[d],a=A(N(s)),i=A(c(s)),u[a+"_"+i]=l[d];l=function(e){return a=A(N(e)),i=A(c(e)),u[a+"_"+i]}}for(j={},y=0,w=e.length;y<w;y++){for(s=e[y],z=N(s),M=c(s),v=A(z),g=A(M),E=[z,M],x=0,_=E.length;x<_;x++)k=E[x],p=A(k),p in j||(j[p]={node:k,outedges:[]});j[v].outedges.push(s),o||j[g].outedges.push(s)}return f=null,0===e.length?f="The length of edges is 0":n<0?f="K can not have negative value":null==l(e[0])?f="Check the distance function/attribute":null==N(e[0])?f="Check the startpoint function/attribute":null==c(e[0])?f="Check the endpoint function/attribute":(h=A(N(e[0])),null==h||"string"!=(S=typeof h)&&"number"!==S?f="Check the nodeid function/attribute":null==O||O in j?null==F||F in j||(f="The target is not in the graph"):f="The source is not in the graph"),null!=f?(r.error(f),null):[e,{source:O,target:F,directed:o,distance:l,nodeid:A,startpoint:N,endpoint:c,K:n,nodes:j,vdebug:C}]}},{"../core/console/print.coffee":54}],170:[function(e,t,n){var r,a;r=e("heap"),a=e("./normalize.coffee"),t.exports=function(e,t,n){var i,o,l,s,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,M,A,j,E,S,O,N,F,C;if(null==n&&(n={}),n.source=t,(null==n.nodes||"object"!=typeof n.nodes)&&(M=a(e,n),e=M[0],n=M[1],null===n))return null;t=n.source,N=n.target,u=n.directed,c=n.distance,_=n.nodeid,O=n.startpoint,d=n.endpoint,i=n.K,k=n.nodes;for(g in k)w=k[g],w.count=0;for(h=new r(function(e,t){return e.distance-t.distance}),C={},null==N&&(C[t]=!0),h.push({edge:null,target:t,distance:0}),b=0,S=[];!h.empty()&&(b=Math.max(b,h.size()),z=h.pop(),F=z.target,k[F].count++,null==N?S.push(z):F===N&&S.push(z),S.length!==i);)if(k[F].count<=i)for(A=k[F].outedges,v=0,y=A.length;v<y;v++){if(f=A[v],o=_(O(f)),s=_(d(f)),u||s!==F||(j=[s,o],o=j[0],s=j[1]),null==N){if(C[s])continue;C[s]=!0}l=z.distance+c(f),h.push({edge:f,previous:z,target:s,distance:l})}for(p=function(t){for(e=[];null!=t.edge;)e.push(t.edge),t=t.previous;return e.reverse()},m=0,x=S.length;m<x;m++)E=S[m],null!=N&&(delete E.target,E.edges=p(E)),delete E.edge,delete E.previous;return S}},{"./normalize.coffee":169,heap:4}],171:[function(e,t,n){var r;r=e("./distance.coffee"),t.exports=function(e,t){var n,a;return t||(t={}),n=[],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,i,o,l,s,u,c,f;if(!e.leaf)for(c=e.nodes,a=0,o=c.length;a<o;a++)if(s=c[a],s&&s.point)if(t.origin)n.push(r(s,t));else for(f=e.nodes,i=0,l=f.length;i<l;i++)u=f[i],u&&u.point&&u.point!==s.point&&n.push(r(s,u));return!1}),t.all?n.sort(function(e,t){return e-t}):d3.min(n)}},{"./distance.coffee":168}],172:[function(e,t,n){var r;r=e("./normalize.coffee"),t.exports=function(e,t,n){var a,i,o,l,s,u,c,f,d,p,h,v;return null==n&&(n={}),n.source=t,null!=n.nodes&&"object"==typeof n.nodes||(p=r(e,n),e=p[0],n=p[1],null!==n)?(t=n.source,o=n.directed,l=n.distance,f=n.nodeid,h=n.startpoint,u=n.endpoint,a=n.K,d=n.nodes,v={},v[t]=!0,i=function(e,t){var n,r,s,c,p,g,m,y,x;for(m=d[e].outedges,x=[],c=0,p=m.length;c<p;c++)s=m[c],n=f(h(s)),r=f(u(s)),o||r!==e||(y=[r,n],n=y[0],r=y[1]),r in v?x.push(void 0):(g=t+l(s),g<=a?(v[r]=!0,x.push(i(r,g))):x.push(void 0));return x},i(t,0),{nodes:function(){var e;e=[];for(c in v)e.push(d[c].node);return e}(),edges:function(){var t,n,r;for(r=[],t=0,n=e.length;t<n;t++)s=e[t],f(h(s))in v&&f(u(s))in v&&r.push(s);return r}()}):null}},{"./normalize.coffee":169}],173:[function(e,t,n){var r;r=e("../core/locale/languages/en_US.coffee"),t.exports=function(e,t){var n,a,i,o,l,s,u,c,f,d,p,h;return void 0===e||null===e||e===!1?"":(t||(t={}),s="locale"in t?t.locale:r,d=s.time.slice(),a=d3.locale(s.format),t||(t={}),p=t.vars||{},i=t.key,o=!("labels"in t)||t.labels,l=e.toString().split(".")[0].length,p.time&&p.time.value&&d.push(p.time.value),"string"==typeof i&&d.indexOf(i.toLowerCase())>=0?u=e:"share"===i?(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?(l=e.toString().split("."),c=1,l.length>1&&(c=d3.min([parseFloat(l[1]).toString().length,2]),-1<e&&e<1||(h=l[1].length-parseFloat(l[1]).toString().length,c+=1+h)),u=a.numberFormat("."+c+"g")(e)):l>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(s.format.decimal,"."),e=parseFloat(e)+"",e=e.replace(".",s.format.decimal),u=e+f):u=3===l?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)),o&&i&&"format"in p&&i in p.format.affixes.value?(n=p.format.affixes.value[i],n[0]+u+n[1]):u)}},{"../core/locale/languages/en_US.coffee":72}],174:[function(e,t,n){var r,a;r=e("../util/d3selection.coffee"),a=e("./validate.coffee"),t.exports=function(e,t){var n,i;return n=function(e,t,i){var o,l,s;l=[];for(o in e)s=e[o],"undefined"!=typeof s?!i&&a(s)?("object"!=typeof t[o]&&(t[o]={}),l.push(n(s,t[o],0===o.indexOf("d3plus")))):!r(s)&&s instanceof Array?l.push(t[o]=s.slice(0)):l.push(t[o]=s):l.push(void 0);return l},i={},e&&n(e,i),t&&n(t,i),i}},{"../util/d3selection.coffee":211,"./validate.coffee":175}],175:[function(e,t,n){t.exports=function(e){return e&&e.constructor===Object}},{}],176:[function(e,t,n){t.exports=function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return t.unkeyed_index=0,t.replace(/\{(\w*)\}/g,function(n,r){if(""===r&&(r=t.unkeyed_index,t.unkeyed_index++),r==+r)return"undefined"!==e[r]?e[r]:n;for(var a=0;a<e.length;a++)if("object"==typeof e[a]&&"undefined"!=typeof e[a][r])return e[a][r];return n}.bind(t))}},{}],177:[function(e,t,n){var r,a;r=e("./format.js"),a=e("../core/locale/languages/en_US.coffee").ui,t.exports=function(e,t,n,i){var o;return e instanceof Array?(e=e.slice(0),t||(t=a.and),i||(i=a.moreText),2===e.length?e.join(" "+t+" "):(n&&e.length>n&&(o=e.length-n+1,e=e.slice(0,n-1),e[n-1]=r(i,o)),e.length>1&&(e[e.length-1]=t+" "+e[e.length-1]),e.join(", "))):e}},{"../core/locale/languages/en_US.coffee":72,"./format.js":176}],178:[function(e,t,n){t.exports=function(e){var t=["!","@","#","$","%","^","&","*","(",")","[","]","{","}",".",",","/","\\","|","'",'"',";",":","<",">","?","=","+"],n=[[/[\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 r=e,a=0;a<n.length;a++)if(new RegExp(n[a][0]).test(e)){r=n[a][1];break}return r})}},{}],179:[function(e,t,n){var r;r=e("../core/locale/languages/en_US.coffee"),t.exports=function(e,t){var n,a,i,o,l;return e?(t||(t={}),i=t.key,"."===e.charAt(e.length-1)?e.charAt(0).toUpperCase()+e.substr(1):(o="locale"in this?this.locale.value:r,l=o.lowercase.map(function(e){return e.toLowerCase()}),a=o.uppercase,a=a.concat(a.map(function(e){return e+"s"})),n=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,r){var i,o;return t?(i=n.indexOf(t.toLowerCase()),o=i>=0?a[i]:l.indexOf(t.toLowerCase())>=0&&0!==r&&r!==e.length-1?t.toLowerCase():t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()):""}))):""}},{"../core/locale/languages/en_US.coffee":72}],180:[function(e,t,n){var r,a;r=e("./foreign.coffee"),a=e("./tspan.coffee"),t.exports=function(e){e.text.html.value?r(e):a(e)}},{"./foreign.coffee":181,"./tspan.coffee":184}],181:[function(e,t,n){t.exports=function(e){var t,n,r,a,i;i=e.container.value,r=i.attr("font-family")||i.style("font-family"),t=e.align.value||i.attr("text-anchor")||i.style("text-anchor"),n=i.attr("fill")||i.style("fill"),a=i.attr("opacity")||i.style("opacity"),t="end"===t?"right":"middle"===t?"center":"left",d3.select(i.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",r).style("font-size",e.size.value[1]+"px").style("color",n).style("text-align",t).style("opacity",a).text(e.text.current)}},{}],182:[function(e,t,n){t.exports=function(e){var t,n,r,a,i,o,l,s,u,c;if(n=e.container.value,a=n.node().previousElementSibling,o=a?a.tagName.toLowerCase():"",a&&(a=d3.select(a)),e.container.x=e.x.value||parseFloat(n.attr("x"),10),e.container.y=e.y.value||parseFloat(n.attr("y"),10),a&&(e.shape.accepted.indexOf(o)>=0&&e.self.shape(o), | |
"rect"===o?(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||(s=parseFloat(a.attr("width")),e.self.width(s)),e.height.value||(r=parseFloat(a.attr("height")),e.self.height(r))):"circle"===o?(i=parseFloat(a.attr("r"),10),u=parseFloat(a.attr("cx"),10)||0,u-=i,c=parseFloat(a.attr("cy"),10)||0,c-=i,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*i,10),e.height.value||e.self.height(2*i,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,l=n.attr("font-size")||n.style("font-size"),l=parseFloat(l,10),e.container.fontSize=l,e.container.dy=parseFloat(n.attr("dy"),10),!e.size.value)return e.resize.value?e.self.size([4,80]):e.self.size([l/2,l])}},{}],183:[function(e,t,n){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")}},{}],184:[function(e,t,n){var r;r=e("../../client/rtl.coffee"),t.exports=function(e){var t,n,a,i,o,l,s,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,M,A,j,E,S,O,N,F;return d=function(t){var r;return r=!v||t?e.container.value.append("tspan"):e.container.value.insert("tspan","tspan"),r.attr("x",S+"px").attr("dy",n+"px").style("baseline-shift","0%").attr("dominant-baseline","alphabetic")},f=e.rotate.value===-90||90===e.rotate.value,A=f?e.height.inner:e.width.inner,l=f?e.width.inner:e.height.inner,t="circle"===e.shape.value?"middle":e.align.value||e.container.align||"start",O="end"===t||"start"===t&&r?A:"middle"===t?A/2:0,M=e.valign.value||"top",S=e.container.x+O,i=e.resize.value?e.size.value[1]:e.container.fontSize||e.size.value[0],n=e.container.dy||1.1*i,_=null,h=null,j=null,v=!1,F=0,"circle"===e.shape.value&&("middle"===M?F=l/n%1*n/2:"end"===M&&(F=l/n%1*n)),e.container.value.attr("text-anchor",t).attr("font-size",i+"px").style("font-size",i+"px").attr("x",e.container.x).attr("y",e.container.y),z=function(){if(_.remove(),v?(s++,_=e.container.value.select("tspan")):(s--,_=d3.select(e.container.value.node().lastChild)),!_.empty())return j=_.text().match(/[^\s-]+-?/g),a()},u=function(){var t;return"circle"===e.shape.value?(t=(s-1)*n+F,t>l/2&&(t+=n),2*Math.sqrt(t*(2*(A/2)-t))):A},a=function(){var t,n;return j&&j.length?(n=j.pop(),t=n.charAt(n.length-1),1===n.length&&e.text.split.value.indexOf(n)>=0?a():(e.text.split.value.indexOf(t)>=0&&(n=n.substr(0,n.length-1)),_.text(j.join(" ")+" "+n+"..."),_.node().getComputedTextLength()>u()?a():void 0)):z()},p=function(t){var n,r,a,i;if(n=_.text(),i="",v){if(i=e.text.current.charAt(e.text.current.length-h.length-1)," "===i)for(a="",r=2;" "===i;)a+=" ",i=e.text.current.charAt(e.text.current.length-h.length-r),r++;else a="";h=t+a+h,_.text(t+a+n)}else{if(i=e.text.current.charAt(h.length)," "===i)for(a="",r=1;" "===i;)a+=" ",i=e.text.current.charAt(h.length+r),r++;else a="";h+=a+t,_.text(n+a+t)}if(Math.floor(_.node().getComputedTextLength())>u()||"\n"===i)return _.text(n),n.length&&(_=d()),_.text(t),v?s--:s++},w=1,s=null,c=null,E=function(){var t,r,a,i,o,u;for(e.container.value.text("").html(""),j=e.text.words.slice(),v&&j.reverse(),h="",_=d(!0),s=w,r=0,a=j.length;r<a;r++){if(u=j[r],s*n>l){z();break}for(p(u),o=!0;o;){for(i=e.text.current.charAt(h.length),t=1;" "===i;)i=e.text.current.charAt(h.length+t),t++;o=e.text.split.value.indexOf(i)>=0,o&&p(i)}}return s*n>l&&z(),c=Math.abs(s-w)+1},E(),c=0,e.container.value.selectAll("tspan").each(function(){if(d3.select(this).text().length)return c++}),"circle"===e.shape.value&&(b=l-c*n,b>n&&("middle"===M?(w=(b/n/2>>0)+1,E()):"bottom"===M&&(v=!0,w=l/n>>0,E()))),c=0,e.container.value.selectAll("tspan").each(function(){if(d3.select(this).text().length)return c++}),"top"===M?N=0:(o=c*n,N="middle"===M?l/2-o/2:l-o),N-=.2*n,k="translate(0,"+N+")",180===e.rotate.value||e.rotate.value===-180?(y=e.container.x+A/2,x=e.container.y+l/2):(g=e.rotate.value<0?A:l,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":42}],185:[function(e,t,n){var r,a,i,o;r=e("./flow.coffee"),a=e("../../font/sizes.coffee"),o=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?i(e):r(e))},t.exports=o,i=function(e){var t,n,i,l,s,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,s=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}),n=1.165+y/s*.11,m=d3.sum(g,function(t){var n;return n=e.container.dy||1.2*h,t.width*n})*n,l="circle"===e.shape.value?Math.PI*Math.pow(y/2,2):f*s,(d>f||m>l)&&(i=Math.sqrt(l/m),x=f/d,v=d3.min([i,x]),h=d3.max([e.size.value[0],Math.floor(h*v)])),u=Math.floor(.8*s),h>u&&(h=u),d*(h/e.size.value[1])<=f?(h!==e.size.value[1]&&e.self.size([e.size.value[0],h]),r(e)):o(e)}},{"../../font/sizes.coffee":104,"./flow.coffee":180}],186:[function(e,t,n){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}},{}],187:[function(e,t,n){arguments[4][110][0].apply(n,arguments)},{dup:110}],188:[function(e,t,n){var r;r=e("../../util/d3selection.coffee"),t.exports={accepted:[!1,Array,Object,String],element:!1,id:"default",process:function(e){return e!==!1&&(r(e)?e:e instanceof Array?d3.select(e[0][0]):(this.selector=e,d3.select(e)))},value:!1}},{"../../util/d3selection.coffee":211}],189:[function(e,t,n){arguments[4][114][0].apply(n,arguments)},{dup:114}],190:[function(e,t,n){var r,a;r=e("../../core/console/print.coffee"),a=e("../../string/format.js"),t.exports={accepted:[void 0],process:function(e,t){var n,i;return this.initialized===!1?e:(t.container.value===!1?(i=t.format.locale.value.dev.setContainer,r.warning(i,"container")):t.container.value.empty()?(i=t.format.locale.value.dev.noContainer,n=t.container.selector||"",r.warning(a(i,'"'+n+'"'),"container")):(t.dev.value&&r.time("total draw time"),t.container.value.call(t.self)),e)},value:void 0}},{"../../core/console/print.coffee":54,"../../string/format.js":176}],191:[function(e,t,n){var r,a;r=e("../../core/locale/locale.coffee"),a=e("../../object/merge.coffee"),t.exports={accepted:[Function,String],locale:{accepted:function(){return d3.keys(r)},process:function(e){var t,n;return t="en_US",n=r[t],e!==t&&(n=a(n,r[e])),this.language=e,n},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":81,"../../object/merge.coffee":174}],192:[function(e,t,n){t.exports={accepted:[!1,Number],value:!1}},{}],193:[function(e,t,n){arguments[4][192][0].apply(n,arguments)},{dup:192}],194:[function(e,t,n){arguments[4][114][0].apply(n,arguments)},{dup:114}],195:[function(e,t,n){t.exports={accepted:[-180,-90,0,90,180],value:0}},{}],196:[function(e,t,n){t.exports={accepted:["circle","square"],value:!1}},{}],197:[function(e,t,n){t.exports={accepted:[Array,!1],value:!1}},{}],198:[function(e,t,n){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:["-","/",";",":","&"]}}},{}],199:[function(e,t,n){t.exports={accepted:[!1,"top","middle","bottom"],value:!1}},{}],200:[function(e,t,n){arguments[4][192][0].apply(n,arguments)},{dup:192}],201:[function(e,t,n){arguments[4][192][0].apply(n,arguments)},{dup:192}],202:[function(e,t,n){arguments[4][192][0].apply(n,arguments)},{dup:192}],203:[function(e,t,n){var r,a,i,o,l;r=e("../core/methods/attach.coffee"),i=e("./helpers/parseSize.coffee"),a=e("../core/console/print.coffee"),o=e("./helpers/parseText.coffee"),l=e("./helpers/wrap.coffee"),t.exports=function(){var t;return t={self:function(e){return e.each(function(){i(t),t.size.value[0]<=t.height.inner?(o(t),l(t)):t.container.value.html(""),t.dev.value&&a.timeEnd("total draw time")}),t.self}},r(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":54,"../core/methods/attach.coffee":82,"./helpers/parseSize.coffee":182,"./helpers/parseText.coffee":183,"./helpers/wrap.coffee":185,"./methods/align.coffee":186,"./methods/config.coffee":187,"./methods/container.coffee":188,"./methods/dev.coffee":189,"./methods/draw.coffee":190,"./methods/format.coffee":191,"./methods/height.coffee":192,"./methods/padding.coffee":193,"./methods/resize.coffee":194,"./methods/rotate.coffee":195,"./methods/shape.coffee":196,"./methods/size.coffee":197,"./methods/text.coffee":198,"./methods/valign.coffee":199,"./methods/width.coffee":200,"./methods/x.coffee":201,"./methods/y.coffee":202}],204:[function(e,t,n){function r(){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"),i=e("../client/pointer.coffee"),o=e("../color/legible.coffee"),l=e("./move.coffee"),s=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,n=s();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(i.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(n+"box-shadow","0px 1px 3px rgba(0, 0, 0, 0.25)").style("position","absolute").on(i.out,r);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,B=e.parent?.75*v:.75*window.innerHeight,_.style("width",z+"px").style("height",B+"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 M=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(n+"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(i.over,function(){d3.select(this).style("cursor","pointer").style(n+"box-shadow","0 1px 3px rgba(0, 0, 0, 0.5)")}).on(i.out,function(){d3.select(this).style("cursor","auto").style(n+"box-shadow","0 1px 3px rgba(0, 0, 0, 0.25)")}).on(i.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 A=d3.select(e.mouseevents).on(i.out),j=function(){var t=d3.event.toElement||d3.event.relatedTarget;if(t)var n="string"==typeof t.className?t.className:t.className.baseVal,a=0==n.indexOf("d3plus_tooltip");else var a=!1;t&&(E(w.node(),t)||E(e.mouseevents,t)||a)||(A(d3.select(e.mouseevents).datum()),r(),d3.select(e.mouseevents).on(i.out,A))},E=function(e,t){for(var n=t.parentNode;null!==n;){if(n==e)return!0;n=n.parentNode}return!1};d3.select(e.mouseevents).on(i.out,j),w.on(i.out,j);var S=d3.select(e.mouseevents).on(i.move);S&&w.on(i.move,S)}}else w.style("pointer-events","none");if(e.arrow){w.append("div").attr("class","d3plus_tooltip_arrow").style("background-color",e.background).style(n+"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(n+"transform","rotate(45deg)").style("z-index",-1)}if(e.icon){var O=M.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&&O.style("background-color",e.color),b-=O.node().offsetWidth}if(e.title){var N=e.max_width-6;e.icon&&(N-=e.iconsize+6),N+="px";M.append("div").attr("class","d3plus_tooltip_title").style("max-width",N).style("color",e.icon?e.fontcolor:o(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 F=k.append("div").attr("class","d3plus_tooltip_data_container").style("overflow-y","auto").style("z-index",-1);if(e.data){var C=0,T={},q=null;e.data.forEach(function(t,a){t.group&&q!=t.group&&(q=t.group,F.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 l=F.append("div").attr("class","d3plus_tooltip_data_block").style("font-size","12px").style("padding","3px 6px").style("position","relative").datum(t);t.highlight===!0?l.style("color",o(e.color)):(t.allColors||t.highlight!==e.color)&&l.style("color",o(t.highlight));var c=l.append("div").attr("class","d3plus_tooltip_data_name").style("display","inline-block").html(t.name).on(i.out,function(){d3.event.stopPropagation()});if(t.link&&c.style("cursor","pointer").on(i.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=l.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(i.out,function(){d3.event.stopPropagation()});if(u?p.style("left","6px"):p.style("right","6px"),e.mouseevents&&t.desc){var h=l.append("div").attr("class","d3plus_tooltip_data_desc").style("color","#888").style("overflow","hidden").style(n+"transition","height 0.5s").style("width","85%").text(t.desc).on(i.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(n+"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(s+"transition","background-color 0.5s").text("?").on(i.over,function(){var e=d3.select(this.parentNode.parentNode).style("color");d3.select(this).style("background-color",e),h.style("height",v+"px")}).on(i.out,function(){d3.event.stopPropagation()});c.style("cursor","pointer").on(i.over,function(){r();var e=d3.select(this.parentNode).style("color");g.style("background-color",e),h.style("height",v+"px")}),l.on(i.out,function(){d3.event.stopPropagation(),r()})}var m=parseFloat(p.style("width"),10);m>e.width/2&&(m=e.width/2),m>C&&(C=m),a!=e.data.length-1&&(t.group&&t.group==e.data[a+1].group||!t.group&&!e.data[a+1].group)&&F.append("div").attr("class","d3plus_tooltip_data_seperator").style("background-color","#ddd").style("display","block").style("height","1px").style("margin","0px 3px")}),F.selectAll(".d3plus_tooltip_data_name").style("width",function(){var e=parseFloat(d3.select(this.parentNode).style("width"),10);return e-C-30+"px"}),F.selectAll(".d3plus_tooltip_data_value").style("width",C+"px").each(function(e){var t=parseFloat(d3.select(this).style("height"),10);T[e.name]=t}),F.selectAll(".d3plus_tooltip_data_name").style("min-height",function(e){return T[e.name]+"px"})}!e.html||e.fullscreen&&!e.stacked||(F.append("div").html(e.html),e.js&&e.js(_));var P=k.append("div").attr("class","d3plus_tooltip_footer").style("font-size","10px").style("position","relative").style("text-align","center");if(e.footer&&P.html(e.footer),e.height=w.node().offsetHeight||w.node().getBoundingClientRect().height,e.html&&e.fullscreen&&!e.stacked){var B=e.height-12,z=w.node().offsetWidth-e.width-44;_.append("div").attr("class","d3plus_tooltip_html").style("width",z+"px").style("height",B+"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 D=e.fixed?v-e.y-10:v-10,B=e.height<D?e.height:D;else var B=e.height;B-=parseFloat(_.style("padding-top"),10),B-=parseFloat(_.style("padding-bottom"),10),M&&(B-=M.node().offsetHeight||M.node().getBoundingClientRect().height,B-=parseFloat(M.style("padding-top"),10),B-=parseFloat(M.style("padding-bottom"),10)),P&&(B-=P.node().offsetHeight||P.node().getBoundingClientRect().height,B-=parseFloat(P.style("padding-top"),10),B-=parseFloat(P.style("padding-bottom"),10)),F.style("max-height",B+"px")}e.height=w.node().offsetHeight||w.node().getBoundingClientRect().height,l(e.x,e.y,e.id)}},{"../client/pointer.coffee":40,"../client/prefix.coffee":41,"../client/rtl.coffee":42,"../client/scroll.js":43,"../client/scrollbar.coffee":44,"../color/legible.coffee":46,"../color/text.coffee":52,"../core/locale/languages/en_US.coffee":72,"../string/list.coffee":177,"./move.coffee":205,"./remove.coffee":206}],205:[function(e,t,n){var r,a;a=e("../client/scroll.js"),t.exports=function(e,t,n){var i,o,l;return n||(n="default"),l=d3.select("div#d3plus_tooltip_id_"+n),l.node()&&(i=l.datum(),i.cx=e,i.cy=t,i.fixed||(o="body"===i.parent.node().tagName.toLowerCase()?[a.x(),a.y()]:[0,0],"center"!==i.anchor.y?("right"===i.anchor.x?i.x=i.cx-i.arrow_offset-4:"center"===i.anchor.x?i.x=i.cx-i.width/2:"left"===i.anchor.x&&(i.x=i.cx-i.width+i.arrow_offset+2),"bottom"===i.anchor.y?i.flip=i.cy+i.height+i.offset<=i.limit[1]:"top"===i.anchor.y&&(i.flip=i.cy-i.height-i.offset<o[1]),i.flip?i.y=i.cy+i.offset+i.arrow_offset:i.y=i.cy-i.height-i.offset-i.arrow_offset):(i.y=i.cy-i.height/2,"right"===i.anchor.x?i.flip=i.cx+i.width+i.offset<=i.limit[0]:"left"===i.anchor.x&&(i.flip=i.cx-i.width-i.offset<o[0]),"center"===i.anchor.x?(i.flip=!1,i.x=i.cx-i.width/2):i.flip?i.x=i.cx+i.offset+i.arrow_offset:i.x=i.cx-i.width-i.offset),i.x<o[0]?i.x=o[0]:i.x+i.width>i.limit[0]&&(i.x=i.limit[0]-i.width),i.y<o[1]?i.y=o[1]:i.y+i.height>i.limit[1]&&(i.y=i.limit[1]-i.height)),l.style("top",i.y+"px").style("left",i.x+"px"),i.arrow&&l.selectAll(".d3plus_tooltip_arrow").call(r)),l},r=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":43}],206:[function(e,t,n){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())}},{}],207:[function(e,t,n){t.exports=function(e,t){var n,r;return n=[],r=1/(t-1)*(e[1]-e[0]),d3.range(e[0],e[1]+r,r)}},{}],208:[function(e,t,n){var r;r=e("./d3selection.coffee"),t.exports=function(e,t){var n;if(!e||!t)return!1;for(r(e)&&(e=e.node()),r(e)&&(t=t.node()),n=t.parentNode;null!==n;){if(n===e)return!0;n=n.parentNode}return!1}},{"./d3selection.coffee":211}],209:[function(e,t,n){t.exports=function(e,t){var n,r;return t.constructor===String?(r=e.indexOf(t),r>-1?e[r]:e[0]):(n=e[0],e.forEach(function(e){if(Math.abs(t-e)<Math.abs(t-n))return n=e}),n)}},{}],210:[function(e,t,n){var r,a,i;a=e("../object/merge.coffee"),i=e("../object/validate.coffee"),r=function(e){var t;return i(e)?a(e):e instanceof Array?(t=[],e.forEach(function(e){return t.push(r(e))}),t):e},t.exports=r},{"../object/merge.coffee":174,"../object/validate.coffee":175}],211:[function(e,t,n){var r;r=e("../client/ie.js"),t.exports=function(e){return r?"object"==typeof e&&e instanceof Array&&"size"in e&&"select"in e:e instanceof d3.selection}},{"../client/ie.js":39}],212:[function(e,t,n){t.exports=function(e,t){var n;n=new Image,n.src=e,n.crossOrigin="Anonymous",n.onload=function(){var e,n;e=document.createElement("canvas"),e.width=this.width,e.height=this.height,n=e.getContext("2d"),n.drawImage(this,0,0),t.call(this,e.toDataURL("image/png")),e=null}}},{}],213:[function(e,t,n){var r,a;r=e("../object/validate.coffee"),a=function(e,t,n,i,o,l){var s,u,c,f,d,p,h,v,g,m,y,x,b,w;if(void 0===e)return[];if(i&&void 0===o&&(o=i.id.value),l=!0===l&&void 0===l,e instanceof Array||(e=[e]),m=[],void 0===t)return e.reduce(function(e,t){var n;return n=JSON.stringify(t),m.indexOf(n)<0&&(e.indexOf(t)<0&&e.push(t),m.push(n)),e},[]);if(w=[],s=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 n&&i)for(c=0,p=e.length;c<p;c++)for(u=e[c],b=a(n(i,u,t,o)),f=0,h=b.length;f<h;f++)x=b[f],s(x);else if("function"==typeof t)for(d=0,v=e.length;d<v;d++)u=e[d],b=t(u),s(b);else for(y=0,g=e.length;y<g;y++)u=e[y],r(u)&&(b=u[t],s(b));return l?w.sort(function(e,t){return e-t}):w},t.exports=a},{"../object/validate.coffee":175}],214:[function(e,t,n){t.exports=function(e){var t,n,r,a,i;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"],n=0,r=a.length;n<r;n++)i=a[n],e[i].value||(t=function(n){var r,a;return void 0===n.tagName||["BODY","HTML"].indexOf(n.tagName)>=0?(a=window["inner"+i.charAt(0).toUpperCase()+i.slice(1)],r=document!==n&&d3.select(n),r&&("width"===i?(a-=parseFloat(r.style("margin-left"),10),a-=parseFloat(r.style("margin-right"),10),a-=parseFloat(r.style("padding-left"),10),a-=parseFloat(r.style("padding-right"),10)):(a-=parseFloat(r.style("margin-top"),10),a-=parseFloat(r.style("margin-bottom"),10),a-=parseFloat(r.style("padding-top"),10),a-=parseFloat(r.style("padding-bottom"),10))),e[i].value=a<=20?e[i].small:a):(a=parseFloat(d3.select(n).style(i),10),"number"==typeof a&&a>0?e[i].value=a:"BODY"!==n.tagName?t(n.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")}},{}],215:[function(e,t,n){var r=e("../../core/data/format.js"),a=e("../../core/data/color.js"),i=e("../../core/data/keys.coffee"),o=e("../../core/data/load.coffee"),l=e("./ui/drawer.js"),s=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"),M=e("../../object/validate.coffee");t.exports=function(e){var t=[],n=e.type.value,A=e.format.locale.value,j=A.message.ui,E=A.message.draw,S=["data","attrs","coords","nodes","edges"];if(S.forEach(function(n){e.error.value||e[n].loaded||!e[n].url||t.push({function:function(e,t){o(e,n,t)},message:A.message.loading,wait:!0})}),e.draw.update){var O=A.visualization[n]||n,N=e.types[n].setup||!1,F=e.types[n].requirements||[],C=w(A.message.initializing,O),T=A.message.data;F instanceof Array||(F=[F]),O=O.toLowerCase(),e.error.value||"function"!=typeof N||t.push({function:function(e){if(e.dev.value){var t="running "+O+" setup";m.time(t)}N(e),e.dev.value&&m.timeEnd(t)},message:C}),e.container.changed&&t.push({function:_,message:C}),n in e.g.apps||t.push({function:function(e){if(e.dev.value){var t="creating "+O+" group";m.time(t)}e.g.apps[n]=e.g.app.append("g").attr("id",n).attr("opacity",0),e.dev.value&&m.timeEnd(t)},message:C}),e.data.changed&&t.push({function:function(e){e.data.cache={},delete e.nodes.restricted,delete e.edges.restricted,i(e,"data")},message:T}),e.attrs.changed&&t.push({function:function(e){i(e,"attrs")},message:T}),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 n=e.color.value;M(n)&&(n=n[e.id.value]?n[e.id.value]:n[d3.keys(n)[0]]),e.data.keys&&n in e.data.keys?e.color.type=e.data.keys[n]:e.attrs.keys&&n in e.attrs.keys&&(e.color.type=e.attrs.keys[n])}else e.data.keys&&(e.color.type=e.data.keys[e.id.value]);e.dev.value&&m.timeEnd(t)}},message:T}),F.indexOf("edges")>=0&&e.edges.value&&(!e.edges.linked||e.edges.changed)&&t.push({function:v,message:T}),F.indexOf("nodes")>=0&&e.edges.value&&(!e.nodes.positions||e.nodes.changed||e.type.changed)&&t.push({function:g,message:T}),(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:r,message:T}),e.error.value||t.push({function:function(e){var t=e.time.fixed.value?["all"]:null;if(e.dev.value){var n=t?"fetching pool data":"fetching data";m.time(n)}e.data.pool=f(e,t),e.dev.value&&m.timeEnd(n),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:T}),e.error.value||t.push({check:function(e){return e.color.value&&"number"===e.color.type&&e.color.valueScale===!1},function:a,message:T})}return t.push({function:function(e){if(e.dev.value){var t=e.format.locale.value.message.tooltipReset;m.time(t)}e.type.previous&&n!==e.type.previous&&y(e.type.previous),y(n),e.dev.value&&m.timeEnd(t)},message:j}),e.error.value||t.push({function:c,message:j}),t.push({function:function(e){if(e.margin.process(),z(e),!e.error.value)if(e.draw.update)l(e),u(e),s(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,n=e.g.timeline.node().getBBox(); | |
n=e.timeline.value?n.height+e.ui.padding:0;var r=e.g.legend.node().getBBox();r=e.legend.value?r.height+e.ui.padding:0,e.margin.bottom+=t+n+r,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:j}),e.error.value||t.push({function:p,message:j}),t.push({function:k,message:E}),!e.error.value&&e.draw.update&&t.push({function:[x,b],message:E}),t.push({function:d,message:E}),t}},{"../../core/console/print.coffee":54,"../../core/data/color.js":56,"../../core/data/format.js":58,"../../core/data/keys.coffee":60,"../../core/data/load.coffee":61,"../../core/fetch/data.js":66,"../../core/parse/edges.js":97,"../../core/parse/nodes.js":100,"../../object/validate.coffee":175,"../../string/format.js":176,"../../tooltip/remove.coffee":206,"./errorCheck.js":216,"./finish.js":217,"./focus/tooltip.coffee":218,"./shapes/draw.js":228,"./svg/enter.js":241,"./svg/update.js":242,"./types/run.coffee":245,"./ui/drawer.js":246,"./ui/history.coffee":247,"./ui/legend.js":248,"./ui/timeline.coffee":250,"./ui/titles.js":251}],216:[function(e,t,n){var r=e("../../core/fetch/text.js"),a=e("../../core/console/print.coffee"),i=e("../../core/methods/rejected.coffee"),o=e("../../string/format.js"),l=e("../../string/list.coffee");t.exports=function(e){e.dev.value&&a.time("checking for errors");var t=["id"],n=e.types[e.type.value].requirements;n&&(n instanceof Array?t=t.concat(e.types[e.type.value].requirements):t.push(n));var s=[];if(t.forEach(function(t){if("string"==typeof t)e[t].value||s.push('"'+t+'"');else if("function"==typeof t){var n=t(e);!n.status&&n.text&&s.push('"'+n.text+'"')}}),s.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;s=l(s,f),e.error.internal=o(u,c,s)}else if(1===s.length){var u=e.format.locale.value.error.method,c=e.format.locale.value.visualization[e.type.value]||e.type.value;e.error.internal=o(u,c,s[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=r(e,e.focus.value[0],e.depth.value),u=e.format.locale.value.error.connections;e.error.internal=o(u,'"'+p+'"')}}var t=["d3"];e.types[e.type.value].libs&&(t=t.concat(e.types[e.type.value].libs));var s=[];if(t.forEach(function(e){window[e]||s.push('"'+e+'"')}),s.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;s=l(s,f),e.error.internal=o(u,c,s)}else if(1===s.length){var u=e.format.locale.value.error.lib,c=e.format.locale.value.visualization[e.type.value];e.error.internal=o(u,c,s[0])}var h=e.shape.accepted(e);h instanceof Array||(h=[h]);var v=e.shape.value;if(v&&!i(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&&!i(e,g,m,"mode")||e.self.type({mode:g[0]})}e.dev.value&&a.timeEnd("checking for errors")}},{"../../core/console/print.coffee":54,"../../core/fetch/text.js":68,"../../core/methods/rejected.coffee":93,"../../string/format.js":176,"../../string/list.coffee":177}],217:[function(e,t,n){var r=e("./shapes/edges.js"),a=e("./shapes/paths.js"),i=e("./ui/message.js"),o=e("./focus/viz.js"),l=e("../../core/methods/reset.coffee"),s=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(){o(e)},e.draw.timing):o(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&&s.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&&s.timeEnd("calculating zoom")):(e.zoom.bounds=[[0,0],[e.width.viz,e.height.viz]],e.zoom.scale=1,f(e))}var n=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",n).attr("height",h).attr("x",v).attr("y",g),e.error.value||(e.draw.update?(e.edges.path?a(e):r(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&&s.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&&s.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?i(e,e.error.value):e.error.internal?(e.error.internal=c(e.error.internal),s.warning(e.error.internal),i(e,e.error.internal),e.error.internal=null):i(e),setTimeout(function(){l(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":54,"../../core/methods/reset.coffee":95,"../../string/title.coffee":179,"./focus/viz.js":219,"./shapes/edges.js":229,"./shapes/labels.js":231,"./shapes/paths.js":233,"./ui/message.js":249,"./zoom/bounds.coffee":252,"./zoom/labels.coffee":254,"./zoom/mouse.coffee":255}],218:[function(e,t,n){var r,a,i,o;r=e("../tooltip/create.js"),a=e("../../../core/fetch/value.coffee"),i=e("../../../core/console/print.coffee"),o=e("../../../tooltip/remove.coffee"),t.exports=function(e){var t,n,l;n=e.focus,!e.error.internal&&1===n.value.length&&n.value.length&&!e.small&&n.tooltip.value?(e.dev.value&&i.time("drawing focus tooltip"),t=e.data.pool.filter(function(t){return a(e,t,e.id.value)===n.value[0]}),t.length>=1?t=t[0]:(t={},t[e.id.value]=n.value[0]),l=e.labels.padding,r({anchor:"top left",arrow:!1,data:t,fullscreen:!1,id:"visualization_focus",length:"long",maxheight:e.height.viz-2*l,mouseevents:!0,offset:0,vars:e,width:e.tooltip.large,x:e.width.value-e.margin.right-l,y:e.margin.top+l}),e.width.viz-=e.tooltip.large+2*l,e.dev.value&&i.timeEnd("drawing focus tooltip")):o("visualization_focus")}},{"../../../core/console/print.coffee":54,"../../../core/fetch/value.coffee":69,"../../../tooltip/remove.coffee":206,"../tooltip/create.js":243}],219:[function(t,n,r){var a=t("../../../client/pointer.coffee"),i=t("../../../client/ie.js"),o=t("../../../core/fetch/value.coffee"),l=t("../../../core/console/print.coffee"),s=t("../../../util/uniques.coffee");n.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&&l.time("drawing focus elements");var n=t.g.edges.selectAll("g");if(n.size()>0){n.each(function(e){var n=e[t.edges.source][t.id.value],r=e[t.edges.target][t.id.value];if(n==t.focus.value[0]||r==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 r=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 i&&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 n=t.edges.arrows.direction.value;if("bucket"in e.d3plus)var a="_"+e.d3plus.bucket;else var a="";return"source"==n&&r?"url(#d3plus_edge_marker_focus"+a+")":"none"}).attr("marker-end",function(e){var n=t.edges.arrows.direction.value;if("bucket"in e.d3plus)var a="_"+e.d3plus.bucket;else var a="";return"target"==n&&r?"url(#d3plus_edge_marker_focus"+a+")":"none"}),t.g.edge_focus.selectAll("text").style("fill",t.color.focus)}var u=s(t.edges.connections(t.focus.value[0],t.id.value,!0),t.id.value,o,t);u.push(t.focus.value[0]);var c=[],f=[],d=[0],p=[0];t.g.data.selectAll("g").each(function(n){if(u.indexOf(n[t.id.value])>=0){var r=t.g.data_focus.node().appendChild(this.cloneNode(!0)),r=d3.select(r).datum(n).attr("opacity",1);"coordinates"==t.shape.value?t.zoom.viewport=t.path.bounds(t.zoom.coords[n.d3plus.id]):"d3plus"in n&&("x"in n.d3plus&&c.push(n.d3plus.x),"y"in n.d3plus&&f.push(n.d3plus.y),"r"in n.d3plus?(d.push(n.d3plus.r),p.push(n.d3plus.r)):("width"in n.d3plus&&d.push(n.d3plus.width/2),"height"in n.d3plus&&p.push(n.d3plus.height/2)));for(e in a){var i=d3.select(this).on(a[e]);i&&r.on(a[e],i)}}});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",i&&t.types[t.type.value].zoom?0:2*t.data.stroke.width),t.dev.value&&l.timeEnd("drawing focus elements")}else t.zoom.viewport=!1}},{"../../../client/ie.js":39,"../../../client/pointer.coffee":40,"../../../core/console/print.coffee":54,"../../../core/fetch/value.coffee":69,"../../../util/uniques.coffee":213}],220:[function(e,t,n){var r,a,i,o;o=e("./style.coffee"),a=e("../../../geom/largestRect.coffee"),i=e("../../../geom/path2poly.coffee"),r={start:{},end:{}},t.exports=function(e,t,n,l){var s,u,c,f;s=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 n,r;return e.labels.value&&(t.d3plus.label?t.d3plus_label=t.d3plus.label:(n=i(s(t)),r=a(n,{angle:0}),r[0]?t.d3plus_label={w:r[0].width,h:r[0].height,x:r[0].cx,y:r[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===r.start[e.d3plus.id]&&(r.start[e.d3plus.id]=0),isNaN(r.start[e.d3plus.id])&&(r.start[e.d3plus.id]=e.d3plus.startAngle),r.start[e.d3plus.id]}).endAngle(function(e){return void 0===r.end[e.d3plus.id]&&(r.end[e.d3plus.id]=0),isNaN(r.end[e.d3plus.id])&&(r.end[e.d3plus.id]=e.d3plus.endAngle),r.end[e.d3plus.id]}),u=function(e,t){return e.attrTween("d",function(e){var n,a,i,o;return void 0===t?(o=e.d3plus.startAngle,n=e.d3plus.endAngle):0===t&&(o=0,n=0),i=d3.interpolate(r.start[e.d3plus.id],o),a=d3.interpolate(r.end[e.d3plus.id],n),function(t){return r.start[e.d3plus.id]=i(t),r.end[e.d3plus.id]=a(t),f(e)}})},n.append("path").attr("class","d3plus_data").call(o,e).attr("d",f),t.selectAll("path.d3plus_data").data(c).transition().duration(e.draw.timing).call(o,e).call(u),l.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(u,0)):(n.append("path").attr("class","d3plus_data"),t.selectAll("path.d3plus_data").data(c).call(o,e).attr("d",s))}},{"../../../geom/largestRect.coffee":162,"../../../geom/path2poly.coffee":164,"./style.coffee":237}],221:[function(e,t,n){var r=e("../../../core/fetch/text.js"),a=e("../../../font/sizes.coffee"),i=e("../../../geom/largestRect.coffee"),o=e("./style.coffee");t.exports=function(e,t,n,l){var s=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);n.append("path").attr("class","d3plus_data").attr("d",function(e){return u(e.values)}).call(o,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 n=d3.max(t.values,function(e){return e.d3plus.y0-e.d3plus.y}),o=!1;if(n>e.labels.font.size){var l=[],s=[],u=r(e,t);t.values.forEach(function(e){l.push([e.d3plus.x,e.d3plus.y]),s.push([e.d3plus.x,e.d3plus.y0])}),l=l.concat(s.reverse());var f=null;if(u.length){var d=a(u[0],c);f=d[0].width/d[0].height}o=i(l,{angle:d3.range(-70,71,1),aspectRatio:f,tolerance:0})}if(o&&o[0]){var p={w:~~o[0].width,h:~~o[0].height,x:~~o[0].cx,y:~~o[0].cy,angle:o[0].angle*-1,padding:2,names:u};0!==o[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 s(e.values)}).call(o,e):t.selectAll("path.d3plus_data").attr("d",function(e){return s(e.values)}).call(o,e)}},{"../../../core/fetch/text.js":68,"../../../font/sizes.coffee":104,"../../../geom/largestRect.coffee":162,"./style.coffee":237}],222:[function(e,t,n){var r=(e("../../../core/fetch/text.js"),e("../../../geom/largestRect.coffee"),e("./style.coffee"));t.exports=function(e,t,n,a){function i(e){e.attr("transform","scale(1)")}function o(e){e.attr("transform",function(e){var t=Math.min(e.d3plus.width,e.d3plus.height),n=Math.floor(t/16);return"scale("+n+")"})}n.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(i).call(r,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(o).call(r,e):t.selectAll("path.d3plus_data").call(o).call(r,e)}},{"../../../core/fetch/text.js":68,"../../../geom/largestRect.coffee":162,"./style.coffee":237}],223:[function(e,t,n){var r,a,i,o;a=e("../../../core/fetch/value.coffee"),r=e("../../../core/fetch/color.coffee"),i=e("../../../color/lighter.coffee"),o=e("./segments.coffee"),t.exports=function(e,t,n){var a,l,s,u;return l=e.d3plus.shape||t.shape.value,"line"===t.shape.value&&"circle"!==l?"none":"area"===t.shape.value||"active"===l||"line"===t.shape.value?r(t,e):"temp"===l?n?r(t,e):"url(#d3plus_hatch_"+e.d3plus.id+")":e.d3plus.static?i(r(t,e),.75):(a=o(t,e,"active"),s=o(t,e,"temp"),u=o(t,e,"total"),!t.active.value&&!t.temp.value||a===!0||a&&u&&a>=u&&!s||a&&!u?r(t,e):t.active.spotlight.value?t.color.missing:i(r(t,e),.75))}},{"../../../color/lighter.coffee":47,"../../../core/fetch/color.coffee":65,"../../../core/fetch/value.coffee":69,"./segments.coffee":236}],224:[function(e,t,n){var r,a,i,o,l,s,u,c;r=e("../../../util/copy.coffee"),a=e("../../../network/distance.coffee"),i=e("../../../core/fetch/text.js"),o=e("../../../font/sizes.coffee"),s=e("../../../geom/largestRect.coffee"),u=e("../../../geom/path2poly.coffee"),c=e("./style.coffee"),l={},t.exports=function(e,t,n,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),n.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 n,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,M,A,j,E,S;if(e.coords.simplify.value&&t.geometry.coordinates.length>1){for(m=[],c=[],n=0,b=r(t),A=r(t),t.geometry.coordinates=t.geometry.coordinates.filter(function(t,r){var a;return A.geometry.coordinates=[t],a=e.path.area(A),a>0&&(c.push(a),a>n&&(b.geometry.coordinates=[t],n=a),!0)}),p=e.path.centroid(b),j=t.geometry.coordinates,y=x=0,w=j.length;x<w;y=++x)d=j[y],A.geometry.coordinates=[d],m.push(a(e.path.centroid(A),p));g=m.reduce(function(e,t,n){return t&&e.push(c[n]/t),e},[]),v=d3.quantile(g,e.coords.threshold.value),A.geometry.coordinates=t.geometry.coordinates.filter(function(e,t){var n,r;return r=m[t],n=c[t],0===r||n/r>=v}),h=b.geometry.coordinates[0],h&&"MultiPolygon"===b.geometry.type&&(h=h[0],b.geometry.coordinates[0]=h,b.geometry.type="Polygon")}else A=t,b=t,h=t.geometry.coordinates[0];return e.zoom.coords[t.d3plus.id]=A,delete t.d3plus_label,e.labels.value&&(_=i(e,t),h&&_.length&&(k=u(e.path(b)),S={"font-weight":e.labels.font.weight,"font-family":e.labels.font.family.value},z=null,1===_[0].split(" ").length&&(E=o(_[0],S)[0],z=E.width/E.height),M=s(k,{angle:0,aspectRatio:z}),M&&(M=M[0],t.d3plus_label={anchor:"middle",valign:"center",h:M.height,w:M.width,x:M.cx,y:M.cy,names:_}))),l[t.id]=t.d3plus_label,f=e.path.bounds(A),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=l[e.id]}))}},{"../../../core/fetch/text.js":68,"../../../font/sizes.coffee":104,"../../../geom/largestRect.coffee":162,"../../../geom/path2poly.coffee":164,"../../../network/distance.coffee":168,"../../../util/copy.coffee":210,"./style.coffee":237}],225:[function(e,t,n){var r=e("./style.coffee");t.exports=function(e,t,n,a){function i(e){e.attr("d",d3.svg.symbol().type("cross").size(10))}function o(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)}))}n.append("path").attr("class","d3plus_data").call(i).call(r,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(o).call(r,e):t.selectAll("path.d3plus_data").call(o).call(r,e)}},{"./style.coffee":237}],226:[function(e,t,n){var r=e("./style.coffee");t.exports=function(e,t,n,a){function i(e){e.attr("d",d3.svg.symbol().type("diamond").size(10))}function o(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)}))}n.append("path").attr("class","d3plus_data").call(i).call(r,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(o).call(r,e):t.selectAll("path.d3plus_data").call(o).call(r,e)}},{"./style.coffee":237}],227:[function(e,t,n){var r=e("./style.coffee");t.exports=function(e,t,n,a){function i(t,n,r,a){if(!n)var n=0;if("number"!=typeof r)var r=void 0;if("number"!=typeof a)var a=void 0;t.attrTween("d",function(t){if(void 0==r)var i=t.d3plus.r?t.d3plus.r:d3.max([t.d3plus.width,t.d3plus.height]);else var i=r;if(void 0==a)var o=t.d3plus.segments[t.d3plus.shape];else var o=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 s=d3.interpolate(e.arcs[t.d3plus.shape][t.d3plus.id].r,i+n),u=d3.interpolate(e.arcs[t.d3plus.shape][t.d3plus.id].a,o);return function(n){return e.arcs[t.d3plus.shape][t.d3plus.id].r=s(n),e.arcs[t.d3plus.shape][t.d3plus.id].a=u(n),l(t)}})}function o(e){return e.d3plus.label?e.d3plus_label=e.d3plus.label:delete e.d3plus_label,[e]}e.arcs||(e.arcs={donut:{},active:{},temp:{}});var l=d3.svg.arc().startAngle(0).endAngle(function(t){var n=e.arcs[t.d3plus.shape][t.d3plus.id].a;return n>2*Math.PI?2*Math.PI:n}).innerRadius(function(t){if(t.d3plus.static)return 0;var n=e.arcs[t.d3plus.shape][t.d3plus.id].r;return n*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(i,0,0).each("end",function(t){delete e.arcs[t.d3plus.shape][t.d3plus.id]}),t.selectAll("path.d3plus_data").data(o).transition().duration(e.draw.timing).call(i).call(r,e),n.append("path").attr("class","d3plus_data").transition().duration(0).call(i,0,0).call(r,e).transition().duration(e.draw.timing).call(i).call(r,e)):(a.selectAll("path.d3plus_data").each(function(t){delete e.arcs[t.d3plus.shape][t.d3plus.id]}),n.append("path").attr("class","d3plus_data"),t.selectAll("path.d3plus_data").data(o).call(i).call(r,e))}},{"./style.coffee":237}],228:[function(e,t,n){var r=e("../../../util/child.coffee"),a=e("../../../util/closest.coffee"),i=e("../tooltip/create.js"),o=e("../../../client/pointer.coffee"),l=e("../../../core/fetch/value.coffee"),s=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 n=0;n<=e.depth.value;n++)t.d3plus.id+=l(e,t,e.id.nesting[n])+"_";t.d3plus.id+=O,["x","y","x2","y2"].forEach(function(n){if("discrete"==e[n].scale.value){var r=l(e,t,e[n].value);r.constructor===Date&&(r=r.getTime()),t.d3plus.id+="_"+r}}),t.d3plus.suffix&&(t.d3plus.id+="_"+t.d3plus.suffix),t.d3plus.id=v(t.d3plus.id)}return t}function n(t,n){var r=e.types[e.type.value].scale,a=1;r&&(x[r]&&e.shape.value in r?a=r[e.shape.value]:"function"==typeof r?a=r(e,e.shape.value):"number"==typeof r&&(a=r)),a=n?a:1,t.attr("transform",function(e){if(["line","area","coordinates"].indexOf(O)<0){var t=e.d3plus.x||0,n=e.d3plus.y||0;return"translate("+t+","+n+")scale("+a+")"}return"scale("+a+")"})}function _(t){t.attr("id",function(e){return"d3plus_group_"+e.d3plus.id}).attr("class",function(t){var n=e.class.value?" "+l(e,t,e.class.value):"";return"d3plus_"+O+n})}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(n){var r=t[e.id.value],a=n[e.edges.source][e.id.value],i=n[e.edges.target][e.id.value];if(a==r||a=="left_"+r||a=="right_"+r||i==r||i=="left_"+r||i=="right_"+r){var o=e.g.edge_hover.node().appendChild(this.cloneNode(!0));d3.select(o).datum(n).attr("opacity",1).selectAll("line, path").datum(n)}});var n=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 r=e.edges.arrows.direction.value;if("bucket"in t.d3plus)var a="_"+t.d3plus.bucket;else var a="";return"source"==r&&n?"url(#d3plus_edge_marker_highlight"+a+")":"none"}).attr("marker-end",function(t){var r=e.edges.arrows.direction.value;if("bucket"in t.d3plus)var a="_"+t.d3plus.bucket;else var a="";return"target"==r&&n?"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||[],M=e.returned.edges||[];e.draw.timing=z.length<e.data.large&&M.length<e.edges.large?e.timing.transitions:0;var A={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"},j={};z.forEach(function(t){var n=t.d3plus&&t.d3plus.shape?t.d3plus.shape:e.shape.value;n in A&&(t.d3plus&&(t.d3plus.shape=n),n=A[n],j[n]||(j[n]=[]),j[n].push(t))});for(var E in A)if(!(A[E]in j)||0===d3.keys(j).length){var S=e.g.data.selectAll("g.d3plus_"+A[E]);e.draw.timing?S.transition().duration(e.draw.timing).attr("opacity",0).remove():S.remove()}for(var O in j){var N=e.g.data.selectAll("g.d3plus_"+O).data(j[O],function(n){if(n.d3plus||(n.d3plus={}),"coordinates"===O)return n.d3plus.id=n.id,n.id;if(!n.d3plus.id)if(n.values)n.values.forEach(function(e){e=t(e),e.d3plus.shape="circle"}),n.d3plus.id=n.key;else if(n=t(n),!n.d3plus.segments){n.d3plus.segments={donut:2*Math.PI};var r=p(e,n,"active"),a=p(e,n,"temp"),i=p(e,n,"total");i&&(r?n.d3plus.segments.active=r/i*(2*Math.PI):n.d3plus.segments.active=0,a?n.d3plus.segments.temp=a/i*(2*Math.PI)+n.d3plus.segments.active:n.d3plus.segments.temp=0)}return!!n.d3plus&&n.d3plus.id});if(e.draw.timing)var F=N.exit().transition().duration(e.draw.timing).attr("opacity",0).remove();else var F=N.exit().remove();e.draw.timing?N.transition().duration(e.draw.timing).call(n).call(_):N.call(n).call(_);var C=e.draw.timing?0:1,T=N.enter().append("g").attr("opacity",C).call(n).call(_);e.draw.timing&&T.transition().duration(e.draw.timing).attr("opacity",1),N.order(),e.dev.value&&f.time('drawing "'+O+'" shapes'),w[O](e,N,T,F,n),e.dev.value&&f.timeEnd('drawing "'+O+'" shapes'),["rect","donut"].indexOf(O)>=0&&e.types[e.type.value].fill&&(e.dev.value&&f.time('filling "'+O+'" shapes'),h(e,N,T,F,n),e.dev.value&&f.timeEnd('filling "'+O+'" shapes'))}if(k(),e.tooltip.value)e.g.data.selectAll("g").on(o.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 r="function"!=typeof e.mouse.over.value;if("function"==typeof e.mouse.over.value&&(r=e.mouse.over.value(t,e.self)),r){var l=b(t.d3plus_data||t,e),s="function"==typeof e.mouse.viz||"function"==typeof e.mouse.viz[o.click]||e.zoom.value&&(e.types[e.type.value].zoom||t.d3plus.threshold&&t.d3plus.merged||1===l||l===-1&&e.history.states.length&&!e.tooltip.value.long);if(d3.select(this).style("cursor",s?"pointer":"auto").transition().duration(e.timing.mouseevents).call(n,!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;i({vars:e,data:h}),"function"==typeof e.mouse.viz?e.mouse.viz(t.d3plus_data||t,e):e.mouse.viz[o.over]&&e.mouse.viz[o.over](t.d3plus_data||t,e),k(t)}}}).on(o.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 n="function"!=typeof e.mouse.move.value;if("function"==typeof e.mouse.move.value&&(n=e.mouse.move.value(t,e.self)),n){var r=b(t.d3plus_data||t,e),l="function"==typeof e.mouse.viz||"function"==typeof e.mouse.viz[o.click]||e.zoom.value&&(e.types[e.type.value].zoom||t.d3plus.threshold&&t.d3plus.merged||1===r||r===-1&&e.history.states.length&&!e.tooltip.value.long);d3.select(this).style("cursor",l?"pointer":"auto");e.types[e.type.value].tooltip||"follow";if(t.values&&e.axes.discrete){var s="x"===e.axes.discrete?0:1,u=d3.mouse(e.container.value.node())[s],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;i({vars:e,data:p}),"function"==typeof e.mouse.viz?e.mouse.viz(t.d3plus_data||t,e):e.mouse.viz[o.move]&&e.mouse.viz[o.move](t.d3plus_data||t,e)}}}).on(o.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 i=r(this,d3.event.toElement);i||e.draw.frozen||t.d3plus&&t.d3plus.static||(d3.select(this).transition().duration(e.timing.mouseevents).call(n),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[o.out]&&e.mouse.viz[o.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(o.over,q).on(o.move,q).on(o.out,q)}d3.select(window).on("scroll.d3plus",function(){d(e.type.value)}),e.g.data.selectAll("g").on(o.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 r="function"!=typeof e.mouse.click.value;if("function"==typeof e.mouse.click.value&&(r=e.mouse.click.value(t,e.self)),r){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[o.out]?e.mouse.viz[o.out](t.d3plus_data||t,e):e.mouse.viz[o.click]&&e.mouse.viz[o.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(s(e,t)),_=e.title.sub.value||!1,z=e.title.sub.font.color,M=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:M}}}).draw()}),e.self.id({solo:m.concat(y(t.d3plus.merged,e.id.value,l,e))}).title({sub:{font:{color:w},value:x},total:{font:{color:w}}}).draw();else if(1===g&&e.zoom.value){var A=l(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:M}}}).draw()}),e.self.depth(e.depth.value+1).id({solo:m.concat(A)}).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(n),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 j=t.d3plus_data?t.d3plus_data:t;i({vars:e,data:j})}}}})}},{"../../../client/pointer.coffee":40,"../../../client/touch.coffee":45,"../../../color/legible.coffee":46,"../../../core/console/print.coffee":54,"../../../core/fetch/color.coffee":65,"../../../core/fetch/text.js":68,"../../../core/fetch/value.coffee":69,"../../../object/validate.coffee":175,"../../../string/strip.js":178,"../../../tooltip/remove.coffee":206,"../../../util/child.coffee":208,"../../../util/closest.coffee":209,"../../../util/uniques.coffee":213,"../tooltip/create.js":243,"../zoom/direction.coffee":253,"../zoom/propagation.coffee":256,"./arc.coffee":220,"./area.js":221,"./check.js":222,"./coordinates.coffee":224,"./cross.js":225,"./diamond.js":226,"./donut.js":227,"./fill.js":230,"./line.js":232,"./radial.coffee":234,"./rect.coffee":235,"./segments.coffee":236,"./triangle_down.js":238,"./triangle_up.js":239,"./whisker.coffee":240}],229:[function(e,t,n){var r=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 n(t){var n=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 r=e.edges.arrows.direction.value;if("bucket"in t.d3plus)var a="_"+t.d3plus.bucket;else var a="";return"source"==r&&n?"url(#d3plus_edge_marker_default"+a+")":"none"}).attr("marker-end",function(t){var r=e.edges.arrows.direction.value;if("bucket"in t.d3plus)var a="_"+t.d3plus.bucket;else var a="";return"target"==r&&n?"url(#d3plus_edge_marker_default"+a+")":"none"}).attr("vector-effect","non-scaling-stroke").attr("pointer-events","none")}function i(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 o(e){e.attr("d",function(e){return v(e.d3plus.spline)})}function l(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 n=this.getTotalLength(),r=this.getPointAtLength(n/2),a=this.getPointAtLength(n/2-.1*n),i=this.getPointAtLength(n/2+.1*n),o=Math.atan2(i.y-a.y,i.x-a.x),l=o*(180/Math.PI),s=(this.parentNode.getBBox(),.8*n),u=r.x,c=r.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,r={x:h.x-v/2,y:h.y-g/2},o=Math.atan2(g,v),l=o*(180/Math.PI),n=Math.sqrt(v*v+g*g),s=n,u=r.x,c=r.y;s+=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],s-=2*m),(l<-90||l>90)&&(l-=180),s*e.zoom.behavior.scaleExtent()[0]>20&&(t.d3plus_label={x:u,y:c,translate:{x:u,y:c},w:s,h:15+2*e.labels.padding,angle:l,anchor:"middle",valign:"center",color:e.edges.color,resize:!1,names:[e.format.value(t[e.edges.label])],background:1})}}var s=e.returned.edges||[],u=e.zoom.behavior.scaleExtent()[0];if("string"==typeof e.edges.size.value){var c=d3.extent(s,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(s,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=r(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 n=t.split("_");if(2==n.length&&e.edges.scale){n=parseInt(n[1]);var r=y[n]}else var r=y;return"target"==e.edges.arrows.direction.value?"M 0,-"+r/2+" L "+.85*r+",0 L 0,"+r/2+" L 0,-"+r/2:"M 0,-"+r/2+" L -"+.85*r+",0 L 0,"+r/2+" L 0,-"+r/2}).attr("fill",function(t){var n=t.split("_")[0];return"default"==n?e.edges.color:"focus"==n?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 M="string"==typeof e.edges.size.value?r(e.edges.scale.domain(),4):null,A=e.edges.arrows.direction.value,j=s.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(M){var n=t[e.edges.size.value];t.d3plus.bucket=n<M[1]?0:n<M[2]?1:2;var r=.85*y[t.d3plus.bucket]/u}else{delete t.d3plus.bucket;var r=.85*y/u}var i=t[e.edges.source],o=t[e.edges.target];if(!i.d3plus||!o.d3plus)return!1;var l=Math.atan2(i.d3plus.y-o.d3plus.y,i.d3plus.x-o.d3plus.x),s=Math.atan2(o.d3plus.y-i.d3plus.y,o.d3plus.x-i.d3plus.x),c="source"==A&&e.edges.arrows.value?i.d3plus.r+r:i.d3plus.r,f="target"==A&&e.edges.arrows.value?o.d3plus.r+r:o.d3plus.r,d=a(l,c,e.shape.value),p=a(s,f,e.shape.value);return"edges"in i.d3plus||(i.d3plus.edges={}),i.d3plus.edges[o[e.id.value]]={x:i.d3plus.x-d.x,y:i.d3plus.y-d.y},"edges"in o.d3plus||(o.d3plus.edges={}),o.d3plus.edges[i[e.id.value]]={x:o.d3plus.x-p.x,y:o.d3plus.y-p.y},!0}return!1}),E=e.g.edges.selectAll("g.d3plus_edge_line").data(j,function(e){return e.d3plus.id}),S=s.filter(function(t){if(t.d3plus.spline){if(M){var n=t[e.edges.size.value];t.d3plus.bucket=n<M[1]?0:n<M[2]?1:2;var r=.85*y[t.d3plus.bucket]/u}else{delete t.d3plus.bucket;var r=.85*y/u}var i=t[e.edges.source],o=t[e.edges.target],l=i.d3plus.edges?i.d3plus.edges[o[e.id.value]]||{}:{},s=o.d3plus.edges?o.d3plus.edges[i[e.id.value]]||{}:{},c=e.edges.arrows.value&&"source"==A?r:0,f=e.edges.arrows.value&&"target"==A?r:0,d=.1,p=i.d3plus.x>o.d3plus.x?1-d:1+d,h=i.d3plus.x>o.d3plus.x?1+d:1-d,v="number"==typeof l.angle?l.angle:Math.atan2(i.d3plus.y-o.d3plus.y,i.d3plus.x-o.d3plus.x)*p,g=a(v,i.d3plus.r+c,e.shape.value),m="number"==typeof s.angle?s.angle:Math.atan2(o.d3plus.y-i.d3plus.y,o.d3plus.x-i.d3plus.x)*h,x=a(m,o.d3plus.r+f,e.shape.value),b=[i.d3plus.x-g.x,i.d3plus.y-g.y],w=!!l.offset&&a(v,l.offset),_=w?[b[0]-w.x,b[1]-w.y]:b,k=[o.d3plus.x-x.x,o.d3plus.y-x.y],z=!!s.offset&&a(m,s.offset),j=z?[k[0]-z.x,k[1]-z.y]:k,E=j[0]-_[0],S=j[1]-_[1],O="number"==typeof l.radius?l.radius:Math.sqrt(E*E+S*S)/4,N="number"==typeof s.radius?s.radius:Math.sqrt(E*E+S*S)/4,F=a(v,O-i.d3plus.r-2*c),C=a(m,N-o.d3plus.r-2*f);t.d3plus.spline=[b,k];var T=Math.abs(Math.atan2(i.d3plus.y-o.d3plus.y,i.d3plus.x-o.d3plus.x)).toFixed(5),q=Math.abs(v).toFixed(5),P=Math.abs(m-Math.PI).toFixed(5);return(q!==P||[q,P].indexOf(T)<0)&&(t.d3plus.spline.splice(1,0,[_[0]-F.x,_[1]-F.y],[j[0]-C.x,j[1]-C.y]),w&&t.d3plus.spline.splice(1,0,_),z&&t.d3plus.spline.splice(t.d3plus.spline.length-1,0,j)),!0}return!1}),O=e.g.edges.selectAll("g.d3plus_edge_path").data(S,function(e){return e.d3plus.id});e.draw.timing?(E.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),O.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),E.selectAll("text.d3plus_label, rect.d3plus_label_bg").transition().duration(e.draw.timing/2).attr("opacity",0).remove(),O.selectAll("text.d3plus_label, rect.d3plus_label_bg").transition().duration(e.draw.timing/2).attr("opacity",0).remove(),E.selectAll("line").data(function(e){return[e]}).transition().duration(e.draw.timing).call(i).call(n).each("end",l),O.selectAll("path").data(function(e){return[e]}).transition().duration(e.draw.timing).call(o).call(n).each("end",l),E.enter().append("g").attr("class","d3plus_edge_line").append("line").call(i).call(t).transition().duration(e.draw.timing).call(n).each("end",l),O.enter().append("g").attr("class","d3plus_edge_path").append("path").call(o).call(t).transition().duration(e.draw.timing).call(n).each("end",l)):(E.exit().remove(),O.exit().remove(),E.selectAll("text.d3plus_label, rect.d3plus_label_bg").remove(),O.selectAll("text.d3plus_label, rect.d3plus_label_bg").remove(),E.selectAll("line").data(function(e){return[e]}).call(i).call(n).call(l),O.selectAll("path").data(function(e){return[e]}).call(o).call(n).call(l),E.enter().append("g").attr("class","d3plus_edge_line").append("line").call(i).call(t).call(n).call(l),O.enter().append("g").attr("class","d3plus_edge_path").append("path").call(o).call(t).call(n).call(l))}},{"../../../geom/offset.coffee":163,"../../../util/buckets.coffee":207}],230:[function(e,t,n){var r=e("../../../util/copy.coffee"),a=e("../../../core/fetch/color.coffee"),i=(e("../../../core/fetch/value.coffee"),e("./segments.coffee")),o=e("./style.coffee");t.exports=function(e,t,n,l){function s(e){e.attr("x",0).attr("y",0).attr("width",0).attr("height",0)}function u(t,n){n||(n=0),t.attr("x",function(e){var t=e.d3plus.r?2*e.d3plus.r:e.d3plus.width;return-t/2-n/2}).attr("y",function(e){var t=e.d3plus.r?2*e.d3plus.r:e.d3plus.height;return-t/2-n/2}).attr("width",function(e){var t=e.d3plus.r?2*e.d3plus.r:e.d3plus.width;return t+n}).attr("height",function(e){var t=e.d3plus.r?2*e.d3plus.r:e.d3plus.height;return t+n}).attr("rx",function(t){var r=t.d3plus.r?2*t.d3plus.r:t.d3plus.width,a=["circle","donut"].indexOf(e.shape.value)>=0;return a?(r+n)/2:0}).attr("ry",function(t){var r=t.d3plus.r?2*t.d3plus.r:t.d3plus.height,a=["circle","donut"].indexOf(e.shape.value)>=0;return a?(r+n)/2:0}).attr("shape-rendering",function(t){return["square"].indexOf(e.shape.value)>=0?e.shape.rendering.value:"auto"})}function c(t,n,r,a){n||(n=0),"number"!=typeof r&&(r=void 0),"number"!=typeof a&&(a=void 0),t.attrTween("d",function(t){if(void 0===r)var i=t.d3plus.r?t.d3plus.r:d3.max([t.d3plus.width,t.d3plus.height]);else var i=r;if(void 0===a)var o=t.d3plus.segments[t.d3plus.shape];else var o=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 l=d3.interpolate(e.arcs[t.d3plus.shape][t.d3plus.id].r,i+n),s=d3.interpolate(e.arcs[t.d3plus.shape][t.d3plus.id].a,o);return function(n){return e.arcs[t.d3plus.shape][t.d3plus.id].r=l(n),e.arcs[t.d3plus.shape][t.d3plus.id].a=s(n),f(t)}})}e.arcs||(e.arcs={donut:{},active:{},temp:{}});var f=d3.svg.arc().startAngle(0).endAngle(function(t){var n=e.arcs[t.d3plus.shape][t.d3plus.id].a;return n>2*Math.PI?2*Math.PI:n}).innerRadius(function(t){if(t.d3plus.static||"donut"!==e.shape.value)return 0;var n=e.arcs[t.d3plus.shape][t.d3plus.id].r;return n*e.data.donut.size}).outerRadius(function(t){var n=e.arcs[t.d3plus.shape][t.d3plus.id].r;return"donut"===e.shape.value?n:2*n});t.each(function(t){function n(t){t.attr("stroke",h).attr("stroke-width",1).attr("shape-rendering",e.shape.rendering.value)}var l=i(e,t,"active"),f=i(e,t,"temp"),d=i(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=r(t);m.d3plus.shape="temp",v.push(m),g=["temp"]}if(l&&(l<d||f)){var m=r(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(n),x.append("line").attr("x1","-1").attr("x2","1").attr("y1","9").attr("y2","11").call(n),x.append("line").attr("x1","9").attr("x2","11").attr("y1","-1").attr("y2","1").call(n);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(s),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(o,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(o,e).call(c,0,void 0,0).transition().duration(e.draw.timing).call(c).call(o,e),_.exit().transition().duration(e.draw.timing).call(c,0,void 0,0).remove()})}},{"../../../core/fetch/color.coffee":65,"../../../core/fetch/value.coffee":69,"../../../util/copy.coffee":210,"./segments.coffee":236,"./style.coffee":237}],231:[function(e,t,n){var r=(e("../../../util/copy.coffee"),e("../../../core/fetch/text.js")),a=e("../../../core/fetch/value.coffee"),i=e("../../../color/mix.coffee"),o=e("../../../core/console/print.coffee"),l=(e("../../../client/rtl.coffee"),e("./segments.coffee")),s=e("./color.coffee"),u=e("../../../string/list.coffee"),c=e("../../../color/text.coffee"),f=e("../../../textwrap/textwrap.coffee");t.exports=function(e,t){var n=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 r=parseFloat(d3.select(this).attr("font-size"),10);return t.visible=r*(e.zoom.scale/n[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 r="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 n=s(t.parent,e),r=c(n),a=t.text?.15:1;return i(n,r,.2,a)}).each(function(t){if(t.resize instanceof Array){t.resize[0],t.resize[1]}var a=t.resize,i=!0;if(t.text){a instanceof Array||(a=[9,50],i=t.resize);var o=t.y-t.h*n[1]/2+t.padding/2;"bottom"===r&&(o+=t.h*n[1]/2),f().align("center").container(d3.select(this)).height(t.h*n[1]/2).padding(t.padding/2).resize(i).size(a).text(e.format.value(100*t.text,{key:"share",vars:e})).width(t.w*n[1]).valign(r).x(t.x-t.w*n[1]/2+t.padding/2).y(o).draw()}else{t.resize instanceof Array||(a=[7,40*(n[1]/n[0])],i=t.resize);var l="bottom"===e.labels.valign.value?t.share:0;f().align(t.anchor||e.labels.align.value).container(d3.select(this)).height(t.h*n[1]-t.share).padding(t.padding/2).resize(i).size(a).shape(t.shape||"square").text(t.names).valign(e.labels.valign.value).width(t.w*n[1]).x(t.x-t.w*n[1]/2+t.padding/2).y(t.y-t.h*n[1]/2+t.padding/2+l).draw()}}).attr("transform",function(e){var t=d3.select(this).attr("transform")||"",r=e.angle||0,a=e.translate&&e.translate.x?e.translate.x:0,i=e.translate&&e.translate.y?e.translate.y:0;return t.length&&(t=t.split(")").slice(-3).join(")")),"rotate("+r+","+a+","+i+")scale("+1/n[1]+")translate("+(e.x*n[1]-e.x)+","+(e.y*n[1]-e.y)+")"+t})};if("edges"===t||e.labels.value){if(e.dev.value){var g="drawing "+t+" labels";o.time(g)}d.each(function(t){function i(t){var n="string"==typeof s.background?s.background:"none"===e.background.value?"#ffffff":e.background.value,r="string"==typeof s.background?s.background:n,a=_.attr("transform").split(")");a.pop(),a.pop(),a.push(""),a=a.join(")"),t.attr("fill",r).attr(S).attr("transform",a)}var o=t.d3plus&&"label"in t.d3plus&&!t.d3plus.label,s=t.d3plus_label||null,c=t.d3plus_share,f=t.d3plus.text?t.d3plus.text:s&&s.names?s.names:e.labels.text.value?a(e,t,e.labels.text.value):r(e,t),d=s&&"group"in s?s.group:d3.select(this),g=0,m=e.types[e.type.value].fill;if(f instanceof Array||(f=[f]),s)if(["line","area"].indexOf(e.shape.value)>=0)var y=!0;else if(t&&"d3plus"in t)var x=l(e,t,"active"),b=l(e,t,"temp"),w=l(e,t,"total"),y=!b&&!x||x>=w||!x&&b>=w;if(o||!(s&&s.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(s&&(s.resize=e.labels.resize.value!==!1&&(!(s&&"resize"in s)||s.resize),s.padding="number"==typeof s.padding?s.padding:e.labels.padding),s&&s.w*n[1]-s.padding>=20&&s.h*n[1]-s.padding>=10&&f.length){for(var k=e.format.locale.value.ui.and,z=e.format.locale.value.ui.more,M=0;M<f.length;M++)f[M]instanceof Array&&(f[M]=u(f[M],k,3,z));s.names=f,s.share=g,s.parent=t;var _=d.selectAll("text#d3plus_label_"+t.d3plus.id).data([s],function(e){return!!e&&e.w+"_"+e.h+"_"+e.x+"_"+e.y+"_"+e.names.join("_")}),A=s.resize?void 0:e.labels.font.size*n[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",A).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",A).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(s.background){var j=["background"],E=_.node().getBBox(),S={height:E.height,width:E.width,x:E.x,y:E.y>0?E.y:-E.height/2};S.width+=e.labels.padding*n[0],S.height+=e.labels.padding*n[0],S.x-=e.labels.padding*n[0]/2,S.y-=e.labels.padding*n[0]/2;var O=_.attr("transform").match(/translate\(([^a-z]+)\)/gi)[0];O=O.replace(/([^a-z])\s([^a-z])/gi,"$1,$2"),O=O.split(","),O.length>1&&(O=O[O.length-1],O=O.substring(0,O.length-1),S.y+=parseFloat(O))}else var j=[],S={};var N=d.selectAll("rect#d3plus_label_bg_"+t.d3plus.id).data(j),F="number"==typeof s.background?s.background:"string"==typeof s.background?1:.6;e.draw.timing?(N.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),N.transition().duration(e.draw.timing).attr("opacity",F).call(i),N.enter().insert("rect",".d3plus_label").attr("id","d3plus_label_bg_"+t.d3plus.id).attr("class","d3plus_label_bg").attr("opacity",0).call(i).transition().duration(e.draw.timing).attr("opacity",F)):(N.exit().remove(),N.enter().insert("rect",".d3plus_label").attr("id","d3plus_label_bg_"+t.d3plus.id).attr("class","d3plus_label_bg"),N.attr("opacity",F).call(i))}}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&&o.timeEnd(g)}else{if(e.dev.value){var g="removing "+t+" labels";o.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&&o.timeEnd(g)}}},{"../../../client/rtl.coffee":42,"../../../color/mix.coffee":48,"../../../color/text.coffee":52,"../../../core/console/print.coffee":54,"../../../core/fetch/text.js":68,"../../../core/fetch/value.coffee":69,"../../../string/list.coffee":177,"../../../textwrap/textwrap.coffee":203,"../../../util/copy.coffee":210,"./color.coffee":223,"./segments.coffee":236}],232:[function(e,t,n){function r(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 n=e.d3plus.r?2*e.d3plus.r:e.d3plus.width;return e.d3plus.x-(n/2+t/2)}).attr("y",function(e){var n=e.d3plus.r?2*e.d3plus.r:e.d3plus.height;return e.d3plus.y-(n/2+t/2)}).attr("width",function(e){var n=e.d3plus.r?2*e.d3plus.r:e.d3plus.width;return n+t}).attr("height",function(e){var n=e.d3plus.r?2*e.d3plus.r:e.d3plus.height;return n+t}).attr("rx",function(e){var n=e.d3plus.r?2*e.d3plus.r:e.d3plus.width;return(n+t)/2}).attr("ry",function(e){var n=e.d3plus.r?2*e.d3plus.r:e.d3plus.height;return(n+t)/2})}function i(e,t,n,r){var i=e.draw.timing?e.timing.mouseevents:0;void 0===r&&(r=0),i?(d3.select(t.parentNode).selectAll("path.d3plus_line").transition().duration(i).style("stroke-width",function(t){var a=n;if(a.constructor!==Number){var i=c(e,t,n);a=i&&i.length?d3.max(i):e.data.stroke.width}return a+r}),d3.select(t.parentNode).selectAll("rect").transition().duration(i).style("stroke-width",function(t){var r=n;if(r.constructor!==Number){var a=c(e,t,n);r=a&&a.length?d3.max(a):e.data.stroke.width}return r}).call(a,r)):(d3.select(t.parentNode).selectAll("path.d3plus_line").style("stroke-width",function(t){var a=n;if(a.constructor!==Number){var i=c(e,t,n);a=i&&i.length?d3.max(i):e.data.stroke.width}return a+r}),d3.select(t.parentNode).selectAll("rect").style("stroke-width",function(t){var r=n;if(r.constructor!==Number){var a=c(e,t,n);r=a&&a.length?d3.max(a):e.data.stroke.width}return r}).call(a,r))}var o=e("../../../util/copy.coffee"),l=e("../../../util/closest.coffee"),s=e("../../../client/pointer.coffee"),u=e("./style.coffee"),c=e("../../../core/fetch/value.coffee");t.exports=function(e,t,n,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 n=p;if(n.constructor!==Number){var r=c(e,t,p);n=r&&r.length?d3.max(r):e.data.stroke.width}return n<15?15:n},g=h.ticks.values.map(function(e){return e.constructor===Date?e.getTime():e});t.each(function(t){var n=!1,f=[],m=[],y=o(t),x=d3.select(this);y.values=[],y.segment_key=y.key,t.values.forEach(function(r,a,i){var s=c(e,r,h.value);s.constructor===Date&&(s=s.getTime());var u=g.indexOf(l(g,s));n===!1||n===u-1?(y.values.push(r),y.segment_key+="_"+u):(y.values.length>1?f.push(y):m.push(y.values[0]),y=o(t),y.values=[r]),a===i.length-1&&(y.values.length>1?f.push(y):m.push(y.values[0])),n=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(r).call(u,e),w.transition().duration(e.draw.timing).call(a).call(u,e),w.exit().transition().duration(e.draw.timing).call(r).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(s.over,function(t){!e.draw.frozen&&e.mouse.value&&e.mouse.over.value&&i(e,this,p,2)}).on(s.out,function(t){!e.draw.frozen&&e.mouse.value&&e.mouse.out.value&&i(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":40,"../../../core/fetch/value.coffee":69,"../../../util/closest.coffee":209,"../../../util/copy.coffee":210,"./style.coffee":237}],233:[function(e,t,n){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 n=e.returned.edges||[],r=e.g.edges.selectAll("g.d3plus_edge_path").data(n,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?(r.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),r.selectAll("text.d3plus_label, rect.d3plus_label_bg").transition().duration(e.draw.timing/2).attr("opacity",0).remove(),r.selectAll("path").data(function(e){return[e]}).transition().duration(e.draw.timing).call(t),r.enter().append("g").attr("class","d3plus_edge_path").append("path").style("stroke-width",0).transition().duration(e.draw.timing).call(t)):(r.exit().remove(),r.selectAll("text.d3plus_label, rect.d3plus_label_bg").remove(),r.selectAll("path").data(function(e){return[e]}).call(t),r.enter().append("g").attr("class","d3plus_edge_path").append("path").call(t))}},{}],234:[function(e,t,n){var r,a,i,o;o=e("./style.coffee"),i={},r={},a={r:{},a:{}},t.exports=function(e,t,n,l){var s,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}),s=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 n,r,a,i,o;for(i=t[c],o=[],r=0,a=i.length;r<a;r++)n=i[r],o.push(n.d3plus.id=n[e.id.value]+"_"+n[c]);return o}),u=d3.svg.line.radial().interpolate("linear-closed").radius(function(e,t){return void 0===i[e.d3plus.id]&&(i[e.d3plus.id]=0),isNaN(i[e.d3plus.id])&&(i[e.d3plus.id]=e.d3plus.r),i[e.d3plus.id]}).angle(function(e,t){return void 0===r[e.d3plus.id]&&(r[e.d3plus.id]=e.d3plus.a),isNaN(r[e.d3plus.id])&&(r[e.d3plus.id]=e.d3plus.a),r[e.d3plus.id]}),d=function(e,t){return e.attrTween("d",function(e){var n,o,l,s,f,d,p;for(p=e[c],l=s=0,f=p.length;s<f;l=++s)o=p[l],n=o.d3plus.a,void 0===t?d=o.d3plus.r:0===t&&(d=0),a.a[o.d3plus.id]=d3.interpolate(r[o.d3plus.id],n),a.r[o.d3plus.id]=d3.interpolate(i[o.d3plus.id],d);return function(t){var n,s,f;for(f=e[c],l=n=0,s=f.length;n<s;l=++n)o=f[l],r[o.d3plus.id]=a.a[o.d3plus.id](t),i[o.d3plus.id]=a.r[o.d3plus.id](t);return u(e[c])}})},n.append("path").attr("class","d3plus_data").call(o,e).attr("d",function(e){return u(e[c])}),t.selectAll("path.d3plus_data").data(s).transition().duration(e.draw.timing).call(o,e).call(d),l.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(d,0)):(n.append("path").attr("class","d3plus_data"),t.selectAll("path.d3plus_data").data(s).call(o,e).attr("d",function(e){return f(e[c])}))}},{"./style.coffee":237}],235:[function(e,t,n){var r;r=e("./style.coffee"),t.exports=function(e,t,n,a){var i,o,l;return i=function(t){var n,r;return e.labels.value&&!t.d3plus.label?(r=t.d3plus.r?2*t.d3plus.r:t.d3plus.width,n=t.d3plus.r?2*t.d3plus.r:t.d3plus.height,t.d3plus_label={w:r,h:n,x:0,y:0},t.d3plus_share={w:r,h:n,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]},o=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})},l=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,n;return t="circle"===e.d3plus.shape,n=e.d3plus.r?2*e.d3plus.r:e.d3plus.width,t?(n+2)/2:0}).attr("ry",function(e){var t,n;return n="circle"===e.d3plus.shape,t=e.d3plus.r?2*e.d3plus.r:e.d3plus.height,n?(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?(n.append("rect").attr("class","d3plus_data").call(o).call(r,e),t.selectAll("rect.d3plus_data").data(i).transition().duration(e.draw.timing).call(l).call(r,e),a.selectAll("rect.d3plus_data").transition().duration(e.draw.timing).call(o)):(n.append("rect").attr("class","d3plus_data"),t.selectAll("rect.d3plus_data").data(i).call(l).call(r,e))}},{"./style.coffee":237}],236:[function(e,t,n){var r;r=e("../../../core/fetch/value.coffee"),t.exports=function(e,t,n){var a;return a=e[n].value,a?n in t.d3plus?t.d3plus[n]:r(e,t,a):t.d3plus[n]}},{"../../../core/fetch/value.coffee":69}],237:[function(e,t,n){var r,a,i;r=e("./color.coffee"),a=e("../../../client/ie.js"),i=e("../../../core/fetch/value.coffee"),t.exports=function(e,t){return e.attr("fill",function(e){return e.d3plus&&e.d3plus.spline?"none":r(e,t)}).style("stroke",function(e){var n;return e.d3plus&&e.d3plus.stroke?e.d3plus.stroke:(n=e.values?r(e.values[0],t):r(e,t,!0),d3.rgb(n).darker(.6)); | |
}).style("stroke-width",function(e){var n;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(n=i(t,e,t.size.value),n&&n.length)return d3.max(n)}return t.data.stroke.width}).attr("opacity",t.data.opacity).attr("vector-effect","non-scaling-stroke")}},{"../../../client/ie.js":39,"../../../core/fetch/value.coffee":69,"./color.coffee":223}],238:[function(e,t,n){var r=e("./style.coffee");t.exports=function(e,t,n,a){function i(e){e.attr("d",d3.svg.symbol().type("triangle-down").size(10))}function o(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)}))}n.append("path").attr("class","d3plus_data").call(i).call(r,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(o).call(r,e):t.selectAll("path.d3plus_data").call(o).call(r,e)}},{"./style.coffee":237}],239:[function(e,t,n){var r=e("./style.coffee");t.exports=function(e,t,n,a){function i(e){e.attr("d",d3.svg.symbol().type("triangle-up").size(10))}function o(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)}))}n.append("path").attr("class","d3plus_data").call(i).call(r,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(o).call(r,e):t.selectAll("path.d3plus_data").call(o).call(r,e)}},{"./style.coffee":237}],240:[function(e,t,n){t.exports=function(e,t,n,r){var a,i,o,l,s,u,c,f,d;i=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)},o=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,n,r;return["top","bottom"].indexOf(e.d3plus.position)>=0?0:(t=e.d3plus.offset||0,n=e.d3plus.width||0,r=t<0?-n:n,r+t)}).attr("x2",function(e){return["top","bottom"].indexOf(e.d3plus.position)>=0?0:e.d3plus.offset||0}).attr("y1",function(e){var t,n,r;return["left","right"].indexOf(e.d3plus.position)>=0?0:(n=e.d3plus.offset||0,t=e.d3plus.height||0,r=n<0?-t:t,r+n)}).attr("y2",function(e){return["left","right"].indexOf(e.d3plus.position)>=0?0:e.d3plus.offset||0}).attr("marker-start","url(#d3plus_whisker_marker)")},l=e.defs.selectAll("#d3plus_whisker_marker").data([0]),l.enter().append("marker").attr("id","d3plus_whisker_marker").attr("markerUnits","userSpaceOnUse").style("overflow","visible").append("line"),a=t.datum(),a?(u=a.d3plus.position,s=["top","bottom"].indexOf(u)>=0?"horizontal":"vertical",f="horizontal"===s?a.d3plus.width:a.d3plus.height):(s="horizontal",f=0),l.select("line").attr("x1","horizontal"===s?-f/2:0).attr("x2","horizontal"===s?f/2:0).attr("y1","vertical"===s?-f/2:0).attr("y2","vertical"===s?f/2:0).call(d).style("stroke-width",2*e.data.stroke.width),e.draw.timing?(n.append("line").attr("class","d3plus_data").call(d).call(o),t.selectAll("line.d3plus_data").data(i).transition().duration(e.draw.timing).call(d).call(c),r.selectAll("line.d3plus_data").transition().duration(e.draw.timing).call(o)):(n.append("line").attr("class","d3plus_data"),t.selectAll("line.d3plus_data").data(i).call(d).call(c))}},{}],241:[function(e,t,n){var r=e("../../../client/pointer.coffee"),a=e("../../../client/prefix.coffee"),i=e("../../../core/console/print.coffee"),o=e("../../../client/touch.coffee"),l=e("../zoom/propagation.coffee");t.exports=function(e){e.dev.value&&i.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(r.move,function(t){o&&l(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(r.up,function(t){o&&l(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(r.down,function(t){o&&l(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&&i.timeEnd("creating SVG elements")}},{"../../../client/pointer.coffee":40,"../../../client/prefix.coffee":41,"../../../client/touch.coffee":45,"../../../core/console/print.coffee":54,"../zoom/propagation.coffee":256}],242:[function(e,t,n){var r=e("../../../core/console/print.coffee");t.exports=function(e){e.dev.value&&r.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&&r.timeEnd("updating SVG elements")}},{"../../../core/console/print.coffee":54}],243:[function(e,t,n){var r=e("../../../array/sort.coffee"),a=e("../../../tooltip/create.js"),i=e("../../../core/data/nest.js"),o=e("./data.js"),l=e("../../../core/fetch/color.coffee"),s=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 n[e].value?n[e].value:n.format.locale.value.method[e]}var g,w="depth"in e?e.depth:y,A={},j=n.id.nesting[w+1]in m?w+1:w,E=n.id.nesting[j],C="merged"in m.d3plus?m.d3plus.merged:m[E];C instanceof Array||(C=[C]);var T=u(n,m,n.size.value);if(n.tooltip.children.value){if(C=C.slice(0),C.length>1&&v(C[0])&&(C=i(n,C,[E])),n.size.value&&v(C[0])){var q=[],P=C.filter(function(e){var t=u(n,e,n.size.value);return!(null===t||"d3plus"in e&&e.d3plus.merged)||void q.push(e)});r(P,n.size.value,"desc",[],n),C=P.concat(q)}var B=n.tooltip.children.value===!0?3:n.tooltip.children.value,D="short"===M?B:n.data.large,R=C.length,I=d3.min([R,D]);g={values:[]};for(var L=0;L<I&&C.length;L++){var V=C.shift(),U=s(n,V,j)[0],Y=v(V)?u(n,V,E,j):V;if(Y!==m[n.id.nesting[w]]&&U&&!g[U]){var H=v(V)?u(n,V,n.size.value,E):null,X=l(n,V,E);g[U]=!H||H instanceof Array?"":n.format.value(H,{key:n.size.value,vars:n,data:V});var G={};G[U]=g[U],g.values.push(G),X&&(g.d3plus_colors||(g.d3plus_colors={}),g.d3plus_colors[U]=X)}else L--}R>I&&(g.d3plusMore=R-I)}m.d3plus.tooltip&&(A=c(A,m.d3plus.tooltip)),n.tooltip.size.value&&(T&&"number"!=typeof n.size.value&&(A[p("size")]=T),n.axes.opposite&&n[n.axes.opposite].value!==n.size.value&&(A[p(n.axes.opposite)]=u(n,m,n[n.axes.opposite].value)),n.axes.opposite&&n[n.axes.opposite+"2"].value!==n.size.value&&(A[p(n.axes.opposite+"2")]=u(n,m,n[n.axes.opposite+"2"].value)),n.color.valueScale&&(A[p("color")]=u(n,m,n.color.value)));var Z=d(n,m,"active"),W=d(n,m,"temp"),J=d(n,m,"total");"number"==typeof Z&&Z>0&&J&&(A[p("active")]=Z+"/"+J+" ("+n.format.value(Z/J*100,{key:"share",vars:n,data:m})+")"),"number"==typeof W&&W>0&&J&&(A[p("temp")]=W+"/"+J+" ("+n.format.value(W/J*100,{key:"share",vars:n,data:m})+")"),n.tooltip.share.value&&m.d3plus.share&&(A.share=n.format.value(100*m.d3plus.share,{key:"share",vars:n,data:m}));var j="depth"in e?e.depth:y,Q=e.title||s(n,m,j)[0],K=h(m,n.icon.value,u,n,n.id.nesting[j]),$=e.titleOnly?[]:o(n,m,M,A,g,j);if(K=1===K.length&&"string"==typeof K[0]&&K[0],$.length>0||S||!m.d3plus_label&&"short"==M&&Q||m.d3plus_label&&(!("visible"in m.d3plus_label)||"visible"in m.d3plus_label&&m.d3plus_label.visible===!1)){Q||(Q=n.format.value(Y,{key:n.id.value,vars:n}));var j="d3plus"in m&&"merged"in m.d3plus?y-1:"depth"in e?e.depth:y;if(j<0&&(j=0),j=n.id.nesting[j],"string"==typeof n.icon.style.value)var ee=n.icon.style.value;else if("object"==typeof n.icon.style.value&&n.icon.style.value[j])var ee=n.icon.style.value[j];else var ee="default";var te=n.tooltip.small;e.width?te=e.width:k&&(te=n.tooltip.large);var ne=!k&&"long"!==e.length||k&&n.tooltip.fullscreen.value?d3.select("body"):n.container.value;!e.description&&m&&n.tooltip.sub.value&&(e.description=u(n,m,n.tooltip.sub.value)),a({align:z,arrow:b,locale:n.format.locale.value,background:n.tooltip.background,curtain:n.tooltip.curtain.color,curtainopacity:n.tooltip.curtain.opacity,fontcolor:n.tooltip.font.color,fontfamily:n.tooltip.font.family.value,fontsize:n.tooltip.font.size,fontweight:n.tooltip.font.weight,data:$,color:l(n,m),allColors:!0,footer:e.footer===!1?e.footer:S,fullscreen:k,html:t,js:e.js,icon:K,id:_,max_height:e.maxheight,max_width:te,mouseevents:x,offset:F,parent:ne,stacked:n.tooltip.stacked.value,style:ee,title:Q,description:e.description,width:e.width||k||0!=$.length?te:"auto",x:O,y:N})}else f(_)}"d3plus"in e.data||(e.data.d3plus={});var n=e.vars,m=e.data,y="d3plus"in m&&"depth"in m.d3plus?m.d3plus.depth:n.depth.value,x=(e.ex,!!e.mouseevents&&e.mouseevents),b=!("arrow"in e)||e.arrow,w=u(n,m,n.id.value),_=e.id||n.type.value;if(!d3.event||"click"!=d3.event.type||!n.tooltip.html.value&&!n.tooltip.value.long||"fullscreen"in e){var k=!1,z=e.anchor||n.tooltip.anchor,M=e.length||"short",A=g(m,n);if(A===-1){var j=n.id.nesting[y-1];u(n,w,j)}var E="";if(n.mouse.click.value&&(!n.mouse.viz||n.mouse.viz.click!==!1))if(1===A&&n.zoom.value)var E=n.format.value(n.format.locale.value.ui.expand);else if(A===-1&&n.zoom.value&&n.history.states.length&&!n.tooltip.value.long)var E=n.format.value(n.format.locale.value.ui.collapse);else if(n.small||"short"!=M||!n.tooltip.html.value&&!n.tooltip.value.long||1===n.focus.value.length&&n.focus.value[0]==w){if("long"==M)var E=n.footer.value||""}else var E=n.format.locale.value.ui.moreInfo;var S=!!E.length&&n.format.value(E,{key:"footer",vars:n})}else{var k=!0,b=!1,x=!0,M="long",S=n.footer.value;n.covered=!0}if("x"in e)var O=e.x;else if("static"===n.types[n.type.value].tooltip){var O=m.d3plus.x;n.zoom.translate&&n.zoom.scale&&(O=n.zoom.translate[0]+O*n.zoom.scale),O+=n.margin.left,"long"!==e.length&&(N+=p.x(),O+=n.container.value.node().getBoundingClientRect().left,O+=parseFloat(n.container.value.style("padding-left"),10))}else var O=d3.mouse(d3.select("html").node())[0];if("y"in e)var N=e.y;else if("static"==n.types[n.type.value].tooltip){var N=m.d3plus.y;n.zoom.translate&&n.zoom.scale&&(N=n.zoom.translate[1]+N*n.zoom.scale),N+=n.margin.top,"long"!==e.length&&(N+=p.y(),N+=n.container.value.node().getBoundingClientRect().top,N+=parseFloat(n.container.value.style("padding-top"),10))}else var N=d3.mouse(d3.select("html").node())[1];if("offset"in e)var F=e.offset;else if("static"==n.types[n.type.value].tooltip){var F=m.d3plus.r?m.d3plus.r:m.d3plus.height/2;n.zoom.scale&&(F*=n.zoom.scale)}else var F=3;if(k||"long"===e.length)if("string"==typeof n.tooltip.html.value)t(n.tooltip.html.value);else if("function"==typeof n.tooltip.html.value)t(n.tooltip.html.value(w));else if(n.tooltip.html.value&&"object"==typeof n.tooltip.html.value&&n.tooltip.html.value.url){var C=n.tooltip.html.value.url;"function"==typeof C&&(C=C(w)),d3.json(C,function(e){var r=n.tooltip.html.value.callback?n.tooltip.html.value.callback(e):e;t(r)})}else t(e.html);else t(e.html)}},{"../../../array/sort.coffee":36,"../../../client/scroll.js":43,"../../../core/data/nest.js":62,"../../../core/fetch/color.coffee":65,"../../../core/fetch/text.js":68,"../../../core/fetch/value.coffee":69,"../../../object/merge.coffee":174,"../../../object/validate.coffee":175,"../../../tooltip/create.js":204,"../../../tooltip/remove.coffee":206,"../../../util/uniques.coffee":213,"../shapes/segments.coffee":236,"../zoom/direction.coffee":253,"./data.js":244}],244:[function(e,t,n){var r=e("../../../util/copy.coffee"),a=e("../../../core/fetch/value.coffee"),i=e("../../../core/fetch/color.coffee"),o=e("../../../core/fetch/text.js"),l=e("../../../color/legible.coffee"),s=e("../../../object/merge.coffee"),u=e("../../../client/prefix.coffee"),c=e("../../../string/format.js"),f=e("../../../object/validate.coffee");t.exports=function(e,t,n,d,p,h){function v(n,r){if(e.attrs.value[r])var i=r;else var i=null;r&&(r=e.format.value(r));var o=m[n]||a(e,t,n,i);if(f(o))w.push({name:e.format.value(n),value:e.format.value(o.value,{key:o.key,vars:e}),group:r});else if(null!=o&&"undefined"!=o&&!(o instanceof Array)&&("string"==typeof o&&o.indexOf("d3plus_other")<0||"string"!=typeof o)){var l=e.format.locale.value.ui[n]?e.format.value(e.format.locale.value.ui[n]):e.format.value(n),s=x.indexOf(n)>=0;o instanceof Array?o.forEach(function(r){r=e.format.value(r,{key:n,vars:e,data:t})}):o=e.format.value(o,{key:n,vars:e,data:t});var u={name:l,value:o,highlight:s,group:r};if(e.descs.value)if("function"==typeof e.descs.value){var c=e.descs.value(n);"string"==typeof c&&(u.desc=c)}else n in e.descs.value&&(u.desc=e.descs.value[n]);w.push(u)}}if(e.small)return[];if(!n)var n="long";if("long"==n)var g="short";else var g="long";var m={};if(d&&"string"==typeof d)d=[d];else if(d&&"object"==typeof d){m=s(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[n]?b[n]:b[g]?[]:s({"":[]},b)),"string"==typeof b?b=[b]:b instanceof Array||(b=s({"":[]},b))}var w=[];if(b.constructor===Array&&(b={"":b}),e.id.nesting.length&&h<e.id.nesting.length-1){var b=r(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 M=e.format.locale.value.ui.including,A=p.d3plus_colors;p.values.forEach(function(t){var n=d3.keys(t)[0];w.push({group:e.format.value(M),highlight:!(!A||!A[n])&&A[n],name:n,value:t[n]})}),p.d3plusMore&&w.push({group:e.format.value(M),highlight:!0,name:c(e.format.locale.value.ui.more,p.d3plusMore),value:""})}if(e.tooltip.connections.value&&"long"===n){var j=e.edges.connections(t[e.id.value],e.id.value,!0);j.length&&j.forEach(function(t){var n=e.data.viz.filter(function(n){return n[e.id.value]===t[e.id.value]}),n=n.length?n[0]:t,r=o(e,n)[0],a=i(e,n),s=e.tooltip.font.size,c="square"==e.shape.value?0:s;styles=["background-color: "+a,"border-color: "+l(a),"border-style: solid","border-width: "+e.data.stroke.width+"px","display: inline-block","height: "+s+"px","left: 0px","position: absolute","width: "+s+"px","top: 0px",u()+"border-radius: "+c+"px"],node="<div style='"+styles.join("; ")+";'></div>";var f=function(){e.self.focus([n[e.id.value]]).draw()};w.push({group:e.format.value(e.format.locale.value.ui.primary),highlight:!1,link:f,name:"<div id='d3plustooltipfocuslink_"+n[e.id.value]+"' class='d3plus_tooltip_focus_link' style='position:relative;padding-left:"+1.5*s+"px;'>"+node+r+"</div>"})})}return w}},{"../../../client/prefix.coffee":41,"../../../color/legible.coffee":46,"../../../core/fetch/color.coffee":65,"../../../core/fetch/text.js":68,"../../../core/fetch/value.coffee":69,"../../../object/merge.coffee":174,"../../../object/validate.coffee":175,"../../../string/format.js":176,"../../../util/copy.coffee":210}],245:[function(e,t,n){var r;r=e("../../../core/console/print.coffee"),t.exports=function(e){var t,n,a,i,o,l,s,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,i=!a||a&&e.data.viz.length,!e.error.internal&&i){for(t=e.format.locale.value.visualization[e.type.value],e.dev.value&&r.time("running "+t),s=e.data.viz,o=0,l=s.length;o<l;o++)n=s[o],n.d3plus&&(delete n.d3plus.shape,delete n.d3plus.label,delete n.d3plus.rotate,delete n.d3plus.share);c=f(e),e.dev.value&&r.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":54}],246:[function(e,t,n){var r=e("../../../util/copy.coffee"),a=e("../../../form/form.js"),i=e("../../../core/console/print.coffee"),o=e("../../../object/validate.coffee");t.exports=function(e){var t=e.ui.value&&e.ui.value.length,n=e.ui.position.value;e.dev.value&&t&&i.time("drawing custom UI elements");var l=e.container.value.selectAll("div#d3plus_drawer").data(["d3plus_drawer"]);l.enter().append("div").attr("id","d3plus_drawer");var s={};e.ui.position.accepted.forEach(function(t){s[t]=t==n?e.margin.bottom+"px":"auto"}),l.style("text-align",e.ui.align.value).style("position","absolute").style("width",e.width.value-2*e.ui.padding+"px").style("height","auto").style(s);var u=l.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 n,i;"string"==typeof t.method&&t.method in e?(n=e[t.method].value,i=function(n){n!==e[t.method].value&&e.self[t.method](n).draw()}):(n=t.focus||t.value[0],o(n)&&(n=n[d3.keys(n)[0]]),"function"==typeof t.method&&(i=function(r){r!==n&&(n=r,t.focus=r,t.method(r,e.self))}));var l,s=[];t.label?l=t.label:"string"==typeof t.method&&t.method in e&&(l=e.format.locale.value.method[t.method]||t.method),t.value.forEach(function(t){var n={};o(t)?(n.id=t[d3.keys(t)[0]],n.text=e.format.value(d3.keys(t)[0])):(n.id=t,n.text=e.format.value(t)),s.push(n)});var u=r(e.ui.font);u.align=r(e.font.align),u.secondary=r(u),t.form.data(s).font(u).focus(t.value.length>1&&n).focus({callback:i}).format(e.format.locale.language).format({number:e.format.number.value,text:e.format.text.value}).title(e.format.value(l)).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=l.node().offsetHeight||l.node().getBoundingClientRect().height;c&&(e.margin[n]+=c),e.dev.value&&t&&i.timeEnd("drawing custom UI elements")}},{"../../../core/console/print.coffee":54,"../../../form/form.js":106,"../../../object/validate.coffee":175,"../../../util/copy.coffee":210}],247:[function(e,t,n){var r,a,i,o;r=e("../../../client/pointer.coffee"),a=e("../../../color/lighter.coffee"),i=e("../../../core/console/print.coffee"),o=e("../../../client/css.coffee"),t.exports=function(e){var t,n,l,s,u,c,f,d,p,h,v,g,m,y,x;return!e.small&&e.history.states.length>0?(e.dev.value&&i.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,n=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),l=parseFloat(e.container.value.style("padding-top"),10),y+=l,l=parseFloat(e.container.value.style("padding-left"),10),c=e.margin.left+p/2+l,v=function(e){return e.style("position","absolute").style("left",c+"px").style("top",y+"px").style("color",n).style("font-family",u).style("font-weight",x).style("font-size",p+"px")},s=t.enter().append("div").attr("id","d3plus_back_button").style("opacity",0).call(v).html(function(){var t;return o("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(r.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(n,.25))}).on(r.out,function(){if(!e.small&&e.history.states.length>0)return d3.select(this).style("cursor","auto").transition().duration(e.timing.mouseevents).style("color",n)}).on(r.click,function(){return e.history.back()}).transition().duration(e.draw.timing).style("opacity",1).call(v),e.dev.value?i.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":38,"../../../client/pointer.coffee":40,"../../../color/lighter.coffee":47,"../../../core/console/print.coffee":54}],248:[function(e,t,n){var r=e("../../../array/sort.coffee"),a=e("../../../util/buckets.coffee"),i=e("../../../util/copy.coffee"),o=e("../tooltip/create.js"),l=e("../../../core/data/nest.js"),s=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,n){var r=C+n*(e.ui.padding+_);return"translate("+r+","+e.ui.padding+")"})}function n(t){t.attr("width",_).attr("height",_).attr("fill",function(t){d3.select(this.parentNode).select("text").remove();var n=g(t,e.icon.value,c,e,I),r=f(e,t,I);if(e.legend.icons.value&&1===n.length&&"string"==typeof n[0]){n=n[0];var a,i=y(n+"_"+r),o=e.icon.style.value,l=e.defs.selectAll("pattern#"+i).data([i]);a="string"==typeof o?e.icon.style.value:b(o)&&o[I]?o[I]:"default",r="knockout"==a?r:"none",l.select("rect").transition().duration(e.draw.timing).attr("fill",r).attr("width",_).attr("height",_),l.select("image").transition().duration(e.draw.timing).attr("width",_).attr("height",_);var u=l.enter().append("pattern").attr("id",i).attr("width",_).attr("height",_);return u.append("rect").attr("fill",r).attr("stroke","none").attr("width",_).attr("height",_),u.append("image").attr("xlink:href",n).attr("width",_).attr("height",_).each(function(e){0===n.indexOf("/")||n.indexOf(window.location.hostname)>=0?s(n,function(e){l.select("image").attr("xlink:href",e)}):l.select("image").attr("xlink:href",n)}),"url(#"+i+")"}if(e.legend.labels.value){var p;if(p=e.legend.text.value?[c(e,t,e.legend.text.value,R)]:d(e,t,R),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(r)).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 r})}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 M=e.g.legend.selectAll("g.d3plus_scale").data(["scale"]);M.enter().append("g").attr("class","d3plus_scale").attr("opacity",0);var A=e.container.id+"_legend_heatmap",j=M.selectAll("#"+A).data(["heatmap"]);j.enter().append("linearGradient").attr("id",A).attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%").attr("spreadMethod","pad");var E=j.selectAll("stop").data(d3.range(0,z.length));E.enter().append("stop").attr("stop-opacity",1),E.attr("offset",function(e){return Math.round(e/(z.length-1)*100)+"%"}).attr("stop-color",function(e){return z[e]}),E.exit().remove();var S=M.selectAll("rect#gradient").data(["gradient"]);S.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(#"+A+")");var O=M.selectAll("text.d3plus_tick").data(d3.range(0,k.length));O.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 N=0;O.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>N&&(N=t)}),N+=2*e.labels.padding;var F=N*(k.length-1);if(F+N<e.width.value){F+N<e.width.value/2&&(F=e.width.value/2,N=F/k.length,F-=N);var C;C="start"==e.legend.align?e.ui.padding:"end"==e.legend.align?e.width.value-e.ui.padding-F:e.width.value/2-F/2,O.transition().duration(e.draw.timing).attr("x",function(e){return C+N*e}),O.exit().transition().duration(e.draw.timing).attr("opacity",0).remove();var T=M.selectAll("rect.d3plus_tick").data(d3.range(0,k.length));T.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),T.transition().duration(e.draw.timing).attr("x",function(e){var t=0===e?1:0;return C+N*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),T.exit().transition().duration(e.draw.timing).attr("width",0).remove(),S.transition().duration(e.draw.timing).attr("x",function(t){return"middle"==e.legend.align?e.width.value/2-F/2:"end"==e.legend.align?e.width.value-F-e.ui.padding:e.ui.padding}).attr("y",e.ui.padding).attr("width",F).attr("height",e.legend.gradient.height),M.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=i(e.nodes.restriced||e.nodes.value),e.data.viz.length)for(var P=0;P<q.length;P++){var B=e.data.viz.filter(function(t){return t[e.id.value]===q[P][e.id.value]});B.length&&(q[P]=B[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 D=function(t){return f(e,t,R)},R=0,I=e.id.value,L=e.id.nesting.indexOf(e.color.value);if(L>=0)R=L,I=e.id.nesting[L];else for(var V=0;V<=e.depth.value;V++){R=V,I=e.id.nesting[V];var U=g(q,function(t){return c(e,t,I)}),Y=g(q,D);if(U.length>=Y.length&&Y.length>1)break}var H=[e.color.value],z=l(e,q,H,!1); | |
e.dev.value&&p.timeEnd("grouping data by color");var X=e.width.value;_=e.legend.size;var F=_*z.length+e.ui.padding*(z.length+1);if(_ instanceof Array){e.dev.value&&p.time("calculating legend size");for(var P=_[1];P>=_[0];P--)if(F=P*z.length+e.ui.padding*(z.length+1),X>=F){_=P;break}e.dev.value&&p.timeEnd("calculating legend size")}else"number"!=typeof _&&_!==!1&&(_=30);if(X<F||1==z.length)w=!1;else{if(F-=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,Z=e.color.value;G?"color"!==e.legend.order.value&&(Z=[]):G=e[e.color.value].value,r(z,G,e.legend.order.sort.value,Z,e,R)}e.dev.value&&p.timeEnd("sorting legend"),e.dev.value&&p.time("drawing legend");var C;C="start"==e.legend.align?e.ui.padding:"end"==e.legend.align?X-e.ui.padding-F:X/2-F/2,e.g.legend.selectAll("g.d3plus_scale").transition().duration(e.draw.timing).attr("opacity",0).remove();var W={},J=e.g.legend.selectAll("g.d3plus_color").data(z,function(t){var n=f(e,t,I);return n in W||(W[n]=-1),W[n]++,W[n]+"_"+n});J.enter().append("g").attr("class","d3plus_color").attr("opacity",0).call(t).append("rect").attr("class","d3plus_color").attr("stroke","none").call(n),J.order().transition().duration(e.draw.timing).call(t).attr("opacity",1).selectAll("rect.d3plus_color").call(n),J.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),e.legend.tooltip.value&&J.on(u.over,function(t,n){d3.select(this).style("cursor","pointer");var r,a=this.getBoundingClientRect(),i=a.left+_/2+m.x(),l=a.top+_/2+m.y()+5,s=c(e,t,I),f=e.id.nesting.indexOf(I);r=e.legend.title.value?c(e,t,e.legend.title.value,R):f>=0?d(e,t,f)[0]:e.format.value(c(e,t,e.color.value,I),{key:e.color.value,vars:e,data:t});var p,h;if(e.legend.filters.value&&!(s 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 n={border:"1px solid #ccc",display:"inline-block",margin:"1px 2px",padding:"3px 5px"};t.select(".mute").style(n).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:s}).draw()}),t.select(".solo").style(n).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:s}).draw()})}}o({data:t,html:p,js:h,depth:R,footer:!1,vars:e,x:i,y:l,mouseevents:this,title:r,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 Q=_+e.ui.padding;else var K=e.g.legend.node().getBBox(),Q=K.height+K.y;0===e.margin.bottom&&(e.margin.bottom+=e.ui.padding),e.margin.bottom+=Q,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":36,"../../../client/pointer.coffee":40,"../../../client/scroll.js":43,"../../../client/touch.coffee":45,"../../../color/text.coffee":52,"../../../core/console/print.coffee":54,"../../../core/data/nest.js":62,"../../../core/fetch/color.coffee":65,"../../../core/fetch/text.js":68,"../../../core/fetch/value.coffee":69,"../../../object/validate.coffee":175,"../../../string/strip.js":178,"../../../textwrap/textwrap.coffee":203,"../../../tooltip/remove.coffee":206,"../../../util/buckets.coffee":207,"../../../util/copy.coffee":210,"../../../util/dataURL.coffee":212,"../../../util/uniques.coffee":213,"../tooltip/create.js":243}],249:[function(e,t,n){var r=e("../../../client/pointer.coffee"),a=e("../../../color/text.coffee");t.exports=function(e,t){function n(t){t.style(o).style("position","absolute").style("background-color",s).style("text-align","center").style("left",function(){return"center"==l?"50%":"0px"}).style("width",function(){return"center"==l?"auto":e.width.value+"px"}).style("margin-left",function(){return"center"==l?-(this.offsetWidth/2)+"px":"0px"}).style("top",function(){return"center"==l?"50%":"top"==l?"0px":"auto"}).style("bottom",function(){return"bottom"==l?"0px":"auto"}).style("margin-top",function(){if("large"==i){var e=this.offsetHeight||this.getBoundingClientRect().height;return-e/2+"px"}return"0px"})}t=e.messages.value?t:null;var i=e.messages.style.value||(t===e.error.internal?"large":e.messages.style.backup);if("large"===i)var o=e.messages,l="center";else{if(e.footer.value)var o=e.footer;else if(e.title.value)var o=e.title;else if(e.title.sub.value)var o=e.title.sub;else if(e.title.total.value)var o=e.title.total;else var o=e.title.sub;var l=o.position}var o={color:o.font.color,"font-family":o.font.family.value,"font-weight":o.font.weight,"font-size":o.font.size+"px",padding:o.padding+"px"},s=e.messages.background.value;s||(s=e.background.value,"none"!==s&&"transparent"!==s||(s=a(o.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"===l?[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(r.click,function(){window.open("http://www.d3plus.org/","_blank")});var p=d3.hsl(s).l<.5?e.messages.branding.image.dark:e.messages.branding.image.light;d.text(c?"Powered by:":"Powered by D3plus").style("background-color",c?s:"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(n).style("opacity",t?1:0)}},{"../../../client/pointer.coffee":40,"../../../color/text.coffee":52}],250:[function(e,t,n){var r,a,i,o,l,s,u,c,f,d;r=e("../../../util/closest.coffee"),a=e("../../../client/css.coffee"),o=e("../../../font/sizes.coffee"),i=e("../../../client/pointer.coffee"),l=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"),s=!1,t.exports=function(e){var t,n,o,p,h,v,g,m,y,x,b,w,_,k,z,M,A,j,E,S,O,N,F,C,T,q,P,B,D,R,I,L,V,U,Y,H,X,G,Z,W,J,Q,K,$,ee,te,ne,re,ae,ie,oe;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"},oe=e.data.time.ticks.map(function(e){return new Date(e)}),J=d(e,{values:oe,style:H}),te=J.values.map(Number),W=J.format,e.time.solo.value.length)for(w=d3.extent(e.time.solo.value),b=_=0,M=w.length;_<M;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(oe);if(ie=oe.slice(),re=d3.max(J.sizes.map(function(e){return e.height})),k=~~d3.max(J.sizes.map(function(e){return e.width}))+1,k+=2*e.ui.padding,K=e.timeline.height.value||re+2*e.ui.padding,ee=k*oe.length,P=K,V=K-2*e.ui.padding>=re,t=e.width.value-2*e.ui.padding,V&&e.timeline.play.value&&(t-=P+e.ui.padding),!V||te.length<oe.length||t<k*te.length){for(S=k,k=(t-k)/oe.length,ee=k*oe.length,$=1,G=~~(S/(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,j=new Date(oe[0]),I=e.data.time.stepType,j["set"+I](j["get"+I]()+oe.length),ie.push(j);return D=new Date(w[0]),D=r(ie,D),y=new Date(w[1]),$||y["set"+e.data.time.stepType](y["get"+e.data.time.stepType]()+1),y=r(ie,y),ae=ie.map(Number),E=ae.indexOf(+D),A=ae.indexOf(+y),p=[D,y],R="start"===e.timeline.align?e.ui.padding:"end"===e.timeline.align?e.width.value-e.ui.padding-ee:e.width.value/2-ee/2,V&&e.timeline.play.value&&(R+=(P+e.ui.padding)/2),L=function(){return clearInterval(s),s=!1,N.call(F,"icon")},v=function(){var e,t,n;if(null!==d3.event.sourceEvent){if(s&&L(),p=o.extent(),n=r(ie,p[0]),t=r(ie,p[1]),n===t&&(E=ae.indexOf(+n),n<p[0]||0===E?t=ie[E+1]:n=ie[E-1]),E=ae.indexOf(+n),A=ae.indexOf(+t),A-E>=1)e=[n,t];else if(E+1<=oe.length)e=[n,ie[E+1]];else{for(e=[n],b=1;b<=1;)E+b<=oe.length?e.push(ie[E+b]):e.unshift(ie[E-(E+b-oe.length)]),b++;e=[e[0],e[e.length-1]]}return p=e,U.attr("fill",Y),d3.select(this).call(o.extent(e))}},B=function(){var t;return A-E===oe.length-$?t=[]:(t=ae.filter(function(e,t){return t>=E&&t<A+$}),t=t.map(function(e){return new Date(e)})),q(),e.self.time({solo:t}).draw()},g=function(){var t,n,a,i;if(null!==d3.event.sourceEvent&&(e.time.solo.value.length?(i=d3.extent(e.time.solo.value),a=ae.indexOf(+r(ie,i[0])),n=ae.indexOf(+r(ie,i[1])),t=a!==E||n!==A):t=A-E!==oe.length-$,t))return B()},O=e.g.timeline.selectAll("rect.d3plus_timeline_play").data(V&&e.timeline.play.value?[0]:[]),T=function(t){return t.attr("width",P+1).attr("height",K+1).attr("fill",e.ui.color.primary.value).attr("stroke",e.ui.color.primary.value).attr("stroke-width",1).attr("x",R-P-1-e.ui.padding).attr("y",e.ui.padding)},O.enter().append("rect").attr("class","d3plus_timeline_play").attr("shape-rendering","crispEdges").attr("opacity",0).call(T),O.transition().duration(e.draw.timing).call(T),O.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),N=e.g.timeline.selectAll("text.d3plus_timeline_playIcon").data(V&&e.timeline.play.value?[0]:[]),F=function(t,n){var r;return n=e.timeline.play[n],a("font-awesome")?(n=n.awesome,r="FontAwesome"):(n=n.fallback,r="inherit"),t.style("font-family",r).text(n)},C=function(t){var n;return n=K/2+e.ui.padding+1,t.attr("fill",f(e.ui.color.primary.value)).attr("stroke","none").attr(H).attr("x",R-(P-1)/2-e.ui.padding).attr("y",n).attr("dy","0.5ex").call(F,s?"pause":"icon")},N.enter().append("text").attr("class","d3plus_timeline_playIcon").call(C).style("pointer-events","none").attr("opacity",0),N.call(C).transition().duration(e.draw.timing).attr("opacity",1),N.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),q=function(){return A-E===oe.length-$?(O.on(i.hover,null).on(i.click,null).transition().duration(e.draw.timing).attr("opacity",.3),N.transition().duration(e.draw.timing).attr("opacity",.3)):(O.on(i.over,function(){return d3.select(this).style("cursor","pointer")}).on(i.out,function(){return d3.select(this).style("cursor","auto")}).on(i.click,function(){return s?L():(N.call(F,"pause"),A===oe.length?(A-=E,E=0):(E++,A++),B(),s=setInterval(function(){return A===oe.length-$?L():(E++,A++,B())},e.timeline.play.timing.value))}).transition().duration(e.draw.timing).attr("opacity",1),N.transition().duration(e.draw.timing).attr("opacity",1))},q(),Y=function(t){var n,r,a;return r=$?t<=p[1]:t<p[1],t>=p[0]&&r?(a=1,n=f(e.ui.color.secondary.value)):(a=.5,n=f(e.ui.color.primary.value)),$&&e.background.value&&"none"!==e.background.value&&(n=d3.rgb(f(e.background.value))),n=d3.rgb(n),"rgba("+n.r+","+n.g+","+n.b+","+a+")"},n=e.g.timeline.selectAll("rect.d3plus_timeline_background").data(["background"]),n.enter().append("rect").attr("class","d3plus_timeline_background").attr("shape-rendering","crispEdges").attr("width",ee+2).attr("height",K+2).attr("fill",e.ui.color.primary.value).attr("x",R-1).attr("y",e.ui.padding),n.transition().duration(e.draw.timing).attr("width",ee+2).attr("height",K+2).attr("fill",e.ui.color.primary.value).attr("x",R-1).attr("y",e.ui.padding),Z=e.g.timeline.selectAll("g#ticks").data(["ticks"]),Z.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"),U=z.selectAll("text").data(oe,function(e,t){return t}),U.enter().append("text").attr("stroke","none").attr("y",0).attr("dy","0.5ex").attr("x",0),ne=d3.time.scale().domain(d3.extent(ie)).rangeRound([0,ee]),U.order().attr(H).text(function(e,t){return te.indexOf(+e)>=0?W(e):""}).attr("opacity",function(t,n){return e.data.time.dataSteps.indexOf(n)>=0?1:.4}).attr("fill",Y).attr("transform",function(t,n){var r,a;return r=R+ne(t),$||(r+=k/2),a=K/2+e.ui.padding+1,$&&(a+=K/2+re),"translate("+Math.round(r)+","+Math.round(a)+")"}),U.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),o=d3.svg.brush().x(ne).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,Z.attr("transform","translate("+R+","+(e.ui.padding+1)+")").transition().duration(e.draw.timing).call(d3.svg.axis().scale(ne).orient("top").ticks(function(){return ie}).tickFormat("").tickSize(-K).tickPadding(0)).selectAll("line").attr("stroke-width",1).attr("shape-rendering","crispEdges").attr("stroke",function(t){return te.indexOf(+t)>=0?X:l(X,e.background.value,.4,1)}),Z.selectAll("path").attr("fill","none"),h.attr("transform","translate("+R+","+(e.ui.padding+1)+")").attr("opacity",1).call(o),U.attr("pointer-events","none"),h.selectAll("rect.background").attr("fill","none").style("visibility","visible").attr("height",K).attr("shape-rendering","crispEdges").on(i.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",K).attr("fill",e.ui.color.secondary.value).attr("shape-rendering","crispEdges").on(i.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 n;return n="resize e"===this.parentNode.className.baseVal?-e.timeline.handles.size:0,"translate("+n+",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",K)):h.selectAll("g.resize").remove(),Q=e.g.timeline.node().getBBox(),0===e.margin.bottom&&(e.margin.bottom+=e.ui.padding),e.margin.bottom+=Q.height+Q.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":38,"../../../client/pointer.coffee":40,"../../../client/prefix.coffee":41,"../../../color/mix.coffee":48,"../../../color/text.coffee":52,"../../../core/console/print.coffee":54,"../../../core/data/time.coffee":64,"../../../font/sizes.coffee":104,"../../../util/closest.coffee":209}],251:[function(e,t,n){var r=e("../../../client/pointer.coffee"),a=e("../../../core/fetch/value.coffee"),i=e("../../../core/console/print.coffee"),o=e("../../../client/rtl.coffee"),l=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 n(e){var t=e.style.font.align;return"center"==t?"middle":"left"==t&&!o||"right"==t&&o?"start":"left"==t&&o||"right"==t&&!o?"end":t}var s=e.size.value?e.size.value:"number"===e.color.type&&e.color.value;if(e.data.viz&&e.title.total.value&&!e.small)if(s){e.dev.value&&i.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[s]||"sum";if(f.constructor===Function?c=f(u):(u=u.reduce(function(t,n){var r=a(e,n,s);return r instanceof Array?t=t.concat(r):t.push(r),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 n=e.time.solo.value.indexOf(a(e,t,e.time.value))>=0;else if(e.time.mute.value.length>0)var n=e.time.solo.value.indexOf(a(e,t,e.time.value))<0;else var n=!0;if(n)return a(e,t,s)});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&&i.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&&i.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(r){var a=d3.select(this).select("text").call(t),i=n(r);l().align(i).container(a).height(e.height.value/2).size(!1).text(r.value).width(b).draw(),r.y=e.margin[r.style.position],e.margin[r.style.position]+=this.getBBox().height+2*r.style.padding}).on(r.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(r.out,function(n){n.link&&d3.select(this).transition().duration(e.timing.mouseevents).style("cursor","auto").select("text").call(t)}).on(r.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 r=t.style.position,a="top"==r?0+t.y:e.height.value-t.y;"bottom"==r?a-=this.getBBox().height+t.style.padding:a+=t.style.padding;var i=n(t);if("start"===i)var o=e.margin.left+e.title.padding;else{d3.select(this).select("text").node().getBBox().width;o="middle"===i?e.width.value/2-b/2:e.width.value-b-e.margin.right-e.title.padding}return"translate("+o+","+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&&i.timeEnd("drawing titles")}},{"../../../client/pointer.coffee":40,"../../../client/rtl.coffee":42,"../../../core/console/print.coffee":54,"../../../core/fetch/value.coffee":69,"../../../textwrap/textwrap.coffee":203}],252:[function(e,t,n){var r,a;r=e("./labels.coffee"),a=e("./transform.coffee"),t.exports=function(e,t,n){var i,o,l,s,u,c,f,d,p;return t||(t=e.zoom.bounds),"number"!=typeof n&&(n=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],l=e.coords.fit.value,i="auto"===l||p.requirements.indexOf("coords")<0?d3.max([e.zoom.size.width/e.width.viz,e.zoom.size.height/e.height.viz]):e.zoom.size[l]/e["app_"+l],u=d3.min([e.width.viz,e.height.viz]),c=p.zoom?2*e.coords.padding:0,f=(u-c)/u/i,o=e.zoom.behavior.scaleExtent(),o[0]!==o[1]&&t!==e.zoom.bounds||e.zoom.behavior.scaleExtent([f,16*f]),s=e.zoom.behavior.scaleExtent()[1],f>s&&(f=s),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)&&r(e),a(e,n)}},{"./labels.coffee":254,"./transform.coffee":257}],253:[function(e,t,n){t.exports=function(e,t){var n,r,a;return r=t.id.nesting.length-1,n=t.depth.value,a=t.id.nesting[n+1],t.types[t.type.value].nesting===!1?0:(e.d3plus.merged||a in e&&n<r)&&(!e||a in e)?1:!(n===r&&n>0||e&&a&&!(a in e))||!t.small&&t.tooltip.html.value?0:-1}},{}],254:[function(e,t,n){var r;r=e("../../../core/console/print.coffee"),t.exports=function(e){var t,n;if(e.dev.value&&r.time("determining label visibility"),n=e.zoom.behavior.scaleExtent(),t=function(t){return t.attr("opacity",function(t){var r;return t||(t={}),r=parseFloat(d3.select(this).attr("font-size"),10),t.visible=r*(e.zoom.scale/n[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 r.timeEnd("determining label visibility")}},{"../../../core/console/print.coffee":54}],255:[function(e,t,n){var r,a,i;r=e("./labels.coffee"),a=e("../../../tooltip/remove.coffee"),i=e("./transform.coffee"),t.exports=function(e){var t,n,o,l,s,u,c,f,d,p,h;return n=d3.event.sourceEvent?d3.event.sourceEvent.type:null,s=d3.event.translate,l=d3.event.scale,o=e.zoom.bounds,f=(e.width.viz-e.zoom.size.width*l)/2,c=f>0?f:0,u=f>0?e.width.viz-f:e.width.viz,h=(e.height.viz-e.zoom.size.height*l)/2,p=h>0?h:0,d=h>0?e.height.viz-h:e.height.viz,s[0]+o[0][0]*l>c?s[0]=-o[0][0]*l+c:s[0]+o[1][0]*l<u&&(s[0]=u-o[1][0]*l),s[1]+o[0][1]*l>p?s[1]=-o[0][1]*l+p:s[1]+o[1][1]*l<d&&(s[1]=d-o[1][1]*l),e.zoom.behavior.translate(s).scale(l),e.zoom.translate=s,e.zoom.scale=l,"wheel"===n&&a(e.type.value),(e.labels.value||e.labels.changed)&&("wheel"===n?(t=e.draw.timing?100:250,clearTimeout(e.zoom.wheel),e.zoom.wheel=setTimeout(function(){return r(e)},t)):r(e)),"dblclick"===n?i(e,e.timing.transitions):i(e,0)}},{"../../../tooltip/remove.coffee":206,"./labels.coffee":254,"./transform.coffee":257}],256:[function(e,t,n){t.exports=function(e,t){var n,r,a,i;r=e.zoom,t||(t=d3.event),i=r.scale>r.behavior.scaleExtent()[0],n=e.types[e.type.value].zoom&&r.value&&r.scroll.value,a=t.touches&&t.touches.length>1&&n,a||i||t.stopPropagation()}},{}],257:[function(e,t,n){t.exports=function(e,t){var n;return"number"!=typeof t&&(t=e.timing.transitions),n="translate("+e.zoom.translate+")",n+="scale("+e.zoom.scale+")",t?e.g.viz.transition().duration(t).attr("transform",n):e.g.viz.attr("transform",n)}},{}],258:[function(e,t,n){var r;r=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Function,Object,String],deprecates:"active_var",mute:r(!0),solo:r(!0),spotlight:{accepted:[Boolean],deprecates:"spotlight",value:!1},value:!1}},{"../../core/methods/filter.coffee":83}],259:[function(e,t,n){t.exports={accepted:[Object],deprecated:"nesting_aggs",objectAccess:!1,value:{}}},{}],260:[function(e,t,n){var r;r=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:r,value:!1}},{"../../core/methods/process/data.coffee":89}],261:[function(e,t,n){var r,a;r=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,r(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":92,"../../core/methods/rendering.coffee":94}],262:[function(e,t,n){t.exports={accepted:[String],value:"#ffffff"}},{}],263:[function(e,t,n){t.exports={accepted:[Function,String],value:!1}},{}],264:[function(e,t,n){var r,a;r=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:r(!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:r(!0),secondary:"#e5b3bb",value:!1}},{"../../color/scale.coffee":50,"../../core/methods/filter.coffee":83}],265:[function(e,t,n){t.exports={accepted:[Array,Function,String],index:{accepted:[Boolean],value:!0},process:function(e,t){return"string"==typeof e&&(e=[e]),e},value:!1}},{}],266:[function(e,t,n){arguments[4][110][0].apply(n,arguments)},{dup:110}],267:[function(e,t,n){var r;r=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}),r(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":211}],268:[function(e,t,n){var r,a;r=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:r(!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:r(!1),threshold:{accepted:[Number],value:.9},value:!1}},{"../../core/methods/filter.coffee":83,"../../core/methods/process/data.coffee":89}],269:[function(e,t,n){var r,a,i;r=e("../../core/fetch/value.coffee"),a=e("../../client/ie.js"),i=e("../../string/strip.js"),t.exports={accepted:[void 0,!0,Array,String],chainable:!1,data:[],process:function(e,t){var n,o,l,s,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,M,A,j,E,S,O,N,F,C,T,q,P,B,D,R,I;if(void 0===t.returned)return[];if(e=e||t.cols.value,e instanceof Array?s=e:"string"==typeof e&&(s=[e]),c=[],R=[],t.title.value?(D=t.title.value,"function"==typeof D&&(D=D(t.self)),D=i(D),E=250,D=D.substr(0,E)):D="D3plus Visualization Data",e===!0)for(s=d3.keys(t.data.keys),c.push(s),T=t.data.value,v=0,y=T.length;v<y;v++){for(f=T[v],B=[],g=0,x=s.length;g<x;g++)o=s[g],I=f[o],"string"===t.data.keys[o]&&(I='"'+I+'"'),B.push(I);c.push(B)}else{for(s||(s=[t.id.value],t.time.value&&s.push(t.time.value),t.size.value&&s.push(t.size.value),t.text.value&&s.push(t.text.value)),m=0,b=s.length;m<b;m++)o=s[m],R.push(t.format.value(o));for(c.push(R),q=t.returned.nodes,j=0,w=q.length;j<w;j++)if(O=q[j],null!=O.values&&O.values instanceof Array)for(P=O.values,S=0,_=P.length;S<_;S++){for(I=P[S],B=[],N=0,k=s.length;N<k;N++)l=s[N],I=r(t,I,l),"string"==typeof I&&(I='"'+I+'"'),B.push(I);c.push(B)}else{for(B=[],F=0,z=s.length;F<z;F++)l=s[F],B.push(r(t,O,l));c.push(B)}}for(u="data:text/csv;charset=utf-8,",h=C=0,M=c.length;C<M;h=++C)o=c[h],d=o.join(","),u+=h<c.length?d+"\n":d;return a?(n=new Blob([u],{type:"text/csv;charset=utf-8;"}),navigator.msSaveBlob(n,D+".csv")):(p=encodeURI(u),A=document.createElement("a"),A.setAttribute("href",p),A.setAttribute("download",D+".csv"),A.click()),this.data=c,s},value:void 0}},{"../../client/ie.js":39,"../../core/fetch/value.coffee":69,"../../string/strip.js":178}],270:[function(e,t,n){var r;r=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 r(e,t,this)},solo:[],stroke:{width:1},value:!1}},{"../../core/methods/process/data.coffee":89}],271:[function(e,t,n){t.exports={accepted:[Function,Number],value:0}},{}],272:[function(e,t,n){t.exports={accepted:[!1,Function,Object],value:!1}},{}],273:[function(e,t,n){arguments[4][114][0].apply(n,arguments)},{dup:114}],274:[function(e,t,n){var r=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 n=t.format.locale.value.dev.setContainer;r.warning(n,"container")}else if(t.container.value.empty()){var n=t.format.locale.value.dev.noContainer,i=t.container.selector||"";r.warning(a(n,'"'+i+'"'),"container")}else t.dev.value&&r.time("total draw time"),t.container.value.call(t.self);if("function"==typeof e&&t.history.chain.length){var o={};t.history.chain.forEach(function(e){var t=e.method;delete e.method,o[t]=e}),e(o),t.history.chain=[]}return e},update:!0,value:void 0}},{"../../core/console/print.coffee":54,"../../string/format.js":176}],275:[function(e,t,n){var r=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,n){var r=this;if(!r.value)return[];if(!t)var t="id";var a=r.restricted||r.value,i=[];if(!e)return a;var o=a.filter(function(a){var o=!1;return a[r.source][t]==e?(o=!0,n&&i.push(a[r.target])):a[r.target][t]==e&&(o=!0,n&&i.push(a[r.source])),o});return n?i:o},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:r,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":89}],276:[function(e,t,n){t.exports={accepted:[Boolean,String],value:!1}},{}],277:[function(e,t,n){ | |
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:[]}},{}],278:[function(e,t,n){var r,a,i,o;r=e("../../core/methods/font/align.coffee"),a=e("../../core/methods/font/decoration.coffee"),i=e("../../core/methods/font/family.coffee"),o=e("../../core/methods/font/transform.coffee"),t.exports={align:r(),color:"#444444",decoration:a(),family:i(),secondary:{align:r(),color:"#444444",decoration:a(),family:i(),size:12,spacing:0,transform:o(),weight:200},size:12,spacing:0,transform:o(),weight:200}},{"../../core/methods/font/align.coffee":84,"../../core/methods/font/decoration.coffee":85,"../../core/methods/font/family.coffee":86,"../../core/methods/font/transform.coffee":88}],279:[function(e,t,n){var r,a,i;a=e("../../core/methods/font/family.coffee"),r=e("../../core/methods/font/decoration.coffee"),i=e("../../core/methods/font/transform.coffee"),t.exports={accepted:[!1,Number,String],font:{align:"center",color:"#444",decoration:r(),family:a(),size:11,transform:i(),weight:200},link:!1,padding:0,position:"bottom",value:!1}},{"../../core/methods/font/decoration.coffee":85,"../../core/methods/font/family.coffee":86,"../../core/methods/font/transform.coffee":88}],280:[function(e,t,n){var r,a,i,o;r=e("../../number/format.coffee"),a=e("../../core/locale/locale.coffee"),i=e("../../object/merge.coffee"),o=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,n;return t="en_US",n=a[t],e!==t&&(n=i(n,a[e])),this.language=e,n},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 n,a,i;return t||(t={}),t.locale||(t.locale=this.locale.value),i=t.vars||{},i.time&&i.time.value&&t.key===i.time.value?(a=e.constructor===Date?e:new Date(e),i.data.time.format(a)):"number"==typeof e?(n=this.number.value||r)(e,t):"string"==typeof e?(n=this.text.value||o)(e,t):JSON.stringify(e)}}},{"../../core/locale/locale.coffee":81,"../../number/format.coffee":173,"../../object/merge.coffee":174,"../../string/title.coffee":179}],281:[function(e,t,n){t.exports={accepted:[!1,Number],max:600,secondary:!1,small:200,value:!1}},{}],282:[function(e,t,n){var r,a,i,o,l,s,u,c;r=e("../../../core/methods/font/align.coffee"),a=e("../../../core/methods/font/decoration.coffee"),i=e("../../../core/methods/font/family.coffee"),o=e("../../../core/methods/filter.coffee"),s=e("../../../core/methods/font/position.coffee"),u=e("../../../core/methods/rendering.coffee"),c=e("../../../core/methods/font/transform.coffee"),l={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:i(""),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:i(),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:r("right"),color:"#444",background:{accepted:[Boolean],value:!0},decoration:a(),family:i(),padding:{accepted:[Number],value:10},position:s("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:o(!0),orient:{accepted:["top","right","bottom","left"],value:l[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,n){var r,a,i,o;for(i=["log","discrete","share"],r=0,a=i.length;r<a;r++)o=i[r],o===t?n.axes[o]=e:n.axes[o]===e&&(n.axes[o]=!1);return"discrete"===t&&(n.axes.opposite=0===e.indexOf("x")?"y":"x"),t},value:"linear"},solo:o(!0),stacked:{accepted:[Boolean],process:function(t,n){return t||n.axes.stacked!==e?t&&(n.axes.stacked=e):n.axes.stacked=!1,t},value:!1},ticks:{accepted:[!1,Array],color:"#ccc",font:{color:"#666",decoration:a(),family:i(),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":83,"../../../core/methods/font/align.coffee":84,"../../../core/methods/font/decoration.coffee":85,"../../../core/methods/font/family.coffee":86,"../../../core/methods/font/position.coffee":87,"../../../core/methods/font/transform.coffee":88,"../../../core/methods/rendering.coffee":94}],283:[function(e,t,n){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}},{}],284:[function(e,t,n){var r;r=e("../../core/methods/process/icon.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],back:{accepted:[!1,String],fallback:"❮",opacity:1,process:r,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":91}],285:[function(e,t,n){var r;r=e("../../core/methods/filter.coffee"),t.exports={accepted:[Array,String],dataFilter:!0,deprecates:["id_var","nesting"],grouping:{accepted:[Boolean],value:!0},mute:r(!0),nesting:["id"],solo:r(!0),value:"id"}},{"../../core/methods/filter.coffee":83}],286:[function(e,t,n){var r,a,i;r=e("../../core/methods/font/decoration.coffee"),a=e("../../core/methods/font/family.coffee"),i=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:r(),family:a(),size:11,transform:i(),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":85,"../../core/methods/font/family.coffee":86,"../../core/methods/font/transform.coffee":88}],287:[function(e,t,n){var r;r=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:r(),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":86}],288:[function(e,t,n){var r,a,i;r=e("../../core/methods/font/decoration.coffee"),a=e("../../core/methods/font/family.coffee"),i=e("../../core/methods/font/transform.coffee"),t.exports={font:{color:"#444444",decoration:r(),family:a(),transform:i(),weight:200},hover:{color:"#444444",decoration:r(),family:a(),transform:i(),weight:200}}},{"../../core/methods/font/decoration.coffee":85,"../../core/methods/font/family.coffee":86,"../../core/methods/font/transform.coffee":88}],289:[function(e,t,n){arguments[4][125][0].apply(n,arguments)},{"../../core/methods/process/margin.coffee":92,dup:125}],290:[function(e,t,n){var r,a,i;r=e("../../core/methods/font/decoration.coffee"),a=e("../../core/methods/font/family.coffee"),i=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:r(),family:a(),size:16,transform:i(),weight:200},padding:5,style:{accepted:[!1,"small","large"],value:!1},value:!0}},{"../../core/methods/font/decoration.coffee":85,"../../core/methods/font/family.coffee":86,"../../core/methods/font/transform.coffee":88}],291:[function(e,t,n){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}},{}],292:[function(e,t,n){var r;r=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:r,value:!1}},{"../../core/methods/process/data.coffee":89}],293:[function(e,t,n){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}},{}],294:[function(e,t,n){t.exports={accepted:[Boolean],value:!1,timeout:400,process:function(e,t){var n,r;return!!e&&(n=null,r=function(){var e,n,r;if(n=t.container.value.node().parentNode.getBoundingClientRect(),r=n.width,e=n.height,t.self.width(r),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(n),n=setTimeout(r,e.timeout)}}(this)),e)}}},{}],295:[function(e,t,n){var r;r=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:r(),value:!1}},{"../../core/methods/rendering.coffee":94}],296:[function(e,t,n){var r;r=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Function,Number,Object,String],dataFilter:!0,deprecates:["value","value_var"],mute:r(!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:r(!0),threshold:{accepted:[Boolean,Function,Number],value:!1},value:!1}},{"../../core/methods/filter.coffee":83}],297:[function(e,t,n){t.exports={value:!1}},{}],298:[function(e,t,n){var r;r=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Function,Object,String],deprecates:["else_var","else"],mute:r(!0),solo:r(!0),value:!1}},{"../../core/methods/filter.coffee":83}],299:[function(e,t,n){var r;r=e("../../core/methods/filter.coffee"),t.exports={accepted:[Array,Boolean,Function,Object,String],deprecates:["name_array","text_var"],nesting:!0,mute:r(!0),solo:r(!0),value:!1}},{"../../core/methods/filter.coffee":83}],300:[function(e,t,n){var r;r=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:r(!1),solo:r(!1),value:!1}},{"../../core/methods/filter.coffee":83}],301:[function(e,t,n){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}},{}],302:[function(e,t,n){t.exports={mouseevents:60,transitions:600,ui:200}},{}],303:[function(e,t,n){var r,a,i,o;r=e("../../core/methods/font/decoration.coffee"),a=e("../../core/methods/font/family.coffee"),o=e("../../core/methods/font/transform.coffee"),i=e("../../string/strip.js"),t.exports={accepted:[!1,Function,String],font:{align:"center",color:"#444444",decoration:r(),family:a(),size:16,transform:o(),weight:400},height:!1,link:!1,padding:2,position:"top",process:function(e,t){var n;return 0===t.container.id.indexOf("default")&&e&&(n=i(e).toLowerCase(),t.self.container({id:n})),e},sub:{accepted:[!1,Function,String],deprecates:"sub_title",font:{align:"center",color:"#444444",decoration:r(),family:a(),size:12,transform:o(),weight:200},link:!1,padding:1,position:"top",value:!1},total:{accepted:[Boolean,Object],deprecates:"total_bar",font:{align:"center",color:"#444444",decoration:r(),family:a(),size:12,transform:o(),weight:200,value:!1},link:!1,padding:1,position:"top",value:!1},width:!1,value:!1}},{"../../core/methods/font/decoration.coffee":85,"../../core/methods/font/family.coffee":86,"../../core/methods/font/transform.coffee":88,"../../string/strip.js":178}],304:[function(e,t,n){var r,a;r=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:r(),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":86,"../../core/methods/font/transform.coffee":88}],305:[function(e,t,n){var r;r=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Function,Object,String],deprecates:["total_var"],mute:r(!0),solo:r(!0),value:!1}},{"../../core/methods/filter.coffee":83}],306:[function(e,t,n){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"}},{}],307:[function(e,t,n){var r,a,i,o;i=e("../../core/methods/font/family.coffee"),r=e("../../core/methods/font/align.coffee"),a=e("../../core/methods/font/decoration.coffee"),o=e("../../core/methods/font/transform.coffee"),t.exports={accepted:[Array,Boolean],align:r("center"),border:1,color:{primary:{process:function(e,t){var n;return n=this.value,t.ui.color.secondary.value||(t.ui.color.secondary.value=d3.rgb(n).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:i(),size:11,transform:o(),weight:200},margin:5,padding:5,position:{accepted:["top","right","bottom","left"],value:"bottom"},value:!1}},{"../../core/methods/font/align.coffee":84,"../../core/methods/font/decoration.coffee":85,"../../core/methods/font/family.coffee":86,"../../core/methods/font/transform.coffee":88}],308:[function(e,t,n){t.exports={accepted:[!1,Number],secondary:!1,small:200,value:!1}},{}],309:[function(e,t,n){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}},{}],310:[function(e,t,n){var r,a,i,o,l,s,u,c;a=e("../../util/closest.coffee"),i=e("../../core/fetch/value.coffee"),o=e("./helpers/graph/draw.coffee"),l=e("./helpers/graph/nest.coffee"),s=e("../../array/sort.coffee"),u=e("./helpers/graph/stack.coffee"),c=e("../../core/data/threshold.js"),r=function(e){var t,n,r,a,l,c,f,d,p,h,v;if(o(e,{buffer:e.axes.opposite,zero:!0}),a=e.x.domain.viz.concat(e.y.domain.viz),a.indexOf(void 0)>=0)return[];for(n=s(e.data.viz,null,null,null,e),r=e[e.axes.discrete],p=e[e.axes.opposite],l=0,f=n.length;l<f;l++)for(h=n[l],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=r.scale.viz(i(e,t,r.value)),t.d3plus.x+=e.axes.margin.viz.left,t.d3plus.y=p.scale.viz(i(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,n)},r.filter=function(e,t){return l(e,c(e,t,e[e.axes.discrete].value))},r.requirements=["data","x","y"],r.setup=function(e){var t,n,r;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}),r=e[e.axes.opposite],n=e.size,!r.value&&n.value||n.changed&&n.previous===r.value?e.self[e.axes.opposite](n.value):!n.value&&r.value||r.changed&&r.previous===n.value?e.self.size(r.value):void 0},r.shapes=["area"],r.threshold=function(e){return 20/e.height.viz},r.tooltip="static",t.exports=r},{"../../array/sort.coffee":36,"../../core/data/threshold.js":63,"../../core/fetch/value.coffee":69,"../../util/closest.coffee":209,"./helpers/graph/draw.coffee":317,"./helpers/graph/nest.coffee":323,"./helpers/graph/stack.coffee":324}],311:[function(e,t,n){var r,a,i,o,l,s,u,c=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1};a=e("../../util/buckets.coffee"),i=e("../../core/fetch/value.coffee"),o=e("./helpers/graph/draw.coffee"),l=e("./helpers/graph/nest.coffee"),s=e("./helpers/graph/stack.coffee"),u=e("../../util/uniques.coffee"),r=function(e){var t,n,r,l,f,d,p,h,v,g,m,y,x,b,w,_,k,z,M,A,j,E,S,O,N,F,C,T,q,P,B,D,R,I,L,V,U,Y,H,X;if(d=e.axes.discrete,g="x"===d?"height":"width",Y="x"===d?"width":"height",P=e.axes.opposite,r="x"===d?"left":"top",N="x"===d?"top":"left",o(e,{buffer:!0,zero:P}),v=e.x.domain.viz.concat(e.y.domain.viz),v.indexOf(void 0)>=0)return[];if(S=e.data.viz,e.axes.stacked)for(x=0,_=S.length;x<_;x++)R=S[x],s(e,R.values);for(V=e.axes[Y]/e[e.axes.discrete].ticks.values.length,D=e[e.axes.discrete].padding.value,D<1&&(D*=V),2*D>V&&(D=.1*V),j=V-2*D,e.axes.stacked||(e[d].persist.position.value?(I=e[d].value,h=c.call(e.id.nesting,I)>=0?d3.max(S,function(e){return e.values.length}):u(S,e.id.value,i,e).length,j/=h,F=V/2-j/2-D,H=d3.scale.ordinal(),1===h?H.domain([0]).range([0]):H.domain([0,h-1]).range([-F,F])):H=d3.scale.linear()),f=[],T=e[P],C=T.scale.viz.domain().slice(),0===P.indexOf("y")&&(C=C.reverse()),C[0]<=0&&C[1]>=0?X=0:C[0]<0?X(d3.max(C)):X=d3.min(C),e[d].persist.position.value&&!e.axes.stacked&&(y=u(d3.merge(S.map(function(e){return e.values})),e.id.value,i,e,e.id.value,!1),H.domain(y),1===y.length?H.range([0]):H.range(a(H.range(),y.length))),A=d3.max(S,function(e){return e.values.length}),b=0,k=S.length;b<k;b++)for(B=S[b],e.axes.stacked?(t=1,O=j):e[d].persist.position.value?(t=h,O=j):(t=B.values.length,e[d].persist.size.value?(O=j/A,F=V/2-(A-t)*(O/2)-O/2-D):(O=j/t,F=V/2-O/2-D),H.domain([0,t-1]),H.range([-F,F])),L=B.values,m=w=0,z=L.length;w<z;m=++w){if(l=L[m],E=e.axes.stacked?0:H(e[d].persist.position.value?i(e,l,e.id.value):m%t),e.axes.stacked)U=l.d3plus[P],n=l.d3plus[P+"0"];else{if(q=i(e,l,T.value),null===q&&(T=e[P+"2"],q=i(e,l,T.value)),0===q)continue;"log"===T.scale.value&&(X=q<0?-1:1),U=T.scale.viz(q),n=T.scale.viz(X)}p=i(e,l,e[d].value),l.d3plus[d]=e[d].scale.viz(p),l.d3plus[d]+=e.axes.margin.viz[r]+E,M=n-U,l.d3plus[P]=n-M/2,e.axes.stacked||(l.d3plus[P]+=e.axes.margin.viz[N]),delete l.d3plus.r,l.d3plus[Y]=O,l.d3plus[g]=Math.abs(M),l.d3plus.init={},l.d3plus.init[P]=T.scale.viz(X),l.d3plus.init[P]-=l.d3plus[P],l.d3plus.init[P]+=e.axes.margin.viz[N],l.d3plus.init[Y]=l.d3plus[Y],e.text.value?delete l.d3plus.label:l.d3plus.label=!1,f.push(l)}return f},r.filter=function(e,t){return l(e,t,e[e.axes.discrete].value)},r.requirements=["data","x","y"],r.setup=function(e){var t,n,r;return e.axes.discrete||(t=e.time.value===e.y.value?"y":"x",e.self[t]({scale:"discrete"})),r=e[e.axes.opposite],n=e.size,!r.value&&n.value||n.changed&&n.previous===r.value?e.self[e.axes.opposite](n.value):!n.value&&r.value||r.changed&&r.previous===n.value?e.self.size(r.value):void 0},r.shapes=["square"],t.exports=r},{"../../core/fetch/value.coffee":69,"../../util/buckets.coffee":207,"../../util/uniques.coffee":213,"./helpers/graph/draw.coffee":317,"./helpers/graph/nest.coffee":323,"./helpers/graph/stack.coffee":324}],312:[function(e,t,n){var r,a,i,o,l,s;a=e("../../core/fetch/value.coffee"),i=e("./helpers/graph/draw.coffee"),o=e("../../string/format.js"),l=e("../../string/strip.js"),s=e("../../util/uniques.coffee"),r=function(e){var t,n,r,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,M,A,j,E;return i(e,{buffer:!0}),u=e.x.domain.viz.concat(e.y.domain.viz),u.indexOf(void 0)>=0?[]:(r=e.axes.discrete,b=e.axes.opposite,n="x"===r?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"===r?"height":"width",E="x"===r?"width":"height",A=e.axes[E]/e[r].ticks.values.length,M=e.size.value,M="number"==typeof M?M:100,A=d3.min([A-2*e.labels.padding,M]),m=e.type.mode.value,m instanceof Array||(m=[m,m]),v=function(t){var n,r,i;r={};for(n in e.data.keys)i=s(t,n,a,e),r[n]=1===i.length?i[0]:i;return r},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),j=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[r].value)}).rollup(function(i){var u,M,S,O,N,F,C,T,q,P,B,D,R,I,L,V,U,Y,H,X,G,Z,W,J,Q,K,$,ee,te,ne,re,ae;for(Z=e[b].scale.viz,ne=i.map(function(t){return a(e,t,e[b].value)}),ne.sort(function(e,t){return e-t}),ee=s(ne),T=d3.quantile(ne,.25),V=d3.quantile(ne,.5),W=d3.quantile(ne,.75),J={},"tukey"===m[1]?(P=T-W,Q=W-1.5*P,K=j):"extent"===m[1]?(Q=d3.max(ne),K=d):"number"==typeof m[1]&&(Q=d3.quantile(ne,(100-m[1])/100),K=o(w,m[1])),Q=d3.min([d3.max(ne),Q]),e.tooltip.extent.value&&(J[K]={key:e[b].value,value:Q}),e.tooltip.iqr.value&&(J[k]={key:e[b].value,value:W},J[h]={key:e[b].value,value:V},J[_]={key:e[b].value,value:T}),"tukey"===m[0]?(P=T-W,u=T+1.5*P,M=t):"extent"===m[0]?(u=d3.min(ne),M=g):"number"==typeof m[0]&&(u=d3.quantile(ne,m[0]/100),K=o(w,m[0])),u=d3.max([d3.min(ne),u]),e.tooltip.extent.value&&(J[M]={key:e[b].value,value:u}),O=[],S=[],$=[],G=[],q=0,I=i.length;q<I;q++)N=i[q],te=a(e,N,e[b].value),te>=T&&te<=W?O.push(N):te>=u&&te<T?S.push(N):te<=Q&&te>W?$.push(N):G.push(N);for(D=a(e,i[0],e[r].value),re=e[r].scale.viz(D),re+=n,R=e.format.value(D,{key:e[r].value,vars:e}),D.constructor===Date&&(D=D.getTime()),D=l(D),O=v(O),O.d3plus={color:"white",id:"box_"+D,init:{},label:!1,shape:"square",stroke:"#444",text:o(f,R)},O.d3plus[E]=A,O.d3plus.init[E]=A,O.d3plus[c]=Math.abs(Z(T)-Z(W)),O.d3plus[r]=re,ae=d3.min([Z(T),Z(W)])+O.d3plus[c]/2,ae+=x,O.d3plus[b]=ae,O.d3plus.tooltip=J,z.push(O),Y={d3plus:{id:"median_line_"+D,position:"height"===c?"top":"right",shape:"whisker",static:!0}},X=e.format.value(V,{key:e[b].value,vars:e}),R={background:"#fff",names:[X],padding:0,resize:!1,x:0,y:0},F=Math.abs(Z(V)-Z(T)),C=Math.abs(Z(V)-Z(W)),H=2*d3.min([F,C]),U=2*e.data.stroke.width+2*e.labels.padding,R["width"===E?"w":"h"]=A-U,R["width"===c?"w":"h"]=H-U,Y.d3plus.label=R,Y.d3plus[E]=A,Y.d3plus[r]=re,Y.d3plus[b]=Z(V)+x,z.push(Y),S=v(S),S.d3plus={id:"bottom_whisker_line_"+D,offset:O.d3plus[c]/2,position:"height"===c?"bottom":"left",shape:"whisker",static:!0},"x"===b&&(S.d3plus.offset*=-1),S.d3plus[c]=Math.abs(Z(u)-Z(T)),S.d3plus[E]=A,S.d3plus[r]=re,S.d3plus[b]=ae,z.push(S),$=v($),$.d3plus={id:"top_whisker_line_"+D,offset:O.d3plus[c]/2,position:"height"===c?"top":"right",shape:"whisker",static:!0},"y"===b&&($.d3plus.offset*=-1),$.d3plus[c]=Math.abs(Z(Q)-Z(W)),$.d3plus[E]=A,$.d3plus[r]=re,$.d3plus[b]=ae,z.push($),B=0,L=G.length;B<L;B++)N=G[B],N.d3plus[r]=re,N.d3plus[b]=Z(a(e,N,e.y.value)),N.d3plus[b]+=x,N.d3plus.r=4,N.d3plus.shape=e.shape.value;return y=!G.length&&Q-u===0,p.push(V),z=z.concat(G),i}).entries(e.data.viz),y&&1===s(p).length?[]:z)},r.modes=["tukey","extent",Array,Number],r.requirements=["data","x","y"],r.shapes=["circle","check","cross","diamond","square","triangle","triangle_up","triangle_down"],r.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=r},{"../../core/fetch/value.coffee":69,"../../string/format.js":176,"../../string/strip.js":178,"../../util/uniques.coffee":213,"./helpers/graph/draw.coffee":317}],313:[function(e,t,n){var r,a,i,o,l,s,u;r=e("../../array/sort.coffee"),l=e("../../core/fetch/value.coffee"),i=e("../../core/fetch/color.coffee"),o=e("../../core/fetch/text.js"),u=e("../../color/legible.coffee"),s=e("../../core/data/group.coffee"),a=function(e){var t,n,a,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,M,A,j,E,S,O,N,F,C,T,q,P,B,D,R,I,L,V,U;if(m=s(e,e.data.viz),m=r(m,null,null,null,e),d=m.length,d<4?(a=d,O=1):(N=e.width.viz/e.height.viz,a=Math.ceil(Math.sqrt(d*N)),O=Math.ceil(Math.sqrt(d/N))),d>0)for(;(O-1)*a>=d;)O--;for(n=e.width.viz/a,t=e.height.viz/O,e.size.value?(D=e.size.scale.domain.min.value,B=e.size.scale.domain.max.value,v="number"==typeof D?D:d3.min(e.data.viz,function(t){return l(e,t,e.size.value,e.id.value,"min")}),h="number"==typeof B?B:d3.max(e.data.viz,function(t){return l(e,t,e.size.value,e.id.value)}),p=[v,h]):p=[0,0],E=5,C=d3.min([n,t])/2-2*E,_=e.labels.value&&!e.small&&C>=40?d3.max([20,d3.min([.25*C,50])]):0,C-=_,T=d3.min([C,e.size.scale.range.min.value]),F=e.size.scale.value.domain(p).rangeRound([T,C]),j=d3.layout.pack().children(function(e){return e.values}).padding(E).radius(function(e){return F(e)}).size([n-2*E,t-2*E-_]).value(function(e){return e.value}),f=[],S=0,y=x=0,k=m.length;x<k;y=++x){for(c=m[y],P=j.nodes(c),I=n*y%e.width.viz,U=t*S,b=0,z=P.length;b<z;b++)q=P[b],q.children?(A={d3plus:{}},A[e.id.value]=q.key):A=q.d3plus,A.d3plus.depth=e.id.grouping.value?q.depth:e.depth.value,A.d3plus.x=q.x,A.d3plus.xOffset=I,A.d3plus.y=q.y,A.d3plus.yOffset=U+_,A.d3plus.r=q.r,f.push(A);(y+1)%a===0&&S++}for(g=C/d3.max(f,function(e){return e.d3plus.r}),R=j.size()[0]/2,V=j.size()[1]/2,w=0,M=f.length;w<M;w++)c=f[w],c.d3plus.x=(c.d3plus.x-R)*g+R+c.d3plus.xOffset,c.d3plus.y=(c.d3plus.y-V)*g+V+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=o(e,c[e.id.value],c.d3plus.depth),L=_>3*e.labels.padding?e.labels.padding:0,c.d3plus.label={x:0,y:-(C+L+_/2),w:2*C,h:_-L,padding:0,resize:!0,color:u(i(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":36,"../../color/legible.coffee":46,"../../core/data/group.coffee":59,"../../core/fetch/color.coffee":65,"../../core/fetch/text.js":68,"../../core/fetch/value.coffee":69}],314:[function(e,t,n){var r,a;a=e("../../../core/console/print.coffee"),r=function(e){var t,n;n={circle:"scatter",donut:"scatter",line:"line",square:"scatter",area:"stacked"},t=n[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()},r.shapes=["circle","donut","line","square","area"],t.exports=r},{"../../../core/console/print.coffee":54}],315:[function(e,t,n){var r;r=function(e){var t,n,r,a,i,o;return t=e.coords.value,r=e.coords.key||d3.keys(t.objects)[0],o=topojson.feature(t,t.objects[r]),n=o.features,i=e.coords.solo.value,a=e.coords.mute.value,n=n.filter(function(t){return t[e.id.value]=t.id,i.length?i.indexOf(t.id)>=0:!a.length||a.indexOf(t.id)<0})},r.libs=["topojson"],r.nesting=!1,r.requirements=["coords"],r.scale=1,r.shapes=["coordinates"],r.zoom=!0,t.exports=r},{}],316:[function(e,t,n){var r,a,i;r=e("../../../../core/fetch/color.coffee"),a=e("../../../../color/legible.coffee"),i=e("../../../../core/console/print.coffee"),t.exports=function(e){var t,n,o,l,s,u,c,f,d,p,h,v;for(t=e.axes,c=e.axes.margin.viz,l=t.stacked||!t.ticks.value?[]:e.data.viz,v=2*l.length>e.data.large?0:e.draw.timing,d=function(n,i){return 0===i.indexOf("y")?n.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}):n.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),n.style("stroke",function(t){return a(r(e,t))}).style("stroke-width",e.data.stroke.width).attr("shape-rendering",e.shape.rendering.value)},e.dev.value&&i.time("creating axis tick groups"),h=e.group.select("g#d3plus_graph_plane").selectAll("g.d3plus_data_tick").data(l,function(n){var r;return r=t.discrete?"_"+n.d3plus[t.discrete]:"","tick_"+n[e.id.value]+"_"+n.d3plus.depth+r}),h.enter().append("g").attr("class","d3plus_data_tick").attr("opacity",0),e.dev.value&&i.timeEnd("creating axis tick groups"),f=["x","y"],s=0,u=f.length;s<u;s++)n=f[s],e.dev.value&&v&&i.time("creating "+n+" ticks"),o=v&&n!==t.discrete?l:[],p=h.selectAll("line.d3plus_data_"+n).data(o,function(t){return"tick_"+t[e.id.value]+"_"+t.d3plus.depth}),e.dev.value&&v&&i.timeEnd("creating "+n+" ticks"),e.dev.value&&v&&i.time("styling "+n+" ticks"),v>0?p.transition().duration(v).call(d,n):p.call(d,n),p.enter().append("line").attr("class","d3plus_data_"+n).call(d,n),e.dev.value&&v&&i.timeEnd("styling "+n+" 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":46,"../../../../core/console/print.coffee":54,"../../../../core/fetch/color.coffee":65}],317:[function(e,t,n){var r,a,i,o;r=e("./includes/axes.coffee"),a=e("./includes/svg.coffee"),i=e("./includes/mouse.coffee"),o=e("./includes/plot.coffee"),t.exports=function(e,t){void 0===t&&(t={}),r(e,t),o(e,t),a(e,t),e.mouse.viz=t.mouse===!0&&i}},{"./includes/axes.coffee":318,"./includes/mouse.coffee":320,"./includes/plot.coffee":321,"./includes/svg.coffee":322}],318:[function(e,t,n){var r,a,i,o,l,s,u,c,f,d,p,h;r=e("../../../../../array/sort.coffee"),o=e("./buffer.coffee"), | |
i=e("../../../../../util/buckets.coffee"),s=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 n,r,i,s,v,g,m,y,x,b,w,_;for(i=l(e),!i&&e.axes.dataset||(e.axes.dataset=c(e)),e.axes.scale=!(!t.buffer||t.buffer===!0)&&p(e,t.buffer),n=e.width.viz>e.height.viz?["y","y2","x","x2"]:["x","x2","y","y2"],v=0,m=n.length;v<m;v++)r=n[v],x=0===r.indexOf("x")?"y":"x",w=e.order.changed||e.order.sort.changed||e.order.value===!0&&e[x].changed,e[r].value&&(!e[r].ticks.values||i||w||e[r].value===e.time.value&&e.time.fixed.value)&&(e.dev.value&&d.time("calculating "+r+" axis"),e[r].reset=!0,e[r].ticks.values=!1,r===e.axes.discrete&&e[r].value!==e.time.value&&(e[r].ticks.values=h(e.axes.dataset,e[r].value,u,e)),_=t.zero===!0||0===r.indexOf(t.zero),b=a(e,r,_),0===r.indexOf("y")&&(b=b.reverse()),e[r].scale.viz=f(e,r,b),e[r].domain.viz=b,e.dev.value&&d.timeEnd("calculating "+r+" axis"));if(e.axes.mirror.value&&(s=d3.extent(e.y.domain.viz.concat(e.x.domain.viz)),e.x.domain.viz=s,e.x.scale.viz.domain(s),s=s.slice().reverse(),e.y.domain.viz=s,e.y.scale.viz.domain(s)),t.buffer)for(g=0,y=n.length;g<y;g++)r=n[g],r!==e.axes.discrete&&o(e,r,t.buffer)},l=function(e){var t,n,r,a,i,o,l,s,u,c,f,d,p;if(n=!e.time.fixed.value&&(e.time.solo.changed||e.time.mute.changed),n||(n=e.id.solo.changed||e.id.mute.changed),n)return n;for(r=["data","time","id","depth","type","width","height","x","y","x2","y2"],a=0,s=r.length;a<s;a++)if(o=r[a],e[o].changed){n=!0;break}if(n)return n;for(p=["mute","range","scale","solo","stacked","zerofill"],f=["x","y","x2","y2"],i=0,u=f.length;i<u;i++)for(t=f[i],l=0,c=p.length;l<c;l++)if(d=p[l],e[t][d].changed){n=!0;break}return n},c=function(e){var t,n;return e.time.fixed.value?(n=d3.range(0,e.id.nesting.length),d3.merge(d3.merge([function(){var r,a,i;for(i=[],r=0,a=n.length;r<a;r++)t=n[r],i.push(s(e,"all",t));return i}()]))):e.data.viz},a=function(e,t,n,a){var i,o,l,s,c,f,d,p,v,g,m,y,x,b,w,_,k,z,M,A,j,E,S,O,N,F,C,T,q;if(M=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(F=[],A=e.axes.dataset,v=0,x=A.length;v<x;v++)d=A[v],d.values?F=F.concat(d.values):F.push(d);return c=d3.nest().key(function(t){return u(e,t,e[M].value)}).rollup(function(n){var r,a;return a=d3.sum(n,function(n){var r;return r=u(e,n,e[t].value),r>0?r:0}),r=d3.sum(n,function(n){var r;return r=u(e,n,e[t].value),r<0?r:0}),[r,a]}).entries(F),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=[],j=e.axes.dataset,g=0,b=j.length;g<b;g++)d=j[g],T=u(e,d,e[t].value),T instanceof Array?q=q.concat(T):q.push(T);if(q=q.filter(function(e){return null!==e}),t===e.axes.discrete){if(N=e.order.value===!0?e[M].value:e.order.value){for(O=e.order.sort.value,i=e.order.agg.value||e.aggs.value[N]||"max",o=typeof i,f=q.reduce(function(e,t){return e[t]=[],e},{}),E=e.axes.dataset,y=0,w=E.length;y<w;y++)if(d=E[y],d.values)for(S=d.values,k=0,_=S.length;k<_;k++)C=S[k],p=u(e,C,e[t].value),f[p].push(u(e,C,N));else p=u(e,d,e[t].value),f[p].push(u(e,d,N));for(m in f)C=f[m],"string"===o?f[m]=d3[i](C):"function"===o&&(f[m]=i(C,N));return f=r(d3.entries(f),"value",O),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)),n&&(s=q.every(function(e){return e>0}),l=q.every(function(e){return e<0}),(s||l)&&(z=s?1:-1,q.push("log"===e[t].scale.value?z:0))),d3.extent(q)},f=function(e,t,n){var r,a,o,l,s;return a=0===t.indexOf("x")?e.width.viz:e.height.viz,l=e[t].scale.value,["discrete","share"].indexOf(l)>=0&&(l="linear"),s=10,"string"==typeof n[0]?(l="ordinal",r=i([0,a],n.length)):(r=[0,a],"linear"===e[t].scale.value&&(s=Math.floor(a/(4*e[t].ticks.font.size)))),e[t].scale.ticks=s,o=d3.scale[l]().domain(n).range(r),"clamp"in o&&o.clamp(!0),o},p=function(e,t){var n,r,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)),r=e.size.scale.range.max.value,"function"==typeof r&&(r=r(e)),t===!1?e.size.scale.value.domain([0,1]).rangeRound([r,r]):"number"==typeof t?e.size.scale.value.domain([0,1]).rangeRound([t,t]):t?(e.dev.value&&d.time("calculating buffer scale"),n=d3.extent(e.axes.dataset,function(n){var r;return r=u(e,n,t),r?r:0}),n[0]===n[1]&&(a=r),e.dev.value&&d.timeEnd("calculating buffer scale"),e.size.scale.value.domain(n).rangeRound([a,r])):void 0}},{"../../../../../array/sort.coffee":36,"../../../../../core/console/print.coffee":54,"../../../../../core/fetch/data.js":66,"../../../../../core/fetch/value.coffee":69,"../../../../../util/buckets.coffee":207,"../../../../../util/uniques.coffee":213,"./buffer.coffee":319}],319:[function(e,t,n){var r,a;r=e("../../../../../util/buckets.coffee"),a=e("../../../../../util/closest.coffee"),t.exports=function(e,t,n){var i,o,l,s,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,M,A,j,E,S,O,N,F,C,T,q,P;if("share"!==e[t].scale.value&&!e[t].range.value&&e[t].reset){if(O=e[t].scale.viz.copy(),"clamp"in O&&O.clamp(!1),t===e.axes.discrete){if(h=O.domain(),"string"==typeof h[0]){for(y=h.length;y>=0;)h.splice(y,0,"d3plus_buffer_"+y),y--;return A=O.range(),A=r(d3.extent(A),h.length),e[t].scale.viz.domain(h).range(A)}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]),N=e.data.time.ticks.indexOf(u),N>0?h[0]=e.data.time.ticks[N-1]:(d=e.data.time.ticks[N+1]-u,h[0]=new Date(u.getTime()-d)),N<e.data.time.ticks.length-1?h[1]=e.data.time.ticks[N+1]:(d=u-e.data.time.ticks[N-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]),o=p/(e[t].ticks.values.length-1),o/=2,j=O.range()[1],k=1.5*e.axes.scale.range()[1],m=O.invert(-k),g=O.invert(j+k),h[0]-o<m?(h[0]=h[0]-o,h[h.length-1]=h[h.length-1]+o):(h=[m,g],0===t.indexOf("y")&&(h=h.reverse()),v=O.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]),o=p/(e[t].ticks.values.length-1),o/=2,h[0]=h[0]-o,h[1]=h[1]+o;else{for(p=Math.abs(h[1]-h[0]),i=p/2,y=h.length,M=h.slice();y>=0;)f=y?M[y-1]+i:M[y]-i,h.splice(y,0,f),y--;A=O.range(),A=r(d3.extent(A),h.length),e[t].scale.viz.domain(h).range(A)}return 0===t.indexOf("y")&&(h=h.reverse()),e[t].scale.viz.domain(h)}if("x"===n&&0===t.indexOf("x")||"y"===n&&0===t.indexOf("y")||n===!0)return h=O.domain(),s=h[0]>=0&&h[1]>=0,l=h[0]<=0&&h[1]<=0,"log"===e[t].scale.value?(P=s?1:-1,s&&0===t.indexOf("y")&&(h=h.slice().reverse()),w=Math.pow(10,parseInt(Math.abs(h[0])).toString().length-1)*P,b=h[0]%w,x=b,b&&x/w<=.1&&(x+=w*P),_=0===b?w:x,h[0]-=_,0===h[0]&&(h[0]=P),T=Math.pow(10,parseInt(Math.abs(h[1])).toString().length-1)*P,C=h[1]%T,F=Math.abs(T-C),C&&F/T<=.1&&(F+=T*P),q=0===C?T:F,h[1]+=q,0===h[1]&&(h[1]=P),s&&0===t.indexOf("y")&&(h=h.reverse())):(P=0,0===t.indexOf("y")&&(h=h.slice().reverse()),S=h.filter(function(e){return e.constructor===String}),o=.05*Math.abs(h[1]-h[0])||1,S.length||(h[0]=h[0]-o,h[1]=h[1]+o,(s&&h[0]<P||l&&h[0]>P)&&(h[0]=P),(s&&h[1]<P||l&&h[1]>P)&&(h[1]=P)),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,E=e.width.viz>e.height.viz?"x":"y"),t===E&&c?h=c.domain().slice().reverse():(j=O.range()[1],k=e.axes.scale.range()[1],m=O.invert(1.5*-k),g=O.invert(j+1.5*k),h=[m,g],0===t.indexOf("y")&&(h=h.reverse()),v=O.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":207,"../../../../../util/closest.coffee":209}],320:[function(e,t,n){var r,a,i,o,l,s;r=e("../../../../../util/copy.coffee"),a=e("../../../../../client/pointer.coffee"),i=e("../../../../../core/fetch/color.coffee"),o=e("../../../../../core/fetch/value.coffee"),l=e("../../../../../color/legible.coffee"),s=e("../../../../../color/text.coffee"),t.exports=function(e,t){var n,r,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,M;return n=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,M=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,!n&&u?(r=l(i(t,e)),f=["x","y","x2","y2"].filter(function(n){var r;return r=o(t,e,t[n].value),r&&!(r instanceof Array)&&n!==t.axes.stacked&&t[n].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")?M:M+m}).attr("x2",function(e){return 0===e.indexOf("x")?z:z-m}).attr("y2",function(e){return 0===e.indexOf("y")?M:M+m}).attr("opacity",0)},p=function(e){return e.style("stroke",function(e){return"area"===t.shape.value?"white":r}).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(n){return n.attr("x1",function(e){return 0===e.indexOf("x")?z:z-m}).attr("y1",function(e){return 0===e.indexOf("y")?M:M+m}).attr("x2",function(n){return 0===n.indexOf("x")?z:e.d3plus.x0?e.d3plus.x0:"y"===n?g.left-t[n].ticks.size:g.left+c.width+t[n].ticks.size}).attr("y2",function(n){return 0===n.indexOf("y")?M:e.d3plus.y0?e.d3plus.y0:"x"===n?c.height+g.top+t[n].ticks.size:g.top-t[n].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(n){return n.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(n){return 0===n.indexOf("y")?M:e.d3plus.y0?e.d3plus.y+(e.d3plus.y0-e.d3plus.y)/2+g.top-6:"x"===n?c.height+g.top+5+t[n].ticks.size:g.top-5-t[n].ticks.size-1.35*t[n].ticks.font.size}).attr("fill","area"===t.shape.value?"white":s(r))},_=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(n){var r,a;return r=t.axes.stacked||n,a=o(t,e,t[r].value),t.format.value(a,{key:t[r].value,vars:t,labels:t[r].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(n){var a;return a=function(e){var t;return t=d3.select("text#"+e+"_d3plusmouseaxislabel"),t.size()?t.node().getBBox():{width:0,height:0}},n.attr("x",function(e){var n;return n=a(e).width,0===e.indexOf("x")?z-n/2-5:"y"===e?g.left-t[e].ticks.size-n-10:g.left+c.width+t[e].ticks.size}).attr("y",function(n){var r;return r=a(n).height,0===n.indexOf("y")?M-(r/2+5):e.d3plus.y0?e.d3plus.y+(e.d3plus.y0-e.d3plus.y)/2+g.top-(r/2+5):"x"===n?c.height+g.top+t[n].ticks.size:g.top-t[n].ticks.size-r-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":r).attr("fill",r).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":40,"../../../../../color/legible.coffee":46,"../../../../../color/text.coffee":52,"../../../../../core/fetch/color.coffee":65,"../../../../../core/fetch/value.coffee":69,"../../../../../util/copy.coffee":210}],321:[function(e,t,n){var r,a,i,o,l,s,u,c,f,d,p;r=e("../../../../../util/buckets.coffee"),a=e("./buffer.coffee"),o=e("../../../../../core/fetch/value.coffee"),l=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 n,r,l,s,c,f,p,h,v,g,m,y,x,b,w,_,k,z,M,A;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,n=e.width.viz>e.height.viz?["y","y2","x","x2"]:["x","x2","y","y2"],c=0,h=n.length;c<h;c++)if(r=n[c],e[r].value){if(e[r].ticks.values===!1)if(e[r].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,s=d3.extent(z),w=e.data.time.stepType,z=[s[0]],k=s[0];k<s[1];)m=new Date(k),k=new Date(m["set"+w](m["get"+w]()+1)),z.push(k);e[r].ticks.values=z}else 1===r.indexOf("2")?(x=e[r.slice(0,1)].scale.viz,b=e[r].scale.viz,z=e[r.slice(0,1)].scale.ticks,e[r].ticks.values=x.ticks(z).map(function(e){return parseFloat(d3.format(".5f")(b.invert(x(e))))})):e[r].ticks.values=e[r].scale.viz.ticks(e[r].scale.ticks);e[r].ticks.values.length||(A=o(e,e.data.viz,e[r].value),A instanceof Array||(A=[A]),e[r].ticks.values=A),y=0===r.indexOf("x")?"y":"x",(1===e[r].ticks.values.length||t.buffer&&t.buffer!==y&&r===e.axes.discrete&&e[r].reset===!0)&&a(e,r,t.buffer),e[r].reset=!1,e[r].value===e.time.value?(l={"font-family":e[r].ticks.font.family.value,"font-weight":e[r].ticks.font.weight,"font-size":e[r].ticks.font.size+"px","text-transform":e[r].ticks.font.transform.value,"letter-spacing":e[r].ticks.font.spacing+"px"},M=d(e,{values:e[r].ticks.values,limit:e.width.viz,style:l}),e[r].ticks.value?e[r].ticks.visible=e[r].ticks.value.map(Number):e[r].ticks.labels.value.constructor===Array?e[r].ticks.visible=e[r].ticks.labels.value.map(Number):e[r].ticks.visible=M.values.map(Number),e[r].ticks.format=M.format):e[r].ticks.value?(e[r].ticks.values=e[r].ticks.value,e[r].ticks.labels.value.constructor===Array?e[r].ticks.visible=e[r].ticks.labels.value:e[r].ticks.visible=e[r].ticks.value):e[r].ticks.labels.value.constructor===Array?e[r].ticks.visible=e[r].ticks.labels.value:"log"===e[r].scale.value?(z=e[r].ticks.values,_=z.filter(function(e){return"1"===Math.abs(e).toString().charAt(0)}),_.length<3?e[r].ticks.visible=z:e[r].ticks.visible=_):e[r].ticks.visible=e[r].ticks.values,e[r].value===e.time.value&&(e[r].ticks.visible=e[r].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=n.length;f<v;f++)r=n[f],e[r].label.height=0;else e.small||u(e);for(p=0,g=n.length;p<g;p++)r=n[p],e[r].axis.svg=i(e,r)},u=function(e){var t,n,a,i,o,u,c,d,p,h,v,g,m,y,x,b,w,_,k,z,M,A,j,E,S,O,N,F,C,T;for(b=e.x.scale.viz.domain(),O=e.y.scale.viz.domain(),e.x2.value&&(g=e.x2.scale.viz.domain()),e.y2.value&&(j=e.y2.scale.viz.domain()),d=["y","y2"],n=0,o=d.length;n<o;n++)t=d[n],e[t].value&&(c="y"===t?"left":"right",E={"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"},T=e[t].ticks.visible,"log"===e[t].scale.value?C=T.map(function(e){return s(e)}):"share"===e[t].scale.value?C=T.map(function(n){return e.format.value(100*n,{key:"share",vars:e,output:t})}):e[t].value===e.time.value?C=T.map(function(n,r){return e[t].ticks.format(new Date(n))}):("string"==typeof T[0]&&(T=e[t].scale.viz.domain().filter(function(e){return 0!==e.indexOf("d3plus_buffer_")})),C=T.map(function(n){return e.format.value(n,{key:e[t].value,vars:e,labels:e[t].affixes.value,output:t})})),e[t].ticks.labels.value?(e[t].ticks.hidden=!1,S=d3.max(l(C,E),function(e){return e.width}),S&&(S=Math.ceil(S+e.labels.padding),e.axes.margin.viz[c]+=S)):e[t].ticks.hidden=!0,N=e[t].label.fetch(e),N?(F={"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=l([N],F)[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(r([0,e.axes.width],b.length)),g&&e.x2.scale.viz.range(r([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"},A=e[t].ticks.visible,"log"===e[t].scale.value?M=A.map(function(e){return s(e)}):"share"===e[t].scale.value?M=A.map(function(n){return e.format.value(100*n,{key:"share",vars:e,output:t})}):e[t].value===e.time.value?M=A.map(function(n,r){return e[t].ticks.format(new Date(n))}):("string"==typeof A[0]&&(A=e[t].scale.viz.domain().filter(function(e){return 0!==e.indexOf("d3plus_buffer_")})),M=A.map(function(n){return e.format.value(n,{key:e[t].value,vars:e,labels:e[t].affixes.value,output:t})})),z=l(M,m),x=d3.max(z,function(e){return e.width}),y=d3.max(z,function(e){return e.height}),1===A.length?k=e.axes.width:(k=e[t].scale.viz(A[1])-e[t].scale.viz(A[0]),k=Math.abs(k)),x>k&&M.join("").indexOf(" ")>0?(e[t].ticks.wrap=!0,z=l(M,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=l(M,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),i=e[t].ticks.visible[e[t].ticks.visible.length-1],h=e[t].scale.viz(i),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=l([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(r([0,e.axes.width],b.length)),g&&e.x2.scale.viz.range(r([0,e.axes.width],g.length)),e.y.scale.viz.range(r([0,e.axes.height],O.length)),j)return e.y2.scale.viz.range(r([0,e.axes.height],j.length))},i=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(n,r){var a,i;return e[t].ticks.hidden?null:(i=e[t].scale.value,a=n.constructor===Date?+n:n,e[t].ticks.visible.indexOf(a)>=0?"share"===i?e.format.value(100*n,{key:"share",vars:e,labels:e[t].affixes.value,output:t}):n.constructor===Date?e[t].ticks.format(n):"log"===i?s(n):e.format.value(n,{key:e[t].value,vars:e,labels:e[t].affixes.value,output:t}):null)})},c="⁰¹²³⁴⁵⁶⁷⁸⁹",s=function(e){var t,n,r;return n=Math.round(Math.log(Math.abs(e))/Math.LN10),r=Math.abs(e).toString().charAt(0),t="10 "+(n+"").split("").map(function(e){return c[e]}).join(""),"1"!==r&&(t=r+" x "+t),e<0?"-"+t:t}},{"../../../../../core/data/time.coffee":64,"../../../../../core/fetch/value.coffee":69,"../../../../../font/sizes.coffee":104,"../../../../../textwrap/textwrap.coffee":203,"../../../../../util/buckets.coffee":207,"../../../../../util/uniques.coffee":213,"./buffer.coffee":319}],322:[function(e,t,n){var r,a,i;r=e("../../../../../color/mix.coffee"),a=e("../../../../../textwrap/textwrap.coffee"),i=e("../../../../../object/validate.coffee"),t.exports=function(e){var t,n,o,l,s,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,M,A,j,E,S,O,N,F,C,T,q,P,B,D,R,I,L,V,U,Y,H,X,G,Z,W,J,Q,K,$,ee,te,ne,re,ae,ie,oe,le,se,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},n={left:"start",center:"middle",right:"end"},l=e.small?[]:[0],ie=function(t,n){return t.attr("x1",function(t){return 0===n.indexOf("x")?e.x.scale.viz(t):0}).attr("x2",function(t){return 0===n.indexOf("x")?e.x.scale.viz(t):e.axes.width}).attr("y1",function(t){return 0===n.indexOf("y")?e.y.scale.viz(t):0}).attr("y2",function(t){return 0===n.indexOf("y")?e.y.scale.viz(t):e.axes.height})},oe=function(t,n,a){var i,o,l;return i=a?e[n].grid.color:e[n].ticks.color,o="log"===e[n].scale.value,l=e[n].ticks.visible||[],t.attr("stroke",function(t){var s;return 0===t?e[n].axis.color:(t.constructor===Date&&(t=+t),s=l.indexOf(t)>=0,!s||o&&"1"!==Math.abs(t).toString().charAt(0)?a&&"transparent"!==e.axes.background.color?r(i,e.axes.background.color,.4,1):"transparent"!==e.background.value?r(i,e.background.value,.4,1):r(i,"white",.4,1):i)}).attr("stroke-width",e[n].ticks.width).attr("shape-rendering",e[n].ticks.rendering.value)},v=function(t,n,r){var a;return a=0===n?"axis":"ticks",n=e[t][a].font[r],n&&(n.length||"number"==typeof n)?n:e[t].ticks.font[r]},ae=function(t,n){var a;return a="log"===e[n].scale.value,t.attr("font-size",function(e){return v(n,e,"size")+"px"}).attr("stroke","none").attr("fill",function(t){var i;return i=v(n,t,"color"),a&&"1"!==Math.abs(t).toString().charAt(0)?r(i,e.background.value,.4,1):i}).attr("font-family",function(e){return v(n,e,"family").value}).attr("font-weight",function(e){return v(n,e,"weight")}).style("text-transform",function(e){return v(n,e,"transform").value}).style("letter-spacing",function(e){return v(n,e,"spacing")+"px"})},q=function(t,n){var r,a;return r=0===n.indexOf("x")?"height":"width",a=0===n.indexOf("x")?"y":"x",t.attr(a+"1",0).attr(a+"2",e.axes[r]).attr(n+"1",function(e){return e.coords.line}).attr(n+"2",function(e){return e.coords.line}).attr("stroke",function(t){return t.color||e[n].lines.color}).attr("stroke-width",e[n].lines.width).attr("shape-rendering",e[n].lines.rendering.value).attr("stroke-dasharray",e[n].lines.dasharray.value)},F=function(t,r){var a;return a=0===r.indexOf("x")?"y":"x",t.attr(a,function(e){return e.coords.text[a]+"px"}).attr(r,function(e){return e.coords.text[r]+"px"}).attr("dy",e[r].lines.font.position.value).attr("text-anchor",n[e[r].lines.font.align.value]).attr("transform",function(e){return e.transform}).attr("font-size",e[r].lines.font.size+"px").attr("fill",function(t){return t.color||e[r].lines.color}).attr("font-family",e[r].lines.font.family.value).attr("font-weight",e[r].lines.font.weight)},U="translate("+e.axes.margin.viz.left+","+e.axes.margin.viz.top+")",V=e.group.selectAll("g#d3plus_graph_plane").data([0]),V.transition().duration(e.draw.timing).attr("transform",U),V.enter().append("g").attr("id","d3plus_graph_plane").attr("transform",U),c=V.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),R=V.selectAll("path#d3plus_graph_mirror").data([0]),R.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),R.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"}),K=0!==e.x.ticks.rotate,ue=function(t,n){var r,i;return i="x"===n?e.axes.height:0,r=t.attr("transform","translate(0,"+i+")").call(e[n].axis.svg.scale(e[n].scale.viz)).selectAll("g.tick"),r.selectAll("line").attr("y2",function(t){var r;return t.constructor===Date&&(t=+t),r=d3.select(this).attr("y2"),e[n].ticks.visible.indexOf(t)>=0?r:r/2}),r.select("text").style("text-anchor",K&&"x"===n?"end":K?"start":"middle").call(ae,n).each(function(t){if(d3.select(this).attr("dy","0px").attr("font-size",function(e){return v(n,e,"size")+"px"}),t.constructor===Date&&(t=+t),!e[n].ticks.hidden&&e[n].ticks.visible.indexOf(t)>=0)return a().container(d3.select(this)).rotate(e[n].ticks.rotate).align(K?"end":"center").valign(K?"middle":"x"===n?"top":"bottom").width(e[n].ticks.maxWidth+2).height(e[n].ticks.maxHeight).padding(0).x(-e[n].ticks.maxWidth/2).y("x2"===n?-(e[n].ticks.maxHeight+2*e.labels.padding):0).draw()})},ce=function(t,n){var r,a;return a="y2"===n?e.axes.width:0,r=t.attr("transform","translate("+a+", 0)").call(e[n].axis.svg.scale(e[n].scale.viz)).selectAll("g.tick"),r.selectAll("line").attr("y2",function(t){var n;return t.constructor===Date&&(t=+t),n=d3.select(this).attr("y2"),e.x.ticks.visible.indexOf(t)>=0?n:n/2}),r.select("text").call(ae,n)},Z=["x","x2","y","y2"],x=0,M=Z.length;x<M;x++)o=Z[x],ee=0===o.indexOf("x")?ue:ce,H=l.length&&e[o].value?[0]:[],s=V.selectAll("g#d3plus_graph_"+o+"ticks").data(H),s.transition().duration(e.draw.timing).call(ee,o),s.selectAll("line").transition().duration(e.draw.timing).call(oe,o),y=s.enter().append("g").attr("id","d3plus_graph_"+o+"ticks").call(ee,o),y.selectAll("path").attr("fill","none").attr("stroke","none"),y.selectAll("line").call(oe,o),s.exit().transition().duration(e.data.timing).attr("opacity",0).remove();for(z=function(t,n){return t.attr("x",0===n.indexOf("x")?e.width.viz/2:-(e.axes.height/2+e.axes.margin.viz.top)).attr("y","x"===n?e.height.viz-e[n].label.height/2-e[n].label.padding:"y2"===n?e.width.viz-e[n].label.height/2-e[n].label.padding:e[n].label.height/2+e[n].label.padding).attr("transform",0===n.indexOf("y")?"rotate(-90)":null).attr("font-family",e[n].label.font.family.value).attr("font-weight",e[n].label.font.weight).attr("font-size",e[n].label.font.size+"px").attr("fill",e[n].label.font.color).style("text-anchor","middle").attr("dominant-baseline","central").style("text-transform",e[n].label.font.transform.value).style("letter-spacing",e[n].label.font.spacing+"px")},W=["x","y"],b=0,A=W.length;b<A;b++)o=W[b],e[o].grid.value?m=e[o].ticks.value?e[o].ticks.value:e[o].ticks.values:(m=[],L="x"===o?"y":"x",e[o].ticks.values.indexOf(0)>=0&&e[L].axis.value&&(m=[0])),e[o].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=V.selectAll("g#d3plus_graph_"+o+"grid").data([0]),g.enter().append("g").attr("id","d3plus_graph_"+o+"grid"),P=g.selectAll("line").data(m,function(e,t){return e.constructor===Date?e.getTime():e}),P.transition().duration(e.draw.timing).call(ie,o).call(oe,o,!0),P.enter().append("line").style("opacity",0).call(ie,o).call(oe,o,!0).transition().duration(e.draw.timing).delay(e.draw.timing/2).style("opacity",1),P.exit().transition().duration(e.draw.timing/2).style("opacity",0).remove();for(J=["x","x2","y","y2"],w=0,j=J.length;w<j;w++)o=J[w],e[o].value?(u=e[o].label.fetch(e),k=l&&u&&!e.small?[0]:[],t=e.format.affixes.value[e[o].value],u&&!e[o].affixes.value&&t&&($=e[o].affixes.separator.value,$===!0?$=["[","]"]:$===!1&&($=["",""]),u+=" "+$[0]+t[0]+" "+t[1]+$[1])):(u="",k=[]),_=e.group.selectAll("text#d3plus_graph_"+o+"label").data(k),_.text(u).transition().duration(e.draw.timing).call(z,o),_.enter().append("text").attr("stroke","none").attr("id","d3plus_graph_"+o+"label").text(u).call(z,o),_.exit().transition().duration(e.data.timing).attr("opacity",0).remove();for(Q=["x","y","x2","y2"],D=0,E=Q.length;D<E;D++)if(o=Q[D],e[o].value){for(C=V.selectAll("g#d3plus_graph_"+o+"_userlines").data([0]),C.enter().append("g").attr("id","d3plus_graph_"+o+"_userlines"),p=e[o].scale.viz.domain(),0===o.indexOf("y")&&(p=p.slice().reverse()),te=[],N=[],le=e[o].lines.value||[],I=0,S=le.length;I<S;I++)O=le[I],d=i(O)?O.position:O,se=o===e.axes.discrete?p.indexOf(d)>=0:d>=p[0]&&d<=p[1],se&&(d=i(O)?O:{position:d},d.coords={line:e[o].scale.viz(d.position)},N.push(d),d.text&&(d.axis=o,d.padding=.5*e[o].lines.font.padding.value,d.align=e[o].lines.font.align.value,Y=e[o].lines.font.position.text,ne="middle"===Y?0:2*d.padding,"top"===Y&&(ne=-ne),0===o.indexOf("x")?(re="left"===d.align?e.axes.height:"center"===d.align?e.axes.height/2:0,"left"===d.align&&(re-=2*d.padding),"right"===d.align&&(re+=2*d.padding)):(re="left"===d.align?0:"center"===d.align?e.axes.width/2:e.axes.width,"right"===d.align&&(re-=2*d.padding),"left"===d.align&&(re+=2*d.padding)),d.coords.text={},d.coords.text[0===o.indexOf("x")?"y":"x"]=re,d.coords.text[o]=e[o].scale.viz(d.position)+ne,d.transform=0===o.indexOf("x")?"rotate(-90,"+d.coords.text.x+","+d.coords.text.y+")":null,te.push(d)));P=C.selectAll("line.d3plus_graph_"+o+"line").data(N,function(e){return e.position}),P.enter().append("line").attr("class","d3plus_graph_"+o+"line").attr("opacity",0).call(q,o),P.transition().duration(e.draw.timing).attr("opacity",1).call(q,o),P.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),B=C.selectAll("text.d3plus_graph_"+o+"line_text").data(te,function(e){return e.position}),B.enter().append("text").attr("class","d3plus_graph_"+o+"line_text").attr("id",function(e){var t;return t=e.position+"",t=t.replace("-","neg"),t=t.replace(".","p"),"d3plus_graph_"+o+"line_text_"+t}).attr("opacity",0).call(F,o),B.text(function(e){return e.text}).transition().duration(e.draw.timing).attr("opacity",1).call(F,o),B.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),G=function(t){var n;return n=function(e){var t;return t=e.position+"",t=t.replace("-","neg"),t=t.replace(".","p"),V.select("text#d3plus_graph_"+e.axis+"line_text_"+t).node().getBBox()},t.attr("x",function(e){return n(e).x-e.padding}).attr("y",function(e){return n(e).y-e.padding}).attr("transform",function(e){return e.transform; | |
}).attr("width",function(e){return n(e).width+2*e.padding}).attr("height",function(e){return n(e).height+2*e.padding}).attr("fill","transparent"!==e.axes.background.color?e.axes.background.color:"white")},X=e[o].lines.font.background.value?te:[],T=C.selectAll("rect.d3plus_graph_"+o+"line_rect").data(X,function(e){return e.position}),T.enter().insert("rect","text.d3plus_graph_"+o+"line_text").attr("class","d3plus_graph_"+o+"line_rect").attr("pointer-events","none").attr("opacity",0).call(G),T.transition().delay(e.draw.timing).each("end",function(t){return d3.select(this).transition().duration(e.draw.timing).attr("opacity",1).call(G)}),T.exit().transition().duration(e.draw.timing).attr("opacity",0).remove()}}},{"../../../../../color/mix.coffee":48,"../../../../../object/validate.coffee":175,"../../../../../textwrap/textwrap.coffee":203}],323:[function(e,t,n){var r,a,i;r=e("../../../../core/fetch/value.coffee"),a=e("../../../../string/strip.js"),i=e("../../../../util/uniques.coffee"),t.exports=function(e,t,n){var o,l,s,u,c,f,d;return void 0===n?n=e.id.nesting.slice(0,e.depth.value+1):n.constructor!==Array&&(n=[n]),void 0===l&&(l=[]),t||(t=e.data.viz),o=e[e.axes.discrete],u=e[e.axes.opposite],d=o.value===e.time.value,d?(f=e.data.time.ticks,s=e.time.solo.value.length?"solo":"mute",e.time[s].value.length&&(c=e.time[s].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"===s?c.indexOf(+e)>=0:c.indexOf(+e)<0}))):f=o.ticks.values?o.ticks.values:i(t,o.value,r,e),d3.nest().key(function(t){var i,o,l,s,u;for(s="nesting",o=0,l=n.length;o<l;o++)i=n[o],u=r(e,t,i),u instanceof Array&&(u=u.join("_")),s+="_"+a(u);return s}).rollup(function(t){var n,a,l,c,p,h,v,g,m,y,x,b;if(n=i(t,o.value,r,e),b=n.length&&n[0].constructor===Date,b&&(n=n.map(Number)),o.zerofill.value)for(a="log"===o.scale.value?u.scale.viz.domain().every(function(e){return e<0})?-1:1:0,l=c=0,h=f.length;c<h;l=++c)if(x=f[l],y=d?+x:x,n.indexOf(y)<0){for(g={d3plus:{}},m=e.id.nesting,p=0,v=m.length;p<v;p++)s=m[p],s in t[0]&&(g[s]=t[0][s]);g[o.value]=x,g[u.value]=0,g[u.value]=a,t.splice(l,0,g)}return"string"==typeof t[0][o.value]?t:t.sort(function(t,n){var a,i,l,s,c;return a=r(e,t,o.value),l=r(e,n,o.value),(c=a-l)?c:(i=r(e,t,u.value),s=r(e,n,u.value),i-s)})}).entries(t)}},{"../../../../core/fetch/value.coffee":69,"../../../../string/strip.js":178,"../../../../util/uniques.coffee":213}],324:[function(e,t,n){var r;r=e("../../../../core/fetch/value.coffee"),t.exports=function(e,t){var n,a,i,o,l,s,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(r(e,t,e[m].value))}).out(function(t,n,i){var o,l;return l=r(e,t,e[m].value),o=l<0,"share"===v?(t.d3plus[m+"0"]=(1-n)*a,t.d3plus[m]=t.d3plus[m+"0"]-i*a):(t.d3plus[m+"0"]=a,e.axes.stacked&&(t.d3plus[m+"0"]-=n),t.d3plus[m]=t.d3plus[m+"0"]-i),t.d3plus[m]+=u,t.d3plus[m+"0"]+=u}),h=[],f=[],i=0,l=t.length;i<l;i++)if(n=t[i],x=r(e,n,e[m].value),x instanceof Array){for(c=!0,o=0,s=x.length;o<s;o++)if(y=x[o],y>=0){c=!1;break}c?f.push(n):h.push(n)}else x>=0&&h.push(n),x<0&&f.push(n);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":69}],325:[function(e,t,n){var r,a,i,o,l,s;r=e("../../core/fetch/value.coffee"),a=e("./helpers/graph/draw.coffee"),o=e("./helpers/graph/nest.coffee"),l=e("../../array/sort.coffee"),s=e("./helpers/graph/stack.coffee"),i=function(e){var t,n,i,o,u,c,f,d,p,h,v;if(a(e,{buffer:e.axes.opposite,mouse:!0}),i=e.x.domain.viz.concat(e.y.domain.viz),i.indexOf(void 0)>=0)return[];for(n=l(e.data.viz,null,null,null,e),o=0,c=n.length;o<c;o++)for(d=n[o],p=d.values,u=0,f=p.length;u<f;u++)t=p[u],h=r(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(r(e,t,e.x2.value))),t.d3plus.x+=e.axes.margin.viz.left,v=r(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(r(e,t,e.y2.value))),t.d3plus.y+=e.axes.margin.viz.top;return e.axes.stacked?s(e,n):n},i.filter=function(e,t){return o(e,t)},i.requirements=["data","x","y"],i.setup=function(e){var t;e.axes.discrete||(t=e.time.value===e.y.value?"y":"x",e.self[t]({scale:"discrete"}))},i.shapes=["line"],i.tooltip="static",t.exports=i},{"../../array/sort.coffee":36,"../../core/fetch/value.coffee":69,"./helpers/graph/draw.coffee":317,"./helpers/graph/nest.coffee":323,"./helpers/graph/stack.coffee":324}],326:[function(e,t,n){var r=e("../../network/smallestGap.coffee"),a=e("../../core/fetch/value.coffee"),i=function(e){var t=e.nodes.restricted||e.nodes.value,n=e.edges.restricted||e.edges.value,i=d3.extent(t,function(e){return e.x}),o=d3.extent(t,function(e){return e.y}),l=[1,1];if("number"==typeof e.size.value?l=[e.size.value,e.size.value]:e.size.value&&(l=d3.extent(t,function(t){var n=a(e,t,e.size.value);return 0===n?null:n})),"undefined"==typeof l[0]&&(l=[1,1]),"number"==typeof e.size.value)var s=e.size.value,u=e.size.value;else{var s=r(t,{accessor:function(e){return[e.x,e.y]}}),c=s/2,f=e.size.value?e.nodes.overlap:.4;if(s*=f,e.edges.arrows.value&&(s=.5*s),l[0]===l[1]){var u=c;s=c}else{var d=i[1]+1.1*s-(i[0]-1.1*s),p=o[1]+1.1*s-(o[0]-1.1*s),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*s;u*g<2&&(u=2/g)}}var m=e.size.scale.value.domain(l).range([u,s]);e.zoom.bounds=[[i[0]-1.1*s,o[0]-1.1*s],[i[1]+1.1*s,o[1]+1.1*s]];var y=[],x={};return t.forEach(function(t){var n=e.data.viz.filter(function(n){return n[e.id.value]==t[e.id.value]})[0],r=n||{};r[e.id.value]=t[e.id.value],r.d3plus={},r.d3plus.x=t.x,r.d3plus.y=t.y;var i=a(e,r,e.size.value);r.d3plus.r=i?m(i):m.range()[0],x[r[e.id.value]]={x:r.d3plus.x,y:r.d3plus.y,r:r.d3plus.r},y.push(r)}),y.sort(function(e,t){return t.d3plus.r-e.d3plus.r}),n.forEach(function(t,n){t.d3plus&&delete t.d3plus.spline,t[e.edges.source].d3plus={};var r=x[t[e.edges.source][e.id.value]];void 0!==r?(t[e.edges.source].d3plus.r=r.r,t[e.edges.source].d3plus.x=r.x,t[e.edges.source].d3plus.y=r.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:n}};i.nesting=!1,i.requirements=["nodes","edges"],i.scale=1.05,i.shapes=["circle","square","donut"],i.tooltip="static",i.zoom=!0,t.exports=i},{"../../core/fetch/value.coffee":69,"../../network/smallestGap.coffee":171}],327:[function(e,t,n){var r,a,i,o,l=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1};a=e("../../network/shortestPath.coffee"),r=e("../../core/fetch/value.coffee"),i=e("../../util/uniques.coffee"),o=function(e){var t,n,a,i,s,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,M,A,j,E,S,O,N,F,C,T,q,P,B,D,R,I,L,V,U,Y,H,X,G,Z,W,J,Q,K,$,ee,te,ne,re,ae,ie,oe,le,se,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]]]},J=o.paths,Y=m=0,k=J.length;m<k;Y=++m)for(U=J[Y],h=h.concat(U.edges),_=e.focus.value[0],X[Y]=[_],Q=U.edges,p=y=0,z=Q.length;y<z;p=++y)d=Q[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],B=d[e.edges.source][e.id.value]===_?"target":"source",D=d[e.edges[B]][e.id.value],void 0===H[D]&&(H[D]=Y),X[Y].push(D),_=D;ie=0;for(Y in X)if(U=X[Y],"all"!==Y){for(q=0,v=x=0,M=U.length;x<M;v=++x)if(g=U[v],0!==v&&v!==U.length-1&&H[g]===parseFloat(Y)){for(q=1,G=U[v-1],P=U[v+1],Z=null,R=null,K=X.all,u=N=0,A=K.length;N<A;u=++N)s=K[u],l.call(s,G)>=0&&(Z=u),l.call(s,P)>=0&&(R=u);null!==Z&&null===R?Z+1===X.all.length-1?X.all.splice(Z+1,0,[g]):X.all[Z+1].push(g):R-Z===1?X.all.splice(R,0,[g]):R-Z>1&&X.all[R-1].push(g)}ie+=q}for(ae=Math.floor(e.height.viz/ie),de=[],v=0;v<ie;)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)/(ie-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]),C=5,F=.4*d3.min([c,ae-b]),le=d3.extent(e.data.viz,function(t){var n;return n=r(e,t,e.size.value),n||0}),oe=e.size.scale.value.domain(le).rangeRound([C,F]),$=e.data.viz,T=0,j=$.length;T<j;T++){for(I=$[T],null==I.d3plus&&(I.d3plus={}),ee=X.all,u=L=0,E=ee.length;L<E;u=++L)s=ee[u],te=I[e.id.value],l.call(s,te)>=0&&(I.d3plus.x=ue(u));I.d3plus.y=fe(H[I[e.id.value]]),e.size.value?(se=r(e,I,e.size.value),I.d3plus.r=se?oe(se):C):I.d3plus.r=F,I.d3plus.r<.1*c&&!e.small?I.d3plus.label={x:0,y:I.d3plus.r+2*e.labels.padding,w:.6*c,h:b+F-I.d3plus.r,resize:!1}:delete I.d3plus.label}for(ne=o.paths,Y=V=0,S=ne.length;V<S;Y=++V)for(U=ne[Y],_=e.focus.value[0],re=U.edges,p=W=0,O=re.length;W<O;p=++W)d=re[p],B=d[e.edges.source][e.id.value]===_?"target":"source",w="target"===B?"source":"target",D=d[e.edges[B]][e.id.value],H[_]!==H[D]?(d.d3plus={spline:!0},null==(t=d[e.edges.source]).d3plus&&(t.d3plus={}),null==(n=d[e.edges.source].d3plus).edges&&(n.edges={}),null==(a=d[e.edges.target]).d3plus&&(a.d3plus={}),null==(i=d[e.edges.target].d3plus).edges&&(i.edges={}),ce=d[B].d3plus.x-d[w].d3plus.x,d[w].d3plus.edges[d[B][e.id.value]]={angle:Math.PI,radius:c/2},d[B].d3plus.edges[d[w][e.id.value]]={angle:0,radius:c/2,offset:ce-c}):delete d.d3plus,_=D;return{nodes:e.data.viz,edges:h}},o.filter=function(e,t){var n,l,s,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z;for(u=e.edges.filtered||e.edges.value,o.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}),o.nodes=[],n=[],b=o.paths,d=0,v=b.length;d<v;d++)for(x=b[d],w=x.edges,p=0,g=w.length;p<g;p++)s=w[p],k=s[e.edges.source],z=s[e.edges.target],n.indexOf(k[e.id.value])<0&&(o.nodes.push(k),n.push(k[e.id.value])),n.indexOf(z[e.id.value])<0&&(o.nodes.push(z),n.push(z[e.id.value]));for(f=i(o.nodes,e.id.value,r,e),_=[],h=0,m=f.length;h<m;h++)c=f[h],l=t.filter(function(t){return t[e.id.value]===c}),l[0]?_.push(l[0]):(y={d3plus:{}},y[e.id.value]=c,_.push(y));return _},o.nesting=!1,o.requirements=[function(e){return{status:2===e.focus.value.length,text:e.format.locale.value.method.focus+" x 2"}},"edges"],o.scale=1,o.shapes=["circle","square","donut"],o.tooltip="static",t.exports=o},{"../../core/fetch/value.coffee":69,"../../network/shortestPath.coffee":170,"../../util/uniques.coffee":213}],328:[function(e,t,n){var r,a,i,o;r=e("../../array/comparator.coffee"),a=e("../../core/data/threshold.js"),i=e("../../core/data/group.coffee"),o=function(e){var t,n,a,o,l,s,u,c,f;for(u=d3.layout.pie().value(function(e){return e.value}).sort(function(t,n){return e.order.value?r(t.d3plus,n.d3plus,[e.order.value],e.order.sort.value,[],e):e.id.nesting.length>1?r(t.d3plus,n.d3plus,e.id.nesting.concat([e.size.value]),void 0,[],e):r(t.d3plus,n.d3plus,[e.size.value],"desc",[],e)}),n=i(e,e.data.viz,[]),s=u(n),f=[],c=d3.min([e.width.viz,e.height.viz])/2-2*e.labels.padding,a=0,l=s.length;a<l;a++)t=s[a],o=t.data.d3plus,o.d3plus.startAngle=t.startAngle,o.d3plus.endAngle=t.endAngle,o.d3plus.r=c,o.d3plus.x=e.width.viz/2,o.d3plus.y=e.height.viz/2,o.d3plus.share=(t.endAngle-t.startAngle)/(2*Math.PI),f.push(o);return f},o.filter=a,o.requirements=["data","size"],o.shapes=["arc"],o.threshold=function(e){return 1600/(e.width.viz*e.height.viz)},t.exports=o},{"../../array/comparator.coffee":34,"../../core/data/group.coffee":59,"../../core/data/threshold.js":63}],329:[function(e,t,n){var r,a,i,o,l,s,u,c,f,d,p;a=e("../../array/comparator.coffee"),f=e("../../array/sort.coffee"),i=e("../../core/data/threshold.js"),o=e("../../core/fetch/text.js"),l=e("../../core/fetch/value.coffee"),s=e("../../font/sizes.coffee"),u=e("../../geom/offset.coffee"),d=e("../../textwrap/textwrap.coffee"),r=e("../../util/buckets.coffee"),p=e("../../util/uniques.coffee"),c=function(e){var t,n,a,i,c,f,h,v,g,m,y,x,b,w,_,k,z,M,A,j,E,S,O,N,F,C,T,q,P,B,D,R,I,L,V,U,Y,H,X,G,Z,W,J,Q,K,$,ee,te,ne,re,ae,ie,oe,le;for(m=e.data.viz,U=e.depth.value+1,Y=e.id.nesting[U],v=function(){var e,t,n;for(n=[],e=0,t=m.length;e<t;e++)g=m[e],n.push(g[Y]);return n}(),ie=function(){var t,n,r;for(r=[],t=0,n=m.length;t<n;t++)g=m[t],r.push(p(m,Y,l,e,U));return r}(),ie=p(d3.merge(ie)).length,i=2*Math.PI/ie,L=d3.min([e.width.viz,e.height.viz])/2,O=0,C=0,T=function(){var t,n,r;for(r=[],t=0,n=v.length;t<n;t++)f=v[t],r.push(o(e,f,U)[0]);return r}(),T=p(d3.merge(T)),e.labels.value&&(y=u(Math.PI/2,L),ee=u(i+Math.PI/2,L),O=y.x-ee.x-2*e.labels.padding,re={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=s(T,re,{mod:function(t){return d().container(d3.select(t)).width(e.height.viz/8).height(O).draw()}}),C=d3.max(te,function(e){return e.width}),L-=C,L-=2*e.labels.padding),I=function(){var t,n,r;for(r=[],t=0,n=v.length;t<n;t++)f=v[t],r.push(function(){var t,n,r;for(r=[],t=0,n=f.length;t<n;t++)g=f[t],r.push(l(e,g,e.size.value));return r}());return r}(),I=d3.max(d3.merge(I)),G=d3.scale.linear().domain([0,I]).range([0,L]),k=function(){var t,n,r;for(r=[],t=0,n=v.length;t<n;t++)f=v[t],r.push(l(e,f,Y));return r}(),k=p(d3.merge(k)),_=d3.scale.ordinal().domain(k).range(d3.range(0,k.length)),M=0,q=m.length;M<q;M++)for(g=m[M],g.d3plus.x=e.width.viz/2+e.margin.top,g.d3plus.y=e.height.viz/2+e.margin.left,Z=g[Y],w=A=0,P=Z.length;A<P;w=++A)t=Z[w],t.d3plus||(t.d3plus={}),t.d3plus.r=G(l(e,t,e.size.value)),t.d3plus.a=_(l(e,t,Y))*i;for(z=1,W=[10,5,4,2],R=0,B=W.length;R<B;R++)if(w=W[R],L/w>=20){z=w;break}for(Q=r([L/z,L],z-1).reverse(),Q.length===z&&Q.shift(),$=e.group.selectAll(".d3plus_radar_rings").data(Q,function(e,t){return t}),K=function(t){return t.attr("fill",function(t,n){return 0===n?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(K).attr("r",0),$.transition().duration(e.draw.timing).call(K).attr("r",function(e){return e}),$.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),N=d3.scale.ordinal().domain(T).range(d3.range(0,T.length)),E=[],V=0,D=T.length;V<D;V++)j=T[V],n=i*N(j)-Math.PI/2,t=n*(180/Math.PI),t<-90||t>90?(t-=180,c=-(L+2*e.labels.padding+C),a="end"):(c=L+2*e.labels.padding,a="start"),ae=n<0||n>Math.PI,J=n<Math.PI/2,X=L,e.labels.value&&(X+=e.labels.padding),H=u(n,X),oe=H.x,le=H.y,J||(oe-=C),ae&&(le-=O),h=[0,Math.PI].indexOf(i*N(j))>=0,h&&(oe-=C/2),E.push({text:j,angle:t,x:c,anchor:a,offset:H});return S=e.group.selectAll("g.d3plus_radar_label_group").data([0]),S.enter().append("g").attr("class","d3plus_radar_label_group").attr("transform","translate("+e.width.viz/2+","+e.height.viz/2+")"),S.transition().duration(e.draw.timing).attr("transform","translate("+e.width.viz/2+","+e.height.viz/2+")"),ne=S.selectAll(".d3plus_radar_labels").data(e.labels.value?E:[],function(e,t){return t}),F=function(e){return e.attr(re).each(function(e,t){return d().container(d3.select(this)).height(O).width(C).align(e.anchor).text(e.text).padding(0).valign("middle").x(e.x).y(-O/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})},ne.call(F),ne.enter().append("text").attr("class","d3plus_radar_labels").attr("opacity",0).call(F).transition().duration(e.draw.timing).attr("opacity",1),ne.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),x=e.group.selectAll(".d3plus_radar_lines").data(E,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":34,"../../array/sort.coffee":36,"../../core/data/threshold.js":63,"../../core/fetch/text.js":68,"../../core/fetch/value.coffee":69,"../../font/sizes.coffee":104,"../../geom/offset.coffee":163,"../../textwrap/textwrap.coffee":203,"../../util/buckets.coffee":207,"../../util/uniques.coffee":213}],330:[function(e,t,n){var r=e("../../array/sort.coffee"),i=e("../../client/pointer.coffee"),o=e("../../core/fetch/value.coffee"),l=e("../../core/fetch/color.coffee"),s=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,n=e.small||!e.labels.value?(t-2*e.labels.padding)/2:t/3,p=e.small||!e.labels.value?1.4*n:n,h=2*n,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 n=t[e.edges.source][e.id.value]==e.focus.value[0]?t[e.edges.target]:t[e.edges.source],r=e.data.viz.filter(function(t){return t[e.id.value]===n[e.id.value]})[0];r||(r={d3plus:{}},r[e.id.value]=n[e.id.value]),r.d3plus.edges=e.edges.connections(r[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]}),r.d3plus.edge=t,x.push(r[e.id.value]),y.push(r)});var b=e.order.value||e.color.value||e.size.value||e.id.value;y.sort(function(t,n){var a=t.d3plus.edges.length-n.d3plus.edges.length;return a?a:r([t,n],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 n=t[e.id.value];t.d3plus.edges=t.d3plus.edges.filter(function(t){var r=t[e.edges.source][e.id.value],a=t[e.edges.target][e.id.value];return x.indexOf(r)<0&&a==n||x.indexOf(a)<0&&r==n}),_+=t.d3plus.edges.length||1,t.d3plus.edges.forEach(function(t){var r=t[e.edges.source],a=t[e.edges.target],i=a[e.id.value]==n?r:a;x.push(i[e.id.value])})}),r(y,b,e.order.sort.value,e.color.value||[],e);var k=0,z=2*Math.PI,M=0;y.forEach(function(t,n){var i=t.d3plus.edges.length||1,o=z/_*i;0==n&&(M=l,k-=o/2);var l=k+o/2;l-=z/4,t.d3plus.radians=l,t.d3plus.x=e.width.viz/2+p*Math.cos(l),t.d3plus.y=e.height.viz/2+p*Math.sin(l),k+=o,t.d3plus.edges.sort(function(n,a){var n=n[e.edges.source][e.id.value]==t[e.id.value]?n[e.edges.target]:n[e.edges.source],a=a[e.edges.source][e.id.value]==t[e.id.value]?a[e.edges.target]:a[e.edges.source];return r([n,a],b,e.order.sort.value,e.color.value||[],e)}),t.d3plus.edges.forEach(function(n,r){var o=n[e.edges.source][e.id.value]==t[e.id.value]?n[e.edges.target]:n[e.edges.source],s=z/_,u=e.data.viz.filter(function(t){return t[e.id.value]===o[e.id.value]})[0];u||(u={d3plus:{}},u[e.id.value]=o[e.id.value]),a=l-s*i/2+s/2+s*r,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 A=c(y,{accessor:function(e){return[e.d3plus.x,e.d3plus.y]}}),j=c(w,{accessor:function(e){return[e.d3plus.x,e.d3plus.y]}});if(A||(A=n/2),j||(j=n/4),A/2-4<8)var E=d3.min([A/2,8]);else var E=A/2-4;if(j/2-4<4)var S=d3.min([j/2,4]);else var S=j/2-4;S>n/10&&(S=n/10),S>E&&S>10&&(S=.75*E),E>1.5*S&&(E=1.5*S),E=Math.floor(E),S=Math.floor(S);var O=d(y,e.id.value,o,e);O=O.concat(d(w,e.id.value,o,e)),O.push(e.focus.value[0]);var N=e.data.viz.filter(function(t){return O.indexOf(t[e.id.value])>=0});if(e.size.value){var F=d3.extent(N,function(t){return o(e,t,e.size.value)});F[0]==F[1]&&(F[0]=0);var t=d3.scale.linear().domain(F).rangeRound([3,d3.min([E,S])]),C=o(e,m,e.size.value);m.d3plus.r=t(C)}else{var t=d3.scale.linear().domain([1,2]).rangeRound([E,S]);e.edges.label&&(m.d3plus.r=1.5*t(1))}w.forEach(function(n){n.d3plus.ring=2;var r=e.size.value?o(e,n,e.size.value):2;n.d3plus.r=t(r)}),y.forEach(function(n){n.d3plus.ring=1;var r=e.size.value?o(e,n,e.size.value):1;n.d3plus.r=t(r)}),g=[m].concat(y).concat(w),y.forEach(function(t,r){var a=[e.edges.source,e.edges.target],i=t.d3plus.edge;a.forEach(function(t){i[t]=g.filter(function(n){return n[e.id.value]==i[t][e.id.value]})[0]}),delete i.d3plus,v.push(i),e.edges.connections(t[e.id.value],e.id.value).forEach(function(r){var a=r[e.edges.source][e.id.value]==t[e.id.value]?r[e.edges.target]:r[e.edges.source];if(a[e.id.value]!=m[e.id.value]){var i=w.filter(function(t){return t[e.id.value]==a[e.id.value]})[0];if(i);else{i=y.filter(function(t){return t[e.id.value]==a[e.id.value]})[0]}if(i){r.d3plus={spline:!0,translate:{x:e.width.viz/2,y:e.height.viz/2}};var o=[e.edges.source,e.edges.target];o.forEach(function(a,o){r[a]=g.filter(function(t){return t[e.id.value]==r[a][e.id.value]})[0],void 0===r[a].d3plus.edges&&(r[a].d3plus.edges={});var l=0===o?r[e.edges.target][e.id.value]:r[e.edges.source][e.id.value];r[a][e.id.value]==t[e.id.value]?r[a].d3plus.edges[l]={angle:t.d3plus.radians+Math.PI,radius:n/2}:r[a].d3plus.edges[l]={angle:i.d3plus.radians,radius:n/2}}),v.push(r)}}})});var T=!1;return e.background.value&&["transparent","none"].indexOf(e.background.value)<0&&d3.hsl(e.background.value).l<.5&&(T=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 r=t.d3plus.rotate,a=n-3*e.labels.padding-t.d3plus.r;if(r<-90||r>90){r-=180;var i=-(t.d3plus.r+a/2+e.labels.padding),o="end"}else var i=t.d3plus.r+a/2+e.labels.padding,o="start";var u=y.indexOf(t)>=0,c=1==t.d3plus.ring?A:j;t.d3plus.label={x:i,y:0,w:a,h:c,angle:r,anchor:o,valign:"center",color:T||s(l(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:T||s(l(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[i.click]=function(t){if(t[e.id.value]!=e.focus.value[0]){u(e.type.value);var n=e.focus.value[0];e.history.states.push(function(){e.self.focus(n).draw()}),e.self.focus(t[e.id.value]).draw()}},{edges:v,nodes:g,data:N}};p.filter=function(e,t){var n=e.edges.connections(e.focus.value[0],e.id.value,!0),r=[];n.forEach(function(t){r=r.concat(e.edges.connections(t[e.id.value],e.id.value,!0))});var a=n.concat(r),i=d(a,e.id.value,o,e),l=[];return i.forEach(function(n){var r=t.filter(function(t){return t[e.id.value]==n})[0];if(r)l.push(r);else{var a={d3plus:{}};a[e.id.value]=n,l.push(a)}}),l},p.nesting=!1,p.scale=1,p.shapes=["circle","square","donut"],p.requirements=["edges","focus"],p.tooltip="static",t.exports=p},{"../../array/sort.coffee":36,"../../client/pointer.coffee":40,"../../color/legible.coffee":46,"../../color/text.coffee":52,"../../core/fetch/color.coffee":65,"../../core/fetch/value.coffee":69,"../../network/smallestGap.coffee":171,"../../tooltip/remove.coffee":206,"../../util/uniques.coffee":213}],331:[function(e,t,n){var r,a,i,o,l;r=e("./sankey.js"),a=e("../../client/pointer.coffee"),i=e("../../tooltip/remove.coffee"),l=e("../../util/uniques.coffee"),o=function(e){var t,n,o,l,s,u,c,f,d,p,h,v,g,m,y;for(l=e.focus.value[0],v=2*e.data.stroke.width,y=e.size.value.constructor===Number?e.size.value:20,o=e.edges.connections(l,e.id.value).filter(function(t){return t[e.edges.source][e.id.value]!==l||t[e.edges.target][e.id.value]!==l}),h=[],g=[],o=o.map(function(t){var n,r;return t[e.edges.target][e.id.value]===l?(n={id:"left_"+t[e.edges.source][e.id.value],dupe:"left",data:t[e.edges.source],value:t[e.edges.strength.value]},r=t[e.edges.target]):(n=t[e.edges.source],r={id:"right_"+t[e.edges.target][e.id.value],dupe:"right",data:t[e.edges.target],value:t[e.edges.strength.value]}),g.indexOf(n.id)<0&&h.push(n),g.indexOf(r.id)<0&&h.push(r),g.push(n.id),g.push(r.id),{source:n,target:r,value:t[e.edges.strength.value]||1}}),c=r().nodeWidth(y).nodePadding(e.data.padding.value).size([e.width.viz-2*v,e.height.viz-2*v]).nodes(h).links(o).layout(2),m=[],s=0,f=h.length;s<f;s++)p=h[s],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!==l&&(t[e.edges.strength.value]=p.value),m.push(t);for(e.edges.path=c.link(),u=0,d=o.length;u<d;u++)n=o[u],n.d3plus={x:v,y:v};return e.mouse.viz={},e.mouse.viz[a.click]=function(t){var n;if(t[e.id.value]!==e.focus.value[0])return i(e.type.value),n=e.focus.value[0],e.history.states.push(function(){return e.self.focus(n).draw()}),e.self.focus(t[e.id.value]).draw()},{nodes:m,edges:o}},o.requirements=["edges","focus","nodes"],o.shapes=["square"],t.exports=o},{"../../client/pointer.coffee":40,"../../tooltip/remove.coffee":206,"../../util/uniques.coffee":213,"./sankey.js":332}],332:[function(e,t,n){t.exports=function(){function e(){p.forEach(function(e){e.sourceLinks=[],e.targetLinks=[]}),h.forEach(function(e){var t=e.source,n=e.target;"number"==typeof t&&(t=e.source=p[e.source]),"number"==typeof n&&(n=e.target=p[e.target]),t.sourceLinks.push(e),n.targetLinks.push(e)})}function t(){p.forEach(function(e){e.value=Math.max(d3.sum(e.sourceLinks,s),d3.sum(e.targetLinks,s))})}function n(){for(var e,t=p,n=0;t.length;)e=[],t.forEach(function(t){t.x=n,t.dx=c,t.sourceLinks.forEach(function(t){e.indexOf(t.target)<0&&e.push(t.target)})}),t=e,++n;r(n),a((d[0]-c)/(n-1))}function r(e){p.forEach(function(t){t.sourceLinks.length||(t.x=e-1)})}function a(e){p.forEach(function(t){t.x*=e})}function i(e){function t(){var e=d3.min(o,function(e){return(d[1]-(e.length-1)*f)/d3.sum(e,s)});o.forEach(function(t){t.forEach(function(t,n){t.y=n,t.dy=t.value*e})}),h.forEach(function(t){t.dy=t.value*e})}function n(e){function t(e){return l(e.source)*e.value}o.forEach(function(n,r){n.forEach(function(n){if(n.targetLinks.length){var r=d3.sum(n.targetLinks,t)/d3.sum(n.targetLinks,s);n.y+=(r-l(n))*e}})})}function r(e){function t(e){return l(e.target)*e.value}o.slice().reverse().forEach(function(n){n.forEach(function(n){if(n.sourceLinks.length){var r=d3.sum(n.sourceLinks,t)/d3.sum(n.sourceLinks,s);n.y+=(r-l(n))*e}})})}function a(){o.forEach(function(e){var t,n,r,a=0,o=e.length;for(e.sort(i),r=0;r<o;++r)t=e[r],n=a-t.y,n>0&&(t.y+=n),a=t.y+t.dy+f;if(n=a-f-d[1],n>0)for(a=t.y-=n,r=o-2;r>=0;--r)t=e[r],n=t.y+t.dy+f-a,n>0&&(t.y-=n),a=t.y})}function i(e,t){return e.y-t.y}var o=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)r(u*=.99),a(),n(u),a()}function o(){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(n){n.sourceLinks.sort(t),n.targetLinks.sort(e)}),p.forEach(function(e){var t=0,n=0;e.sourceLinks.forEach(function(e){e.sy=t,t+=e.dy}),e.targetLinks.forEach(function(e){e.ty=n,n+=e.dy})})}function l(e){return e.y+e.dy/2}function s(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(r){return e(),t(),n(),i(r),o(),u},u.relayout=function(){return o(),u},u.link=function(){function e(e){var n=e.source.x+e.source.dx,r=e.target.x,a=d3.interpolateNumber(n,r),i=a(t),o=a(1-t),l=e.source.y+e.sy+e.dy/2,s=e.target.y+e.ty+e.dy/2;return"M"+n+","+l+"C"+i+","+l+" "+o+","+s+" "+r+","+s}var t=.5;return e.curvature=function(n){return arguments.length?(t=+n,e):t},e},u}},{}],333:[function(e,t,n){var r,a,i,o,l,s;r=e("../../core/fetch/value.coffee"),a=e("./helpers/graph/draw.coffee"),i=e("../../core/console/print.coffee"),l=e("../../array/sort.coffee"),s=e("./helpers/graph/dataTicks.coffee"),o=function(e){var t,n,i,o,u;if(a(e,{buffer:"size",mouse:!0}),n=e.x.domain.viz.concat(e.y.domain.viz),n.indexOf(void 0)>=0)return[];for(u=e.data.viz,i=0,o=u.length;i<o;i++)t=u[i],t.d3plus.x=e.x.scale.viz(r(e,t,e.x.value)),t.d3plus.x+=e.axes.margin.viz.left,t.d3plus.y=e.y.scale.viz(r(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(r(e,t,e.size.value)):t.d3plus.r=e.axes.scale(0);return s(e),l(e.data.viz,e.order.value||e.size.value||e.id.value,"desc"===e.order.sort.value?"asc":"desc",e.color.value||[],e)},o.fill=!0,o.requirements=["data","x","y"],o.scale=1.1,o.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"})},o.shapes=["circle","square","donut"],o.tooltip="static",t.exports=o},{"../../array/sort.coffee":36,"../../core/console/print.coffee":54,"../../core/fetch/value.coffee":69,"./helpers/graph/dataTicks.coffee":316,"./helpers/graph/draw.coffee":317}],334:[function(e,t,n){var r=e("../../core/fetch/value.coffee"),a=e("../../util/uniques.coffee"),i=e("../../util/copy.coffee"),o=e("../../color/random.coffee"),l=function(e){var t=a(e.data.viz,e.id.value,r,e),n=a(e.cols.value);n.indexOf("label")<0&&e.cols.index.value&&n.unshift("label");var l=e.height.viz/(t.length+1),s=e.width.viz/n.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 l*t+l}).attr("x2",e.width.viz).attr("y2",function(e,t){return l*t+l}).style("fill","#fff").style("stroke","#fff"),u.exit().remove();var c=e.group.selectAll("line.vert").data(n);c.enter().append("line").attr("class","vert"),c.attr("x1",function(e,t){return s*t+s}).attr("y1",0).attr("x2",function(e,t){return s*t+s}).attr("y2",e.height.viz).style("fill","#fff").style("stroke","#fff"),c.exit().remove();var f=[],d={};return n.forEach(function(t,n){var r={d3plus:{x:s*n+s/2,y:l/2,width:s,height:l,id:"d3p_header_"+t.toString().replace(/ /g,"_"),shape:"square",color:"#fff",text:e.format.value(t)}};if(t==e.id.value&&(r.d3plus.color="#fff"),"label"==t&&(r.d3plus.label=!1,r.d3plus.color="#fff",r.d3plus.stroke="#fff"),f.push(r),"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,o(t)])}else"boolean"==e.data.keys[t]&&(d[t]=function(n){return n?o(t):e.color.missing})}),e.data.viz.forEach(function(t,r){r+=1,n.forEach(function(n,a){var o=i(t);o.d3plus.id="d3p_"+o[e.id.value].toString().replace(/ /g,"_")+"_"+n,o.d3plus.x=s*a+s/2,o.d3plus.y=l*r+l/2,o.d3plus.width=s,o.d3plus.height=l,"label"==n&&(o.d3plus.shape="square",o.d3plus.color="#fff",f.push(o)),d3.keys(t).indexOf(n)>=0&&n in t&&(d[n]&&(o.d3plus.color=d[n](o[n])),o.d3plus.text=e.format.value(o[n]),"boolean"==e.data.keys[n]?o.d3plus.label=!1:"string"==e.data.keys[n]&&(o.d3plus.color=e.color.missing, | |
o.d3plus.stroke="#fff",o.d3plus.shape="square"),f.push(o))})}),f};l.shapes=["check","cross","diamond","square","triangle","triangle_up","triangle_down"],l.requirements=["data","cols"],t.exports=l},{"../../color/random.coffee":49,"../../core/fetch/value.coffee":69,"../../util/copy.coffee":210,"../../util/uniques.coffee":213}],335:[function(e,t,n){var r,a,i,o;r=e("../../core/data/threshold.js"),a=e("../../core/data/group.coffee"),i=e("../../object/merge.coffee"),o=function(e){var t,n,r,o,l,s,u;if(r=a(e,e.data.viz),n=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 n;return n=e.value-t.value,0===n?e.id<t.id:n}).nodes({name:"root",values:r}).filter(function(e){return!e.values&&e.area}),n.length){for(u=n[0];u.parent;)u=u.parent;for(s=[],o=0,l=n.length;o<l;o++)t=n[o],t.d3plus.d3plus=i(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}),s.push(t.d3plus)}return s},o.filter=r,o.modes=["squarify","slice","dice","slice-dice"],o.requirements=["data","size"],o.shapes=["square"],o.threshold=function(e){return 1600/(e.width.viz*e.height.viz)},t.exports=o},{"../../core/data/group.coffee":59,"../../core/data/threshold.js":63,"../../object/merge.coffee":174}],336:[function(e,t,n){var r,a,i,o,l,s,u;r=e("../core/methods/attach.coffee"),a=e("./methods/helpers/axis.coffee"),o=e("./helpers/ui/message.js"),l=e("./helpers/drawSteps.js"),s=e("../core/console/print.coffee"),i=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,n,r,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),i(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,n=function(){f.length?a():t.dev.value&&(s.groupEnd(),s.timeEnd("total draw time"),s.log("\n"))},r=function(e,r){r=r||"function",e[r]instanceof Array?e[r].forEach(function(e){e(t,n)}):"function"==typeof e[r]&&e[r](t,n),e.wait||n()},a=function(){var a,i,l,u;u=f.shift(),l=t.g.message&&e===u.message,i=!("check"in u)||u.check,"function"==typeof i&&(i=i(t)),i?l?r(u):(t.dev.value&&(e!==!1&&s.groupEnd(),s.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?(o(t,a),t.error.value?r(u):setTimeout(function(){return r(u)},10)):r(u)):"otherwise"in u?t.error.value?r(u,"otherwise"):setTimeout(function(){return r(u,"otherwise")},10):n()},t.messages.style.backup=t.group&&"1"===t.group.attr("opacity")?"small":"large",f=l(t),a()}),t.self},r(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":54,"../core/methods/attach.coffee":82,"../object/validate.coffee":175,"./helpers/container.coffee":214,"./helpers/drawSteps.js":215,"./helpers/ui/message.js":249,"./methods/active.coffee":258,"./methods/aggs.coffee":259,"./methods/attrs.coffee":260,"./methods/axes.coffee":261,"./methods/background.coffee":262,"./methods/class.coffee":263,"./methods/color.coffee":264,"./methods/cols.js":265,"./methods/config.coffee":266,"./methods/container.coffee":267,"./methods/coords.coffee":268,"./methods/csv.coffee":269,"./methods/data.coffee":270,"./methods/depth.coffee":271,"./methods/descs.coffee":272,"./methods/dev.coffee":273,"./methods/draw.js":274,"./methods/edges.js":275,"./methods/error.coffee":276,"./methods/focus.coffee":277,"./methods/font.coffee":278,"./methods/footer.coffee":279,"./methods/format.coffee":280,"./methods/height.coffee":281,"./methods/helpers/axis.coffee":282,"./methods/history.coffee":283,"./methods/icon.coffee":284,"./methods/id.coffee":285,"./methods/labels.coffee":286,"./methods/legend.coffee":287,"./methods/links.coffee":288,"./methods/margin.coffee":289,"./methods/messages.coffee":290,"./methods/mouse.coffee":291,"./methods/nodes.coffee":292,"./methods/order.coffee":293,"./methods/resize.coffee":294,"./methods/shape.coffee":295,"./methods/size.coffee":296,"./methods/style.coffee":297,"./methods/temp.coffee":298,"./methods/text.coffee":299,"./methods/time.coffee":300,"./methods/timeline.coffee":301,"./methods/timing.coffee":302,"./methods/title.coffee":303,"./methods/tooltip.coffee":304,"./methods/total.coffee":305,"./methods/type.coffee":306,"./methods/ui.coffee":307,"./methods/width.coffee":308,"./methods/zoom.js":309,"./types/area.coffee":310,"./types/bar.coffee":311,"./types/box.coffee":312,"./types/bubbles.coffee":313,"./types/deprecated/chart.coffee":314,"./types/geo_map.coffee":315,"./types/line.coffee":325,"./types/network.js":326,"./types/paths.coffee":327,"./types/pie.coffee":328,"./types/radar.coffee":329,"./types/rings.js":330,"./types/sankey.coffee":331,"./types/scatter.coffee":333,"./types/table.js":334,"./types/tree_map.coffee":335}]},{},[166,165]); |
This file contains 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
<!doctype html> | |
<meta charset="utf-8"> | |
<!-- d3plus v1.9.8 --> | |
<script src="d3plus.full.min.js"></script> | |
<div id="viz"></div> | |
<script> | |
var url = 'https://raw.githubusercontent.com/aaizemberg/vis/gh-pages/01/data/deptos.tsv'; | |
var visualization = d3plus.viz() | |
.format('es_ES') | |
.container("#viz") | |
.data( url ) | |
.type("tree_map") | |
.id(["provincia","departamento"]) | |
.size("poblacion") | |
.draw() | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment