Giter Site home page Giter Site logo

hophiphip / react-fishbone Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 6.5 MB

React fishbone (Ishikawa) diagram component.

Home Page: react-fishbone.vercel.app

License: MIT License

CSS 0.78% HTML 1.86% TypeScript 94.03% JavaScript 3.32%
fishbone-diagram react

react-fishbone's Introduction

React Fishbone

React fishbone (Ishikawa) diagram component.

Installation

npm i @hophiphip/react-fishbone

Usage

Import the component

import Fishbone from '@hophiphip/react-fishbone';

Component usage example

<Fishbone 
    items={{
        "name": "Flaws",
        "children": [
            {
                "name": "Machines",
                "children": [
                    {"name": "Speed"},
                    {"name": "Bits"},
                    {"name": "Sockets"}
                ]
            }
        ]
    }}
    wrapperStyle={{ 
        width: 1000, 
        height: 500,
    }}
/>

API

FishboneNode

Fishbone diagram node.

Property Type Description
name string Text content
children FishboneNode[], undefined Nested children

LineConfig

Fishbone line/link parameters for specific level of nesting

Property Type Description
color string Line color
strokeWidthPx number Line width in px

NodeConfig

Fishbone node parameters for specific level of nesting

Property Type Description
color string Text color
fontSizeEm number Text size in em

FishboneProps

Fishbone component props.

Property Type Description
width string, number, undefined Component width
height string, number, undefined Component height
items FishboneNode, undefined Component node items
linesConfig LineConfig[], undefined Component line config for each level of nesting
nodesConfig NodeConfig[], undefined Component node items for each level of nesting
wrapperStyle React.CSSProperties, undefined Component wrapper <div /> style

Storybook

Building/Running storybook might cause an error

Error: error:0308010C:digital envelope routines::unsupported

That error appears in NodeJS versions > 16. Temporary solution is to set NODE_OPTIONS to --openssl-legacy-provider

cross-env NODE_OPTIONS=--openssl-legacy-provider npm run storybook
cross-env NODE_OPTIONS=--openssl-legacy-provider npm run build-storybook

react-fishbone's People

Contributors

hophiphip avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

react-fishbone's Issues

Node Overlap

Nodes are overlapping to each other, it is difficult to view by dragging the node!
overalapping after generating fishbone

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.