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.5 to 4.5.6

368

build/vega-view-transforms.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vega-dataflow'), require('vega-scenegraph'), require('vega-util')) :
typeof define === 'function' && define.amd ? define(['exports', 'vega-dataflow', 'vega-scenegraph', 'vega-util'], factory) :
(global = global || self, factory((global.vega = global.vega || {}, global.vega.transforms = {}), global.vega, global.vega, global.vega));
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.vega = global.vega || {}, global.vega.transforms = {}), global.vega, global.vega, global.vega));
}(this, (function (exports, vegaDataflow, vegaScenegraph, vegaUtil) { 'use strict';

@@ -66,62 +66,63 @@

var prototype = vegaUtil.inherits(Bound, vegaDataflow.Transform);
vegaUtil.inherits(Bound, vegaDataflow.Transform, {
transform(_, pulse) {
const view = pulse.dataflow,
mark = _.mark,
type = mark.marktype,
entry = vegaScenegraph.Marks[type],
bound = entry.bound;
prototype.transform = function(_, pulse) {
var view = pulse.dataflow,
mark = _.mark,
type = mark.marktype,
entry = vegaScenegraph.Marks[type],
bound = entry.bound,
markBounds = mark.bounds, rebound;
let markBounds = mark.bounds, rebound;
if (entry.nested) {
// multi-item marks have a single bounds instance
if (mark.items.length) view.dirty(mark.items[0]);
markBounds = boundItem(mark, bound);
mark.items.forEach(function(item) {
item.bounds.clear().union(markBounds);
});
}
if (entry.nested) {
// multi-item marks have a single bounds instance
if (mark.items.length) view.dirty(mark.items[0]);
markBounds = boundItem(mark, bound);
mark.items.forEach(function(item) {
item.bounds.clear().union(markBounds);
});
}
else if (type === Group || _.modified()) {
// operator parameters modified -> re-bound all items
// updates group bounds in response to modified group content
pulse.visit(pulse.MOD, item => view.dirty(item));
markBounds.clear();
mark.items.forEach(item => markBounds.union(boundItem(item, bound)));
else if (type === Group || _.modified()) {
// operator parameters modified -> re-bound all items
// updates group bounds in response to modified group content
pulse.visit(pulse.MOD, item => view.dirty(item));
markBounds.clear();
mark.items.forEach(item => markBounds.union(boundItem(item, bound)));
// force reflow for axes/legends/titles to propagate any layout changes
switch (mark.role) {
case AxisRole:
case LegendRole:
case TitleRole:
pulse.reflow();
// force reflow for axes/legends/titles to propagate any layout changes
switch (mark.role) {
case AxisRole:
case LegendRole:
case TitleRole:
pulse.reflow();
}
}
}
else {
// incrementally update bounds, re-bound mark as needed
rebound = pulse.changed(pulse.REM);
else {
// incrementally update bounds, re-bound mark as needed
rebound = pulse.changed(pulse.REM);
pulse.visit(pulse.ADD, item => {
markBounds.union(boundItem(item, bound));
});
pulse.visit(pulse.ADD, item => {
markBounds.union(boundItem(item, bound));
});
pulse.visit(pulse.MOD, item => {
rebound = rebound || markBounds.alignsWith(item.bounds);
view.dirty(item);
markBounds.union(boundItem(item, bound));
});
pulse.visit(pulse.MOD, item => {
rebound = rebound || markBounds.alignsWith(item.bounds);
view.dirty(item);
markBounds.union(boundItem(item, bound));
});
if (rebound) {
markBounds.clear();
mark.items.forEach(item => markBounds.union(item.bounds));
if (rebound) {
markBounds.clear();
mark.items.forEach(item => markBounds.union(item.bounds));
}
}
}
// ensure mark bounds do not exceed any clipping region
vegaScenegraph.boundClip(mark);
// ensure mark bounds do not exceed any clipping region
vegaScenegraph.boundClip(mark);
return pulse.modifies('bounds');
};
return pulse.modifies('bounds');
}
});

@@ -132,3 +133,3 @@ function boundItem(item, bound, opt) {

var COUNTER_NAME = ':vega_identifier:';
const COUNTER_NAME = ':vega_identifier:';

@@ -158,23 +159,17 @@ /**

var prototype$1 = vegaUtil.inherits(Identifier, vegaDataflow.Transform);
vegaUtil.inherits(Identifier, vegaDataflow.Transform, {
transform(_, pulse) {
const counter = getCounter(pulse.dataflow),
as = _.as;
let id = counter.value;
prototype$1.transform = function(_, pulse) {
var counter = getCounter(pulse.dataflow),
id = counter.value,
as = _.as;
pulse.visit(pulse.ADD, t => (t[as] = t[as] || ++id));
counter.set(this.value = id);
return pulse;
}
});
pulse.visit(pulse.ADD, t => {
if (!t[as]) t[as] = ++id;
});
counter.set(this.value = id);
return pulse;
};
function getCounter(view) {
var counter = view._signals[COUNTER_NAME];
if (!counter) {
view._signals[COUNTER_NAME] = (counter = view.add(0));
}
return counter;
return view._signals[COUNTER_NAME]
|| (view._signals[COUNTER_NAME] = view.add(0));
}

@@ -194,37 +189,37 @@

var prototype$2 = vegaUtil.inherits(Mark, vegaDataflow.Transform);
vegaUtil.inherits(Mark, vegaDataflow.Transform, {
transform(_, pulse) {
let mark = this.value;
prototype$2.transform = function(_, pulse) {
var mark = this.value;
// acquire mark on first invocation, bind context and group
if (!mark) {
mark = pulse.dataflow.scenegraph().mark(_.markdef, lookup(_), _.index);
mark.group.context = _.context;
if (!_.context.group) _.context.group = mark.group;
mark.source = this.source; // point to upstream collector
mark.clip = _.clip;
mark.interactive = _.interactive;
this.value = mark;
}
// acquire mark on first invocation, bind context and group
if (!mark) {
mark = pulse.dataflow.scenegraph().mark(_.markdef, lookup(_), _.index);
mark.group.context = _.context;
if (!_.context.group) _.context.group = mark.group;
mark.source = this.source; // point to upstream collector
mark.clip = _.clip;
mark.interactive = _.interactive;
this.value = mark;
}
// initialize entering items
const Init = mark.marktype === Group ? vegaScenegraph.GroupItem : vegaScenegraph.Item;
pulse.visit(pulse.ADD, item => Init.call(item, mark));
// initialize entering items
var Init = mark.marktype === Group ? vegaScenegraph.GroupItem : vegaScenegraph.Item;
pulse.visit(pulse.ADD, item => Init.call(item, mark));
// update clipping and/or interactive status
if (_.modified('clip') || _.modified('interactive')) {
mark.clip = _.clip;
mark.interactive = !!_.interactive;
mark.zdirty = true; // force scenegraph re-eval
pulse.reflow();
}
// update clipping and/or interactive status
if (_.modified('clip') || _.modified('interactive')) {
mark.clip = _.clip;
mark.interactive = !!_.interactive;
mark.zdirty = true; // force scenegraph re-eval
pulse.reflow();
// bind items array to scenegraph mark
mark.items = pulse.source;
return pulse;
}
});
// bind items array to scenegraph mark
mark.items = pulse.source;
return pulse;
};
function lookup(_) {
var g = _.groups, p = _.parent;
const g = _.groups, p = _.parent;
return g && g.size === 1 ? g.get(Object.keys(g.object)[0])

@@ -262,18 +257,12 @@ : g && p ? g.lookup(p)

var prototype$3 = vegaUtil.inherits(Overlap, vegaDataflow.Transform);
var methods = {
parity: items => {
return items.filter((item, i) => i % 2 ? (item.opacity = 0) : 1);
},
const methods = {
parity: items =>
items.filter((item, i) => i % 2 ? (item.opacity = 0) : 1),
greedy: (items, sep) => {
var a;
return items.filter((b, i) => {
if (!i || !intersect(a.bounds, b.bounds, sep)) {
a = b;
return 1;
} else {
return b.opacity = 0;
}
});
let a;
return items.filter((b, i) =>
(!i || !intersect(a.bounds, b.bounds, sep))
? (a = b, 1)
: (b.opacity = 0)
);
}

@@ -284,23 +273,17 @@ };

// including padding pixels of separation
function intersect(a, b, sep) {
return sep > Math.max(
b.x1 - a.x2,
a.x1 - b.x2,
b.y1 - a.y2,
a.y1 - b.y2
);
}
const intersect = (a, b, sep) =>
sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2);
function hasOverlap(items, pad) {
const hasOverlap = (items, pad) => {
for (var i=1, n=items.length, a=items[0].bounds, b; i<n; a=b, ++i) {
if (intersect(a, b = items[i].bounds, pad)) return true;
}
}
};
function hasBounds(item) {
const hasBounds = item => {
var b = item.bounds;
return b.width() > 1 && b.height() > 1;
}
};
function boundTest(scale, orient, tolerance) {
const boundTest = (scale, orient, tolerance) => {
var range = scale.range(),

@@ -317,73 +300,74 @@ b = new vegaScenegraph.Bounds();

return item => b.encloses(item.bounds);
}
};
// reset all items to be fully opaque
function reset(source) {
const reset = source => {
source.forEach(item => item.opacity = 1);
return source;
}
};
// add all tuples to mod, fork pulse if parameters were modified
// fork prevents cross-stream tuple pollution (e.g., pulse from scale)
function reflow(pulse, _) {
return pulse.reflow(_.modified()).modifies('opacity');
}
const reflow = (pulse, _) =>
pulse.reflow(_.modified()).modifies('opacity');
prototype$3.transform = function(_, pulse) {
var reduce = methods[_.method] || methods.parity,
source = pulse.materialize(pulse.SOURCE).source,
sep = _.separation || 0,
items, test, bounds;
vegaUtil.inherits(Overlap, vegaDataflow.Transform, {
transform(_, pulse) {
let reduce = methods[_.method] || methods.parity,
source = pulse.materialize(pulse.SOURCE).source,
sep = _.separation || 0,
items, test, bounds;
if (!source || !source.length) return;
if (!source || !source.length) return;
if (!_.method) {
// early exit if method is falsy
if (_.modified('method')) {
reset(source);
pulse = reflow(pulse, _);
if (!_.method) {
// early exit if method is falsy
if (_.modified('method')) {
reset(source);
pulse = reflow(pulse, _);
}
return pulse;
}
return pulse;
}
// skip labels with no content
source = source.filter(hasBounds);
// skip labels with no content
source = source.filter(hasBounds);
// early exit, nothing to do
if (!source.length) return;
// early exit, nothing to do
if (!source.length) return;
if (_.sort) {
source = source.slice().sort(_.sort);
}
if (_.sort) {
source = source.slice().sort(_.sort);
}
items = reset(source);
pulse = reflow(pulse, _);
items = reset(source);
pulse = reflow(pulse, _);
if (items.length >= 3 && hasOverlap(items, sep)) {
do {
items = reduce(items, sep);
} while (items.length >= 3 && hasOverlap(items, sep));
if (items.length >= 3 && hasOverlap(items, sep)) {
do {
items = reduce(items, sep);
} while (items.length >= 3 && hasOverlap(items, sep));
if (items.length < 3 && !vegaUtil.peek(source).opacity) {
if (items.length > 1) vegaUtil.peek(items).opacity = 0;
vegaUtil.peek(source).opacity = 1;
if (items.length < 3 && !vegaUtil.peek(source).opacity) {
if (items.length > 1) vegaUtil.peek(items).opacity = 0;
vegaUtil.peek(source).opacity = 1;
}
}
}
if (_.boundScale && _.boundTolerance >= 0) {
test = boundTest(_.boundScale, _.boundOrient, +_.boundTolerance);
if (_.boundScale && _.boundTolerance >= 0) {
test = boundTest(_.boundScale, _.boundOrient, +_.boundTolerance);
source.forEach(item => {
if (!test(item)) item.opacity = 0;
});
}
// re-calculate mark bounds
bounds = items[0].mark.bounds.clear();
source.forEach(item => {
if (!test(item)) item.opacity = 0;
if (item.opacity) bounds.union(item.bounds);
});
return pulse;
}
});
// re-calculate mark bounds
bounds = items[0].mark.bounds.clear();
source.forEach(item => {
if (item.opacity) bounds.union(item.bounds);
});
return pulse;
};
/**

@@ -397,15 +381,15 @@ * Queue modified scenegraph items for rendering.

var prototype$4 = vegaUtil.inherits(Render, vegaDataflow.Transform);
vegaUtil.inherits(Render, vegaDataflow.Transform, {
transform(_, pulse) {
const view = pulse.dataflow;
prototype$4.transform = function(_, pulse) {
var view = pulse.dataflow;
pulse.visit(pulse.ALL, item => view.dirty(item));
pulse.visit(pulse.ALL, item => view.dirty(item));
// set z-index dirty flag as needed
if (pulse.fields && pulse.fields['zindex']) {
var item = pulse.source && pulse.source[0];
if (item) item.mark.zdirty = true;
// set z-index dirty flag as needed
if (pulse.fields && pulse.fields['zindex']) {
var item = pulse.source && pulse.source[0];
if (item) item.mark.zdirty = true;
}
}
};
});

@@ -1204,13 +1188,13 @@ const tempBounds = new vegaScenegraph.Bounds();

var prototype$5 = vegaUtil.inherits(ViewLayout, vegaDataflow.Transform);
vegaUtil.inherits(ViewLayout, vegaDataflow.Transform, {
transform(_, pulse) {
const view = pulse.dataflow;
_.mark.items.forEach(group => {
if (_.layout) trellisLayout(view, group, _.layout);
layoutGroup(view, group, _);
});
return shouldReflow(_.mark.group) ? pulse.reflow() : pulse;
}
});
prototype$5.transform = function(_, pulse) {
var view = pulse.dataflow;
_.mark.items.forEach(group => {
if (_.layout) trellisLayout(view, group, _.layout);
layoutGroup(view, group, _);
});
return shouldReflow(_.mark.group) ? pulse.reflow() : pulse;
};
function shouldReflow(group) {

@@ -1217,0 +1201,0 @@ // We typically should reflow if layout is invoked (#2568), as child items

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

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

"dependencies": {
"vega-dataflow": "^5.6.0",
"vega-scenegraph": "^4.8.0",
"vega-util": "^1.14.0"
"vega-dataflow": "^5.7.1",
"vega-scenegraph": "^4.9.0",
"vega-util": "^1.15.0"
},

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

},
"gitHead": "48c85218f2202242171aa569f2dca0f53cf2b51f"
"gitHead": "28db83352e43e321dfe55fc5cb6489b211e45662"
}

@@ -16,62 +16,63 @@ import {AxisRole, Group, LegendRole, TitleRole} from './constants';

var prototype = inherits(Bound, Transform);
inherits(Bound, Transform, {
transform(_, pulse) {
const view = pulse.dataflow,
mark = _.mark,
type = mark.marktype,
entry = Marks[type],
bound = entry.bound;
prototype.transform = function(_, pulse) {
var view = pulse.dataflow,
mark = _.mark,
type = mark.marktype,
entry = Marks[type],
bound = entry.bound,
markBounds = mark.bounds, rebound;
let markBounds = mark.bounds, rebound;
if (entry.nested) {
// multi-item marks have a single bounds instance
if (mark.items.length) view.dirty(mark.items[0]);
markBounds = boundItem(mark, bound);
mark.items.forEach(function(item) {
item.bounds.clear().union(markBounds);
});
}
if (entry.nested) {
// multi-item marks have a single bounds instance
if (mark.items.length) view.dirty(mark.items[0]);
markBounds = boundItem(mark, bound);
mark.items.forEach(function(item) {
item.bounds.clear().union(markBounds);
});
}
else if (type === Group || _.modified()) {
// operator parameters modified -> re-bound all items
// updates group bounds in response to modified group content
pulse.visit(pulse.MOD, item => view.dirty(item));
markBounds.clear();
mark.items.forEach(item => markBounds.union(boundItem(item, bound)));
else if (type === Group || _.modified()) {
// operator parameters modified -> re-bound all items
// updates group bounds in response to modified group content
pulse.visit(pulse.MOD, item => view.dirty(item));
markBounds.clear();
mark.items.forEach(item => markBounds.union(boundItem(item, bound)));
// force reflow for axes/legends/titles to propagate any layout changes
switch (mark.role) {
case AxisRole:
case LegendRole:
case TitleRole:
pulse.reflow();
// force reflow for axes/legends/titles to propagate any layout changes
switch (mark.role) {
case AxisRole:
case LegendRole:
case TitleRole:
pulse.reflow();
}
}
}
else {
// incrementally update bounds, re-bound mark as needed
rebound = pulse.changed(pulse.REM);
else {
// incrementally update bounds, re-bound mark as needed
rebound = pulse.changed(pulse.REM);
pulse.visit(pulse.ADD, item => {
markBounds.union(boundItem(item, bound));
});
pulse.visit(pulse.ADD, item => {
markBounds.union(boundItem(item, bound));
});
pulse.visit(pulse.MOD, item => {
rebound = rebound || markBounds.alignsWith(item.bounds);
view.dirty(item);
markBounds.union(boundItem(item, bound));
});
pulse.visit(pulse.MOD, item => {
rebound = rebound || markBounds.alignsWith(item.bounds);
view.dirty(item);
markBounds.union(boundItem(item, bound));
});
if (rebound) {
markBounds.clear();
mark.items.forEach(item => markBounds.union(item.bounds));
if (rebound) {
markBounds.clear();
mark.items.forEach(item => markBounds.union(item.bounds));
}
}
}
// ensure mark bounds do not exceed any clipping region
boundClip(mark);
// ensure mark bounds do not exceed any clipping region
boundClip(mark);
return pulse.modifies('bounds');
};
return pulse.modifies('bounds');
}
});

@@ -78,0 +79,0 @@ function boundItem(item, bound, opt) {

import {Transform} from 'vega-dataflow';
import {inherits} from 'vega-util';
var COUNTER_NAME = ':vega_identifier:';
const COUNTER_NAME = ':vega_identifier:';

@@ -29,23 +29,17 @@ /**

var prototype = inherits(Identifier, Transform);
inherits(Identifier, Transform, {
transform(_, pulse) {
const counter = getCounter(pulse.dataflow),
as = _.as;
let id = counter.value;
prototype.transform = function(_, pulse) {
var counter = getCounter(pulse.dataflow),
id = counter.value,
as = _.as;
pulse.visit(pulse.ADD, t => (t[as] = t[as] || ++id));
counter.set(this.value = id);
return pulse;
}
});
pulse.visit(pulse.ADD, t => {
if (!t[as]) t[as] = ++id;
});
counter.set(this.value = id);
return pulse;
};
function getCounter(view) {
var counter = view._signals[COUNTER_NAME];
if (!counter) {
view._signals[COUNTER_NAME] = (counter = view.add(0));
}
return counter;
return view._signals[COUNTER_NAME]
|| (view._signals[COUNTER_NAME] = view.add(0));
}

@@ -18,37 +18,37 @@ import {Group} from './constants';

var prototype = inherits(Mark, Transform);
inherits(Mark, Transform, {
transform(_, pulse) {
let mark = this.value;
prototype.transform = function(_, pulse) {
var mark = this.value;
// acquire mark on first invocation, bind context and group
if (!mark) {
mark = pulse.dataflow.scenegraph().mark(_.markdef, lookup(_), _.index);
mark.group.context = _.context;
if (!_.context.group) _.context.group = mark.group;
mark.source = this.source; // point to upstream collector
mark.clip = _.clip;
mark.interactive = _.interactive;
this.value = mark;
}
// acquire mark on first invocation, bind context and group
if (!mark) {
mark = pulse.dataflow.scenegraph().mark(_.markdef, lookup(_), _.index);
mark.group.context = _.context;
if (!_.context.group) _.context.group = mark.group;
mark.source = this.source; // point to upstream collector
mark.clip = _.clip;
mark.interactive = _.interactive;
this.value = mark;
}
// initialize entering items
const Init = mark.marktype === Group ? GroupItem : Item;
pulse.visit(pulse.ADD, item => Init.call(item, mark));
// initialize entering items
var Init = mark.marktype === Group ? GroupItem : Item;
pulse.visit(pulse.ADD, item => Init.call(item, mark));
// update clipping and/or interactive status
if (_.modified('clip') || _.modified('interactive')) {
mark.clip = _.clip;
mark.interactive = !!_.interactive;
mark.zdirty = true; // force scenegraph re-eval
pulse.reflow();
}
// update clipping and/or interactive status
if (_.modified('clip') || _.modified('interactive')) {
mark.clip = _.clip;
mark.interactive = !!_.interactive;
mark.zdirty = true; // force scenegraph re-eval
pulse.reflow();
// bind items array to scenegraph mark
mark.items = pulse.source;
return pulse;
}
});
// bind items array to scenegraph mark
mark.items = pulse.source;
return pulse;
};
function lookup(_) {
var g = _.groups, p = _.parent;
const g = _.groups, p = _.parent;
return g && g.size === 1 ? g.get(Object.keys(g.object)[0])

@@ -55,0 +55,0 @@ : g && p ? g.lookup(p)

@@ -33,18 +33,12 @@ import {Bottom, Top} from './constants';

var prototype = inherits(Overlap, Transform);
var methods = {
parity: items => {
return items.filter((item, i) => i % 2 ? (item.opacity = 0) : 1);
},
const methods = {
parity: items =>
items.filter((item, i) => i % 2 ? (item.opacity = 0) : 1),
greedy: (items, sep) => {
var a;
return items.filter((b, i) => {
if (!i || !intersect(a.bounds, b.bounds, sep)) {
a = b;
return 1;
} else {
return b.opacity = 0;
}
});
let a;
return items.filter((b, i) =>
(!i || !intersect(a.bounds, b.bounds, sep))
? (a = b, 1)
: (b.opacity = 0)
);
}

@@ -55,23 +49,17 @@ };

// including padding pixels of separation
function intersect(a, b, sep) {
return sep > Math.max(
b.x1 - a.x2,
a.x1 - b.x2,
b.y1 - a.y2,
a.y1 - b.y2
);
}
const intersect = (a, b, sep) =>
sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2);
function hasOverlap(items, pad) {
const hasOverlap = (items, pad) => {
for (var i=1, n=items.length, a=items[0].bounds, b; i<n; a=b, ++i) {
if (intersect(a, b = items[i].bounds, pad)) return true;
}
}
};
function hasBounds(item) {
const hasBounds = item => {
var b = item.bounds;
return b.width() > 1 && b.height() > 1;
}
};
function boundTest(scale, orient, tolerance) {
const boundTest = (scale, orient, tolerance) => {
var range = scale.range(),

@@ -88,71 +76,72 @@ b = new Bounds();

return item => b.encloses(item.bounds);
}
};
// reset all items to be fully opaque
function reset(source) {
const reset = source => {
source.forEach(item => item.opacity = 1);
return source;
}
};
// add all tuples to mod, fork pulse if parameters were modified
// fork prevents cross-stream tuple pollution (e.g., pulse from scale)
function reflow(pulse, _) {
return pulse.reflow(_.modified()).modifies('opacity');
}
const reflow = (pulse, _) =>
pulse.reflow(_.modified()).modifies('opacity');
prototype.transform = function(_, pulse) {
var reduce = methods[_.method] || methods.parity,
source = pulse.materialize(pulse.SOURCE).source,
sep = _.separation || 0,
items, test, bounds;
inherits(Overlap, Transform, {
transform(_, pulse) {
let reduce = methods[_.method] || methods.parity,
source = pulse.materialize(pulse.SOURCE).source,
sep = _.separation || 0,
items, test, bounds;
if (!source || !source.length) return;
if (!source || !source.length) return;
if (!_.method) {
// early exit if method is falsy
if (_.modified('method')) {
reset(source);
pulse = reflow(pulse, _);
if (!_.method) {
// early exit if method is falsy
if (_.modified('method')) {
reset(source);
pulse = reflow(pulse, _);
}
return pulse;
}
return pulse;
}
// skip labels with no content
source = source.filter(hasBounds);
// skip labels with no content
source = source.filter(hasBounds);
// early exit, nothing to do
if (!source.length) return;
// early exit, nothing to do
if (!source.length) return;
if (_.sort) {
source = source.slice().sort(_.sort);
}
if (_.sort) {
source = source.slice().sort(_.sort);
}
items = reset(source);
pulse = reflow(pulse, _);
items = reset(source);
pulse = reflow(pulse, _);
if (items.length >= 3 && hasOverlap(items, sep)) {
do {
items = reduce(items, sep);
} while (items.length >= 3 && hasOverlap(items, sep));
if (items.length >= 3 && hasOverlap(items, sep)) {
do {
items = reduce(items, sep);
} while (items.length >= 3 && hasOverlap(items, sep));
if (items.length < 3 && !peek(source).opacity) {
if (items.length > 1) peek(items).opacity = 0;
peek(source).opacity = 1;
if (items.length < 3 && !peek(source).opacity) {
if (items.length > 1) peek(items).opacity = 0;
peek(source).opacity = 1;
}
}
}
if (_.boundScale && _.boundTolerance >= 0) {
test = boundTest(_.boundScale, _.boundOrient, +_.boundTolerance);
if (_.boundScale && _.boundTolerance >= 0) {
test = boundTest(_.boundScale, _.boundOrient, +_.boundTolerance);
source.forEach(item => {
if (!test(item)) item.opacity = 0;
});
}
// re-calculate mark bounds
bounds = items[0].mark.bounds.clear();
source.forEach(item => {
if (!test(item)) item.opacity = 0;
if (item.opacity) bounds.union(item.bounds);
});
return pulse;
}
// re-calculate mark bounds
bounds = items[0].mark.bounds.clear();
source.forEach(item => {
if (item.opacity) bounds.union(item.bounds);
});
return pulse;
};
});

@@ -12,14 +12,14 @@ import {Transform} from 'vega-dataflow';

var prototype = inherits(Render, Transform);
inherits(Render, Transform, {
transform(_, pulse) {
const view = pulse.dataflow;
prototype.transform = function(_, pulse) {
var view = pulse.dataflow;
pulse.visit(pulse.ALL, item => view.dirty(item));
pulse.visit(pulse.ALL, item => view.dirty(item));
// set z-index dirty flag as needed
if (pulse.fields && pulse.fields['zindex']) {
var item = pulse.source && pulse.source[0];
if (item) item.mark.zdirty = true;
// set z-index dirty flag as needed
if (pulse.fields && pulse.fields['zindex']) {
var item = pulse.source && pulse.source[0];
if (item) item.mark.zdirty = true;
}
}
};
});

@@ -28,13 +28,13 @@ import {

var prototype = inherits(ViewLayout, Transform);
inherits(ViewLayout, Transform, {
transform(_, pulse) {
const view = pulse.dataflow;
_.mark.items.forEach(group => {
if (_.layout) trellisLayout(view, group, _.layout);
layoutGroup(view, group, _);
});
return shouldReflow(_.mark.group) ? pulse.reflow() : pulse;
}
});
prototype.transform = function(_, pulse) {
var view = pulse.dataflow;
_.mark.items.forEach(group => {
if (_.layout) trellisLayout(view, group, _.layout);
layoutGroup(view, group, _);
});
return shouldReflow(_.mark.group) ? pulse.reflow() : pulse;
};
function shouldReflow(group) {

@@ -41,0 +41,0 @@ // We typically should reflow if layout is invoked (#2568), as child items

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