plotly / dash-cytoscape

Interactive network visualization in Python and Dash, powered by Cytoscape.js
https://dash.plot.ly/cytoscape
MIT License
595 stars 120 forks source link

cose-bilkent does not work #165

Open hroyd opened 2 years ago

hroyd commented 2 years ago

few issues with this

https://github.com/plotly/dash-cytoscape/blob/master/demos/usage-cose-bilkent-layout.py

throws an error about the conflict between serving locally and external scripts

You have set your config to serve_locally=True but A local version of https://cdn.rawgit.com/cytoscape/cytoscape.js-cose-bilkent/d810281d/cytoscape-cose-bilkent.js is not available. If you added this file with app.scripts.append_script or app.css.append_css, use external_scripts or external_stylesheets instead. See https://dash.plotly.com/external-resources

seems like you have built in 'close-bilkent' into your code somewhere instead of 'cose-bilkent' as you get an error pop up saying it is looking for 'close-bilkent'

Invalid argument layout.name passed into Cytoscape with ID "cytoscape". Expected one of ["random","preset","circle","concentric","grid","breadthfirst","cose","close-bilkent","cola","euler","spread","dagre","klay"].

demo works if you replace the external script loading with

cyto.load_extra_layouts()

then replace all instances of 'close-bilkent' in the local cyto files with 'cose-bilkent'

MrTeale commented 2 years ago

Hey @hroyd! Pull request #147 handles this fix. It's been merged into master to go out with the next release. In the meantime, you can install the repo directly by using the below options.

For the latest commit on master:

pip install git+https://github.com/plotly/dash-cytoscape

or to install the specific #147 merge commit

pip install git+https://github.com/plotly/dash-cytoscape@81714a031307594a1c01b73bbc869b4f40bde094
tylercollier commented 1 year ago

It'd be great if this fix could be pushed out :-D

Thanks @MrTeale! I got this error though:

WARNING: pipenv requires an #egg fragment for version controlled dependencies. Please install remote dependency in the form git+https://github.com/plotly/dash-cytoscape#egg=. ✘ Installation Failed

(I'm using pipenv but it's supposedly the same with pip.)

Folowing advice here which led me to here, I had to use this to update to the latest version (note the #egg=...):

$ pip install git+https://github.com/plotly/dash-cytoscape#egg=dash-cytoscape