!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;o0)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>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;oc?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()=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;ul&&(n=l-s),u=n;u>=0;u--){for(var f=!0,d=0;da&&(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;o239?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;rr)&&(n=r);for(var a="",i=t;in)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||te.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>>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>>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;o55295&&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>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=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);a0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(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;fa)&&(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),t0&&(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=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=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>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=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=0;--a)e[a+t]=this[a+n];else if(i<1e3||!o.TYPED_ARRAY_SUPPORT)for(a=0;a>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var i;if("number"==typeof e)for(i=t;it?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>>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>>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=t&&(t=a+1);!(o=l[t])&&++t0&&(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+(t0&&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.t8?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"===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-n1)for(;o=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+(i68?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=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])=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];++r0){for(w||(i.polygonStart(),w=!0),i.lineStart();++o1&&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)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?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]=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||ii}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];z0^w[1]<(xo(w[0]-k)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(i0){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(i0)){if(i/=v,v<0){if(i0){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(i0&&(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)0?0:3:xo(r[0]-n)0?2:1:xo(r[1]-t)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;ar&&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){eUl&&(Ul=e),tYl&&(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)i||xo((y*O+x*N)/b-.5)>.3||l*p+s*h+u*v0&&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?ai)&&(a+=o*Do)):(a=e+o*Do,i=e-.5*s);for(var u,c=a;o>0?c>i:c0?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)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)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;oqo||xo(a-n)>qo)&&(l.splice(o,0,new nr(er(i.site,c,xo(r-f)qo?{x:f,y:xo(t-f)qo?{x:xo(n-h)qo?{x:d,y:xo(t-d)qo?{x:xo(n-p)=-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=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.y1)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=l)return}else i={x:o,y:r*o+a};n={x:l,y:r*l+a}}else{if(i){if(i.xi||f>o||d=b,k=n>=w,z=k<<1|_,M=z+4;zi&&(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=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=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]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=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;++oa&&(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=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 t2?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(;u0;d--)o.push(i(u)*d);for(u=0;o[u]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*t0?l[n-1]:e[0],n0?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);++f1?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]];++t1&&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]];++t1){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;u9&&(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;++a0;)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]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 te?1:t>=e?0:NaN},so.min=function(e,t){var n,r,a=-1,i=e.length;if(1===arguments.length){for(;++a=r){n=r;break}for(;++ar&&(n=r)}else{for(;++a=r){n=r;break}for(;++ar&&(n=r)}return n},so.max=function(e,t){var n,r,a=-1,i=e.length;if(1===arguments.length){for(;++a=r){n=r;break}for(;++an&&(n=r)}else{for(;++a=r){n=r;break}for(;++an&&(n=r)}return n},so.extent=function(e,t){var n,r,a,i=-1,o=e.length;if(1===arguments.length){for(;++i=r){n=a=r;break}for(;++ir&&(n=r),a=r){n=a=r;break}for(;++ir&&(n=r),a1)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=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)=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=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=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=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=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;++t0&&(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;a1){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=u)return o;if(a)return a=!1,i;var t=c;if(34===e.charCodeAt(t)){for(var n=t;n++=^]))?([+\- ])?([$#])?(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;++rp&&(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*hp&&(p=y)}else if(v=(v+360)%360-180,g^(u*hp&&(p=n);g?tl(c,d)&&(d=t):l(t,d)>l(c,d)&&(c=t):d>=c?(td&&(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]:eqo?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];rl(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=.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=0;--t)p.push(e[l[u[t]][2]]);for(t=+f;t=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,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;pm&&(m=c.x),c.y>y&&(y=c.y),f.push(c.x),d.push(c.y);else for(p=0;pm&&(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=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;++n0?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=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;++ul&&(l=r),o.push(r)}for(n=0;n0)for(i=-1;++i=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.xh.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;o0&&(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;++a0;)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;++oa&&(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);++in.dx)&&(c=n.dx);++i1);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;nf?0:1;if(u=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=eBo)+",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;++lrect,.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]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);nn;0<=n?t++:t--)u.push(t);return u}.apply(this).reverse(),s=[],i=0,o=l.length;ig;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>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<>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<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;tnumeric.largeArray)return r.push("...Large Array..."),!0;var u=!1;for(r.push("["),a=0;a0&&(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;n0){for(a[s]=[],t=0;t>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>>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>8&255,v.push(l),v.push(s),v.push(255&~l),v.push(255&~s),0===u&&v.push(0),c=0;c255?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=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=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=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;ev&&(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;rMath.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=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=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=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;td&&(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;n0;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=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;r0){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=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=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=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;li&&(o=a,i=l));for(w(y[n])=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;si&&(o=a,i=l));for(w(y[_[n]])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=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;tf&&(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;ry[t]&&(y[t]=n);for(t=0;ty[t+1]&&(y[t+1]=y[t]);for(t=f-1;t>=1;t--)m[t]=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||na&&(a=i[r]);for(a++,n=numeric.rep([a],0),r=0;r1;)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]&&Mn[s]&&Mn[s]&&A0)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;a20)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=.1*_*u||isNaN(s));)_*=.5,++T;if(_*k1;)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));et&&(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=0;--n){for(i=l[n],r=n+1;rP)&&(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=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=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;np)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]=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)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,St?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=0&&(y=-y),x=m*y-k,f[l][l]=m-y,s=c;s=0&&(y=-y),x=m*y-k,f[l][l+1]=m-y,s=c;sb&&(b=w)}for(l=p-1;l!=-1;l+=-1){if(0!=y){for(x=y*f[l][l+1],s=c;s=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=0;s--)if(v[s]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;on&&(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;ra&&(o=r,a=i);a>t&&(u[o]=1,d.push(c,o,o,f)),f=d.pop(),c=d.pop()}for(r=0;r1){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;h2&&w.push(k.lo(j+1))}else{for(var S=k.offset,E=v.index(m,0),h=0;h0?{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;i0&&!(u[0]>=v);){for(var g=s[0],m=a.index(g,0),y=0,c=0;c0&&!(m[0]>=x);){for(var b=g[0],w=o.index(b,0),_=0,y=0;y=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=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;s0;){var i=r(e);if(i>=0){var o=n[t*i];if(a0)-(e<0)},n.abs=function(e){var t=e>>a-1;return(e^t)-t},n.min=function(e,t){return t^(e^t)&-(e65535)<<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<>>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>",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;ethis_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_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;a0)throw new Error("cwise: pre() block may not reference array args");if(a0)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),a0)throw new Error("cwise: pre() block may not reference array index");if(a0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===o){if(t.shapeArgs.push(a),an.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=0;--r)c=e[r],s.push(["for(i",r,"=0;i",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;c0;){"].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;c0&&(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;f0&&w.push("shape=SS.slice(0)"),e.indexArgs.length>0){for(var _=new Array(n),f=0;f3&&b.push(o(e.pre,e,c));var A=o(e.body,e,c),j=i(g);j3&&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;c0&&(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=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=0;--a)r[a]=n,n*=e[a];for(var i=f.malloc(n,t),a=0;a=0;--n)i[n]=a,a*=e[n];var o=f.malloc(a,t);for(n=0;n=0;n--)s+=i[n],l=Math.min(l,e[n]);for(n=0,r=0;n1&&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;f0;--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;o1?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;eMath.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=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=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;s0)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>>1;e[a]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;d0}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;s0;){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(i0&&(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=0?r(e,t):e=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=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=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=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-11?(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;l0&&(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=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=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;j0){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=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=0&&e.data.time.values.length){t=e.data.time.values.slice(0);for(var g=0;g1&&(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=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=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=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=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=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()r;c=1<=r?++n:--n)a.push(function(){var t,n,r;for(r=[],n=0,t=e.length;nw;d=0<=w?++v:--v){for(o=[function(){var e,t,r;for(r=[],b=e=0,t=n;0<=t?et;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<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)),us;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?nr;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;rn;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?rc;a=0<=c?++r:--r){for(n=0,f=u[a],o=0,l=f.length;ot.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=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.length0){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=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=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.valuee.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=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,re.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,fp+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=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;t0&&(ve=d(ve,ge),e=function(){var e,t,n;for(n=[],e=0,t=ve.length;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]a[1]||e[1]r[0]&&e[0]>a[0])&&(e[0]i)))},i=function(e,t){var n,r,a,i,o;for(i=-1,o=t.length,r=t[o-1],a=0;++iMath.max(t[0],n[0])+r||iMath.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)t[f]&&yf&&(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=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]),-13?(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;an&&(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=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\>\/g," "),t.replace(/\<\/tspan\>/g,""),t.replace(/\/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;rl){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;cf||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.heighti.limit[0]&&(i.x=i.limit[0]-i.width),i.yi.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-5t&&(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_offsett&&(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)=0,t?e:"relative"}),e.container.changed&&e.container.value.html(""),a=["width","height"],n=0,r=a.length;n=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.length1){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=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]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=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()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=no.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=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;M0?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=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]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;LI&&(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&&hh&&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="
";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:""})})}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;o1&&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=""):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=0){if(q=i(e.nodes.restriced||e.nodes.value),e.data.viz.length)for(var P=0;P=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=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="
";var v=e.format.locale.value;p+="
"+e.format.value(v.method.mute)+"
",p+="
"+e.format.value(v.method.solo)+"
",p+="
",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;_=re,t=e.width.value-2*e.ui.padding,V&&e.timeline.play.value&&(t-=P+e.ui.padding),!V||te.length=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=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]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&&n0||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]*lp?s[1]=-o[0][1]*l+p:s[1]+o[1][1]*lr.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=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=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=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=T&&te<=W?O.push(N):te>=u&&teW?$.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;B0)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;x3*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;s0?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;v0?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;g0}),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=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)&&(h[0]=P),(s&&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;c4?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;fk&&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:xe.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=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=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=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;oh)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=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=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;V1?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=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;V90?(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=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;s0&&(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=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