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

vega-hierarchy

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vega-hierarchy - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

14

build/vega-hierarchy.js

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

{ "name": "size", "type": "number", "array": true, "length": 2 },
{ "name": "as", "type": "string", "array": true, "length": 3, "default": Output }
{ "name": "as", "type": "string", "array": true, "length": Output.length, "default": Output }
]

@@ -178,3 +178,3 @@ };

var Output$1 = ["x0", "y0", "x1", "y1", "depth", "children"];
var Output$1 = ['x0', 'y0', 'x1', 'y1', 'depth', 'children'];

@@ -200,3 +200,3 @@ /**

{ "name": "size", "type": "number", "array": true, "length": 2 },
{ "name": "as", "type": "string", "array": true, "length": 4, "default": Output$1 }
{ "name": "as", "type": "string", "array": true, "length": Output$1.length, "default": Output$1 }
]

@@ -268,3 +268,3 @@ };

var Output$2 = ["x", "y", "depth", "children"];
var Output$2 = ['x', 'y', 'depth', 'children'];

@@ -290,3 +290,3 @@ /**

{ "name": "nodeSize", "type": "number", "array": true, "length": 2 },
{ "name": "as", "type": "string", "array": true, "length": 4, "default": Output$2 }
{ "name": "as", "type": "string", "array": true, "length": Output$2.length, "default": Output$2 }
]

@@ -379,3 +379,3 @@ };

var Output$3 = ["x0", "y0", "x1", "y1", "depth", "children"];
var Output$3 = ['x0', 'y0', 'x1', 'y1', 'depth', 'children'];

@@ -410,3 +410,3 @@ /**

{ "name": "size", "type": "number", "array": true, "length": 2 },
{ "name": "as", "type": "string", "array": true, "length": 4, "default": Output$3 }
{ "name": "as", "type": "string", "array": true, "length": Output$3.length, "default": Output$3 }
]

@@ -413,0 +413,0 @@ };

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vega-dataflow"),require("vega-util"),require("d3-collection"),require("d3-hierarchy")):"function"==typeof define&&define.amd?define(["exports","vega-dataflow","vega-util","d3-collection","d3-hierarchy"],t):t((e.vega=e.vega||{},e.vega.transforms={}),e.vega,e.vega,e.d3,e.d3)}(this,function(e,o,d,s,u){"use strict";function l(e,a,r){var n={};return e.each(function(e){var t=e.data;r(t)&&(n[a(t)]=e)}),e.lookup=n,e}function t(e){o.Transform.call(this,null,e)}function f(e){return e.values}function a(e){o.Transform.call(this,null,e)}t.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]},d.inherits(t,o.Transform).transform=function(e,t){t.source||d.error("Nest transform requires an upstream data source.");var a=e.generate,r=e.modified(),n=t.clone(),i=this.value;return(!i||r||t.changed())&&(i&&i.each(function(e){e.children&&o.isTuple(e.data)&&n.rem.push(e.data)}),this.value=i=u.hierarchy({values:d.array(e.keys).reduce(function(e,t){return e.key(t),e},s.nest()).entries(n.source)},f),a&&i.each(function(e){e.children&&(e=o.ingest(e.data),n.add.push(e),n.source.push(e))}),l(i,o.tupleid,o.tupleid)),n.source.root=i,n},d.inherits(a,o.Transform).transform=function(e,t){t.source&&t.source.root||d.error(this.constructor.name+" transform requires a backing tree data source.");var a=this.layout(e.method),r=this.fields,n=t.source.root,i=e.as||r;e.field&&n.sum(e.field),e.sort&&n.sort(e.sort),function(e,t,a){for(var r,n=0,i=t.length;n<i;++n)(r=t[n])in a&&e[r](a[r])}(a,this.params,e);try{this.value=a(n)}catch(e){d.error(e)}return n.each(function(e){!function(e,t,a){for(var r=e.data,n=0,i=t.length-1;n<i;++n)r[a[n]]=e[t[n]];r[a[i]]=e.children?e.children.length:0}(e,r,i)}),t.reflow(e.modified()).modifies(i).modifies("leaf")};var r=["x","y","r","depth","children"];function n(e){a.call(this,e)}n.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:3,default:r}]};var i=d.inherits(n,a);i.layout=u.pack,i.params=["size","padding"],i.fields=r;var m=["x0","y0","x1","y1","depth","children"];function p(e){a.call(this,e)}p.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:4,default:m}]};var c=d.inherits(p,a);function y(e){o.Transform.call(this,null,e)}c.layout=u.partition,c.params=["size","round","padding"],c.fields=m,y.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},d.inherits(y,o.Transform).transform=function(e,t){t.source||d.error("Stratify transform requires an upstream data source.");var a=e.modified(),r=t.fork(t.ALL).materialize(t.SOURCE),n=!this.value||a||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return r.source=r.source.slice(),n&&(this.value=l(u.stratify().id(e.key).parentId(e.parentKey)(r.source),e.key,d.truthy)),r.source.root=this.value,r};var h={tidy:u.tree,cluster:u.cluster},g=["x","y","depth","children"];function v(e){a.call(this,e)}v.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:4,default:g}]};var b=d.inherits(v,a);function k(e){o.Transform.call(this,[],e)}b.layout=function(e){var t=e||"tidy";if(h.hasOwnProperty(t))return h[t]();d.error("Unrecognized Tree layout method: "+t)},b.params=["size","nodeSize","separation"],b.fields=g,k.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},d.inherits(k,o.Transform).transform=function(e,t){var a=this.value,r=t.source&&t.source.root,n=t.fork(t.NO_SOURCE),i={};return r||d.error("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(n.rem=a,t.visit(t.SOURCE,function(e){i[o.tupleid(e)]=1}),r.each(function(e){var t=e.data,a=e.parent&&e.parent.data;a&&i[o.tupleid(t)]&&i[o.tupleid(a)]&&n.add.push(o.ingest({source:a,target:t}))}),this.value=n.add):t.changed(t.MOD)&&(t.visit(t.MOD,function(e){i[o.tupleid(e)]=1}),a.forEach(function(e){(i[o.tupleid(e.source)]||i[o.tupleid(e.target)])&&n.mod.push(e)})),n};var q={binary:u.treemapBinary,dice:u.treemapDice,slice:u.treemapSlice,slicedice:u.treemapSliceDice,squarify:u.treemapSquarify,resquarify:u.treemapResquarify},T=["x0","y0","x1","y1","depth","children"];function D(e){a.call(this,e)}D.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:4,default:T}]};var z=d.inherits(D,a);z.layout=function(){var a=u.treemap();return a.ratio=function(e){var t=a.tile();t.ratio&&a.tile(t.ratio(e))},a.method=function(e){q.hasOwnProperty(e)?a.tile(q[e]):d.error("Unrecognized Treemap layout method: "+e)},a},z.params=["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],z.fields=T,e.nest=t,e.pack=n,e.partition=p,e.stratify=y,e.tree=v,e.treelinks=k,e.treemap=D,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vega-dataflow"),require("vega-util"),require("d3-collection"),require("d3-hierarchy")):"function"==typeof define&&define.amd?define(["exports","vega-dataflow","vega-util","d3-collection","d3-hierarchy"],t):t((e.vega=e.vega||{},e.vega.transforms={}),e.vega,e.vega,e.d3,e.d3)}(this,function(e,o,d,s,u){"use strict";function l(e,a,r){var n={};return e.each(function(e){var t=e.data;r(t)&&(n[a(t)]=e)}),e.lookup=n,e}function t(e){o.Transform.call(this,null,e)}function f(e){return e.values}function a(e){o.Transform.call(this,null,e)}t.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]},d.inherits(t,o.Transform).transform=function(e,t){t.source||d.error("Nest transform requires an upstream data source.");var a=e.generate,r=e.modified(),n=t.clone(),i=this.value;return(!i||r||t.changed())&&(i&&i.each(function(e){e.children&&o.isTuple(e.data)&&n.rem.push(e.data)}),this.value=i=u.hierarchy({values:d.array(e.keys).reduce(function(e,t){return e.key(t),e},s.nest()).entries(n.source)},f),a&&i.each(function(e){e.children&&(e=o.ingest(e.data),n.add.push(e),n.source.push(e))}),l(i,o.tupleid,o.tupleid)),n.source.root=i,n},d.inherits(a,o.Transform).transform=function(e,t){t.source&&t.source.root||d.error(this.constructor.name+" transform requires a backing tree data source.");var a=this.layout(e.method),r=this.fields,n=t.source.root,i=e.as||r;e.field&&n.sum(e.field),e.sort&&n.sort(e.sort),function(e,t,a){for(var r,n=0,i=t.length;n<i;++n)(r=t[n])in a&&e[r](a[r])}(a,this.params,e);try{this.value=a(n)}catch(e){d.error(e)}return n.each(function(e){!function(e,t,a){for(var r=e.data,n=0,i=t.length-1;n<i;++n)r[a[n]]=e[t[n]];r[a[i]]=e.children?e.children.length:0}(e,r,i)}),t.reflow(e.modified()).modifies(i).modifies("leaf")};var r=["x","y","r","depth","children"];function n(e){a.call(this,e)}n.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:r.length,default:r}]};var i=d.inherits(n,a);i.layout=u.pack,i.params=["size","padding"],i.fields=r;var m=["x0","y0","x1","y1","depth","children"];function p(e){a.call(this,e)}p.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:m.length,default:m}]};var c=d.inherits(p,a);function y(e){o.Transform.call(this,null,e)}c.layout=u.partition,c.params=["size","round","padding"],c.fields=m,y.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},d.inherits(y,o.Transform).transform=function(e,t){t.source||d.error("Stratify transform requires an upstream data source.");var a=e.modified(),r=t.fork(t.ALL).materialize(t.SOURCE),n=!this.value||a||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return r.source=r.source.slice(),n&&(this.value=l(u.stratify().id(e.key).parentId(e.parentKey)(r.source),e.key,d.truthy)),r.source.root=this.value,r};var h={tidy:u.tree,cluster:u.cluster},g=["x","y","depth","children"];function v(e){a.call(this,e)}v.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:g.length,default:g}]};var b=d.inherits(v,a);function k(e){o.Transform.call(this,[],e)}b.layout=function(e){var t=e||"tidy";if(h.hasOwnProperty(t))return h[t]();d.error("Unrecognized Tree layout method: "+t)},b.params=["size","nodeSize","separation"],b.fields=g,k.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},d.inherits(k,o.Transform).transform=function(e,t){var a=this.value,r=t.source&&t.source.root,n=t.fork(t.NO_SOURCE),i={};return r||d.error("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(n.rem=a,t.visit(t.SOURCE,function(e){i[o.tupleid(e)]=1}),r.each(function(e){var t=e.data,a=e.parent&&e.parent.data;a&&i[o.tupleid(t)]&&i[o.tupleid(a)]&&n.add.push(o.ingest({source:a,target:t}))}),this.value=n.add):t.changed(t.MOD)&&(t.visit(t.MOD,function(e){i[o.tupleid(e)]=1}),a.forEach(function(e){(i[o.tupleid(e.source)]||i[o.tupleid(e.target)])&&n.mod.push(e)})),n};var q={binary:u.treemapBinary,dice:u.treemapDice,slice:u.treemapSlice,slicedice:u.treemapSliceDice,squarify:u.treemapSquarify,resquarify:u.treemapResquarify},T=["x0","y0","x1","y1","depth","children"];function D(e){a.call(this,e)}D.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:T.length,default:T}]};var z=d.inherits(D,a);z.layout=function(){var a=u.treemap();return a.ratio=function(e){var t=a.tile();t.ratio&&a.tile(t.ratio(e))},a.method=function(e){q.hasOwnProperty(e)?a.tile(q[e]):d.error("Unrecognized Treemap layout method: "+e)},a},z.params=["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],z.fields=T,e.nest=t,e.pack=n,e.partition=p,e.stratify=y,e.tree=v,e.treelinks=k,e.treemap=D,Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "vega-hierarchy",
"version": "3.0.1",
"version": "3.0.2",
"description": "Hierarchical layout transforms for Vega dataflows.",

@@ -41,7 +41,7 @@ "keywords": [

"eslint": "4",
"rollup": "0.60.7",
"rollup": "0.62.0",
"tape": "4",
"uglify-js": "3",
"vega-transforms": "^2.0.0"
"vega-transforms": "^2.1.0"
}
}

@@ -26,3 +26,3 @@ import HierarchyLayout from './HierarchyLayout';

{ "name": "size", "type": "number", "array": true, "length": 2 },
{ "name": "as", "type": "string", "array": true, "length": 3, "default": Output }
{ "name": "as", "type": "string", "array": true, "length": Output.length, "default": Output }
]

@@ -29,0 +29,0 @@ };

@@ -5,3 +5,3 @@ import HierarchyLayout from './HierarchyLayout';

var Output = ["x0", "y0", "x1", "y1", "depth", "children"];
var Output = ['x0', 'y0', 'x1', 'y1', 'depth', 'children'];

@@ -27,3 +27,3 @@ /**

{ "name": "size", "type": "number", "array": true, "length": 2 },
{ "name": "as", "type": "string", "array": true, "length": 4, "default": Output }
{ "name": "as", "type": "string", "array": true, "length": Output.length, "default": Output }
]

@@ -30,0 +30,0 @@ };

@@ -10,3 +10,3 @@ import HierarchyLayout from './HierarchyLayout';

var Output = ["x", "y", "depth", "children"];
var Output = ['x', 'y', 'depth', 'children'];

@@ -32,3 +32,3 @@ /**

{ "name": "nodeSize", "type": "number", "array": true, "length": 2 },
{ "name": "as", "type": "string", "array": true, "length": 4, "default": Output }
{ "name": "as", "type": "string", "array": true, "length": Output.length, "default": Output }
]

@@ -35,0 +35,0 @@ };

@@ -22,3 +22,3 @@ import HierarchyLayout from './HierarchyLayout';

var Output = ["x0", "y0", "x1", "y1", "depth", "children"];
var Output = ['x0', 'y0', 'x1', 'y1', 'depth', 'children'];

@@ -53,3 +53,3 @@ /**

{ "name": "size", "type": "number", "array": true, "length": 2 },
{ "name": "as", "type": "string", "array": true, "length": 4, "default": Output }
{ "name": "as", "type": "string", "array": true, "length": Output.length, "default": Output }
]

@@ -56,0 +56,0 @@ };

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc