react-graph-tree

npm install --save react-graph-tree

Usage no npm install needed!

<script type="module">
  import reactGraphTree from 'https://cdn.skypack.dev/react-graph-tree';
</script>

README

react-graph-tree

NPM JavaScript Style Guide

Install

npm install --save react-graph-tree

Usage

import React, { Component } from 'react'

import Tree from 'react-graph-tree'

class Example extends Component {
  render () {
    const data = {
          'label': 'Top Level',
          'children': [
            {
              'label': 'Level 2: A',
              'children': [
                {
                  'label': 'Son of A'
                },
                {
                  'label': 'Daughter of A'
                }
              ]
            },
            {
              'label': 'Level 2: B'
            }
          ]
        }
    return (
      <Tree data={data} />
    )
  }
}

License

MIT © yershalom