@nx-component/hierarchy-graph

English | 简体中文

Usage no npm install needed!

<script type="module">
  import nxComponentHierarchyGraph from 'https://cdn.skypack.dev/@nx-component/hierarchy-graph';
</script>

README

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);