iVis-at-Bilkent / cytoscape.js-expand-collapse

A Cytoscape.js extension to expand/collapse nodes for better management of complexity of compound graphs
MIT License
126 stars 38 forks source link

Error: Can not register expandCollapse for core since expandCollapse already exists in the prototype and can not be overridden. #117

Open celine3d opened 4 years ago

celine3d commented 4 years ago

I am using cytoscape.js in react and cytoscape.js-expand-collapse. I register this extension at the very begining of my file as shown in docs: https://github.com/iVis-at-Bilkent/cytoscape.js-expand-collapse: by doing expandCollapse( cytoscape ); and it works only on first render. When I come back to my cytoscape component I receive following error: Can not register expandCollapse for core since expandCollapse already exists in the prototype and can not be overridden.

mdub commented 4 years ago

I'm having the same issue, but this work-around seems to be working for me:

if (typeof Cytoscape('core', 'expandCollapse') == 'undefined') {
  Cytoscape.use(CytoscapeUndoRedo);
  Cytoscape.use(CytoscapeExpandCollapse);
}
sashokbg commented 3 years ago

I am having the same issue but I cannot figure out how to apply the fix. In my case It fails on first load. Any help is appreciated.