@hophiphip/react-fishbone
TypeScript icon, indicating that this package has built-in type declarations

0.5.3 • Public • Published

React Fishbone

Fishbone (Ishikawa) chart component for React.

Installation

npm install @hophiphip/react-fishbone

Usage

import Fishbone from '@hophiphip/react-fishbone';
import '@hophiphip/react-fishbone/style.css';

export default () => {
    return (
        <Fishbone
			items={{
				label: "Root",
				children: [
					{
						label: "Node 1",
						children: [
							{
								label: "Node 1-1",
								children: [
									{
										label: "Node 1-1-1",
									},
								],
							},
							{
								label: "Node 1-2",
							},
							{
								label: "Node 1-3",
							},
						],
					},
					{
						label: "Node 2",
						children: [
							{
								label: "Node 2-1",
							},
							{
								label: "Node 2-2",
							},
							{
								label: "Node 2-3",
							},
						],
					},
					{
						label: "Node 3",
					},
					{
						label: "Node 4",
					},
					{
						label: "Node 5",
						children: [
							{
								label: "Node 5-1",
							},
							{
								label: "Node 5-2",
							},
							{
								label: "Node 5-3",
							},
						],
					},
				],
			}}
		/>
    );
};

API

FishboneNode

Fishbone tree node element

Property Type Description
label ReactNode Contents of fishbone tree node
children FishboneNode[] or undefined Nested fishbone tree children-nodes

FishboneProps

Property Type Description
items FishboneNode Fishbone tree root node
layout [LayoutFunction] Fishbone layout function
reactFlowProps ReactFlowProps React flow props

Dependencies

React fishbone component is based on xyflow.

Readme

Keywords

none

Package Sidebar

Install

npm i @hophiphip/react-fishbone

Weekly Downloads

140

Version

0.5.3

License

none

Unpacked Size

325 kB

Total Files

50

Last publish

Collaborators

  • hophiphip