Layout strategies

0 votes
asked Jun 1, 2015 in To be sorted by mime2669 (120 points)
Hi,

I am currently doing a master thesis on UML diagram generation from code and am planning to work with plantUML source code.

After some experiments, we noticed that neato layout strategies performs better than Dot in regards to component diagrams. I saw in the source code that you started developping it (net.sourcefourge.plantuml.SkinParam.getStrategy()).

Is it finished? (I can't find the option to set to neato). Did it give bad results? Is it an ongoing feature?

As we are currently working on plantUML source code I would gladly appreciate if you could tips on where to look/what to fix to create this "strategy" feature :)

Thank you for your help

Myriam

1 Answer

0 votes
answered Jun 1, 2015 by plantuml (295,000 points)
edited Jun 1, 2015 by plantuml
Unfortunatly, we have not started to work on this.
The code you mention is legacy code. Long time ago, we were wondering if we could use other engine than Dot, but we did nothing on this.

Modifying PlantUML to use neato instead of dot is theoretically possible. It's probably a good idea, but it will not be easy to do.

The real issue is historical : 6 years ago, when we started PlantUML, image generation was done with Dot.
To turn around graphical limitation of Graphviz, we implements a new architecture called "svek", (see http://plantuml.sourceforge.net/svek.html  ).
Now this code is working fine, but since we get to it using many slight refactoring to ensure ascending compatibility, this code is not very clean.
There are a lot of thing there that should be cleaned before adding feature like neato.

We can give you some tips, but I am not sure that it will help you. Maybe you should focus on your thesis :-)

If you are curious, you can have a look at DotStringFactory class. We should probably extract an interface from here and create a NeatoStringFactory class that would work with neato.

DotStringFactory has two important methods:
- createDotString() that build a String containing a Dot description of the diagram
- getSvg() which basically call createDotString() then Dot to create a SVG String of the diagram
- solve() which parses the Svg String to retrieve size/position of nodes and edge.

Unfortunatly, we are currently working on too many new features right now, and we cannot open a new front on this.
We will probably in some future, but not right now. Sorry about that!
...