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

vega-encode

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vega-encode - npm Package Compare versions

Comparing version 1.0.0-beta.17 to 1.0.0-beta.18

4

build/vega-encode.js

@@ -124,3 +124,3 @@ (function (global, factory) {

function AxisTicks(params) {
vegaDataflow.Transform.call(this, [], params);
vegaDataflow.Transform.call(this, null, params);
}

@@ -131,3 +131,3 @@

prototype.transform = function(_, pulse) {
if (this.value != null && !_.modified()) {
if (this.value && !_.modified()) {
return pulse.StopPropagation;

@@ -134,0 +134,0 @@ }

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

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("vega-dataflow"),require("vega-util"),require("d3-format"),require("vega-scale"),require("d3-array"),require("d3-interpolate")):"function"==typeof define&&define.amd?define(["exports","vega-dataflow","vega-util","d3-format","vega-scale","d3-array","d3-interpolate"],n):n(e.vega=e.vega||{},e.vega,e.vega,e.d3,e.vega,e.d3,e.d3)}(this,function(e,n,t,r,a,i,o){"use strict";function u(e,n){return e.ticks?e.ticks(n):e.domain()}function s(e,n,t){var r=e.tickFormat?e.tickFormat(n,t):String;return e.type===ue?f(r,l(t)):r}function f(e,n){return function(t){return e(t)?n(t):""}}function l(e){var n=r.formatSpecifier(e||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return c(r.format(n),r.format(".1f")(1)[1])}return r.format(n)}function c(e,n){return function(t){var r,a,i=e(t),o=i.indexOf(n);if(o<0)return i;for(r=d(i,o),a=r<i.length?i.slice(r):"";--r>o;)if("0"!==i[r]){++r;break}return i.slice(0,r)+a}}function d(e,n){var t,r=e.lastIndexOf("e");if(r>0)return r;for(r=e.length;--r>n;)if(t=e.charCodeAt(r),t>=48&&t<=57)return r+1}function m(e){n.Transform.call(this,[],e)}function p(e){n.Transform.call(this,null,e)}function h(){return n.ingest({})}function v(e){return e.exit}function g(e){n.Transform.call(this,null,e)}function y(e,n,t){if(t)return e.domain();var r=Oe[e.type];return r?r(e):u(e,n)}function M(e){var n=e.domain(),r=n[0],a=t.peek(n),i=e.range().length,o=new Array(i),u=0;for(o[0]=r;++u<i;)o[u]=(u*a-(u-i)*r)/i;return o.max=a,o}function x(e){var n=e.domain(),r=[n[0]].concat(e.quantiles());return r.max=t.peek(n),r}function S(e){var n=[-(1/0)].concat(e.domain());return n.max=+(1/0),n}function A(e){var n=e.domain();return n.max=n.pop(),n}function O(e,n){return Oe[e.type]?b(n):D(n)}function b(e){return function(n,t,r){var a=r[t+1]||r.max||+(1/0),i=k(n,e),o=k(a,e);return i&&o?i+"–"+o:o?"< "+o:"≥ "+i}}function k(e,n){return isFinite(e)?n(e):null}function D(e){return function(n){return e(n)}}function T(e){n.Transform.call(this,[],e)}function E(e){return e.source.x}function w(e){return e.source.y}function F(e){return e.target.x}function R(e){return e.target.y}function z(e){n.Transform.call(this,{},e)}function C(e,n,t,r){return"M"+e+","+n+"L"+t+","+r}function q(e,n,t,r){return C(n*Math.cos(e),n*Math.sin(e),r*Math.cos(t),r*Math.sin(t))}function L(e,n,t,r){var a=t-e,i=r-n,o=Math.sqrt(a*a+i*i)/2,u=180*Math.atan2(i,a)/Math.PI;return"M"+e+","+n+"A"+o+","+o+" "+u+" 0 1 "+t+","+r}function _(e,n,t,r){return L(n*Math.cos(e),n*Math.sin(e),r*Math.cos(t),r*Math.sin(t))}function I(e,n,t,r){var a=t-e,i=r-n,o=.2*(a+i),u=.2*(i-a);return"M"+e+","+n+"C"+(e+o)+","+(n+u)+" "+(t+u)+","+(r-o)+" "+t+","+r}function P(e,n,t,r){return I(n*Math.cos(e),n*Math.sin(e),r*Math.cos(t),r*Math.sin(t))}function N(e,n,t,r){return"M"+e+","+n+"V"+r+"H"+t}function U(e,n,t,r){return"M"+e+","+n+"H"+t+"V"+r}function X(e,n,t,r){var a=Math.cos(e),i=Math.sin(e),o=Math.cos(t),u=Math.sin(t),s=Math.abs(t-e)>Math.PI?t<=e:t>e;return"M"+n*a+","+n*i+"A"+n+","+n+" 0 0,"+(s?1:0)+" "+n*o+","+n*u+"L"+r*o+","+r*u}function Y(e,n,t,r){var a=(e+t)/2;return"M"+e+","+n+"C"+a+","+n+" "+a+","+r+" "+t+","+r}function j(e,n,t,r){var a=(n+r)/2;return"M"+e+","+n+"C"+e+","+a+" "+t+","+a+" "+t+","+r}function G(e,n,t,r){var a=Math.cos(e),i=Math.sin(e),o=Math.cos(t),u=Math.sin(t),s=(n+r)/2;return"M"+n*a+","+n*i+"C"+s*a+","+s*i+" "+s*o+","+s*u+" "+r*o+","+r*u}function H(e){n.Transform.call(this,null,e)}function J(e){n.Transform.call(this,null,e),this.modified(!0)}function V(e,n,t){var r=B(e,n.domainRaw);if(r>-1)return r;var a,i,o=n.domain,u=n.zero||void 0===n.zero&&we[e.type];return o?((u||null!=n.domainMin||null!=n.domainMax||null!=n.domainMid)&&(a=(o=o.slice()).length-1||1,u&&(o[0]>0&&(o[0]=0),o[a]<0&&(o[a]=0)),null!=n.domainMin&&(o[0]=n.domainMin),null!=n.domainMax&&(o[a]=n.domainMax),null!=n.domainMid&&(i=n.domainMid,(i<o[0]||i>o[a])&&t.warn("Scale domainMid exceeds domain min or max.",i),o.splice(a,0,i))),e.domain(o),n.nice&&e.nice&&e.nice(n.nice!==!0&&+n.nice||null),o.length):0}function B(e,n){return n?(e.domain(n),n.length):-1}function W(e,n,r){var i=n.round||!1,u=n.range;if(null!=n.rangeStep)u=K(e.type,n,r);else if(n.scheme){if(u=Q(e.type,n,r),t.isFunction(u))return e.interpolator(u)}else if(u&&e.type===Me)return e.interpolator(o.interpolateRgbBasis($(u,n.reverse)));u&&n.interpolate&&e.interpolate?e.interpolate(a.interpolate(n.interpolate,n.interpolateGamma)):t.isFunction(e.round)?e.round(i):t.isFunction(e.rangeRound)&&e.interpolate(i?o.interpolateRound:o.interpolate),u&&e.range($(u,n.reverse))}function K(e,n,r){e!==le&&e!==ce&&t.error("Only band and point scales support rangeStep.");var i=(null!=n.paddingOuter?n.paddingOuter:n.padding)||0,o=e===ce?1:(null!=n.paddingInner?n.paddingInner:n.padding)||0;return[0,n.rangeStep*a.bandSpace(r,o,i)]}function Q(e,n,r){var i,o=n.scheme.toLowerCase(),u=a.scheme(o),s=n.schemeExtent;return u||t.error("Unrecognized scheme name: "+n.scheme),r=e===ve?r+1:e===ye?r-1:e===pe||e===he?+n.schemeCount||Ee:r,e===Me?Z(u,s,n.reverse):!s&&(i=a.scheme(o+"-"+r))?i:t.isFunction(u)?ee(Z(u,s),r):e===me?u:u.slice(0,r)}function Z(e,n,r){return t.isFunction(e)&&(n||r)?a.interpolateRange(e,$(n||[0,1],r)):e}function $(e,n){return n?e.slice().reverse():e}function ee(e,n){for(var t=new Array(n),r=n-1||1,a=0;a<n;++a)t[a]=e(a/r);return t}function ne(e){n.Transform.call(this,null,e)}function te(e){n.Transform.call(this,null,e)}function re(e,n,t,r,a){for(var i,o=(n-e.sum)/2,u=e.length,s=0;s<u;++s)i=e[s],i[r]=o,i[a]=o+=Math.abs(t(i))}function ae(e,n,t,r,a){for(var i,o=1/e.sum,u=0,s=e.length,f=0,l=0;f<s;++f)i=e[f],i[r]=u,i[a]=u=o*(l+=Math.abs(t(i)))}function ie(e,n,t,r,a){for(var i,o,u=0,s=0,f=e.length,l=0;l<f;++l)o=e[l],i=t(o),i<0?(o[r]=s,o[a]=s+=i):(o[r]=u,o[a]=u+=i)}function oe(e,n,t,r){var a,i,o,u,s,f,l,c,d,m=[],p=function(e){return e(s)};if(null==n)m.push(e.slice());else for(a={},i=0,o=e.length;i<o;++i)s=e[i],f=n.map(p),l=a[f]||(m.push(a[f]=[]),a[f]),l.push(s);for(f=0,d=0,u=m.length;f<u;++f){for(l=m[f],i=0,c=0,o=l.length;i<o;++i)c+=Math.abs(r(l[i]));l.sum=c,c>d&&(d=c),t&&l.sort(t)}return m.max=d,m}var ue="log",se="pow",fe="sqrt",le="band",ce="point",de="linear",me="ordinal",pe="quantile",he="quantize",ve="threshold",ge="bin-linear",ye="bin-ordinal",Me="sequential",xe=t.inherits(m,n.Transform);xe.transform=function(e,t){if(null!=this.value&&!e.modified())return t.StopPropagation;var r=t.fork(t.NO_SOURCE|t.NO_FIELDS),a=this.value,i=e.scale,o=e.count,f=e.format||s(i,o,e.formatSpecifier),l=e.values||u(i,o);return a&&(r.rem=a),a=l.map(function(e){return n.ingest({value:e,label:f(e)})}),e.extra&&a.push(n.ingest({extra:{value:a[0].value},label:""})),r.source=r.add=this.value=a,r};var Se=t.inherits(p,n.Transform);Se.transform=function(e,r){var a=r.dataflow,i=r.fork(r.NO_SOURCE|r.NO_FIELDS),o=e.item||h,u=e.key||n.tupleid,s=this.value;return s||(r=r.addAll(),this.value=s=t.fastmap().test(v),s.lookup=function(e){return s.get(u(e))}),(e.modified("key")||r.modified(u))&&t.error("DataJoin does not support modified key function or fields."),r.visit(r.ADD,function(e){var n=u(e),t=s.get(n);t?(t.exit?(--s.empty,i.add):i.mod).push(t):(s.set(n,t=o(e)),i.add.push(t)),t.datum=e,t.exit=!1}),r.visit(r.MOD,function(e){var n=u(e),t=s.get(n);t&&(t.datum=e,i.mod.push(t))}),r.visit(r.REM,function(e){var n=u(e),t=s.get(n);e!==t.datum||t.exit||(i.rem.push(t),t.exit=!0,++s.empty)}),r.changed(r.ADD_MOD)&&i.modifies("datum"),e.clean&&s.empty>a.cleanThreshold&&a.runAfter(s.clean),i};var Ae=t.inherits(g,n.Transform);Ae.transform=function(e,n){var r=n.fork(n.ADD_REM),a=n.encode,i="enter"===a,o=e.encoders.update||t.falsy,u=e.encoders.enter||t.falsy,s=e.encoders.exit||t.falsy,f=(a&&!i?e.encoders[a]:o)||t.falsy;if(n.changed(n.ADD)&&(n.visit(n.ADD,function(n){u(n,e),o(n,e),f!==t.falsy&&f!==o&&f(n,e)}),r.modifies(u.output),r.modifies(o.output),f!==t.falsy&&f!==o&&r.modifies(f.output)),n.changed(n.REM)&&s!==t.falsy&&(n.visit(n.REM,function(n){s(n,e)}),r.modifies(s.output)),i||f!==t.falsy){var l=n.MOD|(e.modified()?n.REFLOW:0);i?(n.visit(l,function(n){var t=u(n,e);(f(n,e)||t)&&r.mod.push(n)}),r.mod.length&&r.modifies(u.output)):n.visit(l,function(n){f(n,e)&&r.mod.push(n)}),r.mod.length&&r.modifies(f.output)}return r};var Oe={};Oe[pe]=x,Oe[he]=M,Oe[ve]=S,Oe[ge]=A,Oe[ye]=A;var be=t.inherits(T,n.Transform);be.transform=function(e,r){if(null!=this.value&&!e.modified())return r.StopPropagation;var i=r.fork(r.NO_SOURCE|r.NO_FIELDS),o=0,u=this.value,f="gradient"===e.type,l=e.scale,c=null==e.count?5:e.count,d=e.format||s(l,c,e.formatSpecifier),m=e.values||y(l,c,f);if(d=O(l,d),u&&(i.rem=u),f)var p=e.values?l.domain():m,h=a.scaleFraction(l,p[0],t.peek(p));else{var v,g=e.size;t.isFunction(g)?(e.values||0!==l(m[0])||(m=m.slice(1)),v=m.reduce(function(n,t){return Math.max(n,g(t,e))},0)):g=t.constant(v=g||8)}return u=m.map(function(t,r){var a=n.ingest({index:r,label:d(t,r,m),value:t});return f?a.perc=h(t):(a.offset=v,a.size=g(t,e),a.total=Math.round(o),o+=a.size),a}),i.source=i.add=this.value=u,i};var ke=t.fastmap({line:C,"line-radial":q,arc:L,"arc-radial":_,curve:I,"curve-radial":P,"orthogonal-horizontal":N,"orthogonal-vertical":U,"orthogonal-radial":X,"diagonal-horizontal":Y,"diagonal-vertical":j,"diagonal-radial":G}),De=t.inherits(z,n.Transform);De.transform=function(e,n){var r=e.sourceX||E,a=e.sourceY||w,i=e.targetX||F,o=e.targetY||R,u=e.as||"path",s=e.orient||"vertical",f=e.shape||"line",l=ke.get(f+"-"+s)||ke.get(f);return l||t.error("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),n.visit(n.SOURCE,function(e){e[u]=l(r(e),a(e),i(e),o(e))}),n.reflow(e.modified()).modifies(u)};var Te=t.inherits(H,n.Transform);Te.transform=function(e,n){var r,a,o,u=e.as||["startAngle","endAngle"],s=u[0],f=u[1],l=e.field||t.one,c=e.startAngle||0,d=null!=e.endAngle?e.endAngle:2*Math.PI,m=n.source,p=m.map(l),h=p.length,v=c,g=(d-c)/i.sum(p),y=i.range(h);for(e.sort&&y.sort(function(e,n){return p[e]-p[n]}),r=0;r<h;++r)o=p[y[r]],a=m[y[r]],a[s]=v,a[f]=v+=o*g;return this.value=p,n.reflow(e.modified()).modifies(u)};var Ee=5,we=t.toSet([de,se,fe]),Fe=t.toSet(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","nice","zero","range","rangeStep","round","reverse","interpolate","interpolateGamma"]),Re=t.inherits(J,n.Transform);Re.transform=function(e,n){var r,i=n.dataflow,o=this.value;o&&!e.modified("type")||(this.value=o=a.scale((e.type||de).toLowerCase())());for(r in e)Fe[r]||(t.isFunction(o[r])?o[r](e[r]):i.warn("Unsupported scale property: "+r));return W(o,e,V(o,e),i),n.fork(n.NO_SOURCE|n.NO_FIELDS)};var ze=t.inherits(ne,n.Transform);ze.transform=function(e,n){var t=e.modified("sort")||n.changed(n.ADD)||n.modified(e.sort.fields)||n.modified("datum");return t&&n.source.sort(e.sort),this.modified(t),n};var Ce="center",qe="normalize",Le=t.inherits(te,n.Transform);Le.transform=function(e,n){var r,a,i,o,u=e.as||["y0","y1"],s=u[0],f=u[1],l=e.field||t.one,c=e.offset===Ce?re:e.offset===qe?ae:ie;for(r=oe(n.source,e.groupby,e.sort,l),a=0,i=r.length,o=r.max;a<i;++a)c(r[a],o,l,s,f);return n.reflow(e.modified()).modifies(u)};var _e={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"as",type:"string",default:"path"}]},Ie={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},Pe={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:"zero",values:["zero","center","normalize"]},{name:"as",type:"string",array:!0,length:2,default:["y0","y1"]}]};n.register(_e,z),n.register(Ie,H),n.register(Pe,te),n.transform("AxisTicks",m),n.transform("DataJoin",p),n.transform("Encode",g),n.transform("LegendEntries",T),n.transform("Scale",J),n.transform("SortItems",ne),e.transform=n.transform,e.definition=n.definition,e.scale=a.scale,e.scheme=a.scheme,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("vega-dataflow"),require("vega-util"),require("d3-format"),require("vega-scale"),require("d3-array"),require("d3-interpolate")):"function"==typeof define&&define.amd?define(["exports","vega-dataflow","vega-util","d3-format","vega-scale","d3-array","d3-interpolate"],n):n(e.vega=e.vega||{},e.vega,e.vega,e.d3,e.vega,e.d3,e.d3)}(this,function(e,n,t,r,a,i,o){"use strict";function u(e,n){return e.ticks?e.ticks(n):e.domain()}function s(e,n,t){var r=e.tickFormat?e.tickFormat(n,t):String;return e.type===ue?f(r,l(t)):r}function f(e,n){return function(t){return e(t)?n(t):""}}function l(e){var n=r.formatSpecifier(e||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return c(r.format(n),r.format(".1f")(1)[1])}return r.format(n)}function c(e,n){return function(t){var r,a,i=e(t),o=i.indexOf(n);if(o<0)return i;for(r=d(i,o),a=r<i.length?i.slice(r):"";--r>o;)if("0"!==i[r]){++r;break}return i.slice(0,r)+a}}function d(e,n){var t,r=e.lastIndexOf("e");if(r>0)return r;for(r=e.length;--r>n;)if(t=e.charCodeAt(r),t>=48&&t<=57)return r+1}function m(e){n.Transform.call(this,null,e)}function p(e){n.Transform.call(this,null,e)}function h(){return n.ingest({})}function v(e){return e.exit}function g(e){n.Transform.call(this,null,e)}function y(e,n,t){if(t)return e.domain();var r=Oe[e.type];return r?r(e):u(e,n)}function M(e){var n=e.domain(),r=n[0],a=t.peek(n),i=e.range().length,o=new Array(i),u=0;for(o[0]=r;++u<i;)o[u]=(u*a-(u-i)*r)/i;return o.max=a,o}function x(e){var n=e.domain(),r=[n[0]].concat(e.quantiles());return r.max=t.peek(n),r}function S(e){var n=[-(1/0)].concat(e.domain());return n.max=+(1/0),n}function A(e){var n=e.domain();return n.max=n.pop(),n}function O(e,n){return Oe[e.type]?b(n):D(n)}function b(e){return function(n,t,r){var a=r[t+1]||r.max||+(1/0),i=k(n,e),o=k(a,e);return i&&o?i+"–"+o:o?"< "+o:"≥ "+i}}function k(e,n){return isFinite(e)?n(e):null}function D(e){return function(n){return e(n)}}function T(e){n.Transform.call(this,[],e)}function E(e){return e.source.x}function w(e){return e.source.y}function F(e){return e.target.x}function R(e){return e.target.y}function z(e){n.Transform.call(this,{},e)}function C(e,n,t,r){return"M"+e+","+n+"L"+t+","+r}function q(e,n,t,r){return C(n*Math.cos(e),n*Math.sin(e),r*Math.cos(t),r*Math.sin(t))}function L(e,n,t,r){var a=t-e,i=r-n,o=Math.sqrt(a*a+i*i)/2,u=180*Math.atan2(i,a)/Math.PI;return"M"+e+","+n+"A"+o+","+o+" "+u+" 0 1 "+t+","+r}function _(e,n,t,r){return L(n*Math.cos(e),n*Math.sin(e),r*Math.cos(t),r*Math.sin(t))}function I(e,n,t,r){var a=t-e,i=r-n,o=.2*(a+i),u=.2*(i-a);return"M"+e+","+n+"C"+(e+o)+","+(n+u)+" "+(t+u)+","+(r-o)+" "+t+","+r}function P(e,n,t,r){return I(n*Math.cos(e),n*Math.sin(e),r*Math.cos(t),r*Math.sin(t))}function N(e,n,t,r){return"M"+e+","+n+"V"+r+"H"+t}function U(e,n,t,r){return"M"+e+","+n+"H"+t+"V"+r}function X(e,n,t,r){var a=Math.cos(e),i=Math.sin(e),o=Math.cos(t),u=Math.sin(t),s=Math.abs(t-e)>Math.PI?t<=e:t>e;return"M"+n*a+","+n*i+"A"+n+","+n+" 0 0,"+(s?1:0)+" "+n*o+","+n*u+"L"+r*o+","+r*u}function Y(e,n,t,r){var a=(e+t)/2;return"M"+e+","+n+"C"+a+","+n+" "+a+","+r+" "+t+","+r}function j(e,n,t,r){var a=(n+r)/2;return"M"+e+","+n+"C"+e+","+a+" "+t+","+a+" "+t+","+r}function G(e,n,t,r){var a=Math.cos(e),i=Math.sin(e),o=Math.cos(t),u=Math.sin(t),s=(n+r)/2;return"M"+n*a+","+n*i+"C"+s*a+","+s*i+" "+s*o+","+s*u+" "+r*o+","+r*u}function H(e){n.Transform.call(this,null,e)}function J(e){n.Transform.call(this,null,e),this.modified(!0)}function V(e,n,t){var r=B(e,n.domainRaw);if(r>-1)return r;var a,i,o=n.domain,u=n.zero||void 0===n.zero&&we[e.type];return o?((u||null!=n.domainMin||null!=n.domainMax||null!=n.domainMid)&&(a=(o=o.slice()).length-1||1,u&&(o[0]>0&&(o[0]=0),o[a]<0&&(o[a]=0)),null!=n.domainMin&&(o[0]=n.domainMin),null!=n.domainMax&&(o[a]=n.domainMax),null!=n.domainMid&&(i=n.domainMid,(i<o[0]||i>o[a])&&t.warn("Scale domainMid exceeds domain min or max.",i),o.splice(a,0,i))),e.domain(o),n.nice&&e.nice&&e.nice(n.nice!==!0&&+n.nice||null),o.length):0}function B(e,n){return n?(e.domain(n),n.length):-1}function W(e,n,r){var i=n.round||!1,u=n.range;if(null!=n.rangeStep)u=K(e.type,n,r);else if(n.scheme){if(u=Q(e.type,n,r),t.isFunction(u))return e.interpolator(u)}else if(u&&e.type===Me)return e.interpolator(o.interpolateRgbBasis($(u,n.reverse)));u&&n.interpolate&&e.interpolate?e.interpolate(a.interpolate(n.interpolate,n.interpolateGamma)):t.isFunction(e.round)?e.round(i):t.isFunction(e.rangeRound)&&e.interpolate(i?o.interpolateRound:o.interpolate),u&&e.range($(u,n.reverse))}function K(e,n,r){e!==le&&e!==ce&&t.error("Only band and point scales support rangeStep.");var i=(null!=n.paddingOuter?n.paddingOuter:n.padding)||0,o=e===ce?1:(null!=n.paddingInner?n.paddingInner:n.padding)||0;return[0,n.rangeStep*a.bandSpace(r,o,i)]}function Q(e,n,r){var i,o=n.scheme.toLowerCase(),u=a.scheme(o),s=n.schemeExtent;return u||t.error("Unrecognized scheme name: "+n.scheme),r=e===ve?r+1:e===ye?r-1:e===pe||e===he?+n.schemeCount||Ee:r,e===Me?Z(u,s,n.reverse):!s&&(i=a.scheme(o+"-"+r))?i:t.isFunction(u)?ee(Z(u,s),r):e===me?u:u.slice(0,r)}function Z(e,n,r){return t.isFunction(e)&&(n||r)?a.interpolateRange(e,$(n||[0,1],r)):e}function $(e,n){return n?e.slice().reverse():e}function ee(e,n){for(var t=new Array(n),r=n-1||1,a=0;a<n;++a)t[a]=e(a/r);return t}function ne(e){n.Transform.call(this,null,e)}function te(e){n.Transform.call(this,null,e)}function re(e,n,t,r,a){for(var i,o=(n-e.sum)/2,u=e.length,s=0;s<u;++s)i=e[s],i[r]=o,i[a]=o+=Math.abs(t(i))}function ae(e,n,t,r,a){for(var i,o=1/e.sum,u=0,s=e.length,f=0,l=0;f<s;++f)i=e[f],i[r]=u,i[a]=u=o*(l+=Math.abs(t(i)))}function ie(e,n,t,r,a){for(var i,o,u=0,s=0,f=e.length,l=0;l<f;++l)o=e[l],i=t(o),i<0?(o[r]=s,o[a]=s+=i):(o[r]=u,o[a]=u+=i)}function oe(e,n,t,r){var a,i,o,u,s,f,l,c,d,m=[],p=function(e){return e(s)};if(null==n)m.push(e.slice());else for(a={},i=0,o=e.length;i<o;++i)s=e[i],f=n.map(p),l=a[f]||(m.push(a[f]=[]),a[f]),l.push(s);for(f=0,d=0,u=m.length;f<u;++f){for(l=m[f],i=0,c=0,o=l.length;i<o;++i)c+=Math.abs(r(l[i]));l.sum=c,c>d&&(d=c),t&&l.sort(t)}return m.max=d,m}var ue="log",se="pow",fe="sqrt",le="band",ce="point",de="linear",me="ordinal",pe="quantile",he="quantize",ve="threshold",ge="bin-linear",ye="bin-ordinal",Me="sequential",xe=t.inherits(m,n.Transform);xe.transform=function(e,t){if(this.value&&!e.modified())return t.StopPropagation;var r=t.fork(t.NO_SOURCE|t.NO_FIELDS),a=this.value,i=e.scale,o=e.count,f=e.format||s(i,o,e.formatSpecifier),l=e.values||u(i,o);return a&&(r.rem=a),a=l.map(function(e){return n.ingest({value:e,label:f(e)})}),e.extra&&a.push(n.ingest({extra:{value:a[0].value},label:""})),r.source=r.add=this.value=a,r};var Se=t.inherits(p,n.Transform);Se.transform=function(e,r){var a=r.dataflow,i=r.fork(r.NO_SOURCE|r.NO_FIELDS),o=e.item||h,u=e.key||n.tupleid,s=this.value;return s||(r=r.addAll(),this.value=s=t.fastmap().test(v),s.lookup=function(e){return s.get(u(e))}),(e.modified("key")||r.modified(u))&&t.error("DataJoin does not support modified key function or fields."),r.visit(r.ADD,function(e){var n=u(e),t=s.get(n);t?(t.exit?(--s.empty,i.add):i.mod).push(t):(s.set(n,t=o(e)),i.add.push(t)),t.datum=e,t.exit=!1}),r.visit(r.MOD,function(e){var n=u(e),t=s.get(n);t&&(t.datum=e,i.mod.push(t))}),r.visit(r.REM,function(e){var n=u(e),t=s.get(n);e!==t.datum||t.exit||(i.rem.push(t),t.exit=!0,++s.empty)}),r.changed(r.ADD_MOD)&&i.modifies("datum"),e.clean&&s.empty>a.cleanThreshold&&a.runAfter(s.clean),i};var Ae=t.inherits(g,n.Transform);Ae.transform=function(e,n){var r=n.fork(n.ADD_REM),a=n.encode,i="enter"===a,o=e.encoders.update||t.falsy,u=e.encoders.enter||t.falsy,s=e.encoders.exit||t.falsy,f=(a&&!i?e.encoders[a]:o)||t.falsy;if(n.changed(n.ADD)&&(n.visit(n.ADD,function(n){u(n,e),o(n,e),f!==t.falsy&&f!==o&&f(n,e)}),r.modifies(u.output),r.modifies(o.output),f!==t.falsy&&f!==o&&r.modifies(f.output)),n.changed(n.REM)&&s!==t.falsy&&(n.visit(n.REM,function(n){s(n,e)}),r.modifies(s.output)),i||f!==t.falsy){var l=n.MOD|(e.modified()?n.REFLOW:0);i?(n.visit(l,function(n){var t=u(n,e);(f(n,e)||t)&&r.mod.push(n)}),r.mod.length&&r.modifies(u.output)):n.visit(l,function(n){f(n,e)&&r.mod.push(n)}),r.mod.length&&r.modifies(f.output)}return r};var Oe={};Oe[pe]=x,Oe[he]=M,Oe[ve]=S,Oe[ge]=A,Oe[ye]=A;var be=t.inherits(T,n.Transform);be.transform=function(e,r){if(null!=this.value&&!e.modified())return r.StopPropagation;var i=r.fork(r.NO_SOURCE|r.NO_FIELDS),o=0,u=this.value,f="gradient"===e.type,l=e.scale,c=null==e.count?5:e.count,d=e.format||s(l,c,e.formatSpecifier),m=e.values||y(l,c,f);if(d=O(l,d),u&&(i.rem=u),f)var p=e.values?l.domain():m,h=a.scaleFraction(l,p[0],t.peek(p));else{var v,g=e.size;t.isFunction(g)?(e.values||0!==l(m[0])||(m=m.slice(1)),v=m.reduce(function(n,t){return Math.max(n,g(t,e))},0)):g=t.constant(v=g||8)}return u=m.map(function(t,r){var a=n.ingest({index:r,label:d(t,r,m),value:t});return f?a.perc=h(t):(a.offset=v,a.size=g(t,e),a.total=Math.round(o),o+=a.size),a}),i.source=i.add=this.value=u,i};var ke=t.fastmap({line:C,"line-radial":q,arc:L,"arc-radial":_,curve:I,"curve-radial":P,"orthogonal-horizontal":N,"orthogonal-vertical":U,"orthogonal-radial":X,"diagonal-horizontal":Y,"diagonal-vertical":j,"diagonal-radial":G}),De=t.inherits(z,n.Transform);De.transform=function(e,n){var r=e.sourceX||E,a=e.sourceY||w,i=e.targetX||F,o=e.targetY||R,u=e.as||"path",s=e.orient||"vertical",f=e.shape||"line",l=ke.get(f+"-"+s)||ke.get(f);return l||t.error("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),n.visit(n.SOURCE,function(e){e[u]=l(r(e),a(e),i(e),o(e))}),n.reflow(e.modified()).modifies(u)};var Te=t.inherits(H,n.Transform);Te.transform=function(e,n){var r,a,o,u=e.as||["startAngle","endAngle"],s=u[0],f=u[1],l=e.field||t.one,c=e.startAngle||0,d=null!=e.endAngle?e.endAngle:2*Math.PI,m=n.source,p=m.map(l),h=p.length,v=c,g=(d-c)/i.sum(p),y=i.range(h);for(e.sort&&y.sort(function(e,n){return p[e]-p[n]}),r=0;r<h;++r)o=p[y[r]],a=m[y[r]],a[s]=v,a[f]=v+=o*g;return this.value=p,n.reflow(e.modified()).modifies(u)};var Ee=5,we=t.toSet([de,se,fe]),Fe=t.toSet(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","nice","zero","range","rangeStep","round","reverse","interpolate","interpolateGamma"]),Re=t.inherits(J,n.Transform);Re.transform=function(e,n){var r,i=n.dataflow,o=this.value;o&&!e.modified("type")||(this.value=o=a.scale((e.type||de).toLowerCase())());for(r in e)Fe[r]||(t.isFunction(o[r])?o[r](e[r]):i.warn("Unsupported scale property: "+r));return W(o,e,V(o,e),i),n.fork(n.NO_SOURCE|n.NO_FIELDS)};var ze=t.inherits(ne,n.Transform);ze.transform=function(e,n){var t=e.modified("sort")||n.changed(n.ADD)||n.modified(e.sort.fields)||n.modified("datum");return t&&n.source.sort(e.sort),this.modified(t),n};var Ce="center",qe="normalize",Le=t.inherits(te,n.Transform);Le.transform=function(e,n){var r,a,i,o,u=e.as||["y0","y1"],s=u[0],f=u[1],l=e.field||t.one,c=e.offset===Ce?re:e.offset===qe?ae:ie;for(r=oe(n.source,e.groupby,e.sort,l),a=0,i=r.length,o=r.max;a<i;++a)c(r[a],o,l,s,f);return n.reflow(e.modified()).modifies(u)};var _e={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"as",type:"string",default:"path"}]},Ie={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},Pe={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:"zero",values:["zero","center","normalize"]},{name:"as",type:"string",array:!0,length:2,default:["y0","y1"]}]};n.register(_e,z),n.register(Ie,H),n.register(Pe,te),n.transform("AxisTicks",m),n.transform("DataJoin",p),n.transform("Encode",g),n.transform("LegendEntries",T),n.transform("Scale",J),n.transform("SortItems",ne),e.transform=n.transform,e.definition=n.definition,e.scale=a.scale,e.scheme=a.scheme,Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "vega-encode",
"version": "1.0.0-beta.17",
"version": "1.0.0-beta.18",
"description": "Visual encoding transforms for Vega dataflows.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -22,3 +22,3 @@ import {Transform, ingest} from 'vega-dataflow';

export default function AxisTicks(params) {
Transform.call(this, [], params);
Transform.call(this, null, params);
}

@@ -29,3 +29,3 @@

prototype.transform = function(_, pulse) {
if (this.value != null && !_.modified()) {
if (this.value && !_.modified()) {
return pulse.StopPropagation;

@@ -32,0 +32,0 @@ }

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc