Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which graphviz library API is recommended for a C++ project that needs to generate some graphs?

I know there are several versions of Graphviz as a library. But I'm a bit confused as to which one is considered current + recommended. I would like to generate and display a few graphs from a linux GUI application.

According to http://www.graphviz.org/doc/libgraph/Agraph.pdf on page 22, Libgraph was replaced by Cgraph. But the document is called Agraph, which I find strange.

On page 23, it also says Lgraph is a C++ successor to Cgraph, and since I'm using C++, I'd love to know more, but I cannot seem to find Lgraph anywhere.

Perhaps related, I do see there is a Boost library called BGL which supports importing and exporting graphviz files. Looking for opinions on whether it is preferable to use BGL over Graphviz directly or Lgraph.

It looks like on Ubuntu if I sudo apt-get install libgraphviz-dev I get Cgraph. In which case, this question is to either confirm Cgraph is the recommended library, and to ask if either Lgraph or BGL are worth considering.

like image 247
Stéphane Avatar asked Apr 09 '13 19:04

Stéphane


People also ask

What is GraphViz simple interface for Python?

Simple Python interface for Graphviz. This package facilitates the creation and rendering of graph descriptions in the DOT language of the Graphviz graph drawing software (master repo) from Python.. Create a graph object, assemble the graph by adding nodes and edges, and retrieve its DOT source code string.

How to add GraphViz files to Visual Studio project?

In both cases we have to add the needed external (Graphviz files) to the visual studio project. To do this, do the following: Then via file explorer copy all files mentioned above including dot.exe and config6 Go to the folder external and change the file type from ‘Visual C# files’ to all files (*.*)

How do I view the source code in GraphViz?

Save the source code to a file and render it with the Graphviz installation of your system. Use the view option/method to directly inspect the resulting (PDF, PNG, SVG, etc.) file with its default application.

What is GraphViz dot package?

This package facilitates the creation and rendering of graph descriptions in the DOT language of the Graphviz graph drawing software ( upstream repo ) from Python. Create a graph object, assemble the graph by adding nodes and edges, and retrieve its DOT source code string.


1 Answers

BGL does not provide interactive interfaces to Graphviz; if you need that, you will need to use one of Graphviz's native libraries such as cgraph. BGL can read and output Graphviz-format files, but that does not seem like what you are looking for; it also has some layout algorithms of its own, but they are not as sophisticated as those in Graphviz.

like image 191
Jeremiah Willcock Avatar answered Oct 21 '22 04:10

Jeremiah Willcock