-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for literal colons in node name (WAS: escaping of ::
)
#53
Comments
Thanks for the detailed report. The edge method currently accepts Lines 55 to 74 in 5eaf0b7
Unforunately, fixing the 'colons in node identifiers' use case might require an API change, so will need to check how to best do this in a backwards-compatible way. In the mean time, you can use node names without literal colons (putting them into the In [1]: from graphviz import Digraph
...:
...: d = Digraph()
...: d.node('A')
...: d.node('B', label='::')
...: d.edge('A', 'B')
...:
...: d
Out[1]: In [2]: d2 = Digraph()
...: d2.node('A')
...: d2.node('B', label="'B::C'")
...: d2.edge('A', 'B')
...:
...: d2
Out[2]: |
Thanks @xflr6 for the workaround, I'll use that in the meantime. |
I just encountered this issue when creating a graph with some C++ modifiers in it ( I think that situation would be better if special meaning of colons (and possibly other characters) was documented better, especially that Python library hides the details of DOT language behind a nice and clean API. |
Thanks. I agree: let's try to better document the current behaviour (maybe you want to help with this?). |
I'll try my best, but as I said I'm not very familiar with DOT language nor with implementation of your library, so I don't want to promise anything. :) |
::
, generating DOT syntax error::
)
It might be nice if port and compass were kwargs, as opposed to things parsed out of the name; (Bringing this suggestion into this issue from here: #168 (comment)) |
Having looked at the code a bit and thought about the different ways |
Result:
Info:
The text was updated successfully, but these errors were encountered: