graphvizdotcytoscape

Cytoscape don't load the node and edge attribute from my dot file


I am using cytoscape to display a graph i made with graphviz. I installed the add-on dot-app from the cytoscape app store to be able to load my graph.

My graph is loading perfectly, all the edges are connected to the nodes wanted. But the attributes of my nodes and edges aren't showing up.

Here is a simplified example (less attributes, nodes and edges) that is not working :

graph map {
node1 [color="#888888"]
node2 [color="#888888"]
node1 -- node2 [color="#1f78b4"]
}

It generates the following graph :

my graph

I managed to find code example of dot file loaded in cytoscape, the following one load the attributes well :

graph toy_example {
graph [bb="-85.648,-58.068,63.891,73.497",outputorder=edgesfirst, overlap=false];
node [fillcolor="#888888",label="\N",style=filled];
    1     [height=0.5,pos="-58.648,-8.4777",width=0.75];
    2     [height=0.5,pos="36.891,3.383",width=0.75];
    2 -- 1     [pos="10.278,0.079128 -2.8626,-1.5522 -18.68,-3.5159 -31.846,-5.1504"];
    3     [height=0.5,pos="12.665,-40.068",width=0.75];
    3 -- 1     [pos="-9.8989,-30.072 -18.223,-26.385 -27.653,-22.208 -35.986,-18.516"];
    3 -- 2     [pos="22.24,-22.895 23.933,-19.858 25.695,-16.698 27.386,-13.665"];
    4     [height=0.5,pos="8.8474,55.497",width=0.75];
    4 -- 2     [pos="18.03,38.433 21.097,32.734 24.516,26.38 27.592,20.664"];
    4 -- 3     [pos="9.5835,37.071 10.264,20.041 11.269,-5.1139 11.944,-22.022"];
}

Generating the following graph :

exemple graph

Do you know why my attributes can't load ? I tried destroying and creating the view on my graph but it don't do anything. The node table of both graphs only have "shared name" and "name".


Solution

  • If you look at the example that worked, the node color is defined as "fillcolor", not "color". This is because Cytoscape nodes can have two different colors, fillcolor and bordercolor, so the app authors chose to differentiate that by the attribute name. You would have to play around to see what they called the edge color. In Cytoscape it's called "Stroke Color (Unselected)", so you might try "edgecolor" or "strokecolor".