graphvizdotcytoscape

Destroying my view in cytoscape make me loose the style from my dot file


I am loading a graph from a dot file into Cytoscape.

At first, all the nodes and edges colors are loaded (see the following picture). But all my nodes are at the same place so i need to move them all by hand : node at the same sport with style

To get a graph like so : moved by hand with style

When i destroy the view and create it once again, all the nodes are placed automatically but the color of the edges and the nodes are gone...

auto placed garph

It is bothering me to choose between having colors in my graph and move the nodes by hand or having an automatically built graph in black and white.

Do you know if i can either get my style back after destroying the view or at the begining force the nodes to be automatically placed ?


Solution

  • First, rather than moving the nodes by hand, I would just suggest running a layout. The reason the nodes are spread out when you recreate the view is that the default layout is being applied (generally Prefuse Force Directed). Second, as far as keeping the style, unfortunately, the way the dot importer works it to use visual property bypasses to apply the colors, etc., so no actual style is being created. That's why you are loosing your colors and other visual properties. Nevertheless, the real answer is to just apply a layout (Layout->Prefuse Force Directed Layout).