npm.io
0.0.10 • Published 5 years ago

@nx-component/hierarchy-graph

Licence
MIT
Version
0.0.10
Deps
1
Size
185 kB
Vulns
0
Weekly
0

Hierarchy Graph

English | 简体中文

Environment Support

  • dagre ^0.8.5 npm package

Installation

$ npm i @nx-component/hierarchy-graph

Usage

import { buildGraph, HierarchyGraphNodeInfo } from '@nx-component/hierarchy-graph';

const data = {
    nodes: [
      { id: '0-1'},
      { id: '0-2'},
      { id: '1-1'},
      { id: '1-2'},
    ],
    edges: [
      { v: '0-1', w: '0-2' },
      { v: '0-2', w: '1-1' },
      { v: '1-1', w: '1-2' }
    ],
    compound: {
      GROUP0: ['0-1', '0-2']
    }
}
const renderInfo: HierarchyGraphNodeInfo = buildGraph(data);

Keywords