vega-parser
Advanced tools
Comparing version 5.8.2 to 5.8.3
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vega-util"),require("vega-expression"),require("vega-functions"),require("vega-event-selector"),require("vega-scale"),require("vega-dataflow")):"function"==typeof define&&define.amd?define(["exports","vega-util","vega-expression","vega-functions","vega-event-selector","vega-scale","vega-dataflow"],t):t((e=e||self).vega={},e.vega,e.vega,e.vega,e.vega,e.vega,e.vega)}(this,function(e,t,n,i,a,r,o){"use strict";function l(e){return+e||0}var s="outer",u=["value","update","init","react","bind"];function d(e,n){t.error(e+' for "outer" push: '+t.stringValue(n))}function c(e,t){var n=e.name;if(e.push===s)t.signals[n]||d("No prior signal definition",n),u.forEach(function(t){void 0!==e[t]&&d("Invalid property ",t)});else{var i=t.addSignal(n,e.value);!1===e.react&&(i.react=!1),e.bind&&t.addBinding(n,e.bind)}}function f(e,a,r){var o,l,s={};try{e=t.isString(e)?e:t.stringValue(e)+"",o=n.parse(e)}catch(n){t.error("Expression parse error: "+e)}return o.visit(function(e){if(e.type===n.CallExpression){var t=e.callee.name,r=i.codegenParams.visitors[t];r&&r(t,e.arguments,a,s)}}),(l=i.codeGenerator(o)).globals.forEach(function(e){var n=i.SignalPrefix+e;!t.hasOwnProperty(s,n)&&a.getSignal(e)&&(s[n]=a.signalRef(e))}),{$expr:r?r+"return("+l.code+");":l.code,$fields:l.fields,$params:s}}function p(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function g(e,t,n,i){return new p(e,t,n,i)}function h(e,t){return g("operator",e,t)}function m(e){var t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function y(e,t){return t?{$field:e,$name:t}:{$field:e}}var v=y("key");function b(e,t){return{$compare:e,$order:t}}var x="descending";function k(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}var S="scope",$="view";function O(e){return e&&e.signal}function R(e){if(O(e))return!0;if(t.isObject(e))for(var n in e)if(R(e[n]))return!0;return!1}function j(e,t){return null!=e?e:t}function w(e){return e&&e.signal||e}var z="timer";function V(e,n){return(e.merge?D:e.stream?P:e.type?_:t.error("Invalid stream specification: "+t.stringValue(e)))(e,n)}function D(e,t){var n=E({merge:e.merge.map(e=>V(e,t))},e,t);return t.addStream(n).id}function P(e,t){var n=E({stream:V(e.stream,t)},e,t);return t.addStream(n).id}function _(e,t){var n,i,a;return e.type===z?(n=t.event(z,e.throttle),e={between:e.between,filter:e.filter}):n=t.event((a=e.source)===S?$:a||$,e.type),i=E({stream:n},e,t),1===Object.keys(i).length?n:t.addStream(i).id}function E(e,n,i){var a,r,o,l,s=n.between;return s&&(2!==s.length&&t.error('Stream "between" parameter must have 2 entries: '+t.stringValue(n)),e.between=[V(s[0],i),V(s[1],i)]),s=n.filter?[].concat(n.filter):[],(n.marktype||n.markname||n.markrole)&&s.push((a=n.marktype,r=n.markname,o=n.markrole,(l="event.item")+(a&&"*"!==a?"&&"+l+".mark.marktype==='"+a+"'":"")+(o?"&&"+l+".mark.role==='"+o+"'":"")+(r?"&&"+l+".mark.name==='"+r+"'":""))),n.source===S&&s.push("inScope(event.item)"),s.length&&(e.filter=f("("+s.join(")&&(")+")").$expr),null!=(s=n.throttle)&&(e.throttle=+s),null!=(s=n.debounce)&&(e.debounce=+s),n.consume&&(e.consume=!0),e}var W="var datum=event.item&&event.item.datum;";function C(e,n,i){var r=e.events,o=e.update,l=e.encode,s=[],u={target:i};r||t.error("Signal update missing events specification."),t.isString(r)&&(r=a.selector(r,n.isSubscope()?S:$)),r=t.array(r).filter(e=>e.signal||e.scale?(s.push(e),0):1),s.length>1&&(s=[A(s)]),r.length&&s.push(r.length>1?{merge:r}:r[0]),null!=l&&(o&&t.error("Signal encode and update are mutually exclusive."),o="encode(item(),"+t.stringValue(l)+")"),u.update=t.isString(o)?f(o,n,W):null!=o.expr?f(o.expr,n,W):null!=o.value?o.value:null!=o.signal?{$expr:"_.value",$params:{value:n.signalRef(o.signal)}}:t.error("Invalid signal update specification."),e.force&&(u.options={force:!0}),s.forEach(function(e){n.addUpdate(t.extend(function(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):V(e,t)}}(e,n),u))})}function A(e){return{signal:"["+e.map(e=>e.scale?'scale("'+e.scale+'")':e.signal)+"]"}}function L(e,n){var i=n.getSignal(e.name),a=e.update;e.init&&(a?t.error("Signals can not include both init and update expressions."):(a=e.init,i.initonly=!0)),a&&(a=f(a,n),i.update=a.$expr,i.params=a.$params),e.on&&e.on.forEach(function(e){C(e,n,i.id)})}function F(e){return function(t,n,i){return g(e,n,t||void 0,i)}}var T=F("aggregate"),M=F("axisticks"),B=F("bound"),U=F("collect"),q=F("compare"),I=F("datajoin"),N=F("encode"),G=F("expression"),X=F("facet"),Y=F("field"),H=F("key"),Q=F("legendentries"),J=F("load"),K=F("mark"),Z=F("multiextent"),ee=F("multivalues"),te=F("overlap"),ne=F("params"),ie=F("prefacet"),ae=F("projection"),re=F("proxy"),oe=F("relay"),le=F("render"),se=F("scale"),ue=F("sieve"),de=F("sortitems"),ce=F("viewlayout"),fe=F("values"),pe=0,ge={min:"min",max:"max",count:"sum"};function he(e,n){var i,a,o=n.getScale(e.name).params;for(i in o.domain=be(e.domain,e,n),null!=e.range&&(o.range=function e(n,i,a){var o=n.range,l=i.config.range;if(o.signal)return i.signalRef(o.signal);if(t.isString(o)){if(l&&t.hasOwnProperty(l,o))return n=t.extend({},n,{range:l[o]}),e(n,i,a);"width"===o?o=[0,{signal:"width"}]:"height"===o?o=r.isDiscrete(n.type)?[0,{signal:"height"}]:[{signal:"height"},0]:t.error("Unrecognized scale range value: "+t.stringValue(o))}else{if(o.scheme)return a.scheme=t.isArray(o.scheme)?ye(o.scheme,i):me(o.scheme,i),o.extent&&(a.schemeExtent=ye(o.extent,i)),void(o.count&&(a.schemeCount=me(o.count,i)));if(o.step)return void(a.rangeStep=me(o.step,i));if(r.isDiscrete(n.type)&&!t.isArray(o))return be(o,n,i);t.isArray(o)||t.error("Unsupported range type: "+t.stringValue(o))}return o.map(e=>(t.isArray(e)?ye:me)(e,i))}(e,n,o)),null!=e.interpolate&&function(e,t){t.interpolate=me(e.type||e),null!=e.gamma&&(t.interpolateGamma=me(e.gamma))}(e.interpolate,o),null!=e.nice&&(o.nice=(a=e.nice,t.isObject(a)?{interval:me(a.interval),step:me(a.step)}:me(a))),null!=e.bins&&(o.bins=function(e,n){return e.signal||t.isArray(e)?ye(e,n):n.objectProperty(e)}(e.bins,n)),e)t.hasOwnProperty(o,i)||"name"===i||(o[i]=me(e[i],n))}function me(e,n){return t.isObject(e)?e.signal?n.signalRef(e.signal):t.error("Unsupported object: "+t.stringValue(e)):e}function ye(e,t){return e.signal?t.signalRef(e.signal):e.map(e=>me(e,t))}function ve(e){t.error("Can not find data set: "+t.stringValue(e))}function be(e,n,i){if(e)return e.signal?i.signalRef(e.signal):(t.isArray(e)?xe:e.fields?Se:ke)(e,n,i);null==n.domainMin&&null==n.domainMax||t.error("No scale domain defined for domainMin/domainMax to override.")}function xe(e,t,n){return e.map(function(e){return me(e,n)})}function ke(e,t,n){var i=n.getData(e.data);return i||ve(e.data),r.isDiscrete(t.type)?i.valuesRef(n,e.field,Oe(e.sort,!1)):r.isQuantile(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function Se(e,n,i){var a=e.data,o=e.fields.reduce(function(e,n){return n=t.isString(n)?{data:a,field:n}:t.isArray(n)||n.signal?function(e,n){var i="_:vega:_"+pe++,a=U({});if(t.isArray(e))a.value={$ingest:e};else if(e.signal){var r="setdata("+t.stringValue(i)+","+e.signal+")";a.params.input=n.signalRef(r)}return n.addDataPipeline(i,[a,ue({})]),{data:i,field:"data"}}(n,i):n,e.push(n),e},[]);return(r.isDiscrete(n.type)?$e:r.isQuantile(n.type)?Re:je)(e,i,o)}function $e(e,t,n){var i,a,r,o,l,s=Oe(e.sort,!0);return i=n.map(function(e){var n=t.getData(e.data);return n||ve(e.data),n.countsRef(t,e.field,s)}),a={groupby:v,pulse:i},s&&(r=s.op||"count",l=s.field?k(r,s.field):"count",a.ops=[ge[r]],a.fields=[t.fieldRef(l)],a.as=[l]),r=t.add(T(a)),o=t.add(U({pulse:m(r)})),l=t.add(fe({field:v,sort:t.sortRef(s),pulse:m(o)})),m(l)}function Oe(e,n){return e&&(e.field||e.op?e.field||"count"===e.op?n&&e.field&&e.op&&!ge[e.op]&&t.error("Multiple domain scales can not be sorted using "+e.op):t.error("No field provided for sort aggregate op: "+e.op):t.isObject(e)?e.field="key":e={field:"key"}),e}function Re(e,t,n){var i=n.map(function(e){var n=t.getData(e.data);return n||ve(e.data),n.domainRef(t,e.field)});return m(t.add(ee({values:i})))}function je(e,t,n){var i=n.map(function(e){var n=t.getData(e.data);return n||ve(e.data),n.extentRef(t,e.field)});return m(t.add(Z({extents:i})))}function we(e,n,i){return t.isArray(e)?e.map(function(e){return we(e,n,i)}):t.isObject(e)?e.signal?i.signalRef(e.signal):"fit"===n?e:t.error("Unsupported parameter object: "+t.stringValue(e)):e}const ze="top",Ve="left",De="right",Pe="bottom",_e="vertical",Ee="start",We="end",Ce="index",Ae="label",Le="offset",Fe="perc",Te="perc2",Me="size",Be="value",Ue="guide-label",qe="guide-title",Ie="group-title",Ne="symbol",Ge="gradient",Xe="discrete",Ye=["size","shape","fill","stroke","strokeWidth","strokeDash","opacity"],He={name:1,interactive:1},Qe={value:0},Je={value:1};var Ke=t.toSet(["rule"]),Ze=t.toSet(["group","image","rect"]);function et(e,n,i,a){var r=f(e,n);return r.$fields.forEach(function(e){a[e]=1}),t.extend(i,r.$params),r.$expr}function tt(e,n,i,a){return function e(n,i,a,r){var o,l,s;if(n.signal)o="datum",s=et(n.signal,i,a,r);else if(n.group||n.parent){for(l=Math.max(1,n.level||1),o="item";l-- >0;)o+=".mark.group";n.parent?(s=n.parent,o+=".datum"):s=n.group}else n.datum?(o="datum",s=n.datum):t.error("Invalid field reference: "+t.stringValue(n));n.signal||(t.isString(s)?(r[s]=1,s=t.splitAccessPath(s).map(t.stringValue).join("][")):s=e(s,i,a,r));return o+"["+s+"]"}(t.isObject(e)?e:{datum:e},n,i,a)}function nt(e,n,i,a,r){var o,l,s,u=it(e.scale,i,a,r);return null!=e.range?(l=u+".range()",n=0===(o=+e.range)?l+"[0]":"($="+l+","+(1===o?"$[$.length-1]":"$[0]+"+o+"*($[$.length-1]-$[0])")+")"):(void 0!==n&&(n=u+"("+n+")"),e.band&&(s=function(e,n){if(!t.isString(e))return-1;var i=n.scaleType(e);return"band"===i||"point"===i?1:0}(e.scale,i))&&(o=(l=u+".bandwidth")+"()"+(1===(o=+e.band)?"":"*"+o),s<0&&(o="("+l+"?"+o+":0)"),n=(n?n+"+":"")+o,e.extra&&(n="(datum.extra?"+u+"(datum.extra.value):"+n+")")),null==n&&(n="0")),n}function it(e,n,a,r){var o;if(t.isString(e))o=i.ScalePrefix+e,t.hasOwnProperty(a,o)||(a[o]=n.scaleRef(e)),o=t.stringValue(o);else{for(o in n.scales)a[i.ScalePrefix+o]=n.scaleRef(o);o=t.stringValue(i.ScalePrefix)+"+"+(e.signal?"("+et(e.signal,n,a,r)+")":tt(e,n,a,r))}return"_["+o+"]"}function at(e,n,i,a){return t.isObject(e)?"("+rt(null,e,n,i,a)+")":e}function rt(e,n,i,a,r){if(null!=n.gradient)return function(e,n,i,a){return"this.gradient("+it(e.gradient,n,i,a)+","+t.stringValue(e.start)+","+t.stringValue(e.stop)+","+t.stringValue(e.count)+")"}(n,i,a,r);var o=n.signal?et(n.signal,i,a,r):n.color?function(e,t,n,i){function a(e,a,r,o){return"this."+e+"("+[rt(null,a,t,n,i),rt(null,r,t,n,i),rt(null,o,t,n,i)].join(",")+").toString()"}return e.c?a("hcl",e.h,e.c,e.l):e.h||e.s?a("hsl",e.h,e.s,e.l):e.l||e.a?a("lab",e.l,e.a,e.b):e.r||e.g||e.b?a("rgb",e.r,e.g,e.b):null}(n.color,i,a,r):null!=n.field?tt(n.field,i,a,r):void 0!==n.value?t.stringValue(n.value):void 0;return null!=n.scale&&(o=nt(n,o,i,a,r)),void 0===o&&(o=null),null!=n.exponent&&(o="Math.pow("+o+","+at(n.exponent,i,a,r)+")"),null!=n.mult&&(o+="*"+at(n.mult,i,a,r)),null!=n.offset&&(o+="+"+at(n.offset,i,a,r)),n.round&&(o="Math.round("+o+")"),o}function ot(e,n,i){const a=e+"["+t.stringValue(n)+"]";return`$=${i};if(${a}!==$)${a}=$,m=1;`}function lt(e,n,i,a,r){var o="";return n.forEach(function(e){var t=rt(0,e,i,a,r);o+=e.test?et(e.test,i,a,r)+"?"+t+":":t}),":"===t.peek(o)&&(o+="null"),ot("o",e,o)}function st(e,n,i,a){var r,o,l={},s="var o=item,datum=o.datum,m=0,$;";for(r in e)o=e[r],t.isArray(o)?s+=lt(r,o,a,i,l):s+=ot("o",r,rt(0,o,a,i,l));return s+=function(e,t){var n="";return Ke[t]?n:(e.x2&&(e.x?(Ze[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(Ze[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;"),n)}(e,n),{$expr:s+="return m;",$fields:Object.keys(l),$output:Object.keys(e)}}var ut="mark",dt="frame",ct="scope",ft="axis",pt="axis-domain",gt="axis-grid",ht="axis-label",mt="axis-tick",yt="axis-title",vt="legend",bt="legend-band",xt="legend-entry",kt="legend-gradient",St="legend-label",$t="legend-symbol",Ot="legend-title",Rt="title";function jt(e){return t.isObject(e)?t.extend({},e):{value:e}}function wt(e,n,i,a){return null!=i?(t.isObject(i)&&!t.isArray(i)?e.update[n]=i:e[a||"enter"][n]={value:i},1):0}function zt(e,t,n){for(let n in t)wt(e,n,t[n]);for(let t in n)wt(e,t,n[t],"update")}function Vt(e,n,i){for(var a in n)i&&t.hasOwnProperty(i,a)||(e[a]=t.extend(e[a]||{},n[a]));return e}function Dt(e,n,i,a,r,o){var l,s;for(s in(o=o||{}).encoders={$encode:l={}},e=function(e,n,i,a,r){var o,l,s,u={},d={};"legend"!=i&&0!==String(i).indexOf("axis")||(i=null);for(l in s=i===dt?r.group:i===ut?t.extend({},r.mark,r[n]):null)_t(l,e)||("fill"===l||"stroke"===l)&&(_t("fill",e)||_t("stroke",e))||Pt(u,l,s[l]);for(l in t.array(a).forEach(function(t){var n=r.style&&r.style[t];for(var i in n)_t(i,e)||Pt(u,i,n[i])}),e=t.extend({},e),u)(s=u[l]).signal?(o=o||{})[l]=s:d[l]=s;e.enter=t.extend(d,e.enter),o&&(e.update=t.extend(o,e.update));return e}(e,n,i,a,r.config))l[s]=st(e[s],n,o,r);return o}function Pt(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}function _t(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}function Et(e,t,n,i,a,r,o){return{type:e,name:o?o.name:void 0,role:t,style:o&&o.style||n,key:i,from:a,interactive:!(!o||!o.interactive),encode:Vt(r,o,He)}}function Wt(e,t){const n=n=>j(e[n],t[n]);return n.isVertical=n=>_e===j(e.direction,t.direction||(n?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>j(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>j(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>j(e.columns,j(t.columns,+n.isVertical(!0))),n}function Ct(e,t){var n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function At(e,t,n){return`item.anchor === "${Ee}" ? ${e} : item.anchor === "${We}" ? ${t} : ${n}`}const Lt=At(t.stringValue(Ve),t.stringValue(De),t.stringValue("center"));var Ft="group",Tt="rect",Mt="rule",Bt="symbol",Ut="text";function qt(e,n,i,a){var r,o,l,s,u,d,c=Wt(e,i),f=c.isVertical(),p=c.gradientThickness(),g=c.gradientLength();return f?(l=[0,1],s=[0,0],u=p,d=g):(l=[0,0],s=[1,0],u=g,d=p),zt(r={enter:o={opacity:Qe,x:Qe,y:Qe,width:jt(u),height:jt(d)},update:t.extend({},o,{opacity:Je,fill:{gradient:n,start:l,stop:s}}),exit:{opacity:Qe}},{stroke:c("gradientStrokeColor"),strokeWidth:c("gradientStrokeWidth")},{opacity:c("gradientOpacity")}),Et(Tt,kt,null,void 0,void 0,r,a)}function It(e,n,i,a,r){var o,l,s,u,d,c,f=Wt(e,i),p=f.isVertical(),g=f.gradientThickness(),h=f.gradientLength(),m="";return p?(s="y",d="y2",u="x",c="width",m="1-"):(s="x",d="x2",u="y",c="height"),(l={opacity:Qe,fill:{scale:n,field:Be}})[s]={signal:m+"datum."+Fe,mult:h},l[u]=Qe,l[d]={signal:m+"datum."+Te,mult:h},l[c]=jt(g),zt(o={enter:l,update:t.extend({},l,{opacity:Je}),exit:{opacity:Qe}},{stroke:f("gradientStrokeColor"),strokeWidth:f("gradientStrokeWidth")},{opacity:f("gradientOpacity")}),Et(Tt,bt,null,Be,r,o,a)}const Nt=`datum.${Fe}<=0?"${Ve}":datum.${Fe}>=1?"${De}":"center"`,Gt=`datum.${Fe}<=0?"${Pe}":datum.${Fe}>=1?"${ze}":"middle"`;function Xt(e,t,n,i){var a,r,o,l,s,u=Wt(e,t),d=u.isVertical(),c=jt(u.gradientThickness()),f=u.gradientLength(),p=u("labelOverlap"),g=u("labelSeparation"),h="";return zt(a={enter:r={opacity:Qe},update:o={opacity:Je,text:{field:Ae}},exit:{opacity:Qe}},{fill:u("labelColor"),fillOpacity:u("labelOpacity"),font:u("labelFont"),fontSize:u("labelFontSize"),fontStyle:u("labelFontStyle"),fontWeight:u("labelFontWeight"),limit:j(e.labelLimit,t.gradientLabelLimit)}),d?(r.align={value:"left"},r.baseline=o.baseline={signal:Gt},l="y",s="x",h="1-"):(r.align=o.align={signal:Nt},r.baseline={value:"top"},l="x",s="y"),r[l]=o[l]={signal:h+"datum."+Fe,mult:f},r[s]=o[s]=c,c.offset=j(e.labelOffset,t.gradientLabelOffset)||0,e=Et(Ut,St,Ue,Be,i,a,n),p&&(e.overlap={separation:g,method:p,order:"datum."+Ce}),e}function Yt(e,t,n,i,a,r,o,l){return{type:Ft,name:n,role:e,style:t,from:i,interactive:a||!1,encode:r,marks:o,layout:l}}function Ht(e,t,n,i,a){var r,o,l,s,u,d,c,f=Wt(e,t),p=n.entries,g=!(!p||!p.interactive),h=p?p.name:void 0,m=f("clipHeight"),y=f("symbolOffset"),v={data:"value"},b={},x=`${a} ? datum.${Le} : datum.${Me}`,k=m?jt(m):{field:Me},S=`datum.${Ce}`,$=`max(1, ${a})`;return k.mult=.5,b={enter:r={opacity:Qe,x:{signal:x,mult:.5,offset:y},y:k},update:o={opacity:Je,x:r.x,y:r.y},exit:{opacity:Qe}},e.fill||zt(b,{fill:t.symbolBaseFillColor,stroke:t.symbolBaseStrokeColor}),zt(b,{fill:f("symbolFillColor"),shape:f("symbolType"),size:f("symbolSize"),stroke:f("symbolStrokeColor"),strokeDash:f("symbolDash"),strokeDashOffset:f("symbolDashOffset"),strokeWidth:f("symbolStrokeWidth")},{opacity:f("symbolOpacity")}),Ye.forEach(function(t){e[t]&&(o[t]=r[t]={scale:e[t],field:Be})}),s=Et(Bt,$t,null,Be,v,b,n.symbols),m&&(s.clip=!0),(l=jt(y)).offset=f("labelOffset"),zt(b={enter:r={opacity:Qe,x:{signal:x,offset:l},y:k},update:o={opacity:Je,text:{field:Ae},x:r.x,y:r.y},exit:{opacity:Qe}},{align:f("labelAlign"),baseline:f("labelBaseline"),fill:f("labelColor"),fillOpacity:f("labelOpacity"),font:f("labelFont"),fontSize:f("labelFontSize"),fontStyle:f("labelFontStyle"),fontWeight:f("labelFontWeight"),limit:f("labelLimit")}),u=Et(Ut,St,Ue,Be,v,b,n.labels),b={enter:{noBound:{value:!m},width:Qe,height:m?jt(m):Qe,opacity:Qe},exit:{opacity:Qe},update:o={opacity:Je,row:{signal:null},column:{signal:null}}},f.isVertical(!0)?(d=`ceil(item.mark.items.length / ${$})`,o.row.signal=`${S}%${d}`,o.column.signal=`floor(${S} / ${d})`,c={field:["row",S]}):(o.row.signal=`floor(${S} / ${$})`,o.column.signal=`${S} % ${$}`,c={field:S}),o.column.signal=`${a}?${o.column.signal}:${S}`,(e=Yt(ct,null,h,i={facet:{data:i,name:"value",groupby:Ce}},g,Vt(b,p,He),[s,u])).sort=c,e}const Qt='item.orient === "left"',Jt='item.orient === "right"',Kt=`(${Qt} || ${Jt})`,Zt=`datum.vgrad && ${Kt}`,en=At('"top"','"bottom"','"middle"'),tn=`datum.vgrad && ${Jt} ? (${At('"right"','"left"','"center"')}) : (${Kt} && !(datum.vgrad && ${Qt})) ? "left" : ${Lt}`,nn=`item._anchor || (${Kt} ? "middle" : "start")`,an=`${Zt} ? (${Qt} ? -90 : 90) : 0`,rn=`${Kt} ? (datum.vgrad ? (${Jt} ? "bottom" : "top") : ${en}) : "top"`;function on(e,n){var i;return t.isObject(e)&&(e.signal?i=e.signal:e.path?i="pathShape("+ln(e.path)+")":e.sphere&&(i="geoShape("+ln(e.sphere)+', {type: "Sphere"})')),i?n.signalRef(i):!!e}function ln(e){return t.isObject(e)&&e.signal?e.signal:t.stringValue(e)}function sn(e){var t=e.role||"";return t.indexOf("axis")&&t.indexOf("legend")?e.type===Ft?ct:t||ut:t}function un(e){return{marktype:e.type,name:e.name||void 0,role:e.role||sn(e),zindex:+e.zindex||void 0}}function dn(e,t){return e&&e.signal?t.signalRef(e.signal):!1!==e}function cn(e,n){var i=o.definition(e.type);i||t.error("Unrecognized transform type: "+t.stringValue(e.type));var a=g(i.type.toLowerCase(),null,fn(i,e,n));return e.signal&&n.addSignal(e.signal,n.proxy(a)),a.metadata=i.metadata||{},a}function fn(e,t,n){var i,a,r,o={};for(a=0,r=e.params.length;a<r;++a)o[(i=e.params[a]).name]=pn(i,t,n);return o}function pn(e,n,i){var a=e.type,r=n[e.name];return"index"===a?function(e,n,i){t.isString(n.from)||t.error('Lookup "from" parameter must be a string literal.');return i.getData(n.from).lookupRef(i,n.key)}(0,n,i):void 0!==r?"param"===a?function(e,n,i){var a=n[e.name];return e.array?(t.isArray(a)||t.error("Expected an array of sub-parameters. Instead: "+t.stringValue(a)),a.map(function(t){return hn(e,t,i)})):hn(e,a,i)}(e,n,i):"projection"===a?i.projectionRef(n[e.name]):e.array&&!O(r)?r.map(function(t){return gn(e,t,i)}):gn(e,r,i):void(e.required&&t.error("Missing required "+t.stringValue(n.type)+" parameter: "+t.stringValue(e.name)))}function gn(e,n,i){var a=e.type;if(O(n))return mn(a)?t.error("Expression references can not be signals."):yn(a)?i.fieldRef(n):vn(a)?i.compareRef(n):i.signalRef(n.signal);var r,o=e.expr||yn(a);return o&&((r=n)&&r.expr)?i.exprRef(n.expr,n.as):o&&function(e){return e&&e.field}(n)?y(n.field,n.as):mn(a)?f(n,i):function(e){return"data"===e}(a)?m(i.getData(n).values):yn(a)?y(n):vn(a)?i.compareRef(n):n}function hn(e,n,i){var a,r,o,l,s;for(l=0,s=e.params.length;l<s;++l){for(o in(r=e.params[l]).key)if(r.key[o]!==n[o]){r=null;break}if(r)break}return r||t.error("Unsupported parameter: "+t.stringValue(n)),a=t.extend(fn(r,n,i),r.key),m(i.add(ne(a)))}function mn(e){return"expr"===e}function yn(e){return"field"===e}function vn(e){return"compare"===e}function bn(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:m(t.getData(e.data).output)}function xn(e,t,n,i,a){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=a,this.index={}}xn.fromEntries=function(e,t){var n=t.length,i=1,a=t[0],r=t[n-1],o=t[n-2],l=null;for(a&&"load"===a.type&&(a=t[1]),e.add(t[0]);i<n;++i)t[i].params.pulse=m(t[i-1]),e.add(t[i]),"aggregate"===t[i].type&&(l=t[i]);return new xn(e,a,o,r,l)};var kn=xn.prototype;function Sn(e){return t.isString(e)?e:null}function $n(e,t,n){var i,a=k(n.op,n.field);if(t.ops){for(var r=0,o=t.as.length;r<o;++r)if(t.as[r]===a)return}else t.ops=["count"],t.fields=[null],t.as=["count"];n.op&&(t.ops.push((i=n.op.signal)?e.signalRef(i):n.op),t.fields.push(e.fieldRef(n.field)),t.as.push(a))}function On(e,n,i,a,r,o,l){var s,u,d=n[i]||(n[i]={}),c=function(e){return t.isObject(e)?(e.order===x?"-":"+")+k(e.op,e.field):""}(o),f=Sn(r);if(null!=f&&(e=n.scope,s=d[f+=c?"|"+c:""]),!s){var p=o?{field:v,pulse:n.countsRef(e,r,o)}:{field:e.fieldRef(r),pulse:m(n.output)};c&&(p.sort=e.sortRef(o)),u=e.add(g(a,void 0,p)),l&&(n.index[r]=u),s=m(u),null!=f&&(d[f]=s)}return s}function Rn(e,t,n){var i,a=e.remove,r=e.insert,o=e.toggle,l=e.modify,s=e.values,u=t.add(h());i=f("if("+e.trigger+',modify("'+n+'",'+[r,a,o,l,s].map(function(e){return null==e?"null":e}).join(",")+"),0)",t),u.update=i.$expr,u.params=i.$params}function jn(e,n){var i,a,r,o,l,s,u,d,c,f,p,g,h,v,b=sn(e),x=e.type===Ft,k=e.from&&e.from.facet,S=e.layout||b===ct||b===dt,$=b===ut||S||k,R=e.overlap;r=function(e,n,i){var a,r,o,l,s;return e?(a=e.facet)&&(n||t.error("Only group marks can be faceted."),null!=a.field?l=s=bn(a,i):(e.data?s=m(i.getData(e.data).aggregate):((o=cn(t.extend({type:"aggregate",groupby:t.array(a.groupby)},a.aggregate),i)).params.key=i.keyRef(a.groupby),o.params.pulse=bn(a,i),l=s=m(i.add(o))),r=i.keyRef(a.groupby,!0))):l=m(i.add(U(null,[{}]))),l||(l=bn(e,i)),{key:r,pulse:l,parent:s}}(e.from,x,n),f=m(a=n.add(I({key:r.key||(e.key?y(e.key):void 0),pulse:r.pulse,clean:!x}))),a=o=n.add(U({pulse:f})),a=n.add(K({markdef:un(e),interactive:dn(e.interactive,n),clip:on(e.clip,n),context:{$context:!0},groups:n.lookup(),parent:n.signals.parent?n.signalRef("parent"):null,index:n.markpath(),pulse:m(a)})),p=m(a),(a=l=n.add(N(Dt(e.encode,e.type,b,e.style,n,{mod:!1,pulse:p})))).params.parent=n.encode(),e.transform&&e.transform.forEach(function(e){const i=cn(e,n),r=i.metadata;(r.generates||r.changes)&&t.error("Mark transforms should not generate new data."),r.nomod||(l.params.mod=!0),i.params.pulse=m(a),n.add(a=i)}),e.sort&&(a=n.add(de({sort:n.compareRef(e.sort),pulse:m(a)}))),g=m(a),(k||S)&&(h=m(S=n.add(ce({layout:n.objectProperty(e.layout),legends:n.legends,mark:p,pulse:g})))),v=m(s=n.add(B({mark:p,pulse:h||g}))),x&&($&&((i=n.operators).pop(),S&&i.pop()),n.pushState(g,h||v,f),k?function(e,n,i){var a,r,o,l,s=e.from.facet,u=s.name,d=bn(s,n);s.name||t.error("Facet must have a name: "+t.stringValue(s)),s.data||t.error("Facet must reference a data set: "+t.stringValue(s)),s.field?l=n.add(ie({field:n.fieldRef(s.field),pulse:d})):s.groupby?l=n.add(X({key:n.keyRef(s.groupby),group:m(n.proxy(i.parent)),pulse:d})):t.error("Facet must specify groupby or field: "+t.stringValue(s)),r=(a=n.fork()).add(U()),o=a.add(ue({pulse:m(r)})),a.addData(u,new xn(a,r,r,o)),a.addSignal("parent",null),l.params.subflow={$subflow:Tn(e,a).toRuntime()}}(e,n,r):$?function(e,t,n){var i=t.add(ie({pulse:n.pulse})),a=t.fork();a.add(ue()),a.addSignal("parent",null),i.params.subflow={$subflow:Tn(e,a).toRuntime()}}(e,n,r):Tn(e,n),n.popState(),$&&(S&&i.push(S),i.push(s))),R&&(v=function(e,t,n){var i,a=e.method,r=e.bound,o=e.separation,l={separation:O(o)?n.signalRef(o.signal):o,method:O(a)?n.signalRef(a.signal):a,pulse:t};e.order&&(l.sort=n.compareRef({field:e.order}));r&&(i=r.tolerance,l.boundTolerance=O(i)?n.signalRef(i.signal):+i,l.boundScale=n.scaleRef(r.scale),l.boundOrient=r.orient);return m(n.add(te(l)))}(R,v,n)),u=n.add(le({pulse:v})),d=n.add(ue({pulse:m(u)},void 0,n.parent())),null!=e.name&&(c=e.name,n.addData(c,new xn(n,o,u,d)),e.on&&e.on.forEach(function(e){(e.insert||e.remove||e.toggle)&&t.error("Marks only support modify triggers."),Rn(e,n,c)}))}function wn(e,n){var i,a,o,l,s,u,d,c,p,g=n.config.legend,h=e.encode||{},y=h.legend||{},v=y.name||void 0,b=y.interactive,x=y.style,k=Wt(e,g),S=Ye.reduce(function(t,n){return t||e[n]},0);return S||t.error("Missing valid scale for legend."),s=function(e,t){var n=e.type||Ne;e.type||1!==function(e){return Ye.reduce(function(t,n){return t+(e[n]?1:0)},0)}(e)||!e.fill&&!e.stroke||(n=r.isContinuous(t)?Ge:r.isDiscretizing(t)?Xe:Ne);return n!==Ge?n:r.isDiscretizing(t)?Xe:Ge}(e,n.scaleType(S)),u={title:null!=e.title,type:s,vgrad:"symbol"!==s&&k.isVertical()},d=m(n.add(U(null,[u]))),y=Vt(function(e,t){var n={enter:{},update:{}};return zt(n,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:t.strokeWidth,strokeDash:t.strokeDash,x:e("legendX"),y:e("legendY")}),n}(k,g),y,He),i={enter:{x:{value:0},y:{value:0}}},c=m(n.add(Q(o={type:s,scale:n.scaleRef(S),count:n.objectProperty(e.tickCount),values:n.objectProperty(e.values),minstep:n.property(e.tickMinStep),formatType:n.property(e.formatType),formatSpecifier:n.property(e.format)}))),s===Ge?(l=[qt(e,S,g,h.gradient),Xt(e,g,h.labels,c)],o.count=o.count||n.signalRef(`max(2,2*floor((${w(k.gradientLength())})/100))`)):s===Xe?l=[It(e,S,g,h.gradient,c),Xt(e,g,h.labels,c)]:(a=function(e,t){const n=Wt(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(e,g),l=[Ht(e,g,h,c,w(a.columns))],o.size=function(e,t,n){var i=w(zn("size",e,n)),a=w(zn("strokeWidth",e,n)),r=w(function(e,t,n){return Ct("fontSize",e)||function(e,t,n){var i=t.config.style[n];return i&&i[e]}("fontSize",t,n)}(n[1].encode,t,Ue));return f(`max(ceil(sqrt(${i})+${a}),${r})`,t)}(e,n,l[0].marks)),l=[Yt(xt,null,null,d,b,i,l,a)],u.title&&l.push(function(e,t,n,i){var a,r=Wt(e,t);return zt(a={enter:{opacity:Qe},update:{opacity:Je,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:Qe}},{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:nn},angle:{signal:an},align:{signal:tn},baseline:{signal:rn},text:e.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit")},{align:r("titleAlign"),baseline:r("titleBaseline")}),Et(Ut,Ot,qe,null,i,a,n)}(e,g,h.title,d)),p=Yt(vt,x,v,d,b,y,l),e.zindex&&(p.zindex=e.zindex),jn(p,n)}function zn(e,t,n){return t[e]?`scale("${t[e]}",datum)`:Ct(e,n[0].encode)}kn.countsRef=function(e,t,n){var i,a,r,o=this.counts||(this.counts={}),l=Sn(t);return null!=l&&(e=this.scope,i=o[l]),i?n&&n.field&&$n(e,i.agg.params,n):(r={groupby:e.fieldRef(t,"key"),pulse:m(this.output)},n&&n.field&&$n(e,r,n),a=e.add(T(r)),i=e.add(U({pulse:m(a)})),i={agg:a,ref:m(i)},null!=l&&(o[l]=i)),i.ref},kn.tuplesRef=function(){return m(this.values)},kn.extentRef=function(e,t){return On(e,this,"extent","extent",t,!1)},kn.domainRef=function(e,t){return On(e,this,"domain","values",t,!1)},kn.valuesRef=function(e,t,n){return On(e,this,"vals","values",t,n||!0)},kn.lookupRef=function(e,t){return On(e,this,"lookup","tupleindex",t,!1)},kn.indataRef=function(e,t){return On(e,this,"indata","tupleindex",t,!0,!0)};const Vn=`item.orient==="${Ve}"?-90:item.orient==="${De}"?90:0`,Dn=`item.orient==="${Pe}"?"${ze}":"${Pe}"`;function Pn(e,n){e=t.isString(e)?{text:e}:e;var i,a,r=n.config.title,o=t.extend({},e.encode);return i=m(n.add(U(null,[{}]))),o.name=e.name,o.interactive=e.interactive,a=function(e,t,n,i){var a,r=Wt(e,t),o={value:0},l=e.text;return zt(a={enter:{opacity:o},update:{opacity:{value:1}},exit:{opacity:o}},{text:l,orient:r("orient"),anchor:r("anchor"),align:{signal:Lt},angle:{signal:Vn},baseline:{signal:Dn},dx:r("dx"),dy:r("dy"),fill:r("color"),font:r("font"),fontSize:r("fontSize"),fontStyle:r("fontStyle"),fontWeight:r("fontWeight"),frame:r("frame"),limit:r("limit"),offset:r("offset")||0},{align:r("align"),angle:r("angle"),baseline:r("baseline")}),Et(Ut,Rt,e.style||Ie,null,i,a,n)}(e,r,o,i),e.zindex&&(a.zindex=e.zindex),jn(a,n)}function _n(e,n){var i=[];e.transform&&e.transform.forEach(function(e){i.push(cn(e,n))}),e.on&&e.on.forEach(function(t){Rn(t,n,e.name)}),n.addDataPipeline(e.name,function(e,n,i){var a,r,o,l,s,u=[],d=null,c=!1,f=!1;e.values?R(e.values)||R(e.format)?(u.push(Wn(n,e)),u.push(d=En())):u.push(d=En({$ingest:e.values,$format:e.format})):e.url?R(e.url)||R(e.format)?(u.push(Wn(n,e)),u.push(d=En())):u.push(d=En({$request:e.url,$format:e.format})):e.source&&(d=a=t.array(e.source).map(function(e){return m(n.getData(e).output)}),u.push(null));for(r=0,o=i.length;r<o;++r)l=i[r],s=l.metadata,d||s.source||u.push(d=En()),u.push(l),s.generates&&(f=!0),s.modifies&&!f&&(c=!0),s.source?d=l:s.changes&&(d=null);a&&(o=a.length-1,u[0]=oe({derive:c,pulse:o?a:a[0]}),(c||o)&&u.splice(1,0,En()));d||u.push(En());return u.push(ue({})),u}(e,n,i))}function En(e){var t=U({},e);return t.metadata={source:!0},t}function Wn(e,t){return J({url:t.url?e.property(t.url):void 0,values:t.values?e.property(t.values):void 0,format:e.objectProperty(t.format)})}function Cn(e,t){return{scale:e.scale,range:t}}function An(e,n,i,a){var r,o,l,s,u,d,c,f,p,g=Wt(e,n),h=e.orient,m=e.gridScale,y=h===Ve||h===ze?1:-1,v=function(e,n){if(1===n);else if(t.isObject(e)){for(var i=e=t.extend({},e);null!=i.mult;){if(!t.isObject(i.mult))return i.mult*=n,e;i=i.mult=t.extend({},i.mult)}i.mult=n}else e=n*(e||0);return e}(e.offset,y);return zt(r={enter:o={opacity:Qe},update:s={opacity:Je},exit:l={opacity:Qe}},{stroke:g("gridColor"),strokeDash:g("gridDash"),strokeDashOffset:g("gridDashOffset"),strokeOpacity:g("gridOpacity"),strokeWidth:g("gridWidth")}),u={scale:e.scale,field:Be,band:g("bandPosition"),round:g("tickRound"),extra:g("tickExtra"),offset:g("tickOffset")},h===ze||h===Pe?(d="x",c="y",p="height"):(d="y",c="x",p="width"),f=c+"2",s[d]=o[d]=l[d]=u,m?(s[c]=o[c]={scale:m,range:0,mult:y,offset:v},s[f]=o[f]={scale:m,range:1,mult:y,offset:v}):(s[c]=o[c]={value:0,offset:v},s[f]=o[f]={signal:p,mult:y,offset:v}),Et(Mt,gt,null,Be,a,r,i)}function Ln(e,t,n,i,a){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+a+")"}}function Fn(e,n){var i,a,r,o,l,s,u=function(e,n){var i=n.config,a=e.orient,r=a===ze||a===Pe?i.axisX:i.axisY,o=i["axis"+a[0].toUpperCase()+a.slice(1)],l="band"===n.scaleType(e.scale)&&i.axisBand;return r||o||l?t.extend({},i.axis,r,o,l):i.axis}(e,n),d=e.encode||{},c=d.axis||{},f=c.name||void 0,p=c.interactive,g=c.style,h=Wt(e,u);return i={orient:e.orient,ticks:!!h("ticks"),labels:!!h("labels"),grid:!!h("grid"),domain:!!h("domain"),title:null!=e.title},a=m(n.add(U({},[i]))),c=Vt({update:{offset:jt(h("offset")||0),position:jt(j(e.position,0)),titlePadding:jt(h("titlePadding")),minExtent:jt(h("minExtent")),maxExtent:jt(h("maxExtent")),range:{signal:`abs(span(range("${e.scale}")))`}}},d.axis,He),r=m(n.add(M({scale:n.scaleRef(e.scale),extra:n.property(h("tickExtra")),count:n.objectProperty(e.tickCount),values:n.objectProperty(e.values),minstep:n.property(e.tickMinStep),formatType:n.property(e.formatType),formatSpecifier:n.property(e.format)}))),s=[],i.grid&&s.push(An(e,u,d.grid,r)),i.ticks&&(o=h("tickSize"),s.push(function(e,t,n,i,a){var r,o,l,s,u,d,c=Wt(e,t),f=e.orient,p=f===Ve||f===ze?-1:1;return zt(r={enter:o={opacity:Qe},update:s={opacity:Je},exit:l={opacity:Qe}},{stroke:c("tickColor"),strokeDash:c("tickDash"),strokeDashOffset:c("tickDashOffset"),strokeOpacity:c("tickOpacity"),strokeWidth:c("tickWidth")}),(u=jt(a)).mult=p,d={scale:e.scale,field:Be,band:c("bandPosition"),round:c("tickRound"),extra:c("tickExtra"),offset:c("tickOffset")},f===ze||f===Pe?(s.y=o.y=Qe,s.y2=o.y2=u,s.x=o.x=l.x=d):(s.x=o.x=Qe,s.x2=o.x2=u,s.y=o.y=l.y=d),Et(Mt,mt,null,Be,i,r,n)}(e,u,d.ticks,r,o))),i.labels&&(o=i.ticks?o:0,s.push(function(e,t,n,i,a){var r,o,l,s,u,d,c,f,p,g,h=Wt(e,t),m=e.orient,y=m===Ve||m===ze?-1:1,v=m===ze||m===Pe,b=e.scale,x=w(h("labelFlush")),k=w(h("labelFlushOffset")),S=0===x||!!x,$=h("labelAlign"),O=h("labelBaseline");return(l=jt(a)).mult=y,l.offset=jt(h("labelPadding")||0),l.offset.mult=y,s={scale:b,field:Be,band:.5,offset:h("tickOffset")},v?(u=$||(S?Ln(b,x,'"left"','"right"','"center"'):"center"),d=O||(m===ze?"bottom":"top"),c=!$):(u=$||(m===De?"left":"right"),d=O||(S?Ln(b,x,'"top"','"bottom"','"middle"'):"middle"),c=!O),c=c&&S&&k?Ln(b,x,"-("+k+")",k,0):null,zt(r={enter:o={opacity:Qe,x:v?s:l,y:v?l:s},update:{opacity:Je,text:{field:Ae},x:o.x,y:o.y},exit:{opacity:Qe,x:o.x,y:o.y}},{[v?"dx":"dy"]:c,align:u,baseline:d,angle:h("labelAngle"),fill:h("labelColor"),fillOpacity:h("labelOpacity"),font:h("labelFont"),fontSize:h("labelFontSize"),fontWeight:h("labelFontWeight"),fontStyle:h("labelFontStyle"),limit:h("labelLimit")}),f=h("labelBound"),p=h("labelOverlap"),g=h("labelSeparation"),e=Et(Ut,ht,Ue,Be,i,r,n),(p||f)&&(e.overlap={separation:g,method:p,order:"datum.index",bound:f?{scale:b,orient:m,tolerance:f}:null}),e}(e,u,d.labels,r,o))),i.domain&&s.push(function(e,t,n,i){var a,r,o,l,s,u,d=Wt(e,t),c=e.orient;return zt(a={enter:r={opacity:Qe},update:o={opacity:Je},exit:{opacity:Qe}},{stroke:d("domainColor"),strokeDash:d("domainDash"),strokeDashOffset:d("domainDashOffset"),strokeWidth:d("domainWidth"),strokeOpacity:d("domainOpacity")}),c===ze||c===Pe?(l="x",u="y"):(l="y",u="x"),s=l+"2",r[u]=Qe,o[l]=r[l]=Cn(e,0),o[s]=r[s]=Cn(e,1),Et(Mt,pt,null,null,i,a,n)}(e,u,d.domain,a)),i.title&&s.push(function(e,n,i,a){var r,o,l,s,u=Wt(e,n),d=e.orient,c=d===Ve||d===ze?-1:1,f=d===ze||d===Pe;return r={enter:o={opacity:Qe,anchor:jt(u("titleAnchor")),align:{signal:Lt}},update:l=t.extend({},o,{opacity:Je,text:jt(e.title)}),exit:{opacity:Qe}},s={signal:`lerp(range("${e.scale}"), ${At(0,1,.5)})`},f?(l.x=s,o.angle={value:0},o.baseline={value:d===ze?"bottom":"top"}):(l.y=s,o.angle={value:90*c},o.baseline={value:"bottom"}),zt(r,{angle:u("titleAngle"),baseline:u("titleBaseline"),fill:u("titleColor"),fillOpacity:u("titleOpacity"),font:u("titleFont"),fontSize:u("titleFontSize"),fontStyle:u("titleFontStyle"),fontWeight:u("titleFontWeight"),limit:u("titleLimit")},{align:u("titleAlign")}),!wt(r,"x",u("titleX"),"update")&&!f&&!_t("x",i)&&(r.enter.auto={value:!0}),!wt(r,"y",u("titleY"),"update")&&f&&!_t("y",i)&&(r.enter.auto={value:!0}),Et(Ut,yt,qe,null,a,r,i)}(e,u,d.title,a)),l=Yt(ft,g,f,a,p,c,s),e.zindex&&(l.zindex=e.zindex),jn(l,n)}function Tn(e,n,i){var a=t.array(e.signals),o=t.array(e.scales);return i||a.forEach(e=>c(e,n)),t.array(e.projections).forEach(e=>(function(e,t){var n={};for(var i in e)"name"!==i&&(n[i]=we(e[i],i,t));t.addProjection(e.name,n)})(e,n)),o.forEach(e=>(function(e,n){var i=e.type||"linear";r.isValidScaleType(i)||t.error("Unrecognized scale type: "+t.stringValue(i)),n.addScale(e.name,{type:i,domain:void 0})})(e,n)),t.array(e.data).forEach(e=>_n(e,n)),o.forEach(e=>he(e,n)),(i||a).forEach(e=>L(e,n)),t.array(e.axes).forEach(e=>Fn(e,n)),t.array(e.marks).forEach(e=>jn(e,n)),t.array(e.legends).forEach(e=>wn(e,n)),e.title&&Pn(e.title,n),n.parseLambdas(),n}var Mn=t.toSet(["width","height","padding","autosize"]);function Bn(e,n){var i,a,r,o,s,u,d=n.config;return n.background=e.background||d.background,n.eventConfig=d.events,s=m(n.root=n.add(h())),n.addSignal("width",e.width||0),n.addSignal("height",e.height||0),n.addSignal("padding",function(e,n){return e=e||n.padding,t.isObject(e)?{top:l(e.top),bottom:l(e.bottom),left:l(e.left),right:l(e.right)}:{top:i=l(e),bottom:i,left:i,right:i};var i}(e.padding,d)),n.addSignal("autosize",function(e,n){return e=e||n.autosize,t.isObject(e)?e:{type:e||"pad"}}(e.autosize,d)),n.legends=n.objectProperty(d.legend&&d.legend.layout),u=function(e,n,i){if(t.array(n).forEach(t=>{Mn[t.name]||c(t,e)}),!i)return n;const a=n.slice();return t.array(i).forEach(t=>{e.hasOwnSignal(t.name)||(c(t,e),a.push(t))}),a}(n,e.signals,d.signals),a=n.add(U()),r=Vt({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e.encode),r=n.add(N(Dt(r,Ft,dt,e.style,n,{pulse:m(a)}))),o=n.add(ce({layout:n.objectProperty(e.layout),legends:n.legends,autosize:n.signalRef("autosize"),mark:s,pulse:m(r)})),n.operators.pop(),n.pushState(m(r),m(o),null),Tn(e,n,u),n.operators.push(o),i=n.add(B({mark:s,pulse:m(o)})),i=n.add(le({pulse:m(i)})),i=n.add(ue({pulse:m(i)})),n.addData("root",new xn(n,a,a,i)),n}function Un(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 qn(e){this.config=e.config,this.legends=e.legends,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 In=Un.prototype=qn.prototype;function Nn(e){return(t.isArray(e)?Gn:Xn)(e)}function Gn(e){for(var n,i="[",a=0,r=e.length;a<r;++a)n=e[a],i+=(a>0?",":"")+(t.isObject(n)?n.signal||Nn(n):t.stringValue(n));return i+"]"}function Xn(e){var n,i,a="{",r=0;for(n in e)i=e[n],a+=(++r>1?",":"")+t.stringValue(n)+":"+(t.isObject(i)?i.signal||Nn(i):t.stringValue(i));return a+"}"}function Yn(e){return(e||[]).reduce((e,t)=>{for(var n in t)if("signals"===n)e.signals=Qn(e.signals,t.signals);else{var i="legend"===n?{layout:1}:"style"===n||null;Hn(e,n,t[n],i)}return e},{padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:ei},area:{fill:ei},image:null,line:{stroke:ei,strokeWidth:Zn},path:{stroke:ei},rect:{fill:ei},rule:{stroke:ti},shape:{stroke:ei},symbol:{fill:ei,size:64},text:{fill:ti,font:Jn,fontSize:11},style:{"guide-label":{fill:ti,font:Jn,fontSize:10},"guide-title":{fill:ti,font:Jn,fontSize:11,fontWeight:"bold"},"group-title":{fill:ti,font:Jn,fontSize:13,fontWeight:"bold"},point:{size:Kn,strokeWidth:Zn,shape:"circle"},circle:{size:Kn,strokeWidth:Zn},square:{size:Kn,strokeWidth:Zn,shape:"square"},cell:{fill:"transparent",stroke:ii}},title:{orient:"top",anchor:"middle",offset:4},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:ni,grid:!1,gridWidth:1,gridColor:ii,labels:!0,labelAngle:0,labelLimit:180,labelPadding:2,ticks:!0,tickColor:ni,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-1},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:ii,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:ni,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}})}function Hn(e,n,i,a){var r,o;if(t.isObject(i)&&!t.isArray(i))for(r in o=t.isObject(e[n])?e[n]:e[n]={},i)a&&(!0===a||a[r])?Hn(o,r,i[r]):o[r]=i[r];else e[n]=i}function Qn(e,t){if(null==e)return t;const n={},i=[];function a(e){n[e.name]||(n[e.name]=1,i.push(e))}return t.forEach(a),e.forEach(a),i}In.fork=function(){return new qn(this)},In.isSubscope=function(){return this._subid>0},In.toRuntime=function(){return this.finish(),{background:this.background,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig}},In.id=function(){return(this._subid?this._subid+":":0)+this._id++},In.add=function(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach(function(t){t.$ref=e.id}),e.refs=null),e},In.proxy=function(e){var t=e instanceof p?m(e):e;return this.add(re({value:t}))},In.addStream=function(e){return this.streams.push(e),e.id=this.id(),e},In.addUpdate=function(e){return this.updates.push(e),e},In.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 i;e&&((i=e.data||(e.data={}))[t]||(i[t]=[])).push(n)}for(e in this.data)for(var i in n((t=this.data[e]).input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values"),t.index)n(t.index[i],e,"index:"+i);return this},In.pushState=function(e,t,n){this._encode.push(m(this.add(ue({pulse:e})))),this._parent.push(t),this._lookup.push(n?m(this.proxy(n)):null),this._markpath.push(-1)},In.popState=function(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},In.parent=function(){return t.peek(this._parent)},In.encode=function(){return t.peek(this._encode)},In.lookup=function(){return t.peek(this._lookup)},In.markpath=function(){var e=this._markpath;return++e[e.length-1]},In.fieldRef=function(e,n){if(t.isString(e))return y(e,n);e.signal||t.error("Unsupported field reference: "+t.stringValue(e));var i,a=e.signal,r=this.field[a];return r||(i={name:this.signalRef(a)},n&&(i.as=n),this.field[a]=r=m(this.add(Y(i)))),r},In.compareRef=function(e){function n(e){return O(e)?(a=!0,i.signalRef(e.signal)):function(e){return e&&e.expr}(e)?(a=!0,i.exprRef(e.expr)):e}var i=this,a=!1,r=t.array(e.field).map(n),o=t.array(e.order).map(n);return a?m(this.add(q({fields:r,orders:o}))):b(r,o)},In.keyRef=function(e,n){var i=this.signals,a=!1;return e=t.array(e).map(function(e){return O(e)?(a=!0,m(i[e.signal])):e}),a?m(this.add(H({fields:e,flat:n}))):function(e,t){var n={$key:e};return t&&(n.$flat=!0),n}(e,n)},In.sortRef=function(e){if(!e)return e;var t=k(e.op,e.field),n=e.order||"ascending";return n.signal?m(this.add(q({fields:t,orders:this.signalRef(n.signal)}))):b(t,n)},In.event=function(e,t){var n=e+":"+t;if(!this.events[n]){var i=this.id();this.streams.push({id:i,source:e,type:t}),this.events[n]=i}return this.events[n]},In.hasOwnSignal=function(e){return t.hasOwnProperty(this.signals,e)},In.addSignal=function(e,n){this.hasOwnSignal(e)&&t.error("Duplicate signal name: "+t.stringValue(e));var i=n instanceof p?n:this.add(h(n));return this.signals[e]=i},In.getSignal=function(e){return this.signals[e]||t.error("Unrecognized signal name: "+t.stringValue(e)),this.signals[e]},In.signalRef=function(e){return this.signals[e]?m(this.signals[e]):(t.hasOwnProperty(this.lambdas,e)||(this.lambdas[e]=this.add(h(null))),m(this.lambdas[e]))},In.parseLambdas=function(){for(var e=Object.keys(this.lambdas),t=0,n=e.length;t<n;++t){var i=e[t],a=f(i,this),r=this.lambdas[i];r.params=a.$params,r.update=a.$expr}},In.property=function(e){return e&&e.signal?this.signalRef(e.signal):e},In.objectProperty=function(e){return e&&t.isObject(e)?this.signalRef(e.signal||Nn(e)):e},In.exprRef=function(e,t){var n={expr:f(e,this)};return t&&(n.expr.$name=t),m(this.add(G(n)))},In.addBinding=function(e,n){this.bindings||t.error("Nested signals do not support binding: "+t.stringValue(e)),this.bindings.push(t.extend({signal:e},n))},In.addScaleProj=function(e,n){t.hasOwnProperty(this.scales,e)&&t.error("Duplicate scale or projection name: "+t.stringValue(e)),this.scales[e]=this.add(n)},In.addScale=function(e,t){this.addScaleProj(e,se(t))},In.addProjection=function(e,t){this.addScaleProj(e,ae(t))},In.getScale=function(e){return this.scales[e]||t.error("Unrecognized scale name: "+t.stringValue(e)),this.scales[e]},In.projectionRef=In.scaleRef=function(e){return m(this.getScale(e))},In.projectionType=In.scaleType=function(e){return this.getScale(e).params.type},In.addData=function(e,n){return t.hasOwnProperty(this.data,e)&&t.error("Duplicate data set name: "+t.stringValue(e)),this.data[e]=n},In.getData=function(e){return this.data[e]||t.error("Undefined data set name: "+t.stringValue(e)),this.data[e]},In.addDataPipeline=function(e,n){return t.hasOwnProperty(this.data,e)&&t.error("Duplicate data set name: "+t.stringValue(e)),this.addData(e,xn.fromEntries(this,n))};var Jn="sans-serif",Kn=30,Zn=2,ei="#4c78a8",ti="#000",ni="#888",ii="#ddd";e.AxisDomainRole=pt,e.AxisGridRole=gt,e.AxisLabelRole=ht,e.AxisRole=ft,e.AxisTickRole=mt,e.AxisTitleRole=yt,e.DataScope=xn,e.FrameRole=dt,e.LegendEntryRole=xt,e.LegendLabelRole=St,e.LegendRole=vt,e.LegendSymbolRole=$t,e.LegendTitleRole=Ot,e.MarkRole=ut,e.Scope=Un,e.ScopeRole=ct,e.config=Yn,e.parse=function(e,n){return t.isObject(e)||t.error("Input Vega specification must be an object."),Bn(e,new Un(Yn([n,e.config]))).toRuntime()},e.signal=c,e.signalUpdates=L,e.stream=V,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vega-util"),require("vega-expression"),require("vega-functions"),require("vega-event-selector"),require("vega-scale"),require("vega-dataflow")):"function"==typeof define&&define.amd?define(["exports","vega-util","vega-expression","vega-functions","vega-event-selector","vega-scale","vega-dataflow"],t):t((e=e||self).vega={},e.vega,e.vega,e.vega,e.vega,e.vega,e.vega)}(this,(function(e,t,n,i,a,r,o){"use strict";function l(e){return+e||0}var s="outer",u=["value","update","init","react","bind"];function d(e,n){t.error(e+' for "outer" push: '+t.stringValue(n))}function c(e,t){var n=e.name;if(e.push===s)t.signals[n]||d("No prior signal definition",n),u.forEach((function(t){void 0!==e[t]&&d("Invalid property ",t)}));else{var i=t.addSignal(n,e.value);!1===e.react&&(i.react=!1),e.bind&&t.addBinding(n,e.bind)}}function f(e,a,r){var o,l,s={};try{e=t.isString(e)?e:t.stringValue(e)+"",o=n.parse(e)}catch(n){t.error("Expression parse error: "+e)}return o.visit((function(e){if(e.type===n.CallExpression){var t=e.callee.name,r=i.codegenParams.visitors[t];r&&r(t,e.arguments,a,s)}})),(l=i.codeGenerator(o)).globals.forEach((function(e){var n=i.SignalPrefix+e;!t.hasOwnProperty(s,n)&&a.getSignal(e)&&(s[n]=a.signalRef(e))})),{$expr:r?r+"return("+l.code+");":l.code,$fields:l.fields,$params:s}}function p(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function g(e,t,n,i){return new p(e,t,n,i)}function h(e,t){return g("operator",e,t)}function m(e){var t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function y(e,t){return t?{$field:e,$name:t}:{$field:e}}var v=y("key");function b(e,t){return{$compare:e,$order:t}}var x="descending";function k(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}var S="scope",$="view";function O(e){return e&&e.signal}function R(e){if(O(e))return!0;if(t.isObject(e))for(var n in e)if(R(e[n]))return!0;return!1}function j(e,t){return null!=e?e:t}function w(e){return e&&e.signal||e}var z="timer";function V(e,n){return(e.merge?D:e.stream?P:e.type?_:t.error("Invalid stream specification: "+t.stringValue(e)))(e,n)}function D(e,t){var n=E({merge:e.merge.map(e=>V(e,t))},e,t);return t.addStream(n).id}function P(e,t){var n=E({stream:V(e.stream,t)},e,t);return t.addStream(n).id}function _(e,t){var n,i,a;return e.type===z?(n=t.event(z,e.throttle),e={between:e.between,filter:e.filter}):n=t.event((a=e.source)===S?$:a||$,e.type),i=E({stream:n},e,t),1===Object.keys(i).length?n:t.addStream(i).id}function E(e,n,i){var a,r,o,l,s=n.between;return s&&(2!==s.length&&t.error('Stream "between" parameter must have 2 entries: '+t.stringValue(n)),e.between=[V(s[0],i),V(s[1],i)]),s=n.filter?[].concat(n.filter):[],(n.marktype||n.markname||n.markrole)&&s.push((a=n.marktype,r=n.markname,o=n.markrole,(l="event.item")+(a&&"*"!==a?"&&"+l+".mark.marktype==='"+a+"'":"")+(o?"&&"+l+".mark.role==='"+o+"'":"")+(r?"&&"+l+".mark.name==='"+r+"'":""))),n.source===S&&s.push("inScope(event.item)"),s.length&&(e.filter=f("("+s.join(")&&(")+")").$expr),null!=(s=n.throttle)&&(e.throttle=+s),null!=(s=n.debounce)&&(e.debounce=+s),n.consume&&(e.consume=!0),e}var W="var datum=event.item&&event.item.datum;";function C(e,n,i){var r=e.events,o=e.update,l=e.encode,s=[],u={target:i};r||t.error("Signal update missing events specification."),t.isString(r)&&(r=a.selector(r,n.isSubscope()?S:$)),r=t.array(r).filter(e=>e.signal||e.scale?(s.push(e),0):1),s.length>1&&(s=[A(s)]),r.length&&s.push(r.length>1?{merge:r}:r[0]),null!=l&&(o&&t.error("Signal encode and update are mutually exclusive."),o="encode(item(),"+t.stringValue(l)+")"),u.update=t.isString(o)?f(o,n,W):null!=o.expr?f(o.expr,n,W):null!=o.value?o.value:null!=o.signal?{$expr:"_.value",$params:{value:n.signalRef(o.signal)}}:t.error("Invalid signal update specification."),e.force&&(u.options={force:!0}),s.forEach((function(e){n.addUpdate(t.extend(function(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):V(e,t)}}(e,n),u))}))}function A(e){return{signal:"["+e.map(e=>e.scale?'scale("'+e.scale+'")':e.signal)+"]"}}function L(e,n){var i=n.getSignal(e.name),a=e.update;e.init&&(a?t.error("Signals can not include both init and update expressions."):(a=e.init,i.initonly=!0)),a&&(a=f(a,n),i.update=a.$expr,i.params=a.$params),e.on&&e.on.forEach((function(e){C(e,n,i.id)}))}function F(e){return function(t,n,i){return g(e,n,t||void 0,i)}}var T=F("aggregate"),M=F("axisticks"),B=F("bound"),U=F("collect"),q=F("compare"),I=F("datajoin"),N=F("encode"),G=F("expression"),X=F("facet"),Y=F("field"),H=F("key"),Q=F("legendentries"),J=F("load"),K=F("mark"),Z=F("multiextent"),ee=F("multivalues"),te=F("overlap"),ne=F("params"),ie=F("prefacet"),ae=F("projection"),re=F("proxy"),oe=F("relay"),le=F("render"),se=F("scale"),ue=F("sieve"),de=F("sortitems"),ce=F("viewlayout"),fe=F("values"),pe=0,ge={min:"min",max:"max",count:"sum"};function he(e,n){var i,a,o=n.getScale(e.name).params;for(i in o.domain=be(e.domain,e,n),null!=e.range&&(o.range=function e(n,i,a){var o=n.range,l=i.config.range;if(o.signal)return i.signalRef(o.signal);if(t.isString(o)){if(l&&t.hasOwnProperty(l,o))return n=t.extend({},n,{range:l[o]}),e(n,i,a);"width"===o?o=[0,{signal:"width"}]:"height"===o?o=r.isDiscrete(n.type)?[0,{signal:"height"}]:[{signal:"height"},0]:t.error("Unrecognized scale range value: "+t.stringValue(o))}else{if(o.scheme)return a.scheme=t.isArray(o.scheme)?ye(o.scheme,i):me(o.scheme,i),o.extent&&(a.schemeExtent=ye(o.extent,i)),void(o.count&&(a.schemeCount=me(o.count,i)));if(o.step)return void(a.rangeStep=me(o.step,i));if(r.isDiscrete(n.type)&&!t.isArray(o))return be(o,n,i);t.isArray(o)||t.error("Unsupported range type: "+t.stringValue(o))}return o.map(e=>(t.isArray(e)?ye:me)(e,i))}(e,n,o)),null!=e.interpolate&&function(e,t){t.interpolate=me(e.type||e),null!=e.gamma&&(t.interpolateGamma=me(e.gamma))}(e.interpolate,o),null!=e.nice&&(o.nice=(a=e.nice,t.isObject(a)?{interval:me(a.interval),step:me(a.step)}:me(a))),null!=e.bins&&(o.bins=function(e,n){return e.signal||t.isArray(e)?ye(e,n):n.objectProperty(e)}(e.bins,n)),e)t.hasOwnProperty(o,i)||"name"===i||(o[i]=me(e[i],n))}function me(e,n){return t.isObject(e)?e.signal?n.signalRef(e.signal):t.error("Unsupported object: "+t.stringValue(e)):e}function ye(e,t){return e.signal?t.signalRef(e.signal):e.map(e=>me(e,t))}function ve(e){t.error("Can not find data set: "+t.stringValue(e))}function be(e,n,i){if(e)return e.signal?i.signalRef(e.signal):(t.isArray(e)?xe:e.fields?Se:ke)(e,n,i);null==n.domainMin&&null==n.domainMax||t.error("No scale domain defined for domainMin/domainMax to override.")}function xe(e,t,n){return e.map((function(e){return me(e,n)}))}function ke(e,t,n){var i=n.getData(e.data);return i||ve(e.data),r.isDiscrete(t.type)?i.valuesRef(n,e.field,Oe(e.sort,!1)):r.isQuantile(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function Se(e,n,i){var a=e.data,o=e.fields.reduce((function(e,n){return n=t.isString(n)?{data:a,field:n}:t.isArray(n)||n.signal?function(e,n){var i="_:vega:_"+pe++,a=U({});if(t.isArray(e))a.value={$ingest:e};else if(e.signal){var r="setdata("+t.stringValue(i)+","+e.signal+")";a.params.input=n.signalRef(r)}return n.addDataPipeline(i,[a,ue({})]),{data:i,field:"data"}}(n,i):n,e.push(n),e}),[]);return(r.isDiscrete(n.type)?$e:r.isQuantile(n.type)?Re:je)(e,i,o)}function $e(e,t,n){var i,a,r,o,l,s=Oe(e.sort,!0);return i=n.map((function(e){var n=t.getData(e.data);return n||ve(e.data),n.countsRef(t,e.field,s)})),a={groupby:v,pulse:i},s&&(r=s.op||"count",l=s.field?k(r,s.field):"count",a.ops=[ge[r]],a.fields=[t.fieldRef(l)],a.as=[l]),r=t.add(T(a)),o=t.add(U({pulse:m(r)})),l=t.add(fe({field:v,sort:t.sortRef(s),pulse:m(o)})),m(l)}function Oe(e,n){return e&&(e.field||e.op?e.field||"count"===e.op?n&&e.field&&e.op&&!ge[e.op]&&t.error("Multiple domain scales can not be sorted using "+e.op):t.error("No field provided for sort aggregate op: "+e.op):t.isObject(e)?e.field="key":e={field:"key"}),e}function Re(e,t,n){var i=n.map((function(e){var n=t.getData(e.data);return n||ve(e.data),n.domainRef(t,e.field)}));return m(t.add(ee({values:i})))}function je(e,t,n){var i=n.map((function(e){var n=t.getData(e.data);return n||ve(e.data),n.extentRef(t,e.field)}));return m(t.add(Z({extents:i})))}function we(e,n,i){return t.isArray(e)?e.map((function(e){return we(e,n,i)})):t.isObject(e)?e.signal?i.signalRef(e.signal):"fit"===n?e:t.error("Unsupported parameter object: "+t.stringValue(e)):e}const ze="top",Ve="left",De="right",Pe="bottom",_e="vertical",Ee="start",We="end",Ce="index",Ae="label",Le="offset",Fe="perc",Te="perc2",Me="size",Be="value",Ue="guide-label",qe="guide-title",Ie="group-title",Ne="symbol",Ge="gradient",Xe="discrete",Ye=["size","shape","fill","stroke","strokeWidth","strokeDash","opacity"],He={name:1,interactive:1},Qe={value:0},Je={value:1};var Ke=t.toSet(["rule"]),Ze=t.toSet(["group","image","rect"]);function et(e,n,i,a){var r=f(e,n);return r.$fields.forEach((function(e){a[e]=1})),t.extend(i,r.$params),r.$expr}function tt(e,n,i,a){return function e(n,i,a,r){var o,l,s;if(n.signal)o="datum",s=et(n.signal,i,a,r);else if(n.group||n.parent){for(l=Math.max(1,n.level||1),o="item";l-- >0;)o+=".mark.group";n.parent?(s=n.parent,o+=".datum"):s=n.group}else n.datum?(o="datum",s=n.datum):t.error("Invalid field reference: "+t.stringValue(n));n.signal||(t.isString(s)?(r[s]=1,s=t.splitAccessPath(s).map(t.stringValue).join("][")):s=e(s,i,a,r));return o+"["+s+"]"}(t.isObject(e)?e:{datum:e},n,i,a)}function nt(e,n,i,a,r){var o,l,s,u=it(e.scale,i,a,r);return null!=e.range?(l=u+".range()",n=0===(o=+e.range)?l+"[0]":"($="+l+","+(1===o?"$[$.length-1]":"$[0]+"+o+"*($[$.length-1]-$[0])")+")"):(void 0!==n&&(n=u+"("+n+")"),e.band&&(s=function(e,n){if(!t.isString(e))return-1;var i=n.scaleType(e);return"band"===i||"point"===i?1:0}(e.scale,i))&&(o=(l=u+".bandwidth")+"()"+(1===(o=+e.band)?"":"*"+o),s<0&&(o="("+l+"?"+o+":0)"),n=(n?n+"+":"")+o,e.extra&&(n="(datum.extra?"+u+"(datum.extra.value):"+n+")")),null==n&&(n="0")),n}function it(e,n,a,r){var o;if(t.isString(e))o=i.ScalePrefix+e,t.hasOwnProperty(a,o)||(a[o]=n.scaleRef(e)),o=t.stringValue(o);else{for(o in n.scales)a[i.ScalePrefix+o]=n.scaleRef(o);o=t.stringValue(i.ScalePrefix)+"+"+(e.signal?"("+et(e.signal,n,a,r)+")":tt(e,n,a,r))}return"_["+o+"]"}function at(e,n,i,a){return t.isObject(e)?"("+rt(null,e,n,i,a)+")":e}function rt(e,n,i,a,r){if(null!=n.gradient)return function(e,n,i,a){return"this.gradient("+it(e.gradient,n,i,a)+","+t.stringValue(e.start)+","+t.stringValue(e.stop)+","+t.stringValue(e.count)+")"}(n,i,a,r);var o=n.signal?et(n.signal,i,a,r):n.color?function(e,t,n,i){function a(e,a,r,o){return"this."+e+"("+[rt(null,a,t,n,i),rt(null,r,t,n,i),rt(null,o,t,n,i)].join(",")+").toString()"}return e.c?a("hcl",e.h,e.c,e.l):e.h||e.s?a("hsl",e.h,e.s,e.l):e.l||e.a?a("lab",e.l,e.a,e.b):e.r||e.g||e.b?a("rgb",e.r,e.g,e.b):null}(n.color,i,a,r):null!=n.field?tt(n.field,i,a,r):void 0!==n.value?t.stringValue(n.value):void 0;return null!=n.scale&&(o=nt(n,o,i,a,r)),void 0===o&&(o=null),null!=n.exponent&&(o="Math.pow("+o+","+at(n.exponent,i,a,r)+")"),null!=n.mult&&(o+="*"+at(n.mult,i,a,r)),null!=n.offset&&(o+="+"+at(n.offset,i,a,r)),n.round&&(o="Math.round("+o+")"),o}function ot(e,n,i){const a=e+"["+t.stringValue(n)+"]";return`$=${i};if(${a}!==$)${a}=$,m=1;`}function lt(e,n,i,a,r){var o="";return n.forEach((function(e){var t=rt(0,e,i,a,r);o+=e.test?et(e.test,i,a,r)+"?"+t+":":t})),":"===t.peek(o)&&(o+="null"),ot("o",e,o)}function st(e,n,i,a){var r,o,l={},s="var o=item,datum=o.datum,m=0,$;";for(r in e)o=e[r],t.isArray(o)?s+=lt(r,o,a,i,l):s+=ot("o",r,rt(0,o,a,i,l));return s+=function(e,t){var n="";return Ke[t]?n:(e.x2&&(e.x?(Ze[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(Ze[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;"),n)}(e,n),{$expr:s+="return m;",$fields:Object.keys(l),$output:Object.keys(e)}}var ut="mark",dt="frame",ct="scope",ft="axis",pt="axis-domain",gt="axis-grid",ht="axis-label",mt="axis-tick",yt="axis-title",vt="legend",bt="legend-band",xt="legend-entry",kt="legend-gradient",St="legend-label",$t="legend-symbol",Ot="legend-title",Rt="title";function jt(e){return t.isObject(e)?t.extend({},e):{value:e}}function wt(e,n,i,a){return null!=i?(t.isObject(i)&&!t.isArray(i)?e.update[n]=i:e[a||"enter"][n]={value:i},1):0}function zt(e,t,n){for(let n in t)wt(e,n,t[n]);for(let t in n)wt(e,t,n[t],"update")}function Vt(e,n,i){for(var a in n)i&&t.hasOwnProperty(i,a)||(e[a]=t.extend(e[a]||{},n[a]));return e}function Dt(e,n,i,a,r,o){var l,s;for(s in(o=o||{}).encoders={$encode:l={}},e=function(e,n,i,a,r){var o,l,s,u={},d={};"legend"!=i&&0!==String(i).indexOf("axis")||(i=null);for(l in s=i===dt?r.group:i===ut?t.extend({},r.mark,r[n]):null)_t(l,e)||("fill"===l||"stroke"===l)&&(_t("fill",e)||_t("stroke",e))||Pt(u,l,s[l]);for(l in t.array(a).forEach((function(t){var n=r.style&&r.style[t];for(var i in n)_t(i,e)||Pt(u,i,n[i])})),e=t.extend({},e),u)(s=u[l]).signal?(o=o||{})[l]=s:d[l]=s;e.enter=t.extend(d,e.enter),o&&(e.update=t.extend(o,e.update));return e}(e,n,i,a,r.config))l[s]=st(e[s],n,o,r);return o}function Pt(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}function _t(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}function Et(e,t,n,i,a,r,o){return{type:e,name:o?o.name:void 0,role:t,style:o&&o.style||n,key:i,from:a,interactive:!(!o||!o.interactive),encode:Vt(r,o,He)}}function Wt(e,t){const n=n=>j(e[n],t[n]);return n.isVertical=n=>_e===j(e.direction,t.direction||(n?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>j(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>j(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>j(e.columns,j(t.columns,+n.isVertical(!0))),n}function Ct(e,t){var n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function At(e,t,n){return`item.anchor === "${Ee}" ? ${e} : item.anchor === "${We}" ? ${t} : ${n}`}const Lt=At(t.stringValue(Ve),t.stringValue(De),t.stringValue("center"));var Ft="group",Tt="rect",Mt="rule",Bt="symbol",Ut="text";function qt(e,n,i,a){var r,o,l,s,u,d,c=Wt(e,i),f=c.isVertical(),p=c.gradientThickness(),g=c.gradientLength();return f?(l=[0,1],s=[0,0],u=p,d=g):(l=[0,0],s=[1,0],u=g,d=p),zt(r={enter:o={opacity:Qe,x:Qe,y:Qe,width:jt(u),height:jt(d)},update:t.extend({},o,{opacity:Je,fill:{gradient:n,start:l,stop:s}}),exit:{opacity:Qe}},{stroke:c("gradientStrokeColor"),strokeWidth:c("gradientStrokeWidth")},{opacity:c("gradientOpacity")}),Et(Tt,kt,null,void 0,void 0,r,a)}function It(e,n,i,a,r){var o,l,s,u,d,c,f=Wt(e,i),p=f.isVertical(),g=f.gradientThickness(),h=f.gradientLength(),m="";return p?(s="y",d="y2",u="x",c="width",m="1-"):(s="x",d="x2",u="y",c="height"),(l={opacity:Qe,fill:{scale:n,field:Be}})[s]={signal:m+"datum."+Fe,mult:h},l[u]=Qe,l[d]={signal:m+"datum."+Te,mult:h},l[c]=jt(g),zt(o={enter:l,update:t.extend({},l,{opacity:Je}),exit:{opacity:Qe}},{stroke:f("gradientStrokeColor"),strokeWidth:f("gradientStrokeWidth")},{opacity:f("gradientOpacity")}),Et(Tt,bt,null,Be,r,o,a)}const Nt=`datum.${Fe}<=0?"${Ve}":datum.${Fe}>=1?"${De}":"center"`,Gt=`datum.${Fe}<=0?"${Pe}":datum.${Fe}>=1?"${ze}":"middle"`;function Xt(e,t,n,i){var a,r,o,l,s,u=Wt(e,t),d=u.isVertical(),c=jt(u.gradientThickness()),f=u.gradientLength(),p=u("labelOverlap"),g=u("labelSeparation"),h="";return zt(a={enter:r={opacity:Qe},update:o={opacity:Je,text:{field:Ae}},exit:{opacity:Qe}},{fill:u("labelColor"),fillOpacity:u("labelOpacity"),font:u("labelFont"),fontSize:u("labelFontSize"),fontStyle:u("labelFontStyle"),fontWeight:u("labelFontWeight"),limit:j(e.labelLimit,t.gradientLabelLimit)}),d?(r.align={value:"left"},r.baseline=o.baseline={signal:Gt},l="y",s="x",h="1-"):(r.align=o.align={signal:Nt},r.baseline={value:"top"},l="x",s="y"),r[l]=o[l]={signal:h+"datum."+Fe,mult:f},r[s]=o[s]=c,c.offset=j(e.labelOffset,t.gradientLabelOffset)||0,e=Et(Ut,St,Ue,Be,i,a,n),p&&(e.overlap={separation:g,method:p,order:"datum."+Ce}),e}function Yt(e,t,n,i,a,r,o,l){return{type:Ft,name:n,role:e,style:t,from:i,interactive:a||!1,encode:r,marks:o,layout:l}}function Ht(e,t,n,i,a){var r,o,l,s,u,d,c,f=Wt(e,t),p=n.entries,g=!(!p||!p.interactive),h=p?p.name:void 0,m=f("clipHeight"),y=f("symbolOffset"),v={data:"value"},b={},x=`${a} ? datum.${Le} : datum.${Me}`,k=m?jt(m):{field:Me},S=`datum.${Ce}`,$=`max(1, ${a})`;return k.mult=.5,b={enter:r={opacity:Qe,x:{signal:x,mult:.5,offset:y},y:k},update:o={opacity:Je,x:r.x,y:r.y},exit:{opacity:Qe}},e.fill||zt(b,{fill:t.symbolBaseFillColor,stroke:t.symbolBaseStrokeColor}),zt(b,{fill:f("symbolFillColor"),shape:f("symbolType"),size:f("symbolSize"),stroke:f("symbolStrokeColor"),strokeDash:f("symbolDash"),strokeDashOffset:f("symbolDashOffset"),strokeWidth:f("symbolStrokeWidth")},{opacity:f("symbolOpacity")}),Ye.forEach((function(t){e[t]&&(o[t]=r[t]={scale:e[t],field:Be})})),s=Et(Bt,$t,null,Be,v,b,n.symbols),m&&(s.clip=!0),(l=jt(y)).offset=f("labelOffset"),zt(b={enter:r={opacity:Qe,x:{signal:x,offset:l},y:k},update:o={opacity:Je,text:{field:Ae},x:r.x,y:r.y},exit:{opacity:Qe}},{align:f("labelAlign"),baseline:f("labelBaseline"),fill:f("labelColor"),fillOpacity:f("labelOpacity"),font:f("labelFont"),fontSize:f("labelFontSize"),fontStyle:f("labelFontStyle"),fontWeight:f("labelFontWeight"),limit:f("labelLimit")}),u=Et(Ut,St,Ue,Be,v,b,n.labels),b={enter:{noBound:{value:!m},width:Qe,height:m?jt(m):Qe,opacity:Qe},exit:{opacity:Qe},update:o={opacity:Je,row:{signal:null},column:{signal:null}}},f.isVertical(!0)?(d=`ceil(item.mark.items.length / ${$})`,o.row.signal=`${S}%${d}`,o.column.signal=`floor(${S} / ${d})`,c={field:["row",S]}):(o.row.signal=`floor(${S} / ${$})`,o.column.signal=`${S} % ${$}`,c={field:S}),o.column.signal=`${a}?${o.column.signal}:${S}`,(e=Yt(ct,null,h,i={facet:{data:i,name:"value",groupby:Ce}},g,Vt(b,p,He),[s,u])).sort=c,e}const Qt='item.orient === "left"',Jt='item.orient === "right"',Kt=`(${Qt} || ${Jt})`,Zt=`datum.vgrad && ${Kt}`,en=At('"top"','"bottom"','"middle"'),tn=`datum.vgrad && ${Jt} ? (${At('"right"','"left"','"center"')}) : (${Kt} && !(datum.vgrad && ${Qt})) ? "left" : ${Lt}`,nn=`item._anchor || (${Kt} ? "middle" : "start")`,an=`${Zt} ? (${Qt} ? -90 : 90) : 0`,rn=`${Kt} ? (datum.vgrad ? (${Jt} ? "bottom" : "top") : ${en}) : "top"`;function on(e,n){var i;return t.isObject(e)&&(e.signal?i=e.signal:e.path?i="pathShape("+ln(e.path)+")":e.sphere&&(i="geoShape("+ln(e.sphere)+', {type: "Sphere"})')),i?n.signalRef(i):!!e}function ln(e){return t.isObject(e)&&e.signal?e.signal:t.stringValue(e)}function sn(e){var t=e.role||"";return t.indexOf("axis")&&t.indexOf("legend")?e.type===Ft?ct:t||ut:t}function un(e){return{marktype:e.type,name:e.name||void 0,role:e.role||sn(e),zindex:+e.zindex||void 0}}function dn(e,t){return e&&e.signal?t.signalRef(e.signal):!1!==e}function cn(e,n){var i=o.definition(e.type);i||t.error("Unrecognized transform type: "+t.stringValue(e.type));var a=g(i.type.toLowerCase(),null,fn(i,e,n));return e.signal&&n.addSignal(e.signal,n.proxy(a)),a.metadata=i.metadata||{},a}function fn(e,t,n){var i,a,r,o={};for(a=0,r=e.params.length;a<r;++a)o[(i=e.params[a]).name]=pn(i,t,n);return o}function pn(e,n,i){var a=e.type,r=n[e.name];return"index"===a?function(e,n,i){t.isString(n.from)||t.error('Lookup "from" parameter must be a string literal.');return i.getData(n.from).lookupRef(i,n.key)}(0,n,i):void 0!==r?"param"===a?function(e,n,i){var a=n[e.name];return e.array?(t.isArray(a)||t.error("Expected an array of sub-parameters. Instead: "+t.stringValue(a)),a.map((function(t){return hn(e,t,i)}))):hn(e,a,i)}(e,n,i):"projection"===a?i.projectionRef(n[e.name]):e.array&&!O(r)?r.map((function(t){return gn(e,t,i)})):gn(e,r,i):void(e.required&&t.error("Missing required "+t.stringValue(n.type)+" parameter: "+t.stringValue(e.name)))}function gn(e,n,i){var a=e.type;if(O(n))return mn(a)?t.error("Expression references can not be signals."):yn(a)?i.fieldRef(n):vn(a)?i.compareRef(n):i.signalRef(n.signal);var r,o=e.expr||yn(a);return o&&((r=n)&&r.expr)?i.exprRef(n.expr,n.as):o&&function(e){return e&&e.field}(n)?y(n.field,n.as):mn(a)?f(n,i):function(e){return"data"===e}(a)?m(i.getData(n).values):yn(a)?y(n):vn(a)?i.compareRef(n):n}function hn(e,n,i){var a,r,o,l,s;for(l=0,s=e.params.length;l<s;++l){for(o in(r=e.params[l]).key)if(r.key[o]!==n[o]){r=null;break}if(r)break}return r||t.error("Unsupported parameter: "+t.stringValue(n)),a=t.extend(fn(r,n,i),r.key),m(i.add(ne(a)))}function mn(e){return"expr"===e}function yn(e){return"field"===e}function vn(e){return"compare"===e}function bn(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:m(t.getData(e.data).output)}function xn(e,t,n,i,a){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=a,this.index={}}xn.fromEntries=function(e,t){var n=t.length,i=1,a=t[0],r=t[n-1],o=t[n-2],l=null;for(a&&"load"===a.type&&(a=t[1]),e.add(t[0]);i<n;++i)t[i].params.pulse=m(t[i-1]),e.add(t[i]),"aggregate"===t[i].type&&(l=t[i]);return new xn(e,a,o,r,l)};var kn=xn.prototype;function Sn(e){return t.isString(e)?e:null}function $n(e,t,n){var i,a=k(n.op,n.field);if(t.ops){for(var r=0,o=t.as.length;r<o;++r)if(t.as[r]===a)return}else t.ops=["count"],t.fields=[null],t.as=["count"];n.op&&(t.ops.push((i=n.op.signal)?e.signalRef(i):n.op),t.fields.push(e.fieldRef(n.field)),t.as.push(a))}function On(e,n,i,a,r,o,l){var s,u,d=n[i]||(n[i]={}),c=function(e){return t.isObject(e)?(e.order===x?"-":"+")+k(e.op,e.field):""}(o),f=Sn(r);if(null!=f&&(e=n.scope,s=d[f+=c?"|"+c:""]),!s){var p=o?{field:v,pulse:n.countsRef(e,r,o)}:{field:e.fieldRef(r),pulse:m(n.output)};c&&(p.sort=e.sortRef(o)),u=e.add(g(a,void 0,p)),l&&(n.index[r]=u),s=m(u),null!=f&&(d[f]=s)}return s}function Rn(e,t,n){var i,a=e.remove,r=e.insert,o=e.toggle,l=e.modify,s=e.values,u=t.add(h());i=f("if("+e.trigger+',modify("'+n+'",'+[r,a,o,l,s].map((function(e){return null==e?"null":e})).join(",")+"),0)",t),u.update=i.$expr,u.params=i.$params}function jn(e,n){var i,a,r,o,l,s,u,d,c,f,p,g,h,v,b=sn(e),x=e.type===Ft,k=e.from&&e.from.facet,S=e.layout||b===ct||b===dt,$=b===ut||S||k,R=e.overlap;r=function(e,n,i){var a,r,o,l,s;return e?(a=e.facet)&&(n||t.error("Only group marks can be faceted."),null!=a.field?l=s=bn(a,i):(e.data?s=m(i.getData(e.data).aggregate):((o=cn(t.extend({type:"aggregate",groupby:t.array(a.groupby)},a.aggregate),i)).params.key=i.keyRef(a.groupby),o.params.pulse=bn(a,i),l=s=m(i.add(o))),r=i.keyRef(a.groupby,!0))):l=m(i.add(U(null,[{}]))),l||(l=bn(e,i)),{key:r,pulse:l,parent:s}}(e.from,x,n),f=m(a=n.add(I({key:r.key||(e.key?y(e.key):void 0),pulse:r.pulse,clean:!x}))),a=o=n.add(U({pulse:f})),a=n.add(K({markdef:un(e),interactive:dn(e.interactive,n),clip:on(e.clip,n),context:{$context:!0},groups:n.lookup(),parent:n.signals.parent?n.signalRef("parent"):null,index:n.markpath(),pulse:m(a)})),p=m(a),(a=l=n.add(N(Dt(e.encode,e.type,b,e.style,n,{mod:!1,pulse:p})))).params.parent=n.encode(),e.transform&&e.transform.forEach((function(e){const i=cn(e,n),r=i.metadata;(r.generates||r.changes)&&t.error("Mark transforms should not generate new data."),r.nomod||(l.params.mod=!0),i.params.pulse=m(a),n.add(a=i)})),e.sort&&(a=n.add(de({sort:n.compareRef(e.sort),pulse:m(a)}))),g=m(a),(k||S)&&(h=m(S=n.add(ce({layout:n.objectProperty(e.layout),legends:n.legends,mark:p,pulse:g})))),v=m(s=n.add(B({mark:p,pulse:h||g}))),x&&($&&((i=n.operators).pop(),S&&i.pop()),n.pushState(g,h||v,f),k?function(e,n,i){var a,r,o,l,s=e.from.facet,u=s.name,d=bn(s,n);s.name||t.error("Facet must have a name: "+t.stringValue(s)),s.data||t.error("Facet must reference a data set: "+t.stringValue(s)),s.field?l=n.add(ie({field:n.fieldRef(s.field),pulse:d})):s.groupby?l=n.add(X({key:n.keyRef(s.groupby),group:m(n.proxy(i.parent)),pulse:d})):t.error("Facet must specify groupby or field: "+t.stringValue(s)),r=(a=n.fork()).add(U()),o=a.add(ue({pulse:m(r)})),a.addData(u,new xn(a,r,r,o)),a.addSignal("parent",null),l.params.subflow={$subflow:Tn(e,a).toRuntime()}}(e,n,r):$?function(e,t,n){var i=t.add(ie({pulse:n.pulse})),a=t.fork();a.add(ue()),a.addSignal("parent",null),i.params.subflow={$subflow:Tn(e,a).toRuntime()}}(e,n,r):Tn(e,n),n.popState(),$&&(S&&i.push(S),i.push(s))),R&&(v=function(e,t,n){var i,a=e.method,r=e.bound,o=e.separation,l={separation:O(o)?n.signalRef(o.signal):o,method:O(a)?n.signalRef(a.signal):a,pulse:t};e.order&&(l.sort=n.compareRef({field:e.order}));r&&(i=r.tolerance,l.boundTolerance=O(i)?n.signalRef(i.signal):+i,l.boundScale=n.scaleRef(r.scale),l.boundOrient=r.orient);return m(n.add(te(l)))}(R,v,n)),u=n.add(le({pulse:v})),d=n.add(ue({pulse:m(u)},void 0,n.parent())),null!=e.name&&(c=e.name,n.addData(c,new xn(n,o,u,d)),e.on&&e.on.forEach((function(e){(e.insert||e.remove||e.toggle)&&t.error("Marks only support modify triggers."),Rn(e,n,c)})))}function wn(e,n){var i,a,o,l,s,u,d,c,p,g=n.config.legend,h=e.encode||{},y=h.legend||{},v=y.name||void 0,b=y.interactive,x=y.style,k=Wt(e,g),S=Ye.reduce((function(t,n){return t||e[n]}),0);return S||t.error("Missing valid scale for legend."),s=function(e,t){var n=e.type||Ne;e.type||1!==function(e){return Ye.reduce((function(t,n){return t+(e[n]?1:0)}),0)}(e)||!e.fill&&!e.stroke||(n=r.isContinuous(t)?Ge:r.isDiscretizing(t)?Xe:Ne);return n!==Ge?n:r.isDiscretizing(t)?Xe:Ge}(e,n.scaleType(S)),u={title:null!=e.title,type:s,vgrad:"symbol"!==s&&k.isVertical()},d=m(n.add(U(null,[u]))),y=Vt(function(e,t){var n={enter:{},update:{}};return zt(n,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:t.strokeWidth,strokeDash:t.strokeDash,x:e("legendX"),y:e("legendY")}),n}(k,g),y,He),i={enter:{x:{value:0},y:{value:0}}},c=m(n.add(Q(o={type:s,scale:n.scaleRef(S),count:n.objectProperty(e.tickCount),values:n.objectProperty(e.values),minstep:n.property(e.tickMinStep),formatType:n.property(e.formatType),formatSpecifier:n.property(e.format)}))),s===Ge?(l=[qt(e,S,g,h.gradient),Xt(e,g,h.labels,c)],o.count=o.count||n.signalRef(`max(2,2*floor((${w(k.gradientLength())})/100))`)):s===Xe?l=[It(e,S,g,h.gradient,c),Xt(e,g,h.labels,c)]:(a=function(e,t){const n=Wt(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(e,g),l=[Ht(e,g,h,c,w(a.columns))],o.size=function(e,t,n){var i=w(zn("size",e,n)),a=w(zn("strokeWidth",e,n)),r=w(function(e,t,n){return Ct("fontSize",e)||function(e,t,n){var i=t.config.style[n];return i&&i[e]}("fontSize",t,n)}(n[1].encode,t,Ue));return f(`max(ceil(sqrt(${i})+${a}),${r})`,t)}(e,n,l[0].marks)),l=[Yt(xt,null,null,d,b,i,l,a)],u.title&&l.push(function(e,t,n,i){var a,r=Wt(e,t);return zt(a={enter:{opacity:Qe},update:{opacity:Je,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:Qe}},{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:nn},angle:{signal:an},align:{signal:tn},baseline:{signal:rn},text:e.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit")},{align:r("titleAlign"),baseline:r("titleBaseline")}),Et(Ut,Ot,qe,null,i,a,n)}(e,g,h.title,d)),p=Yt(vt,x,v,d,b,y,l),e.zindex&&(p.zindex=e.zindex),jn(p,n)}function zn(e,t,n){return t[e]?`scale("${t[e]}",datum)`:Ct(e,n[0].encode)}kn.countsRef=function(e,t,n){var i,a,r,o=this.counts||(this.counts={}),l=Sn(t);return null!=l&&(e=this.scope,i=o[l]),i?n&&n.field&&$n(e,i.agg.params,n):(r={groupby:e.fieldRef(t,"key"),pulse:m(this.output)},n&&n.field&&$n(e,r,n),a=e.add(T(r)),i=e.add(U({pulse:m(a)})),i={agg:a,ref:m(i)},null!=l&&(o[l]=i)),i.ref},kn.tuplesRef=function(){return m(this.values)},kn.extentRef=function(e,t){return On(e,this,"extent","extent",t,!1)},kn.domainRef=function(e,t){return On(e,this,"domain","values",t,!1)},kn.valuesRef=function(e,t,n){return On(e,this,"vals","values",t,n||!0)},kn.lookupRef=function(e,t){return On(e,this,"lookup","tupleindex",t,!1)},kn.indataRef=function(e,t){return On(e,this,"indata","tupleindex",t,!0,!0)};const Vn=`item.orient==="${Ve}"?-90:item.orient==="${De}"?90:0`,Dn=`item.orient==="${Pe}"?"${ze}":"${Pe}"`;function Pn(e,n){e=t.isString(e)?{text:e}:e;var i,a,r=n.config.title,o=t.extend({},e.encode);return i=m(n.add(U(null,[{}]))),o.name=e.name,o.interactive=e.interactive,a=function(e,t,n,i){var a,r=Wt(e,t),o={value:0},l=e.text;return zt(a={enter:{opacity:o},update:{opacity:{value:1}},exit:{opacity:o}},{text:l,orient:r("orient"),anchor:r("anchor"),align:{signal:Lt},angle:{signal:Vn},baseline:{signal:Dn},dx:r("dx"),dy:r("dy"),fill:r("color"),font:r("font"),fontSize:r("fontSize"),fontStyle:r("fontStyle"),fontWeight:r("fontWeight"),frame:r("frame"),limit:r("limit"),offset:r("offset")||0},{align:r("align"),angle:r("angle"),baseline:r("baseline")}),Et(Ut,Rt,e.style||Ie,null,i,a,n)}(e,r,o,i),e.zindex&&(a.zindex=e.zindex),jn(a,n)}function _n(e,n){var i=[];e.transform&&e.transform.forEach((function(e){i.push(cn(e,n))})),e.on&&e.on.forEach((function(t){Rn(t,n,e.name)})),n.addDataPipeline(e.name,function(e,n,i){var a,r,o,l,s,u=[],d=null,c=!1,f=!1;e.values?R(e.values)||R(e.format)?(u.push(Wn(n,e)),u.push(d=En())):u.push(d=En({$ingest:e.values,$format:e.format})):e.url?R(e.url)||R(e.format)?(u.push(Wn(n,e)),u.push(d=En())):u.push(d=En({$request:e.url,$format:e.format})):e.source&&(d=a=t.array(e.source).map((function(e){return m(n.getData(e).output)})),u.push(null));for(r=0,o=i.length;r<o;++r)l=i[r],s=l.metadata,d||s.source||u.push(d=En()),u.push(l),s.generates&&(f=!0),s.modifies&&!f&&(c=!0),s.source?d=l:s.changes&&(d=null);a&&(o=a.length-1,u[0]=oe({derive:c,pulse:o?a:a[0]}),(c||o)&&u.splice(1,0,En()));d||u.push(En());return u.push(ue({})),u}(e,n,i))}function En(e){var t=U({},e);return t.metadata={source:!0},t}function Wn(e,t){return J({url:t.url?e.property(t.url):void 0,values:t.values?e.property(t.values):void 0,format:e.objectProperty(t.format)})}function Cn(e,t){return{scale:e.scale,range:t}}function An(e,n,i,a){var r,o,l,s,u,d,c,f,p,g=Wt(e,n),h=e.orient,m=e.gridScale,y=h===Ve||h===ze?1:-1,v=function(e,n){if(1===n);else if(t.isObject(e)){for(var i=e=t.extend({},e);null!=i.mult;){if(!t.isObject(i.mult))return i.mult*=n,e;i=i.mult=t.extend({},i.mult)}i.mult=n}else e=n*(e||0);return e}(e.offset,y);return zt(r={enter:o={opacity:Qe},update:s={opacity:Je},exit:l={opacity:Qe}},{stroke:g("gridColor"),strokeDash:g("gridDash"),strokeDashOffset:g("gridDashOffset"),strokeOpacity:g("gridOpacity"),strokeWidth:g("gridWidth")}),u={scale:e.scale,field:Be,band:g("bandPosition"),round:g("tickRound"),extra:g("tickExtra"),offset:g("tickOffset")},h===ze||h===Pe?(d="x",c="y",p="height"):(d="y",c="x",p="width"),f=c+"2",s[d]=o[d]=l[d]=u,m?(s[c]=o[c]={scale:m,range:0,mult:y,offset:v},s[f]=o[f]={scale:m,range:1,mult:y,offset:v}):(s[c]=o[c]={value:0,offset:v},s[f]=o[f]={signal:p,mult:y,offset:v}),Et(Mt,gt,null,Be,a,r,i)}function Ln(e,t,n,i,a){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+a+")"}}function Fn(e,n){var i,a,r,o,l,s,u=function(e,n){var i=n.config,a=e.orient,r=a===ze||a===Pe?i.axisX:i.axisY,o=i["axis"+a[0].toUpperCase()+a.slice(1)],l="band"===n.scaleType(e.scale)&&i.axisBand;return r||o||l?t.extend({},i.axis,r,o,l):i.axis}(e,n),d=e.encode||{},c=d.axis||{},f=c.name||void 0,p=c.interactive,g=c.style,h=Wt(e,u);return i={orient:e.orient,ticks:!!h("ticks"),labels:!!h("labels"),grid:!!h("grid"),domain:!!h("domain"),title:null!=e.title},a=m(n.add(U({},[i]))),c=Vt({update:{offset:jt(h("offset")||0),position:jt(j(e.position,0)),titlePadding:jt(h("titlePadding")),minExtent:jt(h("minExtent")),maxExtent:jt(h("maxExtent")),range:{signal:`abs(span(range("${e.scale}")))`}}},d.axis,He),r=m(n.add(M({scale:n.scaleRef(e.scale),extra:n.property(h("tickExtra")),count:n.objectProperty(e.tickCount),values:n.objectProperty(e.values),minstep:n.property(e.tickMinStep),formatType:n.property(e.formatType),formatSpecifier:n.property(e.format)}))),s=[],i.grid&&s.push(An(e,u,d.grid,r)),i.ticks&&(o=h("tickSize"),s.push(function(e,t,n,i,a){var r,o,l,s,u,d,c=Wt(e,t),f=e.orient,p=f===Ve||f===ze?-1:1;return zt(r={enter:o={opacity:Qe},update:s={opacity:Je},exit:l={opacity:Qe}},{stroke:c("tickColor"),strokeDash:c("tickDash"),strokeDashOffset:c("tickDashOffset"),strokeOpacity:c("tickOpacity"),strokeWidth:c("tickWidth")}),(u=jt(a)).mult=p,d={scale:e.scale,field:Be,band:c("bandPosition"),round:c("tickRound"),extra:c("tickExtra"),offset:c("tickOffset")},f===ze||f===Pe?(s.y=o.y=Qe,s.y2=o.y2=u,s.x=o.x=l.x=d):(s.x=o.x=Qe,s.x2=o.x2=u,s.y=o.y=l.y=d),Et(Mt,mt,null,Be,i,r,n)}(e,u,d.ticks,r,o))),i.labels&&(o=i.ticks?o:0,s.push(function(e,t,n,i,a){var r,o,l,s,u,d,c,f,p,g,h=Wt(e,t),m=e.orient,y=m===Ve||m===ze?-1:1,v=m===ze||m===Pe,b=e.scale,x=w(h("labelFlush")),k=w(h("labelFlushOffset")),S=0===x||!!x,$=h("labelAlign"),O=h("labelBaseline");return(l=jt(a)).mult=y,l.offset=jt(h("labelPadding")||0),l.offset.mult=y,s={scale:b,field:Be,band:.5,offset:h("tickOffset")},v?(u=$||(S?Ln(b,x,'"left"','"right"','"center"'):"center"),d=O||(m===ze?"bottom":"top"),c=!$):(u=$||(m===De?"left":"right"),d=O||(S?Ln(b,x,'"top"','"bottom"','"middle"'):"middle"),c=!O),c=c&&S&&k?Ln(b,x,"-("+k+")",k,0):null,zt(r={enter:o={opacity:Qe,x:v?s:l,y:v?l:s},update:{opacity:Je,text:{field:Ae},x:o.x,y:o.y},exit:{opacity:Qe,x:o.x,y:o.y}},{[v?"dx":"dy"]:c,align:u,baseline:d,angle:h("labelAngle"),fill:h("labelColor"),fillOpacity:h("labelOpacity"),font:h("labelFont"),fontSize:h("labelFontSize"),fontWeight:h("labelFontWeight"),fontStyle:h("labelFontStyle"),limit:h("labelLimit")}),f=h("labelBound"),p=h("labelOverlap"),g=h("labelSeparation"),e=Et(Ut,ht,Ue,Be,i,r,n),(p||f)&&(e.overlap={separation:g,method:p,order:"datum.index",bound:f?{scale:b,orient:m,tolerance:f}:null}),e}(e,u,d.labels,r,o))),i.domain&&s.push(function(e,t,n,i){var a,r,o,l,s,u,d=Wt(e,t),c=e.orient;return zt(a={enter:r={opacity:Qe},update:o={opacity:Je},exit:{opacity:Qe}},{stroke:d("domainColor"),strokeDash:d("domainDash"),strokeDashOffset:d("domainDashOffset"),strokeWidth:d("domainWidth"),strokeOpacity:d("domainOpacity")}),c===ze||c===Pe?(l="x",u="y"):(l="y",u="x"),s=l+"2",r[u]=Qe,o[l]=r[l]=Cn(e,0),o[s]=r[s]=Cn(e,1),Et(Mt,pt,null,null,i,a,n)}(e,u,d.domain,a)),i.title&&s.push(function(e,n,i,a){var r,o,l,s,u=Wt(e,n),d=e.orient,c=d===Ve||d===ze?-1:1,f=d===ze||d===Pe;return r={enter:o={opacity:Qe,anchor:jt(u("titleAnchor")),align:{signal:Lt}},update:l=t.extend({},o,{opacity:Je,text:jt(e.title)}),exit:{opacity:Qe}},s={signal:`lerp(range("${e.scale}"), ${At(0,1,.5)})`},f?(l.x=s,o.angle={value:0},o.baseline={value:d===ze?"bottom":"top"}):(l.y=s,o.angle={value:90*c},o.baseline={value:"bottom"}),zt(r,{angle:u("titleAngle"),baseline:u("titleBaseline"),fill:u("titleColor"),fillOpacity:u("titleOpacity"),font:u("titleFont"),fontSize:u("titleFontSize"),fontStyle:u("titleFontStyle"),fontWeight:u("titleFontWeight"),limit:u("titleLimit")},{align:u("titleAlign")}),!wt(r,"x",u("titleX"),"update")&&!f&&!_t("x",i)&&(r.enter.auto={value:!0}),!wt(r,"y",u("titleY"),"update")&&f&&!_t("y",i)&&(r.enter.auto={value:!0}),Et(Ut,yt,qe,null,a,r,i)}(e,u,d.title,a)),l=Yt(ft,g,f,a,p,c,s),e.zindex&&(l.zindex=e.zindex),jn(l,n)}function Tn(e,n,i){var a=t.array(e.signals),o=t.array(e.scales);return i||a.forEach(e=>c(e,n)),t.array(e.projections).forEach(e=>(function(e,t){var n={};for(var i in e)"name"!==i&&(n[i]=we(e[i],i,t));t.addProjection(e.name,n)})(e,n)),o.forEach(e=>(function(e,n){var i=e.type||"linear";r.isValidScaleType(i)||t.error("Unrecognized scale type: "+t.stringValue(i)),n.addScale(e.name,{type:i,domain:void 0})})(e,n)),t.array(e.data).forEach(e=>_n(e,n)),o.forEach(e=>he(e,n)),(i||a).forEach(e=>L(e,n)),t.array(e.axes).forEach(e=>Fn(e,n)),t.array(e.marks).forEach(e=>jn(e,n)),t.array(e.legends).forEach(e=>wn(e,n)),e.title&&Pn(e.title,n),n.parseLambdas(),n}var Mn=t.toSet(["width","height","padding","autosize"]);function Bn(e,n){var i,a,r,o,s,u,d=n.config;return n.background=e.background||d.background,n.eventConfig=d.events,s=m(n.root=n.add(h())),n.addSignal("width",e.width||0),n.addSignal("height",e.height||0),n.addSignal("padding",function(e,n){return e=e||n.padding,t.isObject(e)?{top:l(e.top),bottom:l(e.bottom),left:l(e.left),right:l(e.right)}:{top:i=l(e),bottom:i,left:i,right:i};var i}(e.padding,d)),n.addSignal("autosize",function(e,n){return e=e||n.autosize,t.isObject(e)?e:{type:e||"pad"}}(e.autosize,d)),n.legends=n.objectProperty(d.legend&&d.legend.layout),u=function(e,n,i){if(t.array(n).forEach(t=>{Mn[t.name]||c(t,e)}),!i)return n;const a=t.array(n).slice();return t.array(i).forEach(t=>{e.hasOwnSignal(t.name)||(c(t,e),a.push(t))}),a}(n,e.signals,d.signals),a=n.add(U()),r=Vt({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e.encode),r=n.add(N(Dt(r,Ft,dt,e.style,n,{pulse:m(a)}))),o=n.add(ce({layout:n.objectProperty(e.layout),legends:n.legends,autosize:n.signalRef("autosize"),mark:s,pulse:m(r)})),n.operators.pop(),n.pushState(m(r),m(o),null),Tn(e,n,u),n.operators.push(o),i=n.add(B({mark:s,pulse:m(o)})),i=n.add(le({pulse:m(i)})),i=n.add(ue({pulse:m(i)})),n.addData("root",new xn(n,a,a,i)),n}function Un(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 qn(e){this.config=e.config,this.legends=e.legends,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 In=Un.prototype=qn.prototype;function Nn(e){return(t.isArray(e)?Gn:Xn)(e)}function Gn(e){for(var n,i="[",a=0,r=e.length;a<r;++a)n=e[a],i+=(a>0?",":"")+(t.isObject(n)?n.signal||Nn(n):t.stringValue(n));return i+"]"}function Xn(e){var n,i,a="{",r=0;for(n in e)i=e[n],a+=(++r>1?",":"")+t.stringValue(n)+":"+(t.isObject(i)?i.signal||Nn(i):t.stringValue(i));return a+"}"}function Yn(e){return(e||[]).reduce((e,t)=>{for(var n in t)if("signals"===n)e.signals=Qn(e.signals,t.signals);else{var i="legend"===n?{layout:1}:"style"===n||null;Hn(e,n,t[n],i)}return e},{padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:ei},area:{fill:ei},image:null,line:{stroke:ei,strokeWidth:Zn},path:{stroke:ei},rect:{fill:ei},rule:{stroke:ti},shape:{stroke:ei},symbol:{fill:ei,size:64},text:{fill:ti,font:Jn,fontSize:11},style:{"guide-label":{fill:ti,font:Jn,fontSize:10},"guide-title":{fill:ti,font:Jn,fontSize:11,fontWeight:"bold"},"group-title":{fill:ti,font:Jn,fontSize:13,fontWeight:"bold"},point:{size:Kn,strokeWidth:Zn,shape:"circle"},circle:{size:Kn,strokeWidth:Zn},square:{size:Kn,strokeWidth:Zn,shape:"square"},cell:{fill:"transparent",stroke:ii}},title:{orient:"top",anchor:"middle",offset:4},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:ni,grid:!1,gridWidth:1,gridColor:ii,labels:!0,labelAngle:0,labelLimit:180,labelPadding:2,ticks:!0,tickColor:ni,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-1},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:ii,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:ni,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}})}function Hn(e,n,i,a){var r,o;if(t.isObject(i)&&!t.isArray(i))for(r in o=t.isObject(e[n])?e[n]:e[n]={},i)a&&(!0===a||a[r])?Hn(o,r,i[r]):o[r]=i[r];else e[n]=i}function Qn(e,t){if(null==e)return t;const n={},i=[];function a(e){n[e.name]||(n[e.name]=1,i.push(e))}return t.forEach(a),e.forEach(a),i}In.fork=function(){return new qn(this)},In.isSubscope=function(){return this._subid>0},In.toRuntime=function(){return this.finish(),{background:this.background,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig}},In.id=function(){return(this._subid?this._subid+":":0)+this._id++},In.add=function(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach((function(t){t.$ref=e.id})),e.refs=null),e},In.proxy=function(e){var t=e instanceof p?m(e):e;return this.add(re({value:t}))},In.addStream=function(e){return this.streams.push(e),e.id=this.id(),e},In.addUpdate=function(e){return this.updates.push(e),e},In.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 i;e&&((i=e.data||(e.data={}))[t]||(i[t]=[])).push(n)}for(e in this.data)for(var i in n((t=this.data[e]).input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values"),t.index)n(t.index[i],e,"index:"+i);return this},In.pushState=function(e,t,n){this._encode.push(m(this.add(ue({pulse:e})))),this._parent.push(t),this._lookup.push(n?m(this.proxy(n)):null),this._markpath.push(-1)},In.popState=function(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},In.parent=function(){return t.peek(this._parent)},In.encode=function(){return t.peek(this._encode)},In.lookup=function(){return t.peek(this._lookup)},In.markpath=function(){var e=this._markpath;return++e[e.length-1]},In.fieldRef=function(e,n){if(t.isString(e))return y(e,n);e.signal||t.error("Unsupported field reference: "+t.stringValue(e));var i,a=e.signal,r=this.field[a];return r||(i={name:this.signalRef(a)},n&&(i.as=n),this.field[a]=r=m(this.add(Y(i)))),r},In.compareRef=function(e){function n(e){return O(e)?(a=!0,i.signalRef(e.signal)):function(e){return e&&e.expr}(e)?(a=!0,i.exprRef(e.expr)):e}var i=this,a=!1,r=t.array(e.field).map(n),o=t.array(e.order).map(n);return a?m(this.add(q({fields:r,orders:o}))):b(r,o)},In.keyRef=function(e,n){var i=this.signals,a=!1;return e=t.array(e).map((function(e){return O(e)?(a=!0,m(i[e.signal])):e})),a?m(this.add(H({fields:e,flat:n}))):function(e,t){var n={$key:e};return t&&(n.$flat=!0),n}(e,n)},In.sortRef=function(e){if(!e)return e;var t=k(e.op,e.field),n=e.order||"ascending";return n.signal?m(this.add(q({fields:t,orders:this.signalRef(n.signal)}))):b(t,n)},In.event=function(e,t){var n=e+":"+t;if(!this.events[n]){var i=this.id();this.streams.push({id:i,source:e,type:t}),this.events[n]=i}return this.events[n]},In.hasOwnSignal=function(e){return t.hasOwnProperty(this.signals,e)},In.addSignal=function(e,n){this.hasOwnSignal(e)&&t.error("Duplicate signal name: "+t.stringValue(e));var i=n instanceof p?n:this.add(h(n));return this.signals[e]=i},In.getSignal=function(e){return this.signals[e]||t.error("Unrecognized signal name: "+t.stringValue(e)),this.signals[e]},In.signalRef=function(e){return this.signals[e]?m(this.signals[e]):(t.hasOwnProperty(this.lambdas,e)||(this.lambdas[e]=this.add(h(null))),m(this.lambdas[e]))},In.parseLambdas=function(){for(var e=Object.keys(this.lambdas),t=0,n=e.length;t<n;++t){var i=e[t],a=f(i,this),r=this.lambdas[i];r.params=a.$params,r.update=a.$expr}},In.property=function(e){return e&&e.signal?this.signalRef(e.signal):e},In.objectProperty=function(e){return e&&t.isObject(e)?this.signalRef(e.signal||Nn(e)):e},In.exprRef=function(e,t){var n={expr:f(e,this)};return t&&(n.expr.$name=t),m(this.add(G(n)))},In.addBinding=function(e,n){this.bindings||t.error("Nested signals do not support binding: "+t.stringValue(e)),this.bindings.push(t.extend({signal:e},n))},In.addScaleProj=function(e,n){t.hasOwnProperty(this.scales,e)&&t.error("Duplicate scale or projection name: "+t.stringValue(e)),this.scales[e]=this.add(n)},In.addScale=function(e,t){this.addScaleProj(e,se(t))},In.addProjection=function(e,t){this.addScaleProj(e,ae(t))},In.getScale=function(e){return this.scales[e]||t.error("Unrecognized scale name: "+t.stringValue(e)),this.scales[e]},In.projectionRef=In.scaleRef=function(e){return m(this.getScale(e))},In.projectionType=In.scaleType=function(e){return this.getScale(e).params.type},In.addData=function(e,n){return t.hasOwnProperty(this.data,e)&&t.error("Duplicate data set name: "+t.stringValue(e)),this.data[e]=n},In.getData=function(e){return this.data[e]||t.error("Undefined data set name: "+t.stringValue(e)),this.data[e]},In.addDataPipeline=function(e,n){return t.hasOwnProperty(this.data,e)&&t.error("Duplicate data set name: "+t.stringValue(e)),this.addData(e,xn.fromEntries(this,n))};var Jn="sans-serif",Kn=30,Zn=2,ei="#4c78a8",ti="#000",ni="#888",ii="#ddd";e.AxisDomainRole=pt,e.AxisGridRole=gt,e.AxisLabelRole=ht,e.AxisRole=ft,e.AxisTickRole=mt,e.AxisTitleRole=yt,e.DataScope=xn,e.FrameRole=dt,e.LegendEntryRole=xt,e.LegendLabelRole=St,e.LegendRole=vt,e.LegendSymbolRole=$t,e.LegendTitleRole=Ot,e.MarkRole=ut,e.Scope=Un,e.ScopeRole=ct,e.config=Yn,e.parse=function(e,n){return t.isObject(e)||t.error("Input Vega specification must be an object."),Bn(e,new Un(Yn([n,e.config]))).toRuntime()},e.signal=c,e.signalUpdates=L,e.stream=V,Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "vega-parser", | ||
"version": "5.8.2", | ||
"version": "5.8.3", | ||
"description": "Parse Vega specifications to runtime dataflows.", | ||
@@ -34,3 +34,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "c2aff3dce1a28f8b852b64bbaf5cae0d2ba41ef2" | ||
"gitHead": "9badf6d2d1490057f4010e3796189ca366878101" | ||
} |
@@ -77,3 +77,3 @@ import parseAutosize from './autosize'; | ||
if (!config) return signals; | ||
const out = signals.slice(); | ||
const out = array(signals).slice(); | ||
@@ -80,0 +80,0 @@ // add config signals if not already defined |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
268084