How to display graphs (like in Graphviz)

I need to display a tree-like structure, i.e. nodes that are connected hierarchically, but where some nodes also have connections to other relatives.

Like this:

   A
  /  \\
 B    C
 |  /
 D

I could program the graphics for this myself, but I am looking for something ready-to-use, with the ability to scroll and zoom in it.

A rendering engine like https://www.graphviz.org would probably be ideal, but I need this to work in Xojo, with interaction - meaning that if the user selects a node in the graph, I want to execute Xojo code in response. This means I cannot simply generate a DOT file and have it rendered in a separate app.

Any ideas? Am interested in both free and commercial solutions.

Have you looked at D3? See https://d3js.org . I don’t think that there is a Xojo library that allows interaction out of the box.

I just found this great tool for finding leaks in Xojo projects (I attempted something similar many years ago but this is superior in several ways): https://github.com/kmaehashi/XojoInstruments

It uses a pre-install “dot” command to get a html / SVG rendering from a graph, displays it with Xojo’s HTMLViewer, and is also able to process clicks on the nodes.

That’s basically all I needed :slight_smile:

Although - I thought of using it in a tool that I’d like to distribute (for free). In this case, I’d have to be able to include the renderer code in my app. Not sure if that’s doable with the graphviz package.