Socket
Socket
Sign inDemoInstall

vega-view-transforms

Package Overview
Dependencies
30
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.5.0 to 4.5.1

45

build/vega-view-transforms.js

@@ -452,4 +452,4 @@ (function (global, factory) {

s = Math.max(minExtent, Math.min(maxExtent, -bounds.y1));
if (title) s = axisTitleLayout(view, title, s, titlePadding, dl, 0, -1, bounds);
bounds.add(0, -s).add(range, 0);
if (title) axisTitleLayout(view, title, s, titlePadding, dl, 0, -1, bounds);
break;

@@ -460,4 +460,4 @@ case Left:

s = Math.max(minExtent, Math.min(maxExtent, -bounds.x1));
if (title) s = axisTitleLayout(view, title, s, titlePadding, dl, 1, -1, bounds);
bounds.add(-s, 0).add(0, range);
if (title) axisTitleLayout(view, title, s, titlePadding, dl, 1, -1, bounds);
break;

@@ -468,4 +468,4 @@ case Right:

s = Math.max(minExtent, Math.min(maxExtent, bounds.x2));
if (title) s = axisTitleLayout(view, title, s, titlePadding, dl, 1, 1, bounds);
bounds.add(0, 0).add(s, range);
if (title) axisTitleLayout(view, title, s, titlePadding, dl, 1, 1, bounds);
break;

@@ -476,4 +476,4 @@ case Bottom:

s = Math.max(minExtent, Math.min(maxExtent, bounds.y2));
if (title) s = axisTitleLayout(view, title, s, titlePadding, 0, 0, 1, bounds);
bounds.add(0, 0).add(range, s);
if (title) axisTitleLayout(view, title, s, titlePadding, 0, 0, 1, bounds);
break;

@@ -499,28 +499,17 @@ default:

function axisTitleLayout(view, title, offset, pad, dl, isYAxis, sign, bounds) {
var b = title.bounds, dx = 0, dy = 0;
const b = title.bounds;
if (title.auto) {
const v = sign * (offset + dl + pad);
let dx = 0, dy = 0;
view.dirty(title);
offset += pad;
isYAxis
? dx = (title.x || 0) - (title.x = sign * (offset + dl))
: dy = (title.y || 0) - (title.y = sign * (offset + dl));
? dx = (title.x || 0) - (title.x = v)
: dy = (title.y || 0) - (title.y = v);
title.mark.bounds.clear().union(b.translate(-dx, -dy));
view.dirty(title);
if (isYAxis) {
bounds.add(0, b.y1).add(0, b.y2);
offset += b.width();
} else {
bounds.add(b.x1, 0).add(b.x2, 0);
offset += b.height();
}
} else {
bounds.union(b);
}
return offset;
bounds.union(b);
}

@@ -1328,11 +1317,10 @@

function viewSizeLayout(view, group, viewBounds, _) {
var auto = _.autosize || {},
type = auto.type,
viewWidth = view._width,
viewHeight = view._height,
padding = view.padding();
const auto = _.autosize || {},
type = auto.type;
if (view._autosize < 1 || !type) return;
var width = Math.max(0, group.width || 0),
let viewWidth = view._width,
viewHeight = view._height,
width = Math.max(0, group.width || 0),
left = Math.max(0, Math.ceil(-viewBounds.x1)),

@@ -1345,2 +1333,3 @@ right = Math.max(0, Math.ceil(viewBounds.x2 - width)),

if (auto.contains === Padding) {
const padding = view.padding();
viewWidth -= padding.left + padding.right;

@@ -1347,0 +1336,0 @@ viewHeight -= padding.top + padding.bottom;

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vega-dataflow"),require("vega-scenegraph"),require("vega-util")):"function"==typeof define&&define.amd?define(["exports","vega-dataflow","vega-scenegraph","vega-util"],t):t(((e=e||self).vega=e.vega||{},e.vega.transforms={}),e.vega,e.vega,e.vega)}(this,(function(e,t,n,r){"use strict";const a="top",o="left",i="right",s="bottom",u="top-left",c="top-right",d="bottom-left",l="bottom-right",f="start",h="middle",m="end",y="x",b="y",x="group",g="axis",p="title",w="frame",v="scope",k="legend",M="row-header",E="row-footer",T="row-title",_="column-header",A="column-footer",z="column-title",B="padding",D="symbol",O="fit",j="fit-x",q="fit-y",S="pad",L="none",I="all",P="each",C="flush",F="column",G="row";function H(e){t.Transform.call(this,null,e)}function R(e,t,n){return t(e.bounds.clear(),e,n)}r.inherits(H,t.Transform).transform=function(e,t){var r,a=t.dataflow,o=e.mark,i=o.marktype,s=n.Marks[i],u=s.bound,c=o.bounds;if(s.nested)o.items.length&&a.dirty(o.items[0]),c=R(o,u),o.items.forEach((function(e){e.bounds.clear().union(c)}));else if(i===x||e.modified())switch(t.visit(t.MOD,(function(e){a.dirty(e)})),c.clear(),o.items.forEach((function(e){c.union(R(e,u))})),o.role){case g:case k:case p:t.reflow()}else r=t.changed(t.REM),t.visit(t.ADD,(function(e){c.union(R(e,u))})),t.visit(t.MOD,(function(e){r=r||c.alignsWith(e.bounds),a.dirty(e),c.union(R(e,u))})),r&&(c.clear(),o.items.forEach((function(e){c.union(e.bounds)})));return n.boundClip(o),t.modifies("bounds")};var U=":vega_identifier:";function V(e){t.Transform.call(this,0,e)}function W(e){t.Transform.call(this,null,e)}function J(e){t.Transform.call(this,null,e)}V.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},r.inherits(V,t.Transform).transform=function(e,t){var n=function(e){var t=e._signals[U];t||(e._signals[U]=t=e.add(0));return t}(t.dataflow),r=n.value,a=e.as;return t.visit(t.ADD,(function(e){e[a]||(e[a]=++r)})),n.set(this.value=r),t},r.inherits(W,t.Transform).transform=function(e,t){var r=this.value;r||((r=t.dataflow.scenegraph().mark(e.markdef,function(e){var t=e.groups,n=e.parent;return t&&1===t.size?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}(e),e.index)).group.context=e.context,e.context.group||(e.context.group=r.group),r.source=this.source,r.clip=e.clip,r.interactive=e.interactive,this.value=r);var a=r.marktype===x?n.GroupItem:n.Item;return t.visit(t.ADD,(function(e){a.call(e,r)})),(e.modified("clip")||e.modified("interactive"))&&(r.clip=e.clip,r.interactive=!!e.interactive,r.zdirty=!0,t.reflow()),r.items=t.source,t};var K=r.inherits(J,t.Transform),N={parity:function(e){return e.filter((e,t)=>t%2?e.opacity=0:1)},greedy:function(e,t){var n;return e.filter((e,r)=>r&&Q(n.bounds,e.bounds,t)?e.opacity=0:(n=e,1))}};function Q(e,t,n){return n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2)}function X(e,t){for(var n,r=1,a=e.length,o=e[0].bounds;r<a;o=n,++r)if(Q(o,n=e[r].bounds,t))return!0}function Y(e){var t=e.bounds;return t.width()>1&&t.height()>1}function Z(e){return e.forEach(e=>e.opacity=1),e}function $(e,t){return e.reflow(t.modified()).modifies("opacity")}function ee(e){t.Transform.call(this,null,e)}K.transform=function(e,t){var o,i,u,c=N[e.method]||N.parity,d=t.materialize(t.SOURCE).source,l=e.separation||0;if(d&&d.length){if(!e.method)return e.modified("method")&&(Z(d),t=$(t,e)),t;if(e.sort&&(d=d.slice().sort(e.sort)),o=Z(d=d.filter(Y)),t=$(t,e),o.length>=3&&X(o,l)){do{o=c(o,l)}while(o.length>=3&&X(o,l));o.length<3&&!r.peek(d).opacity&&(o.length>1&&(r.peek(o).opacity=0),r.peek(d).opacity=1)}var f,h,m,y,b;return e.boundScale&&e.boundTolerance>=0&&(f=e.boundScale,h=e.boundOrient,m=+e.boundTolerance,y=f.range(),b=new n.Bounds,h===a||h===s?b.set(y[0],-1/0,y[1],1/0):b.set(-1/0,y[0],1/0,y[1]),b.expand(m||1),i=e=>b.encloses(e.bounds),d.forEach(e=>{i(e)||(e.opacity=0)})),u=o[0].mark.bounds.clear(),d.forEach(e=>{e.opacity&&u.union(e.bounds)}),t}},r.inherits(ee,t.Transform).transform=function(e,t){var n=t.dataflow;if(t.visit(t.ALL,(function(e){n.dirty(e)})),t.fields&&t.fields.zindex){var r=t.source&&t.source[0];r&&(r.mark.zdirty=!0)}};const te=new n.Bounds;function ne(e,t,n){return e[t]===n?0:(e[t]=n,1)}function re(e){var t=e.items[0].datum.orient;return t===o||t===i}function ae(e,t,r,u){var c,d,l=t.items[0],f=l.datum,h=f.orient,m=null!=f.translate?f.translate:.5,y=function(e){var t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}(f),b=l.range,x=l.offset,g=l.position,p=l.minExtent,w=l.maxExtent,v=f.title&&l.items[y[2]].items[0],k=l.titlePadding,M=l.bounds,E=v&&n.multiLineOffset(v),T=0,_=0;switch(te.clear().union(M),M.clear(),(c=y[0])>-1&&M.union(l.items[c].bounds),(c=y[1])>-1&&M.union(l.items[c].bounds),h){case a:T=g||0,_=-x,d=Math.max(p,Math.min(w,-M.y1)),v&&(d=oe(e,v,d,k,E,0,-1,M)),M.add(0,-d).add(b,0);break;case o:T=-x,_=g||0,d=Math.max(p,Math.min(w,-M.x1)),v&&(d=oe(e,v,d,k,E,1,-1,M)),M.add(-d,0).add(0,b);break;case i:T=r+x,_=g||0,d=Math.max(p,Math.min(w,M.x2)),v&&(d=oe(e,v,d,k,E,1,1,M)),M.add(0,0).add(d,b);break;case s:T=g||0,_=u+x,d=Math.max(p,Math.min(w,M.y2)),v&&(d=oe(e,v,d,k,0,0,1,M)),M.add(0,0).add(b,d);break;default:T=l.x,_=l.y}return n.boundStroke(M.translate(T,_),l),ne(l,"x",T+m)|ne(l,"y",_+m)&&(l.bounds=te,e.dirty(l),l.bounds=M,e.dirty(l)),l.mark.bounds.clear().union(M)}function oe(e,t,n,r,a,o,i,s){var u=t.bounds,c=0,d=0;return t.auto?(e.dirty(t),n+=r,o?c=(t.x||0)-(t.x=i*(n+a)):d=(t.y||0)-(t.y=i*(n+a)),t.mark.bounds.clear().union(u.translate(-c,-d)),e.dirty(t),o?(s.add(0,u.y1).add(0,u.y2),n+=u.width()):(s.add(u.x1,0).add(u.x2,0),n+=u.height())):s.union(u),n}function ie(e){return(new n.Bounds).set(0,0,e.width||0,e.height||0)}function se(e){var t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function ue(e,t,n){var a=r.isObject(e)?e[t]:e;return null!=a?a:void 0!==n?n:0}function ce(e){return e<0?Math.ceil(-e):0}function de(e,t,n){var r,a,o,i,s,u,c,d,l,f,x,g=!n.nodirty,p=n.bounds===C?ie:se,w=te.set(0,0,0,0),v=ue(n.align,F),k=ue(n.align,G),M=ue(n.padding,F),E=ue(n.padding,G),T=n.columns||t.length,_=T<0?1:Math.ceil(t.length/T),A=t.length,z=Array(A),B=Array(T),D=0,O=Array(A),j=Array(_),q=0,S=Array(A),L=Array(A),H=Array(A);for(a=0;a<T;++a)B[a]=0;for(a=0;a<_;++a)j[a]=0;for(a=0;a<A;++a)u=t[a],s=H[a]=p(u),u.x=u.x||0,S[a]=0,u.y=u.y||0,L[a]=0,o=a%T,i=~~(a/T),D=Math.max(D,c=Math.ceil(s.x2)),q=Math.max(q,d=Math.ceil(s.y2)),B[o]=Math.max(B[o],c),j[i]=Math.max(j[i],d),z[a]=M+ce(s.x1),O[a]=E+ce(s.y1),g&&e.dirty(t[a]);for(a=0;a<A;++a)a%T==0&&(z[a]=0),a<T&&(O[a]=0);if(v===P)for(o=1;o<T;++o){for(x=0,a=o;a<A;a+=T)x<z[a]&&(x=z[a]);for(a=o;a<A;a+=T)z[a]=x+B[o-1]}else if(v===I){for(x=0,a=0;a<A;++a)a%T&&x<z[a]&&(x=z[a]);for(a=0;a<A;++a)a%T&&(z[a]=x+D)}else for(v=!1,o=1;o<T;++o)for(a=o;a<A;a+=T)z[a]+=B[o-1];if(k===P)for(i=1;i<_;++i){for(x=0,r=(a=i*T)+T;a<r;++a)x<O[a]&&(x=O[a]);for(a=i*T;a<r;++a)O[a]=x+j[i-1]}else if(k===I){for(x=0,a=T;a<A;++a)x<O[a]&&(x=O[a]);for(a=T;a<A;++a)O[a]=x+q}else for(k=!1,i=1;i<_;++i)for(r=(a=i*T)+T;a<r;++a)O[a]+=j[i-1];for(l=0,a=0;a<A;++a)l=z[a]+(a%T?l:0),S[a]+=l-t[a].x;for(o=0;o<T;++o)for(f=0,a=o;a<A;a+=T)f+=O[a],L[a]+=f-t[a].y;if(v&&ue(n.center,F)&&_>1)for(a=0;a<A;++a)(l=(s=v===I?D:B[a%T])-H[a].x2-t[a].x-S[a])>0&&(S[a]+=l/2);if(k&&ue(n.center,G)&&1!==T)for(a=0;a<A;++a)(f=(s=k===I?q:j[~~(a/T)])-H[a].y2-t[a].y-L[a])>0&&(L[a]+=f/2);for(a=0;a<A;++a)w.union(H[a].translate(S[a],L[a]));switch(l=ue(n.anchor,y),f=ue(n.anchor,b),ue(n.anchor,F)){case m:l-=w.width();break;case h:l-=w.width()/2}switch(ue(n.anchor,G)){case m:f-=w.height();break;case h:f-=w.height()/2}for(l=Math.round(l),f=Math.round(f),w.clear(),a=0;a<A;++a)t[a].mark.bounds.clear();for(a=0;a<A;++a)(u=t[a]).x+=S[a]+=l,u.y+=L[a]+=f,w.union(u.mark.bounds.union(u.bounds.translate(S[a],L[a]))),g&&e.dirty(u);return w}function le(e,t,n){var r,a,o,i,s,u,c,d=function(e){for(var t,n,r=e.items,a=r.length,o=0,i={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};o<a;++o)if(n=(t=r[o]).items,t.marktype===x)switch(t.role){case g:case k:case p:break;case M:i.rowheaders.push(...n);break;case E:i.rowfooters.push(...n);break;case _:i.colheaders.push(...n);break;case A:i.colfooters.push(...n);break;case T:i.rowtitle=n[0];break;case z:i.coltitle=n[0];break;default:i.marks.push(...n)}return i}(t),l=d.marks,f=n.bounds===C?fe:he,h=n.offset,y=n.columns||l.length,b=y<0?1:Math.ceil(l.length/y),w=b*y;const v=de(e,l,n);d.rowheaders&&(u=ue(n.headerBand,G,null),r=be(e,d.rowheaders,l,y,b,-ue(h,"rowHeader"),me,0,f,"x1",0,y,1,u)),d.colheaders&&(u=ue(n.headerBand,F,null),a=be(e,d.colheaders,l,y,y,-ue(h,"columnHeader"),me,1,f,"y1",0,1,y,u)),d.rowfooters&&(u=ue(n.footerBand,G,null),o=be(e,d.rowfooters,l,y,b,ue(h,"rowFooter"),ye,0,f,"x2",y-1,y,1,u)),d.colfooters&&(u=ue(n.footerBand,F,null),i=be(e,d.colfooters,l,y,y,ue(h,"columnFooter"),ye,1,f,"y2",w-y,1,y,u)),d.rowtitle&&(s=ue(n.titleAnchor,G),c=ue(h,"rowTitle"),c=s===m?o+c:r-c,u=ue(n.titleBand,G,.5),xe(e,d.rowtitle,c,0,v,u)),d.coltitle&&(s=ue(n.titleAnchor,F),c=ue(h,"columnTitle"),c=s===m?i+c:a-c,u=ue(n.titleBand,F,.5),xe(e,d.coltitle,c,1,v,u))}function fe(e,t){return"x1"===t?e.x||0:"y1"===t?e.y||0:"x2"===t?(e.x||0)+(e.width||0):"y2"===t?(e.y||0)+(e.height||0):void 0}function he(e,t){return e.bounds[t]}function me(e,t){return Math.floor(Math.min(e,t))}function ye(e,t){return Math.ceil(Math.max(e,t))}function be(e,t,n,r,a,o,i,s,u,c,d,l,f,h){var m,y,b,x,g,p,w,v,k,M=n.length,E=0,T=0;if(!M)return E;for(m=d;m<M;m+=l)n[m]&&(E=i(E,u(n[m],c)));if(!t.length)return E;for(t.length>a&&(e.warn("Grid headers exceed limit: "+a),t=t.slice(0,a)),E+=o,y=0,x=t.length;y<x;++y)e.dirty(t[y]),t[y].mark.bounds.clear();for(m=d,y=0,x=t.length;y<x;++y,m+=l){for(g=(p=t[y]).mark.bounds,b=m;b>=0&&null==(w=n[b]);b-=f);s?(v=null==h?w.x:Math.round(w.bounds.x1+h*w.bounds.width()),k=E):(v=E,k=null==h?w.y:Math.round(w.bounds.y1+h*w.bounds.height())),g.union(p.bounds.translate(v-(p.x||0),k-(p.y||0))),p.x=v,p.y=k,e.dirty(p),T=i(T,g[c])}return T}function xe(e,t,n,r,a,o){if(t){e.dirty(t);var i=n,s=n;r?i=Math.round(a.x1+o*a.width()):s=Math.round(a.y1+o*a.height()),t.bounds.translate(i-(t.x||0),s-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=i,t.y=s,e.dirty(t)}}function ge(e,t,n,r,y,b,x){const g=function(e,t){const n=e[t]||{};return(t,r)=>null!=n[t]?n[t]:null!=e[t]?e[t]:r}(n,t),p=function(e,t){var n=-1/0;return e.forEach(e=>{null!=e.offset&&(n=Math.max(n,e.offset))}),n>-1/0?n:t}(e,g("offset",0)),w=g("anchor",f),v=w===m?1:w===h?.5:0,k={align:P,bounds:g("bounds",C),columns:"vertical"===g("direction")?1:e.length,padding:g("margin",8),center:g("center"),nodirty:!0};switch(t){case o:k.anchor={x:Math.floor(r.x1)-p,column:m,y:v*(x||r.height()+2*r.y1),row:w};break;case i:k.anchor={x:Math.ceil(r.x2)+p,y:v*(x||r.height()+2*r.y1),row:w};break;case a:k.anchor={y:Math.floor(y.y1)-p,row:m,x:v*(b||y.width()+2*y.x1),column:w};break;case s:k.anchor={y:Math.ceil(y.y2)+p,x:v*(b||y.width()+2*y.x1),column:w};break;case u:k.anchor={x:p,y:p};break;case c:k.anchor={x:b-p,y:p,column:m};break;case d:k.anchor={x:p,y:x-p,row:m};break;case l:k.anchor={x:b-p,y:x-p,column:m,row:m}}return k}function pe(e,t){var r,a,u,c,d=t.items[0],l=d.datum,f=d.orient,h=d.bounds,y=d.x,b=d.y;return d._bounds?d._bounds.clear().union(h):d._bounds=h.clone(),h.clear(),function(e,t,n){var r=t.padding,a=r-n.x,u=r-n.y;if(t.datum.title){var c=t.items[1].items[0],d=c.anchor,l=t.titlePadding||0,f=r-c.x,h=r-c.y;switch(c.orient){case o:a+=Math.ceil(c.bounds.width())+l;break;case i:case s:break;default:u+=c.bounds.height()+l}switch((a||u)&&ve(e,n,a,u),c.orient){case o:h+=we(t,n,c,d,1,1);break;case i:f+=we(t,n,c,m,0,0)+l,h+=we(t,n,c,d,1,1);break;case s:f+=we(t,n,c,d,0,0),h+=we(t,n,c,m,-1,0,1)+l;break;default:f+=we(t,n,c,d,0,0)}(f||h)&&ve(e,c,f,h),(f=Math.round(c.bounds.x1-r))<0&&(ve(e,n,-f,0),ve(e,c,-f,0))}else(a||u)&&ve(e,n,a,u)}(e,d,d.items[0].items[0]),h=function(e,t){return e.items.forEach(e=>t.union(e.bounds)),t.x1=e.padding,t.y1=e.padding,t}(d,h),r=2*d.padding,a=2*d.padding,h.empty()||(r=Math.ceil(h.width()+r),a=Math.ceil(h.height()+a)),l.type===D&&(u=d.items[0].items[0].items[0].items,c=u.reduce((function(e,t){return e[t.column]=Math.max(t.bounds.x2-t.x,e[t.column]||0),e}),{}),u.forEach((function(e){e.width=c[e.column],e.height=e.bounds.y2-e.y}))),f!==L&&(d.x=y=0,d.y=b=0),d.width=r,d.height=a,n.boundStroke(h.set(y,b,y+r,b+a),d),d.mark.bounds.clear().union(h),d}function we(e,t,r,a,o,i,s){const u="symbol"!==e.datum.type,c=r.datum.vgrad,d=(!u||!i&&c||s?t:t.items[0]).bounds[o?"y2":"x2"]-e.padding,l=c&&i?d:0,h=c&&i?0:d,y=o<=0?0:n.multiLineOffset(r);return Math.round(a===f?l:a===m?h-y:.5*(d-y))}function ve(e,t,n,r){t.x+=n,t.y+=r,t.bounds.translate(n,r),t.mark.bounds.translate(n,r),e.dirty(t)}function ke(e){t.Transform.call(this,null,e)}r.inherits(ke,t.Transform).transform=function(e,t){var r=t.dataflow;return e.mark.items.forEach((function(t){e.layout&&le(r,t,e.layout),function(e,t,r){var u,c,d,l,h,y=t.items,b=Math.max(0,t.width||0),D=Math.max(0,t.height||0),I=(new n.Bounds).set(0,0,b,D),P=I.clone(),C=I.clone(),F=[];for(l=0,h=y.length;l<h;++l)switch((c=y[l]).role){case g:(re(c)?P:C).union(ae(e,c,b,D));break;case p:u=c;break;case k:F.push(pe(e,c));break;case w:case v:case M:case E:case T:case _:case A:case z:P.union(c.bounds),C.union(c.bounds);break;default:I.union(c.bounds)}if(F.length){const t={};F.forEach(e=>{(d=e.orient||i)!==L&&(t[d]||(t[d]=[])).push(e)});for(let n in t){const a=t[n];de(e,a,ge(a,n,r.legends,P,C,b,D))}F.forEach(t=>{const n=t.bounds;if(n.equals(t._bounds)||(t.bounds=t._bounds,e.dirty(t),t.bounds=n,e.dirty(t)),r.autosize&&r.autosize.type===O)switch(t.orient){case o:case i:I.add(n.x1,0).add(n.x2,0);break;case a:case s:I.add(0,n.y1).add(0,n.y2)}else I.union(n)})}I.union(P).union(C),u&&I.union(function(e,t,n,r,u){var c,d=t.items[0],l=d.frame,h=d.orient,y=d.anchor,b=d.offset,g=d.padding,p=d.items[0].items[0],w=d.items[1]&&d.items[1].items[0],v=h===o||h===i?r:n,k=0,M=0,E=0,T=0,_=0;if(l!==x?h===o?(k=u.y2,v=u.y1):h===i?(k=u.y1,v=u.y2):(k=u.x1,v=u.x2):h===o&&(k=r,v=0),c=y===f?k:y===m?v:(k+v)/2,w&&w.text){switch(h){case a:case s:_=p.bounds.height()+g;break;case o:T=p.bounds.width()+g;break;case i:T=-p.bounds.width()-g}te.clear().union(w.bounds),te.translate(T-(w.x||0),_-(w.y||0)),ne(w,"x",T)|ne(w,"y",_)&&(e.dirty(w),w.bounds.clear().union(te),w.mark.bounds.clear().union(te),e.dirty(w)),te.clear().union(w.bounds)}else te.clear();switch(te.union(p.bounds),h){case a:M=c,E=u.y1-te.height()-b;break;case o:M=u.x1-te.width()-b,E=c;break;case i:M=u.x2+te.width()+b,E=c;break;case s:M=c,E=u.y2+b;break;default:M=d.x,E=d.y}return ne(d,"x",M)|ne(d,"y",E)&&(te.translate(M,E),e.dirty(d),d.bounds.clear().union(te),t.bounds.clear().union(te),e.dirty(d)),d.bounds}(e,u,b,D,I));t.clip&&I.set(0,0,t.width||0,t.height||0);!function(e,t,n,r){var a=r.autosize||{},o=a.type,i=e._width,s=e._height,u=e.padding();if(e._autosize<1||!o)return;var c=Math.max(0,t.width||0),d=Math.max(0,Math.ceil(-n.x1)),l=Math.max(0,Math.ceil(n.x2-c)),f=Math.max(0,t.height||0),h=Math.max(0,Math.ceil(-n.y1)),m=Math.max(0,Math.ceil(n.y2-f));a.contains===B&&(i-=u.left+u.right,s-=u.top+u.bottom);o===L?(d=0,h=0,c=i,f=s):o===O?(c=Math.max(0,i-d-l),f=Math.max(0,s-h-m)):o===j?(c=Math.max(0,i-d-l),s=f+h+m):o===q?(i=c+d+l,f=Math.max(0,s-h-m)):o===S&&(i=c+d+l,s=f+h+m);e._resizeView(i,s,c,f,[d,h],a.resize)}(e,t,I,r)}(r,t,e)})),e.modified()&&t.reflow(),t},e.bound=H,e.identifier=V,e.mark=W,e.overlap=J,e.render=ee,e.viewlayout=ke,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vega-dataflow"),require("vega-scenegraph"),require("vega-util")):"function"==typeof define&&define.amd?define(["exports","vega-dataflow","vega-scenegraph","vega-util"],e):e(((t=t||self).vega=t.vega||{},t.vega.transforms={}),t.vega,t.vega,t.vega)}(this,(function(t,e,n,o){"use strict";const r="top",a="left",i="right",s="end",u="row";function c(t){e.Transform.call(this,null,t)}function d(t,e,n){return e(t.bounds.clear(),t,n)}o.inherits(c,e.Transform).transform=function(t,e){var o,r=e.dataflow,a=t.mark,i=a.marktype,s=n.Marks[i],u=s.bound,c=a.bounds;if(s.nested)a.items.length&&r.dirty(a.items[0]),c=d(a,u),a.items.forEach((function(t){t.bounds.clear().union(c)}));else if("group"===i||t.modified())switch(e.visit(e.MOD,(function(t){r.dirty(t)})),c.clear(),a.items.forEach((function(t){c.union(d(t,u))})),a.role){case"axis":case"legend":case"title":e.reflow()}else o=e.changed(e.REM),e.visit(e.ADD,(function(t){c.union(d(t,u))})),e.visit(e.MOD,(function(t){o=o||c.alignsWith(t.bounds),r.dirty(t),c.union(d(t,u))})),o&&(c.clear(),a.items.forEach((function(t){c.union(t.bounds)})));return n.boundClip(a),e.modifies("bounds")};function l(t){e.Transform.call(this,0,t)}function f(t){e.Transform.call(this,null,t)}function h(t){e.Transform.call(this,null,t)}l.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},o.inherits(l,e.Transform).transform=function(t,e){var n=function(t){var e=t._signals[":vega_identifier:"];e||(t._signals[":vega_identifier:"]=e=t.add(0));return e}(e.dataflow),o=n.value,r=t.as;return e.visit(e.ADD,(function(t){t[r]||(t[r]=++o)})),n.set(this.value=o),e},o.inherits(f,e.Transform).transform=function(t,e){var o=this.value;o||((o=e.dataflow.scenegraph().mark(t.markdef,function(t){var e=t.groups,n=t.parent;return e&&1===e.size?e.get(Object.keys(e.object)[0]):e&&n?e.lookup(n):null}(t),t.index)).group.context=t.context,t.context.group||(t.context.group=o.group),o.source=this.source,o.clip=t.clip,o.interactive=t.interactive,this.value=o);var r="group"===o.marktype?n.GroupItem:n.Item;return e.visit(e.ADD,(function(t){r.call(t,o)})),(t.modified("clip")||t.modified("interactive"))&&(o.clip=t.clip,o.interactive=!!t.interactive,o.zdirty=!0,e.reflow()),o.items=e.source,e};var m=o.inherits(h,e.Transform),b={parity:function(t){return t.filter((t,e)=>e%2?t.opacity=0:1)},greedy:function(t,e){var n;return t.filter((t,o)=>o&&y(n.bounds,t.bounds,e)?t.opacity=0:(n=t,1))}};function y(t,e,n){return n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function x(t,e){for(var n,o=1,r=t.length,a=t[0].bounds;o<r;a=n,++o)if(y(a,n=t[o].bounds,e))return!0}function g(t){var e=t.bounds;return e.width()>1&&e.height()>1}function p(t){return t.forEach(t=>t.opacity=1),t}function w(t,e){return t.reflow(e.modified()).modifies("opacity")}function k(t){e.Transform.call(this,null,t)}m.transform=function(t,e){var a,i,s,u=b[t.method]||b.parity,c=e.materialize(e.SOURCE).source,d=t.separation||0;if(c&&c.length){if(!t.method)return t.modified("method")&&(p(c),e=w(e,t)),e;if(t.sort&&(c=c.slice().sort(t.sort)),a=p(c=c.filter(g)),e=w(e,t),a.length>=3&&x(a,d)){do{a=u(a,d)}while(a.length>=3&&x(a,d));a.length<3&&!o.peek(c).opacity&&(a.length>1&&(o.peek(a).opacity=0),o.peek(c).opacity=1)}var l,f,h,m,y;return t.boundScale&&t.boundTolerance>=0&&(l=t.boundScale,f=t.boundOrient,h=+t.boundTolerance,m=l.range(),y=new n.Bounds,f===r||"bottom"===f?y.set(m[0],-1/0,m[1],1/0):y.set(-1/0,m[0],1/0,m[1]),y.expand(h||1),i=t=>y.encloses(t.bounds),c.forEach(t=>{i(t)||(t.opacity=0)})),s=a[0].mark.bounds.clear(),c.forEach(t=>{t.opacity&&s.union(t.bounds)}),e}},o.inherits(k,e.Transform).transform=function(t,e){var n=e.dataflow;if(e.visit(e.ALL,(function(t){n.dirty(t)})),e.fields&&e.fields.zindex){var o=e.source&&e.source[0];o&&(o.mark.zdirty=!0)}};const v=new n.Bounds;function M(t,e,n){return t[e]===n?0:(t[e]=n,1)}function E(t){var e=t.items[0].datum.orient;return e===a||e===i}function T(t,e,o,s){var u,c,d=e.items[0],l=d.datum,f=l.orient,h=null!=l.translate?l.translate:.5,m=function(t){var e=+t.grid;return[t.ticks?e++:-1,t.labels?e++:-1,e+ +t.domain]}(l),b=d.range,y=d.offset,x=d.position,g=d.minExtent,p=d.maxExtent,w=l.title&&d.items[m[2]].items[0],k=d.titlePadding,E=d.bounds,T=w&&n.multiLineOffset(w),A=0,z=0;switch(v.clear().union(E),E.clear(),(u=m[0])>-1&&E.union(d.items[u].bounds),(u=m[1])>-1&&E.union(d.items[u].bounds),f){case r:A=x||0,z=-y,c=Math.max(g,Math.min(p,-E.y1)),E.add(0,-c).add(b,0),w&&_(t,w,c,k,T,0,-1,E);break;case a:A=-y,z=x||0,c=Math.max(g,Math.min(p,-E.x1)),E.add(-c,0).add(0,b),w&&_(t,w,c,k,T,1,-1,E);break;case i:A=o+y,z=x||0,c=Math.max(g,Math.min(p,E.x2)),E.add(0,0).add(c,b),w&&_(t,w,c,k,T,1,1,E);break;case"bottom":A=x||0,z=s+y,c=Math.max(g,Math.min(p,E.y2)),E.add(0,0).add(b,c),w&&_(t,w,c,k,0,0,1,E);break;default:A=d.x,z=d.y}return n.boundStroke(E.translate(A,z),d),M(d,"x",A+h)|M(d,"y",z+h)&&(d.bounds=v,t.dirty(d),d.bounds=E,t.dirty(d)),d.mark.bounds.clear().union(E)}function _(t,e,n,o,r,a,i,s){const u=e.bounds;if(e.auto){const s=i*(n+r+o);let c=0,d=0;t.dirty(e),a?c=(e.x||0)-(e.x=s):d=(e.y||0)-(e.y=s),e.mark.bounds.clear().union(u.translate(-c,-d)),t.dirty(e)}s.union(u)}function A(t){return(new n.Bounds).set(0,0,t.width||0,t.height||0)}function z(t){var e=t.bounds.clone();return e.empty()?e.set(0,0,0,0):e.translate(-(t.x||0),-(t.y||0))}function B(t,e,n){var r=o.isObject(t)?t[e]:t;return null!=r?r:void 0!==n?n:0}function D(t){return t<0?Math.ceil(-t):0}function O(t,e,n){var o,r,a,i,c,d,l,f,h,m,b,y=!n.nodirty,x="flush"===n.bounds?A:z,g=v.set(0,0,0,0),p=B(n.align,"column"),w=B(n.align,u),k=B(n.padding,"column"),M=B(n.padding,u),E=n.columns||e.length,T=E<0?1:Math.ceil(e.length/E),_=e.length,O=Array(_),j=Array(E),q=0,S=Array(_),L=Array(T),I=0,P=Array(_),C=Array(_),F=Array(_);for(r=0;r<E;++r)j[r]=0;for(r=0;r<T;++r)L[r]=0;for(r=0;r<_;++r)d=e[r],c=F[r]=x(d),d.x=d.x||0,P[r]=0,d.y=d.y||0,C[r]=0,a=r%E,i=~~(r/E),q=Math.max(q,l=Math.ceil(c.x2)),I=Math.max(I,f=Math.ceil(c.y2)),j[a]=Math.max(j[a],l),L[i]=Math.max(L[i],f),O[r]=k+D(c.x1),S[r]=M+D(c.y1),y&&t.dirty(e[r]);for(r=0;r<_;++r)r%E==0&&(O[r]=0),r<E&&(S[r]=0);if("each"===p)for(a=1;a<E;++a){for(b=0,r=a;r<_;r+=E)b<O[r]&&(b=O[r]);for(r=a;r<_;r+=E)O[r]=b+j[a-1]}else if("all"===p){for(b=0,r=0;r<_;++r)r%E&&b<O[r]&&(b=O[r]);for(r=0;r<_;++r)r%E&&(O[r]=b+q)}else for(p=!1,a=1;a<E;++a)for(r=a;r<_;r+=E)O[r]+=j[a-1];if("each"===w)for(i=1;i<T;++i){for(b=0,o=(r=i*E)+E;r<o;++r)b<S[r]&&(b=S[r]);for(r=i*E;r<o;++r)S[r]=b+L[i-1]}else if("all"===w){for(b=0,r=E;r<_;++r)b<S[r]&&(b=S[r]);for(r=E;r<_;++r)S[r]=b+I}else for(w=!1,i=1;i<T;++i)for(o=(r=i*E)+E;r<o;++r)S[r]+=L[i-1];for(h=0,r=0;r<_;++r)h=O[r]+(r%E?h:0),P[r]+=h-e[r].x;for(a=0;a<E;++a)for(m=0,r=a;r<_;r+=E)m+=S[r],C[r]+=m-e[r].y;if(p&&B(n.center,"column")&&T>1)for(r=0;r<_;++r)(h=(c="all"===p?q:j[r%E])-F[r].x2-e[r].x-P[r])>0&&(P[r]+=h/2);if(w&&B(n.center,u)&&1!==E)for(r=0;r<_;++r)(m=(c="all"===w?I:L[~~(r/E)])-F[r].y2-e[r].y-C[r])>0&&(C[r]+=m/2);for(r=0;r<_;++r)g.union(F[r].translate(P[r],C[r]));switch(h=B(n.anchor,"x"),m=B(n.anchor,"y"),B(n.anchor,"column")){case s:h-=g.width();break;case"middle":h-=g.width()/2}switch(B(n.anchor,u)){case s:m-=g.height();break;case"middle":m-=g.height()/2}for(h=Math.round(h),m=Math.round(m),g.clear(),r=0;r<_;++r)e[r].mark.bounds.clear();for(r=0;r<_;++r)(d=e[r]).x+=P[r]+=h,d.y+=C[r]+=m,g.union(d.mark.bounds.union(d.bounds.translate(P[r],C[r]))),y&&t.dirty(d);return g}function j(t,e){return"x1"===e?t.x||0:"y1"===e?t.y||0:"x2"===e?(t.x||0)+(t.width||0):"y2"===e?(t.y||0)+(t.height||0):void 0}function q(t,e){return t.bounds[e]}function S(t,e){return Math.floor(Math.min(t,e))}function L(t,e){return Math.ceil(Math.max(t,e))}function I(t,e,n,o,r,a,i,s,u,c,d,l,f,h){var m,b,y,x,g,p,w,k,v,M=n.length,E=0,T=0;if(!M)return E;for(m=d;m<M;m+=l)n[m]&&(E=i(E,u(n[m],c)));if(!e.length)return E;for(e.length>r&&(t.warn("Grid headers exceed limit: "+r),e=e.slice(0,r)),E+=a,b=0,x=e.length;b<x;++b)t.dirty(e[b]),e[b].mark.bounds.clear();for(m=d,b=0,x=e.length;b<x;++b,m+=l){for(g=(p=e[b]).mark.bounds,y=m;y>=0&&null==(w=n[y]);y-=f);s?(k=null==h?w.x:Math.round(w.bounds.x1+h*w.bounds.width()),v=E):(k=E,v=null==h?w.y:Math.round(w.bounds.y1+h*w.bounds.height())),g.union(p.bounds.translate(k-(p.x||0),v-(p.y||0))),p.x=k,p.y=v,t.dirty(p),T=i(T,g[c])}return T}function P(t,e,n,o,r,a){if(e){t.dirty(e);var i=n,s=n;o?i=Math.round(r.x1+a*r.width()):s=Math.round(r.y1+a*r.height()),e.bounds.translate(i-(e.x||0),s-(e.y||0)),e.mark.bounds.clear().union(e.bounds),e.x=i,e.y=s,t.dirty(e)}}function C(t,e,n,o,u,c,d){const l=function(t,e){const n=t[e]||{};return(e,o)=>null!=n[e]?n[e]:null!=t[e]?t[e]:o}(n,e),f=function(t,e){var n=-1/0;return t.forEach(t=>{null!=t.offset&&(n=Math.max(n,t.offset))}),n>-1/0?n:e}(t,l("offset",0)),h=l("anchor","start"),m=h===s?1:"middle"===h?.5:0,b={align:"each",bounds:l("bounds","flush"),columns:"vertical"===l("direction")?1:t.length,padding:l("margin",8),center:l("center"),nodirty:!0};switch(e){case a:b.anchor={x:Math.floor(o.x1)-f,column:s,y:m*(d||o.height()+2*o.y1),row:h};break;case i:b.anchor={x:Math.ceil(o.x2)+f,y:m*(d||o.height()+2*o.y1),row:h};break;case r:b.anchor={y:Math.floor(u.y1)-f,row:s,x:m*(c||u.width()+2*u.x1),column:h};break;case"bottom":b.anchor={y:Math.ceil(u.y2)+f,x:m*(c||u.width()+2*u.x1),column:h};break;case"top-left":b.anchor={x:f,y:f};break;case"top-right":b.anchor={x:c-f,y:f,column:s};break;case"bottom-left":b.anchor={x:f,y:d-f,row:s};break;case"bottom-right":b.anchor={x:c-f,y:d-f,column:s,row:s}}return b}function F(t,e){var o,r,u,c,d=e.items[0],l=d.datum,f=d.orient,h=d.bounds,m=d.x,b=d.y;return d._bounds?d._bounds.clear().union(h):d._bounds=h.clone(),h.clear(),function(t,e,n){var o=e.padding,r=o-n.x,u=o-n.y;if(e.datum.title){var c=e.items[1].items[0],d=c.anchor,l=e.titlePadding||0,f=o-c.x,h=o-c.y;switch(c.orient){case a:r+=Math.ceil(c.bounds.width())+l;break;case i:case"bottom":break;default:u+=c.bounds.height()+l}switch((r||u)&&H(t,n,r,u),c.orient){case a:h+=G(e,n,c,d,1,1);break;case i:f+=G(e,n,c,s,0,0)+l,h+=G(e,n,c,d,1,1);break;case"bottom":f+=G(e,n,c,d,0,0),h+=G(e,n,c,s,-1,0,1)+l;break;default:f+=G(e,n,c,d,0,0)}(f||h)&&H(t,c,f,h),(f=Math.round(c.bounds.x1-o))<0&&(H(t,n,-f,0),H(t,c,-f,0))}else(r||u)&&H(t,n,r,u)}(t,d,d.items[0].items[0]),h=function(t,e){return t.items.forEach(t=>e.union(t.bounds)),e.x1=t.padding,e.y1=t.padding,e}(d,h),o=2*d.padding,r=2*d.padding,h.empty()||(o=Math.ceil(h.width()+o),r=Math.ceil(h.height()+r)),"symbol"===l.type&&(u=d.items[0].items[0].items[0].items,c=u.reduce((function(t,e){return t[e.column]=Math.max(e.bounds.x2-e.x,t[e.column]||0),t}),{}),u.forEach((function(t){t.width=c[t.column],t.height=t.bounds.y2-t.y}))),"none"!==f&&(d.x=m=0,d.y=b=0),d.width=o,d.height=r,n.boundStroke(h.set(m,b,m+o,b+r),d),d.mark.bounds.clear().union(h),d}function G(t,e,o,r,a,i,u){const c="symbol"!==t.datum.type,d=o.datum.vgrad,l=(!c||!i&&d||u?e:e.items[0]).bounds[a?"y2":"x2"]-t.padding,f=d&&i?l:0,h=d&&i?0:l,m=a<=0?0:n.multiLineOffset(o);return Math.round("start"===r?f:r===s?h-m:.5*(l-m))}function H(t,e,n,o){e.x+=n,e.y+=o,e.bounds.translate(n,o),e.mark.bounds.translate(n,o),t.dirty(e)}function R(t){e.Transform.call(this,null,t)}o.inherits(R,e.Transform).transform=function(t,e){var o=e.dataflow;return t.mark.items.forEach((function(e){t.layout&&function(t,e,n){var o,r,a,i,c,d,l,f=function(t){for(var e,n,o=t.items,r=o.length,a=0,i={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};a<r;++a)if(n=(e=o[a]).items,"group"===e.marktype)switch(e.role){case"axis":case"legend":case"title":break;case"row-header":i.rowheaders.push(...n);break;case"row-footer":i.rowfooters.push(...n);break;case"column-header":i.colheaders.push(...n);break;case"column-footer":i.colfooters.push(...n);break;case"row-title":i.rowtitle=n[0];break;case"column-title":i.coltitle=n[0];break;default:i.marks.push(...n)}return i}(e),h=f.marks,m="flush"===n.bounds?j:q,b=n.offset,y=n.columns||h.length,x=y<0?1:Math.ceil(h.length/y),g=x*y;const p=O(t,h,n);f.rowheaders&&(d=B(n.headerBand,u,null),o=I(t,f.rowheaders,h,y,x,-B(b,"rowHeader"),S,0,m,"x1",0,y,1,d)),f.colheaders&&(d=B(n.headerBand,"column",null),r=I(t,f.colheaders,h,y,y,-B(b,"columnHeader"),S,1,m,"y1",0,1,y,d)),f.rowfooters&&(d=B(n.footerBand,u,null),a=I(t,f.rowfooters,h,y,x,B(b,"rowFooter"),L,0,m,"x2",y-1,y,1,d)),f.colfooters&&(d=B(n.footerBand,"column",null),i=I(t,f.colfooters,h,y,y,B(b,"columnFooter"),L,1,m,"y2",g-y,1,y,d)),f.rowtitle&&(c=B(n.titleAnchor,u),l=B(b,"rowTitle"),l=c===s?a+l:o-l,d=B(n.titleBand,u,.5),P(t,f.rowtitle,l,0,p,d)),f.coltitle&&(c=B(n.titleAnchor,"column"),l=B(b,"columnTitle"),l=c===s?i+l:r-l,d=B(n.titleBand,"column",.5),P(t,f.coltitle,l,1,p,d))}(o,e,t.layout),function(t,e,o){var u,c,d,l,f,h=e.items,m=Math.max(0,e.width||0),b=Math.max(0,e.height||0),y=(new n.Bounds).set(0,0,m,b),x=y.clone(),g=y.clone(),p=[];for(l=0,f=h.length;l<f;++l)switch((c=h[l]).role){case"axis":(E(c)?x:g).union(T(t,c,m,b));break;case"title":u=c;break;case"legend":p.push(F(t,c));break;case"frame":case"scope":case"row-header":case"row-footer":case"row-title":case"column-header":case"column-footer":case"column-title":x.union(c.bounds),g.union(c.bounds);break;default:y.union(c.bounds)}if(p.length){const e={};p.forEach(t=>{"none"!==(d=t.orient||i)&&(e[d]||(e[d]=[])).push(t)});for(let n in e){const r=e[n];O(t,r,C(r,n,o.legends,x,g,m,b))}p.forEach(e=>{const n=e.bounds;if(n.equals(e._bounds)||(e.bounds=e._bounds,t.dirty(e),e.bounds=n,t.dirty(e)),o.autosize&&"fit"===o.autosize.type)switch(e.orient){case a:case i:y.add(n.x1,0).add(n.x2,0);break;case r:case"bottom":y.add(0,n.y1).add(0,n.y2)}else y.union(n)})}y.union(x).union(g),u&&y.union(function(t,e,n,o,u){var c,d=e.items[0],l=d.frame,f=d.orient,h=d.anchor,m=d.offset,b=d.padding,y=d.items[0].items[0],x=d.items[1]&&d.items[1].items[0],g=f===a||f===i?o:n,p=0,w=0,k=0,E=0,T=0;if("group"!==l?f===a?(p=u.y2,g=u.y1):f===i?(p=u.y1,g=u.y2):(p=u.x1,g=u.x2):f===a&&(p=o,g=0),c="start"===h?p:h===s?g:(p+g)/2,x&&x.text){switch(f){case r:case"bottom":T=y.bounds.height()+b;break;case a:E=y.bounds.width()+b;break;case i:E=-y.bounds.width()-b}v.clear().union(x.bounds),v.translate(E-(x.x||0),T-(x.y||0)),M(x,"x",E)|M(x,"y",T)&&(t.dirty(x),x.bounds.clear().union(v),x.mark.bounds.clear().union(v),t.dirty(x)),v.clear().union(x.bounds)}else v.clear();switch(v.union(y.bounds),f){case r:w=c,k=u.y1-v.height()-m;break;case a:w=u.x1-v.width()-m,k=c;break;case i:w=u.x2+v.width()+m,k=c;break;case"bottom":w=c,k=u.y2+m;break;default:w=d.x,k=d.y}return M(d,"x",w)|M(d,"y",k)&&(v.translate(w,k),t.dirty(d),d.bounds.clear().union(v),e.bounds.clear().union(v),t.dirty(d)),d.bounds}(t,u,m,b,y));e.clip&&y.set(0,0,e.width||0,e.height||0);!function(t,e,n,o){const r=o.autosize||{},a=r.type;if(t._autosize<1||!a)return;let i=t._width,s=t._height,u=Math.max(0,e.width||0),c=Math.max(0,Math.ceil(-n.x1)),d=Math.max(0,Math.ceil(n.x2-u)),l=Math.max(0,e.height||0),f=Math.max(0,Math.ceil(-n.y1)),h=Math.max(0,Math.ceil(n.y2-l));if("padding"===r.contains){const e=t.padding();i-=e.left+e.right,s-=e.top+e.bottom}"none"===a?(c=0,f=0,u=i,l=s):"fit"===a?(u=Math.max(0,i-c-d),l=Math.max(0,s-f-h)):"fit-x"===a?(u=Math.max(0,i-c-d),s=l+f+h):"fit-y"===a?(i=u+c+d,l=Math.max(0,s-f-h)):"pad"===a&&(i=u+c+d,s=l+f+h);t._resizeView(i,s,u,l,[c,f],r.resize)}(t,e,y,o)}(o,e,t)})),t.modified()&&e.reflow(),e},t.bound=c,t.identifier=l,t.mark=f,t.overlap=h,t.render=k,t.viewlayout=R,Object.defineProperty(t,"__esModule",{value:!0})}));
{
"name": "vega-view-transforms",
"version": "4.5.0",
"version": "4.5.1",
"description": "View-specific transforms for Vega dataflows.",

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

"vega-scenegraph": "^4.4.0",
"vega-util": "^1.12.0"
"vega-util": "^1.13.1"
},

@@ -34,3 +34,3 @@ "devDependencies": {

},
"gitHead": "8180e8ca9379dec7f1722ce0ebd2aa01083be7b2"
"gitHead": "2bee653f2a56c2c0d4393d69d172b9ccdb0fe2f9"
}

