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

@antv/hierarchy

Package Overview
Dependencies
Maintainers
64
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antv/hierarchy

layout algorithms for visualizing hierarchical data

  • 0.6.10
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
87K
decreased by-23.3%
Maintainers
64
Weekly downloads
 
Created

What is @antv/hierarchy?

@antv/hierarchy is a library for visualizing hierarchical data structures. It provides algorithms for layout and rendering of various types of hierarchical diagrams such as trees, clusters, and more.

What are @antv/hierarchy's main functionalities?

Tree Layout

This feature allows you to create a tree layout from hierarchical data. The code sample demonstrates how to use the tree layout algorithm to process a simple hierarchical data structure.

const { hierarchy, tree } = require('@antv/hierarchy');
const data = { name: 'root', children: [{ name: 'child1' }, { name: 'child2' }] };
const root = hierarchy(data);
const layout = tree().size([500, 500]);
const treeData = layout(root);
console.log(treeData);

Cluster Layout

This feature provides a cluster layout for hierarchical data. The code sample shows how to apply the cluster layout algorithm to a hierarchical data structure.

const { hierarchy, cluster } = require('@antv/hierarchy');
const data = { name: 'root', children: [{ name: 'child1' }, { name: 'child2' }] };
const root = hierarchy(data);
const layout = cluster().size([500, 500]);
const clusterData = layout(root);
console.log(clusterData);

Treemap Layout

This feature allows you to create a treemap layout, which is useful for visualizing hierarchical data with weighted nodes. The code sample demonstrates how to generate a treemap layout from a data structure with value attributes.

const { hierarchy, treemap } = require('@antv/hierarchy');
const data = { name: 'root', children: [{ name: 'child1', value: 100 }, { name: 'child2', value: 200 }] };
const root = hierarchy(data).sum(d => d.value);
const layout = treemap().size([500, 500]);
const treemapData = layout(root);
console.log(treemapData);

Other packages similar to @antv/hierarchy

Keywords

FAQs

Package last updated on 19 Jan 2023

Did you know?

Socket

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.

Install

Related posts

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