UNPKG

@twp0217/react-org-chart

Version:

```typescript import React from 'react'; import OrgChart, { NodeDataType } from '@twp0217/react-org-chart';

27 lines (23 loc) 660 B
export interface NodeDataType { key: string | number; label: string; children?: NodeDataType[]; className?: string; style?: React.CSSProperties; } export type RenderNode = ( node: NodeDataType, originNode: React.ReactNode, ) => React.ReactNode; export interface OrgChartComponentProps { data: NodeDataType; expandAll?: boolean; expandable?: boolean; renderNode?: RenderNode; onExpand?: (expanded: boolean, node: NodeDataType) => void; onClick?: (node: NodeDataType) => void; } export interface OrgChartProps extends Partial<OrgChartComponentProps> { className?: string; style?: React.CSSProperties; }