react-cytoscape

1.0.6 • Public • Published

React component for Cytoscape

A React component to use simply the cytoscape js library.

http://js.cytoscape.org

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 to div cytoscape container

  • elements : Object with nodes and egdes attributes

  • style : Array of Style object

  • layout : Object with name of layout attribute.
    ReactCytoscape integrates cola layout and dagre layout.

  • styleContainer : an object of css style

  • cyRef : a callback function to obtain a reference to cytoscape object

  • cytoscapeOptions : Object with others cytoscape options builder

Readme

Keywords

Package Sidebar

Install

npm i react-cytoscape

Weekly Downloads

109

Version

1.0.6

License

MIT

Last publish

Collaborators

  • ybarukh