@@ -47,4 +47,4 @@ import {Top, Bottom, Left, Right} from '../constants';

s = Math.max(minExtent, Math.min(maxExtent, -bounds.y1));
if (title) s = axisTitleLayout(view, title, s, titlePadding, dl, 0, -1, bounds);
bounds.add(0, -s).add(range, 0);
if (title) axisTitleLayout(view, title, s, titlePadding, dl, 0, -1, bounds);
break;

@@ -55,4 +55,4 @@ case Left:

s = Math.max(minExtent, Math.min(maxExtent, -bounds.x1));
if (title) s = axisTitleLayout(view, title, s, titlePadding, dl, 1, -1, bounds);
bounds.add(-s, 0).add(0, range);
if (title) axisTitleLayout(view, title, s, titlePadding, dl, 1, -1, bounds);
break;

@@ -63,4 +63,4 @@ case Right:

s = Math.max(minExtent, Math.min(maxExtent, bounds.x2));
if (title) s = axisTitleLayout(view, title, s, titlePadding, dl, 1, 1, bounds);
bounds.add(0, 0).add(s, range);
if (title) axisTitleLayout(view, title, s, titlePadding, dl, 1, 1, bounds);
break;

@@ -71,4 +71,4 @@ case Bottom:

s = Math.max(minExtent, Math.min(maxExtent, bounds.y2));
if (title) s = axisTitleLayout(view, title, s, titlePadding, 0, 0, 1, bounds);
bounds.add(0, 0).add(range, s);
if (title) axisTitleLayout(view, title, s, titlePadding, 0, 0, 1, bounds);
break;

