Skip to content
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

Cancellation characters #82

Closed
dstaulcu opened this issue Nov 20, 2018 · 3 comments
Closed

Cancellation characters #82

dstaulcu opened this issue Nov 20, 2018 · 3 comments

Comments

@dstaulcu
Copy link

It appears that backslashes (possibly other special chacters) are not printed when included in labels. imagine I could mitigate this before passing lists to PSGraph but it would be ideal to handle any special character cancellation internally.

@KevinMarquette
Copy link
Owner

KevinMarquette commented Dec 8, 2018

I took a look at the graphviz documentation on this one. https://graphviz.gitlab.io/_pages/doc/info/attrs.html#k:escString

A string allowing escape sequences which are replaced according to the context. For node attributes, the substring "\N" is replaced by the name of the node, and the substring "\G" by the name of the graph. For graph or cluster attributes, the substring "\G" is replaced by the name of the graph or cluster. For edge attributes, the substring "\E" is replaced by the name of the edge, the substring "\G" is replaced by the name of the graph or cluster, and the substrings "\T" and "\H" by the names of the tail and head nodes, respectively. The name of an edge is the string formed from the name of the tail node, the appropriate edge operator ("--" or "->") and the name of the head node. In all cases, the substring "\L" is replaced by the object's label attribute.
In addition, if the associated attribute is label, headlabel or taillabel, the escape sequences "\n", "\l" and "\r" divide the label into lines, centered, left-justified, and right-justified, respectively.

Obviously, one can use "\\" to get a single backslash. A backslash appearing before any character not listed above is ignored.

@KevinMarquette
Copy link
Owner

Because I am trying to keep as much of the graphviz functionality as possible available in GraphViz, I want to preserve the ability to use those special escape sequences in labels.

@dstaulcu
Copy link
Author

dstaulcu commented Dec 8, 2018

Thank you for looking into this. I'll incorporate your research into my venture.

The structured data example in your blog article demonstrating use of PSGraph has the same issue which brought me here. The label field for C:\Workspace\PSGraph node is missing backslashes associated with the FullName of the folder. I did obvious things like replacing "\" with "\\" in a copy of the FullName for labeling but it did not help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants