vfrz / DotNetGraph

Create GraphViz DOT graph with .NET / C#
MIT License
93 stars 20 forks source link

HTML labels and edges with ports from element to element #31

Closed rvinowise closed 1 year ago

rvinowise commented 1 year ago

a node Label can contain complex HTML with many sub-elements (e.g. a table); and Edges can connect those internal sub-elements (e.g. connecting cells of the tables)

vfrz commented 1 year ago

Thanks for the contribution, I have a suggestion; I think we should use the same label property for both html and non-html content. It would prevent some confusion about the HtmlLabel property getting/setting the same value as Label underneath. For this I would update the constructor of DotLabelAttribute by adding isHtml = false, so the final result for creating a html label would look like this:

node.Label = new DotLabelAttribute("<table><tr><td port=\"port1\">a</td></tr></table>", true);
rvinowise commented 1 year ago

Thanks for the library! when adding HtmlLabel attribute, instead of additional parameters, i thought it might express the intention more obviously -- some people dislike boolean flags-parameters. but on the other hand, referring to the same label through two names can also be confusing, so, it's the matter of style

vfrz commented 1 year ago

Understandable. Then I would just edit the Node's Label setter to set IsHtml to false. I'll merge right after :)