@ctrl/react-orgchart

1.3.0 • Public • Published

@ctrl/react-orgchart npm CircleCI

React wrapper around a d3 v6 based org chart.

This is based on smartprocure/react-org-chart which itself is also a fork. This fork has been updated to use d3 v6 and expose typescript types.

DEMO: https://ctrl-react-orgchart.vercel.app

Install

npm install @ctrl/react-orgchart

Use

import { OrgChart } from '@ctrl/react-orgchart';

<OrgChart tree={tree} />;

Sample tree data

{
  id: 1,
  entity: {
    id: 1,
    // base 64 image
    avatar: 'data:image/jpeg;base64,/9j....',
    name: 'Jane Doe',
    title: 'IT',
  },
  children: [
    {
      id: 2,
      entity: {
        id: 2,
        // svg example
        avatar: '<svg></svg>',
        name: 'John Foo',
        title: 'CTO',
      },
      children: [],
    },
  ],
}

Readme

Keywords

Package Sidebar

Install

npm i @ctrl/react-orgchart

Weekly Downloads

15

Version

1.3.0

License

MIT

Unpacked Size

66.8 kB

Total Files

31

Last publish

Collaborators

  • scttcper