Colon in Node names and edges
See original GitHub issueHello,
There are a few other open tickets from a bit ago about this. Anyway, I was stumbled over it for a bit as I have nodes which are essentially objects which translate with a colon in it. However, this was difficult to debug as the output was still valid as the Node names stripped everything after the colon although the same does not happen for the edges, ie:
# In:
G.add_edge("(thing :test)", "(thing)", label="A Link")
import sys
from networkx.drawing.nx_pydot import write_dot
write_dot(G, sys.stdout)
# Out:
strict graph {
"(thing ";
"(thing)";
"(thing :test" -- "(thing)" [label="A Link"];
}
So I’m using networkx but I know it calls into pydot.to_pydot(…) The problem is that the edge is different to the node meaning you end up with weird duplicates/nodes that are not attached to anything.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:6 (2 by maintainers)
Top Results From Across the Web
XPath query for XML node with colon in node name
That "node with a colon" is a node using an XML namespace (defined in the <rss version="2.0" xmlns:media="search.yahoo.com/mrss"> node) - you need to...
Read more >8. Node and Edge Column Data - Cytoscape manual
Cytoscape allows the user to add arbitrary node, edge and network information to ... Namespace and column name are separated by a double...
Read more >Nodes and Edges - PGF/TikZ Manual
Your node name should not contain any punctuation like a dot, a comma, or a colon since these are used to detect what...
Read more >Graph Language Tutorial (Msc-generator 6.3.0)
After this, you can list nodes and edges enclosed between curly braces. ... Node names are underlined the first time they are used...
Read more >11 Nodes
Thus, you can name a node just 1 or perhaps start of chart or even y_1. Your node name should not contain any...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m guessing this is the same issue:
Pydot’s job is to hide the dot syntax behind a Python API. As
:
is part of the dot syntax, if a colon is part of a name, pydot should either escape it, or raise an error. Pydot should provide some pure Python way to specify these “ports” and “compass points”, e.g.pydot.Node(("id", "port", "compass_point"))
.Agreed. pydot/pydot#118 is probably a duplicate of this issue, where the conclusion was the same. I am currently busy looking for work, but hope to pick up pydot work in the evenings once everything stabilizes again. Feel free to open a PR in the mean time.