Giter VIP home page Giter VIP logo

r-orgchart's Introduction

R-orgchart

R-orgchart is simple library for displaying and creating orgcharts in React.

Installation:

$ npm install -s r-orgchart

Use:

import Rorgchart from 'r-orgchart';
...
<Rorgchart />

Props:

Prop Default Description
data array with root object: [{id: 1, title: 'Root', ParentId: null}] Array of objects you wish to display. Each object must contain id, title and ParentId.
readonly false By default, orgchart can be edited and nodes deleted. If you send this props, it will be readonly.
disableRootEdit false Disable edit of root node.
addNewChild default function There is default function for adding new node, but you can send your own if you wish - argument: parentId.
deleteNode default function There is default function for deleting node, but you can send your own if you wish - argument: node.
editNode default function There is default function for editing node, but you can send your own if you wish - argument: node (edited).
animation true Turn on/off animation (visible when there is only a root node).
nodeStyle - Custom style for node box.
nodeClassName - CSS className for node box.
btnsStyle - Custom style for buttons box.
btnsClassName - CSS className for buttons box.
lineColor - Custom color for lines connecting nodes.

Exporting data:

To get back data array with all changes, you can call function exportData using a ref:

    ...
    this.refs.rorgchart.exportData();
    ...
    <Rorgchart ref="rorgchart" />
    ...

r-orgchart's People

Contributors

kristina-sicaja avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

r-orgchart's Issues

Using Images

I would like to add images as data and use it within the orgchart. is that possible?

Set Left to Right Chart

I would like to use the chart which is constructed from left to right, Is it possible ?
ex:
1576148139071

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.