Graphviz VIEWER with native Mac UI

Hey, I’m doing a bigger project with Graphviz. I write my dot code in an editor and would like to use an external Graphviz Viewer to see how the result looks.

At the moment I have a little script which converts dot code to SVG and then shows the SVG in a browser, but a dedicated app might be more convinient.

So, I’m not looking for a Graphviz Editor just a Viewer, and – please! – no X Window UI: It’s not that great on macOS.

Any suggestion of a viwer with a mac-native UI would be greatly appreciated.

A simple built-in solution Consider using dot -Tpdf which outputs pdf, and then you can open the result in Preview.app, which is pretty slick for zooming in and out.

1 Like

vscode with a graphviz extension (not sure if it really counts as mac native?): Search results - graphviz | Visual Studio Code , Visual Studio Marketplace

1 Like

I have never used it, but Graphviz.app is a GUI app that ships with Graphviz and claims to be able to do this.

I had to sign up to report my findings on this topic. It seems, today, that:

  • installing via MacPorts (ie. sudo port install graphviz) installs a subport called graphviz-gui which installs the genuine app, v9.0.0 (8 months old). It’s not clear to me how that’s achieved from the portfile, and I no longer have MacPorts installed to check.
  • on the other hand, installing via HomeBrew (ie. brew install graphviz) does not. Although you do get version v11.0.0 (the latest).
  • there was an effort two years ago to put it on the AppStore, that didn’t quite make it.
  • there was a long and successful effort to get the build system to create a pkg when building from source, which installs Graphviz.app in the /Applications folder.
  • PixelGlow have their own GUI for graphviz, but it hasn’t been touched for a decade or more.
  • there’s even a QuickLook project which requires dot to be on the path.

I stumbled across xdot (which is this Python script, not the custom Graphviz language by the same name) and it’s working just fine for me. I can now run xdot myfile.gv to get an interactive viewer (with node highlighting), in about the same time as dot takes to create a PDF.

1 Like