vega-encode
Advanced tools
Comparing version 1.0.0-beta to 1.0.0-beta.1
@@ -120,3 +120,3 @@ (function (global, factory) { | ||
var out = pulse.fork(), | ||
var out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS), | ||
ticks = this.value, | ||
@@ -301,3 +301,3 @@ scale$$1 = _.scale, | ||
var out = pulse.fork(), | ||
var out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS), | ||
total = 0, | ||
@@ -383,7 +383,7 @@ items = this.value, | ||
pulse.reflow().visit(pulse.SOURCE, function(t) { | ||
pulse.visit(pulse.SOURCE, function(t) { | ||
t[as] = path(sx(t), sy(t), tx(t), ty(t)); | ||
}); | ||
return pulse.modifies(as); | ||
return pulse.reflow(_.modified()).modifies(as); | ||
}; | ||
@@ -517,3 +517,3 @@ | ||
this.value = values; | ||
return pulse.reflow().modifies(as); | ||
return pulse.reflow(_.modified()).modifies(as); | ||
}; | ||
@@ -668,3 +668,3 @@ | ||
return pulse.reflow().modifies(as); | ||
return pulse.reflow(_.modified()).modifies(as); | ||
}; | ||
@@ -671,0 +671,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("d3-array"),require("vega-scale")):"function"==typeof define&&define.amd?define(["exports","vega-dataflow","vega-util","d3-format","d3-array","vega-scale"],n):n(e.vega=e.vega||{},e.vega,e.vega,e.d3,e.d3,e.vega)}(this,function(e,n,r,t,a,i){"use strict";function o(e,n){return e.ticks?e.ticks(n):e.domain()}function s(e,n,r){var t=e.tickFormat?e.tickFormat(n,r):String;return"log"===e.type?u(t,f(r)):t}function u(e,n){return function(r){return e(r)?n(r):""}}function f(e){var n=t.formatSpecifier(e||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return l(t.format(n),t.format(".1f")(1)[1])}return t.format(n)}function l(e,n){return function(r){var t,a,i=e(r),o=i.indexOf(n);if(o<0)return i;for(t=c(i,o),a=t<i.length?i.slice(t):"";--t>o;)if("0"!==i[t]){++t;break}return i.slice(0,t)+a}}function c(e,n){var r,t=e.lastIndexOf("e");if(t>0)return t;for(t=e.length;--t>n;)if(r=e.charCodeAt(t),r>=48&&r<=57)return t+1}function d(e){n.Transform.call(this,[],e)}function m(e){n.Transform.call(this,null,e)}function h(){return n.ingest({})}function p(e){n.Transform.call(this,null,e)}function v(e){n.Transform.call(this,[],e)}function g(e){return e.source.x}function y(e){return e.source.y}function M(e){return e.target.x}function x(e){return e.target.y}function b(e){n.Transform.call(this,{},e)}function k(e,n,r,t){return"M"+e+","+n+"L"+r+","+t}function S(e,n,r,t){return k(n*Math.cos(e),n*Math.sin(e),t*Math.cos(r),t*Math.sin(r))}function z(e,n,r,t){var a=r-e,i=t-n,o=.2*(a+i),s=.2*(i-a);return"M"+e+","+n+"C"+(e+o)+","+(n+s)+" "+(r+s)+","+(t-o)+" "+r+","+t}function A(e,n,r,t){return z(n*Math.cos(e),n*Math.sin(e),t*Math.cos(r),t*Math.sin(r))}function T(e,n,r,t){return"M"+e+","+n+"V"+t+"H"+r}function O(e,n,r,t){return"M"+e+","+n+"H"+r+"V"+t}function D(e,n,r,t){var a=Math.cos(e),i=Math.sin(e),o=Math.cos(r),s=Math.sin(r),u=Math.abs(r-e)>Math.PI?r<=e:r>e;return"M"+n*a+","+n*i+"A"+n+","+n+" 0 0,"+(u?1:0)+" "+n*o+","+n*s+"L"+t*o+","+t*s}function w(e,n,r,t){var a=(e+r)/2;return"M"+e+","+n+"C"+a+","+n+" "+a+","+t+" "+r+","+t}function E(e,n,r,t){var a=(n+t)/2;return"M"+e+","+n+"C"+e+","+a+" "+r+","+a+" "+r+","+t}function C(e,n,r,t){var a=Math.cos(e),i=Math.sin(e),o=Math.cos(r),s=Math.sin(r),u=(n+t)/2;return"M"+n*a+","+n*i+"C"+u*a+","+u*i+" "+u*o+","+u*s+" "+t*o+","+t*s}function L(e){n.Transform.call(this,null,e)}function P(e){n.Transform.call(this,null,e),this.modified(!0)}function R(e,n,r){var t=i.scale((e||"linear").toLowerCase());return t(n&&n.toLowerCase(),r)}function F(e,n){var r,t=n.domain,a=n.zero||void 0===n.zero&&B[e.type];return t?((a||null!=n.domainMin||null!=n.domainMax)&&(r=(t=t.slice()).length-1,a&&(t[0]>0&&(t[0]=0),t[r]<0&&(t[r]=0)),null!=n.domainMin&&(t[0]=n.domainMin),null!=n.domainMax&&(t[r]=n.domainMax)),e.domain(t),n.nice&&e.nice&&e.nice(n.nice!==!0&&+n.nice||null),t.length):0}function _(e,n,t){var a=e.type,i=n.range;null!=n.bandSize&&("band"!==a&&"point"!==a&&r.error("Only band and point scales support bandSize."),i=[0,n.bandSize*t]),i&&(n.reverse&&(i=i.slice().reverse()),e[n.round?"rangeRound":"range"](i))}function q(e){n.Transform.call(this,null,e)}function I(e,n,r,t){var a,i,o,s,u,f,l,c,d,m=[],h=function(e){return e(u)};if(null==n)m.push(e.slice());else for(a={},i=0,o=e.length;i<o;++i)u=e[i],f=n.map(h),l=a[f]||(m.push(a[f]=[]),a[f]),l.push(u);for(f=0,d=0,s=m.length;f<s;++f){for(l=m[f],i=0,c=0,o=l.length;i<o;++i)c+=t(l[i]);l.sum=c,c>d&&(d=c),r&&l.sort(r)}return m.max=d,m}var N=r.inherits(d,n.Transform);N.transform=function(e,r){if(null!=this.value&&!e.modified())return r.StopPropagation;var t=r.fork(),a=this.value,i=e.scale,u=null==e.count?10:e.count,f=e.format||s(i,u,e.formatSpecifier),l=e.values||o(i,u);return a&&(t.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:""})),t.source=t.add=this.value=a,t};var U=function(e,n){return e.hasOwnProperty(n)?e[n]:null},X=r.inherits(m,n.Transform);X.transform=function(e,t){var a=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||h,o=e.key||n.tupleid,s=this.value||(t=t.addAll(),this.value={});return(e.modified("key")||t.modified(o))&&r.error("DataJoin does not support modified key function or fields."),t.visit(t.ADD,function(e){var n=o(e),r=U(s,n);r?(r.exit?a.add:a.mod).push(r):(s[n]=r=i(e),a.add.push(r)),r.datum=e,r.exit=!1}),t.visit(t.MOD,function(e){var n=o(e),r=U(s,n);r&&a.mod.push(r)}),t.visit(t.REM,function(e){var n=o(e),r=U(s,n);e===r.datum&&(a.rem.push(r),r.exit=!0)}),a};var Y=r.inherits(p,n.Transform);Y.transform=function(e,n){var t=n.fork(n.ADD_REM),a=n.encode,i="enter"===a,o=e.encoders.update||r.falsy,s=e.encoders.enter||r.falsy,u=e.encoders.exit||r.falsy,f=(a&&!i?e.encoders[a]:o)||r.falsy;if(n.changed(n.ADD)&&(n.visit(n.ADD,function(n){s(n,e),o(n,e),f!==r.falsy&&f!==o&&f(n,e)}),t.modifies(s.output),t.modifies(o.output),f!==r.falsy&&f!==o&&t.modifies(f.output)),n.changed(n.REM)&&u!==r.falsy&&(n.visit(n.REM,function(n){u(n,e)}),t.modifies(u.output)),i||f!==r.falsy){var l=n.MOD|(e.modified()?n.REFLOW:0);i?(n.visit(l,function(n){var r=s(n,e);(f(n,e)||r)&&t.mod.push(n)}),t.mod.length&&t.modifies(s.output)):n.visit(l,function(n){f(n,e)&&t.mod.push(n)}),t.mod.length&&t.modifies(f.output)}return t};var j=r.inherits(v,n.Transform);j.transform=function(e,t){if(null!=this.value&&!e.modified())return t.StopPropagation;var a=t.fork(),i=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||(f?l.domain():o(l,c));if(u&&(a.rem=u),f)var h=e.values?l.domain():m,p=h[0],v=h[h.length-1],g=l.range?l.copy().domain([p,v]).range([0,1]):function(e){return(e-p)/(v-p)};else{var y=e.size;r.isFunction(y)||(y=r.constant(y||8))}return u=m.map(function(e,r){var t=n.ingest({index:r,label:d(e),value:e});return f?t.perc=g(e):(t.size=y(e),t.total=Math.round(i),i+=t.size),t}),a.source=a.add=this.value=u,a};var H={line:k,"line-radial":S,curve:z,"curve-radial":A,"orthogonal-horizontal":T,"orthogonal-vertical":O,"orthogonal-radial":D,"diagonal-horizontal":w,"diagonal-vertical":E,"diagonal-radial":C},J=r.inherits(b,n.Transform);J.transform=function(e,n){var t=e.sourceX||g,a=e.sourceY||y,i=e.targetX||M,o=e.targetY||x,s=e.as||"path",u=e.orient||"vertical",f=e.shape||"line",l=U(H,f+"-"+u)||U(H,f);return l||r.error("LinkPath unsupported type: "+e.shape+"-"+e.orient),n.reflow().visit(n.SOURCE,function(e){e[s]=l(t(e),a(e),i(e),o(e))}),n.modifies(s)};var V=r.inherits(L,n.Transform);V.transform=function(e,n){var t,i,o,s=e.as||["startAngle","endAngle"],u=s[0],f=s[1],l=e.field||r.one,c=e.startAngle||0,d=null!=e.endAngle?e.endAngle:2*Math.PI,m=n.source,h=m.map(l),p=h.length,v=c,g=(d-c)/a.sum(h),y=a.range(p);for(e.sort&&y.sort(function(e,n){return h[e]-h[n]}),t=0;t<p;++t)o=h[y[t]],i=m[y[t]],i[u]=v,i[f]=v+=o*g;return this.value=h,n.reflow().modifies(s)};var W={set:1,modified:1,clear:1,type:1,scheme:1,domain:1,domainMin:1,domainMax:1,nice:1,zero:1,range:1,round:1,bandSize:1,reverse:1},B=r.toSet(["linear","pow","sqrt"]),G=r.inherits(P,n.Transform);G.transform=function(e,n){var t,a=this.value,i=!a||e.modified("type")||e.modified("scheme")||e.scheme&&e.modified("reverse");i&&(this.value=a=R(e.type,e.scheme,e.reverse));for(t in e)W[t]||(r.isFunction(a[t])?a[t](e[t]):n.dataflow.warn("Unsupported scale property: "+t));return _(a,e,F(a,e)),n.fork(n.NO_SOURCE|n.NO_FIELDS)};var K="center",Q="normalize",Z=r.inherits(q,n.Transform);Z.transform=function(e,n){var r,t,a,i,o,s,u,f,l,c,d,m,h,p=e.as||["y0","y1"],v=p[0],g=p[1],y=e.field,M=e.offset;for(r=I(n.source,e.groupby,e.sort,y),a=0,o=r.length,u=r.max;a<o;++a)for(t=r[a],f=M===K?(u-t.sum)/2:0,l=M===Q?1/t.sum:1,m=f,h=0,i=0,s=t.length;i<s;++i)c=t[i],d=m,h+=y(c),m=l*h+f,c[v]=d,c[g]=m;return n.reflow().modifies(p)};var $={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","curve","diagonal","orthogonal"]},{name:"as",type:"string",default:"path"}]},ee={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"]}]},ne={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($,b),n.register(ee,L),n.register(ne,q),n.transform("AxisTicks",d),n.transform("DataJoin",m),n.transform("Encode",p),n.transform("LegendEntries",v),n.transform("Scale",P),e.transform=n.transform,e.definition=n.definition,e.scale=i.scale,e.scheme=i.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("d3-array"),require("vega-scale")):"function"==typeof define&&define.amd?define(["exports","vega-dataflow","vega-util","d3-format","d3-array","vega-scale"],n):n(e.vega=e.vega||{},e.vega,e.vega,e.d3,e.d3,e.vega)}(this,function(e,n,r,t,a,i){"use strict";function o(e,n){return e.ticks?e.ticks(n):e.domain()}function s(e,n,r){var t=e.tickFormat?e.tickFormat(n,r):String;return"log"===e.type?u(t,f(r)):t}function u(e,n){return function(r){return e(r)?n(r):""}}function f(e){var n=t.formatSpecifier(e||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return l(t.format(n),t.format(".1f")(1)[1])}return t.format(n)}function l(e,n){return function(r){var t,a,i=e(r),o=i.indexOf(n);if(o<0)return i;for(t=d(i,o),a=t<i.length?i.slice(t):"";--t>o;)if("0"!==i[t]){++t;break}return i.slice(0,t)+a}}function d(e,n){var r,t=e.lastIndexOf("e");if(t>0)return t;for(t=e.length;--t>n;)if(r=e.charCodeAt(t),r>=48&&r<=57)return t+1}function c(e){n.Transform.call(this,[],e)}function m(e){n.Transform.call(this,null,e)}function h(){return n.ingest({})}function p(e){n.Transform.call(this,null,e)}function v(e){n.Transform.call(this,[],e)}function g(e){return e.source.x}function y(e){return e.source.y}function M(e){return e.target.x}function x(e){return e.target.y}function S(e){n.Transform.call(this,{},e)}function O(e,n,r,t){return"M"+e+","+n+"L"+r+","+t}function b(e,n,r,t){return O(n*Math.cos(e),n*Math.sin(e),t*Math.cos(r),t*Math.sin(r))}function k(e,n,r,t){var a=r-e,i=t-n,o=.2*(a+i),s=.2*(i-a);return"M"+e+","+n+"C"+(e+o)+","+(n+s)+" "+(r+s)+","+(t-o)+" "+r+","+t}function z(e,n,r,t){return k(n*Math.cos(e),n*Math.sin(e),t*Math.cos(r),t*Math.sin(r))}function A(e,n,r,t){return"M"+e+","+n+"V"+t+"H"+r}function T(e,n,r,t){return"M"+e+","+n+"H"+r+"V"+t}function D(e,n,r,t){var a=Math.cos(e),i=Math.sin(e),o=Math.cos(r),s=Math.sin(r),u=Math.abs(r-e)>Math.PI?r<=e:r>e;return"M"+n*a+","+n*i+"A"+n+","+n+" 0 0,"+(u?1:0)+" "+n*o+","+n*s+"L"+t*o+","+t*s}function E(e,n,r,t){var a=(e+r)/2;return"M"+e+","+n+"C"+a+","+n+" "+a+","+t+" "+r+","+t}function w(e,n,r,t){var a=(n+t)/2;return"M"+e+","+n+"C"+e+","+a+" "+r+","+a+" "+r+","+t}function C(e,n,r,t){var a=Math.cos(e),i=Math.sin(e),o=Math.cos(r),s=Math.sin(r),u=(n+t)/2;return"M"+n*a+","+n*i+"C"+u*a+","+u*i+" "+u*o+","+u*s+" "+t*o+","+t*s}function L(e){n.Transform.call(this,null,e)}function R(e){n.Transform.call(this,null,e),this.modified(!0)}function _(e,n,r){var t=i.scale((e||"linear").toLowerCase());return t(n&&n.toLowerCase(),r)}function F(e,n){var r,t=n.domain,a=n.zero||void 0===n.zero&&B[e.type];return t?((a||null!=n.domainMin||null!=n.domainMax)&&(r=(t=t.slice()).length-1,a&&(t[0]>0&&(t[0]=0),t[r]<0&&(t[r]=0)),null!=n.domainMin&&(t[0]=n.domainMin),null!=n.domainMax&&(t[r]=n.domainMax)),e.domain(t),n.nice&&e.nice&&e.nice(n.nice!==!0&&+n.nice||null),t.length):0}function P(e,n,t){var a=e.type,i=n.range;null!=n.bandSize&&("band"!==a&&"point"!==a&&r.error("Only band and point scales support bandSize."),i=[0,n.bandSize*t]),i&&(n.reverse&&(i=i.slice().reverse()),e[n.round?"rangeRound":"range"](i))}function N(e){n.Transform.call(this,null,e)}function I(e,n,r,t){var a,i,o,s,u,f,l,d,c,m=[],h=function(e){return e(u)};if(null==n)m.push(e.slice());else for(a={},i=0,o=e.length;i<o;++i)u=e[i],f=n.map(h),l=a[f]||(m.push(a[f]=[]),a[f]),l.push(u);for(f=0,c=0,s=m.length;f<s;++f){for(l=m[f],i=0,d=0,o=l.length;i<o;++i)d+=t(l[i]);l.sum=d,d>c&&(c=d),r&&l.sort(r)}return m.max=c,m}var q=r.inherits(c,n.Transform);q.transform=function(e,r){if(null!=this.value&&!e.modified())return r.StopPropagation;var t=r.fork(r.NO_SOURCE|r.NO_FIELDS),a=this.value,i=e.scale,u=null==e.count?10:e.count,f=e.format||s(i,u,e.formatSpecifier),l=e.values||o(i,u);return a&&(t.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:""})),t.source=t.add=this.value=a,t};var U=function(e,n){return e.hasOwnProperty(n)?e[n]:null},X=r.inherits(m,n.Transform);X.transform=function(e,t){var a=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||h,o=e.key||n.tupleid,s=this.value||(t=t.addAll(),this.value={});return(e.modified("key")||t.modified(o))&&r.error("DataJoin does not support modified key function or fields."),t.visit(t.ADD,function(e){var n=o(e),r=U(s,n);r?(r.exit?a.add:a.mod).push(r):(s[n]=r=i(e),a.add.push(r)),r.datum=e,r.exit=!1}),t.visit(t.MOD,function(e){var n=o(e),r=U(s,n);r&&a.mod.push(r)}),t.visit(t.REM,function(e){var n=o(e),r=U(s,n);e===r.datum&&(a.rem.push(r),r.exit=!0)}),a};var Y=r.inherits(p,n.Transform);Y.transform=function(e,n){var t=n.fork(n.ADD_REM),a=n.encode,i="enter"===a,o=e.encoders.update||r.falsy,s=e.encoders.enter||r.falsy,u=e.encoders.exit||r.falsy,f=(a&&!i?e.encoders[a]:o)||r.falsy;if(n.changed(n.ADD)&&(n.visit(n.ADD,function(n){s(n,e),o(n,e),f!==r.falsy&&f!==o&&f(n,e)}),t.modifies(s.output),t.modifies(o.output),f!==r.falsy&&f!==o&&t.modifies(f.output)),n.changed(n.REM)&&u!==r.falsy&&(n.visit(n.REM,function(n){u(n,e)}),t.modifies(u.output)),i||f!==r.falsy){var l=n.MOD|(e.modified()?n.REFLOW:0);i?(n.visit(l,function(n){var r=s(n,e);(f(n,e)||r)&&t.mod.push(n)}),t.mod.length&&t.modifies(s.output)):n.visit(l,function(n){f(n,e)&&t.mod.push(n)}),t.mod.length&&t.modifies(f.output)}return t};var j=r.inherits(v,n.Transform);j.transform=function(e,t){if(null!=this.value&&!e.modified())return t.StopPropagation;var a=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=0,u=this.value,f="gradient"===e.type,l=e.scale,d=null==e.count?5:e.count,c=e.format||s(l,d,e.formatSpecifier),m=e.values||(f?l.domain():o(l,d));if(u&&(a.rem=u),f)var h=e.values?l.domain():m,p=h[0],v=h[h.length-1],g=l.range?l.copy().domain([p,v]).range([0,1]):function(e){return(e-p)/(v-p)};else{var y=e.size;r.isFunction(y)||(y=r.constant(y||8))}return u=m.map(function(e,r){var t=n.ingest({index:r,label:c(e),value:e});return f?t.perc=g(e):(t.size=y(e),t.total=Math.round(i),i+=t.size),t}),a.source=a.add=this.value=u,a};var H={line:O,"line-radial":b,curve:k,"curve-radial":z,"orthogonal-horizontal":A,"orthogonal-vertical":T,"orthogonal-radial":D,"diagonal-horizontal":E,"diagonal-vertical":w,"diagonal-radial":C},J=r.inherits(S,n.Transform);J.transform=function(e,n){var t=e.sourceX||g,a=e.sourceY||y,i=e.targetX||M,o=e.targetY||x,s=e.as||"path",u=e.orient||"vertical",f=e.shape||"line",l=U(H,f+"-"+u)||U(H,f);return l||r.error("LinkPath unsupported type: "+e.shape+"-"+e.orient),n.visit(n.SOURCE,function(e){e[s]=l(t(e),a(e),i(e),o(e))}),n.reflow(e.modified()).modifies(s)};var V=r.inherits(L,n.Transform);V.transform=function(e,n){var t,i,o,s=e.as||["startAngle","endAngle"],u=s[0],f=s[1],l=e.field||r.one,d=e.startAngle||0,c=null!=e.endAngle?e.endAngle:2*Math.PI,m=n.source,h=m.map(l),p=h.length,v=d,g=(c-d)/a.sum(h),y=a.range(p);for(e.sort&&y.sort(function(e,n){return h[e]-h[n]}),t=0;t<p;++t)o=h[y[t]],i=m[y[t]],i[u]=v,i[f]=v+=o*g;return this.value=h,n.reflow(e.modified()).modifies(s)};var W={set:1,modified:1,clear:1,type:1,scheme:1,domain:1,domainMin:1,domainMax:1,nice:1,zero:1,range:1,round:1,bandSize:1,reverse:1},B=r.toSet(["linear","pow","sqrt"]),G=r.inherits(R,n.Transform);G.transform=function(e,n){var t,a=this.value,i=!a||e.modified("type")||e.modified("scheme")||e.scheme&&e.modified("reverse");i&&(this.value=a=_(e.type,e.scheme,e.reverse));for(t in e)W[t]||(r.isFunction(a[t])?a[t](e[t]):n.dataflow.warn("Unsupported scale property: "+t));return P(a,e,F(a,e)),n.fork(n.NO_SOURCE|n.NO_FIELDS)};var K="center",Q="normalize",Z=r.inherits(N,n.Transform);Z.transform=function(e,n){var r,t,a,i,o,s,u,f,l,d,c,m,h,p=e.as||["y0","y1"],v=p[0],g=p[1],y=e.field,M=e.offset;for(r=I(n.source,e.groupby,e.sort,y),a=0,o=r.length,u=r.max;a<o;++a)for(t=r[a],f=M===K?(u-t.sum)/2:0,l=M===Q?1/t.sum:1,m=f,h=0,i=0,s=t.length;i<s;++i)d=t[i],c=m,h+=y(d),m=l*h+f,d[v]=c,d[g]=m;return n.reflow(e.modified()).modifies(p)};var $={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","curve","diagonal","orthogonal"]},{name:"as",type:"string",default:"path"}]},ee={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"]}]},ne={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($,S),n.register(ee,L),n.register(ne,N),n.transform("AxisTicks",c),n.transform("DataJoin",m),n.transform("Encode",p),n.transform("LegendEntries",v),n.transform("Scale",R),e.transform=n.transform,e.definition=n.definition,e.scale=i.scale,e.scheme=i.scheme,Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "vega-encode", | ||
"version": "1.0.0-beta", | ||
"version": "1.0.0-beta.1", | ||
"description": "Visual encoding transforms for Vega dataflows.", | ||
@@ -33,3 +33,3 @@ "keywords": [ | ||
"d3-format": "1", | ||
"vega-dataflow": ">=2.0.0-beta", | ||
"vega-dataflow": ">=2.0.0-beta.4", | ||
"vega-scale": "1", | ||
@@ -36,0 +36,0 @@ "vega-util": "1" |
@@ -32,3 +32,3 @@ import {Transform, ingest} from 'vega-dataflow'; | ||
var out = pulse.fork(), | ||
var out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS), | ||
ticks = this.value, | ||
@@ -35,0 +35,0 @@ scale = _.scale, |
@@ -32,3 +32,3 @@ import {Transform, ingest} from 'vega-dataflow'; | ||
var out = pulse.fork(), | ||
var out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS), | ||
total = 0, | ||
@@ -35,0 +35,0 @@ items = this.value, |
@@ -48,7 +48,7 @@ import get from './get'; | ||
pulse.reflow().visit(pulse.SOURCE, function(t) { | ||
pulse.visit(pulse.SOURCE, function(t) { | ||
t[as] = path(sx(t), sy(t), tx(t), ty(t)); | ||
}); | ||
return pulse.modifies(as); | ||
return pulse.reflow(_.modified()).modifies(as); | ||
}; | ||
@@ -55,0 +55,0 @@ |
@@ -49,3 +49,3 @@ import {Transform} from 'vega-dataflow'; | ||
this.value = values; | ||
return pulse.reflow().modifies(as); | ||
return pulse.reflow(_.modified()).modifies(as); | ||
}; |
@@ -51,3 +51,3 @@ import {Transform} from 'vega-dataflow'; | ||
return pulse.reflow().modifies(as); | ||
return pulse.reflow(_.modified()).modifies(as); | ||
}; | ||
@@ -54,0 +54,0 @@ |
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
58574
Updatedvega-dataflow@>=2.0.0-beta.4