0.1.3 • Published 4 years ago

@ayc19/react-org-chart-fork v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

react-org-chart-next

Note

This is a version of @keymastervn/react-org-chart-next to be used as an npm package

This repository is an effort to make it work with es6 import.

It can be deprecated or private-used by the owner or the organization owner.

Usage

import * as OrgChart from '@keymastervn/react-org-chart-next'

...

render() {
  return <OrgChart tree={data} lineType="angle" style={{ cursor: "move", height: "100%", width: "100%" }} />
}

Features

  • High-performance D3-based SVG rendering
  • Lazy-load children with a custom function
  • Handle up to 1 million collapsed nodes and 5,000 expanded nodes

React Props

propertytypedescriptionexample
treeObjectNested data model with all of the employees in the company (Required){ "id": 123, "person": { "name": "Fouad Matin" }, "children": [] }
nodeWidthNumberWidth of the component for each individual (Optional)180
nodeHeightNumberHeight of the component for each individual (Optional)100
nodeSpacingNumberSpacing between each of the nodes in the chart (Optional)12
animationDurationNumberDuration of the animations in milliseconds (Optional)350
lineTypeStringType of line that connects the nodes to each other (Optional)“angle” “curve”
classNameStringDefine the classes for the root element (Optional)“rc-chart”
styleObjectDefine styling for the root element (Optional){ cursor: "move", height: "100%", width: "100%" }