Closed un0btanium closed 3 years ago
Hi @un0btanium,
I think this is only an issue with the demo, which uses graphlib-dot to validate that the input string is valid DOT (the code for that is here) and it seems as if it doesn't correctly parse HTML-like labels. This code isn't present in the actual graphlib-react
library, which does no validation on the structure of the input strings and leaves that up to the consumer of the library, it only affects the demo.
A quick look at the graphlib-dot
repo and this issue seems to be related to the issue you're having. Setting the labelType
to "html"
, as per the below example, should allow you to use HTML-like labels in the demo.
graph {
a [label=<<b>Test</b>> labelType="html"]
}
Hope that helps.
Actually, using labelType
doesn't seem to solve the issue. Regardless, it's only an issue with the demo and not the actual library.
Oh, I see. That's good news. I tried it out and it does indeed work properly in my React application. Thank you :)
Does this allow nodes to be defined with HTML-like labels? I dont seem to get it to work in the demo. For example:
it throws
Parse Error: Cannot read property '3' of null
.