-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvega2.min.js
10 lines (8 loc) · 224 KB
/
vega2.min.js
1
2
3
4
5
6
7
8
9
10
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.vg=t()}}(function(){var t;return function e(t,n,r){function i(s,o){if(!n[s]){if(!t[s]){var l="function"==typeof require&&require;if(!o&&l)return l(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var a="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,e,n){e.exports={core:{View:t("./src/core/View")},dataflow:{changeset:t("./src/dataflow/changeset"),Datasource:t("./src/dataflow/Datasource"),Graph:t("./src/dataflow/Graph"),Node:t("./src/dataflow/Node")},parse:{spec:t("./src/parse/spec")},scene:{Builder:t("./src/scene/Builder"),GroupBuilder:t("./src/scene/GroupBuilder")},transforms:t("./src/transforms/index"),config:t("./src/util/config"),util:t("datalib"),Bounds:t("./src/util/Bounds")}},{"./src/core/View":30,"./src/dataflow/Datasource":32,"./src/dataflow/Graph":33,"./src/dataflow/Node":34,"./src/dataflow/changeset":36,"./src/parse/spec":57,"./src/scene/Builder":73,"./src/scene/GroupBuilder":75,"./src/transforms/index":102,"./src/util/Bounds":103,"./src/util/config":106,datalib:20}],2:[function(t,e,n){},{}],3:[function(t,e,n){function r(){if(!o){o=!0;for(var t,e=s.length;e;){t=s,s=[];for(var n=-1;++n<e;)t[n]();e=s.length}o=!1}}function i(){}var a=e.exports={},s=[],o=!1;a.nextTick=function(t){s.push(t),o||setTimeout(r,0)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=i,a.addListener=i,a.once=i,a.off=i,a.removeListener=i,a.removeAllListeners=i,a.emit=i,a.binding=function(t){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(t){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],4:[function(t,e,n){function r(){this._cells={},this._aggr=[],this._stream=!1}function i(t){if(a.isArray(t))return t;if(null==t)return[];var e,n,r=[];for(e in t)n=a.array(t[e]),r.push({name:e,ops:n});return r}var a=t("../util"),s=t("./measures"),o=t("./collector"),l=r.Flags={ADD_CELL:1,MOD_CELL:2},u=r.prototype;u.stream=function(t){return null==t?this._stream:(this._stream=!!t,this._aggr=[],this)},u.key=function(t){return null==t?this._key:(this._key=a.$(t),this)},u.groupby=function(t){return this._dims=a.array(t).map(function(t,e){if(t=a.isString(t)?{name:t,get:a.$(t)}:a.isFunction(t)?{name:a.name(t)||t.name||"_"+e,get:t}:t.name&&a.isFunction(t.get)?t:null,null==t)throw"Invalid groupby argument: "+t;return t}),this.clear()},u.summarize=function(t){t=i(t),this._count=!0;var e,n,r,o,l,u,c,d=this._aggr=[];for(r=0;r<t.length;++r){for(o=0,e=[],n=t[r];o<n.ops.length;++o)l=n.ops[o],"count"!==l&&(this._count=!1),u=n.as&&n.as[o]||l+("*"===n.name?"":"_"+n.name),e.push(s[l](u));c=n.get&&a.$(n.get)||("*"===n.name?a.identity:a.$(n.name)),d.push({name:n.name,measures:s.create(e,this._stream,c,this._assign)})}return this.clear()},u.count=function(){return this.summarize({"*":"count"})},u._assign=function(t,e,n){t[e]=n},u.clear=function(){return this._cells={},this},u._cellkey=function(t){var e,n=this._dims,r=n.length,i=String(n[0].get(t));for(e=1;r>e;++e)i+="|"+n[e].get(t);return i},u._cell=function(t){var e=this._dims.length?this._cellkey(t):"";return this._cells[e]||(this._cells[e]=this._newcell(t))},u._newcell=function(t){var e,n={num:0,tuple:this._newtuple(t),flag:l.ADD_CELL,aggs:{}},r=this._aggr;for(e=0;e<r.length;++e)n.aggs[r[e].name]=new r[e].measures(n,n.tuple);return n.collect&&(n.data=new o(this._key)),n},u._newtuple=function(t){var e,n,r=this._dims,i={};for(e=0,n=r.length;n>e;++e)i[r[e].name]=r[e].get(t);return this._ingest(i)},u._ingest=a.identity,u._add=function(t){var e,n=this._cell(t),r=this._aggr;if(n.num+=1,!this._count)for(n.collect&&n.data.add(t),e=0;e<r.length;++e)n.aggs[r[e].name].add(t);n.flag|=l.MOD_CELL},u._rem=function(t){var e,n=this._cell(t),r=this._aggr;if(n.num-=1,!this._count)for(n.collect&&n.data.rem(t),e=0;e<r.length;++e)n.aggs[r[e].name].rem(t);n.flag|=l.MOD_CELL},u._mod=function(t,e){var n,r=this._cell(e),i=this._cell(t),s=this._aggr;for(r!==i?(r.num-=1,i.num+=1,r.collect&&r.data.rem(e),i.collect&&i.data.add(t)):r.collect&&!a.isObject(t)&&(r.data.rem(e),r.data.add(t)),n=0;n<s.length;++n)r.aggs[s[n].name].rem(e),i.aggs[s[n].name].add(t);r.flag|=l.MOD_CELL,i.flag|=l.MOD_CELL},u.result=function(){var t,e,n,r=[],i=this._aggr;for(n in this._cells){if(t=this._cells[n],t.num>0){for(t.collect&&t.data.values(),e=0;e<i.length;++e)t.aggs[i[e].name].set();r.push(t.tuple)}else delete this._cells[n];t.flag=0}return this._rems=!1,r},u.changes=function(){var t,e,n,r,i={add:[],rem:[],mod:[]},a=this._aggr;for(r in this._cells){for(t=this._cells[r],e=t.flag,t.collect&&t.data.values(),n=0;n<a.length;++n)t.aggs[a[n].name].set();t.num<=0?(i.rem.push(t.tuple),delete this._cells[r]):e&l.ADD_CELL?i.add.push(t.tuple):e&l.MOD_CELL&&i.mod.push(t.tuple),t.flag=0}return this._rems=!1,i},u.execute=function(t){return this.clear().insert(t).result()},u.insert=function(t){this._consolidate();for(var e=0;e<t.length;++e)this._add(t[e]);return this},u.remove=function(t){if(!this._stream)throw"Aggregator not configured for streaming removes. Call stream(true) prior to calling summarize.";for(var e=0;e<t.length;++e)this._rem(t[e]);return this._rems=!0,this},u._consolidate=function(){if(this._rems){for(var t in this._cells)this._cells[t].collect&&this._cells[t].data.values();this._rems=!1}},e.exports=r},{"../util":25,"./collector":5,"./measures":7}],5:[function(t,e,n){function r(t){this._add=[],this._rem=[],this._key=t||null,this._last=null}var i=t("../util"),a=t("../stats"),s="__dl_rem__",o=r.prototype;o.add=function(t){this._add.push(t)},o.rem=function(t){this._rem.push(t)},o.values=function(){if(this._get=null,0===this._rem.length)return this._add;var t,e,n,r,o=this._add,l=this._rem,u=this._key,c=Array(o.length-l.length);if(i.isObject(l[0]))if(u)for(r=i.toMap(l,u),t=0,e=0,n=o.length;n>t;++t)r.hasOwnProperty(u(o[t]))||(c[e++]=o[t]);else{for(t=0,n=l.length;n>t;++t)l[t][s]=1;for(t=0,e=0,n=o.length;n>t;++t)o[t][s]||(c[e++]=o[t]);for(t=0,n=l.length;n>t;++t)delete l[t][s]}else for(r=a.count.map(l),t=0,e=0,n=o.length;n>t;++t)r[o[t]]>0?r[o[t]]-=1:c[e++]=o[t];return this._rem=[],this._add=c},o.extent=function(t){if(this._get!==t||!this._ext){var e=this.values(),n=a.extent.index(e,t);this._ext=[e[n[0]],e[n[1]]],this._get=t}return this._ext},o.argmin=function(t){return this.extent(t)[0]},o.argmax=function(t){return this.extent(t)[1]},o.min=function(t){var e=this.extent(t)[0];return e?t(e):+(1/0)},o.max=function(t){var e=this.extent(t)[1];return e?t(e):-(1/0)},o.quartile=function(t){return this._get===t&&this._q||(this._q=a.quartile(this.values(),t),this._get=t),this._q},o.q1=function(t){return this.quartile(t)[0]},o.q2=function(t){return this.quartile(t)[1]},o.q3=function(t){return this.quartile(t)[2]},e.exports=r},{"../stats":22,"../util":25}],6:[function(t,e,n){var r=t("../util"),i=t("./aggregator");e.exports=function(){var t=[].reduce.call(arguments,function(t,e){return t.concat(r.array(e))},[]);return(new i).groupby(t).summarize({"*":"values"})}},{"../util":25,"./aggregator":4}],7:[function(t,e,n){function r(t){return function(e){var n=s.extend({init:"",add:"",rem:"",idx:0},t);return n.out=e||t.name,n}}function i(t,e){function n(t,r){function i(e){t[e]||n(t,t[e]=o[e]())}return r.req&&r.req.forEach(i),e&&r.str&&r.str.forEach(i),t}var r=t.reduce(n,t.reduce(function(t,e){return t[e.name]=e,t},{}));return s.vals(r).sort(function(t,e){return t.idx-e.idx})}function a(e,n,r,a){var o=i(e,n),l="this.cell = cell; this.tuple = t; this.valid = 0; this.missing = 0;",u="if (v==null) this.missing++; if (!this.isValid(v)) return; ++this.valid;",c="if (v==null) this.missing--; if (!this.isValid(v)) return; --this.valid;",d="var t = this.tuple; var cell = this.cell;";return o.forEach(function(t){t.idx<0?(l=t.init+l,u=t.add+u,c=t.rem+c):(l+=t.init,u+=t.add,c+=t.rem)}),e.slice().sort(function(t,e){return t.idx-e.idx}).forEach(function(t){d+="this.assign(t,'"+t.out+"',"+t.set+");"}),d+="return t;",l=Function("cell","t",l),l.prototype.assign=a,l.prototype.add=Function("t","var v = this.get(t);"+u),l.prototype.rem=Function("t","var v = this.get(t);"+c),l.prototype.set=Function(d),l.prototype.get=r,l.prototype.distinct=t("../stats").count.distinct,l.prototype.isValid=s.isValid,l}var s=t("../util"),o={values:r({name:"values",init:"cell.collect = true;",set:"cell.data.values()",idx:-1}),count:r({name:"count",set:"cell.num"}),missing:r({name:"missing",set:"this.missing"}),valid:r({name:"valid",set:"this.valid"}),sum:r({name:"sum",init:"this.sum = 0;",add:"this.sum += v;",rem:"this.sum -= v;",set:"this.sum"}),mean:r({name:"mean",init:"this.mean = 0;",add:"var d = v - this.mean; this.mean += d / this.valid;",rem:"var d = v - this.mean; this.mean -= this.valid ? d / this.valid : this.mean;",set:"this.mean"}),average:r({name:"average",set:"this.mean",req:["mean"],idx:1}),variance:r({name:"variance",init:"this.dev = 0;",add:"this.dev += d * (v - this.mean);",rem:"this.dev -= d * (v - this.mean);",set:"this.valid > 1 ? this.dev / (this.valid-1) : 0",req:["mean"],idx:1}),variancep:r({name:"variancep",set:"this.valid > 1 ? this.dev / this.valid : 0",req:["variance"],idx:2}),stdev:r({name:"stdev",set:"this.valid > 1 ? Math.sqrt(this.dev / (this.valid-1)) : 0",req:["variance"],idx:2}),stdevp:r({name:"stdevp",set:"this.valid > 1 ? Math.sqrt(this.dev / this.valid) : 0",req:["variance"],idx:2}),median:r({name:"median",set:"cell.data.q2(this.get)",req:["values"],idx:3}),q1:r({name:"q1",set:"cell.data.q1(this.get)",req:["values"],idx:3}),q3:r({name:"q3",set:"cell.data.q3(this.get)",req:["values"],idx:3}),distinct:r({name:"distinct",set:"this.distinct(cell.data.values(), this.get)",req:["values"],idx:3}),argmin:r({name:"argmin",add:"if (v < this.min) this.argmin = t;",rem:"if (v <= this.min) this.argmin = null;",set:"this.argmin = this.argmin || cell.data.argmin(this.get)",req:["min"],str:["values"],idx:3}),argmax:r({name:"argmax",add:"if (v > this.max) this.argmax = t;",rem:"if (v >= this.max) this.argmax = null;",set:"this.argmax = this.argmax || cell.data.argmax(this.get)",req:["max"],str:["values"],idx:3}),min:r({name:"min",init:"this.min = +Infinity;",add:"if (v < this.min) this.min = v;",rem:"if (v <= this.min) this.min = NaN;",set:"this.min = (isNaN(this.min) ? cell.data.min(this.get) : this.min)",str:["values"],idx:4}),max:r({name:"max",init:"this.max = -Infinity;",add:"if (v > this.max) this.max = v;",rem:"if (v >= this.max) this.max = NaN;",set:"this.max = (isNaN(this.max) ? cell.data.max(this.get) : this.max)",str:["values"],idx:4}),modeskew:r({name:"modeskew",set:"this.dev===0 ? 0 : (this.mean - cell.data.q2(this.get)) / Math.sqrt(this.dev/(this.valid-1))",req:["mean","stdev","median"],idx:5})};o.create=a,e.exports=o},{"../stats":22,"../util":25}],8:[function(t,e,n){function r(t){if(!t)throw Error("Missing binning options.");var e,n,r,o,l,u,c,d=t.maxbins||15,f=t.base||10,h=Math.log(f),p=t.div||[5,2],g=t.min,m=t.max,v=m-g;if(t.step)e=t.step;else if(t.steps)e=t.steps[Math.min(t.steps.length-1,i(t.steps,v/d,0,t.steps.length))];else{n=Math.ceil(Math.log(d)/h),r=t.minstep||0,e=Math.max(r,Math.pow(f,Math.round(Math.log(v)/h)-n));do e*=f;while(Math.ceil(v/e)>d);for(u=0;u<p.length;++u)l=e/p[u],l>=r&&d>=v/l&&(e=l)}return l=Math.log(e),o=l>=0?0:~~(-l/h)+1,c=Math.pow(f,-o-1),g=Math.min(g,Math.floor(g/e+c)*e),m=Math.ceil(m/e)*e,{start:g,stop:m,step:e,unit:{precision:o},value:a,index:s}}function i(t,e,n,r){for(;r>n;){var i=n+r>>>1;u.cmp(t[i],e)<0?n=i+1:r=i}return n}function a(t){return this.step*Math.floor(t/this.step+d)}function s(t){return Math.floor((t-this.start)/this.step+d)}function o(t){return this.unit.date(a.call(this,t))}function l(t){return s.call(this,this.unit.unit(t))}var u=t("../util"),c=t("../time-units"),d=1e-15;r.date=function(t){if(!t)throw Error("Missing date binning options.");var e=t.min,n=t.max,i=t.maxbins||20,a=t.minbins||4,s=+n-+e,u=t.unit?c[t.unit]:c.find(s,a,i),d=r({min:null!=u.min?u.min:u.unit(e),max:null!=u.max?u.max:u.unit(n),maxbins:i,minstep:u.minstep,steps:u.step});return d.unit=u,d.index=l,t.raw||(d.value=o),d},e.exports=r},{"../time-units":24,"../util":25}],9:[function(t,e,n){function r(t,e,n){n=s(t,e,n);var r=a(n);return r?d.$func("bin",r.unit.unit?function(t){return r.value(r.unit.unit(t))}:function(t){return r.value(t)})(n.accessor):n.accessor||d.identity}function i(t,e,n){n=s(t,e,n);var r=a(n);return r?o(t,n.accessor,r):l(t,n.accessor,n&&n.sort)}function a(t){var e=t.type,n=null;return(null==e||p[e])&&("integer"===e&&null==t.minstep&&(t.minstep=1),n="date"===e?h.date(t):h(t)),n}function s(){var t=arguments,e=0,n=d.isArray(t[e])?t[e++]:null,r=d.isFunction(t[e])||d.isString(t[e])?d.$(t[e++]):null,i=d.extend({},t[e]);if(n&&(i.type=i.type||c(n,r),p[i.type])){var a=u.extent(n,r);i=d.extend({min:a[0],max:a[1]},i)}return r&&(i.accessor=r),i}function o(t,e,n){for(var r,i,a=f.range(n.start,n.stop+n.step/2,n.step).map(function(t){return{value:n.value(t),count:0}}),s=0;s<t.length;++s)if(r=e?e(t[s]):t[s],d.isValid(r)){if(i=n.index(r),0>i||i>=a.length||!isFinite(i))continue;a[i].count+=1}return a.bins=n,a}function l(t,e,n){var r=u.unique(t,e),i=u.count.map(t,e);return r.map(function(t){return{value:t,count:i[t]}}).sort(d.comparator(n?"-count":"+value"))}var u=t("../stats"),c=t("../import/type"),d=t("../util"),f=t("../generate"),h=t("./bins"),p={integer:1,number:1,date:1};e.exports={$bin:r,histogram:i}},{"../generate":10,"../import/type":19,"../stats":22,"../util":25,"./bins":8}],10:[function(t,e,n){var r=e.exports={};r.repeat=function(t,e){var n,r=Array(e);for(n=0;e>n;++n)r[n]=t;return r},r.zeros=function(t){return r.repeat(0,t)},r.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n==1/0)throw new Error("Infinite range");var r,i=[],a=-1;if(0>n)for(;(r=t+n*++a)>e;)i.push(r);else for(;(r=t+n*++a)<e;)i.push(r);return i},r.random={},r.random.uniform=function(t,e){void 0===e&&(e=void 0===t?1:t,t=0);var n=e-t,i=function(){return t+n*Math.random()};return i.samples=function(t){return r.zeros(t).map(i)},i},r.random.integer=function(t,e){void 0===e&&(e=t,t=0);var n=e-t,i=function(){return t+Math.floor(n*Math.random())};return i.samples=function(t){return r.zeros(t).map(i)},i},r.random.normal=function(t,e){t=t||0,e=e||1;var n,i=function(){var r,i,a=0,s=0;if(void 0!==n)return a=n,n=void 0,a;do a=2*Math.random()-1,s=2*Math.random()-1,r=a*a+s*s;while(0===r||r>1);return i=Math.sqrt(-2*Math.log(r)/r),n=t+s*i*e,t+a*i*e};return i.samples=function(t){return r.zeros(t).map(i)},i}},{}],11:[function(t,e,n){(function(n){function r(t,e){if(t){var n=e.header;t=(n?n.join(e.delimiter)+"\n":"")+t}return a.dsv(e.delimiter).parse(t)}var i=t("../../util"),a="undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null;r.delimiter=function(t){var e={delimiter:t};return function(t,n){return r(t,n?i.extend(n,e):e)}},e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../util":25}],12:[function(t,e,n){var r=t("./dsv");e.exports={json:t("./json"),topojson:t("./topojson"),treejson:t("./treejson"),dsv:r,csv:r.delimiter(","),tsv:r.delimiter(" ")}},{"./dsv":11,"./json":13,"./topojson":14,"./treejson":15}],13:[function(t,e,n){var r=t("../../util");e.exports=function(t,e){var n=r.isObject(t)&&!r.isBuffer(t)?t:JSON.parse(t);return e&&e.property&&(n=r.accessor(e.property)(n)),n}},{"../../util":25}],14:[function(t,e,n){(function(n){var r=t("./json"),i=function(t,e){var n=i.topojson;if(null==n)throw Error("TopoJSON library not loaded.");var a,s=r(t,e);if(e&&e.feature){if(a=s.objects[e.feature])return n.feature(s,a).features;throw Error("Invalid TopoJSON object: "+e.feature)}if(e&&e.mesh){if(a=s.objects[e.mesh])return[n.mesh(s,s.objects[e.mesh])];throw Error("Invalid TopoJSON object: "+e.mesh)}throw Error("Missing TopoJSON feature or mesh parameter.")};i.topojson="undefined"!=typeof window?window.topojson:"undefined"!=typeof n?n.topojson:null,e.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./json":13}],15:[function(t,e,n){function r(t,e){function n(t){r.push(t);var i=t[e];if(i)for(var a=0;a<i.length;++a)n(i[a],t)}e=e||"children";var r=[];return n(t,null),r.root=t,r}var i=t("./json");e.exports=function(t,e){return t=i(t,e),r(t,e&&e.children)}},{"./json":13}],16:[function(t,e,n){function r(e){var n=e.url;if(!n&&e.file)return d+e.file;if(e.baseURL&&!c.test(n)&&(u.startsWith(n,"/")||"/"===e.baseURL[e.baseURL.length-1]||(n="/"+n),n=e.baseURL+n),u.isNode&&u.startsWith(n,"//")&&(n=(e.defaultProtocol||"http")+":"+n),e.domainWhiteList){var r,i;if(u.isNode){var a=t("url").parse(n);r=a.hostname,i=null}else{var s=document.createElement("a");s.href=n,""===s.host&&(s.href=s.href),r=s.hostname.toLowerCase(),i=window.location.hostname}if(i!==r){var o=e.domainWhiteList.some(function(t){var e=r.length-t.length;return t===r||e>1&&"."===r[e-1]&&r.lastIndexOf(t)===e});if(!o)throw"URL is not whitelisted: "+n}}return n}function i(t,e){var n,r=e||function(t){throw t};try{n=i.sanitizeUrl(t)}catch(a){return void r(a)}return n?u.isNode?u.startsWith(n,d)?o(n.slice(d.length),e):n.indexOf("://")<0?o(n,e):l(n,e):s(n,e):void r("Invalid URL: "+n)}function a(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function s(t,e){function n(){var t=i.status;!t&&a(i)||t>=200&&300>t||304===t?e(null,i.responseText):e(i,null)}var r=!!e,i=new XMLHttpRequest;return!this.XDomainRequest||"withCredentials"in i||!/^(http(s)?:)?\/\//.test(t)||(i=new XDomainRequest),r&&("onload"in i?i.onload=i.onerror=n:i.onreadystatechange=function(){i.readyState>3&&n()}),i.open("GET",t,r),i.send(),!r&&a(i)?i.responseText:void 0}function o(e,n){var r=t("fs");return n?void t("fs").readFile(e,n):r.readFileSync(e,"utf8")}function l(e,n){return n?void t("request")(e,function(t,e,r){t||200!==e.statusCode?(t=t||"Load failed with response code "+e.statusCode+".",n(t,null)):n(null,r)}):t("sync-request")("GET",e).getBody()}var u=t("../util"),c=/^([A-Za-z]+:)?\/\//,d="file://";i.sanitizeUrl=r,e.exports=i},{"../util":25,fs:2,request:2,"sync-request":2,url:2}],17:[function(t,e,n){function r(t,e){var n=e&&e.type||"json";return t=o[n](t,e),e&&e.parse&&i(t,e.parse),t}function i(t,e){var n,r,i,o,l,u,c=t.length;for(e="auto"===e?s.inferAll(t):a.duplicate(e),n=a.keys(e),r=n.map(function(t){return s.parsers[e[t]]}),o=0,u=n.length;c>o;++o)for(i=t[o],l=0;u>l;++l)i[n[l]]=r[l](i[n[l]]);s.annotation(t,e)}var a=t("../util"),s=t("./type"),o=t("./formats");r.formats=o,e.exports=r},{"../util":25,"./formats":12,"./type":19}],18:[function(t,e,n){var r=t("../util"),i=t("./load"),a=t("./read");e.exports=r.keys(a.formats).reduce(function(t,e){return t[e]=function(t,n,s){r.isString(t)&&(t={url:t}),2===arguments.length&&r.isFunction(n)&&(s=n,n=void 0),n=r.extend({parse:"auto"},n),n.type=e;var o=i(t,s?function(t,e){if(t)return void s(t,null);try{e=a(e,n)}catch(r){s(r,null)}s(null,e)}:void 0);return o?a(o,n):void 0},t},{})},{"../util":25,"./load":16,"./read":17}],19:[function(t,e,n){function r(t,e){return e?void(t[u]=e):t&&t[u]||null}function i(t,e){e=l.$(e);var n,r,i;if(t[u]&&(n=e(t[u]),l.isString(n)))return n;for(r=0,i=t.length;!l.isValid(n)&&i>r;++r)n=e?e(t[r]):t[r];return l.isDate(n)?"date":l.isNumber(n)?"number":l.isBoolean(n)?"boolean":l.isString(n)?"string":null}function a(t,e){return t.length?(e=e||l.keys(t[0]),e.reduce(function(e,n){return e[n]=i(t,n),e},{})):void 0}function s(t,e){e=l.$(e);var n,r,i,a=["boolean","integer","number","date"];for(n=0;n<t.length;++n){for(i=e?e(t[n]):t[n],r=0;r<a.length;++r)l.isValid(i)&&!d[a[r]](i)&&(a.splice(r,1),r-=1);if(0===a.length)return"string"}return a[0]}function o(t,e){return e=e||l.keys(t[0]),e.reduce(function(e,n){return e[n]=s(t,n),e},{})}var l=t("../util"),u="__types__",c={"boolean":l["boolean"],integer:l.number,number:l.number,date:l.date,string:function(t){return""===t?null:t}},d={"boolean":function(t){return"true"===t||"false"===t||l.isBoolean(t)},integer:function(t){return d.number(t)&&(t=+t)===~~t},number:function(t){return!isNaN(+t)&&!l.isDate(t)},date:function(t){return!isNaN(Date.parse(t))}};i.annotation=r,i.all=a,i.infer=s,i.inferAll=o,i.parsers=c,e.exports=i},{"../util":25}],20:[function(t,e,n){var r=t("./util"),i={load:t("./import/load"),read:t("./import/read"),type:t("./import/type"),bins:t("./bins/bins"),$bin:t("./bins/histogram").$bin,groupby:t("./aggregate/groupby"),histogram:t("./bins/histogram").histogram,print:t("./print"),template:t("./template"),timeunits:t("./time-units")};r.extend(i,r),r.extend(i,t("./generate")),r.extend(i,t("./stats")),r.extend(i,t("./import/readers")),e.exports=i},{"./aggregate/groupby":6,"./bins/bins":8,"./bins/histogram":9,"./generate":10,"./import/load":16,"./import/read":17,"./import/readers":18,"./import/type":19,"./print":21,"./stats":22,"./template":23,"./time-units":24,"./util":25}],21:[function(t,e,n){function r(t){return["valid: "+t.valid,"missing: "+t.missing,"distinct: "+t.distinct,"min: "+t.min,"max: "+t.max,"median: "+t.median,"mean: "+t.mean,"stdev: "+t.stdev,"modeskew: "+t.modeskew].join("\n")}function i(t){var e=["valid: "+t.valid,"missing: "+t.missing,"distinct: "+t.distinct,"top values: "],n=t.unique,r=a.keys(n).sort(function(t,e){return n[e]-n[t]}).slice(0,6).map(function(t){return" '"+t+"' ("+n[t]+")"});return e.concat(r).join("\n")}var a=t("./util"),s=t("./import/type"),o=t("./stats"),l=t("./template"),u={date:'|time:"%m/%d/%Y %H:%M:%S"',number:'|number:".4f"',integer:'|number:"d"'},c={number:"left",integer:"left"};e.exports.table=function(t,e){e=a.extend({separator:" ",minwidth:8,maxwidth:15},e);var n=e.fields||a.keys(t[0]),r=s.all(t);if(e.start||e.limit){var i=e.start||0,d=e.limit?i+e.limit:t.length;t=t.slice(i,d)}var f=n.map(function(n){var i=u[r[n]]||"",a=l("{{"+n+i+"}}"),s=o.max(t,function(t){return a(t).length});return s=Math.max(Math.min(n.length,e.minwidth),s),e.maxwidth>0?Math.min(s,e.maxwidth):s}),h=n.map(function(t,e){return a.truncate(a.pad(t,f[e],"center"),f[e])}).join(e.separator),p=l(n.map(function(t,e){return"{{"+t+(u[r[t]]||"")+("|pad:"+f[e]+","+(c[r[t]]||"right"))+("|truncate:"+f[e])+"}}"}).join(e.separator));return h+"\n"+t.map(p).join("\n")},e.exports.summary=function(t){t=t?t.__summary__?t:o.summary(t):this;var e,n,a=[];for(e=0,n=t.length;n>e;++e)a.push("-- "+t[e].field+" --"),a.push("string"===t[e].type||t[e].distinct<10?i(t[e]):r(t[e])),a.push("");return a.join("\n")}},{"./import/type":19,"./stats":22,"./template":23,"./util":25}],22:[function(t,e,n){var r=t("./util"),i=t("./import/type"),a=t("./generate"),s={};s.unique=function(t,e,n){e=r.$(e),n=n||[];var i,a,s,o={};for(a=0,s=t.length;s>a;++a)i=e?e(t[a]):t[a],i in o||(o[i]=1,n.push(i));return n},s.count=function(t){return t&&t.length||0},s.count.valid=function(t,e){e=r.$(e);var n,i,a,s=0;for(i=0,a=t.length;a>i;++i)n=e?e(t[i]):t[i],r.isValid(n)&&(s+=1);return s},s.count.missing=function(t,e){e=r.$(e);var n,i,a,s=0;for(i=0,a=t.length;a>i;++i)n=e?e(t[i]):t[i],null==n&&(s+=1);return s},s.count.distinct=function(t,e){e=r.$(e);var n,i,a,s={},o=0;for(i=0,a=t.length;a>i;++i)n=e?e(t[i]):t[i],n in s||(s[n]=1,o+=1);return o},s.count.map=function(t,e){e=r.$(e);var n,i,a,s={};for(i=0,a=t.length;a>i;++i)n=e?e(t[i]):t[i],s[n]=n in s?s[n]+1:1;return s},s.median=function(t,e){return e&&(t=t.map(r.$(e))),t=t.filter(r.isValid).sort(r.cmp),s.quantile(t,.5)},s.quartile=function(t,e){e&&(t=t.map(r.$(e))),t=t.filter(r.isValid).sort(r.cmp);var n=s.quantile;return[n(t,.25),n(t,.5),n(t,.75)]},s.quantile=function(t,e,n){void 0===n&&(n=e,e=r.identity),e=r.$(e);var i=(t.length-1)*n+1,a=Math.floor(i),s=+e(t[a-1]),o=i-a;return o?s+o*(e(t[a])-s):s},s.sum=function(t,e){e=r.$(e);for(var n,i=0,a=0,s=t.length;s>a;++a)n=e?e(t[a]):t[a],r.isValid(n)&&(i+=n);return i},s.mean=function(t,e){e=r.$(e);var n,i,a,s,o,l=0;for(i=0,s=0,a=t.length;a>i;++i)o=e?e(t[i]):t[i],r.isValid(o)&&(n=o-l,l+=n/++s);return l},s.variance=function(t,e){if(e=r.$(e),!r.isArray(t)||t.length<2)return 0;var n,i,a,s,o=0,l=0;for(i=0,a=0;i<t.length;++i)s=e?e(t[i]):t[i],r.isValid(s)&&(n=s-o,o+=n/++a,l+=n*(s-o));return l/=a-1},s.stdev=function(t,e){return Math.sqrt(s.variance(t,e))},s.modeskew=function(t,e){var n=s.mean(t,e),r=s.median(t,e),i=s.stdev(t,e);return 0===i?0:(n-r)/i},s.min=function(t,e){return s.extent(t,e)[0]},s.max=function(t,e){return s.extent(t,e)[1]},s.extent=function(t,e){e=r.$(e);var n,i,a,s,o=t.length;for(s=0;o>s;++s)if(a=e?e(t[s]):t[s],r.isValid(a)){n=i=a;break}for(;o>s;++s)a=e?e(t[s]):t[s],r.isValid(a)&&(n>a&&(n=a),a>i&&(i=a));return[n,i]},s.extent.index=function(t,e){e=r.$(e);var n,i,a,s,o=-1,l=-1,u=t.length;for(s=0;u>s;++s)if(a=e?e(t[s]):t[s],r.isValid(a)){n=i=a,o=l=s;break}for(;u>s;++s)a=e?e(t[s]):t[s],r.isValid(a)&&(n>a&&(n=a,o=s),a>i&&(i=a,l=s));return[o,l]},s.dot=function(t,e,n){var i,a,s=0;if(n)for(e=r.$(e),n=r.$(n),i=0;i<t.length;++i)a=e(t[i])*n(t[i]),a===a&&(s+=a);else{if(t.length!==e.length)throw Error("Array lengths must match.");for(i=0;i<t.length;++i)a=t[i]*e[i],a===a&&(s+=a)}return s},s.rank=function(t,e){e=r.$(e)||r.identity;var n,i,a,s=t.map(function(t,n){return{idx:n,val:e(t)}}).sort(r.comparator("val")),o=t.length,l=Array(o),u=-1,c={};for(n=0;o>n;++n){if(i=s[n].val,0>u&&c===i)u=n-1;else if(u>-1&&c!==i){for(a=1+(n-1+u)/2;n>u;++u)l[s[u].idx]=a;u=-1}l[s[n].idx]=n+1,c=i}if(u>-1)for(a=1+(o-1+u)/2;o>u;++u)l[s[u].idx]=a;return l},s.cor=function(t,e,n){var i=n;n=i?t.map(r.$(n)):e,e=i?t.map(r.$(e)):t;var a=s.dot(e,n),o=s.mean(e),l=s.mean(n),u=s.stdev(e),c=s.stdev(n),d=t.length;return(a-d*o*l)/((d-1)*u*c)},s.cor.rank=function(t,e,n){var i,a,o,l=n?s.rank(t,r.$(e)):s.rank(t),u=n?s.rank(t,r.$(n)):s.rank(e),c=t.length;for(i=0,a=0;c>i;++i)o=l[i]-u[i],a+=o*o;return 1-6*a/(c*(c*c-1))},s.cor.dist=function(t,e,n){var i,a,o,l,u=n?t.map(r.$(e)):t,c=n?t.map(r.$(n)):e,d=s.dist.mat(u),f=s.dist.mat(c),h=d.length;for(i=0,a=0,o=0,l=0;h>i;++i)a+=d[i]*d[i],o+=f[i]*f[i],l+=d[i]*f[i];return Math.sqrt(l/Math.sqrt(a*o))},s.dist=function(t,e,n,i){var a,s,o=r.isFunction(n)||r.isString(n),l=t,u=o?t:e,c=o?i:n,d=2===c||null==c,f=t.length,h=0;for(o&&(e=r.$(e),n=r.$(n)),s=0;f>s;++s)a=o?e(l[s])-n(u[s]):l[s]-u[s],h+=d?a*a:Math.pow(Math.abs(a),c);return d?Math.sqrt(h):Math.pow(h,1/c)},s.dist.mat=function(t){var e,n,r,i=t.length,s=i*i,o=Array(s),l=a.zeros(i),u=0;for(n=0;i>n;++n)for(o[n*i+n]=0,r=n+1;i>r;++r)o[n*i+r]=e=Math.abs(t[n]-t[r]),o[r*i+n]=e,l[n]+=e,l[r]+=e;for(n=0;i>n;++n)u+=l[n],l[n]/=i;for(u/=s,n=0;i>n;++n)for(r=n;i>r;++r)o[n*i+r]+=u-l[n]-l[r],o[r*i+n]=o[n*i+r];return o},s.entropy=function(t,e){e=r.$(e);var n,i,a=0,s=0,o=t.length;for(n=0;o>n;++n)a+=e?e(t[n]):t[n];if(0===a)return 0;for(n=0;o>n;++n)i=(e?e(t[n]):t[n])/a,i&&(s+=i*Math.log(i));return-s/Math.LN2},s.mutual=function(t,e,n,i){var a,s,o,l=i?t.map(r.$(e)):t,u=i?t.map(r.$(n)):e,c=i?t.map(r.$(i)):n,d={},f={},h=c.length,p=0,g=0,m=0;for(o=0;h>o;++o)d[l[o]]=0,f[u[o]]=0;for(o=0;h>o;++o)d[l[o]]+=c[o],f[u[o]]+=c[o],p+=c[o];for(s=1/(p*Math.LN2),o=0;h>o;++o)0!==c[o]&&(a=p*c[o]/(d[l[o]]*f[u[o]]),g+=c[o]*s*Math.log(a),m+=c[o]*s*Math.log(c[o]/p));return[g,1+g/m]},s.mutual.info=function(t,e,n,r){return s.mutual(t,e,n,r)[0]},s.mutual.dist=function(t,e,n,r){return s.mutual(t,e,n,r)[1]},s.profile=function(t,e){var n,a,o,l,u,c=0,d=0,f=0,h=0,p=null,g=null,m=0,v=[],y={};for(o=0;o<t.length;++o)l=e?e(t[o]):t[o],y[l]=l in y?y[l]+1:(h+=1,1),null==l?++f:r.isValid(l)&&(u="string"==typeof l?l.length:l,(null===p||p>u)&&(p=u),(null===g||u>g)&&(g=u),n=u-c,c+=n/++d,m+=n*(u-c),v.push(u));return m/=d-1,a=Math.sqrt(m),v.sort(r.cmp),{type:i(t,e),unique:y,count:t.length,valid:d,missing:f,distinct:h,min:p,max:g,mean:c,stdev:a,median:l=s.quantile(v,.5),q1:s.quantile(v,.25),q3:s.quantile(v,.75),modeskew:0===a?0:(c-l)/a}},s.summary=function(t,e){e=e||r.keys(t[0]);var n=e.map(function(e){var n=s.profile(t,r.$(e));return n.field=e,n});return n.__summary__=!0,n},e.exports=s},{"./generate":10,"./import/type":19,"./util":25}],23:[function(t,e,n){(function(n){function r(t){var e=i(t,"d");return e="var __t; return "+e+";",new Function("d",e).bind(c)}function i(t,e,n){e=e||"obj";var r=0,i="'",o=d;return t.replace(o,function(o,l,u){return i+=t.slice(r,u).replace(h,s),r=u+o.length,l&&(i+="'\n+((__t=("+a(l,e,n)+"))==null?'':__t)+\n'"),o}),i+"'"}function a(t,e,n){function r(t){return t=t||"",c?(c=!1,d="String("+d+")"+t):d+=t,d}function i(){return"(typeof "+d+'==="number"?new Date('+d+"):"+d+")"}var a=t.split("|"),s=a.shift().trim(),c=!0;n&&(n[s]=1);var d=l.field(s).map(l.str).join("][");d=e+"["+d+"]";for(var f=0;f<a.length;++f){var h,p,g,m=a[f],v=null;switch((h=m.indexOf(":"))>0&&(m=m.slice(0,h),v=a[f].slice(h+1).split(",").map(function(t){return t.trim()})),m=m.trim()){case"length":r(".length");break;case"lower":r(".toLowerCase()");break;case"upper":r(".toUpperCase()");break;case"lower-locale":r(".toLocaleLowerCase()");break;case"upper-locale":r(".toLocaleUpperCase()");break;case"trim":r(".trim()");break;case"left":p=l.number(v[0]),r(".slice(0,"+p+")");break;case"right":p=l.number(v[0]),r(".slice(-"+p+")");break;case"mid":p=l.number(v[0]),g=p+l.number(v[1]),r(".slice(+"+p+","+g+")");break;case"slice":p=l.number(v[0]),r(".slice("+p+(v.length>1?","+l.number(v[1]):"")+")");break;case"truncate":p=l.number(v[0]),g=v[1],g="left"!==g&&"middle"!==g&&"center"!==g?"right":g,d="this.truncate("+r()+","+p+",'"+g+"')";break;case"pad":p=l.number(v[0]),g=v[1],g="left"!==g&&"middle"!==g&&"center"!==g?"right":g,d="this.pad("+r()+","+p+",'"+g+"')";break;case"number":p=o(v[0],u.format),c=!1,d="this.formats["+p+"]("+d+")";break;case"time":p=o(v[0],u.time.format),c=!1,d="this.formats["+p+"]("+i()+")";break;default:throw Error("Unrecognized template filter: "+m)}}return d}function s(t){return"\\"+f[t]}function o(t,e){if(!("'"===t[0]&&"'"===t[t.length-1]||'"'===t[0]&&'"'===t[t.length-1]))throw Error("Format pattern must be quoted: "+t);if(t=t.slice(1,-1),!c.format_map[t]){var n=e(t),r=c.formats.length;c.formats.push(n),c.format_map[t]=r}return c.format_map[t]}var l=t("./util"),u="undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null,c={formats:[],format_map:{},truncate:l.truncate,pad:l.pad};r.source=i,r.context=c,e.exports=r,r.clearFormatCache=function(){c.formats=[],c.format_map={}};var d=/\{\{(.+?)\}\}|$/g,f={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},h=/\\|'|\r|\n|\u2028|\u2029/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./util":25}],24:[function(t,e,n){function r(t){return"number"==typeof t}var i=[[31536e6,5],[7776e6,4],[2592e6,4],[12096e5,3],[6048e5,3],[1728e5,3],[864e5,3],[432e5,2],[216e5,2],[108e5,2],[36e5,2],[18e5,1],[9e5,1],[3e5,1],[6e4,1],[3e4,0],[15e3,0],[5e3,0],[1e3,0]],a=[{type:"second",minstep:1,format:"%Y %b %-d %H:%M:%S.%L",date:function(t){return new Date(1e3*t)},unit:function(t){return+t/1e3}},{type:"minute",minstep:1,format:"%Y %b %-d %H:%M",date:function(t){return new Date(6e4*t)},unit:function(t){return~~(+t/6e4)}},{type:"hour",minstep:1,format:"%Y %b %-d %H:00",date:function(t){return new Date(36e5*t)},unit:function(t){return~~(+t/36e5)}},{type:"day",minstep:1,step:[1,7],format:"%Y %b %-d",date:function(t){return new Date(864e5*t)},unit:function(t){return~~(+t/864e5)}},{type:"month",minstep:1,step:[1,3,6],format:"%b %Y",date:function(t){return new Date(Date.UTC(~~(t/12),t%12,1))},unit:function(t){return r(t)&&(t=new Date(t)),12*t.getUTCFullYear()+t.getUTCMonth()}},{type:"year",minstep:1,format:"%Y",date:function(t){return new Date(Date.UTC(t,0,1))},unit:function(t){return(r(t)?new Date(t):t).getUTCFullYear()}}],s={type:"minuteOfHour",
min:0,max:59,minstep:1,format:"%M",date:function(t){return new Date(Date.UTC(1970,0,1,0,t))},unit:function(t){return(r(t)?new Date(t):t).getUTCMinutes()}},o={type:"hourOfDay",min:0,max:23,minstep:1,format:"%H",date:function(t){return new Date(Date.UTC(1970,0,1,t))},unit:function(t){return(r(t)?new Date(t):t).getUTCHours()}},l={type:"dayOfWeek",min:0,max:6,step:[1],format:"%a",date:function(t){return new Date(Date.UTC(1970,0,4+t))},unit:function(t){return(r(t)?new Date(t):t).getUTCDay()}},u={type:"dayOfMonth",min:1,max:31,step:[1],format:"%-d",date:function(t){return new Date(Date.UTC(1970,0,t))},unit:function(t){return(r(t)?new Date(t):t).getUTCDate()}},c={type:"monthOfYear",min:0,max:11,step:[1],format:"%b",date:function(t){return new Date(Date.UTC(1970,t%12,1))},unit:function(t){return(r(t)?new Date(t):t).getUTCMonth()}},d={second:a[0],minute:a[1],hour:a[2],day:a[3],month:a[4],year:a[5],minuteOfHour:s,hourOfDay:o,dayOfWeek:l,dayOfMonth:u,monthOfYear:c,timesteps:a};d.find=function(t,e,n){var r,s,o,l=i[0];for(r=1,s=i.length;s>r;++r)if(l=i[r],t>l[0]){if(o=t/l[0],o>n)return a[i[r-1][1]];if(o>=e)return a[l[1]]}return a[i[i.length-1][1]]},e.exports=d},{}],25:[function(t,e,n){(function(n){function r(t){return t.replace(d,"$1\\'")}function i(t,e){var n,r="";for(n=0;t>n;++n)r+=e;return r}function a(t,e,n){var r=0,i=t.split(f);return t=n?(i=i.reverse()).filter(function(t){return r+=t.length,e>=r}).reverse():i.filter(function(t){return r+=t.length,e>=r}),t.length?t.join("").trim():i[0].slice(0,e)}var s=t("buffer"),o=t("./time-units"),l=e.exports={};l.isNode="undefined"!=typeof n&&"undefined"!=typeof n.stderr;var u="__name__";l.namedfunc=function(t,e){return e[u]=t,e},l.name=function(t){return null==t?null:t[u]},l.identity=function(t){return t},l["true"]=l.namedfunc("true",function(){return!0}),l["false"]=l.namedfunc("false",function(){return!1}),l.duplicate=function(t){return JSON.parse(JSON.stringify(t))},l.equal=function(t,e){return JSON.stringify(t)===JSON.stringify(e)},l.extend=function(t){for(var e,n,r=1,i=arguments.length;i>r;++r){e=arguments[r];for(n in e)t[n]=e[n]}return t},l.length=function(t){return null!=t&&null!=t.length?t.length:null},l.keys=function(t){var e,n=[];for(e in t)n.push(e);return n},l.vals=function(t){var e,n=[];for(e in t)n.push(t[e]);return n},l.toMap=function(t,e){return(e=l.$(e))?t.reduce(function(t,n){return t[e(n)]=1,t},{}):t.reduce(function(t,e){return t[e]=1,t},{})},l.keystr=function(t){var e=t.length;if(!e)return"";for(var n=String(t[0]),r=1;e>r;++r)n+="|"+String(t[r]);return n};var c=Object.prototype.toString;l.isObject=function(t){return t===Object(t)},l.isFunction=function(t){return"[object Function]"===c.call(t)},l.isString=function(t){return"string"==typeof value||"[object String]"===c.call(t)},l.isArray=Array.isArray||function(t){return"[object Array]"===c.call(t)},l.isNumber=function(t){return"number"==typeof t||"[object Number]"===c.call(t)},l.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"==c.call(t)},l.isDate=function(t){return"[object Date]"===c.call(t)},l.isValid=function(t){return null!=t&&t===t},l.isBuffer=s.Buffer&&s.Buffer.isBuffer||l["false"],l.number=function(t){return null==t||""===t?null:+t},l["boolean"]=function(t){return null==t||""===t?null:"false"===t?!1:!!t},l.date=function(t){return null==t||""===t?null:Date.parse(t)},l.array=function(t){return null!=t?l.isArray(t)?t:[t]:[]},l.str=function(t){return l.isArray(t)?"["+t.map(l.str)+"]":l.isObject(t)?JSON.stringify(t):l.isString(t)?"'"+r(t)+"'":t};var d=/(^|[^\\])'/g;l.field=function(t){return String(t).split("\\.").map(function(t){return t.split(".")}).reduce(function(t,e){return t.length&&(t[t.length-1]+="."+e.shift()),t.push.apply(t,e),t},[])},l.accessor=function(t){var e;return null==t||l.isFunction(t)?t:l.namedfunc(t,(e=l.field(t)).length>1?function(t){return e.reduce(function(t,e){return t[e]},t)}:function(e){return e[t]})},l.$=l.accessor,l.mutator=function(t){var e;return l.isString(t)&&(e=l.field(t)).length>1?function(t,n){for(var r=0;r<e.length-1;++r)t=t[e[r]];t[e[r]]=n}:function(e,n){e[t]=n}},l.$func=function(t,e){return function(n){n=l.$(n)||l.identity;var r=t+(l.name(n)?"_"+l.name(n):"");return l.namedfunc(r,function(t){return e(n(t))})}},l.$valid=l.$func("valid",l.isValid),l.$length=l.$func("length",l.length),l.$year=l.$func("year",o.year.unit),l.$month=l.$func("month",o.monthOfYear.unit),l.$date=l.$func("date",o.dayOfMonth.unit),l.$day=l.$func("day",o.dayOfWeek.unit),l.$hour=l.$func("hour",o.hourOfDay.unit),l.$minute=l.$func("minute",o.minuteOfHour.unit),l.$in=function(t,e){t=l.$(t);var n=l.isArray(e)?l.toMap(e):e;return function(e){return!!n[t(e)]}},l.comparator=function(t){var e=[];return void 0===t&&(t=[]),t=l.array(t).map(function(t){var n=1;return"-"===t[0]?(n=-1,t=t.slice(1)):"+"===t[0]&&(n=1,t=t.slice(1)),e.push(n),l.accessor(t)}),function(n,r){var i,a,s,o,l;for(i=0,a=t.length;a>i;++i){if(s=t[i],o=s(n),l=s(r),l>o)return-1*e[i];if(o>l)return e[i]}return 0}},l.cmp=function(t,e){return e>t?-1:t>e?1:t>=e?0:null===t?-1:null===e?1:0/0},l.numcmp=function(t,e){return t-e},l.stablesort=function(t,e,n){var r=t.reduce(function(t,e,r){return t[n(e)]=r,t},{});return t.sort(function(t,i){var a=e(t),s=e(i);return s>a?-1:a>s?1:r[n(t)]-r[n(i)]}),t},l.startsWith=String.prototype.startsWith?function(t,e){return t.startsWith(e)}:function(t,e){return 0===t.lastIndexOf(e,0)},l.pad=function(t,e,n,r){r=r||" ";var a=e-t.length;if(0>=a)return t;switch(n){case"left":return i(a,r)+t;case"middle":case"center":return i(Math.floor(a/2),r)+t+i(Math.ceil(a/2),r);default:return t+i(a,r)}},l.truncate=function(t,e,n,r,i){var s=t.length;if(e>=s)return t;i=void 0!==i?String(i):"…";var o=Math.max(0,e-i.length);switch(n){case"left":return i+(r?a(t,o,1):t.slice(s-o));case"middle":case"center":var l=Math.ceil(o/2),u=Math.floor(o/2);return(r?a(t,l):t.slice(0,l))+i+(r?a(t,u,1):t.slice(s-u));default:return(r?a(t,o):t.slice(0,o))+i}};var f=/([\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u2028\u2029\u3000\uFEFF])/}).call(this,t("_process"))},{"./time-units":24,_process:3,buffer:2}],26:[function(t,e,n){e.exports=t("./lib/heap")},{"./lib/heap":27}],27:[function(e,n,r){(function(){var e,i,a,s,o,l,u,c,d,f,h,p,g,m,v;a=Math.floor,f=Math.min,i=function(t,e){return e>t?-1:t>e?1:0},d=function(t,e,n,r,s){var o;if(null==n&&(n=0),null==s&&(s=i),0>n)throw new Error("lo must be non-negative");for(null==r&&(r=t.length);r>n;)o=a((n+r)/2),s(e,t[o])<0?r=o:n=o+1;return[].splice.apply(t,[n,n-n].concat(e)),e},l=function(t,e,n){return null==n&&(n=i),t.push(e),m(t,0,t.length-1,n)},o=function(t,e){var n,r;return null==e&&(e=i),n=t.pop(),t.length?(r=t[0],t[0]=n,v(t,0,e)):r=n,r},c=function(t,e,n){var r;return null==n&&(n=i),r=t[0],t[0]=e,v(t,0,n),r},u=function(t,e,n){var r;return null==n&&(n=i),t.length&&n(t[0],e)<0&&(r=[t[0],e],e=r[0],t[0]=r[1],v(t,0,n)),e},s=function(t,e){var n,r,s,o,l,u;for(null==e&&(e=i),o=function(){u=[];for(var e=0,n=a(t.length/2);n>=0?n>e:e>n;n>=0?e++:e--)u.push(e);return u}.apply(this).reverse(),l=[],r=0,s=o.length;s>r;r++)n=o[r],l.push(v(t,n,e));return l},g=function(t,e,n){var r;return null==n&&(n=i),r=t.indexOf(e),-1!==r?(m(t,0,r,n),v(t,r,n)):void 0},h=function(t,e,n){var r,a,o,l,c;if(null==n&&(n=i),a=t.slice(0,e),!a.length)return a;for(s(a,n),c=t.slice(e),o=0,l=c.length;l>o;o++)r=c[o],u(a,r,n);return a.sort(n).reverse()},p=function(t,e,n){var r,a,l,u,c,h,p,g,m,v;if(null==n&&(n=i),10*e<=t.length){if(u=t.slice(0,e).sort(n),!u.length)return u;for(l=u[u.length-1],g=t.slice(e),c=0,p=g.length;p>c;c++)r=g[c],n(r,l)<0&&(d(u,r,0,null,n),u.pop(),l=u[u.length-1]);return u}for(s(t,n),v=[],a=h=0,m=f(e,t.length);m>=0?m>h:h>m;a=m>=0?++h:--h)v.push(o(t,n));return v},m=function(t,e,n,r){var a,s,o;for(null==r&&(r=i),a=t[n];n>e&&(o=n-1>>1,s=t[o],r(a,s)<0);)t[n]=s,n=o;return t[n]=a},v=function(t,e,n){var r,a,s,o,l;for(null==n&&(n=i),a=t.length,l=e,s=t[e],r=2*e+1;a>r;)o=r+1,a>o&&!(n(t[r],t[o])<0)&&(r=o),t[e]=t[r],e=r,r=2*e+1;return t[e]=s,m(t,l,e,n)},e=function(){function t(t){this.cmp=null!=t?t:i,this.nodes=[]}return t.push=l,t.pop=o,t.replace=c,t.pushpop=u,t.heapify=s,t.updateItem=g,t.nlargest=h,t.nsmallest=p,t.prototype.push=function(t){return l(this.nodes,t,this.cmp)},t.prototype.pop=function(){return o(this.nodes,this.cmp)},t.prototype.peek=function(){return this.nodes[0]},t.prototype.contains=function(t){return-1!==this.nodes.indexOf(t)},t.prototype.replace=function(t){return c(this.nodes,t,this.cmp)},t.prototype.pushpop=function(t){return u(this.nodes,t,this.cmp)},t.prototype.heapify=function(){return s(this.nodes,this.cmp)},t.prototype.updateItem=function(t){return g(this.nodes,t,this.cmp)},t.prototype.clear=function(){return this.nodes=[]},t.prototype.empty=function(){return 0===this.nodes.length},t.prototype.size=function(){return this.nodes.length},t.prototype.clone=function(){var e;return e=new t,e.nodes=this.nodes.slice(0),e},t.prototype.toArray=function(){return this.nodes.slice(0)},t.prototype.insert=t.prototype.push,t.prototype.top=t.prototype.peek,t.prototype.front=t.prototype.peek,t.prototype.has=t.prototype.contains,t.prototype.copy=t.prototype.clone,t}(),function(e,i){return"function"==typeof t&&t.amd?t([],i):"object"==typeof r?n.exports=i():e.Heap=i()}(this,function(){return e})}).call(this)},{}],28:[function(t,e,n){(function(n){var r=t("datalib"),i=t("../render/canvas/index"),a=t("../render/svg-headless/index"),s=t("./View"),o=(t("../util/debug"),function(t,e,n){s.call(null,t,e,n),this._el="body",this._type="canvas",this._renderers={canvas:i,svg:a},this._canvas=null}),l=o.prototype=new s;l.renderer=function(t){return t&&(this._type=t),s.prototype.renderer.apply(this,arguments)},l.canvas=function(){return this._canvas},l.canvasAsync=function(t){function e(){0===n.pendingImages()?(r.render(),t(r._canvas)):setTimeout(e,10)}var n=this._renderer,r=this;n.pendingImages()>0?e():t(this._canvas)},l.svg=function(){return"svg"===this._type?this._renderer.svg():null},l.initialize=function(){var t=this._width,e=this._height,n=this._padding,r=this._bgcolor;return this._viewport&&(t=this._viewport[0]-(n?n.left+n.right:0),e=this._viewport[1]-(n?n.top+n.bottom:0)),this._renderer=this._renderer||new this._io.Renderer,"svg"===this._type?this.initSVG(t,e,n,r):this.initCanvas(t,e,n,r),this},l.initCanvas=function(t,e,i,a){var s="undefined"!=typeof window?window.canvas:"undefined"!=typeof n?n.canvas:null,o=t+(i?i.left+i.right:0),l=e+(i?i.top+i.bottom:0),u=this._canvas=r.isNode?new s(o,l):document.createElement("canvas"),c=u.getContext("2d");r.isNode||(u.setAttribute("width",o),u.setAttribute("height",l)),c.setTransform(1,0,0,1,i.left,i.top),this._renderer.context(c),this._renderer.resize(t,e,i),this._renderer.background(a)},l.initSVG=function(t,e,n,r){var i=t+(n?n.left+n.right:0),a=e+(n?n.top+n.bottom:0);this._renderer.initialize(this._el,i,a,n,r)},e.exports=o}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../render/canvas/index":62,"../render/svg-headless/index":66,"../util/debug":108,"./View":30,datalib:20}],29:[function(t,e,n){function r(){this._defs={},this._predicates={},this._scene=null,this._node=null,this._builder=null,this._reset={axes:!1,legends:!1},s.prototype.init.call(this)}function i(t){var e=this,n={};return a.isArray(t)?(t.forEach(function(t){n[t]=e._predicates[t]}),n):this._predicates[t]}var a=t("datalib"),s=t("../dataflow/Graph"),o=t("../dataflow/Node"),l=t("../scene/GroupBuilder"),u=t("../dataflow/changeset"),c=t("../scene/visit"),d=r.prototype=new s;d.defs=function(t){return arguments.length?(this._defs=t,this):this._defs},d.width=function(t){return this._defs&&(this._defs.width=t),this._defs&&this._defs.marks&&(this._defs.marks.width=t),this._scene&&(this._scene.items[0].width=t),this._reset.axes=!0,this},d.height=function(t){return this._defs&&(this._defs.height=t),this._defs&&this._defs.marks&&(this._defs.marks.height=t),this._scene&&(this._scene.items[0].height=t),this._reset.axes=!0,this},d.node=function(){return this._node||(this._node=new o(this))},d.data=function(){var t=s.prototype.data.apply(this,arguments);return arguments.length>1&&this.node().addListener(t.pipeline()[0]),t},d.predicate=function(t,e){return 1===arguments.length?i.call(this,t):this._predicates[t]=e},d.predicates=function(){return this._predicates},d.scene=function(t){if(this._scene&&this._scene.updateScenegraph&&this._scene.updateScenegraph(),!arguments.length)return this._scene;this._builder&&this.node().removeListener(this._builder.disconnect()),this._builder=new l(this,this._defs.marks,this._scene={}),this.node().addListener(this._builder.connect());var e=this._builder.pipeline();return e[e.length-1].addListener(t),this},d.reset=function(){return this._scene&&this._reset.axes&&(c(this._scene,function(t){t.axes&&t.axes.forEach(function(t){t.reset()})}),this._reset.axes=!1),this._scene&&this._reset.legends&&(c(this._scene,function(t){t.legends&&t.legends.forEach(function(t){t.reset()})}),this._reset.legends=!1),this},d.addListener=function(t){this.node().addListener(t)},d.removeListener=function(t){this.node().removeListener(t)},d.fire=function(t){t||(t=u.create()),this.propagate(t,this.node())},e.exports=r},{"../dataflow/Graph":33,"../dataflow/Node":34,"../dataflow/changeset":36,"../scene/GroupBuilder":75,"../scene/visit":81,datalib:20}],30:[function(t,e,n){(function(n){function r(t){var e=this._model.data(t),n=e.pipeline()[0],r=this._streamer,i=this._changeset,a={};if(s.keys(i.signals).length>0)throw"New signal values are not reflected in the visualization. Please call view.update() before updating data values.";return this._api[t]?this._api[t]:(a.insert=function(t){return e.insert(s.duplicate(t)),r.addListener(n),i.data[e.name()]=1,a},a.update=function(){return r.addListener(n),i.data[e.name()]=1,e.update.apply(e,arguments),a},a.remove=function(){return r.addListener(n),i.data[e.name()]=1,e.remove.apply(e,arguments),a},a.values=function(){return e.values()},this._api[t]=a)}function i(){var t=this;return t._renderNode=new o(t._model).router(!0),t._renderNode.evaluate=function(e){p(e,["rendering"]);var n=t._model.scene();e.trans?e.trans.start(function(e){t._renderer.render(n,e)}):t._renderer.render(n);var r,i;for(r in e.data)i=t._model.data(r),i.revises()&&g.finalize(i.last());return e},t._model.scene(t._renderNode),!0}var a="undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null,s=t("datalib"),o=t("../dataflow/Node"),l=t("../parse/streams"),u=t("../render/canvas/index"),c=t("../render/svg/index"),d=t("../scene/Encoder"),f=t("../scene/Transition"),h=t("../util/config"),p=t("../util/debug"),g=t("../dataflow/changeset"),m=function(t,e,n,r){this._el=null,this._model=null,this._width=this.__width=e||500,this._height=this.__height=n||300,this._bgcolor=null,this._autopad=1,this._padding={top:0,left:0,bottom:0,right:0},this._viewport=null,this._renderer=null,this._handler=null,this._streamer=null,this._changeset=null,this._renderers={canvas:u,svg:c},this._io=u,this._api={}},v=m.prototype;v.model=function(t){return arguments.length?(this._model!==t&&(this._model=t,this._streamer=new o(t),this._changeset=g.create(),this._handler&&this._handler.model(t)),this):this._model},v.data=function(t){var e=this;return arguments.length?s.isString(t)?r.call(e,t):(s.isObject(t)&&s.keys(t).forEach(function(n){var i=r.call(e,n);t[n](i)}),this):e._model.dataValues()},v.signal=function(t,e){var n=this._model,r=this._changeset,i=this._streamer,a=t;if(!arguments.length)return n.signalValues();if(1==arguments.length&&s.isString(t))return n.signalValues(t);if(s.keys(r.data).length>0)throw"New data values are not reflected in the visualization. Please call view.update() before updating signal values.";return 2==arguments.length&&(a={},a[t]=e),s.keys(a).forEach(function(t){i.addListener(n.signal(t).value(a[t])),r.signals[t]=1,r.reflow=!0}),this},v.width=function(t){return arguments.length?(this.__width!==t&&(this._width=this.__width=t,this.initialize(),this._strict&&(this._autopad=1)),this):this.__width},v.height=function(t){return arguments.length?(this.__height!==t&&(this._height=this.__height=t,this.initialize(),this._strict&&(this._autopad=1)),this):this.__height},v.background=function(t){return arguments.length?(this._bgcolor!==t&&(this._bgcolor=t,this.initialize()),this):this._bgcolor},v.padding=function(t){return arguments.length?(this._padding!==t&&(s.isString(t)?(this._autopad=1,this._padding={top:0,left:0,bottom:0,right:0},this._strict="strict"===t):(this._autopad=0,this._padding=t,this._strict=!1),this._el&&(this._renderer.resize(this._width,this._height,t),this._handler&&this._handler.padding(t))),this):this._padding},v.autopad=function(t){if(this._autopad<1)return this;this._autopad=0;var e=this._padding,n=this.model().scene().bounds,r=h.autopadInset,i=n.x1<0?Math.ceil(-n.x1)+r:0,a=n.y1<0?Math.ceil(-n.y1)+r:0,s=n.x2>this._width?Math.ceil(+n.x2-this._width)+r:0,n=n.y2>this._height?Math.ceil(+n.y2-this._height)+r:0;return e={left:i,top:a,right:s,bottom:n},this._strict?(this._autopad=0,this._padding=e,this._width=Math.max(0,this.__width-(i+s)),this._height=Math.max(0,this.__height-(a+n)),this._model.width(this._width).height(this._height).reset(),this.initialize().update({props:"enter"}).update({props:"update"})):this.padding(e).update(t),this},v.viewport=function(t){return arguments.length?(this._viewport!==t&&(this._viewport=t,this.initialize()),this):this._viewport},v.renderer=function(t){if(!arguments.length)return this._renderer;if(this._renderers[t])t=this._renderers[t];else{if(s.isString(t))throw new Error("Unknown renderer: "+t);if(!t)throw new Error("No renderer specified")}return this._io!==t&&(this._io=t,this._renderer=null,this.initialize(),this._build&&this.render()),this},v.initialize=function(t){var e,n=this,r=n._width,i=n._height,s=n._padding,o=n._bgcolor;return arguments.length&&null!==t||(t=this._el?this._el.parentNode:null)?(a.select(t).select("div.vega").remove(),this._el=t=a.select(t).append("div").attr("class","vega").style("position","relative").node(),n._viewport&&a.select(t).style("width",(n._viewport[0]||r)+"px").style("height",(n._viewport[1]||i)+"px").style("overflow","auto"),n._renderer=(n._renderer||new this._io.Renderer).initialize(t,r,i,s,o),e=n._handler,n._handler=(new this._io.Handler).initialize(t,s,n).model(n._model),e?e.handlers().forEach(function(t){n._handler.on(t.type,t.handler)}):l(this),this):this},v.update=function(t){t=t||{};var e=this,n=t.duration?new f(t.duration,t.ease):null,r=e._changeset;if(n&&(r.trans=n),void 0!==t.props){if(s.keys(r.data).length>0)throw"New data values are not reflected in the visualization. Please call view.update() before updating a specified property set.";r.reflow=!0,r.request=t.props}return e._build=e._build||i.call(this),t.items?(d.update(this._model,t.trans,t.props,t.items),e._renderNode.evaluate(r)):e._streamer.listeners().length?(e._model.propagate(r,e._streamer),e._streamer.disconnect()):e._model.fire(r),e._changeset=g.create(),e.autopad(t)},v.render=function(t){return this._renderer.render(this._model.scene(),t),this},v.on=function(){return this._handler.on.apply(this._handler,arguments),this},v.onSignal=function(t,e){return this._model.signal(t).on(e),this},v.off=function(){return this._handler.off.apply(this._handler,arguments),this},v.offSignal=function(t,e){return this._model.signal(t).off(e),this},m.factory=function(e){var n=t("./HeadlessView");return function(t){t=t||{};var r=e.defs(),i=(t.el?new m:new n).model(e).renderer(t.renderer||"canvas").width(r.width).height(r.height).background(r.background).padding(r.padding);return(t.el||!t.el&&i instanceof n)&&i.initialize(t.el),t.data&&i.data(t.data),i}},e.exports=m}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../dataflow/Node":34,"../dataflow/changeset":36,"../parse/streams":58,"../render/canvas/index":62,"../render/svg/index":70,"../scene/Encoder":74,"../scene/Transition":78,"../util/config":106,"../util/debug":108,"./HeadlessView":28,datalib:20}],31:[function(t,e,n){function r(t){return i.prototype.init.call(this,t),this._data=[],this.router(!0).collector(!0)}var i=t("./Node"),a=t("./changeset"),s=t("../util/debug"),o=(t("../util/constants"),r.prototype=new i);o.data=function(){return this._data},o.evaluate=function(t){if(s(t,["collecting"]),t.reflow)return t=a.create(t),t.mod=this._data.slice(),t;if(t.rem.length){var e=t.rem.reduce(function(t,e){return t[e._id]=1,t},{});this._data=this._data.filter(function(t){return 1!==e[t._id]})}return t.add.length&&(this._data=this._data.length?this._data.concat(t.add):t.add),t.sort&&this._data.sort(t.sort),t},e.exports=r},{"../util/constants":107,"../util/debug":108,"./Node":34,"./changeset":36}],32:[function(t,e,n){function r(t,e,n){this._graph=t,this._name=e,this._data=[],this._source=null,this._facet=n,this._input=s.create(),this._output=null,this._pipeline=null,this._collector=null,this._revises=!1}function i(t){void 0===t._prev&&(t._prev=d.SENTINEL)}var a=t("datalib"),s=t("./changeset"),o=t("./tuple"),l=t("./Node"),u=t("./Collector"),c=t("../util/debug"),d=t("../util/constants"),f=r.prototype;f.name=function(t){return arguments.length?(this._name=t,this):this._name},f.source=function(t){return arguments.length?this._source=this._graph.data(t):this._source},f.insert=function(t){var e=this._revises?null:void 0;return this._input.add=this._input.add.concat(a.array(t).map(function(t){return o.ingest(t,e)})),this},f.remove=function(t){var e=this._data.filter(t);return this._input.rem=this._input.rem.concat(e),this},f.update=function(t,e,n){{var r=this._input.mod,i=o.idMap(r);this._revises?null:void 0}return this._input.fields[e]=1,this._data.filter(t).forEach(function(t){var a=t[e],s=n(t);a!==s&&(o.set(t,e,s),1!==i[t._id]&&(r.push(t),i[t._id]=1))}),this},f.values=function(t){return arguments.length?(this._input.rem=this._data.slice(),t&&this.insert(t),this):this._collector?this._collector.data():this._data},f.revises=function(t){return arguments.length?(!this._revises&&t&&(this._data.forEach(i),this._input.add.forEach(i)),this._revises=this._revises||t,this):this._revises},f.last=function(){return this._output},f.fire=function(t){return t&&(this._input=t),this._graph.propagate(this._input,this._pipeline[0]),this},f.pipeline=function(t){var e=this;if(!arguments.length)return this._pipeline;t.length&&(e._collector=new u(this._graph),t.push(e._collector),e._revises=t.some(function(t){return t.revises()}));var n=new l(this._graph).router(!0).collector(!0);n.evaluate=function(t){c(t,["input",e._name]);var n,r=e._input,i=s.create(t);return a.keys(r.fields).forEach(function(t){i.fields[t]=1}),t.reflow?i.mod=e._data.slice():(r.rem.length&&(n=o.idMap(r.rem),e._data=e._data.filter(function(t){return 1!==n[t._id]})),r.add.length&&(e._data=e._data.concat(r.add)),e._input=s.create(),i.add=r.add,i.mod=r.mod,i.rem=r.rem),i.facet=e._facet,i},t.unshift(n);var r=new l(this._graph).router(!0).collector(!0);return r.evaluate=function(t){c(t,["output",e._name]);var n=s.create(t,!0);return e._facet&&(e._facet.values=e.values(),t.facet=null),e._output=t,n.data[e._name]=1,n},t.push(r),this._pipeline=t,this._graph.connect(e._pipeline),this},f.listener=function(){var t=new l(this._graph).router(!0),e=this,n=this._revises?null:void 0;return t.evaluate=function(t){e._srcMap=e._srcMap||{};var r=e._srcMap,i=s.create(t);return i.add=t.add.map(function(t){return r[t._id]=o.derive(t,void 0!==t._prev?t._prev:n)}),i.mod=t.mod.map(function(t){return r[t._id]}),i.rem=t.rem.map(function(t){var e=r[t._id];return r[t._id]=null,e}),e._input=i},t.addListener(this._pipeline[0]),t},f.addListener=function(t){return t instanceof r?this._collector?this._collector.addListener(t.listener()):this._pipeline[0].addListener(t.listener()):this._pipeline[this._pipeline.length-1].addListener(t),this},f.removeListener=function(t){this._pipeline[this._pipeline.length-1].removeListener(t)},f.listeners=function(t){return t?this._collector?this._collector.listeners():this._pipeline[0].listeners():this._pipeline[this._pipeline.length-1].listeners()},e.exports=r},{"../util/constants":107,"../util/debug":108,"./Collector":31,"./Node":34,"./changeset":36,"./tuple":37,datalib:20}],33:[function(t,e,n){function r(){}function i(t){var e=this;return s.isArray(t)?t.map(function(t){e._signals[t]}):this._signals[t]}function a(t,e){var n,r,i,a;for(i=0,a=t.length;a>i;++i)n=t[i],n.collector()&&(r=n),e(n,r,i)}var s=t("datalib"),o=t("heap"),l=t("./Datasource"),u=t("./Signal"),c=(t("./changeset"),t("../util/debug")),d=t("../util/constants"),f=r.prototype;f.init=function(){this._stamp=0,this._rank=0,this._data={},this._signals={},this.doNotPropagate={}},f.data=function(t,e,n){var r=this._data;return arguments.length?1===arguments.length?r[t]:r[t]=new l(this,t,n).pipeline(e):s.keys(r).map(function(t){return r[t]})},f.dataValues=function(t){var e=this;return arguments.length||(t=s.keys(this._data)),s.isArray(t)?t.reduce(function(t,n){return t[n]=e._data[n].values(),t},{}):this._data[t].values()},f.signal=function(t,e){return 1===arguments.length?i.call(this,t):this._signals[t]=new u(this,t,e)},f.signalValues=function(t){var e=this;return arguments.length||(t=s.keys(this._signals)),s.isArray(t)?t.reduce(function(t,n){return t[n]=e._signals[n].value(),t},{}):this._signals[t].value()},f.signalRef=function(t){s.isArray(t)||(t=s.field(t));var e=this.signal(t.shift()).value();if(t.length>0){var n=Function("s","return s["+t.map(s.str).join("][")+"]");e=n.call(null,e)}return e};var h=function(t,e){return t.rank==e.rank?t.pulse.reflow?1:-1:t.rank-e.rank};f.propagate=function(t,e){var n,r,i,a,s,l,u,d,f=new o(h);if(t.stamp)throw"Pulse already has a non-zero stamp";for(t.stamp=++this._stamp,f.push({node:e,pulse:t,rank:e.rank()});f.size()>0;)if(n=f.pop(),i=n.node,a=n.pulse,s=n.rank,r=i._listeners,d=a.reflow&&i.last()>=a.stamp,!d)if(s==i.rank()){if(a=this.evaluate(a,i),a!==this.doNotPropagate)for(l=0,u=r.length;u>l;l++)f.push({node:r[l],pulse:a,rank:r[l]._rank})}else c(a,["Rank mismatch",s,i.rank()]),f.push({node:i,pulse:a,rank:i.rank()})},f.connect=function(t){c({},["connecting"]);var e=this;return a(t,function(n,r,i){var a=n.dependency(d.DATA),s=n.dependency(d.SIGNALS);a.length>0&&a.forEach(function(t){e.data(t).revises(n.revises()).addListener(r)}),s.length>0&&s.forEach(function(t){e.signal(t).addListener(r)}),i>0&&t[i-1].addListener(t[i])}),t},f.disconnect=function(t){c({},["disconnecting"]);var e=this;return a(t,function(t,n,r){var i=t.dependency(d.DATA),a=t.dependency(d.SIGNALS);i.length>0&&i.forEach(function(t){e.data(t).removeListener(n)}),a.length>0&&a.forEach(function(t){e.signal(t).removeListener(n)}),t.disconnect()}),t},f.reevaluate=function(t,e){var n=!t.reflow||t.reflow&&e.last()>=t.stamp,r=!!t.add.length||!!t.rem.length||e.router();return r=r||!n,r||e.reevaluate(t)},f.evaluate=function(t,e){return this.reevaluate(t,e)?(t=e.evaluate(t),e.last(t.stamp),t):t},e.exports=r},{"../util/constants":107,"../util/debug":108,"./Datasource":32,"./Signal":35,"./changeset":36,datalib:20,heap:26}],34:[function(t,e,n){function r(t){return t&&this.init(t),this}var i=t("datalib"),a=t("../util/constants"),s=[a.DATA,a.FIELDS,a.SCALES,a.SIGNALS],o=1,l=r.prototype;l.init=function(t){return this._id=o++,this._graph=t,this._rank=++t._rank,this._stamp=0,this._listeners=[],this._registered={},this._deps={data:[],fields:[],scales:[],signals:[]},this._isRouter=!1,this._isCollector=!1,this._revises=!1,this},l.rank=function(){return this._rank},l.last=function(t){return arguments.length?(this._stamp=t,this):this._stamp},l.dependency=function(t,e){var n=this._deps[t];if(1===arguments.length)return n;if(null===e)for(;n.length>0;)n.pop();else!i.isArray(e)&&n.indexOf(e)<0?n.push(e):n.push.apply(n,i.array(e));return this},l.router=function(t){return arguments.length?(this._isRouter=!!t,this):this._isRouter},l.collector=function(t){return arguments.length?(this._isCollector=!!t,this):this._isCollector},l.revises=function(t){return arguments.length?(this._revises=!!t,this):this._revises},l.listeners=function(){return this._listeners},l.addListener=function(t){if(!(t instanceof r))throw"Listener is not a Node";if(this._registered[t._id])return this;if(this._listeners.push(t),this._registered[t._id]=1,this._rank>t._rank)for(var e=[t];e.length;){var n=e.splice(0,1)[0];n._rank=++this._graph._rank,e.push.apply(e,n._listeners)}return this},l.removeListener=function(t){for(var e=!1,n=0,r=this._listeners.length;r>n&&!e;n++)this._listeners[n]===t&&(this._listeners.splice(n,1),this._registered[t._id]=null,e=!0);return e},l.disconnect=function(){this._listeners=[],this._registered={}},l.evaluate=function(t){return t},l.reevaluate=function(t){var e=this,n=!1;return s.some(function(r){return n=n||e._deps[r].some(function(e){return!!t[r][e]})})},e.exports=r},{"../util/constants":107,datalib:20}],35:[function(t,e,n){function r(t,e,n){return i.prototype.init.call(this,t),this._name=e,this._value=n,this._handlers=[],this}var i=t("./Node"),a=t("./changeset"),s=r.prototype=new i;s.name=function(){return this._name},s.value=function(t){return arguments.length?(this._value=t,this):this._value},s.evaluate=function(t){return t.signals[this._name]?t:this._graph.doNotPropagate},s.fire=function(t){t||(t=a.create(null,!0)),t.signals[this._name]=1,this._graph.propagate(t,this)},s.on=function(t){var e=this,n=new i(this._graph);return n.evaluate=function(n){return t(e.name(),e.value()),n},this._handlers.push({handler:t,node:n}),this.addListener(n)},s.off=function(t){for(var e=this,n=this._handlers,r=n.length;--r>=0;)t&&n[r].handler!==t||e.removeListener(n.splice(r,1)[0].node);return this},e.exports=r},{"./Node":34,"./changeset":36}],36:[function(t,e,n){function r(t,e){var n={};return o(t,n),n.add=[],n.mod=[],n.rem=[],n.reflow=e,n}function a(t){t._prev=void 0===t._prev?void 0:l.SENTINEL}function s(t){for(i=0,len=t.add.length;i<len;++i)a(t.add[i]);for(i=0,len=t.mod.length;i<len;++i)a(t.mod[i])}function o(t,e){e.stamp=t?t.stamp:0,e.sort=t?t.sort:null,e.facet=t?t.facet:null,e.trans=t?t.trans:null,e.request=t?t.request:null,u.forEach(function(n){e[n]=t?t[n]:{}})}var l=t("../util/constants"),u=[l.DATA,l.FIELDS,l.SCALES,l.SIGNALS];e.exports={create:r,copy:o,finalize:s}},{"../util/constants":107}],37:[function(t,e,n){function r(t,e){return t=c.isObject(t)?t:{data:t},t._id=f++,t._prev=void 0!==e?e||d.SENTINEL:void 0,t}function i(t,e){return r(Object.create(t),e)}function a(t,e,n){var r=t[e];r!==n&&(s(t,e),t[e]=n)}function s(t,e){void 0!==t._prev&&(t._prev=t._prev===d.SENTINEL?{}:t._prev,t._prev[e]=t[e])}function o(t){return t._prev&&t._prev!==d.SENTINEL}function l(){f=1}function u(t){return t.reduce(function(t,e){return t[e._id]=1,t},{})}var c=t("datalib"),d=t("../util/constants"),f=1;e.exports={ingest:r,derive:i,set:a,set_prev:s,has_prev:o,reset:l,idMap:u}},{"../util/constants":107,datalib:20}],38:[function(t,e,n){var r=t("datalib");e.exports=function(e){function n(t){var e={fn:i(t),signals:r.keys(f),fields:r.keys(h)};return f={},h={},e}function i(t){if(t instanceof String)return t;var e=p[t.type];if(null==e)throw new Error("Unsupported type: "+t.type);return e(t)}e=e||{};var a=e.constants||t("./constants"),s=(e.functions||t("./functions"))(i),o=e.idWhiteList?r.toMap(e.idWhiteList):null,l=e.idBlackList?r.toMap(e.idBlackList):null,u=0,c="d",d="sg.",f={},h={},p={Literal:function(t){return t.raw},Identifier:function(t){var e=t.name;if(u>0)return e;if(a.hasOwnProperty(e))return a[e];if(o)return o.hasOwnProperty(e)?e:(f[e]=1,d+e);if(l&&l.hasOwnProperty(e))throw new Error("Illegal identifier: "+e);return e},Program:function(t){return t.body.map(i).join("\n")},MemberExpression:function(t){var e=!t.computed,n=i(t.object);e&&(u+=1);var r=i(t.property);return n===c&&(h[r]=1),e&&(u-=1),n+(e?"."+r:"["+r+"]")},CallExpression:function(t){if("Identifier"!==t.callee.type)throw new Error("Illegal callee type: "+t.callee.type);
var e=t.callee.name,n=t.arguments,r=s.hasOwnProperty(e)&&s[e];if(!r)throw new Error("Unrecognized function: "+e);return r instanceof Function?r(n):r+"("+n.map(i).join(",")+")"},ArrayExpression:function(t){return"["+t.elements.map(i).join(",")+"]"},BinaryExpression:function(t){return"("+i(t.left)+t.operator+i(t.right)+")"},UnaryExpression:function(t){return"("+t.operator+i(t.argument)+")"},UpdateExpression:function(t){return"("+(prefix?t.operator+i(t.argument):i(t.argument)+t.operator)+")"},ConditionalExpression:function(t){return"("+i(t.test)+"?"+i(t.consequent)+":"+i(t.alternate)+")"},LogicalExpression:function(t){return"("+i(t.left)+t.operator+i(t.right)+")"},ObjectExpression:function(t){return"{"+t.properties.map(i).join(",")+"}"},Property:function(t){u+=1;var e=i(t.key);return u-=1,e+":"+i(t.value)},ExpressionStatement:function(t){return i(t.expression)}};return n}},{"./constants":39,"./functions":40,datalib:20}],39:[function(t,e,n){e.exports={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2"}},{}],40:[function(t,e,n){t("datalib");e.exports=function(t){function e(e,n,r,i){var a=t(n[0]);return r&&(a=r+"("+a+")",dl.startsWith(r,"new ")&&(a="("+a+")")),a+"."+e+(0>i?"":0===i?"()":"("+n.slice(1).map(t).join(",")+")")}var n="new Date",r="String",i="RegExp";return{isNaN:"isNaN",isFinite:"isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",now:"Date.now",datetime:"new Date",date:function(t){return e("getDate",t,n,0)},day:function(t){return e("getDay",t,n,0)},year:function(t){return e("getFullYear",t,n,0)},month:function(t){return e("getMonth",t,n,0)},hours:function(t){return e("getHours",t,n,0)},minutes:function(t){return e("getMinutes",t,n,0)},seconds:function(t){return e("getSeconds",t,n,0)},milliseconds:function(t){return e("getMilliseconds",t,n,0)},time:function(t){return e("getTime",t,n,0)},timezoneoffset:function(t){return e("getTimezoneOffset",t,n,0)},utcdate:function(t){return e("getUTCDate",t,n,0)},utcday:function(t){return e("getUTCDay",t,n,0)},utcyear:function(t){return e("getUTCFullYear",t,n,0)},utcmonth:function(t){return e("getUTCMonth",t,n,0)},utchours:function(t){return e("getUTCHours",t,n,0)},utcminutes:function(t){return e("getUTCMinutes",t,n,0)},utcseconds:function(t){return e("getUTCSeconds",t,n,0)},utcmilliseconds:function(t){return e("getUTCMilliseconds",t,n,0)},length:function(t){return e("length",t,null,-1)},indexof:function(t){return e("indexOf",t,null)},lastindexof:function(t){return e("lastIndexOf",t,null)},parseFloat:"parseFloat",parseInt:"parseInt",upper:function(t){return e("toUpperCase",t,r,0)},lower:function(t){return e("toLowerCase",t,r,0)},slice:function(t){return e("slice",t,r)},substring:function(t){return e("substring",t,r)},test:function(t){return e("test",t,i)},"if":function(e){if(e.length<3)throw new Error("Missing arguments to if function.");if(e.length>3)throw new Error("Too many arguments to if function.");var n=e.map(t);return n[0]+"?"+n[1]+":"+n[2]}}}},{datalib:20}],41:[function(t,e,n){var r=t("./parser"),i=t("./codegen");e.exports={parse:function(t,e){return r.parse("("+t+")",e)},code:function(t){return i(t)}}},{"./codegen":38,"./parser":42}],42:[function(t,e,n){e.exports=function(){"use strict";function t(t,e){if(!t)throw new Error("ASSERT: "+e)}function e(t){return t>=48&&57>=t}function n(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function r(t){return"01234567".indexOf(t)>=0}function i(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0}function a(t){return 10===t||13===t||8232===t||8233===t}function s(t){return 36===t||95===t||t>=65&&90>=t||t>=97&&122>=t||92===t||t>=128&&Et.NonAsciiIdentifierStart.test(String.fromCharCode(t))}function o(t){return 36===t||95===t||t>=65&&90>=t||t>=97&&122>=t||t>=48&&57>=t||92===t||t>=128&&Et.NonAsciiIdentifierPart.test(String.fromCharCode(t))}function l(t){switch(t){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0;default:return!1}}function u(t){switch(t){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function c(t){if(St&&u(t))return!0;switch(t.length){case 2:return"if"===t||"in"===t||"do"===t;case 3:return"var"===t||"for"===t||"new"===t||"try"===t||"let"===t;case 4:return"this"===t||"else"===t||"case"===t||"void"===t||"with"===t||"enum"===t;case 5:return"while"===t||"break"===t||"catch"===t||"throw"===t||"const"===t||"yield"===t||"class"===t||"super"===t;case 6:return"return"===t||"typeof"===t||"delete"===t||"switch"===t||"export"===t||"import"===t;case 7:return"default"===t||"finally"===t||"extends"===t;case 8:return"function"===t||"continue"===t||"debugger"===t;case 10:return"instanceof"===t;default:return!1}}function d(){var t,e;for(e=0===At;Tt>At;)if(t=Lt.charCodeAt(At),i(t))++At;else{if(!a(t))break;++At,13===t&&10===Lt.charCodeAt(At)&&++At,++Mt,Ct=At,e=!0}}function f(t){var e,r,i,a=0;for(r="u"===t?4:2,e=0;r>e;++e){if(!(Tt>At&&n(Lt[At])))return"";i=Lt[At++],a=16*a+"0123456789abcdef".indexOf(i.toLowerCase())}return String.fromCharCode(a)}function h(){var t,e,r,i;for(t=Lt[At],e=0,"}"===t&&F({},kt.UnexpectedToken,"ILLEGAL");Tt>At&&(t=Lt[At++],n(t));)e=16*e+"0123456789abcdef".indexOf(t.toLowerCase());return(e>1114111||"}"!==t)&&F({},kt.UnexpectedToken,"ILLEGAL"),65535>=e?String.fromCharCode(e):(r=(e-65536>>10)+55296,i=(e-65536&1023)+56320,String.fromCharCode(r,i))}function p(){var t,e;for(t=Lt.charCodeAt(At++),e=String.fromCharCode(t),92===t&&(117!==Lt.charCodeAt(At)&&F({},kt.UnexpectedToken,"ILLEGAL"),++At,t=f("u"),t&&"\\"!==t&&s(t.charCodeAt(0))||F({},kt.UnexpectedToken,"ILLEGAL"),e=t);Tt>At&&(t=Lt.charCodeAt(At),o(t));)++At,e+=String.fromCharCode(t),92===t&&(e=e.substr(0,e.length-1),117!==Lt.charCodeAt(At)&&F({},kt.UnexpectedToken,"ILLEGAL"),++At,t=f("u"),t&&"\\"!==t&&o(t.charCodeAt(0))||F({},kt.UnexpectedToken,"ILLEGAL"),e+=t);return e}function g(){var t,e;for(t=At++;Tt>At;){if(e=Lt.charCodeAt(At),92===e)return At=t,p();if(!o(e))break;++At}return Lt.slice(t,At)}function m(){var t,e,n;return t=At,e=92===Lt.charCodeAt(At)?p():g(),n=1===e.length?_t.Identifier:c(e)?_t.Keyword:"null"===e?_t.NullLiteral:"true"===e||"false"===e?_t.BooleanLiteral:_t.Identifier,{type:n,value:e,lineNumber:Mt,lineStart:Ct,start:t,end:At}}function v(){var t,e,n,r,i=At,a=Lt.charCodeAt(At),s=Lt[At];switch(a){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++At,It.tokenize&&(40===a?It.openParenToken=It.tokens.length:123===a&&(It.openCurlyToken=It.tokens.length)),{type:_t.Punctuator,value:String.fromCharCode(a),lineNumber:Mt,lineStart:Ct,start:i,end:At};default:if(t=Lt.charCodeAt(At+1),61===t)switch(a){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return At+=2,{type:_t.Punctuator,value:String.fromCharCode(a)+String.fromCharCode(t),lineNumber:Mt,lineStart:Ct,start:i,end:At};case 33:case 61:return At+=2,61===Lt.charCodeAt(At)&&++At,{type:_t.Punctuator,value:Lt.slice(i,At),lineNumber:Mt,lineStart:Ct,start:i,end:At}}}return r=Lt.substr(At,4),">>>="===r?(At+=4,{type:_t.Punctuator,value:r,lineNumber:Mt,lineStart:Ct,start:i,end:At}):(n=r.substr(0,3),">>>"===n||"<<="===n||">>="===n?(At+=3,{type:_t.Punctuator,value:n,lineNumber:Mt,lineStart:Ct,start:i,end:At}):(e=n.substr(0,2),s===e[1]&&"+-<>&|".indexOf(s)>=0||"=>"===e?(At+=2,{type:_t.Punctuator,value:e,lineNumber:Mt,lineStart:Ct,start:i,end:At}):"<>=!+-*%&|^/".indexOf(s)>=0?(++At,{type:_t.Punctuator,value:s,lineNumber:Mt,lineStart:Ct,start:i,end:At}):void F({},kt.UnexpectedToken,"ILLEGAL")))}function y(t){for(var e="";Tt>At&&n(Lt[At]);)e+=Lt[At++];return 0===e.length&&F({},kt.UnexpectedToken,"ILLEGAL"),s(Lt.charCodeAt(At))&&F({},kt.UnexpectedToken,"ILLEGAL"),{type:_t.NumericLiteral,value:parseInt("0x"+e,16),lineNumber:Mt,lineStart:Ct,start:t,end:At}}function _(t){for(var n="0"+Lt[At++];Tt>At&&r(Lt[At]);)n+=Lt[At++];return(s(Lt.charCodeAt(At))||e(Lt.charCodeAt(At)))&&F({},kt.UnexpectedToken,"ILLEGAL"),{type:_t.NumericLiteral,value:parseInt(n,8),octal:!0,lineNumber:Mt,lineStart:Ct,start:t,end:At}}function x(){var n,i,a;if(a=Lt[At],t(e(a.charCodeAt(0))||"."===a,"Numeric literal must start with a decimal digit or a decimal point"),i=At,n="","."!==a){if(n=Lt[At++],a=Lt[At],"0"===n){if("x"===a||"X"===a)return++At,y(i);if(r(a))return _(i);a&&e(a.charCodeAt(0))&&F({},kt.UnexpectedToken,"ILLEGAL")}for(;e(Lt.charCodeAt(At));)n+=Lt[At++];a=Lt[At]}if("."===a){for(n+=Lt[At++];e(Lt.charCodeAt(At));)n+=Lt[At++];a=Lt[At]}if("e"===a||"E"===a)if(n+=Lt[At++],a=Lt[At],("+"===a||"-"===a)&&(n+=Lt[At++]),e(Lt.charCodeAt(At)))for(;e(Lt.charCodeAt(At));)n+=Lt[At++];else F({},kt.UnexpectedToken,"ILLEGAL");return s(Lt.charCodeAt(At))&&F({},kt.UnexpectedToken,"ILLEGAL"),{type:_t.NumericLiteral,value:parseFloat(n),lineNumber:Mt,lineStart:Ct,start:i,end:At}}function b(){var e,n,i,s,o,l,u,c,d="",p=!1;for(u=Mt,c=Ct,e=Lt[At],t("'"===e||'"'===e,"String literal must starts with a quote"),n=At,++At;Tt>At;){if(i=Lt[At++],i===e){e="";break}if("\\"===i)if(i=Lt[At++],i&&a(i.charCodeAt(0)))++Mt,"\r"===i&&"\n"===Lt[At]&&++At,Ct=At;else switch(i){case"u":case"x":"{"===Lt[At]?(++At,d+=h()):(l=At,o=f(i),o?d+=o:(At=l,d+=i));break;case"n":d+="\n";break;case"r":d+="\r";break;case"t":d+=" ";break;case"b":d+="\b";break;case"f":d+="\f";break;case"v":d+="";break;default:r(i)?(s="01234567".indexOf(i),0!==s&&(p=!0),Tt>At&&r(Lt[At])&&(p=!0,s=8*s+"01234567".indexOf(Lt[At++]),"0123".indexOf(i)>=0&&Tt>At&&r(Lt[At])&&(s=8*s+"01234567".indexOf(Lt[At++]))),d+=String.fromCharCode(s)):d+=i}else{if(a(i.charCodeAt(0)))break;d+=i}}return""!==e&&F({},kt.UnexpectedToken,"ILLEGAL"),{type:_t.StringLiteral,value:d,octal:p,startLineNumber:u,startLineStart:c,lineNumber:Mt,lineStart:Ct,start:n,end:At}}function w(t,e){var n,r=t;e.indexOf("u")>=0&&(r=r.replace(/\\u\{([0-9a-fA-F]+)\}/g,function(t,e){return parseInt(e,16)<=1114111?"x":void F({},kt.InvalidRegExp)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{n=new RegExp(r)}catch(i){F({},kt.InvalidRegExp)}try{return new RegExp(t,e)}catch(a){return null}}function k(){var e,n,r,i,s;for(e=Lt[At],t("/"===e,"Regular expression literal must start with a slash"),n=Lt[At++],r=!1,i=!1;Tt>At;)if(e=Lt[At++],n+=e,"\\"===e)e=Lt[At++],a(e.charCodeAt(0))&&F({},kt.UnterminatedRegExp),n+=e;else if(a(e.charCodeAt(0)))F({},kt.UnterminatedRegExp);else if(r)"]"===e&&(r=!1);else{if("/"===e){i=!0;break}"["===e&&(r=!0)}return i||F({},kt.UnterminatedRegExp),s=n.substr(1,n.length-2),{value:s,literal:n}}function E(){var t,e,n,r;for(e="",n="";Tt>At&&(t=Lt[At],o(t.charCodeAt(0)));)if(++At,"\\"===t&&Tt>At)if(t=Lt[At],"u"===t){if(++At,r=At,t=f("u"))for(n+=t,e+="\\u";At>r;++r)e+=Lt[r];else At=r,n+="u",e+="\\u";R({},kt.UnexpectedToken,"ILLEGAL")}else e+="\\",R({},kt.UnexpectedToken,"ILLEGAL");else n+=t,e+=t;return{value:n,literal:e}}function L(){var t,e,n,r;return Nt=null,d(),t=At,e=k(),n=E(),r=w(e.value,n.value),It.tokenize?{type:_t.RegularExpression,value:r,regex:{pattern:e.value,flags:n.value},lineNumber:Mt,lineStart:Ct,start:t,end:At}:{literal:e.literal+n.literal,value:r,regex:{pattern:e.value,flags:n.value},start:t,end:At}}function S(){var t,e,n,r;return d(),t=At,e={start:{line:Mt,column:At-Ct}},n=L(),e.end={line:Mt,column:At-Ct},It.tokenize||(It.tokens.length>0&&(r=It.tokens[It.tokens.length-1],r.range[0]===t&&"Punctuator"===r.type&&("/"===r.value||"/="===r.value)&&It.tokens.pop()),It.tokens.push({type:"RegularExpression",value:n.literal,regex:n.regex,range:[t,At],loc:e})),n}function A(t){return t.type===_t.Identifier||t.type===_t.Keyword||t.type===_t.BooleanLiteral||t.type===_t.NullLiteral}function M(){var t,e;if(t=It.tokens[It.tokens.length-1],!t)return S();if("Punctuator"===t.type){if("]"===t.value)return v();if(")"===t.value)return e=It.tokens[It.openParenToken-1],!e||"Keyword"!==e.type||"if"!==e.value&&"while"!==e.value&&"for"!==e.value&&"with"!==e.value?v():S();if("}"===t.value){if(It.tokens[It.openCurlyToken-3]&&"Keyword"===It.tokens[It.openCurlyToken-3].type){if(e=It.tokens[It.openCurlyToken-4],!e)return v()}else{if(!It.tokens[It.openCurlyToken-4]||"Keyword"!==It.tokens[It.openCurlyToken-4].type)return v();if(e=It.tokens[It.openCurlyToken-5],!e)return S()}return v()}return S()}return"Keyword"===t.type&&"this"!==t.value?S():v()}function C(){var t;return d(),At>=Tt?{type:_t.EOF,lineNumber:Mt,lineStart:Ct,start:At,end:At}:(t=Lt.charCodeAt(At),s(t)?m():40===t||41===t||59===t?v():39===t||34===t?b():46===t?e(Lt.charCodeAt(At+1))?x():v():e(t)?x():It.tokenize&&47===t?M():v())}function T(){var t,e,n,r;return d(),t={start:{line:Mt,column:At-Ct}},e=C(),t.end={line:Mt,column:At-Ct},e.type!==_t.EOF&&(n=Lt.slice(e.start,e.end),r={type:xt[e.type],value:n,range:[e.start,e.end],loc:t},e.regex&&(r.regex={pattern:e.regex.pattern,flags:e.regex.flags}),It.tokens.push(r)),e}function N(){var t;return t=Nt,At=t.end,Mt=t.lineNumber,Ct=t.lineStart,Nt="undefined"!=typeof It.tokens?T():C(),At=t.end,Mt=t.lineNumber,Ct=t.lineStart,t}function P(){var t,e,n;t=At,e=Mt,n=Ct,Nt="undefined"!=typeof It.tokens?T():C(),At=t,Mt=e,Ct=n}function I(){this.line=Mt,this.column=At-Ct}function O(){this.start=new I,this.end=null}function D(t){this.start=t.type===_t.StringLiteral?{line:t.startLineNumber,column:t.start-t.startLineStart}:{line:t.lineNumber,column:t.start-t.lineStart},this.end=null}function z(){At=Nt.start,Nt.type===_t.StringLiteral?(Mt=Nt.startLineNumber,Ct=Nt.startLineStart):(Mt=Nt.lineNumber,Ct=Nt.lineStart),It.range&&(this.range=[At,0]),It.loc&&(this.loc=new O)}function U(t){It.range&&(this.range=[t.start,0]),It.loc&&(this.loc=new D(t))}function j(){var t,e,n,r;return t=At,e=Mt,n=Ct,d(),r=Mt!==e,At=t,Mt=e,Ct=n,r}function F(e,n){var r,i=Array.prototype.slice.call(arguments,2),a=n.replace(/%(\d)/g,function(e,n){return t(n<i.length,"Message reference must be in range"),i[n]});throw"number"==typeof e.lineNumber?(r=new Error("Line "+e.lineNumber+": "+a),r.index=e.start,r.lineNumber=e.lineNumber,r.column=e.start-Ct+1):(r=new Error("Line "+Mt+": "+a),r.index=At,r.lineNumber=Mt,r.column=At-Ct+1),r.description=a,r}function R(){try{F.apply(null,arguments)}catch(t){if(!It.errors)throw t;It.errors.push(t)}}function q(t){if(t.type===_t.EOF&&F(t,kt.UnexpectedEOS),t.type===_t.NumericLiteral&&F(t,kt.UnexpectedNumber),t.type===_t.StringLiteral&&F(t,kt.UnexpectedString),t.type===_t.Identifier&&F(t,kt.UnexpectedIdentifier),t.type===_t.Keyword){if(l(t.value))F(t,kt.UnexpectedReserved);else if(St&&u(t.value))return void R(t,kt.StrictReservedWord);F(t,kt.UnexpectedToken,t.value)}F(t,kt.UnexpectedToken,t.value)}function G(t){var e=N();(e.type!==_t.Punctuator||e.value!==t)&&q(e)}function W(t){if(It.errors){var e=Nt;e.type!==_t.Punctuator&&e.value!==t?R(e,kt.UnexpectedToken,e.value):N()}else G(t)}function B(t){return Nt.type===_t.Punctuator&&Nt.value===t}function V(t){return Nt.type===_t.Keyword&&Nt.value===t}function $(){var t;return 59===Lt.charCodeAt(At)||B(";")?void N():(t=Mt,d(),void(Mt===t&&(Nt.type===_t.EOF||B("}")||q(Nt))))}function H(){var t=[],e=new z;for(G("[");!B("]");)B(",")?(N(),t.push(null)):(t.push(ut()),B("]")||G(","));return N(),e.finishArrayExpression(t)}function Y(){var t,e=new z;return t=N(),t.type===_t.StringLiteral||t.type===_t.NumericLiteral?(St&&t.octal&&R(t,kt.StrictOctalLiteral),e.finishLiteral(t)):e.finishIdentifier(t.value)}function X(){var t,e,n,r,i=new z;return t=Nt,t.type===_t.Identifier?(n=Y(),G(":"),r=ut(),i.finishProperty("init",n,r)):t.type!==_t.EOF&&t.type!==_t.Punctuator?(e=Y(),G(":"),r=ut(),i.finishProperty("init",e,r)):void q(t)}function K(){var t,e,n,r,i=[],a={},s=String,o=new z;for(G("{");!B("}");)t=X(),e=t.key.type===bt.Identifier?t.key.name:s(t.key.value),r="init"===t.kind?wt.Data:"get"===t.kind?wt.Get:wt.Set,n="$"+e,Object.prototype.hasOwnProperty.call(a,n)?(a[n]===wt.Data?St&&r===wt.Data?R({},kt.StrictDuplicateProperty):r!==wt.Data&&R({},kt.AccessorDataProperty):r===wt.Data?R({},kt.AccessorDataProperty):a[n]&r&&R({},kt.AccessorGetSet),a[n]|=r):a[n]=r,i.push(t),B("}")||W(",");return G("}"),o.finishObjectExpression(i)}function J(){var t;return G("("),++Pt.parenthesisCount,t=ct(),G(")"),t}function Q(){var t,e,n,r;if(B("("))return J();if(B("["))return H();if(B("{"))return K();if(t=Nt.type,r=new z,t===_t.Identifier||Ot[Nt.value])n=r.finishIdentifier(N().value);else if(t===_t.StringLiteral||t===_t.NumericLiteral)St&&Nt.octal&&R(Nt,kt.StrictOctalLiteral),n=r.finishLiteral(N());else{if(t===_t.Keyword)throw new Error("Disabled.");t===_t.BooleanLiteral?(e=N(),e.value="true"===e.value,n=r.finishLiteral(e)):t===_t.NullLiteral?(e=N(),e.value=null,n=r.finishLiteral(e)):B("/")||B("/=")?(n=r.finishLiteral("undefined"!=typeof It.tokens?S():L()),P()):q(N())}return n}function Z(){var t=[];if(G("("),!B(")"))for(;Tt>At&&(t.push(ut()),!B(")"));)W(",");return G(")"),t}function tt(){var t,e=new z;return t=N(),A(t)||q(t),e.finishIdentifier(t.value)}function et(){return G("."),tt()}function nt(){var t;return G("["),t=ct(),G("]"),t}function rt(){var t,e,n,r,i=Pt.allowIn;for(r=Nt,Pt.allowIn=!0,t=Q();;)if(B("."))n=et(),t=new U(r).finishMemberExpression(".",t,n);else if(B("("))e=Z(),t=new U(r).finishCallExpression(t,e);else{if(!B("["))break;n=nt(),t=new U(r).finishMemberExpression("[",t,n)}return Pt.allowIn=i,t}function it(){var t;if(t=rt(),Nt.type===_t.Punctuator&&(B("++")||B("--"))&&!j())throw new Error("Disabled.");return t}function at(){var t,e,n;if(Nt.type!==_t.Punctuator&&Nt.type!==_t.Keyword)e=it();else{if(B("++")||B("--"))throw new Error("Disabled.");if(B("+")||B("-")||B("~")||B("!"))n=Nt,t=N(),e=at(),e=new U(n).finishUnaryExpression(t.value,e);else{if(V("delete")||V("void")||V("typeof"))throw new Error("Disabled.");e=it()}}return e}function st(t,e){var n=0;if(t.type!==_t.Punctuator&&t.type!==_t.Keyword)return 0;switch(t.value){case"||":n=1;break;case"&&":n=2;break;case"|":n=3;break;case"^":n=4;break;case"&":n=5;break;case"==":case"!=":case"===":case"!==":n=6;break;case"<":case">":case"<=":case">=":case"instanceof":n=7;break;case"in":n=e?7:0;break;case"<<":case">>":case">>>":n=8;break;case"+":case"-":n=9;break;case"*":case"/":case"%":n=11}return n}function ot(){var t,e,n,r,i,a,s,o,l,u;if(t=Nt,l=at(),r=Nt,i=st(r,Pt.allowIn),0===i)return l;for(r.prec=i,N(),e=[t,Nt],s=at(),a=[l,r,s];(i=st(Nt,Pt.allowIn))>0;){for(;a.length>2&&i<=a[a.length-2].prec;)s=a.pop(),o=a.pop().value,l=a.pop(),e.pop(),n=new U(e[e.length-1]).finishBinaryExpression(o,l,s),a.push(n);r=N(),r.prec=i,a.push(r),e.push(Nt),n=at(),a.push(n)}for(u=a.length-1,n=a[u],e.pop();u>1;)n=new U(e.pop()).finishBinaryExpression(a[u-1].value,a[u-2],n),u-=2;return n}function lt(){var t,e,n,r,i;return i=Nt,t=ot(),B("?")&&(N(),e=Pt.allowIn,Pt.allowIn=!0,n=ut(),Pt.allowIn=e,G(":"),r=ut(),t=new U(i).finishConditionalExpression(t,n,r)),t}function ut(){var t,e,n,r;return t=Pt.parenthesisCount,r=Nt,e=Nt,n=lt()}function ct(){var t;if(t=ut(),B(","))throw new Error("Disabled.");return t}function dt(t){var e=ct();return $(),t.finishExpressionStatement(e)}function ft(){var t,e,n=Nt.type;if(n===_t.EOF&&q(Nt),n===_t.Punctuator&&"{"===Nt.value)throw new Error("Disabled.");if(e=new z,n===_t.Punctuator)switch(Nt.value){case";":throw new Error("Disabled.");case"(":return dt(e)}else if(n===_t.Keyword)throw new Error("Disabled.");return t=ct(),$(),e.finishExpressionStatement(t)}function ht(){if(Nt.type===_t.Keyword)switch(Nt.value){case"const":case"let":throw new Error("Disabled.");case"function":throw new Error("Disabled.");default:return ft()}return Nt.type!==_t.EOF?ft():void 0}function pt(){for(var t,e,n,r,i=[];Tt>At&&(e=Nt,e.type===_t.StringLiteral)&&(t=ht(),i.push(t),t.expression.type===bt.Literal);)n=Lt.slice(e.start+1,e.end-1),"use strict"===n?(St=!0,r&&R(r,kt.StrictOctalLiteral)):!r&&e.octal&&(r=e);for(;Tt>At&&(t=ht(),"undefined"!=typeof t);)i.push(t);return i}function gt(){var t,e;return d(),P(),e=new z,St=!0,t=pt(),e.finishProgram(t)}function mt(){var t,e,n,r=[];for(t=0;t<It.tokens.length;++t)e=It.tokens[t],n={type:e.type,value:e.value},e.regex&&(n.regex={pattern:e.regex.pattern,flags:e.regex.flags}),It.range&&(n.range=e.range),It.loc&&(n.loc=e.loc),r.push(n);It.tokens=r}function vt(t,e){var n,r;n=String,"string"==typeof t||t instanceof String||(t=n(t)),Lt=t,At=0,Mt=Lt.length>0?1:0,Ct=0,Tt=Lt.length,Nt=null,Pt={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},It={},e=e||{},e.tokens=!0,It.tokens=[],It.tokenize=!0,It.openParenToken=-1,It.openCurlyToken=-1,It.range="boolean"==typeof e.range&&e.range,It.loc="boolean"==typeof e.loc&&e.loc,"boolean"==typeof e.tolerant&&e.tolerant&&(It.errors=[]);try{if(P(),Nt.type===_t.EOF)return It.tokens;for(N();Nt.type!==_t.EOF;)try{N()}catch(i){if(It.errors){It.errors.push(i);break}throw i}mt(),r=It.tokens,"undefined"!=typeof It.errors&&(r.errors=It.errors)}catch(a){throw a}finally{It={}}return r}function yt(t,e){var n,r;r=String,"string"==typeof t||t instanceof String||(t=r(t)),Lt=t,At=0,Mt=Lt.length>0?1:0,Ct=0,Tt=Lt.length,Nt=null,Pt={allowIn:!0,labelSet:{},parenthesisCount:0,inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},It={},"undefined"!=typeof e&&(It.range="boolean"==typeof e.range&&e.range,It.loc="boolean"==typeof e.loc&&e.loc,It.loc&&null!==e.source&&void 0!==e.source&&(It.source=r(e.source)),"boolean"==typeof e.tokens&&e.tokens&&(It.tokens=[]),"boolean"==typeof e.tolerant&&e.tolerant&&(It.errors=[]));try{n=gt(),"undefined"!=typeof It.tokens&&(mt(),n.tokens=It.tokens),"undefined"!=typeof It.errors&&(n.errors=It.errors)}catch(i){throw i}finally{It={}}return n}var _t,xt,bt,wt,kt,Et,Lt,St,At,Mt,Ct,Tt,Nt,Pt,It;_t={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9},xt={},xt[_t.BooleanLiteral]="Boolean",xt[_t.EOF]="<end>",xt[_t.Identifier]="Identifier",xt[_t.Keyword]="Keyword",xt[_t.NullLiteral]="Null",xt[_t.NumericLiteral]="Numeric",xt[_t.Punctuator]="Punctuator",xt[_t.StringLiteral]="String",xt[_t.RegularExpression]="RegularExpression",bt={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BinaryExpression:"BinaryExpression",CallExpression:"CallExpression",ConditionalExpression:"ConditionalExpression",ExpressionStatement:"ExpressionStatement",Identifier:"Identifier",Literal:"Literal",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression"},wt={Data:1,Get:2,Set:4},kt={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},Et={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԯԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఀ-ఃఅ-ఌఎ-ఐఒ-నప-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಁ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲഁ-ഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟ෦-෯ෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧ᪰-᪽ᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚝꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꧠ-ꧾꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︭︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},U.prototype=z.prototype={finish:function(){It.range&&(this.range[1]=At),It.loc&&(this.loc.end=new I,It.source&&(this.loc.source=It.source))},finishArrayExpression:function(t){return this.type=bt.ArrayExpression,this.elements=t,this.finish(),this},finishAssignmentExpression:function(t,e,n){return this.type=bt.AssignmentExpression,this.operator=t,this.left=e,this.right=n,this.finish(),this},finishBinaryExpression:function(t,e,n){return this.type="||"===t||"&&"===t?bt.LogicalExpression:bt.BinaryExpression,this.operator=t,this.left=e,this.right=n,this.finish(),this},finishCallExpression:function(t,e){return this.type=bt.CallExpression,this.callee=t,this.arguments=e,this.finish(),this},finishConditionalExpression:function(t,e,n){return this.type=bt.ConditionalExpression,this.test=t,this.consequent=e,this.alternate=n,this.finish(),this},finishExpressionStatement:function(t){return this.type=bt.ExpressionStatement,this.expression=t,this.finish(),this},finishIdentifier:function(t){return this.type=bt.Identifier,this.name=t,this.finish(),this},finishLiteral:function(t){return this.type=bt.Literal,this.value=t.value,this.raw=Lt.slice(t.start,t.end),t.regex&&("//"==this.raw&&(this.raw="/(?:)/"),this.regex=t.regex),this.finish(),this},finishMemberExpression:function(t,e,n){return this.type=bt.MemberExpression,this.computed="["===t,this.object=e,this.property=n,this.finish(),this},finishObjectExpression:function(t){return this.type=bt.ObjectExpression,this.properties=t,this.finish(),this},finishProgram:function(t){return this.type=bt.Program,this.body=t,this.finish(),this},finishProperty:function(t,e,n){return this.type=bt.Property,this.key=e,this.value=n,this.kind=t,this.finish(),this},finishUnaryExpression:function(t,e){return this.type="++"===t||"--"===t?bt.UpdateExpression:bt.UnaryExpression,this.operator=t,this.argument=e,this.prefix=!0,this.finish(),this}};var Ot={"if":1,"this":1};return{tokenize:vt,parse:yt}}()},{}],43:[function(t,e,n){function r(t,e,n,r){(e||[]).forEach(function(e,a){n[a]=n[a]||s(t),i(e,a,n[a],r)})}function i(t,e,n,r){void 0!==t.scale&&n.scale(r.scale(t.scale)),n.orient(t.orient||l[t.type]),n.offset(t.offset||0),n.layer(t.layer||"front"),n.grid(t.grid||!1),n.title(t.title||null),n.titleOffset(null!=t.titleOffset?t.titleOffset:o.axis.titleOffset),n.tickValues(t.values||null),n.tickFormat(t.format||null),n.tickSubdivide(t.subdivide||0),n.tickPadding(t.tickPadding||o.axis.padding);var i=[];if(void 0!==t.tickSize)for(var s=0;3>s;++s)i.push(t.tickSize);else{var u=o.axis.tickSize;i=[u,u,u]}null!=t.tickSizeMajor&&(i[0]=t.tickSizeMajor),null!=t.tickSizeMinor&&(i[1]=t.tickSizeMinor),null!=t.tickSizeEnd&&(i[2]=t.tickSizeEnd),i.length&&n.tickSize.apply(n,i),n.tickCount(t.ticks||o.axis.ticks);var c=t.properties;c&&c.ticks?(n.majorTickProperties(c.majorTicks?a.extend({},c.ticks,c.majorTicks):c.ticks),n.minorTickProperties(c.minorTicks?a.extend({},c.ticks,c.minorTicks):c.ticks)):(n.majorTickProperties(c&&c.majorTicks||{}),n.minorTickProperties(c&&c.minorTicks||{})),n.tickLabelProperties(c&&c.labels||{}),n.titleProperties(c&&c.title||{}),n.gridLineProperties(c&&c.grid||{}),n.domainProperties(c&&c.axis||{})}var a=t("datalib"),s=t("../scene/axis"),o=t("../util/config"),l={x:"bottom",y:"left",top:"top",bottom:"bottom",left:"left",right:"right"};e.exports=r},{"../scene/axis":79,"../util/config":106,datalib:20}],44:[function(t,e,n){(function(t){var n="undefined"!=typeof window?window.d3:"undefined"!=typeof t?t.d3:null;e.exports=function(t){return null==t?null:n.rgb(t)+""}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],45:[function(t,e,n){var r=t("datalib"),i=t("../util/config"),a=t("./transforms"),s=t("./modify"),o=function(t,e,n){function a(e){return function(i,a){i?r.error("LOADING FAILED: "+e.url+" "+i):t.data(e.name).values(r.read(a,e.format)),0===--s&&n()}}var s=0;return(e||[]).forEach(function(e){e.url&&(s+=1,r.load(r.extend({url:e.url},i.load),a(e))),o.datasource(t,e)}),0===s&&setTimeout(n,1),e};o.datasource=function(t,e){var n=(e.transform||[]).map(function(e){return a(t,e)}),i=(e.modify||[]).map(function(n){return s(t,n,e)}),o=t.data(e.name,i.concat(n));return e.values?o.values(r.read(e.values,e.format)):e.source&&(o.source(e.source).revises(o.revises()).addListener(o),t.removeListener(o.pipeline()[0])),o},e.exports=o},{"../util/config":106,"./modify":52,"./transforms":59,datalib:20}],46:[function(t,e,n){function r(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n}function i(t,e,n,r,i,a){this.message=t,this.expected=e,this.found=n,this.offset=r,this.line=i,this.column=a,this.name="SyntaxError"}function a(t){function e(e){function n(e,n,r){var i,a;for(i=n;r>i;i++)a=t.charAt(i),"\n"===a?(e.seenCR||e.line++,e.column=1,e.seenCR=!1):"\r"===a||"\u2028"===a||"\u2029"===a?(e.line++,e.column=1,e.seenCR=!0):(e.column++,
e.seenCR=!1)}return Ft!==e&&(Ft>e&&(Ft=0,Rt={line:1,column:1,seenCR:!1}),n(Rt,Ft,e),Ft=e),Rt}function n(t){qt>Ut||(Ut>qt&&(qt=Ut,Gt=[]),Gt.push(t))}function r(n,r,a){function s(t){var e=1;for(t.sort(function(t,e){return t.description<e.description?-1:t.description>e.description?1:0});e<t.length;)t[e-1]===t[e]?t.splice(e,1):e++}function o(t,e){function n(t){function e(t){return t.charCodeAt(0).toString(16).toUpperCase()}return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(t){return"\\x0"+e(t)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(t){return"\\x"+e(t)}).replace(/[\u0180-\u0FFF]/g,function(t){return"\\u0"+e(t)}).replace(/[\u1080-\uFFFF]/g,function(t){return"\\u"+e(t)})}var r,i,a,s=new Array(t.length);for(a=0;a<t.length;a++)s[a]=t[a].description;return r=t.length>1?s.slice(0,-1).join(", ")+" or "+s[t.length-1]:s[0],i=e?'"'+n(e)+'"':"end of input","Expected "+r+" but "+i+" found."}var l=e(a),u=a<t.length?t.charAt(a):null;return null!==r&&s(r),new i(null!==n?n:o(r,u),r,u,a,l.line,l.column)}function a(){var t;return t=s()}function s(){var e,r,i,a,l,u;return e=Ut,r=o(),r!==y?(i=g(),i!==y?(44===t.charCodeAt(Ut)?(a=w,Ut++):(a=y,0===Wt&&n(k)),a!==y?(l=g(),l!==y?(u=s(),u!==y?(jt=e,r=E(r,u),e=r):(Ut=e,e=b)):(Ut=e,e=b)):(Ut=e,e=b)):(Ut=e,e=b)):(Ut=e,e=b),e===y&&(e=Ut,r=o(),r!==y&&(jt=e,r=L(r)),e=r),e}function o(){var e,r,i,a,s,u,c,d,f,h,p,m,v,_;return e=Ut,91===t.charCodeAt(Ut)?(r=S,Ut++):(r=y,0===Wt&&n(A)),r!==y?(i=g(),i!==y?(a=l(),a!==y?(s=g(),s!==y?(44===t.charCodeAt(Ut)?(u=w,Ut++):(u=y,0===Wt&&n(k)),u!==y?(c=g(),c!==y?(d=l(),d!==y?(f=g(),f!==y?(93===t.charCodeAt(Ut)?(h=M,Ut++):(h=y,0===Wt&&n(C)),h!==y?(p=g(),p!==y?(62===t.charCodeAt(Ut)?(m=T,Ut++):(m=y,0===Wt&&n(N)),m!==y?(v=g(),v!==y?(_=o(),_!==y?(jt=e,r=P(a,d,_),e=r):(Ut=e,e=b)):(Ut=e,e=b)):(Ut=e,e=b)):(Ut=e,e=b)):(Ut=e,e=b)):(Ut=e,e=b)):(Ut=e,e=b)):(Ut=e,e=b)):(Ut=e,e=b)):(Ut=e,e=b)):(Ut=e,e=b)):(Ut=e,e=b)):(Ut=e,e=b),e===y&&(e=l()),e}function l(){var t,e,n,r;if(t=Ut,e=u(),e!==y){if(n=[],r=h(),r!==y)for(;r!==y;)n.push(r),r=h();else n=b;n!==y?(jt=t,e=I(e,n),t=e):(Ut=t,t=b)}else Ut=t,t=b;return t===y&&(t=Ut,e=u(),e!==y&&(jt=t,e=O(e)),t=e),t}function u(){var e,r,i,a;if(e=Ut,r=c(),r===y&&(r=d()),r===y&&(r=D),r!==y?(i=f(),i!==y?(jt=e,r=z(r,i),e=r):(Ut=e,e=b)):(Ut=e,e=b),e===y){if(e=Ut,r=[],U.test(t.charAt(Ut))?(i=t.charAt(Ut),Ut++):(i=y,0===Wt&&n(j)),i!==y)for(;i!==y;)r.push(i),U.test(t.charAt(Ut))?(i=t.charAt(Ut),Ut++):(i=y,0===Wt&&n(j));else r=b;r!==y&&(jt=e,r=F(r)),e=r,e===y&&(e=Ut,40===t.charCodeAt(Ut)?(r=R,Ut++):(r=y,0===Wt&&n(q)),r!==y?(i=s(),i!==y?(41===t.charCodeAt(Ut)?(a=G,Ut++):(a=y,0===Wt&&n(W)),a!==y?(jt=e,r=B(i),e=r):(Ut=e,e=b)):(Ut=e,e=b)):(Ut=e,e=b))}return e}function c(){var e,r,i,a;return e=Ut,46===t.charCodeAt(Ut)?(r=V,Ut++):(r=y,0===Wt&&n($)),r!==y?(i=p(),i!==y?(58===t.charCodeAt(Ut)?(a=H,Ut++):(a=y,0===Wt&&n(Y)),a!==y?(jt=e,r=X(i),e=r):(Ut=e,e=b)):(Ut=e,e=b)):(Ut=e,e=b),e}function d(){var e,r,i,a;return e=Ut,35===t.charCodeAt(Ut)?(r=K,Ut++):(r=y,0===Wt&&n(J)),r!==y?(i=p(),i!==y?(58===t.charCodeAt(Ut)?(a=H,Ut++):(a=y,0===Wt&&n(Y)),a!==y?(jt=e,r=Q(i),e=r):(Ut=e,e=b)):(Ut=e,e=b)):(Ut=e,e=b),e}function f(){var e;return t.substr(Ut,9)===Z?(e=Z,Ut+=9):(e=y,0===Wt&&n(tt)),e===y&&(t.substr(Ut,7)===et?(e=et,Ut+=7):(e=y,0===Wt&&n(nt)),e===y&&(t.substr(Ut,5)===rt?(e=rt,Ut+=5):(e=y,0===Wt&&n(it)),e===y&&(t.substr(Ut,8)===at?(e=at,Ut+=8):(e=y,0===Wt&&n(st)),e===y&&(t.substr(Ut,5)===ot?(e=ot,Ut+=5):(e=y,0===Wt&&n(lt)),e===y&&(t.substr(Ut,7)===ut?(e=ut,Ut+=7):(e=y,0===Wt&&n(ct)),e===y&&(t.substr(Ut,8)===dt?(e=dt,Ut+=8):(e=y,0===Wt&&n(ft)),e===y&&(t.substr(Ut,5)===ht?(e=ht,Ut+=5):(e=y,0===Wt&&n(pt)),e===y&&(t.substr(Ut,10)===gt?(e=gt,Ut+=10):(e=y,0===Wt&&n(mt)),e===y&&(t.substr(Ut,9)===vt?(e=vt,Ut+=9):(e=y,0===Wt&&n(yt)),e===y&&(t.substr(Ut,8)===_t?(e=_t,Ut+=8):(e=y,0===Wt&&n(xt)),e===y&&(t.substr(Ut,9)===bt?(e=bt,Ut+=9):(e=y,0===Wt&&n(wt)),e===y&&(t.substr(Ut,10)===kt?(e=kt,Ut+=10):(e=y,0===Wt&&n(Et)),e===y&&(t.substr(Ut,10)===Lt?(e=Lt,Ut+=10):(e=y,0===Wt&&n(St)),e===y&&(t.substr(Ut,9)===At?(e=At,Ut+=9):(e=y,0===Wt&&n(Mt)),e===y&&(t.substr(Ut,8)===Ct?(e=Ct,Ut+=8):(e=y,0===Wt&&n(Tt))))))))))))))))),e}function h(){var e,r,i,a;return e=Ut,91===t.charCodeAt(Ut)?(r=S,Ut++):(r=y,0===Wt&&n(A)),r!==y?(i=p(),i!==y?(93===t.charCodeAt(Ut)?(a=M,Ut++):(a=y,0===Wt&&n(C)),a!==y?(jt=e,r=Nt(i),e=r):(Ut=e,e=b)):(Ut=e,e=b)):(Ut=e,e=b),e}function p(){var e,r,i;if(e=Ut,r=[],Pt.test(t.charAt(Ut))?(i=t.charAt(Ut),Ut++):(i=y,0===Wt&&n(It)),i!==y)for(;i!==y;)r.push(i),Pt.test(t.charAt(Ut))?(i=t.charAt(Ut),Ut++):(i=y,0===Wt&&n(It));else r=b;return r!==y&&(jt=e,r=Ot(r)),e=r}function g(){var e,r;for(e=[],Dt.test(t.charAt(Ut))?(r=t.charAt(Ut),Ut++):(r=y,0===Wt&&n(zt));r!==y;)e.push(r),Dt.test(t.charAt(Ut))?(r=t.charAt(Ut),Ut++):(r=y,0===Wt&&n(zt));return e}var m,v=arguments.length>1?arguments[1]:{},y={},_={start:a},x=a,b=y,w=",",k={type:"literal",value:",",description:'","'},E=function(t,e){return[t].concat(e)},L=function(t){return[t]},S="[",A={type:"literal",value:"[",description:'"["'},M="]",C={type:"literal",value:"]",description:'"]"'},T=">",N={type:"literal",value:">",description:'">"'},P=function(t,e,n){return{start:t,end:e,middle:n}},I=function(t,e){return t.filters=e,t},O=function(t){return t},D=null,z=function(t,e){return{event:e,target:t}},U=/^[:a-zA-z0-9_\-]/,j={type:"class",value:"[:a-zA-z0-9_\\-]",description:"[:a-zA-z0-9_\\-]"},F=function(t){return{signal:t.join("")}},R="(",q={type:"literal",value:"(",description:'"("'},G=")",W={type:"literal",value:")",description:'")"'},B=function(t){return{stream:t}},V=".",$={type:"literal",value:".",description:'"."'},H=":",Y={type:"literal",value:":",description:'":"'},X=function(t){return{type:"class",value:t}},K="#",J={type:"literal",value:"#",description:'"#"'},Q=function(t){return{type:"id",value:t}},Z="mousedown",tt={type:"literal",value:"mousedown",description:'"mousedown"'},et="mouseup",nt={type:"literal",value:"mouseup",description:'"mouseup"'},rt="click",it={type:"literal",value:"click",description:'"click"'},at="dblclick",st={type:"literal",value:"dblclick",description:'"dblclick"'},ot="wheel",lt={type:"literal",value:"wheel",description:'"wheel"'},ut="keydown",ct={type:"literal",value:"keydown",description:'"keydown"'},dt="keypress",ft={type:"literal",value:"keypress",description:'"keypress"'},ht="keyup",pt={type:"literal",value:"keyup",description:'"keyup"'},gt="mousewheel",mt={type:"literal",value:"mousewheel",description:'"mousewheel"'},vt="mousemove",yt={type:"literal",value:"mousemove",description:'"mousemove"'},_t="mouseout",xt={type:"literal",value:"mouseout",description:'"mouseout"'},bt="mouseover",wt={type:"literal",value:"mouseover",description:'"mouseover"'},kt="mouseenter",Et={type:"literal",value:"mouseenter",description:'"mouseenter"'},Lt="touchstart",St={type:"literal",value:"touchstart",description:'"touchstart"'},At="touchmove",Mt={type:"literal",value:"touchmove",description:'"touchmove"'},Ct="touchend",Tt={type:"literal",value:"touchend",description:'"touchend"'},Nt=function(t){return t},Pt=/^['"a-zA-Z0-9_.><=! \t\-]/,It={type:"class",value:"['\"a-zA-Z0-9_.><=! \\t\\-]",description:"['\"a-zA-Z0-9_.><=! \\t\\-]"},Ot=function(t){return t.join("")},Dt=/^[ \t\r\n]/,zt={type:"class",value:"[ \\t\\r\\n]",description:"[ \\t\\r\\n]"},Ut=0,jt=0,Ft=0,Rt={line:1,column:1,seenCR:!1},qt=0,Gt=[],Wt=0;if("startRule"in v){if(!(v.startRule in _))throw new Error("Can't start parsing from rule \""+v.startRule+'".');x=_[v.startRule]}if(m=x(),m!==y&&Ut===t.length)return m;throw m!==y&&Ut<t.length&&n({type:"end",description:"end of input"}),r(null,Gt,qt)}r(i,Error),e.exports={SyntaxError:i,parse:a}},{}],47:[function(t,e,n){var r=t("datalib"),i=t("../expression"),a=function(){var t=i.parse,e=i.code({idWhiteList:["d","e","i","p","sg"]});return function(n){var r=e(t(n));return r.fn=Function("d","e","i","p","sg",'"use strict"; return ('+r.fn+");"),r}}();a.eval=function(t,e,n,i,a,s,o){return o=t.signalValues(r.array(o)),e.call(null,n,i,a,s,o)},e.exports=a},{"../expression":41,datalib:20}],48:[function(t,e,n){var r=t("datalib"),i=t("../util/config"),a=t("../util/constants");e.exports=function(t,e,n){function s(t){return function(e,n){if(e)r.error("LOADING FAILED: "+t.url);else{var i=r.isObject(n)?n:JSON.parse(n);o(t.name,i)}0==--m&&l()}}function o(t,e){v={},y={},e.signals&&x.push.apply(x,d(t,e.signals)),e.predicates&&b.push.apply(b,f(t,e.predicates)),p(t,e.marks)}function l(){r.keys(_).length>0&&u(e.marks),e.signals=r.array(e.signals),e.predicates=r.array(e.predicates),e.signals.unshift.apply(e.signals,x),e.predicates.unshift.apply(e.predicates,b),n()}function u(t){var e,n,i,s;for(t=r.array(t),i=0,s=t.length;s>i;i++)e=t[i],(n=_[e.type])?(t[i]=r.duplicate(n),e.from&&(t[i].from=e.from),e.properties&&[a.ENTER,a.UPDATE,a.EXIT].forEach(function(a){t[i].properties[a]=r.extend(n.properties[a],e.properties[a])})):e.marks&&u(e.marks)}function c(t,e){return r.isString(e)?e+"_"+t:(r.keys(e).forEach(function(n){var r=new RegExp("\\b"+n+"\\b","g");t=t.replace(r,e[n])}),t)}function d(t,e){return e=r.array(e),e.forEach(function(e){e.name=v[e.name]=c(e.name,t)}),e.forEach(function(t){(t.streams||[]).forEach(function(t){t.type=c(t.type,v),t.expr=c(t.expr,v)})}),e}function f(t,e){return e=r.array(e),e.forEach(function(e){e.name=y[e.name]=c(e.name,t),[e.operands,e.range].forEach(function(t){(t||[]).forEach(function(t){t.signal?t.signal=c(t.signal,v):t.predicate&&h(t)})})}),e}function h(t){t.predicate=y[t.predicate],r.keys(t.input).forEach(function(e){var n=t.input[e];n.signal&&(n.signal=c(n.signal,v))})}function p(t,e){(e||[]).forEach(function(e){g(e.properties.enter),g(e.properties.update),g(e.properties.exit),_[c(e.name,t)]=e})}function g(t){r.keys(t).forEach(function(e){var n=t[e];n.signal?n.signal=c(n.signal,v):n.rule&&n.rule.forEach(function(t){t.signal&&(t.signal=c(t.signal,v)),t.predicate&&h(t)})})}var m=0,v={},y={},_={},x=[],b=[];return(e.interactors||[]).forEach(function(t){t.url&&(m+=1,r.load(r.extend({url:t.url},i.load),s(t)))}),0===m&&setTimeout(l,1),e}},{"../util/config":106,"../util/constants":107,datalib:20}],49:[function(t,e,n){function r(t,e,n,r){(e||[]).forEach(function(e,s){n[s]=n[s]||a(t),i(e,s,n[s],r)})}function i(t,e,n,r){n.size(t.size?r.scale(t.size):null),n.shape(t.shape?r.scale(t.shape):null),n.fill(t.fill?r.scale(t.fill):null),n.stroke(t.stroke?r.scale(t.stroke):null),t.orient&&n.orient(t.orient),null!=t.offset&&n.offset(t.offset),n.title(t.title||null),n.values(t.values||null),n.format(void 0!==t.format?t.format:null);var i=t.properties;n.titleProperties(i&&i.title||{}),n.labelProperties(i&&i.labels||{}),n.legendProperties(i&&i.legend||{}),n.symbolProperties(i&&i.symbols||{}),n.gradientProperties(i&&i.gradient||{})}{var a=t("../scene/legend");t("../util/config")}e.exports=r},{"../scene/legend":80,"../util/config":106}],50:[function(t,e,n){var r=t("datalib"),i=t("./properties");e.exports=function a(t,e){var n=e.properties,s=e.marks;return r.keys(n).forEach(function(r){n[r]=i(t,e.type,n[r])}),e.delay&&(e.delay=i(t,e.type,{delay:e.delay})),s&&(e.marks=s.map(function(e){return a(t,e)})),e}},{"./properties":55,datalib:20}],51:[function(t,e,n){var r=t("./mark");e.exports=function(t,e,n,i){return{type:"group",width:n,height:i,scales:e.scales||[],axes:e.axes||[],legends:e.legends||[],marks:(e.marks||[]).map(function(e){return r(t,e)})}}},{"./mark":50}],52:[function(t,e,n){var r=t("datalib"),i=t("../dataflow/Node"),a=t("../dataflow/tuple"),s=t("../util/debug"),o=t("../util/constants"),l=function(t,e,n,r){for(var i=n.length-1;i>=0;--i)n[i][t]==e&&r.push.apply(r,n.splice(i,1))};e.exports=function(t,e,n){var u=e.signal?r.field(e.signal):null,c=u?u[0]:null,d=e.predicate?t.predicate(e.predicate.name||e.predicate):null,f=null===d,h=new i(t).router(e.type===o.CLEAR);return h.evaluate=function(r){if(null!==d){var i=t.dataValues(d.data||[]);f=d.call(d,{},i,t.signalValues(d.signals||[]),t._predicates)}if(s(r,[e.type+"ing",f]),!f)return r;var c={},h=u?t.signalRef(e.signal):null,p=t.data(n.name),g=p.revises()?null:void 0,m=null;if(c[e.field]=h,e.type===o.ADD)m=a.ingest(c,g),r.add.push(m),p._data.push(m);else if(e.type===o.REMOVE)l(e.field,h,r.add,r.rem),l(e.field,h,r.mod,r.rem),p._data=p._data.filter(function(t){return t[e.field]!==h});else if(e.type===o.TOGGLE){var v=[],y=[];l(e.field,h,r.rem,v),l(e.field,h,r.add,y),l(e.field,h,r.mod,y),0==v.length&&0==y.length&&v.push(a.ingest(c)),r.add.push.apply(r.add,v),p._data.push.apply(p._data,v),r.rem.push.apply(r.rem,y),p._data=p._data.filter(function(t){return-1===y.indexOf(t)})}else e.type===o.CLEAR&&(r.rem.push.apply(r.rem,r.add),r.rem.push.apply(r.rem,r.mod),r.add=[],r.mod=[],p._data=[]);return r.fields[e.field]=1,r},c&&h.dependency(o.SIGNALS,c),d&&h.dependency(o.SIGNALS,d.signals),h}},{"../dataflow/Node":34,"../dataflow/tuple":37,"../util/constants":107,"../util/debug":108,datalib:20}],53:[function(t,e,n){var r=t("datalib");e.exports=function(t){if(null==t)return"auto";if(r.isString(t))return"strict"===t?"strict":"auto";if(r.isObject(t))return t;var e=r.isNumber(t)?t:20;return{top:e,left:e,right:e,bottom:e}}},{datalib:20}],54:[function(t,e,n){var r=t("datalib");e.exports=function(t,e){function n(t,e){var n=r.field(t),i="signals["+n.map(r.str).join("][")+"]";return e[n.shift()]=1,i}function i(e){var i=[],a=[],s={},o={};return r.array(e).forEach(function(e,l){var u="o"+l,c="";if(void 0!==e.value)c=r.str(e.value);else if(e.arg)c="args["+r.str(e.arg)+"]";else if(e.signal)c=n(e.signal,s);else if(e.predicate){var d=e.predicate,f=d&&(d.name||d),h=t.predicate(f),p="predicates["+r.str(f)+"]";h.signals.forEach(function(t){s[t]=1}),h.data.forEach(function(t){o[t]=1}),r.isObject(d)&&r.keys(d).forEach(function(t){if("name"!==t){var e=d[t];c+="args["+r.str(t)+"] = ",e.signal?c+=n(e.signal,s):e.arg&&(c+="args["+r.str(e.arg)+"]"),c+=", "}}),c+=p+".call("+p+", args, db, signals, predicates)"}i.push(u),a.push(u+"=("+c+")")}),{code:"var "+i.join(", ")+";\n"+a.join(";\n")+";\n",signals:r.keys(s),data:r.keys(o)}}function a(t){var e=i(t.operands);return"="==t.type&&(t.type="=="),{code:e.code+"return "+["o0","o1"].join(t.type)+";",signals:e.signals,data:e.data}}function s(t){for(var e=i(t.operands),n=[],r=0,a=t.operands.length;n.push("o"+r++)<a;);return"and"==t.type?t.type="&&":"or"==t.type&&(t.type="||"),{code:e.code+"return "+n.join(t.type)+";",signals:e.signals,data:e.data}}function o(t){var e=[t.item],n="";t.range&&e.push.apply(e,t.range),t.scale&&(n=l(t.scale,e));var a=i(e);if(n=a.code+n,t.data){var s=r.field(t.field).map(r.str);n+="var where = function(d) { return d["+s.join("][")+"] == o0 };\n",n+="return db["+r.str(t.data)+"].filter(where).length > 0;"}else t.range&&(t.scale&&(n+="o1 = scale(o1);\no2 = scale(o2);\n"),n+="return o1 < o2 ? o1 <= o0 && o0 <= o2 : o2 <= o0 && o0 <= o1");return{code:n,signals:a.signals,data:a.data.concat(t.data?[t.data]:[])}}function l(t,e){var n="var scale = ",i=e.length;return r.isString(t)?(e.push({value:t}),n+="this.root().scale(o"+i+")"):t.arg?(e.push(t),n+="o"+i):t.name&&(e.push(r.isString(t.name)?{value:t.name}:t.name),n+="(this.isFunction(o"+i+") ? o"+i+" : ",t.scope?(e.push(t.scope),n+="(o"+(i+1)+".scale || this.root().scale)(o"+i+")"):n+="this.root().scale(o"+i+")",n+=")"),t.invert===!0&&(n+=".invert"),n+";\n"}var u={"=":a,"==":a,"!=":a,">":a,">=":a,"<":a,"<=":a,and:s,"&&":s,or:s,"||":s,"in":o};return(e||[]).forEach(function(e){var n=u[e.type](e),i=Function("args","db","signals","predicates",n.code);i.root=function(){return t.scene().items[0]},i.isFunction=r.isFunction,i.signals=n.signals,i.data=n.data,t.predicate(e.name,i)}),e}},{datalib:20}],55:[function(t,e,n){(function(n){function r(t,e,n){var r,o,l,u,h="",g=c.keys(n),m={},v={signals:{},scales:{},data:{},fields:{},reflow:!1};for(h+="var o = trans ? {} : item;\n",r=0,o=g.length;o>r;++r)u=n[l=g[r]],h+=r>0?"\n ":" ",u.rule?(u=a(t,l,u.rule),h+="\n "+u.code):(u=s(l,u),h+="this.tpl.set(o, "+c.str(l)+", "+u.val+");"),m[l]=!0,p.forEach(function(t){null!=u[t]&&c.array(u[t]).forEach(function(e){v[t][e]=1})}),v.reflow=v.reflow||u.reflow;m.x2&&(m.x?(h+="\n if (o.x > o.x2) { var t = o.x;this.tpl.set(o, 'x', o.x2);this.tpl.set(o, 'x2', t); };",h+="\n this.tpl.set(o, 'width', (o.x2 - o.x));"):h+=m.width?"\n this.tpl.set(o, 'x', (o.x2 - o.width));":"\n this.tpl.set(o, 'x', o.x2);"),m.xc&&(h+=m.width?"\n this.tpl.set(o, 'x', (o.xc - o.width/2));":"\n this.tpl.set(o, 'x', o.xc);"),m.y2&&(m.y?(h+="\n if (o.y > o.y2) { var t = o.y;this.tpl.set(o, 'y', o.y2);this.tpl.set(o, 'y2', t);};",h+="\n this.tpl.set(o, 'height', (o.y2 - o.y));"):h+=m.height?"\n this.tpl.set(o, 'y', (o.y2 - o.height));":"\n this.tpl.set(o, 'y', o.y2);"),m.yc&&(h+=m.height?"\n this.tpl.set(o, 'y', (o.yc - o.height/2));":"\n this.tpl.set(o, 'y', o.yc);"),i(e,m)&&(h+="\n item.touch();"),h+="\n if (trans) trans.interpolate(item, o);";try{var y=Function("item","group","trans","db","signals","predicates",h);return y.tpl=f,y.util=c,y.d3=d,{encode:y,signals:c.keys(v.signals),scales:c.keys(v.scales),data:c.keys(v.data),fields:c.keys(v.fields),reflow:v.reflow}}catch(_){c.error(_),c.log(h)}}function i(t,e){return e.path||("area"===t||"line"===t)&&(e.x||e.x2||e.width||e.y||e.y2||e.height||e.tension||e.interpolate)}function a(t,e,n){var r=[],i=[],a=[],o=[],l="";return(n||[]).forEach(function(u,d){var f,h=u.predicate,p=h&&(h.name||h),g=t.predicate(p),m="predicates["+c.str(p)+"]",v=[],y=e+"_arg"+d;c.isObject(h)&&c.keys(h).forEach(function(t){if("name"!==t){var e=s(d,h[t]);v.push(c.str(t)+": "+e.val),e.signals&&r.push.apply(r,c.array(e.signals)),e.scales&&i.push.apply(i,c.array(e.scales))}}),f=s(e,u),f.signals&&r.push.apply(r,c.array(f.signals)),f.scales&&i.push.apply(i,c.array(f.scales)),p?(r.push.apply(r,g.signals),a.push.apply(a,g.data),o.push(y+" = {"+v.join(", ")+"}"),l+="if("+m+".call("+m+","+y+", db, signals, predicates)) {\n this.tpl.set(o, "+c.str(e)+", "+f.val+");\n",l+=n[d+1]?" } else ":" }"):l+="{\n this.tpl.set(o, "+c.str(e)+", "+f.val+");\n }"}),l="var "+o.join(",\n ")+";\n "+l,{code:l,signals:r,scales:i,data:a}}function s(t,e){if(null==e)return null;if("fill"===t||"stroke"===t){if(e.c)return o("hcl",e.h,e.c,e.l);if(e.h||e.s)return o("hsl",e.h,e.s,e.l);if(e.l||e.a)return o("lab",e.l,e.a,e.b);if(e.r||e.g||e.b)return o("rgb",e.r,e.g,e.b)}var n=null,r=null,i={},a={},s={},d=[],f=[],h=!1;return void 0!==e.template&&(n=c.template.source(e.template,"item.datum")),void 0!==e.value&&(n=c.str(e.value)),void 0!==e.signal&&(i=c.field(e.signal),n="signals["+i.map(c.str).join("][")+"]",d.push(i.shift())),void 0!==e.field&&(e.field=c.isString(e.field)?{datum:e.field}:e.field,a=l(e.field),n=a.val),void 0!==e.scale&&(s=u(e.scale),r=s.val,n=null!==n||e.band||e.mult||e.offset?r+(e.band?".rangeBand()":"("+(null!==n?n:"item.datum.data")+")"):r),n="("+(e.mult?c.number(e.mult)+" * ":"")+n+")"+(e.offset?" + "+c.number(e.offset):""),{val:n,signals:d.concat(c.array(a.signals)).concat(c.array(s.signals)),fields:f.concat(c.array(a.fields)).concat(c.array(s.fields)),scales:e.scale?e.scale.name||e.scale:null,reflow:h||a.reflow||s.reflow}}function o(t,e,n,r){var i=e?s("",e):h.color[t][0],a=n?s("",n):h.color[t][1],o=r?s("",r):h.color[t][2];return signals=[],scales=[],[i,a,o].forEach(function(t){t.signals&&signals.push.apply(signals,t.signals),t.scales&&scales.push(t.scales)}),{val:"(this.d3."+t+"("+[i.val,a.val,o.val].join(",")+') + "")',signals:signals,scales:scales}}function l(t){if(c.isString(t))return{val:c.field(t).map(c.str).join("][")};var e=t.level,n=(t.group||t.parent)&&e,r=n?Array(e).join("group.mark."):"",i=l(t.datum||t.group||t.parent||t.signal),a=i.val,s=i.fields||[],o=i.signals||[],u=i.reflow||!1;return t.datum?(a="item.datum["+a+"]",s.push(t.datum)):t.group?(a=r+"group["+a+"]",u=!0):t.parent?(a=r+"group.datum["+a+"]",u=!0):t.signal&&(a="signals["+a+"]",o.push(c.field(t.signal)[0]),u=!0),{val:a,fields:s,signals:o,reflow:u}}function u(t){var e=null,n=null;return e=c.isString(t)?c.str(t):t.name?c.isString(t.name)?c.str(t.name):(n=l(t.name)).val:(n=l(t)).val,e="group.scale("+e+")",t.invert&&(e+=".invert"),n?(n.val=e,n):{val:e}}var c=t("datalib"),d="undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null,f=t("../dataflow/tuple"),h=t("../util/config"),p=["signals","scales","data","fields"];e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../dataflow/tuple":37,"../util/config":106,datalib:20}],56:[function(t,e,n){function r(t,e){return(e||[]).forEach(function(e){var n=t.signal(e.name,e.init);e.init&&e.init.expr&&(e.init.expr=a(e.init.expr),n.value(i(t,e.init))),e.expr&&(e.expr=a(e.expr),n.evaluate=function(r){var a=i(t,e);return a!==n.value()?(n.value(a),r.signals[e.name]=1,r):t.doNotPropagate},n.dependency(s.SIGNALS,e.expr.signals),e.expr.signals.forEach(function(e){t.signal(e).addListener(n)}))}),e}function i(t,e){var n=e.expr,r=a.eval(t,n.fn,null,null,null,null,n.signals);return e.scale?scale(t,e,r):r}var a=t("./expr"),s=t("../util/constants");r.scale=function o(t,e,n){var r=e.scale,i=r.name||r.signal||r,a=r.scope?t.signalRef(r.scope.signal):null;a&&a.scale||(a=a&&a.mark?a.mark.group:t.scene().items[0]);var o=a.scale(i);return o?r.invert?o.invert(n):o(n):n},e.exports=r},{"../util/constants":107,"./expr":47}],57:[function(t,e,n){var r=t("datalib"),i=t("../core/Model"),a=t("../core/View"),s=t("../parse/background"),o=t("../parse/padding"),l=t("../parse/marks"),u=t("../parse/signals"),c=t("../parse/predicates"),d=t("../parse/data"),f=t("../parse/interactors");e.exports=function(t,e,n){t=r.duplicate(t),n=n||a.factory;var h=t.width||500,p=t.height||500,g=t.viewport||null,m=new i;f(m,t,function(){m.defs({width:h,height:p,viewport:g,background:s(t.background),padding:o(t.padding),signals:u(m,t.signals),predicates:c(m,t.predicates),marks:l(m,t,h,p),data:d(m,t.data,function(){e(n(m))})})})}},{"../core/Model":29,"../core/View":30,"../parse/background":44,"../parse/data":45,"../parse/interactors":48,"../parse/marks":51,"../parse/padding":53,"../parse/predicates":54,"../parse/signals":56,datalib:20}],58:[function(t,e,n){(function(n){var r=t("datalib"),i="undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null,a=t("../dataflow/Node"),s=t("./signals"),o=t("../dataflow/changeset"),l=t("./events"),u=t("./expr"),c=t("../util/constants"),d="start",f="middle",h="end";e.exports=function(t){function e(t,e,n,r){var i=new a(m);i.evaluate=function(i){if(!i.signals[e.signal])return m.doNotPropagate;var a=u.eval(m,n.fn,null,null,null,null,n.signals);return r.scale&&(a=s.scale(m,r,a)),a!==t.value()&&(t.value(a),i.signals[t.name()]=1,i.reflow=!0),i},i.dependency(c.SIGNALS,e.signal),i.addListener(t),m.signal(e.signal).addListener(i)}function n(t,e,n,i){var s=e.filters||[],o=e.target;o&&s.push("i."+o.type+"=="+r.str(o.value)),y[e.event]=y[e.event]||[],y[e.event].push({signal:t,exp:n,filters:s.map(function(t){return u(t)}),spec:i}),_[e.event]=_[e.event]||new a(m),_[e.event].addListener(t)}function p(t,r,i,s){var o=t.name(),l=u("true"),c={};c[d]=m.signal(o+d,!1),c[f]=m.signal(o+f,!1),c[h]=m.signal(o+h,!1);var p=new a(m);p.evaluate=function(e){return c[d].value()===!0&&c[h].value()===!1?e.signals[o+d]?m.doNotPropagate:(c[f].value()!==t.value()&&(t.value(c[f].value()),e.signals[o]=1),e):(c[h].value()===!0&&(c[d].value(!1),c[h].value(!1)),m.doNotPropagate)},p.addListener(t),[d,f,h].forEach(function(t){var a=t==f?i:l,o=t==f?s:{};r[t].event?n(c[t],r[t],a,o):r[t].signal?e(c[t],r[t],a,o):r[t].stream&&g(c[t],r[t].stream,a,o),c[t].addListener(p)})}function g(t,r,i,a){r.forEach(function(r){r.event?n(t,r,i,a):r.signal?e(t,r,i,a):r.start?p(t,r,i,a):r.stream&&g(t,r.stream,i,a)})}var m=t.model(),v=m.defs().signals,y={},_={};(v||[]).forEach(function(t){var e=m.signal(t.name);t.expr||(t.streams||[]).forEach(function(t){var n=l.parse(t.type),r=u(t.expr);g(e,n,r,t)})}),r.keys(y).forEach(function(e){var n=y[e],r=_[e];t.on(e,function(e,a){var l,c,d,f,h,p=o.create(null,!0),g=t.padding(),v=!1;e.preventDefault(),f=i.mouse((i.event=e,t._el)),a=a||{},h=a.datum||{};var y={x:f[0]-g.left,y:f[1]-g.top};for(d=0;d<n.length;d++)c=n[d],v=c.filters.some(function(t){return!u.eval(m,t.fn,h,e,a,y,t.signals)}),v||(l=u.eval(m,c.exp.fn,h,e,a,y,c.exp.signals),c.spec.scale&&(l=s.scale(m,c.spec,l)),l!==c.signal.value()&&(c.signal.value(l),p.signals[c.signal.name()]=1));m.propagate(p,r)})})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../dataflow/Node":34,"../dataflow/changeset":36,"../util/constants":107,"./events":46,"./expr":47,"./signals":56,datalib:20}],59:[function(t,e,n){var r=t("datalib"),i=t("../transforms/index");e.exports=function(t,e){var n=new i[e.type](t);return e.output&&n.output(e.output),r.keys(e).forEach(function(t){"type"!==t&&"output"!==t&&("transform"!==t||"facet"!==e.type)&&n.param(t,e[t])}),n}},{"../transforms/index":102,datalib:20}],60:[function(t,e,n){(function(n){function r(t){var e=t.indexOf(".");return 0>e?t:t.slice(0,e)}var i=t("datalib"),a="undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null,s=t("./marks"),o=function(t,e){this._active=null,this._down=null,this._handlers={},t&&this.initialize(t),e&&this.model(e)},l=o.prototype;l.initialize=function(t,e,n){this._el=a.select(t).node(),this._canvas=a.select(t).select("canvas.marks").node(),this._padding=e,this._obj=n||null;var r=this._canvas,i=this;return u.forEach(function(t){r.addEventListener(t,function(e){l[t].call(i,e)})}),this},l.padding=function(t){return this._padding=t,this},l.model=function(t){return arguments.length?(this._model=t,this):this._model},l.handlers=function(){var t=this._handlers;return i.keys(t).reduce(function(e,n){return t[n].reduce(function(t,e){return t.push(e),t},e)},[])};var u=["mouseup","dblclick","wheel","keydown","keypress","keyup","mousewheel","touchstart"];u.forEach(function(t){l[t]=function(e){this.fire(t,e)}}),u.push("mousedown"),u.push("mousemove"),u.push("mouseout"),u.push("click"),u.push("touchmove"),u.push("touchend"),l.touchmove=l.mousemove=function(t){var e=this._padding,n=t.target.getBoundingClientRect(),r=t.clientX-n.left,i=t.clientY-n.top,a=this._active,s=this.pick(this._model.scene(),r,i,r-e.left,i-e.top);return s===a?(this.fire("mousemove",t),void("touchmove"==t.type&&this.fire("touchmove",t))):(a&&(this.fire("mouseout",t),"touchend"==t.type&&this.fire("touchend",t)),this._active=s,void(s&&(this.fire("mouseover",t),"touchstart"==t.type&&this.fire("touchstart",t))))},l.touchend=l.mouseout=function(t){this._active&&(this.fire("mouseout",t),this.fire("touchend",t)),this._active=null},l.mousedown=function(t){this._down=this._active,this.fire("mousedown",t)},l.click=function(t){this._down===this._active&&(this.fire("click",t),this._down=null)},l.DOMMouseScroll=function(t){this.fire("mousewheel",t)},l.fire=function(t,e){var n=this._active,r=this._handlers[t];if(r)for(var i=0,a=r.length;a>i;++i)r[i].handler.call(this._obj,e,n)},l.on=function(t,e){var n=r(t),i=this._handlers;return i=i[n]||(i[n]=[]),i.push({type:t,handler:e}),this},l.off=function(t,e){var n=r(t),i=this._handlers[n];if(i){for(var a=i.length;--a>=0;)i[a].type===t&&(e&&i[a].handler!==e||i.splice(a,1));return this}},l.context=function(){return this._canvas.getContext("2d")},l.pick=function(t,e,n,r,i){var a=this.context(),o=t.marktype,l=s.pick[o];return l.call(this,a,t,e,n,r,i)},e.exports=o}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./marks":63,datalib:20}],61:[function(t,e,n){(function(n){function r(t,e){var n=window.devicePixelRatio||1,r=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1,i=n/r;if(n!==r){var a=t.width,s=t.height;t.setAttribute("width",a*i),t.setAttribute("height",s*i),t.style.width=a+"px",t.style.height=s+"px"}return i}function i(t){if(!t.vgLineDash){var e=[];t.setLineDash?(t.vgLineDash=function(t){this.setLineDash(t||e)},t.vgLineDashOffset=function(t){this.lineDashOffset=t}):void 0!==t.webkitLineDash?(t.vgLineDash=function(t){this.webkitLineDash=t||e},t.vgLineDashOffset=function(t){this.webkitLineDashOffset=t}):void 0!==t.mozDash?(t.vgLineDash=function(t){this.mozDash=t},t.vgLineDashOffset=function(t){}):(t.vgLineDash=function(t){},t.vgLineDashOffset=function(t){})}}function a(t,e){for(var n=new c(e);null!=(t=t.mark.group);)n.translate(t.x||0,t.y||0);return n}function s(t){return t?u.array(t).reduce(function(t,e){return t.union(a(e,e.bounds)).union(a(e,e["bounds:prev"]))},new c):null}function o(t,e){var n=null;return e&&(n=new c(e).round(),t.beginPath(),t.rect(n.x1,n.y1,n.width(),n.height()),t.clip()),n}var l="undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null,u=t("datalib"),c=t("../../util/Bounds"),d=t("../../util/config"),f=t("./marks"),h=function(){this._ctx=null,this._el=null,this._bgcolor=null,this._imgload=0},p=h.prototype;p.initialize=function(t,e,n,r,i){if(this._el=t,this.background(i),!t)return this;var a=l.select(t).selectAll("canvas.marks").data([1]);return a.enter().append("canvas").attr("class","marks"),a.exit().remove(),this.resize(e,n,r)},p.background=function(t){return this._bgcolor=t,this},p.resize=function(t,e,n){if(this._width=t,this._height=e,this._padding=n,this._el){var a=l.select(this._el).select("canvas.marks");a.attr("width",t+n.left+n.right).attr("height",e+n.top+n.bottom);var s;this._ctx=a.node().getContext("2d"),this._ctx._ratio=s=r(a.node(),this._ctx)||1,this._ctx.setTransform(s,0,0,s,s*n.left,s*n.top)}return i(this._ctx),this},p.context=function(t){return t?(this._ctx=t,this):this._ctx},p.element=function(){return this._el},p.pendingImages=function(){return this._imgload},p.render=function(t,e){var n,r=this._ctx,i=this._padding,a=this._width+i.left+i.right,l=this._height+i.top+i.bottom,u=null;this._scene=t,r.save(),u=o(r,s(e)),this.clear(-i.left,-i.top,a,l),this.draw(r,t,u),e&&(r.restore(),r.save(),n=o(r,s(e)),u.encloses(n)||(this.clear(-i.left,-i.top,a,l),this.draw(r,t,n))),r.restore(),this._scene=null},p.draw=function(t,e,n){var r=e.marktype,i=f.draw[r];i.call(this,t,e,n)},p.clear=function(t,e,n,r){var i=this._ctx;i.clearRect(t,e,n,r),null!=this._bgcolor&&(i.fillStyle=this._bgcolor,i.fillRect(t,e,n,r))},p.renderAsync=function(t){var e=this;e._async_id&&clearTimeout(e._async_id),e._async_id=setTimeout(function(){e.render(t),delete e._async_id},50)},p.loadImage=function(t){var e,r=this,i=r._scene,a=null;if(u.isNode)r._imgload+=1,a=new("undefined"!=typeof window?window.canvas:"undefined"!=typeof n?n.canvas:null).Image,u.load(u.extend({url:t},d.load),function(e,n){return r._imgload-=1,e?void u.error(e):(u.log("LOAD IMAGE: "+t),a.src=n,void(a.loaded=!0))});else{if(a=new Image,e=u.load.sanitizeUrl(u.extend({url:t},d.load)),!e)return;r._imgload+=1,a.onload=function(){u.log("LOAD IMAGE: "+e),a.loaded=!0,r._imgload-=1,r.renderAsync(i)},a.src=e}return a},e.exports=h}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../util/Bounds":103,"../../util/config":106,"./marks":63,datalib:20}],62:[function(t,e,n){e.exports={Handler:t("./Handler"),Renderer:t("./Renderer")}},{"./Handler":60,"./Renderer":61}],63:[function(t,e,n){function r(t){return(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+(null!=t.fontSize?t.fontSize:T.render.fontSize)+"px "+(t.font||T.render.font)}function i(t,e){var n=e.x||0,r=e.y||0,i=e.innerRadius||0,a=e.outerRadius||0,s=(e.startAngle||0)-Math.PI/2,o=(e.endAngle||0)-Math.PI/2;t.beginPath(),0===i?t.moveTo(n,r):t.arc(n,r,i,s,o,0),t.arc(n,r,a,o,s,1),t.closePath()}function a(t,e){var n=e[0],r=n.mark,i=r.pathCache||(r.pathCache=P(N.area(e)));I(t,i)}function s(t,e){var n=e[0],r=n.mark,i=r.pathCache||(r.pathCache=P(N.line(e)));I(t,i)}function o(t,e){
if(null!=e.path){var n=e.pathCache||(e.pathCache=P(e.path));return I(t,n,e.x,e.y)}}function l(t,e){t.beginPath();var n,r,i,a,s=null!=e.size?e.size:100,o=e.x,l=e.y;if(null==e.shape||"circle"===e.shape)return n=Math.sqrt(s/Math.PI),t.arc(o,l,n,0,2*Math.PI,0),void t.closePath();switch(e.shape){case"cross":n=Math.sqrt(s/5)/2,r=3*n,t.moveTo(o-r,l-n),t.lineTo(o-n,l-n),t.lineTo(o-n,l-r),t.lineTo(o+n,l-r),t.lineTo(o+n,l-n),t.lineTo(o+r,l-n),t.lineTo(o+r,l+n),t.lineTo(o+n,l+n),t.lineTo(o+n,l+r),t.lineTo(o-n,l+r),t.lineTo(o-n,l+n),t.lineTo(o-r,l+n);break;case"diamond":a=Math.sqrt(s/(2*D)),i=a*D,t.moveTo(o,l-a),t.lineTo(o+i,l),t.lineTo(o,l+a),t.lineTo(o-i,l);break;case"square":r=Math.sqrt(s),n=r/2,t.rect(o-n,l-n,r,r);break;case"triangle-down":i=Math.sqrt(s/O),a=i*O/2,t.moveTo(o,l+a),t.lineTo(o+i,l-a),t.lineTo(o-i,l-a);break;case"triangle-up":i=Math.sqrt(s/O),a=i*O/2,t.moveTo(o,l-a),t.lineTo(o+i,l+a),t.lineTo(o-i,l+a)}t.closePath()}function u(t,e){var n=e[0],r=n.strokeWidth,i=n.strokeCap;t.lineWidth=null!=r?r:T.render.lineWidth,t.lineCap=null!=i?i:T.render.lineCap,s(t,e)}function c(t,e){var n=e.x||0,r=e.y||0,i=null!=e.x2?e.x2:n,a=null!=e.y2?e.y2:r,s=e.strokeWidth,o=e.strokeCap;t.lineWidth=null!=s?s:T.render.lineWidth,t.lineCap=null!=o?o:T.render.lineCap,t.beginPath(),t.moveTo(n,r),t.lineTo(i,a)}function d(t,e,n,r){var i,a,s,o=n.fill,l=n.stroke;t(e,r),i=null==n.opacity?1:n.opacity,0!=i&&(o||l)&&(o&&(e.globalAlpha=i*(null==n.fillOpacity?1:n.fillOpacity),e.fillStyle=x(e,n,o),e.fill()),l&&(s=null!=(s=n.strokeWidth)?s:T.render.lineWidth,s>0&&(e.globalAlpha=i*(null==n.strokeOpacity?1:n.strokeOpacity),e.strokeStyle=x(e,n,l),e.lineWidth=s,e.lineCap=null!=(a=n.strokeCap)?a:T.render.lineCap,e.vgLineDash(n.strokeDash||null),e.vgLineDashOffset(n.strokeDashOffset||0),e.stroke())))}function f(t,e,n,r){var i,a,s;for(i=0,a=n.items.length;a>i;++i)s=n.items[i],(!r||r.intersects(s.bounds))&&d(t,e,s,s)}function h(t,e,n){if(e.items.length)for(var r,i,a,s,o,l,u,c,d,f,h=e.items,p=0,g=h.length;g>p;++p)r=h[p],(!n||n.intersects(r.bounds))&&(u=r.x||0,c=r.y||0,d=r.width||0,f=r.height||0,s=null==r.opacity?1:r.opacity,0!=s&&((i=r.fill)&&(t.globalAlpha=s*(null==r.fillOpacity?1:r.fillOpacity),t.fillStyle=x(t,r,i),t.fillRect(u,c,d,f)),(a=r.stroke)&&(l=null!=(l=r.strokeWidth)?l:T.render.lineWidth,l>0&&(t.globalAlpha=s*(null==r.strokeOpacity?1:r.strokeOpacity),t.strokeStyle=x(t,r,a),t.lineWidth=l,t.lineCap=null!=(o=r.strokeCap)?o:T.render.lineCap,t.vgLineDash(r.strokeDash||null),t.vgLineDashOffset(r.strokeDashOffset||0),t.strokeRect(u,c,d,f)))))}function p(t,e,n){if(e.items.length)for(var r,i,a,s,o,l,u,c,d,f=e.items,h=0,p=f.length;p>h;++h)r=f[h],(!n||n.intersects(r.bounds))&&(l=r.x||0,u=r.y||0,c=null!=r.x2?r.x2:l,d=null!=r.y2?r.y2:u,a=null==r.opacity?1:r.opacity,0!=a&&(i=r.stroke)&&(o=null!=(o=r.strokeWidth)?o:T.render.lineWidth,o>0&&(t.globalAlpha=a*(null==r.strokeOpacity?1:r.strokeOpacity),t.strokeStyle=x(t,r,i),t.lineWidth=o,t.lineCap=null!=(s=r.strokeCap)?s:T.render.lineCap,t.vgLineDash(r.strokeDash||null),t.vgLineDashOffset(r.strokeDashOffset||0),t.beginPath(),t.moveTo(l,u),t.lineTo(c,d),t.stroke())))}function g(t,e,n){if(e.items.length)for(var r,i=this,a=e.items,s=0,o=a.length;o>s;++s)if(r=a[s],!n||n.intersects(r.bounds)){r.image&&r.image.url===r.url||(r.image=i.loadImage(r.url),r.image.url=r.url);var l,u,c,d,f;c=r.width||r.image&&r.image.width||0,d=r.height||r.image&&r.image.height||0,l=(r.x||0)-("center"===r.align?c/2:"right"===r.align?c:0),u=(r.y||0)-("middle"===r.baseline?d/2:"bottom"===r.baseline?d:0),r.image.loaded&&(t.globalAlpha=null!=(f=r.opacity)?f:1,t.drawImage(r.image,l,u,c,d))}}function m(t,e,n){if(e.items.length)for(var i,a,s,o,l,u,c,d,f,h=e.items,p=0,g=h.length;g>p;++p)i=h[p],(!n||n.intersects(i.bounds))&&(t.font=r(i),t.textAlign=i.align||"left",t.textBaseline=i.baseline||"alphabetic",o=null==i.opacity?1:i.opacity,0!=o&&(u=i.x||0,c=i.y||0,(d=i.radius)&&(f=(i.theta||0)-Math.PI/2,u+=d*Math.cos(f),c+=d*Math.sin(f)),i.angle?(t.save(),t.translate(u,c),t.rotate(i.angle*Math.PI/180),u=i.dx||0,c=i.dy||0):(u+=i.dx||0,c+=i.dy||0),(a=i.fill)&&(t.globalAlpha=o*(null==i.fillOpacity?1:i.fillOpacity),t.fillStyle=x(t,i,a),t.fillText(i.text,u,c)),(s=i.stroke)&&(l=null!=(l=i.strokeWidth)?l:1,l>0&&(t.globalAlpha=o*(null==i.strokeOpacity?1:i.strokeOpacity),t.strokeStyle=x(t,i,s),t.lineWidth=l,t.strokeText(i.text,u,c))),i.angle&&t.restore()))}function v(t){return function(e,n,r){f(t,e,n,r)}}function y(t){return function(e,n,r){n.items.length&&(!r||r.intersects(n.items[0].bounds))&&d(t,e,n.items[0],n.items)}}function _(t,e,n){if(e.items.length){var r,i,a,s,o,l,u,c,d,f=e.items,p=this;for(h(t,e,n),l=0,u=f.length;u>l;++l){for(r=f[l],i=r.axisItems||[],a=r.legendItems||[],s=r.x||0,o=r.y||0,t.save(),t.translate(s,o),r.clip&&(t.beginPath(),t.rect(0,0,r.width||0,r.height||0),t.clip()),n&&n.translate(-s,-o),c=0,d=i.length;d>c;++c)"back"===i[c].def.layer&&p.draw(t,i[c],n);for(c=0,d=r.items.length;d>c;++c)p.draw(t,r.items[c],n);for(c=0,d=i.length;d>c;++c)"back"!==i[c].def.layer&&p.draw(t,i[c],n);for(c=0,d=a.length;d>c;++c)p.draw(t,a[c],n);n&&n.translate(s,o),t.restore()}}}function x(t,e,n){return n.id?b(t,n,e.bounds):n}function b(t,e,n){var r,i,a=n.width(),s=n.height(),o=n.x1+e.x1*a,l=n.y1+e.y1*s,u=n.x1+e.x2*a,c=n.y1+e.y2*s,d=t.createLinearGradient(o,l,u,c),f=e.stops;for(r=0,i=f.length;i>r;++r)d.addColorStop(f[r].offset,f[r].color);return d}function w(t,e,n,r,i,a){if(0===e.items.length||e.bounds&&!e.bounds.contains(i,a))return!1;var s,o,l,u,c,d,f,h=e.items,p=this;for(d=h.length;--d>=0;){for(o=h[d],u=o.x||0,c=o.y||0,t.save(),t.translate(u,c),f=o.items.length;--f>=0;)if(s=o.items[f],s.interactive!==!1&&(l=p.pick(s,n,r,i-u,a-c)))return t.restore(),l;t.restore()}return e.interactive?k(U.group,t,e,n,r,i,a):!1}function k(t,e,n,r,i,a,s){if(!n.items.length)return!1;var o,l,u;for(1!==e._ratio&&(r*=e._ratio,i*=e._ratio),u=n.items.length;--u>=0;)if(o=n.items[u],l=o.bounds,(!l||l.contains(a,s))&&l&&t(e,o,r,i,a,s))return o;return!1}function E(t,e,n,r,i,a){if(!e.items.length)return!1;var s,o=e.items;return s=o[0].bounds,s&&!s.contains(i,a)?!1:(1!==t._ratio&&(n*=t._ratio,r*=t._ratio),U.area(t,o,n,r)?o[0]:!1)}function L(t,e,n,r,i,a){if(!e.items.length)return!1;var s,o=e.items;return s=o[0].bounds,s&&!s.contains(i,a)?!1:(1!==t._ratio&&(n*=t._ratio,r*=t._ratio),U.line(t,o,n,r)?o[0]:!1)}function S(t){return function(e,n,r,i,a,s){return k(t,e,n,r,i,a,s)}}function A(t,e,n,r,i,a){if(!e.fontSize)return!1;if(!e.angle)return!0;var s=C.text(e,z,!0),o=-e.angle*Math.PI/180,l=Math.cos(o),u=Math.sin(o),n=e.x,r=e.y,c=l*i-u*a+(n-n*l+r*u),d=u*i+l*a+(r-n*u-r*l);return s.contains(c,d)}var M=t("../../util/Bounds"),C=t("../../util/boundscalc"),T=t("../../util/config"),N=t("./path"),P=N.parse,I=N.render,O=(Math.PI/2,Math.sqrt(3)),D=Math.tan(30*Math.PI/180),z=new M,U={text:A,rect:function(t,e,n,r){return!0},image:function(t,e,n,r){return!0},group:function(t,e,n,r){return e.fill||e.stroke},rule:function(t,e,n,r){return t.isPointInStroke?(c(t,e),t.isPointInStroke(n,r)):!1},line:function(t,e,n,r){return t.isPointInStroke?(u(t,e),t.isPointInStroke(n,r)):!1},arc:function(t,e,n,r){return i(t,e),t.isPointInPath(n,r)},area:function(t,e,n,r){return a(t,e),t.isPointInPath(n,r)},path:function(t,e,n,r){return o(t,e),t.isPointInPath(n,r)},symbol:function(t,e,n,r){return l(t,e),t.isPointInPath(n,r)}};e.exports={draw:{group:_,area:y(a),line:y(s),arc:v(i),path:v(o),symbol:v(l),rect:h,rule:p,text:m,image:g,drawOne:y,drawAll:v},pick:{group:w,area:E,line:L,arc:S(U.arc),path:S(U.path),symbol:S(U.symbol),rect:S(U.rect),rule:S(U.rule),text:S(U.text),image:S(U.image),pickAll:k}}},{"../../util/Bounds":103,"../../util/boundscalc":105,"../../util/config":106,"./path":64}],64:[function(t,e,n){(function(n){function r(t){var e,n,r,i=[];t=t.slice().replace(m[0],"###$1").split(m[1]).slice(1);for(var a,s,o=0,l=t.length;l>o;o++){e=t[o],n=e.slice(1).trim().replace(m[2],"$1###-").split(m[3]),s=[e.charAt(0)];for(var a=0,u=n.length;u>a;a++)r=parseFloat(n[a]),isNaN(r)||s.push(r);var c=s[0].toLowerCase(),d=g[c];if(s.length-1>d)for(var f=1,h=s.length;h>f;f+=d)i.push([s[0]].concat(s.slice(f,f+d)));else i.push(s)}return i}function i(t,e,n,r,i,a,l){for(var u=r[0],c=r[1],d=r[2],f=r[3],h=r[4],p=r[5],g=r[6],m=s(p,g,u,c,f,h,d,e,n),v=0;v<m.length;v++){var y=o.apply(null,m[v]);t.bezierCurveTo.apply(t,y),i.add(y[0]-a,y[1]-l),i.add(y[2]-a,y[3]-l),i.add(y[4]-a,y[5]-l)}}function a(t,e,n,r){for(var i=n[0],a=n[1],l=n[2],u=n[3],c=n[4],d=n[5],f=n[6],h=s(d,f,i,a,u,c,l,t,e),p=0;p<h.length;p++){var g=o.apply(null,h[p]);r.add(g[0],g[1]),r.add(g[2],g[3]),r.add(g[4],g[5])}}function s(t,e,n,r,i,a,s,o,l){if(f=_.call(arguments),v[f])return v[f];var u=s*(Math.PI/180),c=Math.sin(u),d=Math.cos(u);n=Math.abs(n),r=Math.abs(r);var h=d*(o-t)*.5+c*(l-e)*.5,p=d*(l-e)*.5-c*(o-t)*.5,g=h*h/(n*n)+p*p/(r*r);g>1&&(g=Math.sqrt(g),n*=g,r*=g);var m=d/n,y=c/n,x=-c/r,b=d/r,w=m*o+y*l,k=x*o+b*l,E=m*t+y*e,L=x*t+b*e,S=(E-w)*(E-w)+(L-k)*(L-k),A=1/S-.25;0>A&&(A=0);var M=Math.sqrt(A);a==i&&(M=-M);var C=.5*(w+E)-M*(L-k),T=.5*(k+L)+M*(E-w),N=Math.atan2(k-T,w-C),P=Math.atan2(L-T,E-C),I=P-N;0>I&&1==a?I+=2*Math.PI:I>0&&0==a&&(I-=2*Math.PI);for(var O=Math.ceil(Math.abs(I/(.5*Math.PI+.001))),D=[],z=0;O>z;z++){var U=N+z*I/O,j=N+(z+1)*I/O;D[z]=[C,T,U,j,n,r,c,d]}return v[f]=D}function o(t,e,n,r,i,a,s,o){if(f=_.call(arguments),y[f])return y[f];var l=o*i,u=-s*a,c=s*i,d=o*a,h=Math.cos(n),p=Math.sin(n),g=Math.cos(r),m=Math.sin(r),v=.5*(r-n),x=Math.sin(.5*v),b=8/3*x*x/Math.sin(v),w=t+h-b*p,k=e+p+b*h,E=t+g,L=e+m,S=E+b*m,A=L-b*g;return y[f]=[l*w+u*k,c*w+d*k,l*S+u*A,c*S+d*A,l*E+u*L,c*E+d*L]}function l(t,e,n,r){var a,s,o,l,u,c=null,d=0,f=0,h=0,g=0,m=new p;void 0==n&&(n=0),void 0==r&&(r=0),t.beginPath();for(var v=0,y=e.length;y>v;++v){switch(a=e[v],a[0]){case"l":d+=a[1],f+=a[2],t.lineTo(d+n,f+r),m.add(d,f);break;case"L":d=a[1],f=a[2],t.lineTo(d+n,f+r),m.add(d,f);break;case"h":d+=a[1],t.lineTo(d+n,f+r),m.add(d,f);break;case"H":d=a[1],t.lineTo(d+n,f+r),m.add(d,f);break;case"v":f+=a[1],t.lineTo(d+n,f+r),m.add(d,f);break;case"V":f=a[1],t.lineTo(d+n,f+r),m.add(d,f);break;case"m":d+=a[1],f+=a[2],t.moveTo(d+n,f+r),m.add(d,f);break;case"M":d=a[1],f=a[2],t.moveTo(d+n,f+r),m.add(d,f);break;case"c":s=d+a[5],o=f+a[6],h=d+a[3],g=f+a[4],t.bezierCurveTo(d+a[1]+n,f+a[2]+r,h+n,g+r,s+n,o+r),m.add(d+a[1],f+a[2]),m.add(h,g),m.add(s,o),d=s,f=o;break;case"C":d=a[5],f=a[6],h=a[3],g=a[4],t.bezierCurveTo(a[1]+n,a[2]+r,h+n,g+r,d+n,f+r),m.add(a[1],a[2]),m.add(h,g),m.add(d,f);break;case"s":s=d+a[3],o=f+a[4],h=2*d-h,g=2*f-g,t.bezierCurveTo(h+n,g+r,d+a[1]+n,f+a[2]+r,s+n,o+r),m.add(h,g),m.add(d+a[1],f+a[2]),m.add(s,o),h=d+a[1],g=f+a[2],d=s,f=o;break;case"S":s=a[3],o=a[4],h=2*d-h,g=2*f-g,t.bezierCurveTo(h+n,g+r,a[1]+n,a[2]+r,s+n,o+r),d=s,f=o,m.add(a[1],a[2]),m.add(h,g),m.add(s,o),h=a[1],g=a[2];break;case"q":s=d+a[3],o=f+a[4],h=d+a[1],g=f+a[2],t.quadraticCurveTo(h+n,g+r,s+n,o+r),d=s,f=o,m.add(h,g),m.add(s,o);break;case"Q":s=a[3],o=a[4],t.quadraticCurveTo(a[1]+n,a[2]+r,s+n,o+r),d=s,f=o,h=a[1],g=a[2],m.add(h,g),m.add(s,o);break;case"t":s=d+a[1],o=f+a[2],null===c[0].match(/[QqTt]/)?(h=d,g=f):"t"===c[0]?(h=2*d-l,g=2*f-u):"q"===c[0]&&(h=2*d-h,g=2*f-g),l=h,u=g,t.quadraticCurveTo(h+n,g+r,s+n,o+r),d=s,f=o,h=d+a[1],g=f+a[2],m.add(h,g),m.add(s,o);break;case"T":s=a[1],o=a[2],h=2*d-h,g=2*f-g,t.quadraticCurveTo(h+n,g+r,s+n,o+r),d=s,f=o,m.add(h,g),m.add(s,o);break;case"a":i(t,d+n,f+r,[a[1],a[2],a[3],a[4],a[5],a[6]+d+n,a[7]+f+r],m,n,r),d+=a[6],f+=a[7];break;case"A":i(t,d+n,f+r,[a[1],a[2],a[3],a[4],a[5],a[6]+n,a[7]+r],m,n,r),d=a[6],f=a[7];break;case"z":case"Z":t.closePath()}c=a}return m.translate(n,r)}function u(t,e){for(var n,r,i,s,o,l=null,u=0,c=0,d=0,f=0,h=0,p=t.length;p>h;++h){switch(n=t[h],n[0]){case"l":u+=n[1],c+=n[2],e.add(u,c);break;case"L":u=n[1],c=n[2],e.add(u,c);break;case"h":u+=n[1],e.add(u,c);break;case"H":u=n[1],e.add(u,c);break;case"v":c+=n[1],e.add(u,c);break;case"V":c=n[1],e.add(u,c);break;case"m":u+=n[1],c+=n[2],e.add(u,c);break;case"M":u=n[1],c=n[2],e.add(u,c);break;case"c":r=u+n[5],i=c+n[6],d=u+n[3],f=c+n[4],e.add(u+n[1],c+n[2]),e.add(d,f),e.add(r,i),u=r,c=i;break;case"C":u=n[5],c=n[6],d=n[3],f=n[4],e.add(n[1],n[2]),e.add(d,f),e.add(u,c);break;case"s":r=u+n[3],i=c+n[4],d=2*u-d,f=2*c-f,e.add(d,f),e.add(u+n[1],c+n[2]),e.add(r,i),d=u+n[1],f=c+n[2],u=r,c=i;break;case"S":r=n[3],i=n[4],d=2*u-d,f=2*c-f,u=r,c=i,e.add(n[1],n[2]),e.add(d,f),e.add(r,i),d=n[1],f=n[2];break;case"q":r=u+n[3],i=c+n[4],d=u+n[1],f=c+n[2],u=r,c=i,e.add(d,f),e.add(r,i);break;case"Q":r=n[3],i=n[4],u=r,c=i,d=n[1],f=n[2],e.add(d,f),e.add(r,i);break;case"t":r=u+n[1],i=c+n[2],null===l[0].match(/[QqTt]/)?(d=u,f=c):"t"===l[0]?(d=2*u-s,f=2*c-o):"q"===l[0]&&(d=2*u-d,f=2*c-f),s=d,o=f,u=r,c=i,d=u+n[1],f=c+n[2],e.add(d,f),e.add(r,i);break;case"T":r=n[1],i=n[2],d=2*u-d,f=2*c-f,u=r,c=i,e.add(d,f),e.add(r,i);break;case"a":a(u,c,[n[1],n[2],n[3],n[4],n[5],n[6]+u,n[7]+c],e),u+=n[6],c+=n[7];break;case"A":a(u,c,[n[1],n[2],n[3],n[4],n[5],n[6],n[7]],e),u=n[6],c=n[7];break;case"z":case"Z":}l=n}return e}function c(t){var e,n=t[0];return e="horizontal"===n.orient?h.svg.area().y(function(t){return t.y}).x0(function(t){return t.x}).x1(function(t){return t.x+t.width}):h.svg.area().x(function(t){return t.x}).y1(function(t){return t.y}).y0(function(t){return t.y+t.height}),n.interpolate&&e.interpolate(n.interpolate),null!=n.tension&&e.tension(n.tension),e(t)}function d(t){var e=t[0],n=h.svg.line().x(function(t){return t.x}).y(function(t){return t.y});return e.interpolate&&n.interpolate(e.interpolate),null!=e.tension&&n.tension(e.tension),n(t)}var f,h="undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null,p=t("../../util/Bounds"),g={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},m=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\d)-/g,/\s|,|###/],v={},y={},_=Array.prototype.join;e.exports={parse:r,render:l,bounds:u,area:c,line:d}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../util/Bounds":103}],65:[function(t,e,n){(function(n){var r=("undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null,t("datalib")),i=(t("../../util/config"),t("./svg")),a=function(){this._builder=null},s=a.prototype;s.initialize=function(t,e,n,r){return this._builder=new i,this.resize(e,n,r)},s.resize=function(t,e,n){this._width=t,this._height=e,this._padding=n||{top:0,left:0,bottom:0,right:0},this._autopad=r.isString(this._padding)?1:0;var i=this._width,a=this._height,n=this._padding;return this._builder.initialize(null,i,a,n),this},s.render=function(t,e){return this._builder.render(t),this},s.svg=function(){return this._builder.svg()},e.exports=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../util/config":106,"./svg":67,datalib:20}],66:[function(t,e,n){e.exports={Renderer:t("./Renderer")}},{"./Renderer":65}],67:[function(t,e,n){(function(n){function r(t,e,n){var r="<"+t;if(e)for(var i in e){var a=e[i];null!=a&&(r+=" "+i+'="'+a+'"')}return n&&(r+=" "+n),r+">"}function i(t){return"</"+t+">"}function a(t){return t=null==t?"":String(t),t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function s(t){return String(t).replace(/\"/g,"'")}function o(t){var e=(t.width||0,t.height||0,t.mark.interactive===!1?'style="pointer-events: none;"':'style=""');return r("rect",{"class":"background"},e)+i("rect")}function l(t,e){var n=t.x||0,r=t.y||0,i={transform:"translate("+n+","+r+")"};if(t.clip){var a={width:t.width||0,height:t.height||0},s=t.clip_id||(t.clip_id="clip"+j++);e.clipping[s]=a,i["clip-path"]="url(#"+s+")"}return i}function u(t){var e=t.x||0,n=t.y||0;return{transform:"translate("+e+","+n+")",d:I(t)}}function c(t){if(t.length){var e=t[0],n="horizontal"===e.orient?D:O;return n.interpolate(e.interpolate||"linear").tension(null==e.tension?.7:e.tension),{d:n(t)}}}function d(t){if(t.length){var e=t[0];return z.interpolate(e.interpolate||"linear").tension(null==e.tension?.7:e.tension),{d:z(t)}}}function f(t){var e=t.x||0,n=t.y||0;return{transform:"translate("+e+","+n+")",d:t.path}}function h(t){return{x:t.x||0,y:t.y||0,width:t.width||0,height:t.height||0}}function p(t){var e=t.x||0,n=t.y||0;return{x1:e,y1:n,x2:null!=t.x2?t.x2:e,y2:null!=t.y2?t.y2:n}}function g(t){var e=t.x||0,n=t.y||0;return{transform:"translate("+e+","+n+")",d:U(t)}}function m(t){var e=t.width||t.image&&t.image.width||0,n=t.height||t.image&&t.image.height||0,r=t.x-("center"===t.align?e/2:"right"===t.align?e:0),i=t.y-("middle"===t.baseline?n/2:"bottom"===t.baseline?n:0),a=C.load.baseURL+t.url;return{"xlink:href":a,x:r,y:i,width:e,height:n}}function v(t){var e=t.x||0,n=t.y||0,r=t.dx||0,i=t.dy||0,a=t.angle||0,s=t.radius||0,o=F[t.align||"left"],l="top"===t.baseline?".9em":"middle"===t.baseline?".35em":0;if(s){var u=(t.theta||0)-Math.PI/2;e+=s*Math.cos(u),n+=s*Math.sin(u)}return{x:e+r,y:n+i,"text-anchor":o,transform:a?"rotate("+a+" "+e+","+n+")":null,dy:l?l:null}}function y(t){var e="type-"+t.type;return t.name&&(e+=" "+t.name),e}function _(t){return t.x||0}function x(t){return t.y||0}function b(t){return t.x+t.width||0}function w(t){return t.y+t.height||0}function k(t){return null==t.size?100:t.size}function E(t){return t.shape||"circle"}function L(t,e,n){var r,i,a,s,o,l=t.mark?t:t.length?t[0]:null;if(null===l)return null;var u="";for("text"===e&&(u+="font: "+S(l)+";"),r=0,i=q.length;i>r;++r)a=q[r],s=R[a],o=l[a],null==o?"fill"===s&&(u+="fill: none;"):(o.id&&(n.gradient[o.id]=o,o="url("+window.location.href+"#"+o.id+")"),u+=(u.length?" ":"")+s+": "+o+";");return'style="'+u+'"'}function S(t){var e=(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+(null!=t.fontSize?t.fontSize:C.render.fontSize)+"px "+(t.font&&s(t.font)||C.render.font);return e}var A="undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null,M=t("datalib"),C=t("../../util/config"),T=function(){this._gid=0,this._text={head:"",root:"",foot:"",defs:"",body:""},this._defs={gradient:{},clipping:{}}},N=T.prototype;N.initialize=function(t,e,n,a){var s=this._text;s.head=r("svg",{"class":"marks",width:e+a.left+a.right,height:n+a.top+a.bottom},C.svgNamespace),s.root=r("g",{transform:"translate("+a.left+","+a.top+")"}),s.foot=i("g")+i("svg")},N.svg=function(){var t=this._text;return t.head+t.defs+t.root+t.body+t.foot},N.buildDefs=function(){var t,e,n=this._defs,a=M.keys(n.gradient),s=M.keys(n.clipping),o="";for(t=0;t<a.length;++t){var l=a[t],u=n.gradient[l],c=u.stops;for(o+=r("linearGradient",{id:l,x1:u.x1,x2:u.x2,y1:u.y1,y2:u.y2}),e=0;e<c.length;++e)o+=r("stop",{offset:c[e].offset,"stop-color":c[e].color})+i("stop");o+=i("linearGradient")}for(t=0;t<s.length;++t){var l=s[t],u=n.clipping[l];o+=r("clipPath",{id:l}),o+=r("rect",{x:0,y:0,width:u.width,height:u.height})+i("rect"),o+=i("clipPath")}return o.length>0?r("defs")+o+i("defs"):""},N.render=function(t){this._gid=0,this._text.body=this.draw(t),this._text.defs=this.buildDefs()},N.draw=function(t){var e=P[t.marktype];if(e){var n,s,o=e[0],l=e[1],u=e[2]||!1,c=u?[t.items]:t.items,d=this._defs,f="",h=y(t.def),p=null;for("type-rule"===h||"type-path"===h?p='style="pointer-events: none;"':"type-group"!==h&&(p='style=""'),f+=r("g",{id:"g"+ ++this._gid,"class":y(t.def)},p),n=0;n<c.length;++n){var s="g"===o?null:L(c[n],o,d);f+=r(o,l(c[n],d),s),"text"===o&&(f+=a(c[n].text)),"g"===o&&(f+=this.drawGroup(c[n])),f+=i(o)}return f+i("g")}};var P={group:["g",l],area:["path",c,!0],line:["path",d,!0],arc:["path",u],path:["path",f],symbol:["path",g],rect:["rect",h],rule:["line",p],text:["text",v],image:["image",m]};N.drawGroup=function(t){var e,n,r="",i=t.axisItems||[],a=t.items,s=t.legendItems||[];for(r+=o(t),e=0,n=i.length;n>e;++e)"back"===i[e].def.layer&&(r+=this.draw(i[e]));for(e=0,n=a.length;n>e;++e)r+=this.draw(a[e]);for(e=0,n=i.length;n>e;++e)"back"!==i[e].def.layer&&(r+=this.draw(i[e]));for(e=0,n=s.length;n>e;++e)r+=this.draw(s[e]);return r};var I=A.svg.arc(),O=A.svg.area().x(_).y1(x).y0(w),D=A.svg.area().y(x).x0(b).x1(_),z=A.svg.line().x(_).y(x),U=A.svg.symbol().type(E).size(k),j=0,F={left:"start",center:"middle",right:"end"},R={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeOpacity:"stroke-opacity",strokeCap:"stroke-linecap",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",opacity:"opacity"},q=M.keys(R);e.exports=T}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../util/config":106,datalib:20}],68:[function(t,e,n){function r(t){var e=this;return function(n){var r=n.target,i=r.__data__;i&&(i=i.mark?i:i[0]),t.call(e._obj,n,i)}}function i(t){var e=t.indexOf(".");return 0>e?t:t.slice(0,e)}var a=t("datalib"),s=function(t,e){this._active=null,this._handlers={},t&&this.initialize(t),e&&this.model(e)},o=s.prototype;o.initialize=function(t,e,n){return this._el=d3.select(t).node(),this._svg=d3.select(t).select("svg.marks").node(),this._padding=e,this._obj=n||null,this},o.padding=function(t){return this._padding=t,this},o.model=function(t){return arguments.length?(this._model=t,this):this._model},o.handlers=function(){var t=this._handlers;return a.keys(t).reduce(function(e,n){return t[n].reduce(function(t,e){return t.push(e),t},e)},[])},o.on=function(t,e){var n=i(t),a=this._handlers,s=d3.select(this._svg).node(),o={type:t,handler:e,svg:r.call(this,e)};return a=a[n]||(a[n]=[]),a.push(o),s.addEventListener(n,o.svg),this},o.off=function(t,e){var n=i(t),r=this._handlers[n],a=d3.select(this._svg).node();if(r){for(var s=r.length;--s>=0;)r[s].type===t&&(e&&r[s].handler!==e||(a.removeEventListener(n,r[s].svg),r.splice(s,1)));return this}},e.exports=s},{datalib:20}],69:[function(t,e,n){(function(n){var r="undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null,i=t("datalib"),a=t("./marks"),s=function(){this._svg=null,this._ctx=null,this._el=null,this._defs={gradient:{},clipping:{}}},o=s.prototype;o.initialize=function(t,e,n,i,a){return this._el=t,r.select(t).select("svg.marks").remove(),this._svg=r.select(t).append("svg").attr("class","marks"),null!=a&&this._svg.style("background-color",a),this._ctx=this._svg.append("g"),this.resize(e,n,i)},o.resize=function(t,e,n){return this._width=t,this._height=e,this._padding=n,this._svg.attr("width",t+n.left+n.right).attr("height",e+n.top+n.bottom),this._ctx.attr("transform","translate("+n.left+","+n.top+")"),this},o.context=function(){return this._ctx},o.element=function(){return this._el},o.updateDefs=function(){var t,e,n=this._svg,a=this._defs,s=i.keys(a.gradient),o=i.keys(a.clipping),l=n.select("defs");return 0===s.length&&0==o.length?void l.remove():(l.empty()&&(l=n.insert("defs",":first-child")),t=l.selectAll("linearGradient").data(s,i.identity),t.enter().append("linearGradient").attr("id",i.identity),t.exit().remove(),t.each(function(t){var e=a.gradient[t],n=r.select(this);n.attr({x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2}),stop=n.selectAll("stop").data(e.stops),stop.enter().append("stop"),stop.exit().remove(),stop.attr("offset",function(t){return t.offset}).attr("stop-color",function(t){return t.color})}),e=l.selectAll("clipPath").data(o,i.identity),e.enter().append("clipPath").attr("id",i.identity),e.exit().remove(),void e.each(function(t){var e=a.clipping[t],n=r.select(this).selectAll("rect").data([1]);n.enter().append("rect"),n.attr("x",0).attr("y",0).attr("width",e.width).attr("height",e.height)}))},o.render=function(t,e){a.current=this,e?this.renderItems(i.array(e)):this.draw(this._ctx,t,-1),this.updateDefs(),delete a.current},o.renderItems=function(t){var e,n,r,i,s;for(i=0,s=t.length;s>i;++i)e=t[i],n=e._svg,r=e.mark.marktype,e=a.nested[r]?e.mark.items:e,a.update[r].call(n,e),a.style.call(n,e)},o.draw=function(t,e,n){var r=e.marktype,i=a.draw[r];i.call(this,t,e,n)},e.exports=s}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./marks":71,datalib:20}],70:[function(t,e,n){arguments[4][62][0].apply(n,arguments)},{"./Handler":68,"./Renderer":69,dup:62}],71:[function(t,e,n){(function(n){function r(t){return t.x||0}function i(t){return t.y||0}function a(t){return t.x+t.width||0}function s(t){return t.y+t.height||0}function o(t){return null==t.size?100:t.size}function l(t){return t.shape||"circle"}function u(t){var e,n,r,i,a,s=t.mark?t:t.length?t[0]:null;if(null!==s)for(e=0,n=j.length;n>e;++e)r=j[e],i=U[r],a=s[r],null==a?"fill"===i?this.style.setProperty(i,"none",null):this.style.removeProperty(i):(a.id&&(F.current._defs.gradient[a.id]=a,a="url("+window.location.href+"#"+a.id+")"),this.style.setProperty(i,a+"",null))}function c(t){var e=t.x||0,n=t.y||0;this.setAttribute("transform","translate("+e+","+n+")"),this.setAttribute("d",C(t))}function d(t){if(t.length){var e=t[0],n="horizontal"===e.orient?N:T;n.interpolate(e.interpolate||"linear").tension(null==e.tension?.7:e.tension),this.setAttribute("d",n(t))}}function f(t){if(t.length){var e=t[0];P.interpolate(e.interpolate||"linear").tension(null==e.tension?.7:e.tension),this.setAttribute("d",P(t))}}function h(t){var e=t.x||0,n=t.y||0;this.setAttribute("transform","translate("+e+","+n+")"),null!=t.path&&this.setAttribute("d",t.path)}function p(t){this.setAttribute("x",t.x||0),this.setAttribute("y",t.y||0),this.setAttribute("width",t.width||0),this.setAttribute("height",t.height||0)}function g(t){var e=t.x||0,n=t.y||0;this.setAttribute("x1",e),this.setAttribute("y1",n),this.setAttribute("x2",null!=t.x2?t.x2:e),this.setAttribute("y2",null!=t.y2?t.y2:n)}function m(t){var e=t.x||0,n=t.y||0;this.setAttribute("transform","translate("+e+","+n+")"),this.setAttribute("d",I(t))}function v(t){var e=t.width||t.image&&t.image.width||0,n=t.height||t.image&&t.image.height||0,r=t.x-("center"===t.align?e/2:"right"===t.align?e:0),i=t.y-("middle"===t.baseline?n/2:"bottom"===t.baseline?n:0),a=S.load.sanitizeUrl(S.extend({url:t.url},M.load));a&&this.setAttributeNS("http://www.w3.org/1999/xlink","href",a),this.setAttribute("x",r),this.setAttribute("y",i),this.setAttribute("width",e),this.setAttribute("height",n)}function y(t){return(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+(null!=t.fontSize?t.fontSize:M.render.fontSize)+"px "+(t.font||M.render.font)}function _(t){var e=t.x||0,n=t.y||0,r=t.dx||0,i=t.dy||0,a=t.angle||0,s=t.radius||0,o=z[t.align||"left"],l="top"===t.baseline?".9em":"middle"===t.baseline?".35em":0;if(s){var u=(t.theta||0)-Math.PI/2;e+=s*Math.cos(u),n+=s*Math.sin(u)}this.setAttribute("x",e+r),this.setAttribute("y",n+i),this.setAttribute("text-anchor",o),a?this.setAttribute("transform","rotate("+a+" "+e+","+n+")"):this.removeAttribute("transform"),l?this.setAttribute("dy",l):this.removeAttribute("dy"),this.textContent=t.text,this.style.setProperty("font",y(t),null)}function x(t){var e=t.x||0,n=t.y||0;if(this.setAttribute("transform","translate("+e+","+n+")"),t.clip){var r={width:t.width||0,height:t.height||0},i=t.clip_id||(t.clip_id="clip"+D++);F.current._defs.clipping[i]=r,this.setAttribute("clip-path","url(#"+i+")")}}function b(t){var e=t.width||0,n=t.height||0;this.setAttribute("width",e),this.setAttribute("height",n)}function w(t){var e="type-"+t.type;return t.name&&(e+=" "+t.name),e}function k(t,e,n){return function(r,i,a){E(r,i,a,t,e,n)}}function E(t,e,n,r,i,a){var s=a?[e.items]:e.items,o=e.interactive===!1?"none":null,l=t.node().childNodes,c="g"!==r,d=(d=l[n+1])?A.select(d):t.append("g").attr("id","g"+ ++O).attr("class",w(e.def)),f=d.attr("id"),h="#"+f+" > "+r,p=d.selectAll(h).data(s),g=p.enter().append(r);return c?(d.style("pointer-events",o),g.each(function(t){t.mark?t._svg=this:t.length&&(t[0]._svg=this)})):g.append("rect").attr("class","background").style("pointer-events",o),p.exit().remove(),p.each(i),c?p.each(u):d.selectAll(h+" > rect.background").each(b).each(u),d}function L(t,e,n){var r,i,a,s=E(t,e,n,"g",x),o=s.node().childNodes,l=o.length;for(r=0;l>r;++r){var u=o[r].__data__.items,c=o[r].__data__.legendItems||[],d=o[r].__data__.axisItems||[],f=A.select(o[r]),h=0;for(i=0,a=d.length;a>i;++i)"back"===d[i].def.layer&&L.call(this,f,d[i],h++);for(i=0,a=u.length;a>i;++i)this.draw(f,u[i],h++);for(i=0,a=d.length;a>i;++i)"back"!==d[i].def.layer&&L.call(this,f,d[i],h++);for(i=0,a=c.length;a>i;++i)L.call(this,f,c[i],h++)}}var S=t("datalib"),A="undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null,M=t("../../util/config"),C=A.svg.arc(),T=A.svg.area().x(r).y1(i).y0(s),N=A.svg.area().y(i).x0(a).x1(r),P=A.svg.line().x(r).y(i),I=A.svg.symbol().type(l).size(o),O=0,D=0,z={left:"start",center:"middle",right:"end"},U={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeOpacity:"stroke-opacity",strokeCap:"stroke-linecap",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",opacity:"opacity"},j=S.keys(U),F=e.exports={update:{group:p,area:d,line:f,arc:c,path:h,symbol:m,rect:p,rule:g,text:_,image:v},nested:{area:!0,line:!0},style:u,draw:{group:L,area:k("path",d,!0),line:k("path",f,!0),arc:k("path",c),path:k("path",h),symbol:k("path",m),rect:k("rect",p),rule:k("line",g),text:k("text",_),image:k("image",v),draw:k},current:null}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../util/config":106,datalib:20}],72:[function(t,e,n){function r(t,e){return this._mark=e,a.prototype.init.call(this,t).router(!0)}var i=t("datalib"),a=t("../dataflow/Node"),s=t("./Encoder"),o=t("../util/boundscalc"),l=t("../util/constants"),u=t("../util/debug"),c=r.prototype=new a;c.evaluate=function(t){u(t,["bounds",this._mark.marktype]);var e,n,r,a,c,d;if(hasLegends=this._mark.marktype==l.GROUP&&i.array(this._mark.def.legends).length>0,o.mark(this._mark,null,!hasLegends),hasLegends){for(e=0,n=this._mark.items.length;n>e;++e)for(c=this._mark.items[e],c._legendPositions=null,r=0,a=c.legendItems.length;a>r;++r)d=c.legendItems[r],s.update(this._graph,t.trans,"vg_legendPosition",d.items),o.mark(d,null,!0);o.mark(this._mark,null,!0)}return t.reflow=!0,t},e.exports=r},{"../dataflow/Node":34,"../util/boundscalc":105,"../util/constants":107,"../util/debug":108,"./Encoder":74,datalib:20}],73:[function(t,e,n){function r(){return arguments.length?this.init.apply(this,arguments):this}function i(){var t,e,n,r,i,a=this._def.from,s=a.mark;s?(e=["vg",this._parent_id,s].join("_"),n={name:e,transform:a.transform,modify:a.modify}):(t=this._graph.data(this._from),e=["vg",this._from,this._def.type,t.listeners(!0).length].join("_"),n={name:e,source:this._from,transform:a.transform,modify:a.modify}),this._from=e,this._ds=g.datasource(this._graph,n);var o=this._ds.revises();if(s)r=this.sibling(s).revises(o),r._isSuper?r.addListener(this._ds.listener()):r._bounder.addListener(this._ds.listener());else{var i=this._ds.source().revises(o).last();input=v.create(i),input.add=i.add,input.mod=i.mod,input.rem=i.rem,input.stamp=null,this._graph.propagate(input,this._ds.listener())}}function a(){var t=this._revises?null:void 0,e=m.ingest(new p(this._mark),t);return this._def.width&&m.set(e,"width",this._def.width),this._def.height&&m.set(e,"height",this._def.height),e}function s(t,e,n,r,i,s){var o,l,u,c,d,f;for(o=0,u=t.length;u>o;++o)d=t[o],c=e?this._map[l=e(d)]:i[o],f=c?!1:(c=a.call(this),!0),c.status=f?_.ENTER:_.UPDATE,c.datum=d,m.set(c,"key",l),this._map[l]=c,n.push(c),f?r.add.push(c):(!s||s&&s[d._id])&&r.mod.push(c)}function o(t,e,n){var r,i,a,o,l=v.create(t),c=u(this._def.key||"_id"),d=(t.add,t.mod),f=t.rem,h=[];for(r=0,a=f.length;a>r;++r)o=this._map[i=c(f[r])],o.status=_.EXIT,h.push(o),l.rem.push(o),this._map[i]=null;return s.call(this,e,c,h,l,null,m.idMap(n?e:d)),this._mark.items=h,l}function l(t,e,n){var r,i,a,o=v.create(t),l=u(this._def.key),c=this._mark.items||[],d=[];for(r=0,i=c.length;i>r;++r)a=c[r],a.status=_.EXIT,l&&(this._map[a.key]=a);for(s.call(this,e,l,d,o,c,n?m.idMap(e):null),r=0,i=c.length;i>r;++r)a=c[r],a.status===_.EXIT&&(m.set(a,"key",l?a.key:this._items.length),d.splice(0,0,a),o.rem.push(a));return this._mark.items=d,o}function u(t){
if(null==t)return null;var e=c.array(t).map(c.accessor);return function(t){for(var n="",r=0,i=e.length;i>r;++r)r>0&&(n+="|"),n+=String(e[r](t));return n}}var c=t("datalib"),d=t("../dataflow/Node"),f=t("./Encoder"),h=t("./Bounder"),p=t("./Item"),g=t("../parse/data"),m=t("../dataflow/tuple"),v=t("../dataflow/changeset"),y=t("../util/debug"),_=t("../util/constants"),x=r.prototype=new d;x.init=function(t,e,n,r,a,s){return d.prototype.init.call(this,t).router(!0).collector(!0),this._def=e,this._mark=n,this._from=(e.from?e.from.data:null)||s,this._ds=c.isString(this._from)?t.data(this._from):null,this._map={},this._revises=!1,n.def=e,n.marktype=e.type,n.interactive=!(e.interactive===!1),n.items=[],this._parent=r,this._parent_id=a,e.from&&(e.from.mark||e.from.transform||e.from.modify)&&i.call(this),this._isSuper=this._def.type!==_.GROUP,this._encoder=new f(this._graph,this._mark),this._bounder=new h(this._graph,this._mark),this._ds&&this._encoder.dependency(_.DATA,this._from),this.dependency(_.DATA,this._encoder.dependency(_.DATA)),this.dependency(_.SCALES,this._encoder.dependency(_.SCALES)),this.dependency(_.SIGNALS,this._encoder.dependency(_.SIGNALS)),this},x.revises=function(t){return arguments.length?(!this._revises&&t&&this._items.forEach(function(t){void 0===t._prev&&(t._prev=_.SENTINEL)}),this._revises=this._revises||t,this):this._revises},x.pipeline=function(){return[this]},x.connect=function(){var t=this;return this._graph.connect(this.pipeline()),this._encoder.dependency(_.SCALES).forEach(function(e){t._parent.scale(e).addListener(t)}),this._parent&&(this._isSuper?this.addListener(this._parent._collector):this._bounder.addListener(this._parent._collector)),this},x.disconnect=function(){var t=this;return this._listeners.length?(d.prototype.disconnect.call(this),this._graph.disconnect(this.pipeline()),this._encoder.dependency(_.SCALES).forEach(function(e){t._parent.scale(e).removeListener(t)}),this):this},x.sibling=function(t){return this._parent.child(t,this._parent_id)},x.evaluate=function(t){y(t,["building",this._from,this._def.type]);var e,n,r,i;return this._ds?(e=v.create(t),i=c.duplicate(e.data),delete e.data[this._ds.name()],n=this._encoder.reevaluate(e),e.data=i,n&&(e.mod=this._mark.items.slice()),r=this._ds.last(),r?r.stamp>this._stamp&&(e=o.call(this,r,this._ds.values(),n)):e.reflow=!0):(n=this._encoder.reevaluate(t),i=c.isFunction(this._def.from)?this._def.from():[_.SENTINEL],e=l.call(this,t,i,n)),e=this._graph.evaluate(e,this._encoder),this._isSuper?this._graph.evaluate(e,this._bounder):e},e.exports=r},{"../dataflow/Node":34,"../dataflow/changeset":36,"../dataflow/tuple":37,"../parse/data":45,"../util/constants":107,"../util/debug":108,"./Bounder":72,"./Encoder":74,"./Item":76,datalib:20}],74:[function(t,e,n){function r(t,e){var n=e.def.properties||{},r=n.update;return s.prototype.init.call(this,t),this._mark=e,r&&(this.dependency(l.DATA,r.data),this.dependency(l.SCALES,r.scales),this.dependency(l.SIGNALS,r.signals),this.dependency(l.FIELDS,r.fields)),this}function i(t,e,n,r,i,a){var s=t.encode;s.call(s,e,e.mark.group||e,n,r,i,a)}var a=t("datalib"),s=t("../dataflow/Node"),o=t("../util/boundscalc"),l=t("../util/constants"),u=t("../util/debug"),c={},d=r.prototype=new s;d.evaluate=function(t){u(t,["encoding",this._mark.def.type]);var e,n,r,a,s=this._graph,o=(this._mark.items,this._mark.def.properties||{}),d=o.enter,f=o.update,h=o.exit,p=this._graph.predicates(),g=s.signalValues(),m=s.dataValues(),v=t.request;if(v){if(a=o[v])for(e=0,n=t.mod.length;n>e;++e)r=t.mod[e],i.call(this,a,r,t.trans,m,g,p);return t}for(e=0,n=t.rem.length;n>e;++e)r=t.rem[e],f&&i.call(this,f,r,t.trans,m,g,p),h&&i.call(this,h,r,t.trans,m,g,p),t.trans&&!h?t.trans.interpolate(r,c):t.trans||r.remove();for(e=0,n=t.add.length;n>e;++e)r=t.add[e],d&&i.call(this,d,r,t.trans,m,g,p),f&&i.call(this,f,r,t.trans,m,g,p),r.status=l.UPDATE;if(f)for(e=0,n=t.mod.length;n>e;++e)r=t.mod[e],i.call(this,f,r,t.trans,m,g,p);return t},d.reevaluate=function(t){var e=this._mark.def.properties||{},n=e.update;return t.request||s.prototype.reevaluate.call(this,t)||(n?n.reflow:!1)},r.update=function(t,e,n,r){r=a.array(r);var s,l,u,c,d,f=t.predicates(),h=t.dataValues(),p=t.signalValues();for(s=0,l=r.length;l>s;++s)u=r[s],c=u.mark.def.properties,d=c&&c[n],d&&(i.call(null,d,u,e,h,p,f),o.item(u))},e.exports=r},{"../dataflow/Node":34,"../util/boundscalc":105,"../util/constants":107,"../util/debug":108,datalib:20}],75:[function(t,e,n){function r(){return this._children={},this._scaler=null,this._recursor=null,this._scales={},this.scale=a.bind(this),arguments.length?this.init.apply(this,arguments):this}function i(t){var e,n,r,i,a,s=this,f=d.array(this._def.marks).length>0,h=d.array(this._def.axes).length>0,p=d.array(this._def.legends).length>0,g=!1;for(e=0,n=t.add.length;n>e;++e)r=t.add[e],f&&o.call(this,t,r),h&&l.call(this,t,r),p&&u.call(this,t,r);for(e=t.add.length-1;e>=0;--e)for(r=t.add[e],j=this._children[r._id].length-1;j>=0;--j)c=this._children[r._id][j],c.builder.connect(),i=c.builder.pipeline(),a=c.builder._def,g=a.type!==_.GROUP,g=g&&void 0!==this._graph.data(c.from),g=g&&1==i[i.length-1].listeners().length,c.inline=g,g?c.builder.evaluate(t):this._recursor.addListener(c.builder);for(e=0,n=t.mod.length;n>e;++e)r=t.mod[e],f&&s._children[r._id].forEach(function(t){t.type!=_.MARK||t.inline||void 0===s._graph.data(t.from)||s._recursor.removeListener(t.builder)}),h&&(m(s._graph,s._def.axes,r.axes,r),r.axes.forEach(function(t,e){t.def()})),p&&(v(s._graph,s._def.legends,r.legends,r),r.legends.forEach(function(t,e){t.def()}));for(e=0,n=t.rem.length;n>e;++e)r=t.rem[e],s._children[r._id].forEach(function(t){s._recursor.removeListener(t.builder),t.builder.disconnect()}),delete s._children[r._id];return t}function a(t,e){var n=this;if(2===arguments.length)return n._scales[t]=e,e;for(;null==e&&(e=n._scales[t],n=n.mark?n.mark.group:n._parent););return e}function s(t,e){y(t,["building group",e._id]),e._scales=e._scales||{},e.scale=a.bind(e),e.items=e.items||[],this._children[e._id]=this._children[e._id]||[],e.axes=e.axes||[],e.axisItems=e.axisItems||[],e.legends=e.legends||[],e.legendItems=e.legendItems||[]}function o(t,e){y(t,["building marks",e._id]);var n,i,a,s,o,l,u=this._def.marks;for(s=0,o=u.length;o>s;++s)n=u[s],i=n.from||{},a="vg_"+e.datum._id,e.items[s]={group:e},l=n.type===_.GROUP?new r:new p,l.init(this._graph,n,e.items[s],this,e._id,a),this._children[e._id].push({builder:l,from:i.data||(i.mark?"vg_"+e._id+"_"+i.mark:a),type:_.MARK})}function l(t,e){var n=e.axes,i=e.axisItems,a=this;m(this._graph,this._def.axes,n,e),n.forEach(function(t,n){var s=a._def.axes[n].scale,o=t.def(),l=null;i[n]={group:e,axisDef:o},l=o.type===_.GROUP?new r:new p,l.init(a._graph,o,i[n],a).dependency(_.SCALES,s),a._children[e._id].push({builder:l,type:_.AXIS,scale:s})})}function u(t,e){var n=e.legends,i=e.legendItems,a=this;v(this._graph,this._def.legends,n,e),n.forEach(function(t,n){var s=t.size()||t.shape()||t.fill()||t.stroke(),o=t.def(),l=null;i[n]={group:e,legendDef:o},l=o.type===_.GROUP?new r:new p,l.init(a._graph,o,i[n],a).dependency(_.SCALES,s),a._children[e._id].push({builder:l,type:_.LEGEND,scale:s})})}var d=t("datalib"),f=t("../dataflow/Node"),h=t("../dataflow/Collector"),p=t("./Builder"),g=t("./Scale"),m=t("../parse/axes"),v=t("../parse/legends"),y=t("../util/debug"),_=t("../util/constants"),x=r.prototype=new p;x.init=function(t,e,n,r,a,s){var o=this;this._scaler=new f(t),(e.scales||[]).forEach(function(e){e=o.scale(e.name,new g(t,e,o)),o._scaler.addListener(e)}),this._recursor=new f(t),this._recursor.evaluate=i.bind(this);var l=(e.axes||[]).reduce(function(t,e){return t[e.scale]=1,t},{});return l=(e.legends||[]).reduce(function(t,e){return t[e.size||e.shape||e.fill||e.stroke],t},l),this._recursor.dependency(_.SCALES,d.keys(l)),this._collector=new h(t),p.prototype.init.apply(this,arguments)},x.evaluate=function(t){var e=p.prototype.evaluate.apply(this,arguments),n=this;return e.add.forEach(function(t){s.call(n,e,t)}),e},x.pipeline=function(){return[this,this._scaler,this._recursor,this._collector,this._bounder]},x.disconnect=function(){var t=this;return d.keys(t._children).forEach(function(e){t._children[e].forEach(function(e){t._recursor.removeListener(e.builder),e.builder.disconnect()})}),t._children={},p.prototype.disconnect.call(this)},x.child=function(t,e){for(var n,r=this._children[e],i=0,a=r.length;a>i&&(n=r[i],n.type!=_.MARK||n.builder._def.name!=t);++i);return n.builder},e.exports=r},{"../dataflow/Collector":31,"../dataflow/Node":34,"../parse/axes":43,"../parse/legends":49,"../util/constants":107,"../util/debug":108,"./Builder":73,"./Scale":77,datalib:20}],76:[function(t,e,n){function r(t){this.mark=t}var i=r.prototype;i.hasPropertySet=function(t){var e=this.mark.def.properties;return e&&null!=e[t]},i.cousin=function(t,e){if(0===t)return this;t=t||-1;var n=this.mark,r=n.group,i=null==e?n.items.indexOf(this):e,a=r.items.indexOf(n)+t;return r.items[a].items[i]},i.sibling=function(t){if(0===t)return this;t=t||-1;var e=this.mark,n=e.items.indexOf(this)+t;return e.items[n]},i.remove=function(){var t=this,e=t.mark.items,n=e.indexOf(t);return n>=0&&(n===e.length-1?e.pop():e.splice(n,1)),t},i.touch=function(){this.pathCache&&(this.pathCache=null),this.mark.pathCache&&(this.mark.pathCache=null)},e.exports=r},{}],77:[function(t,e,n){(function(n){function r(t,e,n){return this._def=e,this._parent=n,this._updated=!1,_.prototype.init.call(this,t)}function i(t){var e=this._def.name,n=e+":prev",r=a.call(this,t.scale(e)),i=r.type===k.ORDINAL?s:o,l=m.call(this,t);return i.call(this,r,l,t),t.scale(e,r),t.scale(n,t.scale(n)||r),r}function a(t){var e=this._def.type||k.LINEAR;if(!t||e!==t.type){var n=w.scale[e]||y.scale[e];n||v.error("Unrecognized scale type: "+e),(t=n()).type=t.type||e,t.scaleName=this._def.name,t._prev={}}return t}function s(t,e,n){var r,i,a=this._def,s=t._prev,o=!1,l=a.padding||0,u=null==a.outerPadding?l:a.outerPadding;if(v.isObject(a.range)&&!v.isArray(a.range)&&(o=!0,e=h.call(this,k.RANGE,a.range,t,n)),r=h.call(this,k.DOMAIN,a.domain,t,n),r&&!v.equal(s.domain,r)&&(t.domain(r),s.domain=r,this._updated=!0),!v.equal(s.range,e)){if(a.bandWidth){var c=a.bandWidth,d=r.length,f=e[0]||0,p=a.points?l*c:l*c*(d-1)+2*u;e=[f,f+(c*d+p)]}i="string"==typeof e[0],i||e.length>2||1===e.length||o?t.range(e):a.points&&(a.round||null==a.round)?t.rangeRoundPoints(e,l):a.points?t.rangePoints(e,l):a.round||null==a.round?t.rangeRoundBands(e,l,u):t.rangeBands(e,l,u),s.range=e,this._updated=!0}}function o(t,e,n){var r,i,a=this._def,s=t._prev;r=a.type===k.QUANTILE?h.call(this,k.DOMAIN,a.domain,t,n):g.call(this,t,n),r&&!v.equal(s.domain,r)&&(t.domain(r),s.domain=r,this._updated=!0),"height"===a.range&&(e=e.reverse()),v.equal(s.range,e)||(t[a.round&&t.rangeRound?"rangeRound":"range"](e),s.range=e,this._updated=!0,this._stamp>0||(a.exponent&&a.type===k.POWER&&t.exponent(a.exponent),a.clamp&&t.clamp(!0),a.nice&&(a.type===k.TIME?(i=y.time[a.nice],i||v.error("Unrecognized interval: "+i),t.nice(i)):t.nice())))}function l(t){return t.type===k.ORDINAL||t.type===k.QUANTILE}function u(t){return t.fields||v.array(t)}function c(t,e){return v.array(t.field).map(function(t){return t.parent?v.accessor(t.parent)(e.datum):t})}function d(t,e){var n=u(t);return 1==n.length&&1==v.array(n[0].field).length?x.TYPES.TUPLE:l(e)&&t.sort?x.TYPES.MULTI:x.TYPES.VALUE}function f(t,e,n,r){var i,a=u(e),s=d(e,n),o=l(n),f=e.sort,h="_"+t,p=c(a[0],r);if(n[h])return n[h];var g,m,y=n[h]=new x(this._graph).type(s);return o?s===x.TYPES.VALUE?(g=[{name:k.GROUPBY,get:v.identity}],m={"*":k.COUNT}):s===x.TYPES.TUPLE?(g=[{name:k.GROUPBY,get:v.$(p[0])}],m=f?[{name:k.VALUE,get:v.$(i.sort||f.field),ops:[f.stat]}]:{"*":k.COUNT}):(g=k.GROUPBY,m=[{name:k.VALUE,ops:[f.stat]}]):(g=[],m=[{name:k.VALUE,get:s==x.TYPES.TUPLE?v.$(p[0]):v.identity,ops:[k.MIN,k.MAX],as:[k.MIN,k.MAX]}]),y.param("groupby",g).param("summarize",m),y}function h(t,e,n,r){if(null==e)return[];if(v.isArray(e))return e.map(p.bind(this));var i,a,s,o,h,g,m,y=this,_=this._graph,b=u(e),w=d(e,n),E=f.apply(this,arguments),L=e.sort,S=l(n);for(i=0,a=b.length;a>i;++i)if(h=b[i],from=h.data||"vg_"+r.datum._id,data=_.data(from).revises(!0).last(),!(data.stamp<=this._stamp)){for(g=c(h,r),s=0,o=g.length;o>s;++s)m=g[s],w===x.TYPES.VALUE?E.accessors(null,m):w===x.TYPES.MULTI&&E.accessors(m,h.sort||L.field),E.evaluate(data);this.dependency(k.DATA,from),E.dependency(k.SIGNALS).forEach(function(t){y.dependency(k.SIGNALS,t)})}return data=E.aggr().result(),S?(L&&(L=L.order.signal?_.signalRef(L.order.signal):L.order,L=(L==k.DESC?"-":"+")+k.VALUE,L=v.comparator(L),data=data.sort(L)),data.map(function(t){return t[k.GROUPBY]})):(data=data[0],v.isValid(data)?[data[k.MIN],data[k.MAX]]:[])}function p(t){var e,n=t.signal;return n?(this.dependency(k.SIGNALS,(e=v.field(n))[0]),this._graph.signalRef(e)):t}function g(t,e){var n,r=this._def,i=[null,null];return void 0!==r.domain&&(i=v.isObject(r.domain)?h.call(this,k.DOMAIN,r.domain,t,e):i),n=i.length-1,void 0!==r.domainMin&&(i[0]=v.isObject(r.domainMin)?r.domainMin.signal?p.call(this,r.domainMin):h.call(this,k.DOMAIN+k.MIN,r.domainMin,t,e)[0]:r.domainMin),void 0!==r.domainMax&&(i[n]=v.isObject(r.domainMax)?r.domainMax.signal?p.call(this,r.domainMax):h.call(this,k.DOMAIN+k.MAX,r.domainMax,t,e)[1]:r.domainMax),r.type===k.LOG||r.type===k.TIME||!r.zero&&void 0!==r.zero||(i[0]=Math.min(0,i[0]),i[n]=Math.max(0,i[n])),i}function m(t){var e=this._def,n=[null,null];if(void 0!==e.range)if("string"==typeof e.range)if(E[e.range])n=[0,t[e.range]];else{if(!w.range[e.range])return v.error("Unrecogized range: "+e.range),n;n=w.range[e.range]}else if(v.isArray(e.range))n=v.duplicate(e.range).map(p.bind(this));else{if(v.isObject(e.range))return null;n=[0,e.range]}if(void 0!==e.rangeMin&&(n[0]=e.rangeMin.signal?p.call(this,e.rangeMin):e.rangeMin),void 0!==e.rangeMax&&(n[n.length-1]=e.rangeMax.signal?p.call(this,e.rangeMax):e.rangeMax),void 0!==e.reverse){var r=e.reverse;v.isObject(r)&&(r=v.accessor(r.field)(t.datum)),r&&(n=n.reverse())}return n}var v=t("datalib"),y="undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null,_=t("../dataflow/Node"),x=t("../transforms/Aggregate"),b=t("../dataflow/changeset"),w=(t("../util/debug"),t("../util/config")),k=t("../util/constants"),E={width:1,height:1},L=r.prototype=new _;L.evaluate=function(t){var e=this,n=function(t){i.call(e,t)};return this._updated=!1,t.add.forEach(n),t.mod.forEach(n),this._updated&&(t.scales[this._def.name]=1),b.create(t,!0)},L.dependency=function(t,e){if(2==arguments.length){e=v.array(e);for(var n=0,r=e.length;r>n;++n)this._graph[t==k.DATA?k.DATA:k.SIGNAL](e[n]).addListener(this._parent)}return _.prototype.dependency.call(this,t,e)},e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../dataflow/Node":34,"../dataflow/changeset":36,"../transforms/Aggregate":82,"../util/config":106,"../util/constants":107,"../util/debug":108,datalib:20}],78:[function(t,e,n){function r(t,e){this.duration=t||500,this.ease=e&&d3.ease(e)||d3.ease("cubic-in-out"),this.updates={next:null}}function i(t){for(var e,n,r,i,a,o,l=this.updates,u=l,c=u.next,d=this.duration,f=!0;null!=c;u=c,c=u.next)if(e=c.item,n=e.delay||0,r=(t-n)/d,0>r)f=!1;else{for(r>1&&(r=1),i=c.ease(r),a=0,o=c.length;o>a;++a)e[c[a].property]=c[a](i);e.touch(),s.item(e),1===r?(c.remove&&e.remove(),u.next=c.next,c=u):f=!1}return this.callback(),f}var a=t("../dataflow/tuple"),s=t("../util/boundscalc"),o=t("../util/constants"),l=r.prototype,u={text:1,url:1};l.interpolate=function(t,e,n){var r,i,s,l,c=null;for(r in e)i=t[r],s=e[r],i!==s&&(u[r]||void 0===i?a.set(t,r,s):"number"!=typeof i||isFinite(i)?(l=d3.interpolate(i,s),l.property=r,(c||(c=[])).push(l)):a.set(t,r,s));return null===c&&t.status===o.EXIT&&(c=[]),null!=c&&(c.item=t,c.ease=t.mark.ease||this.ease,c.next=this.updates.next,this.updates.next=c),this},l.start=function(t){for(var e=this,n=e.updates,r=n.next;null!=r;n=r,r=n.next)r.item.status===o.EXIT&&(r.remove=!0);e.callback=t,d3.timer(function(t){return i.call(e,t)})},e.exports=r},{"../dataflow/tuple":37,"../util/boundscalc":105,"../util/constants":107}],79:[function(t,e,n){(function(n){function r(t){function e(){A.type=null}function n(t){return{data:t}}function r(){return z||("log"===k.type?".1s":null)}function a(){var t=r();return k.tickFormat?k.tickFormat(j,t):t?"time"===k.type?m.time.format(t):m.format(t):String}function _(t){var e={major:D,minor:null};return null==e.major&&(e.major=k.ticks?k.ticks(j):k.domain()),e.minor=i(k,e.major,U).map(n),e.major=e.major.map(function(e){return e=n(e),e.label=t(e.data),e}),e}function w(e){var n,r,i;"ordinal"===e.type?(n={scale:e.scaleName,offset:.5+e.rangeBand()/2},r=n):(n={scale:e.scaleName,offset:.5},r={scale:e.scaleName+":prev",offset:.5}),i=s(e),v.extend(V.gridLines,f()),v.extend(V.majorTicks,f()),v.extend(V.minorTicks,f()),v.extend(V.tickLabels,h()),v.extend(V.domain,g()),v.extend(V.title,p()),V.gridLines.properties.enter.stroke={value:y.axis.gridColor},l(E,V.gridLines,r,n,1/0),l(E,V.majorTicks,r,n,N),l(E,V.minorTicks,r,n,P),o(E,V.tickLabels,r,n,N,O),c(E,V.domain,i,I),u(E,V.title,i,S),v.extend(V.gridLines.properties.update,F),v.extend(V.majorTicks.properties.update,q),v.extend(V.minorTicks.properties.update,G),v.extend(V.tickLabels.properties.update,R),v.extend(V.domain.properties.update,B),v.extend(V.title.properties.update,W);var a=[V.gridLines,V.majorTicks,V.minorTicks,V.tickLabels,V.domain,V.title];v.extend(A,{type:"group",interactive:!1,properties:{enter:{encode:d,scales:[e.scaleName],signals:[],data:[]},update:{encode:d,scales:[e.scaleName],signals:[],data:[]}}}),A.marks=a.map(function(e){return x(t,e)})}var k,E=y.axis.orient,L=0,S=y.axis.titleOffset,A={},M="front",C=!1,T=null,N=y.axis.tickSize,P=y.axis.tickSize,I=y.axis.tickSize,O=y.axis.padding,D=null,z=null,U=0,j=y.axis.ticks,F={},R={},q={},G={},W={},B={},V={gridLines:{},majorTicks:{},minorTicks:{},tickLabels:{},domain:{},title:{}},$={};return $.def=function(){A.type||w(k);var t=a(),e=_(t),r=T?[T].map(n):[];return A.marks[0].from=function(){return C?e.major:[]},A.marks[1].from=function(){return e.major},A.marks[2].from=function(){return e.minor},A.marks[3].from=A.marks[1].from,A.marks[4].from=function(){return[1]},A.marks[5].from=function(){return r},A.offset=L,A.orient=E,A.layer=M,A},$.scale=function(t){return arguments.length?(k!==t&&(k=t,e()),$):k},$.orient=function(t){return arguments.length?(E!==t&&(E=t in b?t+"":y.axis.orient,e()),$):E},$.title=function(t){return arguments.length?(T!==t&&(T=t,e()),$):T},$.tickCount=function(t){return arguments.length?(j=t,$):j},$.tickValues=function(t){return arguments.length?(D=t,$):D},$.tickFormat=function(t){return arguments.length?(z!==t&&(z=t,e()),$):z},$.tickSize=function(t,n){if(!arguments.length)return N;var r=arguments.length-1,i=+t,a=r>1?+n:N,s=r>0?+arguments[r]:N;return(N!==i||P!==a||I!==s)&&e(),N=i,P=a,I=s,$},$.tickSubdivide=function(t){return arguments.length?(U=+t,$):U},$.offset=function(t){return arguments.length?(L=v.isObject(t)?t:+t,$):L},$.tickPadding=function(t){return arguments.length?(O!==+t&&(O=+t,e()),$):O},$.titleOffset=function(t){return arguments.length?(S!==+t&&(S=+t,e()),$):S},$.layer=function(t){return arguments.length?(M!==t&&(M=t,e()),$):M},$.grid=function(t){return arguments.length?(C!==t&&(C=t,e()),$):C},$.gridLineProperties=function(t){return arguments.length?(F!==t&&(F=t),$):F},$.majorTickProperties=function(t){return arguments.length?(q!==t&&(q=t),$):q},$.minorTickProperties=function(t){return arguments.length?(G!==t&&(G=t),$):G},$.tickLabelProperties=function(t){return arguments.length?(R!==t&&(R=t),$):R},$.titleProperties=function(t){return arguments.length?(W!==t&&(W=t),$):W},$.domainProperties=function(t){return arguments.length?(B!==t&&(B=t),$):B},$.reset=function(){e()},$}function i(t,e,n){if(r=[],n&&e.length>1){for(var r,i,s,o=a(t.domain()),l=-1,u=e.length,c=(e[1]-e[0])/++n;++l<u;)for(i=n;--i>0;)(s=+e[l]-i*c)>=o[0]&&r.push(s);for(--l,i=0;++i<n&&(s=+e[l]+i*c)<o[1];)r.push(s)}return r}function a(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function s(t){return t.rangeExtent?t.rangeExtent():a(t.range())}function o(t,e,n,r,i,a){i=Math.max(i,0)+a,("left"===t||"top"===t)&&(i*=-1),"top"===t||"bottom"===t?(v.extend(e.properties.enter,{x:n,y:{value:i}}),v.extend(e.properties.update,{x:r,y:{value:i},align:{value:"center"},baseline:{value:k[t]}})):(v.extend(e.properties.enter,{x:{value:i},y:n}),v.extend(e.properties.update,{x:{value:i},y:r,align:{value:w[t]},baseline:{value:"middle"}}))}function l(t,e,n,r,i){var a="left"===t||"top"===t?-1:1;i=i===1/0?"top"===t||"bottom"===t?{field:{group:"height",level:2},mult:-a}:{field:{group:"width",level:2},mult:-a}:{value:a*i},"top"===t||"bottom"===t?(v.extend(e.properties.enter,{x:n,y:{value:0},y2:i}),v.extend(e.properties.update,{x:r,y:{value:0},y2:i}),v.extend(e.properties.exit,{x:r})):(v.extend(e.properties.enter,{x:{value:0},x2:i,y:n}),v.extend(e.properties.update,{x:{value:0},x2:i,y:r}),v.extend(e.properties.exit,{y:r}))}function u(t,e,n,r){var i=~~((n[0]+n[1])/2),a="top"===t||"left"===t?-1:1;"bottom"===t||"top"===t?v.extend(e.properties.update,{x:{value:i},y:{value:a*r},angle:{value:0}}):v.extend(e.properties.update,{x:{value:a*r},y:{value:i},angle:{value:-90}})}function c(t,e,n,r){var i;("top"===t||"left"===t)&&(r=-1*r),i="bottom"===t||"top"===t?"M"+n[0]+","+r+"V0H"+n[1]+"V"+r:"M"+r+","+n[0]+"H0V"+n[1]+"H"+r,e.properties.update.path={value:i}}function d(t,e,n,r,i,a){var s=n?{}:t,o=t.mark.def.offset,l=t.mark.def.orient,u=e.width,c=e.height;if(v.isArray(o)){var d=o[0],f=o[1];switch(l){case"left":_.set(s,"x",-d),_.set(s,"y",f);break;case"right":_.set(s,"x",u+d),_.set(s,"y",f);break;case"bottom":_.set(s,"x",d),_.set(s,"y",c+f);break;case"top":_.set(s,"x",d),_.set(s,"y",-f);break;default:_.set(s,"x",d),_.set(s,"y",f)}}else switch(v.isObject(o)&&(o=-e.scale(o.scale)(o.value)),l){case"left":_.set(s,"x",-o),_.set(s,"y",0);break;case"right":_.set(s,"x",u+o),_.set(s,"y",0);break;case"bottom":_.set(s,"x",0),_.set(s,"y",c+o);break;case"top":_.set(s,"x",0),_.set(s,"y",-o);break;default:_.set(s,"x",0),_.set(s,"y",0)}n&&n.interpolate(t,s)}function f(){return{type:"rule",interactive:!1,key:"data",properties:{enter:{stroke:{value:y.axis.tickColor},strokeWidth:{value:y.axis.tickWidth},opacity:{value:1e-6}},exit:{opacity:{value:1e-6}},update:{opacity:{value:1}}}}}function h(){return{type:"text",interactive:!0,key:"data",properties:{enter:{fill:{value:y.axis.tickLabelColor},font:{value:y.axis.tickLabelFont},fontSize:{value:y.axis.tickLabelFontSize},opacity:{value:1e-6},text:{field:"label"}},exit:{opacity:{value:1e-6}},update:{opacity:{value:1}}}}}function p(){return{type:"text",interactive:!0,properties:{enter:{font:{value:y.axis.titleFont},fontSize:{value:y.axis.titleFontSize},fontWeight:{value:y.axis.titleFontWeight},fill:{value:y.axis.titleColor},align:{value:"center"},baseline:{value:"middle"},text:{field:"data"}},update:{}}}}function g(){return{type:"path",interactive:!1,properties:{enter:{x:{value:.5},y:{value:.5},stroke:{value:y.axis.axisColor},strokeWidth:{value:y.axis.axisWidth}},update:{}}}}var m="undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null,v=t("datalib"),y=t("../util/config"),_=t("../dataflow/tuple"),x=t("../parse/mark"),b={top:1,right:1,bottom:1,left:1},w={bottom:"center",top:"center",left:"right",right:"left"},k={bottom:"top",top:"bottom",left:"middle",right:"middle"};e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../dataflow/tuple":37,"../parse/mark":50,"../util/config":106,datalib:20}],80:[function(t,e,n){(function(n){function r(t){function e(){w.type=null}function n(t,e){return{data:t,index:e}}function r(t){return"ordinal"===t||"quantize"===t||"quantile"===t||"threshold"===t}function y(t){var e,r,i,a=_(k,E,L,S),s=(null==M?t.ticks?t.ticks.apply(t,D):t.domain():M).map(n),o=null==C?t.tickFormat?t.tickFormat.apply(t,D):String:C,l=5,u=d.range(s.length);k?(r=s.map(function(t){return Math.sqrt(k(t.data))}),i=d.max(r),r=r.reduce(function(t,e,n,r){return n>0&&(t[n]=t[n-1]+r[n-1]/2+l),t[n]+=e/2,t},[0]).map(Math.round)):(i=Math.round(Math.sqrt(m.legend.symbolSize)),r=A||(e=R.fontSize)&&e.value+l||m.legend.labelFontSize+l,r=u.map(function(t,e){return Math.round(i/2+e*r)}));var c,f=O;N&&(c=F.fontSize,f+=5+(c&&c.value||m.legend.titleFontSize));for(var h=0,p=r.length;p>h;++h)r[h]+=f;var t={name:"legend",type:"ordinal",points:!0,domain:u,range:r},g=(N?[N]:[]).map(n);return s.forEach(function(t){t.label=o(t.data),t.offset=i}),a.scales=[t],a.marks[0].from=function(){return g},a.marks[1].from=function(){return s},a.marks[2].from=a.marks[1].from,a}function _(e,n,r,u){var c=f.extend(q.titles,s()),d=f.extend(q.symbols,o()),g=f.extend(q.labels,l());return a(d,e,n,r,u),f.extend(c.properties.update,F),f.extend(d.properties.update,U),f.extend(g.properties.update,R),c.properties.enter.x.value+=O,c.properties.enter.y.value+=O,g.properties.enter.x.offset+=O+1,d.properties.enter.x.offset=O+1,g.properties.update.x.offset+=O+1,d.properties.update.x.offset=O+1,f.extend(w,{type:"group",interactive:!1,properties:{enter:h(t,"group",z),vg_legendPosition:{encode:i,signals:[],scales:[],data:[],fields:[]}}}),w.marks=[c,d,g].map(function(e){return p(t,e)}),w}function x(t){var e=b(t),r=t.domain(),i=r.map(n),a=j.width&&j.width.value||m.legend.gradientWidth,s=null==C?t.tickFormat?t.tickFormat.apply(t,D):String:C,o={name:"legend",type:t.type,round:!0,zero:!1,domain:[r[0],r[r.length-1]],range:[O,a+O]};"pow"===t.type&&(o.exponent=t.exponent());var l=(N?[N]:[]).map(n);return i.forEach(function(t,e){t.label=s(t.data),t.align=e==i.length-1?"right":0==e?"left":"center"}),e.scales=[o],e.marks[0].from=function(){return l},e.marks[1].from=function(){return[1]},e.marks[2].from=function(){return i},e}function b(e){var n=f.extend(q.title,s()),r=f.extend(q.gradient,u()),a=f.extend(q.labels,c()),o=new g,l=e.domain(),d=l[0],m=l[l.length-1],v=e.copy().domain([d,m]).range([0,1]),y="linear"!==e.type&&e.ticks?e.ticks.call(e,15):l;d!==y[0]&&y.unshift(d),m!==y[y.length-1]&&y.push(m);for(var _=0,x=y.length;x>_;++_)o.stop(v(y[_]),e(y[_]));r.properties.enter.fill={value:o},f.extend(n.properties.update,F),f.extend(r.properties.update,j),f.extend(a.properties.update,R);var b=r.properties,k=j.height,E=k&&k.value||b.enter.height.value;if(a.properties.enter.y.value=E,a.properties.update.y.value=E,N){var L=n.properties,S=F.fontSize,A=4+(S&&S.value||L.enter.fontSize.value);r.properties.enter.y.value+=A,a.properties.enter.y.value+=A,r.properties.update.y.value+=A,a.properties.update.y.value+=A}return n.properties.enter.x.value+=O,n.properties.enter.y.value+=O,r.properties.enter.x.value+=O,r.properties.enter.y.value+=O,a.properties.enter.y.value+=O,r.properties.update.x.value+=O,r.properties.update.y.value+=O,a.properties.update.y.value+=O,f.extend(w,{type:"group",interactive:!1,properties:{enter:h(t,"group",z),vg_legendPosition:{encode:i,signals:[],scales:[],data:[],fields:[]}}}),w.marks=[n,r,a].map(function(e){return p(t,e)}),w}var w,k=null,E=null,L=null,S=null,A=null,M=null,C=null,T=null,N=void 0,P="right",I=m.legend.offset,O=m.legend.padding,D=[5],z={},U={},j={},F={},R={},q={titles:{},symbols:{},labels:{},gradient:{}},G={},w={};return G.def=function(){var t=k||E||L||S;return C=T?"time"===t.type?d.time.format(T):d.format(T):null,w.type||(w=t!==L&&t!==S||r(t.type)?y(t):x(t)),w.orient=P,w.offset=I,w.padding=O,w},G.size=function(t){return arguments.length?(k!==t&&(k=t,e()),G):k},G.shape=function(t){return arguments.length?(E!==t&&(E=t,e()),G):E},G.fill=function(t){return arguments.length?(L!==t&&(L=t,e()),G):L},G.stroke=function(t){return arguments.length?(S!==t&&(S=t,e()),G):S},G.title=function(t){return arguments.length?(N!==t&&(N=t,e()),G):N},G.format=function(t){return arguments.length?(T!==t&&(T=t,e()),G):T},G.spacing=function(t){return arguments.length?(A!==+t&&(A=+t,e()),G):A},G.orient=function(t){return arguments.length?(P=t in v?t+"":m.legend.orient,G):P},G.offset=function(t){return arguments.length?(I=+t,G):I},G.values=function(t){return arguments.length?(M=t,G):M},G.legendProperties=function(t){return arguments.length?(z=t,G):z},G.symbolProperties=function(t){return arguments.length?(U=t,G):U},G.gradientProperties=function(t){return arguments.length?(j=t,G):j},G.labelProperties=function(t){return arguments.length?(R=t,G):R},G.titleProperties=function(t){return arguments.length?(F=t,G):F},G.reset=function(){e()},G}function i(t,e,n,r,i,a){var s,o=n?{}:t,l=t.mark.def.offset,u=t.mark.def.orient,c=2*t.mark.def.padding,d=~~t.bounds.width()+(t.width?0:c),f=~~t.bounds.height()+(t.height?0:c),h=e._legendPositions||(e._legendPositions={right:.5,left:.5});switch(o.x=.5,o.width=d,o.y=h[u],h[u]+=o.height=f,!n&&e.bounds&&(e.bounds.delta=e.bounds.x2-e.width),u){case"left":s=e.bounds?e.bounds.x1:0,o.x+=s-l-d;break;case"right":s=e.width,e.bounds&&(s=n?e.width+e.bounds.delta:e.bounds.x2),o.x+=s+l}n&&n.interpolate(t,o);var p=t.mark.def.properties.enter.encode;p.call(p,t,e,n)}function a(t,e,n,r,i){var a=t.properties.enter,s=t.properties.update;e&&(a.size=s.size={scale:e.scaleName,field:"data"}),n&&(a.shape=s.shape={scale:n.scaleName,field:"data"}),r&&(a.fill=s.fill={scale:r.scaleName,field:"data"}),i&&(a.stroke=s.stroke={scale:i.scaleName,field:"data"})}function s(){var t=m.legend;return{type:"text",interactive:!1,key:"data",properties:{enter:{x:{value:0},y:{value:0},fill:{value:t.titleColor},font:{value:t.titleFont},fontSize:{value:t.titleFontSize},fontWeight:{value:t.titleFontWeight},baseline:{value:"top"},text:{field:"data"},opacity:{value:1e-6}},exit:{opacity:{value:1e-6}},update:{opacity:{value:1}}}}}function o(){var t=m.legend;return{type:"symbol",interactive:!1,key:"data",properties:{enter:{x:{field:"offset",mult:.5},y:{scale:"legend",field:"index"},shape:{value:t.symbolShape},size:{value:t.symbolSize},stroke:{value:t.symbolColor},strokeWidth:{value:t.symbolStrokeWidth},opacity:{value:1e-6}},exit:{opacity:{value:1e-6}},update:{x:{field:"offset",mult:.5},y:{scale:"legend",field:"index"},opacity:{value:1}}}}}function l(){var t=m.legend;return{type:"text",interactive:!1,key:"data",properties:{enter:{x:{field:"offset",offset:5},y:{scale:"legend",field:"index"},fill:{value:t.labelColor},font:{value:t.labelFont},fontSize:{value:t.labelFontSize},align:{value:t.labelAlign},baseline:{value:t.labelBaseline},text:{field:"label"},opacity:{value:1e-6}},exit:{opacity:{value:1e-6}},update:{opacity:{value:1},x:{field:"offset",offset:5},y:{scale:"legend",field:"index"}}}}}function u(){var t=m.legend;return{type:"rect",interactive:!1,properties:{enter:{x:{value:0},y:{value:0},width:{value:t.gradientWidth},height:{value:t.gradientHeight},stroke:{value:t.gradientStrokeColor},strokeWidth:{value:t.gradientStrokeWidth},opacity:{value:1e-6}},exit:{opacity:{value:1e-6}},update:{x:{value:0},y:{value:0},opacity:{value:1}}}}}function c(){var t=m.legend;return{type:"text",interactive:!1,key:"data",properties:{enter:{x:{scale:"legend",field:"data"},y:{value:20},dy:{value:2},fill:{value:t.labelColor},font:{value:t.labelFont},fontSize:{value:t.labelFontSize},align:{field:"align"},baseline:{value:"top"},text:{field:"label"},opacity:{value:1e-6}},exit:{opacity:{value:1e-6}},update:{x:{scale:"legend",field:"data"},y:{value:20},opacity:{value:1}}}}}var d="undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null,f=t("datalib"),h=t("../parse/properties"),p=t("../parse/mark"),g=t("../util/Gradient"),m=t("../util/config"),v={right:1,left:1};e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../parse/mark":50,"../parse/properties":55,"../util/Gradient":104,"../util/config":106,datalib:20}],81:[function(t,e,n){e.exports=function r(t,e){var n,i,a,s,o;if(e(t))return!0;var l=["items","axisItems","legendItems"];for(a=0,s=l.length;s>a;++a)if(o=t[l[a]])for(n=0,i=o.length;i>n;++n)if(r(o[n],e))return!0;
}},{}],82:[function(t,e,n){function r(t){return o.prototype.init.call(this,t).router(!0).revises(!0),o.addParameters(this,{groupby:{type:"array<field>"},summarize:{type:"custom",set:function(t){var e,n,r,i,a,o,l={};if(!s.isArray(i=t)){i=[];for(a in t)o=s.array(t[a]),i.push({name:a,ops:o})}for(e=0,n=i.length;n>e;++e)r=i[e],r.name.signal&&(l[r.name.signal]=1),s.array(r.ops).forEach(function(t){t.signal&&(l[t.signal]=1)});return this._transform._fieldsDef=i,this._transform._aggr=null,this._transform.dependency(f.SIGNALS,s.keys(l)),this._transform}}}),this._fieldsDef=[],this._aggr=null,this._type=p.TUPLE,this._acc={groupby:s["true"],value:s["true"]},this._cache={},this._prev={},this}function i(t){var e=this._acc;return this._type===p.TUPLE?t:this._type===p.VALUE?e.value(t):this._cache[t._id]||(this._cache[t._id]={_id:t._id,groupby:e.groupby(t),value:e.value(t)})}function a(t){var e=this._prev[t._id]||(this._prev[t._id]=Object.create(t));return s.extend(e,t._prev)}var s=t("datalib"),o=t("./Transform"),l=t("./Facetor"),u=t("../dataflow/tuple"),c=t("../dataflow/changeset"),d=t("../util/debug"),f=t("../util/constants"),h=r.prototype=new o,p=r.TYPES={VALUE:1,TUPLE:2,MULTI:3};h.type=function(t){return this._type=t,this},h.accessors=function(t,e){var n=this._acc;n.groupby=s.$(t)||s["true"],n.value=s.$(e)||s["true"]},h.aggr=function(){if(this._aggr)return this._aggr;var t=this._graph,e=this.param("groupby").field,n=this._fieldsDef.map(function(e){var n=s.duplicate(e);return e.get&&(n.get=e.get),n.name=n.name.signal?t.signalRef(n.name.signal):n.name,n.ops=n.ops.signal?t.signalRef(n.ops.signal):s.array(n.ops).map(function(e){return e.signal?t.signalRef(e.signal):e}),n}),r=this._aggr=(new l).groupby(e).stream(!0).summarize(n);return this._type!==p.VALUE&&r.key("_id"),r},h._reset=function(t,e){e.rem.push.apply(e.rem,this.aggr().result()),this.aggr().clear(),this._aggr=null},h.transform=function(t,e){d(t,["aggregate"]);var n=c.create(t);e&&this._reset(t,n);var r=this,s=this._type===p.TUPLE,o=this.aggr();return t.add.forEach(function(t){o._add(s?t:i.call(r,t))}),t.mod.forEach(function(t){if(e)o._add(s?t:i.call(r,t));else if(u.has_prev(t)){var n=a.call(r,t);o._mod(s?t:i.call(r,t),s?n:i.call(r,n))}}),t.rem.forEach(function(t){var e=u.has_prev(t)?a.call(r,t):t;o._rem(s?e:i.call(r,e)),r._cache[t._id]=r._prev[t._id]=null}),o.changes(t,n)},e.exports=r},{"../dataflow/changeset":36,"../dataflow/tuple":37,"../util/constants":107,"../util/debug":108,"./Facetor":87,"./Transform":99,datalib:20}],83:[function(t,e,n){function r(){}var i=t("./Transform"),a=t("../dataflow/Collector"),s=r.prototype=new i;s.init=function(t){return i.prototype.init.call(this,t),this._collector=new a(t),this},s.transform=function(t){this._collector.evaluate(t);var e=this._collector.data();return this.batchTransform(t,e)},s.batchTransform=function(t,e){},e.exports=r},{"../dataflow/Collector":31,"./Transform":99}],84:[function(t,e,n){function r(t){return a.prototype.init.call(this,t),a.addParameters(this,{field:{type:"field"},min:{type:"value"},max:{type:"value"},step:{type:"value"},maxbins:{type:"value","default":20}}),this._output={bin:"bin"},this}var i=t("datalib"),a=t("./Transform"),s=t("../dataflow/tuple"),o=r.prototype=new a;o.transform=function(t){function e(e){var i=n.param("field").accessor(e);i=null==i?null:a.start+a.step*~~((i-a.start)/a.step),s.set(e,r,i,t.stamp)}var n=this,r=this._output.bin,a=i.bins({min:this.param("min"),max:this.param("max"),step:this.param("step"),maxbins:this.param("maxbins")});return t.add.forEach(e),t.mod.forEach(e),t.rem.forEach(e),t},e.exports=r},{"../dataflow/tuple":37,"./Transform":99,datalib:20}],85:[function(t,e,n){function r(t){return u.prototype.init.call(this,t),u.addParameters(this,{"with":{type:"data"},diagonal:{type:"value","default":"true"}}),this._output={left:"a",right:"b"},this._collector=new c(t),this._lastRem=null,this._lastWith=null,this._ids={},this._cache={},this.router(!0)}function i(t,e){var n=this._cache[t._id]=this._cache[t._id]||{c:[],s:this._stamp};n.c.push(e)}function a(t,e,n,r,a){for(var s,o,l,u=e?n:this._collector.data(),c=0,d=u.length,h=void 0!==a._prev?null:void 0;d>c;++c)o=u[c],l=e?a._id+"_"+o._id:o._id+"_"+a._id,this._ids[l]||(a._id!=o._id||r)&&(s=f.ingest({},h),s[this._output.left]=e?a:o,s[this._output.right]=e?o:a,t.add.push(s),i.call(this,a,s),i.call(this,o,s),this._ids[l]=1)}function s(t,e,n){var r=this,i=this._cache[n._id];this._lastRem>i.s&&(i.c=i.c.filter(function(t){var n=t[r._output[e?"right":"left"]];return null!==r._cache[n._id]}),i.s=this._lastRem),t.mod.push.apply(t.mod,i.c)}function o(t,e){t.rem.push.apply(t.rem,this._cache[e._id].c),this._cache[e._id]=null,this._lastRem=this._stamp}function l(t,e){(t.add.length||t.rem.length)&&(e.fields[this._output.left]=1,e.fields[this._output.right]=1)}var u=t("./Transform"),c=t("../dataflow/Collector"),d=t("../util/debug"),f=t("../dataflow/tuple"),h=t("../dataflow/changeset"),p=r.prototype=new u;p.transform=function(t){d(t,["crossing"]),this._collector.evaluate(t);var e=this.param("with"),n=this.param("diagonal"),r=!e.name,i=this._collector.data(),u=r?t:e.source.last(),c=r?i:e.source.values(),f=h.create(t),p=o.bind(this,f);return t.rem.forEach(p),t.add.forEach(a.bind(this,f,!0,c,n)),!r&&u.stamp>this._lastWith&&(u.rem.forEach(p),u.add.forEach(a.bind(this,f,!1,i,n)),u.mod.forEach(s.bind(this,f,!1)),l.call(this,u,f),this._lastWith=u.stamp),t.mod.forEach(s.bind(this,f,!0)),l.call(this,t,f),f},e.exports=r},{"../dataflow/Collector":31,"../dataflow/changeset":36,"../dataflow/tuple":37,"../util/debug":108,"./Transform":99}],86:[function(t,e,n){function r(e){return i.addParameters(this,{transform:{type:"custom",set:function(t){return this._transform._pipeline=t,this._transform},get:function(){var e=t("../parse/transforms"),n=this._transform;return n._pipeline.map(function(t){return e(n._graph,t)})}}}),this._pipeline=[],a.call(this,e)}var i=t("./Transform"),a=t("./Aggregate"),s=r.prototype=Object.create(a.prototype);s.aggr=function(){return a.prototype.aggr.call(this).facet(this)},e.exports=r},{"../parse/transforms":59,"./Aggregate":82,"./Transform":99}],87:[function(t,e,n){function r(){c.constructor.call(this),this._facet=null}function i(t){l({},["deleting cell",this.tuple._id]);var e=this.ds.pipeline();t.removeListener(e[0]),t._graph.disconnect(e)}var a=t("datalib"),s=t("../dataflow/tuple"),o=t("../dataflow/changeset"),l=t("../util/debug"),u=t("../util/constants"),c=a.groupby(),d=r.prototype=Object.create(c);d.facet=function(t){return arguments.length?(this._facet=t,this):this._facet},d._ingest=function(t){return s.ingest(t,null)},d._assign=s.set,d._newcell=function(t){var e,n,r=c._newcell.call(this,t),a=this._facet,s=r.tuple;return null!==this._facet&&(e=a._graph,n=a.param("transform"),r.ds=e.data("vg_"+s._id,n,s),r["delete"]=i,a.addListener(n[0])),r},d._newtuple=function(t){var e=c._newtuple.call(this,t);return null!==this._facet&&s.set(e,"key",this._cellkey(t)),e},d.clear=function(){if(null!==this._facet)for(var t in this._cells)this._cells[t]["delete"](this._facet);return c.clear.call(this)},d._add=function(t){var e=this._cell(t);c._add.call(this,t),null!==this._facet&&e.ds._input.add.push(t)},d._mod=function(t,e){var n=this._cell(e),r=this._cell(t);c._mod.call(this,t,e),null!==this._facet&&(n===r?n.ds._input.mod.push(t):(n.ds._input.rem.push(t),r.ds._input.add.push(t)))},d._rem=function(t){var e=this._cell(t);c._rem.call(this,t),null!==this._facet&&e.ds._input.rem.push(t)},d.changes=function(t,e){var n,r,i,a,s=this._aggr;for(a in this._cells){for(n=this._cells[a],r=n.flag,n.collect&&n.data.values(),i=0;i<s.length;++i)n.aggs[s[i].name].set();n.num<=0?(r===u.MOD_CELL&&e.rem.push(n.tuple),null!==this._facet&&n["delete"](this._facet),delete this._cells[a]):(null!==this._facet&&o.copy(t,n.ds._input),r&u.ADD_CELL?e.add.push(n.tuple):r&u.MOD_CELL&&e.mod.push(n.tuple)),n.flag=0}return this._rems=!1,e},e.exports=r},{"../dataflow/changeset":36,"../dataflow/tuple":37,"../util/constants":107,"../util/debug":108,datalib:20}],88:[function(t,e,n){function r(t){return a.prototype.init.call(this,t),a.addParameters(this,{test:{type:"expr"}}),this._skip={},this}function i(t){return o.eval(this._graph,this.param("test"),t,null,null,null,this.dependency(u.SIGNALS))}var a=t("./Transform"),s=t("../dataflow/changeset"),o=t("../parse/expr"),l=t("../util/debug"),u=t("../util/constants"),c=r.prototype=new a;c.transform=function(t){l(t,["filtering"]);var e=s.create(t),n=this._skip,r=this;return t.rem.forEach(function(t){1!==n[t._id]?e.rem.push(t):n[t._id]=0}),t.add.forEach(function(t){i.call(r,t)?e.add.push(t):n[t._id]=1}),t.mod.forEach(function(t){var a=i.call(r,t),s=1===n[t._id];a&&s?(n[t._id]=0,e.add.push(t)):a&&!s?e.mod.push(t):!a&&s||(e.rem.push(t),n[t._id]=1)}),e},e.exports=r},{"../dataflow/changeset":36,"../parse/expr":47,"../util/constants":107,"../util/debug":108,"./Transform":99}],89:[function(t,e,n){function r(t){return o.prototype.init.call(this,t),o.addParameters(this,{fields:{type:"array<field>"}}),this._output={key:"key",value:"value"},this._cache={},this.router(!0).revises(!0)}function i(t,e){for(var n in this._cache)e.rem.push.apply(e.rem,this._cache[n]);this._cache={}}function a(t,e,n){var r=this._cache[t._id]||(this._cache[t._id]=Array(n));return r[e]||(r[e]=u.derive(t,t._prev))}function s(t,e,n,r,i){for(var s,o,l,c=0,d=t.length,f=e.length;d>c;++c)for(o=t[c],s=0;f>s;++s)l=a.call(this,o,s,f),u.set(l,this._output.key,e[s]),u.set(l,this._output.value,n[s](o)),r.push(l)}var o=t("./Transform"),l=t("../util/debug"),u=t("../dataflow/tuple"),c=t("../dataflow/changeset"),d=r.prototype=new o;d.transform=function(t,e){l(t,["folding"]);var n=this,r=this.param("fields"),a=c.create(t);return e&&i.call(this,t,a),s.call(this,t.add,r.field,r.accessor,a.add,t.stamp),s.call(this,t.mod,r.field,r.accessor,e?a.add:a.mod,t.stamp),t.rem.forEach(function(t){a.rem.push.apply(a.rem,n._cache[t._id]),n._cache[t._id]=null}),(t.add.length||t.rem.length||r.field.some(function(e){return!!t.fields[e]}))&&(a.fields[this._output.key]=1,a.fields[this._output.value]=1),a},e.exports=r},{"../dataflow/changeset":36,"../dataflow/tuple":37,"../util/debug":108,"./Transform":99}],90:[function(t,e,n){(function(n){function r(t){return a.prototype.init.call(this,t),a.addParameters(this,{size:{type:"array<value>","default":[500,500]},links:{type:"data"},linkDistance:{type:"field|value","default":20},linkStrength:{type:"field|value","default":1},charge:{type:"field|value","default":30},chargeDistance:{type:"field|value","default":1/0},iterations:{type:"value","default":500},friction:{type:"value","default":.9},theta:{type:"value","default":.8},gravity:{type:"value","default":.1},alpha:{type:"value","default":.1}}),this._nodes=[],this._links=[],this._layout=i.layout.force(),this._output={x:"layout_x",y:"layout_y",source:"_source",target:"_target"},this}var i="undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null,a=t("./Transform"),s=t("../dataflow/tuple"),o=r.prototype=new a;o.transform=function(t){var e=this.param("links").source.last(),n=this._layout,r=this._output,i=this._nodes,a=this._links,o=this.param("iterations");t.add.forEach(function(t){i.push({tuple:t})}),e.add.forEach(function(t){var e={tuple:t,source:i[t.source],target:i[t.target]};s.set(t,r.source,e.source.tuple),s.set(t,r.target,e.target.tuple),a.push(e)}),n.size(this.param("size")).linkDistance(this.param("linkDistance")).linkStrength(this.param("linkStrength")).charge(this.param("charge")).chargeDistance(this.param("chargeDistance")).friction(this.param("friction")).theta(this.param("theta")).gravity(this.param("gravity")).alpha(this.param("alpha")).nodes(i).links(a),n.start();for(var l=0;o>l;++l)n.tick();if(n.stop(),i.forEach(function(t){s.set(t.tuple,r.x,t.x),s.set(t.tuple,r.y,t.y)}),t.rem.length>0){var u=s.idMap(t.rem);this._nodes=i.filter(function(t){return!u[t.tuple._id]})}if(e.rem.length>0){var c=s.idMap(e.rem);this._links=a.filter(function(t){return!c[t.tuple._id]})}return t.fields[r.x]=1,t.fields[r.y]=1,t},e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../dataflow/tuple":37,"./Transform":99}],91:[function(t,e,n){function r(t){return i.prototype.init.call(this,t),i.addParameters(this,{field:{type:"value"},expr:{type:"expr"}}),this}var i=t("./Transform"),a=t("../dataflow/tuple"),s=t("../parse/expr"),o=t("../util/debug"),l=t("../util/constants"),u=r.prototype=new i;u.transform=function(t){function e(t){var e=s.eval(n,i,t,null,null,null,u);a.set(t,r,e)}o(t,["formulating"]);var n=this._graph,r=this.param("field"),i=this.param("expr"),u=this.dependency(l.SIGNALS);return t.add.forEach(e),this.reevaluate(t)&&t.mod.forEach(e),t.fields[r]=1,t},e.exports=r},{"../dataflow/tuple":37,"../parse/expr":47,"../util/constants":107,"../util/debug":108,"./Transform":99}],92:[function(t,e,n){(function(n){function r(t){return s.prototype.init.call(this,t),s.addParameters(this,r.Parameters),s.addParameters(this,{lon:{type:"field"},lat:{type:"field"}}),this._output={x:"layout_x",y:"layout_y"},this}var i=t("datalib"),a="undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null,s=t("./Transform"),o=t("../dataflow/tuple");r.Parameters={projection:{type:"value","default":"mercator"},center:{type:"array[value]"},translate:{type:"array[value]"},rotate:{type:"array[value]"},scale:{type:"value"},precision:{type:"value"},clipAngle:{type:"value"},clipExtent:{type:"value"}},r.d3Projection=function(){var t,e,n,s=(this._graph,this.param("projection")),o=r.Parameters;s!==this._mode&&(this._mode=s,this._projection=a.geo[s]()),t=this._projection;for(e in o)"projection"!==e&&t[e]&&(n=this.param(e),void 0===n||i.isArray(n)&&0===n.length||n!==t[e]()&&t[e](n));return t};var l=r.prototype=new s;l.transform=function(t){function e(t){var e=[i(t),a(t)],r=s(e);o.set(t,n.x,r[0]),o.set(t,n.y,r[1])}var n=(this._graph,this._output),i=this.param("lon").accessor,a=this.param("lat").accessor,s=r.d3Projection.call(this);return t.add.forEach(e),this.reevaluate(t)&&(t.mod.forEach(e),t.rem.forEach(e)),t.fields[n.x]=1,t.fields[n.y]=1,t},e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../dataflow/tuple":37,"./Transform":99,datalib:20}],93:[function(t,e,n){(function(n){function r(t){return o.prototype.init.call(this,t),o.addParameters(this,s.Parameters),o.addParameters(this,{value:{type:"field","default":null}}),this._output={path:"layout_path"},this}var i=t("datalib"),a="undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null,s=t("./Geo"),o=t("./Transform"),l=t("../dataflow/tuple"),u=r.prototype=new o;u.transform=function(t){function e(t){l.set(t,n.path,u(r(t)))}var n=this._output,r=this.param("value").accessor||i.identity,o=s.d3Projection.call(this),u=a.geo.path().projection(o);return t.add.forEach(e),this.reevaluate(t)&&(t.mod.forEach(e),t.rem.forEach(e)),t.fields[n.path]=1,t},e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../dataflow/tuple":37,"./Geo":92,"./Transform":99,datalib:20}],94:[function(t,e,n){function r(t){return l.prototype.init.call(this,t),l.addParameters(this,{source:{type:"field","default":"_source"},target:{type:"field","default":"_target"},x:{type:"field","default":"layout_x"},y:{type:"field","default":"layout_y"},tension:{type:"value","default":.2},shape:{type:"value","default":"line"}}),this._output={path:"layout_path"},this}function i(t,e,n,r,i,a){var s=e(t),o=r(s),l=i(s),u=n(t),c=r(u),d=i(u);return"M"+o+","+l+"L"+c+","+d}function a(t,e,n,r,i,a){var s=e(t),o=r(s),l=i(s),u=n(t),c=r(u),d=i(u),f=c-o,h=d-l,p=a*(f+h),g=a*(h-f);return"M"+o+","+l+"C"+(o+p)+","+(l+g)+" "+(c+g)+","+(d-p)+" "+c+","+d}function s(t,e,n,r,i,a){var s=e(t),o=r(s),l=i(s),u=n(t),c=r(u),d=i(u),f=(o+c)/2;return"M"+o+","+l+"C"+f+","+l+" "+f+","+d+" "+c+","+d}function o(t,e,n,r,i,a){var s=e(t),o=r(s),l=i(s),u=n(t),c=r(u),d=i(u),f=(l+d)/2;return"M"+o+","+l+"C"+o+","+f+" "+c+","+f+" "+c+","+d}var l=t("./Transform"),u=t("../dataflow/tuple"),c=r.prototype=new l,d={line:i,curve:a,diagonal:s,diagonalX:s,diagonalY:o};c.transform=function(t){function e(t){var e=r(t,i,a,s,o,l);u.set(t,n.path,e)}var n=this._output,r=d[this.param("shape")]||d.line,i=this.param("source").accessor,a=this.param("target").accessor,s=this.param("x").accessor,o=this.param("y").accessor,l=this.param("tension");return t.add.forEach(e),this.reevaluate(t)&&t.mod.forEach(e),t.fields[n.path]=1,t},e.exports=r},{"../dataflow/tuple":37,"./Transform":99}],95:[function(t,e,n){function r(t,e,n){this._name=t,this._type=e,this._transform=n,this._value=[],this._accessors=[],this._resolution=!1,this._signals={}}function i(){var t=l.test(this._type),e=u.test(this._type),n=c.test(this._type),r=t?this._value:this._value[0],i=t?this._accessors:this._accessors[0];return!a.isValid(i)&&f.test(this._type)?r:e?{name:r,source:i}:n?{field:r,accessor:i}:r}var a=t("datalib"),s=t("../parse/expr"),o=t("../util/constants"),l=/array/i,u=/data/i,c=/field/i,d=/expr/i,f=/value/i,h=r.prototype;h.get=function(){var t,e,n,r=this._transform._graph,s=u.test(this._type),o=c.test(this._type);if(!this._resolution)return i.call(this);if(s)return this._accessors=this._value.map(function(t){return r.data(t)}),i.call(this);for(t in this._signals)e=this._signals[t],n=r.signalRef(t),o&&(this._accessors[e]=this._value[e]!=n?a.accessor(n):this._accessors[e]),this._value[e]=n;return i.call(this)},h.set=function(t){var e=this,n=d.test(this._type),r=u.test(this._type),i=c.test(this._type);return this._value=a.array(t).map(function(t,l){if(a.isString(t)){if(n){var u=s(t);return e._transform.dependency(o.FIELDS,u.fields),e._transform.dependency(o.SIGNALS,u.signals),u.fn}return i?(e._accessors[l]=a.accessor(t),e._transform.dependency(o.FIELDS,t)):r&&(e._resolution=!0,e._transform.dependency(o.DATA,t)),t}return void 0!==t.value?t.value:void 0!==t.field?(e._accessors[l]=a.accessor(t.field),e._transform.dependency(o.FIELDS,t.field),t.field):void 0!==t.signal?(e._resolution=!0,e._signals[t.signal]=l,e._transform.dependency(o.SIGNALS,t.signal),t.signal):t}),e._transform},e.exports=r},{"../parse/expr":47,"../util/constants":107,datalib:20}],96:[function(t,e,n){(function(n){function r(t){return l.prototype.init.call(this,t),o.addParameters(this,{value:{type:"field","default":null},startAngle:{type:"value","default":0},endAngle:{type:"value","default":2*Math.PI},sort:{type:"value","default":!1}}),this._output={start:"layout_start",end:"layout_end",mid:"layout_mid"},this}function i(){return 1}var a=t("datalib"),s="undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null,o=t("./Transform"),l=t("./BatchTransform"),u=t("../dataflow/tuple"),c=r.prototype=new l;c.batchTransform=function(t,e){var n,r,o,l=(this._graph,this._output),c=this.param("value").accessor||i,d=this.param("startAngle"),f=this.param("endAngle"),h=this.param("sort"),p=e.map(c),g=d,m=(f-d)/s.sum(p),v=a.range(e.length);for(h&&v.sort(function(t,e){return p[t]-p[e]}),n=0;n<v.length;++n)r=e[v[n]],o=p[v[n]],u.set(r,l.start,g),u.set(r,l.mid,g+.5*o*m),u.set(r,l.end,g+=o*m);return t.fields[l.start]=1,t.fields[l.end]=1,t.fields[l.mid]=1,t},e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../dataflow/tuple":37,"./BatchTransform":83,"./Transform":99,datalib:20}],97:[function(t,e,n){function r(t){return a.prototype.init.call(this,t),a.addParameters(this,{by:{type:"array<field>"}}),this.router(!0)}var i=t("datalib"),a=t("./Transform"),s=(t("../parse/expr"),t("../util/debug")),o=r.prototype=new a;o.transform=function(t){return s(t,["sorting"]),(t.add.length||t.mod.length||t.rem.length)&&(t.sort=i.comparator(this.param("by").field)),t},e.exports=r},{"../parse/expr":47,"../util/debug":108,"./Transform":99,datalib:20}],98:[function(t,e,n){function r(t){return o.prototype.init.call(this,t),s.addParameters(this,{groupby:{type:"array<field>"},sortby:{type:"array<field>"},value:{type:"field"},offset:{type:"value","default":"zero"}}),this._output={start:"layout_start",end:"layout_end",mid:"layout_mid"},this}function i(t,e,n,r){var i,a,s,o,l,u,c,d=[];if(null==e)d.push(t.slice());else for(i={},a=0;a<t.length;++a)s=t[a],o=e.map(function(t){return t(s)}),l=i[o]||(d.push(i[o]=[]),i[o]),l.push(s);for(o=0,c=0;o<d.length;++o){for(l=d[o],a=0,u=0;a<l.length;++a)u+=r(l[a]);l.sum=u,u>c&&(c=u),null!=n&&l.sort(n)}return d.max=c,d}var a=t("datalib"),s=t("./Transform"),o=t("./BatchTransform"),l=t("../dataflow/tuple"),u=r.prototype=new o;u.batchTransform=function(t,e){for(var n=(this._graph,this.param("groupby").accessor),r=a.comparator(this.param("sortby").field),s=this.param("value").accessor,o=this.param("offset"),u=this._output,c=i(e,n,r,s),d=0,f=c.max;d<c.length;++d){var d,h,p,g=c[d],m=g.sum,v="center"===o?(f-m)/2:0,y="normalize"===o?1/m:1,_=v,x=0;for(j=0;j<g.length;++j)h=g[j],p=_,x+=s(h),_=y*x+v,l.set(h,u.start,p),l.set(h,u.end,_),l.set(h,u.mid,.5*(p+_))}return t.fields[u.start]=1,t.fields[u.end]=1,t.fields[u.mid]=1,t},e.exports=r},{"../dataflow/tuple":37,"./BatchTransform":83,"./Transform":99,datalib:20}],99:[function(t,e,n){function r(t){return t&&i.prototype.init.call(this,t),this}var i=t("../dataflow/Node"),a=t("./Parameter"),s=t("../util/constants");r.addParameters=function(t,e){t._parameters=t._parameters||{};for(var n in e){var r=e[n],i=t._parameters[n]=new a(n,r.type,t);"custom"===r.type&&(r.set&&(i.set=r.set.bind(i)),r.get&&(i.get=r.get.bind(i))),r.hasOwnProperty("default")&&i.set(r["default"])}};var o=r.prototype=new i;o.param=function(t,e){return 1===arguments.length?this._parameters[t].get():this._parameters[t].set(e)},o.transform=function(t,e){return t},o.evaluate=function(t){var e=this._stamp<t.stamp&&this.dependency(s.SIGNALS).some(function(e){return!!t.signals[e]});return this.transform(t,e)},o.output=function(t){for(var e in this._output)void 0!==t[e]&&(this._output[e]=t[e]);return this},e.exports=r},{"../dataflow/Node":34,"../util/constants":107,"./Parameter":95}],100:[function(t,e,n){(function(n){function r(t){return o.prototype.init.call(this,t),s.addParameters(this,{sort:{type:"array<field>","default":["-value"]},children:{type:"field","default":"children"},value:{type:"field","default":"value"},size:{type:"array<value>","default":[500,500]},round:{type:"value","default":!0},sticky:{type:"value","default":!1},ratio:{type:"value","default":.5*(1+Math.sqrt(5))},padding:{type:"value","default":null},mode:{type:"value","default":"squarify"}}),this._layout=a.layout.treemap(),this._output={x:"layout_x",y:"layout_y",width:"layout_width",height:"layout_height"},this}var i=t("datalib"),a="undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null,s=t("./Transform"),o=t("./BatchTransform"),l=t("../dataflow/tuple"),u=r.prototype=new o;u.batchTransform=function(t,e){var n=this._layout,r=this._output;return n.sort(i.comparator(this.param("sort").field)).children(this.param("children").accessor).value(this.param("value").accessor).size(this.param("size")).round(this.param("round")).sticky(this.param("sticky")).ratio(this.param("ratio")).padding(this.param("padding")).mode(this.param("mode")).nodes(e[0]),e.forEach(function(t){l.set(t,r.x,t.x),l.set(t,r.y,t.y),l.set(t,r.width,t.dx),l.set(t,r.height,t.dy)}),t.fields[r.x]=1,t.fields[r.y]=1,t.fields[r.width]=1,t.fields[r.height]=1,t},e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../dataflow/tuple":37,"./BatchTransform":83,"./Transform":99,datalib:20}],101:[function(t,e,n){function r(t){return s.prototype.init.call(this,t),s.addParameters(this,{"with":{type:"data"},as:{type:"value"},key:{type:"field","default":"data"},withKey:{type:"field","default":null},"default":{type:"value"}}),this._map={},this._collector=new o(t),this._lastJoin=0,this.revises(!0)}function i(t){return this._map[t]||(this._map[t]=[])}var a=t("datalib"),s=t("./Transform"),o=t("../dataflow/Collector"),l=t("../util/debug"),u=r.prototype=new s;u.transform=function(t){var e=this.param("with"),n=e.source,r=n.last(),s=n.values(),o=this.param("key"),u=this.param("withKey"),c=this.param("as"),d=this.param("default"),f=i.bind(this),h={};if(l(t,["zipping",e.name]),u.field)r&&r.stamp>this._lastJoin&&(r.rem.forEach(function(t){var e=f(u.accessor(t));e[0]&&e[0].forEach(function(t){t[c]=d}),e[1]=null}),r.add.forEach(function(t){var e=f(u.accessor(t));e[0]&&e[0].forEach(function(e){e[c]=t}),e[1]=t}),r.fields[u.field]&&r.mod.forEach(function(t){var e;if(t._prev&&void 0!==(e=u.accessor(t._prev))){var n=f(e);n[0]&&n[0].forEach(function(t){t[c]=d}),n[1]=null;var r=f(u.accessor(t));r[0]&&r[0].forEach(function(e){e[c]=t}),r[1]=t}}),this._lastJoin=r.stamp),t.add.forEach(function(t){var e=f(o.accessor(t));t[c]=e[1]||d,(e[0]=e[0]||[]).push(t)}),t.rem.forEach(function(t){var e=o.accessor(t);(h[e]=h[e]||{})[t._id]=1}),t.fields[o.field]&&t.mod.forEach(function(t){var e;if(t._prev&&void 0!==(e=o.accessor(t._prev))){var n=f(o.accessor(t));t[c]=n[1]||d,(n[0]=n[0]||[]).push(t),(h[e]=h[e]||{})[t._id]=1}}),a.keys(h).forEach(function(t){var e=f(t);e[0]&&(e[0]=e[0].filter(function(e){return 1!==h[t][e._id]}))});else{if(0==t.add.length&&0==t.rem.length&&0==r.add.length&&0==r.rem.length)return t;this._collector.evaluate(t);var p,g=this._collector.data(),m=s.length;for(p=0;p<g.length;p++)g[p][c]=s[p%m]}return t.fields[c]=1,t},e.exports=r},{"../dataflow/Collector":31,"../util/debug":108,"./Transform":99,datalib:20}],102:[function(t,e,n){e.exports={aggregate:t("./Aggregate"),bin:t("./Bin"),cross:t("./Cross"),linkpath:t("./LinkPath"),facet:t("./Facet"),filter:t("./Filter"),fold:t("./Fold"),force:t("./Force"),formula:t("./Formula"),geo:t("./Geo"),geopath:t("./GeoPath"),pie:t("./Pie"),sort:t("./Sort"),stack:t("./Stack"),treemap:t("./Treemap"),zip:t("./Zip")}},{"./Aggregate":82,"./Bin":84,"./Cross":85,"./Facet":86,"./Filter":88,"./Fold":89,"./Force":90,"./Formula":91,"./Geo":92,"./GeoPath":93,"./LinkPath":94,"./Pie":96,"./Sort":97,"./Stack":98,"./Treemap":100,"./Zip":101}],103:[function(t,e,n){var r=function(t){this.clear(),t&&this.union(t)},i=r.prototype;i.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},i.set=function(t,e,n,r){return this.x1=t,this.y1=e,this.x2=n,this.y2=r,this},i.add=function(t,e){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},i.expand=function(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},i.round=function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},i.translate=function(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},i.rotate=function(t,e,n){var r=Math.cos(t),i=Math.sin(t),a=e-e*r+n*i,s=n-e*i-n*r,o=this.x1,l=this.x2,u=this.y1,c=this.y2;return this.clear().add(r*o-i*u+a,i*o+r*u+s).add(r*o-i*c+a,i*o+r*c+s).add(r*l-i*u+a,i*l+r*u+s).add(r*l-i*c+a,i*l+r*c+s)},i.union=function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},i.encloses=function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},i.intersects=function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},i.contains=function(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},i.width=function(){return this.x2-this.x1},i.height=function(){return this.y2-this.y1},e.exports=r},{}],104:[function(t,e,n){function r(t){this.id="grad_"+i++,this.type=t||"linear",this.stops=[],this.x1=0,this.x2=1,this.y1=0,this.y2=0}var i=0,a=r.prototype;a.stop=function(t,e){return this.stops.push({offset:t,color:e}),this},e.exports=r},{}],105:[function(t,e,n){(function(n){function r(t){return(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+(null!=t.fontSize?t.fontSize:w.render.fontSize)+"px "+(t.font||w.render.font)}function i(){return T||(T=(_.isNode?new("undefined"!=typeof window?window.canvas:"undefined"!=typeof n?n.canvas:null)(1,1):y.select("body").append("canvas").attr("class","vega_hidden").attr("width",1).attr("height",1).style("display","none").node()).getContext("2d"))}function a(t,e,n){return null==e?n.set(0,0,0,0):(E(e,n),t.stroke&&0!==t.opacity&&t.strokeWidth>0&&n.expand(t.strokeWidth)),n}function s(t,e){var n=t.path?t.pathCache||(t.pathCache=k(t.path)):null;return a(t,n,e)}function o(t,e){var n=t.mark.items,t=n[0],r=t.pathCache||(t.pathCache=k(L(n)));return a(n[0],r,e)}function l(t,e){var n=t.mark.items,t=n[0],r=t.pathCache||(t.pathCache=k(S(n)));return a(n[0],r,e)}function u(t,e){var n=t.x||0,r=t.y||0,i=n+t.width||0,a=r+t.height||0;return e.set(n,r,i,a),t.stroke&&0!==t.opacity&&t.strokeWidth>0&&e.expand(t.strokeWidth),e}function c(t,e){var n=t.width||0,r=t.height||0,i=(t.x||0)-("center"===t.align?n/2:"right"===t.align?n:0),a=(t.y||0)-("middle"===t.baseline?r/2:"bottom"===t.baseline?r:0);return e.set(i,a,i+n,a+r)}function d(t,e){var n,r;return e.set(n=t.x||0,r=t.y||0,null!=t.x2?t.x2:n,null!=t.y2?t.y2:r),t.stroke&&0!==t.opacity&&t.strokeWidth>0&&e.expand(t.strokeWidth),e}function f(t,e){var n,r,i,a,s,o,l,u,c,d=t.x||0,f=t.y||0,h=t.innerRadius||0,p=t.outerRadius||0,g=(t.startAngle||0)-A,m=(t.endAngle||0)-A,v=1/0,y=-(1/0),_=1/0,x=-(1/0),b=[g,m],w=g-g%A;for(r=0;4>r&&m>w;++r,w+=A)b.push(w);for(r=0,i=b.length;i>r;++r)n=b[r],a=Math.cos(n),o=h*a,u=p*a,s=Math.sin(n),l=h*s,c=p*s,v=Math.min(v,o,u),y=Math.max(y,o,u),_=Math.min(_,l,c),x=Math.max(x,l,c);return e.set(d+v,f+_,d+y,f+x),t.stroke&&0!==t.opacity&&t.strokeWidth>0&&e.expand(t.strokeWidth),e}function h(t,e){var n,r,i,a,s=null!=t.size?t.size:100,o=t.x||0,l=t.y||0;switch(t.shape){case"cross":n=Math.sqrt(s/5)/2,r=3*n,e.set(o-r,l-n,o+r,l+n);break;case"diamond":a=Math.sqrt(s/(2*C)),i=a*C,e.set(o-i,l-a,o+i,l+a);break;case"square":r=Math.sqrt(s),n=r/2,e.set(o-n,l-n,o+n,l+n);break;case"triangle-down":i=Math.sqrt(s/M),a=i*M/2,e.set(o-i,l-a,o+i,l+a);break;case"triangle-up":i=Math.sqrt(s/M),a=i*M/2,e.set(o-i,l-a,o+i,l+a);break;default:n=Math.sqrt(s/Math.PI),e.set(o-n,l-n,o+n,l+n)}return t.stroke&&0!==t.opacity&&t.strokeWidth>0&&e.expand(t.strokeWidth),e}function p(t,e,n){var a,s,o=(t.x||0)+(t.dx||0),l=(t.y||0)+(t.dy||0),u=t.fontSize||w.render.fontSize,c=t.align,d=t.baseline,f=t.radius||0,h=i();return h.font=r(t),h.textAlign=c||"left",h.textBaseline=d||"alphabetic",a=h.measureText(t.text||"").width,f&&(s=(t.theta||0)-Math.PI/2,o+=f*Math.cos(s),l+=f*Math.sin(s)),"center"===c?o-=a/2:"right"===c&&(o-=a),"top"===d?l+=u/5:"bottom"===d?l-=u:"middle"===d?l=l-u/2+u/10:l-=4*u/5,e.set(o,l,o+a,l+u),t.angle&&!n&&e.rotate(t.angle*Math.PI/180,t.x||0,t.y||0),e.expand(n?0:1)}function g(t,e,n){var r,i,a=t.axisItems||[],s=t.legendItems||[];for(r=0,i=a.length;i>r;++r)e.union(a[r].bounds);for(r=0,i=t.items.length;i>r;++r)e.union(t.items[r].bounds);if(n){for(r=0,i=s.length;i>r;++r)e.union(s[r].bounds);null!=t.width&&null!=t.height&&e.add(t.width,t.height),null!=t.x&&null!=t.y&&e.add(0,0)}return e.translate(t.x||0,t.y||0),e}function m(t,e,n){e=e||N[t.mark.marktype],t.bounds_prev||(t["bounds:prev"]=new x);var r=t.bounds,i=t["bounds:prev"];return r&&i.clear().union(r),t.bounds=e(t,r?r.clear():new x,n),r||i.clear().union(t.bounds),t.bounds}function v(t,e,n){e=e||t.bounds&&t.bounds.clear()||new x;var r,i,a=t.marktype,s=N[a],o=t.items;if("area"===a||"line"===a)o.length&&(o[0].bounds=s(o[0],e));else for(r=0,i=o.length;i>r;++r)e.union(m(o[r],s,n));t.bounds=e}var y="undefined"!=typeof window?window.d3:"undefined"!=typeof n?n.d3:null,_=t("datalib"),x=t("../util/Bounds"),b=t("../render/canvas/path"),w=t("./config"),k=b.parse,E=b.bounds,L=b.area,S=b.line,A=Math.PI/2,M=Math.sqrt(3),C=Math.tan(30*Math.PI/180),T=null,N={group:g,symbol:h,image:c,rect:u,rule:d,arc:f,text:p,path:s,area:o,line:l};e.exports={mark:v,item:m,text:p,
group:g}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../render/canvas/path":64,"../util/Bounds":103,"./config":106,datalib:20}],106:[function(t,e,n){(function(t){var n="undefined"!=typeof window?window.d3:"undefined"!=typeof t?t.d3:null,r={};r.debug=!1,r.load={baseURL:"",domainWhiteList:!1},r.svgNamespace='version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"',r.autopadInset=5,r.scale={time:n.time.scale,utc:n.time.scale.utc},r.render={lineWidth:1,lineCap:"butt",font:"sans-serif",fontSize:11},r.axis={orient:"bottom",ticks:10,padding:3,axisColor:"#000",gridColor:"#d8d8d8",tickColor:"#000",tickLabelColor:"#000",axisWidth:1,tickWidth:1,tickSize:6,tickLabelFontSize:11,tickLabelFont:"sans-serif",titleColor:"#000",titleFont:"sans-serif",titleFontSize:11,titleFontWeight:"bold",titleOffset:35},r.legend={orient:"right",offset:10,padding:3,gradientStrokeColor:"#888",gradientStrokeWidth:1,gradientHeight:16,gradientWidth:100,labelColor:"#000",labelFontSize:10,labelFont:"sans-serif",labelAlign:"left",labelBaseline:"middle",labelOffset:8,symbolShape:"circle",symbolSize:50,symbolColor:"#888",symbolStrokeWidth:1,titleColor:"#000",titleFont:"sans-serif",titleFontSize:11,titleFontWeight:"bold"},r.color={rgb:[128,128,128],lab:[50,0,0],hcl:[0,0,50],hsl:[0,0,.5]},r.range={category10:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],category20:["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],shapes:["circle","cross","diamond","square","triangle-down","triangle-up"]},e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],107:[function(t,e,n){e.exports={ADD_CELL:1,MOD_CELL:2,ID:"_id",DATA:"data",FIELDS:"fields",SCALES:"scales",SIGNAL:"signal",SIGNALS:"signals",GROUP:"group",ENTER:"enter",UPDATE:"update",EXIT:"exit",SENTINEL:{sentinel:1},SINGLETON:"_singleton",ADD:"add",REMOVE:"remove",TOGGLE:"toggle",CLEAR:"clear",LINEAR:"linear",ORDINAL:"ordinal",LOG:"log",POWER:"pow",TIME:"time",QUANTILE:"quantile",DOMAIN:"domain",RANGE:"range",MARK:"mark",AXIS:"axis",LEGEND:"legend",COUNT:"count",GROUPBY:"groupby",MIN:"min",MAX:"max",VALUE:"value",SORT:"sort",ASC:"asc",DESC:"desc"}},{}],108:[function(t,e,n){var r,i=t("./config");e.exports=function(t,e){if(i.debug){var n=Function.prototype.bind.call(console.log,console);e.unshift(t.stamp||-1),e.unshift(Date.now()-r),t.add&&e.push(t.add.length,t.mod.length,t.rem.length,!!t.reflow),n.apply(console,e),r=Date.now()}}},{"./config":106}]},{},[1])(1)});