MontealegreLuis / phuml

phUML is a UML diagram generator. It takes arbitrary object oriented PHP code and creates fully blown class diagrams of it.
BSD 3-Clause "New" or "Revised" License
100 stars 19 forks source link

Creating UML for large project causes wierd image scalling issue #17

Closed rainmanjam closed 2 years ago

rainmanjam commented 2 years ago

Working on a large project, phuml causes a scaling issue with the UML generation. Image below. The resolution of the image is 32767 × 617 test

MontealegreLuis commented 2 years ago

Hi @rainmanjam we're not passing many configuration options to neato or dot

Here you can find the options for the generated Digraph: https://github.com/MontealegreLuis/phuml/blob/master/src/resources/templates/digraph.html.twig#L5-L7

And the command is called with png as the output file type: https://github.com/MontealegreLuis/phuml/blob/master/src/Processors/ImageProcessor.php#L66

One thing you could try is to generate a .gv file and see if other options would generate a better output: https://montealegreluis.com/phuml/docs/dot-file.html

Whether we pass different settings to the DOT digraph or different flags to dot or neato commands.

Maybe the scale flag can help: https://www.graphviz.org/doc/info/command.html#-s

If you can share the .gv file I could try a few more things as well.

rainmanjam commented 2 years ago

Looks like generating a .gv file worked but now I have a .pdf file so complicated, it crashes Adobe Acrobat.

Closing Ticket.

MontealegreLuis commented 2 years ago

Sorry to hear that @rainmanjam, here are a few things I found that might help:

They're all very specific though, so I'm not sure how, or if, we could add them as enhancements in a way to make them work for all class diagrams.

Since your diagram is very big they're probably a bit impractical for you to try as well. But, if you want, you could try editing your .gv file (before converting it to pdf) and see if any of those suggestions help when you run neato or dot on your edited gv file. You might also try a different kind of image, like an svg for instance.

I'm not sure about the structure of your project, but I was already planning on deprecating the directory parameter and replace it with source in order to allow using glob patterns, so you can visualize multiple packages, a single class, or specific classes, or, for older projects not using namespaces, classes with similar names (common suffix or prefix). I hope that helps people with scenarios similar to yours.