idekerlab / dot-app

Cytoscape application for exporting to .dot file format
GNU General Public License v3.0
7 stars 4 forks source link

Parser does not accept newlines in labels #9

Open cmungall opened 7 years ago

cmungall commented 7 years ago

I frequently embed newlines in my dot labels to improve rendering of nodes with long labels in graphviz, but dot-app doesn't seem to like this. E.g.

digraph cliquegraph {
subgraph cluster_A {
A [ label="A" ];
B [ label="B
foo" ];}
A -> B [ arrowhead = none, penwidth=1, color=blue, label="", style=dotted]
A -> B [ arrowhead = ediamond, penwidth=8, color=red, label="75", style=solid, arrowtail=ediamond, dir=both]
}

gives "Sorry! does not conform to dot syntax"

removing the new line between B and foo eliminates this error.

digraph cliquegraph {
subgraph cluster_A {
A [ label="A" ];
B [ label="B foo" ];}
A -> B [ arrowhead = none, penwidth=1, color=blue, label="", style=dotted]
A -> B [ arrowhead = ediamond, penwidth=8, color=red, label="75", style=solid, arrowtail=ediamond, dir=both]
}

however, now I get a perplexing 'source node is not a member of this network.

bdtfitts commented 7 years ago

Hello there, at this time the newlines issue has not been resolved, however your other problem has been resolved. The problem before was that nodes in a subgraph were not being added to Cytoscape's representation of the network, and so when the edges were being created the nodes were not actually a part of the network. This has been fixed in our latest version (which will be up on the Cytoscape App store in next few days. One thing to keep in mind (we will update the documentation with this as well) is that if you attempt to set default attributes within subgraphs, they will be ignored. For nodes within subgraphs, you'll have to set attributes to each element

cmungall commented 7 years ago

Thanks!