vega-functions
Advanced tools
Comparing version 5.7.0 to 5.7.1
@@ -370,3 +370,3 @@ (function (global, factory) { | ||
const s = getScale(name, (group || this).context); | ||
return s && value !== undefined ? s(value) : undefined; | ||
return s ? s(value) : undefined; | ||
} | ||
@@ -373,0 +373,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vega-util"),require("vega-expression"),require("d3-geo"),require("d3-color"),require("vega-dataflow"),require("vega-scale"),require("vega-scenegraph"),require("vega-selections"),require("vega-statistics"),require("vega-time"),require("d3-array")):"function"==typeof define&&define.amd?define(["exports","vega-util","vega-expression","d3-geo","d3-color","vega-dataflow","vega-scale","vega-scenegraph","vega-selections","vega-statistics","vega-time","d3-array"],e):e((t=t||self).vega={},t.vega,t.vega,t.d3,t.d3,t.vega,t.vega,t.vega,t.vega,t.vega,t.vega,t.d3)}(this,(function(t,e,n,r,a,o,i,s,c,u,l,f){"use strict";function d(t){const e=this.context.data[t];return e?e.values.value:[]}function m(t,e,n){const r=this.context.data[t]["index:"+e],a=r?r.value.get(n):void 0;return a?a.count:a}function g(t,n){const r=this.context.dataflow,a=this.context.data[t].input;return r.pulse(a,r.changeset().remove(e.truthy).insert(n)),1}function p(t,e,n){if(t){const n=this.context.dataflow,r=t.mark.source;n.pulse(r,n.changeset().encode(t,e))}return void 0!==n?n:t}const h=t=>function(e,n){return this.context.dataflow.locale()[t](n)(e)},v=h("format"),y=h("timeFormat"),x=h("utcFormat"),b=h("timeParse"),w=h("utcParse");var S=new Date(2e3,0,1);function q(t,e,n){return Number.isInteger(t)&&Number.isInteger(e)?(S.setYear(2e3),S.setMonth(t),S.setDate(e),y.call(this,S,n)):""}function P(t){return q.call(this,t,1,"%B")}function N(t){return q.call(this,t,1,"%b")}function L(t){return q.call(this,0,2+t,"%A")}function A(t){return q.call(this,0,2+t,"%a")}function F(t,r,a,o){r[0].type!==n.Literal&&e.error("First argument to data functions must be a string literal.");const i=r[0].value,s=":"+i;if(!e.hasOwnProperty(s,o))try{o[s]=a.getData(i).tuplesRef()}catch(t){}}function k(t,r,a,o){r[0].type!==n.Literal&&e.error("First argument to indata must be a string literal."),r[1].type!==n.Literal&&e.error("Second argument to indata must be a string literal.");const i=r[0].value,s=r[1].value,c="@"+s;e.hasOwnProperty(c,o)||(o[c]=a.getData(i).indataRef(a,s))}function _(t,e,r,a){if(e[0].type===n.Literal)O(r,a,e[0].value);else for(t in r.scales)O(r,a,t)}function O(t,n,r){const a="%"+r;if(!e.hasOwnProperty(n,a))try{n[a]=t.scaleRef(r)}catch(t){}}function R(t,n){let r;return e.isFunction(t)?t:e.isString(t)?(r=n.scales[t])&&r.value:void 0}function z(t,e){return function(n,r,a){if(n){const e=R(n,(a||this).context);return e&&e.path[t](r)}return e(r)}}const D=z("area",r.geoArea),E=z("bounds",r.geoBounds),U=z("centroid",r.geoCentroid);function V(t){let e=this.context.group,n=!1;if(e)for(;t;){if(t===e){n=!0;break}t=t.mark.group}return n}function B(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(e){t.warn(e)}return n[n.length-1]}function $(){return B(this.context.dataflow,"warn",arguments)}function M(){return B(this.context.dataflow,"info",arguments)}function j(){return B(this.context.dataflow,"debug",arguments)}function C(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function T(t){const e=a.rgb(t);return.2126*C(e.r)+.7152*C(e.g)+.0722*C(e.b)}function X(t,e){const n=T(t),r=T(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Y(){var t=[].slice.call(arguments);return t.unshift({}),e.extend.apply(null,t)}function I(t,n){return t===n||t!=t&&n!=n||(e.isArray(t)?!(!e.isArray(n)||t.length!==n.length)&&function(t,e){for(let n=0,r=t.length;n<r;++n)if(!I(t[n],e[n]))return!1;return!0}(t,n):!(!e.isObject(t)||!e.isObject(n))&&G(t,n))}function G(t,e){for(let n in t)if(!I(t[n],e[n]))return!1;return!0}function H(t){return e=>G(t,e)}function W(t,n,r,a,i,s){let c,u,l=this.context.dataflow,f=this.context.data[t],d=f.input,m=f.changes,g=l.stamp();if(!1===l._trigger||!(d.value.length||n||a))return 0;if((!m||m.stamp<g)&&(f.changes=m=l.changeset(),m.stamp=g,l.runAfter((function(){f.modified=!0,l.pulse(d,m).run()}),!0,1)),r&&(c=!0===r?e.truthy:e.isArray(r)||o.isTuple(r)?r:H(r),m.remove(c)),n&&m.insert(n),a&&(c=H(a),d.value.some(c)?m.remove(c):m.insert(a)),i)for(u in s)m.modify(i,u,s[u]);return 1}function J(t){const e=t.touches,n=e[0].clientX-e[1].clientX,r=e[0].clientY-e[1].clientY;return Math.sqrt(n*n+r*r)}function K(t){const e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)}function Q(t,e,n){return i.bandSpace(t||0,e||0,n||0)}function Z(t,e){const n=R(t,(e||this).context);return n&&n.bandwidth?n.bandwidth():0}function tt(t,e){const n=R(t,(e||this).context);return n?n.copy():void 0}function et(t,e){const n=R(t,(e||this).context);return n?n.domain():[]}function nt(t,n,r){const a=R(t,(r||this).context);return a?e.isArray(n)?(a.invertRange||a.invert)(n):(a.invert||a.invertExtent)(n):void 0}function rt(t,e){const n=R(t,(e||this).context);return n&&n.range?n.range():[]}function at(t,e,n){const r=R(t,(n||this).context);return r&&void 0!==e?r(e):void 0}function ot(t,n,r,a,o){t=R(t,(o||this).context);const c=s.Gradient(n,r);let u=t.domain(),l=u[0],f=e.peek(u),d=e.identity;return f-l?d=i.scaleFraction(t,l,f):t=(t.interpolator?i.scale("sequential")().interpolator(t.interpolator()):i.scale("linear")().interpolate(t.interpolate()).range(t.range())).domain([l=0,f=1]),t.ticks&&(u=t.ticks(+a||15),l!==u[0]&&u.unshift(l),f!==e.peek(u)&&u.push(f)),u.forEach(e=>c.stop(d(e),t(e))),c}function it(t,e,n){const r=R(t,(n||this).context);return function(t){return r?r.path.context(t)(e):""}}function st(t){let e=null;return function(n){return n?s.pathRender(n,e=e||s.pathParse(t)):t}}const ct=t=>t.data;function ut(t,e){const n=d.call(e,t);return n.root&&n.root.lookup||{}}function lt(t,e,n){const r=ut(t,this),a=r[e],o=r[n];return a&&o?a.path(o).map(ct):void 0}function ft(t,e){const n=ut(t,this)[e];return n?n.ancestors().map(ct):void 0}const dt=()=>"undefined"!=typeof window&&window||null;function mt(){const t=dt();return t?t.screen:{}}function gt(){const t=dt();return t?[t.innerWidth,t.innerHeight]:[void 0,void 0]}function pt(){const t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]}const ht={random:function(){return u.random()},cumulativeNormal:u.cumulativeNormal,cumulativeLogNormal:u.cumulativeLogNormal,cumulativeUniform:u.cumulativeUniform,densityNormal:u.densityNormal,densityLogNormal:u.densityLogNormal,densityUniform:u.densityUniform,quantileNormal:u.quantileNormal,quantileLogNormal:u.quantileLogNormal,quantileUniform:u.quantileUniform,sampleNormal:u.sampleNormal,sampleLogNormal:u.sampleLogNormal,sampleUniform:u.sampleUniform,isArray:e.isArray,isBoolean:e.isBoolean,isDate:e.isDate,isDefined:function(t){return void 0!==t},isNumber:e.isNumber,isObject:e.isObject,isRegExp:e.isRegExp,isString:e.isString,isTuple:o.isTuple,isValid:function(t){return null!=t&&t==t},toBoolean:e.toBoolean,toDate:e.toDate,toNumber:e.toNumber,toString:e.toString,flush:e.flush,lerp:e.lerp,merge:Y,pad:e.pad,peek:e.peek,span:e.span,inrange:e.inrange,truncate:e.truncate,rgb:a.rgb,lab:a.lab,hcl:a.hcl,hsl:a.hsl,luminance:T,contrast:X,sequence:f.range,format:v,utcFormat:x,utcParse:w,utcOffset:l.utcOffset,utcSequence:l.utcSequence,timeFormat:y,timeParse:b,timeOffset:l.timeOffset,timeSequence:l.timeSequence,timeUnitSpecifier:l.timeUnitSpecifier,monthFormat:P,monthAbbrevFormat:N,dayFormat:L,dayAbbrevFormat:A,quarter:e.quarter,utcquarter:e.utcquarter,week:l.week,utcweek:l.utcweek,dayofyear:l.dayofyear,utcdayofyear:l.utcdayofyear,warn:$,info:M,debug:j,extent:e.extent,inScope:V,intersect:function(t,n,r){if(!t)return[];const[a,o]=t,i=(new s.Bounds).set(a[0],a[1],o[0],o[1]),c=r||this.context.dataflow.scenegraph().root;return s.intersect(c,i,function(t){let n=null;if(t){const r=e.array(t.marktype),a=e.array(t.markname);n=t=>(!r.length||r.some(e=>t.marktype===e))&&(!a.length||a.some(e=>t.name===e))}return n}(n))},clampRange:e.clampRange,pinchDistance:J,pinchAngle:K,screen:mt,containerSize:pt,windowSize:gt,bandspace:Q,setdata:g,pathShape:st,panLinear:e.panLinear,panLog:e.panLog,panPow:e.panPow,panSymlog:e.panSymlog,zoomLinear:e.zoomLinear,zoomLog:e.zoomLog,zoomPow:e.zoomPow,zoomSymlog:e.zoomSymlog,encode:p,modify:W},vt=["view","item","group","xy","x","y"],yt={};function xt(t,e,n){return 1===arguments.length?ht[t]:(ht[t]=e,n&&(yt[t]=n),wt&&(wt.functions[t]="this."+t),this)}xt("bandwidth",Z,_),xt("copy",tt,_),xt("domain",et,_),xt("range",rt,_),xt("invert",nt,_),xt("scale",at,_),xt("gradient",ot,_),xt("geoArea",D,_),xt("geoBounds",E,_),xt("geoCentroid",U,_),xt("geoShape",it,_),xt("indata",m,k),xt("data",d,F),xt("treePath",lt,F),xt("treeAncestors",ft,F),xt("vlSelectionTest",c.selectionTest,c.selectionVisitor),xt("vlSelectionResolve",c.selectionResolve,c.selectionVisitor);const bt={blacklist:["_"],whitelist:["datum","event","item"],fieldvar:"datum",globalvar:t=>"_["+e.stringValue("$"+t)+"]",functions:function(t){const r=n.functions(t);vt.forEach(t=>r[t]="event.vega."+t);for(let t in ht)r[t]="this."+t;return e.extend(r,function(t,r,a){r.__bandwidth=t=>t&&t.bandwidth?t.bandwidth():0,a._bandwidth=_,a._range=_,a._scale=_;const o=r=>"_["+(r.type===n.Literal?e.stringValue("%"+r.value):e.stringValue("%")+"+"+t(r))+"]";return{_bandwidth:t=>`this.__bandwidth(${o(t[0])})`,_range:t=>o(t[0])+".range()",_scale:e=>`${o(e[0])}(${t(e[1])})`}}(t,ht,yt)),r},constants:n.constants,visitors:yt};var wt=n.codegen(bt);t.DataPrefix=":",t.IndexPrefix="@",t.ScalePrefix="%",t.SignalPrefix="$",t.bandspace=Q,t.bandwidth=Z,t.codeGenerator=wt,t.codegenParams=bt,t.containerSize=pt,t.contrast=X,t.copy=tt,t.data=d,t.dataVisitor=F,t.dayAbbrevFormat=A,t.dayFormat=L,t.debug=j,t.domain=et,t.encode=p,t.expressionFunction=xt,t.format=v,t.functionContext=ht,t.geoArea=D,t.geoBounds=E,t.geoCentroid=U,t.geoShape=it,t.inScope=V,t.indata=m,t.indataVisitor=k,t.info=M,t.invert=nt,t.luminance=T,t.merge=Y,t.modify=W,t.monthAbbrevFormat=N,t.monthFormat=P,t.parseExpression=function(t,r){var a,o,i={};try{t=e.isString(t)?t:e.stringValue(t)+"",a=n.parse(t)}catch(n){e.error("Expression parse error: "+t)}return a.visit(t=>{if(t.type===n.CallExpression){var e=t.callee.name,a=bt.visitors[e];a&&a(e,t.arguments,r,i)}}),(o=wt(a)).globals.forEach(t=>{var n="$"+t;!e.hasOwnProperty(i,n)&&r.getSignal(t)&&(i[n]=r.signalRef(t))}),{$expr:e.extend({code:o.code},r.options.ast?{ast:a}:null),$fields:o.fields,$params:i}},t.pathShape=st,t.pinchAngle=K,t.pinchDistance=J,t.range=rt,t.scale=at,t.scaleGradient=ot,t.scaleVisitor=_,t.screen=mt,t.setdata=g,t.timeFormat=y,t.timeParse=b,t.treeAncestors=ft,t.treePath=lt,t.utcFormat=x,t.utcParse=w,t.warn=$,t.windowSize=gt,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vega-util"),require("vega-expression"),require("d3-geo"),require("d3-color"),require("vega-dataflow"),require("vega-scale"),require("vega-scenegraph"),require("vega-selections"),require("vega-statistics"),require("vega-time"),require("d3-array")):"function"==typeof define&&define.amd?define(["exports","vega-util","vega-expression","d3-geo","d3-color","vega-dataflow","vega-scale","vega-scenegraph","vega-selections","vega-statistics","vega-time","d3-array"],e):e((t=t||self).vega={},t.vega,t.vega,t.d3,t.d3,t.vega,t.vega,t.vega,t.vega,t.vega,t.vega,t.d3)}(this,(function(t,e,n,r,a,o,i,s,c,u,l,f){"use strict";function d(t){const e=this.context.data[t];return e?e.values.value:[]}function m(t,e,n){const r=this.context.data[t]["index:"+e],a=r?r.value.get(n):void 0;return a?a.count:a}function g(t,n){const r=this.context.dataflow,a=this.context.data[t].input;return r.pulse(a,r.changeset().remove(e.truthy).insert(n)),1}function p(t,e,n){if(t){const n=this.context.dataflow,r=t.mark.source;n.pulse(r,n.changeset().encode(t,e))}return void 0!==n?n:t}const h=t=>function(e,n){return this.context.dataflow.locale()[t](n)(e)},v=h("format"),y=h("timeFormat"),x=h("utcFormat"),b=h("timeParse"),w=h("utcParse");var S=new Date(2e3,0,1);function q(t,e,n){return Number.isInteger(t)&&Number.isInteger(e)?(S.setYear(2e3),S.setMonth(t),S.setDate(e),y.call(this,S,n)):""}function P(t){return q.call(this,t,1,"%B")}function N(t){return q.call(this,t,1,"%b")}function L(t){return q.call(this,0,2+t,"%A")}function A(t){return q.call(this,0,2+t,"%a")}function F(t,r,a,o){r[0].type!==n.Literal&&e.error("First argument to data functions must be a string literal.");const i=r[0].value,s=":"+i;if(!e.hasOwnProperty(s,o))try{o[s]=a.getData(i).tuplesRef()}catch(t){}}function k(t,r,a,o){r[0].type!==n.Literal&&e.error("First argument to indata must be a string literal."),r[1].type!==n.Literal&&e.error("Second argument to indata must be a string literal.");const i=r[0].value,s=r[1].value,c="@"+s;e.hasOwnProperty(c,o)||(o[c]=a.getData(i).indataRef(a,s))}function _(t,e,r,a){if(e[0].type===n.Literal)O(r,a,e[0].value);else for(t in r.scales)O(r,a,t)}function O(t,n,r){const a="%"+r;if(!e.hasOwnProperty(n,a))try{n[a]=t.scaleRef(r)}catch(t){}}function R(t,n){let r;return e.isFunction(t)?t:e.isString(t)?(r=n.scales[t])&&r.value:void 0}function z(t,e){return function(n,r,a){if(n){const e=R(n,(a||this).context);return e&&e.path[t](r)}return e(r)}}const D=z("area",r.geoArea),E=z("bounds",r.geoBounds),U=z("centroid",r.geoCentroid);function V(t){let e=this.context.group,n=!1;if(e)for(;t;){if(t===e){n=!0;break}t=t.mark.group}return n}function B(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(e){t.warn(e)}return n[n.length-1]}function $(){return B(this.context.dataflow,"warn",arguments)}function M(){return B(this.context.dataflow,"info",arguments)}function j(){return B(this.context.dataflow,"debug",arguments)}function C(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function T(t){const e=a.rgb(t);return.2126*C(e.r)+.7152*C(e.g)+.0722*C(e.b)}function X(t,e){const n=T(t),r=T(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Y(){var t=[].slice.call(arguments);return t.unshift({}),e.extend.apply(null,t)}function I(t,n){return t===n||t!=t&&n!=n||(e.isArray(t)?!(!e.isArray(n)||t.length!==n.length)&&function(t,e){for(let n=0,r=t.length;n<r;++n)if(!I(t[n],e[n]))return!1;return!0}(t,n):!(!e.isObject(t)||!e.isObject(n))&&G(t,n))}function G(t,e){for(let n in t)if(!I(t[n],e[n]))return!1;return!0}function H(t){return e=>G(t,e)}function W(t,n,r,a,i,s){let c,u,l=this.context.dataflow,f=this.context.data[t],d=f.input,m=f.changes,g=l.stamp();if(!1===l._trigger||!(d.value.length||n||a))return 0;if((!m||m.stamp<g)&&(f.changes=m=l.changeset(),m.stamp=g,l.runAfter((function(){f.modified=!0,l.pulse(d,m).run()}),!0,1)),r&&(c=!0===r?e.truthy:e.isArray(r)||o.isTuple(r)?r:H(r),m.remove(c)),n&&m.insert(n),a&&(c=H(a),d.value.some(c)?m.remove(c):m.insert(a)),i)for(u in s)m.modify(i,u,s[u]);return 1}function J(t){const e=t.touches,n=e[0].clientX-e[1].clientX,r=e[0].clientY-e[1].clientY;return Math.sqrt(n*n+r*r)}function K(t){const e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)}function Q(t,e,n){return i.bandSpace(t||0,e||0,n||0)}function Z(t,e){const n=R(t,(e||this).context);return n&&n.bandwidth?n.bandwidth():0}function tt(t,e){const n=R(t,(e||this).context);return n?n.copy():void 0}function et(t,e){const n=R(t,(e||this).context);return n?n.domain():[]}function nt(t,n,r){const a=R(t,(r||this).context);return a?e.isArray(n)?(a.invertRange||a.invert)(n):(a.invert||a.invertExtent)(n):void 0}function rt(t,e){const n=R(t,(e||this).context);return n&&n.range?n.range():[]}function at(t,e,n){const r=R(t,(n||this).context);return r?r(e):void 0}function ot(t,n,r,a,o){t=R(t,(o||this).context);const c=s.Gradient(n,r);let u=t.domain(),l=u[0],f=e.peek(u),d=e.identity;return f-l?d=i.scaleFraction(t,l,f):t=(t.interpolator?i.scale("sequential")().interpolator(t.interpolator()):i.scale("linear")().interpolate(t.interpolate()).range(t.range())).domain([l=0,f=1]),t.ticks&&(u=t.ticks(+a||15),l!==u[0]&&u.unshift(l),f!==e.peek(u)&&u.push(f)),u.forEach(e=>c.stop(d(e),t(e))),c}function it(t,e,n){const r=R(t,(n||this).context);return function(t){return r?r.path.context(t)(e):""}}function st(t){let e=null;return function(n){return n?s.pathRender(n,e=e||s.pathParse(t)):t}}const ct=t=>t.data;function ut(t,e){const n=d.call(e,t);return n.root&&n.root.lookup||{}}function lt(t,e,n){const r=ut(t,this),a=r[e],o=r[n];return a&&o?a.path(o).map(ct):void 0}function ft(t,e){const n=ut(t,this)[e];return n?n.ancestors().map(ct):void 0}const dt=()=>"undefined"!=typeof window&&window||null;function mt(){const t=dt();return t?t.screen:{}}function gt(){const t=dt();return t?[t.innerWidth,t.innerHeight]:[void 0,void 0]}function pt(){const t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]}const ht={random:function(){return u.random()},cumulativeNormal:u.cumulativeNormal,cumulativeLogNormal:u.cumulativeLogNormal,cumulativeUniform:u.cumulativeUniform,densityNormal:u.densityNormal,densityLogNormal:u.densityLogNormal,densityUniform:u.densityUniform,quantileNormal:u.quantileNormal,quantileLogNormal:u.quantileLogNormal,quantileUniform:u.quantileUniform,sampleNormal:u.sampleNormal,sampleLogNormal:u.sampleLogNormal,sampleUniform:u.sampleUniform,isArray:e.isArray,isBoolean:e.isBoolean,isDate:e.isDate,isDefined:function(t){return void 0!==t},isNumber:e.isNumber,isObject:e.isObject,isRegExp:e.isRegExp,isString:e.isString,isTuple:o.isTuple,isValid:function(t){return null!=t&&t==t},toBoolean:e.toBoolean,toDate:e.toDate,toNumber:e.toNumber,toString:e.toString,flush:e.flush,lerp:e.lerp,merge:Y,pad:e.pad,peek:e.peek,span:e.span,inrange:e.inrange,truncate:e.truncate,rgb:a.rgb,lab:a.lab,hcl:a.hcl,hsl:a.hsl,luminance:T,contrast:X,sequence:f.range,format:v,utcFormat:x,utcParse:w,utcOffset:l.utcOffset,utcSequence:l.utcSequence,timeFormat:y,timeParse:b,timeOffset:l.timeOffset,timeSequence:l.timeSequence,timeUnitSpecifier:l.timeUnitSpecifier,monthFormat:P,monthAbbrevFormat:N,dayFormat:L,dayAbbrevFormat:A,quarter:e.quarter,utcquarter:e.utcquarter,week:l.week,utcweek:l.utcweek,dayofyear:l.dayofyear,utcdayofyear:l.utcdayofyear,warn:$,info:M,debug:j,extent:e.extent,inScope:V,intersect:function(t,n,r){if(!t)return[];const[a,o]=t,i=(new s.Bounds).set(a[0],a[1],o[0],o[1]),c=r||this.context.dataflow.scenegraph().root;return s.intersect(c,i,function(t){let n=null;if(t){const r=e.array(t.marktype),a=e.array(t.markname);n=t=>(!r.length||r.some(e=>t.marktype===e))&&(!a.length||a.some(e=>t.name===e))}return n}(n))},clampRange:e.clampRange,pinchDistance:J,pinchAngle:K,screen:mt,containerSize:pt,windowSize:gt,bandspace:Q,setdata:g,pathShape:st,panLinear:e.panLinear,panLog:e.panLog,panPow:e.panPow,panSymlog:e.panSymlog,zoomLinear:e.zoomLinear,zoomLog:e.zoomLog,zoomPow:e.zoomPow,zoomSymlog:e.zoomSymlog,encode:p,modify:W},vt=["view","item","group","xy","x","y"],yt={};function xt(t,e,n){return 1===arguments.length?ht[t]:(ht[t]=e,n&&(yt[t]=n),wt&&(wt.functions[t]="this."+t),this)}xt("bandwidth",Z,_),xt("copy",tt,_),xt("domain",et,_),xt("range",rt,_),xt("invert",nt,_),xt("scale",at,_),xt("gradient",ot,_),xt("geoArea",D,_),xt("geoBounds",E,_),xt("geoCentroid",U,_),xt("geoShape",it,_),xt("indata",m,k),xt("data",d,F),xt("treePath",lt,F),xt("treeAncestors",ft,F),xt("vlSelectionTest",c.selectionTest,c.selectionVisitor),xt("vlSelectionResolve",c.selectionResolve,c.selectionVisitor);const bt={blacklist:["_"],whitelist:["datum","event","item"],fieldvar:"datum",globalvar:t=>"_["+e.stringValue("$"+t)+"]",functions:function(t){const r=n.functions(t);vt.forEach(t=>r[t]="event.vega."+t);for(let t in ht)r[t]="this."+t;return e.extend(r,function(t,r,a){r.__bandwidth=t=>t&&t.bandwidth?t.bandwidth():0,a._bandwidth=_,a._range=_,a._scale=_;const o=r=>"_["+(r.type===n.Literal?e.stringValue("%"+r.value):e.stringValue("%")+"+"+t(r))+"]";return{_bandwidth:t=>`this.__bandwidth(${o(t[0])})`,_range:t=>o(t[0])+".range()",_scale:e=>`${o(e[0])}(${t(e[1])})`}}(t,ht,yt)),r},constants:n.constants,visitors:yt};var wt=n.codegen(bt);t.DataPrefix=":",t.IndexPrefix="@",t.ScalePrefix="%",t.SignalPrefix="$",t.bandspace=Q,t.bandwidth=Z,t.codeGenerator=wt,t.codegenParams=bt,t.containerSize=pt,t.contrast=X,t.copy=tt,t.data=d,t.dataVisitor=F,t.dayAbbrevFormat=A,t.dayFormat=L,t.debug=j,t.domain=et,t.encode=p,t.expressionFunction=xt,t.format=v,t.functionContext=ht,t.geoArea=D,t.geoBounds=E,t.geoCentroid=U,t.geoShape=it,t.inScope=V,t.indata=m,t.indataVisitor=k,t.info=M,t.invert=nt,t.luminance=T,t.merge=Y,t.modify=W,t.monthAbbrevFormat=N,t.monthFormat=P,t.parseExpression=function(t,r){var a,o,i={};try{t=e.isString(t)?t:e.stringValue(t)+"",a=n.parse(t)}catch(n){e.error("Expression parse error: "+t)}return a.visit(t=>{if(t.type===n.CallExpression){var e=t.callee.name,a=bt.visitors[e];a&&a(e,t.arguments,r,i)}}),(o=wt(a)).globals.forEach(t=>{var n="$"+t;!e.hasOwnProperty(i,n)&&r.getSignal(t)&&(i[n]=r.signalRef(t))}),{$expr:e.extend({code:o.code},r.options.ast?{ast:a}:null),$fields:o.fields,$params:i}},t.pathShape=st,t.pinchAngle=K,t.pinchDistance=J,t.range=rt,t.scale=at,t.scaleGradient=ot,t.scaleVisitor=_,t.screen=mt,t.setdata=g,t.timeFormat=y,t.timeParse=b,t.treeAncestors=ft,t.treePath=lt,t.utcFormat=x,t.utcParse=w,t.warn=$,t.windowSize=gt,Object.defineProperty(t,"__esModule",{value:!0})})); |
{ | ||
"name": "vega-functions", | ||
"version": "5.7.0", | ||
"version": "5.7.1", | ||
"description": "Custom functions for the Vega expression language.", | ||
@@ -28,4 +28,4 @@ "keywords": [ | ||
"d3-color": "^1.4.1", | ||
"d3-geo": "^1.12.0", | ||
"vega-dataflow": "^5.6.0", | ||
"d3-geo": "^1.12.1", | ||
"vega-dataflow": "^5.7.0", | ||
"vega-expression": "^2.6.5", | ||
@@ -36,3 +36,3 @@ "vega-scale": "^7.0.0", | ||
"vega-statistics": "^1.7.5", | ||
"vega-time": "^2.0.0", | ||
"vega-time": "^2.0.1", | ||
"vega-util": "^1.14.0" | ||
@@ -43,3 +43,3 @@ }, | ||
}, | ||
"gitHead": "48c85218f2202242171aa569f2dca0f53cf2b51f" | ||
"gitHead": "62565bbe084a422c4a0cbc6e19c6f7c45a3e5137" | ||
} |
@@ -38,3 +38,3 @@ import {getScale} from '../scales'; | ||
const s = getScale(name, (group || this).context); | ||
return s && value !== undefined ? s(value) : undefined; | ||
return s ? s(value) : undefined; | ||
} |
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
65080
Updatedd3-geo@^1.12.1
Updatedvega-dataflow@^5.7.0
Updatedvega-time@^2.0.1