@@ -94,28 +94,17 @@ default:

function axisTitleLayout(view, title, offset, pad, dl, isYAxis, sign, bounds) {
var b = title.bounds, dx = 0, dy = 0;
const b = title.bounds;
if (title.auto) {
const v = sign * (offset + dl + pad);
let dx = 0, dy = 0;
view.dirty(title);
offset += pad;
isYAxis
? dx = (title.x || 0) - (title.x = sign * (offset + dl))
: dy = (title.y || 0) - (title.y = sign * (offset + dl));
? dx = (title.x || 0) - (title.x = v)
: dy = (title.y || 0) - (title.y = v);
title.mark.bounds.clear().union(b.translate(-dx, -dy));
view.dirty(title);
if (isYAxis) {
bounds.add(0, b.y1).add(0, b.y2);
offset += b.width();
} else {
bounds.add(b.x1, 0).add(b.x2, 0);
offset += b.height();
}
} else {
bounds.union(b);
}
return offset;
bounds.union(b);
}

@@ -146,11 +146,10 @@ import {

function viewSizeLayout(view, group, viewBounds, _) {
var auto = _.autosize || {},
type = auto.type,
viewWidth = view._width,
viewHeight = view._height,
padding = view.padding();
const auto = _.autosize || {},
type = auto.type;
if (view._autosize < 1 || !type) return;
var width = Math.max(0, group.width || 0),
let viewWidth = view._width,
viewHeight = view._height,
width = Math.max(0, group.width || 0),
left = Math.max(0, Math.ceil(-viewBounds.x1)),

@@ -163,2 +162,3 @@ right = Math.max(0, Math.ceil(viewBounds.x2 - width)),

if (auto.contains === Padding) {
const padding = view.padding();
viewWidth -= padding.left + padding.right;

@@ -165,0 +165,0 @@ viewHeight -= padding.top + padding.bottom;

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc