Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vega-parser

Package Overview
Dependencies
Maintainers
1
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vega-parser - npm Package Compare versions

Comparing version 3.7.1 to 3.7.2

2

build/vega-parser.min.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vega-util"),require("d3-format"),require("d3-time-format"),require("vega-scale"),require("vega-scenegraph"),require("d3-geo"),require("vega-dataflow"),require("vega-expression"),require("vega-statistics"),require("d3-color"),require("d3-array"),require("vega-event-selector")):"function"==typeof define&&define.amd?define(["exports","vega-util","d3-format","d3-time-format","vega-scale","vega-scenegraph","d3-geo","vega-dataflow","vega-expression","vega-statistics","d3-color","d3-array","vega-event-selector"],t):t(e.vega={},e.vega,e.d3,e.d3,e.vega,e.vega,e.d3,e.vega,e.vega,e.vega,e.d3,e.d3,e.vega)}(this,function(e,Ye,n,a,f,p,t,g,o,r,i,l,u){"use strict";function h(e){return+e||0}var s="outer",d=["value","update","react","bind"];function c(e,t){Ye.error(e+' for "outer" push: '+Ye.stringValue(t))}function m(t,e){var n=t.name;if(t.push===s)e.signals[n]||c("No prior signal definition",n),d.forEach(function(e){void 0!==t[e]&&c("Invalid property ",e)});else{var a=e.addSignal(n,t.value);!1===t.react&&(a.react=!1),t.bind&&e.addBinding(n,t.bind)}}var v={};function y(e,t,n){var a=e+":"+n,r=v[a];return r&&r[0]===t||(v[a]=r=[t,t(n)]),r[1]}function b(e,t){return y("timeFormat",a.timeFormat,t)(e)}var x=new Date(2e3,0,1);function k(e,t,n){return x.setMonth(e),x.setDate(t),b(x,n)}function S(e,t,n,a){var r,i=t[0],o=t[t.length-1];return o<i&&(r=i,i=o,o=r),a=void 0===a||a,((n=void 0===n||n)?i<=e:i<e)&&(a?e<=o:e<o)}function R(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(e){t.warn(e)}return n[n.length-1]}var w="undefined"!=typeof window&&window||null;var O="Literal",z="%",P=":";function j(e,t){var n;return Ye.isFunction(e)?e:Ye.isString(e)?(n=t.scales[e])&&n.value:void 0}function D(e,t,n){var a=z+n;if(!t.hasOwnProperty(a))try{t[a]=e.scaleRef(n)}catch(e){}}function $(e,t,n,a){if(t[0].type===O)D(n,a,t[0].value);else if("Identifier"===t[0].type)for(e in n.scales)D(n,a,e)}function _(r,i){return function(e,t,n){if(e){var a=j(e,(n||this).context);return a&&a.path[r](t)}return i(t)}}var E=_("area",t.geoArea),V=_("bounds",t.geoBounds),A=_("centroid",t.geoCentroid);function F(e){var t=this.context.data[e];return t?t.values.value:[]}function W(e,t,n,a){t[0].type!==O&&Ye.error("First argument to data functions must be a string literal.");var r=t[0].value,i=P+r;a.hasOwnProperty(i)||(a[i]=n.getData(r).tuplesRef())}var L={};function C(e){return e.data}function M(e,t){var n=F.call(t,e);return n.root&&n.root.lookup||L}function q(e,t){return e===t||e!=e&&t!=t||!(!Ye.isArray(e)||!Ye.isArray(t)||e.length!==t.length)&&function(e,t){for(var n=0,a=e.length;n<a;++n)if(!q(e[n],t[n]))return!1;return!0}(e,t)}function B(n){return function(e){for(var t in n)if(!q(e[t],n[t]))return!1;return!0}}var T="bin_",N="intersect",U="union",I="index:unit";function X(e,t){for(var n,a=t.fields,r=t.values,i=t.getter||(t.getter=[]),o=a.length,l=0;l<o;++l)if(i[l]=i[l]||Ye.field(a[l]),n=i[l](e),Ye.isDate(n)&&(n=Ye.toNumber(n)),Ye.isDate(r[l])&&(r[l]=Ye.toNumber(r[l])),t[T+a[l]]){if(Ye.isDate(r[l][0])&&(r[l]=r[l].map(Ye.toNumber)),!S(n,r[l],!0,!1))return!1}else if(n!==r[l])return!1;return!0}function Y(e,t){for(var n,a,r=t.intervals,i=r.length,o=0;o<i;++o){if(n=r[o].extent,a=(r[o].getter||(r[o].getter=Ye.field(r[o].field)))(e),!n||n[0]===n[1])return!1;if(Ye.isDate(a)&&(a=Ye.toNumber(a)),Ye.isDate(n[0])&&(n=r[o].extent=n.map(Ye.toNumber)),Ye.isNumber(n[0])&&!S(a,n))return!1;if(Ye.isString(n[0])&&n.indexOf(a)<0)return!1}return!0}function G(e,t,n,a){for(var r,i,o,l,s,u=this.context.data[e],d=u?u.values.value:[],c=u?u[I]&&u[I].value:void 0,f=n===N,p=d.length,g=0;g<p;++g)if(r=d[g],c&&f){if(-1===(o=(i=i||{})[l=r.unit]||0))continue;if(s=a(t,r),i[l]=s?-1:++o,s&&1===c.size)return!0;if(!s&&o===c.get(l).count)return!1}else if(f^(s=a(t,r)))return s;return p&&f}function H(e,t,n){return G.call(this,e,t,n,X)}function J(e,t,n,a){t[0].type!==O&&Ye.error("First argument to indata must be a string literal.");var r=t[0].value;(2<=t.length&&t[t.length-1].value)!==N||a.hasOwnProperty("@unit")||(a["@unit"]=n.getData(r).indataRef(n,"unit")),W(0,t,n,a)}function K(e,t,n,a){var r,i,o,l,s,u=this.context.data[e],d=u?u.values.value:[],c=u?u[I]&&u[I].value:void 0,f=d[0],p=0;if(f){for(r=t?f.encodings.length:f.fields.length;p<r;++p)if(t&&f.encodings[p]===t||n&&f.fields[p]===n){i=p,l=f[T+f.fields[p]];break}return c&&1===c.size&&(a=U),c&&a===N?(s=d.reduce(function(e,t){return(e[t.unit]||(e[t.unit]=[])).push({unit:t.unit,value:t.values[i]}),e},{}),o=Object.keys(s).map(function(e){return{unit:e,value:l?Z(s[e],U):Q(s[e],U)}})):o=d.map(function(e){return{unit:e.unit,value:e.values[i]}}),l?Z(o,a):Q(o,a)}}function Q(e,t){for(var n,a,r,i,o={},l=0,s={},u=[],d=0,c=e.length;d<c;++d)a=(n=e[d]).unit,i=n.value,o[a]||(o[a]=++l),(r=s[i])||(s[i]=r={value:i,units:{},count:0}),r.units[a]||(r.units[a]=++r.count);for(i in s)r=s[i],t===N&&r.count!==l||u.push(r.value);return u.length?u:void 0}function Z(e,t){for(var n,a,r,i,o=t===N?te:ee,l=0,s=e.length;l<s;++l)n=e[l].value,Ye.isDate(n[0])&&(n=n.map(Ye.toNumber)),r=n[0],(i=n[1])<r&&(i=n[0],r=n[1]),a=a?o(a,r,i):[r,i];return a&&a.length&&+a[0]!=+a[1]?a:void 0}function ee(e,t,n){return e[0]>t&&(e[0]=t),e[1]<n&&(e[1]=n),e}function te(e,t,n){return n<e[0]||e[1]<t?[]:(e[0]<t&&(e[0]=t),e[1]>n&&(e[1]=n),e)}var ne={random:function(){return r.random()},isArray:Ye.isArray,isBoolean:Ye.isBoolean,isDate:Ye.isDate,isNumber:Ye.isNumber,isObject:Ye.isObject,isRegExp:Ye.isRegExp,isString:Ye.isString,isTuple:g.isTuple,toBoolean:Ye.toBoolean,toDate:Ye.toDate,toNumber:Ye.toNumber,toString:Ye.toString,pad:Ye.pad,peek:Ye.peek,truncate:Ye.truncate,rgb:i.rgb,lab:i.lab,hcl:i.hcl,hsl:i.hsl,sequence:l.range,format:function(e,t){return y("format",n.format,t)(e)},utcFormat:function(e,t){return y("utcFormat",a.utcFormat,t)(e)},utcParse:function(e,t){return y("utcParse",a.utcParse,t)(e)},timeFormat:b,timeParse:function(e,t){return y("timeParse",a.timeParse,t)(e)},monthFormat:function(e){return k(e,1,"%B")},monthAbbrevFormat:function(e){return k(e,1,"%b")},dayFormat:function(e){return k(0,2+e,"%A")},dayAbbrevFormat:function(e){return k(0,2+e,"%a")},quarter:function(e){return 1+~~(new Date(e).getMonth()/3)},utcquarter:function(e){return 1+~~(new Date(e).getUTCMonth()/3)},warn:function(){return R(this.context.dataflow,"warn",arguments)},info:function(){return R(this.context.dataflow,"info",arguments)},debug:function(){return R(this.context.dataflow,"debug",arguments)},extent:function(e){var t,n,a,r,i=0;if(e&&(t=e.length)){for(n=e[i];null==n||n!=n;n=e[++i]);for(a=r=n;i<t;++i)null!=(n=e[i])&&(n<a&&(a=n),r<n&&(r=n))}return[a,r]},inScope:function(e){var t=this.context.group,n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n},clampRange:function(e,t,n){var a,r=e[0],i=e[1];return i<r&&(a=i,i=r,r=a),n-t<=(a=i-r)?[t,n]:[r=Math.min(Math.max(r,t),n-a),r+a]},pinchDistance:function(e){var t=e.touches,n=t[0].clientX-t[1].clientX,a=t[0].clientY-t[1].clientY;return Math.sqrt(n*n+a*a)},pinchAngle:function(e){var t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)},screen:function(){return w?w.screen:{}},containerSize:function(){var e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]},windowSize:function(){return w?[w.innerWidth,w.innerHeight]:[void 0,void 0]},span:function(e){return e[e.length-1]-e[0]||0},merge:function(){var e=[].slice.call(arguments);return e.unshift({}),Ye.extend.apply(null,e)},flush:function(e,t,n,a,r,i){if(!n&&0!==n)return i;var o,l,s=e[0],u=Ye.peek(e),d=+n;return u<s&&(o=s,s=u,u=o),(o=Math.abs(t-s))<(l=Math.abs(u-t))&&o<=d?a:l<=d?r:i},bandspace:function(e,t,n){return f.bandSpace(e||0,t||0,n||0)},inrange:S,setdata:function(e,t){var n=this.context.dataflow,a=this.context.data[e].input;return n.pulse(a,n.changeset().remove(Ye.truthy).insert(t)),1},pathShape:function(t){var n=null;return function(e){return e?p.pathRender(e,n=n||p.pathParse(t)):t}},panLinear:Ye.panLinear,panLog:Ye.panLog,panPow:Ye.panPow,zoomLinear:Ye.zoomLinear,zoomLog:Ye.zoomLog,zoomPow:Ye.zoomPow,encode:function(e,t,n){if(e){var a=this.context.dataflow,r=e.mark.source;a.pulse(r,a.changeset().encode(e,t))}return void 0!==n?n:e},modify:function(e,t,n,a,r,i){var o,l,s=this.context.dataflow,u=this.context.data[e],d=u.input,c=u.changes,f=s.stamp();if(!1===s._trigger||!(d.value.length||t||a))return 0;if((!c||c.stamp<f)&&(u.changes=c=s.changeset(),c.stamp=f,s.runAfter(function(){u.modified=!0,s.pulse(d,c).run()},!0,1)),n&&(o=!0===n?Ye.truthy:Ye.isArray(n)||g.isTuple(n)?n:B(n),c.remove(o)),t&&c.insert(t),a&&(o=B(a),d.value.some(o)?c.remove(o):c.insert(a)),r)for(l in i)c.modify(r,l,i[l]);return 1}},ae=["view","item","group","xy","x","y"],re={};function ie(e,t,n){return 1===arguments.length?ne[e]:(ne[e]=t,n&&(re[e]=n),le&&(le.functions[e]="this."+e),this)}ie("bandwidth",function(e,t){var n=j(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0},$),ie("copy",function(e,t){var n=j(e,(t||this).context);return n?n.copy():void 0},$),ie("domain",function(e,t){var n=j(e,(t||this).context);return n?n.domain():[]},$),ie("range",function(e,t){var n=j(e,(t||this).context);return n&&n.range?n.range():[]},$),ie("invert",function(e,t,n){var a=j(e,(n||this).context);return a?Ye.isArray(t)?(a.invertRange||a.invert)(t):(a.invert||a.invertExtent)(t):void 0},$),ie("scale",function(e,t,n){var a=j(e,(n||this).context);return a?a(t):void 0},$),ie("gradient",function(e,t,n,a,r){e=j(e,(r||this).context);var i=p.Gradient(t,n),o=e.domain(),l=o[0],s=o[o.length-1],u=f.scaleFraction(e,l,s);e.ticks&&(l!==(o=e.ticks(+a||15))[0]&&o.unshift(l),s!==o[o.length-1]&&o.push(s));for(var d=0,c=o.length;d<c;++d)i.stop(u(o[d]),e(o[d]));return i},$),ie("geoArea",E,$),ie("geoBounds",V,$),ie("geoCentroid",A,$),ie("geoShape",function(e,t,n){var a=j(e,(n||this).context);return function(e){return a?a.path.context(e)(t):""}},$),ie("indata",function(e,t,n){var a=this.context.data[e]["index:"+t],r=a?a.value.get(n):void 0;return r?r.count:r},function(e,t,n,a){t[0].type!==O&&Ye.error("First argument to indata must be a string literal."),t[1].type!==O&&Ye.error("Second argument to indata must be a string literal.");var r=t[0].value,i=t[1].value,o="@"+i;a.hasOwnProperty(o)||(a[o]=n.getData(r).indataRef(n,i))}),ie("data",F,W),ie("vlSingle",H,W),ie("vlSingleDomain",K,W),ie("vlMulti",H,J),ie("vlMultiDomain",K,J),ie("vlInterval",function(e,t,n){return G.call(this,e,t,n,Y)},W),ie("vlIntervalDomain",function(e,t,n,a){var r,i,o,l,s,u=this.context.data[e],d=u?u.values.value:[],c=d[0],f=0;if(c){for(r=c.intervals.length;f<r;++f)if(i=c.intervals[f],t&&i.encoding===t||n&&i.field===n){if(!i.extent)return;o=f,s=2<i.extent.length;break}return l=d.reduce(function(e,t){var n=t.intervals[o].extent,a=s?n.map(function(e){return{unit:t.unit,value:e}}):{unit:t.unit,value:n};return s?e.push.apply(e,a):e.push(a),e},[]),s?Q(l,a):Z(l,a)}},W),ie("treePath",function(e,t,n){var a=M(e,this),r=a[t],i=a[n];return r&&i?r.path(i).map(C):void 0},W),ie("treeAncestors",function(e,t){var n=M(e,this)[t];return n?n.ancestors().map(C):void 0},W);var oe={blacklist:["_"],whitelist:["datum","event","item"],fieldvar:"datum",globalvar:function(e){return"_["+Ye.stringValue("$"+e)+"]"},functions:function(e){var t=o.functions(e);for(var n in ae.forEach(function(e){t[e]="event.vega."+e}),ne)t[n]="this."+n;return t},constants:o.constants,visitors:re},le=o.codegen(oe),se="$";function Me(t,a,e){var n,r,i={};try{t=Ye.isString(t)?t:Ye.stringValue(t)+"",n=o.parse(t)}catch(e){Ye.error("Expression parse error: "+t)}return n.visit(function(e){if("CallExpression"===e.type){var t=e.callee.name,n=oe.visitors[t];n&&n(t,e.arguments,a,i)}}),(r=le(n)).globals.forEach(function(e){var t=se+e;!i.hasOwnProperty(t)&&a.getSignal(e)&&(i[t]=a.signalRef(e))}),{$expr:e?e+"return("+r.code+");":r.code,$fields:r.fields,$params:i}}function ue(e,t,n,a){this.id=-1,this.type=e,this.value=t,this.params=n,a&&(this.parent=a)}function de(e,t,n,a){return new ue(e,t,n,a)}function ce(e,t){return de("operator",e,t)}function Ge(e){var t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}var fe={$tupleid:1,toString:function(){return":_tupleid_:"}};function pe(e,t){return t?{$field:e,$name:t}:{$field:e}}var ge=pe("key");function he(e,t){return{$compare:e,$order:t}}var me="descending";function ve(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}var ye="scope",be="view";function xe(e){return e&&e.signal}function ke(e){if(xe(e))return!0;if(Ye.isObject(e))for(var t in e)if(ke(e[t]))return!0;return!1}function He(e,t){return null!=e?e:t}function Je(e){return e&&e.signal||e}var Se="timer";function Re(e,t){return(e.merge?we:e.stream?Oe:e.type?ze:Ye.error("Invalid stream specification: "+Ye.stringValue(e)))(e,t)}function we(e,t){var n=Pe({merge:e.merge.map(function(e){return Re(e,t)})},e,t);return t.addStream(n).id}function Oe(e,t){var n=Pe({stream:Re(e.stream,t)},e,t);return t.addStream(n).id}function ze(e,t){var n,a,r;return e.type===Se?(n=t.event(Se,e.throttle),e={between:e.between,filter:e.filter}):n=t.event((r=e.source)===ye?be:r||be,e.type),a=Pe({stream:n},e,t),1===Object.keys(a).length?n:t.addStream(a).id}function Pe(e,t,n){var a,r,i,o,l=t.between;return l&&(2!==l.length&&Ye.error('Stream "between" parameter must have 2 entries: '+Ye.stringValue(t)),e.between=[Re(l[0],n),Re(l[1],n)]),l=t.filter?Ye.array(t.filter):[],(t.marktype||t.markname||t.markrole)&&l.push((a=t.marktype,r=t.markname,i=t.markrole,(o="event.item")+(a&&"*"!==a?"&&"+o+".mark.marktype==='"+a+"'":"")+(i?"&&"+o+".mark.role==='"+i+"'":"")+(r?"&&"+o+".mark.name==='"+r+"'":""))),t.source===ye&&l.push("inScope(event.item)"),l.length&&(e.filter=Me("("+l.join(")&&(")+")").$expr),null!=(l=t.throttle)&&(e.throttle=+l),null!=(l=t.debounce)&&(e.debounce=+l),t.consume&&(e.consume=!0),e}var je="var datum=event.item&&event.item.datum;";function De(e,a,t){var n,r,i=e.events,o=e.update,l=e.encode,s=[];i||Ye.error("Signal update missing events specification."),Ye.isString(i)&&(i=u.selector(i,a.isSubscope()?ye:be)),(i=Ye.array(i).filter(function(e){return e.signal||e.scale?(s.push(e),0):1})).length&&s.push(1<i.length?{merge:i}:i[0]),null!=l&&(o&&Ye.error("Signal encode and update are mutually exclusive."),o="encode(item(),"+Ye.stringValue(l)+")"),n=Ye.isString(o)?Me(o,a,je):null!=o.expr?Me(o.expr,a,je):null!=o.value?o.value:null!=o.signal?{$expr:"_.value",$params:{value:a.signalRef(o.signal)}}:Ye.error("Invalid signal update specification."),r={target:t,update:n},e.force&&(r.options={force:!0}),s.forEach(function(e){var t,n;a.addUpdate(Ye.extend((n=a,{source:(t=e).signal?n.signalRef(t.signal):t.scale?n.scaleRef(t.scale):Re(t,n)}),r))})}function $e(e,t){var n=t.getSignal(e.name);if(e.update){var a=Me(e.update,t);n.update=a.$expr,n.params=a.$params}e.on&&e.on.forEach(function(e){De(e,t,n.id)})}function _e(a){return function(e,t,n){return de(a,t,e||void 0,n)}}var Ee=_e("aggregate"),Ke=_e("axisticks"),Ve=_e("bound"),Qe=_e("collect"),Ae=_e("compare"),Fe=_e("datajoin"),We=_e("encode"),Le=_e("expression"),Ce=_e("facet"),qe=_e("field"),Be=_e("key"),Te=_e("legendentries"),Ne=_e("load"),Ue=_e("mark"),Ie=_e("multiextent"),Xe=_e("multivalues"),Ze=_e("overlap"),et=_e("params"),tt=_e("prefacet"),nt=_e("projection"),at=_e("proxy"),rt=_e("relay"),it=_e("render"),ot=_e("scale"),lt=_e("sieve"),st=_e("sortitems"),ut=_e("viewlayout"),dt=_e("values"),ct=0,ft=["identity","ordinal","band","point","bin-linear","bin-ordinal","quantize","quantile","threshold","linear","pow","sqrt","log","sequential","time","utc"],pt=Ye.toSet(ft),gt=Ye.toSet(ft.slice(4,9)),ht=Ye.toSet(ft.slice(9)),mt=Ye.toSet(ft.slice(1,6));function vt(e){return mt.hasOwnProperty(e)}function yt(e){return gt.hasOwnProperty(e)}function bt(e){return"quantile"===e}function xt(e,t){var n,a,r,i,o=t.getScale(e.name).params;for(n in o.domain=Rt(e.domain,e,t),null!=e.range&&(o.range=function e(t,n,a){var r=t.range,i=n.config.range;{if(r.signal)return n.signalRef(r.signal);if(Ye.isString(r)){if(i&&i.hasOwnProperty(r))return t=Ye.extend({},t,{range:i[r]}),e(t,n,a);"width"===r?r=[0,{signal:"width"}]:"height"===r?r=vt(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]:Ye.error("Unrecognized scale range value: "+Ye.stringValue(r))}else{if(r.scheme)return a.scheme=kt(r.scheme,n),r.extent&&(a.schemeExtent=(o=r.extent,l=n,o.signal?l.signalRef(o.signal):o.map(function(e){return kt(e,l)}))),void(r.count&&(a.schemeCount=kt(r.count,n)));if(r.step)return void(a.rangeStep=kt(r.step,n));if(vt(t.type)&&!Ye.isArray(r))return Rt(r,t,n);Ye.isArray(r)||Ye.error("Unsupported range type: "+Ye.stringValue(r))}}var o,l;return r.map(function(e){return kt(e,n)})}(e,t,o)),null!=e.interpolate&&(a=e.interpolate,(r=o).interpolate=kt(a.type||a),null!=a.gamma&&(r.interpolateGamma=kt(a.gamma))),null!=e.nice&&(i=e.nice,o.nice=Ye.isObject(i)?{interval:kt(i.interval),step:kt(i.step)}:kt(i)),e)o.hasOwnProperty(n)||"name"===n||(o[n]=kt(e[n],t))}function kt(e,t){return Ye.isObject(e)?e.signal?t.signalRef(e.signal):Ye.error("Unsupported object: "+Ye.stringValue(e)):e}function St(e){Ye.error("Can not find data set: "+Ye.stringValue(e))}function Rt(e,t,n){if(e)return e.signal?n.signalRef(e.signal):(Ye.isArray(e)?function(e,t,n){return e.map(function(e){return kt(e,n)})}:e.fields?function(e,t,n){var a=e.data,r=e.fields.reduce(function(e,t){return t=Ye.isString(t)?{data:a,field:t}:Ye.isArray(t)||t.signal?function(e,t){var n="_:vega:_"+ct++,a=Qe({});if(Ye.isArray(e))a.value={$ingest:e};else if(e.signal){var r="setdata("+Ye.stringValue(n)+","+e.signal+")";a.params.input=t.signalRef(r)}return t.addDataPipeline(n,[a,lt({})]),{data:n,field:"data"}}(t,n):t,e.push(t),e},[]);return(vt(t.type)?function(e,n,t){var a,r,i;return a=t.map(function(e){var t=n.getData(e.data);return t||St(e.data),t.countsRef(n,e.field)}),r=n.add(Ee({groupby:ge,ops:["sum"],fields:[n.fieldRef("count")],as:["count"],pulse:a})),i=n.add(Qe({pulse:Ge(r)})),Ge(n.add(dt({field:ge,sort:n.sortRef(wt(e.sort,!0)),pulse:Ge(i)})))}:bt(t.type)?function(e,n,t){var a=t.map(function(e){var t=n.getData(e.data);return t||St(e.data),t.domainRef(n,e.field)});return Ge(n.add(Xe({values:a})))}:function(e,n,t){var a=t.map(function(e){var t=n.getData(e.data);return t||St(e.data),t.extentRef(n,e.field)});return Ge(n.add(Ie({extents:a})))})(e,n,r)}:function(e,t,n){var a=n.getData(e.data);a||St(e.data);return vt(t.type)?a.valuesRef(n,e.field,wt(e.sort,!1)):bt(t.type)?a.domainRef(n,e.field):a.extentRef(n,e.field)})(e,t,n);null==t.domainMin&&null==t.domainMax||Ye.error("No scale domain defined for domainMin/domainMax to override.")}function wt(e,t){return e&&(e.field||e.op?e.field||"count"===e.op?t&&e.field?Ye.error("Multiple domain scales can not sort by field."):t&&e.op&&"count"!==e.op&&Ye.error("Multiple domain scales support op count only."):Ye.error("No field provided for sort aggregate op: "+e.op):Ye.isObject(e)?e.field="key":e={field:"key"}),e}function Ot(e,t,n){return Ye.isArray(e)?e.map(function(e){return Ot(e,t,n)}):Ye.isObject(e)?e.signal?n.signalRef(e.signal):"fit"===t?e:Ye.error("Unsupported parameter object: "+Ye.stringValue(e)):e}var zt="top",Pt="left",jt="right",Dt="bottom",$t="vertical",_t="index",Et="label",Vt="offset",At="perc",Ft="perc2",Wt="size",Lt="value",Ct="guide-label",Mt="guide-title",qt="group-title",Bt="symbol",Tt="gradient",Nt="discrete",Ut=["size","shape","fill","stroke","strokeDash","opacity"],It={name:1,interactive:1},Xt=Ye.toSet(["rule"]),Yt=Ye.toSet(["group","image","rect"]);function Gt(e,t,n,a){var r=Me(e,t);return r.$fields.forEach(function(e){a[e]=1}),Ye.extend(n,r.$params),r.$expr}function Ht(e,t,n,a){return function e(t,n,a,r){var i,o,l;if(t.signal)i="datum",l=Gt(t.signal,n,a,r);else if(t.group||t.parent){for(o=Math.max(1,t.level||1),i="item";0<o--;)i+=".mark.group";t.parent?(l=t.parent,i+=".datum"):l=t.group}else t.datum?(i="datum",l=t.datum):Ye.error("Invalid field reference: "+Ye.stringValue(t));t.signal||(Ye.isString(l)?(r[l]=1,l=Ye.splitAccessPath(l).map(Ye.stringValue).join("][")):l=e(l,n,a,r));return i+"["+l+"]"}(Ye.isObject(e)?e:{datum:e},t,n,a)}function Jt(e,t,n,a,r){var i,o,l,s=Kt(e.scale,n,a,r);return null!=e.range?(o=s+".range()",t=0===(i=+e.range)?o+"[0]":"($="+o+","+(1===i?"$[$.length-1]":"$[0]+"+i+"*($[$.length-1]-$[0])")+")"):(void 0!==t&&(t=s+"("+t+")"),e.band&&(l=function(e,t){if(!Ye.isString(e))return-1;var n=t.scaleType(e);return"band"===n||"point"===n?1:0}(e.scale,n))&&(i=(o=s+".bandwidth")+"()"+(1===(i=+e.band)?"":"*"+i),l<0&&(i="("+o+"?"+i+":0)"),t=(t?t+"+":"")+i,e.extra&&(t="(datum.extra?"+s+"(datum.extra.value):"+t+")")),null==t&&(t="0")),t}function Kt(e,t,n,a){var r;if(Ye.isString(e))r=z+e,n.hasOwnProperty(r)||(n[r]=t.scaleRef(e)),r=Ye.stringValue(r);else{for(r in t.scales)n[z+r]=t.scaleRef(r);r=Ye.stringValue(z)+"+"+(e.signal?"("+Gt(e.signal,t,n,a)+")":Ht(e,t,n,a))}return"_["+r+"]"}function Qt(e,t,n,a){return Ye.isObject(e)?"("+Zt(null,e,t,n,a)+")":e}function Zt(e,t,n,a,r){if(null!=t.gradient)return o=n,l=a,s=r,"this.gradient("+Kt((i=t).gradient,o,l,s)+","+Ye.stringValue(i.start)+","+Ye.stringValue(i.stop)+","+Ye.stringValue(i.count)+")";var i,o,l,s,u=t.signal?Gt(t.signal,n,a,r):t.color?function(e,r,i,o){function t(e,t,n,a){return"this."+e+"("+[Zt(null,t,r,i,o),Zt(null,n,r,i,o),Zt(null,a,r,i,o)].join(",")+").toString()"}return e.c?t("hcl",e.h,e.c,e.l):e.h||e.s?t("hsl",e.h,e.s,e.l):e.l||e.a?t("lab",e.l,e.a,e.b):e.r||e.g||e.b?t("rgb",e.r,e.g,e.b):null}(t.color,n,a,r):null!=t.field?Ht(t.field,n,a,r):void 0!==t.value?Ye.stringValue(t.value):void 0;return null!=t.scale&&(u=Jt(t,u,n,a,r)),void 0===u&&(u=null),null!=t.exponent&&(u="Math.pow("+u+","+Qt(t.exponent,n,a,r)+")"),null!=t.mult&&(u+="*"+Qt(t.mult,n,a,r)),null!=t.offset&&(u+="+"+Qt(t.offset,n,a,r)),t.round&&(u="Math.round("+u+")"),u}function en(e,t,n){return e+"["+Ye.stringValue(t)+"]="+n+";"}function tn(e,t,n,a,r){var i="";return t.forEach(function(e){var t=Zt(0,e,n,a,r);i+=e.test?Gt(e.test,n,a,r)+"?"+t+":":t}),":"===Ye.peek(i)&&(i+="null"),en("o",e,i)}function nn(e,t,n,a){var r,i,o,l,s,u={},d="var o=item,datum=o.datum,$;";for(r in e)i=e[r],Ye.isArray(i)?d+=tn(r,i,a,n,u):d+=en("o",r,Zt(0,i,a,n,u));return d+=(o=e,s="",Xt[l=t]||(o.x2&&(o.x?(Yt[l]&&(s+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),s+="o.width=o.x2-o.x;"):s+="o.x=o.x2-(o.width||0);"),o.xc&&(s+="o.x=o.xc-(o.width||0)/2;"),o.y2&&(o.y?(Yt[l]&&(s+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),s+="o.height=o.y2-o.y;"):s+="o.y=o.y2-(o.height||0);"),o.yc&&(s+="o.y=o.yc-(o.height||0)/2;")),s),{$expr:d+="return 1;",$fields:Object.keys(u),$output:Object.keys(e)}}var an="mark",rn="frame",on="scope",ln="axis",sn="axis-domain",un="axis-grid",dn="axis-label",cn="axis-tick",fn="axis-title",pn="legend",gn="legend-band",hn="legend-entry",mn="legend-gradient",vn="legend-label",yn="legend-symbol",bn="legend-title",xn="title";function kn(e){return Ye.isObject(e)?Ye.extend({},e):{value:e}}function Sn(e,t,n,a){return null!=n?(Ye.isObject(n)&&!Ye.isArray(n)?e.update[t]=n:e[a||"enter"][t]={value:n},1):0}function Rn(e,t,n){for(var a in t)n&&n.hasOwnProperty(a)||(e[a]=Ye.extend(e[a]||{},t[a]));return e}function wn(e,t,n,a,r,i){var o,l;for(l in(i=i||{}).encoders={$encode:o={}},e=function(a,e,t,n,r){var i,o,l={};"legend"!=t&&0!==String(t).indexOf("axis")||(t=null);for(i in o=t===rn?r.group:t===an?Ye.extend({},r.mark,r[e]):null)zn(i,a)||("fill"===i||"stroke"===i)&&(zn("fill",a)||zn("stroke",a))||(l[i]=On(o[i]));return Ye.array(n).forEach(function(e){var t=r.style&&r.style[e];for(var n in t)zn(n,a)||(l[n]=On(t[n]))}),(a=Ye.extend({},a)).enter=Ye.extend(l,a.enter),a}(e,t,n,a,r.config))o[l]=nn(e[l],t,i,r);return i}function On(e){return e&&e.signal?{signal:e.signal}:{value:e}}function zn(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}function Pn(e,t,n,a,r,i,o){return{type:e,name:o?o.name:void 0,role:t,style:o&&o.style||n,key:a,from:r,interactive:!(!o||!o.interactive),encode:Rn(i,o,It)}}function jn(e,t,n){return He(t[e],n[e])}function Dn(e,t){return He(e.direction,t)===$t}function $n(e,t){return He(e.gradientLength,t.gradientLength||t.gradientWidth)}function _n(e,t){return He(e.gradientThickness,t.gradientThickness||t.gradientHeight)}function En(e,t){var n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}var Vn="group",An="rect",Fn="rule",Wn="symbol",Ln="text";var Cn="datum."+At+'<=0?"left":datum.'+At+'>=1?"right":"center"',Mn="datum."+At+'<=0?"bottom":datum.'+At+'>=1?"top":"middle"';function qn(e,t,n,a){var r,i,o,l,s,u={value:0},d=Dn(e,t.gradientDirection),c=kn(_n(e,t)),f=$n(e,t),p=jn("labelOverlap",e,t),g="";return Sn(r={enter:i={opacity:u},update:o={opacity:{value:1},text:{field:Et}},exit:{opacity:u}},"fill",jn("labelColor",e,t)),Sn(r,"font",jn("labelFont",e,t)),Sn(r,"fontSize",jn("labelFontSize",e,t)),Sn(r,"fontWeight",jn("labelFontWeight",e,t)),Sn(r,"fillOpacity",jn("labelOpacity",e,t)),Sn(r,"limit",He(e.labelLimit,t.gradientLabelLimit)),d?(i.align={value:"left"},i.baseline=o.baseline={signal:Mn},l="y",s="x",g="1-"):(i.align=o.align={signal:Cn},i.baseline={value:"top"},l="x",s="y"),i[l]=o[l]={signal:g+"datum."+At,mult:f},i[s]=o[s]=c,c.offset=He(e.labelOffset,t.gradientLabelOffset)||0,e=Pn(Ln,vn,Ct,Lt,a,r,n),p&&(e.overlap={method:p,order:"datum."+_t}),e}function Bn(e,t,n,a,r,i,o,l){return{type:Vn,name:n,role:e,style:t,from:a,interactive:r||!1,encode:i,marks:o,layout:l}}var Tn={value:0};function Nn(e,t){return{align:jn("gridAlign",e,t),center:{row:!0,column:!1},columns:(n=e,a=t,He(n.columns,He(a.columns,+Dn(n,a.symbolDirection)))),padding:{row:jn("rowPadding",e,t),column:jn("columnPadding",e,t)}};var n,a}function Un(e){return Ye.isObject(e)&&e.signal?e.signal:Ye.stringValue(e)}function In(e){var t=e.role||"";return t.indexOf("axis")&&t.indexOf("legend")?e.type===Vn?on:t||an:t}function Xn(e,t){var n=g.definition(e.type);n||Ye.error("Unrecognized transform type: "+Ye.stringValue(e.type));var a=de(n.type.toLowerCase(),null,Yn(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(a)),a.metadata=n.metadata||{},a}function Yn(e,t,n){var a,r,i,o={};for(r=0,i=e.params.length;r<i;++r)o[(a=e.params[r]).name]=Gn(a,t,n);return o}function Gn(t,e,n){var a,r,i,o=t.type,l=e[t.name];if("index"===o)return function(e,t,n){Ye.isString(t.from)||Ye.error('Lookup "from" parameter must be a string literal.');return n.getData(t.from).lookupRef(n,t.key)}(0,e,n);{if(void 0!==l)return"param"===o?(r=n,i=e[(a=t).name],a.array?(Ye.isArray(i)||Ye.error("Expected an array of sub-parameters. Instead: "+Ye.stringValue(i)),i.map(function(e){return Jn(a,e,r)})):Jn(a,i,r)):"projection"===o?n.projectionRef(e[t.name]):t.array&&!xe(l)?l.map(function(e){return Hn(t,e,n)}):Hn(t,l,n);t.required&&Ye.error("Missing required "+Ye.stringValue(e.type)+" parameter: "+Ye.stringValue(t.name))}}function Hn(e,t,n){var a=e.type;if(xe(t))return Kn(a)?Ye.error("Expression references can not be signals."):Qn(a)?n.fieldRef(t):Zn(a)?n.compareRef(t):n.signalRef(t.signal);var r,i,o=e.expr||Qn(a);return o&&((i=t)&&i.expr)?n.exprRef(t.expr,t.as):o&&((r=t)&&r.field)?pe(t.field,t.as):Kn(a)?Me(t,n):"data"===a?Ge(n.getData(t).values):Qn(a)?pe(t):Zn(a)?n.compareRef(t):t}function Jn(e,t,n){var a,r,i,o,l;for(o=0,l=e.params.length;o<l;++o){for(i in(r=e.params[o]).key)if(r.key[i]!==t[i]){r=null;break}if(r)break}return r||Ye.error("Unsupported parameter: "+Ye.stringValue(t)),a=Ye.extend(Yn(r,t,n),r.key),Ge(n.add(et(a)))}function Kn(e){return"expr"===e}function Qn(e){return"field"===e}function Zn(e){return"compare"===e}function ea(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:Ge(t.getData(e.data).output)}function ta(e,t,n,a,r){this.scope=e,this.input=t,this.output=n,this.values=a,this.aggregate=r,this.index={}}ta.fromEntries=function(e,t){var n=t.length,a=1,r=t[0],i=t[n-1],o=t[n-2],l=null;for(e.add(t[0]);a<n;++a)t[a].params.pulse=Ge(t[a-1]),e.add(t[a]),"aggregate"===t[a].type&&(l=t[a]);return new ta(e,r,o,i,l)};var na=ta.prototype;function aa(e){return Ye.isString(e)?e:null}function ra(e,t,n){var a,r=ve(n.op,n.field);if(t.ops){for(var i=0,o=t.as.length;i<o;++i)if(t.as[i]===r)return}else t.ops=["count"],t.fields=[null],t.as=["count"];n.op&&(t.ops.push((a=n.op.signal)?e.signalRef(a):n.op),t.fields.push(e.fieldRef(n.field)),t.as.push(r))}function ia(e,t,n,a,r,i,o){var l,s,u,d=t[n]||(t[n]={}),c=(u=i,Ye.isObject(u)?(u.order===me?"-":"+")+ve(u.op,u.field):""),f=aa(r);if(null!=f&&(e=t.scope,l=d[f+=c?"|"+c:""]),!l){var p=i?{field:ge,pulse:t.countsRef(e,r,i)}:{field:e.fieldRef(r),pulse:Ge(t.output)};c&&(p.sort=e.sortRef(i)),s=e.add(de(a,void 0,p)),o&&(t.index[r]=s),l=Ge(s),null!=f&&(d[f]=l)}return l}function oa(e,t,n){var a,r=e.remove,i=e.insert,o=e.toggle,l=e.modify,s=e.values,u=t.add(ce());a=Me("if("+e.trigger+',modify("'+n+'",'+[i,r,o,l,s].map(function(e){return null==e?"null":e}).join(",")+"),0)",t),u.update=a.$expr,u.params=a.$params}function la(e,n){var t,a,r,i,o,l,s,u,d,c,f,p,g,h,m,v,y,b,x,k,S,R,w,O,z,P,j,D,$,_,E,V,A,F,W,L,C,M,q,B,T,N,U=In(e),I=e.type===Vn,X=e.from&&e.from.facet,Y=e.layout||U===on||U===rn,G=U===an||Y||X,H=e.overlap;h=e.from,m=I,v=n,h?(y=h.facet)&&(m||Ye.error("Only group marks can be faceted."),null!=y.field?k=S=ea(y,v):(h.data?S=Ge(v.getData(h.data).aggregate):((x=Xn(Ye.extend({type:"aggregate",groupby:Ye.array(y.groupby)},y.aggregate),v)).params.key=v.keyRef(y.groupby),x.params.pulse=ea(y,v),k=S=Ge(v.add(x))),b=v.keyRef(y.groupby,!0))):k=Ge(v.add(Qe(null,[{}]))),k||(k=ea(h,v)),r={key:b,pulse:k,parent:S},d=Ge(a=n.add(Fe({key:r.key||(e.key?pe(e.key):void 0),pulse:r.pulse,clean:!I}))),a=i=n.add(Qe({pulse:d})),c=Ge(a=n.add(Ue({markdef:(j=e,{marktype:j.type,name:j.name||void 0,role:j.role||In(j),zindex:+j.zindex||void 0}),interactive:(z=e.interactive,P=n,z&&z.signal?P.signalRef(z.signal):!1!==z),clip:(R=e.clip,w=n,Ye.isObject(R)&&(R.signal?O=R.signal:R.path?O="pathShape("+Un(R.path)+")":R.sphere&&(O="geoShape("+Un(R.sphere)+', {type: "Sphere"})')),O?w.signalRef(O):!!R),context:{$context:!0},groups:n.lookup(),parent:n.signals.parent?n.signalRef("parent"):null,index:n.markpath(),pulse:Ge(a)}))),(a=n.add(We(wn(e.encode,e.type,U,e.style,n,{pulse:c})))).params.parent=n.encode(),e.transform&&e.transform.forEach(function(e){var t=Xn(e,n);(t.metadata.generates||t.metadata.changes)&&Ye.error("Mark transforms should not generate new data."),t.params.pulse=Ge(a),n.add(a=t)}),e.sort&&(a=n.add(st({sort:n.compareRef(e.sort,!0),pulse:Ge(a)}))),f=Ge(a),(X||Y)&&(p=Ge(Y=n.add(ut({layout:n.objectProperty(e.layout),legendMargin:n.config.legendMargin,mark:c,pulse:f})))),g=Ge(o=n.add(Ve({mark:c,pulse:p||f}))),I&&(G&&((t=n.operators).pop(),Y&&t.pop()),n.pushState(f,p||g,d),X?(F=n,W=r,B=(A=e).from.facet,T=B.name,N=ea(B,F),B.name||Ye.error("Facet must have a name: "+Ye.stringValue(B)),B.data||Ye.error("Facet must reference a data set: "+Ye.stringValue(B)),B.field?q=F.add(tt({field:F.fieldRef(B.field),pulse:N})):B.groupby?q=F.add(Ce({key:F.keyRef(B.groupby),group:Ge(F.proxy(W.parent)),pulse:N})):Ye.error("Facet must specify groupby or field: "+Ye.stringValue(B)),C=(L=F.fork()).add(Qe()),M=L.add(lt({pulse:Ge(C)})),L.addData(T,new ta(L,C,C,M)),L.addSignal("parent",null),q.params.subflow={$subflow:ya(A,L).toRuntime()}):G?(D=e,_=r,E=($=n).add(tt({pulse:_.pulse})),(V=$.fork()).add(lt()),V.addSignal("parent",null),E.params.subflow={$subflow:ya(D,V).toRuntime()}):ya(e,n),n.popState(),G&&(Y&&t.push(Y),t.push(o))),H&&(g=function(e,t,n){var a,r=e.method,i=e.bound,o={method:xe(r)?n.signalRef(r.signal):r,pulse:t};e.order&&(o.sort=n.compareRef({field:e.order}));i&&(a=i.tolerance,o.boundTolerance=xe(a)?n.signalRef(a.signal):+a,o.boundScale=n.scaleRef(i.scale),o.boundOrient=i.orient);return Ge(n.add(Ze(o)))}(H,g,n)),l=n.add(it({pulse:g})),s=n.add(lt({pulse:Ge(l)},void 0,n.parent())),null!=e.name&&(u=e.name,n.addData(u,new ta(n,i,l,s)),e.on&&e.on.forEach(function(e){(e.insert||e.remove||e.toggle)&&Ye.error("Marks only support modify triggers."),oa(e,n,u)}))}function sa(n,e){var t,a,r,i,o,l,s,u,d,c,f,p,g,h,m,v,y,b,x,k,S,R,w,O,z,P,j,D,$,_,E,V,A,F,W,L,C,M,q,B,T,N,U,I,X,Y,G,H,J,K,Q,Z,ee,te,ne,ae,re,ie,oe,le,se,ue,de,ce,fe,pe,ge,he,me,ve,ye,be,xe,ke,Se,Re,we,Oe,ze,Pe,je,De,$e,_e,Ee=e.config.legend,Ve=n.encode||{},Ae=Ve.legend||{},Fe=Ae.name||void 0,We=Ae.interactive,Le=Ae.style,Ce=Ut.reduce(function(e,t){return e||n[t]},0);return Ce||Ye.error("Missing valid scale for legend."),o=function(e,t){var n=e.type||Bt;e.type||1!==(r=e,Ut.reduce(function(e,t){return e+(r[t]?1:0)},0))||!e.fill&&!e.stroke||(a=t,n=ht.hasOwnProperty(a)?Tt:yt(t)?Nt:Bt);var a;var r;return n!==Tt?n:yt(t)?Nt:Tt}(n,e.scaleType(Ce)),l={orient:jn("orient",n,Ee),title:null!=n.title,type:o},s=Ge(e.add(Qe(null,[l]))),Ae=Rn((Sn(p={enter:{},update:{}},"offset",jn("offset",c=n,f=Ee)),Sn(p,"padding",jn("padding",c,f)),Sn(p,"titlePadding",jn("titlePadding",c,f)),Sn(p,"fill",jn("fillColor",c,f)),Sn(p,"stroke",jn("strokeColor",c,f)),Sn(p,"strokeWidth",jn("strokeWidth",c,f)),Sn(p,"cornerRadius",jn("cornerRadius",c,f)),Sn(p,"strokeDash",f.strokeDash),p),Ae,It),t={enter:{x:{value:0},y:{value:0}}},u=Ge(e.add(Te(r={type:o,scale:e.scaleRef(Ce),count:e.objectProperty(n.tickCount),values:e.objectProperty(n.values),formatSpecifier:e.property(n.format)}))),o===Tt?(i=[(ce=n,fe=Ce,pe=Ee,ge=Ve.gradient,ke={value:0},Se=Dn(ce,pe.gradientDirection),Re=_n(ce,pe),we=$n(ce,pe),Se?(ve=[0,1],ye=[0,0],be=Re,xe=we):(ve=[0,0],ye=[1,0],be=we,xe=Re),Sn(he={enter:me={opacity:ke,x:ke,y:ke,width:kn(be),height:kn(xe)},update:Ye.extend({},me,{opacity:{value:1},fill:{gradient:fe,start:ve,stop:ye}}),exit:{opacity:ke}},"stroke",jn("gradientStrokeColor",ce,pe)),Sn(he,"strokeWidth",jn("gradientStrokeWidth",ce,pe)),Sn(he,"opacity",jn("gradientOpacity",ce,pe),"update"),Pn(An,mn,null,void 0,void 0,he,ge)),qn(n,Ee,Ve.labels,u)],r.count=r.count||e.signalRef("max(2,2*floor(("+Je($n(n,Ee))+")/100))")):o===Nt?i=[(H=n,J=Ce,K=Ee,Q=Ve.gradient,Z=u,oe={value:0},le=Dn(H,K.gradientDirection),se=_n(H,K),ue=$n(H,K),de="",le?(ne="y",re="y2",ae="x",ie="width",de="1-"):(ne="x",re="x2",ae="y",ie="height"),(te={opacity:oe,fill:{scale:J,field:Lt}})[ne]={signal:de+"datum."+At,mult:ue},te[ae]=oe,te[re]={signal:de+"datum."+Ft,mult:ue},te[ie]=kn(se),Sn(ee={enter:te,update:Ye.extend({},te,{opacity:{value:1}}),exit:{opacity:oe}},"stroke",jn("gradientStrokeColor",H,K)),Sn(ee,"strokeWidth",jn("gradientStrokeWidth",H,K)),Sn(ee,"opacity",jn("gradientOpacity",H,K),"update"),Pn(An,gn,null,Lt,Z,ee,Q)),qn(n,Ee,Ve.labels,u)]:(a=Nn(n,Ee),i=[(z=n,P=Ee,j=Ve,D=u,$=Je(a.columns),C=j.entries,M=!(!C||!C.interactive),q=C?C.name:void 0,B=jn("clipHeight",z,P),T=jn("symbolOffset",z,P),N={data:"value"},U={},I=$+"?datum."+Vt+":datum."+Wt,X=B?kn(B):{field:Wt},Y="datum."+_t,G="max(1,"+$+")",X.mult=.5,U={enter:_={opacity:Tn,x:{signal:I,mult:.5,offset:T},y:X},update:E={opacity:{value:1},x:_.x,y:_.y},exit:{opacity:Tn}},z.fill||(Sn(U,"fill",P.symbolBaseFillColor),Sn(U,"stroke",P.symbolBaseStrokeColor)),Sn(U,"shape",jn("symbolType",z,P)),Sn(U,"size",jn("symbolSize",z,P)),Sn(U,"strokeWidth",jn("symbolStrokeWidth",z,P)),Sn(U,"fill",jn("symbolFillColor",z,P)),Sn(U,"stroke",jn("symbolStrokeColor",z,P)),Sn(U,"opacity",jn("symbolOpacity",z,P),"update"),Ut.forEach(function(e){z[e]&&(E[e]=_[e]={scale:z[e],field:Lt})}),A=Pn(Wn,yn,null,Lt,N,U,j.symbols),B&&(A.clip=!0),(V=kn(T)).offset=jn("labelOffset",z,P),Sn(U={enter:_={opacity:Tn,x:{signal:I,offset:V},y:X},update:E={opacity:{value:1},text:{field:Et},x:_.x,y:_.y},exit:{opacity:Tn}},"align",jn("labelAlign",z,P)),Sn(U,"baseline",jn("labelBaseline",z,P)),Sn(U,"fill",jn("labelColor",z,P)),Sn(U,"font",jn("labelFont",z,P)),Sn(U,"fontSize",jn("labelFontSize",z,P)),Sn(U,"fontWeight",jn("labelFontWeight",z,P)),Sn(U,"limit",jn("labelLimit",z,P)),Sn(U,"fillOpacity",jn("labelOpacity",z,P)),F=Pn(Ln,vn,Ct,Lt,N,U,j.labels),U={enter:{width:Tn,height:B?kn(B):Tn,opacity:Tn},exit:{opacity:Tn},update:E={opacity:{value:1},row:{signal:null},column:{signal:null}}},Dn(z,P.symbolDirection)?(W="ceil(item.mark.items.length/"+G+")",E.row.signal=Y+"%"+W,E.column.signal="floor("+Y+"/"+W+")",L={field:["row",Y]}):(E.row.signal="floor("+Y+"/"+G+")",E.column.signal=Y+"%"+G,L={field:Y}),E.column.signal=$+"?"+E.column.signal+":"+Y,(z=Bn(on,null,q,D={facet:{data:D,name:"value",groupby:_t}},M,Rn(U,C,It),[A,F])).sort=L,z)],r.size=(g=n,h=e,m=i[0].marks,b=En("strokeWidth",m[0].encode),y=g.size?'scale("'+g.size+'",datum)':En("size",m[0].encode),x=m[1].encode,k=h,S=Ct,v=En("fontSize",x)||(R="fontSize",w=S,(O=k.config.style[w])&&O[R]),Me("max(ceil(sqrt("+Je(y)+")+"+Je(b)+"),"+Je(v)+")",h))),i=[Bn(hn,null,null,s,We,t,i,a)],l.title&&i.push((Oe=n,ze=Ee,Pe=Ve.title,je=s,Sn(De={enter:$e={opacity:_e={value:0},x:{field:{group:"padding"}},y:{field:{group:"padding"}}},update:{opacity:{value:1},text:kn(Oe.title),x:$e.x,y:$e.y},exit:{opacity:_e}},"align",jn("titleAlign",Oe,ze)),Sn(De,"baseline",jn("titleBaseline",Oe,ze)),Sn(De,"fill",jn("titleColor",Oe,ze)),Sn(De,"font",jn("titleFont",Oe,ze)),Sn(De,"fontSize",jn("titleFontSize",Oe,ze)),Sn(De,"fontWeight",jn("titleFontWeight",Oe,ze)),Sn(De,"limit",jn("titleLimit",Oe,ze)),Sn(De,"fillOpacity",jn("titleOpacity",Oe,ze)),Pn(Ln,bn,Mt,null,je,De,Pe))),d=Bn(pn,Le,Fe,s,We,Ae,i),n.zindex&&(d.zindex=n.zindex),la(d,e)}function ua(e,t,n){return'item.anchor==="start"?'+e+':item.anchor==="end"?'+t+":"+n}na.countsRef=function(e,t,n){var a,r,i,o=this.counts||(this.counts={}),l=aa(t);return null!=l&&(e=this.scope,a=o[l]),a?n&&n.field&&ra(e,a.agg.params,n):(i={groupby:e.fieldRef(t,"key"),pulse:Ge(this.output)},n&&n.field&&ra(e,i,n),a={agg:r=e.add(Ee(i)),ref:Ge(a=e.add(Qe({pulse:Ge(r)})))},null!=l&&(o[l]=a)),a.ref},na.tuplesRef=function(){return Ge(this.values)},na.extentRef=function(e,t){return ia(e,this,"extent","extent",t,!1)},na.domainRef=function(e,t){return ia(e,this,"domain","values",t,!1)},na.valuesRef=function(e,t,n){return ia(e,this,"vals","values",t,n||!0)},na.lookupRef=function(e,t){return ia(e,this,"lookup","tupleindex",t,!1)},na.indataRef=function(e,t){return ia(e,this,"indata","tupleindex",t,!0,!0)};var da=ua(Ye.stringValue(Pt),Ye.stringValue(jt),Ye.stringValue("center")),ca=ua('+(item.orient==="'+jt+'")','+(item.orient!=="'+Pt+'")',"0.5");function fa(e,t){e=Ye.isString(e)?{text:e}:e;var n,a,r,i=t.config.title,o=Ye.extend({},e.encode);return n={orient:jn("orient",e,i)},a=Ge(t.add(Qe(null,[n]))),o.name=e.name,o.interactive=e.interactive,r=function(e,t,n,a){var r,i,o,l,s,u={value:0},d=e.text,c=jn("orient",e,t),f=jn("anchor",e,t),p=c===Pt||c===zt?-1:1,g=c===zt||c===Dt,h={group:g?"width":"height"};l={field:h,mult:{signal:ca}},s=p<0?u:g?{field:{group:"height"}}:{field:{group:"width"}},r={enter:i={opacity:u},update:o={opacity:{value:1},text:kn(d),anchor:kn(f),orient:kn(c),extent:{field:h},align:{signal:da}},exit:{opacity:u}},g?(o.x=l,o.y=s,i.angle=u,i.baseline={value:c===zt?Dt:zt}):(o.x=s,o.y=l,i.angle={value:90*p},i.baseline={value:Dt});return Sn(r,"align",jn("align",e,t),"update"),Sn(r,"angle",jn("angle",e,t)),Sn(r,"baseline",jn("baseline",e,t)),Sn(r,"fill",jn("color",e,t)),Sn(r,"font",jn("font",e,t)),Sn(r,"fontSize",jn("fontSize",e,t)),Sn(r,"fontWeight",jn("fontWeight",e,t)),Sn(r,"frame",jn("frame",e,t)),Sn(r,"limit",jn("limit",e,t)),Sn(r,"offset",jn("offset",e,t)||0),Pn(Ln,xn,e.style||qt,null,a,r,n)}(e,i,o,a),e.zindex&&(r.zindex=e.zindex),la(r,t)}function pa(t,n){var a=[];t.transform&&t.transform.forEach(function(e){a.push(Xn(e,n))}),t.on&&t.on.forEach(function(e){oa(e,n,t.name)}),n.addDataPipeline(t.name,function(e,t,n){var a,r,i,o,l,s=[],u=null,d=!1,c=!1;e.values?s.push(u=ga({$ingest:e.values,$format:e.format})):e.url?(u=ke(e.url)||ke(e.format)?{$load:Ge(t.add((f=t,p=e,Ne({url:f.property(p.url),format:f.objectProperty(p.format)}))))}:{$request:e.url,$format:e.format},s.push(u=ga(u))):e.source&&(u=a=Ye.array(e.source).map(function(e){return Ge(t.getData(e).output)}),s.push(null));var f,p;for(r=0,i=n.length;r<i;++r)o=n[r],l=o.metadata,u||l.source||s.push(u=ga()),s.push(o),l.generates&&(c=!0),l.modifies&&!c&&(d=!0),l.source?u=o:l.changes&&(u=null);a&&(i=a.length-1,s[0]=rt({derive:d,pulse:i?a:a[0]}),(d||i)&&s.splice(1,0,ga()));u||s.push(ga());return s.push(lt({})),s}(t,n,a))}function ga(e){var t=Qe({},e);return t.metadata={source:!0},t}function ha(e,t){return{scale:e.scale,range:t}}function ma(e,t,n,a,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+a+","+r+")"}}function va(e,t){var n,a,r,i,o,l,s,u,d,c,f,p,g,h,m,v,y,b,x,k,S,R,w,O,z,P,j,D,$,_,E,V,A,F,W,L,C,M,q,B,T,N,U,I,X,Y,G,H,J,K,Q,Z,ee,te,ne,ae,re,ie,oe,le,se,ue,de,ce,fe,pe,ge,he,me,ve,ye,be,xe,ke,Se,Re,we,Oe,ze,Pe,je,De,$e,_e,Ee,Ve,Ae,Fe,We,Le,Ce,Me,qe,Be=(s=e,d=(u=t).config,c=s.orient,f=c===zt||c===Dt?d.axisX:d.axisY,p=d["axis"+c[0].toUpperCase()+c.slice(1)],g="band"===u.scaleType(s.scale)&&d.axisBand,f||p||g?Ye.extend({},d.axis,f,p,g):d.axis),Te=e.encode||{},Ne=Te.axis||{},Ue=Ne.name||void 0,Ie=Ne.interactive,Xe=Ne.style;return n={orient:e.orient,ticks:!!jn("ticks",e,Be),labels:!!jn("labels",e,Be),grid:!!jn("grid",e,Be),domain:!!jn("domain",e,Be),title:!!He(e.title,!1)},a=Ge(t.add(Qe({},[n]))),Ne=Rn({update:{range:{signal:'abs(span(range("'+e.scale+'")))'},offset:kn(He(e.offset,0)),position:kn(He(e.position,0)),titlePadding:kn(jn("titlePadding",e,Be)),minExtent:kn(jn("minExtent",e,Be)),maxExtent:kn(jn("maxExtent",e,Be))}},Te.axis,It),r=Ge(t.add(Ke({scale:t.scaleRef(e.scale),extra:t.property(jn("tickExtra",e,Be)),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),formatSpecifier:t.property(e.format)}))),l=[],n.grid&&l.push((h=e,m=Be,v=Te.grid,y=r,j=h.orient,D=h.gridScale,_=($=j===Pt||j===zt?1:-1)*h.offset||0,Sn(b={enter:x={opacity:E={value:0}},update:S={opacity:{value:1}},exit:k={opacity:E}},"stroke",jn("gridColor",h,m)),Sn(b,"strokeDash",jn("gridDash",h,m)),Sn(b,"strokeOpacity",jn("gridOpacity",h,m)),Sn(b,"strokeWidth",jn("gridWidth",h,m)),R={scale:h.scale,field:Lt,band:jn("bandPosition",h,m),round:jn("tickRound",h,m),extra:jn("tickExtra",h,m),offset:jn("tickOffset",h,m)},j===zt||j===Dt?(w="x",O="y",P="height"):(w="y",O="x",P="width"),z=O+"2",S[w]=x[w]=k[w]=R,D?(x[O]={scale:D,range:0,mult:$,offset:_},S[z]=x[z]={scale:D,range:1,mult:$,offset:_}):(x[O]={value:_},S[z]=x[z]={signal:P,mult:$,offset:_}),Pn(Fn,un,null,Lt,y,b,v))),n.ticks&&(i=jn("tickSize",e,Be),l.push((V=e,A=Be,F=Te.ticks,W=r,L=i,U=V.orient,I=U===Pt||U===zt?-1:1,Sn(C={enter:M={opacity:X={value:0}},update:B={opacity:{value:1}},exit:q={opacity:X}},"stroke",jn("tickColor",V,A)),Sn(C,"strokeOpacity",jn("tickOpacity",V,A)),Sn(C,"strokeWidth",jn("tickWidth",V,A)),(T=kn(L)).mult=I,N={scale:V.scale,field:Lt,band:jn("bandPosition",V,A),round:jn("tickRound",V,A),extra:jn("tickExtra",V,A),offset:jn("tickOffset",V,A)},U===zt||U===Dt?(B.y=M.y=X,B.y2=M.y2=T,B.x=M.x=q.x=N):(B.x=M.x=X,B.x2=M.x2=T,B.y=M.y=q.y=N),Pn(Fn,cn,null,Lt,W,C,F)))),n.labels&&(i=n.ticks?i:0,l.push((Y=e,G=Be,H=Te.labels,J=r,K=i,le=Y.orient,se=le===Pt||le===zt?-1:1,ue=le===zt||le===Dt,de=Y.scale,ce=Je(jn("labelFlush",Y,G)),fe=Je(jn("labelFlushOffset",Y,G)),pe=0===ce||!!ce,ge=jn("labelAlign",Y,G),he=jn("labelBaseline",Y,G),me={value:0},(ee=kn(K)).mult=se,ee.offset=kn(jn("labelPadding",Y,G)||0),ee.offset.mult=se,te={scale:de,field:Lt,band:.5,offset:jn("tickOffset",Y,G)},ue?(ne=ge||(pe?ma(de,ce,'"left"','"right"','"center"'):"center"),ae=he||(le===zt?"bottom":"top"),re=!ge):(ne=ge||(le===jt?"left":"right"),ae=he||(pe?ma(de,ce,'"top"','"bottom"','"middle"'):"middle"),re=!he),re=re&&pe&&fe?ma(de,ce,"-"+fe,fe,0):null,Sn(Q={enter:Z={opacity:me,x:ue?te:ee,y:ue?ee:te},update:{opacity:{value:1},text:{field:Et},x:Z.x,y:Z.y},exit:{opacity:me,x:Z.x,y:Z.y}},ue?"dx":"dy",re),Sn(Q,"align",ne),Sn(Q,"baseline",ae),Sn(Q,"angle",jn("labelAngle",Y,G)),Sn(Q,"fill",jn("labelColor",Y,G)),Sn(Q,"font",jn("labelFont",Y,G)),Sn(Q,"fontSize",jn("labelFontSize",Y,G)),Sn(Q,"fontWeight",jn("labelFontWeight",Y,G)),Sn(Q,"limit",jn("labelLimit",Y,G)),Sn(Q,"fillOpacity",jn("labelOpacity",Y,G)),ie=jn("labelBound",Y,G),oe=jn("labelOverlap",Y,G),Y=Pn(Ln,dn,Ct,Lt,J,Q,H),(oe||ie)&&(Y.overlap={method:oe,order:"datum.index",bound:ie?{scale:de,orient:le,tolerance:ie}:null}),Y))),n.domain&&l.push((ve=e,ye=Be,be=Te.domain,xe=a,Pe=ve.orient,Sn(ke={enter:Se={opacity:je={value:0}},update:Re={opacity:{value:1}},exit:{opacity:je}},"stroke",jn("domainColor",ve,ye)),Sn(ke,"strokeWidth",jn("domainWidth",ve,ye)),Sn(ke,"strokeOpacity",jn("domainOpacity",ve,ye)),Pe===zt||Pe===Dt?(we="x",ze="y"):(we="y",ze="x"),Oe=we+"2",Se[ze]=je,Re[we]=Se[we]=ha(ve,0),Re[Oe]=Se[Oe]=ha(ve,1),Pn(Fn,sn,null,null,xe,ke,be))),n.title&&l.push((De=e,$e=Be,_e=Te.title,Ee=a,Le=De.orient,Ce=Le===Pt||Le===zt?-1:1,Me=Le===zt||Le===Dt,Ve={enter:Ae={opacity:qe={value:0}},update:Fe={opacity:{value:1},text:kn(De.title)},exit:{opacity:qe}},We={scale:De.scale,range:.5},Me?(Fe.x=We,Ae.angle={value:0},Ae.baseline={value:Le===zt?"bottom":"top"}):(Fe.y=We,Ae.angle={value:90*Ce},Ae.baseline={value:"bottom"}),Sn(Ve,"align",jn("titleAlign",De,$e)),Sn(Ve,"angle",jn("titleAngle",De,$e)),Sn(Ve,"baseline",jn("titleBaseline",De,$e)),Sn(Ve,"fill",jn("titleColor",De,$e)),Sn(Ve,"font",jn("titleFont",De,$e)),Sn(Ve,"fontSize",jn("titleFontSize",De,$e)),Sn(Ve,"fontWeight",jn("titleFontWeight",De,$e)),Sn(Ve,"limit",jn("titleLimit",De,$e)),Sn(Ve,"fillOpacity",jn("titleOpacity",De,$e)),!Sn(Ve,"x",jn("titleX",De,$e),"update")&&Me&&!zn("x",_e)&&(Ve.enter.auto={value:!0}),!Sn(Ve,"y",jn("titleY",De,$e),"update")&&!Me&&!zn("y",_e)&&(Ve.enter.auto={value:!0}),Pn(Ln,fn,Mt,null,Ee,Ve,_e))),o=Bn(ln,Xe,Ue,a,Ie,Ne,l),e.zindex&&(o.zindex=e.zindex),la(o,t)}function ya(e,r,t){var n=Ye.array(e.signals),a=Ye.array(e.scales);return t||n.forEach(function(e){m(e,r)}),Ye.array(e.projections).forEach(function(e){!function(e,t){var n={};for(var a in e)"name"!==a&&(n[a]=Ot(e[a],a,t));t.addProjection(e.name,n)}(e,r)}),a.forEach(function(e){var t,n,a;n=r,a=(t=e).type||"linear",pt.hasOwnProperty(a)||Ye.error("Unrecognized scale type: "+Ye.stringValue(a)),n.addScale(t.name,{type:a,domain:void 0})}),Ye.array(e.data).forEach(function(e){pa(e,r)}),a.forEach(function(e){xt(e,r)}),n.forEach(function(e){$e(e,r)}),Ye.array(e.axes).forEach(function(e){va(e,r)}),Ye.array(e.marks).forEach(function(e){la(e,r)}),Ye.array(e.legends).forEach(function(e){sa(e,r)}),e.title&&fa(e.title,r),r.parseLambdas(),r}var ba=Ye.toSet(["width","height","padding","autosize"]);function xa(e,t){var n,a,r,i,o,l,s,u,d,c,f=t.config;return t.background=e.background||f.background,t.eventConfig=f.events,o=Ge(t.root=t.add(ce())),t.addSignal("width",e.width||0),t.addSignal("height",e.height||0),t.addSignal("padding",(l=e.padding,s=f,l=l||s.padding,Ye.isObject(l)?{top:h(l.top),bottom:h(l.bottom),left:h(l.left),right:h(l.right)}:{top:u=h(l),bottom:u,left:u,right:u})),t.addSignal("autosize",(d=e.autosize,c=f,d=d||c.autosize,Ye.isObject(d)?d:{type:d=d||"pad"})),Ye.array(e.signals).forEach(function(e){ba[e.name]||m(e,t)}),a=t.add(Qe()),r=Rn({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e.encode),r=t.add(We(wn(r,Vn,rn,e.style,t,{pulse:Ge(a)}))),i=t.add(ut({layout:t.objectProperty(e.layout),legendMargin:f.legendMargin,autosize:t.signalRef("autosize"),mark:o,pulse:Ge(r)})),t.operators.pop(),t.pushState(Ge(r),Ge(i),null),ya(e,t,!0),t.operators.push(i),n=t.add(Ve({mark:o,pulse:Ge(i)})),n=t.add(it({pulse:Ge(n)})),n=t.add(lt({pulse:Ge(n)})),t.addData("root",new ta(t,a,a,n)),t}function ka(e){this.config=e,this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.background=null,this.eventConfig=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function Sa(e){this.config=e.config,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}var Ra=ka.prototype=Sa.prototype;function wa(e){return(Ye.isArray(e)?function(e){for(var t,n="[",a=0,r=e.length;a<r;++a)t=e[a],n+=(0<a?",":"")+(Ye.isObject(t)?t.signal||wa(t):Ye.stringValue(t));return n+"]"}:function(e){var t,n,a="{",r=0;for(t in e)n=e[t],a+=(1<++r?",":"")+Ye.stringValue(t)+":"+(Ye.isObject(n)?n.signal||wa(n):Ye.stringValue(n));return a+"}"})(e)}function Oa(e){var r={padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:Da},area:{fill:Da},image:null,line:{stroke:Da,strokeWidth:ja},path:{stroke:Da},rect:{fill:Da},rule:{stroke:$a},shape:{stroke:Da},symbol:{fill:Da,size:64},text:{fill:$a,font:za,fontSize:11},style:{"guide-label":{fill:$a,font:za,fontSize:10},"guide-title":{fill:$a,font:za,fontSize:11,fontWeight:"bold"},"group-title":{fill:$a,font:za,fontSize:13,fontWeight:"bold"},point:{size:Pa,strokeWidth:ja,shape:"circle"},circle:{size:Pa,strokeWidth:ja},square:{size:Pa,strokeWidth:ja,shape:"square"},cell:{fill:"transparent",stroke:Ea}},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:_a,grid:!1,gridWidth:1,gridColor:Ea,labels:!0,labelAngle:0,labelLimit:180,labelPadding:2,ticks:!0,tickColor:_a,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titleAlign:"center",titlePadding:4},axisBand:{tickOffset:-1},legend:{orient:"right",offset:18,padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:Ea,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:_a,titleAlign:"left",titleBaseline:"top",titleLimit:180,titlePadding:5},title:{orient:"top",anchor:"middle",offset:4},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues",extent:[.2,1]},heatmap:{scheme:"viridis"},ramp:{scheme:"blues",extent:[.2,1]},diverging:{scheme:"blueorange"},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}};return(e||[]).forEach(function(e){var t,n,a;if(e)for(t in e)if("style"===t)for(t in a=r.style||(r.style={}),e.style)a[t]=Ye.extend(a[t]||{},e.style[t]);else n=e[t],r[t]=Ye.isObject(n)&&!Ye.isArray(n)?Ye.extend(Ye.isObject(r[t])?r[t]:{},n):n}),r}Ra.fork=function(){return new Sa(this)},Ra.isSubscope=function(){return 0<this._subid},Ra.toRuntime=function(){return this.finish(),{background:this.background,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig}},Ra.id=function(){return(this._subid?this._subid+":":0)+this._id++},Ra.add=function(t){return this.operators.push(t),t.id=this.id(),t.refs&&(t.refs.forEach(function(e){e.$ref=t.id}),t.refs=null),t},Ra.proxy=function(e){var t=e instanceof ue?Ge(e):e;return this.add(at({value:t}))},Ra.addStream=function(e){return this.streams.push(e),e.id=this.id(),e},Ra.addUpdate=function(e){return this.updates.push(e),e},Ra.finish=function(){var e,t;for(e in this.root&&(this.root.root=!0),this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(e,t,n){var a;e&&((a=e.data||(e.data={}))[t]||(a[t]=[])).push(n)}for(e in this.data)for(var a in n((t=this.data[e]).input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values"),t.index)n(t.index[a],e,"index:"+a);return this},Ra.pushState=function(e,t,n){this._encode.push(Ge(this.add(lt({pulse:e})))),this._parent.push(t),this._lookup.push(n?Ge(this.proxy(n)):null),this._markpath.push(-1)},Ra.popState=function(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},Ra.parent=function(){return Ye.peek(this._parent)},Ra.encode=function(){return Ye.peek(this._encode)},Ra.lookup=function(){return Ye.peek(this._lookup)},Ra.markpath=function(){var e=this._markpath;return++e[e.length-1]},Ra.fieldRef=function(e,t){if(Ye.isString(e))return pe(e,t);e.signal||Ye.error("Unsupported field reference: "+Ye.stringValue(e));var n,a=e.signal,r=this.field[a];return r||(n={name:this.signalRef(a)},t&&(n.as=t),this.field[a]=r=Ge(this.add(qe(n)))),r},Ra.compareRef=function(e,t){function n(e){return xe(e)?(r=!0,Ge(a[e.signal])):e}var a=this.signals,r=!1,i=Ye.array(e.field).map(n),o=Ye.array(e.order).map(n);return t&&i.push(fe),r?Ge(this.add(Ae({fields:i,orders:o}))):he(i,o)},Ra.keyRef=function(e,t){var n,a=this.signals,r=!1;return e=Ye.array(e).map(function(e){return xe(e)?(r=!0,Ge(a[e.signal])):e}),r?Ge(this.add(Be({fields:e,flat:t}))):(n={$key:e},t&&(n.$flat=!0),n)},Ra.sortRef=function(e){if(!e)return e;var t=[ve(e.op,e.field),fe],n=e.order||"ascending";return n.signal?Ge(this.add(Ae({fields:t,orders:[n=this.signalRef(n.signal),n]}))):he(t,[n,n])},Ra.event=function(e,t){var n=e+":"+t;if(!this.events[n]){var a=this.id();this.streams.push({id:a,source:e,type:t}),this.events[n]=a}return this.events[n]},Ra.addSignal=function(e,t){this.signals.hasOwnProperty(e)&&Ye.error("Duplicate signal name: "+Ye.stringValue(e));var n=t instanceof ue?t:this.add(ce(t));return this.signals[e]=n},Ra.getSignal=function(e){return this.signals[e]||Ye.error("Unrecognized signal name: "+Ye.stringValue(e)),this.signals[e]},Ra.signalRef=function(e){return this.signals[e]?Ge(this.signals[e]):(this.lambdas.hasOwnProperty(e)||(this.lambdas[e]=this.add(ce(null))),Ge(this.lambdas[e]))},Ra.parseLambdas=function(){for(var e=Object.keys(this.lambdas),t=0,n=e.length;t<n;++t){var a=e[t],r=Me(a,this),i=this.lambdas[a];i.params=r.$params,i.update=r.$expr}},Ra.property=function(e){return e&&e.signal?this.signalRef(e.signal):e},Ra.objectProperty=function(e){return e&&Ye.isObject(e)?this.signalRef(e.signal||wa(e)):e},Ra.exprRef=function(e,t){var n={expr:Me(e,this)};return t&&(n.expr.$name=t),Ge(this.add(Le(n)))},Ra.addBinding=function(e,t){this.bindings||Ye.error("Nested signals do not support binding: "+Ye.stringValue(e)),this.bindings.push(Ye.extend({signal:e},t))},Ra.addScaleProj=function(e,t){this.scales.hasOwnProperty(e)&&Ye.error("Duplicate scale or projection name: "+Ye.stringValue(e)),this.scales[e]=this.add(t)},Ra.addScale=function(e,t){this.addScaleProj(e,ot(t))},Ra.addProjection=function(e,t){this.addScaleProj(e,nt(t))},Ra.getScale=function(e){return this.scales[e]||Ye.error("Unrecognized scale name: "+Ye.stringValue(e)),this.scales[e]},Ra.projectionRef=Ra.scaleRef=function(e){return Ge(this.getScale(e))},Ra.projectionType=Ra.scaleType=function(e){return this.getScale(e).params.type},Ra.addData=function(e,t){return this.data.hasOwnProperty(e)&&Ye.error("Duplicate data set name: "+Ye.stringValue(e)),this.data[e]=t},Ra.getData=function(e){return this.data[e]||Ye.error("Undefined data set name: "+Ye.stringValue(e)),this.data[e]},Ra.addDataPipeline=function(e,t){return this.data.hasOwnProperty(e)&&Ye.error("Duplicate data set name: "+Ye.stringValue(e)),this.addData(e,ta.fromEntries(this,t))};var za="sans-serif",Pa=30,ja=2,Da="#4c78a8",$a="#000",_a="#888",Ea="#ddd";e.formatLocale=n.formatDefaultLocale,e.timeFormatLocale=a.timeFormatDefaultLocale,e.parse=function(e,t){return Ye.isObject(e)||Ye.error("Input Vega specification must be an object."),xa(e,new ka(Oa([t,e.config]))).toRuntime()},e.config=Oa,e.signal=m,e.signalUpdates=$e,e.stream=Re,e.codeGenerator=le,e.functionContext=ne,e.expressionFunction=ie,e.MarkRole=an,e.FrameRole=rn,e.ScopeRole=on,e.AxisRole=ln,e.AxisDomainRole=sn,e.AxisGridRole=un,e.AxisLabelRole=dn,e.AxisTickRole=cn,e.AxisTitleRole=fn,e.LegendRole=pn,e.LegendEntryRole=hn,e.LegendLabelRole=vn,e.LegendSymbolRole=yn,e.LegendTitleRole=bn,e.Scope=ka,e.DataScope=ta,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vega-util"),require("d3-format"),require("d3-time-format"),require("vega-scale"),require("vega-scenegraph"),require("d3-geo"),require("vega-dataflow"),require("vega-expression"),require("vega-statistics"),require("d3-color"),require("d3-array"),require("vega-event-selector")):"function"==typeof define&&define.amd?define(["exports","vega-util","d3-format","d3-time-format","vega-scale","vega-scenegraph","d3-geo","vega-dataflow","vega-expression","vega-statistics","d3-color","d3-array","vega-event-selector"],t):t(e.vega={},e.vega,e.d3,e.d3,e.vega,e.vega,e.d3,e.vega,e.vega,e.vega,e.d3,e.d3,e.vega)}(this,function(e,Ye,n,a,f,p,t,g,o,r,i,l,u){"use strict";function h(e){return+e||0}var s="outer",d=["value","update","react","bind"];function c(e,t){Ye.error(e+' for "outer" push: '+Ye.stringValue(t))}function m(t,e){var n=t.name;if(t.push===s)e.signals[n]||c("No prior signal definition",n),d.forEach(function(e){void 0!==t[e]&&c("Invalid property ",e)});else{var a=e.addSignal(n,t.value);!1===t.react&&(a.react=!1),t.bind&&e.addBinding(n,t.bind)}}var v={};function y(e,t,n){var a=e+":"+n,r=v[a];return r&&r[0]===t||(v[a]=r=[t,t(n)]),r[1]}function b(e,t){return y("timeFormat",a.timeFormat,t)(e)}var x=new Date(2e3,0,1);function k(e,t,n){return x.setMonth(e),x.setDate(t),b(x,n)}function S(e,t,n,a){var r,i=t[0],o=t[t.length-1];return o<i&&(r=i,i=o,o=r),a=void 0===a||a,((n=void 0===n||n)?i<=e:i<e)&&(a?e<=o:e<o)}function R(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(e){t.warn(e)}return n[n.length-1]}var w="undefined"!=typeof window&&window||null;var O="Literal",z="%",P=":";function j(e,t){var n;return Ye.isFunction(e)?e:Ye.isString(e)?(n=t.scales[e])&&n.value:void 0}function D(e,t,n){var a=z+n;if(!t.hasOwnProperty(a))try{t[a]=e.scaleRef(n)}catch(e){}}function $(e,t,n,a){if(t[0].type===O)D(n,a,t[0].value);else if("Identifier"===t[0].type)for(e in n.scales)D(n,a,e)}function _(r,i){return function(e,t,n){if(e){var a=j(e,(n||this).context);return a&&a.path[r](t)}return i(t)}}var E=_("area",t.geoArea),V=_("bounds",t.geoBounds),A=_("centroid",t.geoCentroid);function F(e){var t=this.context.data[e];return t?t.values.value:[]}function W(e,t,n,a){t[0].type!==O&&Ye.error("First argument to data functions must be a string literal.");var r=t[0].value,i=P+r;a.hasOwnProperty(i)||(a[i]=n.getData(r).tuplesRef())}var L={};function C(e){return e.data}function M(e,t){var n=F.call(t,e);return n.root&&n.root.lookup||L}function q(e,t){return e===t||e!=e&&t!=t||!(!Ye.isArray(e)||!Ye.isArray(t)||e.length!==t.length)&&function(e,t){for(var n=0,a=e.length;n<a;++n)if(!q(e[n],t[n]))return!1;return!0}(e,t)}function B(n){return function(e){for(var t in n)if(!q(e[t],n[t]))return!1;return!0}}var T="bin_",N="intersect",U="union",I="index:unit";function X(e,t){for(var n,a=t.fields,r=t.values,i=t.getter||(t.getter=[]),o=a.length,l=0;l<o;++l)if(i[l]=i[l]||Ye.field(a[l]),n=i[l](e),Ye.isDate(n)&&(n=Ye.toNumber(n)),Ye.isDate(r[l])&&(r[l]=Ye.toNumber(r[l])),t[T+a[l]]){if(Ye.isDate(r[l][0])&&(r[l]=r[l].map(Ye.toNumber)),!S(n,r[l],!0,!1))return!1}else if(n!==r[l])return!1;return!0}function Y(e,t){for(var n,a,r=t.intervals,i=r.length,o=0;o<i;++o){if(n=r[o].extent,a=(r[o].getter||(r[o].getter=Ye.field(r[o].field)))(e),!n||n[0]===n[1])return!1;if(Ye.isDate(a)&&(a=Ye.toNumber(a)),Ye.isDate(n[0])&&(n=r[o].extent=n.map(Ye.toNumber)),Ye.isNumber(n[0])&&!S(a,n))return!1;if(Ye.isString(n[0])&&n.indexOf(a)<0)return!1}return!0}function G(e,t,n,a){for(var r,i,o,l,s,u=this.context.data[e],d=u?u.values.value:[],c=u?u[I]&&u[I].value:void 0,f=n===N,p=d.length,g=0;g<p;++g)if(r=d[g],c&&f){if(-1===(o=(i=i||{})[l=r.unit]||0))continue;if(s=a(t,r),i[l]=s?-1:++o,s&&1===c.size)return!0;if(!s&&o===c.get(l).count)return!1}else if(f^(s=a(t,r)))return s;return p&&f}function H(e,t,n){return G.call(this,e,t,n,X)}function J(e,t,n,a){t[0].type!==O&&Ye.error("First argument to indata must be a string literal.");var r=t[0].value;(2<=t.length&&t[t.length-1].value)!==N||a.hasOwnProperty("@unit")||(a["@unit"]=n.getData(r).indataRef(n,"unit")),W(0,t,n,a)}function K(e,t,n,a){var r,i,o,l,s,u=this.context.data[e],d=u?u.values.value:[],c=u?u[I]&&u[I].value:void 0,f=d[0],p=0;if(f){for(r=t?f.encodings.length:f.fields.length;p<r;++p)if(t&&f.encodings[p]===t||n&&f.fields[p]===n){i=p,l=f[T+f.fields[p]];break}return c&&1===c.size&&(a=U),c&&a===N?(s=d.reduce(function(e,t){return(e[t.unit]||(e[t.unit]=[])).push({unit:t.unit,value:t.values[i]}),e},{}),o=Object.keys(s).map(function(e){return{unit:e,value:l?Z(s[e],U):Q(s[e],U)}})):o=d.map(function(e){return{unit:e.unit,value:e.values[i]}}),l?Z(o,a):Q(o,a)}}function Q(e,t){for(var n,a,r,i,o={},l=0,s={},u=[],d=0,c=e.length;d<c;++d)a=(n=e[d]).unit,i=n.value,o[a]||(o[a]=++l),(r=s[i])||(s[i]=r={value:i,units:{},count:0}),r.units[a]||(r.units[a]=++r.count);for(i in s)r=s[i],t===N&&r.count!==l||u.push(r.value);return u.length?u:void 0}function Z(e,t){for(var n,a,r,i,o=t===N?te:ee,l=0,s=e.length;l<s;++l)n=e[l].value,Ye.isDate(n[0])&&(n=n.map(Ye.toNumber)),r=n[0],(i=n[1])<r&&(i=n[0],r=n[1]),a=a?o(a,r,i):[r,i];return a&&a.length&&+a[0]!=+a[1]?a:void 0}function ee(e,t,n){return e[0]>t&&(e[0]=t),e[1]<n&&(e[1]=n),e}function te(e,t,n){return n<e[0]||e[1]<t?[]:(e[0]<t&&(e[0]=t),e[1]>n&&(e[1]=n),e)}var ne={random:function(){return r.random()},isArray:Ye.isArray,isBoolean:Ye.isBoolean,isDate:Ye.isDate,isNumber:Ye.isNumber,isObject:Ye.isObject,isRegExp:Ye.isRegExp,isString:Ye.isString,isTuple:g.isTuple,toBoolean:Ye.toBoolean,toDate:Ye.toDate,toNumber:Ye.toNumber,toString:Ye.toString,pad:Ye.pad,peek:Ye.peek,truncate:Ye.truncate,rgb:i.rgb,lab:i.lab,hcl:i.hcl,hsl:i.hsl,sequence:l.range,format:function(e,t){return y("format",n.format,t)(e)},utcFormat:function(e,t){return y("utcFormat",a.utcFormat,t)(e)},utcParse:function(e,t){return y("utcParse",a.utcParse,t)(e)},timeFormat:b,timeParse:function(e,t){return y("timeParse",a.timeParse,t)(e)},monthFormat:function(e){return k(e,1,"%B")},monthAbbrevFormat:function(e){return k(e,1,"%b")},dayFormat:function(e){return k(0,2+e,"%A")},dayAbbrevFormat:function(e){return k(0,2+e,"%a")},quarter:function(e){return 1+~~(new Date(e).getMonth()/3)},utcquarter:function(e){return 1+~~(new Date(e).getUTCMonth()/3)},warn:function(){return R(this.context.dataflow,"warn",arguments)},info:function(){return R(this.context.dataflow,"info",arguments)},debug:function(){return R(this.context.dataflow,"debug",arguments)},extent:function(e){var t,n,a,r,i=0;if(e&&(t=e.length)){for(n=e[i];null==n||n!=n;n=e[++i]);for(a=r=n;i<t;++i)null!=(n=e[i])&&(n<a&&(a=n),r<n&&(r=n))}return[a,r]},inScope:function(e){var t=this.context.group,n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n},clampRange:function(e,t,n){var a,r=e[0],i=e[1];return i<r&&(a=i,i=r,r=a),n-t<=(a=i-r)?[t,n]:[r=Math.min(Math.max(r,t),n-a),r+a]},pinchDistance:function(e){var t=e.touches,n=t[0].clientX-t[1].clientX,a=t[0].clientY-t[1].clientY;return Math.sqrt(n*n+a*a)},pinchAngle:function(e){var t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)},screen:function(){return w?w.screen:{}},containerSize:function(){var e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]},windowSize:function(){return w?[w.innerWidth,w.innerHeight]:[void 0,void 0]},span:function(e){return e[e.length-1]-e[0]||0},merge:function(){var e=[].slice.call(arguments);return e.unshift({}),Ye.extend.apply(null,e)},flush:function(e,t,n,a,r,i){if(!n&&0!==n)return i;var o,l,s=e[0],u=Ye.peek(e),d=+n;return u<s&&(o=s,s=u,u=o),(o=Math.abs(t-s))<(l=Math.abs(u-t))&&o<=d?a:l<=d?r:i},bandspace:function(e,t,n){return f.bandSpace(e||0,t||0,n||0)},inrange:S,setdata:function(e,t){var n=this.context.dataflow,a=this.context.data[e].input;return n.pulse(a,n.changeset().remove(Ye.truthy).insert(t)),1},pathShape:function(t){var n=null;return function(e){return e?p.pathRender(e,n=n||p.pathParse(t)):t}},panLinear:Ye.panLinear,panLog:Ye.panLog,panPow:Ye.panPow,zoomLinear:Ye.zoomLinear,zoomLog:Ye.zoomLog,zoomPow:Ye.zoomPow,encode:function(e,t,n){if(e){var a=this.context.dataflow,r=e.mark.source;a.pulse(r,a.changeset().encode(e,t))}return void 0!==n?n:e},modify:function(e,t,n,a,r,i){var o,l,s=this.context.dataflow,u=this.context.data[e],d=u.input,c=u.changes,f=s.stamp();if(!1===s._trigger||!(d.value.length||t||a))return 0;if((!c||c.stamp<f)&&(u.changes=c=s.changeset(),c.stamp=f,s.runAfter(function(){u.modified=!0,s.pulse(d,c).run()},!0,1)),n&&(o=!0===n?Ye.truthy:Ye.isArray(n)||g.isTuple(n)?n:B(n),c.remove(o)),t&&c.insert(t),a&&(o=B(a),d.value.some(o)?c.remove(o):c.insert(a)),r)for(l in i)c.modify(r,l,i[l]);return 1}},ae=["view","item","group","xy","x","y"],re={};function ie(e,t,n){return 1===arguments.length?ne[e]:(ne[e]=t,n&&(re[e]=n),le&&(le.functions[e]="this."+e),this)}ie("bandwidth",function(e,t){var n=j(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0},$),ie("copy",function(e,t){var n=j(e,(t||this).context);return n?n.copy():void 0},$),ie("domain",function(e,t){var n=j(e,(t||this).context);return n?n.domain():[]},$),ie("range",function(e,t){var n=j(e,(t||this).context);return n&&n.range?n.range():[]},$),ie("invert",function(e,t,n){var a=j(e,(n||this).context);return a?Ye.isArray(t)?(a.invertRange||a.invert)(t):(a.invert||a.invertExtent)(t):void 0},$),ie("scale",function(e,t,n){var a=j(e,(n||this).context);return a?a(t):void 0},$),ie("gradient",function(e,t,n,a,r){e=j(e,(r||this).context);var i=p.Gradient(t,n),o=e.domain(),l=o[0],s=o[o.length-1],u=f.scaleFraction(e,l,s);e.ticks&&(l!==(o=e.ticks(+a||15))[0]&&o.unshift(l),s!==o[o.length-1]&&o.push(s));for(var d=0,c=o.length;d<c;++d)i.stop(u(o[d]),e(o[d]));return i},$),ie("geoArea",E,$),ie("geoBounds",V,$),ie("geoCentroid",A,$),ie("geoShape",function(e,t,n){var a=j(e,(n||this).context);return function(e){return a?a.path.context(e)(t):""}},$),ie("indata",function(e,t,n){var a=this.context.data[e]["index:"+t],r=a?a.value.get(n):void 0;return r?r.count:r},function(e,t,n,a){t[0].type!==O&&Ye.error("First argument to indata must be a string literal."),t[1].type!==O&&Ye.error("Second argument to indata must be a string literal.");var r=t[0].value,i=t[1].value,o="@"+i;a.hasOwnProperty(o)||(a[o]=n.getData(r).indataRef(n,i))}),ie("data",F,W),ie("vlSingle",H,W),ie("vlSingleDomain",K,W),ie("vlMulti",H,J),ie("vlMultiDomain",K,J),ie("vlInterval",function(e,t,n){return G.call(this,e,t,n,Y)},W),ie("vlIntervalDomain",function(e,t,n,a){var r,i,o,l,s,u=this.context.data[e],d=u?u.values.value:[],c=d[0],f=0;if(c){for(r=c.intervals.length;f<r;++f)if(i=c.intervals[f],t&&i.encoding===t||n&&i.field===n){if(!i.extent)return;o=f,s=2<i.extent.length;break}return l=d.reduce(function(e,t){var n=t.intervals[o].extent,a=s?n.map(function(e){return{unit:t.unit,value:e}}):{unit:t.unit,value:n};return s?e.push.apply(e,a):e.push(a),e},[]),s?Q(l,a):Z(l,a)}},W),ie("treePath",function(e,t,n){var a=M(e,this),r=a[t],i=a[n];return r&&i?r.path(i).map(C):void 0},W),ie("treeAncestors",function(e,t){var n=M(e,this)[t];return n?n.ancestors().map(C):void 0},W);var oe={blacklist:["_"],whitelist:["datum","event","item"],fieldvar:"datum",globalvar:function(e){return"_["+Ye.stringValue("$"+e)+"]"},functions:function(e){var t=o.functions(e);for(var n in ae.forEach(function(e){t[e]="event.vega."+e}),ne)t[n]="this."+n;return t},constants:o.constants,visitors:re},le=o.codegen(oe),se="$";function Me(t,a,e){var n,r,i={};try{t=Ye.isString(t)?t:Ye.stringValue(t)+"",n=o.parse(t)}catch(e){Ye.error("Expression parse error: "+t)}return n.visit(function(e){if("CallExpression"===e.type){var t=e.callee.name,n=oe.visitors[t];n&&n(t,e.arguments,a,i)}}),(r=le(n)).globals.forEach(function(e){var t=se+e;!i.hasOwnProperty(t)&&a.getSignal(e)&&(i[t]=a.signalRef(e))}),{$expr:e?e+"return("+r.code+");":r.code,$fields:r.fields,$params:i}}function ue(e,t,n,a){this.id=-1,this.type=e,this.value=t,this.params=n,a&&(this.parent=a)}function de(e,t,n,a){return new ue(e,t,n,a)}function ce(e,t){return de("operator",e,t)}function Ge(e){var t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}var fe={$tupleid:1,toString:function(){return":_tupleid_:"}};function pe(e,t){return t?{$field:e,$name:t}:{$field:e}}var ge=pe("key");function he(e,t){return{$compare:e,$order:t}}var me="descending";function ve(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}var ye="scope",be="view";function xe(e){return e&&e.signal}function ke(e){if(xe(e))return!0;if(Ye.isObject(e))for(var t in e)if(ke(e[t]))return!0;return!1}function He(e,t){return null!=e?e:t}function Je(e){return e&&e.signal||e}var Se="timer";function Re(e,t){return(e.merge?we:e.stream?Oe:e.type?ze:Ye.error("Invalid stream specification: "+Ye.stringValue(e)))(e,t)}function we(e,t){var n=Pe({merge:e.merge.map(function(e){return Re(e,t)})},e,t);return t.addStream(n).id}function Oe(e,t){var n=Pe({stream:Re(e.stream,t)},e,t);return t.addStream(n).id}function ze(e,t){var n,a,r;return e.type===Se?(n=t.event(Se,e.throttle),e={between:e.between,filter:e.filter}):n=t.event((r=e.source)===ye?be:r||be,e.type),a=Pe({stream:n},e,t),1===Object.keys(a).length?n:t.addStream(a).id}function Pe(e,t,n){var a,r,i,o,l=t.between;return l&&(2!==l.length&&Ye.error('Stream "between" parameter must have 2 entries: '+Ye.stringValue(t)),e.between=[Re(l[0],n),Re(l[1],n)]),l=t.filter?Ye.array(t.filter):[],(t.marktype||t.markname||t.markrole)&&l.push((a=t.marktype,r=t.markname,i=t.markrole,(o="event.item")+(a&&"*"!==a?"&&"+o+".mark.marktype==='"+a+"'":"")+(i?"&&"+o+".mark.role==='"+i+"'":"")+(r?"&&"+o+".mark.name==='"+r+"'":""))),t.source===ye&&l.push("inScope(event.item)"),l.length&&(e.filter=Me("("+l.join(")&&(")+")").$expr),null!=(l=t.throttle)&&(e.throttle=+l),null!=(l=t.debounce)&&(e.debounce=+l),t.consume&&(e.consume=!0),e}var je="var datum=event.item&&event.item.datum;";function De(e,a,t){var n,r,i=e.events,o=e.update,l=e.encode,s=[];i||Ye.error("Signal update missing events specification."),Ye.isString(i)&&(i=u.selector(i,a.isSubscope()?ye:be)),(i=Ye.array(i).filter(function(e){return e.signal||e.scale?(s.push(e),0):1})).length&&s.push(1<i.length?{merge:i}:i[0]),null!=l&&(o&&Ye.error("Signal encode and update are mutually exclusive."),o="encode(item(),"+Ye.stringValue(l)+")"),n=Ye.isString(o)?Me(o,a,je):null!=o.expr?Me(o.expr,a,je):null!=o.value?o.value:null!=o.signal?{$expr:"_.value",$params:{value:a.signalRef(o.signal)}}:Ye.error("Invalid signal update specification."),r={target:t,update:n},e.force&&(r.options={force:!0}),s.forEach(function(e){var t,n;a.addUpdate(Ye.extend((n=a,{source:(t=e).signal?n.signalRef(t.signal):t.scale?n.scaleRef(t.scale):Re(t,n)}),r))})}function $e(e,t){var n=t.getSignal(e.name);if(e.update){var a=Me(e.update,t);n.update=a.$expr,n.params=a.$params}e.on&&e.on.forEach(function(e){De(e,t,n.id)})}function _e(a){return function(e,t,n){return de(a,t,e||void 0,n)}}var Ee=_e("aggregate"),Ke=_e("axisticks"),Ve=_e("bound"),Qe=_e("collect"),Ae=_e("compare"),Fe=_e("datajoin"),We=_e("encode"),Le=_e("expression"),Ce=_e("facet"),qe=_e("field"),Be=_e("key"),Te=_e("legendentries"),Ne=_e("load"),Ue=_e("mark"),Ie=_e("multiextent"),Xe=_e("multivalues"),Ze=_e("overlap"),et=_e("params"),tt=_e("prefacet"),nt=_e("projection"),at=_e("proxy"),rt=_e("relay"),it=_e("render"),ot=_e("scale"),lt=_e("sieve"),st=_e("sortitems"),ut=_e("viewlayout"),dt=_e("values"),ct=0,ft=["identity","ordinal","band","point","bin-linear","bin-ordinal","quantize","quantile","threshold","linear","pow","sqrt","log","sequential","time","utc"],pt=Ye.toSet(ft),gt=Ye.toSet(ft.slice(4,9)),ht=Ye.toSet(ft.slice(9)),mt=Ye.toSet(ft.slice(1,6));function vt(e){return mt.hasOwnProperty(e)}function yt(e){return gt.hasOwnProperty(e)}function bt(e){return"quantile"===e}function xt(e,t){var n,a,r,i,o=t.getScale(e.name).params;for(n in o.domain=Rt(e.domain,e,t),null!=e.range&&(o.range=function e(t,n,a){var r=t.range,i=n.config.range;{if(r.signal)return n.signalRef(r.signal);if(Ye.isString(r)){if(i&&i.hasOwnProperty(r))return t=Ye.extend({},t,{range:i[r]}),e(t,n,a);"width"===r?r=[0,{signal:"width"}]:"height"===r?r=vt(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]:Ye.error("Unrecognized scale range value: "+Ye.stringValue(r))}else{if(r.scheme)return a.scheme=kt(r.scheme,n),r.extent&&(a.schemeExtent=(o=r.extent,l=n,o.signal?l.signalRef(o.signal):o.map(function(e){return kt(e,l)}))),void(r.count&&(a.schemeCount=kt(r.count,n)));if(r.step)return void(a.rangeStep=kt(r.step,n));if(vt(t.type)&&!Ye.isArray(r))return Rt(r,t,n);Ye.isArray(r)||Ye.error("Unsupported range type: "+Ye.stringValue(r))}}var o,l;return r.map(function(e){return kt(e,n)})}(e,t,o)),null!=e.interpolate&&(a=e.interpolate,(r=o).interpolate=kt(a.type||a),null!=a.gamma&&(r.interpolateGamma=kt(a.gamma))),null!=e.nice&&(i=e.nice,o.nice=Ye.isObject(i)?{interval:kt(i.interval),step:kt(i.step)}:kt(i)),e)o.hasOwnProperty(n)||"name"===n||(o[n]=kt(e[n],t))}function kt(e,t){return Ye.isObject(e)?e.signal?t.signalRef(e.signal):Ye.error("Unsupported object: "+Ye.stringValue(e)):e}function St(e){Ye.error("Can not find data set: "+Ye.stringValue(e))}function Rt(e,t,n){if(e)return e.signal?n.signalRef(e.signal):(Ye.isArray(e)?function(e,t,n){return e.map(function(e){return kt(e,n)})}:e.fields?function(e,t,n){var a=e.data,r=e.fields.reduce(function(e,t){return t=Ye.isString(t)?{data:a,field:t}:Ye.isArray(t)||t.signal?function(e,t){var n="_:vega:_"+ct++,a=Qe({});if(Ye.isArray(e))a.value={$ingest:e};else if(e.signal){var r="setdata("+Ye.stringValue(n)+","+e.signal+")";a.params.input=t.signalRef(r)}return t.addDataPipeline(n,[a,lt({})]),{data:n,field:"data"}}(t,n):t,e.push(t),e},[]);return(vt(t.type)?function(e,n,t){var a,r,i;return a=t.map(function(e){var t=n.getData(e.data);return t||St(e.data),t.countsRef(n,e.field)}),r=n.add(Ee({groupby:ge,ops:["sum"],fields:[n.fieldRef("count")],as:["count"],pulse:a})),i=n.add(Qe({pulse:Ge(r)})),Ge(n.add(dt({field:ge,sort:n.sortRef(wt(e.sort,!0)),pulse:Ge(i)})))}:bt(t.type)?function(e,n,t){var a=t.map(function(e){var t=n.getData(e.data);return t||St(e.data),t.domainRef(n,e.field)});return Ge(n.add(Xe({values:a})))}:function(e,n,t){var a=t.map(function(e){var t=n.getData(e.data);return t||St(e.data),t.extentRef(n,e.field)});return Ge(n.add(Ie({extents:a})))})(e,n,r)}:function(e,t,n){var a=n.getData(e.data);a||St(e.data);return vt(t.type)?a.valuesRef(n,e.field,wt(e.sort,!1)):bt(t.type)?a.domainRef(n,e.field):a.extentRef(n,e.field)})(e,t,n);null==t.domainMin&&null==t.domainMax||Ye.error("No scale domain defined for domainMin/domainMax to override.")}function wt(e,t){return e&&(e.field||e.op?e.field||"count"===e.op?t&&e.field?Ye.error("Multiple domain scales can not sort by field."):t&&e.op&&"count"!==e.op&&Ye.error("Multiple domain scales support op count only."):Ye.error("No field provided for sort aggregate op: "+e.op):Ye.isObject(e)?e.field="key":e={field:"key"}),e}function Ot(e,t,n){return Ye.isArray(e)?e.map(function(e){return Ot(e,t,n)}):Ye.isObject(e)?e.signal?n.signalRef(e.signal):"fit"===t?e:Ye.error("Unsupported parameter object: "+Ye.stringValue(e)):e}var zt="top",Pt="left",jt="right",Dt="bottom",$t="vertical",_t="index",Et="label",Vt="offset",At="perc",Ft="perc2",Wt="size",Lt="value",Ct="guide-label",Mt="guide-title",qt="group-title",Bt="symbol",Tt="gradient",Nt="discrete",Ut=["size","shape","fill","stroke","strokeDash","opacity"],It={name:1,interactive:1},Xt=Ye.toSet(["rule"]),Yt=Ye.toSet(["group","image","rect"]);function Gt(e,t,n,a){var r=Me(e,t);return r.$fields.forEach(function(e){a[e]=1}),Ye.extend(n,r.$params),r.$expr}function Ht(e,t,n,a){return function e(t,n,a,r){var i,o,l;if(t.signal)i="datum",l=Gt(t.signal,n,a,r);else if(t.group||t.parent){for(o=Math.max(1,t.level||1),i="item";0<o--;)i+=".mark.group";t.parent?(l=t.parent,i+=".datum"):l=t.group}else t.datum?(i="datum",l=t.datum):Ye.error("Invalid field reference: "+Ye.stringValue(t));t.signal||(Ye.isString(l)?(r[l]=1,l=Ye.splitAccessPath(l).map(Ye.stringValue).join("][")):l=e(l,n,a,r));return i+"["+l+"]"}(Ye.isObject(e)?e:{datum:e},t,n,a)}function Jt(e,t,n,a,r){var i,o,l,s=Kt(e.scale,n,a,r);return null!=e.range?(o=s+".range()",t=0===(i=+e.range)?o+"[0]":"($="+o+","+(1===i?"$[$.length-1]":"$[0]+"+i+"*($[$.length-1]-$[0])")+")"):(void 0!==t&&(t=s+"("+t+")"),e.band&&(l=function(e,t){if(!Ye.isString(e))return-1;var n=t.scaleType(e);return"band"===n||"point"===n?1:0}(e.scale,n))&&(i=(o=s+".bandwidth")+"()"+(1===(i=+e.band)?"":"*"+i),l<0&&(i="("+o+"?"+i+":0)"),t=(t?t+"+":"")+i,e.extra&&(t="(datum.extra?"+s+"(datum.extra.value):"+t+")")),null==t&&(t="0")),t}function Kt(e,t,n,a){var r;if(Ye.isString(e))r=z+e,n.hasOwnProperty(r)||(n[r]=t.scaleRef(e)),r=Ye.stringValue(r);else{for(r in t.scales)n[z+r]=t.scaleRef(r);r=Ye.stringValue(z)+"+"+(e.signal?"("+Gt(e.signal,t,n,a)+")":Ht(e,t,n,a))}return"_["+r+"]"}function Qt(e,t,n,a){return Ye.isObject(e)?"("+Zt(null,e,t,n,a)+")":e}function Zt(e,t,n,a,r){if(null!=t.gradient)return o=n,l=a,s=r,"this.gradient("+Kt((i=t).gradient,o,l,s)+","+Ye.stringValue(i.start)+","+Ye.stringValue(i.stop)+","+Ye.stringValue(i.count)+")";var i,o,l,s,u=t.signal?Gt(t.signal,n,a,r):t.color?function(e,r,i,o){function t(e,t,n,a){return"this."+e+"("+[Zt(null,t,r,i,o),Zt(null,n,r,i,o),Zt(null,a,r,i,o)].join(",")+").toString()"}return e.c?t("hcl",e.h,e.c,e.l):e.h||e.s?t("hsl",e.h,e.s,e.l):e.l||e.a?t("lab",e.l,e.a,e.b):e.r||e.g||e.b?t("rgb",e.r,e.g,e.b):null}(t.color,n,a,r):null!=t.field?Ht(t.field,n,a,r):void 0!==t.value?Ye.stringValue(t.value):void 0;return null!=t.scale&&(u=Jt(t,u,n,a,r)),void 0===u&&(u=null),null!=t.exponent&&(u="Math.pow("+u+","+Qt(t.exponent,n,a,r)+")"),null!=t.mult&&(u+="*"+Qt(t.mult,n,a,r)),null!=t.offset&&(u+="+"+Qt(t.offset,n,a,r)),t.round&&(u="Math.round("+u+")"),u}function en(e,t,n){return e+"["+Ye.stringValue(t)+"]="+n+";"}function tn(e,t,n,a,r){var i="";return t.forEach(function(e){var t=Zt(0,e,n,a,r);i+=e.test?Gt(e.test,n,a,r)+"?"+t+":":t}),":"===Ye.peek(i)&&(i+="null"),en("o",e,i)}function nn(e,t,n,a){var r,i,o,l,s,u={},d="var o=item,datum=o.datum,$;";for(r in e)i=e[r],Ye.isArray(i)?d+=tn(r,i,a,n,u):d+=en("o",r,Zt(0,i,a,n,u));return d+=(o=e,s="",Xt[l=t]||(o.x2&&(o.x?(Yt[l]&&(s+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),s+="o.width=o.x2-o.x;"):s+="o.x=o.x2-(o.width||0);"),o.xc&&(s+="o.x=o.xc-(o.width||0)/2;"),o.y2&&(o.y?(Yt[l]&&(s+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),s+="o.height=o.y2-o.y;"):s+="o.y=o.y2-(o.height||0);"),o.yc&&(s+="o.y=o.yc-(o.height||0)/2;")),s),{$expr:d+="return 1;",$fields:Object.keys(u),$output:Object.keys(e)}}var an="mark",rn="frame",on="scope",ln="axis",sn="axis-domain",un="axis-grid",dn="axis-label",cn="axis-tick",fn="axis-title",pn="legend",gn="legend-band",hn="legend-entry",mn="legend-gradient",vn="legend-label",yn="legend-symbol",bn="legend-title",xn="title";function kn(e){return Ye.isObject(e)?Ye.extend({},e):{value:e}}function Sn(e,t,n,a){return null!=n?(Ye.isObject(n)&&!Ye.isArray(n)?e.update[t]=n:e[a||"enter"][t]={value:n},1):0}function Rn(e,t,n){for(var a in t)n&&n.hasOwnProperty(a)||(e[a]=Ye.extend(e[a]||{},t[a]));return e}function wn(e,t,n,a,r,i){var o,l;for(l in(i=i||{}).encoders={$encode:o={}},e=function(a,e,t,n,r){var i,o,l={};"legend"!=t&&0!==String(t).indexOf("axis")||(t=null);for(i in o=t===rn?r.group:t===an?Ye.extend({},r.mark,r[e]):null)zn(i,a)||("fill"===i||"stroke"===i)&&(zn("fill",a)||zn("stroke",a))||(l[i]=On(o[i]));return Ye.array(n).forEach(function(e){var t=r.style&&r.style[e];for(var n in t)zn(n,a)||(l[n]=On(t[n]))}),(a=Ye.extend({},a)).enter=Ye.extend(l,a.enter),a}(e,t,n,a,r.config))o[l]=nn(e[l],t,i,r);return i}function On(e){return e&&e.signal?{signal:e.signal}:{value:e}}function zn(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}function Pn(e,t,n,a,r,i,o){return{type:e,name:o?o.name:void 0,role:t,style:o&&o.style||n,key:a,from:r,interactive:!(!o||!o.interactive),encode:Rn(i,o,It)}}function jn(e,t,n){return He(t[e],n[e])}function Dn(e,t){return He(e.direction,t)===$t}function $n(e,t){return He(e.gradientLength,t.gradientLength||t.gradientWidth)}function _n(e,t){return He(e.gradientThickness,t.gradientThickness||t.gradientHeight)}function En(e,t){var n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}var Vn="group",An="rect",Fn="rule",Wn="symbol",Ln="text";var Cn="datum."+At+'<=0?"left":datum.'+At+'>=1?"right":"center"',Mn="datum."+At+'<=0?"bottom":datum.'+At+'>=1?"top":"middle"';function qn(e,t,n,a){var r,i,o,l,s,u={value:0},d=Dn(e,t.gradientDirection),c=kn(_n(e,t)),f=$n(e,t),p=jn("labelOverlap",e,t),g="";return Sn(r={enter:i={opacity:u},update:o={opacity:{value:1},text:{field:Et}},exit:{opacity:u}},"fill",jn("labelColor",e,t)),Sn(r,"font",jn("labelFont",e,t)),Sn(r,"fontSize",jn("labelFontSize",e,t)),Sn(r,"fontWeight",jn("labelFontWeight",e,t)),Sn(r,"fillOpacity",jn("labelOpacity",e,t)),Sn(r,"limit",He(e.labelLimit,t.gradientLabelLimit)),d?(i.align={value:"left"},i.baseline=o.baseline={signal:Mn},l="y",s="x",g="1-"):(i.align=o.align={signal:Cn},i.baseline={value:"top"},l="x",s="y"),i[l]=o[l]={signal:g+"datum."+At,mult:f},i[s]=o[s]=c,c.offset=He(e.labelOffset,t.gradientLabelOffset)||0,e=Pn(Ln,vn,Ct,Lt,a,r,n),p&&(e.overlap={method:p,order:"datum."+_t}),e}function Bn(e,t,n,a,r,i,o,l){return{type:Vn,name:n,role:e,style:t,from:a,interactive:r||!1,encode:i,marks:o,layout:l}}var Tn={value:0};function Nn(e,t){return{align:jn("gridAlign",e,t),center:{row:!0,column:!1},columns:(n=e,a=t,He(n.columns,He(a.columns,+Dn(n,a.symbolDirection)))),padding:{row:jn("rowPadding",e,t),column:jn("columnPadding",e,t)}};var n,a}function Un(e){return Ye.isObject(e)&&e.signal?e.signal:Ye.stringValue(e)}function In(e){var t=e.role||"";return t.indexOf("axis")&&t.indexOf("legend")?e.type===Vn?on:t||an:t}function Xn(e,t){var n=g.definition(e.type);n||Ye.error("Unrecognized transform type: "+Ye.stringValue(e.type));var a=de(n.type.toLowerCase(),null,Yn(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(a)),a.metadata=n.metadata||{},a}function Yn(e,t,n){var a,r,i,o={};for(r=0,i=e.params.length;r<i;++r)o[(a=e.params[r]).name]=Gn(a,t,n);return o}function Gn(t,e,n){var a,r,i,o=t.type,l=e[t.name];if("index"===o)return function(e,t,n){Ye.isString(t.from)||Ye.error('Lookup "from" parameter must be a string literal.');return n.getData(t.from).lookupRef(n,t.key)}(0,e,n);{if(void 0!==l)return"param"===o?(r=n,i=e[(a=t).name],a.array?(Ye.isArray(i)||Ye.error("Expected an array of sub-parameters. Instead: "+Ye.stringValue(i)),i.map(function(e){return Jn(a,e,r)})):Jn(a,i,r)):"projection"===o?n.projectionRef(e[t.name]):t.array&&!xe(l)?l.map(function(e){return Hn(t,e,n)}):Hn(t,l,n);t.required&&Ye.error("Missing required "+Ye.stringValue(e.type)+" parameter: "+Ye.stringValue(t.name))}}function Hn(e,t,n){var a=e.type;if(xe(t))return Kn(a)?Ye.error("Expression references can not be signals."):Qn(a)?n.fieldRef(t):Zn(a)?n.compareRef(t):n.signalRef(t.signal);var r,i,o=e.expr||Qn(a);return o&&((i=t)&&i.expr)?n.exprRef(t.expr,t.as):o&&((r=t)&&r.field)?pe(t.field,t.as):Kn(a)?Me(t,n):"data"===a?Ge(n.getData(t).values):Qn(a)?pe(t):Zn(a)?n.compareRef(t):t}function Jn(e,t,n){var a,r,i,o,l;for(o=0,l=e.params.length;o<l;++o){for(i in(r=e.params[o]).key)if(r.key[i]!==t[i]){r=null;break}if(r)break}return r||Ye.error("Unsupported parameter: "+Ye.stringValue(t)),a=Ye.extend(Yn(r,t,n),r.key),Ge(n.add(et(a)))}function Kn(e){return"expr"===e}function Qn(e){return"field"===e}function Zn(e){return"compare"===e}function ea(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:Ge(t.getData(e.data).output)}function ta(e,t,n,a,r){this.scope=e,this.input=t,this.output=n,this.values=a,this.aggregate=r,this.index={}}ta.fromEntries=function(e,t){var n=t.length,a=1,r=t[0],i=t[n-1],o=t[n-2],l=null;for(e.add(t[0]);a<n;++a)t[a].params.pulse=Ge(t[a-1]),e.add(t[a]),"aggregate"===t[a].type&&(l=t[a]);return new ta(e,r,o,i,l)};var na=ta.prototype;function aa(e){return Ye.isString(e)?e:null}function ra(e,t,n){var a,r=ve(n.op,n.field);if(t.ops){for(var i=0,o=t.as.length;i<o;++i)if(t.as[i]===r)return}else t.ops=["count"],t.fields=[null],t.as=["count"];n.op&&(t.ops.push((a=n.op.signal)?e.signalRef(a):n.op),t.fields.push(e.fieldRef(n.field)),t.as.push(r))}function ia(e,t,n,a,r,i,o){var l,s,u,d=t[n]||(t[n]={}),c=(u=i,Ye.isObject(u)?(u.order===me?"-":"+")+ve(u.op,u.field):""),f=aa(r);if(null!=f&&(e=t.scope,l=d[f+=c?"|"+c:""]),!l){var p=i?{field:ge,pulse:t.countsRef(e,r,i)}:{field:e.fieldRef(r),pulse:Ge(t.output)};c&&(p.sort=e.sortRef(i)),s=e.add(de(a,void 0,p)),o&&(t.index[r]=s),l=Ge(s),null!=f&&(d[f]=l)}return l}function oa(e,t,n){var a,r=e.remove,i=e.insert,o=e.toggle,l=e.modify,s=e.values,u=t.add(ce());a=Me("if("+e.trigger+',modify("'+n+'",'+[i,r,o,l,s].map(function(e){return null==e?"null":e}).join(",")+"),0)",t),u.update=a.$expr,u.params=a.$params}function la(e,n){var t,a,r,i,o,l,s,u,d,c,f,p,g,h,m,v,y,b,x,k,S,R,w,O,z,P,j,D,$,_,E,V,A,F,W,L,C,M,q,B,T,N,U=In(e),I=e.type===Vn,X=e.from&&e.from.facet,Y=e.layout||U===on||U===rn,G=U===an||Y||X,H=e.overlap;h=e.from,m=I,v=n,h?(y=h.facet)&&(m||Ye.error("Only group marks can be faceted."),null!=y.field?k=S=ea(y,v):(h.data?S=Ge(v.getData(h.data).aggregate):((x=Xn(Ye.extend({type:"aggregate",groupby:Ye.array(y.groupby)},y.aggregate),v)).params.key=v.keyRef(y.groupby),x.params.pulse=ea(y,v),k=S=Ge(v.add(x))),b=v.keyRef(y.groupby,!0))):k=Ge(v.add(Qe(null,[{}]))),k||(k=ea(h,v)),r={key:b,pulse:k,parent:S},d=Ge(a=n.add(Fe({key:r.key||(e.key?pe(e.key):void 0),pulse:r.pulse,clean:!I}))),a=i=n.add(Qe({pulse:d})),c=Ge(a=n.add(Ue({markdef:(j=e,{marktype:j.type,name:j.name||void 0,role:j.role||In(j),zindex:+j.zindex||void 0}),interactive:(z=e.interactive,P=n,z&&z.signal?P.signalRef(z.signal):!1!==z),clip:(R=e.clip,w=n,Ye.isObject(R)&&(R.signal?O=R.signal:R.path?O="pathShape("+Un(R.path)+")":R.sphere&&(O="geoShape("+Un(R.sphere)+', {type: "Sphere"})')),O?w.signalRef(O):!!R),context:{$context:!0},groups:n.lookup(),parent:n.signals.parent?n.signalRef("parent"):null,index:n.markpath(),pulse:Ge(a)}))),(a=n.add(We(wn(e.encode,e.type,U,e.style,n,{pulse:c})))).params.parent=n.encode(),e.transform&&e.transform.forEach(function(e){var t=Xn(e,n);(t.metadata.generates||t.metadata.changes)&&Ye.error("Mark transforms should not generate new data."),t.params.pulse=Ge(a),n.add(a=t)}),e.sort&&(a=n.add(st({sort:n.compareRef(e.sort,!0),pulse:Ge(a)}))),f=Ge(a),(X||Y)&&(p=Ge(Y=n.add(ut({layout:n.objectProperty(e.layout),legendMargin:n.config.legendMargin,mark:c,pulse:f})))),g=Ge(o=n.add(Ve({mark:c,pulse:p||f}))),I&&(G&&((t=n.operators).pop(),Y&&t.pop()),n.pushState(f,p||g,d),X?(F=n,W=r,B=(A=e).from.facet,T=B.name,N=ea(B,F),B.name||Ye.error("Facet must have a name: "+Ye.stringValue(B)),B.data||Ye.error("Facet must reference a data set: "+Ye.stringValue(B)),B.field?q=F.add(tt({field:F.fieldRef(B.field),pulse:N})):B.groupby?q=F.add(Ce({key:F.keyRef(B.groupby),group:Ge(F.proxy(W.parent)),pulse:N})):Ye.error("Facet must specify groupby or field: "+Ye.stringValue(B)),C=(L=F.fork()).add(Qe()),M=L.add(lt({pulse:Ge(C)})),L.addData(T,new ta(L,C,C,M)),L.addSignal("parent",null),q.params.subflow={$subflow:ya(A,L).toRuntime()}):G?(D=e,_=r,E=($=n).add(tt({pulse:_.pulse})),(V=$.fork()).add(lt()),V.addSignal("parent",null),E.params.subflow={$subflow:ya(D,V).toRuntime()}):ya(e,n),n.popState(),G&&(Y&&t.push(Y),t.push(o))),H&&(g=function(e,t,n){var a,r=e.method,i=e.bound,o={method:xe(r)?n.signalRef(r.signal):r,pulse:t};e.order&&(o.sort=n.compareRef({field:e.order}));i&&(a=i.tolerance,o.boundTolerance=xe(a)?n.signalRef(a.signal):+a,o.boundScale=n.scaleRef(i.scale),o.boundOrient=i.orient);return Ge(n.add(Ze(o)))}(H,g,n)),l=n.add(it({pulse:g})),s=n.add(lt({pulse:Ge(l)},void 0,n.parent())),null!=e.name&&(u=e.name,n.addData(u,new ta(n,i,l,s)),e.on&&e.on.forEach(function(e){(e.insert||e.remove||e.toggle)&&Ye.error("Marks only support modify triggers."),oa(e,n,u)}))}function sa(n,e){var t,a,r,i,o,l,s,u,d,c,f,p,g,h,m,v,y,b,x,k,S,R,w,O,z,P,j,D,$,_,E,V,A,F,W,L,C,M,q,B,T,N,U,I,X,Y,G,H,J,K,Q,Z,ee,te,ne,ae,re,ie,oe,le,se,ue,de,ce,fe,pe,ge,he,me,ve,ye,be,xe,ke,Se,Re,we,Oe,ze,Pe,je,De,$e,_e,Ee=e.config.legend,Ve=n.encode||{},Ae=Ve.legend||{},Fe=Ae.name||void 0,We=Ae.interactive,Le=Ae.style,Ce=Ut.reduce(function(e,t){return e||n[t]},0);return Ce||Ye.error("Missing valid scale for legend."),o=function(e,t){var n=e.type||Bt;e.type||1!==(r=e,Ut.reduce(function(e,t){return e+(r[t]?1:0)},0))||!e.fill&&!e.stroke||(a=t,n=ht.hasOwnProperty(a)?Tt:yt(t)?Nt:Bt);var a;var r;return n!==Tt?n:yt(t)?Nt:Tt}(n,e.scaleType(Ce)),l={orient:jn("orient",n,Ee),title:null!=n.title,type:o},s=Ge(e.add(Qe(null,[l]))),Ae=Rn((Sn(p={enter:{},update:{}},"offset",jn("offset",c=n,f=Ee)),Sn(p,"padding",jn("padding",c,f)),Sn(p,"titlePadding",jn("titlePadding",c,f)),Sn(p,"fill",jn("fillColor",c,f)),Sn(p,"stroke",jn("strokeColor",c,f)),Sn(p,"strokeWidth",jn("strokeWidth",c,f)),Sn(p,"cornerRadius",jn("cornerRadius",c,f)),Sn(p,"strokeDash",f.strokeDash),p),Ae,It),t={enter:{x:{value:0},y:{value:0}}},u=Ge(e.add(Te(r={type:o,scale:e.scaleRef(Ce),count:e.objectProperty(n.tickCount),values:e.objectProperty(n.values),formatSpecifier:e.property(n.format)}))),o===Tt?(i=[(ce=n,fe=Ce,pe=Ee,ge=Ve.gradient,ke={value:0},Se=Dn(ce,pe.gradientDirection),Re=_n(ce,pe),we=$n(ce,pe),Se?(ve=[0,1],ye=[0,0],be=Re,xe=we):(ve=[0,0],ye=[1,0],be=we,xe=Re),Sn(he={enter:me={opacity:ke,x:ke,y:ke,width:kn(be),height:kn(xe)},update:Ye.extend({},me,{opacity:{value:1},fill:{gradient:fe,start:ve,stop:ye}}),exit:{opacity:ke}},"stroke",jn("gradientStrokeColor",ce,pe)),Sn(he,"strokeWidth",jn("gradientStrokeWidth",ce,pe)),Sn(he,"opacity",jn("gradientOpacity",ce,pe),"update"),Pn(An,mn,null,void 0,void 0,he,ge)),qn(n,Ee,Ve.labels,u)],r.count=r.count||e.signalRef("max(2,2*floor(("+Je($n(n,Ee))+")/100))")):o===Nt?i=[(H=n,J=Ce,K=Ee,Q=Ve.gradient,Z=u,oe={value:0},le=Dn(H,K.gradientDirection),se=_n(H,K),ue=$n(H,K),de="",le?(ne="y",re="y2",ae="x",ie="width",de="1-"):(ne="x",re="x2",ae="y",ie="height"),(te={opacity:oe,fill:{scale:J,field:Lt}})[ne]={signal:de+"datum."+At,mult:ue},te[ae]=oe,te[re]={signal:de+"datum."+Ft,mult:ue},te[ie]=kn(se),Sn(ee={enter:te,update:Ye.extend({},te,{opacity:{value:1}}),exit:{opacity:oe}},"stroke",jn("gradientStrokeColor",H,K)),Sn(ee,"strokeWidth",jn("gradientStrokeWidth",H,K)),Sn(ee,"opacity",jn("gradientOpacity",H,K),"update"),Pn(An,gn,null,Lt,Z,ee,Q)),qn(n,Ee,Ve.labels,u)]:(a=Nn(n,Ee),i=[(z=n,P=Ee,j=Ve,D=u,$=Je(a.columns),C=j.entries,M=!(!C||!C.interactive),q=C?C.name:void 0,B=jn("clipHeight",z,P),T=jn("symbolOffset",z,P),N={data:"value"},U={},I=$+"?datum."+Vt+":datum."+Wt,X=B?kn(B):{field:Wt},Y="datum."+_t,G="max(1,"+$+")",X.mult=.5,U={enter:_={opacity:Tn,x:{signal:I,mult:.5,offset:T},y:X},update:E={opacity:{value:1},x:_.x,y:_.y},exit:{opacity:Tn}},z.fill||(Sn(U,"fill",P.symbolBaseFillColor),Sn(U,"stroke",P.symbolBaseStrokeColor)),Sn(U,"shape",jn("symbolType",z,P)),Sn(U,"size",jn("symbolSize",z,P)),Sn(U,"strokeWidth",jn("symbolStrokeWidth",z,P)),Sn(U,"fill",jn("symbolFillColor",z,P)),Sn(U,"stroke",jn("symbolStrokeColor",z,P)),Sn(U,"opacity",jn("symbolOpacity",z,P),"update"),Ut.forEach(function(e){z[e]&&(E[e]=_[e]={scale:z[e],field:Lt})}),A=Pn(Wn,yn,null,Lt,N,U,j.symbols),B&&(A.clip=!0),(V=kn(T)).offset=jn("labelOffset",z,P),Sn(U={enter:_={opacity:Tn,x:{signal:I,offset:V},y:X},update:E={opacity:{value:1},text:{field:Et},x:_.x,y:_.y},exit:{opacity:Tn}},"align",jn("labelAlign",z,P)),Sn(U,"baseline",jn("labelBaseline",z,P)),Sn(U,"fill",jn("labelColor",z,P)),Sn(U,"font",jn("labelFont",z,P)),Sn(U,"fontSize",jn("labelFontSize",z,P)),Sn(U,"fontWeight",jn("labelFontWeight",z,P)),Sn(U,"limit",jn("labelLimit",z,P)),Sn(U,"fillOpacity",jn("labelOpacity",z,P)),F=Pn(Ln,vn,Ct,Lt,N,U,j.labels),U={enter:{noBound:{value:!0},width:Tn,height:B?kn(B):Tn,opacity:Tn},exit:{opacity:Tn},update:E={opacity:{value:1},row:{signal:null},column:{signal:null}}},Dn(z,P.symbolDirection)?(W="ceil(item.mark.items.length/"+G+")",E.row.signal=Y+"%"+W,E.column.signal="floor("+Y+"/"+W+")",L={field:["row",Y]}):(E.row.signal="floor("+Y+"/"+G+")",E.column.signal=Y+"%"+G,L={field:Y}),E.column.signal=$+"?"+E.column.signal+":"+Y,(z=Bn(on,null,q,D={facet:{data:D,name:"value",groupby:_t}},M,Rn(U,C,It),[A,F])).sort=L,z)],r.size=(g=n,h=e,m=i[0].marks,b=En("strokeWidth",m[0].encode),y=g.size?'scale("'+g.size+'",datum)':En("size",m[0].encode),x=m[1].encode,k=h,S=Ct,v=En("fontSize",x)||(R="fontSize",w=S,(O=k.config.style[w])&&O[R]),Me("max(ceil(sqrt("+Je(y)+")+"+Je(b)+"),"+Je(v)+")",h))),i=[Bn(hn,null,null,s,We,t,i,a)],l.title&&i.push((Oe=n,ze=Ee,Pe=Ve.title,je=s,Sn(De={enter:$e={opacity:_e={value:0},x:{field:{group:"padding"}},y:{field:{group:"padding"}}},update:{opacity:{value:1},text:kn(Oe.title),x:$e.x,y:$e.y},exit:{opacity:_e}},"align",jn("titleAlign",Oe,ze)),Sn(De,"baseline",jn("titleBaseline",Oe,ze)),Sn(De,"fill",jn("titleColor",Oe,ze)),Sn(De,"font",jn("titleFont",Oe,ze)),Sn(De,"fontSize",jn("titleFontSize",Oe,ze)),Sn(De,"fontWeight",jn("titleFontWeight",Oe,ze)),Sn(De,"limit",jn("titleLimit",Oe,ze)),Sn(De,"fillOpacity",jn("titleOpacity",Oe,ze)),Pn(Ln,bn,Mt,null,je,De,Pe))),d=Bn(pn,Le,Fe,s,We,Ae,i),n.zindex&&(d.zindex=n.zindex),la(d,e)}function ua(e,t,n){return'item.anchor==="start"?'+e+':item.anchor==="end"?'+t+":"+n}na.countsRef=function(e,t,n){var a,r,i,o=this.counts||(this.counts={}),l=aa(t);return null!=l&&(e=this.scope,a=o[l]),a?n&&n.field&&ra(e,a.agg.params,n):(i={groupby:e.fieldRef(t,"key"),pulse:Ge(this.output)},n&&n.field&&ra(e,i,n),a={agg:r=e.add(Ee(i)),ref:Ge(a=e.add(Qe({pulse:Ge(r)})))},null!=l&&(o[l]=a)),a.ref},na.tuplesRef=function(){return Ge(this.values)},na.extentRef=function(e,t){return ia(e,this,"extent","extent",t,!1)},na.domainRef=function(e,t){return ia(e,this,"domain","values",t,!1)},na.valuesRef=function(e,t,n){return ia(e,this,"vals","values",t,n||!0)},na.lookupRef=function(e,t){return ia(e,this,"lookup","tupleindex",t,!1)},na.indataRef=function(e,t){return ia(e,this,"indata","tupleindex",t,!0,!0)};var da=ua(Ye.stringValue(Pt),Ye.stringValue(jt),Ye.stringValue("center")),ca=ua('+(item.orient==="'+jt+'")','+(item.orient!=="'+Pt+'")',"0.5");function fa(e,t){e=Ye.isString(e)?{text:e}:e;var n,a,r,i=t.config.title,o=Ye.extend({},e.encode);return n={orient:jn("orient",e,i)},a=Ge(t.add(Qe(null,[n]))),o.name=e.name,o.interactive=e.interactive,r=function(e,t,n,a){var r,i,o,l,s,u={value:0},d=e.text,c=jn("orient",e,t),f=jn("anchor",e,t),p=c===Pt||c===zt?-1:1,g=c===zt||c===Dt,h={group:g?"width":"height"};l={field:h,mult:{signal:ca}},s=p<0?u:g?{field:{group:"height"}}:{field:{group:"width"}},r={enter:i={opacity:u},update:o={opacity:{value:1},text:kn(d),anchor:kn(f),orient:kn(c),extent:{field:h},align:{signal:da}},exit:{opacity:u}},g?(o.x=l,o.y=s,i.angle=u,i.baseline={value:c===zt?Dt:zt}):(o.x=s,o.y=l,i.angle={value:90*p},i.baseline={value:Dt});return Sn(r,"align",jn("align",e,t),"update"),Sn(r,"angle",jn("angle",e,t)),Sn(r,"baseline",jn("baseline",e,t)),Sn(r,"fill",jn("color",e,t)),Sn(r,"font",jn("font",e,t)),Sn(r,"fontSize",jn("fontSize",e,t)),Sn(r,"fontWeight",jn("fontWeight",e,t)),Sn(r,"frame",jn("frame",e,t)),Sn(r,"limit",jn("limit",e,t)),Sn(r,"offset",jn("offset",e,t)||0),Pn(Ln,xn,e.style||qt,null,a,r,n)}(e,i,o,a),e.zindex&&(r.zindex=e.zindex),la(r,t)}function pa(t,n){var a=[];t.transform&&t.transform.forEach(function(e){a.push(Xn(e,n))}),t.on&&t.on.forEach(function(e){oa(e,n,t.name)}),n.addDataPipeline(t.name,function(e,t,n){var a,r,i,o,l,s=[],u=null,d=!1,c=!1;e.values?s.push(u=ga({$ingest:e.values,$format:e.format})):e.url?(u=ke(e.url)||ke(e.format)?{$load:Ge(t.add((f=t,p=e,Ne({url:f.property(p.url),format:f.objectProperty(p.format)}))))}:{$request:e.url,$format:e.format},s.push(u=ga(u))):e.source&&(u=a=Ye.array(e.source).map(function(e){return Ge(t.getData(e).output)}),s.push(null));var f,p;for(r=0,i=n.length;r<i;++r)o=n[r],l=o.metadata,u||l.source||s.push(u=ga()),s.push(o),l.generates&&(c=!0),l.modifies&&!c&&(d=!0),l.source?u=o:l.changes&&(u=null);a&&(i=a.length-1,s[0]=rt({derive:d,pulse:i?a:a[0]}),(d||i)&&s.splice(1,0,ga()));u||s.push(ga());return s.push(lt({})),s}(t,n,a))}function ga(e){var t=Qe({},e);return t.metadata={source:!0},t}function ha(e,t){return{scale:e.scale,range:t}}function ma(e,t,n,a,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+a+","+r+")"}}function va(e,t){var n,a,r,i,o,l,s,u,d,c,f,p,g,h,m,v,y,b,x,k,S,R,w,O,z,P,j,D,$,_,E,V,A,F,W,L,C,M,q,B,T,N,U,I,X,Y,G,H,J,K,Q,Z,ee,te,ne,ae,re,ie,oe,le,se,ue,de,ce,fe,pe,ge,he,me,ve,ye,be,xe,ke,Se,Re,we,Oe,ze,Pe,je,De,$e,_e,Ee,Ve,Ae,Fe,We,Le,Ce,Me,qe,Be=(s=e,d=(u=t).config,c=s.orient,f=c===zt||c===Dt?d.axisX:d.axisY,p=d["axis"+c[0].toUpperCase()+c.slice(1)],g="band"===u.scaleType(s.scale)&&d.axisBand,f||p||g?Ye.extend({},d.axis,f,p,g):d.axis),Te=e.encode||{},Ne=Te.axis||{},Ue=Ne.name||void 0,Ie=Ne.interactive,Xe=Ne.style;return n={orient:e.orient,ticks:!!jn("ticks",e,Be),labels:!!jn("labels",e,Be),grid:!!jn("grid",e,Be),domain:!!jn("domain",e,Be),title:!!He(e.title,!1)},a=Ge(t.add(Qe({},[n]))),Ne=Rn({update:{range:{signal:'abs(span(range("'+e.scale+'")))'},offset:kn(He(e.offset,0)),position:kn(He(e.position,0)),titlePadding:kn(jn("titlePadding",e,Be)),minExtent:kn(jn("minExtent",e,Be)),maxExtent:kn(jn("maxExtent",e,Be))}},Te.axis,It),r=Ge(t.add(Ke({scale:t.scaleRef(e.scale),extra:t.property(jn("tickExtra",e,Be)),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),formatSpecifier:t.property(e.format)}))),l=[],n.grid&&l.push((h=e,m=Be,v=Te.grid,y=r,j=h.orient,D=h.gridScale,_=($=j===Pt||j===zt?1:-1)*h.offset||0,Sn(b={enter:x={opacity:E={value:0}},update:S={opacity:{value:1}},exit:k={opacity:E}},"stroke",jn("gridColor",h,m)),Sn(b,"strokeDash",jn("gridDash",h,m)),Sn(b,"strokeOpacity",jn("gridOpacity",h,m)),Sn(b,"strokeWidth",jn("gridWidth",h,m)),R={scale:h.scale,field:Lt,band:jn("bandPosition",h,m),round:jn("tickRound",h,m),extra:jn("tickExtra",h,m),offset:jn("tickOffset",h,m)},j===zt||j===Dt?(w="x",O="y",P="height"):(w="y",O="x",P="width"),z=O+"2",S[w]=x[w]=k[w]=R,D?(x[O]={scale:D,range:0,mult:$,offset:_},S[z]=x[z]={scale:D,range:1,mult:$,offset:_}):(x[O]={value:_},S[z]=x[z]={signal:P,mult:$,offset:_}),Pn(Fn,un,null,Lt,y,b,v))),n.ticks&&(i=jn("tickSize",e,Be),l.push((V=e,A=Be,F=Te.ticks,W=r,L=i,U=V.orient,I=U===Pt||U===zt?-1:1,Sn(C={enter:M={opacity:X={value:0}},update:B={opacity:{value:1}},exit:q={opacity:X}},"stroke",jn("tickColor",V,A)),Sn(C,"strokeOpacity",jn("tickOpacity",V,A)),Sn(C,"strokeWidth",jn("tickWidth",V,A)),(T=kn(L)).mult=I,N={scale:V.scale,field:Lt,band:jn("bandPosition",V,A),round:jn("tickRound",V,A),extra:jn("tickExtra",V,A),offset:jn("tickOffset",V,A)},U===zt||U===Dt?(B.y=M.y=X,B.y2=M.y2=T,B.x=M.x=q.x=N):(B.x=M.x=X,B.x2=M.x2=T,B.y=M.y=q.y=N),Pn(Fn,cn,null,Lt,W,C,F)))),n.labels&&(i=n.ticks?i:0,l.push((Y=e,G=Be,H=Te.labels,J=r,K=i,le=Y.orient,se=le===Pt||le===zt?-1:1,ue=le===zt||le===Dt,de=Y.scale,ce=Je(jn("labelFlush",Y,G)),fe=Je(jn("labelFlushOffset",Y,G)),pe=0===ce||!!ce,ge=jn("labelAlign",Y,G),he=jn("labelBaseline",Y,G),me={value:0},(ee=kn(K)).mult=se,ee.offset=kn(jn("labelPadding",Y,G)||0),ee.offset.mult=se,te={scale:de,field:Lt,band:.5,offset:jn("tickOffset",Y,G)},ue?(ne=ge||(pe?ma(de,ce,'"left"','"right"','"center"'):"center"),ae=he||(le===zt?"bottom":"top"),re=!ge):(ne=ge||(le===jt?"left":"right"),ae=he||(pe?ma(de,ce,'"top"','"bottom"','"middle"'):"middle"),re=!he),re=re&&pe&&fe?ma(de,ce,"-"+fe,fe,0):null,Sn(Q={enter:Z={opacity:me,x:ue?te:ee,y:ue?ee:te},update:{opacity:{value:1},text:{field:Et},x:Z.x,y:Z.y},exit:{opacity:me,x:Z.x,y:Z.y}},ue?"dx":"dy",re),Sn(Q,"align",ne),Sn(Q,"baseline",ae),Sn(Q,"angle",jn("labelAngle",Y,G)),Sn(Q,"fill",jn("labelColor",Y,G)),Sn(Q,"font",jn("labelFont",Y,G)),Sn(Q,"fontSize",jn("labelFontSize",Y,G)),Sn(Q,"fontWeight",jn("labelFontWeight",Y,G)),Sn(Q,"limit",jn("labelLimit",Y,G)),Sn(Q,"fillOpacity",jn("labelOpacity",Y,G)),ie=jn("labelBound",Y,G),oe=jn("labelOverlap",Y,G),Y=Pn(Ln,dn,Ct,Lt,J,Q,H),(oe||ie)&&(Y.overlap={method:oe,order:"datum.index",bound:ie?{scale:de,orient:le,tolerance:ie}:null}),Y))),n.domain&&l.push((ve=e,ye=Be,be=Te.domain,xe=a,Pe=ve.orient,Sn(ke={enter:Se={opacity:je={value:0}},update:Re={opacity:{value:1}},exit:{opacity:je}},"stroke",jn("domainColor",ve,ye)),Sn(ke,"strokeWidth",jn("domainWidth",ve,ye)),Sn(ke,"strokeOpacity",jn("domainOpacity",ve,ye)),Pe===zt||Pe===Dt?(we="x",ze="y"):(we="y",ze="x"),Oe=we+"2",Se[ze]=je,Re[we]=Se[we]=ha(ve,0),Re[Oe]=Se[Oe]=ha(ve,1),Pn(Fn,sn,null,null,xe,ke,be))),n.title&&l.push((De=e,$e=Be,_e=Te.title,Ee=a,Le=De.orient,Ce=Le===Pt||Le===zt?-1:1,Me=Le===zt||Le===Dt,Ve={enter:Ae={opacity:qe={value:0}},update:Fe={opacity:{value:1},text:kn(De.title)},exit:{opacity:qe}},We={scale:De.scale,range:.5},Me?(Fe.x=We,Ae.angle={value:0},Ae.baseline={value:Le===zt?"bottom":"top"}):(Fe.y=We,Ae.angle={value:90*Ce},Ae.baseline={value:"bottom"}),Sn(Ve,"align",jn("titleAlign",De,$e)),Sn(Ve,"angle",jn("titleAngle",De,$e)),Sn(Ve,"baseline",jn("titleBaseline",De,$e)),Sn(Ve,"fill",jn("titleColor",De,$e)),Sn(Ve,"font",jn("titleFont",De,$e)),Sn(Ve,"fontSize",jn("titleFontSize",De,$e)),Sn(Ve,"fontWeight",jn("titleFontWeight",De,$e)),Sn(Ve,"limit",jn("titleLimit",De,$e)),Sn(Ve,"fillOpacity",jn("titleOpacity",De,$e)),!Sn(Ve,"x",jn("titleX",De,$e),"update")&&Me&&!zn("x",_e)&&(Ve.enter.auto={value:!0}),!Sn(Ve,"y",jn("titleY",De,$e),"update")&&!Me&&!zn("y",_e)&&(Ve.enter.auto={value:!0}),Pn(Ln,fn,Mt,null,Ee,Ve,_e))),o=Bn(ln,Xe,Ue,a,Ie,Ne,l),e.zindex&&(o.zindex=e.zindex),la(o,t)}function ya(e,r,t){var n=Ye.array(e.signals),a=Ye.array(e.scales);return t||n.forEach(function(e){m(e,r)}),Ye.array(e.projections).forEach(function(e){!function(e,t){var n={};for(var a in e)"name"!==a&&(n[a]=Ot(e[a],a,t));t.addProjection(e.name,n)}(e,r)}),a.forEach(function(e){var t,n,a;n=r,a=(t=e).type||"linear",pt.hasOwnProperty(a)||Ye.error("Unrecognized scale type: "+Ye.stringValue(a)),n.addScale(t.name,{type:a,domain:void 0})}),Ye.array(e.data).forEach(function(e){pa(e,r)}),a.forEach(function(e){xt(e,r)}),n.forEach(function(e){$e(e,r)}),Ye.array(e.axes).forEach(function(e){va(e,r)}),Ye.array(e.marks).forEach(function(e){la(e,r)}),Ye.array(e.legends).forEach(function(e){sa(e,r)}),e.title&&fa(e.title,r),r.parseLambdas(),r}var ba=Ye.toSet(["width","height","padding","autosize"]);function xa(e,t){var n,a,r,i,o,l,s,u,d,c,f=t.config;return t.background=e.background||f.background,t.eventConfig=f.events,o=Ge(t.root=t.add(ce())),t.addSignal("width",e.width||0),t.addSignal("height",e.height||0),t.addSignal("padding",(l=e.padding,s=f,l=l||s.padding,Ye.isObject(l)?{top:h(l.top),bottom:h(l.bottom),left:h(l.left),right:h(l.right)}:{top:u=h(l),bottom:u,left:u,right:u})),t.addSignal("autosize",(d=e.autosize,c=f,d=d||c.autosize,Ye.isObject(d)?d:{type:d=d||"pad"})),Ye.array(e.signals).forEach(function(e){ba[e.name]||m(e,t)}),a=t.add(Qe()),r=Rn({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e.encode),r=t.add(We(wn(r,Vn,rn,e.style,t,{pulse:Ge(a)}))),i=t.add(ut({layout:t.objectProperty(e.layout),legendMargin:f.legendMargin,autosize:t.signalRef("autosize"),mark:o,pulse:Ge(r)})),t.operators.pop(),t.pushState(Ge(r),Ge(i),null),ya(e,t,!0),t.operators.push(i),n=t.add(Ve({mark:o,pulse:Ge(i)})),n=t.add(it({pulse:Ge(n)})),n=t.add(lt({pulse:Ge(n)})),t.addData("root",new ta(t,a,a,n)),t}function ka(e){this.config=e,this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.background=null,this.eventConfig=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function Sa(e){this.config=e.config,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}var Ra=ka.prototype=Sa.prototype;function wa(e){return(Ye.isArray(e)?function(e){for(var t,n="[",a=0,r=e.length;a<r;++a)t=e[a],n+=(0<a?",":"")+(Ye.isObject(t)?t.signal||wa(t):Ye.stringValue(t));return n+"]"}:function(e){var t,n,a="{",r=0;for(t in e)n=e[t],a+=(1<++r?",":"")+Ye.stringValue(t)+":"+(Ye.isObject(n)?n.signal||wa(n):Ye.stringValue(n));return a+"}"})(e)}function Oa(e){var r={padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:Da},area:{fill:Da},image:null,line:{stroke:Da,strokeWidth:ja},path:{stroke:Da},rect:{fill:Da},rule:{stroke:$a},shape:{stroke:Da},symbol:{fill:Da,size:64},text:{fill:$a,font:za,fontSize:11},style:{"guide-label":{fill:$a,font:za,fontSize:10},"guide-title":{fill:$a,font:za,fontSize:11,fontWeight:"bold"},"group-title":{fill:$a,font:za,fontSize:13,fontWeight:"bold"},point:{size:Pa,strokeWidth:ja,shape:"circle"},circle:{size:Pa,strokeWidth:ja},square:{size:Pa,strokeWidth:ja,shape:"square"},cell:{fill:"transparent",stroke:Ea}},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:_a,grid:!1,gridWidth:1,gridColor:Ea,labels:!0,labelAngle:0,labelLimit:180,labelPadding:2,ticks:!0,tickColor:_a,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titleAlign:"center",titlePadding:4},axisBand:{tickOffset:-1},legend:{orient:"right",offset:18,padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:Ea,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:_a,titleAlign:"left",titleBaseline:"top",titleLimit:180,titlePadding:5},title:{orient:"top",anchor:"middle",offset:4},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues",extent:[.2,1]},heatmap:{scheme:"viridis"},ramp:{scheme:"blues",extent:[.2,1]},diverging:{scheme:"blueorange"},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}};return(e||[]).forEach(function(e){var t,n,a;if(e)for(t in e)if("style"===t)for(t in a=r.style||(r.style={}),e.style)a[t]=Ye.extend(a[t]||{},e.style[t]);else n=e[t],r[t]=Ye.isObject(n)&&!Ye.isArray(n)?Ye.extend(Ye.isObject(r[t])?r[t]:{},n):n}),r}Ra.fork=function(){return new Sa(this)},Ra.isSubscope=function(){return 0<this._subid},Ra.toRuntime=function(){return this.finish(),{background:this.background,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig}},Ra.id=function(){return(this._subid?this._subid+":":0)+this._id++},Ra.add=function(t){return this.operators.push(t),t.id=this.id(),t.refs&&(t.refs.forEach(function(e){e.$ref=t.id}),t.refs=null),t},Ra.proxy=function(e){var t=e instanceof ue?Ge(e):e;return this.add(at({value:t}))},Ra.addStream=function(e){return this.streams.push(e),e.id=this.id(),e},Ra.addUpdate=function(e){return this.updates.push(e),e},Ra.finish=function(){var e,t;for(e in this.root&&(this.root.root=!0),this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(e,t,n){var a;e&&((a=e.data||(e.data={}))[t]||(a[t]=[])).push(n)}for(e in this.data)for(var a in n((t=this.data[e]).input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values"),t.index)n(t.index[a],e,"index:"+a);return this},Ra.pushState=function(e,t,n){this._encode.push(Ge(this.add(lt({pulse:e})))),this._parent.push(t),this._lookup.push(n?Ge(this.proxy(n)):null),this._markpath.push(-1)},Ra.popState=function(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},Ra.parent=function(){return Ye.peek(this._parent)},Ra.encode=function(){return Ye.peek(this._encode)},Ra.lookup=function(){return Ye.peek(this._lookup)},Ra.markpath=function(){var e=this._markpath;return++e[e.length-1]},Ra.fieldRef=function(e,t){if(Ye.isString(e))return pe(e,t);e.signal||Ye.error("Unsupported field reference: "+Ye.stringValue(e));var n,a=e.signal,r=this.field[a];return r||(n={name:this.signalRef(a)},t&&(n.as=t),this.field[a]=r=Ge(this.add(qe(n)))),r},Ra.compareRef=function(e,t){function n(e){return xe(e)?(r=!0,Ge(a[e.signal])):e}var a=this.signals,r=!1,i=Ye.array(e.field).map(n),o=Ye.array(e.order).map(n);return t&&i.push(fe),r?Ge(this.add(Ae({fields:i,orders:o}))):he(i,o)},Ra.keyRef=function(e,t){var n,a=this.signals,r=!1;return e=Ye.array(e).map(function(e){return xe(e)?(r=!0,Ge(a[e.signal])):e}),r?Ge(this.add(Be({fields:e,flat:t}))):(n={$key:e},t&&(n.$flat=!0),n)},Ra.sortRef=function(e){if(!e)return e;var t=[ve(e.op,e.field),fe],n=e.order||"ascending";return n.signal?Ge(this.add(Ae({fields:t,orders:[n=this.signalRef(n.signal),n]}))):he(t,[n,n])},Ra.event=function(e,t){var n=e+":"+t;if(!this.events[n]){var a=this.id();this.streams.push({id:a,source:e,type:t}),this.events[n]=a}return this.events[n]},Ra.addSignal=function(e,t){this.signals.hasOwnProperty(e)&&Ye.error("Duplicate signal name: "+Ye.stringValue(e));var n=t instanceof ue?t:this.add(ce(t));return this.signals[e]=n},Ra.getSignal=function(e){return this.signals[e]||Ye.error("Unrecognized signal name: "+Ye.stringValue(e)),this.signals[e]},Ra.signalRef=function(e){return this.signals[e]?Ge(this.signals[e]):(this.lambdas.hasOwnProperty(e)||(this.lambdas[e]=this.add(ce(null))),Ge(this.lambdas[e]))},Ra.parseLambdas=function(){for(var e=Object.keys(this.lambdas),t=0,n=e.length;t<n;++t){var a=e[t],r=Me(a,this),i=this.lambdas[a];i.params=r.$params,i.update=r.$expr}},Ra.property=function(e){return e&&e.signal?this.signalRef(e.signal):e},Ra.objectProperty=function(e){return e&&Ye.isObject(e)?this.signalRef(e.signal||wa(e)):e},Ra.exprRef=function(e,t){var n={expr:Me(e,this)};return t&&(n.expr.$name=t),Ge(this.add(Le(n)))},Ra.addBinding=function(e,t){this.bindings||Ye.error("Nested signals do not support binding: "+Ye.stringValue(e)),this.bindings.push(Ye.extend({signal:e},t))},Ra.addScaleProj=function(e,t){this.scales.hasOwnProperty(e)&&Ye.error("Duplicate scale or projection name: "+Ye.stringValue(e)),this.scales[e]=this.add(t)},Ra.addScale=function(e,t){this.addScaleProj(e,ot(t))},Ra.addProjection=function(e,t){this.addScaleProj(e,nt(t))},Ra.getScale=function(e){return this.scales[e]||Ye.error("Unrecognized scale name: "+Ye.stringValue(e)),this.scales[e]},Ra.projectionRef=Ra.scaleRef=function(e){return Ge(this.getScale(e))},Ra.projectionType=Ra.scaleType=function(e){return this.getScale(e).params.type},Ra.addData=function(e,t){return this.data.hasOwnProperty(e)&&Ye.error("Duplicate data set name: "+Ye.stringValue(e)),this.data[e]=t},Ra.getData=function(e){return this.data[e]||Ye.error("Undefined data set name: "+Ye.stringValue(e)),this.data[e]},Ra.addDataPipeline=function(e,t){return this.data.hasOwnProperty(e)&&Ye.error("Duplicate data set name: "+Ye.stringValue(e)),this.addData(e,ta.fromEntries(this,t))};var za="sans-serif",Pa=30,ja=2,Da="#4c78a8",$a="#000",_a="#888",Ea="#ddd";e.formatLocale=n.formatDefaultLocale,e.timeFormatLocale=a.timeFormatDefaultLocale,e.parse=function(e,t){return Ye.isObject(e)||Ye.error("Input Vega specification must be an object."),xa(e,new ka(Oa([t,e.config]))).toRuntime()},e.config=Oa,e.signal=m,e.signalUpdates=$e,e.stream=Re,e.codeGenerator=le,e.functionContext=ne,e.expressionFunction=ie,e.MarkRole=an,e.FrameRole=rn,e.ScopeRole=on,e.AxisRole=ln,e.AxisDomainRole=sn,e.AxisGridRole=un,e.AxisLabelRole=dn,e.AxisTickRole=cn,e.AxisTitleRole=fn,e.LegendRole=pn,e.LegendEntryRole=hn,e.LegendLabelRole=vn,e.LegendSymbolRole=yn,e.LegendTitleRole=bn,e.Scope=ka,e.DataScope=ta,Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "vega-parser",
"version": "3.7.1",
"version": "3.7.2",
"description": "Parse Vega specifications to runtime dataflows.",

@@ -42,3 +42,3 @@ "keywords": [

"vega-scale": "^2.4.0",
"vega-scenegraph": "^3.2.1",
"vega-scenegraph": "^3.2.2",
"vega-statistics": "^1.2.1",

@@ -45,0 +45,0 @@ "vega-util": "^1.7.0"

@@ -109,2 +109,3 @@ import {

enter: {
noBound: {value: true}, // ignore width/height in bounds calc
width: zero,

@@ -111,0 +112,0 @@ height: height ? encoder(height) : zero,

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc