@vx/hierarchy
TypeScript icon, indicating that this package has built-in type declarations

0.0.199 • Public • Published

@vx/hierarchy

Many datasets are intrinsically hierarchical. This package contains several react components for visualizing hierarchical data and largely mirrors d3-hierarchy.

Many components take the same input hierarchy data root node as defined in as specified in the d3-hierarchy module. For convenience, this package also exports the d3-hierarchyutility to generate this format.

// equivalent to `import { hierarchy } from 'd3-hierarchy';`
import { hierarchy } from '@vx/hierarchy';

const root = hierarchy({
  name: 'root',
  children: [
    { name: 'child #1' },
    {
      name: 'child #2',
      children: [{ name: 'grandchild #1' }, { name: 'grandchild #2' }, { name: 'grandchild #3' }],
    },
  ],
});

Installation

npm install --save @vx/hierarchy

Package Sidebar

Install

npm i @vx/hierarchy

Weekly Downloads

1,922

Version

0.0.199

License

MIT

Unpacked Size

55.7 kB

Total Files

47

Last publish

Collaborators

  • hshoff
  • christopher.card.williams
  • vx-hshoff