0.0.2 • Published 11 months ago

graphvisor v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

GraphVisor

GraphVisor is a React component that facilitates the visualization of interactive, customizable, directed, and weighted graphs.

npm version

Examples

Check out the interactive examples on the component's Storybook page.

API

GraphVisor

PropertyDescriptionTypeDefault
dataThe graph data object{nodes: node[], links: link[]}/
nodeTypeThe type of the node: circle or image. If it's an image, the image source must be provided in each node object"image" / "circle""circle"
nodeSizeThe size of the nodesnumber25
directedLinksSpecifies whether the link (edge) is directed or notbooleantrue
enableDragSpecifies whether the nodes are draggable or notbooleantrue
distanceThe distance between two nodes, or the length of the linknumber200
colorThe color applied to the nodes and linksstringblack
nodeClassNameThe class name applied to all nodesstring/
linkClassNameThe class name applied to all linksstring/
linkLabelClassNameThe class name applied to all link labelsstring/
titleClassNameThe class name applied to all node titlesstring/
onClickThe function to be called when a node is clicked(node) => void;/

Nodes

PropertyDescriptionTypeDefault
idThe unique identifier of the nodestring / number/
labelThe text shown under the nodestring/
imageThe source of the image of the node (only used if option.type is 'image')stringnull
classNameThe class name given to the nodestringnull
titleClassNameThe class name given to the label of the nodestringnull

Links

PropertyDescriptionTypeDefault
sourceThe ID of the source nodestring / number/
targetThe ID of the target nodestring / number/
labelThe label shown on the linkstringnull
labelClassNameThe class name given to the label of the linkstringnull
linkClassNameThe class name given to the linkstringnull
colorThe color of the linkstringby default, it uses the options.color