How PlantUML embeds Graphviz?

0 votes
asked Sep 29, 2021 in Question / help by gauravsaxena1997 (120 points)
edited Sep 29, 2021 by gauravsaxena1997

I'm working on a project based on state machines that transpile a state machine-based language in multiple languages plus PlantUML too. Till now I'm working with PlantUML which meeting my needs but now I have some advanced features like using styles and make them configurable, appending multiple types of data in a state, and so on.

So, alongside PlantUML, I want to use Graphviz also to fulfill the requirements. But to do so I want Graphviz as an executable so when a user is installing my application they do not want to install Graphviz as a dependency to use the product. Same as we use PlantUML, we don't have to install Graphviz first. So, I'm wondering how PlantUML embeds Graphviz to use it efficiently, without externally installing it and independent of the platform (Operating System).

1 Answer

0 votes
answered Oct 4, 2021 by Martin (8,360 points)
edited Oct 5, 2021 by Martin

My understanding is that Plantuml does not embed Graphviz.  Which is why they are working on a new embedded version of Graphviz called 'Smetana'.  See elk and vizjs for other alternatives to graphviz-dot.

Update (thanks Serge): To quote from https://plantuml.com/graphviz-dot:

Installation under Windows

Starting from 1.2020.21

If you use a recent version (that is at least version 1.2020.21), you don't need to manually install GraphViz anymore !

minimalistic graphviz dot.exe is packed into PlantUML and will be automagically unzipped in some temporary folder if needed (that is, if no installed GraphViz is available).

This is really the preferred option under Windows.

The text suggests this is a Windows only solution.  Check out the technical detail at https://github.com/plantuml/graphviz-distributions

commented Oct 5, 2021 by Serge Wenger Work (15,620 points)

Hello,

At my point of view, your are not right.

https://plantuml.com/fr/graphviz-dot explain that minimalistic graphviz dot.exe is packed into PlantUML.

We can also see on the download page that there is a version without embedded GraphViz: plantuml-nodot.1.2021.11.jar

commented Oct 5, 2021 by Martin (8,360 points)
Good point, I'd not noticed the new download; shows how often I refresh my local copy!  Thank you.
commented Oct 5, 2021 by The-Lu (67,080 points)

Yes, according to:

Starting from 1.2020.21

If you use a recent version (that is at least version 1.2020.21), you don't need to manually install GraphViz anymore !

minimalistic graphviz dot.exe is packed into PlantUML and will be automagically unzipped in some temporary folder if needed (that is, if no installed GraphViz is available).

This is really the prefered option under Windows.

Caveat: Before 1.2020.25, there was an error message during graph generation, so please use 1.2020.25 or more recent.

See also those threads:

If taht can help,
Reagrds,
Th.

...