Skip to content

think-herrmann/react-orgchart

 
 

Repository files navigation

@ctrl/react-orgchart npm CircleCI

Small react wrapper around a d3 based org chart.

The latest fork by Herrmann Intl. is to add support for arbitrary svg so we could use font awesome

Use

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

<OrgChart tree={tree} />;

Sample tree data

import { icon } from '@fortawesome/fontawesome-svg-core'
import { faBuilding, faUser } from '@fortawesome/free-solid-svg-icons'

{
  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: icon(faUser).html,
        name: 'John Foo',
        title: 'CTO',
      },
      children: [],
    },
  ],
}

Building

yarn install

After making changes in this repo, run yarn run build. Be sure to add the built files with the commit.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 93.4%
  • TypeScript 6.6%