dash-cytoscape icon indicating copy to clipboard operation
dash-cytoscape copied to clipboard

Feature Request/Question: yFiles Hierarchic layout

Open manihamidi opened this issue 5 years ago • 1 comments
trafficstars

First off, thanks for this awesome repo. Was wondering what the best way is to use a yFiles layout in dash-cyto. In particular, I find their hierarchic layout really useful but can't seem to find anything that comes close among the builtins or the "external layouts".

I'm open to any hacks that you would suggest/endorse perhaps using cytoscape's API or py2cytoscape that would facilitate this in the meantime?

Are there any guidelines for how to go about implementing a custom "external layout" somewhere?

Thanks again!

manihamidi avatar Sep 03 '20 18:09 manihamidi

Hi @manihamidi! yFiles hierarchical layout looks pretty neat! I think there's two ways to approach this:

  1. Write the logic in Javascript, then create a script called yFilesHierachical.js in src/lib. Then, import it in extra_index.js. For an example, see cola.js.
  2. Create a function in Python that can algorithmically generate the coordinate of each node based on nodes/edges specifications. For an example, see usage-phylogeny, and focus on this snippet:

https://github.com/plotly/dash-cytoscape/blob/b18fd799de48a05db8ef704d6024684b9e627771/demos/usage-phylogeny.py#L80-L85

xhluca avatar Sep 08 '20 18:09 xhluca