forked from d3plus/d3plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathd3plus.min.js
executable file
·15 lines (15 loc) · 461 KB
/
d3plus.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
!function t(e,r,n){function a(i,s){if(!r[i]){if(!e[i]){var l="function"==typeof require&&require;if(!s&&l)return l(i,!0);if(o)return o(i,!0);var u=new Error("Cannot find module '"+i+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[i]={exports:{}};e[i][0].call(c.exports,function(t){var r=e[i][1][t];return a(r?r:t)},c,c.exports,t,e,r,n)}return r[i].exports}for(var o="function"==typeof require&&require,i=0;i<n.length;i++)a(n[i]);return a}({1:[function(e){var t,r,n;t=window.d3plus||{},window.d3plus=t,t.version="1.6.3 - Turquoise",t.repo="https://github.com/alexandersimoes/d3plus/",t.array={comparator:e("./array/comparator.coffee"),contains:e("./array/contains.coffee"),sort:e("./array/sort.coffee"),update:e("./array/update.coffee")},t.client={css:e("./client/css.coffee"),ie:e("./client/ie.js"),pointer:e("./client/pointer.coffee"),prefix:e("./client/prefix.coffee"),rtl:e("./client/rtl.coffee"),scrollbar:e("./client/scrollbar.coffee"),touch:e("./client/touch.coffee")},t.color={legible:e("./color/legible.coffee"),lighter:e("./color/lighter.coffee"),mix:e("./color/mix.coffee"),random:e("./color/random.coffee"),scale:e("./color/scale.coffee"),sort:e("./color/sort.coffee"),text:e("./color/text.coffee"),validate:e("./color/validate.coffee")},t.data={bestRegress:e("./data/bestRegress.coffee"),lof:e("./data/lof.coffee"),mad:e("./data/mad.coffee")},t.font={sizes:e("./font/sizes.coffee"),validate:e("./font/validate.coffee")},t.form=e("./form/form.js"),t.geom={largestRect:e("./geom/largestRect.coffee"),offset:e("./geom/offset.coffee"),path2poly:e("./geom/path2poly.coffee")},t.network={cluster:e("./network/cluster.coffee"),distances:e("./network/distances.coffee"),normalize:e("./network/normalize.coffee"),shortestPath:e("./network/shortestPath.coffee"),subgraph:e("./network/subgraph.coffee")},t.number={format:e("./number/format.js")},t.object={merge:e("./object/merge.coffee"),validate:e("./object/validate.coffee")},t.string={format:e("./string/format.js"),list:e("./string/list.coffee"),strip:e("./string/strip.js"),title:e("./string/title.coffee")},t.textwrap=e("./textwrap/textwrap.coffee"),t.tooltip={create:e("./tooltip/create.js"),move:e("./tooltip/move.coffee"),remove:e("./tooltip/remove.coffee")},t.util={buckets:e("./util/buckets.coffee"),child:e("./util/child.coffee"),closest:e("./util/closest.coffee"),copy:e("./util/copy.coffee"),d3selection:e("./util/d3selection.coffee"),dataurl:e("./util/dataURL.coffee"),uniques:e("./util/uniques.coffee")},t.viz=e("./viz/viz.coffee"),n=e("./client/css.coffee"),r=e("./core/console/print.coffee"),n("d3plus.css")&&r.warning("d3plus.css has been deprecated, you do not need to load this file.",t.repo+"releases/tag/v1.4.0")},{"./array/comparator.coffee":35,"./array/contains.coffee":36,"./array/sort.coffee":37,"./array/update.coffee":38,"./client/css.coffee":39,"./client/ie.js":40,"./client/pointer.coffee":41,"./client/prefix.coffee":42,"./client/rtl.coffee":43,"./client/scrollbar.coffee":44,"./client/touch.coffee":45,"./color/legible.coffee":46,"./color/lighter.coffee":47,"./color/mix.coffee":48,"./color/random.coffee":49,"./color/scale.coffee":50,"./color/sort.coffee":51,"./color/text.coffee":52,"./color/validate.coffee":53,"./core/console/print.coffee":54,"./data/bestRegress.coffee":92,"./data/lof.coffee":93,"./data/mad.coffee":94,"./font/sizes.coffee":95,"./font/validate.coffee":96,"./form/form.js":97,"./geom/largestRect.coffee":152,"./geom/offset.coffee":153,"./geom/path2poly.coffee":154,"./network/cluster.coffee":155,"./network/distances.coffee":156,"./network/normalize.coffee":157,"./network/shortestPath.coffee":158,"./network/subgraph.coffee":159,"./number/format.js":160,"./object/merge.coffee":161,"./object/validate.coffee":162,"./string/format.js":163,"./string/list.coffee":164,"./string/strip.js":165,"./string/title.coffee":166,"./textwrap/textwrap.coffee":184,"./tooltip/create.js":185,"./tooltip/move.coffee":186,"./tooltip/remove.coffee":187,"./util/buckets.coffee":188,"./util/child.coffee":189,"./util/closest.coffee":190,"./util/copy.coffee":191,"./util/d3selection.coffee":192,"./util/dataURL.coffee":193,"./util/uniques.coffee":194,"./viz/viz.coffee":307}],2:[function(e,t,r){function n(e,t,r){if(!(this instanceof n))return new n(e,t,r);var a,o=typeof e;if("number"===o)a=e>0?e>>>0:0;else if("string"===o)"base64"===t&&(e=k(e)),a=n.byteLength(e,t);else{if("object"!==o||null===e)throw new TypeError("must start with number, buffer, array or string");"Buffer"===e.type&&P(e.data)&&(e=e.data),a=+e.length>0?Math.floor(+e.length):0}if(this.length>q)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+q.toString(16)+" bytes");var i;n.TYPED_ARRAY_SUPPORT?i=n._augment(new Uint8Array(a)):(i=this,i.length=a,i._isBuffer=!0);var s;if(n.TYPED_ARRAY_SUPPORT&&"number"==typeof e.byteLength)i._set(e);else if(j(e))if(n.isBuffer(e))for(s=0;a>s;s++)i[s]=e.readUInt8(s);else for(s=0;a>s;s++)i[s]=(e[s]%256+256)%256;else if("string"===o)i.write(e,0,t);else if("number"===o&&!n.TYPED_ARRAY_SUPPORT&&!r)for(s=0;a>s;s++)i[s]=0;return i}function a(e,t,r,n){r=Number(r)||0;var a=e.length-r;n?(n=Number(n),n>a&&(n=a)):n=a;var o=t.length;if(o%2!==0)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var i=0;n>i;i++){var s=parseInt(t.substr(2*i,2),16);if(isNaN(s))throw new Error("Invalid hex string");e[r+i]=s}return i}function o(e,t,r,n){var a=O(M(t),e,r,n);return a}function i(e,t,r,n){var a=O(E(t),e,r,n);return a}function s(e,t,r,n){return i(e,t,r,n)}function l(e,t,r,n){var a=O(T(t),e,r,n);return a}function u(e,t,r,n){var a=O(S(t),e,r,n);return a}function c(e,t,r){return F.fromByteArray(0===t&&r===e.length?e:e.slice(t,r))}function f(e,t,r){var n="",a="";r=Math.min(e.length,r);for(var o=t;r>o;o++)e[o]<=127?(n+=N(a)+String.fromCharCode(e[o]),a=""):a+="%"+e[o].toString(16);return n+N(a)}function d(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;r>a;a++)n+=String.fromCharCode(e[a]);return n}function p(e,t,r){return d(e,t,r)}function h(e,t,r){var n=e.length;(!t||0>t)&&(t=0),(!r||0>r||r>n)&&(r=n);for(var a="",o=t;r>o;o++)a+=A(e[o]);return a}function v(e,t,r){for(var n=e.slice(t,r),a="",o=0;o<n.length;o+=2)a+=String.fromCharCode(n[o]+256*n[o+1]);return a}function g(e,t,r){if(e%1!==0||0>e)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function m(e,t,r,a,o,i){if(!n.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>o||i>t)throw new TypeError("value is out of bounds");if(r+a>e.length)throw new TypeError("index out of range")}function y(e,t,r,n){0>t&&(t=65535+t+1);for(var a=0,o=Math.min(e.length-r,2);o>a;a++)e[r+a]=(t&255<<8*(n?a:1-a))>>>8*(n?a:1-a)}function x(e,t,r,n){0>t&&(t=4294967295+t+1);for(var a=0,o=Math.min(e.length-r,4);o>a;a++)e[r+a]=t>>>8*(n?a:3-a)&255}function b(e,t,r,n,a,o){if(t>a||o>t)throw new TypeError("value is out of bounds");if(r+n>e.length)throw new TypeError("index out of range")}function w(e,t,r,n,a){return a||b(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),B.write(e,t,r,n,23,4),r+4}function _(e,t,r,n,a){return a||b(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),B.write(e,t,r,n,52,8),r+8}function k(e){for(e=z(e).replace(R,"");e.length%4!==0;)e+="=";return e}function z(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function j(e){return P(e)||n.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function A(e){return 16>e?"0"+e.toString(16):e.toString(16)}function M(e){for(var t=[],r=0;r<e.length;r++){var n=e.charCodeAt(r);if(127>=n)t.push(n);else{var a=r;n>=55296&&57343>=n&&r++;for(var o=encodeURIComponent(e.slice(a,r+1)).substr(1).split("%"),i=0;i<o.length;i++)t.push(parseInt(o[i],16))}}return t}function E(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t}function S(e){for(var t,r,n,a=[],o=0;o<e.length;o++)t=e.charCodeAt(o),r=t>>8,n=t%256,a.push(n),a.push(r);return a}function T(e){return F.toByteArray(e)}function O(e,t,r,n){for(var a=0;n>a&&!(a+r>=t.length||a>=e.length);a++)t[a+r]=e[a];return a}function N(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}var F=e("base64-js"),B=e("ieee754"),P=e("is-array");r.Buffer=n,r.SlowBuffer=n,r.INSPECT_MAX_BYTES=50,n.poolSize=8192;var q=1073741823;n.TYPED_ARRAY_SUPPORT=function(){try{var e=new ArrayBuffer(0),t=new Uint8Array(e);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray&&0===new Uint8Array(1).subarray(1,1).byteLength}catch(r){return!1}}(),n.isBuffer=function(e){return!(null==e||!e._isBuffer)},n.compare=function(e,t){if(!n.isBuffer(e)||!n.isBuffer(t))throw new TypeError("Arguments must be Buffers");for(var r=e.length,a=t.length,o=0,i=Math.min(r,a);i>o&&e[o]===t[o];o++);return o!==i&&(r=e[o],a=t[o]),a>r?-1:r>a?1:0},n.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},n.concat=function(e,t){if(!P(e))throw new TypeError("Usage: Buffer.concat(list[, length])");if(0===e.length)return new n(0);if(1===e.length)return e[0];var r;if(void 0===t)for(t=0,r=0;r<e.length;r++)t+=e[r].length;var a=new n(t),o=0;for(r=0;r<e.length;r++){var i=e[r];i.copy(a,o),o+=i.length}return a},n.byteLength=function(e,t){var r;switch(e+="",t||"utf8"){case"ascii":case"binary":case"raw":r=e.length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=2*e.length;break;case"hex":r=e.length>>>1;break;case"utf8":case"utf-8":r=M(e).length;break;case"base64":r=T(e).length;break;default:r=e.length}return r},n.prototype.length=void 0,n.prototype.parent=void 0,n.prototype.toString=function(e,t,r){var n=!1;if(t>>>=0,r=void 0===r||1/0===r?this.length:r>>>0,e||(e="utf8"),0>t&&(t=0),r>this.length&&(r=this.length),t>=r)return"";for(;;)switch(e){case"hex":return h(this,t,r);case"utf8":case"utf-8":return f(this,t,r);case"ascii":return d(this,t,r);case"binary":return p(this,t,r);case"base64":return c(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}},n.prototype.equals=function(e){if(!n.isBuffer(e))throw new TypeError("Argument must be a Buffer");return 0===n.compare(this,e)},n.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},n.prototype.compare=function(e){if(!n.isBuffer(e))throw new TypeError("Argument must be a Buffer");return n.compare(this,e)},n.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},n.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},n.prototype.write=function(e,t,r,n){if(isFinite(t))isFinite(r)||(n=r,r=void 0);else{var c=n;n=t,t=r,r=c}t=Number(t)||0;var f=this.length-t;r?(r=Number(r),r>f&&(r=f)):r=f,n=String(n||"utf8").toLowerCase();var d;switch(n){case"hex":d=a(this,e,t,r);break;case"utf8":case"utf-8":d=o(this,e,t,r);break;case"ascii":d=i(this,e,t,r);break;case"binary":d=s(this,e,t,r);break;case"base64":d=l(this,e,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":d=u(this,e,t,r);break;default:throw new TypeError("Unknown encoding: "+n)}return d},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},n.prototype.slice=function(e,t){var r=this.length;if(e=~~e,t=void 0===t?r:~~t,0>e?(e+=r,0>e&&(e=0)):e>r&&(e=r),0>t?(t+=r,0>t&&(t=0)):t>r&&(t=r),e>t&&(t=e),n.TYPED_ARRAY_SUPPORT)return n._augment(this.subarray(e,t));for(var a=t-e,o=new n(a,void 0,!0),i=0;a>i;i++)o[i]=this[i+e];return o},n.prototype.readUInt8=function(e,t){return t||g(e,1,this.length),this[e]},n.prototype.readUInt16LE=function(e,t){return t||g(e,2,this.length),this[e]|this[e+1]<<8},n.prototype.readUInt16BE=function(e,t){return t||g(e,2,this.length),this[e]<<8|this[e+1]},n.prototype.readUInt32LE=function(e,t){return t||g(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},n.prototype.readUInt32BE=function(e,t){return t||g(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},n.prototype.readInt8=function(e,t){return t||g(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},n.prototype.readInt16LE=function(e,t){t||g(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},n.prototype.readInt16BE=function(e,t){t||g(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},n.prototype.readInt32LE=function(e,t){return t||g(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},n.prototype.readInt32BE=function(e,t){return t||g(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},n.prototype.readFloatLE=function(e,t){return t||g(e,4,this.length),B.read(this,e,!0,23,4)},n.prototype.readFloatBE=function(e,t){return t||g(e,4,this.length),B.read(this,e,!1,23,4)},n.prototype.readDoubleLE=function(e,t){return t||g(e,8,this.length),B.read(this,e,!0,52,8)},n.prototype.readDoubleBE=function(e,t){return t||g(e,8,this.length),B.read(this,e,!1,52,8)},n.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,1,255,0),n.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e,t+1},n.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,2,65535,0),n.TYPED_ARRAY_SUPPORT?(this[t]=e,this[t+1]=e>>>8):y(this,e,t,!0),t+2},n.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,2,65535,0),n.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e):y(this,e,t,!1),t+2},n.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,4,4294967295,0),n.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e):x(this,e,t,!0),t+4},n.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,4,4294967295,0),n.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e):x(this,e,t,!1),t+4},n.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,1,127,-128),n.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[t]=e,t+1},n.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,2,32767,-32768),n.TYPED_ARRAY_SUPPORT?(this[t]=e,this[t+1]=e>>>8):y(this,e,t,!0),t+2},n.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,2,32767,-32768),n.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e):y(this,e,t,!1),t+2},n.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,4,2147483647,-2147483648),n.TYPED_ARRAY_SUPPORT?(this[t]=e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):x(this,e,t,!0),t+4},n.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),n.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e):x(this,e,t,!1),t+4},n.prototype.writeFloatLE=function(e,t,r){return w(this,e,t,!0,r)},n.prototype.writeFloatBE=function(e,t,r){return w(this,e,t,!1,r)},n.prototype.writeDoubleLE=function(e,t,r){return _(this,e,t,!0,r)},n.prototype.writeDoubleBE=function(e,t,r){return _(this,e,t,!1,r)},n.prototype.copy=function(e,t,r,a){var o=this;if(r||(r=0),a||0===a||(a=this.length),t||(t=0),a!==r&&0!==e.length&&0!==o.length){if(r>a)throw new TypeError("sourceEnd < sourceStart");if(0>t||t>=e.length)throw new TypeError("targetStart out of bounds");if(0>r||r>=o.length)throw new TypeError("sourceStart out of bounds");if(0>a||a>o.length)throw new TypeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t<a-r&&(a=e.length-t+r);var i=a-r;if(100>i||!n.TYPED_ARRAY_SUPPORT)for(var s=0;i>s;s++)e[s+t]=this[s+r];else e._set(this.subarray(r,r+i),t)}},n.prototype.fill=function(e,t,r){if(e||(e=0),t||(t=0),r||(r=this.length),t>r)throw new TypeError("end < start");if(r!==t&&0!==this.length){if(0>t||t>=this.length)throw new TypeError("start out of bounds");if(0>r||r>this.length)throw new TypeError("end out of bounds");var n;if("number"==typeof e)for(n=t;r>n;n++)this[n]=e;else{var a=M(e.toString()),o=a.length;for(n=t;r>n;n++)this[n]=a[n%o]}return this}},n.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(n.TYPED_ARRAY_SUPPORT)return new n(this).buffer;for(var e=new Uint8Array(this.length),t=0,r=e.length;r>t;t+=1)e[t]=this[t];return e.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var I=n.prototype;n._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=I.get,e.set=I.set,e.write=I.write,e.toString=I.toString,e.toLocaleString=I.toString,e.toJSON=I.toJSON,e.equals=I.equals,e.compare=I.compare,e.copy=I.copy,e.slice=I.slice,e.readUInt8=I.readUInt8,e.readUInt16LE=I.readUInt16LE,e.readUInt16BE=I.readUInt16BE,e.readUInt32LE=I.readUInt32LE,e.readUInt32BE=I.readUInt32BE,e.readInt8=I.readInt8,e.readInt16LE=I.readInt16LE,e.readInt16BE=I.readInt16BE,e.readInt32LE=I.readInt32LE,e.readInt32BE=I.readInt32BE,e.readFloatLE=I.readFloatLE,e.readFloatBE=I.readFloatBE,e.readDoubleLE=I.readDoubleLE,e.readDoubleBE=I.readDoubleBE,e.writeUInt8=I.writeUInt8,e.writeUInt16LE=I.writeUInt16LE,e.writeUInt16BE=I.writeUInt16BE,e.writeUInt32LE=I.writeUInt32LE,e.writeUInt32BE=I.writeUInt32BE,e.writeInt8=I.writeInt8,e.writeInt16LE=I.writeInt16LE,e.writeInt16BE=I.writeInt16BE,e.writeInt32LE=I.writeInt32LE,e.writeInt32BE=I.writeInt32BE,e.writeFloatLE=I.writeFloatLE,e.writeFloatBE=I.writeFloatBE,e.writeDoubleLE=I.writeDoubleLE,e.writeDoubleBE=I.writeDoubleBE,e.fill=I.fill,e.inspect=I.inspect,e.toArrayBuffer=I.toArrayBuffer,e};var R=/[^+\/0-9A-z]/g},{"base64-js":3,ieee754:4,"is-array":5}],3:[function(e,t,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(e){"use strict";function t(e){var t=e.charCodeAt(0);return t===i?62:t===s?63:l>t?-1:l+10>t?t-l+26+26:c+26>t?t-c:u+26>t?t-u+26:void 0}function r(e){function r(e){u[f++]=e}var n,a,i,s,l,u;if(e.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=e.length;l="="===e.charAt(c-2)?2:"="===e.charAt(c-1)?1:0,u=new o(3*e.length/4-l),i=l>0?e.length-4:e.length;var f=0;for(n=0,a=0;i>n;n+=4,a+=3)s=t(e.charAt(n))<<18|t(e.charAt(n+1))<<12|t(e.charAt(n+2))<<6|t(e.charAt(n+3)),r((16711680&s)>>16),r((65280&s)>>8),r(255&s);return 2===l?(s=t(e.charAt(n))<<2|t(e.charAt(n+1))>>4,r(255&s)):1===l&&(s=t(e.charAt(n))<<10|t(e.charAt(n+1))<<4|t(e.charAt(n+2))>>2,r(s>>8&255),r(255&s)),u}function a(e){function t(e){return n.charAt(e)}function r(e){return t(e>>18&63)+t(e>>12&63)+t(e>>6&63)+t(63&e)}var a,o,i,s=e.length%3,l="";for(a=0,i=e.length-s;i>a;a+=3)o=(e[a]<<16)+(e[a+1]<<8)+e[a+2],l+=r(o);switch(s){case 1:o=e[e.length-1],l+=t(o>>2),l+=t(o<<4&63),l+="==";break;case 2:o=(e[e.length-2]<<8)+e[e.length-1],l+=t(o>>10),l+=t(o>>4&63),l+=t(o<<2&63),l+="="}return l}var o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="+".charCodeAt(0),s="/".charCodeAt(0),l="0".charCodeAt(0),u="a".charCodeAt(0),c="A".charCodeAt(0);e.toByteArray=r,e.fromByteArray=a}("undefined"==typeof r?this.base64js={}:r)},{}],4:[function(e,t,r){r.read=function(e,t,r,n,a){var o,i,s=8*a-n-1,l=(1<<s)-1,u=l>>1,c=-7,f=r?a-1:0,d=r?-1:1,p=e[t+f];for(f+=d,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+e[t+f],f+=d,c-=8);for(i=o&(1<<-c)-1,o>>=-c,c+=n;c>0;i=256*i+e[t+f],f+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return i?0/0:1/0*(p?-1:1);i+=Math.pow(2,n),o-=u}return(p?-1:1)*i*Math.pow(2,o-n)},r.write=function(e,t,r,n,a,o){var i,s,l,u=8*o-a-1,c=(1<<u)-1,f=c>>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,h=n?1:-1,v=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(s=isNaN(t)?1:0,i=c):(i=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-i))<1&&(i--,l*=2),t+=i+f>=1?d/l:d*Math.pow(2,1-f),t*l>=2&&(i++,l/=2),i+f>=c?(s=0,i=c):i+f>=1?(s=(t*l-1)*Math.pow(2,a),i+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,a),i=0));a>=8;e[r+p]=255&s,p+=h,s/=256,a-=8);for(i=i<<a|s,u+=a;u>0;e[r+p]=255&i,p+=h,i/=256,u-=8);e[r+p-h]|=128*v}},{}],5:[function(e,t){var r=Array.isArray,n=Object.prototype.toString;t.exports=r||function(e){return!!e&&"[object Array]"==n.call(e)}},{}],6:[function(e,t){t.exports=e("./lib/heap")},{"./lib/heap":7}],7:[function(e,t){(function(){var e,r,n,a,o,i,s,l,u,c,f,d,p,h,v;n=Math.floor,c=Math.min,r=function(e,t){return t>e?-1:e>t?1:0},u=function(e,t,a,o,i){var s;if(null==a&&(a=0),null==i&&(i=r),0>a)throw new Error("lo must be non-negative");for(null==o&&(o=e.length);o>a;)s=n((a+o)/2),i(t,e[s])<0?o=s:a=s+1;return[].splice.apply(e,[a,a-a].concat(t)),t},i=function(e,t,n){return null==n&&(n=r),e.push(t),h(e,0,e.length-1,n)},o=function(e,t){var n,a;return null==t&&(t=r),n=e.pop(),e.length?(a=e[0],e[0]=n,v(e,0,t)):a=n,a},l=function(e,t,n){var a;return null==n&&(n=r),a=e[0],e[0]=t,v(e,0,n),a},s=function(e,t,n){var a;return null==n&&(n=r),e.length&&n(e[0],t)<0&&(a=[e[0],t],t=a[0],e[0]=a[1],v(e,0,n)),t},a=function(e,t){var a,o,i,s,l,u;for(null==t&&(t=r),s=function(){u=[];for(var t=0,r=n(e.length/2);r>=0?r>t:t>r;r>=0?t++:t--)u.push(t);return u}.apply(this).reverse(),l=[],o=0,i=s.length;i>o;o++)a=s[o],l.push(v(e,a,t));return l},p=function(e,t,n){var a;return null==n&&(n=r),a=e.indexOf(t),-1!==a?(h(e,0,a,n),v(e,a,n)):void 0},f=function(e,t,n){var o,i,l,u,c;if(null==n&&(n=r),i=e.slice(0,t),!i.length)return i;for(a(i,n),c=e.slice(t),l=0,u=c.length;u>l;l++)o=c[l],s(i,o,n);return i.sort(n).reverse()},d=function(e,t,n){var i,s,l,f,d,p,h,v,g,m;if(null==n&&(n=r),10*t<=e.length){if(f=e.slice(0,t).sort(n),!f.length)return f;for(l=f[f.length-1],v=e.slice(t),d=0,h=v.length;h>d;d++)i=v[d],n(i,l)<0&&(u(f,i,0,null,n),f.pop(),l=f[f.length-1]);return f}for(a(e,n),m=[],s=p=0,g=c(t,e.length);g>=0?g>p:p>g;s=g>=0?++p:--p)m.push(o(e,n));return m},h=function(e,t,n,a){var o,i,s;for(null==a&&(a=r),o=e[n];n>t&&(s=n-1>>1,i=e[s],a(o,i)<0);)e[n]=i,n=s;return e[n]=o},v=function(e,t,n){var a,o,i,s,l;for(null==n&&(n=r),o=e.length,l=t,i=e[t],a=2*t+1;o>a;)s=a+1,o>s&&!(n(e[a],e[s])<0)&&(a=s),e[t]=e[a],t=a,a=2*t+1;return e[t]=i,h(e,l,t,n)},e=function(){function e(e){this.cmp=null!=e?e:r,this.nodes=[]}return e.push=i,e.pop=o,e.replace=l,e.pushpop=s,e.heapify=a,e.updateItem=p,e.nlargest=f,e.nsmallest=d,e.prototype.push=function(e){return i(this.nodes,e,this.cmp)},e.prototype.pop=function(){return o(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return-1!==this.nodes.indexOf(e)},e.prototype.replace=function(e){return l(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return s(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return a(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return p(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return 0===this.nodes.length},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t;return t=new e,t.nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.prototype.top=e.prototype.peek,e.prototype.front=e.prototype.peek,e.prototype.has=e.prototype.contains,e.prototype.copy=e.prototype.clone,e}(),("undefined"!=typeof t&&null!==t?t.exports:void 0)?t.exports=e:window.Heap=e}).call(this)},{}],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 r,n,a,o;for("undefined"==typeof t&&(t=15),a=.5,r=new Date;;){for(a*=2,o=a;o>3;o-=4)e(),e(),e(),e();for(;o>0;)e(),o--;if(n=new Date,n-r>t)break}for(o=a;o>3;o-=4)e(),e(),e(),e();for(;o>0;)e(),o--;return n=new Date,1e3*(3*a-1)/(n-r)},numeric._myIndexOf=function(e){var t,r=this.length;for(t=0;r>t;++t)if(this[t]===e)return t;return-1},numeric.myIndexOf=Array.prototype.indexOf?Array.prototype.indexOf:numeric._myIndexOf,numeric.Function=Function,numeric.precision=4,numeric.largeArray=50,numeric.prettyPrint=function(e){function t(e){if(0===e)return"0";if(isNaN(e))return"NaN";if(0>e)return"-"+t(-e);if(isFinite(e)){var r=Math.floor(Math.log(e)/Math.log(10)),n=e/Math.pow(10,r),a=n.toPrecision(numeric.precision);return 10===parseFloat(a)&&(r++,n=1,a=n.toPrecision(numeric.precision)),parseFloat(a).toString()+"e"+r.toString()}return"Infinity"}function r(e){var a;if("undefined"==typeof e)return n.push(Array(numeric.precision+8).join(" ")),!1;if("string"==typeof e)return n.push('"'+e+'"'),!1;if("boolean"==typeof e)return n.push(e.toString()),!1;if("number"==typeof e){var o=t(e),i=e.toPrecision(numeric.precision),s=parseFloat(e.toString()).toString(),l=[o,i,s,parseFloat(i).toString(),parseFloat(s).toString()];for(a=1;a<l.length;a++)l[a].length<o.length&&(o=l[a]);return n.push(Array(numeric.precision+8-o.length).join(" ")+o),!1}if(null===e)return n.push("null"),!1;if("function"==typeof e){n.push(e.toString());var u=!1;for(a in e)e.hasOwnProperty(a)&&(n.push(u?",\n":"\n{"),u=!0,n.push(a),n.push(": \n"),r(e[a]));return u&&n.push("}\n"),!0}if(e instanceof Array){if(e.length>numeric.largeArray)return n.push("...Large Array..."),!0;var u=!1;for(n.push("["),a=0;a<e.length;a++)a>0&&(n.push(","),u&&n.push("\n ")),u=r(e[a]);return n.push("]"),!0}n.push("{");var u=!1;for(a in e)e.hasOwnProperty(a)&&(u&&n.push(",\n"),u=!0,n.push(a),n.push(": \n"),r(e[a]));return n.push("}"),!0}var n=[];return r(e),n.join("")},numeric.parseDate=function(e){function t(e){if("string"==typeof e)return Date.parse(e.replace(/-/g,"/"));if(!(e instanceof Array))throw new Error("parseDate: parameter must be arrays of strings");var r,n=[];for(r=0;r<e.length;r++)n[r]=t(e[r]);return n}return t(e)},numeric.parseFloat=function(e){function t(e){if("string"==typeof e)return parseFloat(e);if(!(e instanceof Array))throw new Error("parseFloat: parameter must be arrays of strings");var r,n=[];for(r=0;r<e.length;r++)n[r]=t(e[r]);return n}return t(e)},numeric.parseCSV=function(e){var t,r,n=e.split("\n"),a=[],o=/(([^'",]*)|('[^']*')|("[^"]*")),/g,i=/^\s*(([+-]?[0-9]+(\.[0-9]*)?(e[+-]?[0-9]+)?)|([+-]?[0-9]*(\.[0-9]+)?(e[+-]?[0-9]+)?))\s*$/,s=function(e){return e.substr(0,e.length-1)},l=0;for(r=0;r<n.length;r++){var u,c=(n[r]+",").match(o);if(c.length>0){for(a[l]=[],t=0;t<c.length;t++)u=s(c[t]),a[l][t]=i.test(u)?parseFloat(u):u;l++}}return a},numeric.toCSV=function(e){var t,r,n,a,o,i,s=numeric.dim(e);for(n=s[0],a=s[1],i=[],t=0;n>t;t++){for(o=[],r=0;n>r;r++)o[r]=e[t][r].toString();i[t]=o.join(", ")}return i.join("\n")+"\n"},numeric.getURL=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(),t},numeric.imageURL=function(e){function t(e){var t,r,n,a,o,i,s,l,u=e.length,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f="";for(t=0;u>t;t+=3)r=e[t],n=e[t+1],a=e[t+2],o=r>>2,i=((3&r)<<4)+(n>>4),s=((15&n)<<2)+(a>>6),l=63&a,t+1>=u?s=l=64:t+2>=u&&(l=64),f+=c.charAt(o)+c.charAt(i)+c.charAt(s)+c.charAt(l);return f}function r(e,t,r){"undefined"==typeof t&&(t=0),"undefined"==typeof r&&(r=e.length);{var n,a=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],o=-1,i=0;e.length}for(n=t;r>n;n++)i=255&(o^e[n]),o=o>>>8^a[i];return-1^o}var n,a,o,i,s,l,u,c,f,d,p=e[0].length,h=e[0][0].length,v=[137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,h>>24&255,h>>16&255,h>>8&255,255&h,p>>24&255,p>>16&255,p>>8&255,255&p,8,2,0,0,0,-1,-2,-3,-4,-5,-6,-7,-8,73,68,65,84,8,29];for(d=r(v,12,29),v[29]=d>>24&255,v[30]=d>>16&255,v[31]=d>>8&255,v[32]=255&d,n=1,a=0,u=0;p>u;u++){for(v.push(p-1>u?0:1),s=3*h+1+(0===u)&255,l=3*h+1+(0===u)>>8&255,v.push(s),v.push(l),v.push(255&~s),v.push(255&~l),0===u&&v.push(0),c=0;h>c;c++)for(o=0;3>o;o++)s=e[o][u][c],s=s>255?255:0>s?0:Math.round(s),n=(n+s)%65521,a=(a+n)%65521,v.push(s);v.push(0)}return f=(a<<16)+n,v.push(f>>24&255),v.push(f>>16&255),v.push(f>>8&255),v.push(255&f),i=v.length-41,v[33]=i>>24&255,v[34]=i>>16&255,v[35]=i>>8&255,v[36]=255&i,d=r(v,37),v.push(d>>24&255),v.push(d>>16&255),v.push(d>>8&255),v.push(255&d),v.push(0),v.push(0),v.push(0),v.push(0),v.push(73),v.push(69),v.push(78),v.push(68),v.push(174),v.push(66),v.push(96),v.push(130),"data:image/png;base64,"+t(v)},numeric._dim=function(e){for(var t=[];"object"==typeof e;)t.push(e.length),e=e[0];return t},numeric.dim=function(e){var t,r;return"object"==typeof e?(t=e[0],"object"==typeof t?(r=t[0],"object"==typeof r?numeric._dim(e):[e.length,t.length]):[e.length]):[]},numeric.mapreduce=function(e,t){return Function("x","accum","_s","_k",'if(typeof accum === "undefined") accum = '+t+';\nif(typeof x === "number") { var xi = x; '+e+'; return accum; }\nif(typeof _s === "undefined") _s = numeric.dim(x);\nif(typeof _k === "undefined") _k = 0;\nvar _n = _s[_k];\nvar i,xi;\nif(_k < _s.length-1) {\n for(i=_n-1;i>=0;i--) {\n accum = arguments.callee(x[i],accum,_s,_k+1);\n } return accum;\n}\nfor(i=_n-1;i>=1;i-=2) { \n xi = x[i];\n '+e+";\n xi = x[i-1];\n "+e+";\n}\nif(i === 0) {\n xi = x[i];\n "+e+"\n}\nreturn accum;")},numeric.mapreduce2=function(e,t){return Function("x","var n = x.length;\nvar i,xi;\n"+t+";\nfor(i=n-1;i!==-1;--i) { \n xi = x[i];\n "+e+";\n}\nreturn accum;")},numeric.same=function e(t,r){var n,a;if(!(t instanceof Array&&r instanceof Array))return!1;if(a=t.length,a!==r.length)return!1;for(n=0;a>n;n++)if(t[n]!==r[n]){if("object"!=typeof t[n])return!1;
if(!e(t[n],r[n]))return!1}return!0},numeric.rep=function(e,t,r){"undefined"==typeof r&&(r=0);var n,a=e[r],o=Array(a);if(r===e.length-1){for(n=a-2;n>=0;n-=2)o[n+1]=t,o[n]=t;return-1===n&&(o[0]=t),o}for(n=a-1;n>=0;n--)o[n]=numeric.rep(e,t,r+1);return o},numeric.dotMMsmall=function(e,t){var r,n,a,o,i,s,l,u,c,f,d;for(o=e.length,i=t.length,s=t[0].length,l=Array(o),r=o-1;r>=0;r--){for(u=Array(s),c=e[r],a=s-1;a>=0;a--){for(f=c[i-1]*t[i-1][a],n=i-2;n>=1;n-=2)d=n-1,f+=c[n]*t[n][a]+c[d]*t[d][a];0===n&&(f+=c[0]*t[0][a]),u[a]=f}l[r]=u}return l},numeric._getCol=function(e,t,r){var n,a=e.length;for(n=a-1;n>0;--n)r[n]=e[n][t],--n,r[n]=e[n][t];0===n&&(r[0]=e[0][t])},numeric.dotMMbig=function(e,t){var r,n,a,o,i=numeric._getCol,s=t.length,l=Array(s),u=e.length,c=t[0].length,f=new Array(u),d=numeric.dotVV;for(--s,--u,n=u;-1!==n;--n)f[n]=Array(c);for(--c,n=c;-1!==n;--n)for(i(t,n,l),a=u;-1!==a;--a)o=0,r=e[a],f[a][n]=d(r,l);return f},numeric.dotMV=function(e,t){var r,n=e.length,a=(t.length,Array(n)),o=numeric.dotVV;for(r=n-1;r>=0;r--)a[r]=o(e[r],t);return a},numeric.dotVM=function(e,t){var r,n,a,o,i,s,l;for(a=e.length,o=t[0].length,i=Array(o),n=o-1;n>=0;n--){for(s=e[a-1]*t[a-1][n],r=a-2;r>=1;r-=2)l=r-1,s+=e[r]*t[r][n]+e[l]*t[l][n];0===r&&(s+=e[0]*t[0][n]),i[n]=s}return i},numeric.dotVV=function(e,t){var r,n,a=e.length,o=e[a-1]*t[a-1];for(r=a-2;r>=1;r-=2)n=r-1,o+=e[r]*t[r]+e[n]*t[n];return 0===r&&(o+=e[0]*t[0]),o},numeric.dot=function(e,t){var r=numeric.dim;switch(1e3*r(e).length+r(t).length){case 2002:return t.length<10?numeric.dotMMsmall(e,t):numeric.dotMMbig(e,t);case 2001:return numeric.dotMV(e,t);case 1002:return numeric.dotVM(e,t);case 1001:return numeric.dotVV(e,t);case 1e3:return numeric.mulVS(e,t);case 1:return numeric.mulSV(e,t);case 0:return e*t;default:throw new Error("numeric.dot only works on vectors and matrices")}},numeric.diag=function(e){var t,r,n,a,o=e.length,i=Array(o);for(t=o-1;t>=0;t--){for(a=Array(o),r=t+2,n=o-1;n>=r;n-=2)a[n]=0,a[n-1]=0;for(n>t&&(a[n]=0),a[t]=e[t],n=t-1;n>=1;n-=2)a[n]=0,a[n-1]=0;0===n&&(a[0]=0),i[t]=a}return i},numeric.getDiag=function(e){var t,r=Math.min(e.length,e[0].length),n=Array(r);for(t=r-1;t>=1;--t)n[t]=e[t][t],--t,n[t]=e[t][t];return 0===t&&(n[0]=e[0][0]),n},numeric.identity=function(e){return numeric.diag(numeric.rep([e],1))},numeric.pointwise=function(e,t,r){"undefined"==typeof r&&(r="");var n,a,o=[],i=/\[i\]$/,s="",l=!1;for(n=0;n<e.length;n++)i.test(e[n])?(a=e[n].substring(0,e[n].length-3),s=a):a=e[n],"ret"===a&&(l=!0),o.push(a);return o[e.length]="_s",o[e.length+1]="_k",o[e.length+2]='if(typeof _s === "undefined") _s = numeric.dim('+s+');\nif(typeof _k === "undefined") _k = 0;\nvar _n = _s[_k];\nvar i'+(l?"":", ret = Array(_n)")+";\nif(_k < _s.length-1) {\n for(i=_n-1;i>=0;i--) ret[i] = arguments.callee("+e.join(",")+",_s,_k+1);\n return ret;\n}\n"+r+"\nfor(i=_n-1;i!==-1;--i) {\n "+t+"\n}\nreturn ret;",Function.apply(null,o)},numeric.pointwise2=function(e,t,r){"undefined"==typeof r&&(r="");var n,a,o=[],i=/\[i\]$/,s="",l=!1;for(n=0;n<e.length;n++)i.test(e[n])?(a=e[n].substring(0,e[n].length-3),s=a):a=e[n],"ret"===a&&(l=!0),o.push(a);return o[e.length]="var _n = "+s+".length;\nvar i"+(l?"":", ret = Array(_n)")+";\n"+r+"\nfor(i=_n-1;i!==-1;--i) {\n"+t+"\n}\nreturn ret;",Function.apply(null,o)},numeric._biforeach=function t(e,r,n,a,o){if(a===n.length-1)return void o(e,r);var i,s=n[a];for(i=s-1;i>=0;i--)t("object"==typeof e?e[i]:e,"object"==typeof r?r[i]:r,n,a+1,o)},numeric._biforeach2=function r(e,t,n,a,o){if(a===n.length-1)return o(e,t);var i,s=n[a],l=Array(s);for(i=s-1;i>=0;--i)l[i]=r("object"==typeof e?e[i]:e,"object"==typeof t?t[i]:t,n,a+1,o);return l},numeric._foreach=function n(e,t,r,a){if(r===t.length-1)return void a(e);var o,i=t[r];for(o=i-1;o>=0;o--)n(e[o],t,r+1,a)},numeric._foreach2=function a(e,t,r,n){if(r===t.length-1)return n(e);var o,i=t[r],s=Array(i);for(o=i-1;o>=0;o--)s[o]=a(e[o],t,r+1,n);return s},numeric.ops2={add:"+",sub:"-",mul:"*",div:"/",mod:"%",and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">=",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"},numeric.opseq={addeq:"+=",subeq:"-=",muleq:"*=",diveq:"/=",modeq:"%=",lshifteq:"<<=",rshifteq:">>=",rrshifteq:">>>=",bandeq:"&=",boreq:"|=",bxoreq:"^="},numeric.mathfuns=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan","isNaN","isFinite"],numeric.mathfuns2=["atan2","pow","max","min"],numeric.ops1={neg:"-",not:"!",bnot:"~",clone:""},numeric.mapreducers={any:["if(xi) return true;","var accum = false;"],all:["if(!xi) return false;","var accum = true;"],sum:["accum += xi;","var accum = 0;"],prod:["accum *= xi;","var accum = 1;"],norm2Squared:["accum += xi*xi;","var accum = 0;"],norminf:["accum = max(accum,abs(xi));","var accum = 0, max = Math.max, abs = Math.abs;"],norm1:["accum += abs(xi)","var accum = 0, abs = Math.abs;"],sup:["accum = max(accum,xi);","var accum = -Infinity, max = Math.max;"],inf:["accum = min(accum,xi);","var accum = Infinity, min = Math.min;"]},function(){var e,t;for(e=0;e<numeric.mathfuns2.length;++e)t=numeric.mathfuns2[e],numeric.ops2[t]=t;for(e in numeric.ops2)if(numeric.ops2.hasOwnProperty(e)){t=numeric.ops2[e];var r,n,a="";-1!==numeric.myIndexOf.call(numeric.mathfuns2,e)?(a="var "+t+" = Math."+t+";\n",r=function(e,r,n){return e+" = "+t+"("+r+","+n+")"},n=function(e,r){return e+" = "+t+"("+e+","+r+")"}):(r=function(e,r,n){return e+" = "+r+" "+t+" "+n},n=numeric.opseq.hasOwnProperty(e+"eq")?function(e,r){return e+" "+t+"= "+r}:function(e,r){return e+" = "+e+" "+t+" "+r}),numeric[e+"VV"]=numeric.pointwise2(["x[i]","y[i]"],r("ret[i]","x[i]","y[i]"),a),numeric[e+"SV"]=numeric.pointwise2(["x","y[i]"],r("ret[i]","x","y[i]"),a),numeric[e+"VS"]=numeric.pointwise2(["x[i]","y"],r("ret[i]","x[i]","y"),a),numeric[e]=Function("var n = arguments.length, i, x = arguments[0], y;\nvar VV = numeric."+e+"VV, VS = numeric."+e+"VS, SV = numeric."+e+'SV;\nvar dim = numeric.dim;\nfor(i=1;i!==n;++i) { \n y = arguments[i];\n if(typeof x === "object") {\n if(typeof y === "object") x = numeric._biforeach2(x,y,dim(x),0,VV);\n else x = numeric._biforeach2(x,y,dim(x),0,VS);\n } else if(typeof y === "object") x = numeric._biforeach2(x,y,dim(y),0,SV);\n else '+n("x","y")+"\n}\nreturn x;\n"),numeric[t]=numeric[e],numeric[e+"eqV"]=numeric.pointwise2(["ret[i]","x[i]"],n("ret[i]","x[i]"),a),numeric[e+"eqS"]=numeric.pointwise2(["ret[i]","x"],n("ret[i]","x"),a),numeric[e+"eq"]=Function("var n = arguments.length, i, x = arguments[0], y;\nvar V = numeric."+e+"eqV, S = numeric."+e+'eqS\nvar s = numeric.dim(x);\nfor(i=1;i!==n;++i) { \n y = arguments[i];\n if(typeof y === "object") numeric._biforeach(x,y,s,0,V);\n else numeric._biforeach(x,y,s,0,S);\n}\nreturn x;\n')}for(e=0;e<numeric.mathfuns2.length;++e)t=numeric.mathfuns2[e],delete numeric.ops2[t];for(e=0;e<numeric.mathfuns.length;++e)t=numeric.mathfuns[e],numeric.ops1[t]=t;for(e in numeric.ops1)numeric.ops1.hasOwnProperty(e)&&(a="",t=numeric.ops1[e],-1!==numeric.myIndexOf.call(numeric.mathfuns,e)&&Math.hasOwnProperty(t)&&(a="var "+t+" = Math."+t+";\n"),numeric[e+"eqV"]=numeric.pointwise2(["ret[i]"],"ret[i] = "+t+"(ret[i]);",a),numeric[e+"eq"]=Function("x",'if(typeof x !== "object") return '+t+"x\nvar i;\nvar V = numeric."+e+"eqV;\nvar s = numeric.dim(x);\nnumeric._foreach(x,s,0,V);\nreturn x;\n"),numeric[e+"V"]=numeric.pointwise2(["x[i]"],"ret[i] = "+t+"(x[i]);",a),numeric[e]=Function("x",'if(typeof x !== "object") return '+t+"(x)\nvar i;\nvar V = numeric."+e+"V;\nvar s = numeric.dim(x);\nreturn numeric._foreach2(x,s,0,V);\n"));for(e=0;e<numeric.mathfuns.length;++e)t=numeric.mathfuns[e],delete numeric.ops1[t];for(e in numeric.mapreducers)numeric.mapreducers.hasOwnProperty(e)&&(t=numeric.mapreducers[e],numeric[e+"V"]=numeric.mapreduce2(t[0],t[1]),numeric[e]=Function("x","s","k",t[1]+'if(typeof x !== "object") { xi = x;\n'+t[0]+';\n return accum;\n}if(typeof s === "undefined") s = numeric.dim(x);\nif(typeof k === "undefined") k = 0;\nif(k === s.length-1) return numeric.'+e+"V(x);\nvar xi;\nvar n = x.length, i;\nfor(i=n-1;i!==-1;--i) {\n xi = arguments.callee(x[i]);\n"+t[0]+";\n}\nreturn accum;\n"))}(),numeric.truncVV=numeric.pointwise(["x[i]","y[i]"],"ret[i] = round(x[i]/y[i])*y[i];","var round = Math.round;"),numeric.truncVS=numeric.pointwise(["x[i]","y"],"ret[i] = round(x[i]/y)*y;","var round = Math.round;"),numeric.truncSV=numeric.pointwise(["x","y[i]"],"ret[i] = round(x/y[i])*y[i];","var round = Math.round;"),numeric.trunc=function(e,t){return"object"==typeof e?"object"==typeof t?numeric.truncVV(e,t):numeric.truncVS(e,t):"object"==typeof t?numeric.truncSV(e,t):Math.round(e/t)*t},numeric.inv=function(e){var t,r,n,a,o,i,s,e,l=numeric.dim(e),u=Math.abs,c=l[0],f=l[1],d=numeric.clone(e),p=numeric.identity(c);for(i=0;f>i;++i){var h=-1,v=-1;for(o=i;o!==c;++o)s=u(d[o][i]),s>v&&(h=o,v=s);for(r=d[h],d[h]=d[i],d[i]=r,a=p[h],p[h]=p[i],p[i]=a,e=r[i],s=i;s!==f;++s)r[s]/=e;for(s=f-1;-1!==s;--s)a[s]/=e;for(o=c-1;-1!==o;--o)if(o!==i){for(t=d[o],n=p[o],e=t[i],s=i+1;s!==f;++s)t[s]-=r[s]*e;for(s=f-1;s>0;--s)n[s]-=a[s]*e,--s,n[s]-=a[s]*e;0===s&&(n[0]-=a[0]*e)}}return p},numeric.det=function(e){var t=numeric.dim(e);if(2!==t.length||t[0]!==t[1])throw new Error("numeric: det() only works on square matrices");var r,n,a,o,i,s,l,u,c=t[0],f=1,d=numeric.clone(e);for(n=0;c-1>n;n++){for(a=n,r=n+1;c>r;r++)Math.abs(d[r][n])>Math.abs(d[a][n])&&(a=r);for(a!==n&&(l=d[a],d[a]=d[n],d[n]=l,f*=-1),o=d[n],r=n+1;c>r;r++){for(i=d[r],s=i[n]/o[n],a=n+1;c-1>a;a+=2)u=a+1,i[a]-=o[a]*s,i[u]-=o[u]*s;a!==c&&(i[a]-=o[a]*s)}if(0===o[n])return 0;f*=o[n]}return f*d[n][n]},numeric.transpose=function(e){var t,r,n,a,o,i=e.length,s=e[0].length,l=Array(s);for(r=0;s>r;r++)l[r]=Array(i);for(t=i-1;t>=1;t-=2){for(a=e[t],n=e[t-1],r=s-1;r>=1;--r)o=l[r],o[t]=a[r],o[t-1]=n[r],--r,o=l[r],o[t]=a[r],o[t-1]=n[r];0===r&&(o=l[0],o[t]=a[0],o[t-1]=n[0])}if(0===t){for(n=e[0],r=s-1;r>=1;--r)l[r][0]=n[r],--r,l[r][0]=n[r];0===r&&(l[0][0]=n[0])}return l},numeric.negtranspose=function(e){var t,r,n,a,o,i=e.length,s=e[0].length,l=Array(s);for(r=0;s>r;r++)l[r]=Array(i);for(t=i-1;t>=1;t-=2){for(a=e[t],n=e[t-1],r=s-1;r>=1;--r)o=l[r],o[t]=-a[r],o[t-1]=-n[r],--r,o=l[r],o[t]=-a[r],o[t-1]=-n[r];0===r&&(o=l[0],o[t]=-a[0],o[t-1]=-n[0])}if(0===t){for(n=e[0],r=s-1;r>=1;--r)l[r][0]=-n[r],--r,l[r][0]=-n[r];0===r&&(l[0][0]=-n[0])}return l},numeric._random=function o(e,t){var r,n,a=e[t],i=Array(a);if(t===e.length-1){for(n=Math.random,r=a-1;r>=1;r-=2)i[r]=n(),i[r-1]=n();return 0===r&&(i[0]=n()),i}for(r=a-1;r>=0;r--)i[r]=o(e,t+1);return i},numeric.random=function(e){return numeric._random(e,0)},numeric.norm2=function(e){return Math.sqrt(numeric.norm2Squared(e))},numeric.linspace=function(e,t,r){if("undefined"==typeof r&&(r=Math.max(Math.round(t-e)+1,1)),2>r)return 1===r?[e]:[];var n,a=Array(r);for(r--,n=r;n>=0;n--)a[n]=(n*t+(r-n)*e)/r;return a},numeric.getBlock=function(e,t,r){function n(e,o){var i,s=t[o],l=r[o]-s,u=Array(l);if(o===a.length-1){for(i=l;i>=0;i--)u[i]=e[i+s];return u}for(i=l;i>=0;i--)u[i]=n(e[i+s],o+1);return u}var a=numeric.dim(e);return n(e,0)},numeric.setBlock=function(e,t,r,n){function a(e,n,i){var s,l=t[i],u=r[i]-l;if(i===o.length-1)for(s=u;s>=0;s--)e[s+l]=n[s];for(s=u;s>=0;s--)a(e[s+l],n[s],i+1)}var o=numeric.dim(e);return a(e,n,0),e},numeric.getRange=function(e,t,r){var n,a,o,i,s=t.length,l=r.length,u=Array(s);for(n=s-1;-1!==n;--n)for(u[n]=Array(l),o=u[n],i=e[t[n]],a=l-1;-1!==a;--a)o[a]=i[r[a]];return u},numeric.blockMatrix=function(e){var t=numeric.dim(e);if(t.length<4)return numeric.blockMatrix([e]);var r,n,a,o,i,s=t[0],l=t[1];for(r=0,n=0,a=0;s>a;++a)r+=e[a][0].length;for(o=0;l>o;++o)n+=e[0][o][0].length;var u=Array(r);for(a=0;r>a;++a)u[a]=Array(n);var c,f,d,p,h,v=0;for(a=0;s>a;++a){for(c=n,o=l-1;-1!==o;--o)for(i=e[a][o],c-=i[0].length,d=i.length-1;-1!==d;--d)for(h=i[d],f=u[v+d],p=h.length-1;-1!==p;--p)f[c+p]=h[p];v+=e[a][0].length}return u},numeric.tensor=function(e,t){if("number"==typeof e||"number"==typeof t)return numeric.mul(e,t);var r=numeric.dim(e),n=numeric.dim(t);if(1!==r.length||1!==n.length)throw new Error("numeric: tensor product is only defined for vectors");var a,o,i,s,l=r[0],u=n[0],c=Array(l);for(o=l-1;o>=0;o--){for(a=Array(u),s=e[o],i=u-1;i>=3;--i)a[i]=s*t[i],--i,a[i]=s*t[i],--i,a[i]=s*t[i],--i,a[i]=s*t[i];for(;i>=0;)a[i]=s*t[i],--i;c[o]=a}return c},numeric.T=function(e,t){this.x=e,this.y=t},numeric.t=function(e,t){return new numeric.T(e,t)},numeric.Tbinop=function(e,t,r,n,a){numeric.indexOf;if("string"!=typeof a){var o;a="";for(o in numeric)numeric.hasOwnProperty(o)&&(e.indexOf(o)>=0||t.indexOf(o)>=0||r.indexOf(o)>=0||n.indexOf(o)>=0)&&o.length>1&&(a+="var "+o+" = numeric."+o+";\n")}return Function(["y"],"var x = this;\nif(!(y instanceof numeric.T)) { y = new numeric.T(y); }\n"+a+"\nif(x.y) { if(y.y) { return new numeric.T("+n+");\n }\n return new numeric.T("+r+");\n}\nif(y.y) {\n return new numeric.T("+t+");\n}\nreturn new numeric.T("+e+");\n")},numeric.T.prototype.add=numeric.Tbinop("add(x.x,y.x)","add(x.x,y.x),y.y","add(x.x,y.x),x.y","add(x.x,y.x),add(x.y,y.y)"),numeric.T.prototype.sub=numeric.Tbinop("sub(x.x,y.x)","sub(x.x,y.x),neg(y.y)","sub(x.x,y.x),x.y","sub(x.x,y.x),sub(x.y,y.y)"),numeric.T.prototype.mul=numeric.Tbinop("mul(x.x,y.x)","mul(x.x,y.x),mul(x.x,y.y)","mul(x.x,y.x),mul(x.y,y.x)","sub(mul(x.x,y.x),mul(x.y,y.y)),add(mul(x.x,y.y),mul(x.y,y.x))"),numeric.T.prototype.reciprocal=function(){var e=numeric.mul,t=numeric.div;if(this.y){var r=numeric.add(e(this.x,this.x),e(this.y,this.y));return new numeric.T(t(this.x,r),t(numeric.neg(this.y),r))}return new T(t(1,this.x))},numeric.T.prototype.div=function i(e){if(e instanceof numeric.T||(e=new numeric.T(e)),e.y)return this.mul(e.reciprocal());var i=numeric.div;return this.y?new numeric.T(i(this.x,e.x),i(this.y,e.x)):new numeric.T(i(this.x,e.x))},numeric.T.prototype.dot=numeric.Tbinop("dot(x.x,y.x)","dot(x.x,y.x),dot(x.x,y.y)","dot(x.x,y.x),dot(x.y,y.x)","sub(dot(x.x,y.x),dot(x.y,y.y)),add(dot(x.x,y.y),dot(x.y,y.x))"),numeric.T.prototype.transpose=function(){var e=numeric.transpose,t=this.x,r=this.y;return r?new numeric.T(e(t),e(r)):new numeric.T(e(t))},numeric.T.prototype.transjugate=function(){var e=numeric.transpose,t=this.x,r=this.y;return r?new numeric.T(e(t),numeric.negtranspose(r)):new numeric.T(e(t))},numeric.Tunop=function(e,t,r){return"string"!=typeof r&&(r=""),Function("var x = this;\n"+r+"\nif(x.y) { "+t+";\n}\n"+e+";\n")},numeric.T.prototype.exp=numeric.Tunop("return new numeric.T(ex)","return new numeric.T(mul(cos(x.y),ex),mul(sin(x.y),ex))","var ex = numeric.exp(x.x), cos = numeric.cos, sin = numeric.sin, mul = numeric.mul;"),numeric.T.prototype.conj=numeric.Tunop("return new numeric.T(x.x);","return new numeric.T(x.x,numeric.neg(x.y));"),numeric.T.prototype.neg=numeric.Tunop("return new numeric.T(neg(x.x));","return new numeric.T(neg(x.x),neg(x.y));","var neg = numeric.neg;"),numeric.T.prototype.sin=numeric.Tunop("return new numeric.T(numeric.sin(x.x))","return x.exp().sub(x.neg().exp()).div(new numeric.T(0,2));"),numeric.T.prototype.cos=numeric.Tunop("return new numeric.T(numeric.cos(x.x))","return x.exp().add(x.neg().exp()).div(2);"),numeric.T.prototype.abs=numeric.Tunop("return new numeric.T(numeric.abs(x.x));","return new numeric.T(numeric.sqrt(numeric.add(mul(x.x,x.x),mul(x.y,x.y))));","var mul = numeric.mul;"),numeric.T.prototype.log=numeric.Tunop("return new numeric.T(numeric.log(x.x));","var theta = new numeric.T(numeric.atan2(x.y,x.x)), r = x.abs();\nreturn new numeric.T(numeric.log(r.x),theta.x);"),numeric.T.prototype.norm2=numeric.Tunop("return numeric.norm2(x.x);","var f = numeric.norm2Squared;\nreturn Math.sqrt(f(x.x)+f(x.y));"),numeric.T.prototype.inv=function(){var e=this;if("undefined"==typeof e.y)return new numeric.T(numeric.inv(e.x));var t,r,n,a,o,i,s,l,u,c,f,t,r,n,d,p,h,v,g,m,y,x=e.x.length,b=numeric.identity(x),w=numeric.rep([x,x],0),_=numeric.clone(e.x),k=numeric.clone(e.y);for(t=0;x>t;t++){for(h=_[t][t],v=k[t][t],d=h*h+v*v,n=t,r=t+1;x>r;r++)h=_[r][t],v=k[r][t],p=h*h+v*v,p>d&&(n=r,d=p);for(n!==t&&(y=_[t],_[t]=_[n],_[n]=y,y=k[t],k[t]=k[n],k[n]=y,y=b[t],b[t]=b[n],b[n]=y,y=w[t],w[t]=w[n],w[n]=y),a=_[t],o=k[t],l=b[t],u=w[t],h=a[t],v=o[t],r=t+1;x>r;r++)g=a[r],m=o[r],a[r]=(g*h+m*v)/d,o[r]=(m*h-g*v)/d;for(r=0;x>r;r++)g=l[r],m=u[r],l[r]=(g*h+m*v)/d,u[r]=(m*h-g*v)/d;for(r=t+1;x>r;r++){for(i=_[r],s=k[r],c=b[r],f=w[r],h=i[t],v=s[t],n=t+1;x>n;n++)g=a[n],m=o[n],i[n]-=g*h-m*v,s[n]-=m*h+g*v;for(n=0;x>n;n++)g=l[n],m=u[n],c[n]-=g*h-m*v,f[n]-=m*h+g*v}}for(t=x-1;t>0;t--)for(l=b[t],u=w[t],r=t-1;r>=0;r--)for(c=b[r],f=w[r],h=_[r][t],v=k[r][t],n=x-1;n>=0;n--)g=l[n],m=u[n],c[n]-=h*g-v*m,f[n]-=h*m+v*g;return new numeric.T(b,w)},numeric.T.prototype.get=function(e){var t,r=this.x,n=this.y,a=0,o=e.length;if(n){for(;o>a;)t=e[a],r=r[t],n=n[t],a++;return new numeric.T(r,n)}for(;o>a;)t=e[a],r=r[t],a++;return new numeric.T(r)},numeric.T.prototype.set=function(e,t){var r,n=this.x,a=this.y,o=0,i=e.length,s=t.x,l=t.y;if(0===i)return l?this.y=l:a&&(this.y=void 0),this.x=n,this;if(l){for(a||(a=numeric.rep(numeric.dim(n),0),this.y=a);i-1>o;)r=e[o],n=n[r],a=a[r],o++;return r=e[o],n[r]=s,a[r]=l,this}if(a){for(;i-1>o;)r=e[o],n=n[r],a=a[r],o++;return r=e[o],n[r]=s,a[r]=s instanceof Array?numeric.rep(numeric.dim(s),0):0,this}for(;i-1>o;)r=e[o],n=n[r],o++;return r=e[o],n[r]=s,this},numeric.T.prototype.getRows=function(e,t){var r,n,a=t-e+1,o=Array(a),i=this.x,s=this.y;for(r=e;t>=r;r++)o[r-e]=i[r];if(s){for(n=Array(a),r=e;t>=r;r++)n[r-e]=s[r];return new numeric.T(o,n)}return new numeric.T(o)},numeric.T.prototype.setRows=function(e,t,r){var n,a=this.x,o=this.y,i=r.x,s=r.y;for(n=e;t>=n;n++)a[n]=i[n-e];if(s)for(o||(o=numeric.rep(numeric.dim(a),0),this.y=o),n=e;t>=n;n++)o[n]=s[n-e];else if(o)for(n=e;t>=n;n++)o[n]=numeric.rep([i[n-e].length],0);return this},numeric.T.prototype.getRow=function(e){var t=this.x,r=this.y;return r?new numeric.T(t[e],r[e]):new numeric.T(t[e])},numeric.T.prototype.setRow=function(e,t){var r=this.x,n=this.y,a=t.x,o=t.y;return r[e]=a,o?(n||(n=numeric.rep(numeric.dim(r),0),this.y=n),n[e]=o):n&&(n=numeric.rep([a.length],0)),this},numeric.T.prototype.getBlock=function(e,t){var r=this.x,n=this.y,a=numeric.getBlock;return n?new numeric.T(a(r,e,t),a(n,e,t)):new numeric.T(a(r,e,t))},numeric.T.prototype.setBlock=function(e,t,r){r instanceof numeric.T||(r=new numeric.T(r));var n=this.x,a=this.y,o=numeric.setBlock,i=r.x,s=r.y;return s?(a||(this.y=numeric.rep(numeric.dim(this),0),a=this.y),o(n,e,t,i),o(a,e,t,s),this):(o(n,e,t,i),void(a&&o(a,e,t,numeric.rep(numeric.dim(i),0))))},numeric.T.rep=function(e,t){var r=numeric.T;t instanceof r||(t=new r(t));var n=t.x,a=t.y,o=numeric.rep;return a?new r(o(e,n),o(e,a)):new r(o(e,n))},numeric.T.diag=function s(e){e instanceof numeric.T||(e=new numeric.T(e));var t=e.x,r=e.y,s=numeric.diag;return r?new numeric.T(s(t),s(r)):new numeric.T(s(t))},numeric.T.eig=function(){if(this.y)throw new Error("eig: not implemented for complex matrices.");return numeric.eig(this.x)},numeric.T.identity=function(e){return new numeric.T(numeric.identity(e))},numeric.T.prototype.getDiag=function(){var e=numeric,t=this.x,r=this.y;return r?new e.T(e.getDiag(t),e.getDiag(r)):new e.T(e.getDiag(t))},numeric.house=function(e){var t=numeric.clone(e),r=e[0]>=0?1:-1,n=r*numeric.norm2(e);t[0]+=n;var a=numeric.norm2(t);if(0===a)throw new Error("eig: internal error");return numeric.div(t,a)},numeric.toUpperHessenberg=function(e){var t=numeric.dim(e);if(2!==t.length||t[0]!==t[1])throw new Error("numeric: toUpperHessenberg() only works on square matrices");var r,n,a,o,i,s,l,u,c,f,d=t[0],p=numeric.clone(e),h=numeric.identity(d);for(n=0;d-2>n;n++){for(o=Array(d-n-1),r=n+1;d>r;r++)o[r-n-1]=p[r][n];if(numeric.norm2(o)>0){for(i=numeric.house(o),s=numeric.getBlock(p,[n+1,n],[d-1,d-1]),l=numeric.tensor(i,numeric.dot(i,s)),r=n+1;d>r;r++)for(u=p[r],c=l[r-n-1],a=n;d>a;a++)u[a]-=2*c[a-n];for(s=numeric.getBlock(p,[0,n+1],[d-1,d-1]),l=numeric.tensor(numeric.dot(s,i),i),r=0;d>r;r++)for(u=p[r],c=l[r],a=n+1;d>a;a++)u[a]-=2*c[a-n-1];for(s=Array(d-n-1),r=n+1;d>r;r++)s[r-n-1]=h[r];for(l=numeric.tensor(i,numeric.dot(i,s)),r=n+1;d>r;r++)for(f=h[r],c=l[r-n-1],a=0;d>a;a++)f[a]-=2*c[a]}}return{H:p,Q:h}},numeric.epsilon=2.220446049250313e-16,numeric.QRFrancis=function(e,t){"undefined"==typeof t&&(t=1e4),e=numeric.clone(e);var r,n,a,o,i,s,l,u,c,f,d,p,h,v,g,m,y,x,b=(numeric.clone(e),numeric.dim(e)),w=b[0],_=numeric.identity(w);if(3>w)return{Q:_,B:[[0,w-1]]};var k=numeric.epsilon;for(x=0;t>x;x++){for(m=0;w-1>m;m++)if(Math.abs(e[m+1][m])<k*(Math.abs(e[m][m])+Math.abs(e[m+1][m+1]))){var z=numeric.QRFrancis(numeric.getBlock(e,[0,0],[m,m]),t),j=numeric.QRFrancis(numeric.getBlock(e,[m+1,m+1],[w-1,w-1]),t);for(p=Array(m+1),g=0;m>=g;g++)p[g]=_[g];for(h=numeric.dot(z.Q,p),g=0;m>=g;g++)_[g]=h[g];for(p=Array(w-m-1),g=m+1;w>g;g++)p[g-m-1]=_[g];for(h=numeric.dot(j.Q,p),g=m+1;w>g;g++)_[g]=h[g-m-1];return{Q:_,B:z.B.concat(numeric.add(j.B,m+1))}}if(a=e[w-2][w-2],o=e[w-2][w-1],i=e[w-1][w-2],s=e[w-1][w-1],u=a+s,l=a*s-o*i,c=numeric.getBlock(e,[0,0],[2,2]),u*u>=4*l){var A,M;A=.5*(u+Math.sqrt(u*u-4*l)),M=.5*(u-Math.sqrt(u*u-4*l)),c=numeric.add(numeric.sub(numeric.dot(c,c),numeric.mul(c,A+M)),numeric.diag(numeric.rep([3],A*M)))}else c=numeric.add(numeric.sub(numeric.dot(c,c),numeric.mul(c,u)),numeric.diag(numeric.rep([3],l)));for(r=[c[0][0],c[1][0],c[2][0]],n=numeric.house(r),p=[e[0],e[1],e[2]],h=numeric.tensor(n,numeric.dot(n,p)),g=0;3>g;g++)for(d=e[g],v=h[g],y=0;w>y;y++)d[y]-=2*v[y];for(p=numeric.getBlock(e,[0,0],[w-1,2]),h=numeric.tensor(numeric.dot(p,n),n),g=0;w>g;g++)for(d=e[g],v=h[g],y=0;3>y;y++)d[y]-=2*v[y];for(p=[_[0],_[1],_[2]],h=numeric.tensor(n,numeric.dot(n,p)),g=0;3>g;g++)for(f=_[g],v=h[g],y=0;w>y;y++)f[y]-=2*v[y];var E;for(m=0;w-2>m;m++){for(y=m;m+1>=y;y++)if(Math.abs(e[y+1][y])<k*(Math.abs(e[y][y])+Math.abs(e[y+1][y+1]))){var z=numeric.QRFrancis(numeric.getBlock(e,[0,0],[y,y]),t),j=numeric.QRFrancis(numeric.getBlock(e,[y+1,y+1],[w-1,w-1]),t);for(p=Array(y+1),g=0;y>=g;g++)p[g]=_[g];for(h=numeric.dot(z.Q,p),g=0;y>=g;g++)_[g]=h[g];for(p=Array(w-y-1),g=y+1;w>g;g++)p[g-y-1]=_[g];for(h=numeric.dot(j.Q,p),g=y+1;w>g;g++)_[g]=h[g-y-1];return{Q:_,B:z.B.concat(numeric.add(j.B,y+1))}}for(E=Math.min(w-1,m+3),r=Array(E-m),g=m+1;E>=g;g++)r[g-m-1]=e[g][m];for(n=numeric.house(r),p=numeric.getBlock(e,[m+1,m],[E,w-1]),h=numeric.tensor(n,numeric.dot(n,p)),g=m+1;E>=g;g++)for(d=e[g],v=h[g-m-1],y=m;w>y;y++)d[y]-=2*v[y-m];for(p=numeric.getBlock(e,[0,m+1],[w-1,E]),h=numeric.tensor(numeric.dot(p,n),n),g=0;w>g;g++)for(d=e[g],v=h[g],y=m+1;E>=y;y++)d[y]-=2*v[y-m-1];for(p=Array(E-m),g=m+1;E>=g;g++)p[g-m-1]=_[g];for(h=numeric.tensor(n,numeric.dot(n,p)),g=m+1;E>=g;g++)for(f=_[g],v=h[g-m-1],y=0;w>y;y++)f[y]-=2*v[y]}}throw new Error("numeric: eigenvalue iteration does not converge -- increase maxiter?")},numeric.eig=function(e,t){var r,n,a,o,i,s,l,u,c,f,d,p,h,v,g,m,y,x=numeric.toUpperHessenberg(e),b=numeric.QRFrancis(x.H,t),w=numeric.T,_=e.length,k=b.B,z=numeric.dot(b.Q,numeric.dot(x.H,numeric.transpose(b.Q))),j=new w(numeric.dot(b.Q,x.Q)),A=k.length,M=Math.sqrt;for(n=0;A>n;n++)if(r=k[n][0],r===k[n][1]);else{if(o=r+1,i=z[r][r],s=z[r][o],l=z[o][r],u=z[o][o],0===s&&0===l)continue;c=-i-u,f=i*u-s*l,d=c*c-4*f,d>=0?(p=0>c?-.5*(c-M(d)):-.5*(c+M(d)),m=(i-p)*(i-p)+s*s,y=l*l+(u-p)*(u-p),m>y?(m=M(m),v=(i-p)/m,g=s/m):(y=M(y),v=l/y,g=(u-p)/y),a=new w([[g,-v],[v,g]]),j.setRows(r,o,a.dot(j.getRows(r,o)))):(p=-.5*c,h=.5*M(-d),m=(i-p)*(i-p)+s*s,y=l*l+(u-p)*(u-p),m>y?(m=M(m+h*h),v=(i-p)/m,g=s/m,p=0,h/=m):(y=M(y+h*h),v=l/y,g=(u-p)/y,p=h/y,h=0),a=new w([[g,-v],[v,g]],[[p,h],[h,-p]]),j.setRows(r,o,a.dot(j.getRows(r,o))))}var E=j.dot(e).dot(j.transjugate()),_=e.length,S=numeric.T.identity(_);for(o=0;_>o;o++)if(o>0)for(n=o-1;n>=0;n--){var T=E.get([n,n]),O=E.get([o,o]);numeric.neq(T.x,O.x)||numeric.neq(T.y,O.y)?(p=E.getRow(n).getBlock([n],[o-1]),h=S.getRow(o).getBlock([n],[o-1]),S.set([o,n],E.get([n,o]).neg().sub(p.dot(h)).div(T.sub(O)))):S.setRow(o,S.getRow(n))}for(o=0;_>o;o++)p=S.getRow(o),S.setRow(o,p.div(p.norm2()));return S=S.transpose(),S=j.transjugate().dot(S),{lambda:E.getDiag(),E:S}},numeric.ccsSparse=function(e){var t,r,n,a,o=e.length,i=[];for(n=o-1;-1!==n;--n){r=e[n];for(a in r){for(a=parseInt(a);a>=i.length;)i[i.length]=0;0!==r[a]&&i[a]++}}var t=i.length,s=Array(t+1);for(s[0]=0,n=0;t>n;++n)s[n+1]=s[n]+i[n];var l=Array(s[t]),u=Array(s[t]);for(n=o-1;-1!==n;--n){r=e[n];for(a in r)0!==r[a]&&(i[a]--,l[s[a]+i[a]]=n,u[s[a]+i[a]]=r[a])}return[s,l,u]},numeric.ccsFull=function(e){var t,r,n,a,o=e[0],i=e[1],s=e[2],l=numeric.ccsDim(e),u=l[0],c=l[1],f=numeric.rep([u,c],0);for(t=0;c>t;t++)for(n=o[t],a=o[t+1],r=n;a>r;++r)f[i[r]][t]=s[r];return f},numeric.ccsTSolve=function(e,t,r,n,a){function o(e){var t;if(0===r[e]){for(r[e]=1,t=i[e];t<i[e+1];++t)o(s[t]);a[f]=e,++f}}var i=e[0],s=e[1],l=e[2],u=i.length-1,c=Math.max,f=0;"undefined"==typeof n&&(r=numeric.rep([u],0)),"undefined"==typeof n&&(n=numeric.linspace(0,r.length-1)),"undefined"==typeof a&&(a=[]);var d,p,h,v,g,m,y;for(d=n.length-1;-1!==d;--d)o(n[d]);for(a.length=f,d=a.length-1;-1!==d;--d)r[a[d]]=0;for(d=n.length-1;-1!==d;--d)p=n[d],r[p]=t[p];for(d=a.length-1;-1!==d;--d){for(p=a[d],h=i[p],v=c(i[p+1],h),g=h;g!==v;++g)if(s[g]===p){r[p]/=l[g];break}for(y=r[p],g=h;g!==v;++g)m=s[g],m!==p&&(r[m]-=y*l[g])}return r},numeric.ccsDFS=function(e){this.k=Array(e),this.k1=Array(e),this.j=Array(e)},numeric.ccsDFS.prototype.dfs=function(e,t,r,n,a,o){var i,s,l,u=0,c=a.length,f=this.k,d=this.k1,p=this.j;if(0===n[e])for(n[e]=1,p[0]=e,f[0]=s=t[e],d[0]=l=t[e+1];;)if(s>=l){if(a[c]=p[u],0===u)return;++c,--u,s=f[u],l=d[u]}else i=o[r[s]],0===n[i]?(n[i]=1,f[u]=s,++u,p[u]=i,s=t[i],d[u]=l=t[i+1]):++s},numeric.ccsLPSolve=function(e,t,r,n,a,o,i){var s,l,u,c,f,d,p,h,v,g=e[0],m=e[1],y=e[2],x=(g.length-1,t[0]),b=t[1],w=t[2];for(l=x[a],u=x[a+1],n.length=0,s=l;u>s;++s)i.dfs(o[b[s]],g,m,r,n,o);for(s=n.length-1;-1!==s;--s)r[n[s]]=0;for(s=l;s!==u;++s)c=o[b[s]],r[c]=w[s];for(s=n.length-1;-1!==s;--s){for(c=n[s],f=g[c],d=g[c+1],p=f;d>p;++p)if(o[m[p]]===c){r[c]/=y[p];break}for(v=r[c],p=f;d>p;++p)h=o[m[p]],h!==c&&(r[h]-=v*y[p])}return r},numeric.ccsLUP1=function(e,t){var r,n,a,o,i,s,l,u=e[0].length-1,c=[numeric.rep([u+1],0),[],[]],f=[numeric.rep([u+1],0),[],[]],d=c[0],p=c[1],h=c[2],v=f[0],g=f[1],m=f[2],y=numeric.rep([u],0),x=numeric.rep([u],0),b=numeric.ccsLPSolve,w=(Math.max,Math.abs),_=numeric.linspace(0,u-1),k=numeric.linspace(0,u-1),z=new numeric.ccsDFS(u);for("undefined"==typeof t&&(t=1),r=0;u>r;++r){for(b(c,e,y,x,r,k,z),o=-1,i=-1,n=x.length-1;-1!==n;--n)a=x[n],r>=a||(s=w(y[a]),s>o&&(i=a,o=s));for(w(y[r])<t*o&&(n=_[r],o=_[i],_[r]=o,k[o]=r,_[i]=n,k[n]=i,o=y[r],y[r]=y[i],y[i]=o),o=d[r],i=v[r],l=y[r],p[o]=_[r],h[o]=1,++o,n=x.length-1;-1!==n;--n)a=x[n],s=y[a],x[n]=0,y[a]=0,r>=a?(g[i]=a,m[i]=s,++i):(p[o]=_[a],h[o]=s/l,++o);d[r+1]=o,v[r+1]=i}for(n=p.length-1;-1!==n;--n)p[n]=k[p[n]];return{L:c,U:f,P:_,Pinv:k}},numeric.ccsDFS0=function(e){this.k=Array(e),this.k1=Array(e),this.j=Array(e)},numeric.ccsDFS0.prototype.dfs=function(e,t,r,n,a,o){var i,s,l,u=0,c=a.length,f=this.k,d=this.k1,p=this.j;if(0===n[e])for(n[e]=1,p[0]=e,f[0]=s=t[o[e]],d[0]=l=t[o[e]+1];;){if(isNaN(s))throw new Error("Ow!");if(s>=l){if(a[c]=o[p[u]],0===u)return;++c,--u,s=f[u],l=d[u]}else i=r[s],0===n[i]?(n[i]=1,f[u]=s,++u,p[u]=i,i=o[i],s=t[i],d[u]=l=t[i+1]):++s}},numeric.ccsLPSolve0=function(e,t,r,n,a,o,i,s){var l,u,c,f,d,p,h,v,g,m=e[0],y=e[1],x=e[2],b=(m.length-1,t[0]),w=t[1],_=t[2];for(u=b[a],c=b[a+1],n.length=0,l=u;c>l;++l)s.dfs(w[l],m,y,r,n,o,i);for(l=n.length-1;-1!==l;--l)f=n[l],r[i[f]]=0;for(l=u;l!==c;++l)f=w[l],r[f]=_[l];for(l=n.length-1;-1!==l;--l){for(f=n[l],v=i[f],d=m[f],p=m[f+1],h=d;p>h;++h)if(y[h]===v){r[v]/=x[h];break}for(g=r[v],h=d;p>h;++h)r[y[h]]-=g*x[h];r[v]=g}},numeric.ccsLUP0=function(e,t){var r,n,a,o,i,s,l,u=e[0].length-1,c=[numeric.rep([u+1],0),[],[]],f=[numeric.rep([u+1],0),[],[]],d=c[0],p=c[1],h=c[2],v=f[0],g=f[1],m=f[2],y=numeric.rep([u],0),x=numeric.rep([u],0),b=numeric.ccsLPSolve0,w=(Math.max,Math.abs),_=numeric.linspace(0,u-1),k=numeric.linspace(0,u-1),z=new numeric.ccsDFS0(u);for("undefined"==typeof t&&(t=1),r=0;u>r;++r){for(b(c,e,y,x,r,k,_,z),o=-1,i=-1,n=x.length-1;-1!==n;--n)a=x[n],r>=a||(s=w(y[_[a]]),s>o&&(i=a,o=s));for(w(y[_[r]])<t*o&&(n=_[r],o=_[i],_[r]=o,k[o]=r,_[i]=n,k[n]=i),o=d[r],i=v[r],l=y[_[r]],p[o]=_[r],h[o]=1,++o,n=x.length-1;-1!==n;--n)a=x[n],s=y[_[a]],x[n]=0,y[_[a]]=0,r>=a?(g[i]=a,m[i]=s,++i):(p[o]=_[a],h[o]=s/l,++o);d[r+1]=o,v[r+1]=i}for(n=p.length-1;-1!==n;--n)p[n]=k[p[n]];return{L:c,U:f,P:_,Pinv:k}},numeric.ccsLUP=numeric.ccsLUP0,numeric.ccsDim=function(e){return[numeric.sup(e[1])+1,e[0].length-1]},numeric.ccsGetBlock=function(e,t,r){var n=numeric.ccsDim(e),a=n[0],o=n[1];"undefined"==typeof t?t=numeric.linspace(0,a-1):"number"==typeof t&&(t=[t]),"undefined"==typeof r?r=numeric.linspace(0,o-1):"number"==typeof r&&(r=[r]);var i,s,l,u,c,f=t.length,d=r.length,p=numeric.rep([o],0),h=[],v=[],g=[p,h,v],m=e[0],y=e[1],x=e[2],b=numeric.rep([a],0),w=0,_=numeric.rep([a],0);for(s=0;d>s;++s){u=r[s];var k=m[u],z=m[u+1];for(i=k;z>i;++i)l=y[i],_[l]=1,b[l]=x[i];for(i=0;f>i;++i)c=t[i],_[c]&&(h[w]=i,v[w]=b[t[i]],++w);for(i=k;z>i;++i)l=y[i],_[l]=0;p[s+1]=w}return g},numeric.ccsDot=function(e,t){var r,n,a,o,i,s,l,u,c,f,d,p=e[0],h=e[1],v=e[2],g=t[0],m=t[1],y=t[2],x=numeric.ccsDim(e),b=numeric.ccsDim(t),w=x[0],_=(x[1],b[1]),k=numeric.rep([w],0),z=numeric.rep([w],0),j=Array(w),A=numeric.rep([_],0),M=[],E=[],S=[A,M,E];for(a=0;a!==_;++a){for(o=g[a],i=g[a+1],c=0,n=o;i>n;++n)for(f=m[n],d=y[n],s=p[f],l=p[f+1],r=s;l>r;++r)u=h[r],0===z[u]&&(j[c]=u,z[u]=1,c+=1),k[u]=k[u]+v[r]*d;for(o=A[a],i=o+c,A[a+1]=i,n=c-1;-1!==n;--n)d=o+n,r=j[n],M[d]=r,E[d]=k[r],z[r]=0,k[r]=0;A[a+1]=A[a]+c}return S},numeric.ccsLUPSolve=function(e,t){var r=e.L,n=e.U,a=(e.P,t[0]),o=!1;"object"!=typeof a&&(t=[[0,t.length],numeric.linspace(0,t.length-1),t],a=t[0],o=!0);var i,s,l,u,c,f,d=t[1],p=t[2],h=r[0].length-1,v=a.length-1,g=numeric.rep([h],0),m=Array(h),y=numeric.rep([h],0),x=Array(h),b=numeric.rep([v+1],0),w=[],_=[],k=numeric.ccsTSolve,z=0;for(i=0;v>i;++i){for(c=0,l=a[i],u=a[i+1],s=l;u>s;++s)f=e.Pinv[d[s]],x[c]=f,y[f]=p[s],++c;for(x.length=c,k(r,y,g,x,m),s=x.length-1;-1!==s;--s)y[x[s]]=0;if(k(n,g,y,m,x),o)return y;for(s=m.length-1;-1!==s;--s)g[m[s]]=0;for(s=x.length-1;-1!==s;--s)f=x[s],w[z]=f,_[z]=y[f],y[f]=0,++z;b[i+1]=z}return[b,w,_]},numeric.ccsbinop=function(e,t){return"undefined"==typeof t&&(t=""),Function("X","Y","var Xi = X[0], Xj = X[1], Xv = X[2];\nvar Yi = Y[0], Yj = Y[1], Yv = Y[2];\nvar n = Xi.length-1,m = Math.max(numeric.sup(Xj),numeric.sup(Yj))+1;\nvar Zi = numeric.rep([n+1],0), Zj = [], Zv = [];\nvar x = numeric.rep([m],0),y = numeric.rep([m],0);\nvar xk,yk,zk;\nvar i,j,j0,j1,k,p=0;\n"+t+"for(i=0;i<n;++i) {\n j0 = Xi[i]; j1 = Xi[i+1];\n for(j=j0;j!==j1;++j) {\n k = Xj[j];\n x[k] = 1;\n Zj[p] = k;\n ++p;\n }\n j0 = Yi[i]; j1 = Yi[i+1];\n for(j=j0;j!==j1;++j) {\n k = Yj[j];\n y[k] = Yv[j];\n if(x[k] === 0) {\n Zj[p] = k;\n ++p;\n }\n }\n Zi[i+1] = p;\n j0 = Xi[i]; j1 = Xi[i+1];\n for(j=j0;j!==j1;++j) x[Xj[j]] = Xv[j];\n j0 = Zi[i]; j1 = Zi[i+1];\n for(j=j0;j!==j1;++j) {\n k = Zj[j];\n xk = x[k];\n yk = y[k];\n"+e+"\n Zv[j] = zk;\n }\n j0 = Xi[i]; j1 = Xi[i+1];\n for(j=j0;j!==j1;++j) x[Xj[j]] = 0;\n j0 = Yi[i]; j1 = Yi[i+1];\n for(j=j0;j!==j1;++j) y[Yj[j]] = 0;\n}\nreturn [Zi,Zj,Zv];")},function(){var k,A,B,C;for(k in numeric.ops2)A=isFinite(eval("1"+numeric.ops2[k]+"0"))?"[Y[0],Y[1],numeric."+k+"(X,Y[2])]":"NaN",B=isFinite(eval("0"+numeric.ops2[k]+"1"))?"[X[0],X[1],numeric."+k+"(X[2],Y)]":"NaN",C=isFinite(eval("1"+numeric.ops2[k]+"0"))&&isFinite(eval("0"+numeric.ops2[k]+"1"))?"numeric.ccs"+k+"MM(X,Y)":"NaN",numeric["ccs"+k+"MM"]=numeric.ccsbinop("zk = xk "+numeric.ops2[k]+"yk;"),numeric["ccs"+k]=Function("X","Y",'if(typeof X === "number") return '+A+';\nif(typeof Y === "number") return '+B+";\nreturn "+C+";\n")}(),numeric.ccsScatter=function(e){var t,r=e[0],n=e[1],a=e[2],o=numeric.sup(n)+1,i=r.length,s=numeric.rep([o],0),l=Array(i),u=Array(i),c=numeric.rep([o],0);
for(t=0;i>t;++t)c[n[t]]++;for(t=0;o>t;++t)s[t+1]=s[t]+c[t];var f,d,p=s.slice(0);for(t=0;i>t;++t)d=n[t],f=p[d],l[f]=r[t],u[f]=a[t],p[d]=p[d]+1;return[s,l,u]},numeric.ccsGather=function(e){var t,r,n,a,o,i=e[0],s=e[1],l=e[2],u=i.length-1,c=s.length,f=Array(c),d=Array(c),p=Array(c);for(o=0,t=0;u>t;++t)for(n=i[t],a=i[t+1],r=n;r!==a;++r)d[o]=t,f[o]=s[r],p[o]=l[r],++o;return[f,d,p]},numeric.sdim=function l(e,t,r){if("undefined"==typeof t&&(t=[]),"object"!=typeof e)return t;"undefined"==typeof r&&(r=0),r in t||(t[r]=0),e.length>t[r]&&(t[r]=e.length);var n;for(n in e)e.hasOwnProperty(n)&&l(e[n],t,r+1);return t},numeric.sclone=function u(e,t,r){"undefined"==typeof t&&(t=0),"undefined"==typeof r&&(r=numeric.sdim(e).length);var n,a=Array(e.length);if(t===r-1){for(n in e)e.hasOwnProperty(n)&&(a[n]=e[n]);return a}for(n in e)e.hasOwnProperty(n)&&(a[n]=u(e[n],t+1,r));return a},numeric.sdiag=function(e){var t,r,n=e.length,a=Array(n);for(t=n-1;t>=1;t-=2)r=t-1,a[t]=[],a[t][t]=e[t],a[r]=[],a[r][r]=e[r];return 0===t&&(a[0]=[],a[0][0]=e[t]),a},numeric.sidentity=function(e){return numeric.sdiag(numeric.rep([e],1))},numeric.stranspose=function(e){{var t,r,n,a=[];e.length}for(t in e)if(e.hasOwnProperty(t)){n=e[t];for(r in n)n.hasOwnProperty(r)&&("object"!=typeof a[r]&&(a[r]=[]),a[r][t]=n[r])}return a},numeric.sLUP=function(){throw new Error("The function numeric.sLUP had a bug in it and has been removed. Please use the new numeric.ccsLUP function instead.")},numeric.sdotMM=function(e,t){var r,n,a,o,i,s,l,u=e.length,c=(t.length,numeric.stranspose(t)),f=c.length,d=Array(u);for(a=u-1;a>=0;a--){for(l=[],r=e[a],i=f-1;i>=0;i--){s=0,n=c[i];for(o in r)r.hasOwnProperty(o)&&o in n&&(s+=r[o]*n[o]);s&&(l[i]=s)}d[a]=l}return d},numeric.sdotMV=function(e,t){var r,n,a,o,i=e.length,s=Array(i);for(n=i-1;n>=0;n--){r=e[n],o=0;for(a in r)r.hasOwnProperty(a)&&t[a]&&(o+=r[a]*t[a]);o&&(s[n]=o)}return s},numeric.sdotVM=function(e,t){var r,n,a,o,i=[];for(r in e)if(e.hasOwnProperty(r)){a=t[r],o=e[r];for(n in a)a.hasOwnProperty(n)&&(i[n]||(i[n]=0),i[n]+=o*a[n])}return i},numeric.sdotVV=function(e,t){var r,n=0;for(r in e)e[r]&&t[r]&&(n+=e[r]*t[r]);return n},numeric.sdot=function(e,t){var r=numeric.sdim(e).length,n=numeric.sdim(t).length,a=1e3*r+n;switch(a){case 0:return e*t;case 1001:return numeric.sdotVV(e,t);case 2001:return numeric.sdotMV(e,t);case 1002:return numeric.sdotVM(e,t);case 2002:return numeric.sdotMM(e,t);default:throw new Error("numeric.sdot not implemented for tensors of order "+r+" and "+n)}},numeric.sscatter=function(e){var t,r,n,a,o=e[0].length,i=e.length,s=[];for(r=o-1;r>=0;--r)if(e[i-1][r]){for(a=s,n=0;i-2>n;n++)t=e[n][r],a[t]||(a[t]=[]),a=a[t];a[e[n][r]]=e[n+1][r]}return s},numeric.sgather=function c(e,t,r){"undefined"==typeof t&&(t=[]),"undefined"==typeof r&&(r=[]);var n,a,o;n=r.length;for(a in e)if(e.hasOwnProperty(a))if(r[n]=parseInt(a),o=e[a],"number"==typeof o){if(o){if(0===t.length)for(a=n+1;a>=0;--a)t[a]=[];for(a=n;a>=0;--a)t[a].push(r[a]);t[n+1].push(o)}}else c(o,t,r);return r.length>n&&r.pop(),t},numeric.cLU=function(e){var t,r,n,a,o,i,s=e[0],l=e[1],u=e[2],c=s.length,f=0;for(t=0;c>t;t++)s[t]>f&&(f=s[t]);f++;var d,p,h,v=Array(f),g=Array(f),m=numeric.rep([f],1/0),y=numeric.rep([f],-1/0);for(n=0;c>n;n++)t=s[n],r=l[n],r<m[t]&&(m[t]=r),r>y[t]&&(y[t]=r);for(t=0;f-1>t;t++)y[t]>y[t+1]&&(y[t+1]=y[t]);for(t=f-1;t>=1;t--)m[t]<m[t-1]&&(m[t-1]=m[t]);var x=0,b=0;for(t=0;f>t;t++)g[t]=numeric.rep([y[t]-m[t]+1],0),v[t]=numeric.rep([t-m[t]],0),x+=t-m[t]+1,b+=y[t]-t+1;for(n=0;c>n;n++)t=s[n],g[t][l[n]-m[t]]=u[n];for(t=0;f-1>t;t++)for(a=t-m[t],d=g[t],r=t+1;m[r]<=t&&f>r;r++)if(o=t-m[r],i=y[t]-t,p=g[r],h=p[o]/d[a]){for(n=1;i>=n;n++)p[n+o]-=h*d[n+a];v[r][t-m[r]]=h}var c,w,_,d=[],p=[],k=[],z=[],j=[],A=[];for(c=0,w=0,t=0;f>t;t++){for(a=m[t],o=y[t],_=g[t],r=t;o>=r;r++)_[r-a]&&(d[c]=t,p[c]=r,k[c]=_[r-a],c++);for(_=v[t],r=a;t>r;r++)_[r-a]&&(z[w]=t,j[w]=r,A[w]=_[r-a],w++);z[w]=t,j[w]=t,A[w]=1,w++}return{U:[d,p,k],L:[z,j,A]}},numeric.cLUsolve=function(e,t){var r,n,a=e.L,o=e.U,i=numeric.clone(t),s=a[0],l=a[1],u=a[2],c=o[0],f=o[1],d=o[2],p=c.length,h=(s.length,i.length);for(n=0,r=0;h>r;r++){for(;l[n]<r;)i[r]-=u[n]*i[l[n]],n++;n++}for(n=p-1,r=h-1;r>=0;r--){for(;f[n]>r;)i[r]-=d[n]*i[f[n]],n--;i[r]/=d[n],n--}return i},numeric.cgrid=function(e,t){"number"==typeof e&&(e=[e,e]);var r,n,a,o=numeric.rep(e,-1);if("function"!=typeof t)switch(t){case"L":t=function(t,r){return t>=e[0]/2||r<e[1]/2};break;default:t=function(){return!0}}for(a=0,r=1;r<e[0]-1;r++)for(n=1;n<e[1]-1;n++)t(r,n)&&(o[r][n]=a,a++);return o},numeric.cdelsq=function(e){var t,r,n,a,o,i=[[-1,0],[0,-1],[0,1],[1,0]],s=numeric.dim(e),l=s[0],u=s[1],c=[],f=[],d=[];for(t=1;l-1>t;t++)for(r=1;u-1>r;r++)if(!(e[t][r]<0)){for(n=0;4>n;n++)a=t+i[n][0],o=r+i[n][1],e[a][o]<0||(c.push(e[t][r]),f.push(e[a][o]),d.push(-1));c.push(e[t][r]),f.push(e[t][r]),d.push(4)}return[c,f,d]},numeric.cdotMV=function(e,t){var r,n,a,o=e[0],i=e[1],s=e[2],l=o.length;for(a=0,n=0;l>n;n++)o[n]>a&&(a=o[n]);for(a++,r=numeric.rep([a],0),n=0;l>n;n++)r[o[n]]+=s[n]*t[i[n]];return r},numeric.Spline=function(e,t,r,n,a){this.x=e,this.yl=t,this.yr=r,this.kl=n,this.kr=a},numeric.Spline.prototype._at=function(e,t){var e,r,n,a,o=this.x,i=this.yl,s=this.yr,l=this.kl,u=this.kr,c=numeric.add,f=numeric.sub,d=numeric.mul;r=f(d(l[t],o[t+1]-o[t]),f(s[t+1],i[t])),n=c(d(u[t+1],o[t]-o[t+1]),f(s[t+1],i[t])),a=(e-o[t])/(o[t+1]-o[t]);var p=a*(1-a);return c(c(c(d(1-a,i[t]),d(a,s[t+1])),d(r,p*(1-a))),d(n,p*a))},numeric.Spline.prototype.at=function(e){if("number"==typeof e){var t,r,n,a=this.x,o=a.length,i=Math.floor;for(t=0,r=o-1;r-t>1;)n=i((t+r)/2),a[n]<=e?t=n:r=n;return this._at(e,t)}var s,o=e.length,l=Array(o);for(s=o-1;-1!==s;--s)l[s]=this.at(e[s]);return l},numeric.Spline.prototype.diff=function(){var e,t,r,n=this.x,a=this.yl,o=this.yr,i=this.kl,s=this.kr,l=a.length,u=i,c=s,f=Array(l),d=Array(l),p=numeric.add,h=numeric.mul,v=numeric.div,g=numeric.sub;for(e=l-1;-1!==e;--e)t=n[e+1]-n[e],r=g(o[e+1],a[e]),f[e]=v(p(h(r,6),h(i[e],-4*t),h(s[e+1],-2*t)),t*t),d[e+1]=v(p(h(r,-6),h(i[e],2*t),h(s[e+1],4*t)),t*t);return new numeric.Spline(n,u,c,f,d)},numeric.Spline.prototype.roots=function(){function e(e){return e*e}var t=[],r=this.x,n=this.yl,a=this.yr,o=this.kl,i=this.kr;"number"==typeof n[0]&&(n=[n],a=[a],o=[o],i=[i]);var s,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,j,A,M,E,S,T,O=n.length,N=r.length-1,t=Array(O),F=Math.sqrt;for(s=0;s!==O;++s){for(c=n[s],f=a[s],d=o[s],p=i[s],h=[],l=0;l!==N;l++){for(l>0&&f[l]*c[l]<0&&h.push(r[l]),_=r[l+1]-r[l],k=r[l],m=c[l],y=f[l+1],v=d[l]/_,g=p[l+1]/_,w=e(v-g+3*(m-y))+12*g*m,x=g+3*m+2*v-3*y,b=3*(g+v+2*(m-y)),0>=w?(j=x/b,z=j>r[l]&&j<r[l+1]?[r[l],j,r[l+1]]:[r[l],r[l+1]]):(j=(x-F(w))/b,A=(x+F(w))/b,z=[r[l]],j>r[l]&&j<r[l+1]&&z.push(j),A>r[l]&&A<r[l+1]&&z.push(A),z.push(r[l+1])),E=z[0],j=this._at(E,l),u=0;u<z.length-1;u++)if(S=z[u+1],A=this._at(S,l),0!==j)if(0===A||j*A>0)E=S,j=A;else{for(var B=0;;){if(T=(j*S-A*E)/(j-A),E>=T||T>=S)break;if(M=this._at(T,l),M*A>0)S=T,A=M,-1===B&&(j*=.5),B=-1;else{if(!(M*j>0))break;E=T,j=M,1===B&&(A*=.5),B=1}}h.push(T),E=z[u+1],j=this._at(E,l)}else h.push(E),E=S,j=A;0===A&&h.push(S)}t[s]=h}return"number"==typeof this.yl[0]?t[0]:t},numeric.spline=function(e,t,r,n){var a,o=e.length,i=[],s=[],l=[],u=numeric.sub,c=numeric.mul,f=numeric.add;for(a=o-2;a>=0;a--)s[a]=e[a+1]-e[a],l[a]=u(t[a+1],t[a]);("string"==typeof r||"string"==typeof n)&&(r=n="periodic");var d=[[],[],[]];switch(typeof r){case"undefined":i[0]=c(3/(s[0]*s[0]),l[0]),d[0].push(0,0),d[1].push(0,1),d[2].push(2/s[0],1/s[0]);break;case"string":i[0]=f(c(3/(s[o-2]*s[o-2]),l[o-2]),c(3/(s[0]*s[0]),l[0])),d[0].push(0,0,0),d[1].push(o-2,0,1),d[2].push(1/s[o-2],2/s[o-2]+2/s[0],1/s[0]);break;default:i[0]=r,d[0].push(0),d[1].push(0),d[2].push(1)}for(a=1;o-1>a;a++)i[a]=f(c(3/(s[a-1]*s[a-1]),l[a-1]),c(3/(s[a]*s[a]),l[a])),d[0].push(a,a,a),d[1].push(a-1,a,a+1),d[2].push(1/s[a-1],2/s[a-1]+2/s[a],1/s[a]);switch(typeof n){case"undefined":i[o-1]=c(3/(s[o-2]*s[o-2]),l[o-2]),d[0].push(o-1,o-1),d[1].push(o-2,o-1),d[2].push(1/s[o-2],2/s[o-2]);break;case"string":d[1][d[1].length-1]=0;break;default:i[o-1]=n,d[0].push(o-1),d[1].push(o-1),d[2].push(1)}i="number"!=typeof i[0]?numeric.transpose(i):[i];var p=Array(i.length);if("string"==typeof r)for(a=p.length-1;-1!==a;--a)p[a]=numeric.ccsLUPSolve(numeric.ccsLUP(numeric.ccsScatter(d)),i[a]),p[a][o-1]=p[a][0];else for(a=p.length-1;-1!==a;--a)p[a]=numeric.cLUsolve(numeric.cLU(d),i[a]);return p="number"==typeof t[0]?p[0]:numeric.transpose(p),new numeric.Spline(e,t,t,p,p)},numeric.fftpow2=function f(e,t){var r=e.length;if(1!==r){var n,a,o=Math.cos,i=Math.sin,s=Array(r/2),l=Array(r/2),u=Array(r/2),c=Array(r/2);for(a=r/2,n=r-1;-1!==n;--n)--a,u[a]=e[n],c[a]=t[n],--n,s[a]=e[n],l[a]=t[n];f(s,l),f(u,c),a=r/2;var d,p,h,v=-6.283185307179586/r;for(n=r-1;-1!==n;--n)--a,-1===a&&(a=r/2-1),d=v*n,p=o(d),h=i(d),e[n]=s[a]+p*u[a]-h*c[a],t[n]=l[a]+p*c[a]+h*u[a]}},numeric._ifftpow2=function d(e,t){var r=e.length;if(1!==r){var n,a,o=Math.cos,i=Math.sin,s=Array(r/2),l=Array(r/2),u=Array(r/2),c=Array(r/2);for(a=r/2,n=r-1;-1!==n;--n)--a,u[a]=e[n],c[a]=t[n],--n,s[a]=e[n],l[a]=t[n];d(s,l),d(u,c),a=r/2;var f,p,h,v=6.283185307179586/r;for(n=r-1;-1!==n;--n)--a,-1===a&&(a=r/2-1),f=v*n,p=o(f),h=i(f),e[n]=s[a]+p*u[a]-h*c[a],t[n]=l[a]+p*c[a]+h*u[a]}},numeric.ifftpow2=function(e,t){numeric._ifftpow2(e,t),numeric.diveq(e,e.length),numeric.diveq(t,t.length)},numeric.convpow2=function(e,t,r,n){numeric.fftpow2(e,t),numeric.fftpow2(r,n);var a,o,i,s,l,u=e.length;for(a=u-1;-1!==a;--a)o=e[a],s=t[a],i=r[a],l=n[a],e[a]=o*i-s*l,t[a]=o*l+s*i;numeric.ifftpow2(e,t)},numeric.T.prototype.fft=function(){{var e,t,r=this.x,n=this.y,a=r.length,o=Math.log,i=o(2),s=Math.ceil(o(2*a-1)/i),l=Math.pow(2,s),u=numeric.rep([l],0),c=numeric.rep([l],0),f=Math.cos,d=Math.sin,p=-3.141592653589793/a,h=numeric.rep([l],0),v=numeric.rep([l],0);Math.floor(a/2)}for(e=0;a>e;e++)h[e]=r[e];if("undefined"!=typeof n)for(e=0;a>e;e++)v[e]=n[e];for(u[0]=1,e=1;l/2>=e;e++)t=p*e*e,u[e]=f(t),c[e]=d(t),u[l-e]=f(t),c[l-e]=d(t);var g=new numeric.T(h,v),m=new numeric.T(u,c);return g=g.mul(m),numeric.convpow2(g.x,g.y,numeric.clone(m.x),numeric.neg(m.y)),g=g.mul(m),g.x.length=a,g.y.length=a,g},numeric.T.prototype.ifft=function(){{var e,t,r=this.x,n=this.y,a=r.length,o=Math.log,i=o(2),s=Math.ceil(o(2*a-1)/i),l=Math.pow(2,s),u=numeric.rep([l],0),c=numeric.rep([l],0),f=Math.cos,d=Math.sin,p=3.141592653589793/a,h=numeric.rep([l],0),v=numeric.rep([l],0);Math.floor(a/2)}for(e=0;a>e;e++)h[e]=r[e];if("undefined"!=typeof n)for(e=0;a>e;e++)v[e]=n[e];for(u[0]=1,e=1;l/2>=e;e++)t=p*e*e,u[e]=f(t),c[e]=d(t),u[l-e]=f(t),c[l-e]=d(t);var g=new numeric.T(h,v),m=new numeric.T(u,c);return g=g.mul(m),numeric.convpow2(g.x,g.y,numeric.clone(m.x),numeric.neg(m.y)),g=g.mul(m),g.x.length=a,g.y.length=a,g.div(a)},numeric.gradient=function(e,t){var r=t.length,n=e(t);if(isNaN(n))throw new Error("gradient: f(x) is a NaN!");var a,o,i,s,l,u,c,f,d,p,h=Math.max,v=numeric.clone(t),g=Array(r),h=(numeric.div,numeric.sub,Math.max),m=.001,y=Math.abs,x=Math.min,b=0;for(a=0;r>a;a++)for(var w=h(1e-6*n,1e-8);;){if(++b,b>20)throw new Error("Numerical gradient fails");if(v[a]=t[a]+w,o=e(v),v[a]=t[a]-w,i=e(v),v[a]=t[a],isNaN(o)||isNaN(i))w/=16;else{if(g[a]=(o-i)/(2*w),l=t[a]-w,u=t[a],c=t[a]+w,f=(o-n)/w,d=(n-i)/w,p=h(y(g[a]),y(n),y(o),y(i),y(l),y(u),y(c),1e-8),s=x(h(y(f-g[a]),y(d-g[a]),y(f-d))/p,w/p),!(s>m))break;w/=16}}return g},numeric.uncmin=function(e,t,r,n,a,o,i){var s=numeric.gradient;"undefined"==typeof i&&(i={}),"undefined"==typeof r&&(r=1e-8),"undefined"==typeof n&&(n=function(t){return s(e,t)}),"undefined"==typeof a&&(a=1e3),t=numeric.clone(t);var l,u,c=t.length,f=e(t);if(isNaN(f))throw new Error("uncmin: f(x0) is a NaN!");var d=Math.max,p=numeric.norm2;r=d(r,numeric.epsilon);var h,v,g,m,y,x,b,w,_,k,z=i.Hinv||numeric.identity(c),j=numeric.dot,A=(numeric.inv,numeric.sub),M=numeric.add,E=numeric.tensor,S=numeric.div,T=numeric.mul,O=numeric.all,N=numeric.isFinite,F=numeric.neg,B=0,P="";for(v=n(t);a>B;){if("function"==typeof o&&o(B,t,f,v,z)){P="Callback returned true";break}if(!O(N(v))){P="Gradient has Infinity or NaN";break}if(h=F(j(z,v)),!O(N(h))){P="Search direction has Infinity or NaN";break}if(k=p(h),r>k){P="Newton step smaller than tol";break}for(_=1,u=j(v,h),y=t;a>B&&!(r>_*k)&&(m=T(h,_),y=M(t,m),l=e(y),l-f>=.1*_*u||isNaN(l));)_*=.5,++B;if(r>_*k){P="Line search step size smaller than tol";break}if(B===a){P="maxit reached during line search";break}g=n(y),x=A(g,v),w=j(x,m),b=j(z,x),z=A(M(z,T((w+j(x,b))/(w*w),E(m,m))),S(M(E(b,m),E(m,b)),w)),t=y,f=l,v=g,++B}return{solution:t,f:f,gradient:v,invHessian:z,iterations:B,message:P}},numeric.Dopri=function(e,t,r,n,a,o,i){this.x=e,this.y=t,this.f=r,this.ymid=n,this.iterations=a,this.events=i,this.message=o},numeric.Dopri.prototype._at=function(e,t){function r(e){return e*e}var n,a,o,i,s,l,e,u,c,f,d,p=this,h=p.x,v=p.y,g=p.f,m=p.ymid,y=(h.length,Math.floor,.5),x=numeric.add,b=numeric.mul,w=numeric.sub;return n=h[t],a=h[t+1],i=v[t],s=v[t+1],u=a-n,o=n+y*u,l=m[t],c=w(g[t],b(i,1/(n-o)+2/(n-a))),f=w(g[t+1],b(s,1/(a-o)+2/(a-n))),d=[r(e-a)*(e-o)/r(n-a)/(n-o),r(e-n)*r(e-a)/r(n-o)/r(a-o),r(e-n)*(e-o)/r(a-n)/(a-o),(e-n)*r(e-a)*(e-o)/r(n-a)/(n-o),(e-a)*r(e-n)*(e-o)/r(n-a)/(a-o)],x(x(x(x(b(i,d[0]),b(l,d[1])),b(s,d[2])),b(c,d[3])),b(f,d[4]))},numeric.Dopri.prototype.at=function(e){var t,r,n,a=Math.floor;if("number"!=typeof e){var o=e.length,i=Array(o);for(t=o-1;-1!==t;--t)i[t]=this.at(e[t]);return i}var s=this.x;for(t=0,r=s.length-1;r-t>1;)n=a(.5*(t+r)),s[n]<=e?t=n:r=n;return this._at(e,t)},numeric.dopri=function(e,t,r,n,a,o,i){"undefined"==typeof a&&(a=1e-6),"undefined"==typeof o&&(o=1e3);var s,l,u,c,f,d,p,h,v,g,m,y,x,b=[e],w=[r],_=[n(e,r)],k=[],z=.2,j=[.075,.225],A=[44/45,-56/15,32/9],M=[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],T=[.10013431883002395,0,.3918321794184259,-0.02982460176594817,.05893268337240795,-0.04497888809104361,.023904308236133973],O=[.2,.3,.8,8/9,1,1],N=[-71/57600,0,71/16695,-71/1920,17253/339200,-22/525,.025],F=0,B=(t-e)/10,P=0,q=numeric.add,I=numeric.mul,R=(Math.max,Math.min),V=Math.abs,C=numeric.norminf,U=Math.pow,D=numeric.any,L=numeric.lt,Y=numeric.and,H=(numeric.sub,new numeric.Dopri(b,w,_,k,-1,""));for("function"==typeof i&&(m=i(e,r));t>e&&o>P;)if(++P,e+B>t&&(B=t-e),s=n(e+O[0]*B,q(r,I(z*B,_[F]))),l=n(e+O[1]*B,q(q(r,I(j[0]*B,_[F])),I(j[1]*B,s))),u=n(e+O[2]*B,q(q(q(r,I(A[0]*B,_[F])),I(A[1]*B,s)),I(A[2]*B,l))),c=n(e+O[3]*B,q(q(q(q(r,I(M[0]*B,_[F])),I(M[1]*B,s)),I(M[2]*B,l)),I(M[3]*B,u))),f=n(e+O[4]*B,q(q(q(q(q(r,I(E[0]*B,_[F])),I(E[1]*B,s)),I(E[2]*B,l)),I(E[3]*B,u)),I(E[4]*B,c))),v=q(q(q(q(q(r,I(_[F],B*S[0])),I(l,B*S[2])),I(u,B*S[3])),I(c,B*S[4])),I(f,B*S[5])),d=n(e+B,v),p=q(q(q(q(q(I(_[F],B*N[0]),I(l,B*N[2])),I(u,B*N[3])),I(c,B*N[4])),I(f,B*N[5])),I(d,B*N[6])),g="number"==typeof p?V(p):C(p),g>a){if(B=.2*B*U(a/g,.25),e+B===e){H.msg="Step size became too small";break}}else{if(k[F]=q(q(q(q(q(q(r,I(_[F],B*T[0])),I(l,B*T[2])),I(u,B*T[3])),I(c,B*T[4])),I(f,B*T[5])),I(d,B*T[6])),++F,b[F]=e+B,w[F]=v,_[F]=d,"function"==typeof i){var W,X,G=e,Q=e+.5*B;if(y=i(Q,k[F-1]),x=Y(L(m,0),L(0,y)),D(x)||(G=Q,Q=e+B,m=y,y=i(Q,v),x=Y(L(m,0),L(0,y))),D(x)){for(var J,K,Z=0,$=1,et=1;;){if("number"==typeof m)X=(et*y*G-$*m*Q)/(et*y-$*m);else for(X=Q,h=m.length-1;-1!==h;--h)m[h]<0&&y[h]>0&&(X=R(X,(et*y[h]*G-$*m[h]*Q)/(et*y[h]-$*m[h])));if(G>=X||X>=Q)break;W=H._at(X,F-1),K=i(X,W),J=Y(L(m,0),L(0,K)),D(J)?(Q=X,y=K,x=J,et=1,-1===Z?$*=.5:$=1,Z=-1):(G=X,m=K,$=1,1===Z?et*=.5:et=1,Z=1)}return v=H._at(.5*(e+X),F-1),H.f[F]=n(X,W),H.x[F]=X,H.y[F]=W,H.ymid[F-1]=v,H.events=x,H.iterations=P,H}}e+=B,r=v,m=y,B=R(.8*B*U(a/g,.25),4*B)}return H.iterations=P,H},numeric.LU=function(e,t){t=t||!1;var r,n,a,o,i,s,l,u,c,f=Math.abs,d=e.length,p=d-1,h=new Array(d);for(t||(e=numeric.clone(e)),a=0;d>a;++a){for(l=a,s=e[a],c=f(s[a]),n=a+1;d>n;++n)o=f(e[n][a]),o>c&&(c=o,l=n);for(h[a]=l,l!=a&&(e[a]=e[l],e[l]=s,s=e[a]),i=s[a],r=a+1;d>r;++r)e[r][a]/=i;for(r=a+1;d>r;++r){for(u=e[r],n=a+1;p>n;++n)u[n]-=u[a]*s[n],++n,u[n]-=u[a]*s[n];n===p&&(u[n]-=u[a]*s[n])}}return{LU:e,P:h}},numeric.LUsolve=function(e,t){var r,n,a,o,i,s=e.LU,l=s.length,u=numeric.clone(t),c=e.P;for(r=l-1;-1!==r;--r)u[r]=t[r];for(r=0;l>r;++r)for(a=c[r],c[r]!==r&&(i=u[r],u[r]=u[a],u[a]=i),o=s[r],n=0;r>n;++n)u[r]-=u[n]*o[n];for(r=l-1;r>=0;--r){for(o=s[r],n=r+1;l>n;++n)u[r]-=u[n]*o[n];u[r]/=o[r]}return u},numeric.solve=function(e,t,r){return numeric.LUsolve(numeric.LU(e,r),t)},numeric.echelonize=function(e){var t,r,n,a,o,i,s,l,u=numeric.dim(e),c=u[0],f=u[1],d=numeric.identity(c),p=Array(c),h=Math.abs,v=numeric.diveq;for(e=numeric.clone(e),t=0;c>t;++t){for(n=0,o=e[t],i=d[t],r=1;f>r;++r)h(o[n])<h(o[r])&&(n=r);for(p[t]=n,v(i,o[n]),v(o,o[n]),r=0;c>r;++r)if(r!==t){for(s=e[r],l=s[n],a=f-1;-1!==a;--a)s[a]-=o[a]*l;for(s=d[r],a=c-1;-1!==a;--a)s[a]-=i[a]*l}}return{I:d,A:e,P:p}},numeric.__solveLP=function(e,t,r,n,a,o,i){var s,l,u,c,f=numeric.sum,d=(numeric.log,numeric.mul),p=numeric.sub,h=numeric.dot,v=numeric.div,g=numeric.add,m=e.length,y=r.length,x=!1,b=0,w=1,_=(numeric.transpose(t),numeric.svd,numeric.transpose),k=(numeric.leq,Math.sqrt),z=Math.abs,j=(numeric.muleq,numeric.norminf,numeric.any,Math.min),A=numeric.all,M=numeric.gt,E=Array(m),S=Array(y),T=(numeric.rep([y],1),numeric.solve),O=p(r,h(t,o)),N=h(e,e);for(u=b;a>u;++u){var F,B;for(F=y-1;-1!==F;--F)S[F]=v(t[F],O[F]);var P=_(S);for(F=m-1;-1!==F;--F)E[F]=f(P[F]);w=.25*z(N/h(e,E));var q=100*k(N/h(E,E));for((!isFinite(w)||w>q)&&(w=q),c=g(e,d(w,E)),l=h(P,S),F=m-1;-1!==F;--F)l[F][F]+=1;B=T(l,v(c,w),!0);var I=v(O,h(t,B)),R=1;for(F=y-1;-1!==F;--F)I[F]<0&&(R=j(R,-.999*I[F]));if(s=p(o,d(B,R)),O=p(r,h(t,s)),!A(M(O,0)))return{solution:o,message:"",iterations:u};if(o=s,n>w)return{solution:s,message:"",iterations:u};if(i){var V=h(e,c),C=h(t,c);for(x=!0,F=y-1;-1!==F;--F)if(V*C[F]<0){x=!1;break}}else x=o[m-1]>=0?!1:!0;if(x)return{solution:s,message:"Unbounded",iterations:u}}return{solution:o,message:"maximum iteration count exceeded",iterations:u}},numeric._solveLP=function(e,t,r,n,a){var o,i=e.length,s=r.length,l=(numeric.sum,numeric.log,numeric.mul,numeric.sub),u=numeric.dot,c=(numeric.div,numeric.add,numeric.rep([i],0).concat([1])),f=numeric.rep([s,1],-1),d=numeric.blockMatrix([[t,f]]),p=r,o=numeric.rep([i],0).concat(Math.max(0,numeric.sup(numeric.neg(r)))+1),h=numeric.__solveLP(c,d,p,n,a,o,!1),v=numeric.clone(h.solution);v.length=i;var g=numeric.inf(l(r,u(t,v)));if(0>g)return{solution:0/0,message:"Infeasible",iterations:h.iterations};var m=numeric.__solveLP(e,t,r,n,a-h.iterations,v,!0);return m.iterations+=h.iterations,m},numeric.solveLP=function(e,t,r,n,a,o,i){if("undefined"==typeof i&&(i=1e3),"undefined"==typeof o&&(o=numeric.epsilon),"undefined"==typeof n)return numeric._solveLP(e,t,r,o,i);var s,l=n.length,u=n[0].length,c=t.length,f=numeric.echelonize(n),d=numeric.rep([u],0),p=f.P,h=[];for(s=p.length-1;-1!==s;--s)d[p[s]]=1;for(s=u-1;-1!==s;--s)0===d[s]&&h.push(s);var v=numeric.getRange,g=numeric.linspace(0,l-1),m=numeric.linspace(0,c-1),y=v(n,g,h),x=v(t,m,p),b=v(t,m,h),w=numeric.dot,_=numeric.sub,k=w(x,f.I),z=_(b,w(k,y)),j=_(r,w(k,a)),A=Array(p.length),M=Array(h.length);for(s=p.length-1;-1!==s;--s)A[s]=e[p[s]];for(s=h.length-1;-1!==s;--s)M[s]=e[h[s]];var E=_(M,w(A,w(f.I,y))),S=numeric._solveLP(E,z,j,o,i),T=S.solution;if(T!==T)return S;var O=w(f.I,_(a,w(y,T))),N=Array(e.length);for(s=p.length-1;-1!==s;--s)N[p[s]]=O[s];for(s=h.length-1;-1!==s;--s)N[h[s]]=T[s];return{solution:N,message:S.message,iterations:S.iterations}},numeric.MPStoLP=function(e){function t(t){throw new Error("MPStoLP: "+t+"\nLine "+r+": "+e[r]+"\nCurrent state: "+s[i]+"\n")}e instanceof String&&e.split("\n");var r,n,a,o,i=0,s=["Initial state","NAME","ROWS","COLUMNS","RHS","BOUNDS","ENDATA"],l=e.length,u=0,c={},f=[],d=0,p={},h=0,v=[],g=[],m=[];for(r=0;l>r;++r){a=e[r];var y=a.match(/\S*/g),x=[];for(n=0;n<y.length;++n)""!==y[n]&&x.push(y[n]);if(0!==x.length){for(n=0;n<s.length&&a.substr(0,s[n].length)!==s[n];++n);if(n<s.length){if(i=n,1===n&&(o=x[1]),6===n)return{name:o,c:v,A:numeric.transpose(g),b:m,rows:c,vars:p}}else switch(i){case 0:case 1:t("Unexpected line");case 2:switch(x[0]){case"N":0===u?u=x[1]:t("Two or more N rows");break;case"L":c[x[1]]=d,f[d]=1,m[d]=0,++d;break;case"G":c[x[1]]=d,f[d]=-1,m[d]=0,++d;break;case"E":c[x[1]]=d,f[d]=0,m[d]=0,++d;break;default:t("Parse error "+numeric.prettyPrint(x))}break;case 3:p.hasOwnProperty(x[0])||(p[x[0]]=h,v[h]=0,g[h]=numeric.rep([d],0),++h);var b=p[x[0]];for(n=1;n<x.length;n+=2)if(x[n]!==u){var w=c[x[n]];g[b][w]=(f[w]<0?-1:1)*parseFloat(x[n+1])}else v[b]=parseFloat(x[n+1]);break;case 4:for(n=1;n<x.length;n+=2)m[c[x[n]]]=(f[c[x[n]]]<0?-1:1)*parseFloat(x[n+1]);break;case 5:break;case 6:t("Internal error")}}}t("Reached end of file without ENDATA")},numeric.seedrandom={pow:Math.pow,random:Math.random},function(e,t,r,n,a,o,i){function s(e){var t,n,a=this,o=e.length,i=0,s=a.i=a.j=a.m=0;for(a.S=[],a.c=[],o||(e=[o++]);r>i;)a.S[i]=i++;for(i=0;r>i;i++)t=a.S[i],s=c(s+t+e[i%o]),n=a.S[s],a.S[i]=n,a.S[s]=t;a.g=function(e){var t=a.S,n=c(a.i+1),o=t[n],i=c(a.j+o),s=t[i];t[n]=s,t[i]=o;for(var l=t[c(o+s)];--e;)n=c(n+1),o=t[n],i=c(i+o),s=t[i],t[n]=s,t[i]=o,l=l*r+t[c(o+s)];return a.i=n,a.j=i,l},a.g(r)}function l(e,t,r,n,a){if(r=[],a=typeof e,t&&"object"==a)for(n in e)if(n.indexOf("S")<5)try{r.push(l(e[n],t-1))}catch(o){}return r.length?r:e+("string"!=a?"\x00":"")}function u(e,t,r,n){for(e+="",r=0,n=0;n<e.length;n++)t[c(n)]=c((r^=19*t[c(n)])+e.charCodeAt(n));e="";for(n in t)e+=String.fromCharCode(t[n]);return e}function c(e){return e&r-1}t.seedrandom=function(c,f){var d,p=[];return c=u(l(f?[c,e]:arguments.length?c:[(new Date).getTime(),e,window],3),p),d=new s(p),u(d.S,e),t.random=function(){for(var e=d.g(n),t=i,s=0;a>e;)e=(e+s)*r,t*=r,s=d.g(1);for(;e>=o;)e/=2,t/=2,s>>>=1;return(e+s)/t},c},i=t.pow(r,n),a=t.pow(2,a),o=2*a,u(t.random(),e)}([],numeric.seedrandom,256,6,52),function(e){function t(e){if("object"!=typeof e)return e;var r,n=[],a=e.length;for(r=0;a>r;r++)n[r+1]=t(e[r]);return n}function r(e){if("object"!=typeof e)return e;var t,n=[],a=e.length;for(t=1;a>t;t++)n[t-1]=r(e[t]);return n}function n(e,t,r){var n,a,o,i,s;for(o=1;r>=o;o+=1){for(e[o][o]=1/e[o][o],s=-e[o][o],n=1;o>n;n+=1)e[n][o]=s*e[n][o];if(i=o+1,i>r)break;for(a=i;r>=a;a+=1)for(s=e[o][a],e[o][a]=0,n=1;o>=n;n+=1)e[n][a]=e[n][a]+s*e[n][o]}}function a(e,t,r,n){var a,o,i,s;for(o=1;r>=o;o+=1){for(s=0,a=1;o>a;a+=1)s+=e[a][o]*n[a];n[o]=(n[o]-s)/e[o][o]}for(i=1;r>=i;i+=1)for(o=r+1-i,n[o]=n[o]/e[o][o],s=-n[o],a=1;o>a;a+=1)n[a]=n[a]+s*e[a][o]}function o(e,t,r,n){var a,o,i,s,l,u;for(o=1;r>=o;o+=1){if(n[1]=o,u=0,i=o-1,1>i){if(u=e[o][o]-u,0>=u)break;e[o][o]=Math.sqrt(u)}else{for(s=1;i>=s;s+=1){for(l=e[s][o],a=1;s>a;a+=1)l-=e[a][o]*e[a][s];l/=e[s][s],e[s][o]=l,u+=l*l}if(u=e[o][o]-u,0>=u)break;e[o][o]=Math.sqrt(u)}n[1]=0}}function i(e,t,r,i,s,l,u,c,f,d,p,h,v,g,m,y){function x(){for(g[1]=g[1]+1,A=F,z=1;d>=z;z+=1){for(A+=1,V=-c[z],j=1;i>=j;j+=1)V+=u[j][z]*s[j];if(Math.abs(V)<X&&(V=0),z>p)m[A]=V;else if(m[A]=-Math.abs(V),V>0){for(j=1;i>=j;j+=1)u[j][z]=-u[j][z];c[z]=-c[z]}}for(z=1;v>=z;z+=1)m[F+h[z]]=0;for(P=0,R=0,z=1;d>=z;z+=1)m[F+z]<R*m[I+z]&&(P=z,R=m[F+z]/m[I+z]);return 0===P?999:0}function b(){for(z=1;i>=z;z+=1){for(V=0,j=1;i>=j;j+=1)V+=e[j][z]*u[j][P];m[z]=V}for(M=T,z=1;i>=z;z+=1)m[M+z]=0;for(j=v+1;i>=j;j+=1)for(z=1;i>=z;z+=1)m[M+z]=m[M+z]+e[z][j]*m[j];for(H=!0,z=v;z>=1;z-=1){for(V=m[z],A=N+z*(z+3)/2,M=A-z,j=z+1;v>=j;j+=1)V-=m[A]*m[O+j],A+=j;if(V/=m[M],m[O+z]=V,h[z]<p)break;if(0>V)break;H=!1,S=z}if(!H)for(C=m[B+S]/m[O+S],z=1;v>=z&&!(h[z]<p)&&!(m[O+z]<0);z+=1)R=m[B+z]/m[O+z],C>R&&(C=R,S=z);for(V=0,z=T+1;T+i>=z;z+=1)V+=m[z]*m[z];if(Math.abs(V)<=X){if(H)return y[1]=1,999;for(z=1;v>=z;z+=1)m[B+z]=m[B+z]-C*m[O+z];return m[B+v+1]=m[B+v+1]+C,700}for(V=0,z=1;i>=z;z+=1)V+=m[T+z]*u[z][P];for(U=-m[F+P]/V,W=!0,H||U>C&&(U=C,W=!1),z=1;i>=z;z+=1)s[z]=s[z]+U*m[T+z],Math.abs(s[z])<X&&(s[z]=0);for(l[1]=l[1]+U*V*(U/2+m[B+v+1]),z=1;v>=z;z+=1)m[B+z]=m[B+z]-U*m[O+z];if(m[B+v+1]=m[B+v+1]+U,!W){for(V=-c[P],j=1;i>=j;j+=1)V+=s[j]*u[j][P];if(P>p)m[F+P]=V;else if(m[F+P]=-Math.abs(V),V>0){for(j=1;i>=j;j+=1)u[j][P]=-u[j][P];c[P]=-c[P]}return 700}for(v+=1,h[v]=P,A=N+(v-1)*v/2+1,z=1;v-1>=z;z+=1)m[A]=m[z],A+=1;if(v===i)m[A]=m[i];else{for(z=i;z>=v+1&&0!==m[z]&&(D=Math.max(Math.abs(m[z-1]),Math.abs(m[z])),L=Math.min(Math.abs(m[z-1]),Math.abs(m[z])),R=m[z-1]>=0?Math.abs(D*Math.sqrt(1+L*L/(D*D))):-Math.abs(D*Math.sqrt(1+L*L/(D*D))),D=m[z-1]/R,L=m[z]/R,1!==D);z-=1)if(0===D)for(m[z-1]=L*R,j=1;i>=j;j+=1)R=e[j][z-1],e[j][z-1]=e[j][z],e[j][z]=R;else for(m[z-1]=R,Y=L/(1+D),j=1;i>=j;j+=1)R=D*e[j][z-1]+L*e[j][z],e[j][z]=Y*(e[j][z-1]+R)-e[j][z],e[j][z-1]=R;m[A]=m[v]}return 0}function w(){if(A=N+S*(S+1)/2+1,M=A+S,0===m[M])return 798;if(D=Math.max(Math.abs(m[M-1]),Math.abs(m[M])),L=Math.min(Math.abs(m[M-1]),Math.abs(m[M])),R=m[M-1]>=0?Math.abs(D*Math.sqrt(1+L*L/(D*D))):-Math.abs(D*Math.sqrt(1+L*L/(D*D))),D=m[M-1]/R,L=m[M]/R,1===D)return 798;if(0===D){for(z=S+1;v>=z;z+=1)R=m[M-1],m[M-1]=m[M],m[M]=R,M+=z;for(z=1;i>=z;z+=1)R=e[z][S],e[z][S]=e[z][S+1],e[z][S+1]=R}else{for(Y=L/(1+D),z=S+1;v>=z;z+=1)R=D*m[M-1]+L*m[M],m[M]=Y*(m[M-1]+R)-m[M],m[M-1]=R,M+=z;for(z=1;i>=z;z+=1)R=D*e[z][S]+L*e[z][S+1],e[z][S+1]=Y*(e[z][S]+R)-e[z][S+1],e[z][S]=R}return 0}function _(){for(M=A-S,z=1;S>=z;z+=1)m[M]=m[A],A+=1,M+=1;return m[B+S]=m[B+S+1],h[S]=h[S+1],S+=1,v>S?797:0}function k(){return m[B+v]=m[B+v+1],m[B+v+1]=0,h[v]=0,v-=1,g[2]=g[2]+1,0}var z,j,A,M,E,S,T,O,N,F,B,P,q,I,R,V,C,U,D,L,Y,H,W,X,G,Q,J;q=Math.min(i,d),A=2*i+q*(q+5)/2+2*d+1,X=1e-60;do X+=X,G=1+.1*X,Q=1+.2*X;while(1>=G||1>=Q);for(z=1;i>=z;z+=1)m[z]=t[z];for(z=i+1;A>=z;z+=1)m[z]=0;for(z=1;d>=z;z+=1)h[z]=0;if(E=[],0===y[1]){if(o(e,r,i,E),0!==E[1])return void(y[1]=2);a(e,r,i,t),n(e,r,i)}else{for(j=1;i>=j;j+=1)for(s[j]=0,z=1;j>=z;z+=1)s[j]=s[j]+e[z][j]*t[z];for(j=1;i>=j;j+=1)for(t[j]=0,z=j;i>=z;z+=1)t[j]=t[j]+e[j][z]*s[z]}for(l[1]=0,j=1;i>=j;j+=1)for(s[j]=t[j],l[1]=l[1]+m[j]*s[j],m[j]=0,z=j+1;i>=z;z+=1)e[z][j]=0;for(l[1]=-l[1]/2,y[1]=0,T=i,O=T+i,B=O+q,N=B+q+1,F=N+q*(q+1)/2,I=F+d,z=1;d>=z;z+=1){for(V=0,j=1;i>=j;j+=1)V+=u[j][z]*u[j][z];m[I+z]=Math.sqrt(V)}for(v=0,g[1]=0,g[2]=0,J=0;;){if(J=x(),999===J)return;for(;;){if(J=b(),0===J)break;if(999===J)return;if(700===J)if(S===v)k();else{for(;;)if(w(),J=_(),797!==J)break;k()}}}}function s(e,n,a,o,s,l){e=t(e),n=t(n),a=t(a);var u,c,f,d,p,h,v=[],g=[],m=[],y=[],x=[];if(s=s||0,l=l?t(l):[void 0,0],o=o?t(o):[],c=e.length-1,f=a[1].length-1,!o)for(u=1;f>=u;u+=1)o[u]=0;for(u=1;f>=u;u+=1)g[u]=0;for(d=0,p=Math.min(c,f),u=1;c>=u;u+=1)m[u]=0;for(v[1]=0,u=1;2*c+p*(p+5)/2+2*f+1>=u;u+=1)y[u]=0;for(u=1;2>=u;u+=1)x[u]=0;return i(e,n,c,c,m,v,a,o,c,f,s,g,d,x,y,l),h="",1===l[1]&&(h="constraints are inconsistent, no solution!"),2===l[1]&&(h="matrix D in quadratic function is not positive definite!"),{solution:r(m),value:r(v),unconstrained_solution:r(n),iterations:r(x),iact:r(g),message:h}}e.solveQP=s}(numeric),numeric.svd=function(e){function t(e,t){return e=Math.abs(e),t=Math.abs(t),e>t?e*Math.sqrt(1+t*t/e/e):0==t?e:t*Math.sqrt(1+e*e/t/t)}var r,n=numeric.epsilon,a=1e-64/n,o=50,i=0,s=0,l=0,u=0,c=0,f=numeric.clone(e),d=f.length,p=f[0].length;if(p>d)throw"Need more rows than columns";var h=new Array(p),v=new Array(p);for(s=0;p>s;s++)h[s]=v[s]=0;var g=numeric.rep([p,p],0),m=0,y=0,x=0,b=0,w=0,_=0,k=0;for(s=0;p>s;s++){for(h[s]=y,k=0,c=s+1,l=s;d>l;l++)k+=f[l][s]*f[l][s];if(a>=k)y=0;else for(m=f[s][s],y=Math.sqrt(k),m>=0&&(y=-y),x=m*y-k,f[s][s]=m-y,l=c;p>l;l++){for(k=0,u=s;d>u;u++)k+=f[u][s]*f[u][l];for(m=k/x,u=s;d>u;u++)f[u][l]+=m*f[u][s]}for(v[s]=y,k=0,l=c;p>l;l++)k+=f[s][l]*f[s][l];if(a>=k)y=0;else{for(m=f[s][s+1],y=Math.sqrt(k),m>=0&&(y=-y),x=m*y-k,f[s][s+1]=m-y,l=c;p>l;l++)h[l]=f[s][l]/x;for(l=c;d>l;l++){for(k=0,u=c;p>u;u++)k+=f[l][u]*f[s][u];for(u=c;p>u;u++)f[l][u]+=k*h[u]}}w=Math.abs(v[s])+Math.abs(h[s]),w>b&&(b=w)}for(s=p-1;-1!=s;s+=-1){if(0!=y){for(x=y*f[s][s+1],l=c;p>l;l++)g[l][s]=f[s][l]/x;for(l=c;p>l;l++){for(k=0,u=c;p>u;u++)k+=f[s][u]*g[u][l];for(u=c;p>u;u++)g[u][l]+=k*g[u][s]}}for(l=c;p>l;l++)g[s][l]=0,g[l][s]=0;g[s][s]=1,y=h[s],c=s}for(s=p-1;-1!=s;s+=-1){for(c=s+1,y=v[s],l=c;p>l;l++)f[s][l]=0;if(0!=y){for(x=f[s][s]*y,l=c;p>l;l++){for(k=0,u=c;d>u;u++)k+=f[u][s]*f[u][l];for(m=k/x,u=s;d>u;u++)f[u][l]+=m*f[u][s]}for(l=s;d>l;l++)f[l][s]=f[l][s]/y}else for(l=s;d>l;l++)f[l][s]=0;f[s][s]+=1}for(n*=b,u=p-1;-1!=u;u+=-1)for(var z=0;o>z;z++){var j=!1;for(c=u;-1!=c;c+=-1){if(Math.abs(h[c])<=n){j=!0;break}if(Math.abs(v[c-1])<=n)break}if(!j){i=0,k=1;var A=c-1;for(s=c;u+1>s&&(m=k*h[s],h[s]=i*h[s],!(Math.abs(m)<=n));s++)for(y=v[s],x=t(m,y),v[s]=x,i=y/x,k=-m/x,l=0;d>l;l++)w=f[l][A],_=f[l][s],f[l][A]=w*i+_*k,f[l][s]=-w*k+_*i}if(_=v[u],c==u){if(0>_)for(v[u]=-_,l=0;p>l;l++)g[l][u]=-g[l][u];break}if(z>=o-1)throw"Error: no convergence.";for(b=v[c],w=v[u-1],y=h[u-1],x=h[u],m=((w-_)*(w+_)+(y-x)*(y+x))/(2*x*w),y=t(m,1),m=0>m?((b-_)*(b+_)+x*(w/(m-y)-x))/b:((b-_)*(b+_)+x*(w/(m+y)-x))/b,i=1,k=1,s=c+1;u+1>s;s++){for(y=h[s],w=v[s],x=k*y,y=i*y,_=t(m,x),h[s-1]=_,i=m/_,k=x/_,m=b*i+y*k,y=-b*k+y*i,x=w*k,w*=i,l=0;p>l;l++)b=g[l][s-1],_=g[l][s],g[l][s-1]=b*i+_*k,g[l][s]=-b*k+_*i;for(_=t(m,x),v[s-1]=_,i=m/_,k=x/_,m=i*y+k*w,b=-k*y+i*w,l=0;d>l;l++)w=f[l][s-1],_=f[l][s],f[l][s-1]=w*i+_*k,f[l][s]=-w*k+_*i}h[c]=0,h[u]=m,v[u]=b}for(s=0;s<v.length;s++)v[s]<n&&(v[s]=0);for(s=0;p>s;s++)for(l=s-1;l>=0;l--)if(v[l]<v[s]){for(i=v[l],v[l]=v[s],v[s]=i,u=0;u<f.length;u++)r=f[u][s],f[u][s]=f[u][l],f[u][l]=r;for(u=0;u<g.length;u++)r=g[u][s],g[u][s]=g[u][l],g[u][l]=r;s=l}return{U:f,S:v,V:g}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],9:[function(e,t){!function(){"use strict";function e(e,t){var r=e.x-t.x,n=e.y-t.y;return r*r+n*n}function r(e,t,r){var n=t.x,a=t.y,o=r.x-n,i=r.y-a;if(0!==o||0!==i){var s=((e.x-n)*o+(e.y-a)*i)/(o*o+i*i);s>1?(n=r.x,a=r.y):s>0&&(n+=o*s,a+=i*s)}return o=e.x-n,i=e.y-a,o*o+i*i}function n(t,r){for(var n,a=t[0],o=[a],i=1,s=t.length;s>i;i++)n=t[i],e(n,a)>r&&(o.push(n),a=n);return a!==n&&o.push(n),o}function a(e,t){var n,a,o,i,s=e.length,l="undefined"!=typeof Uint8Array?Uint8Array:Array,u=new l(s),c=0,f=s-1,d=[],p=[];for(u[c]=u[f]=1;f;){for(a=0,n=c+1;f>n;n++)o=r(e[n],e[c],e[f]),o>a&&(i=n,a=o);a>t&&(u[i]=1,d.push(c,i,i,f)),f=d.pop(),c=d.pop()}for(n=0;s>n;n++)u[n]&&p.push(e[n]);return p}function o(e,t,r){var o=void 0!==t?t*t:1;return e=r?e:n(e,o),e=a(e,o)}"function"==typeof define&&define.amd?define(function(){return o}):"undefined"!=typeof t?t.exports=o:"undefined"!=typeof self?self.simplify=o:window.simplify=o}()},{}],10:[function(e,t){"use strict";function r(e,t,r,n){this.points=e,this.ids=t,this.dimension=n,this.length=r}function n(e){var t,n,a;if(Array.isArray(e)){if(t=e.length,0===t)return new r(null,null,0,0);n=e[0].length,a=o(c.mallocDouble(t*(n+1)),[t,n+1]),s(e,a.hi(t,n))}else{t=e.shape[0],n=e.shape[1];var p=e.dtype;p="int8"===p||"int16"===p||"int32"===p?"int32":"uint8"===p||"uint8_clamped"===p||"buffer"===p||"uint16"===p||"uint32"===p?"uint32":"float32"===p?"float32":"float64",a=o(c.malloc(t*(n+1)),[t,n+1]),l.assign(a.hi(t,n),e)}for(var h=0;t>h;++h)a.set(h,n,h);for(var v=u.malloc([t,n],e.dtype),g=c.mallocInt32(t),m=0,y=v.data,x=a.data,b=(d.log2(d.nextPow2(t)),i.compile(a.order,!0,a.dtype)),w=[a];t>m;){var _=w.shift(),k=_,z=0|k.shape[0];if(z>1){var j,A=d.log2(m+1)%n,M=f.root(z);j=b(k,M,function(e,t){return e.get(A)-t.get(A)});for(var E=v.index(m,0),S=j.offset,h=0;n>h;++h)y[E++]=x[S++];g[m]=x[S],m+=1,w.push(k.hi(M)),z>2&&w.push(k.lo(M+1))}else{for(var S=k.offset,E=v.index(m,0),h=0;n>h;++h)y[E+h]=x[S++];g[m]=x[S],m+=1}}return c.free(a.data),new r(v,g,t,n)}function a(e){var t=e.p,n=e.i;if(t){for(var a=t.length,i=c.mallocFloat64(a),s=0;a>s;++s)i[s]=t[s];for(var l=n.length,u=c.mallocInt32(l),s=0;l>s;++s)u[s]=n[s];var f=a/l|0;return new r(o(i,[l,f]),u,l,f)}return new r(null,null,0,e.d)}t.exports=n,t.exports.deserialize=a;var o=e("ndarray"),i=e("ndarray-select"),s=e("ndarray-pack"),l=e("ndarray-ops"),u=e("ndarray-scratch"),c=e("typedarray-pool"),f=e("inorder-tree-layout"),d=e("bit-twiddle"),p=e("./lib/heap.js"),h=r.prototype;
h.serialize=function(){return this.length>0?{p:Array.prototype.slice.call(this.points.data,0,this.length*this.dimension),i:Array.prototype.slice.call(this.ids,0,this.length)}:{d:this.dimension}},h.range=function(e,t,r){var n=this.length;if(!(1>n)){for(var a=this.dimension,o=0;a>o;++o)if(t[o]<e[o])return;var i,l=this.points,f=this.ids,p=u.malloc([n,2,a]),h=c.mallocInt32(n),v=p.data,g=l.data,m=1,y=0;for(h[0]=0,s(e,p.pick(0,0)),s(t,p.pick(0,1));m>y;){for(var x=h[y],b=d.log2(x+1)%a,w=p.index(y,0,0),_=p.index(y,1,0),k=l.index(x,0),z=!0,o=0;a>o;++o){var j=g[k+o];if(j<v[w+o]||v[_+o]<j){z=!1;break}}if(z&&(i=r(f[x]),void 0!==i))break;var A=g[k+b],M=v[_+b],E=v[w+b];if(A>=E){var S=2*x+1;if(n>S){h[m]=S;for(var T=p.index(m,0,0),o=0;a>o;++o)v[T+o]=v[w+o];for(var O=p.index(m,1,0),o=0;a>o;++o)v[O+o]=v[_+o];v[O+b]=Math.min(M,A),m+=1}}if(M>=A){var N=2*(x+1);if(n>N){h[m]=N;for(var T=p.index(m,0,0),o=0;a>o;++o)v[T+o]=v[w+o];for(var O=p.index(m,1,0),o=0;a>o;++o)v[O+o]=v[_+o];v[T+b]=Math.max(E,A),m+=1}}y+=1}return u.free(p),c.free(h),i}},h.rnn=function(e,t,r){if(!(0>t)){var n=this.length;if(!(1>n)){var a,o=this.dimension,i=this.points,s=this.ids,l=u.malloc([n,o]),f=c.mallocInt32(n),p=l.data,h=i.data,v=1,g=0,m=t*t;f[0]=0;for(var y=0;o>y;++y)l.set(0,y,0);for(;v>g;){for(var x=f[g],b=i.index(x,0),w=0,y=0;o>y;++y)w+=Math.pow(e[y]-h[b+y],2);if(m>=w&&(a=r(s[x]),void 0!==a))break;for(var _=d.log2(x+1)%o,k=0,z=l.index(g,0),y=0;o>y;++y)y!==_&&(k+=p[z+y]);var j=e[_],A=h[b+_],M=p[z+_],E=M,S=M;A>j?S=Math.max(M,Math.pow(A-j,2)):E=Math.max(M,Math.pow(A-j,2));var T=E+k,O=S+k;if(m>=T){var N=2*x+1;if(n>N){f[v]=N;for(var F=l.index(v,0),y=0;o>y;++y)p[F+y]=p[z+y];p[F+_]=E,v+=1}}if(m>=O){var B=2*(x+1);if(n>B){f[v]=B;for(var F=l.index(v,0),y=0;o>y;++y)p[F+y]=p[z+y];p[F+_]=S,v+=1}}g+=1}return u.free(l),c.free(f),a}}},h.nn=function(e,t){var r=this.length;if(1>r)return-1;if("number"==typeof t){if(0>t)return-1}else t=1/0;var n=this.dimension,a=this.points,o=a.data,i=c.mallocFloat64(n),s=new p(r,n+1),l=s.index,u=s.data;l[0]=0;for(var f=0;n>=f;++f)u[f]=0;s.count+=1;for(var h=-1,v=t;s.count>0&&!(u[0]>=v);){for(var g=l[0],m=a.index(g,0),y=0,f=0;n>f;++f)y+=Math.pow(e[f]-o[m+f],2);v>y&&(v=y,h=g);for(var x=d.log2(g+1)%n,b=0,f=0;n>f;++f){var w=u[f+1];f!==x&&(b+=w),i[f]=w}var _=e[x],k=o[m+x],z=i[x],j=z,A=z;k>_?A=Math.max(z,Math.pow(k-_,2)):j=Math.max(z,Math.pow(k-_,2));var M=j+b,E=A+b;if(s.pop(),v>M){var S=2*g+1;if(r>S){var T=s.count;l[T]=S;var O=T*(n+1);u[O]=M;for(var f=1;n>=f;++f)u[O+f]=i[f-1];u[O+x+1]=j,s.push()}}if(v>E){var N=2*(g+1);if(r>N){var T=s.count;l[T]=N;var O=T*(n+1);u[O]=E;for(var f=1;n>=f;++f)u[O+f]=i[f-1];u[O+x+1]=A,s.push()}}}return c.freeFloat64(i),s.dispose(),0>h?-1:this.ids[h]},h.knn=function(e,t,r){if("number"==typeof r){if(0>r)return[]}else r=1/0;var n=this.length;if(1>n)return[];if("number"==typeof t){if(0>=t)return[];t=0|Math.min(t,n)}else t=n;var a=this.ids,o=this.dimension,i=this.points,s=i.data,l=c.mallocFloat64(o),u=new p(t,1),f=u.index,h=u.data,v=new p(n,o+1),g=v.index,m=v.data;g[0]=0;for(var y=0;o>=y;++y)m[y]=0;v.count+=1;for(var x=r;v.count>0&&!(m[0]>=x);){for(var b=g[0],w=i.index(b,0),_=0,y=0;o>y;++y)_+=Math.pow(e[y]-s[w+y],2);if(x>_){u.count>=t&&u.pop();var k=u.count;f[k]=b,h[k]=-_,u.push(),u.count>=t&&(x=-h[0])}for(var z=d.log2(b+1)%o,j=0,y=0;o>y;++y){var A=m[y+1];y!==z&&(j+=A),l[y]=A}var M=e[z],E=s[w+z],S=l[z],T=S,O=S;E>M?O=Math.max(S,Math.pow(E-M,2)):T=Math.max(S,Math.pow(E-M,2));var N=T+j,F=O+j;if(v.pop(),x>N){var B=2*b+1;if(n>B){var P=v.count;g[P]=B;var q=P*(o+1);m[q]=N;for(var y=1;o>=y;++y)m[q+y]=l[y-1];m[q+z+1]=T,v.push()}}if(x>F){var I=2*(b+1);if(n>I){var P=v.count;g[P]=I;var q=P*(o+1);m[q]=F;for(var y=1;o>=y;++y)m[q+y]=l[y-1];m[q+z+1]=O,v.push()}}}c.freeFloat64(l),v.dispose();for(var R=new Array(u.count),a=this.ids,y=u.count-1;y>=0;--y)R[y]=a[f[0]],u.pop();return u.dispose(),R},h.dispose=function(){c.free(this.points.data),c.freeInt32(this.ids),this.points=null,this.ids=null,this.length=0}},{"./lib/heap.js":11,"bit-twiddle":12,"inorder-tree-layout":13,ndarray:31,"ndarray-ops":15,"ndarray-pack":20,"ndarray-scratch":29,"ndarray-select":30,"typedarray-pool":34}],11:[function(e,t){"use strict";function r(e){return 1&e?e-1>>1:(e>>1)-1}function n(e,t){this.count=0,this.dataSize=t,this.index=a.mallocInt32(e),this.data=a.mallocFloat64(e*t)}t.exports=n;var a=e("typedarray-pool"),o=n.prototype;o.heapSwap=function(e,t){var r=this.data,n=this.index,a=this.dataSize,o=n[e];n[e]=n[t],n[t]=o;for(var i=a*e,s=a*t,l=0;a>l;++l){var u=r[i];r[i]=r[s],r[s]=u,i+=1,s+=1}},o.heapUp=function(e){for(var t=this.dataSize,n=(this.index,this.data),a=n[t*e];e>0;){var o=r(e);if(o>=0){var i=n[t*o];if(i>a){this.heapSwap(e,o),e=o;continue}}break}},o.heapDown=function(e){for(var t=this.dataSize,r=(this.index,this.data),n=this.count,a=r[t*e];;){var o=a,i=2*e+1,s=2*(e+1),l=e;if(n>i){var u=r[t*i];o>u&&(l=i,o=u)}if(n>s){var c=r[t*s];o>c&&(l=s)}if(l===e)break;this.heapSwap(e,l),e=l}},o.pop=function(){this.count-=1,this.heapSwap(0,this.count),this.heapDown(0)},o.push=function(){this.heapUp(this.count),this.count+=1},o.dispose=function(){a.freeInt32(this.index),a.freeFloat64(this.data)}},{"typedarray-pool":34}],12:[function(e,t,r){"use strict";"use restrict";function n(e){var t=32;return e&=-e,e&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}var a=32;r.INT_BITS=a,r.INT_MAX=2147483647,r.INT_MIN=-1<<a-1,r.sign=function(e){return(e>0)-(0>e)},r.abs=function(e){var t=e>>a-1;return(e^t)-t},r.min=function(e,t){return t^(e^t)&-(t>e)},r.max=function(e,t){return e^(e^t)&-(t>e)},r.isPow2=function(e){return!(e&e-1||!e)},r.log2=function(e){var t,r;return t=(e>65535)<<4,e>>>=t,r=(e>255)<<3,e>>>=r,t|=r,r=(e>15)<<2,e>>>=r,t|=r,r=(e>3)<<1,e>>>=r,t|=r,t|e>>1},r.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},r.popCount=function(e){return e-=e>>>1&1431655765,e=(858993459&e)+(e>>>2&858993459),16843009*(e+(e>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1},r.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e-(e>>>1)},r.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,e&=15,27030>>>e&1};var o=new Array(256);!function(e){for(var t=0;256>t;++t){var r=t,n=t,a=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--a;e[t]=n<<a&255}}(o),r.reverse=function(e){return o[255&e]<<24|o[e>>>8&255]<<16|o[e>>>16&255]<<8|o[e>>>24&255]},r.interleave2=function(e,t){return e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1},r.deinterleave2=function(e,t){return e=e>>>t&1431655765,e=858993459&(e|e>>>1),e=252645135&(e|e>>>2),e=16711935&(e|e>>>4),e=65535&(e|e>>>16),e<<16>>16},r.interleave3=function(e,t,r){return e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e|=t<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),e|r<<2},r.deinterleave3=function(e,t){return e=e>>>t&1227133513,e=3272356035&(e|e>>>2),e=251719695&(e|e>>>4),e=4278190335&(e|e>>>8),e=1023&(e|e>>>16),e<<22>>22},r.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>n(e)+1}},{}],13:[function(e,t,r){"use strict";function n(e){var t=(v.nextPow2(e+1)>>>1)-1,r=e-t;return v.nextPow2(r)-1>=t?t:(t>>>1)+r}function a(){return 0}function o(e){return e-1}function i(e,t){if(0>=e)return 0;var r=n(e);return t>r?i(e-r-1,t-r-1):t===r?v.log2(e):i(r,t)}function s(e,t){return Math.max(t-1,0)}function l(e,t){return Math.min(t+1,e-1)}function u(e,t){if(0>=e)return-1;var r=n(e);if(t>r){var a=u(e-r-1,t-r-1);return 0>a?r:a+r+1}if(t===r)return-1;var a=u(r,t);return 0>a?r:a}function c(e,t){if(0>=e)return 0;var r=n(e);return t>r?c(e-r-1,t-r-1)+r+1:t===r?n(t):c(r,t)}function f(e,t){if(0>=e)return 0;var r=n(e);return t>r?f(e-r-1,t-r-1)+r+1:t===r?n(e-r-1)+r+1:f(r,t)}function d(e,t){return 0===i(e,t)}function p(e,t){e|=0,t|=0;for(var r=0;e>1;){var a=n(e);if(t>a)r+=a+1,e-=a+1,t-=a+1;else{if(t===a)break;e=a}}return r}function h(e,t){e|=0,t|=0;for(var r=0;e>1;){var a=n(e);if(t>a)r+=a+1,e-=a+1,t-=a+1;else{if(t===a){r+=e-1;break}e=a}}return r}var v=e("bit-twiddle");r.root=n,r.begin=a,r.end=o,r.height=i,r.prev=s,r.next=l,r.parent=u,r.left=c,r.right=f,r.leaf=d,r.lo=p,r.hi=h},{"bit-twiddle":14}],14:[function(e,t){t.exports=e(12)},{"/Users/Dave/Sites/d3plus/node_modules/static-kdtree/node_modules/bit-twiddle/twiddle.js":12}],15:[function(e,t,r){"use strict";function n(e){if(!e)return s;for(var t=0;t<e.args.length;++t){var r=e.args[t];e.args[t]=0===t?{name:r,lvalue:!0,rvalue:!!e.rvalue,count:e.count||1}:{name:r,lvalue:!1,rvalue:!0,count:1}}return e.thisVars||(e.thisVars=[]),e.localVars||(e.localVars=[]),e}function a(e){return i({args:e.args,pre:n(e.pre),body:n(e.body),post:n(e.proc),funcName:e.funcName})}function o(e){for(var t=[],r=0;r<e.args.length;++r)t.push("a"+r);var n=new Function("P",["return function ",e.funcName,"_ndarrayops(",t.join(","),") {P(",t.join(","),");return a0}"].join(""));return n(a(e))}var i=e("cwise-compiler"),s={body:"",args:[],thisVars:[],localVars:[]},l={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};!function(){for(var e in l){var t=l[e];r[e]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+t+"c"},funcName:e}),r[e+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+t+"=b"},rvalue:!0,funcName:e+"eq"}),r[e+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+t+"s"},funcName:e+"s"}),r[e+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+t+"=s"},rvalue:!0,funcName:e+"seq"})}}();var u={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var e in u){var t=u[e];r[e]=o({args:["array","array"],body:{args:["a","b"],body:"a="+t+"b"},funcName:e}),r[e+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+t+"a"},rvalue:!0,count:2,funcName:e+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var e in c){var t=c[e];r[e]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+t+"c"},funcName:e}),r[e+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+t+"s"},funcName:e+"s"}),r[e+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+t+"b"},rvalue:!0,count:2,funcName:e+"eq"}),r[e+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+t+"s"},rvalue:!0,count:2,funcName:e+"seq"})}}();var f=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var e=0;e<f.length;++e){var t=f[e];r[t]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:t}),r[t+"eq"]=o({args:["array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"eq"})}}();var d=["max","min","atan2","pow"];!function(){for(var e=0;e<d.length;++e){var t=d[e];r[t]=o({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:t}),r[t+"s"]=o({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:t+"s"}),r[t+"eq"]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=o({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"seq"})}}();var p=["atan2","pow"];!function(){for(var e=0;e<p.length;++e){var t=p[e];r[t+"op"]=o({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:t+"op"}),r[t+"ops"]=o({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:t+"ops"}),r[t+"opeq"]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"opeq"}),r[t+"opseq"]=o({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"opseq"})}}(),r.any=i({args:["array"],pre:s,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"}),r.all=i({args:["array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"}),r.sum=i({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"}),r.prod=i({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"}),r.norm2squared=i({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"}),r.norm2=i({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"}),r.norminf=i({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=i({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=i({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=i({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.argmin=i({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.argmax=i({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=o({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=o({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=o({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=i({args:["array","array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":16}],16:[function(e,t){"use strict";function r(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],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 n(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 o=0;o<n.length;++o){var i=n[o];if("array"===i){if(t.arrayArgs.push(o),t.shimArgs.push("array"+o),o<t.pre.args.length&&t.pre.args[o].count>0)throw new Error("cwise: pre() block may not reference array args");if(o<t.post.args.length&&t.post.args[o].count>0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===i)t.scalarArgs.push(o),t.shimArgs.push("scalar"+o);else if("index"===i){if(t.indexArgs.push(o),o<t.pre.args.length&&t.pre.args[o].count>0)throw new Error("cwise: pre() block may not reference array index");if(o<t.body.args.length&&t.body.args[o].lvalue)throw new Error("cwise: body() block may not write to array index");if(o<t.post.args.length&&t.post.args[o].count>0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===i){if(t.shapeArgs.push(o),o<t.pre.args.length&&t.pre.args[o].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(o<t.body.args.length&&t.body.args[o].lvalue)throw new Error("cwise: body() block may not write to array shape");if(o<t.post.args.length&&t.post.args[o].lvalue)throw new Error("cwise: post() block may not write to array shape")}else{if("object"!=typeof i||!i.offset)throw new Error("cwise: Unknown argument type "+n[o]);t.argTypes[o]="offset",t.offsetArgs.push({array:i.array,offset:i.offset}),t.offsetArgIndex.push(o)}}if(t.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(t.pre.args.length>n.length)throw new Error("cwise: Too many arguments in pre() block");if(t.body.args.length>n.length)throw new Error("cwise: Too many arguments in body() block");if(t.post.args.length>n.length)throw new Error("cwise: Too many arguments in post() block");return t.debug=!!e.printCode||!!e.debug,t.funcName=e.funcName||"cwise",t.blockSize=e.blockSize||64,a(t)}var a=e("./lib/thunk.js");t.exports=n},{"./lib/thunk.js":18}],17:[function(e,t){"use strict";function r(e,t,r){var n,a,o=e.length,i=t.arrayArgs.length,s=t.indexArgs.length>0,l=[],u=[],c=0,f=0;for(n=0;o>n;++n)u.push(["i",n,"=0"].join(""));for(a=0;i>a;++a)for(n=0;o>n;++n)f=c,c=e[n],u.push(0===n?["d",a,"s",n,"=t",a,"p",c].join(""):["d",a,"s",n,"=(t",a,"p",c,"-s",f,"*t",a,"p",f,")"].join(""));for(l.push("var "+u.join(",")),n=o-1;n>=0;--n)c=e[n],l.push(["for(i",n,"=0;i",n,"<s",c,";++i",n,"){"].join(""));for(l.push(r),n=0;o>n;++n){for(f=c,c=e[n],a=0;i>a;++a)l.push(["p",a,"+=d",a,"s",n].join(""));s&&(n>0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",c,"]"].join(""))),l.push("}")}return l.join("\n")}function n(e,t,n,a){for(var o=t.length,i=n.arrayArgs.length,s=n.blockSize,l=n.indexArgs.length>0,u=[],c=0;i>c;++c)u.push(["var offset",c,"=p",c].join(""));for(var c=e;o>c;++c)u.push(["for(var j"+c+"=SS[",t[c],"]|0;j",c,">0;){"].join("")),u.push(["if(j",c,"<",s,"){"].join("")),u.push(["s",t[c],"=j",c].join("")),u.push(["j",c,"=0"].join("")),u.push(["}else{s",t[c],"=",s].join("")),u.push(["j",c,"-=",s,"}"].join("")),l&&u.push(["index[",t[c],"]=j",c].join(""));for(var c=0;i>c;++c){for(var f=["offset"+c],d=e;o>d;++d)f.push(["j",d,"*t",c,"p",t[d]].join(""));u.push(["p",c,"=(",f.join("+"),")"].join(""))}u.push(r(t,n,a));for(var c=e;o>c;++c)u.push("}");return u.join("\n")}function a(e){for(var t=0,r=e[0].length;r>t;){for(var n=1;n<e.length;++n)if(e[n][t]!==e[0][t])return t;++t}return t}function o(e,t,r){for(var n=e.body,a=[],o=[],i=0;i<e.args.length;++i){var s=e.args[i];if(!(s.count<=0)){var l=new RegExp(s.name,"g"),u="",c=t.arrayArgs.indexOf(i);switch(t.argTypes[i]){case"offset":var f=t.offsetArgIndex.indexOf(i),d=t.offsetArgs[f];c=d.array,u="+q"+f;case"array":u="p"+c+u;var p="l"+i,h="a"+c;1===s.count?"generic"===r[c]?s.lvalue?(a.push(["var ",p,"=",h,".get(",u,")"].join("")),n=n.replace(l,p),o.push([h,".set(",u,",",p,")"].join(""))):n=n.replace(l,[h,".get(",u,")"].join("")):n=n.replace(l,[h,"[",u,"]"].join("")):"generic"===r[c]?(a.push(["var ",p,"=",h,".get(",u,")"].join("")),n=n.replace(l,p),s.lvalue&&o.push([h,".set(",u,",",p,")"].join(""))):(a.push(["var ",p,"=",h,"[",u,"]"].join("")),n=n.replace(l,p),s.lvalue&&o.push([h,"[",u,"]=",p].join("")));break;case"scalar":n=n.replace(l,"Y"+t.scalarArgs.indexOf(i));break;case"index":n=n.replace(l,"index");break;case"shape":n=n.replace(l,"shape")}}}return[a.join("\n"),n,o.join("\n")].join("\n").trim()}function i(e){for(var t=new Array(e.length),r=!0,n=0;n<e.length;++n){var a=e[n],o=a.match(/\d+/);o=o?o[0]:"",t[n]=0===a.charAt(0)?"u"+a.charAt(1)+o:a.charAt(0)+o,n>0&&(r=r&&t[n]===t[n-1])}return r?t[0]:t.join("")}function s(e,t){for(var s=0|t[1].length,u=new Array(e.arrayArgs.length),c=new Array(e.arrayArgs.length),f=["SS"],d=["'use strict'"],p=[],h=0;s>h;++h)p.push(["s",h,"=SS[",h,"]"].join(""));for(var v=0;v<e.arrayArgs.length;++v){f.push("a"+v),f.push("t"+v),f.push("p"+v),c[v]=t[2*v],u[v]=t[2*v+1];for(var h=0;s>h;++h)p.push(["t",v,"p",h,"=t",v,"[",h,"]"].join(""))}for(var v=0;v<e.scalarArgs.length;++v)f.push("Y"+v);if(e.shapeArgs.length>0&&p.push("shape=SS.slice(0)"),e.indexArgs.length>0){for(var g=new Array(s),v=0;s>v;++v)g[v]="0";p.push(["index=[",g.join(","),"]"].join(""))}for(var v=0;v<e.offsetArgs.length;++v){for(var m=e.offsetArgs[v],y=[],h=0;h<m.offset.length;++h)0!==m.offset[h]&&y.push(1===m.offset[h]?["t",m.array,"p",h].join(""):[m.offset[h],"*t",m.array,"p",h].join(""));p.push(0===y.length?"q"+v+"=0":["q",v,"=",y.join("+")].join(""))}var x=l([].concat(e.pre.thisVars).concat(e.body.thisVars).concat(e.post.thisVars));p=p.concat(x),d.push("var "+p.join(","));for(var v=0;v<e.arrayArgs.length;++v)d.push("p"+v+"|=0");e.pre.body.length>3&&d.push(o(e.pre,e,c));var b=o(e.body,e,c),w=a(u);d.push(s>w?n(w,u[0],e,b):r(u[0],e,b)),e.post.body.length>3&&d.push(o(e.post,e,c)),e.debug&&console.log("Generated cwise routine for ",t,":\n\n",d.join("\n"));var _=[e.funcName||"unnamed","_cwise_loop_",u[0].join("s"),"m",w,i(c)].join(""),k=new Function(["function ",_,"(",f.join(","),"){",d.join("\n"),"} return ",_].join(""));return k()}var l=e("uniq");t.exports=s},{uniq:19}],18:[function(e,t){"use strict";function r(e){var t=["'use strict'","var CACHED={}"],r=[],a=e.funcName+"_cwise_thunk";t.push(["return function ",a,"(",e.shimArgs.join(","),"){"].join(""));for(var o=[],i=[],s=[["array",e.arrayArgs[0],".shape"].join("")],l=0;l<e.arrayArgs.length;++l){var u=e.arrayArgs[l];r.push(["t",u,"=array",u,".dtype,","r",u,"=array",u,".order"].join("")),o.push("t"+u),o.push("r"+u),i.push("t"+u),i.push("r"+u+".join()"),s.push("array"+u+".data"),s.push("array"+u+".stride"),s.push("array"+u+".offset|0")}for(var l=0;l<e.scalarArgs.length;++l)s.push("scalar"+e.scalarArgs[l]);r.push(["type=[",i.join(","),"].join()"].join("")),r.push("proc=CACHED[type]"),t.push("var "+r.join(",")),t.push(["if(!proc){","CACHED[type]=proc=compile([",o.join(","),"])}","return proc(",s.join(","),")}"].join("")),e.debug&&console.log("Generated thunk:",t.join("\n"));var c=new Function("compile",t.join("\n"));return c(n.bind(void 0,e))}var n=e("./compile.js");t.exports=r},{"./compile.js":17}],19:[function(e,t){"use strict";function r(e,t){for(var r=1,n=e.length,a=e[0],o=e[0],i=1;n>i;++i)if(o=a,a=e[i],t(a,o)){if(i===r){r++;continue}e[r++]=a}return e.length=r,e}function n(e){for(var t=1,r=e.length,n=e[0],a=e[0],o=1;r>o;++o,a=n)if(a=n,n=e[o],n!==a){if(o===t){t++;continue}e[t++]=n}return e.length=t,e}function a(e,t,a){return 0===e.length?e:t?(a||e.sort(t),r(e,t)):(a||e.sort(),n(e))}t.exports=a},{}],20:[function(e,t){"use strict";var r=e("ndarray"),n=e("./doConvert.js");t.exports=function(e,t){for(var a=[],o=e,i=1;o instanceof Array;)a.push(o.length),i*=o.length,o=o[0];return 0===a.length?r():(t||(t=r(new Float64Array(i),a)),n(t,e),t)}},{"./doConvert.js":21,ndarray:31}],21:[function(e,t){t.exports=e("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":22}],22:[function(e,t){"use strict";function r(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],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 n(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.slice(0);for(var o=0;o<n.length;++o){var i=n[o];if("array"===i){if(t.arrayArgs.push(o),t.shimArgs.push("array"+o),o<t.pre.args.length&&t.pre.args[o].count>0)throw new Error("cwise: pre() block may not reference array args");if(o<t.post.args.length&&t.post.args[o].count>0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===i)t.scalarArgs.push(o),t.shimArgs.push("scalar"+o);else if("index"===i){if(t.indexArgs.push(o),o<t.pre.args.length&&t.pre.args[o].count>0)throw new Error("cwise: pre() block may not reference array index");if(o<t.body.args.length&&t.body.args[o].lvalue)throw new Error("cwise: body() block may not write to array index");if(o<t.post.args.length&&t.post.args[o].count>0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===i){if(t.shapeArgs.push(o),o<t.pre.args.length&&t.pre.args[o].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(o<t.body.args.length&&t.body.args[o].lvalue)throw new Error("cwise: body() block may not write to array shape");if(o<t.post.args.length&&t.post.args[o].lvalue)throw new Error("cwise: post() block may not write to array shape")}else{if("object"!=typeof i||!i.offset)throw new Error("cwise: Unknown argument type "+n[o]);t.argTypes[o]="offset",t.offsetArgs.push({array:i.array,offset:i.offset}),t.offsetArgIndex.push(o)}}if(t.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(t.pre.args.length>n.length)throw new Error("cwise: Too many arguments in pre() block");if(t.body.args.length>n.length)throw new Error("cwise: Too many arguments in body() block");if(t.post.args.length>n.length)throw new Error("cwise: Too many arguments in post() block");return t.debug=!!e.printCode||!!e.debug,t.funcName=e.funcName||"cwise",t.blockSize=e.blockSize||64,a(t)}var a=e("./lib/thunk.js");t.exports=n},{"./lib/thunk.js":24}],23:[function(e,t){"use strict";function r(e,t,r){var n,a,o=e.length,i=t.arrayArgs.length,s=t.indexArgs.length>0,l=[],u=[],c=0,f=0;for(n=0;o>n;++n)u.push(["i",n,"=0"].join(""));for(a=0;i>a;++a)for(n=0;o>n;++n)f=c,c=e[n],u.push(0===n?["d",a,"s",n,"=t",a,"[",c,"]"].join(""):["d",a,"s",n,"=(t",a,"[",c,"]-s",f,"*t",a,"[",f,"])"].join(""));for(l.push("var "+u.join(",")),n=o-1;n>=0;--n)c=e[n],l.push(["for(i",n,"=0;i",n,"<s",c,";++i",n,"){"].join(""));for(l.push(r),n=0;o>n;++n){for(f=c,c=e[n],a=0;i>a;++a)l.push(["p",a,"+=d",a,"s",n].join(""));s&&(n>0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",c,"]"].join(""))),l.push("}")}return l.join("\n")}function n(e,t,n,a){for(var o=t.length,i=n.arrayArgs.length,s=n.blockSize,l=n.indexArgs.length>0,u=[],c=0;i>c;++c)u.push(["var offset",c,"=p",c].join(""));for(var c=e;o>c;++c)u.push(["for(var j"+c+"=SS[",t[c],"]|0;j",c,">0;){"].join("")),u.push(["if(j",c,"<",s,"){"].join("")),u.push(["s",t[c],"=j",c].join("")),u.push(["j",c,"=0"].join("")),u.push(["}else{s",t[c],"=",s].join("")),u.push(["j",c,"-=",s,"}"].join("")),l&&u.push(["index[",t[c],"]=j",c].join(""));for(var c=0;i>c;++c){for(var f=["offset"+c],d=e;o>d;++d)f.push(["j",d,"*t",c,"[",t[d],"]"].join(""));u.push(["p",c,"=(",f.join("+"),")"].join(""))}u.push(r(t,n,a));for(var c=e;o>c;++c)u.push("}");return u.join("\n")}function a(e){for(var t=0,r=e[0].length;r>t;){for(var n=1;n<e.length;++n)if(e[n][t]!==e[0][t])return t;++t}return t}function o(e,t,r){for(var n=e.body,a=[],o=[],i=0;i<e.args.length;++i){var s=e.args[i];if(!(s.count<=0)){var l=new RegExp(s.name,"g"),u="",c=t.arrayArgs.indexOf(i);switch(t.argTypes[i]){case"offset":var f=t.offsetArgIndex.indexOf(i),d=t.offsetArgs[f];c=d.array,u="+q"+f;case"array":u="p"+c+u;var p="l"+i,h="a"+c;1===s.count?"generic"===r[c]?s.lvalue?(a.push(["var ",p,"=",h,".get(",u,")"].join("")),n=n.replace(l,p),o.push([h,".set(",u,",",p,")"].join(""))):n=n.replace(l,[h,".get(",u,")"].join("")):n=n.replace(l,[h,"[",u,"]"].join("")):"generic"===r[c]?(a.push(["var ",p,"=",h,".get(",u,")"].join("")),n=n.replace(l,p),s.lvalue&&o.push([h,".set(",u,",",p,")"].join(""))):(a.push(["var ",p,"=",h,"[",u,"]"].join("")),n=n.replace(l,p),s.lvalue&&o.push([h,"[",u,"]=",p].join("")));break;case"scalar":n=n.replace(l,"Y"+t.scalarArgs.indexOf(i));break;case"index":n=n.replace(l,"index");break;case"shape":n=n.replace(l,"shape")}}}return[a.join("\n"),n,o.join("\n")].join("\n").trim()}function i(e){for(var t=new Array(e.length),r=!0,n=0;n<e.length;++n){var a=e[n],o=a.match(/\d+/);o=o?o[0]:"",t[n]=0===a.charAt(0)?"u"+a.charAt(1)+o:a.charAt(0)+o,n>0&&(r=r&&t[n]===t[n-1])}return r?t[0]:t.join("")}function s(e,t){for(var s=0|t[1].length,u=new Array(e.arrayArgs.length),c=new Array(e.arrayArgs.length),f=["SS"],d=["'use strict'"],p=[],h=0;s>h;++h)p.push(["s",h,"=SS[",h,"]"].join(""));for(var v=0;v<e.arrayArgs.length;++v)f.push("a"+v),f.push("t"+v),f.push("p"+v),c[v]=t[2*v],u[v]=t[2*v+1];for(var v=0;v<e.scalarArgs.length;++v)f.push("Y"+v);if(e.shapeArgs.length>0&&p.push("shape=SS.slice(0)"),e.indexArgs.length>0){for(var g=new Array(s),v=0;s>v;++v)g[v]="0";p.push(["index=[",g.join(","),"]"].join(""))}for(var v=0;v<e.offsetArgs.length;++v){for(var m=e.offsetArgs[v],y=[],h=0;h<m.offset.length;++h)0!==m.offset[h]&&y.push(1===m.offset[h]?["t",m.array,"[",h,"]"].join(""):[m.offset[h],"*t",m.array,"[",h,"]"].join(""));
p.push(0===y.length?"q"+v+"=0":["q",v,"=(",y.join("+"),")|0"].join(""))}var x=l([].concat(e.pre.thisVars).concat(e.body.thisVars).concat(e.post.thisVars));p=p.concat(x),d.push("var "+p.join(","));for(var v=0;v<e.arrayArgs.length;++v)d.push("p"+v+"|=0");e.pre.body.length>3&&d.push(o(e.pre,e,c));var b=o(e.body,e,c),w=a(u);d.push(s>w?n(w,u[0],e,b):r(u[0],e,b)),e.post.body.length>3&&d.push(o(e.post,e,c)),e.debug&&console.log("Generated cwise routine for ",t,":\n\n",d.join("\n"));var _=[e.funcName||"unnamed","_cwise_loop_",u[0].join("s"),"m",w,i(c)].join(""),k=new Function(["function ",_,"(",f.join(","),"){",d.join("\n"),"} return ",_].join(""));return k()}var l=e("uniq");t.exports=s},{uniq:25}],24:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{"./compile.js":23,"/Users/Dave/Sites/d3plus/node_modules/static-kdtree/node_modules/ndarray-ops/node_modules/cwise-compiler/lib/thunk.js":18}],25:[function(e,t){"use strict";function r(e,t){for(var r=1,n=e.length,a=e[0],o=e[0],i=1;n>i;++i)if(o=a,a=e[i],t(a,o)){if(i===r){r++;continue}e[r++]=a}return e.length=r,e}function n(e){for(var t=1,r=e.length,n=e[0],a=e[0],o=1;r>o;++o,a=n)if(a=n,n=e[o],n!==a){if(o===t){t++;continue}e[t++]=n}return e.length=t,e}function a(e,t,a){return 0===e.length?[]:t?(a||e.sort(t),r(e,t)):(a||e.sort(),n(e))}t.exports=a},{}],26:[function(e,t){t.exports=e(12)},{"/Users/Dave/Sites/d3plus/node_modules/static-kdtree/node_modules/bit-twiddle/twiddle.js":12}],27:[function(e,t){"use strict";function r(e,t,n){var a=0|e[n];if(0>=a)return[];var o,i=new Array(a);if(n===e.length-1)for(o=0;a>o;++o)i[o]=t;else for(o=0;a>o;++o)i[o]=r(e,t,n+1);return i}function n(e,t){var r,n;for(r=new Array(e),n=0;e>n;++n)r[n]=t;return r}function a(e,t){switch("undefined"==typeof t&&(t=0),typeof e){case"number":if(e>0)return n(0|e,t);break;case"object":if("number"==typeof e.length)return r(e,t,0)}return[]}t.exports=a},{}],28:[function(e,t,r){(function(t,n){"use strict";function a(e){if(e){var t=e.length||e.byteLength,r=y.log2(t);_[r].push(e)}}function o(e){a(e.buffer)}function i(e){var e=y.nextPow2(e),t=y.log2(e),r=_[t];return r.length>0?r.pop():new ArrayBuffer(e)}function s(e){return new Uint8Array(i(e),0,e)}function l(e){return new Uint16Array(i(2*e),0,e)}function u(e){return new Uint32Array(i(4*e),0,e)}function c(e){return new Int8Array(i(e),0,e)}function f(e){return new Int16Array(i(2*e),0,e)}function d(e){return new Int32Array(i(4*e),0,e)}function p(e){return new Float32Array(i(4*e),0,e)}function h(e){return new Float64Array(i(8*e),0,e)}function v(e){return b?new Uint8ClampedArray(i(e),0,e):s(e)}function g(e){return new DataView(i(e),0,e)}function m(e){e=y.nextPow2(e);var t=y.log2(e),r=k[t];return r.length>0?r.pop():new n(e)}var y=e("bit-twiddle"),x=e("dup");t.__TYPEDARRAY_POOL||(t.__TYPEDARRAY_POOL={UINT8:x([32,0]),UINT16:x([32,0]),UINT32:x([32,0]),INT8:x([32,0]),INT16:x([32,0]),INT32:x([32,0]),FLOAT:x([32,0]),DOUBLE:x([32,0]),DATA:x([32,0]),UINT8C:x([32,0]),BUFFER:x([32,0])});var b="undefined"!=typeof Uint8ClampedArray,w=t.__TYPEDARRAY_POOL;w.UINT8C||(w.UINT8C=x([32,0])),w.BUFFER||(w.BUFFER=x([32,0]));var _=w.DATA,k=w.BUFFER;r.free=function(e){if(n.isBuffer(e))k[y.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var t=e.length||e.byteLength,r=0|y.log2(t);_[r].push(e)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=o,r.freeArrayBuffer=a,r.freeBuffer=function(e){k[y.log2(e.length)].push(e)},r.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return i(e);switch(t){case"uint8":return s(e);case"uint16":return l(e);case"uint32":return u(e);case"int8":return c(e);case"int16":return f(e);case"int32":return d(e);case"float":case"float32":return p(e);case"double":case"float64":return h(e);case"uint8_clamped":return v(e);case"buffer":return m(e);case"data":case"dataview":return g(e);default:return null}return null},r.mallocArrayBuffer=i,r.mallocUint8=s,r.mallocUint16=l,r.mallocUint32=u,r.mallocInt8=c,r.mallocInt16=f,r.mallocInt32=d,r.mallocFloat32=r.mallocFloat=p,r.mallocFloat64=r.mallocDouble=h,r.mallocUint8Clamped=v,r.mallocDataView=g,r.mallocBuffer=m,r.clearCache=function(){for(var e=0;32>e;++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":26,buffer:2,dup:27}],29:[function(e,t,r){"use strict";function n(e){var t=e.dtype;("generic"===t||"array"===t)&&(t="double");var r=u.malloc(e.size,t),n=s(r,e.shape);return l.assign(n,e),n}function a(e,t){t||(t="double");for(var r=1,n=new Array(e.length),a=e.length-1;a>=0;--a)n[a]=r,r*=e[a];return s(u.malloc(r,t),e,n,0)}function o(e){"generic"!==e.dtype&&"array"!==e.dtype&&u.free(e.data)}function i(e,t){t||(t="double");for(var r=1,n=new Array(e.length),a=e.length-1;a>=0;--a)n[a]=r,r*=e[a];for(var o=u.malloc(r,t),a=0;r>a;++a)o[a]=0;return s(o,e,n,0)}var s=e("ndarray"),l=e("ndarray-ops"),u=e("typedarray-pool");r.clone=n,r.malloc=a,r.free=o,r.zeros=i},{ndarray:31,"ndarray-ops":15,"typedarray-pool":28}],30:[function(e,t){"use strict";function r(e){return"s"+e}function n(e){return"t"+e}function a(e){return"u"+e}function o(e){return"v"+e}function i(e){return"i"+e}function s(e){return"p"+e}function l(e){return"x"+e}function u(e){var t=e.slice();return t.splice(e.indexOf(0),1),t.unshift(0),t}function c(e,t,c){function f(a,u,c){if(t)A.push(s(0),".offset=",m,"+",n(e[0]),"*(",u,");",s(1),".offset=",m,"+",n(e[0]),"*(",c,");",a,"=",v,"(",s(0),",",s(1),");");else{A.push(l(0),"=",m,"+",n(0),"*(",u,");",l(1),"=",m,"+",n(0),"*(",c,");"),k>1&&A.push("_cmp:");for(var f=k-1;f>0;--f)A.push("for(",i(f),"=0;",i(f),"<",r(f),";",i(f),"++){");z?A.push(a,"=",g,".get(",l(0),")-",g,".get(",l(1),");"):A.push(a,"=",g,"[",l(0),"]-",g,"[",l(1),"];"),k>1&&A.push("if(",a,")break _cmp;");for(var f=1;k>f;++f)A.push(l(0),"+=",o(f),";",l(1),"+=",o(f),"}")}}function d(t,o){A.push(l(0),"=",m,"+",n(e[0]),"*(",t,");",l(1),"=",m,"+",n(e[0]),"*(",o,");");for(var s=k-1;s>0;--s)A.push("for(",i(e[s]),"=0;",i(e[s]),"<",r(e[s]),";",i(e[s]),"++){");z?A.push(x,"=",g,".get(",l(0),");",g,".set(",l(0),",",g,".get(",l(1),"));",g,".set(",l(1),",",x,");"):A.push(x,"=",g,"[",l(0),"];",g,"[",l(0),"]=",g,"[",l(1),"];",g,"[",l(1),"]=",x,";");for(var s=1;k>s;++s)A.push(l(0),"+=",a(e[s]),";",l(1),"+=",a(e[s]),"}")}e=u(e);var k=e.length,z="generic"===c,j="ndSelect"+c+e.join("_")+"_"+(t?"cmp":"lex"),A=[],M=[p,h];t&&M.push(v);for(var E=[g+"="+p+".data",m+"="+p+".offset|0",y+"=Math.random",x],S=0;2>S;++S)E.push(l(S)+"=0");for(var S=0;k>S;++S)E.push(r(S)+"="+p+".shape["+S+"]|0",n(S)+"="+p+".stride["+S+"]|0",i(S)+"=0");for(var S=1;k>S;++S)k-1>S?E.push(o(S)+"=("+n(S)+"-"+r(S+1)+"*"+n(S+1)+")|0",a(e[S])+"=("+n(e[S])+"-"+r(e[S+1])+"*"+n(e[S+1])+")|0"):E.push(o(S)+"="+n(S),a(e[S])+"="+n(e[S]));if(t)for(var S=0;2>S;++S)E.push(s(S)+"="+p+".pick(0)");E.push(_+"=0",b+"=0",w+"="+r(e[0])+"-1"),A.push("while(",b,"<",w,"){",_,"=(",y,"()*(",w,"-",b,"+1)+",b,")|0;"),d(_,w),A.push(_,"=",b,";","for(",i(0),"=",b,";",i(0),"<",w,";",i(0),"++){"),f(x,i(0),w),A.push("if(",x,"<0){"),d(_,i(0)),A.push(_,"++;"),A.push("}}"),d(_,w),A.push("if(",_,"===",h,"){",b,"=",_,";","break;","}else if(",h,"<",_,"){",w,"=",_,"-1;","}else{",b,"=",_,"+1;","}","}"),t?A.push(s(0),".offset=",m,"+",b,"*",n(0),";","return ",s(0),";"):A.push("return ",p,".pick(",b,");");var T=["'use strict';function ",j,"(",M,"){","var ",E.join(),";",A.join(""),"};return ",j].join(""),O=new Function(T);return O()}function f(e,t,r){var n=e.join()+t+r,a=k[n];return a?a:k[n]=c(e,t,r)}function d(e,t,r){if(t|=0,0===e.dimension||e.shape[0]<=t||0>t)return null;var n=!!r,a=f(e.order,n,e.dtype);return n?a(e,t,r):a(e,t)}t.exports=d,t.exports.compile=f;var p="a",h="K",v="C",g="d",m="o",y="R",x="T",b="L",w="H",_="X",k={}},{}],31:[function(e,t){(function(r){function n(e,t){return e[0]-t[0]}function a(){var e,t=this.stride,r=new Array(t.length);for(e=0;e<r.length;++e)r[e]=[Math.abs(t[e]),e];r.sort(n);var a=new Array(r.length);for(e=0;e<a.length;++e)a[e]=r[e][1];return a}function o(e,t){var r=["View",t,"d",e].join("");0>t&&(r="View_Nil"+e);var n="generic"===e;if(-1===t){var o="function "+r+"(a){this.data=a;};var proto="+r+".prototype;proto.dtype='"+e+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+r+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+r+"(a){return new "+r+"(a);}",i=new Function(o);return i()}if(0===t){var o="function "+r+"(a,d) {this.data = a;this.offset = d};var proto="+r+".prototype;proto.dtype='"+e+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+r+"_copy() {return new "+r+"(this.data,this.offset)};proto.pick=function "+r+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+r+"_get(){return "+(n?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+r+"_set(v){return "+(n?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+r+"(a,b,c,d){return new "+r+"(a,d)}",i=new Function("TrivialArray",o);return i(d[e][0])}var o=["'use strict'"],s=l(t),c=s.map(function(e){return"i"+e}),f="this.offset+"+s.map(function(e){return"this._stride"+e+"*i"+e}).join("+");o.push("function "+r+"(a,"+s.map(function(e){return"b"+e}).join(",")+","+s.map(function(e){return"c"+e}).join(",")+",d){this.data=a");for(var p=0;t>p;++p)o.push("this._shape"+p+"=b"+p+"|0");for(var p=0;t>p;++p)o.push("this._stride"+p+"=c"+p+"|0");o.push("this.offset=d|0}","var proto="+r+".prototype","proto.dtype='"+e+"'","proto.dimension="+t);var h="VStride"+t+"d"+e,v="VShape"+t+"d"+e,g={stride:h,shape:v};for(var m in g){var y=g[m];o.push("function "+y+"(v) {this._v=v} var aproto="+y+".prototype","aproto.length="+t);for(var x=[],p=0;t>p;++p)x.push(["this._v._",m,p].join(""));o.push("aproto.toJSON=function "+y+"_toJSON(){return ["+x.join(",")+"]}","aproto.valueOf=aproto.toString=function "+y+"_toString(){return ["+x.join(",")+"].join()}");for(var p=0;t>p;++p)o.push("Object.defineProperty(aproto,"+p+",{get:function(){return this._v._"+m+p+"},set:function(v){return this._v._"+m+p+"=v|0},enumerable:true})");for(var p=0;p<u.length;++p)u[p]in Array.prototype&&o.push("aproto."+u[p]+"=Array.prototype."+u[p]);o.push(["Object.defineProperty(proto,'",m,"',{get:function ",y,"_get(){return new ",y,"(this)},set: function ",y,"_set(v){"].join(""));for(var p=0;t>p;++p)o.push("this._"+m+p+"=v["+p+"]|0");o.push("return v}})")}o.push("Object.defineProperty(proto,'size',{get:function "+r+"_size(){return "+s.map(function(e){return"this._shape"+e}).join("*"),"}})"),1===t?o.push("proto.order=[0]"):(o.push("Object.defineProperty(proto,'order',{get:"),4>t?(o.push("function "+r+"_order(){"),2===t?o.push("return (Math.abs(this._stride0)>Math.abs(this._stride1))?[1,0]:[0,1]}})"):3===t&&o.push("var s0=Math.abs(this._stride0),s1=Math.abs(this._stride1),s2=Math.abs(this._stride2);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):o.push("ORDER})")),o.push("proto.set=function "+r+"_set("+c.join(",")+",v){"),o.push(n?"return this.data.set("+f+",v)}":"return this.data["+f+"]=v}"),o.push("proto.get=function "+r+"_get("+c.join(",")+"){"),o.push(n?"return this.data.get("+f+")}":"return this.data["+f+"]}"),o.push("proto.index=function "+r+"_index(",c.join(),"){return "+f+"}"),o.push("proto.hi=function "+r+"_hi("+c.join(",")+"){return new "+r+"(this.data,"+s.map(function(e){return["(typeof i",e,"!=='number'||i",e,"<0)?this._shape",e,":i",e,"|0"].join("")}).join(",")+","+s.map(function(e){return"this._stride"+e}).join(",")+",this.offset)}");var b=s.map(function(e){return"a"+e+"=this._shape"+e}),w=s.map(function(e){return"c"+e+"=this._stride"+e});o.push("proto.lo=function "+r+"_lo("+c.join(",")+"){var b=this.offset,d=0,"+b.join(",")+","+w.join(","));for(var p=0;t>p;++p)o.push("if(typeof i"+p+"==='number'&&i"+p+">=0){d=i"+p+"|0;b+=c"+p+"*d;a"+p+"-=d}");o.push("return new "+r+"(this.data,"+s.map(function(e){return"a"+e}).join(",")+","+s.map(function(e){return"c"+e}).join(",")+",b)}"),o.push("proto.step=function "+r+"_step("+c.join(",")+"){var "+s.map(function(e){return"a"+e+"=this._shape"+e}).join(",")+","+s.map(function(e){return"b"+e+"=this._stride"+e}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var p=0;t>p;++p)o.push("if(typeof i"+p+"==='number'){d=i"+p+"|0;if(d<0){c+=b"+p+"*(a"+p+"-1);a"+p+"=ceil(-a"+p+"/d)}else{a"+p+"=ceil(a"+p+"/d)}b"+p+"*=d}");o.push("return new "+r+"(this.data,"+s.map(function(e){return"a"+e}).join(",")+","+s.map(function(e){return"b"+e}).join(",")+",c)}");for(var _=new Array(t),k=new Array(t),p=0;t>p;++p)_[p]="a[i"+p+"]",k[p]="b[i"+p+"]";o.push("proto.transpose=function "+r+"_transpose("+c+"){"+c.map(function(e,t){return e+"=("+e+"===undefined?"+t+":"+e+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+r+"(this.data,"+_.join(",")+","+k.join(",")+",this.offset)}"),o.push("proto.pick=function "+r+"_pick("+c+"){var a=[],b=[],c=this.offset");for(var p=0;t>p;++p)o.push("if(typeof i"+p+"==='number'&&i"+p+">=0){c=(c+this._stride"+p+"*i"+p+")|0}else{a.push(this._shape"+p+");b.push(this._stride"+p+")}");o.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),o.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(e){return"shape["+e+"]"}).join(",")+","+s.map(function(e){return"stride["+e+"]"}).join(",")+",offset)}");var i=new Function("CTOR_LIST","ORDER",o.join("\n"));return i(d[e],a)}function i(e){if(f&&r.isBuffer(e))return"buffer";if(c)switch(Object.prototype.toString.call(e)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped"}return Array.isArray(e)?"array":"generic"}function s(e,t,r,n){if(void 0===e){var a=d.array[0];return a([])}"number"==typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var s=t.length;if(void 0===r){r=new Array(s);for(var l=s-1,u=1;l>=0;--l)r[l]=u,u*=t[l]}if(void 0===n){n=0;for(var l=0;s>l;++l)r[l]<0&&(n-=(t[l]-1)*r[l])}for(var c=i(e),f=d[c];f.length<=s+1;)f.push(o(c,f.length-1));var a=f[s+1];return a(e,t,r,n)}var l=e("iota-array"),u=["concat","join","slice","toString","indexOf","lastIndexOf","forEach","every","some","filter","map","reduce","reduceRight"],c="undefined"!=typeof Float64Array,f="undefined"!=typeof r,d={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};t.exports=s}).call(this,e("buffer").Buffer)},{buffer:2,"iota-array":32}],32:[function(e,t){"use strict";function r(e){for(var t=new Array(e),r=0;e>r;++r)t[r]=r;return t}t.exports=r},{}],33:[function(e,t){t.exports=e(27)},{"/Users/Dave/Sites/d3plus/node_modules/static-kdtree/node_modules/ndarray-scratch/node_modules/typedarray-pool/node_modules/dup/dup.js":27}],34:[function(e,t){t.exports=e(28)},{"/Users/Dave/Sites/d3plus/node_modules/static-kdtree/node_modules/ndarray-scratch/node_modules/typedarray-pool/pool.js":28,"bit-twiddle":12,buffer:2,dup:33}],35:[function(e,t){var r;r=e("../color/sort.coffee"),t.exports=function(e,t,n,a,o,i,s){var l,u,c;for(a||(a="asc"),o instanceof Array||(o=[o]),n instanceof Array||(n=[n]),i&&void 0!==s&&"number"!=typeof s&&(s=i.id.nesting.indexOf(s)),c=0,l=0;l<n.length&&(u=n[l],e=i&&e.d3plus&&e.d3plus.sortKeys?e.d3plus.sortKeys[u]:e[u],t=i&&t.d3plus&&t.d3plus.sortKeys?t.d3plus.sortKeys[u]:t[u],c=i&&o.indexOf(u)>=0?r(e,t):t>e?-1:1,0===c&&l!==n.length-1);)l++;return"asc"===a?c:-c}},{"../color/sort.coffee":51}],36:[function(e,t){t.exports=function(e,t){var r;return e instanceof Array?(r=void 0===t?t:t.constructor,e.indexOf(t)>=0||void 0!==t&&e.indexOf(r)>=0):!1}},{}],37:[function(e,t){var r,n;r=e("./comparator.coffee"),n=e("../core/fetch/sort.coffee"),t.exports=function(e,t,a,o,i,s){var l,u,c;if(!e||e.length<=1||!t)return e||[];if(i)for(u=0,c=e.length;c>u;u++)l=e[u],l.d3plus&&(l.d3plus.sortKeys=n(i,l,t,o,s));return e.sort(function(e,n){return r(e,n,t,a,o,i,s)})}},{"../core/fetch/sort.coffee":66,"./comparator.coffee":35}],38:[function(e,t){t.exports=function(e,t){return t===!1?[]:t instanceof Array?t:(e instanceof Array||(e=[]),e.indexOf(t)>=0?e.splice(e.indexOf(t),1):e.push(t),e)}},{}],39:[function(e,t){var r;r=function(e){var t,n,a,o;if(o=r.tested,e in o)return o[e];for(n=0,a=!1;n<document.styleSheets.length;){if(t=document.styleSheets[n],t.href&&t.href.indexOf(e)>=0){a=!0;break}n++}return a},r.tested={},t.exports=r},{}],40:[function(e,t){t.exports=!1},{}],41:[function(e,t){var r,n;r=e("./ie.js"),n=e("./touch.coffee"),t.exports=n?{click:"click",down:"touchstart",up:"touchend",over:"touchstart",out:"touchend",move:"touchmove"}:{click:"click",down:"mousedown",up:"mouseup",over:r?"mouseenter":"mouseover",out:r?"mouseleave":"mouseout",move:"mousemove"}},{"./ie.js":40,"./touch.coffee":45}],42:[function(e,t){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},{}],43:[function(e,t){t.exports="rtl"===d3.select("html").attr("dir")},{}],44:[function(e,t){var r;r=function(){var e,t,n,a,o;return e=document.createElement("p"),e.style.width="100%",e.style.height="200px",t=document.createElement("div"),t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),document.body.appendChild(t),a=e.offsetWidth,t.style.overflow="scroll",o=e.offsetWidth,a===o&&(o=t.clientWidth),document.body.removeChild(t),n=a-o,r=function(){return n},n},t.exports=r},{}],45:[function(e,t){t.exports="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch?!0:!1},{}],46:[function(e,t){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){t.exports=function(e,t){var r;return void 0===t&&(t=.5),r=d3.hsl(e),r.l+=(1-r.l)*t,r.toString()}},{}],48:[function(e,t){t.exports=function(e,t,r,n){var a,o,i;return r||(r=1),n||(n=1),e=d3.rgb(e),t=d3.rgb(t),i=(r*e.r+n*t.r-r*n*t.r)/(r+n-r*n),o=(r*e.g+n*t.g-r*n*t.g)/(r+n-r*n),a=(r*e.b+n*t.b-r*n*t.b)/(r+n-r*n),d3.rgb(i,o,a).toString()}},{}],49:[function(e,t){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){t.exports=d3.scale.ordinal().range(["#b22200","#EACE3F","#282F6B","#B35C1E","#224F20","#5F487C","#759143","#419391","#993F88","#e89c89","#ffee8d","#afd5e8","#f7ba77","#a5c697","#c5b5e5","#d1d392","#bbefd0","#e099cf"])},{}],51:[function(e,t){t.exports=function(e,t){var r,n;return r=d3.hsl(e),n=d3.hsl(t),e=0===r.s?361:r.h,t=0===n.s?361:n.h,e===t?r.l-n.l:e-t}},{}],52:[function(e,t){t.exports=function(e){var t,r,n,a,o;return a=d3.rgb(e),n=a.r,r=a.g,t=a.b,o=(299*n+587*r+114*t)/1e3,o>=128?"#444444":"#f7f7f7"}},{}],53:[function(e,t){t.exports=function(e){var t,r,n;return e+="",e=e.replace(RegExp(" ","g"),""),0===e.indexOf("rgb")&&(e=e.split("(")[1].split(")")[0].split(",").slice(0,3).join(",")),0===e.indexOf("hsl")&&(e=e.split(",")[2].split(")")[0]),r=d3.rgb(e).toString(),t=["black","#000","#000000","0%","0,0,0"],n=t.indexOf(e)>=0,"#000000"!==r||n}},{}],54:[function(e,t){var r,n,a;r=e("../../client/ie.js"),a=e("./wiki.coffee"),n=function(e,t,n){n=n||"",r||"undefined"!=typeof InstallTrigger?console.log("[ D3plus ] "+t):"groupCollapsed"===e?window.chrome&&navigator.onLine?console[e]("%c%c "+t,"padding:3px 10px;line-height:25px;background-size:20px;background-position:top left;background-image:url('http://d3plus.org/assets/img/favicon.ico');","font-weight:200;"+n):console[e]("%cD3plus%c "+t,"line-height:25px;font-weight:800;color:#b35c1e;margin-left:0px;","font-weight:200;"+n):console[e]("%c"+t,n+"font-weight:200;")},n.comment=function(e){this("log",e,"color:#aaa;")},n.error=function(e,t){this("groupCollapsed","ERROR: "+e,"font-weight:800;color:#D74B03;"),this.stack(),this.wiki(t),this.groupEnd()},n.group=function(e){this("group",e,"color:#888;")},n.groupCollapsed=function(e){this("groupCollapsed",e,"color:#888;")},n.groupEnd=function(){r||console.groupEnd()},n.log=function(e){this("log",e,"color:#444444;")},n.stack=function(){var e,t,n,a,o,i,s;r||(e=new Error,e.stack&&(i=e.stack.split("\n"),i=i.filter(function(e){return 0!==e.indexOf("Error")&&e.indexOf("d3plus.js:")<0&&e.indexOf("d3plus.min.js:")<0}),i.length&&i[0].length&&(o=window.chrome?"at ":"@",s=i[0].split(o)[1],i=s.split(":"),3===i.length&&i.pop(),t=i.pop(),a=i.join(":").split("/"),a=a[a.length-1],n="line "+t+" of "+a+": "+s,this("log",n,"color:#D74B03;"))))},n.time=function(e){r||console.time(e)},n.timeEnd=function(e){r||console.timeEnd(e)},n.warning=function(e,t){this("groupCollapsed",e,"color:#888;"),this.stack(),this.wiki(t),this.groupEnd()},n.wiki=function(e){e&&(e in a&&(e=d3plus.repo+"wiki/"+a[e]),this("log","documentation: "+e,"color:#aaa;"))},t.exports=n},{"../../client/ie.js":40,"./wiki.coffee":55}],55:[function(e,t){t.exports={active:"Segmenting-Data#active",aggs:"Custom-Aggregations",alt:"Alt-Text-Parameters",attrs:"Attribute-Data#axes",axes:"Axis-Parameters",background:"Background",color:"Color-Parameters",container:"Container-Element",coords:"Geography-Data",csv:"CSV-Export",data:"Data-Points",depth:"Visible-Depth",descs:"Value-Definitions",dev:"Verbose-Mode",draw:"Draw",edges:"Edges-List",error:"Custom-Error-Message",focus:"Focus-Element",font:"Font-Styles",footer:"Custom-Footer",format:"Value-Formatting",height:"Height",history:"User-History",hover:"Hover-Element",icon:"Icon-Parameters",id:"Unique-ID",keywords:"Keyword-Parameters",labels:"Data-Labels",legend:"Legend",links:"Link-Styles",margin:"Outer-Margins",messages:"Status-Messages",method:"Methods",nodes:"Node-Positions",open:"Open",order:"Data-Ordering",remove:"Remove",search:"Search-Box",select:"Selecting-Elements#select",selectAll:"Selecting-Elements#selectall",shape:"Data-Shapes",size:"Size-Parameters",temp:"Segmenting-Data#temp",text:"Text-Parameters",time:"Time-Parameters",timeline:"Timeline",timing:"Animation-Timing",title:"Custom-Titles",tooltip:"Tooltip-Parameters",total:"Segmenting-Data#total",type:"Output-Type",ui:"Custom-Interface",width:"Width",x:"Axis-Parameters",y:"Axis-Parameters",zoom:"Zooming"}},{}],56:[function(e,t){var r=e("../../util/buckets.coffee"),n=e("../fetch/value.js"),a=e("../console/print.coffee");t.exports=function(e){e.dev.value&&a.time("getting color data range");var t=[];if(e.data.pool.forEach(function(r){var a=parseFloat(n(e,r,e.color.value));"number"==typeof a&&!isNaN(a)&&t.indexOf(a)<0&&t.push(a)}),e.dev.value&&a.timeEnd("getting color data range"),t.length>1){if(e.dev.value&&a.time("calculating color scale"),t=d3.extent(t),t[0]<0&&t[1]>0){var o=e.color.range;3==o.length&&(t.push(t[1]),t[1]=0)}else if(t[1]>0&&t[0]>=0){var o=e.color.heatmap;t=r(t,o.length)}else{var o=e.color.range.slice(0);t[0]<0?o.pop():o.shift()}e.color.valueScale=d3.scale.sqrt().domain(t).range(o).interpolate(d3.interpolateRgb),e.dev.value&&a.timeEnd("calculating color scale")}else e.color.valueScale=null}},{"../../util/buckets.coffee":188,"../console/print.coffee":54,"../fetch/value.js":68}],57:[function(e,t){var r=e("../fetch/value.js"),n=e("../console/print.coffee"),a=e("../../object/validate.coffee");t.exports=function(e,t){e.dev.value&&n.time("filtering data");var o=d3.keys(e.data.keys||{});"attrs"in e&&(o=o.concat(d3.keys(e.attrs.keys||{}))),t=t.filter(function(t){return e.id.value in t}),e.data.filters.forEach(function(n){o.indexOf(e[n].value)>=0&&(t=t.filter(function(t){var a=r(e,t,e[n].value);return"size"===n?"number"==typeof a:null!==a}))});var i=e.data.solo.length?"solo":"mute";return e.data[i].forEach(function(o){function s(t){var r=e[o][i].value,n=!1;return r.forEach(function(e){"function"==typeof e?n=e(t):e===t&&(n=!0)}),n}function l(t){var n=!1;if(e[o].nesting){var l=e[o].nesting;a(l)&&(l=d3.keys(l)),l.forEach(function(a){n||(n=s(r(e,t,a)))})}else n=s(r(e,t,e[o].value));return"solo"===i?n:!n}t=t.filter(l),"id"===o&&("nodes"in e&&e.nodes.value&&(e.dev.value&&n.log("Filtering Nodes"),e.nodes.restricted=e.nodes.value.filter(l)),"edges"in e&&e.edges.value&&(e.dev.value&&n.log("Filtering Connections"),e.edges.restricted=e.edges.value.filter(function(t){var r=l(t[e.edges.source]),n=l(t[e.edges.target]);return r&&n})))}),e.dev.value&&n.timeEnd("filtering data"),t}},{"../../object/validate.coffee":162,"../console/print.coffee":54,"../fetch/value.js":68}],58:[function(e,t){var r=e("./nest.js"),n=e("../fetch/value.js"),a=e("../console/print.coffee"),o=e("../../util/uniques.coffee");t.exports=function(e){if(e.data.time={values:[]},e.time&&e.time.value){if(e.dev.value){var t="analyzing time periods";a.time(t)}for(var i=o(e.data.value,e.time.value),s=0;s<i.length;s++){var l=new Date(i[s].toString());"Invalid Date"!==l&&(l.setTime(l.getTime()+60*l.getTimezoneOffset()*1e3),e.data.time.values.push(l))}e.data.time.values.sort(function(e,t){return e-t});var u=[];e.data.time.values.forEach(function(t,r){if(0!=r){var n=e.data.time.values[r-1];u.push(t-n),r===e.data.time.values.length-1&&(e.data.time.total=t-e.data.time.values[0])}}),e.data.time.step=d3.min(u);var c=["Milliseconds","Seconds","Minutes","Hours","Date","Month","FullYear"],f=[1e3,60,60,24,30,12,1],d=function(t,r,n){return e.data.time.stepDivider||(e.data.time.stepDivider=f.slice(0,n).reduce(function(e,t){return e*t})),Math.round(Math.floor(r-t)/e.data.time.stepDivider)},u=e.data.time.step,p=e.data.time.total;c.forEach(function(t,r){var n="Date"===t?28:f[r];if(!e.data.time.stepType&&(r===c.length-1||Math.round(u)<n)){e.data.time.stepType=t;var a=e.data.time.values[0],o=e.data.time.values[e.data.time.values.length-1];e.data.time.stepIntervals=d(a,o,r)}!e.data.time.totalType&&(r===c.length-1||Math.round(p)<n)&&(e.data.time.totalType=t),u/=n,p/=n}),e.data.time.values.forEach(function(t,r){if(0!=r){var n=e.data.time.values[0];e.data.time.dataSteps.push(d(n,t,c.indexOf(e.data.time.stepType)))}else e.data.time.dataSteps=[0]});for(var h=e.data.time.stepType,v=e.data.time.totalType,g=e.format.locale.value,m=function(e,t,r){if(e===t)return r&&g.timeFormat[e+"Small"]?g.timeFormat[e+"Small"]:g.timeFormat[e];if(c.indexOf(e)>=4||c.indexOf(t)<=3)return g.timeFormat[t+"-"+e];if("Date"===t)var n=g.timeFormat[t];else var n=g.timeFormat[t+"-Date"];return"Hours"===e?n+" "+g.timeFormat[e]:n+" "+g.timeFormat["Hours-"+e]},y=[],x=[,function(e){return e.getMilliseconds()},function(e){return e.getSeconds()},function(e){return e.getMinutes()},function(e){return e.getHours()},function(e){return 1!=e.getDate()},function(e){return e.getMonth()},function(){return!0}],s=c.indexOf(h);s<=c.indexOf(v);s++){var b=s-1<c.indexOf(h)?c[s]:c[s-1],w=c[s]===b&&h!==v,_=m(b,c[s],w);y.push([_,x[s+1]])}e.data.time.format=d3.locale(g.format).timeFormat(m(h,v)),e.data.time.multiFormat=d3.locale(g.format).timeFormat.multi(y),e.data.time.ticks=[];for(var k=d3.min(e.data.time.values),s=0;s<=e.data.time.stepIntervals;s++){var l=new Date(k);l["set"+e.data.time.stepType](l["get"+e.data.time.stepType]()+s),e.data.time.ticks.push(l)}e.dev.value&&a.timeEnd(t)}if(e.dev.value){var t="nesting data by time and depths";a.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)})):e.data.time.values.forEach(function(t){var a=t.getTime();e.data.nested[a]={};var o=e.data.value.filter(function(t){var t=new Date(n(e,t,e.time.value).toString());return t.setTime(t.getTime()+60*t.getTimezoneOffset()*1e3),t.getTime()===a});e.id.nesting.forEach(function(t,n){var i=e.id.nesting.slice(0,n+1);e.data.nested[a][t]=r(e,o,i)})}),e.dev.value&&a.timeEnd(t)}},{"../../util/uniques.coffee":194,"../console/print.coffee":54,"../fetch/value.js":68,"./nest.js":62}],59:[function(e,t){var r;r=e("../fetch/value.js"),t.exports=function(e,t,n){var a,o,i,s,l,u,c,f,d,p,h;for(o=d3.nest(),void 0===n&&(n=e.id.nesting),i=f=0,p=n.length;p>f;i=++f)l=n[i],i<e.depth.value&&(s=l,o.key(function(t){return r(e,t.d3plus,s)}));for(u=[],d=0,h=t.length;h>d;d++)a=t[d],c=e.size.value?r(e,a,e.size.value):1,c&&"number"==typeof c&&c>0&&(delete a.d3plus.r,delete a.d3plus.x,delete a.d3plus.y,u.push({d3plus:a,id:a[e.id.value],value:c}));return o.entries(u)}},{"../fetch/value.js":68}],60:[function(e,t){var r=e("../../object/validate.coffee");t.exports=function(e,t){function n(a){if(a instanceof Array)a.forEach(function(e){n(e)});else if(r(a))for(var o in a)r(a[o])?n(a[o]):!(o in e[t].keys)&&o in a&&(e[t].keys[o]=typeof a[o])}if(e.dev.value){var a=t+" key analysis";console.time(a)}if(e[t].keys={},r(e[t].value))for(var o in e[t].value)n(e[t].value[o]);else n(e[t].value);e.dev.value&&console.time(a)}},{"../../object/validate.coffee":162}],61:[function(e,t){var r,n;r=e("../console/print.coffee"),n=e("../../object/validate.coffee"),t.exports=function(e,t,a){var o,i,s;return e.dev.value&&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]:!1,o?("txt"===o&&(o="text"),e[t].filetype.accepted.indexOf(o)<0&&(o="json")):o="json"),(i="dsv"===o?d3.dsv(e[t].delimiter.value,"text/plain"):d3[o])(s,function(i,l){var u,c;if(!i&&l){if("function"==typeof e[t].callback){if(c=e[t].callback(l))if(n(c)&&t in c)for(u in c)u in e&&(e[u].value=c[u]);else e[t].value=c}else e[t].value=l;["json"].indexOf(o)<0&&e[t].value.forEach(function(e){var t;t=[];for(u in e)t.push(isNaN(e[u])?"false"===e[u].toLowerCase()?e[u]=!1:"true"===e[u].toLowerCase()?e[u]=!0:"null"===e[u].toLowerCase()?e[u]=null:"undefined"===e[u].toLowerCase()?e[u]=void 0:void 0:e[u]=parseFloat(e[u]));return t}),e[t].changed=!0,e[t].loaded=!0}else e.internal_error='Could not load data from: "'+s+'"';return e.dev.value&&r.time("loading "+t),a()})}},{"../../object/validate.coffee":162,"../console/print.coffee":54}],62:[function(e,t){var r=e("../fetch/value.js"),n=e("../../object/validate.coffee"),a=e("../../util/uniques.coffee"),o=function(e,t,i,s){var l=d3.nest(),u=[],c="temp"in e?["active","temp","total"]:[],s=s||e.types[e.type.value].requirements||[],f="time"in e?[e.time.value,e.icon.value]:[],d=function(){s&&s.length&&["x","y"].forEach(function(t){var n=e[t].value;s.indexOf(t)>=0&&n&&"discrete"===e[t].scale.value&&(f.push(n),l.key(function(t){return r(e,t,n)}))})};s instanceof Array||(s=[s]),i.forEach(function(t){l.key(function(n){return"function"==typeof t?t(n):r(e,n,t)}),d()}),i.length||(l.key(function(){return!0}),d());var p=i.length?i.length-1:0;l.rollup(function(t){function s(e){for(var t=0;t<e.length;t++){var r=e[t];void 0!==r&&(r.constructor===Date?b.push(r):r.constructor===Array?s(r):(r=new Date(r.toString()),"Invalid Date"!==r&&(r.setTime(r.getTime()+60*r.getTimezoneOffset()*1e3),b.push(r))))}}function l(e){e instanceof Array?e.forEach(l):n(e)&&d in e&&(e[d]instanceof Array?e[d].forEach(l):w.push(e))}if(1===t.length&&"d3plus"in t[0])return u.push(t[0]),t[0];var f={d3plus:{depth:p}};"d3plus"in t[0]&&t.forEach(function(e){"d3plus"in e&&(e.d3plus.merged instanceof Array&&(f.d3plus.merged||(f.d3plus.merged=[]),f.d3plus.merged=f.d3plus.merged.concat(e.d3plus.merged)),e.d3plus.text&&(f.d3plus.text=e.d3plus.text))
}),c.forEach(function(n){var a=e[n].value||n;f.d3plus[a]=d3.sum(t,function(t){if(e[n].value){var a=r(e,t,e[n].value);"number"!=typeof a&&(a=a?1:0)}else if("total"===n)var a=1;else var a=0;return a})});for(var d in e.data.keys){var h=a(t,d);if(h.length){var v=e.aggs&&e.aggs.value[d]?e.aggs.value[d]:"sum",g=typeof v,m=e.data.keys[d],y=e.id.nesting.indexOf(d)>=0,x="time"in e&&d===e.time.value;if(d in f.d3plus)f[d]=f.d3plus[d];else if("function"===g)f[d]=e.aggs.value[d](t);else if(x){var b=[];s(h),f[d]=1===b.length?b[0]:b}else if("number"!==m||"string"!==g||y){var w=[];l(t);var _=1===w.length?w[0][d]:a(w,d);if(void 0!==_&&null!==_){if(_ instanceof Array||(_=[_]),_.length)if(y&&e.id.nesting.indexOf(d)>p&&w.length>1){if("id"==d&&1==i.length&&w.length>t.length){var k=i.concat(d);w=o(e,w,k)}f[d]=1===w.length?w[0]:w}else f[d]=1===_.length?_[0]:_}else if(y){var z=e.id.nesting.indexOf(d)-1;z>=p&&(!("endPoint"in f.d3plus)||f.d3plus.endPoint>p)&&(f.d3plus.endPoint=p)}}else f[d]=d3[v](h)}}return u.push(f),f});var h=function(e){return e.values&&e.values.length?(e.children=e.values.map(function(e){return h(e)}),delete e.values,e):e.values?e.values:e},v=function(t,r,n){if(t.children){"number"==e.data.keys[i[r]]&&(t.key=parseFloat(t.key)),n[i[r]]=t.key,delete t.key;for(var a in n)t[a]=n[a];r++,t.children.forEach(function(e){v(e,r,n)})}};return l=l.entries(t).map(h).map(function(e){return v(e,0,{}),e}),u};t.exports=o},{"../../object/validate.coffee":162,"../../util/uniques.coffee":194,"../fetch/value.js":68}],63:[function(e,t){var r=e("../../array/sort.coffee"),n=e("./nest.js"),a=e("../fetch/value.js"),o=(e("../fetch/color.coffee"),e("../fetch/text.js"));t.exports=function(e,t,i){if(e.size.threshold.value===!1)var s=0;else if("number"==typeof e.size.threshold.value)var s=e.size.threshold.value;else if("function"==typeof e.size.threshold.value)var s=e.size.threshold.value(e);else if("number"==typeof e.types[e.type.value].threshold)var s=e.types[e.type.value].threshold;else if("function"==typeof e.types[e.type.value].threshold)var s=e.types[e.type.value].threshold(e);else var s=.02;if("number"==typeof s&&s>0){var l=[],u=0==e.depth.value?0:{},c=[],f={},d=d3.nest();i&&d.key(function(t){return a(e,t,i)}),d.rollup(function(t){var r=t.length;e.aggs[e.size.value]?"function"==typeof e.aggs[e.size.value]?r=e.aggs[e.size.value](t):"string"==typeof e.aggs[e.size.value]&&(r=d3[e.aggs[e.size.value]](t,function(t){return a(e,t,e.size.value)})):r=d3.sum(t,function(t){return a(e,t,e.size.value)});var n=i?a(e,t[0],i):"all";return f[n]=r,r}).entries(t);var p=t.filter(function(t){var r=a(e,t,e.id.value),n=a(e,t,e.size.value),o=i?a(e,t,i):"all";if(l.indexOf(r)<0&&n/f[o]>=s&&l.push(r),l.indexOf(r)<0){if(0==e.depth.value)n>u&&(u=n);else{var d=t[e.id.nesting[e.depth.value-1]];d in u||(u[d]=0),n>u[d]&&(u[d]=n)}return c.push(t),!1}return!0});if(c.length>1){c=r(c,e.size.value,"desc",[],e);var h=e.id.nesting.slice(0,e.depth.value),v=n(e,c,h);v.forEach(function(t){var r=e.id.nesting[e.depth.value-1];if(e.id.nesting.forEach(function(r,n){if(e.depth.value==n){var a=t[e.id.nesting[n-1]];t[r]="string"==typeof a?"d3plus_other_"+a:"d3plus_other"}else n>e.depth.value&&delete t[r]}),e.color.value&&"string"===e.color.type&&(t[e.color.value]=0==e.depth.value?e.color.missing:a(e,t[r],e.color.value,r)),e.icon.value&&(t[e.icon.value]=a(e,t[r],e.icon.value,r)),t[r]&&(t.d3plus.depth=e.depth.value),0===e.depth.value){var n=e.format.value(e.format.locale.value.ui.values,"threshold",e);n+=" < "+e.format.value(u,e.size.value,e)}else{var n=o(e,t,e.depth.value-1);n=n.length?n[0].split(" < ")[0]:e.format.value(e.format.locale.value.ui.values,"threshold",e),n+=" < "+e.format.value(u[t[r]],e.size.value,e)}n+=" ("+e.format.value(100*s,"share",e)+"%)",t.d3plus.threshold=u,r?(t.d3plus.merged=[],c.forEach(function(e){t[r]==e[r]&&t.d3plus.merged.push(e)})):t.d3plus.merged=c,e.text.value&&(t[e.text.value]=n),t.d3plus.text=n})}else v=c;return p.concat(v)}return t}},{"../../array/sort.coffee":37,"../fetch/color.coffee":64,"../fetch/text.js":67,"../fetch/value.js":68,"./nest.js":62}],64:[function(e,t){var r,n,a,o;r=e("./value.js"),n=e("../../color/random.coffee"),a=e("../../color/validate.coffee"),o=e("../../object/validate.coffee"),t.exports=function(e,t,i){var s,l,u,c,f,d,p,h;if(t.d3plus&&t.d3plus.color)return t.d3plus.color;if(f=function(t){return o(t)&&(t=r(e,t,i)),t instanceof Array&&(t=t[0]),n(t,e.color.scale.value)},i||(i=e.id.value),"number"==typeof i&&(i=e.id.nesting[i]),e.color.value){for(u=[],d=e.id.nesting.indexOf(i),c=function(r){return r?e.color.valueScale?e.color.valueScale(r):a(r)?r:f(r):e.color.value&&"function"==typeof e.color.valueScale?e.color.valueScale(0):f(t)};d>=0;)l=e.id.nesting[d],o(t)?(p=l in t?t:r(e,t,l),h=r(e,p,e.color.value,l)):h=t,void 0!==h&&null!==h&&(s=c(h),u.indexOf(s)<0&&u.push(s)),d--;return 1===u.length?u[0]:e.color.missing}return f(t)}},{"../../color/random.coffee":49,"../../color/validate.coffee":53,"../../object/validate.coffee":162,"./value.js":68}],65:[function(e,t){var r=e("../data/filter.js"),n=e("../data/nest.js"),a=e("../console/print.coffee"),o=e("../../string/format.js"),i=e("../../string/list.coffee");t.exports=function(e,t,s){if(!e.data.value)return[];if(void 0===s)var s=e.depth.value;var l=e.id.nesting[s];if(!t||t instanceof Array||(t=[t]),!t&&"time"in e){var u=e.time.solo.value.length?"solo":"mute",t=[];if(e.time[u].value.length){var t=[];e.time[u].value.forEach(function(r){if("function"==typeof r)e.data.time.values.forEach(function(e){r(e.getTime())&&t.push(e.getTime())});else if(r.constructor===Date)t.push(new Date(r).getTime());else{var n=new Date(r.toString());"Invalid Date"!==n&&(n.setTime(n.getTime()+60*n.getTimezoneOffset()*1e3),t.push(n.getTime()))}}),"mute"===u&&(t=e.data.time.values.filter(function(e){return t.indexOf(e.getTime())<0}))}else t.push("all")}else t=["all"];if(t.indexOf("all")>=0&&e.data.time.values.length){t=e.data.time.values.slice(0);for(var c=0;c<t.length;c++)t[c]=t[c].getTime()}var f=[e.type.value,l,s].concat(e.data.filters).concat(t),d=e.data.solo.length?"solo":"mute",p=d3.keys(e.data.cache),h=e.types[e.type.value].filter||null;e.data[d].length&&e.data[d].forEach(function(t){var r=e[t][d].value.slice(0);r.unshift(t),f=f.concat(r)}),f=f.join("_");for(var c=0;c<p.length;c++){var v=p[c].split("_").slice(1).join("_");if(v===f){f=(new Date).getTime()+"_"+f,e.data.cache[f]=e.data.cache[p[c]],delete e.data.cache[p[c]];break}}if(e.data.cache[f]){e.dev.value&&a.comment("data already cached");var g=e.data.cache[f];return"function"==typeof h&&(g=h(e,g)),g}var m=[],g=[];if(e.data.value&&e.data.value.length&&t.forEach(function(t){e.data.nested[t]?g=g.concat(e.data.nested[t][l]):m.push(t)}),0===g.length&&m.length&&!e.internal_error){var y=e.time.format.value||e.data.time.format;m.length>1&&(m=d3.extent(m)),m=m.map(function(e){return y(new Date(e))}),m=m.join(" - ");var x=e.format.locale.value.error.dataYear,b=e.format.locale.value.ui.and;m=i(m,b),e.internal_error=o(x,m),e.time.missing=!0}else{if(e.time&&(e.time.missing=!1),t.length>1){var w=!1;if(["x","y"].forEach(function(t){e[t].value===e.time.value&&"discrete"===e[t].scale.value&&(w=!0)}),!w){var _=e.id.nesting.slice(0,s+1);g=n(e,g,_)}}g=g?r(e,g):[];var p=d3.keys(e.data.cache);20===p.length&&(p.sort(),delete e.data.cache(p[0])),f=(new Date).getTime()+"_"+f,e.data.cache[f]=g,"function"==typeof h&&(g=h(e,g)),e.dev.value&&a.comment("storing data in cache")}return g}},{"../../string/format.js":163,"../../string/list.coffee":164,"../console/print.coffee":54,"../data/filter.js":57,"../data/nest.js":62}],66:[function(e,t){var r,n,a;a=e("./value.js"),r=e("./color.coffee"),n=e("./text.js"),t.exports=function(e,t,o,i,s){var l,u,c,f;for(o instanceof Array||(o=[o]),i instanceof Array||(i=[i]),e&&void 0!==s&&"number"!=typeof s&&(s=e.id.nesting.indexOf(s)),c={},l=0;l<o.length;)u=o[l],f=e?i.indexOf(u)>=0?r(e,t,s):u===e.text.value?n(e,t,s):a(e,t,u,s):t[u],f instanceof Array&&(f=f[0]),f="string"==typeof f?f.toLowerCase():f,c[u]=f,l++;return c}},{"./color.coffee":64,"./text.js":67,"./value.js":68}],67:[function(e,t){var r=e("./value.js"),n=e("../../object/validate.coffee"),a=e("../../util/uniques.coffee");t.exports=function(e,t,o){if("number"!=typeof o)var o=e.depth.value;var i=e.id.nesting[o];if(e.text.nesting&&n(e.text.nesting))if(e.text.nesting[i])var s=e.text.nesting[i];else var s=e.text.value;else{var s=[];e.text.value&&o===e.depth.value&&s.push(e.text.value),s.push(i)}s instanceof Array||(s=[s]);var l=[];if(n(t)&&"d3plus"in t&&t.d3plus.text)l.push(t.d3plus.text.toString()),l.push(e.format.value(t.d3plus.text.toString(),void 0,e,t));else{var u=n(t)&&i in t?t[i]:r(e,t,i);u instanceof Array?n(u[0])&&(u=a(u,i)):u=[u];var c=n(t)?t:void 0;s.forEach(function(t){var o=[];u.forEach(function(s){var l=r(e,s,t,i);l&&(l instanceof Array&&n(l[0])&&(l=a(l,t)),o=o.concat(l))}),o.length&&(o=o.map(function(r){return r instanceof Array?r.map(function(r){return e.format.value(r.toString(),t,e,c)}):r?e.format.value(r.toString(),t,e,c):void 0}),1===o.length&&(o=o[0]),l.push(o))})}return l}},{"../../object/validate.coffee":162,"../../util/uniques.coffee":194,"./value.js":68}],68:[function(e,t){var r=e("../../object/validate.coffee"),n=e("../../util/uniques.coffee");fetch=function(e,t,a,o){function i(e){if(t instanceof Array){var r=n(t,o);return e.filter(function(e){return r.indexOf(e[o])>=0})}return e.filter(function(e){return e[o]===t})}function s(e){var t=n(e,a);return 1===t.length?t[0]:void 0}if(a&&"function"==typeof a)return a(t,e);if(a&&"number"==typeof a)return a;if(!a)return null;if(!o)if(r(a)){if(a[e.id.value])var o=e.id.value;else var o=d3.keys(a)[0];a=a[o]}else var o=e.id.value;if(a===o){if(r(t)&&a in t)return t[a];if(!(t instanceof Array))return t}if(r(t)&&a in t)return t[a];if(r(t)&&o in t){var l=s(t);if(l)return l;t=t[o]}if(t instanceof Array){var l=s(t);if(l)return l}if(e.data.viz instanceof Array){var l=s(i(e.data.viz));if(l)return l}if("attrs"in e&&e.attrs.value)if(e.attrs.value instanceof Array)var u=i(e.attrs.value);else if(o in e.attrs.value)if(e.attrs.value[o]instanceof Array)var u=i(e.attrs.value[o]);else var u=e.attrs.value[o];else var u=e.attrs.value;if(r(u)){var c=[];t instanceof Array?(r(t[0])&&(t=n(t,o)),t.forEach(function(e){c.push(u[e])})):c.push(u[t]),u=c}if(u&&u.length){var f=n(u,a);if(1===f.length)return f[0];if(f.length)return f}return null},t.exports=function(e,t,n,a,o){if(r(t)&&t.values instanceof Array){for(var i=null,s=0;s<t.values.length&&!(i=fetch(e,t.values[s],n,a,o));s++);return i}return fetch(e,t,n,a,o)}},{"../../object/validate.coffee":162,"../../util/uniques.coffee":194}],69:[function(e,t){t.exports=function(e){var t,r,n;return["div","svg"].indexOf(e)<0&&(e="div"),r={position:"absolute",left:"-9999px",top:"-9999px",visibility:"hidden",display:"block"},t="div"===e?{}:{position:"absolute"},n=d3.select("body").selectAll(e+".d3plus_tester").data([0]),n.enter().append(e).attr("class","d3plus_tester").style(r).attr(t),n}},{}],70:[function(e,t){t.exports={dev:{accepted:"{0} is not an accepted value for {1}, please use one of the following: {2}.",deprecated:"the {0} method has been removed, please update your code to use {1}.",noChange:"{0} was not updated because it did not change.",noContainer:"cannot find a container on the page matching {0}.",of:"of",oldStyle:"style properties for {0} have now been embedded directly into .{1}().",sameEdge:"edges cannot link to themselves. automatically removing self-referencing edge {0}.",set:"{0} has been set.",setLong:"{0} has been set to {1}.",setContainer:"please define a container div using .container()"},error:{accepted:"{0} is not an accepted {1} for {2} visualizations, please use one of the following: {3}.",connections:"no connections available for {0}.",data:"no data available",dataYear:"no data available for {0}.",lib:"{0} visualizations require loading the {1} library.",libs:"{0} visualizations require loading the following libraries: {1}.",method:"{0} visualizations require setting the {1} method.",methods:"{0} visualizations require setting the following methods: {1}."},format:{decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%A, %B %-d, %Y %X",date:"%-m/%-d/%Y",time:"%I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},lowercase:["a","and","at","but","in","of","or","the","to","with"],message:{data:"analyzing data",draw:"drawing visualization",initializing:"initializing {0}",loading:"loading data",tooltipReset:"resetting tooltips",ui:"updating ui"},method:{active:"active segments",color:"color",depth:"depth",dev:"verbose",focus:"focus",icon:"icon",id:"id",height:"height",labels:"labels",legend:"legend",margin:"margin",messages:"status messages",mode:"mode",order:"order",search:"search",shape:"shape",size:"size",style:"style",temp:"temporary segments",text:"text",time:"time",timeline:"timeline",total:"total segments",type:"type",width:"width",x:"x axis",y:"y axis",zoom:"zoom"},time:["date","day","month","time","year"],timeFormat:{FullYear:"%Y",Month:"%B",MonthSmall:"%b",Date:"%A %-d",DateSmall:"%-d",Hours:"%I %p",Minutes:"%I:%M",Seconds:"%Ss",Milliseconds:"%Lms","FullYear-Month":"%b %Y","FullYear-Date":"%-m/%-d/%Y","Month-Date":"%b %-d","Hours-Minutes":"%I:%M %p","Hours-Seconds":"%I:%M:%S %p","Hours-Milliseconds":"%H:%M:%S.%L"},ui:{and:"and",back:"back",collapse:"click to collapse",error:"error",expand:"click to expand",including:"including",loading:"loading...",more:"{0} more",moreInfo:"click for more info",or:"or",noResults:"no results matching {0}.",primary:"primary connections",share:"share",total:"total",values:"values"},uppercase:["tv","ui"],visualization:{bar:"Bar Chart",box:"Box Plot",bubbles:"Bubbles",chart:"Chart",geo_map:"Geo Map",line:"Line Plot",network:"Network",paths:"Paths",pie:"Pie Chart",rings:"Rings",scatter:"Scatter Plot",stacked:"Stacked Area",table:"Table",tree_map:"Tree Map"}}},{}],71:[function(e,t){t.exports={dev:{accepted:"{0} не е прифатенa вредноста за {1}, ве молиме користете еднa од следниве вредности: {2}.",deprecated:"{0} метод е отстранета, ве молиме обновете го вашиот код за да се користи {1}.",noChange:"{0} не е ажурирана, бидејќи немаше промени.",noContainer:"не можe да се најде контејнер на страницата кој се совпаѓа со {0}.",of:"на",oldStyle:"својствата за стилот за {0} сега се вградени директно во. {1} ().",sameEdge:"рабовите не може да имаат алка самите кон себе. автоматски ги отстранувам рабовите кои се само-референцираат {0}.",set:"{0} е наместен.",setLong:"{0} е поставен на {1}.",setContainer:"Ве молиме дефинирајте контејнер div користејќи .container()"},error:{accepted:"{0} не е прифатлива за {1} {2} визуелизација, ве молиме користете една од следниве: {3}.",connections:"нема конекции на располагање за {0}.",data:"нема податоци",dataYear:"Нема достапни податоци за {0}.",lib:"{0} визуализации бараат вчитување на библиотеката {1} .",libs:"{0} визуализации бараат вчитување на следниве библиотеки: {1}.",method:"{0} визуализации бара поставување на {1} методот.",methods:"{0} визуализации бараат поставување на следниве методи: {1}."},format:{decimal:",",thousands:".",grouping:[3],currency:[""," ден."],dateTime:"%A, %e %B %Y г. %X",date:"%d.%m.%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["недела","понеделник","вторник","среда","четврток","петок","сабота"],shortDays:["нед","пон","вто","сре","чет","пет","саб"],months:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],shortMonths:["јан","фев","мар","апр","мај","јун","јул","авг","сеп","окт","ное","дек"]},lowercase:["a","и","во","но","на","или","да","се","со"],method:{active:"активни сегменти",color:"боја",depth:"длабочина",dev:"опширно",focus:"фокус",icon:"икона",id:"ID",height:"висина",labels:"етикети",legend:"легенда",margin:"маргина",messages:"пораки за статусот",order:"цел",search:"барај",shape:"форма",size:"големина",style:"стил",temp:"привремени сегменти",text:"текст",time:"време",timeline:"времеплов",total:"Вкупно сегменти",type:"тип",width:"ширина",x:"x оската",y:"y оската",zoom:"зум",mode:"режим"},time:["датум","ден","месец","време","година"],visualization:{bar:"Бар табела",box:"Кутија Парцел",bubbles:"Меурчиња",chart:"Табела",geo_map:"Гео мапа",line:"Линиски график",network:"Мрежа",path:"Патеки",pie:"Пита графикон",rings:"Прстени",scatter:"Распрскан график",stacked:"Наредена површина",table:"Табела",tree_map:"Мапа во вид на дрво"},ui:{and:"и",back:"назад",collapse:"кликни за да се собере",error:"грешка",expand:"кликни за да се прошири",loading:"Се вчитува ...",more:"{0} повеќе",moreInfo:"кликнете за повеќе информации",noResults:"Нема резултати за појавување на {0}.",or:"или",primary:"основно врски",share:"удел",total:"Вкупно",values:"вредности",including:"вклучувајќи"},message:{data:"анализирање на податоците",draw:"цртање на визуелизација",initializing:"иницијализација {0}",loading:"вчитување на податоци",tooltipReset:"ресетирање на објаснувањата",ui:"ажурирање на кориничкиот интерфејс"},uppercase:["TV","UI"]}},{}],72:[function(e,t){t.exports={dev:{accepted:"{0} não é um valor aceito para {1}, por favor, use um dos seguintes procedimentos: {2}.",deprecated:"{0} método foi removido, por favor atualize seu código para utilizar {1}.",noChange:"{0} não foi atualizado porque ele não mudou.",noContainer:"Não foi possível encontrar um local na página correspondente a {0}.",of:"de",oldStyle:"propriedades de estilo para {0} já foram incorporados diretamente no. {1} ().",sameEdge:"bordas não podem vincular a si mesmos. removendo automaticamente borda de auto-referência {0}.",set:"{0} foi definida.",setLong:"{0} foi definida para {1}.",setContainer:"por favor, defina um div utilizando .container()"},error:{accepted:"{0} não é um reconhecido {1} para {2} visualizações, por favor, use um dos seguintes procedimentos: {3}.",connections:"Não há conexões disponíveis para {0}.",data:"Não há dados disponíveis",dataYear:"Não há dados disponíveis para {0}.",lib:"A visualização {0} necessita que seja carregado a biblioteca {1}.",libs:"A visualização {0} necessita que seja carregado as bibliotecas {1}.",method:"A visualização {0} exige a definição do método {1}.",methods:"A visualização {0} exige a definição dos métodos {1}."},format:{decimal:",",thousands:".",grouping:[3],currency:["R$",""],dateTime:"%A, %e de %B de %Y. %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],shortDays:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],shortMonths:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"]},lowercase:["a","com","de","e","em","mas","ou","para","um"],method:{active:"segmentos ativos",color:"cor",depth:"profundidade",dev:"verboso",focus:"foco",icon:"ícone",id:"id",height:"altura",labels:"rótulos",legend:"legenda",margin:"margem",messages:"mensagens de status",order:"ordenar",search:"pesquisar",shape:"forma",size:"tamanho",style:"estilo",temp:"segmentos temporários",text:"texto",time:"tempo",timeline:"cronograma",total:"segmentos totais",type:"tipo",width:"largura",x:"eixo x",y:"eixo y",zoom:"zoom",mode:"modo"},time:["ano","data","dia","hora","mês"],visualization:{bar:"Gráfico de Barras",box:"Box Plot",bubbles:"Bolhas",chart:"Gráfico",geo_map:"Mapa",line:"Gráfico de Linha",network:"Rede",path:"Caminhos",pie:"Pie Chart",rings:"Anéis",scatter:"Dispersão",stacked:"Evolução",table:"Tabela",tree_map:"Tree Map"},ui:{and:"e",back:"de volta",collapse:"Clique para fechar",error:"erro",expand:"clique para expandir",loading:"carregando ...",more:"mais {0}",moreInfo:"clique para mais informações",noResults:"nenhum resultado para {0}.",or:"ou",primary:"conexões primárias",share:"participação",total:"total",values:"valores",including:"incluindo"},message:{data:"analisando dados",draw:"desenhando visualização",initializing:"inicializando {0}",loading:"carregando dados",tooltipReset:"redefinindo as dicas",ui:"atualizando interface"},uppercase:["TV"]}},{}],73:[function(e,t){t.exports={dev:{accepted:"{0}不是{1}的可接受值, 请用下列之一的值:{2}",deprecated:"{0}的方法已被移除, 请更新您的代码去使用{1}",noChange:"{0}没有更新, 因为它并没有改变。",noContainer:"无法在该页找到容器去匹配{0}",of:"的",oldStyle:"样式属性{0}现在已经直接嵌入到。{1}()。",sameEdge:"边缘不能链接到自己。自动去除自我参照边缘{0}。",set:"{0}已经被设置。",setLong:"{0}被设置为{1}。",setContainer:"请使用()容器来定义div容器"},error:{accepted:"{0}对于{2}的可视化效果并不是一个可接受的{1}, 请使用如下的一个:{3}.",connections:"没有对{0}可用的连接。",data:"无可用数据",dataYear:"没有数据对{0}可用。",lib:"{0}的可视化要求装载{1}库。",libs:"{0}的可视化需要加载以下库:{1}。",method:"{0}的可视化要求设置{1}方法。",methods:"{0}的可视化要求设置以下方法:{1}。"},format:{decimal:".",thousands:",",grouping:[3],currency:["¥",""],dateTime:"%A %B %e %Y %X",date:"%Y/%-m/%-d",time:"%H:%M:%S",periods:["上午","下午"],days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],shortDays:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],shortMonths:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},lowercase:["一个","和","在","但是","在...里","的","或者","这","向","与...一起"],method:{active:"活跃段",color:"颜色",depth:"深度",dev:"详细",focus:"焦点",icon:"图标",id:"身份认证",height:"高度",labels:"标签",legend:"图例注释",margin:"外边距",messages:"状态消息",order:"规则",search:"搜索",shape:"形状",size:"大小",style:"样式",temp:"暂时性区段",text:"文本",time:"时间",timeline:"时间轴",total:"总段",type:"类型",width:"宽度",x:"X轴",y:"Y轴",zoom:"缩放",mode:"模式"},time:["日","星期","月","时间","年"],visualization:{bar:"条形图",box:"箱线图",bubbles:"气泡",chart:"图表",geo_map:"地理地图",line:"线图",network:"网络",path:"路径",pie:"饼图",rings:"特性",scatter:"散点图",stacked:"堆积面积图",table:"表",tree_map:"树图"},ui:{and:"和",back:"后面",collapse:"点击合并",error:"错误",expand:"单击以展开",loading:"载入中...",more:"{0}更多",moreInfo:"点击了解更多信息",noResults:"没有结果匹配{0}。",or:"或",primary:"主要连接",share:"共享",total:"总",values:"值",including:"包括"},message:{data:"分析数据",draw:"绘制可视化",initializing:"初始化{0}",loading:"加载数据",tooltipReset:"重置工具提示",ui:"更新UI"},uppercase:["电视","用户界面","研发"]}},{}],74:[function(e,t){t.exports={en_US:e("./languages/en_US.coffee"),mk_MK:e("./languages/mk_MK.js"),pt_BR:e("./languages/pt_BR.js"),zh_CN:e("./languages/zh_CN.js")}},{"./languages/en_US.coffee":70,"./languages/mk_MK.js":71,"./languages/pt_BR.js":72,"./languages/zh_CN.js":73}],75:[function(e,t){var r,n,a,o,i,s,l,u,c;n=e("../../util/copy.coffee"),i=e("../console/print.coffee"),s=e("./process/detect.coffee"),l=e("./set.coffee"),u=e("../../string/format.js"),c=e("../../object/validate.coffee"),t.exports=function(e,t){var r,i,s;s=[];for(r in t)i=t[r],e[r]=n(i),e[r].initialized=o(e,e[r],r),s.push(e.self[r]=a(e,r));return s},o=function(e,t,r){var n,a,l,f,d;t.previous=!1,t.changed=!1,t.initialized=!1,"init"in t&&!("value"in t)&&(t.value=t.init(e),delete t.init),"process"in t&&(t.value=s(e,t,t.value));for(l in t)if("deprecates"===l)for(a=t[l]instanceof Array?t[l]:[t[l]],f=0,d=a.length;d>f;f++)n=a[f],e.self[n]=function(t,r){return function(){var n;return e.dev.value&&e.methodGroup&&(i.groupEnd(),e.methodGroup=!1),n=e.format.locale.value.dev.deprecated,t="."+t+"()",i.error(u(n,t,"."+r+"()"),r),e.self}}(n,r);else"global"===l?r in e||(e[r]=[]):c(t[l])&&o(e,t[l],l);return!0},a=function(e,t){return function(n,a){var o,s,l,f;if(o="accepted"in e[t]?e[t].accepted:null,"function"==typeof o&&(o=o(e)),o instanceof Array||(o=[o]),n===Object)return e[t];if(!arguments.length&&o.indexOf(void 0)<0)return"value"in e[t]?e[t].value:e[t];if("style"===t&&"object"==typeof n){f=e.format.locale.value.dev.oldStyle,(e.dev.value||"dev"===t&&n)&&!e.methodGroup&&"wait"!==e.methodGroup&&(e.methodGroup=!0,i.groupCollapsed("method behavior"));for(l in n)i.warning(u(f,'"'+l+'"',l),l),e.self[l](n[l])}return"font"===t&&c(n)&&"family"in n&&"string"==typeof n.family&&(s=function(t){var r;if(c(t))if("family"in t)t.family.value=t.family.process(n.family,e);else for(r in t)s(t[r])})(e),r(e,t,e,t,n),"function"==typeof a&&(e[t].callback=a),e[t].chainable===!1?e[t].value:e.self}},r=function(e,t,n,a,o){var i,s,u,f;if("accepted"!==a)if(f=c(o),u=c(n[a])&&"objectAccess"in n[a]&&n[a].objectAccess===!1,i=!(!f||!u&&("value"in o||d3.keys(o)[0]in n[a])),null===o||!f||i)i?l(e,t,n[a],"value",o):l(e,t,n,a,o);else if(f)for(s in o)r(e,t,n[a],s,o[s])}},{"../../object/validate.coffee":162,"../../string/format.js":163,"../../util/copy.coffee":191,"../console/print.coffee":54,"./process/detect.coffee":83,"./set.coffee":88}],76:[function(e,t){t.exports=function(e){return e||(e=!1),{accepted:[!1,Array,Function,Number,Object,String],callback:{accepted:[!1,Function],value:!1},global:e,process:Array,value:[]}}},{}],77:[function(e,t){var r;r=e("../../../client/rtl.coffee"),t.exports=function(e){return e||(e="left"),{accepted:["left","center","right"],process:function(e){return r?"left"===e?"right":"right"===e?"left":e:e},value:e}}},{"../../../client/rtl.coffee":43}],78:[function(e,t){t.exports=function(e){return e||(e="none"),{accepted:["line-through","none","overline","underline"],value:e}}},{}],79:[function(e,t){var r,n;n=e("../../../font/validate.coffee"),r=["Helvetica Neue","HelveticaNeue","Helvetica","Arial","sans-serif"],t.exports=function(e){return e||(e=r),{process:n,value:e}}},{"../../../font/validate.coffee":96}],80:[function(e,t){t.exports=function(e){return e||(e="bottom"),{accepted:["top","middle","bottom"],mapping:{top:"0ex",middle:"0.5ex",bottom:"1ex"},process:function(e){return this.text=e,this.mapping[e]},value:e}}},{}],81:[function(e,t){t.exports=function(e){return e||(e="none"),{accepted:["capitalize","lowercase","none","uppercase"],value:e}}},{}],82:[function(e,t){var r;r=e("../../../util/d3selection.coffee"),t.exports=function(e,t,n){var a;return"string"==typeof e||r(e)?(a=e.indexOf("/")>=0,!a&&r(e)?e:a||d3.selectAll(e).empty()?(n.url=e,[]):d3.selectAll(e)):e}},{"../../../util/d3selection.coffee":192}],83:[function(e,t){var r,n;r=e("../../../util/copy.coffee"),n=e("../../../array/update.coffee"),t.exports=function(e,t,a){return t.process===Array?n(r(t.value),a):"object"==typeof t.process&&"string"==typeof a?t.process[a]:"function"==typeof t.process?t.process(a,e,t):a}},{"../../../array/update.coffee":38,"../../../util/copy.coffee":191}],84:[function(e,t){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":39}],85:[function(e,t){var r,n,a,o;r=e("../../array/contains.coffee"),n=e("../../string/format.js"),a=e("../../string/list.coffee"),o=e("../console/print.coffee"),t.exports=function(e,t,i,s,l){var u,c,f,d,p,h,v,g;if("function"==typeof t&&(t=t(e)),t instanceof Array||(t=[t]),c=r(t,i),c===!1&&void 0!==i){for(d=[],h=JSON.stringify(i),"string"!=typeof i&&(h='"'+h+'"'),v=0,g=t.length;g>v;v++)u=t[v],d.push("string"==typeof u?'"'+u+'"':"function"==typeof u?u.toString().split("()")[0].substring(9):u.toString());d=a(d,e.format.locale.value.ui.or),e.type&&["mode","shape"].indexOf(s)>=0?(p=e.format.locale.value.error.accepted,f=e.format.locale.value.visualization[e.type.value]||e.type.value,o.warning(n(p,h,s,f,d),s)):(p=e.format.locale.value.dev.accepted,o.warning(n(p,h,l,d),s))}return!c}},{"../../array/contains.coffee":36,"../../string/format.js":163,"../../string/list.coffee":164,"../console/print.coffee":54}],86:[function(e,t){t.exports=function(e){var t;return t=["auto","optimizeSpeed","crispEdges","geometricPrecision"],t.indexOf(e)>=0||(e="crispEdges"),{accepted:t,value:e}}},{}],87:[function(e,t){var r,n;n=e("../../object/validate.coffee"),r=function(e,t){var a;e.changed&&(e.changed=!1),"draw"===t&&(e.frozen=!1,e.update=!0,e.first=!1);for(a in e)n(e[a])&&r(e[a],a)},t.exports=r},{"../../object/validate.coffee":162}],88:[function(e,t){var r,n,a,o,i,s,l,u,c;r=e("../../util/copy.coffee"),n=e("../../util/d3selection.coffee"),c=e("../../object/validate.coffee"),a=e("../../object/merge.coffee"),o=e("../console/print.coffee"),i=e("./process/detect.coffee"),s=e("./rejected.coffee"),l=e("../../string/format.js"),u=e("../../array/update.coffee"),t.exports=function(e,t,f,d,p){var h,v,g,m,y,x,b,w,_,k,z,j,A,M;if(j="value"!==d&&d&&d!==t?'"'+d+'" '+e.format.locale.value.dev.of+" ."+t+"()":"."+t+"()",h="value"===d&&"accepted"in f?f.accepted:c(f[d])&&"accepted"in f[d]?f[d].accepted:[p],!s(e,h,p,t,j)){if(c(f[d])&&"value"in f[d]&&(k=d,f=f[d],d="value"),"value"===d&&"process"in f&&(p=i(e,f,p)),f[d]instanceof Array||f[d]!==p||void 0===p){if(f.changed=!0,"history"in e&&"draw"!==t&&(v=r(f),v.method=t,e.history.chain.push(v)),f.previous=f[d],"id"in e&&"value"===d&&"nesting"in f)if("id"!==t){if("object"!=typeof f.nesting&&(f.nesting={}),c(p)){for(x in p)"string"==typeof p[x]&&(p[x]=[p[x]]);f.nesting=a(f.nesting,p),e.id.value in f.nesting||(f.nesting[e.id.value]=p[d3.keys(p)[0]])}else f.nesting[e.id.value]=p instanceof Array?p:[p];f[d]=f.nesting[e.id.value][0]}else p instanceof Array?(f.nesting=p,"depth"in e&&e.depth.value<p.length?f[d]=p[e.depth.value]:(f[d]=p[0],"depth"in e&&(e.depth.value=0))):(f[d]=p,f.nesting=[p],"depth"in e&&(e.depth.value=0));else"depth"===t?(e.depth.value=p>=e.id.nesting.length?e.id.nesting.length-1:0>p?0: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[d]=c(f[d])&&c(p)?a(f[d],p):p;"value"===d&&f.global&&(y=f[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]=u(e.data[b],t))),"value"===d&&f.dataFilter&&e.data&&e.data.filters.indexOf(t)<0&&e.data.filters.push(t),(e.dev.value||"dev"===d)&&f.changed&&void 0!==f[d]&&(w=f[d]instanceof Array&&f[d].length>10,m=n(f[d]),A="function"==typeof f[d],M=w||m||A?null:"string"==typeof f[d]?f[d]:JSON.stringify(f[d]),(e.dev.value||"dev"===d&&user)&&!e.methodGroup&&"wait"!==e.methodGroup&&(e.methodGroup=!0,o.groupCollapsed("method behavior")),null!==M&&M.length<260?(z=e.format.locale.value.dev.setLong,o.log(l(z,j,'"'+M+'"'))):(z=e.format.locale.value.dev.set,o.log(l(z,j))))}else z=e.format.locale.value.dev.noChange,e.dev.value&&o.comment(l(z,j));"value"===d&&f.callback&&!f.url&&(g="function"==typeof f.callback?f.callback:f.callback.value,g&&g(p))}}},{"../../array/update.coffee":38,"../../object/merge.coffee":161,"../../object/validate.coffee":162,"../../string/format.js":163,"../../util/copy.coffee":191,"../../util/d3selection.coffee":192,"../console/print.coffee":54,"./process/detect.coffee":83,"./rejected.coffee":85}],89:[function(e,t){var r=e("../console/print.coffee"),n=e("../../string/format.js");t.exports=function(e){if(e.dev.value){var t="analyzing edges list";r.time(t)}var a=e.types[e.type.value].requirements;a instanceof Array||(a=[a]);var o=a.indexOf("nodes")>=0&&!e.nodes.value;if(o){e.nodes.value=[];var i=[];e.nodes.changed=!0}e.edges.value.forEach(function(t){if("object"!=typeof t[e.edges.source]){var r={};r[e.id.value]=t[e.edges.source],t[e.edges.source]=r}if("object"!=typeof t[e.edges.target]){var r={};r[e.id.value]=t[e.edges.target],t[e.edges.target]=r}"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]),o&&(i.indexOf(t[e.edges.source][e.id.value])<0&&(i.push(t[e.edges.source][e.id.value]),e.nodes.value.push(t[e.edges.source])),i.indexOf(t[e.edges.target][e.id.value])<0&&(i.push(t[e.edges.target][e.id.value]),e.nodes.value.push(t[e.edges.target])))}),e.edges.value=e.edges.value.filter(function(t){var a=t[e.edges.source][e.id.value],o=t[e.edges.target][e.id.value];if(a===o){var i=e.format.locale.value.dev.sameEdge;return r.warning(n(i,'"'+a+'"'),"edges"),!1}return!0}),e.edges.linked=!0,e.dev.value&&r.timeEnd(t)}},{"../../string/format.js":163,"../console/print.coffee":54}],90:[function(e,t){t.exports=function(e){function t(e,t){[].forEach.call(t.attributes,function(t){if(/^data-/.test(t.name)){var r=t.name.substr(5).replace(/-(.)/g,function(e,t){return t.toUpperCase()
});e[r]=t.value}}),n.forEach(function(r){null!==t.getAttribute(r)&&(e[r]=t.getAttribute(r))})}function r(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")}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(),o=e.data.element.value.attr("type"),i=[];if("select"===a){var s=e.data.element.value.node().id;s&&e.self.container({id:s}),e.data.element.value.selectAll("option").each(function(r,n){var a={};if(a.text=this.innerHTML,t(a,this),i.push(a),this.selected)for(var n=e.id.nesting.length-1;n>=0;n--){var o=e.id.nesting[n];if(o in a){e.self.focus(a[o]);break}}})}else if("input"===a&&"radio"===o){var l=e.data.element.value.node().getAttribute("name");l&&e.self.container({id:l}),e.data.element.value.each(function(){var n={};t(n,this);var a=n[e.id.value]||this.id||!1;if(a&&isNaN(parseFloat(a))){var o=d3.select("label[for="+a+"]");o.empty()||(n.text=o.html(),o.call(r))}i.push(n),this.checked&&e.self.focus(n[e.id.value])})}!e.focus.value.length&&i.length&&(e.data.element.value.node().selectedIndex=0,e.self.focus(i[0][e.id.value]));var u=d3.select("legend[for="+e.container.id+"]");u.empty()||(e.self.title(u.html()),u.call(r));var c=e.container.value?e.container.value.node().tagName.toLowerCase():!1;return(e.container.value===!1||"body"===c)&&(e.container.value=d3.select(e.data.element.value.node().parentNode)),i}},{}],91:[function(e,t){var r=e("../console/print.coffee");t.exports=function(e){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),o=e.edges.strength.value;o&&a.linkStrength("string"==typeof o?function(e){return e[o]}:o);var i=50,s=.01;a.start();for(var l=i;l>0&&(a.tick(),!(a.alpha()<s));--l);a.stop(),e.nodes.positions=!0}e.dev.value&&r.timeEnd(t)}},{"../console/print.coffee":54}],92:[function(e,t){var r;r=e("numeric"),t.exports=function(e,t){var n,a,o,i,s,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,j,A,M;for(null==t&&(t={}),null==t.maxDegree&&(t.maxDegree=5),n=e.length,m=Number.MAX_VALUE,s=null,o=function(){var r,n,a;for(a=[],c=r=1,n=t.maxDegree+1;n>=1?n>r:r>n;c=n>=1?++r:--r)a.push(function(){var t,r,n;for(n=[],t=0,r=e.length;r>t;t++)g=e[t],n.push(Math.pow(g[0],c));return n}());return a}(),_=function(){var t,r,n;for(n=[],t=0,r=e.length;r>t;t++)g=e[t],n.push(g[1]);return n}(),d=z=0,A=1<<t.maxDegree;A>=0?A>z:z>A;d=A>=0?++z:--z){for(i=[function(){var e,t;for(t=[],y=e=0;n>=0?n>e:e>n;y=n>=0?++e:--e)t.push(1);return t}()],f=[0],p=j=0,M=t.maxDegree;M>=0?M>j:j>M;p=M>=0?++j:--j)(d&1<<p)>0&&(i.push(o[p]),f.push(p+1));a=r.transpose(i),h=f.length,l=r.dot(r.dot(r.inv(r.dot(i,a)),i),_),k=r.dot(a,l),x=r.sub(_,k),w=r.dot(x,x),b=w/(n-h),v=-.5*n*Math.log(2*Math.PI)-.5*n*Math.log(b)-w/(2*b),u=-2*v+h*(Math.log(n)-Math.log(2*Math.PI)),m>u&&(m=u,s=[f,l,k])}return s}},{numeric:8}],93:[function(e,t){var r;r=e("static-kdtree"),t.exports=function(e,t){var n,a,o,i,s,l,u,c,f,d,p,h;return null==t&&(t=10),h=r(e),u=function(){var r,n,a;for(a=[],r=0,n=e.length;n>r;r++)c=e[r],a.push(h.knn(c,t+1).slice(1));return a}(),p=function(t,r){var n,a,o,i,s,l;for(n=e[t],a=e[r],i=0,t=s=0,l=n.length;l>=0?l>s:s>l;t=l>=0?++s:--s)o=n[t]-a[t],i+=o*o;return i},i=function(){var r,n,o;for(o=[],a=r=0,n=e.length;n>=0?n>r:r>n;a=n>=0?++r:--r)o.push(p(a,u[a][t-1]));return o}(),f=function(e,t){return Math.max(p(e,t),i[t])},s=function(e){var r,n,a,o,i;for(n=0,i=u[e],a=0,o=i.length;o>a;a++)r=i[a],n+=f(e,r);return t/n},l=function(){var t,r,n;for(n=[],a=t=0,r=e.length;r>=0?r>t:t>r;a=r>=0?++t:--t)n.push(s(a));return n}(),d=function(){var r,i,s,c,f,d;for(d=[],a=r=0,c=e.length;c>=0?c>r:r>c;a=c>=0?++r:--r){for(n=0,f=u[a],i=0,s=f.length;s>i;i++)o=f[i],n+=l[o];n/=t,d.push([a,n/l[a]])}return d}(),d.sort(function(e,t){return t[1]-e[1]})}},{"static-kdtree":10}],94:[function(e,t){t.exports=function(e){var t,r,n;return r=d3.median(e),t=d3.median(e.map(function(e){return Math.abs(e-r)})),n=e.map(function(e,n){return[n,Math.abs(e-r)/t]}),n.sort(function(e,t){return t[1]-e[1]})}},{}],95:[function(e,t){var r;r=e("../core/font/tester.coffee"),t.exports=function(e,t,n){var a,o,i,s;return i=n||r("svg").append("text"),t=t||{},o=[],e instanceof Array||(e=[e]),s=i.selectAll("tspan").data(e),a={x:0,y:0},s.enter().append("tspan").text(String).attr("position","absolute").attr("top","0px").attr("left","0px").style(t).attr(a).each(function(e){return o.push({height:this.offsetHeight||this.getBoundingClientRect().height||this.parentNode.getBBox().height,text:e,width:this.getComputedTextLength()})}),s.remove(),n||i.remove(),o}},{"../core/font/tester.coffee":69}],96:[function(e,t){var r,n;r=e("../core/font/tester.coffee"),n=function(e){var t,a,o,i,s,l,u,c,f,d,p,h,v,g;for(e instanceof Array||(e=e.split(",")),p=0,v=e.length;v>p;p++)o=e[p],o.trim();if(i=e.join(", "),t=n.complete,i in t)return t[i];for(u=function(e){return f.append("span").style("font-family",e).style("font-size","32px").style("padding","0px").style("margin","0px").text("abcdefghiABCDEFGHI_!@#$%^&*()_+1234567890")},c=function(e,t){var r,n,a;return r=u(e),n=r.node().offsetWidth,a=t.node().offsetWidth,r.remove(),n!==a},f=r("div"),s=u("monospace"),l=u("sans-serif"),h=0,g=e.length;g>h;h++)if(a=e[h],d=c(a+",monospace",s),d||(d=c(a+",sans-serif",l)),d){d=a;break}return d||(d="sans-serif"),s.remove(),l.remove(),t[i]=d,d},n.complete={},t.exports=n},{"../core/font/tester.coffee":69}],97:[function(e,t){var r=e("../array/sort.coffee"),n=e("../core/methods/attach.coffee"),a=e("../core/data/format.js"),o=e("../core/data/keys.js"),i=e("../core/data/load.coffee"),s=e("../core/fetch/data.js"),l=e("../client/ie.js"),u=e("../core/methods/reset.coffee"),c=e("../core/console/print.coffee");t.exports=function(){var t={types:{auto:e("./types/auto.js"),button:e("./types/button/button.js"),drop:e("./types/drop/drop.js"),toggle:e("./types/toggle.js")}};return t.self=function(){var e=t.data.value instanceof Array&&t.data.value.length>t.data.large;if(t.draw.timing=t.draw.first||e||l?0:t.timing.ui,t.data.value instanceof Array){if(t.dev.value&&c.groupCollapsed('drawing "'+t.type.value+'"'),t.data.changed&&(t.data.cache={},o(t,"data"),a(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){var n=t.data.element.value;if(n&&"select"===n.node().tagName.toLowerCase()){var f=n.property("selectedIndex");f=0>f?0:f;var d=n.selectAll("option")[0][f],p=d.getAttribute("data-"+t.id.value)||d.getAttribute(t.id.value);p&&(t.focus.value=p)}!t.focus.value&&t.data.viz.length&&(t.focus.value=t.data.viz[0][t.id.value]),t.dev.value&&t.focus.value&&c.log('"value" set to "'+t.focus.value+'"')}var h=function(e,r){r="number"!=typeof r?1===t.id.nesting.length?0:t.id.nesting.length-1:r;var n=t.id.nesting[r];return r>0&&(!(n in e)||e[n]instanceof Array)?h(e,r-1):n};if(t.data.changed){"auto"===t.search.value?t.data.viz.length>10?(t.search.enabled=!0,t.dev.value&&c.log("Search enabled.")):(t.search.enabled=!1,t.dev.value&&c.log("Search disabled.")):t.search.enabled=t.search.value;var v=t.data.element.value?t.data.element.value.node().tagName.toLowerCase():"";if(t.data.element.value&&"select"===v){var g=[];for(var m in t.data.nested.all)g=g.concat(t.data.nested.all[m]);options=t.data.element.value.selectAll("option").data(g,function(e){var t=e?h(e):!1;return e&&t in e?e[t]:!1}),options.exit().remove(),options.enter().append("option"),options.each(function(e){var r=h(e),n=r===t.id.value?t.text.value||t.id.value:t.text.nesting!==!0&&r in t.text.nesting?t.text.nesting[r]:r;for(var a in e)"object"!=typeof e[a]&&(a===n&&d3.select(this).html(e[a]),["alt","value"].indexOf(a)>=0?d3.select(this).attr(a,e[a]):d3.select(this).attr("data-"+a,e[a]));this.selected=e[r]===t.focus.value?!0:!1})}}else if(t.focus.changed&&t.data.element.value){var y=t.data.element.value.node().tagName.toLowerCase();"select"===y&&t.data.element.value.selectAll("option").each(function(e){var r=h(e);this.selected=e[r]===t.focus.value?!0:!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 x=t.data.element.value?t.data.element.value[0][0]:null;if(x)if(x.id)x="#"+x.id;else{var b=x.getAttribute(t.id.value)?t.id.value:"data-"+t.id.value;x=x.getAttribute(b)?"["+b+"="+x.getAttribute(b)+"]":null}t.container.ui.enter().insert("div",x).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+"px");var w=t.container.ui.selectAll("div.d3plus_title").data(t.title.value?[t.title.value]:[]);w.enter().insert("div","#d3plus_"+t.type.value+"_"+t.container.id).attr("class","d3plus_title").style("display","inline-block"),w.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+"px").style("border-color","transparent").style("border-style","solid").style("border-width",t.ui.border+"px").text(String).each(function(){t.margin.left=this.offsetWidth})}if(t.data.value.length){var _=t.format.locale.value.visualization[t.type.value];t.dev.value&&c.time("drawing "+_),t.types[t.type.value](t),t.dev.value&&c.timeEnd("drawing "+_)}else!t.data.url||t.data.loaded&&!t.data.stream||i(t,"data",t.self.draw);u(t),t.methodGroup=!1,t.dev.value&&c.groupEnd()}},n(t,{active:e("./methods/active.coffee"),alt:e("./methods/alt.coffee"),color:e("./methods/color.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":37,"../client/ie.js":40,"../core/console/print.coffee":54,"../core/data/format.js":58,"../core/data/keys.js":60,"../core/data/load.coffee":61,"../core/fetch/data.js":65,"../core/methods/attach.coffee":75,"../core/methods/reset.coffee":87,"./methods/active.coffee":98,"./methods/alt.coffee":99,"./methods/color.coffee":100,"./methods/container.coffee":101,"./methods/data.js":102,"./methods/depth.coffee":103,"./methods/dev.coffee":104,"./methods/draw.js":105,"./methods/focus.coffee":106,"./methods/font.coffee":107,"./methods/format.coffee":108,"./methods/height.coffee":109,"./methods/history.coffee":110,"./methods/hover.coffee":111,"./methods/icon.coffee":112,"./methods/id.coffee":113,"./methods/keywords.coffee":114,"./methods/margin.coffee":115,"./methods/open.coffee":116,"./methods/order.coffee":117,"./methods/remove.coffee":118,"./methods/search.coffee":119,"./methods/select.coffee":120,"./methods/selectAll.coffee":121,"./methods/text.coffee":122,"./methods/timing.coffee":123,"./methods/title.coffee":124,"./methods/type.coffee":125,"./methods/ui.coffee":126,"./methods/width.coffee":127,"./types/auto.js":128,"./types/button/button.js":129,"./types/drop/drop.js":134,"./types/toggle.js":151}],98:[function(e,t){var r;r=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Array,Function,Number,String],value:!1}},{"../../core/methods/filter.coffee":76}],99:[function(e,t){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":76}],100:[function(e,t){t.exports={accepted:[String],value:"color"}},{}],101:[function(e,t){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:d3.select(e instanceof Array?e[0][0]:e)},value:d3.select("body")}},{"../../util/d3selection.coffee":192}],102:[function(e,t){var r=e("../../util/d3selection.coffee"),n=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.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")),n},value:!1},filetype:{accepted:[!1,"json","xml","html","csv","dsv","tsv","txt"],value:!1},filters:[],mute:[],process:function(e,t){return"default"===t.container.id&&e.length&&t.self.container({id:"default"+e.length}),n(e,t,this)},solo:[],sort:{accepted:[Boolean],value:!0},value:!1}},{"../../core/methods/process/data.coffee":82,"../../util/d3selection.coffee":192}],103:[function(e,t){t.exports={accepted:[Number],value:0}},{}],104:[function(e,t){t.exports={accepted:[Boolean],value:!1}},{}],105:[function(e,t){var r=e("../../util/d3selection.coffee"),n=e("../../core/parse/element.js"),a=e("../../core/console/print.coffee"),o=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.value=n(t)),void 0===e&&"function"==typeof this.value&&(e=this.value),t.container.value===!1){var i=t.format.locale.value.dev.setContainer;a.warning(i,"container")}else if(t.container.value.empty()){var i=t.format.locale.value.dev.noContainer;a.warning(o(i,'"'+t.container.value+'"'),"container")}else t.dev.value&&(t.methodGroup&&(t.methodGroup="wait",a.groupEnd()),a.time("total draw time")),t.container.value.call(t.self);if("function"==typeof e&&t.history.chain.length){var s={};changes.forEach(function(e){var t=e.method;delete e.method,s[t]=e}),e(s),t.history.chain=[]}return e},update:!0,value:void 0}},{"../../core/console/print.coffee":54,"../../core/parse/element.js":90,"../../string/format.js":163,"../../util/d3selection.coffee":192}],106:[function(e,t){t.exports={accepted:[!1,Number,String],deprecates:"highlight",process:function(e,t){var r,n,a,o,i,s,l,u,c,f;if(n=t.data.element.value,n&&["string","number"].indexOf(typeof e)>=0)if(a=n.node().tagName.toLowerCase(),o=n.attr("type"),"select"===a)for(f=n.selectAll("option"),i=s=0,u=f.length;u>s;i=++s)r=f[i],r&&r[t.id.value]===e&&(n.node().selectedIndex=i);else if("input"===a&&"radio"===o)for(l=0,c=n.length;c>l;l++)r=n[l],this.checked=r&&r[t.id.value]===e;return e},value:!1}},{}],107:[function(e,t){var r,n,a,o;a=e("../../core/methods/font/family.coffee"),r=e("../../core/methods/font/align.coffee"),n=e("../../core/methods/font/decoration.coffee"),o=e("../../core/methods/font/transform.coffee"),t.exports={align:r(),color:"#444444",decoration:n(),family:a(),secondary:{align:r(),color:"#444444",decoration:n(),family:a(),size:12,spacing:0,transform:o(),weight:200},size:12,spacing:0,transform:o(),weight:200}},{"../../core/methods/font/align.coffee":77,"../../core/methods/font/decoration.coffee":78,"../../core/methods/font/family.coffee":79,"../../core/methods/font/transform.coffee":81}],108:[function(e,t){var r,n,a,o;r=e("../../number/format.js"),n=e("../../core/locale/locale.coffee"),a=e("../../object/merge.coffee"),o=e("../../string/title.coffee"),t.exports={accepted:[Function,String],deprecates:["number_format","text_format"],locale:{accepted:function(){return d3.keys(n)},process:function(e){var t,r;return t="en_US",r=n[t],e!==t&&(r=a(r,n[e])),this.language=e,r},value:"en_US"},number:{accepted:[!1,Function],value:!1},process:function(e,t){if("string"==typeof e)t.self.format({locale:e});else if("function"==typeof e)return e;return this.value},text:{accepted:[!1,Function],value:!1},value:function(e,t,n,a){var i,s;return n||(n={}),n.time&&n.time.value&&t===n.time.value?(i=n.time.format.value||n.data.time.format,s=e.constructor===Date?e:new Date(e),i(s)):"number"==typeof e?(i=this.number.value||r)(e,t,n,a):"string"==typeof e?(i=this.text.value||o)(e,t,n,a):JSON.stringify(e)}}},{"../../core/locale/locale.coffee":74,"../../number/format.js":160,"../../object/merge.coffee":161,"../../string/title.coffee":166}],109:[function(e,t){t.exports={accepted:[!1,Number],max:600,secondary:!1,value:!1}},{}],110:[function(e,t){t.exports={back:function(){this.states.length&&this.states.pop()()},chain:[],states:[]}},{}],111:[function(e,t){t.exports={accepted:[!1,Number,String],value:!1}},{}],112:[function(e,t){var r;r=e("../../core/methods/process/icon.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],back:{accepted:[!1,String],fallback:"❮",opacity:1,process:r,rotate:0,value:"fa-angle-left"},button:{accepted:[!1,String],fallback:!1,opacity:1,process:r,rotate:0,value:!1},drop:{accepted:[!1,String],fallback:"❯",opacity:1,process:r,rotate:0,value:"fa-angle-down"},next:{accepted:[!1,String],fallback:"❯",opacity:1,process:r,rotate:0,value:"fa-angle-right"},select:{accepted:[!1,String],fallback:"✓",opacity:1,process:r,rotate:0,value:"fa-check"},style:{accepted:[Object,String],value:"default"},value:"icon"}},{"../../core/methods/process/icon.coffee":84}],113:[function(e,t){var r;r=e("../../core/methods/filter.coffee"),t.exports={accepted:[Array,String],dataFilter:!0,mute:r(!0),nesting:["value"],solo:r(!0),value:"value"}},{"../../core/methods/filter.coffee":76}],114:[function(e,t){var r;r=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],mute:r(!0),solo:r(!0),value:"keywords"}},{"../../core/methods/filter.coffee":76}],115:[function(e,t){t.exports={accepted:[Number,Object,String],process:function(e){var t,r,n,a,o,i,s,l,u,c,f,d,p,h;if(n=this,i=["top","right","bottom","left"],void 0===e&&(e=n.value),s=e,"string"==typeof e){for(e=e.split(" "),t=u=0,d=e.length;d>u;t=++u)l=e[t],e[t]=parseFloat(l,10);e=1===e.length?e[0]:2===e.length?{top:e[0],right:e[1],bottom:e[0],left:e[1]}:3===e.length?{top:e[0],right:e[1],bottom:e[2],left:e[1]}:4===e.length?{top:e[0],right:e[1],bottom:e[2],left:e[3]}:0}if("number"==typeof e)for(c=0,p=i.length;p>c;c++)a=i[c],n[a]=e;else{for(a in e)o=i.indexOf(a),o>=0&&(i.splice(o,1),n[a]=e[a]);for(f=0,h=i.length;h>f;f++)r=i[f],n[r]=0}return s},value:0}},{}],116:[function(e,t){t.exports={accepted:[Boolean],flipped:{accepted:[Boolean],value:!1},value:!1}},{}],117:[function(e,t){t.exports={accepted:[!1,Function,String],sort:{accepted:["asc","desc"],deprecates:["sort"],value:"asc"},value:!1}},{}],118:[function(e,t){t.exports={accepted:void 0,process:function(e,t){this.initialized&&t.container.value.remove()},value:void 0}},{}],119:[function(e,t){t.exports={accepted:["auto",Boolean],process:function(e){return"Boolean"==typeof e&&(this.enabled=e),e},value:"auto"}},{}],120:[function(e,t){t.exports={accepted:[String],chainable:!1,process:function(e,t){var r;return r=t.container.value,r&&e?r.select(e):e},value:void 0}},{}],121:[function(e,t){t.exports={accepted:[String],chainable:!1,process:function(e,t){var r;return r=t.container.value,r&&e?r.selectAll(e):e},value:void 0}},{}],122:[function(e,t){var r;r=e("../../core/methods/filter.coffee"),t.exports={accepted:[!1,String],nesting:!0,mute:r(!0),solo:r(!0),secondary:{accepted:[!1,String],nesting:!0,value:!1},value:!1}},{"../../core/methods/filter.coffee":76}],123:[function(e,t){t.exports={mouseevents:60,ui:200}},{}],124:[function(e,t){var r,n,a,o;r=e("../../core/methods/font/decoration.coffee"),n=e("../../core/methods/font/family.coffee"),o=e("../../core/methods/font/transform.coffee"),a=e("../../string/strip.js"),t.exports={accepted:[!1,Function,String],font:{align:"center",color:"#444444",decoration:r(),family:n(),size:16,transform:o(),weight:400},link:!1,process:function(e,t){var r;return 0===t.container.id.indexOf("default")&&e&&(r=a(e).toLowerCase(),t.self.container({id:r})),e},value:!1}},{"../../core/methods/font/decoration.coffee":78,"../../core/methods/font/family.coffee":79,"../../core/methods/font/transform.coffee":81,"../../string/strip.js":165}],125:[function(e,t){t.exports={accepted:function(e){return d3.keys(e.types)},value:"auto"}},{}],126:[function(e,t){var r,n,a,o;a=e("../../core/methods/font/family.coffee"),r=e("../../core/methods/font/align.coffee"),n=e("../../core/methods/font/decoration.coffee"),o=e("../../core/methods/font/transform.coffee"),t.exports={align:r("center"),border:1,color:{primary:{process:function(e,t){var r,n;return r=this.value,n=t.ui.color.secondary.value,n&&n!==d3.rgb(r).darker(2).toString()||(t.ui.color.secondary.value=d3.rgb(e).darker(2).toString()),e},value:"#ffffff"},secondary:{value:!1}},display:{acceped:["block","inline-block"],value:"inline-block"},font:{align:r("center"),color:"#444",decoration:n(),family:a(),size:11,transform:o(),weight:200},margin:5,padding:5}},{"../../core/methods/font/align.coffee":77,"../../core/methods/font/decoration.coffee":78,"../../core/methods/font/family.coffee":79,"../../core/methods/font/transform.coffee":81}],127:[function(e,t){t.exports={accepted:[!1,Number],secondary:!1,value:!1}},{}],128:[function(e,t){t.exports=function(e){var t=e.data.value.length;1===t?e.self.type("button").draw():5>t?e.self.type("toggle").draw():e.self.type("drop").draw()}},{}],129:[function(e,t){var r=e("../../../core/console/print.coffee"),n=e("./functions/color.js"),a=e("./functions/icons.js"),o=e("./functions/mouseevents.js"),i=e("./functions/style.js");t.exports=function(e){var t=e.container.ui.selectAll("div.d3plus_node").data(e.data.viz,function(t){return t[e.id.value]});if(e.dev.value&&r.time("enter"),t.enter().append("div").attr("class","d3plus_node").call(n,e).call(i,e).call(a,e).call(o,e,n),e.dev.value&&r.timeEnd("enter"),e.draw.update||e.draw.timing){e.dev.value&&r.time("ordering"),t.order(),e.dev.value&&r.timeEnd("ordering");var s=t}else var l=[e.focus.previous,e.focus.value,e.hover.previous,e.hover.value].filter(function(e){return e}),s=t.filter(function(t){return l.indexOf(t[e.id.value])>=0});e.dev.value&&r.time("update"),e.draw.timing?s.transition().duration(e.draw.timing).call(n,e).call(i,e):s.call(n,e).call(i,e),s.call(a,e).call(o,e,n),e.dev.value&&r.timeEnd("update"),t.exit().remove()}},{"../../../core/console/print.coffee":54,"./functions/color.js":130,"./functions/icons.js":131,"./functions/mouseevents.js":132,"./functions/style.js":133}],130:[function(e,t){var r=e("../../../../color/legible.coffee"),n=e("../../../../color/lighter.coffee"),a=e("../../../../color/text.coffee");t.exports=function(e,t){e.style("background-color",function(e){return t.focus.value!==e[t.id.value]?t.hover.value===e[t.id.value]?n(t.ui.color.secondary.value,.25):t.ui.color.secondary.value:t.hover.value===e[t.id.value]?d3.rgb(t.ui.color.primary.value).darker(.15).toString():t.ui.color.primary.value}).style("color",function(e){var n=e[t.icon.value]&&t.data.viz.length<t.data.large;if(t.focus.value===e[t.id.value])var o=1;else var o=.75;if(t.focus.value===e[t.id.value]&&e[t.color.value]&&!n)var i=r(e[t.color.value]);else if(t.focus.value===e[t.id.value])var i=a(t.ui.color.primary.value);else var i=a(t.ui.color.secondary.value);var i=d3.rgb(i);return"rgba("+i.r+","+i.g+","+i.b+","+o+")"}).style("border-color",t.ui.color.secondary.value)}},{"../../../../color/legible.coffee":46,"../../../../color/lighter.coffee":47,"../../../../color/text.coffee":52}],131:[function(e,t){var r=e("../../../../client/prefix.coffee"),n=e("../../../../client/rtl.coffee");t.exports=function(e,t){var a="right"===t.font.align.value&&!n||n&&"right"===t.font.align.value;e.each(function(e){var o=["label"];e[t.icon.value]&&t.data.viz.length<=t.data.large&&o.push("icon");var i=t.icon.button.value;e[t.id.value]===t.focus.value&&t.icon.select.value?(i=t.icon.select.value,o.push("selected")):i&&e.d3plus.icon!==!1&&o.push("selected");var s=0,l=d3.select(this).selectAll("div.d3plus_button_element").data(o,function(e){return e});l.enter().append("div").style("display",function(e){return"label"===e?"block":"absolute"}),l.order().attr("class",function(e){var t="";return"selected"===e&&0===i.indexOf("fa-")&&(t=" fa "+i),"d3plus_button_element d3plus_button_"+e+t}).html(function(r){if("label"===r){var n=t.text.value&&t.text.value in e&&!(e[t.text.value]instanceof Array)?t.text.value:t.id.value;return t.format.value(e[n])}return"selected"===r&&i.indexOf("fa-")<0?i:""}).style("background-image",function(r){return"icon"===r?"url('"+e[t.icon.value]+"')":"none"}).style("background-color",function(r){return"icon"===r&&"knockout"===e.style?e[t.color.value]||t.ui.color.primary.value:"transparent"}).style("background-size","100%").style("text-align",function(e){return"label"===e?t.font.align.value:"center"}).style("position",function(e){return"label"==e?"static":"absolute"}).style("width",function(e){return"label"===e?"auto":(s=t.height.value?t.height.value-2*t.ui.padding-2*t.ui.border:t.font.size+t.ui.padding+t.ui.border,s+"px")}).style("height",function(e){return"icon"===e?s+"px":"auto"}).style("margin-top",function(e){if("label"===e)return"0px";if(this.offsetHeight||this.getBoundingClientRect().height)var r=this.offsetHeight||this.getBoundingClientRect().height;else if("selected"===e)var r=t.font.size;else var r=s;return-r/2+"px"}).style("top",function(e){return"label"===e?"auto":"50%"}).style("left",function(e){return"icon"===e&&!a||"selected"===e&&a?t.ui.padding+"px":"auto"}).style("right",function(e){return"icon"===e&&a||"selected"===e&&!a?t.ui.padding+"px":"auto"}).style(r()+"transition",function(e){return"selected"===e?t.draw.timing/1e3+"s":"none"}).style(r()+"transform",function(e){var r="selected"===e?t.icon.select.rotate:"none";return"string"==typeof r?r:"rotate("+r+"deg)"}).style("opacity",function(e){return"selected"===e?t.icon.select.opacity:1}),l.exit().remove();var u=d3.select(this).selectAll(".d3plus_button_label");if(s>0){s+=2*t.ui.padding;var c=t.ui.padding;if(3===o.length)var f=c+"px "+s+"px";else if(o.indexOf("icon")>=0&&!n||o.indexOf("selected")>=0&&n)var f=c+"px "+c+"px "+c+"px "+s+"px";else var f=c+"px "+s+"px "+c+"px "+c+"px";u.style("padding",f)}else u.style("padding",t.ui.padding+"px");if("number"==typeof t.width.value){var d=t.width.value;d-=parseFloat(u.style("padding-left"),10),d-=parseFloat(u.style("padding-right"),10),d-=2*t.ui.border,d+="px"}else var d="auto";u.style("width",d)})}},{"../../../../client/prefix.coffee":42,"../../../../client/rtl.coffee":43}],132:[function(e,t){var r=e("../../../../client/pointer.coffee"),n=e("../../../../client/ie.js");t.exports=function(e,t,a){e.on(r.over,function(e){t.self.hover(e[t.id.value]),n||!t.draw.timing?d3.select(this).style("cursor","pointer").call(a,t):d3.select(this).style("cursor","pointer").transition().duration(t.timing.mouseevents).call(a,t)}).on(r.out,function(){t.self.hover(!1),n||!t.draw.timing?d3.select(this).style("cursor","auto").call(a,t):d3.select(this).style("cursor","auto").transition().duration(t.timing.mouseevents).call(a,t)}).on(r.click,function(e){t.id.value in e&&t.self.focus(e[t.id.value]).draw()})}},{"../../../../client/ie.js":40,"../../../../client/pointer.coffee":41}],133:[function(e,t){t.exports=function(e,t){e.style("position","relative").style("margin",t.ui.margin+"px").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")}},{}],134:[function(e,t){t.exports=function(t){var r=e("./functions/element.js"),n=e("./functions/keyboard.js"),a=e("./functions/window.js"),o=e("./functions/width.js"),i=e("./functions/button.js"),s=e("./functions/selector.js"),l=e("./functions/title.js"),u=e("./functions/search.js"),c=e("./functions/list.js"),f=e("./functions/data.js"),d=e("./functions/update.js");t.margin.top=0,t.margin.title=0,r(t),n(t),a(t),o(t),i(t),s(t),l(t),u(t),c(t),f(t),d(t)}},{"./functions/button.js":137,"./functions/data.js":138,"./functions/element.js":139,"./functions/keyboard.js":142,"./functions/list.js":143,"./functions/search.js":145,"./functions/selector.js":146,"./functions/title.js":147,"./functions/update.js":148,"./functions/width.js":149,"./functions/window.js":150}],135:[function(e,t){t.exports=function(e,t,r){var n=[],r=r||e.active.value;if(r instanceof Array)for(var a=0;a<r.length;a++)n.push(this(e,t,r[a]));else{var o=typeof r;n.push("number"===o?e.depth.value===r:"function"===o?r(t):t===r)}return n.indexOf(!0)>=0}},{}],136:[function(e,t){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}],137:[function(e,t){var r=e("../../../../util/copy.coffee"),n=e("../../../../client/pointer.coffee"),a=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=a().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,i=r(e.data.value.filter(function(r){for(var n=!1,a=0;a<e.id.nesting.length;a++){var o=e.id.nesting[a];if(n=o in r&&r[o]===e.focus.value){t=a;break}}return n})[0]);i||(i=e.container.button.data()[0]||e.data.viz[0]),e.container.button.data([i]).id(e.id.nesting).depth(t)}e.container.button.draw({update:e.draw.update}).focus(e.focus.value).font(e.font).icon({button:e.icon.drop.value,select:e.icon.drop.value,value:e.icon.value}).text(e.text.value).timing({ui:e.draw.timing}).ui({color:e.ui.color,padding:e.ui.padding}).width(e.width.value).draw();var s=e.container.button.container(Object).ui;e.margin.top+=s.node().offsetHeight||s.node().getBoundingClientRect().height,s.on(n.click,function(){e.self.open(!e.open.value).draw()})}},{"../../../../client/pointer.coffee":41,"../../../../core/console/print.coffee":54,"../../../../util/copy.coffee":191,"../../../form.js":97}],138:[function(e,t){var r=e("../../../../string/format.js"),n=e("../../../../string/strip.js");t.exports=function(e){if(e.data.url&&!e.data.loaded){var t={};t[e.text.value||e.id.value]=e.format.value(e.format.locale.value.ui.loading),e.data.filtered=[t],e.data.changed="loading"!==e.data.lastFilter,e.data.lastFilter="loading"}else if(e.open.value)if(e.text.solo.value.length&&""!==e.text.solo.value[0]){var a=e.text.solo.value.length?e.text.solo.value[0].toLowerCase():"",o=n(a).split("_"),i=[e.id.value,e.text.value,e.alt.value,e.keywords.value];
i=i.filter(function(e){return e}),o=o.filter(function(e){return""!==e});var s=[],l=[],u=[],c=[];if(e.id.nesting.forEach(function(t){c=c.concat(e.data.nested.all[t])}),c.forEach(function(t){var r=!1;i.forEach(function(i){if(!r&&i in t&&"string"==typeof t[i]){var c=t[i].toLowerCase();if([e.text.value,e.id.value].indexOf(i)>=0&&0===c.indexOf(a))s.push(t),r=!0;else if(c.indexOf(a)>=0)l.push(t),r=!0;else{var f=n(c).split("_");for(var d in f){if(r)break;for(var p in o)if(0===f[d].indexOf(o[p])){u.push(t),r=!0;break}}}}})}),e.data.filtered=d3.merge([s,l,u]),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 f={},d=e.format.value(e.format.locale.value.ui.noResults);f[e.text.value||e.id.value]=r(d,'"'+a+'"'),e.data.filtered=[f]}}else e.data.filtered=e.data.viz,e.data.changed="viz"!==e.data.lastFilter,e.data.lastFilter="viz",e.id.nesting.length>1&&e.depth.value<e.id.nesting.length-1&&(e.data.filtered=e.data.filtered.filter(function(t){return"endPoint"in t.d3plus&&t.d3plus.endPoint===e.depth.value&&(t.d3plus.icon=!1),!0}),e.data.changed="depth"!==e.data.lastFilter,e.data.lastFilter="depth");else e.data.filtered=[]}},{"../../../../string/format.js":163,"../../../../string/strip.js":165}],139:[function(e,t){t.exports=function(e){e.data.element.value&&(e.data.element.value.on("focus."+e.container.id,function(){e.self.draw({update:!1}).draw()}),e.data.element.value.on("blur."+e.container.id,function(){var t=e.search.enabled?d3.event.relatedTarget!=e.container.value.select("input").node():!0;t&&e.self.draw({update:!1}).draw()}),e.data.element.value.on("change."+e.container.id,function(){e.self.focus(this.value).draw()}),e.data.element.value.on("keydown.cancel_"+e.container.id,function(){var e=d3.event.keyCode;9!=e&&d3.event.preventDefault()}))}},{}],140:[function(e,t){t.exports=function(e){var t=e.container.button.container().node().getBoundingClientRect();e.height.secondary=window.innerHeight-t.bottom-e.ui.margin-2*e.ui.padding-2*e.ui.border,e.height.secondary<3*t.height?(e.height.secondary=t.top-10,e.self.open({flipped:!0})):e.self.open({flipped:!1});e.height.secondary>e.height.max&&(e.height.secondary=e.height.max)}},{}],141:[function(e,t){var r,n,a,o;r=e("./active.js"),n=e("../../../../util/copy.coffee"),a=e("../../../form.js"),o=e("../../../../core/console/print.coffee"),t.exports=function(e){var t,i,s;e.open.value&&(e.dev.value&&o.time("updating list items"),"items"in e.container||(e.container.items=a().container(e.container.list).data({sort:!1}).type("button").ui({border:0,display:"block",margin:0}).width(!1)),i=e.draw.timing?e.data.large:1,s=n(e.order),s.value=e.text.solo.value.length&&""!==e.text.solo.value[0]?"d3plus_order":e.order.value,t=e.depth.value===e.id.nesting.length-1,(e.focus.changed||!e.container.items.focus().length)&&e.container.items.focus(e.focus.value,function(t){var n,a,o,i;n=t!==e.focus.value,n&&e.active.value&&(n=r(e,t)),n&&e.self.focus(t),a=e.data.filtered.filter(function(r){return r[e.id.value]===t})[0],e.depth.value<e.id.nesting.length-1&&e.id.nesting[e.depth.value+1]in a?(o=e.depth.value,i=e.id.solo.value,e.history.states.push(function(){return e.self.depth(o).id({solo:i}).draw()}),e.self.depth(e.depth.value+1).id({solo:[t]}).draw()):e.depth.changed?n&&e.self.draw():e.self.open(!1).draw()}),e.data.changed&&e.container.items.data({large:i,value:e.data.filtered}),e.container.items.active(e.active.value).draw({update:e.draw.update}).font(e.font.secondary).id(e.id.value).icon({button:t?!1:e.icon.next,select:t?e.icon.select:!1}).order(s).text(e.text.secondary.value||e.text.value).timing({ui:e.draw.timing}).ui({color:{primary:1===e.id.nesting.length?e.ui.color.primary.value:e.ui.color.secondary.value,secondary:e.ui.color.secondary.value},padding:e.ui.padding}).draw(),e.dev.value&&o.timeEnd("updating list items"))}},{"../../../../core/console/print.coffee":54,"../../../../util/copy.coffee":191,"../../../form.js":97,"./active.js":135}],142:[function(e,t){t.exports=function(e){d3.select(document).on("keydown."+e.container.id,function(){if(e.open.value||e.hover===!0){var t=d3.event.keyCode,r=e.container.list.select("div").selectAll("div.d3plus_node"),n=0;if(r.each("boolean"==typeof e.hover?function(t,r){t.value==e.focus&&(n=r)}:function(t,r){t.value==e.hover&&(n=r)}),[9].indexOf(t)>=0&&(!e.search.enabled||e.search.enabled&&!d3.event.shiftKey))e.self.draw({update:!1}).disable();else if([40].indexOf(t)>=0){if(e.open.value&&(n>=r.size()-1?n=0:n+=1),"boolean"!=typeof e.hover)var a=r.data()[n].value;else var a=e.focus;e.open.value?e.self.draw({update:!1}).hover(a).draw(60):e.self.draw({update:!1}).hover(a).enable()}else if([38].indexOf(t)>=0){if(e.open.value&&(0>=n?n=r.size()-1:n-=1),"boolean"!=typeof e.hover)var a=r.data()[n].value;else var a=e.focus;e.open.value?e.self.draw({update:!1}).hover(a).draw(60):e.self.draw({update:!1}).hover(a).enable()}else[13].indexOf(t)>=0?"boolean"!=typeof e.hover?e.self.value(e.hover).draw():e.self.hover(e.focus).toggle():[27].indexOf(t)>=0&&(e.open.value?e.self.disable():e.hover===!0&&e.self.hover(!1).draw())}})}},{}],143:[function(e,t){var r=e("../../../../core/console/print.coffee");t.exports=function(e){e.dev.value&&r.time("populating list"),e.container.list=e.container.selector.selectAll("div.d3plus_drop_list").data(["list"]),e.container.list.enter().append("div").attr("class","d3plus_drop_list").attr("id","d3plus_drop_list_"+e.container.id).style("overflow-y","auto").style("overflow-x","hidden"),e.dev.value&&r.timeEnd("populating list")}},{"../../../../core/console/print.coffee":54}],144:[function(e,t){var r=e("../../../../core/console/print.coffee");t.exports=function(e){if(e.open.value){e.dev.value&&r.time("calculating height");var t=!1;if("none"==e.container.selector.style("display"))var t=!0;t&&e.container.selector.style("display","block");var n=e.search.enabled?e.container.search.node().offsetHeight||e.container.search.node().getBoundingClientRect().height:0,a=e.container.selector.style("height"),o=e.container.selector.property("scrollTop"),i=e.container.list.style("max-height"),s=e.container.list.property("scrollTop");e.container.selector.style("height","auto"),e.container.list.style("max-height","200000px"),e.container.listHeight=parseFloat(e.container.selector.style("height"),10),e.container.list.style("max-height",i).property("scrollTop",s),e.container.selector.style("height",a).property("scrollTop",o);var l=!1;if(e.container.listHeight>e.height.secondary&&(e.container.listHeight=e.height.secondary,l=!0),t&&e.container.selector.style("display","none"),e.dev.value&&r.timeEnd("calculating height"),l){e.dev.value&&r.time("calculating scroll position");var u=e.container.list.select("div").selectAll("div.d3plus_node"),c=u[0][0];u.each(function(t){t[e.id.value]==e.focus.value&&(c=this)});var t=!1;"none"===e.container.selector.style("display")&&(t=!0,e.container.selector.style("display","block"));var f=c.offsetTop,d=c.offsetHeight||c.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,p>f?e.container.listScroll=f:f+d>p+e.height.secondary-n&&(e.container.listScroll=f-(e.height.secondary-d-n))),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}],145:[function(e,t){var r=e("../../../../client/prefix.coffee"),n=e("../../../../core/console/print.coffee");t.exports=function(t){function a(e){e.style("padding",t.ui.padding+"px").style("display","block").style("background-color",t.ui.color.secondary.value)}function o(e){var n=t.width.secondary-4*t.ui.padding-2*t.ui.border;e.style("padding",t.ui.padding+"px").style("width",n+"px").style("border-style","solid").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&&n.time("creating search");var i=e("./data.js"),s=e("./items.coffee"),l=e("./update.js");t.container.search=t.container.selector.selectAll("div.d3plus_drop_search").data(t.search.enabled?["search"]:[]),t.draw.timing?(t.container.search.transition().duration(t.draw.timing).call(a),t.container.search.select("input").transition().duration(t.draw.timing).call(o)):(t.container.search.call(a),t.container.search.select("input").call(o)),t.container.search.enter().insert("div","#d3plus_drop_list_"+t.container.id).attr("class","d3plus_drop_search").attr("id","d3plus_drop_search_"+t.container.id).call(a).append("input").attr("id","d3plus_drop_input_"+t.container.id).style("-webkit-appearance","none").call(o),t.container.search.select("input").on("keyup."+t.container.id,function(){t.text.solo[0]!==this.value&&(t.self.text({solo:[this.value]}),i(t),s(t),l(t))}),t.container.search.exit().remove(),t.search.enabled&&(t.margin.title+=t.container.search.node().offsetHeight||t.container.search.node().getBoundingClientRect().height),t.dev.value&&n.timeEnd("creating search")}},{"../../../../client/prefix.coffee":42,"../../../../core/console/print.coffee":54,"./data.js":138,"./items.coffee":141,"./update.js":148}],146:[function(e,t){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")}},{}],147:[function(e,t){var r=e("../../../../client/pointer.coffee"),n=e("../../../../color/lighter.coffee"),a=e("../../../../core/console/print.coffee"),o=e("../../../../color/text.coffee");t.exports=function(e){function t(t){t.style("padding",e.ui.padding+"px").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 i(t){if(!t.empty()){var r=0===e.icon.back.value.indexOf("fa-")?" fa "+e.icon.back.value:"";r="d3plus_drop_back"+r;var n=0===e.icon.back.value.indexOf("fa-")?"":e.icon.back.value;t.style("position","absolute").attr("class",r).style("top",e.ui.padding+e.font.secondary.size/2/2.5+"px").html(n)}}function s(t){var r=u?e.focus.value:e.format.locale.value.ui.back;t.text(e.format.value(r)).style("padding","0px "+2*e.ui.padding+"px")}if(e.open.value){e.dev.value&&a.time("creating title and back button");var l=1===e.id.solo.value.length&&e.depth.value>0,u=l,c=e.container.button.data(Object).viz[0];u=!0;for(var f=0;f<e.id.nesting.length;f++){var d=e.id.nesting[f];if(d in c&&c[d]===e.focus.value){u=!1;break}}e.container.title=e.container.selector.selectAll("div.d3plus_drop_title").data(l?["title"]:[]),e.draw.timing?(e.container.title.transition().duration(e.draw.timing).call(t),e.container.title.select("div.d3plus_drop_title_text").transition().duration(e.draw.timing).call(s)):(e.container.title.call(t),e.container.title.select("div.d3plus_drop_title_text").call(s)),e.container.title.select("span.d3plus_drop_back").call(i);var p=e.container.title.enter().insert("div","#d3plus_drop_list_"+e.container.id).attr("class","d3plus_drop_title").attr("id","d3plus_drop_title_"+e.container.id).call(t);p.append("span").attr("id","d3plus_drop_back_"+e.container.id).attr("class","d3plus_drop_back").call(i),p.append("div").attr("id","d3plus_drop_title_text_"+e.container.id).attr("class","d3plus_drop_title_text").call(s),e.container.title.on(r.over,function(){var t=n(e.ui.color.secondary.value);d3.select(this).style("cursor","pointer").transition().duration(e.timing.mouseevents).style("background-color",t).style("color",o(t))}).on(r.out,function(){var t=e.ui.color.secondary.value;d3.select(this).style("cursor","auto").transition().duration(e.timing.mouseevents).style("background-color",t).style("color",o(t))}).on(r.click,function(){e.history.back()}),e.container.title.exit().remove(),l&&(e.margin.title+=e.container.title.node().offsetHeight||e.container.title.node().getBoundingClientRect().height),e.dev.value&&a.timeEnd("creating title and back button")}}},{"../../../../client/pointer.coffee":41,"../../../../color/lighter.coffee":47,"../../../../color/text.coffee":52,"../../../../core/console/print.coffee":54}],148:[function(e,t){var r=e("./items.coffee"),n=e("./height.js"),a=e("../../../../core/console/print.coffee"),o=e("./scroll.js"),i=e("./arrow.js");t.exports=function(e){function t(t){t.style("left",function(){return"left"===e.font.align.value?e.margin.left+"px":"center"===e.font.align.value?e.margin.left-(e.width.secondary-e.width.value)/2+"px":"auto"}).style("right",function(){return"right"===e.font.align.value?"0px":"auto"}).style("height",e.container.listHeight+"px").style("padding",e.ui.border+"px").style("background-color",e.ui.color.secondary.value).style("z-index",function(){return e.open.value?"9999":"-1"}).style("width",e.width.secondary-2*e.ui.border+"px").style("top",function(){return e.open.flipped.value?"auto":e.margin.top+"px"}).style("bottom",function(){return e.open.flipped.value?e.margin.top+"px":"auto"}).style("opacity",e.open.value?1:0)}function s(t){t.style("top",function(){return e.open.flipped.value?"auto":e.margin.top+"px"}).style("bottom",function(){return e.open.flipped.value?e.margin.top+"px":"auto"}).style("display",e.open.value?null:"none"),e.search.enabled&&e.open.value&&e.container.selector.select("div.d3plus_drop_search input").node().focus()}function l(e){return function(){var t=d3.interpolateNumber(this.scrollTop,e);return function(e){this.scrollTop=t(e)}}}e.draw.timing?e.container.ui.transition().duration(e.draw.timing).each("start",function(){e.open.value&&d3.select(this).style("z-index",9999)}).style("margin",e.ui.margin+"px").each("end",function(){e.open.value||d3.select(this).style("z-index","auto")}):e.container.ui.style("margin",e.ui.margin+"px").style("z-index",function(){return e.open.value?9999:"auto"}),r(e),n(e),o(e),i(e),e.dev.value&&a.time("drawing list");var u=e.open.value?e.height.secondary-e.margin.title:0;e.draw.timing?(e.container.selector.transition().duration(e.draw.timing).each("start",function(){d3.select(this).style("display",e.open.value?"block":null)}).call(t).each("end",function(){d3.select(this).transition().duration(e.draw.timing).call(s)}),e.container.list.transition().duration(e.draw.timing).style("width",e.width.secondary-2*e.ui.border+"px").style("max-height",u+"px").tween("scroll",l(e.container.listScroll))):(e.container.selector.call(t).call(s),e.container.list.style("width",e.width.secondary-2*e.ui.border+"px").style("max-height",u+"px").property("scrollTop",e.container.listScroll)),e.dev.value&&a.timeEnd("drawing list")}},{"../../../../core/console/print.coffee":54,"./arrow.js":136,"./height.js":140,"./items.coffee":141,"./scroll.js":144}],149:[function(e,t){var r=e("../../../../util/copy.coffee"),n=e("../../../../core/font/tester.coffee"),a=e("../../../form.js"),o=e("../../../../core/console/print.coffee"),i=e("../../../../object/validate.coffee");t.exports=function(e){function t(t){var r="primary"===t?"value":t,i="value"===r?e.icon.drop.value:e.icon.select.value||e.icon.drop.value,l="value"===r?e.text.value:e.text.secondary.value||e.text.value,u="value"===r?e.font:e.font.secondary;e.dev.value&&o.time("calculating "+t+" width");var c=a().container(n()).data({large:9999,value:s}).draw({update:!1}).font(u).icon({button:i,value:e.icon.value}).id(e.id.value).timing({ui:0}).text(l||e.id.value).type("button").ui({border:"primary"===t?e.ui.border:0,display:"inline-block",margin:0,padding:e.ui.padding}).width(!1).draw(),f=[];c.selectAll("div.d3plus_node").each(function(){f.push(this.offsetWidth)}).remove();var d={};d[r]=d3.max(f),e.self.width(d),e.dev.value&&o.timeEnd("calculating "+t+" width")}var s=[];for(var l in e.data.nested.all){var u=e.data.nested.all[l],c=i(e.text.nesting)&&l in e.text.nesting?e.text.nesting[l][0]:l;[e.id.value,e.text.value].indexOf(c)<0&&(u=r(u),u.forEach(function(t){t[e.text.value||e.id.value]=t[c]})),s=s.concat(u)}"number"!=typeof e.width.value&&t("primary"),"number"!=typeof e.width.secondary&&(e.text.secondary.value&&e.text.value!==e.text.secondary.value?t("secondary"):e.self.width({secondary:e.width.value}))}},{"../../../../core/console/print.coffee":54,"../../../../core/font/tester.coffee":69,"../../../../object/validate.coffee":162,"../../../../util/copy.coffee":191,"../../../form.js":97}],150:[function(e,t){var r=e("../../../../util/child.coffee"),n=function(e,t){if(void 0===t)var t=window;d3.select(t).on("click."+e.container.id,function(){var t=d3.event.target||d3.event.toElement,n=t.parentNode;n&&["d3plus_node","d3plus_drop_title"].indexOf(n.className)>=0&&(t=n.parentNode),t&&n&&!r(e.container.ui,t)&&e.open.value&&e.self.open(!e.open.value).draw()});try{var a=window.parent.location.host===window.location.host}catch(o){var a=!1}a&&t.self!==window.top&&n(e,t.parent)};t.exports=n},{"../../../../util/child.coffee":189}],151:[function(e,t){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:!1,a=e.container.ui.selectAll("div.d3plus_toggle").data(e.data.viz,function(t){return t[e.id.value]});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()}).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}).width(n).draw()})}},{"../form.js":97}],152:[function(e,t){var r,n,a,o,i,s,l,u,c,f,d,p;s=e("../core/console/print.coffee"),d=e("simplify-js"),t.exports=function(e,t){var n,o,l,u,f,h,v,g,m,y,x,b,w,_,k,z,j,A,M,E,S,T,O,N,F,B,P,q,I,R,V,C,U,D,L,Y,H,W,X,G,Q,J,K,Z,$,et,tt,rt,nt,at,ot,it,st,lt,ut,ct,ft,dt,pt,ht,vt,gt,mt,yt,xt,bt,wt;if(e.length<3)return s.error("polygon has to have at least 3 points"),null;if(_=[],g=.5,f=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?h=t.angle:"number"==typeof t.angle?h=[t.angle]:"string"!=typeof t.angle||isNaN(t.angle)||(h=[Number(t.angle)])),null==h&&(h=d3.range(-90,90+f,f)),null!=t.aspectRatio&&(t.aspectRatio instanceof Array?m=t.aspectRatio:"number"==typeof t.aspectRatio?m=[t.aspectRatio]:"string"!=typeof t.aspectRatio||isNaN(t.aspectRatio)||(m=[Number(t.aspectRatio)])),null!=t.origin&&t.origin instanceof Array&&(D=t.origin[0]instanceof Array?t.origin:[t.origin]),v=Math.abs(d3.geom.polygon(e).area()),0===v)return s.error("polygon has 0 area"),null;if(pt=d3.extent(e,function(e){return e[0]}),I=pt[0],N=pt[1],ht=d3.extent(e,function(e){return e[1]}),R=ht[0],F=ht[1],et=Math.min(N-I,F-R)*t.tolerance,$=function(){var t,r,n;for(n=[],t=0,r=e.length;r>t;t++)L=e[t],n.push({x:L[0],y:L[1]});return n}(),et>0&&($=d($,et),e=function(){var e,t,r;for(r=[],e=0,t=$.length;t>e;e++)L=$[e],r.push([L.x,L.y]);return r}()),t.vdebug&&_.push({type:"simplify",poly:e}),vt=d3.extent(e,function(e){return e[0]}),I=vt[0],N=vt[1],gt=d3.extent(e,function(e){return e[1]}),R=gt[0],F=gt[1],y=[[I,R],[N,R],[N,F],[I,F]],mt=[N-I,F-R],b=mt[0],x=mt[1],rt=Math.min(b,x)/50,null==D)for(D=[],w=d3.geom.polygon(e).centroid(),a(w,e)&&D.push(w);D.length<t.nTries;)K=Math.random()*b+I,Z=Math.random()*x+R,J=[K,Z],a(J,e)&&D.push(J);for(t.vdebug&&_.push({type:"origins",points:D}),M=0,T=null,ot=0,ut=h.length;ut>ot;ot++)for(l=h[ot],u=-l*Math.PI/180,t.vdebug&&_.push({type:"angle",angle:l}),z=it=0,ct=D.length;ct>it;z=++it)for(C=D[z],yt=r(e,C,u),H=yt[0],X=yt[1],xt=r(e,C,u+Math.PI/2),Y=xt[0],W=xt[1],V=[],null!=H&&null!=X&&V.push([(H[0]+X[0])/2,(H[1]+X[1])/2]),null!=Y&&null!=W&&V.push([(Y[0]+W[0])/2,(Y[1]+W[1])/2]),t.vdebug&&_.push({type:"modifOrigin",idx:z,p1W:H,p2W:X,p1H:Y,p2H:W,modifOrigins:V}),st=0,ft=V.length;ft>st;st++)if(U=V[st],t.vdebug&&_.push({type:"origin",cx:U[0],cy:U[1]}),bt=r(e,U,u),H=bt[0],X=bt[1],q=Math.min(p(U,H),p(U,X)),O=2*Math.sqrt(q),wt=r(e,U,u+Math.PI/2),Y=wt[0],W=wt[1],P=Math.min(p(U,Y),p(U,W)),S=2*Math.sqrt(P),!(M>O*S))for(null!=m?o=m:(B=Math.max(1,t.minWidth/S,M/(S*S)),E=Math.min(t.maxAspectRatio,O/t.minHeight,O*O/M),o=d3.range(B,E+g,g)),lt=0,dt=o.length;dt>lt;lt++)if(n=o[lt],A=Math.max(t.minWidth,Math.sqrt(M*n)),Q=Math.min(O,S*n),!(M>Q*S))for(Q-A>=rt&&t.vdebug&&_.push({type:"aRatio",aRatio:n});Q-A>=rt;)tt=(A+Q)/2,k=tt/n,nt=U[0],at=U[1],G=[[nt-tt/2,at-k/2],[nt+tt/2,at-k/2],[nt+tt/2,at+k/2],[nt-tt/2,at+k/2]],G=c(G,u,U),i(G,e)?(j=!0,M=tt*k,T={cx:nt,cy:at,width:tt,height:k,angle:l},A=tt):(j=!1,Q=tt),t.vdebug&&_.push({type:"rectangle",cx:nt,cy:at,width:tt,height:k,areaFraction:tt*k/v,angle:l,insidePoly:j});return[T,M,_]},p=function(e,t){var r,n;return r=t[0]-e[0],n=t[1]-e[1],r*r+n*n},l=function(e,t,r){var n,a,o,i,s;return s=t[1]<r[1]?[t,r]:[r,t],n=s[0],a=s[1],(e[1]===a[1]||e[1]===n[1])&&(e[1]+=Number.MIN_VALUE),e[1]>a[1]||e[1]<n[1]?!1:e[0]>n[0]&&e[0]>a[0]?!1:e[0]<n[0]&&e[0]<a[0]?!0:(o=(a[1]-n[1])/(a[0]-n[0]),i=(e[1]-n[1])/(e[0]-n[0]),i>o)},a=function(e,t){var r,n,a,o,i;for(o=-1,i=t.length,n=t[i-1],a=0;++o<i;)r=n,n=t[o],l(e,r,n)&&a++;return a%2!==0},o=function(e,t,r){var n,a,o;return n=1e-9,a=e[0],o=e[1],a<Math.min(t[0],r[0])-n||a>Math.max(t[0],r[0])+n||o<Math.min(t[1],r[1])-n||o>Math.max(t[1],r[1])+n?!1:!0},n=function(e,t,r,n){var a,o,i,s,l,u,c,f,d,p;return f=1e-9,s=e[0]-t[0],u=e[1]-t[1],l=r[0]-n[0],c=r[1]-n[1],i=s*c-u*l,Math.abs(i)<f?null:(a=e[0]*t[1]-e[1]*t[0],o=r[0]*n[1]-r[1]*n[0],d=(a*l-o*s)/i,p=(a*c-o*u)/i,[d,p])},f=function(e,t,r,a){var i;return i=n(e,t,r,a),null==i?!1:o(i,e,t)&&o(i,r,a)},i=function(e,t){var r,n,o,i,s,l,u,c;for(s=-1,u=e.length,c=t.length,o=e[u-1];++s<u;)for(r=o,o=e[s],l=-1,i=t[c-1];++l<c;)if(n=i,i=t[l],f(r,o,n,i))return!1;return a(e[0],t)},u=function(e,t,r){var n,a,o,i;return null==r&&(r=[0,0]),o=e[0]-r[0],i=e[1]-r[1],n=Math.cos(t),a=Math.sin(t),[n*o-a*i+r[0],a*o+n*i+r[1]]},c=function(e,t,r){var n,a,o,i;for(i=[],a=0,o=e.length;o>a;a++)n=e[a],i.push(u(n,t,r));return i},r=function(e,t,r){var a,i,s,l,u,c,f,d,h,v,g,m,y,x,b;for(u=1e-9,t=[t[0]+u*Math.cos(r),t[1]+u*Math.sin(r)],x=t[0],b=t[1],m=[x+Math.cos(r),b+Math.sin(r)],f=0,Math.abs(m[0]-x)<u&&(f=1),c=-1,v=e.length,i=e[v-1],d=Number.MAX_VALUE,h=Number.MAX_VALUE,s=null,l=null;++c<v;)a=i,i=e[c],g=n(t,m,a,i),null!=g&&o(g,a,i)&&(y=p(t,g),g[f]<t[f]?d>y&&(d=y,s=g):g[f]>t[f]&&h>y&&(h=y,l=g));return[s,l]}},{"../core/console/print.coffee":54,"simplify-js":9}],153:[function(e,t){t.exports=function(e,t,r){var n,a,o,i;return a={x:0,y:0},0>e&&(e=2*Math.PI+e),"square"===r?(o=45*(Math.PI/180),e<=Math.PI?e<Math.PI/2?o>e?(a.x+=t,i=Math.tan(e)*t,a.y+=i):(a.y+=t,n=t/Math.tan(e),a.x+=n):e<Math.PI-o?(a.y+=t,n=t/Math.tan(Math.PI-e),a.x-=n):(a.x-=t,i=Math.tan(Math.PI-e)*t,a.y+=i):e<3*Math.PI/2?e<o+Math.PI?(a.x-=t,i=Math.tan(e-Math.PI)*t,a.y-=i):(a.y-=t,n=t/Math.tan(e-Math.PI),a.x-=n):e<2*Math.PI-o?(a.y-=t,n=t/Math.tan(2*Math.PI-e),a.x+=n):(a.x+=t,i=Math.tan(2*Math.PI-e)*t,a.y-=i)):(a.x+=t*Math.cos(e),a.y+=t*Math.sin(e)),a}},{}],154:[function(e,t){var r;r=e("../geom/offset.coffee"),t.exports=function(e){var t,n,a,o,i,s,l,u,c,f,d,p,h,v,g,m;for(e=e.slice(1).slice(0,-1).split(/L|A/),u=[],g=0,m=e.length;m>g;g++)if(l=e[g],l=l.split(" "),1===l.length)u.push(l[0].split(",").map(function(e){return parseFloat(e)}));else{for(c=u[u.length-1],a=l.pop().split(",").map(function(e){return parseFloat(e)}),f=parseFloat(l.shift().split(",")[0]),v=Math.sqrt(Math.pow(a[0]-c[0],2)+Math.pow(a[1]-c[1],2)),t=Math.acos((f*f+f*f-v*v)/(2*f*f)),s="1"===l[1].split(",")[0],s&&(t=2*Math.PI-t),o=t/(2*Math.PI)*f*Math.PI*2,d=o/5,p=Math.atan2(-c[1],-c[0])-Math.PI,h=t/d,n=h;t>n;)i=r(p+n,f),u.push([i.x,i.y]),n+=h;u.push(a)}return u}},{"../geom/offset.coffee":153}],155:[function(e,t){var r;r=e("./normalize.coffee"),t.exports=function(e,t){var n,a,o,i,s,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,j,A,M,E,S,T,O,N,F,B;if(v=[],null==t&&(t={}),(null==t.nodes||"object"!=typeof t.nodes)&&(F=r(e,t),e=F[0],t=F[1],null===t))return null;d=t.distance,z=t.nodeid,E=t.startpoint,h=t.endpoint,j=t.nodes,A={};for(g in j)A[g]={node:j[g].node,degree:0};for(b=0,x={},S=0,O=e.length;O>S;S++)p=e[S],a=z(E(p)),o=z(h(p)),a in x||(x[a]={}),o in x||(x[o]={}),o in x[a]||(x[a][o]=0,x[o][a]=0,b++,A[a].degree+=1,A[o].degree+=1);u={},n=0;for(g in A)k=A[g],u[g]={score:k.degree/(2*b),nodes:[g]};for(a in x)for(o in x[a])x[a][o]=1/(2*b)-A[a].degree*A[o].degree/(4*b*b);for(m=0;1e3>m;){f=-1,w=void 0,_=void 0;for(a in x)for(o in x[a])x[a][o]>f&&(f=x[a][o],w=a,_=o);if(0>f)break;for(y in x[w])y!==_&&(y in x[_]?x[_][y]+=x[w][y]:x[_][y]=x[w][y]-2*u[_].score*u[y].score,x[y][_]=x[_][y]),delete x[y][w];for(y in x[_])y in x[w]||y===_||(x[_][y]-=2*u[w].score*u[y].score,x[y][_]=x[_][y]);for(B=u[w].nodes,T=0,N=B.length;N>T;T++)k=B[T],u[_].nodes.push(k);u[_].score+=u[w].score,t.vdebug&&v.push({type:"merge",father:_,child:w,nodes:u[_].nodes}),delete u[w],delete x[w],n+=f,m++}return l=function(){var e;e=[];for(i in u)c=u[i],e.push([i,c.nodes.length]);return e}(),l.sort(function(e,t){return t[1]-e[1]}),M=function(){var e,t,r;for(r=[],e=0,t=l.length;t>e;e++)s=l[e],r.push(u[s[0]].nodes);return r}(),[M,v]}},{"./normalize.coffee":157}],156:[function(e,t){t.exports=function(e,t){var r,n;return n=[],r=[],e.forEach(function(a){var o;return o=t?t(a):[a.x,a.y],r.push(a),e.forEach(function(e){var a,i,s;return r.indexOf(e)<0?(a=t?t(e):[e.x,e.y],i=Math.abs(o[0]-a[0]),s=Math.abs(o[1]-a[1]),n.push(Math.sqrt(i*i+s*s))):void 0})}),n.sort(function(e,t){return e-t})}},{}],157:[function(e,t){var r;r=e("../core/console/print.coffee"),t.exports=function(e,t){var n,a,o,i,s,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,j,A,M,E,S,T,O,N,F;if(_=t.source,z=t.target,i=t.directed,s=t.distance,b=t.nodeid,k=t.startpoint,c=t.endpoint,n=t.K,j=t.vdebug,i||(i=!1),null==n&&(n=1),null==b?b=function(e){return e}:"string"==typeof b&&(b=function(e){return function(t){return t[e]}}(b)),null!=_&&"object"==typeof _&&(_=b(_)),null!=z&&"object"==typeof z&&(z=b(z)),null==k?k=function(e){return e.source}:"string"==typeof k&&(k=function(e){return function(t){return t[e]}}(k)),null==c?c=function(e){return e.target}:"string"==typeof c&&(c=function(e){return function(t){return t[e]}}(c)),null==s)s=function(){return 1};else if("number"==typeof s)s=function(e){return function(){return e}}(s);else if("string"==typeof s)s=function(e){return function(t){return t[e]}}(s);else if(s instanceof Array){for(u={},d=A=0,S=e.length;S>A;d=++A)l=e[d],a=b(k(l)),o=b(c(l)),u[a+"_"+o]=s[d];s=function(e){return a=b(k(e)),o=b(c(e)),u[a+"_"+o]}}for(w={},M=0,T=e.length;T>M;M++){for(l=e[M],y=k(l),x=c(l),v=b(y),g=b(x),N=[y,x],E=0,O=N.length;O>E;E++)m=N[E],p=b(m),p in w||(w[p]={node:m,outedges:[]});w[v].outedges.push(l),i||w[g].outedges.push(l)}return f=null,0===e.length?f="The length of edges is 0":0>n?f="K can not have negative value":null==s(e[0])?f="Check the distance function/attribute":null==k(e[0])?f="Check the startpoint function/attribute":null==c(e[0])?f="Check the endpoint function/attribute":(h=b(k(e[0])),null==h||"string"!=(F=typeof h)&&"number"!==F?f="Check the nodeid function/attribute":null==_||_ in w?null==z||z in w||(f="The target is not in the graph"):f="The source is not in the graph"),null!=f?(r.error(f),null):[e,{source:_,target:z,directed:i,distance:s,nodeid:b,startpoint:k,endpoint:c,K:n,nodes:w,vdebug:j}]}},{"../core/console/print.coffee":54}],158:[function(e,t){var r,n;r=e("heap"),n=e("./normalize.coffee"),t.exports=function(e,t,a){var o,i,s,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,j,A,M,E,S,T,O,N,F;if(null==a&&(a={}),a.source=t,(null==a.nodes||"object"!=typeof a.nodes)&&(O=n(e,a),e=O[0],a=O[1],null===a))return null;t=a.source,z=a.target,u=a.directed,c=a.distance,y=a.nodeid,k=a.startpoint,d=a.endpoint,o=a.K,x=a.nodes;for(v in x)m=x[v],m.count=0;for(h=new r(function(e,t){return e.distance-t.distance}),A={},null==z&&(A[t]=!0),h.push({edge:null,target:t,distance:0}),g=0,_=[];!h.empty()&&(g=Math.max(g,h.size()),b=h.pop(),j=b.target,x[j].count++,null==z?_.push(b):j===z&&_.push(b),_.length!==o);)if(x[j].count<=o)for(N=x[j].outedges,M=0,S=N.length;S>M;M++){if(f=N[M],i=y(k(f)),l=y(d(f)),u||l!==j||(F=[l,i],i=F[0],l=F[1]),null==z){if(A[l])continue;A[l]=!0}s=b.distance+c(f),h.push({edge:f,previous:b,target:l,distance:s})}for(p=function(t){for(e=[];null!=t.edge;)e.push(t.edge),t=t.previous;return e.reverse()},E=0,T=_.length;T>E;E++)w=_[E],null!=z&&(delete w.target,w.edges=p(w)),delete w.edge,delete w.previous;return _}},{"./normalize.coffee":157,heap:6}],159:[function(e,t){var r;r=e("./normalize.coffee"),t.exports=function(e,t,n){var a,o,i,s,l,u,c,f,d,p,h,v;return null==n&&(n={}),n.source=t,null!=n.nodes&&"object"==typeof n.nodes||(v=r(e,n),e=v[0],n=v[1],null!==n)?(t=n.source,i=n.directed,s=n.distance,f=n.nodeid,p=n.startpoint,u=n.endpoint,a=n.K,d=n.nodes,h={},h[t]=!0,o=function(e,t){var r,n,l,c,v,g,m,y,x;for(m=d[e].outedges,x=[],v=0,g=m.length;g>v;v++)l=m[v],r=f(p(l)),n=f(u(l)),i||n!==e||(y=[n,r],r=y[0],n=y[1]),n in h?x.push(void 0):(c=t+s(l),a>=c?(h[n]=!0,x.push(o(n,c))):x.push(void 0));return x},o(t,0),{nodes:function(){var e;e=[];for(c in h)e.push(d[c].node);return e}(),edges:function(){var t,r,n;for(n=[],t=0,r=e.length;r>t;t++)l=e[t],f(p(l))in h&&f(u(l))in h&&n.push(l);return n}()}):null}},{"./normalize.coffee":157}],160:[function(e,t){var r=e("../core/locale/languages/en_US.coffee");t.exports=function(e,t,n){if(n&&t&&n.x&&n.y&&(t===n.x.value&&"log"===n.x.scale.value||t===n.y.value&&"log"===n.y.scale.value)){var a="⁰¹²³⁴⁵⁶⁷⁸⁹",o=function(e){return(e+"").split("").map(function(e){return a[e]}).join("")};return"10 "+o(Math.round(Math.log(e)/Math.LN10))}if("locale"in this)var i=this.locale.value.time;else var i=r.time;if(n&&n.time&&"string"==typeof n.time.value&&i.push(n.time.value),"string"==typeof t&&i.indexOf(t.toLowerCase())>=0)return e;if(10>e&&e>-10)return d3.round(e,2);if(e.toString().split(".")[0].length>4){var s=d3.formatPrefix(e).symbol;return s=s.replace("G","B"),e=d3.formatPrefix(e).scale(e),e=parseFloat(d3.format(".3g")(e)),e+s}return"share"==t?d3.format(".2f")(e):d3.format(",f")(e)}},{"../core/locale/languages/en_US.coffee":70}],161:[function(e,t){var r,n;r=e("../util/d3selection.coffee"),n=e("./validate.coffee"),t.exports=function(e,t){var a,o;return a=function(e,t){var o,i;i=[];for(o in e)"undefined"!=typeof e[o]?n(e[o])?("object"!=typeof t[o]&&(t[o]={}),i.push(a(e[o],t[o]))):i.push(!r(e[o])&&e[o]instanceof Array?t[o]=e[o].slice(0):t[o]=e[o]):i.push(void 0);return i},o={},e&&a(e,o),t&&a(t,o),o}},{"../util/d3selection.coffee":192,"./validate.coffee":162}],162:[function(e,t){t.exports=function(e){return null!==e&&"object"==typeof e&&!(e instanceof Array)}},{}],163:[function(e,t){t.exports=function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return t.unkeyed_index=0,t.replace(/\{(\w*)\}/g,function(r,n){if(""===n&&(n=t.unkeyed_index,t.unkeyed_index++),n==+n)return"undefined"!==e[n]?e[n]:r;for(var a=0;a<e.length;a++)if("object"==typeof e[a]&&"undefined"!=typeof e[a][n])return e[a][n];
return r}.bind(t))}},{}],164:[function(e,t){var r,n;r=e("./format.js"),n=e("../core/locale/languages/en_US.coffee").ui,t.exports=function(e,t,a,o){var i;return e instanceof Array?(e=e.slice(0),t||(t=n.and),o||(o=n.moreText),2===e.length?e.join(" "+t+" "):(a&&e.length>a&&(i=e.length-a+1,e=e.slice(0,a-1),e[a-1]=r(o,i)),e.length>1&&(e[e.length-1]=t+" "+e[e.length-1]),e.join(", "))):e}},{"../core/locale/languages/en_US.coffee":70,"./format.js":163}],165:[function(e,t){t.exports=function(e){var t=["!","@","#","$","%","^","&","*","(",")","[","]","{","}",".",",","/","\\","|","'",'"',";",":","<",">","?","=","+"],r=[[/[\300-\306]/g,"A"],[/[\340-\346]/g,"a"],[/[\310-\313]/g,"E"],[/[\350-\353]/g,"e"],[/[\314-\317]/g,"I"],[/[\354-\357]/g,"i"],[/[\322-\330]/g,"O"],[/[\362-\370]/g,"o"],[/[\331-\334]/g,"U"],[/[\371-\374]/g,"u"],[/[\321]/g,"N"],[/[\361]/g,"n"],[/[\307]/g,"C"],[/[\347]/g,"c"]];return e+="",""+e.replace(/[^A-Za-z0-9\-_]/g,function(e){if(" "==e)return"_";if(t.indexOf(e)>=0)return"";var n="";for(var a in r)if(r[a][0].test(e)){n=r[a][1];break}return n})}},{}],166:[function(e,t){var r;r=e("../core/locale/languages/en_US.coffee"),t.exports=function(e){var t,n,a;return e?(n="locale"in this?this.locale.value:r,"."===e.charAt(e.length-1)?e.charAt(0).toUpperCase()+e.substr(1):(a=n.lowercase,t=n.uppercase,e.replace(/\S*/g,function(r,n){return t.indexOf(r.toLowerCase())>=0?r.toUpperCase():a.indexOf(r.toLowerCase())>=0&&0!==n&&n!==e.length-1?r.toLowerCase():r.charAt(0).toUpperCase()+r.substr(1).toLowerCase()}))):""}},{"../core/locale/languages/en_US.coffee":70}],167:[function(e,t){var r,n;r=e("./foreign.coffee"),n=e("./tspan.js"),t.exports=function(e){e.text.html.value?r(e):n(e)}},{"./foreign.coffee":168,"./tspan.js":172}],168:[function(e,t){t.exports=function(e){var t,r,n,a,o;o=e.container.value,n=o.attr("font-family")||o.style("font-family"),t=o.attr("text-anchor")||o.style("text-anchor"),r=o.attr("fill")||o.style("fill"),a=o.attr("opacity")||o.style("opacity"),t="end"===t?"right":"middle"===t?"center":"left",d3.select(o.node().parentNode).append("foreignObject").attr("width",e.width.value+"px").attr("height",e.height.value+"px").attr("x","0px").attr("y","0px").append("xhtml:div").style("font-family",n).style("font-size",e.size.value[1]+"px").style("color",r).style("text-align",t).style("opacity",a).text(e.text.current)}},{}],169:[function(e,t){t.exports=function(e){var t,r,n,a,o,i;e.width.value&&e.height.value||(n=d3.select(e.container.value.node().parentNode),o=n.select("rect"),t=n.select("circle"),o.empty()?t.empty()?(e.width.value||e.self.width(500),e.height.value||e.self.height(500)):(a=t.attr("r"),e.width.value||e.self.width(parseFloat(2*a,10)),e.height.value||e.self.height(parseFloat(2*a,10))):(e.width.value||(i=o.attr("width"),e.self.width(parseFloat(i,10))),e.height.value||(r=o.attr("height"),e.self.height(parseFloat(r,10)))))}},{}],170:[function(e,t){t.exports=function(e){var t;t=e.container.value.attr("font-size"),e.container.fontSize=t,e.size.value||(t=parseFloat(t,10),e.self.size(e.resize.value?[t,2*t]:[t/2,t]))}},{}],171:[function(e,t){t.exports=function(e){var t;e.text.value||(t=e.container.value.text(),t&&(t.indexOf("tspan")>=0&&(t.replace(/\<\/tspan\>\<tspan\>/g," "),t.replace(/\<\/tspan\>/g,""),t.replace(/\<tspan\>/g,"")),e.self.text(t))),e.text.phrases=e.text.value instanceof Array?e.text.value.filter(function(e){return["string","number"].indexOf(typeof e)>=0}):[e.text.value+""],e.container.value.text("")}},{}],172:[function(e,t){t.exports=function(e){var t=e.container.value.attr("x")||"0px",r=e.text.words.slice(0),n=!1,a=e.resize.value?e.size.value[1]+"px":e.container.fontSize||e.size.value[0]+"px",o=e.container.value.append("tspan").text(r[0]).attr("dy",a),i=o.node().offsetHeight||o.node().getBoundingClientRect().height,s=1,l=function(){return e.container.value.append("tspan").attr("x",t).attr("dy",a)},u=function(){o.empty()||(r=o.text().match(/[^\s-]+-?/g),c())},c=function(){if(r&&r.length){var t=r.pop(),n=t.charAt(t.length-1);if(1===t.length&&e.text.split.value.indexOf(t)>=0)c();else{e.text.split.value.indexOf(n)>=0&&(t=t.substr(0,t.length-1)),o.text(r.join(" ")+" "+t+" ...");var a=(s-1)*i,l="circle"===e.shape.value?2*Math.sqrt(a*(2*(e.width.value/2)-a)):e.width.value;o.node().getComputedTextLength()>l&&c()}}else o.remove(),o=d3.select(e.container.value.node().lastChild),o.empty()||(s--,u())};"circle"===e.shape.value&&e.container.value.attr("text-anchor","middle");for(var f=1;f<r.length;f++){if(s*i>e.height.value){o.remove(),1!==f&&(o=d3.select(e.container.value.node().lastChild),o.empty()||u());break}var d=o.text(),p=(d.slice(-1),e.text.current.charAt(e.text.current.indexOf(d)+d.length)),h=" "==p?" ":"";o.text(d+h+r[f]);var v=(s-1)*i,g="circle"===e.shape.value?2*Math.sqrt(v*(2*(e.width.value/2)-v)):e.width.value;o.node().getComputedTextLength()>g&&(n||(o.text(""),o=l()),o.text(d),o=l(),o.text(r[f]),s++)}}},{}],173:[function(e,t){var r,n,a,o;r=e("./flow.coffee"),n=e("../../font/sizes.coffee"),r=e("./flow.coffee"),o=function(e){e.text.phrases.length&&(e.text.current=e.text.phrases.shift()+"",e.text.words=e.text.current.match(e.text["break"]),e.resize.value?a(e):r(e))},t.exports=o,a=function(e){var t,a,i,s,l,u,c,f,d,p,h,v,g,m;for(m=[],u=0;u<e.text.words.length;)t=u===e.text.words.length-1?"":" ",m.push(e.text.words[u]+t),u++;d=Math.floor(e.size.value[1]),c="circle"===e.shape.value?.785*e.width.value:e.width.value,h=n(m,{"font-size":d+"px"},e.container.value),f=d3.max(h,function(e){return e.width}),a=1.165+e.width.value/e.height.value*.037,v=d3.sum(h,function(e){return e.width*e.height})*a,s="circle"===e.shape.value?Math.PI*Math.pow(e.width.value/2,2):c*e.height.value,(f>c||v>s)&&(i=Math.sqrt(s/v),g=c/f,p=d3.min([i,g]),d=d3.max([e.size.value[0],Math.floor(d*p)])),l=Math.floor(.8*e.height.value),d>l&&(d=l),f*(d/e.size.value[1])<=c?(d!==e.size.value[1]&&e.self.size([e.size.value[0],d]),e.container.value.attr("font-size",e.size.value[1]+"px"),r(e)):o(e)}},{"../../font/sizes.coffee":95,"./flow.coffee":167}],174:[function(e,t){var r;r=e("../../util/d3selection.coffee"),t.exports={accepted:[!1,Array,Object,String],element:!1,id:"default",process:function(e){return e===!1?!1:r(e)?e:d3.select(e instanceof Array?e[0][0]:e)},value:!1}},{"../../util/d3selection.coffee":192}],175:[function(e,t){t.exports={accepted:[Boolean],value:!1}},{}],176:[function(e,t){var r;r=e("../../core/console/print.coffee"),t.exports={accepted:[void 0],process:function(e,t){var n;return this.initialized===!1?e:(t.container.value===!1?(n=t.format.locale.value.dev.setContainer,r.warning(n,"container")):t.container.value.empty()?(n=t.format.locale.value.dev.noContainer,r.warning(stringFormat(n,'"'+t.container.value+'"'),"container")):(t.dev.value&&(t.methodGroup&&(t.methodGroup="wait",r.groupEnd()),r.time("total draw time")),t.container.value.call(t.self)),e)},value:void 0}},{"../../core/console/print.coffee":54}],177:[function(e,t){var r,n;r=e("../../core/locale/locale.coffee"),n=e("../../object/merge.coffee"),t.exports={accepted:[Function,String],locale:{accepted:function(){return d3.keys(r)},process:function(e){var t,a;return t="en_US",a=r[t],e!==t&&(a=n(a,r[e])),this.language=e,a},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":74,"../../object/merge.coffee":161}],178:[function(e,t){t.exports={accepted:[!1,Number],value:!1}},{}],179:[function(e,t){t.exports={accepted:[Boolean],value:!1}},{}],180:[function(e,t){t.exports={accepted:["circle","square"],value:!1}},{}],181:[function(e,t){t.exports={accepted:[Array,!1],value:!1}},{}],182:[function(e,t){t.exports={accepted:[!1,Array,Number,String],html:{accepted:[Boolean],value:!1},init:function(){var e;return e=this.split.value,this["break"]=new RegExp("[^\\s\\"+e.join("\\")+"]+\\"+e.join("?\\")+"?","g"),!1},split:{accepted:[Array],value:["-","/",";",":","&"]}}},{}],183:[function(e,t){t.exports={accepted:[!1,Number],value:!1}},{}],184:[function(e,t){var r,n,a,o,i;r=e("../core/methods/attach.coffee"),n=e("./helpers/getDimensions.coffee"),a=e("./helpers/getSize.coffee"),o=e("./helpers/getText.coffee"),i=e("./helpers/wrap.coffee"),t.exports=function(){var t;return t={self:function(e){return e.each(function(){n(t),a(t),t.size.value[0]<=t.height.value&&(o(t),i(t))}),t.self}},r(t,{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"),resize:e("./methods/resize.coffee"),text:e("./methods/text.coffee"),shape:e("./methods/shape.coffee"),size:e("./methods/size.coffee"),width:e("./methods/width.coffee")}),t.self}},{"../core/methods/attach.coffee":75,"./helpers/getDimensions.coffee":169,"./helpers/getSize.coffee":170,"./helpers/getText.coffee":171,"./helpers/wrap.coffee":173,"./methods/container.coffee":174,"./methods/dev.coffee":175,"./methods/draw.coffee":176,"./methods/format.coffee":177,"./methods/height.coffee":178,"./methods/resize.coffee":179,"./methods/shape.coffee":180,"./methods/size.coffee":181,"./methods/text.coffee":182,"./methods/width.coffee":183}],185:[function(e,t){var r=e("../core/locale/languages/en_US.coffee"),n=e("../client/pointer.coffee"),a=e("../color/legible.coffee"),o=e("./move.coffee"),i=e("../client/prefix.coffee"),s=e("../client/rtl.coffee"),l=e("./remove.coffee"),u=e("../string/list.coffee"),c=e("../color/text.coffee");t.exports=function(e){var t=e.fullscreen?250:200,f=i();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||r;var d=e.parent?e.parent.node().offsetHeight||e.parent.node().getBoundingClientRect().height:0;if(e.iconsize||(e.iconsize="small"==e.size?22:50),e.limit=[parseFloat(e.parent.style("width"),10),parseFloat(e.parent.style("height"),10)],e.title instanceof Array){var p=e.locale.ui.and,h=e.locale.ui.more;e.title=u(e.title,p,3,h)}var v=function(){d3.selectAll("div.d3plus_tooltip_data_desc").style("height","0px"),d3.selectAll("div.d3plus_tooltip_data_help").style("background-color","#ccc")};if(l(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?d/2:window.innerHeight/2;else if(e.align){var g=e.align.split(" ");e.anchor.y=g[0],e.anchor.x=g[1]?g[1]:"center"}else e.anchor.x="center",e.anchor.y="top";var m=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(n.click,function(){l(e.id)})}var y=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(f+"box-shadow","0px 1px 3px rgba(0, 0, 0, 0.25)").style("position","absolute").style("z-index",e.zindex).on(n.out,function(){v()});e.max_height&&y.style("max-height",e.max_height+"px"),e.fixed?(y.style("z-index",500),e.mouseevents=!0):y.style("z-index",2e3);var x=y.append("div").datum(e).attr("class","d3plus_tooltip_container").style("background-color",e.background).style("padding","6px");if(e.fullscreen&&e.html){w=e.parent?.75*e.parent.node().offsetWidth:.75*window.innerWidth,B=e.parent?.75*d:.75*window.innerHeight,x.style("width",w+"px").style("height",B+"px");var b=x.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 w="auto";x.style("max-width",e.max_width+"px")}else var w=e.width-14+"px";var b=x.style("width",w)}if(e.title||e.icon)var _=b.append("div").attr("class","d3plus_tooltip_header").style("position","relative").style("z-index",1);if(e.fullscreen){y.append("div").attr("class","d3plus_tooltip_close").style("background-color",e.color).style("color",c(e.color)).style("position","absolute").style(f+"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(n.over,function(){d3.select(this).style("cursor","pointer").style(f+"box-shadow","0 1px 3px rgba(0, 0, 0, 0.5)")}).on(n.out,function(){d3.select(this).style("cursor","auto").style(f+"box-shadow","0 1px 3px rgba(0, 0, 0, 0.25)")}).on(n.click,function(){l(e.id)})}if(e.mouseevents){if(e.mouseevents!==!0){var k=d3.select(e.mouseevents).on(n.out),z=function(){var t=d3.event.toElement||d3.event.relatedTarget;if(t)var r="string"==typeof t.className?t.className:t.className.baseVal,a=0==r.indexOf("d3plus_tooltip");else var a=!1;t&&(j(y.node(),t)||j(e.mouseevents,t)||a)||(k(d3.select(e.mouseevents).datum()),v(),d3.select(e.mouseevents).on(n.out,k))},j=function(e,t){for(var r=t.parentNode;null!==r;){if(r==e)return!0;r=r.parentNode}return!1};d3.select(e.mouseevents).on(n.out,z),y.on(n.out,z);var A=d3.select(e.mouseevents).on(n.move);A&&y.on(n.move,A)}}else y.style("pointer-events","none");if(e.arrow){y.append("div").attr("class","d3plus_tooltip_arrow").style("background-color",e.background).style(f+"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(f+"transform","rotate(45deg)").style("z-index",-1)}if(e.icon){var 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&&M.style("background-color",e.color),m-=M.node().offsetWidth}if(e.title){var E=e.max_width-6;e.icon&&(E-=e.iconsize+6),E+="px";{_.append("div").attr("class","d3plus_tooltip_title").style("max-width",E).style("color",e.icon?e.fontcolor:a(e.color)).style("vertical-align","top").style("width",m+"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){b.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 S=b.append("div").attr("class","d3plus_tooltip_data_container").style("overflow-y","auto").style("z-index",-1);if(e.data){var T=0,O={},N=null;e.data.forEach(function(t,r){t.group&&N!=t.group&&(N=t.group,S.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 o=S.append("div").attr("class","d3plus_tooltip_data_block").style("font-size","12px").style("padding","3px 6px").style("position","relative").datum(t);t.highlight===!0?o.style("color",a(e.color)):(t.allColors||t.highlight!==e.color)&&o.style("color",a(t.highlight));var l=o.append("div").attr("class","d3plus_tooltip_data_name").style("display","inline-block").html(t.name).on(n.out,function(){d3.event.stopPropagation()});if(t.link&&l.style("cursor","pointer").on(n.click,t.link),t.value instanceof Array){var u=e.locale.ui.and,c=e.locale.ui.more;t.value=list(t.value,u,3,c)}var d=o.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(n.out,function(){d3.event.stopPropagation()});if(s?d.style("left","6px"):d.style("right","6px"),e.mouseevents&&t.desc){var p=o.append("div").attr("class","d3plus_tooltip_data_desc").style("color","#888").style("overflow","hidden").style(f+"transition","height 0.5s").style("width","85%").text(t.desc).on(n.out,function(){d3.event.stopPropagation()}),h=p.node().offsetHeight||p.node().getBoundingClientRect().height;p.style("height","0px");var g=l.append("div").attr("class","d3plus_tooltip_data_help").style("background-color","#ccc").style(f+"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(i+"transition","background-color 0.5s").text("?").on(n.over,function(){var e=d3.select(this.parentNode.parentNode).style("color");d3.select(this).style("background-color",e),p.style("height",h+"px")}).on(n.out,function(){d3.event.stopPropagation()});l.style("cursor","pointer").on(n.over,function(){v();var e=d3.select(this.parentNode).style("color");g.style("background-color",e),p.style("height",h+"px")}),o.on(n.out,function(){d3.event.stopPropagation(),v()})}var m=parseFloat(d.style("width"),10);m>e.width/2&&(m=e.width/2),m>T&&(T=m),r!=e.data.length-1&&(t.group&&t.group==e.data[r+1].group||!t.group&&!e.data[r+1].group)&&S.append("div").attr("class","d3plus_tooltip_data_seperator").style("background-color","#ddd").style("display","block").style("height","1px").style("margin","0px 3px")}),S.selectAll(".d3plus_tooltip_data_name").style("width",function(){var e=parseFloat(d3.select(this.parentNode).style("width"),10);return e-T-30+"px"}),S.selectAll(".d3plus_tooltip_data_value").style("width",T+"px").each(function(e){var t=parseFloat(d3.select(this).style("height"),10);O[e.name]=t}),S.selectAll(".d3plus_tooltip_data_name").style("min-height",function(e){return O[e.name]+"px"})}e.html&&!e.fullscreen&&S.append("div").html(e.html);var F=b.append("div").attr("class","d3plus_tooltip_footer").style("font-size","10px").style("position","relative").style("text-align","center");if(e.footer&&F.html(e.footer),e.height=y.node().offsetHeight||y.node().getBoundingClientRect().height,e.html&&e.fullscreen){var B=e.height-12,w=y.node().offsetWidth-e.width-44;x.append("div").attr("class","d3plus_tooltip_html").style("width",w+"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)}if(e.width=y.node().offsetWidth,"center"!=e.anchor.y?e.height+=e.arrow_offset:e.width+=e.arrow_offset,e.data||!e.fullscreen&&e.html){if(e.fullscreen)var B=e.height;else var P=e.fixed?d-e.y-10:d-10,B=e.height<P?e.height:P;B-=parseFloat(x.style("padding-top"),10),B-=parseFloat(x.style("padding-bottom"),10),_&&(B-=_.node().offsetHeight||_.node().getBoundingClientRect().height,B-=parseFloat(_.style("padding-top"),10),B-=parseFloat(_.style("padding-bottom"),10)),F&&(B-=F.node().offsetHeight||F.node().getBoundingClientRect().height,B-=parseFloat(F.style("padding-top"),10),B-=parseFloat(F.style("padding-bottom"),10)),S.style("max-height",B+"px")}e.height=y.node().offsetHeight||y.node().getBoundingClientRect().height,o(e.x,e.y,e.id)}},{"../client/pointer.coffee":41,"../client/prefix.coffee":42,"../client/rtl.coffee":43,"../color/legible.coffee":46,"../color/text.coffee":52,"../core/locale/languages/en_US.coffee":70,"../string/list.coffee":164,"./move.coffee":186,"./remove.coffee":187}],186:[function(e,t){var r;t.exports=function(e,t,n){var a,o;return n||(n="default"),o=d3.select("div#d3plus_tooltip_id_"+n),o.node()&&(a=o.datum(),a.cx=e,a.cy=t,a.fixed||("center"!==a.anchor.y?("right"===a.anchor.x?a.x=a.cx-a.arrow_offset-4:"center"===a.anchor.x?a.x=a.cx-a.width/2:"left"===a.anchor.x&&(a.x=a.cx-a.width+a.arrow_offset+2),"bottom"===a.anchor.y?a.flip=a.cy+a.height+a.offset<=a.limit[1]:"top"===a.anchor.y&&(a.flip=a.cy-a.height-a.offset<0),a.y=a.flip?a.cy+a.offset+a.arrow_offset:a.cy-a.height-a.offset-a.arrow_offset):(a.y=a.cy-a.height/2,"right"===a.anchor.x?a.flip=a.cx+a.width+a.offset<=a.limit[0]:"left"===a.anchor.x&&(a.flip=a.cx-a.width-a.offset<0),"center"===a.anchor.x?(a.flip=!1,a.x=a.cx-a.width/2):a.x=a.flip?a.cx+a.offset+a.arrow_offset:a.cx-a.width-a.offset),a.x<0?a.x=0:a.x+a.width>a.limit[0]&&(a.x=a.limit[0]-a.width),a.y<0?a.y=0:a.y+a.height>a.limit[1]&&(a.y=a.limit[1]-a.height)),o.style("top",a.y+"px").style("left",a.x+"px"),a.arrow&&o.selectAll(".d3plus_tooltip_arrow").call(r)),o},r=function(e){return e.style("bottom",function(e){return"center"===e.anchor.y||e.flip?"auto":"-5px"}).style("right",function(e){return"center"!==e.anchor.y||e.flip?"auto":"-5px"}).style("top",function(e){return"center"!==e.anchor.y&&e.flip?"-5px":"center"===e.anchor.y?"50%":"auto"}).style("left",function(e){return"center"===e.anchor.y&&e.flip?"-5px":"center"!==e.anchor.y?"50%":"auto"}).style("margin-left",function(e){var t;return"center"===e.anchor.y?"auto":(t="right"===e.anchor.x?-e.width/2+e.arrow_offset/2:"left"===e.anchor.x?e.width/2-2*e.arrow_offset-5:-5,e.cx-e.width/2-5<t?(t=e.cx-e.width/2-5,t<2-e.width/2&&(t=2-e.width/2)):-(e.limit[0]-e.cx-e.width/2+5)>t&&(t=-(e.limit[0]-e.cx-e.width/2+5),t>e.width/2-11&&(t=e.width/2-11)),t+"px")}).style("margin-top",function(e){var t;return"center"!==e.anchor.y?"auto":(t="bottom"===e.anchor.y?-e.height/2+e.arrow_offset/2-1:"top"===e.anchor.y?e.height/2-2*e.arrow_offset-2:-9,e.cy-e.height/2-e.arrow_offset<t?(t=e.cy-e.height/2-e.arrow_offset,t<4-e.height/2&&(t=4-e.height/2)):-(e.limit[1]-e.cy-e.height/2+e.arrow_offset)>t&&(t=-(e.limit[1]-e.cy-e.height/2+e.arrow_offset),t>e.height/2-22&&(t=e.height/2-22)),t+"px")})}},{}],187:[function(e,t){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())}},{}],188:[function(e,t){t.exports=function(e,t){var r,n;return r=[],n=1/(t-1)*(e[1]-e[0]),d3.range(e[0],e[1]+n,n)}},{}],189:[function(e,t){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":192}],190:[function(e,t){t.exports=function(e,t){var r;return r=e[0],e.forEach(function(e){return Math.abs(t-e)<Math.abs(t-r)?r=e:void 0}),r}},{}],191:[function(e,t){var r,n,a;n=e("../object/merge.coffee"),a=e("../object/validate.coffee"),r=function(e){var t;return a(e)?n(e):e instanceof Array?(t=[],e.forEach(function(e){return t.push(r(e))}),t):e},t.exports=r},{"../object/merge.coffee":161,"../object/validate.coffee":162}],192:[function(e,t){var r;r=e("../client/ie.js"),t.exports=function(e){return r?"object"==typeof e&&e instanceof Array&&"size"in e&&"select"in e:e instanceof d3.selection}},{"../client/ie.js":40}],193:[function(e,t){t.exports=function(e,t){var r;r=new Image,r.src=e,r.crossOrigin="Anonymous",r.onload=function(){var e,r;e=document.createElement("canvas"),e.width=this.width,e.height=this.height,r=e.getContext("2d"),r.drawImage(this,0,0),t.call(this,e.toDataURL("image/png")),e=null}}},{}],194:[function(e,t){var r,n;r=e("../core/fetch/value.js"),n=e("../object/validate.coffee"),t.exports=function(e,t,a){var o,i,s,l,u,c,f;if(void 0===e)return[];if(void 0===t)return e.reduce(function(e,t){return e.indexOf(t)<0&&e.push(t),e},[]);for(e instanceof Array||(e=[e]),u=[],s=[],c=0,f=e.length;f>c;c++)o=e[c],n(o)&&(l="function"==typeof t?t(o):a?r(a,o,t):o[t],i=["number","string"].indexOf(typeof l)>=0?l:JSON.stringify(l),void 0!==i&&s.indexOf(i)<0&&(u.push(l),s.push(i)));return u.sort(function(e,t){return e-t})}},{"../core/fetch/value.js":68,"../object/validate.coffee":162}],195:[function(e,t){t.exports=function(e){var t,r,n,a,o;for(e.container.value.style("position",function(){var e,t;return e=d3.select(this).style("position"),t=["absolute","fixed"].indexOf(e)>=0,t?e:"relative"}).html(""),o=["width","height"],n=0,a=o.length;a>n;n++)r=o[n],e[r].value||(t=function(n){var a,o;return void 0===n.tagName||["BODY","HTML"].indexOf(n.tagName)>=0?(o=window["inner"+r.charAt(0).toUpperCase()+r.slice(1)],a=document!==n?d3.select(n):!1,a&&("width"===r?(o-=parseFloat(a.style("margin-left"),10),o-=parseFloat(a.style("margin-right"),10),o-=parseFloat(a.style("padding-left"),10),o-=parseFloat(a.style("padding-right"),10)):(o-=parseFloat(a.style("margin-top"),10),o-=parseFloat(a.style("margin-bottom"),10),o-=parseFloat(a.style("padding-top"),10),o-=parseFloat(a.style("padding-bottom"),10))),e[r].value=20>=o?e[r].small:o):(o=parseFloat(d3.select(n).style(r),10),"number"==typeof o&&o>0?e[r].value=o:"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")}},{}],196:[function(e,t){var r=e("../../core/data/format.js"),n=e("../../core/data/color.js"),a=e("../../core/data/keys.js"),o=e("../../core/data/load.coffee"),i=e("./ui/drawer.js"),s=e("./ui/legend.js"),l=e("./ui/timeline.js"),u=e("./errorCheck.js"),c=e("../../core/fetch/data.js"),f=e("./finish.js"),d=e("./focus/tooltip.coffee"),p=e("./focus/viz.js"),h=e("./ui/history.js"),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"),j=e("../../object/validate.coffee");t.exports=function(e){var t=[],A=e.type.value,M=e.format.locale.value,E=M.message.ui,S=M.message.draw,T=["data","attrs","coords","nodes","edges"];if(T.forEach(function(r){!e[r].loaded&&e[r].url&&t.push({"function":function(e,t){o(e,r,t)},message:M.message.loading,wait:!0})}),e.draw.update){var O=M.visualization[A]||A,N=e.types[A].setup||!1,F=e.types[A].requirements||[],B=w(M.message.initializing,O),P=M.message.data;F instanceof Array||(F=[F]),O=O.toLowerCase(),"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:B}),e.container.changed&&t.push({"function":_,message:B}),A in e.g.apps||t.push({"function":function(e){if(e.dev.value){var t="creating "+O+" group";m.time(t)}e.g.apps[A]=e.g.app.selectAll("g#"+A).data([A]),e.g.apps[A].enter().append("g").attr("id",A).attr("opacity",0),e.dev.value&&m.timeEnd(t)},message:B}),e.data.changed&&t.push({"function":function(e){e.data.cache={},delete e.nodes.restricted,delete e.edges.restricted,a(e,"data")},message:P}),e.attrs.changed&&t.push({"function":function(e){a(e,"attrs")},message:P}),t.push({"function":function(e){if(e.color.changed&&e.color.value){if(e.color.valueScale=null,e.dev.value){var t="determining color type";m.time(t)}var r=e.color.value;j(r)&&(r=r[e.id.value]?r[e.id.value]:r[d3.keys(r)[0]]),e.color.type=e.data.keys&&r in e.data.keys?e.data.keys[r]:e.attrs.keys&&r in e.attrs.keys?e.attrs.keys[r]:void 0,e.dev.value&&m.timeEnd(t)}else e.color.value||(e.color.type="keys"in e.data?e.data.keys[e.id.value]:!1)},message:P}),F.indexOf("edges")>=0&&e.edges.value&&(!e.edges.linked||e.edges.changed)&&t.push({"function":v,message:P}),F.indexOf("nodes")>=0&&e.edges.value&&(!e.nodes.positions||e.nodes.changed)&&t.push({"function":g,message:P}),(e.data.changed||e.time.changed||e.id.changed)&&t.push({"function":r,message:P}),t.push({"function":function(e){var t=e.time.fixed.value?null:["all"];if(e.dev.value){var r=t?"fetching pool data":"fetching data";m.time(r)}e.data.pool=c(e,t),e.dev.value&&m.timeEnd(r),t?(e.dev.value&&m.time("fetching data for current year"),e.data.viz=c(e),e.dev.value&&m.timeEnd("fetching data for current year")):e.data.viz=e.data.pool},message:P}),t.push({check:function(e){return e.color.value&&"number"===e.color.type&&e.id.nesting.indexOf(e.color.value)<0&&e.data.value&&e.color.value!=e.id.value&&(e.color.changed||e.data.changed||e.depth.changed||e.time.fixed.value&&(e.time.solo.changed||e.time.mute.changed))},"function":n,message:P})}return t.push({"function":function(e){if(e.dev.value){var t=e.format.locale.value.message.tooltipReset;m.time(t)}e.type.previous&&A!==e.type.previous&&y(e.type.previous),y(A),e.dev.value&&m.timeEnd(t)},message:E}),t.push({"function":u,message:E}),t.push({"function":function(e){if(e.margin.process(),z(e),e.draw.update)i(e),l(e),s(e);else{e.dev.value&&m.time("calculating margins");var t=e.container.value.select("div#d3plus_drawer").node().offsetHeight||e.container.value.select("div#d3plus_drawer").node().getBoundingClientRect().height,r=e.g.timeline.node().getBBox();r=e.timeline.value?r.height+r.y:0;var n=e.g.legend.node().getBBox();n=e.legend.value?n.height+n.y:0,e.margin.bottom+=t+r+n,e.dev.value&&m.timeEnd("calculating margins")}h(e),e.height.viz-=e.margin.top+e.margin.bottom,e.width.viz-=e.margin.left+e.margin.right},message:E}),t.push({"function":d,message:E}),t.push({"function":k,message:S}),e.draw.update&&t.push({"function":[x,b],message:S}),t.push({"function":[p,f],message:S}),t}},{"../../core/console/print.coffee":54,"../../core/data/color.js":56,"../../core/data/format.js":58,"../../core/data/keys.js":60,"../../core/data/load.coffee":61,"../../core/fetch/data.js":65,"../../core/parse/edges.js":89,"../../core/parse/nodes.js":91,"../../object/validate.coffee":162,"../../string/format.js":163,"../../tooltip/remove.coffee":187,"./errorCheck.js":197,"./finish.js":198,"./focus/tooltip.coffee":199,"./focus/viz.js":200,"./shapes/draw.js":209,"./svg/enter.js":219,"./svg/update.js":220,"./types/run.coffee":223,"./ui/drawer.js":224,"./ui/history.js":225,"./ui/legend.js":226,"./ui/timeline.js":228,"./ui/titles.js":229}],197:[function(e,t){var r=e("../../core/fetch/text.js"),n=e("../../core/console/print.coffee"),a=e("../../core/methods/rejected.coffee"),o=e("../../string/format.js"),i=e("../../string/list.coffee");t.exports=function(e){e.dev.value&&n.time("checking for errors");var t=["id"],s=e.types[e.type.value].requirements;s&&(s instanceof Array?t=t.concat(e.types[e.type.value].requirements):t.push(s));var l=[];if(t.forEach(function(t){if("string"==typeof t)e[t].value||l.push('"'+t+'"');else if("function"==typeof t){var r=t(e);!r.status&&r.text&&l.push('"'+r.text+'"')}}),l.length>1){var u=e.format.locale.value.error.methods,c=e.format.locale.value.visualization[e.type.value]||e.type.value,f=e.format.locale.value.ui.and;l=i(l,f),e.internal_error=o(u,c,l)}else if(1===l.length){var u=e.format.locale.value.error.method,c=e.format.locale.value.visualization[e.type.value]||e.type.value;e.internal_error=o(u,c,l[0])}if(!e.internal_error&&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.internal_error=o(u,'"'+p+'"')}}var t=["d3"];e.types[e.type.value].libs&&(t=t.concat(e.types[e.type.value].libs));var l=[];if(t.forEach(function(e){window[e]||l.push('"'+e+'"')}),l.length>1){var u=e.format.locale.value.error.libs,c=e.format.locale.value.visualization[e.type.value],f=e.format.locale.value.ui.and;l=i(l,f),e.internal_error=o(u,c,l)
}else if(1===l.length){var u=e.format.locale.value.error.lib,c=e.format.locale.value.visualization[e.type.value];e.internal_error=o(u,c,l[0])}var h=e.shape.accepted(e);h instanceof Array||(h=[h]);var v=e.shape.value;if((!v||a(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||a(e,g,m,"mode"))&&e.self.type({mode:g[0]})}e.dev.value&&n.timeEnd("checking for errors")}},{"../../core/console/print.coffee":54,"../../core/fetch/text.js":67,"../../core/methods/rejected.coffee":85,"../../string/format.js":163,"../../string/list.coffee":164}],198:[function(e,t){var r=e("./shapes/edges.js"),n=e("./ui/message.js"),a=e("../../core/methods/reset.coffee"),o=e("../../core/console/print.coffee"),i=e("./shapes/labels.js"),s=e("../../string/title.coffee"),l=e("./zoom/bounds.js"),u=e("./zoom/labels.js"),c=e("./zoom/mouse.coffee");t.exports=function(e){var t=e.zoom.viewport||e.zoom.bounds;e.types[e.type.value].zoom&&e.zoom.value&&t?(e.dev.value&&o.time("calculating zoom"),e.draw.first?l(e,t,0):(e.type.changed||e.focus.changed||e.height.changed||e.width.changed||e.nodes.changed)&&l(e,t),e.dev.value&&o.timeEnd("calculating zoom")):(e.zoom.bounds=[[0,0],[e.width.viz,e.height.viz]],e.zoom.scale=1,l(e));var f=e.zoom.size?e.zoom.size.width:e.width.viz,d=e.zoom.size?e.zoom.size.height:e.height.viz,p=e.zoom.bounds?e.zoom.bounds[0][0]:0,h=e.zoom.bounds?e.zoom.bounds[0][1]:0;e.g.overlay.attr("width",f).attr("height",d).attr("x",p).attr("y",h),e.draw.update?(r(e),(e.draw.timing||!e.types[e.type.value].zoom&&!e.draw.timing)&&(i(e,"data"),e.edges.label&&setTimeout(function(){i(e,"edges")},e.draw.timing+200))):e.types[e.type.value].zoom&&e.zoom.value&&e.draw.timing&&setTimeout(function(){u(e)},e.draw.timing),e.types[e.type.value].zoom&&e.zoom.value&&e.focus.value.length&&!e.draw.timing&&(e.dev.value&&o.time("focus labels"),i(e,"data_focus"),e.edges.label&&setTimeout(function(){i(e,"edge_focus")},e.draw.timing+200),e.dev.value&&o.timeEnd("focus labels"));var v=e.types[e.type.value].requirements||[];v instanceof Array||(v=[v]);var g=v.indexOf("data")>=0;e.internal_error||e.data.viz&&e.returned.nodes.length||!g||(e.internal_error=e.format.locale.value.error.data);var m=e.type.previous;m&&e.type.value!=m&&e.g.apps[m]&&(e.dev.value&&o.time('hiding "'+m+'"'),e.draw.timing?e.g.apps[m].transition().duration(e.draw.timing).attr("opacity",0):e.g.apps[m].attr("opacity",0),e.dev.value&&o.timeEnd());var y=g&&0==e.data.viz.length||e.internal_error?0:e.focus.value.length&&e.types[e.type.value].zoom&&e.zoom.value?.4:1,x=e.group.attr("opacity");if(y!=x){var b=e.draw.timing;e.group.transition().duration(b).attr("opacity",y),e.g.data.transition().duration(b).attr("opacity",y),e.g.edges.transition().duration(b).attr("opacity",y)}e.internal_error?(e.internal_error=s(e.internal_error),o.warning(e.internal_error),n(e,e.internal_error),e.internal_error=null):n(e),setTimeout(function(){a(e),e.types[e.type.value].zoom&&e.zoom.value?(e.g.zoom.datum(e).call(e.zoom.behavior.on("zoom",c)),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":87,"../../string/title.coffee":166,"./shapes/edges.js":210,"./shapes/labels.js":212,"./ui/message.js":227,"./zoom/bounds.js":230,"./zoom/labels.js":232,"./zoom/mouse.coffee":233}],199:[function(e,t){var r,n,a,o;r=e("../tooltip/create.js"),n=e("../../../core/fetch/value.js"),a=e("../../../core/console/print.coffee"),o=e("../../../tooltip/remove.coffee"),t.exports=function(e){var t,i,s;i=e.focus,!e.internal_error&&1===i.value.length&&i.value.length&&!e.small&&i.tooltip.value?(e.dev.value&&a.time("drawing focus tooltip"),t=e.data.pool.filter(function(t){return n(e,t,e.id.value)===i.value[0]}),t.length>=1?t=t[0]:(t={},t[e.id.value]=i.value[0]),s=e.labels.padding,r({anchor:"top left",arrow:!1,data:t,fullscreen:!1,id:"visualization_focus",length:"long",maxheight:e.height.viz-2*s,mouseevents:!0,offset:0,vars:e,width:e.tooltip.large,x:e.width.value-e.margin.right-s,y:e.margin.top+s}),d3.select("div#d3plus_tooltip_id_visualization_focus").empty()||(e.width.viz-=e.tooltip.large+2*s),e.dev.value&&a.timeEnd("drawing focus tooltip")):o("visualization_focus")}},{"../../../core/console/print.coffee":54,"../../../core/fetch/value.js":68,"../../../tooltip/remove.coffee":187,"../tooltip/create.js":221}],200:[function(t,r){var n=t("../../../client/pointer.coffee"),a=t("../../../core/console/print.coffee"),o=t("../../../util/uniques.coffee");r.exports=function(t){if(t.g.edge_focus.selectAll("g").remove(),t.g.data_focus.selectAll("g").remove(),t.focus.value.length&&t.types[t.type.value].zoom&&t.zoom.value){t.dev.value&&a.time("drawing focus elements");var r=t.g.edges.selectAll("g");if(r.size()>0){r.each(function(e){var r=e[t.edges.source][t.id.value],n=e[t.edges.target][t.id.value];if(r==t.focus.value[0]||n==t.focus.value[0]){var a=t.g.edge_focus.node().appendChild(this.cloneNode(!0));d3.select(a).datum(e).attr("opacity",1).selectAll("line, path").datum(e)}});var i=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 t.edges.size?d3.select(this).style("stroke-width"):2*t.data.stroke.width}).attr("marker-start",function(e){var r=t.edges.arrows.direction.value;if("bucket"in e.d3plus)var n="_"+e.d3plus.bucket;else var n="";return"source"==r&&i?"url(#d3plus_edge_marker_focus"+n+")":"none"}).attr("marker-end",function(e){var r=t.edges.arrows.direction.value;if("bucket"in e.d3plus)var n="_"+e.d3plus.bucket;else var n="";return"target"==r&&i?"url(#d3plus_edge_marker_focus"+n+")":"none"}),t.g.edge_focus.selectAll("text").style("fill",t.color.focus)}var s=o(t.edges.connections(t.focus.value[0],t.id.value,!0),t.id.value);s.push(t.focus.value[0]);{var l=[],u=[],c=[0],f=[0];t.g.data.selectAll("g").each(function(r){if(s.indexOf(r[t.id.value])>=0){var a=t.g.data_focus.node().appendChild(this.cloneNode(!0)),a=d3.select(a).datum(r).attr("opacity",1);"coordinates"==t.shape.value?t.zoom.viewport=t.path.bounds(t.zoom.coords[r.d3plus.id]):"d3plus"in r&&("x"in r.d3plus&&l.push(r.d3plus.x),"y"in r.d3plus&&u.push(r.d3plus.y),"r"in r.d3plus?(c.push(r.d3plus.r),f.push(r.d3plus.r)):("width"in r.d3plus&&c.push(r.d3plus.width/2),"height"in r.d3plus&&f.push(r.d3plus.height/2)));for(e in n){var o=d3.select(this).on(n[e]);o&&a.on(n[e],o)}}})}if(l.length&&u.length){var d=d3.extent(l),p=d3.extent(u),h=d3.max(c),v=d3.max(f);t.zoom.viewport=[[d[0]-h,p[0]-v],[d[1]+h,p[1]+v]]}t.g.data_focus.selectAll("path").style("stroke-width",2*t.data.stroke.width),t.dev.value&&a.timeEnd("drawing focus elements")}else t.zoom.viewport=!1}},{"../../../client/pointer.coffee":41,"../../../core/console/print.coffee":54,"../../../util/uniques.coffee":194}],201:[function(e,t){var r,n,a;a=e("./style.coffee"),r=e("../../../geom/largestRect.coffee"),n=e("../../../geom/path2poly.coffee"),t.exports=function(e,t,o,i){var s,l,u,c;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}),u=function(t){var a,o;return e.labels.value&&(t.d3plus.label?t.d3plus_label=t.d3plus.label:(a=n(s(t)),o=r(a,{angle:0}),o[0]?t.d3plus_label={w:o[0].width,h:o[0].height,x:o[0].cx,y:o[0].cy}:delete t.d3plus_label)),[t]},e.draw.timing?(c=d3.svg.arc().innerRadius(0).outerRadius(function(e){return e.d3plus.r}).startAngle(function(e){return void 0===e.d3plus.startAngleCurrent&&(e.d3plus.startAngleCurrent=0),isNaN(e.d3plus.startAngleCurrent)&&(e.d3plus.startAngleCurrent=e.d3plus.startAngle),e.d3plus.startAngleCurrent}).endAngle(function(e){return void 0===e.d3plus.endAngleCurrent&&(e.d3plus.endAngleCurrent=0),isNaN(e.d3plus.endAngleCurrent)&&(e.d3plus.endAngleCurrent=e.d3plus.endAngle),e.d3plus.endAngleCurrent}),l=function(e,t){return e.attrTween("d",function(e){var r,n,a,o;return void 0===t?(o=e.d3plus.startAngle,r=e.d3plus.endAngle):0===t&&(o=0,r=0),a=d3.interpolate(e.d3plus.startAngleCurrent,o),n=d3.interpolate(e.d3plus.endAngleCurrent,r),function(t){return e.d3plus.startAngleCurrent=a(t),e.d3plus.endAngleCurrent=n(t),c(e)}})},o.append("path").attr("class","d3plus_data").call(a,e).attr("d",c),t.selectAll("path.d3plus_data").data(u).transition().duration(e.draw.timing).call(a,e).call(l),i.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(l,0)):(o.append("path").attr("class","d3plus_data"),t.selectAll("path.d3plus_data").data(u).call(a,e).attr("d",s))}},{"../../../geom/largestRect.coffee":152,"../../../geom/path2poly.coffee":154,"./style.coffee":215}],202:[function(e,t){var r=e("../../../core/fetch/text.js"),n=e("../../../font/sizes.coffee"),a=e("../../../geom/largestRect.coffee"),o=e("./style.coffee");t.exports=function(e,t,i){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);i.append("path").attr("class","d3plus_data").attr("d",function(e){return s(e.values)}).call(o,e),t.selectAll("path.d3plus_data").data(function(t){if(e.labels.value&&t.values.length>1){var o=[],i=[],s=r(e,t);t.values.forEach(function(e){o.push([e.d3plus.x,e.d3plus.y]),i.push([e.d3plus.x,e.d3plus.y0])}),o=o.concat(i.reverse());var l={"font-weight":e.labels.font.weight,"font-family":e.labels.font.family.value};if(s.length)var u=n(s[0],l),c=u[0].width/u[0].height;else var c=null;var f=a(o,{angle:d3.range(-70,71,1),aspectRatio:c,tolerance:0});if(f&&f[0]){var d={w:Math.floor(f[0].width),h:Math.floor(f[0].height),x:Math.floor(f[0].cx),y:Math.floor(f[0].cy),angle:-1*f[0].angle,padding:2,names:s};d.translate=0!==f[0].angle?{x:d.x,y:d.y}:!1,d.w>=10&&d.h>=10&&(t.d3plus_label=d)}}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":67,"../../../font/sizes.coffee":95,"../../../geom/largestRect.coffee":152,"./style.coffee":215}],203:[function(e,t){var r=(e("../../../core/fetch/text.js"),e("../../../font/sizes.coffee"),e("../../../geom/largestRect.coffee"),e("./style.coffee"));t.exports=function(e,t,n){function a(e){e.attr("transform","scale(1)")}function o(e){e.attr("transform",function(e){var t=Math.min(e.d3plus.width,e.d3plus.height),r=Math.floor(t/16);return"scale("+r+")"})}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(a).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":67,"../../../font/sizes.coffee":95,"../../../geom/largestRect.coffee":152,"./style.coffee":215}],204:[function(e,t){var r,n,a;n=e("../../../core/fetch/value.js"),r=e("../../../core/fetch/color.coffee"),a=e("../../../color/lighter.coffee"),t.exports=function(e,t){var o,i,s,l;return i=e.d3plus.shape||t.shape.value,"line"===t.shape.value&&"circle"!==i?"none":"area"===t.shape.value||"active"===i||"line"===t.shape.value?r(t,e):"temp"===i?"url(#d3plus_hatch_"+e.d3plus.id+")":e.d3plus["static"]?a(r(t,e),.75):(o=t.active.value?n(t,e,t.active.value):e.d3plus.active,s=t.temp.value?n(t,e,t.temp.value):e.d3plus.temp,l=t.total.value?n(t,e,t.total.value):e.d3plus.total,!t.active.value&&!t.temp.value||o===!0||o&&l&&o===l&&!s||o&&!l?r(t,e):t.active.spotlight.value?"#eee":a(r(t,e),.75))}},{"../../../color/lighter.coffee":47,"../../../core/fetch/color.coffee":64,"../../../core/fetch/value.js":68}],205:[function(e,t){var r=e("../../../util/copy.coffee"),n=e("../../../core/fetch/text.js"),a=e("../../../font/sizes.coffee"),o=e("../../../geom/largestRect.coffee"),i=e("../../../geom/path2poly.coffee"),s=e("./style.coffee");t.exports=function(e,t,l){var u=d3.geo[e.coords.projection.value]().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(u),l.append("path").attr("id",function(e){return e.id}).attr("class","d3plus_data").attr("d",e.path).call(s,e),e.draw.timing?t.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(s,e):t.selectAll("path.d3plus_data").call(s,e);var c=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||c||e.coords.mute.changed||e.coords.solo.changed?(e.zoom.bounds=null,e.zoom.coords={},e.zoom.labels={},t.each(function(t){var s=e.path.bounds(t),l=[];t.geometry.coordinates=t.geometry.coordinates.filter(function(n,a){var o=r(t);o.geometry.coordinates=[o.geometry.coordinates[a]];var i=e.path.area(o);return i>=e.coords.threshold?(l.push(i),!0):!1}),l.sort(function(e,t){return e-t});var u=r(t),c=r(t);u.geometry.coordinates=u.geometry.coordinates.filter(function(n,a){var o=r(t);o.geometry.coordinates=[o.geometry.coordinates[a]];var i=e.path.area(o);return i==l[l.length-1]&&(c.geometry.coordinates=o.geometry.coordinates),i>=d3.quantile(l,.9)}),e.zoom.coords[t.d3plus.id]=u;var f=c.geometry.coordinates[0];f&&"MultiPolygon"===c.geometry.type&&(f=f[0],c.geometry.coordinates[0]=f,c.geometry.type="Polygon");var d=n(e,t);if(f&&d.length){var p=i(e.path(c)),h={"font-weight":e.labels.font.weight,"font-family":e.labels.font.family.value};if(1===d[0].split(" ").length)var v=a(d[0],h)[0],g=v.width/v.height;else var g=null;var m=o(p,{angle:0,aspectRatio:g})[0];if(m){var y={anchor:"middle",valign:"center",group:e.g.labels,h:Math.floor(m.height),w:Math.floor(m.width),x:Math.floor(m.cx),y:Math.floor(m.cy),names:d};e.zoom.labels[t.d3plus.id]=y}else delete e.zoom.labels[t.d3plus.id]}else delete e.zoom.labels[t.d3plus.id];e.zoom.bounds?(e.zoom.bounds[0][0]>s[0][0]&&(e.zoom.bounds[0][0]=s[0][0]),e.zoom.bounds[0][1]>s[0][1]&&(e.zoom.bounds[0][1]=s[0][1]),e.zoom.bounds[1][0]<s[1][0]&&(e.zoom.bounds[1][0]=s[1][0]),e.zoom.bounds[1][1]<s[1][1]&&(e.zoom.bounds[1][1]=s[1][1])):e.zoom.bounds=s})):e.focus.value.length||(e.zoom.viewport=!1)}},{"../../../core/fetch/text.js":67,"../../../font/sizes.coffee":95,"../../../geom/largestRect.coffee":152,"../../../geom/path2poly.coffee":154,"../../../util/copy.coffee":191,"./style.coffee":215}],206:[function(e,t){var r=e("./style.coffee");t.exports=function(e,t,n){function a(e){e.attr("d",d3.svg.symbol().type("cross").size(10))}function o(e){e.attr("d",d3.svg.symbol().type("cross").size(function(e){var t=Math.min(e.d3plus.width,e.d3plus.height);return d3.scale.pow().exponent(2)(t/2)}))}n.append("path").attr("class","d3plus_data").call(a).call(r,e),t.selectAll("path.d3plus_data").data(function(e){return[e]}),e.draw.timing?t.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(o).call(r,e):t.selectAll("path.d3plus_data").call(o).call(r,e)}},{"./style.coffee":215}],207:[function(e,t){var r=e("./style.coffee");t.exports=function(e,t,n){function a(e){e.attr("d",d3.svg.symbol().type("diamond").size(10))}function o(e){e.attr("d",d3.svg.symbol().type("diamond").size(function(e){var t=Math.min(e.d3plus.width,e.d3plus.height);return d3.scale.pow().exponent(2)(t/2)}))}n.append("path").attr("class","d3plus_data").call(a).call(r,e),t.selectAll("path.d3plus_data").data(function(e){return[e]}),e.draw.timing?t.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(o).call(r,e):t.selectAll("path.d3plus_data").call(o).call(r,e)}},{"./style.coffee":215}],208:[function(e,t){var r=e("./style.coffee");t.exports=function(e,t,n,a){function o(t,r,n,a){if(!r)var r=0;if("number"!=typeof n)var n=void 0;if("number"!=typeof a)var a=void 0;t.attrTween("d",function(t){if(void 0==n)var o=t.d3plus.r?t.d3plus.r:d3.max([t.d3plus.width,t.d3plus.height]);else var o=n;if(void 0==a)var s=t.d3plus.segments[t.d3plus.shape];else var s=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,o+r),u=d3.interpolate(e.arcs[t.d3plus.shape][t.d3plus.id].a,s);return function(r){return e.arcs[t.d3plus.shape][t.d3plus.id].r=l(r),e.arcs[t.d3plus.shape][t.d3plus.id].a=u(r),i(t)}})}e.arcs||(e.arcs={donut:{},active:{},temp:{}});var i=d3.svg.arc().startAngle(0).endAngle(function(t){var r=e.arcs[t.d3plus.shape][t.d3plus.id].a;return r>2*Math.PI?2*Math.PI:r}).innerRadius(function(t){if("donut"!=shape||t.d3plus.static)return 0;var r=e.arcs[t.d3plus.shape][t.d3plus.id].r;return r*e.data.donut.size}).outerRadius(function(t){var r=e.arcs[t.d3plus.shape][t.d3plus.id].r;return"donut"!=t.d3plus.shape?2*r:r});a.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(o,0,0).each("end",function(t){delete e.arcs[t.d3plus.shape][t.d3plus.id]}),t.selectAll("path.d3plus_data").data(function(e){return[e]}).transition().duration(e.draw.timing).call(o).call(r,e),n.append("path").attr("class","d3plus_data").transition().duration(0).call(o,0,0).call(r,e)}},{"./style.coffee":215}],209:[function(e,t){var r=e("../../../util/child.coffee"),n=e("../../../util/closest.coffee"),a=e("../tooltip/create.js"),o=e("../../../client/pointer.coffee"),i=e("../../../core/fetch/value.js"),s=e("../../../core/fetch/color.coffee"),l=e("../../../core/fetch/text.js"),u=e("../../../color/legible.coffee"),c=e("../../../core/console/print.coffee"),f=e("../../../tooltip/remove.coffee"),d=e("./fill.js"),p=e("../../../string/strip.js"),h=e("../../../client/touch.coffee"),v=e("../zoom/propagation.coffee"),g=e("../../../util/uniques.coffee"),m=e("../zoom/direction.coffee"),y={arc:e("./arc.coffee"),area:e("./area.js"),check:e("./check.js"),coordinates:e("./coordinates.js"),cross:e("./cross.js"),diamond:e("./diamond.js"),donut:e("./donut.js"),line:e("./line.js"),rect:e("./rect.coffee"),triangle_down:e("./triangle_down.js"),triangle_up:e("./triangle_up.js"),whisker:e("./whisker.coffee")};t.exports=function(e){function t(t){if(!t.d3plus.id){t.d3plus.id="";for(var r=0;r<=e.depth.value;r++)t.d3plus.id+=i(e,t,e.id.nesting[r])+"_";t.d3plus.id+=j,["x","y"].forEach(function(r){"discrete"==e[r].scale.value&&(t.d3plus.id+="_"+i(e,t,e[r].value))}),t.d3plus.id=p(t.d3plus.id)}return t}function x(t,r){var n=e.types[e.type.value].scale;if(r&&n&&n[e.shape.value])var a=n[e.shape.value];else if(r&&n&&"number"==typeof n)var a=n;else var a=1;t.attr("transform",function(e){var t=e.d3plus.x||0,r=e.d3plus.y||0;return["line","area","coordinates"].indexOf(j)<0?"translate("+t+","+r+")scale("+a+")":"scale("+a+")"})}function b(t){if(t&&e.g.edges.selectAll("g").size()>0){e.g.edge_hover.selectAll("*").remove(),e.g.edges.selectAll("g").each(function(r){var n=t[e.id.value],a=r[e.edges.source][e.id.value],o=r[e.edges.target][e.id.value];if(a==n||o==n){var i=e.g.edge_hover.node().appendChild(this.cloneNode(!0));d3.select(i).datum(r).attr("opacity",1).selectAll("line, path").datum(r)}});var r=e.edges.arrows.value;e.g.edge_hover.attr("opacity",0).selectAll("line, path").style("stroke",e.color.primary).style("stroke-width",function(){return e.edges.size?d3.select(this).style("stroke-width"):2*e.data.stroke.width}).attr("marker-start",function(t){var n=e.edges.arrows.direction.value;if("bucket"in t.d3plus)var a="_"+t.d3plus.bucket;else var a="";return"source"==n&&r?"url(#d3plus_edge_marker_highlight"+a+")":"none"}).attr("marker-end",function(t){var n=e.edges.arrows.direction.value;if("bucket"in t.d3plus)var a="_"+t.d3plus.bucket;else var a="";return"target"==n&&r?"url(#d3plus_edge_marker_highlight"+a+")":"none"}),e.g.edge_hover.selectAll("text").style("fill",e.color.primary),e.draw.timing?(e.g.edge_hover.transition().duration(e.timing.mouseevents).attr("opacity",1),e.g.edges.transition().duration(e.timing.mouseevents).attr("opacity",.5)):e.g.edge_hover.attr("opacity",1)}else e.draw.timing?(e.g.edge_hover.transition().duration(e.timing.mouseevents).attr("opacity",0).transition().selectAll("*").remove(),e.g.edges.transition().duration(e.timing.mouseevents).attr("opacity",1)):e.g.edge_hover.selectAll("*").remove()}var w=e.returned.nodes||[],_=e.returned.edges||[];e.draw.timing=w.length<e.data.large&&_.length<e.edges.large?e.timing.transitions:0;var k={arc:"arc",area:"area",check:"check",circle:"rect",coordinates:"coordinates",cross:"cross",donut:"donut",diamond:"diamond",line:"line",plus:"cross",rect:"rect",square:"rect",triangle_down:"triangle_down",triangle:"triangle_up",triangle_up:"triangle_up",whisker:"whisker"},z={};w.forEach(function(t){var r=t.d3plus&&t.d3plus.shape?t.d3plus.shape:e.shape.value;r in k&&(t.d3plus&&(t.d3plus.shape=r),r=k[r],z[r]||(z[r]=[]),z[r].push(t))});for(j in k)k[j]in z&&0!==d3.keys(z).length||(e.draw.timing?e.g.data.selectAll("g.d3plus_"+k[j]).transition().duration(e.draw.timing).attr("opacity",0).remove():e.g.data.selectAll("g.d3plus_"+k[j]).remove());for(var j in z){var A=e.g.data.selectAll("g.d3plus_"+j).data(z[j],function(r){if(r.d3plus||(r.d3plus={}),"coordinates"===j)return r.d3plus.id=r.id,r.id;if(!r.d3plus.id)if(r.values)r.values.forEach(function(e){e=t(e),e.d3plus.shape="circle"}),r.d3plus.id=r.key;else if(r=t(r),!r.d3plus.segments){r.d3plus.segments={donut:2*Math.PI};var n=e.active.value?r.d3plus[e.active.value]:r.d3plus.active,a=e.temp.value?r.d3plus[e.temp.value]:r.d3plus.temp,o=e.total.value?r.d3plus[e.total.value]:r.d3plus.total;o&&(r.d3plus.segments.active=n?n/o*2*Math.PI:0,r.d3plus.segments.temp=a?a/o*2*Math.PI+r.d3plus.segments.active:0)}return r.d3plus?r.d3plus.id:!1});if(e.draw.timing)var M=A.exit().transition().duration(e.draw.timing).attr("opacity",0).remove();else var M=A.exit().remove();e.draw.timing?A.transition().duration(e.draw.timing).call(x):A.call(x);var E=e.draw.timing?0:1,S=A.enter().append("g").attr("class","d3plus_"+j).attr("opacity",E).call(x);e.draw.timing&&S.transition().duration(e.draw.timing).attr("opacity",1),A.order(),e.dev.value&&c.time('drawing "'+j+'" shapes'),y[j](e,A,S,M,x),e.dev.value&&c.timeEnd('drawing "'+j+'" shapes'),["rect","donut"].indexOf(j)>=0&&e.types[e.type.value].fill&&(e.dev.value&&c.time('filling "'+j+'" shapes'),d(e,A,S,M,x),e.dev.value&&c.timeEnd('filling "'+j+'" shapes'))}if(b(),h){var T=function(){v(e,d3.event)};e.g.data.selectAll("g").on(o.over,T).on(o.move,T).on(o.out,T)}else e.g.data.selectAll("g").on(o.over,function(t){if(!(e.draw.frozen||t.d3plus&&t.d3plus.static)){if(d3.select(this).style("cursor","pointer").transition().duration(e.timing.mouseevents).call(x,!0),d3.select(this).selectAll(".d3plus_data").transition().duration(e.timing.mouseevents).attr("opacity",1),e.covered=!1,1!==e.focus.value.length||e.focus.value[0]!=t[e.id.value]){if(t.values&&e.axes.discrete){var r="x"===e.axes.discrete?0:1,i=d3.mouse(e.container.value.node())[r],s=g(t.values,function(t){return t.d3plus[e.axes.discrete]}),l=n(s,i);t.d3plus_data=t.values[s.indexOf(l)],t.d3plus=t.values[s.indexOf(l)].d3plus}var u=t.d3plus_data?t.d3plus_data:t;a({vars:e,data:u})}"function"==typeof e.mouse?e.mouse(t.d3plus_data||t,e):e.mouse[o.over]&&e.mouse[o.over](t.d3plus_data||t,e),b(t)}}).on(o.move,function(t){if(!(e.draw.frozen||t.d3plus&&t.d3plus.static)){if(e.covered=!1,t.values||"follow"==e.types[e.type.value].tooltip&&e.focus.value[0]!=t[e.id.value]){if(t.values&&e.axes.discrete){var r="x"===e.axes.discrete?0:1,i=d3.mouse(e.container.value.node())[r],s=g(t.values,function(t){return t.d3plus[e.axes.discrete]}),l=n(s,i);t.d3plus_data=t.values[s.indexOf(l)],t.d3plus=t.values[s.indexOf(l)].d3plus}var u=t.d3plus_data?t.d3plus_data:t;a({vars:e,data:u})}"function"==typeof e.mouse?e.mouse(t.d3plus_data||t,e):e.mouse[o.move]&&e.mouse[o.move](t.d3plus_data||t,e)}}).on(o.out,function(t){var n=r(this,d3.event.toElement);n||e.draw.frozen||t.d3plus&&t.d3plus.static||(d3.select(this).transition().duration(e.timing.mouseevents).call(x),d3.select(this).selectAll(".d3plus_data").transition().duration(e.timing.mouseevents).attr("opacity",e.data.opacity),e.covered||f(e.type.value),"function"==typeof e.mouse?e.mouse(t.d3plus_data||t,e):e.mouse[o.out]&&e.mouse[o.out](t.d3plus_data||t,e),b())});e.g.data.selectAll("g").on(o.click,function(t){if(!(d3.event.defaultPrevented||e.draw.frozen||t.d3plus&&t.d3plus.static)){"function"==typeof e.mouse?e.mouse(t.d3plus_data||t,e):e.mouse[o.out]?e.mouse[o.out](t.d3plus_data||t,e):e.mouse[o.click]&&e.mouse[o.click](t.d3plus_data||t,e);var r=m(t.d3plus_data||t,e),n=e.id.solo.value,c=l(e,t)[0],d=u(s(e,t)),p=e.title.sub.value||!1,h=e.title.sub.font.color,v=e.title.total.font.color;if(t.d3plus.threshold&&t.d3plus.merged&&e.zoom.value)e.history.states.push(function(){e.self.id({solo:n}).title({sub:{font:{color:h},value:p},total:{font:{color:v}}}).draw()}),e.self.id({solo:g(t.d3plus.merged,e.id.value)}).title({sub:{font:{color:d},value:c},total:{font:{color:d}}}).draw();else if(1===r&&e.zoom.value){var y=i(e,t.d3plus_data||t,e.id.value);e.history.states.push(function(){e.self.depth(e.depth.value-1).id({solo:n}).title({sub:{font:{color:h},value:p},total:{font:{color:v}}}).draw()}),e.self.depth(e.depth.value+1).id({solo:[y]}).title({sub:{font:{color:d},value:c},total:{font:{color:d}}}).draw()}else if(-1===r&&e.zoom.value)e.history.back();else if(e.types[e.type.value].zoom&&e.zoom.value)b(),d3.select(this).transition().duration(e.timing.mouseevents).call(x),d3.select(this).selectAll(".d3plus_data").transition().duration(e.timing.mouseevents).attr("opacity",e.data.opacity),f(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(1!==e.focus.value.length||t[e.id.value]!=e.focus.value[0]){b();var w=t.d3plus_data?t.d3plus_data:t;a({vars:e,data:w})}}})}},{"../../../client/pointer.coffee":41,"../../../client/touch.coffee":45,"../../../color/legible.coffee":46,"../../../core/console/print.coffee":54,"../../../core/fetch/color.coffee":64,"../../../core/fetch/text.js":67,"../../../core/fetch/value.js":68,"../../../string/strip.js":165,"../../../tooltip/remove.coffee":187,"../../../util/child.coffee":189,"../../../util/closest.coffee":190,"../../../util/uniques.coffee":194,"../tooltip/create.js":221,"../zoom/direction.coffee":231,"../zoom/propagation.coffee":234,"./arc.coffee":201,"./area.js":202,"./check.js":203,"./coordinates.js":205,"./cross.js":206,"./diamond.js":207,"./donut.js":208,"./fill.js":211,"./line.js":213,"./rect.coffee":214,"./triangle_down.js":216,"./triangle_up.js":217,"./whisker.coffee":218}],210:[function(e,t){var r=e("../../../util/buckets.coffee"),n=e("../../../geom/offset.coffee");t.exports=function(e){function t(t){var r=1==e.edges.opacity?e.edges.opacity:0;t.attr("opacity",r).style("stroke-width",0).style("stroke",e.background.value).style("fill","none")}function a(t){var r=e.edges.arrows.value;t.style("stroke-width",function(t){return e.edges.scale(t[e.edges.size])}).style("stroke",e.edges.color).attr("opacity",e.edges.opacity).attr("marker-start",function(t){var n=e.edges.arrows.direction.value;if("bucket"in t.d3plus)var a="_"+t.d3plus.bucket;else var a="";return"source"==n&&r?"url(#d3plus_edge_marker_default"+a+")":"none"}).attr("marker-end",function(t){var n=e.edges.arrows.direction.value;if("bucket"in t.d3plus)var a="_"+t.d3plus.bucket;else var a="";return"target"==n&&r?"url(#d3plus_edge_marker_default"+a+")":"none"}).attr("vector-effect","non-scaling-stroke").attr("pointer-events","none")}function o(t){t.attr("x1",function(t){return t[e.edges.source].d3plus.edges[t[e.edges.target][e.id.value]].x}).attr("y1",function(t){return t[e.edges.source].d3plus.edges[t[e.edges.target][e.id.value]].y}).attr("x2",function(t){return t[e.edges.target].d3plus.edges[t[e.edges.source][e.id.value]].x}).attr("y2",function(t){return t[e.edges.target].d3plus.edges[t[e.edges.source][e.id.value]].y})}function i(e){e.attr("d",function(e){return p(e.d3plus.spline)})}function s(t){if(delete t.d3plus_label,e.g.edges.selectAll("line, path").size()<e.edges.large&&e.edges.label&&t[e.edges.label]){if("spline"in t.d3plus)var r=this.getTotalLength(),n=this.getPointAtLength(r/2),a=this.getPointAtLength(r/2-.1*r),o=this.getPointAtLength(r/2+.1*r),i=Math.atan2(o.y-a.y,o.x-a.x),s=i*(180/Math.PI),l=(this.parentNode.getBBox(),.8*r),u=n.x,c=n.y;else var f=(this.getBBox(),t[e.edges.source]),d=t[e.edges.target],p={x:f.d3plus.edges[d[e.id.value]].x,y:f.d3plus.edges[d[e.id.value]].y},h={x:d.d3plus.edges[f[e.id.value]].x,y:d.d3plus.edges[f[e.id.value]].y},v=h.x-p.x,g=h.y-p.y,n={x:h.x-v/2,y:h.y-g/2},i=Math.atan2(g,v),s=i*(180/Math.PI),r=Math.sqrt(v*v+g*g),l=r,u=n.x,c=n.y;l+=2*e.labels.padding;var m=0;e.edges.arrows.value&&(m="number"==typeof e.edges.arrows.value?e.edges.arrows.value:8,m/=e.zoom.behavior.scaleExtent()[1],l-=2*m),(-90>s||s>90)&&(s-=180),l*e.zoom.behavior.scaleExtent()[0]>20&&(t.d3plus_label={x:u,y:c,translate:{x:u,y:c},w:l,h:15+2*e.labels.padding,angle:s,anchor:"middle",valign:"center",color:e.edges.color,resize:!1,names:[e.format.value(t[e.edges.label])],background:1})}}var l=e.returned.edges||[],u=e.zoom.behavior.scaleExtent()[0];if("string"==typeof e.edges.size){var c=d3.extent(l,function(t){return t[e.edges.size]}),f=.5*d3.min(e.returned.nodes||[],function(e){return e.d3plus.r});e.edges.scale=d3.scale.sqrt().domain(c).range([e.edges.width,f*u])}else{var d="number"==typeof e.edges.size?e.edges.size:e.edges.width;e.edges.scale=function(){return d}}var p=d3.svg.line().interpolate(e.edges.interpolate.value),h=e.edges.arrows.value?"string"==typeof e.edges.size?["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)for(var v=r(e.edges.scale.range(),4),g=[],m=0;3>m;m++)g.push(v[m+1]+(v[1]-v[0])*(m+2)*2);else var y="number"==typeof e.edges.arrows.value?e.edges.arrows.value:8,g="number"==typeof e.edges.size?e.edges.size/y:y;var x=e.defs.selectAll(".d3plus_edge_marker").data(h,String),b=function(t){t.attr("d",function(t){var r=t.split("_");if(2==r.length&&e.edges.scale){r=parseInt(r[1]);var n=g[r]}else var n=g;return"target"==e.edges.arrows.direction.value?"M 0,-"+n/2+" L "+.85*n+",0 L 0,"+n/2+" L 0,-"+n/2:"M 0,-"+n/2+" L -"+.85*n+",0 L 0,"+n/2+" L 0,-"+n/2}).attr("fill",function(t){var r=t.split("_")[0];return"default"==r?e.edges.color:"focus"==r?e.color.focus:e.color.primary}).attr("transform","scale("+1/u+")")};e.draw.timing?(x.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),x.select("path").transition().duration(e.draw.timing).attr("opacity",1).call(b)):(x.exit().remove(),x.select("path").attr("opacity",1).call(b));var w=e.draw.timing?0:1,_=x.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",w).attr("vector-effect","non-scaling-stroke").call(b);e.draw.timing&&_.transition().duration(e.draw.timing).attr("opacity",1);var k="string"==typeof e.edges.size?r(e.edges.scale.domain(),4):null,z=e.edges.arrows.direction.value,j=l.filter(function(t){if(t.d3plus||(t.d3plus={}),t.d3plus.id="edge_"+t[e.edges.source][e.id.value]+"_"+t[e.edges.target][e.id.value],t.d3plus.spline!==!0){if(k){var r=t[e.edges.size];t.d3plus.bucket=r<k[1]?0:r<k[2]?1:2;var a=.85*g[t.d3plus.bucket]/u}else{delete t.d3plus.bucket;
var a=.85*g/u}var o=t[e.edges.source],i=t[e.edges.target];if(!o.d3plus||!i.d3plus)return!1;var s=Math.atan2(o.d3plus.y-i.d3plus.y,o.d3plus.x-i.d3plus.x),l=Math.atan2(i.d3plus.y-o.d3plus.y,i.d3plus.x-o.d3plus.x),c="source"==z&&e.edges.arrows.value?o.d3plus.r+a:o.d3plus.r,f="target"==z&&e.edges.arrows.value?i.d3plus.r+a:i.d3plus.r,d=n(s,c,e.shape.value),p=n(l,f,e.shape.value);return"edges"in o.d3plus||(o.d3plus.edges={}),o.d3plus.edges[i[e.id.value]]={x:o.d3plus.x-d.x,y:o.d3plus.y-d.y},"edges"in i.d3plus||(i.d3plus.edges={}),i.d3plus.edges[o[e.id.value]]={x:i.d3plus.x-p.x,y:i.d3plus.y-p.y},!0}return!1}),A=e.g.edges.selectAll("g.d3plus_edge_line").data(j,function(e){return e.d3plus.id}),M=l.filter(function(t){if(t.d3plus.spline){if(k){var r=t[e.edges.size];t.d3plus.bucket=r<k[1]?0:r<k[2]?1:2;var a=.85*g[t.d3plus.bucket]/u}else{delete t.d3plus.bucket;var a=.85*g/u}var o=t[e.edges.source],i=t[e.edges.target],s=o.d3plus.edges?o.d3plus.edges[i[e.id.value]]||{}:{},l=i.d3plus.edges?i.d3plus.edges[o[e.id.value]]||{}:{},c=e.edges.arrows.value&&"source"==z?a:0,f=e.edges.arrows.value&&"target"==z?a:0,d=.1,p=o.d3plus.x>i.d3plus.x?1-d:1+d,h=o.d3plus.x>i.d3plus.x?1+d:1-d,v="number"==typeof s.angle?s.angle:Math.atan2(o.d3plus.y-i.d3plus.y,o.d3plus.x-i.d3plus.x)*p,m=n(v,o.d3plus.r+c,e.shape.value),y="number"==typeof l.angle?l.angle:Math.atan2(i.d3plus.y-o.d3plus.y,i.d3plus.x-o.d3plus.x)*h,x=n(y,i.d3plus.r+f,e.shape.value),b=[o.d3plus.x-m.x,o.d3plus.y-m.y],w=s.offset?n(v,s.offset):!1,_=w?[b[0]-w.x,b[1]-w.y]:b,j=[i.d3plus.x-x.x,i.d3plus.y-x.y],A=l.offset?n(y,l.offset):!1,M=A?[j[0]-A.x,j[1]-A.y]:j,E=M[0]-_[0],S=M[1]-_[1],T="number"==typeof s.radius?s.radius:Math.sqrt(E*E+S*S)/4,O="number"==typeof l.radius?l.radius:Math.sqrt(E*E+S*S)/4,N=n(v,T-o.d3plus.r-2*c),F=n(y,O-i.d3plus.r-2*f);t.d3plus.spline=[b,j];var B=Math.abs(Math.atan2(o.d3plus.y-i.d3plus.y,o.d3plus.x-i.d3plus.x)).toFixed(5),P=Math.abs(v).toFixed(5),q=Math.abs(y-Math.PI).toFixed(5);return(P!==q||[P,q].indexOf(B)<0)&&(t.d3plus.spline.splice(1,0,[_[0]-N.x,_[1]-N.y],[M[0]-F.x,M[1]-F.y]),w&&t.d3plus.spline.splice(1,0,_),A&&t.d3plus.spline.splice(t.d3plus.spline.length-1,0,M)),!0}return!1}),E=e.g.edges.selectAll("g.d3plus_edge_path").data(M,function(e){return e.d3plus.id});e.draw.timing?(A.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),E.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),A.selectAll("text.d3plus_label, rect.d3plus_label_bg").transition().duration(e.draw.timing/2).attr("opacity",0).remove(),E.selectAll("text.d3plus_label, rect.d3plus_label_bg").transition().duration(e.draw.timing/2).attr("opacity",0).remove(),A.selectAll("line").data(function(e){return[e]}).transition().duration(e.draw.timing).call(o).call(a).each("end",s),E.selectAll("path").data(function(e){return[e]}).transition().duration(e.draw.timing).call(i).call(a).each("end",s),A.enter().append("g").attr("class","d3plus_edge_line").append("line").call(o).call(t).transition().duration(e.draw.timing).call(a).each("end",s),E.enter().append("g").attr("class","d3plus_edge_path").append("path").call(i).call(t).transition().duration(e.draw.timing).call(a).each("end",s)):(A.exit().remove(),E.exit().remove(),A.selectAll("text.d3plus_label, rect.d3plus_label_bg").remove(),E.selectAll("text.d3plus_label, rect.d3plus_label_bg").remove(),A.selectAll("line").data(function(e){return[e]}).call(o).call(a).call(s),E.selectAll("path").data(function(e){return[e]}).call(i).call(a).call(s),A.enter().append("g").attr("class","d3plus_edge_line").append("line").call(o).call(t).call(a).call(s),E.enter().append("g").attr("class","d3plus_edge_path").append("path").call(i).call(t).call(a).call(s))}},{"../../../geom/offset.coffee":153,"../../../util/buckets.coffee":188}],211:[function(e,t){var r=e("../../../util/copy.coffee"),n=e("../../../core/fetch/color.coffee"),a=e("./style.coffee");t.exports=function(e,t){function o(e){e.attr("x",0).attr("y",0).attr("width",0).attr("height",0)}function i(t,r){if(!r)var r=0;t.attr("x",function(e){var t=e.d3plus.r?2*e.d3plus.r:e.d3plus.width;return-t/2-r/2}).attr("y",function(e){var t=e.d3plus.r?2*e.d3plus.r:e.d3plus.height;return-t/2-r/2}).attr("width",function(e){var t=e.d3plus.r?2*e.d3plus.r:e.d3plus.width;return t+r}).attr("height",function(e){var t=e.d3plus.r?2*e.d3plus.r:e.d3plus.height;return t+r}).attr("rx",function(t){var n=t.d3plus.r?2*t.d3plus.r:t.d3plus.width,a=["circle","donut"].indexOf(e.shape.value)>=0;return a?(n+r)/2:0}).attr("ry",function(t){var n=t.d3plus.r?2*t.d3plus.r:t.d3plus.height,a=["circle","donut"].indexOf(e.shape.value)>=0;return a?(n+r)/2:0}).attr("shape-rendering",function(){return["square"].indexOf(e.shape.value)>=0?e.shape.rendering.value:"auto"})}function s(t,r,n,a){if(!r)var r=0;if("number"!=typeof n)var n=void 0;if("number"!=typeof a)var a=void 0;t.attrTween("d",function(t){if(void 0==n)var o=t.d3plus.r?t.d3plus.r:d3.max([t.d3plus.width,t.d3plus.height]);else var o=n;if(void 0==a)var i=t.d3plus.a[t.d3plus.shape];else var i=a;e.arcs[t.d3plus.shape][t.d3plus.id]||(e.arcs[t.d3plus.shape][t.d3plus.id]={r:0},e.arcs[t.d3plus.shape][t.d3plus.id].a="donut"==t.d3plus.shape?2*Math.PI:0);var s=d3.interpolate(e.arcs[t.d3plus.shape][t.d3plus.id].r,o+r),u=d3.interpolate(e.arcs[t.d3plus.shape][t.d3plus.id].a,i);return function(r){return e.arcs[t.d3plus.shape][t.d3plus.id].r=s(r),e.arcs[t.d3plus.shape][t.d3plus.id].a=u(r),l(t)}})}e.arcs||(e.arcs={donut:{},active:{},temp:{}});var l=d3.svg.arc().startAngle(0).endAngle(function(t){var r=e.arcs[t.d3plus.shape][t.d3plus.id].a;return r>2*Math.PI?2*Math.PI:r}).innerRadius(function(t){if("donut"!=shape||t.d3plus.static)return 0;var r=e.arcs[t.d3plus.shape][t.d3plus.id].r;return r*e.data.donut.size}).outerRadius(function(t){var r=e.arcs[t.d3plus.shape][t.d3plus.id].r;return"donut"!=t.d3plus.shape?2*r:r});t.each(function(t){function l(t){t.attr("stroke",p).attr("stroke-width",1).attr("shape-rendering",e.shape.rendering.value)}var u=e.active.value?t.d3plus[e.active.value]:t.d3plus.active,c=e.temp.value?t.d3plus[e.temp.value]:t.d3plus.temp,f=e.total.value?t.d3plus[e.total.value]:t.d3plus.total,d=d3.select(this),p=n(e,t),h=[],v=[];if(f&&e.types[e.type.value].fill){if(c){var g=r(t);g.d3plus.shape="temp",h.push(g),v=["temp"]}if(u&&(f>u||c)){var g=r(t);g.d3plus.shape="active",h.push(g)}}var m=e.defs.selectAll("pattern#d3plus_hatch_"+t.d3plus.id).data(v);e.draw.timing?(m.selectAll("rect").transition().duration(e.draw.timing).style("fill",p),m.selectAll("line").transition().duration(e.draw.timing).style("stroke",p)):(m.selectAll("rect").style("fill",p),m.selectAll("line").style("stroke",p));var y=m.enter().append("pattern").attr("id","d3plus_hatch_"+t.d3plus.id).attr("patternUnits","userSpaceOnUse").attr("x","0").attr("y","0").attr("width","10").attr("height","10").append("g");y.append("rect").attr("x","0").attr("y","0").attr("width","10").attr("height","10").attr("fill",p).attr("fill-opacity",.25),y.append("line").attr("x1","0").attr("x2","10").attr("y1","0").attr("y2","10").call(l),y.append("line").attr("x1","-1").attr("x2","1").attr("y1","9").attr("y2","11").call(l),y.append("line").attr("x1","9").attr("x2","11").attr("y1","-1").attr("y2","1").call(l);var x=h.length?[t]:[],b=d.selectAll("#d3plus_clip_"+t.d3plus.id).data(x);b.enter().insert("clipPath",".d3plus_mouse").attr("id","d3plus_clip_"+t.d3plus.id).append("rect").attr("class","d3plus_clipping").call(o),e.draw.timing?(b.selectAll("rect").transition().duration(e.draw.timing).call(i),b.exit().transition().delay(e.draw.timing).remove()):(b.selectAll("rect").call(i),b.exit().remove());var w=d.selectAll("path.d3plus_fill").data(h);w.transition().duration(e.draw.timing).call(a,e).call(s),w.enter().insert("path","rect.d3plus_mouse").attr("class","d3plus_fill").attr("clip-path","url(#d3plus_clip_"+t.d3plus.id+")").transition().duration(0).call(s,0,void 0,0).call(a,e).transition().duration(e.draw.timing).call(s),w.exit().transition().duration(e.draw.timing).call(s,0,void 0,0).remove()})}},{"../../../core/fetch/color.coffee":64,"../../../util/copy.coffee":191,"./style.coffee":215}],212:[function(e,t){var r=e("../../../util/copy.coffee"),n=e("../../../core/fetch/text.js"),a=e("../../../color/mix.coffee"),o=e("../../../core/console/print.coffee"),i=e("../../../client/rtl.coffee"),s=e("./color.coffee"),l=e("../../../string/list.coffee"),u=e("../../../color/text.coffee"),c=e("../../../textwrap/textwrap.coffee");t.exports=function(e,t){var f=e.types[e.type.value].zoom?e.zoom.behavior.scaleExtent():[1,1],d=e.g[t].selectAll("g"),p=function(t){t.attr("opacity",function(t){if(!t)var t={scale:f[1]};var r=parseFloat(d3.select(this).attr("font-size"),10);return t.visible=r/t.scale*e.zoom.scale>=7,t.visible?1:0})};if(remove=function(t){e.draw.timing?t.transition().duration(e.draw.timing).attr("opacity",0).remove():t.remove()},style=function(t,r){function n(t){if("circle"===t.shape)return"0px";var r=t.anchor||e.labels.align,n="tspan"===this.tagName.toLowerCase(),a=n?"d3plus_share"==this.parentNode.className.baseVal:"d3plus_share"==this.className.baseVal,o=d3.select(this).node().getComputedTextLength()/f[1];if("middle"==r||a)var s=t.x-o/2;else if("end"==r&&!i||"start"==r&&i)var s=t.x+(t.w-t.padding)/2-o;else var s=t.x-(t.w-t.padding)/2;if(n){var l=this.getComputedTextLength()/f[1];"middle"==r?i?s-=(o-l)/2:s+=(o-l)/2:"end"==r&&(i?s-=o-l:s+=o-l)}return i&&(s+=o),s*f[1]}function o(t){if(d3.select(this).select("tspan").empty())return 0;var r=e.labels.align,n=d3.select(this).node().getBBox().height/f[1],a=parseFloat(d3.select(this).style("font-size"),10)/5/f[1];if("d3plus_share"==this.className.baseVal){var o=d3.select(this.parentNode).datum(),i=o.d3plus.r?2*o.d3plus.r:o.d3plus.height;if(i/=f[1],"end"==r)var s=t.y-i/2+a/2;else var s=t.y+i/2-n-a/2}else if("circle"===t.shape||"middle"===r||"center"===t.valign)var s=t.y-n/2-a/2;else if("end"==r)var s=t.y+(t.h-t.padding)/2-n+a/2;else var s=t.y-(t.h-t.padding)/2-a;return s*f[1]}t.attr("font-weight",e.labels.font.weight).attr("font-family",e.labels.font.family.value).style("text-anchor",function(e){return"circle"===e.shape?"middle":"start"}).attr("pointer-events",function(e){return e.mouse?"auto":"none"}).attr("fill",function(t){if(t.color)return t.color;var r=s(t.parent,e),n=u(r),o=t.text?.15:1;return a(r,n,.2,o)}).attr("x",n).attr("y",o),r&&t.each(function(t){if(t.resize instanceof Array){t.resize[0],t.resize[1]}if(t.text){if(t.resize instanceof Array)var r=t.resize,n=!0;else var r=[9/t.scale,50*t.scale],n=t.resize;c().container(d3.select(this)).height(t.h*t.scale-t.padding).resize(n).size(r).text(e.format.value(100*t.text,"share")+"%",e).width(t.w*t.scale-t.padding).draw()}else{if("middle"!==e.labels.align&&t.share)var a=t.h-t.share-t.padding;else var a=t.h;if(t.resize instanceof Array)var r=t.resize,n=!0;else var r=[9/t.scale,40*t.scale],n=t.resize;var o=t.shape||"square";c().container(d3.select(this)).height(a*t.scale-t.padding).resize(n).size(r).shape(o).text(t.names).width(t.w*t.scale-t.padding).draw()}}).attr("x",n).attr("y",o),t.attr("transform",function(e){var t=e.angle||0,r=e.translate&&e.translate.x?e.translate.x:0,n=e.translate&&e.translate.y?e.translate.y:0;return"rotate("+t+","+r+","+n+")scale("+1/f[1]+")"}).selectAll("tspan").attr("x",n)},"edges"===t||e.labels.value){if(e.dev.value){var h="drawing "+t+" labels";o.time(h)}d.each(function(t){function a(t){var r="string"==typeof i.background?i.background:"none"===e.background.value?"#ffffff":e.background.value,n="string"==typeof i.background?i.background:r,a=i.angle||0,o=i.translate?A.x+A.width/2:0,s=i.translate?A.y+A.height/2:0,l="scale("+1/f[1]+")rotate("+a+","+o+","+s+")";t.attr("fill",n).attr(A).attr("transform",l)}var o=t.d3plus&&"label"in t.d3plus&&!t.d3plus.label,i=t.d3plus_label?t.d3plus_label:e.zoom.labels?e.zoom.labels[t.d3plus.id]:null,s=t.d3plus_share,u=t.d3plus.text?t.d3plus.text:i&&i.names?i.names:n(e,t),c=i&&"group"in i?i.group:d3.select(this),d=0,h=e.types[e.type.value].fill;if(u instanceof Array||(u=[u]),i)if(["line","area"].indexOf(e.shape.value)>=0)var v=!0;else if(t&&"d3plus"in t)var g=e.active.value?t.d3plus[e.active.value]:t.d3plus.active,m=e.temp.value?t.d3plus[e.temp.value]:t.d3plus.temp,y=e.total.value?t.d3plus[e.total.value]:t.d3plus.total,v=!m&&!g||g==y;if(o||!v&&h)delete t.d3plus_label,c.selectAll("text#d3plus_label_"+t.d3plus.id+", rect#d3plus_label_bg_"+t.d3plus.id).call(remove);else{if(s&&t.d3plus.share&&"middle"!=e.labels.align){s.resize=e.labels.resize.value===!1?!1:s&&"resize"in s?s.resize:!0,s.scale=s.resize?f[1]:f[0],s.padding=e.labels.padding/s.scale*2,s.text=t.d3plus.share,s.parent=t;var x=c.selectAll("text#d3plus_share_"+t.d3plus.id).data([s],function(e){return e.w+""+e.h+e.text});e.draw.timing?(x.transition().duration(e.draw.timing/2).call(style),x.enter().append("text").attr("id","d3plus_share_"+t.d3plus.id).attr("class","d3plus_share").attr("opacity",0).call(style,!0).transition().duration(e.draw.timing/2).delay(e.draw.timing/2).attr("opacity",1)):(x.attr("opacity",1).call(style),x.enter().append("text").attr("id","d3plus_share_"+t.d3plus.id).attr("class","d3plus_share").attr("opacity",1).call(style,!0)),d=x.node().getBBox().height,x.exit().call(remove)}else c.selectAll("text.d3plus_share").call(remove);if(i){i.resize=e.labels.resize.value===!1?!1:i&&"resize"in i?i.resize:!0,i.scale=i.resize?f[1]:f[0];var b="number"==typeof i.padding?i.padding:e.labels.padding;i.padding=b/i.scale*2}if(i&&i.w*i.scale-i.padding>=20&&i.h*i.scale-i.padding>=10&&u.length){for(var w=e.format.locale.value.ui.and,_=e.format.locale.value.ui.more,k=0;k<u.length;k++)u[k]instanceof Array&&(u[k]=l(u[k],w,3,_));i.names=u,i.share=d,i.parent=t;var x=c.selectAll("text#d3plus_label_"+t.d3plus.id).data([i],function(e){return e?e.w+"_"+e.h+"_"+e.x+"_"+e.y+"_"+e.names.join("_"):!1}),z=i.resize?void 0:e.labels.font.size*i.scale+"px";if(e.draw.timing?(x.transition().duration(e.draw.timing/2).call(style).call(p),x.enter().append("text").attr("font-size",z).attr("id","d3plus_label_"+t.d3plus.id).attr("class","d3plus_label").attr("opacity",0).call(style,!0).transition().duration(e.draw.timing/2).delay(e.draw.timing/2).call(p)):(x.attr("opacity",1).call(style).call(p),x.enter().append("text").attr("font-size",z).attr("id","d3plus_label_"+t.d3plus.id).attr("class","d3plus_label").call(style,!0).call(p)),x.exit().call(remove),0==x.size()||""==x.html())delete t.d3plus_label,c.selectAll("text#d3plus_label_"+t.d3plus.id+", rect#d3plus_label_bg_"+t.d3plus.id).call(remove);else{if(i.background){var j=["background"],A=r(x.node().getBBox());A.width+=e.labels.padding*f[0],A.height+=e.labels.padding*f[0],A.x-=e.labels.padding*f[0]/2,A.y-=e.labels.padding*f[0]/2}else var j=[],A={};var M=c.selectAll("rect#d3plus_label_bg_"+t.d3plus.id).data(j),E="number"==typeof i.background?i.background:"string"==typeof i.background?1:.6;e.draw.timing?(M.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),M.transition().duration(e.draw.timing).attr("opacity",E).call(a),M.enter().insert("rect",".d3plus_label").attr("id","d3plus_label_bg_"+t.d3plus.id).attr("class","d3plus_label_bg").attr("opacity",0).call(a).transition().duration(e.draw.timing).attr("opacity",E)):(M.exit().remove(),M.enter().insert("rect",".d3plus_label").attr("id","d3plus_label_bg_"+t.d3plus.id).attr("class","d3plus_label_bg"),M.attr("opacity",E).call(a))}}else delete t.d3plus_label,c.selectAll("text#d3plus_label_"+t.d3plus.id+", rect#d3plus_label_bg_"+t.d3plus.id).call(remove)}}),e.dev.value&&o.timeEnd(h)}else{if(e.dev.value){var h="removing "+t+" labels";o.time(h)}d.selectAll("text.d3plus_label, rect.d3plus_label_bg").call(remove),e.g.labels.selectAll("text.d3plus_label, rect.d3plus_label_bg").call(remove),e.dev.value&&o.timeEnd(h)}}},{"../../../client/rtl.coffee":43,"../../../color/mix.coffee":48,"../../../color/text.coffee":52,"../../../core/console/print.coffee":54,"../../../core/fetch/text.js":67,"../../../string/list.coffee":164,"../../../textwrap/textwrap.coffee":184,"../../../util/copy.coffee":191,"./color.coffee":204}],213:[function(e,t){var r=e("../../../util/copy.coffee"),n=e("../../../util/closest.coffee"),a=e("../../../client/pointer.coffee"),o=e("./style.coffee");t.exports=function(e,t){function i(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 s(e,t){if(!t)var t=0;e.attr("x",function(e){var r=e.d3plus.r?2*e.d3plus.r:e.d3plus.width;return e.d3plus.x-(r/2+t/2)}).attr("y",function(e){var r=e.d3plus.r?2*e.d3plus.r:e.d3plus.height;return e.d3plus.y-(r/2+t/2)}).attr("width",function(e){var r=e.d3plus.r?2*e.d3plus.r:e.d3plus.width;return r+t}).attr("height",function(e){var r=e.d3plus.r?2*e.d3plus.r:e.d3plus.height;return r+t}).attr("rx",function(e){var r=e.d3plus.r?2*e.d3plus.r:e.d3plus.width;return(r+t)/2}).attr("ry",function(e){var r=e.d3plus.r?2*e.d3plus.r:e.d3plus.height;return(r+t)/2})}var l=d3.svg.line().x(function(e){return e.d3plus.x}).y(function(e){return e.d3plus.y}).interpolate(e.shape.interpolate.value),u=2*e.data.stroke.width,c=30>u?30:u,f=e[e.axes.discrete],d=[];f.ticks.values.forEach(function(e){d.push(e.constructor===Date?e.getTime():e)}),t.each(function(t){var p=!1,h=[],v=[],g=r(t),m=d3.select(this);g.values=[],t.values.forEach(function(e,a,o){v.push(e);var i=e[f.value];i.constructor===Date&&(i=i.getTime());var s=d.indexOf(n(d,i));p===!1&&(p=s),a+p===s?(g.values.push(e),g.key+="_"+h.length):(a>0&&(h.push(g),g=r(t),g.values=[]),g.values.push(e),g.key+="_"+h.length,p++),a===o.length-1&&h.push(g)});var y=m.selectAll("path.d3plus_line").data(h,function(e){return e.d3plus.shape="line",e.key}),x=m.selectAll("rect.d3plus_anchor").data(v,function(e){return e.d3plus.id});e.draw.timing?(y.transition().duration(e.draw.timing).attr("d",function(e){return l(e.values)}).call(o,e),y.enter().append("path").attr("class","d3plus_line").attr("d",function(e){return l(e.values)}).call(o,e),x.enter().append("rect").attr("class","d3plus_anchor").attr("id",function(e){return e.d3plus.id}).call(i).call(o,e),x.transition().duration(e.draw.timing).call(s).call(o,e),x.exit().transition().duration(e.draw.timing).call(i).remove()):(y.enter().append("path").attr("class","d3plus_line"),y.attr("d",function(e){return l(e.values)}).call(o,e),x.enter().append("rect").attr("class","d3plus_anchor").attr("id",function(e){return e.d3plus.id}),x.call(s).call(o,e));var b=m.selectAll("path.d3plus_mouse").data(h,function(e){return e.key});b.enter().append("path").attr("class","d3plus_mouse").attr("d",function(e){return l(e.values)}).style("stroke","black").style("stroke-width",c).style("fill","none").style("stroke-linecap","round").attr("opacity",0),b.on(a.over,function(){e.draw.frozen||(d3.select(this.parentNode).selectAll("path.d3plus_line").transition().duration(e.timing.mouseevents).style("stroke-width",2*u),d3.select(this.parentNode).selectAll("rect").transition().duration(e.timing.mouseevents).style("stroke-width",u).call(s,2))}).on(a.out,function(){e.draw.frozen||(d3.select(this.parentNode).selectAll("path.d3plus_line").transition().duration(e.timing.mouseevents).style("stroke-width",u),d3.select(this.parentNode).selectAll("rect").transition().duration(e.timing.mouseevents).style("stroke-width",e.data.stroke.width).call(s))}),e.draw.timing?b.transition().duration(e.draw.timing).attr("d",function(e){return l(e.values)}).style("stroke-width",c):b.attr("d",function(e){return l(e.values)}).style("stroke-width",c),b.exit().remove()})}},{"../../../client/pointer.coffee":41,"../../../util/closest.coffee":190,"../../../util/copy.coffee":191,"./style.coffee":215}],214:[function(e,t){var r;r=e("./style.coffee"),t.exports=function(e,t,n,a){var o,i,s;return o=function(t){var r,n;return e.labels.value&&!t.d3plus.label?(t.d3plus_label={w:0,h:0,x:0,y:0},n=t.d3plus.r?2*t.d3plus.r:t.d3plus.width,r=t.d3plus.r?2*t.d3plus.r:t.d3plus.height,t.d3plus_share={w:n,h:d3.max([25,r/3]),x:0,y:0},t.d3plus_label.w=n,t.d3plus_label.h=r,t.d3plus_label.shape="circle"===t.d3plus.shape?"circle":"square"):t.d3plus.label&&(t.d3plus_label=t.d3plus.label),[t]},i=function(e){return e.attr("x",function(e){return e.d3plus.init&&"x"in e.d3plus.init?e.d3plus.init.x:e.d3plus.init&&"width"in e.d3plus.init?-e.d3plus.width/2:0}).attr("y",function(e){return e.d3plus.init&&"y"in e.d3plus.init?e.d3plus.init.y:e.d3plus.init&&"height"in e.d3plus.init?-e.d3plus.height/2:0}).attr("width",function(e){return e.d3plus.init&&"width"in e.d3plus.init?e.d3plus.init.width:0}).attr("height",function(e){return e.d3plus.init&&"height"in e.d3plus.init?e.d3plus.init.height:0})},s=function(t){return t.attr("x",function(e){var t;return t=e.d3plus.r?2*e.d3plus.r:e.d3plus.width,-t/2}).attr("y",function(e){var t;return t=e.d3plus.r?2*e.d3plus.r:e.d3plus.height,-t/2}).attr("width",function(e){return e.d3plus.r?2*e.d3plus.r:e.d3plus.width}).attr("height",function(e){return e.d3plus.r?2*e.d3plus.r:e.d3plus.height}).attr("rx",function(e){var t,r;return t="circle"===e.d3plus.shape,r=e.d3plus.r?2*e.d3plus.r:e.d3plus.width,t?(r+2)/2:0}).attr("ry",function(e){var t,r;return r="circle"===e.d3plus.shape,t=e.d3plus.r?2*e.d3plus.r:e.d3plus.height,r?(t+2)/2:0}).attr("transform",function(e){return"rotate"in e.d3plus?"rotate("+e.d3plus.rotate+")":""}).attr("shape-rendering",function(t){return"square"!==t.d3plus.shape||"rotate"in t.d3plus?"auto":e.shape.rendering.value})},e.draw.timing?(n.append("rect").attr("class","d3plus_data").call(i).call(r,e),t.selectAll("rect.d3plus_data").data(o).transition().duration(e.draw.timing).call(s).call(r,e),a.selectAll("rect.d3plus_data").transition().duration(e.draw.timing).call(i)):(n.append("rect").attr("class","d3plus_data"),t.selectAll("rect.d3plus_data").data(o).call(s).call(r,e))}},{"./style.coffee":215}],215:[function(e,t){var r;r=e("./color.coffee"),t.exports=function(e,t){return e.attr("fill",function(e){return e.d3plus&&e.d3plus.spline?"none":r(e,t)}).style("stroke",function(e){var n;return e.d3plus&&e.d3plus.stroke?e.d3plus.stroke:(n=e.values?r(e.values[0],t):r(e,t),d3.rgb(n).darker(.7))}).style("stroke-width",function(e){var r;return r="line"===e.d3plus.shape?2:1,t.data.stroke.width*r}).attr("opacity",t.data.opacity).attr("vector-effect","non-scaling-stroke")}},{"./color.coffee":204}],216:[function(e,t){var r=e("./style.coffee");t.exports=function(e,t,n){function a(e){e.attr("d",d3.svg.symbol().type("triangle-down").size(10))}function o(e){e.attr("d",d3.svg.symbol().type("triangle-down").size(function(e){var t=Math.min(e.d3plus.width,e.d3plus.height);return d3.scale.pow().exponent(2)(t/2)}))}n.append("path").attr("class","d3plus_data").call(a).call(r,e),t.selectAll("path.d3plus_data").data(function(e){return[e]}),e.draw.timing?t.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(o).call(r,e):t.selectAll("path.d3plus_data").call(o).call(r,e)}},{"./style.coffee":215}],217:[function(e,t){var r=e("./style.coffee");t.exports=function(e,t,n){function a(e){e.attr("d",d3.svg.symbol().type("triangle-up").size(10))}function o(e){e.attr("d",d3.svg.symbol().type("triangle-up").size(function(e){var t=Math.min(e.d3plus.width,e.d3plus.height);return d3.scale.pow().exponent(2)(t/2)}))}n.append("path").attr("class","d3plus_data").call(a).call(r,e),t.selectAll("path.d3plus_data").data(function(e){return[e]}),e.draw.timing?t.selectAll("path.d3plus_data").transition().duration(e.draw.timing).call(o).call(r,e):t.selectAll("path.d3plus_data").call(o).call(r,e)}},{"./style.coffee":215}],218:[function(e,t){t.exports=function(e,t,r,n){var a,o,i,s,l,u,c,f,d;o=function(e){return e.d3plus.text?e.d3plus_label={w:f,h:f,x:0,y:0,background:"#fff",resize:!1,angle:["left","right"].indexOf(e.d3plus.position)>=0?90:0}:delete e.d3plus_label,[e]},d=function(t){return t.style("stroke-width",e.data.stroke.width).style("stroke","#444").attr("fill","none").attr("shape-rendering",e.shape.rendering.value)},i=function(e){return e.attr("x1",0).attr("x2",0).attr("y1",0).attr("y2",0)},c=function(e){return e.attr("x1",function(e){var t,r,n;return["top","bottom"].indexOf(e.d3plus.position)>=0?0:(t=e.d3plus.offset||0,r=e.d3plus.width||0,n=0>t?-r:r,n+t)}).attr("x2",function(e){return["top","bottom"].indexOf(e.d3plus.position)>=0?0:e.d3plus.offset||0}).attr("y1",function(e){var t,r,n;return["left","right"].indexOf(e.d3plus.position)>=0?0:(r=e.d3plus.offset||0,t=e.d3plus.height||0,n=0>r?-t:t,n+r)}).attr("y2",function(e){return["left","right"].indexOf(e.d3plus.position)>=0?0:e.d3plus.offset||0}).attr("marker-start","url(#d3plus_whisker_marker)")},s=e.defs.selectAll("#d3plus_whisker_marker").data([0]),s.enter().append("marker").attr("id","d3plus_whisker_marker").attr("markerUnits","userSpaceOnUse").style("overflow","visible").append("line"),a=t.datum(),a?(u=a.d3plus.position,l=["top","bottom"].indexOf(u)>=0?"horizontal":"vertical",f="horizontal"===l?a.d3plus.width:a.d3plus.height):(l="horizontal",f=0),s.select("line").attr("x1","horizontal"===l?-f/2:0).attr("x2","horizontal"===l?f/2:0).attr("y1","vertical"===l?-f/2:0).attr("y2","vertical"===l?f/2:0).call(d).style("stroke-width",2*e.data.stroke.width),e.draw.timing?(r.append("line").attr("class","d3plus_data").call(d).call(i),t.selectAll("line.d3plus_data").data(o).transition().duration(e.draw.timing).call(d).call(c),n.selectAll("line.d3plus_data").transition().duration(e.draw.timing).call(i)):(r.append("line").attr("class","d3plus_data"),t.selectAll("line.d3plus_data").data(o).call(d).call(c))}},{}],219:[function(e,t){var r=e("../../../client/pointer.coffee"),n=e("../../../client/prefix.coffee"),a=e("../../../core/console/print.coffee"),o=e("../../../client/touch.coffee"),i=e("../zoom/propagation.coffee");t.exports=function(e){if(e.dev.value&&a.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: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("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+")"),e.g.clipping=e.svg.selectAll("#clipping").data(["clipping"]),e.g.clipping.enter().append("clipPath").attr("id","clipping").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(#clipping)").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),o){var t=function(){i(e,d3.event)};e.g.overlay.on(r.over,t).on(r.move,t).on(r.out,t)}else e.g.overlay.on(r.move,function(){e.types[e.type.value].zoom&&e.zoom.pan.value&&e.zoom.behavior.scaleExtent()[0]<e.zoom.scale?d3.select(this).style("cursor",n()+"grab"):d3.select(this).style("cursor","auto")}).on(r.up,function(){e.types[e.type.value].zoom&&e.zoom.pan.value&&e.zoom.behavior.scaleExtent()[0]<e.zoom.scale?d3.select(this).style("cursor",n()+"grab"):d3.select(this).style("cursor","auto")}).on(r.down,function(){e.types[e.type.value].zoom&&e.zoom.pan.value&&e.zoom.behavior.scaleExtent()[0]<e.zoom.scale?d3.select(this).style("cursor",n()+"grabbing"):d3.select(this).style("cursor","auto")});e.g.app=e.g.viz.selectAll("g#app").data(["app"]),e.g.app.enter().append("g").attr("id","app"),e.g.edges=e.g.viz.selectAll("g#edges").data(["edges"]),e.g.edges.enter().append("g").attr("id","edges").attr("opacity",0),e.g.edge_focus=e.g.viz.selectAll("g#focus").data(["focus"]),e.g.edge_focus.enter().append("g").attr("id","focus"),e.g.edge_hover=e.g.viz.selectAll("g#edge_hover").data(["edge_hover"]),e.g.edge_hover.enter().append("g").attr("id","edge_hover").attr("opacity",0),e.g.data=e.g.viz.selectAll("g#data").data(["data"]),e.g.data.enter().append("g").attr("id","data").attr("opacity",0),e.g.data_focus=e.g.viz.selectAll("g#data_focus").data(["data_focus"]),e.g.data_focus.enter().append("g").attr("id","data_focus"),e.g.labels=e.g.viz.selectAll("g#d3plus_labels").data(["d3plus_labels"]),e.g.labels.enter().append("g").attr("id","d3plus_labels"),e.defs=e.svg.selectAll("defs").data(["defs"]),e.defs.enter().append("defs"),e.dev.value&&a.timeEnd("creating SVG elements")}},{"../../../client/pointer.coffee":41,"../../../client/prefix.coffee":42,"../../../client/touch.coffee":45,"../../../core/console/print.coffee":54,"../zoom/propagation.coffee":234}],220:[function(e,t){var r=e("../../../core/console/print.coffee");t.exports=function(e){e.dev.value&&r.time("updating SVG elements"),e.draw.timing?(e.container.value.transition().duration(e.draw.timing).style("width",e.width.value+"px").style("height",e.height.value+"px"),e.svg.transition().duration(e.draw.timing).attr("width",e.width.value).attr("height",e.height.value),e.g.bg.transition().duration(e.draw.timing).attr("width",e.width.value).attr("height",e.height.value),e.g.clipping.select("rect").transition().duration(e.draw.timing).attr("width",e.width.viz).attr("height",e.height.viz),e.g.container.transition().duration(e.draw.timing).attr("transform","translate("+e.margin.left+","+e.margin.top+")")):(e.container.value.style("width",e.width.value+"px").style("height",e.height.value+"px"),e.svg.attr("width",e.width.value).attr("height",e.height.value),e.g.bg.attr("width",e.width.value).attr("height",e.height.value),e.g.clipping.select("rect").attr("width",e.width.viz).attr("height",e.height.viz),e.g.container.attr("transform","translate("+e.margin.left+","+e.margin.top+")")),e.dev.value&&r.timeEnd("updating SVG elements")}},{"../../../core/console/print.coffee":54}],221:[function(e,t){var r=e("../../../array/sort.coffee"),n=e("../../../tooltip/create.js"),a=e("./data.js"),o=e("../../../core/fetch/color.coffee"),i=e("../../../core/fetch/text.js"),s=e("../../../core/fetch/value.js"),l=e("../../../tooltip/remove.coffee"),u=e("../../../object/validate.coffee"),c=e("../zoom/direction.coffee");t.exports=function(e){function t(t){var c={},g={},w=f.id.nesting[p+1]in d?p+1:p,_=f.id.nesting[w],k="merged"in d.d3plus?d.d3plus.merged:d[_],E=s(f,d,f.size.value),S=(!(k instanceof Array)||k instanceof Array&&1===k.length)&&w===f.depth.value;if(!S&&f.tooltip.children.value)if(k instanceof Array){if(k=k.slice(0),f.size.value&&u(k[0])){var T=k.filter(function(e){return f.size.value in e}),O=k.filter(function(e){return!(f.size.value in e)});r(T,f.size.value,"desc",[],f),k=T.concat(O)}for(var N="short"===b?3:f.data.large,F=d3.min([k.length,N]),B=0;F>B;B++){var P=k[B],q=i(f,P,w)[0],I=s(f,P,f.size.value,_),R=o(f,P,_);g[q]=I?f.format.value(I,f.size.value,f,P):"",R&&(g.d3plus_colors||(g.d3plus_colors={}),g.d3plus_colors[q]=R)}k.length>F&&(g.d3plusMore=k.length-F)}else if(k&&"null"!==k){var q=i(f,k,w)[0];g[q]=E?f.format.value(E,f.size.value,f,d):""}f.size.value&&f.tooltip.size.value&&E&&(S||!k||k instanceof Array)&&(c[f.size.value]=E);var V=f.active.value?s(f,d,f.active.value):d.d3plus.active,C=f.temp.value?s(f,d,f.temp.value):d.d3plus.temp,U=f.total.value?s(f,d,f.total.value):d.d3plus.total;if("number"==typeof V&&V>0&&U){var D=f.active.value||"active";
c[D]=V+"/"+U+" ("+f.format.value(V/U*100,"share",f,d)+"%)"}if("number"==typeof C&&C>0&&U){var D=f.temp.value||"temp";c[D]=C+"/"+U+" ("+f.format.value(C/U*100,"share",f,d)+"%)"}f.tooltip.share.value&&d.d3plus.share&&(c.share=f.format.value(100*d.d3plus.share,"share",f,d)+"%");var w="depth"in e?e.depth:p,L=e.title||i(f,d,w)[0],Y=s(f,d,f.icon.value,f.id.nesting[w]),H=a(f,d,b,c,g,w);if("null"===Y&&(Y=!1),H.length>0||z||!d.d3plus_label&&"short"==b&&L||d.d3plus_label&&(!("visible"in d.d3plus_label)||"visible"in d.d3plus_label&&d.d3plus_label.visible===!1)){L||(L=P);var w="d3plus"in d&&"merged"in d.d3plus?p-1:p;if(0>w&&(w=0),w=f.id.nesting[w],"string"==typeof f.icon.style.value)var W=f.icon.style.value;else if("object"==typeof f.icon.style.value&&f.icon.style.value[w])var W=f.icon.style.value[w];else var W="default";if(e.width)var X=e.width;else if(y||0!=H.length)var X=f.tooltip.small;else var X="auto";n({align:x,arrow:v,locale:f.format.locale.value,background:f.tooltip.background,curtain:f.tooltip.curtain.color,curtainopacity:f.tooltip.curtain.opacity,fontcolor:f.tooltip.font.color,fontfamily:f.tooltip.font.family.value,fontsize:f.tooltip.font.size,fontweight:f.tooltip.font.weight,data:H,color:o(f,d),allColors:!0,footer:e.footer===!1?e.footer:z,fullscreen:y,html:t,icon:Y,id:m,max_height:e.maxheight,max_width:f.tooltip.small,mouseevents:h,offset:M,parent:f.container.value,style:W,title:L,width:X,x:j,y:A})}else l(m)}"d3plus"in e.data||(e.data.d3plus={});var f=e.vars,d=e.data,p="d3plus"in d&&"depth"in d.d3plus?d.d3plus.depth:f.depth.value,h=(e.ex,e.mouseevents?e.mouseevents:!1),v="arrow"in e?e.arrow:!0,g=s(f,d,f.id.value),m=e.id||f.type.value;if(!d3.event||"click"!=d3.event.type||!f.tooltip.html.value&&!f.tooltip.value.long||"fullscreen"in e){var y=!1,x=e.anchor||f.tooltip.anchor,b=e.length||"short",w=c(d,f);if(-1===w){var _=f.id.nesting[p-1];s(f,g,_)}if(1===w&&f.zoom.value)var k=f.format.value(f.format.locale.value.ui.expand);else if(-1===w&&f.zoom.value&&f.history.states.length)var k=f.format.value(f.format.locale.value.ui.collapse);else if(f.small||"short"!=b||!f.tooltip.html.value&&!f.tooltip.value.long||1===f.focus.value.length&&f.focus.value[0]==g)if("long"==b)var k=f.footer.value||"";else var k="";else var k=f.format.locale.value.ui.moreInfo;var z=k.length?f.format.value(k,"footer",f):!1}else{var y=!0,v=!1,h=!0,b="long",z=f.footer.value;f.covered=!0}if("x"in e)var j=e.x;else if("follow"==f.types[f.type.value].tooltip)var j=d3.mouse(f.container.value.node())[0];else{var j=d.d3plus.x;f.zoom.translate&&f.zoom.scale&&(j=f.zoom.translate[0]+j*f.zoom.scale),j+=f.margin.left}if("y"in e)var A=e.y;else if("follow"==f.types[f.type.value].tooltip)var A=d3.mouse(f.container.value.node())[1];else{var A=d.d3plus.y;f.zoom.translate&&f.zoom.scale&&(A=f.zoom.translate[1]+A*f.zoom.scale),A+=f.margin.top}if("offset"in e)var M=e.offset;else if("follow"==f.types[f.type.value].tooltip)var M=3;else{var M=d.d3plus.r?d.d3plus.r:d.d3plus.height/2;f.zoom.scale&&(M*=f.zoom.scale)}y||"long"===e.length?"string"==typeof f.tooltip.html.value?t(f.tooltip.html.value):"function"==typeof f.tooltip.html.value?t(f.tooltip.html.value(g)):f.tooltip.html.value&&"object"==typeof f.tooltip.html.value&&f.tooltip.html.value.url?d3.json(f.tooltip.html.value.url,function(e){var r=f.tooltip.html.value.callback?f.tooltip.html.value.callback(e):e;t(r)}):t(""):t("")}},{"../../../array/sort.coffee":37,"../../../core/fetch/color.coffee":64,"../../../core/fetch/text.js":67,"../../../core/fetch/value.js":68,"../../../object/validate.coffee":162,"../../../tooltip/create.js":185,"../../../tooltip/remove.coffee":187,"../zoom/direction.coffee":231,"./data.js":222}],222:[function(e,t){var r=e("../../../util/copy.coffee"),n=e("../../../core/fetch/value.js"),a=e("../../../core/fetch/color.coffee"),o=e("../../../core/fetch/text.js"),i=e("../../../color/legible.coffee"),s=e("../../../object/merge.coffee"),l=e("../../../client/prefix.coffee"),u=e("../../../string/format.js");t.exports=function(e,t,c,f,d,p){function h(r,a){if(e.attrs.value[a])var o=a;else var o=null;a&&(a=e.format.value(a));var i=g[r]||n(e,t,r,o);if(null!=i&&"undefined"!=i&&!(i instanceof Array)&&("string"==typeof i&&i.indexOf("d3plus_other")<0||"string"!=typeof i)){var s=e.format.value(e.format.locale.value.ui[r]?e.format.locale.value.ui[r]:r),l=y.indexOf(r)>=0;i instanceof Array?i.forEach(function(n){n=e.format.value(n,r,e,t)}):i=e.format.value(i,r,e,t);var u={name:s,value:i,highlight:l,group:a};if(e.descs.value)if("function"==typeof e.descs.value){var c=e.descs.value(r);"string"==typeof c&&(u.desc=c)}else r in e.descs.value&&(u.desc=e.descs.value[r]);b.push(u)}}if(e.small)return[];if(!c)var c="long";if("long"==c)var v="short";else var v="long";var g={};if(f&&"string"==typeof f)f=[f];else if(f&&"object"==typeof f){g=s(g,f);var f=[];for(var m in g)f.push(m)}else if(!f)var f=[];var y=[];if(e.tooltip.value instanceof Array)var x=e.tooltip.value;else if("string"==typeof e.tooltip.value)var x=[e.tooltip.value];else{if(e.tooltip.value[e.id.nesting[p]])var x=e.tooltip.value[e.id.nesting[p]];else var x=e.tooltip.value;x instanceof Array||(x=x[c]?x[c]:x[v]?[]:s({"":[]},x)),"string"==typeof x?x=[x]:x instanceof Array||(x=s({"":[]},x))}var b=[];if(x instanceof Array)f.forEach(function(e){x.indexOf(e)<0&&x.push(e)}),x.forEach(function(e){h(e)});else{if(e.id.nesting.length&&p<e.id.nesting.length-1){var x=r(x);e.id.nesting.forEach(function(e,t){t>p&&x[e]&&delete x[e]})}if(e.tooltip.value.long&&"object"==typeof e.tooltip.value.long){var w=[];for(var _ in e.tooltip.value.long)f.forEach(function(t){e.tooltip.value.long[_].indexOf(t)>=0&&(x[_]&&x[_].indexOf(t)<0||!x[_])?(x[_]||(x[_]=[]),x[_].push(t),w.push(t)):x[_]&&x[_].indexOf(t)>=0&&w.push(t)});f.forEach(function(e){w.indexOf(e)<0&&(x[""]||(x[""]=[]),x[""].push(e))})}else{var k=[];for(var _ in x)f.forEach(function(e){x[_]instanceof Array&&x[_].indexOf(e)>=0?k.push(e):"string"==typeof x[_]&&x[_]==e&&k.push(e)});k.length!=f.length&&(x[""]||(x[""]=[]),f.forEach(function(e){k.indexOf(e)<0&&x[""].push(e)}))}x[""]&&(x[""].forEach(function(e){h(e,"")}),delete x[""]);for(var _ in x)x[_]instanceof Array?x[_].forEach(function(e){h(e,_)}):"string"==typeof x[_]&&h(x[_],_)}if(d){var z=e.format.locale.value.ui.including,j=d.d3plus_colors;for(var A in d)if("d3plus_colors"!==A){if("d3plusMore"===A){var M=e.format.locale.value.ui.more,E=u(M,d[A]),S=!0;d[A]=""}else var E=A,S=j&&j[E]?j[E]:!1;b.push({group:e.format.value(z),highlight:S,name:E,value:d[A]})}}if(e.tooltip.connections.value&&"long"===c){var T=e.edges.connections(t[e.id.value],e.id.value,!0);T.length&&T.forEach(function(t){var r=e.data.viz.filter(function(r){return r[e.id.value]===t[e.id.value]}),r=r.length?r[0]:t,n=o(e,r)[0],s=a(e,r),u=e.tooltip.font.size,c="square"==e.shape.value?0:u;styles=["background-color: "+s,"border-color: "+i(s),"border-style: solid","border-width: "+e.data.stroke.width+"px","display: inline-block","height: "+u+"px","left: 0px","position: absolute","width: "+u+"px","top: 0px",l()+"border-radius: "+c+"px"],node="<div style='"+styles.join("; ")+";'></div>";var f=function(){e.self.focus([r[e.id.value]]).draw()};b.push({group:e.format.value(e.format.locale.value.ui.primary),highlight:!1,link:f,name:"<div id='d3plustooltipfocuslink_"+r[e.id.value]+"' class='d3plus_tooltip_focus_link' style='position:relative;padding-left:"+1.5*u+"px;'>"+node+n+"</div>"})})}return b}},{"../../../client/prefix.coffee":42,"../../../color/legible.coffee":46,"../../../core/fetch/color.coffee":64,"../../../core/fetch/text.js":67,"../../../core/fetch/value.js":68,"../../../object/merge.coffee":161,"../../../string/format.js":163,"../../../util/copy.coffee":191}],223:[function(e,t){var r;r=e("../../../core/console/print.coffee"),t.exports=function(e){var t,n,a,o,i,s;e.group=e.g.apps[e.type.value],e.mouse={},s=e.types[e.type.value],o=s.requirements||[],n=o.indexOf("data")>=0,a=!n||n&&e.data.viz.length,!e.internal_error&&a?(t=e.format.locale.value.visualization[e.type.value],e.dev.value&&r.time("running "+t),i=s(e),e.dev.value&&r.timeEnd("running "+t)):i=null,e.returned={nodes:[],edges:null},i instanceof Array?e.returned.nodes=i:i&&(i.nodes&&(e.returned.nodes=i.nodes),i.edges&&(e.returned.edges=i.edges))}},{"../../../core/console/print.coffee":54}],224:[function(e,t){var r=e("../../../util/copy.coffee"),n=e("../../../form/form.js"),a=e("../../../core/console/print.coffee");t.exports=function(e){var t=e.ui.value&&e.ui.value.length,o=e.ui.position.value;e.dev.value&&t&&a.time("drawing custom UI elements");var i=e.container.value.selectAll("div#d3plus_drawer").data(["d3plus_drawer"]);i.enter().append("div").attr("id","d3plus_drawer");var s={};e.ui.position.accepted.forEach(function(t){s[t]=t==o?e.margin.bottom+"px":"auto"}),i.style("text-align",e.ui.align.value).style("position","absolute").style("width",e.width.value-2*e.ui.padding+"px").style("height","auto").style(s);var l=i.selectAll("div.d3plus_drawer_ui").data(t?e.ui.value:[],function(e){return e.method||!1});l.enter().append("div").attr("class","d3plus_drawer_ui").style("padding",e.ui.padding+"px").style("display","inline-block").each(function(t){var r=d3.select(this);t.form=n().container(r).focus(e[t.method].value,function(r){r!==e[t.method].value&&e.self[t.method](r).draw()}).id("id").text("text").type("auto")}),l.each(function(t){var n=[],a=e.format.locale.value.method[t.method]||t.method;t.value.forEach(function(t){var r={id:t,text:e.format.value(t)};n.push(r)});var o=r(e.ui.font);o.secondary=e.ui.font,t.form.data(n).font(o).format(e.format.locale.language).title(e.format.value(a)).ui({align:e.ui.align.value,padding:e.ui.padding,margin:0}).width(t.width||!1).draw()}),l.exit().remove();var u=i.node().offsetHeight||i.node().getBoundingClientRect().height;u&&(e.margin[o]+=u),e.dev.value&&t&&a.timeEnd("drawing custom UI elements")}},{"../../../core/console/print.coffee":54,"../../../form/form.js":97,"../../../util/copy.coffee":191}],225:[function(e,t){var r=e("../../../client/pointer.coffee"),n=e("../../../color/lighter.coffee"),a=e("../../../core/console/print.coffee"),o=e("../../../client/css.coffee");t.exports=function(e){function t(t){t.style("position","absolute").style("left",e.ui.padding+"px").style("top",e.margin.top/2-s/2+"px").style("color",l).style("font-family",u).style("font-weight",c).style("font-size",s+"px").style("z-index",2e3)}if(!e.small&&e.history.states.length>0){e.dev.value&&a.time("drawing back button");var i=e.container.value.selectAll("div#d3plus_back_button").data(["d3plus_back_button"]),s=e.title.value?e.title.font.size:e.title.sub.font.size,l=e.title.sub.value?e.title.sub.font.color:e.title.font.color,u=e.title.sub.value?e.title.sub.font.family.value:e.title.font.family.value,c=e.title.sub.value?e.title.sub.font.weight:e.title.font.weight,f=e.title.sub.value?e.title.sub.padding:e.title.padding,d=s+2*f;e.margin.top<d&&(e.margin.top=d);{i.enter().append("div").attr("id","d3plus_back_button").style("opacity",0).call(t).html(function(){if(o("font-awesome"))var t="<span style='font-family:FontAwesome;margin-right:5px;'></span>";else var t="« ";return t+e.format.value(e.format.locale.value.ui.back)})}i.on(r.over,function(){!e.small&&e.history.states.length>0&&d3.select(this).style("cursor","pointer").transition().duration(e.timing.mouseevents).style("color",n(l,.25))}).on(r.out,function(){!e.small&&e.history.states.length>0&&d3.select(this).style("cursor","auto").transition().duration(e.timing.mouseevents).style("color",l)}).on(r.click,function(){e.history.back()}).transition().duration(e.draw.timing).style("opacity",1).call(t),e.dev.value&&a.timeEnd("drawing back button")}else e.container.value.selectAll("div#d3plus_back_button").transition().duration(e.draw.timing).style("opacity",0).remove()}},{"../../../client/css.coffee":39,"../../../client/pointer.coffee":41,"../../../color/lighter.coffee":47,"../../../core/console/print.coffee":54}],226:[function(e,t){var r=e("../../../array/sort.coffee"),n=e("../../../util/buckets.coffee"),a=e("../../../util/copy.coffee"),o=e("../tooltip/create.js"),i=e("../../../core/data/nest.js"),s=e("../../../util/dataURL.coffee"),l=e("../../../client/pointer.coffee"),u=e("../../../core/fetch/value.js"),c=e("../../../core/fetch/color.coffee"),f=e("../../../core/fetch/text.js"),d=e("../../../core/console/print.coffee"),p=e("../../../tooltip/remove.coffee"),h=e("../../../color/text.coffee"),v=e("../../../util/uniques.coffee"),g=e("../../../string/strip.js"),m=e("../../../textwrap/textwrap.coffee"),y=e("../../../client/touch.coffee"),x=e("../../../object/validate.coffee");t.exports=function(e){function t(t){t.attr("transform",function(t,r){var n=B+r*(e.ui.padding+_);return"translate("+n+","+e.ui.padding+")"})}function b(t){t.attr("width",_).attr("height",_).attr("fill",function(t){d3.select(this.parentNode).selectAll("text").remove();var r=u(e,t,e.icon.value,U),n=c(e,t,U);if(r&&"null"!==r){var a=g(r+"_"+n),o=e.icon.style.value,i=e.defs.selectAll("pattern#"+a).data([a]);if("string"==typeof o)var l=e.icon.style.value;else if(x(o)&&o[U])var l=o[U];else var l="default";var n="knockout"==l?n:"none";i.select("rect").transition().duration(e.draw.timing).attr("fill",n).attr("width",_).attr("height",_),i.select("image").transition().duration(e.draw.timing).attr("width",_).attr("height",_);var d=i.enter().append("pattern").attr("id",a).attr("width",_).attr("height",_);return d.append("rect").attr("fill",n).attr("width",_).attr("height",_),d.append("image").attr("xlink:href",r).attr("width",_).attr("height",_).each(function(){0==r.indexOf("/")||r.indexOf(window.location.hostname)>=0?s(r,function(e){i.select("image").attr("xlink:href",e)}):i.select("image").attr("xlink:href",r)}),"url(#"+a+")"}var p=d3.select(this.parentNode).append("text");return p.attr("font-size",e.legend.font.size+"px").attr("font-weight",e.legend.font.weight).attr("font-family",e.legend.font.family.value).style("text-anchor","start").attr("fill",h(n)).attr("x",0).attr("y",0).each(function(t){var r=f(e,t,C);1===r.length&&r[0].length&&m().container(d3.select(this)).height(_-2*e.ui.padding).resize(e.labels.resize.value).text(r[0]).width(_-2*e.ui.padding).draw()}).attr("y",function(){var e=this.getBBox().height,t=parseFloat(d3.select(this).style("font-size"),10)/5;return _/2-e/2-t/2}).selectAll("tspan").attr("x",function(){var e=this.getComputedTextLength();return _/2-e/2}),p.select("tspan").empty()&&p.remove(),n})}var w=!0,_=0,k=e.color.value,z=e.color.value||"d3plus_color";if(!e.internal_error&&k&&!e.small&&e.legend.value)if(e.color.valueScale)if(e.color.valueScale){e.dev.value&&d.time("drawing color scale"),e.g.legend.selectAll("g.d3plus_color").transition().duration(e.draw.timing).attr("opacity",0).remove();var j=e.color.valueScale.domain(),A=e.color.valueScale.range();j.length<=2&&(j=n(j,6));var M=e.g.legend.selectAll("g.d3plus_scale").data(["scale"]);M.enter().append("g").attr("class","d3plus_scale").attr("opacity",0);var E=M.selectAll("#d3plus_legend_heatmap").data(["heatmap"]);E.enter().append("linearGradient").attr("id","d3plus_legend_heatmap").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%").attr("spreadMethod","pad");var S=E.selectAll("stop").data(d3.range(0,A.length));S.enter().append("stop").attr("stop-opacity",1),S.attr("offset",function(e){return Math.round(e/(A.length-1)*100)+"%"}).attr("stop-color",function(e){return A[e]}),S.exit().remove();var T=M.selectAll("rect#gradient").data(["gradient"]);T.enter().append("rect").attr("id","gradient").attr("x",function(){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(#d3plus_legend_heatmap)");var O=M.selectAll("text.d3plus_tick").data(d3.range(0,j.length));O.enter().append("text").attr("class","d3plus_tick").attr("x",function(){return"middle"==e.legend.align?e.width.value/2:"end"==e.legend.align?e.width.value:0}).attr("y",function(){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(j[t],k,e)}).attr("y",function(){return this.getBBox().height+e.legend.gradient.height+2*e.ui.padding}).each(function(){var e=this.offsetWidth;e>N&&(N=e)}),N+=2*e.labels.padding;var F=N*(j.length-1);if(F+N<e.width.value){if(F+N<e.width.value/2&&(F=e.width.value/2,N=F/j.length,F-=N),"start"==e.legend.align)var B=e.ui.padding;else if("end"==e.legend.align)var B=e.width.value-e.ui.padding-F;else var B=e.width.value/2-F/2;O.transition().duration(e.draw.timing).attr("x",function(e){return B+N*e}),O.exit().transition().duration(e.draw.timing).attr("opacity",0).remove();var P=M.selectAll("rect.d3plus_tick").data(d3.range(0,j.length));P.enter().append("rect").attr("class","d3plus_tick").attr("x",function(){return"middle"==e.legend.align?e.width.value/2:"end"==e.legend.align?e.width.value:0}).attr("y",e.ui.padding).attr("width",0).attr("height",e.ui.padding+e.legend.gradient.height).attr("fill",e.legend.font.color),P.transition().duration(e.draw.timing).attr("x",function(e){var t=0==e?1:0;return B+N*e-t}).attr("y",e.ui.padding).attr("width",1).attr("height",e.ui.padding+e.legend.gradient.height).attr("fill",e.legend.font.color),P.exit().transition().duration(e.draw.timing).attr("width",0).remove(),T.transition().duration(e.draw.timing).attr("x",function(){return"middle"==e.legend.align?e.width.value/2-F/2:"end"==e.legend.align?e.width.value-F-e.ui.padding:e.ui.padding}).attr("y",e.ui.padding).attr("width",F).attr("height",e.legend.gradient.height),M.transition().duration(e.draw.timing).attr("opacity",1),e.dev.value&&d.timeEnd("drawing color scale")}else w=!1}else w=!1;else{if(e.dev.value&&d.time("grouping data by colors"),e.nodes.value&&e.types[e.type.value].requirements.indexOf("nodes")>=0){var q=a(e.nodes.restriced||e.nodes.value);if(e.data.viz.length)for(var I=0;I<q.length;I++){var R=e.data.viz.filter(function(t){return t[e.id.value]===q[I][e.id.value]});R.length&&(q[I]=R[0])}}else var q=e.data.viz;var V=function(t){return c(e,t,U)},C=0,U=e.id.value;if(e.id.nesting.indexOf(z)>=0)C=e.id.nesting.indexOf(e.color.value),U=e.id.nesting[e.id.nesting.indexOf(z)];else for(var I=0;I<=e.depth.value;I++){C=I,U=e.id.nesting[I];var D=v(q,function(t){return u(e,t,U)}),L=v(q,V);if(D.length===L.length&&L.length>1)break}var A=i(e,q,[V],[]);e.dev.value&&d.timeEnd("grouping data by color");var Y=e.width.value;_=e.legend.size;var F=_*A.length+e.ui.padding*(A.length+1);if(_ instanceof Array){e.dev.value&&d.time("calculating legend size");for(var I=_[1];I>=_[0];I--)if(F=I*A.length+e.ui.padding*(A.length+1),Y>=F){_=I;break}e.dev.value&&d.timeEnd("calculating legend size")}else"number"!=typeof _&&_!==!1&&(_=30);if(F>Y||1==A.length)w=!1;else{F-=2*e.ui.padding,e.dev.value&&d.time("sorting legend");var H=e[e.legend.order.value].value;if(r(A,H,e.legend.order.sort.value,z,e,C),e.dev.value&&d.timeEnd("sorting legend"),e.dev.value&&d.time("drawing legend"),"start"==e.legend.align)var B=e.ui.padding;else if("end"==e.legend.align)var B=Y-e.ui.padding-F;else var B=Y/2-F/2;e.g.legend.selectAll("g.d3plus_scale").transition().duration(e.draw.timing).attr("opacity",0).remove();var W=e.g.legend.selectAll("g.d3plus_color").data(A,function(t){var r=c(e,t,U),n=u(e,t,z);return r+n}),X=W.enter().append("g").attr("class","d3plus_color").attr("opacity",0).call(t);X.append("rect").attr("class","d3plus_color").call(b),y||W.on(l.over,function(t,r){d3.select(this).style("cursor","pointer");var n=B+r*(e.ui.padding+_),a=d3.transform(d3.select(this.parentNode).attr("transform")).translate[1];n+=_/2,a+=e.ui.padding+_/2;var i=e.id.nesting.indexOf(U),s=i>=0?f(e,t,i)[0]:e.format.value(u(e,t,z,U),z,e,t);o({data:t,footer:!1,vars:e,x:n,y:a,title:s,offset:.4*_})}).on(l.out,function(){p(e.type.value)}),W.order().transition().duration(e.draw.timing).attr("opacity",1).call(t),W.selectAll("rect.d3plus_color").transition().duration(e.draw.timing).call(b),W.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),e.dev.value&&d.timeEnd("drawing legend")}}else w=!1;if(e.legend.value&&k&&w){if(e.dev.value&&d.time("positioning legend"),_)var G=_+e.ui.padding;else var Q=e.g.legend.node().getBBox(),G=Q.height+Q.y-e.ui.padding;0===e.margin.bottom&&(e.margin.bottom+=e.ui.padding),e.margin.bottom+=G,e.g.legend.transition().duration(e.draw.timing).attr("transform","translate(0,"+(e.height.value-e.margin.bottom)+")"),e.dev.value&&d.timeEnd("positioning legend")}else e.dev.value&&d.time("hiding legend"),e.g.legend.transition().duration(e.draw.timing).attr("transform","translate(0,"+e.height.value+")"),e.dev.value&&d.timeEnd("hiding legend")}},{"../../../array/sort.coffee":37,"../../../client/pointer.coffee":41,"../../../client/touch.coffee":45,"../../../color/text.coffee":52,"../../../core/console/print.coffee":54,"../../../core/data/nest.js":62,"../../../core/fetch/color.coffee":64,"../../../core/fetch/text.js":67,"../../../core/fetch/value.js":68,"../../../object/validate.coffee":162,"../../../string/strip.js":165,"../../../textwrap/textwrap.coffee":184,"../../../tooltip/remove.coffee":187,"../../../util/buckets.coffee":188,"../../../util/copy.coffee":191,"../../../util/dataURL.coffee":193,"../../../util/uniques.coffee":194,"../tooltip/create.js":221}],227:[function(e,t){t.exports=function(e,t){function r(t){t.style(a).style("position","absolute").style("background",i).style("text-align","center").style("left",function(){return"center"==o?"50%":"0px"}).style("width",function(){return"center"==o?"auto":e.width.value+"px"}).style("margin-left",function(){var t=e.width.value-e.width.viz;return"center"==o?-(this.offsetWidth/2+t/2)+"px":"0px"}).style("top",function(){return"center"==o?"50%":"top"==o?"0px":"auto"}).style("bottom",function(){return"bottom"==o?"0px":"auto"}).style("margin-top",function(){if("large"==n){var e=this.offsetHeight||this.getBoundingClientRect().height;return-e/2+"px"}return"0px"})}var t=e.messages.value?t:null,n=t==e.internal_error?"large":e.messages.style;if("large"==n)var a=e.messages,o="center";else{if(e.footer.value)var a=e.footer;else if(e.title.value)var a=e.title;else if(e.title.sub.value)var a=e.title.sub;else if(e.title.total.value)var a=e.title.total;else var a=e.title.sub;var o=a.position}var a={color:a.font.color,"font-family":a.font.family.value,"font-weight":a.font.weight,"font-size":a.font.size+"px",padding:a.padding+"px"},i="none"!=e.background.value?e.background.value:"white";e.g.message=e.container.value.selectAll("div#d3plus_message").data(["message"]),e.g.message.enter().append("div").attr("id","d3plus_message").attr("opacity",0);var s=t?1:0,l=t?t:e.g.message.text(),u=t?"inline-block":"none";e.g.message.text(l).style("display",u).call(r).transition().duration(e.draw.timing).style("opacity",s)}},{}],228:[function(e,t){var r=e("../../../util/closest.coffee"),n=e("../../../font/sizes.coffee"),a=e("../../../client/pointer.coffee"),o=e("../../../client/prefix.coffee"),i=e("../../../core/console/print.coffee"),s=e("../../../color/text.coffee");t.exports=function(e){if((!e.internal_error||!e.data.missing)&&!e.small&&e.data.time&&e.data.time.values.length>1&&e.timeline.value){var t=[];e.data.time.values.forEach(function(e){t.push(new Date(e))}),e.dev.value&&i.time("drawing timeline");var l=e.time.format.value||e.data.time.format,u=e.time.format.value||e.data.time.multiFormat;if(e.time.value==e.x.value&&"discrete"==e.x.scale.value||e.time.value==e.y.value&&"discrete"==e.y.scale.value)var c=2;else var c=1;if(e.time.solo.value.length){for(var f=d3.extent(e.time.solo.value),d=0;d<f.length;d++)if(f[d].constructor!==Date){var p=new Date(f[d].toString());p.setTime(p.getTime()+60*p.getTimezoneOffset()*1e3),f[d]=p}}else var f=d3.extent(t);var h=t[0],v=new Date(f[0]),g=new Date(f[1]);t=e.data.time.ticks;var m=t.slice(),p=new Date(h);p["set"+e.data.time.stepType](p["get"+e.data.time.stepType]()+t.length),m.push(p),g["set"+e.data.time.stepType](g["get"+e.data.time.stepType]()+1),v=r(m,v),g=r(m,g);for(var y=m.slice(0),d=0;d<y.length;d++)y[d]=y[d].getTime();var x=y.indexOf(v.getTime()),b=y.indexOf(g.getTime()),w=function(){if(null!==d3.event.sourceEvent){F=U.extent();var e=r(m,F[0]),n=r(m,F[1]);if(e===n&&(x=y.indexOf(e.getTime()),e<F[0]||0===x?n=m[x+1]:e=m[x-1]),x=y.indexOf(e.getTime()),b=y.indexOf(n.getTime()),b-x>=c)var a=[e,n];else if(x+c<=t.length)var a=[e,m[x+c]];else{for(var a=[e],o=1;c>=o;o++)x+o<=t.length?a.push(m[x+o]):a.unshift(m[x-(x+o-t.length)]);a=[a[0],a[a.length-1]]}F=a,V.attr("fill",B),d3.select(this).call(U.extent(a))}},_=function(){if(null!==d3.event.sourceEvent){if(e.time.solo.value.length)var n=d3.extent(e.time.solo.value),a=y.indexOf(r(m,n[0]).getTime()),o=y.indexOf(r(m,n[1]).getTime())+1,i=a!==x||o!==b;else var i=b-x!==t.length;if(i){if(b-x==t.length)var s=[];else var s=d3.range(x,b).map(function(r){var n=e.data.time.dataSteps.indexOf(r);return n>=0?e.data.time.values[n]:t[r]});e.self.time({solo:s}).draw()}}},k={"font-weight":e.ui.font.weight,"font-family":e.ui.font.family.value,"font-size":e.ui.font.size+"px","text-anchor":"middle"},z=function(e,r){return 0===r||r===t.length-1?l(e):u(e)},j=n(t.map(z),k),A=j.map(function(e){return e.width}),M=Math.ceil(d3.max(A)),E=d3.max(j.map(function(e){return e.height})),S=M+2*e.ui.padding,T=E+2*e.ui.padding;timelineWidth=S*t.length,availableWidth=e.width.value-2*e.ui.padding,tickStep=1,textRotate=0,timelineWidth>availableWidth&&(S=E+2*e.ui.padding,T=M+2*e.ui.padding,timelineWidth=S*t.length,textRotate=90),T=d3.max([T,e.timeline.height.value]);var O=S;if(timelineWidth>availableWidth&&(timelineWidth=availableWidth,O=S-2*e.ui.padding,S=timelineWidth/t.length,O>S))for(tickStep=Math.ceil(O/(timelineWidth/t.length));tickStep<t.length-1&&(t.length-1)%tickStep!=0;tickStep++);if("start"==e.timeline.align)var N=e.ui.padding;else if("end"==e.timeline.align)var N=e.width.value-e.ui.padding-timelineWidth;else var N=e.width.value/2-timelineWidth/2;var F=[v,g],B=function(t){if(t>=F[0]&&t<F[1])var r=1,n=s(e.ui.color.primary.value);else var r=.5,n=s(e.ui.color.secondary.value);var n=d3.rgb(n);return"rgba("+n.r+","+n.g+","+n.b+","+r+")"},P=e.g.timeline.selectAll("rect.d3plus_timeline_background").data(["background"]);P.enter().append("rect").attr("class","d3plus_timeline_background").attr("shape-rendering","crispEdges").attr("width",timelineWidth+2).attr("height",T+2).attr("fill",e.ui.color.secondary.value).attr("x",N-1).attr("y",e.ui.padding),P.transition().duration(e.draw.timing).attr("width",timelineWidth+2).attr("height",T+2).attr("fill",e.ui.color.secondary.value).attr("x",N-1).attr("y",e.ui.padding);var q=e.g.timeline.selectAll("g#ticks").data(["ticks"]);q.enter().append("g").attr("id","ticks").attr("transform","translate("+e.width.value/2+","+e.ui.padding+")");var I=e.g.timeline.selectAll("g#brush").data(["brush"]);I.enter().append("g").attr("id","brush");var R=e.g.timeline.selectAll("g#labels").data(["labels"]);R.enter().append("g").attr("id","labels");var V=R.selectAll("text").data(t,function(e,t){return t});V.enter().append("text").attr("y",0).attr("dy","0.5ex").attr("x",0),V.order().attr(k).text(function(r,n){if(0===n||n===t.length-1)return l(r);{var a=(n-1)%tickStep===0,o=(n+1)%tickStep===0,i=e.data.time.dataSteps.indexOf(n)>=0;A[n-1]/2+A[n]+A[n+1]/2+4*e.ui.padding<2*S}return n%tickStep===0||!a&&!o&&i&&3*S>O?u(r):""}).attr("opacity",function(t,r){return e.data.time.dataSteps.indexOf(r)>=0?1:.4}).attr("fill",B).attr("transform",function(t,r){var n=N+S*r+S/2,a=T/2+e.ui.padding+1;return"translate("+Math.round(n)+","+Math.round(a)+")rotate("+textRotate+")"}),V.exit().transition().duration(e.draw.timing).attr("opacity",0).remove();var C=d3.time.scale().domain(d3.extent(m)).rangeRound([0,timelineWidth]),U=d3.svg.brush().x(C).extent(F).on("brush",w).on("brushend",_);if(q.attr("transform","translate("+N+","+e.ui.padding+")").transition().duration(e.draw.timing).call(d3.svg.axis().scale(C).orient("top").ticks(function(){return m}).tickFormat("").tickSize(-T).tickPadding(0)).selectAll("path").attr("fill","none"),q.selectAll("line").attr("stroke",e.timeline.tick).attr("stroke-width",1).attr("shape-rendering","crispEdges"),I.attr("transform","translate("+N+","+(e.ui.padding+1)+")").attr("opacity",1).call(U),V.attr("pointer-events","none"),I.selectAll("rect.background").attr("fill","none").style("visibility","visible").attr("height",T).attr("shape-rendering","crispEdges").on(a.move,function(){var t=e.timeline.hover.value;["grab","grabbing"].indexOf(t)>=0&&(t=o()+t),d3.select(this).style("cursor",t)}),I.selectAll("rect.extent").attr("height",T).attr("fill",e.ui.color.primary.value).attr("shape-rendering","crispEdges").on(a.move,function(){var t=e.timeline.hover.value;["grab","grabbing"].indexOf(t)>=0&&(t=o()+t),d3.select(this).style("cursor",t)}),e.timeline.handles.value){var D=I.selectAll("g.resize").selectAll("rect.d3plus_handle").data(["d3plus_handle"]);D.enter().insert("rect","rect").attr("class","d3plus_handle"),D.attr("fill",e.timeline.handles.color).attr("transform",function(){var t="resize e"===this.parentNode.className.baseVal?-e.timeline.handles.size:0;return"translate("+t+",0)"}).attr("width",e.timeline.handles.size).style("visibility","visible").attr("shape-rendering","crispEdges").attr("opacity",e.timeline.handles.opacity).on(a.over,function(){d3.select(this).select("rect").transition().duration(e.timing.mouseevents).attr("fill",e.timeline.handles.hover)}).on(a.out,function(){d3.select(this).select("rect").transition().duration(e.timing.mouseevents).attr("fill",e.timeline.handles.color)}),I.selectAll("g.resize").selectAll("rect").attr("height",T)}else I.selectAll("g.resize").remove();0===e.margin.bottom&&(e.margin.bottom+=e.ui.padding);var L=e.g.timeline.node().getBBox();e.margin.bottom+=L.height+L.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&&i.time("drawing timeline")}else e.g.timeline.transition().duration(e.draw.timing).attr("transform","translate(0,"+e.height.value+")")}},{"../../../client/pointer.coffee":41,"../../../client/prefix.coffee":42,"../../../color/text.coffee":52,"../../../core/console/print.coffee":54,"../../../font/sizes.coffee":95,"../../../util/closest.coffee":190}],229:[function(e,t){var r=e("../../../client/pointer.coffee"),n=e("../../../core/fetch/value.js"),a=e("../../../core/console/print.coffee"),o=e("../../../client/rtl.coffee"),i=e("../../../textwrap/textwrap.coffee");t.exports=function(e){function t(t){t.style("text-anchor",function(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":void 0}).attr("x",function(t){var r=t.style.font.align;return"center"==r?e.width.value/2:"left"==r&&!o||"right"==r&&o?e.padding:"left"==r&&o||"right"==r&&!o?e.width.value-e.padding:void 0}).attr("y",0)}function s(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})}var l=e.size.value?e.size.value:"number"===e.color.type?e.color.value:!1;if(e.data.viz&&e.title.total.value&&!e.small)if(l){if(e.dev.value&&a.time("calculating total value"),e.focus.value.length){var u=e.data.viz.filter(function(t){return t[e.id.value]==e.focus.value[0]
});u=d3.sum(u,function(t){return n(e,t,l)})}else var u=d3.sum(e.data.pool,function(t){return n(e,t,l)});if(0===u&&(u=!1),"number"==typeof u){var c="";if(e.data.mute.length||e.data.solo.length||e.focus.value.length){var f=d3.sum(e.data.value,function(t){if(e.time.solo.value.length>0)var r=e.time.solo.value.indexOf(n(e,t,e.time.value))>=0;else if(e.time.mute.value.length>0)var r=e.time.solo.value.indexOf(n(e,t,e.time.value))<0;else var r=!0;return r?n(e,t,l):void 0});if(f>u)var c=u/f*100,d=e.format.value(f,e.size.value,e),c=" ("+e.format.value(c,"share")+"% of "+d+", vars)"}u=e.format.value(u,e.size.value,e);var p=e.title.total.value,h=p.prefix||e.format.value(e.format.locale.value.ui.total)+": ";u=h+u,p.suffix?u+=p.suffix:null,u+=c}e.dev.value&&a.timeEnd("calculating total value")}else var u=!1;else var u=!1;var v=[];e.footer.value&&v.push({link:e.footer.link,style:e.footer,type:"footer",value:e.footer.value}),e.small||(e.title.value&&v.push({link:e.title.link,style:e.title,type:"title",value:e.title.value}),e.title.sub.value&&v.push({link:e.title.sub.link,style:e.title.sub,type:"sub",value:e.title.sub.value}),e.title.total.value&&u&&v.push({link:e.title.total.link,style:e.title.total,type:"total",value:u})),e.dev.value&&a.time("drawing titles");var g=e.svg.selectAll("g.d3plus_title").data(v,function(e){return e.type}),m=e.title.width||e.width.value;g.enter().append("g").attr("class","d3plus_title").attr("opacity",0).attr("transform",function(t){var r="top"==t.style.position?0:e.height.value;return"translate(0,"+r+")"}).append("text").call(t).call(s),g.each(function(t){i().container(d3.select(this).select("text")).height(e.height.value/8).size(!1).text(t.value).width(m).draw(),t.y=e.margin[t.style.position],e.margin[t.style.position]+=this.getBBox().height+2*t.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(t){t.link&&d3.select(this).transition().duration(e.timing.mouseevents).style("cursor","auto").select("text").call(s)}).on(r.click,function(e){if(e.link){var t="/"!=e.link.charAt(0)?"_blank":"_self";window.open(e.link,t)}}).transition().duration(e.draw.timing).attr("opacity",1).attr("transform",function(t){var r=t.style.position,n="top"==r?0+t.y:e.height.value-t.y;return"bottom"==r?n-=this.getBBox().height+t.style.padding:n+=t.style.padding,"translate(0,"+n+")"}).select("text").call(t).call(s),g.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 y=e.title.height;y&&e.margin[e.title.position]<y&&(e.margin[e.title.position]=y),e.dev.value&&a.timeEnd("drawing titles")}},{"../../../client/pointer.coffee":41,"../../../client/rtl.coffee":43,"../../../core/console/print.coffee":54,"../../../core/fetch/value.js":68,"../../../textwrap/textwrap.coffee":184}],230:[function(e,t){var r=e("./transform.coffee");t.exports=function(e,t,n){if(!t)var t=e.zoom.bounds;if("number"!=typeof n)var n=e.timing.transitions;e.zoom.size={height:t[1][1]-t[0][1],width:t[1][0]-t[0][0]};var a=e.coords.fit.value;if("auto"==a||e.types[e.type.value].requirements.indexOf("coords")<0)var o=d3.max([e.zoom.size.width/e.width.viz,e.zoom.size.height/e.height.viz]);else var o=e.zoom.size[a]/e["app_"+a];var i=d3.min([e.width.viz,e.height.viz]),s=e.types[e.type.value].zoom?2*e.coords.padding:0,l=(i-s)/i/o,u=e.zoom.behavior.scaleExtent();(u[0]==u[1]||t==e.zoom.bounds)&&e.zoom.behavior.scaleExtent([l,16*l]);var c=e.zoom.behavior.scaleExtent()[1];l>c&&(l=c),e.zoom.scale=l;var f=[];f[0]=e.width.viz/2-e.zoom.size.width*l/2-t[0][0]*l,f[1]=e.height.viz/2-e.zoom.size.height*l/2-t[0][1]*l,e.zoom.translate=f,e.zoom.behavior.translate(f).scale(l),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]},r(e,n)}},{"./transform.coffee":235}],231:[function(e,t){t.exports=function(e,t){var r,n,a;return n=t.id.nesting.length-1,r=t.depth.value,a=t.types[t.type.value].nesting===!1,a?0:e.d3plus.merged||n>r&&(!e||t.id.nesting[t.depth.value+1]in e)?1:r!==n&&(!e||t.id.nesting[t.depth.value+1]in e)||!t.small&&t.tooltip.html.value?0:-1}},{}],232:[function(e,t){var r=e("../../../core/console/print.coffee");t.exports=function(e){var t=e.zoom.behavior.scaleExtent()[1];e.dev.value&&r.time("determining label visibility"),e.draw.timing?e.g.viz.selectAll("text.d3plus_label").transition().duration(e.draw.timing).attr("opacity",function(r){if(!r)var r={scale:t};var n=parseFloat(d3.select(this).attr("font-size"),10);return r.visible=n/r.scale*e.zoom.scale>=7,r.visible?1:0}):e.g.viz.selectAll("text.d3plus_label").attr("opacity",function(r){if(!r)var r={scale:t};var n=parseFloat(d3.select(this).attr("font-size"),10);return r.visible=n/r.scale*e.zoom.scale>=7,r.visible?1:0}),e.dev.value&&r.timeEnd("determining label visibility")}},{"../../../core/console/print.coffee":54}],233:[function(e,t){var r,n;r=e("./labels.js"),n=e("./transform.coffee"),t.exports=function(e){var t,a,o,i,s,l,u,c,f,d;return i=d3.event.translate,o=d3.event.scale,a=e.zoom.bounds,u=(e.width.viz-e.zoom.size.width*o)/2,l=u>0?u:0,s=u>0?e.width.viz-u:e.width.viz,d=(e.height.viz-e.zoom.size.height*o)/2,f=d>0?d:0,c=d>0?e.height.viz-d:e.height.viz,i[0]+a[0][0]*o>l?i[0]=-a[0][0]*o+l:i[0]+a[1][0]*o<s&&(i[0]=s-a[1][0]*o),i[1]+a[0][1]*o>f?i[1]=-a[0][1]*o+f:i[1]+a[1][1]*o<c&&(i[1]=c-a[1][1]*o),e.zoom.behavior.translate(i).scale(o),e.zoom.translate=i,e.zoom.scale=o,"wheel"===d3.event.sourceEvent.type?(t=e.draw.timing?100:250,clearTimeout(e.zoom.wheel),e.zoom.wheel=setTimeout(function(){return r(e)},t)):r(e),"dblclick"===d3.event.sourceEvent.type?n(e,e.timing.transitions):n(e,0)}},{"./labels.js":232,"./transform.coffee":235}],234:[function(e,t){t.exports=function(e,t){var r,n,a,o;n=e.zoom,t||(t=d3.event),o=n.scale>n.behavior.scaleExtent()[0],r=e.types[e.type.value].zoom&&n.value&&n.scroll.value,a=t.touches&&t.touches.length>1&&r,a||o||t.stopPropagation()}},{}],235:[function(e,t){t.exports=function(e,t){var r,n;"number"!=typeof t&&(t=e.timing.transitions),n=e.zoom.translate,r=e.zoom.scale,t?e.g.viz.transition().duration(t).attr("transform","translate("+n+")scale("+r+")"):e.g.viz.attr("transform","translate("+n+")scale("+r+")")}},{}],236:[function(e,t){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":76}],237:[function(e,t){t.exports={accepted:[Object],deprecated:"nesting_aggs",objectAccess:!1,value:{}}},{}],238:[function(e,t){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},process:r,value:!1}},{"../../core/methods/process/data.coffee":82}],239:[function(e,t){var r;r=e("../../core/methods/rendering.coffee"),t.exports={background:{color:"#fafafa",rendering:r(),stroke:{color:"#ccc",width:1}},mirror:{accepted:[Boolean],deprecates:["mirror_axis","mirror_axes"],value:!1}}},{"../../core/methods/rendering.coffee":86}],240:[function(e,t){t.exports={accepted:[String],value:"#ffffff"}},{}],241:[function(e,t){var r,n;r=e("../../core/methods/filter.coffee"),n=e("../../color/scale.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],deprecates:"color_var",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?n:"string"==typeof e?d3.scale[e]():e},value:"d3plus"},solo:r(!0),secondary:"#e5b3bb",value:!1}},{"../../color/scale.coffee":50,"../../core/methods/filter.coffee":76}],242:[function(e,t){t.exports={accepted:[Array,Function,String],index:{accepted:[Boolean],value:!0},process:function(e){return"string"==typeof e&&(e=[e]),e},value:!1}},{}],243:[function(e,t){var r;r=e("../../util/d3selection.coffee"),t.exports={accepted:[!1,Array,Object,String],id:"default",process:function(e){return e===!1?!1:r(e)?e:d3.select(e instanceof Array?e[0][0]:e)},value:!1}},{"../../util/d3selection.coffee":192}],244:[function(e,t){var r,n;r=e("../../core/methods/filter.coffee"),n=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"},mute:r(!1),padding:20,process:n,projection:{accepted:["mercator","equirectangular"],value:"mercator"},solo:r(!1),threshold:.1,value:!1}},{"../../core/methods/filter.coffee":76,"../../core/methods/process/data.coffee":82}],245:[function(e,t){var r,n,a;r=e("../../core/fetch/value.js"),n=e("../../client/ie.js"),a=e("../../string/strip.js"),t.exports={accepted:[void 0,Array,String],chainable:!1,data:[],process:function(e,t){var o,i,s,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,j,A;if(void 0===t.returned)return[];for(e=e||t.cols.value,e instanceof Array?l=e:"string"==typeof e&&(l=[e]),c=[],m=[],g=a(t.title.value||"My D3plus App Data"),l||(l=[t.id.value],t.time.value&&l.push(t.time.value),t.size.value&&l.push(t.size.value),t.text.value&&l.push(t.text.value)),y=0,_=l.length;_>y;y++)s=l[y],m.push(t.format.value(s));for(c.push(m),A=t.returned.nodes.forEach,x=0,k=A.length;k>x;x++){for(v=A[x],o=[],b=0,z=l.length;z>b;b++)s=l[b],o.push(r(t,v,s));c.push(o)}for(u="data:text/csv;charset=utf-8,",p=w=0,j=c.length;j>w;p=++w)s=c[p],f=s.join(","),u+=p<c.length?f+"\n":f;return n?(i=new Blob([u],{type:"text/csv;charset=utf-8;"}),navigator.msSaveBlob(i,g+".csv")):(d=encodeURI(u),h=document.createElement("a"),h.setAttribute("href",d),h.setAttribute("download",g+".csv"),h.click()),this.data=c,l},value:void 0}},{"../../client/ie.js":40,"../../core/fetch/value.js":68,"../../string/strip.js":165}],246:[function(e,t){var r=e("../../core/methods/process/data.coffee");t.exports={accepted:[!1,Array,Function,String],cache:{},delimiter:{accepted:[String],value:"|"},donut:{size:.35},filetype:{accepted:[!1,"json","xml","html","csv","dsv","tsv","txt"],value:!1},filters:[],mute:[],large:400,opacity:.9,process:function(e,t){return"default"===t.container.id&&e.length&&t.self.container({id:"default"+e.length}),r(e,t,this)},solo:[],stroke:{width:1},value:!1}},{"../../core/methods/process/data.coffee":82}],247:[function(e,t){t.exports={accepted:[Function,Number],value:0}},{}],248:[function(e,t){t.exports={accepted:[!1,Function,Object],value:!1}},{}],249:[function(e,t){t.exports={accepted:[Boolean],value:!1}},{}],250:[function(e,t){var r=e("../../core/console/print.coffee"),n=e("../../string/format.js");t.exports={accepted:[void 0,Function],first:!0,frozen:!1,process:function(e,t){if(this.initialized===!1)return this.initialized=!0,e;if(void 0===e&&"function"==typeof this.value&&(e=this.value),t.container.value===!1){var a=t.format.locale.value.dev.setContainer;r.warning(a,"container")}else if(t.container.value.empty()){var a=t.format.locale.value.dev.noContainer;r.warning(n(a,'"'+t.container.value+'"'),"container")}else t.dev.value&&(t.methodGroup&&(t.methodGroup="wait",r.groupEnd()),r.time("total draw time")),t.container.value.call(t.self);if("function"==typeof e&&t.history.chain.length){var o={};changes.forEach(function(e){var t=e.method;delete e.method,o[t]=e}),e(o),t.history.chain=[]}return e},update:!0,value:void 0}},{"../../core/console/print.coffee":54,"../../string/format.js":163}],251:[function(e,t){var r=e("../../core/methods/process/data.coffee");t.exports={accepted:[!1,Array,Function,String],arrows:{accepted:[Boolean,Number],direction:{accepted:["source","target"],value:"target"},value:!1},color:"#d0d0d0",connections:function(e,t,r){var n=this;if(!n.value)return[];if(!t)var t="id";var a=n.restricted||n.value,o=[];if(!e)return a;var i=a.filter(function(a){var i=!1;return a[n.source][t]==e?(i=!0,r&&o.push(a[n.target])):a[n.target][t]==e&&(i=!0,r&&o.push(a[n.source])),i});return r?o:i},delimiter:{accepted:[String],value:"|"},filetype:{accepted:[!1,"json","xml","html","csv","dsv","tsv","txt"],value:!1},interpolate:{accepted:["basis","cardinal","linear","monotone","step"],value:"basis"},label:!1,large:100,limit:{accepted:[!1,Function,Number],value:!1},opacity:1,process:r,size:!1,source:"source",strength:{accepted:[!1,Function,Number,String],value:!1},target:"target",value:!1,width:1}},{"../../core/methods/process/data.coffee":82}],252:[function(e,t){t.exports={accepted:[Boolean,String],value:!1}},{}],253:[function(e,t){t.exports={accepted:[!1,Array,Function,Number,String],deprecates:"highlight",process:function(e){return e===!1?[]:e instanceof Array?e:[e]},tooltip:{accepted:[Boolean],value:!0},value:[]}},{}],254:[function(e,t){var r,n,a,o;r=e("../../core/methods/font/align.coffee"),n=e("../../core/methods/font/decoration.coffee"),a=e("../../core/methods/font/family.coffee"),o=e("../../core/methods/font/transform.coffee"),t.exports={align:r(),color:"#444444",decoration:n(),family:a(),secondary:{align:r(),color:"#444444",decoration:n(),family:a(),size:12,spacing:0,transform:o(),weight:200},size:12,spacing:0,transform:o(),weight:200}},{"../../core/methods/font/align.coffee":77,"../../core/methods/font/decoration.coffee":78,"../../core/methods/font/family.coffee":79,"../../core/methods/font/transform.coffee":81}],255:[function(e,t){var r,n,a;n=e("../../core/methods/font/family.coffee"),r=e("../../core/methods/font/decoration.coffee"),a=e("../../core/methods/font/transform.coffee"),t.exports={accepted:[!1,Number,String],font:{align:"center",color:"#444",decoration:r(),family:n(),size:11,transform:a(),weight:200},link:!1,padding:0,position:"bottom",value:!1}},{"../../core/methods/font/decoration.coffee":78,"../../core/methods/font/family.coffee":79,"../../core/methods/font/transform.coffee":81}],256:[function(e,t){var r,n,a,o;r=e("../../number/format.js"),n=e("../../core/locale/locale.coffee"),a=e("../../object/merge.coffee"),o=e("../../string/title.coffee"),t.exports={accepted:[Function,String],deprecates:["number_format","text_format"],locale:{accepted:function(){return d3.keys(n)},process:function(e){var t,r;return t="en_US",r=n[t],e!==t&&(r=a(r,n[e])),this.language=e,r},value:"en_US"},number:{accepted:[!1,Function],value:!1},process:function(e,t){if("string"==typeof e)t.self.format({locale:e});else if("function"==typeof e)return e;return this.value},text:{accepted:[!1,Function],value:!1},value:function(e,t,n,a){var i,s;return n||(n={}),n.time&&n.time.value&&t===n.time.value?(i=n.time.format.value||n.data.time.format,s=e.constructor===Date?e:new Date(e),i(s)):"number"==typeof e?(i=this.number.value||r)(e,t,n,a):"string"==typeof e?(i=this.text.value||o)(e,t,n,a):JSON.stringify(e)}}},{"../../core/locale/locale.coffee":74,"../../number/format.js":160,"../../object/merge.coffee":161,"../../string/title.coffee":166}],257:[function(e,t){t.exports={accepted:[!1,Number],max:600,secondary:!1,small:200,value:!1}},{}],258:[function(e,t){var r,n,a,o,i,s,l;r=e("../../../core/methods/font/align.coffee"),n=e("../../../core/methods/font/decoration.coffee"),a=e("../../../core/methods/font/family.coffee"),o=e("../../../core/methods/filter.coffee"),i=e("../../../core/methods/font/position.coffee"),s=e("../../../core/methods/rendering.coffee"),l=e("../../../core/methods/font/transform.coffee"),t.exports=function(e){return{accepted:[Array,Boolean,Function,Object,String],axis:{color:"#444",font:{color:"#444",decoration:n(),family:a(),size:10,transform:l(),weight:200},rendering:s()},dataFilter:!0,deprecates:[e+"axis",e+"axis_val",e+"axis_var"],domain:{accepted:[!1,Array],value:!1},grid:{color:"#ccc",rendering:s()},label:{color:"#444",decoration:n(),family:a(),size:12,transform:l(),weight:200},lines:{accept:[!1,Array,Number,Object],dasharray:{accepted:[Array,String],process:function(e){return e instanceof Array&&(e=e.filter(function(e){return!isNaN(e)}),e=e.length?e.join(", "):"none"),e},value:"10, 10"},color:"#888",font:{align:r("right"),color:"#444",background:{accepted:[Boolean],value:!0},decoration:n(),family:a(),padding:{accepted:[Number],value:10},position:i("middle"),size:12,transform:l(),weight:200},process:Array,rendering:s(),width:1,value:[]},mouse:{accept:[Boolean],dasharray:{accepted:[Array,String],process:function(e){return e instanceof Array&&(e=e.filter(function(e){return!isNaN(e)}),e=e.length?e.join(", "):"none"),e},value:"none"},rendering:s(),width:2,value:!0},mute:o(!0),range:{accepted:[!1,Array],value:!1},scale:{accepted:["linear","log","discrete","share"],deprecates:["layout","unique_axis",e+"axis_scale"],process:function(t,r){var n,a,o,i;for(i=["log","discrete","share"],a=0,o=i.length;o>a;a++)n=i[a],n===t?r.axes[n]=e:r.axes[n]===e&&(r.axes[n]=!1);return"discrete"===t&&(r.axes.opposite="x"===e?"y":"x"),t},value:"linear"},solo:o(!0),stacked:{accepted:[Boolean],process:function(t,r){return t||r.axes.stacked!==e?t&&(r.axes.stacked=e):r.axes.stacked=!1,t},value:!1},ticks:{color:"#ccc",font:{color:"#666",decoration:n(),family:a(),size:10,transform:l(),weight:200},rendering:s(),size:10,width:1},value:!1,zerofill:{accepted:[Boolean],value:!1}}}},{"../../../core/methods/filter.coffee":76,"../../../core/methods/font/align.coffee":77,"../../../core/methods/font/decoration.coffee":78,"../../../core/methods/font/family.coffee":79,"../../../core/methods/font/position.coffee":80,"../../../core/methods/font/transform.coffee":81,"../../../core/methods/rendering.coffee":86}],259:[function(e,t){t.exports={accepted:[Boolean],back:function(){this.states.length&&this.states.pop()()},chain:[],states:[],value:!0}},{}],260:[function(e,t){var r;r=e("../../core/methods/process/icon.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],back:{accepted:[!1,String],fallback:"❮",opacity:1,process:r,rotate:0,value:"fa-angle-left"},deprecates:"icon_var",style:{accepted:[Object,String],deprecates:"icon_style",value:"default"},value:"icon"}},{"../../core/methods/process/icon.coffee":84}],261:[function(e,t){var r;r=e("../../core/methods/filter.coffee"),t.exports={accepted:[Array,String],dataFilter:!0,deprecates:["id_var","nesting"],mute:r(!0),nesting:["id"],solo:r(!0),value:"id"}},{"../../core/methods/filter.coffee":76}],262:[function(e,t){var r,n,a;r=e("../../core/methods/font/decoration.coffee"),n=e("../../core/methods/font/family.coffee"),a=e("../../core/methods/font/transform.coffee"),t.exports={accepted:[Boolean],align:"middle",font:{decoration:r(),family:n(),size:11,transform:a(),weight:200},padding:7,resize:{accepted:[Boolean],value:!0},segments:2,value:!0}},{"../../core/methods/font/decoration.coffee":78,"../../core/methods/font/family.coffee":79,"../../core/methods/font/transform.coffee":81}],263:[function(e,t){var r;r=e("../../core/methods/font/family.coffee"),t.exports={accepted:[Boolean],align:"middle",font:{align:"middle",color:"#444444",family:r(),size:10,weight:200},gradient:{height:10},order:{accepted:["color","id","size","text"],sort:{accepted:["asc","desc"],value:"asc"},value:"color"},size:[8,30],value:!0}},{"../../core/methods/font/family.coffee":79}],264:[function(e,t){var r,n,a;r=e("../../core/methods/font/decoration.coffee"),n=e("../../core/methods/font/family.coffee"),a=e("../../core/methods/font/transform.coffee"),t.exports={font:{color:"#444444",decoration:r(),family:n(),transform:a(),weight:200},hover:{color:"#444444",decoration:r(),family:n(),transform:a(),weight:200}}},{"../../core/methods/font/decoration.coffee":78,"../../core/methods/font/family.coffee":79,"../../core/methods/font/transform.coffee":81}],265:[function(e,t){t.exports={accepted:[Number,Object,String],process:function(e){var t,r,n,a,o,i,s,l,u,c,f,d,p,h;if(n=this,i=["top","right","bottom","left"],void 0===e&&(e=n.value),s=e,"string"==typeof e){for(e=e.split(" "),t=u=0,d=e.length;d>u;t=++u)l=e[t],e[t]=parseFloat(l,10);e=1===e.length?e[0]:2===e.length?{top:e[0],right:e[1],bottom:e[0],left:e[1]}:3===e.length?{top:e[0],right:e[1],bottom:e[2],left:e[1]}:4===e.length?{top:e[0],right:e[1],bottom:e[2],left:e[3]}:0}if("number"==typeof e)for(c=0,p=i.length;p>c;c++)a=i[c],n[a]=e;else{for(a in e)o=i.indexOf(a),o>=0&&(i.splice(o,1),n[a]=e[a]);for(f=0,h=i.length;h>f;f++)r=i[f],n[r]=0}return s},value:0}},{}],266:[function(e,t){var r,n,a;r=e("../../core/methods/font/decoration.coffee"),n=e("../../core/methods/font/family.coffee"),a=e("../../core/methods/font/transform.coffee"),t.exports={accepted:[Boolean,String],font:{color:"#444",decoration:r(),family:n(),size:16,transform:a(),weight:200},padding:5,value:!0}},{"../../core/methods/font/decoration.coffee":78,"../../core/methods/font/family.coffee":79,"../../core/methods/font/transform.coffee":81}],267:[function(e,t){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":82}],268:[function(e,t){t.exports={accepted:[!1,Function,String],deprecates:["sort"],sort:{accepted:["asc","desc"],value:"asc"},value:!1}},{}],269:[function(e,t){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":86}],270:[function(e,t){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",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:!0},value:!1}},{"../../core/methods/filter.coffee":76}],271:[function(e,t){t.exports={value:!1}},{}],272:[function(e,t){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":76}],273:[function(e,t){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":76}],274:[function(e,t){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,String],value:!1},mute:r(!1),solo:r(!1),value:!1}},{"../../core/methods/filter.coffee":76}],275:[function(e,t){t.exports={accepted:[Boolean],align:"middle",hover:{accepted:["all-scroll","col-resize","crosshair","default","grab","grabbing","move","pointer"],value:"pointer"},handles:{accepted:[Boolean],color:"#e5e5e5",hover:"#cccccc",opacity:1,size:2,stroke:"#818181",value:!0},height:{accepted:[Number],value:23},tick:"#818181",value:!0}},{}],276:[function(e,t){t.exports={mouseevents:60,transitions:600,ui:200}},{}],277:[function(e,t){var r,n,a,o;r=e("../../core/methods/font/decoration.coffee"),n=e("../../core/methods/font/family.coffee"),o=e("../../core/methods/font/transform.coffee"),a=e("../../string/strip.js"),t.exports={accepted:[!1,Function,String],font:{align:"center",color:"#444444",decoration:r(),family:n(),size:16,transform:o(),weight:400},height:!1,link:!1,padding:2,position:"top",process:function(e,t){var r;return 0===t.container.id.indexOf("default")&&e&&(r=a(e).toLowerCase(),t.self.container({id:r})),e},sub:{accepted:[!1,String],deprecates:"sub_title",font:{align:"center",color:"#444444",decoration:r(),family:n(),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:n(),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":78,"../../core/methods/font/family.coffee":79,"../../core/methods/font/transform.coffee":81,"../../string/strip.js":165}],278:[function(e,t){var r,n;r=e("../../core/methods/font/family.coffee"),n=e("../../core/methods/font/transform.coffee"),t.exports={accepted:[!1,Array,Function,Object,String],anchor:"top center",background:"#ffffff",children:{accepted:[Boolean],value:!0},connections:{accepted:[Boolean],value:!0},curtain:{color:"#ffffff",opacity:.8},deprecates:"tooltip_info",font:{color:"#444",family:r(),size:12,transform:n(),weight:200},html:{accepted:[!1,Function,String],deprecates:"click_function",value:!1},large:250,share:{accepted:[Boolean],value:!0},size:{accepted:[Boolean],value:!0},small:225,value:!1}},{"../../core/methods/font/family.coffee":79,"../../core/methods/font/transform.coffee":81}],279:[function(e,t){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":76}],280:[function(e,t){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"}},{}],281:[function(e,t){var r,n,a,o;a=e("../../core/methods/font/family.coffee"),r=e("../../core/methods/font/align.coffee"),n=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 r,n;return r=this.value,n=t.ui.color.secondary.value,n&&n!==d3.rgb(r).darker(2).toString()||(t.ui.color.secondary.value=d3.rgb(e).darker(2).toString()),e},value:"#ffffff"},secondary:{value:!1}},display:{acceped:["block","inline-block"],value:"inline-block"},font:{align:"center",color:"#444",decoration:n(),family:a(),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":77,"../../core/methods/font/decoration.coffee":78,"../../core/methods/font/family.coffee":79,"../../core/methods/font/transform.coffee":81}],282:[function(e,t){t.exports={accepted:[!1,Number],secondary:!1,small:200,value:!1}},{}],283:[function(e,t){t.exports={accepted:[Boolean],behavior:d3.behavior.zoom().scaleExtent([1,1]),click:{accepted:[Boolean],value:!0},pan:{accepted:[Boolean],value:!0},scroll:{accepted:[Boolean],deprecates:"scroll_zoom",value:!0},value:!0}},{}],284:[function(e,t){var r,n,a,o,i;n=e("../../core/fetch/value.js"),a=e("./helpers/graph/draw.coffee"),o=e("./helpers/graph/nest.coffee"),i=e("./helpers/graph/stack.coffee"),r=function(e){var t,r,s,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,j,A,M,E;if(u=e.axes.discrete,c="x"===u?"height":"width",_="x"===u?"width":"height",y=e.axes.opposite,r="x"===u?"left":"top",g="x"===u?"top":"left",l=e.data.viz.filter(function(t){return n(e,t,e[y].value)}),!l.length)return[];for(a(e,{buffer:!0,zero:e.axes.opposite}),v=o(e,l),e.axes.stacked&&i(e,v),b=e.axes[_]/e[e.axes.discrete].ticks.values.length,e.axes.stacked?p=b-4*e.labels.padding:(p=b/v.length,p-=2*e.labels.padding,m=b/2-p/2-2*e.labels.padding,k=d3.scale.linear().domain([0,v.length-1]).range([-m,m])),f=z=0,A=v.length;A>z;f=++z)for(x=v[f],h=e.axes.stacked?0:k(f),E=x.values,j=0,M=E.length;M>j;j++)s=E[j],s.d3plus[u]=e[u].scale.viz(n(e,s,e[u].value)),s.d3plus[u]+=e.axes.margin[r]+h,e.axes.stacked?(t=s.d3plus[y+"0"],w=s.d3plus[y],d=t-w):(t=e[y].scale.viz(0),w=e[y].scale.viz(n(e,s,e[y].value)),d=t-w),s.d3plus[y]=t-d/2,e.axes.stacked||(s.d3plus[y]+=e.axes.margin[g]),s.d3plus[_]=p,s.d3plus[c]=Math.abs(d),s.d3plus.init={},s.d3plus.init[y]=e[y].scale.viz(0)-s.d3plus[y]+e.axes.margin[g],s.d3plus.init[_]=s.d3plus[_],s.d3plus.label=!1;return l},r.requirements=["data","x","y"],r.setup=function(e){return e.axes.discrete?void 0:e.self.x({scale:"discrete"})},r.shapes=["square"],r.tooltip="static",t.exports=r},{"../../core/fetch/value.js":68,"./helpers/graph/draw.coffee":290,"./helpers/graph/nest.coffee":296,"./helpers/graph/stack.coffee":297}],285:[function(e,t){var r,n,a,o;n=e("../../core/fetch/value.js"),a=e("./helpers/graph/draw.coffee"),o=e("../../util/uniques.coffee"),r=function(e){var t,r,i,s,l,u,c,f,d,p;return a(e,{buffer:!0,mouse:!0}),r=e.axes.discrete,c=e.axes.opposite,t="x"===r?e.axes.margin.left:e.axes.margin.top,u="x"===c?e.axes.margin.left:e.axes.margin.top,i="x"===r?"height":"width",p="x"===r?"width":"height",d=e.axes[p]/e[r].ticks.values.length,d=d3.max([d3.min([d/2,40]),10]),l=e.type.mode.value,l instanceof Array||(l=[l,l]),s=function(t){var r,n,a;n={};for(r in e.data.keys)a=o(t,r),n[r]=1===a.length?a[0]:a;return n},f=[],d3.nest().key(function(t){return n(e,t,e[r].value)}).rollup(function(a){var o,h,v,g,m,y,x,b,w,_,k,z,j,A,M,E,S,T,O,N,F,B,P;for(z=e[c].scale.viz,S=a.map(function(t){return n(e,t,e[c].value)}),S.sort(function(e,t){return e-t}),m=d3.quantile(S,.25),w=d3.quantile(S,.5),j=d3.quantile(S,.75),"tukey"===l[0]?(y=m-j,o=m+1.5*y):"extent"===l[0]?o=d3.min(S):"number"==typeof l[0]&&(o=d3.quantile(S,l[0]/100)),"tukey"===l[1]?(y=m-j,A=j-1.5*y):"extent"===l[1]?A=d3.max(S):"number"==typeof l[1]&&(A=d3.quantile(S,(100-l[1])/100)),o=d3.max([d3.min(S),o]),A=d3.min([d3.max(S),A]),v=[],h=[],M=[],k=[],N=0,B=a.length;B>N;N++)g=a[N],E=n(e,g,e[c].value),E>=m&&j>=E?v.push(g):E>=o&&m>E?h.push(g):A>=E&&E>j?M.push(g):k.push(g);for(x=n(e,a[0],e[r].value),T=e[r].scale.viz(x),T+=t,b=e.format.value(x,e[r].value,e),x.constructor===Date&&(x=x.getTime()),v=s(v),v.d3plus={color:"white",id:"box_"+x,init:{},label:!1,shape:"square",stroke:"#444",text:"Interquartile Range for "+b},v.d3plus[p]=d,v.d3plus.init[p]=d,v.d3plus[i]=Math.abs(z(m)-z(j)),v.d3plus[r]=T,O=d3.min([z(m),z(j)])+v.d3plus[i]/2,O+=u,v.d3plus[c]=O,f.push(v),_={d3plus:{id:"median_line_"+x,position:"height"===i?"top":"right",shape:"whisker","static":!0,text:w}},_.d3plus[p]=d,_.d3plus[r]=T,_.d3plus[c]=z(w)+u,f.push(_),h=s(h),h.d3plus={id:"bottom_whisker_line_"+x,offset:v.d3plus[i]/2,position:"height"===i?"bottom":"left",shape:"whisker","static":!0},"x"===c&&(h.d3plus.offset*=-1),h.d3plus[i]=Math.abs(z(o)-z(m)),h.d3plus[p]=d,h.d3plus[r]=T,h.d3plus[c]=O,f.push(h),M=s(M),M.d3plus={id:"top_whisker_line_"+x,offset:v.d3plus[i]/2,position:"height"===i?"top":"right",shape:"whisker","static":!0},"y"===c&&(M.d3plus.offset*=-1),M.d3plus[i]=Math.abs(z(A)-z(j)),M.d3plus[p]=d,M.d3plus[r]=T,M.d3plus[c]=O,f.push(M),F=0,P=k.length;P>F;F++)g=k[F],g.d3plus[r]=T,g.d3plus[c]=z(n(e,g,e.y.value)),g.d3plus[c]+=u,g.d3plus.r=4,g.d3plus.shape=e.shape.value;return f=f.concat(k),a}).entries(e.data.viz),f},r.modes=["tukey","extent",Array,Number],r.requirements=["data","x","y"],r.shapes=["circle","check","cross","diamond","square","triangle","triangle_up","triangle_down"],r.setup=function(e){return e.axes.discrete?void 0:e.self.x({scale:"discrete"})},t.exports=r},{"../../core/fetch/value.js":68,"../../util/uniques.coffee":194,"./helpers/graph/draw.coffee":290}],286:[function(e,t){var r,n,a,o,i,s,l;r=e("../../array/sort.coffee"),i=e("../../core/fetch/value.js"),a=e("../../core/fetch/color.coffee"),o=e("../../core/fetch/text.js"),l=e("../../color/legible.coffee"),s=e("../../core/data/group.coffee"),n=function(e){var t,n,o,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,j,A,M,E,S,T,O,N,F,B,P,q,I,R,V,C;
if(g=s(e,e.data.viz),x=d3.max(g,function(e){return e.values instanceof Array?e.values.length:1}),y=e.labels.value&&!e.small&&x>1?50:0,r(g,e.order.value||e.size.value,e.order.sort.value,e.color.value,e),f=g.length,4>f?(o=f,z=1):(j=e.width.viz/e.height.viz,o=Math.ceil(Math.sqrt(f*j)),z=Math.ceil(Math.sqrt(f/j))),f>0)for(;(z-1)*o>=e.data.viz.length;)z--;for(n=e.width.viz/o,t=e.height.viz/z,e.size.value?(h=d3.min(e.data.viz,function(t){return i(e,t,e.size.value,e.id.value,"min")}),p=d3.max(e.data.viz,function(t){return i(e,t,e.size.value,e.id.value)}),d=[h,p]):d=[0,0],_=5,E=20,M=d3.min([n,t])/2-2*_,M-=y,A=e.size.scale.value.domain(d).rangeRound([E,M]),w=d3.layout.pack().children(function(e){return e.values}).padding(_).radius(function(e){return A(e)}).size([n-2*_,t-2*_-y]).value(function(e){return e.value}),c=[],k=0,m=P=0,R=g.length;R>P;m=++P){for(u=g[m],T=w.nodes(u),N=n*m%e.width.viz,B=t*k,q=0,V=T.length;V>q;q++)S=T[q],b=S.d3plus||{d3plus:{}},S.d3plus?b=S.d3plus:(b={d3plus:{}},b[e.id.value]=S.key),b.d3plus.depth=S.depth,b.d3plus.x=S.x,b.d3plus.xOffset=N,b.d3plus.y=S.y,b.d3plus.yOffset=B+y,b.d3plus.r=S.r,c.push(b);(m+1)%o===0&&k++}for(v=M/d3.max(c,function(e){return e.d3plus.r}),O=w.size()[0]/2,F=w.size()[1]/2,I=0,C=c.length;C>I;I++)u=c[I],u.d3plus.x=(u.d3plus.x-O)*v+O+u.d3plus.xOffset,u.d3plus.y=(u.d3plus.y-F)*v+F+u.d3plus.yOffset,u.d3plus.r=u.d3plus.r*v,delete u.d3plus.xOffset,delete u.d3plus.yOffset,u.d3plus.depth<e.depth.value?(u.d3plus["static"]=!0,u.d3plus.label=0===u.d3plus.depth?{x:0,y:-(M+y/2),w:1.5*M,h:y,color:l(a(e,u,u.d3plus.depth))}:!1):(u.d3plus["static"]=!1,delete u.d3plus.label);return c.sort(function(e,t){return e.d3plus.depth-t.d3plus.depth})},n.fill=!0,n.requirements=["data"],n.scale=1.05,n.shapes=["circle","donut"],n.tooltip="static",t.exports=n},{"../../array/sort.coffee":37,"../../color/legible.coffee":46,"../../core/data/group.coffee":59,"../../core/fetch/color.coffee":64,"../../core/fetch/text.js":67,"../../core/fetch/value.js":68}],287:[function(e,t){var r,n;n=e("../../../core/console/print.coffee"),r=function(e){var t,r;r={circle:"scatter",donut:"scatter",line:"line",square:"scatter",area:"stacked"},t=r[e.shape.value],n.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}],288:[function(e,t){var r;r=function(e){var t,r,n,a,o,i;return topojson.presimplify(e.coords.value),t=e.coords.value,n=d3.keys(t.objects)[0],i=topojson.feature(t,t.objects[n]),r=i.features,o=e.coords.solo.value,a=e.coords.mute.value,r=r.filter(function(t){return t[e.id.value]=t.id,o.length?o.indexOf(t.id)>=0:a.length?a.indexOf(t.id)<0:!0})},r.libs=["topojson"],r.nesting=!1,r.requirements=["color","coords"],r.scale=1,r.shapes=["coordinates"],r.tooltip="follow",r.zoom=!0,t.exports=r},{}],289:[function(e,t){var r,n;r=e("../../../../core/fetch/color.coffee"),n=e("../../../../color/legible.coffee"),t.exports=function(e){var t,a,o,i,s,l,u,c,f;for(o=e.axes.stacked?[]:e.data.viz,i=function(t,a){return t.attr("x1",function(t){return"y"===a?-2:t.d3plus.x-e.axes.margin.left}).attr("x2",function(t){return"y"===a?-8:t.d3plus.x-e.axes.margin.left}).attr("y1",function(t){return"x"===a?e.axes.height+2:t.d3plus.y-e.axes.margin.top}).attr("y2",function(t){return"x"===a?e.axes.height+8:t.d3plus.y-e.axes.margin.top}).style("stroke",function(t){return n(r(e,t))}).style("stroke-width",e.data.stroke.width).attr("shape-rendering",e.shape.rendering.value)},l=e.group.select("g#d3plus_graph_plane").selectAll("g.d3plus_data_tick").data(o,function(t){var r;return r=e.axes.discrete?"_"+t.d3plus[e.axes.discrete]:"","tick_"+t[e.id.value]+"_"+t.d3plus.depth+r}),l.enter().append("g").attr("class","d3plus_data_tick").attr("opacity",0),f=["x","y"],u=0,c=f.length;c>u;u++)t=f[u],a=t!==e.axes.discrete?o:[],s=l.selectAll("line.d3plus_data_"+t).data(a,function(t){var r;return r=e.axes.discrete?"_"+t.d3plus[e.axes.discrete]:"","tick_"+t[e.id.value]+"_"+t.d3plus.depth+r}),s.enter().append("line").attr("class","d3plus_data_"+t).call(i,t),s.transition().duration(e.draw.timing).call(i,t);l.transition().duration(e.draw.timing).attr("opacity",1),l.exit().transition().duration(e.draw.timing).attr("opacity",0).remove()}},{"../../../../color/legible.coffee":46,"../../../../core/fetch/color.coffee":64}],290:[function(e,t){var r,n,a,o;r=e("./includes/axes.coffee"),n=e("./includes/svg.coffee"),a=e("./includes/mouse.coffee"),o=e("./includes/plot.coffee"),t.exports=function(e,t){void 0===t&&(t={}),r(e,t),o(e,t),n(e,t),e.mouse=t.mouse===!0?a:!1}},{"./includes/axes.coffee":291,"./includes/mouse.coffee":293,"./includes/plot.coffee":294,"./includes/svg.coffee":295}],291:[function(e,t){var r,n,a,o,i,s,l,u,c,f;n=e("./buffer.coffee"),o=e("../../../../../core/fetch/data.js"),i=e("../../../../../core/fetch/value.js"),u=e("../../../../../core/console/print.coffee"),f=e("../../../../../util/uniques.coffee"),t.exports=function(e,t){var o,d,p,h,v,g,m,y,x,b,w,_,k,z,j,A;for(d=a(e),d&&(e.axes.dataset=s(e)),e.axes.scale=t.buffer&&t.buffer!==!0?c(e,t.buffer):!1,A=["x","y"],_=0,z=A.length;z>_;_++)if(o=A[_],v=e[o].solo.changed||e[o].mute.changed,m=d||e[o].changed||e.time.fixed.value&&v||e[o].scale.changed,m||e[o].stacked.changed||e[o].range.changed){if(e.dev.value&&u.time("calculating "+o+" axis"),e[o].reset=!0,e[o].ticks.values=!1,e[o].value===e.time.value)if(e.time.solo.value.length){for(b=e.time.solo.value,g=k=0,j=b.length;j>k;g=++k)x=b[g],x.constructor!==Date&&(p=new Date(x.toString()),p.setTime(p.getTime()+60*p.getTimezoneOffset()*1e3),b[g]=p);e[o].ticks.values=b}else e[o].ticks.values=e.data.time.ticks;else o===e.axes.discrete&&(e[o].ticks.values=f(e.axes.dataset,function(t){return i(e,t,e[o].value)}));w=[!0,o].indexOf(t.zero)>0?!0:!1,y=r(e,o,w),"y"===o&&(y=y.reverse()),e[o].scale.viz=l(e,o,y),t.buffer&&o!==e.axes.discrete&&n(e,o,t.buffer),e[o].domain.viz=y,e.dev.value&&u.timeEnd("calculating "+o+" axis")}e.axes.mirror.value&&(h=e.y.domain.viz.concat(e.x.domain.viz),e.x.domain.viz=d3.extent(h),e.y.domain.viz=d3.extent(h).reverse())},a=function(e){var t,r,n,a,o;for(r=["data","time","id","depth","type"],t=e.time.fixed.value&&(e.time.solo.changed||e.time.mute.changed),a=0,o=r.length;o>a;a++)if(n=r[a],t||e[n].changed){t=!0;break}return t},s=function(e){var t,r;return e.time.fixed.value?e.data.viz:(r=d3.range(0,e.id.nesting.length),d3.merge([function(){var n,a,i;for(i=[],n=0,a=r.length;a>n;n++)t=r[n],i.push(o(e,"all",t));return i}()]))},r=function(e,t,r){var n,a,o;return e[t].range.value&&2===e[t].range.value.length?e[t].range.value.slice():"share"===e[t].scale.value?(e[t].ticks.values=d3.range(0,1.1,.1),[0,1]):e[t].stacked.value?(a="x"===t?"y":"x",n=d3.nest().key(function(t){return i(e,t,e[a].value)}).rollup(function(r){var n,a;return a=d3.sum(r,function(r){var n;return n=i(e,r,e[t].value),n>0?n:0}),n=d3.sum(r,function(r){var n;return n=i(e,r,e[t].value),0>n?n:0}),[n,a]}).entries(e.axes.dataset),o=d3.merge(n.map(function(e){return e.values})),d3.extent(o)):e[t].value===e.time.value?d3.extent(e[t].ticks.values):(o=e.axes.dataset.map(function(r){return i(e,r,e[t].value)}),r&&o.push(0),d3.extent(o))},l=function(e,t,r){var n,a;return n="x"===t?e.width.viz:e.height.viz,a=e[t].scale.value,["discrete","share"].indexOf(a)>=0&&(a="linear"),d3.scale[a]().domain(r).rangeRound([0,n])},c=function(e,t){var r,n,a;return t===!0&&(t="size"),t in e&&(t=e[t].value),a=e.size.scale.min.value,"function"==typeof a&&(a=a(e)),n=e.size.scale.max.value,"function"==typeof n&&(n=n(e)),t===!1?e.size.scale.value.rangeRound([n,n]):"number"==typeof t?e.size.scale.value.rangeRound([t,t]):t?(e.dev.value&&u.time("calculating buffer scale"),r=d3.extent(e.axes.dataset,function(r){var n;return n=i(e,r,t),n?n:0}),r[0]===r[1]&&(a=n),e.dev.value&&u.timeEnd("calculating buffer scale"),e.size.scale.value.domain(r).rangeRound([a,n])):void 0}},{"../../../../../core/console/print.coffee":54,"../../../../../core/fetch/data.js":65,"../../../../../core/fetch/value.js":68,"../../../../../util/uniques.coffee":194,"./buffer.coffee":292}],292:[function(e,t){var r;r=e("../../../../../util/closest.coffee"),t.exports=function(e,t,n){var a,o,i,s,l,u,c,f,d,p,h,v;if("share"!==e[t].scale.value&&!e[t].range.value){if(t===e.axes.discrete)return c=e[t].scale.viz.domain(),"y"===t&&(c=c.slice().reverse()),1===e[t].ticks.values.length?e[t].value===e.time.value&&1!==e.data.time.ticks.length?(s=r(e.data.time.ticks,c[0]),v=e.data.time.ticks.indexOf(s),v>0?c[0]=e.data.time.ticks[v-1]:(l=e.data.time.ticks[v+1]-s,c[0]=new Date(s.getTime()-l)),v<e.data.time.ticks.length-1?c[1]=e.data.time.ticks[v+1]:(l=s-e.data.time.ticks[v-1],c[1]=new Date(s.getTime()+l))):(c[0]-=1,c[1]+=1):(u=Math.abs(c[1]-c[0]),a=u/(e[t].ticks.values.length-1),a/=2,c[0]=c[0]-a,c[1]=c[1]+a),"y"===t&&(c=c.reverse()),e[t].scale.viz.domain(c);if("x"===n&&"x"===t||"y"===n&&"y"===t||n===!0)return c=e[t].scale.viz.domain(),"y"===t&&(c=c.slice().reverse()),i=c[0]>=0&&c[1]>=0,o=c[0]<=0&&c[1]<=0,a=.05*Math.abs(c[1]-c[0]),c[0]=c[0]-a,c[1]=c[1]+a,(i&&c[0]<0||o&&c[0]>0)&&(c[0]=0),(i&&c[1]<0||o&&c[1]>0)&&(c[1]=0),"y"===t&&(c=c.reverse()),e[t].scale.viz.domain(c);if(e.axes.scale)return h=e[t].scale.viz.range()[1],p=e.axes.scale.range()[1],f=e[t].scale.viz.invert(2*-p),d=e[t].scale.viz.invert(h+2*p),f===d&&(f+=1,d-=1),e[t].scale.viz.domain([f,d])}}},{"../../../../../util/closest.coffee":190}],293:[function(e,t){var r,n,a,o,i;r=e("../../../../../util/copy.coffee"),n=e("../../../../../client/pointer.coffee"),a=e("../../../../../core/fetch/color.coffee"),o=e("../../../../../core/fetch/value.js"),i=e("../../../../../color/legible.coffee"),t.exports=function(e,t){var r,s,l,u,c,f,d,p,h,v,g,m,y,x,b,w;return r=d3.event.type===n.click&&(t.tooltip.value.long||t.tooltip.html.value),l=[n.over,n.move].indexOf(d3.event.type)>=0,b=e.d3plus.x,w=e.d3plus.y,h=e.d3plus.r||0,u=t.axes,x=t.timing.mouseevents,!r&&l?(s=i(a(t,e)),c=["x","y"].filter(function(r){var n;return n=o(t,e,t[r].value),!(n instanceof Array)&&r!==t.axes.stacked&&t[r].mouse.value&&r!==t.axes.discrete})):c=[],f=function(e){return e.attr("x2",function(e){return"x"===e?b:b-h}).attr("y2",function(e){return"y"===e?w:w+h}).attr("opacity",0)},d=function(e){return e.attr("x1",function(e){return"x"===e?b:b-h}).attr("y1",function(e){return"y"===e?w:w+h}).style("stroke",function(){return"area"===t.shape.value?"white":s}).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})},p=t.g.labels.selectAll("line.d3plus_mouse_axis_label").data(c),p.enter().append("line").attr("class","d3plus_mouse_axis_label").attr("pointer-events","none").call(f).call(d),p.transition().duration(x).attr("x2",function(r){return"x"===r?b:e.d3plus.x0||u.margin.left-t[r].ticks.size}).attr("y2",function(r){return"y"===r?w:e.d3plus.y0||u.height+u.margin.top+t[r].ticks.size}).style("opacity",1).call(d),p.exit().transition().duration(x).call(f).remove(),m=function(r){return r.attr("font-size",function(e){return t[e].ticks.font.size+"px"}).attr("fill",function(e){return t[e].ticks.font.color}).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"x"===e?b:u.margin.left-5-t[e].ticks.size}).attr("y",function(r){return"y"===r?w:e.d3plus.y0?e.d3plus.y+(e.d3plus.y0-e.d3plus.y)/2+u.margin.top-6:u.height+u.margin.top+5+t[r].ticks.size}).attr("fill","area"===t.shape.value?"white":s)},y=t.g.labels.selectAll("text.d3plus_mouse_axis_label").data(c),y.enter().append("text").attr("class","d3plus_mouse_axis_label").attr("id",function(e){return e+"_d3plusmouseaxislabel"}).attr("dy",function(e){return"y"===e?.35*t[e].ticks.font.size:t[e].ticks.font.size}).style("text-anchor",function(e){return"y"===e?"end":"middle"}).attr("opacity",0).attr("pointer-events","none").call(m),y.text(function(r){var n,a;return n=t.axes.stacked||r,a=o(t,e,t[n].value),t.format.value(a,t[n].value,t)}).transition().duration(x).delay(x).attr("opacity",1).call(m),y.exit().transition().duration(x).attr("opacity",0).remove(),v=function(r){var n;return n=function(e){return d3.select("text#"+e+"_d3plusmouseaxislabel").node().getBBox()},r.attr("x",function(e){var r;return r=n(e).width,"x"===e?b-r/2-5:u.margin.left-t[e].ticks.size-r-10}).attr("y",function(r){var a;return a=n(r).height/2+5,"y"===r?w-a:e.d3plus.y0?e.d3plus.y+(e.d3plus.y0-e.d3plus.y)/2+u.margin.top-a:u.height+u.margin.top+t[r].ticks.size}).attr("width",function(e){return n(e).width+10}).attr("height",function(e){return n(e).height+10}).style("stroke","area"===t.shape.value?"transparent":s).attr("fill","area"===t.shape.value?s:t.background.value).attr("shape-rendering",function(e){return t[e].mouse.rendering.value}).style("stroke-width",function(e){return t[e].mouse.width})},g=t.g.labels.selectAll("rect.d3plus_mouse_axis_label").data(c),g.enter().insert("rect","text.d3plus_mouse_axis_label").attr("class","d3plus_mouse_axis_label").attr("pointer-events","none").attr("opacity",0).call(v),g.transition().duration(x).delay(x).attr("opacity",1).call(v),g.exit().transition().duration(x).attr("opacity",0).remove()}},{"../../../../../client/pointer.coffee":41,"../../../../../color/legible.coffee":46,"../../../../../core/fetch/color.coffee":64,"../../../../../core/fetch/value.js":68,"../../../../../util/copy.coffee":191}],294:[function(e,t){var r,n,a,o,i;r=e("./buffer.coffee"),a=e("../../../../../font/sizes.coffee"),t.exports=function(e,t){var a,s,l,u,c,f,d,p;for(e.axes.margin=i(e),e.axes.height=e.height.viz,e.axes.width=e.width.viz,d=["x","y"],l=0,c=d.length;c>l;l++)a=d[l],e[a].ticks.values===!1&&(e[a].ticks.values=e[a].scale.viz.ticks()),s="x"===a?"y":"x",!t.buffer||t.buffer===s&&1!==e[a].ticks.values.length||a!==e.axes.discrete||e[a].reset!==!0||r(e,a,t.buffer),e[a].reset=!1;for(e.small||o(e),p=["x","y"],u=0,f=p.length;f>u;u++)a=p[u],e[a].axis.svg=n(e,a)},i=function(e){return e.small?{top:0,right:0,bottom:0,left:0}:{top:10,right:10,bottom:45,left:40}},o=function(e){var t,r,n,o,i,s,l,u,c;return l={"font-size":e.y.ticks.font.size+"px","font-family":e.y.ticks.font.family.value,"font-weight":e.y.ticks.font.weight},c=e.y.ticks.values.map(function(t){return e.format.value(t,e.y.value,e)}),u=d3.max(a(c,l),function(e){return e.width}),u=Math.round(u+e.labels.padding),e.axes.margin.left+=u,e.axes.width-=e.axes.margin.left-e.axes.margin.right,t={"font-size":e.x.ticks.font.size+"px","font-family":e.x.ticks.font.family.value,"font-weight":e.x.ticks.font.weight},s=e.x.ticks.values.map(function(t){return e.format.value(t,e.x.value,e)}),i=a(s,t),n=d3.max(i,function(e){return e.width}),r=d3.max(i,function(e){return e.height}),o=d3.min([e.axes.width/(s.length+1),2*e.axes.margin.left])-2*e.labels.padding,o>n?(n+=e.labels.padding,e.x.ticks.rotate=!1,e.x.ticks.anchor="middle",e.x.ticks.transform="translate(0,0)"):(n=r+e.labels.padding,r=d3.max(i,function(e){return e.width}),e.x.ticks.rotate=!0,e.x.ticks.anchor="start",e.x.ticks.transform="translate("+n+",15)rotate(90)"),r=Math.round(r),n=Math.round(n),e.axes.margin.bottom+=r,e.axes.height-=e.axes.margin.top+e.axes.margin.bottom,e.axes.width-=Math.round(n/2),e.x.scale.viz.rangeRound([0,e.axes.width]),e.y.scale.viz.rangeRound([0,e.axes.height])},n=function(e,t){return d3.svg.axis().tickSize(e[t].ticks.size).tickPadding(5).orient("x"===t?"bottom":"left").scale(e[t].scale.viz).tickValues(e[t].ticks.values).tickFormat(function(r){var n,a,o;return o=e[t].scale.value,n=e[t].value===e.time.value&&r%1!==0,a="log"===o&&"1"===r.toString().charAt(0),n||!a&&"log"===o?null:"share"===o?100*r+"%":r.constructor===Date?e.data.time.multiFormat(r):e.format.value(r,e[t].value,e)})}},{"../../../../../font/sizes.coffee":95,"./buffer.coffee":292}],295:[function(e,t){var r;r=e("../../../../../color/mix.coffee"),t.exports=function(e){var t,n,a,o,i,s,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,j,A,M,E,S,T,O,N,F,B,P,q,I,R,V,C,U,D,L,Y,H,W;for(i={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},t={left:"start",center:"middle",right:"end"},a=e.small?[]:[0],T=function(t,r){return t.attr("x1",function(t){return"x"===r?e.x.scale.viz(t):0}).attr("x2",function(t){return"x"===r?e.x.scale.viz(t):e.axes.width}).attr("y1",function(t){return"y"===r?e.y.scale.viz(t):0}).attr("y2",function(t){return"y"===r?e.y.scale.viz(t):e.axes.height})},O=function(t,n,a){var o;return o="log"===e[n].scale.value,t.attr("stroke",function(t){var i;return i=o&&"1"!==t.toString().charAt(0),0===t?e[n].axis.color:a?i?r(e[n].grid.color,e.axes.background.color,.5,1):e[n].grid.color:e[n].ticks.color}).attr("stroke-width",e[n].ticks.width).attr("shape-rendering",e[n].ticks.rendering.value)},S=function(t,r){return t.attr("font-size",function(t){var n;return n=0===t?"axis":"ticks",e[r][n].font.size+"px"}).attr("fill",function(t){var n;return n=0===t?"axis":"ticks",e[r][n].font.color}).attr("font-family",function(t){var n;return n=0===t?"axis":"ticks",e[r][n].font.family.value}).attr("font-weight",function(t){var n;return n=0===t?"axis":"ticks",e[r][n].font.weight})},m=function(t,r){var n,a;return n="x"===r?"height":"width",a="x"===r?"y":"x",t.attr(a+"1",0).attr(a+"2",e.axes[n]).attr(r+"1",function(e){return e.coords.line}).attr(r+"2",function(e){return e.coords.line}).attr("stroke",function(t){return t.color||e[r].lines.color}).attr("stroke-width",e[r].lines.width).attr("shape-rendering",e[r].lines.rendering.value).attr("stroke-dasharray",e[r].lines.dasharray.value)},h=function(r,n){var a;return a="x"===n?"y":"x",r.attr(a,function(e){return e.coords.text[a]+"px"}).attr(n,function(e){return e.coords.text[n]+"px"}).attr("dy",e[n].lines.font.position.value).attr("text-anchor",t[e[n].lines.font.align.value]).attr("transform",function(e){return e.transform}).attr("font-size",e[n].lines.font.size+"px").attr("fill",function(t){return t.color||e[n].lines.color}).attr("font-family",e[n].lines.font.family.value).attr("font-weight",e[n].lines.font.weight)},_="translate("+e.axes.margin.left+","+e.axes.margin.top+")",w=e.group.selectAll("g#d3plus_graph_plane").data([0]),w.transition().duration(e.draw.timing).attr("transform",_),w.enter().append("g").attr("id","d3plus_graph_plane").attr("transform",_),o=w.selectAll("rect#d3plus_graph_background").data([0]),o.transition().duration(e.draw.timing).attr(i),o.enter().append("rect").attr("id","d3plus_graph_background").attr("x",0).attr("y",0).attr(i),b=w.selectAll("path#d3plus_graph_mirror").data([0]),b.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),b.transition().duration(e.draw.timing).attr("opacity",function(){return e.axes.mirror.value?1:0}).attr("d",function(){var e,t;return t=i.width,e=i.height,"M "+t+" "+e+" L 0 "+e+" L "+t+" 0 Z"}),B=function(t){return t.attr("transform","translate(0,"+e.axes.height+")").call(e.x.axis.svg.scale(e.x.scale.viz)).selectAll("g.tick").select("text").style("text-anchor",e.x.ticks.anchor).attr("transform",e.x.ticks.transform).call(S,"x")},N=w.selectAll("g#d3plus_graph_xticks").data(a),N.transition().duration(e.draw.timing).call(B),N.selectAll("line").transition().duration(e.draw.timing).call(O,"x"),F=N.enter().append("g").attr("id","d3plus_graph_xticks").call(B),F.selectAll("path").attr("fill","none"),F.selectAll("line").call(O,"x"),N.exit().transition().duration(e.data.timing).attr("opacity",0).remove(),I=function(t){return t.call(e.y.axis.svg.scale(e.y.scale.viz)).selectAll("g.tick").select("text").call(S,"y")},P=w.selectAll("g#d3plus_graph_yticks").data(a),P.transition().duration(e.draw.timing).call(I),P.selectAll("line").transition().duration(e.draw.timing).call(O,"y"),q=P.enter().append("g").attr("id","d3plus_graph_yticks").call(I),q.selectAll("path").attr("fill","none"),q.selectAll("line").call(O,"y"),P.exit().transition().duration(e.data.timing).attr("opacity",0).remove(),f=function(t,r){return t.attr("x","x"===r?e.width.viz/2:-(e.axes.height/2+e.axes.margin.top)).attr("y","x"===r?e.height.viz-10:15).attr("transform","y"===r?"rotate(-90)":null).attr("font-family",e[r].label.family.value).attr("font-weight",e[r].label.weight).attr("font-size",e[r].label.size+"px").attr("fill",e[r].label.color).style("text-anchor",e[r].label.align)},Y=["x","y"],R=0,U=Y.length;U>R;R++)n=Y[R],u=w.selectAll("g#d3plus_graph_"+n+"grid").data([0]),u.enter().append("g").attr("id","d3plus_graph_"+n+"grid"),y=u.selectAll("line").data(e[n].ticks.values,function(e){return e}),y.transition().duration(e.draw.timing).call(T,n).call(O,n,!0),y.enter().append("line").style("opacity",0).call(T,n).call(O,n,!0).transition().duration(e.draw.timing).delay(e.draw.timing/2).style("opacity",1),y.exit().transition().duration(e.draw.timing/2).style("opacity",0).remove(),c=e.group.selectAll("text#d3plus_graph_"+n+"label").data(a),c.text(e.format.value(e[n].value,void 0,e)).transition().duration(e.draw.timing).call(f,n),c.enter().append("text").attr("id","d3plus_graph_"+n+"label").text(e.format.value(e[n].value,void 0,e)).call(f,n),c.exit().transition().duration(e.data.timing).attr("opacity",0).remove();for(H=["x","y"],V=0,D=H.length;D>V;V++)if(n=H[V],v=w.selectAll("g#d3plus_graph_"+n+"_userlines").data([0]),v.enter().append("g").attr("id","d3plus_graph_"+n+"_userlines"),e[n].lines.value.length){for(l=e[n].scale.viz.domain(),"y"===n&&(l=l.slice().reverse()),A=[],p=[],W=e[n].lines.value,C=0,L=W.length;L>C;C++)d=W[C],s="object"==typeof d?d.position:d,isNaN(s)||(s=parseFloat(s),s>l[0]&&s<l[1]&&(s="object"!=typeof d?{position:s}:d,s.coords={line:e[n].scale.viz(s.position)},p.push(s),s.text&&(s.axis=n,s.padding=.5*e[n].lines.font.padding.value,s.align=e[n].lines.font.align.value,k=e[n].lines.font.position.text,M="middle"===k?0:2*s.padding,"top"===k&&(M=-M),"x"===n?(E="left"===s.align?e.axes.height:"center"===s.align?e.axes.height/2:0,"left"===s.align&&(E-=2*s.padding),"right"===s.align&&(E+=2*s.padding)):(E="left"===s.align?0:"center"===s.align?e.axes.width/2:e.axes.width,"right"===s.align&&(E-=2*s.padding),"left"===s.align&&(E+=2*s.padding)),s.coords.text={},s.coords.text["x"===n?"y":"x"]=E,s.coords.text[n]=e[n].scale.viz(s.position)+M,s.transform="x"===n?"rotate(-90,"+s.coords.text.x+","+s.coords.text.y+")":null,A.push(s))));y=v.selectAll("line.d3plus_graph_"+n+"line").data(p,function(e){return e.position}),y.enter().append("line").attr("class","d3plus_graph_"+n+"line").attr("opacity",0).call(m,n),y.transition().duration(e.draw.timing).attr("opacity",1).call(m,n),y.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),x=v.selectAll("text.d3plus_graph_"+n+"line_text").data(A,function(e){return e.position}),x.enter().append("text").attr("class","d3plus_graph_"+n+"line_text").attr("id",function(e){return"d3plus_graph_"+n+"line_text_"+e.position}).attr("opacity",0).call(h,n),x.text(function(e){return e.text}).transition().duration(e.draw.timing).attr("opacity",1).call(h,n),x.exit().transition().duration(e.draw.timing).attr("opacity",0).remove(),j=function(t){var r;return r=function(e){return w.select("text#d3plus_graph_"+e.axis+"line_text_"+e.position).node().getBBox()},t.attr("x",function(e){return r(e).x-e.padding}).attr("y",function(e){return r(e).y-e.padding}).attr("transform",function(e){return e.transform}).attr("width",function(e){return r(e).width+2*e.padding}).attr("height",function(e){return r(e).height+2*e.padding}).attr("fill",e.axes.background.color)},z=e[n].lines.font.background.value?A:[],g=v.selectAll("rect.d3plus_graph_"+n+"line_rect").data(z,function(e){return e.position}),g.enter().insert("rect","text.d3plus_graph_"+n+"line_text").attr("class","d3plus_graph_"+n+"line_rect").attr("pointer-events","none").attr("opacity",0).call(j),g.transition().delay(e.draw.timing).each("end",function(){return d3.select(this).transition().duration(e.draw.timing).attr("opacity",1).call(j)}),g.exit().transition().duration(e.draw.timing).attr("opacity",0).remove()}}},{"../../../../../color/mix.coffee":48}],296:[function(e,t){var r,n,a;r=e("../../../../core/fetch/value.js"),n=e("../../../../string/strip.js"),a=e("../../../../util/uniques.coffee"),t.exports=function(e,t){var o,i,s,l;return t||(t=e.data.viz),o=e[e.axes.discrete],s=e[e.axes.opposite],l=o.ticks.values,i={x:e.axes.margin.left,y:e.axes.margin.top},d3.nest().key(function(t){var a,o;return o=r(e,t,e.id.value),a="depth"in t.d3plus?t.d3plus.depth:e.depth.value,"line_"+n(o)+"_"+a}).rollup(function(t){var r,n,i,u,c,f,d,p;for(r=a(t,o.value),f=r[0].constructor===Date,f&&(r=r.map(function(e){return e.getTime()})),n=d=0,p=l.length;p>d;n=++d)c=l[n],u=f?c.getTime():c,r.indexOf(u)<0&&o.zerofill.value&&(i={d3plus:{}},i[e.id.value]=t[0][e.id.value],i[o.value]=c,i[s.value]=s.scale.viz.domain()[1],t.push(i));return t.sort(function(e,t){var r,n;return r=e[o.value]-t[o.value],n=e[s.value]-t[s.value],r?r:n})}).entries(t)}},{"../../../../core/fetch/value.js":68,"../../../../string/strip.js":165,"../../../../util/uniques.coffee":194}],297:[function(e,t){var r;r=e("../../../../core/fetch/value.js"),t.exports=function(e,t){var n,a,o,i,s,l,u,c,f;return f=e.axes.stacked,n=e[f].scale.viz(0),u=e[f].scale.value,s="x"===f?"y":"x",a="y"===f?e.axes.margin.top:e.axes.margin.left,i="share"===u?"expand":"zero",c=d3.layout.stack().values(function(e){return e.values}).offset(i).x(function(e){return e.d3plus[s]}).y(function(t){return n-e[f].scale.viz(r(e,t,e[f].value))}).out(function(t,o,i){var s,l;return l=r(e,t,e[f].value),s=0>l,"share"===u?(t.d3plus[f+"0"]=(1-o)*n,t.d3plus[f]=t.d3plus[f+"0"]-i*n):(t.d3plus[f+"0"]=n-o,t.d3plus[f]=t.d3plus[f+"0"]-i),t.d3plus[f]+=a,t.d3plus[f+"0"]+=a}),l=t.filter(function(t){return r(e,t,e[f].value)>0}),o=t.filter(function(t){return r(e,t,e[f].value)<0}),l.length&&(l=c(l)),o.length&&(o=c(o)),l.concat(o)}},{"../../../../core/fetch/value.js":68}],298:[function(e,t){var r,n,a,o,i,s;n=e("../../core/fetch/value.js"),a=e("./helpers/graph/draw.coffee"),r=e("./helpers/graph/dataTicks.coffee"),i=e("./helpers/graph/nest.coffee"),s=e("./helpers/graph/stack.coffee"),o=function(e){var t,o,l,u,c,f,d,p;for(a(e,{buffer:e.axes.opposite,mouse:!0}),o=i(e),u=0,f=o.length;f>u;u++)for(l=o[u],p=l.values,c=0,d=p.length;d>c;c++)t=p[c],t.d3plus.x=e.x.scale.viz(n(e,t,e.x.value)),t.d3plus.x+=e.axes.margin.left,t.d3plus.y=e.y.scale.viz(n(e,t,e.y.value)),t.d3plus.y+=e.axes.margin.top,t.d3plus.r=2;return r(e),e.axes.stacked?s(e,o):o},o.requirements=["data","x","y"],o.setup=function(e){var t,r;e.axes.discrete||e.self.x({scale:"discrete"}),r=e[e.axes.opposite].value,t=e.size,!r.value&&t.value||t.changed&&t.previous===r.value?e.self[e.axes.opposite](t.value):(!t.value&&r.value||r.changed&&r.previous===t.value)&&e.self.size(r.value)},o.shapes=["line"],o.tooltip="static",t.exports=o},{"../../core/fetch/value.js":68,"./helpers/graph/dataTicks.coffee":289,"./helpers/graph/draw.coffee":290,"./helpers/graph/nest.coffee":296,"./helpers/graph/stack.coffee":297}],299:[function(e,t){var r=e("../../network/distances.coffee"),n=e("../../core/fetch/value.js"),a=function(e){var t=e.nodes.restricted||e.nodes.value,a=e.edges.restricted||e.edges.value,o=d3.extent(t,function(e){return e.x}),i=d3.extent(t,function(e){return e.y}),s=[1,1];if("number"==typeof e.size.value?s=[e.size.value,e.size.value]:e.size.value&&(s=d3.extent(t,function(t){var r=n(e,t,e.size.value);return 0===r?null:r})),"undefined"==typeof s[0]&&(s=[1,1]),"number"==typeof e.size.value)var l=e.size.value,u=e.size.value;else{var l=d3.min(r(t)),c=e.size.value?e.nodes.overlap:.4;if(l*=c,e.edges.arrows.value&&(l=.5*l),s[0]===s[1])var u=l;else{var f=o[1]+1.1*l-(o[0]-1.1*l),d=i[1]+1.1*l-(i[0]-1.1*l);if(aspect=f/d,app=e.width.viz/e.height.viz,app>aspect)var p=e.height.viz/d;else var p=e.width.viz/f;var u=.25*l;2>u*p&&(u=2/p)}}var h=e.size.scale.value.domain(s).range([u,l]);e.zoom.bounds=[[o[0]-1.1*l,i[0]-1.1*l],[o[1]+1.1*l,i[1]+1.1*l]];var v=[],g={};return t.forEach(function(t){var r=e.data.viz.filter(function(r){return r[e.id.value]==t[e.id.value]})[0],a=r||{};a[e.id.value]=t[e.id.value],a.d3plus={},a.d3plus.x=t.x,a.d3plus.y=t.y;var o=n(e,a,e.size.value);a.d3plus.r=o?h(o):h.range()[0],g[a[e.id.value]]={x:a.d3plus.x,y:a.d3plus.y,r:a.d3plus.r},v.push(a)}),v.sort(function(e,t){return t.d3plus.r-e.d3plus.r}),a.forEach(function(t){t.d3plus&&delete t.d3plus.spline,t[e.edges.source].d3plus={};var r=g[t[e.edges.source][e.id.value]];t[e.edges.source].d3plus.r=r.r,t[e.edges.source].d3plus.x=r.x,t[e.edges.source].d3plus.y=r.y,t[e.edges.target].d3plus={};var n=g[t[e.edges.target][e.id.value]];t[e.edges.target].d3plus.r=n.r,t[e.edges.target].d3plus.x=n.x,t[e.edges.target].d3plus.y=n.y}),{nodes:v,edges:a}};a.nesting=!1,a.requirements=["nodes","edges"],a.scale=1.05,a.shapes=["circle","square","donut"],a.tooltip="static",a.zoom=!0,t.exports=a},{"../../core/fetch/value.js":68,"../../network/distances.coffee":156}],300:[function(e,t){var r,n,a,o,i=[].indexOf||function(e){for(var t=0,r=this.length;r>t;t++)if(t in this&&this[t]===e)return t;return-1};n=e("../../network/shortestPath.coffee"),r=e("../../core/fetch/value.js"),a=e("../../util/uniques.coffee"),o=function(e){var t,n,a,s,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k,z,j,A,M,E,S,T,O,N,F,B,P,q,I,R,V,C,U,D,L,Y,H,W,X,G,Q,J,K,Z,$,et,tt,rt,nt,at,ot,it,st,lt,ut,ct,ft,dt;for(c=[],A={},A[e.focus.value[0]]=0,A[e.focus.value[1]]=0,M={all:[[e.focus.value[0]],[e.focus.value[1]]]},ot=o.paths,j=L=0,X=ot.length;X>L;j=++L)for(z=ot[j],c=c.concat(z.edges),v=e.focus.value[0],M[j]=[v],it=z.edges,u=Y=0,G=it.length;G>Y;u=++Y)l=it[u],l[e.edges.source]=e.data.viz.filter(function(t){return l[e.edges.source][e.id.value]===t[e.id.value]})[0],l[e.edges.target]=e.data.viz.filter(function(t){return l[e.edges.target][e.id.value]===t[e.id.value]})[0],b=l[e.edges.source][e.id.value]===v?"target":"source",w=l[e.edges[b]][e.id.value],void 0===A[w]&&(A[w]=j),M[j].push(w),v=w;O=0;for(j in M)if(z=M[j],"all"!==j){for(y=0,f=H=0,Q=z.length;Q>H;f=++H)if(d=z[f],0!==f&&f!==z.length-1&&A[d]===parseFloat(j)){for(y=1,E=z[f-1],x=z[f+1],S=null,_=null,st=M.all,n=W=0,J=st.length;J>W;n=++W)t=st[n],i.call(t,E)>=0&&(S=n),i.call(t,x)>=0&&(_=n);null!==S&&null===_?S+1===M.all.length-1?M.all.splice(S+1,0,[d]):M.all[S+1].push(d):_-S===1?M.all.splice(_,0,[d]):_-S>1&&M.all[_-1].push(d)}O+=y}for(T=Math.floor(e.height.viz/O),R=[],f=0;O>f;)f%2===0?R.push(f):R.unshift(f),f++;for(p=e.size.value&&!e.small?30:0,I=d3.scale.ordinal().domain(R).range(d3.range(T/2-p,e.height.viz+T/2-p,(e.height.viz-T)/(O-1))),s=M.all.length,a=Math.floor(e.width.viz/s),P=d3.scale.linear().domain([0,s-1]).rangeRound([a/2,e.width.viz-a/2]),m=5,g=.4*d3.min([a,T-p]),F=d3.extent(e.data.viz,function(t){var n;return n=r(e,t,e.size.value),n||0}),N=e.size.scale.value.domain(F).rangeRound([m,g]),lt=e.data.viz,tt=0,K=lt.length;K>tt;tt++){for(k=lt[tt],null==k.d3plus&&(k.d3plus={}),ut=M.all,n=rt=0,Z=ut.length;Z>rt;n=++rt)t=ut[n],ct=k[e.id.value],i.call(t,ct)>=0&&(k.d3plus.x=P(n));k.d3plus.y=I(A[k[e.id.value]]),e.size.value?(B=r(e,k,e.size.value),k.d3plus.r=B?N(B):m):k.d3plus.r=g,k.d3plus.r<.1*a&&!e.small?k.d3plus.label={x:0,y:k.d3plus.r+2*e.labels.padding,w:.6*a,h:p+g-k.d3plus.r,resize:!1}:delete k.d3plus.label}for(ft=o.paths,j=nt=0,$=ft.length;$>nt;j=++nt)for(z=ft[j],v=e.focus.value[0],dt=z.edges,u=at=0,et=dt.length;et>at;u=++at)l=dt[u],b=l[e.edges.source][e.id.value]===v?"target":"source",h="target"===b?"source":"target",w=l[e.edges[b]][e.id.value],A[v]!==A[w]?(l.d3plus={spline:!0},null==(V=l[e.edges.source]).d3plus&&(V.d3plus={}),null==(C=l[e.edges.source].d3plus).edges&&(C.edges={}),null==(U=l[e.edges.target]).d3plus&&(U.d3plus={}),null==(D=l[e.edges.target].d3plus).edges&&(D.edges={}),q=l[b].d3plus.x-l[h].d3plus.x,l[h].d3plus.edges[l[b][e.id.value]]={angle:Math.PI,radius:a/2},l[b].d3plus.edges[l[h][e.id.value]]={angle:0,radius:a/2,offset:q-a}):delete l.d3plus,v=w;
return{nodes:e.data.viz,edges:c}},o.filter=function(e,t){var r,i,s,l,u,c,f,d,p,h,v,g,m,y,x,b,w,_,k;for(l=e.edges.filtered||e.edges.value,o.paths=n(l,e.focus.value[0],{target:e.focus.value[1],distance:e.edges.size||void 0,nodeid:e.id.value,startpoint:e.edges.source,endpoint:e.edges.target,K:e.edges.limit.value||5}),o.nodes=[],r=[],_=o.paths,g=0,x=_.length;x>g;g++)for(d=_[g],k=d.edges,m=0,b=k.length;b>m;m++)s=k[m],h=s[e.edges.source],v=s[e.edges.target],r.indexOf(h[e.id.value])<0&&(o.nodes.push(h),r.push(h[e.id.value])),r.indexOf(v[e.id.value])<0&&(o.nodes.push(v),r.push(v[e.id.value]));for(c=a(o.nodes,e.id.value),p=[],y=0,w=c.length;w>y;y++)u=c[y],i=t.filter(function(t){return t[e.id.value]===u}),i[0]?p.push(i[0]):(f={d3plus:{}},f[e.id.value]=u,p.push(f));return p},o.nesting=!1,o.requirements=[function(e){return{status:2===e.focus.value.length,text:e.format.locale.value.method.focus+" x 2"}},"edges"],o.scale=1,o.shapes=["circle","square","donut"],o.tooltip="static",t.exports=o},{"../../core/fetch/value.js":68,"../../network/shortestPath.coffee":158,"../../util/uniques.coffee":194}],301:[function(e,t){var r,n,a,o,i,s;r=e("../../array/comparator.coffee"),n=e("../../core/data/threshold.js"),a=e("../../core/fetch/value.js"),o=e("../../core/data/group.coffee"),i={},s=function(e){var t,n,s,l,u,c,f,d,p;for(u=d3.layout.pie().value(function(e){return e.value}).sort(function(t,n){var o,s;return e.order.value?r(t.d3plus,n.d3plus,[e.order.value],e.order.sort.value,[],e):(o=a(e,t.d3plus,e.id.value),void 0===i[o]&&(i[o]=t.value),s=a(e,n.d3plus,e.id.value),void 0===i[s]&&(i[s]=n.value),i[s]<i[o]?-1:1)}),n=o(e,e.data.viz,[]),l=u(n),f=[],c=d3.min([e.width.viz,e.height.viz])/2-2*e.labels.padding,d=0,p=l.length;p>d;d++)t=l[d],s=t.data.d3plus,s.d3plus.startAngle=t.startAngle,s.d3plus.endAngle=t.endAngle,s.d3plus.r=c,s.d3plus.x=e.width.viz/2,s.d3plus.y=e.height.viz/2,f.push(s);return f},s.filter=n,s.requirements=["data","size"],s.shapes=["arc"],s.threshold=function(e){return 1600/(e.width.viz*e.height.viz)},s.tooltip="follow",t.exports=s},{"../../array/comparator.coffee":35,"../../core/data/group.coffee":59,"../../core/data/threshold.js":63,"../../core/fetch/value.js":68}],302:[function(e,t){var r=e("../../array/sort.coffee"),n=e("../../client/pointer.coffee"),o=e("../../network/distances.coffee"),i=e("../../core/fetch/value.js"),s=e("../../core/fetch/color.coffee"),l=e("../../color/legible.coffee"),u=e("../../tooltip/remove.coffee"),c=e("../../util/uniques.coffee"),f=function(e){var t=d3.min([e.height.viz,e.width.viz])/2,f=e.small||!e.labels.value?(t-2*e.labels.padding)/2:t/3,d=e.small||!e.labels.value?1.4*f:f,p=2*f,h=[],v=[],g=e.data.viz.filter(function(t){return t[e.id.value]===e.focus.value[0]})[0];g||(g={d3plus:{}},g[e.id.value]=e.focus.value[0]),g.d3plus.x=e.width.viz/2,g.d3plus.y=e.height.viz/2,g.d3plus.r=.65*d;var m=[],y=[e.focus.value[0]];e.edges.connections(e.focus.value[0],e.id.value).forEach(function(t){var r=t[e.edges.source][e.id.value]==e.focus.value[0]?t[e.edges.target]:t[e.edges.source],n=e.data.viz.filter(function(t){return t[e.id.value]===r[e.id.value]})[0];n||(n={d3plus:{}},n[e.id.value]=r[e.id.value]),n.d3plus.edges=e.edges.connections(n[e.id.value],e.id.value).filter(function(t){return t[e.edges.source][e.id.value]!=e.focus.value[0]&&t[e.edges.target][e.id.value]!=e.focus.value[0]}),n.d3plus.edge=t,y.push(n[e.id.value]),m.push(n)});var x=e.order.value||e.color.value||e.size.value||e.id.value;m.sort(function(t,n){var a=t.d3plus.edges.length-n.d3plus.edges.length;return a?a:r([t,n],x,e.order.sort.value,e.color.value||[],e)}),"number"==typeof e.edges.limit.value?m=m.slice(0,e.edges.limit.value):"function"==typeof e.edges.limit.value&&(m=e.edges.limit.value(m));var b=[],w=0;m.forEach(function(t){var r=t[e.id.value];t.d3plus.edges=t.d3plus.edges.filter(function(t){var n=t[e.edges.source][e.id.value],a=t[e.edges.target][e.id.value];return y.indexOf(n)<0&&a==r||y.indexOf(a)<0&&n==r}),w+=t.d3plus.edges.length||1,t.d3plus.edges.forEach(function(t){var n=t[e.edges.source],a=t[e.edges.target],o=a[e.id.value]==r?n:a;y.push(o[e.id.value])})}),r(m,x,e.order.sort.value,e.color.value||[],e);var _=0,k=2*Math.PI,z=0;m.forEach(function(t,n){var o=t.d3plus.edges.length||1,i=k/w*o;0==n&&(z=s,_-=i/2);var s=_+i/2;s-=k/4,t.d3plus.radians=s,t.d3plus.x=e.width.viz/2+d*Math.cos(s),t.d3plus.y=e.height.viz/2+d*Math.sin(s),_+=i,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],x,e.order.sort.value,e.color.value||[],e)}),t.d3plus.edges.forEach(function(r,n){var i=r[e.edges.source][e.id.value]==t[e.id.value]?r[e.edges.target]:r[e.edges.source],l=k/w,u=e.data.viz.filter(function(t){return t[e.id.value]===i[e.id.value]})[0];u||(u={d3plus:{}},u[e.id.value]=i[e.id.value]),a=s-l*o/2+l/2+l*n,u.d3plus.radians=a,u.d3plus.x=e.width.viz/2+p*Math.cos(a),u.d3plus.y=e.height.viz/2+p*Math.sin(a),b.push(u)})});var j=d3.min(o(m,function(e){return[e.d3plus.x,e.d3plus.y]})),A=d3.min(o(b,function(e){return[e.d3plus.x,e.d3plus.y]}));if(j||(j=f/2),A||(A=f/4),8>j/2-4)var M=d3.min([j/2,8]);else var M=j/2-4;if(4>A/2-4)var E=d3.min([A/2,4]);else var E=A/2-4;E>f/10&&(E=f/10),E>M?E=.75*M:M>1.5*E&&(M=1.5*E),M=Math.floor(M),E=Math.floor(E);var S=c(m,e.id.value);S=S.concat(c(b,e.id.value)),S.push(e.focus.value[0]);var T=e.data.viz.filter(function(t){return S.indexOf(t[e.id.value])>=0});if(e.size.value){var O=d3.extent(T,function(t){return i(e,t,e.size.value)});O[0]==O[1]&&(O[0]=0);var t=d3.scale.linear().domain(O).rangeRound([3,d3.min([M,E])]),N=i(e,g,e.size.value);g.d3plus.r=t(N)}else{var t=d3.scale.linear().domain([1,2]).rangeRound([M,E]);e.edges.label&&(g.d3plus.r=1.5*t(1))}return b.forEach(function(r){r.d3plus.ring=2;var n=e.size.value?i(e,r,e.size.value):2;r.d3plus.r=t(n)}),m.forEach(function(r){r.d3plus.ring=1;var n=e.size.value?i(e,r,e.size.value):1;r.d3plus.r=t(n)}),v=[g].concat(m).concat(b),m.forEach(function(t){var r=[e.edges.source,e.edges.target],n=t.d3plus.edge;r.forEach(function(t){n[t]=v.filter(function(r){return r[e.id.value]==n[t][e.id.value]})[0]}),delete n.d3plus,h.push(n),e.edges.connections(t[e.id.value],e.id.value).forEach(function(r){var n=r[e.edges.source][e.id.value]==t[e.id.value]?r[e.edges.target]:r[e.edges.source];if(n[e.id.value]!=g[e.id.value]){var a=b.filter(function(t){return t[e.id.value]==n[e.id.value]})[0];if(a);else{a=m.filter(function(t){return t[e.id.value]==n[e.id.value]})[0]}if(a){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(n,o){r[n]=v.filter(function(t){return t[e.id.value]==r[n][e.id.value]})[0],void 0===r[n].d3plus.edges&&(r[n].d3plus.edges={});var i=0===o?r[e.edges.target][e.id.value]:r[e.edges.source][e.id.value];r[n].d3plus.edges[i]=r[n][e.id.value]==t[e.id.value]?{angle:t.d3plus.radians+Math.PI,radius:f/2}:{angle:a.d3plus.radians,radius:f/2}}),h.push(r)}}})}),v.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,n=f-3*e.labels.padding-t.d3plus.r;if(-90>r||r>90){r-=180;var a=-(t.d3plus.r+n/2+e.labels.padding),o="end"}else var a=t.d3plus.r+n/2+e.labels.padding,o="start";var i=m.indexOf(t)>=0?!0:!1,u=1==t.d3plus.ring?j:A;u+=2*e.labels.padding,t.d3plus.label={x:a,y:0,w:n,h:u,angle:r,anchor:o,valign:"center",color:l(s(e,t)),resize:[8,e.labels.font.size],background:i,mouse:!0}}else if(e.size.value||e.edges.label){var u=d-2*t.d3plus.r-2*e.labels.padding;t.d3plus.label={x:0,y:t.d3plus.r+u/2,w:d,h:u,color:l(s(e,t)),resize:[10,40],background:!0,mouse:!0}}else delete t.d3plus.rotate,delete t.d3plus.label;else delete t.d3plus.rotate,delete t.d3plus.label}),e.mouse[n.click]=function(t){t[e.id.value]!=e.focus.value[0]&&(u(e.type.value),e.self.focus(t[e.id.value]).draw())},{edges:h,nodes:v,data:T}};f.filter=function(e,t){var r=e.edges.connections(e.focus.value[0],e.id.value,!0),n=[];r.forEach(function(t){n=n.concat(e.edges.connections(t[e.id.value],e.id.value,!0))});var a=r.concat(n),o=c(a,e.id.value),i=[];return o.forEach(function(r){var n=t.filter(function(t){return t[e.id.value]==r})[0];if(n)i.push(n);else{var a={d3plus:{}};a[e.id.value]=r,i.push(a)}}),i},f.nesting=!1,f.scale=1,f.shapes=["circle","square","donut"],f.requirements=["edges","focus"],f.tooltip="static",t.exports=f},{"../../array/sort.coffee":37,"../../client/pointer.coffee":41,"../../color/legible.coffee":46,"../../core/fetch/color.coffee":64,"../../core/fetch/value.js":68,"../../network/distances.coffee":156,"../../tooltip/remove.coffee":187,"../../util/uniques.coffee":194}],303:[function(e,t){var r,n,a,o,i,s;r=e("../../core/fetch/value.js"),n=e("./helpers/graph/draw.coffee"),a=e("../../core/console/print.coffee"),i=e("../../array/sort.coffee"),s=e("./helpers/graph/dataTicks.coffee"),o=function(e){var t,a,o,l;for(n(e,{buffer:"size",mouse:!0}),l=e.data.viz,a=0,o=l.length;o>a;a++)t=l[a],t.d3plus.x=e.x.scale.viz(r(e,t,e.x.value)),t.d3plus.x+=e.axes.margin.left,t.d3plus.y=e.y.scale.viz(r(e,t,e.y.value)),t.d3plus.y+=e.axes.margin.top,t.d3plus.r=e.axes.scale("number"!=typeof e.size.value&&e.size.value?r(e,t,e.size.value):0);return s(e),i(e.data.viz,e.order.value||e.size.value||e.id.value,"desc"===e.order.sort.value?"asc":"desc",e.color.value||[],e)},o.fill=!0,o.requirements=["data","x","y"],o.scale=1.1,o.setup=function(e){return e.x.value===e.time.value&&e.self.x({scale:"discrete"}),e.y.value===e.time.value?e.self.y({scale:"discrete"}):void 0},o.shapes=["circle","square","donut"],o.tooltip="static",t.exports=o},{"../../array/sort.coffee":37,"../../core/console/print.coffee":54,"../../core/fetch/value.js":68,"./helpers/graph/dataTicks.coffee":289,"./helpers/graph/draw.coffee":290}],304:[function(e,t){var r,n,a,o,i,s,l;r=e("../../core/fetch/value.js"),n=e("./helpers/graph/draw.coffee"),a=e("./helpers/graph/nest.coffee"),o=e("../../array/sort.coffee"),i=e("./helpers/graph/stack.coffee"),l=e("../../core/data/threshold.js"),s=function(e){var t,s,l,u,c,f,d,p,h,v;for(n(e,{buffer:e.axes.opposite}),s=a(e),f=0,p=s.length;p>f;f++)for(u=s[f],u.d3plus||(u.d3plus={}),v=u.values,d=0,h=v.length;h>d;d++)t=v[d],t.d3plus.x=e.x.scale.viz(r(e,t,e.x.value)),t.d3plus.x+=e.axes.margin.left,t.d3plus.y=e.y.scale.viz(r(e,t,e.y.value)),t.d3plus.y+=e.axes.margin.top,t.d3plus.merged instanceof Array&&(u.d3plus.merged||(u.d3plus.merged=[]),u.d3plus.merged=u.d3plus.merged.concat(t.d3plus.merged)),t.d3plus.text&&!u.d3plus.text&&(u.d3plus.text=t.d3plus.text);return s=i(e,s),l=e.order.value||e.size.value||e.id.value,c="desc"===e.order.sort.value?"asc":"desc",o(s,l,c,e.color.value||[],e)},s.filter=function(e,t){return l(e,t,e.x.value)},s.requirements=["data","x","y"],s.setup=function(e){var t,r;e.axes.discrete||e.self.x({scale:"discrete"}),e.self[e.axes.discrete]({zerofill:!0}),e.self[e.axes.opposite]({stacked:!0}),r=e[e.axes.opposite],t=e.size,!r.value&&t.value||t.changed&&t.previous===r.value?e.self[e.axes.opposite](t.value):(!t.value&&r.value||r.changed&&r.previous===t.value)&&e.self.size(r.value)},s.shapes=["area"],s.threshold=function(e){return 20/e.height.viz},s.tooltip="static",t.exports=s},{"../../array/sort.coffee":37,"../../core/data/threshold.js":63,"../../core/fetch/value.js":68,"./helpers/graph/draw.coffee":290,"./helpers/graph/nest.coffee":296,"./helpers/graph/stack.coffee":297}],305:[function(e,t){var r=e("../../util/uniques.coffee"),n=e("../../util/copy.coffee"),a=e("../../color/random.coffee"),o=function(e){var t=r(e.data.viz,e.id.value),o=r(e.cols.value);o.indexOf("label")<0&&e.cols.index.value&&o.unshift("label");var i=e.height.viz/(t.length+1),s=e.width.viz/o.length;e.group.selectAll("rect").data([0]).enter().append("rect").attr("class","background").attr("height",e.height.viz).attr("width",e.width.viz).style("fill",e.color.missing);var l=e.group.selectAll("line.horiz").data(e.data.viz);l.enter().append("line").attr("class","horiz"),l.attr("x1",0).attr("y1",function(e,t){return i*t+i}).attr("x2",e.width.viz).attr("y2",function(e,t){return i*t+i}).style("fill","#fff").style("stroke","#fff"),l.exit().remove();var u=e.group.selectAll("line.vert").data(o);u.enter().append("line").attr("class","vert"),u.attr("x1",function(e,t){return s*t+s}).attr("y1",0).attr("x2",function(e,t){return s*t+s}).attr("y2",e.height.viz).style("fill","#fff").style("stroke","#fff"),u.exit().remove();var c=[],f={};return o.forEach(function(t,r){var n={d3plus:{x:s*r+s/2,y:i/2,width:s,height:i,id:"d3p_header_"+t.toString().replace(/ /g,"_"),shape:"square",color:"#fff",text:t}};if(t==e.id.value&&(n.d3plus.color="#fff"),"label"==t&&(n.d3plus.label=!1,n.d3plus.color="#fff",n.d3plus.stroke="#fff"),c.push(n),"number"==e.data.keys[t]){var o=d3.extent(e.data.viz,function(e){return e[t]});o[0]==o[1]&&(o=[o[0]-1,o[1]]),f[t]=d3.scale.linear().domain(o).range([e.color.missing,a(t)])}else"boolean"==e.data.keys[t]&&(f[t]=function(r){return r?a(t):e.color.missing})}),e.data.viz.forEach(function(t,r){r+=1,o.forEach(function(a,o){var l=n(t);l.d3plus.id="d3p_"+l[e.id.value].toString().replace(/ /g,"_")+"_"+a,l.d3plus.x=s*o+s/2,l.d3plus.y=i*r+i/2,l.d3plus.width=s,l.d3plus.height=i,"label"==a&&(l.d3plus.shape="square",l.d3plus.color="#fff",c.push(l)),d3.keys(t).indexOf(a)>=0&&a in t&&(f[a]&&(l.d3plus.color=f[a](l[a])),l.d3plus.text=l[a],"boolean"==e.data.keys[a]?l.d3plus.label=!1:"string"==e.data.keys[a]&&(l.d3plus.color=e.color.missing,l.d3plus.stroke="#fff",l.d3plus.shape="square"),c.push(l))})}),c};o.shapes=["check","cross","diamond","square","triangle","triangle_up","triangle_down"],o.requirements=["data","cols"],t.exports=o},{"../../color/random.coffee":49,"../../util/copy.coffee":191,"../../util/uniques.coffee":194}],306:[function(e,t){var r,n,a,o;r=e("../../core/data/threshold.js"),n=e("../../core/data/group.coffee"),a=e("../../object/merge.coffee"),o=function(e){var t,r,o,i,s,l,u;if(o=n(e,e.data.viz),r=d3.layout.treemap().mode(e.type.mode.value).round(!0).size([e.width.viz,e.height.viz]).children(function(e){return e.values}).padding(1).sort(function(e,t){var r;return r=e.value-t.value,0===r?e.id<t.id:r}).nodes({name:"root",values:o}).filter(function(e){return!e.values&&e.area}),r.length){for(s=r[0];s.parent;)s=s.parent;for(i=[],l=0,u=r.length;u>l;l++)t=r[l],t.d3plus.d3plus=a(t.d3plus.d3plus,{x:t.x+t.dx/2,y:t.y+t.dy/2,width:t.dx,height:t.dy,share:t.value/s.value}),i.push(t.d3plus)}return i},o.filter=r,o.modes=["squarify","slice","dice","slice-dice"],o.requirements=["data","size"],o.shapes=["square"],o.threshold=function(e){return 1600/(e.width.viz*e.height.viz)},o.tooltip="follow",t.exports=o},{"../../core/data/group.coffee":59,"../../core/data/threshold.js":63,"../../object/merge.coffee":161}],307:[function(e,t){var r,n,a,o,i,s;r=e("../core/methods/attach.coffee"),n=e("./methods/helpers/axis.coffee"),o=e("./helpers/ui/message.js"),i=e("./helpers/drawSteps.js"),s=e("../core/console/print.coffee"),a=e("./helpers/container.coffee"),t.exports=function(){var t;return t={g:{apps:{}},types:{bar:e("./types/bar.coffee"),bubbles:e("./types/bubbles.coffee"),box:e("./types/box.coffee"),chart:e("./types/deprecated/chart.coffee"),geo_map:e("./types/geo_map.coffee"),line:e("./types/line.coffee"),network:e("./types/network.js"),paths:e("./types/paths.coffee"),pie:e("./types/pie.coffee"),rings:e("./types/rings.js"),scatter:e("./types/scatter.coffee"),stacked:e("./types/stacked.coffee"),table:e("./types/table.js"),tree_map:e("./types/tree_map.coffee")}},t.self=function(e){return e.each(function(){var e,r,n,l,u,c,f,d,p;t.draw.frozen=!0,t.internal_error=null,"timing"in t.draw||(t.draw.timing=t.timing.transitions),t.container.changed&&a(t),f=t.width.value<=t.width.small,c=t.height.value<=t.height.small,t.small=f||c,t.width.viz=t.width.value,t.height.viz=t.height.value,e=!1,t.error.value?(p=t.draw.timing,t.group.transition().duration(p).attr("opacity",0),t.g.data.transition().duration(p).attr("opacity",0),t.g.edges.transition().duration(p).attr("opacity",0),t.messages.style="large",r=t.error.value===!0?t.format.value(t.format.locale.value.ui.error):t.error.value,e=r,o(t,r)):(n=function(){d.length?u():(t.methodGroup=!1,t.dev.value&&(s.timeEnd("total draw time"),s.groupEnd(),s.log("\n")))},l=function(e,r){r=r||"function",e[r]instanceof Array?e[r].forEach(function(e){e(t,n)}):"function"==typeof e[r]&&e[r](t,n),e.wait||n()},u=function(){var a,i,u;u=d.shift(),i=t.g.message&&e===u.message,a="check"in u?u.check:!0,"function"==typeof a&&(a=a(t)),a?!i&&t.draw.update?(t.dev.value&&(e!==!1&&s.groupEnd(),s.groupCollapsed(u.message)),e="string"==typeof t.messages.value?t.messages.value:u.message,r="string"==typeof t.messages.value?t.messages.value:t.format.value(u.message),o(t,r),setTimeout(function(){l(u)},10)):l(u):"otherwise"in u?setTimeout(function(){l(u,"otherwise")},10):n()},t.messages.style=t.group&&"1"===t.group.attr("opacity")?"small":"large",d=i(t),u())}),t.self},r(t,{active:e("./methods/active.coffee"),aggs:e("./methods/aggs.coffee"),attrs:e("./methods/attrs.coffee"),axes:e("./methods/axes.coffee"),background:e("./methods/background.coffee"),color:e("./methods/color.coffee"),cols:e("./methods/cols.js"),container:e("./methods/container.coffee"),coords:e("./methods/coords.coffee"),csv:e("./methods/csv.coffee"),data:e("./methods/data.js"),depth:e("./methods/depth.coffee"),descs:e("./methods/descs.coffee"),dev:e("./methods/dev.coffee"),draw:e("./methods/draw.js"),edges:e("./methods/edges.js"),error:e("./methods/error.coffee"),focus:e("./methods/focus.coffee"),font:e("./methods/font.coffee"),footer:e("./methods/footer.coffee"),format:e("./methods/format.coffee"),height:e("./methods/height.coffee"),history:e("./methods/history.coffee"),icon:e("./methods/icon.coffee"),id:e("./methods/id.coffee"),labels:e("./methods/labels.coffee"),legend:e("./methods/legend.coffee"),links:e("./methods/links.coffee"),margin:e("./methods/margin.coffee"),messages:e("./methods/messages.coffee"),nodes:e("./methods/nodes.coffee"),order:e("./methods/order.coffee"),shape:e("./methods/shape.coffee"),size:e("./methods/size.coffee"),style:e("./methods/style.coffee"),temp:e("./methods/temp.coffee"),text:e("./methods/text.coffee"),time:e("./methods/time.coffee"),timeline:e("./methods/timeline.coffee"),timing:e("./methods/timing.coffee"),title:e("./methods/title.coffee"),tooltip:e("./methods/tooltip.coffee"),total:e("./methods/total.coffee"),type:e("./methods/type.coffee"),ui:e("./methods/ui.coffee"),width:e("./methods/width.coffee"),x:n("x"),y:n("y"),zoom:e("./methods/zoom.js")}),t.self}},{"../core/console/print.coffee":54,"../core/methods/attach.coffee":75,"./helpers/container.coffee":195,"./helpers/drawSteps.js":196,"./helpers/ui/message.js":227,"./methods/active.coffee":236,"./methods/aggs.coffee":237,"./methods/attrs.coffee":238,"./methods/axes.coffee":239,"./methods/background.coffee":240,"./methods/color.coffee":241,"./methods/cols.js":242,"./methods/container.coffee":243,"./methods/coords.coffee":244,"./methods/csv.coffee":245,"./methods/data.js":246,"./methods/depth.coffee":247,"./methods/descs.coffee":248,"./methods/dev.coffee":249,"./methods/draw.js":250,"./methods/edges.js":251,"./methods/error.coffee":252,"./methods/focus.coffee":253,"./methods/font.coffee":254,"./methods/footer.coffee":255,"./methods/format.coffee":256,"./methods/height.coffee":257,"./methods/helpers/axis.coffee":258,"./methods/history.coffee":259,"./methods/icon.coffee":260,"./methods/id.coffee":261,"./methods/labels.coffee":262,"./methods/legend.coffee":263,"./methods/links.coffee":264,"./methods/margin.coffee":265,"./methods/messages.coffee":266,"./methods/nodes.coffee":267,"./methods/order.coffee":268,"./methods/shape.coffee":269,"./methods/size.coffee":270,"./methods/style.coffee":271,"./methods/temp.coffee":272,"./methods/text.coffee":273,"./methods/time.coffee":274,"./methods/timeline.coffee":275,"./methods/timing.coffee":276,"./methods/title.coffee":277,"./methods/tooltip.coffee":278,"./methods/total.coffee":279,"./methods/type.coffee":280,"./methods/ui.coffee":281,"./methods/width.coffee":282,"./methods/zoom.js":283,"./types/bar.coffee":284,"./types/box.coffee":285,"./types/bubbles.coffee":286,"./types/deprecated/chart.coffee":287,"./types/geo_map.coffee":288,"./types/line.coffee":298,"./types/network.js":299,"./types/paths.coffee":300,"./types/pie.coffee":301,"./types/rings.js":302,"./types/scatter.coffee":303,"./types/stacked.coffee":304,"./types/table.js":305,"./types/tree_map.coffee":306}]},{},[1]);