Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
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.
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.