An open API service indexing awesome lists of open source software.

https://github.com/pwcong/react-org-chart

Organization Chart written in React. https://pwcong.github.io/react-org-chart/index.html
https://github.com/pwcong/react-org-chart

react react-org-chart

Last synced: 3 months ago
JSON representation

Organization Chart written in React. https://pwcong.github.io/react-org-chart/index.html

Awesome Lists containing this project

README

        

# React Org Chart
Organization Chart written in React. Preview demo here [https://pwcong.github.io/react-org-chart/index.html](https://pwcong.github.io/react-org-chart/index.html)

### How to use
```tsx

import React from 'react';
import ReactDOM from 'react-dom';

import ReactOrgChart from '../src/index';

let counter = 0;

ReactDOM.render(
({
name: '人员',
avatar: ''
})),
hasChildren: true
}}
getChildren={(node) =>
new Promise((resolve) => {
counter++;
resolve(
Array.from(Array(3)).map((_, i) => ({
id: `sub-${counter}-${i}`,
name: '子部门',
hasChildren: true
}))
);
})}
/>,
document.getElementById('root')
);

```