
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
vega-hierarchy
Advanced tools
The vega-hierarchy npm package provides utilities for creating and manipulating hierarchical visualizations such as tree diagrams, treemaps, and partition layouts. It is part of the Vega ecosystem, which is a visualization grammar that allows for the creation of a wide range of visualizations.
Tree Layout
This feature allows you to create tree layouts from hierarchical data. The code sample demonstrates how to create a tree layout using the vega-hierarchy package.
const vega = require('vega');
const vegaHierarchy = require('vega-hierarchy');
const data = {
name: 'root',
children: [
{ name: 'child1' },
{ name: 'child2', children: [{ name: 'grandchild1' }] }
]
};
const treeLayout = vegaHierarchy.tree();
const treeData = treeLayout(data);
console.log(treeData);
Treemap Layout
This feature allows you to create treemap layouts from hierarchical data. The code sample demonstrates how to create a treemap layout using the vega-hierarchy package.
const vega = require('vega');
const vegaHierarchy = require('vega-hierarchy');
const data = {
name: 'root',
children: [
{ name: 'child1', value: 100 },
{ name: 'child2', value: 200 }
]
};
const treemapLayout = vegaHierarchy.treemap();
const treemapData = treemapLayout(data);
console.log(treemapData);
Partition Layout
This feature allows you to create partition layouts from hierarchical data. The code sample demonstrates how to create a partition layout using the vega-hierarchy package.
const vega = require('vega');
const vegaHierarchy = require('vega-hierarchy');
const data = {
name: 'root',
children: [
{ name: 'child1', value: 100 },
{ name: 'child2', value: 200 }
]
};
const partitionLayout = vegaHierarchy.partition();
const partitionData = partitionLayout(data);
console.log(partitionData);
The d3-hierarchy package is part of the D3.js library and provides similar functionalities for creating hierarchical visualizations such as tree diagrams, treemaps, and partition layouts. It is widely used and has a large community, making it a robust alternative to vega-hierarchy.
Flare is a visualization toolkit for ActionScript that provides a wide range of visualizations, including hierarchical layouts. While it is not a JavaScript library, it offers similar functionalities for creating complex hierarchical visualizations.
ECharts is a powerful, interactive charting and visualization library for browser environments. It supports hierarchical visualizations such as treemaps and sunburst charts, making it a versatile alternative to vega-hierarchy.
FAQs
Hierarchical layout transforms for Vega dataflows.
The npm package vega-hierarchy receives a total of 173,061 weekly downloads. As such, vega-hierarchy popularity was classified as popular.
We found that vega-hierarchy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.