graph-uml icon indicating copy to clipboard operation
graph-uml copied to clipboard

Use GraphViz HTML-Like Labels instead of record shapes

Open clue opened this issue 12 years ago • 10 comments

http://www.graphviz.org/doc/info/shapes.html#html

clue avatar Jun 24 '13 07:06 clue

Please elaborate on the why?

I changed the title as it is HTML-Like Labels which is one of my reasons not to use it as people might expect it may contain any HTML. But it does not :(

OTOH people can actually write a label like this. Which would be awesome.

I guess we should look for a library understanding this HTML subset.

clemens-tolboom avatar Dec 30 '13 10:12 clemens-tolboom

Please elaborate on the why?

GraphViz record structures are somewhat limited, as there's no way to use an italic font (used for abstract methods/classes) or underlines (used for static members) etc. Also, this would allow us to apply more styles to the class diagram, like assigning background colors or coloring the method and attribute names.

I changed the title as it is HTML-Like Labels [...]

Yeah, makes sense :)

I guess we should look for a library understanding this HTML subset.

I don't think we necessarily have to be able to "understand" (i.e. parse?) them, we merely should be able to export them :)

clue avatar Dec 30 '13 10:12 clue

Support for italic / underline for our digrams sound indeed as a nice feature.

Regarding export ... does that break somehow? Then please add some tasks to this issue.

I'm now curious from my Drupal tooling regarding this label style :)

clemens-tolboom avatar Dec 30 '13 12:12 clemens-tolboom

[…] does that break somehow?

I don't think so. Issue #19 mentions the required steps to refactor our existing code into a separate ClassVertexToGraphVizRecord class. Once this lands, we can start working on a ClassVertexToGraphVizHtml.

clue avatar Dec 30 '13 12:12 clue

I think I missed the point all together. We want to render output from this lib into nice table form. Sorry for that.

clemens-tolboom avatar Dec 31 '13 16:12 clemens-tolboom

Hello, @clue I like your graphs librairies (graph/). And as I've beginning to write a tools based on new versions (dev master branch of graphp and graphviz), I realized that graph-uml is outdated (not yet migrated).

Rather than submit a PR, I've rebuilt a copy, based on your project. I'm still working on it, and it should be available soon on packagist. You can see architecture as a png image in docs folder of my project : https://github.com/llaville/graph-uml

You'll see that I've introduced the formatter feature to allow either record and html labels.

Tell me what you think about it.

llaville avatar Apr 15 '20 11:04 llaville

@llaville Thanks for working on this, this looks cool!

I'm still planning to update this project, but expect this to take at least a few more months. Perhaps we can join efforts then. Looking forward to see what you come up with in the meantime! :+1:

clue avatar Apr 15 '20 11:04 clue

I don't like this 'copy' instead of making a clone which keep the records strait.

clemens-tolboom avatar Apr 15 '20 11:04 clemens-tolboom

@clue Thanks to gave me feedbback so quickly !

@clue and @clemens-tolboom : Of course I'm ready to replace my copy by your own as soon as it will be available with this feature (html-like labels). But until then, I'll continue with my version because I need it now ! Hope you understand.

llaville avatar Apr 15 '20 15:04 llaville

I've released today version 0.4.0 of my copy of graph-uml (with docs, and beginning of unit tests). But the best to learn in this announcement, is the ability to choose (as previous) between html and record format (for Graphviz), and also ability to decouple code to graphviz attributes with Generator.

llaville avatar Apr 26 '20 15:04 llaville