Skip to content

Installation of Graphviz

Neriderc edited this page Feb 18, 2023 · 2 revisions

The module uses Graphviz to generate the tree, which is a general purpose graphing tool. If Graphviz is installed on the server the module can use it to generate image files directly. From version 2.1.9, exporting your diagram to SVG, PNG, and JPEG are now supported without needing to have Graphviz installed, and PDF is supported from version 2.1.14.

However, you may still want to install Graphviz on the server. This has a few advantages.

  • You can generate on the server instead of the browser. This may be handy when the server is faster, or where you're using a browser that doesn't support the modern browser features needed to generate the output.
  • You can generate much larger trees. Generally you should be able to generate trees of 1,000 or more individuals, but if you want a really big tree you may hit a memory limit error. Installing Graphviz on the server can help with this error.
  • You can save much larger JPEG and PNG files. Browsers have a limit to the image size they can handle. GVExport will notify you if you hit this limit. Using Graphviz on the server can get around this limit.
  • PDF files can have links and will scale better. If you don't have Graphviz installed, a PDF will just be a PNG image embedded in a PDF file and so links won't be possible.
  • You can generate a couple more file types, GIF and PS

Install Graphviz

If you run a Debian based OS (like Ubuntu), you can install Graphviz by running the command sudo apt install graphviz.

If you're using Docker, you could update the Dockerfile apt-install process to include graphviz, or for a once off you could run:

docker exec -it webtrees apt update && docker exec -it webtrees apt install graphviz

However, note that while this command installs graphviz in the container, if you rebuild your container it will be lost and you'll have to do it again.

Note that the Cairo backend is required for SVG output. Typically this doesn't require further installation.

Get started

Now you're set up, see How to use GVExport.