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

Issue in creating HTML-like labels. #18

Open
shobhitg opened this issue Sep 18, 2014 · 1 comment
Open

Issue in creating HTML-like labels. #18

shobhitg opened this issue Sep 18, 2014 · 1 comment

Comments

@shobhitg
Copy link

Dot specification has HTML-like labels.

They are generally like:
label=<<FONT POINT-SIZE='12'>Some Text</FONT>>

The issue is that Graphviz doesn't understand it if that html label is quoted like this:
label="<<FONT POINT-SIZE='12'>Some Text</FONT>>"

In the attributes js file, lbl is of type lblString, which means it would be quoted.
https://github.com/glejeune/node-graphviz/blob/master/lib/deps/attributs.js#L59

We need a way to say if our label is a string or an html markup. Based on that it must be quoted or not.

I don't know what would be an elegant solution to this.

Any fixes (or even ideas) would be awesome?

@ravenscar
Copy link

Apologies for necroing this ancient issue but I was also hoping for a solution and there now seems to be a provision for that in the code and I thought I would document it for future visitors. You can add a ! before the string and it will end up being enclosed by <...> in the dotfile.

e.g.

const n1 = g.addNode('APIGW', {
  label: '!<B>API</B> <i>Gateway</i>',
});

comes out as:

"APIGW" [ label =<<B>API</B> <i>Gateway</i>> ];

I think this issue can be closed.

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