Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor() {
super();
cydagre(cytoscape); // register extension
cycola(cytoscape);
}
componentDidMount() {
import React, { Component, PropTypes } from 'react'
import cytoscape from 'cytoscape'
import jquery from 'jquery'
import contextMenus from 'cytoscape-context-menus'
contextMenus(cytoscape, jquery)
import cycola from 'cytoscape-cola'
import cola from 'cola'
cycola(cytoscape, cola)
import './Graph.css'
class Graph extends Component {
constructor () {
super()
this.state = {
cy: null
}
}
componentDidMount () {
console.log('setting up cytoscape...', this.refs.graph)
this.setState({
cy: cytoscape({
container: this.refs.graph,
elements: [],