1.0.6 • Published 7 years ago
react-cytoscape v1.0.6
React component for Cytoscape
A React component to use simply the cytoscape js library.
Installation
npm install react-cytoscape
Usage
import ReactCytoscape from 'react-cytoscape';
<ReactCytoscape containerID="cy"
elements={this.getElements()}
cyRef={(cy) => { this.cy = cy; console.log(this.cy) }}
cytoscapeOptions={{wheelSensitivity: 0.1}}
layout={{name: 'dagre'}} />
ReactCytoscape props
Props are same as Cytoscape builder function.
containerID
: HTML ID todiv
cytoscape containerelements
: Object withnodes
andegdes
attributesstyle
: Array of Style objectlayout
: Object withname
of layout attribute.ReactCytoscape
integrates cola layout and dagre layout.styleContainer
: an object ofcss
stylecyRef
: a callback function to obtain a reference tocytoscape object
cytoscapeOptions
: Object with others cytoscape options builder