Free C++ library for drawing flow diagrams or Directed graph? [closed]
Asked Answered
R

5

15

I want to embed a flow diagram drawing canvas in my program. Users would possible to:

  • draw "nodes" (rectangle nodes is enough) and "edges" (preferable to be orthogonal) to connect "nodes";
  • use mouse to drag nodes for layout and resize rectangle;
  • select one or multiple nodes by mouse to delete, copy, paste etc.;
  • select one or multiple nodes by mouse to edit predefined properties (volume, temperature, pressure etc.) for them.;
  • change color (optional)
  • save/read data to/from files.

After drawing, the program only needs to get the connection logic (in data structure like Directed graph) and properties for further calculation.

Is there any free or open source C++ library to do this? (Not necessary for cross-platform, available in windows is enough.)

Redbird answered 29/5, 2011 at 14:50 Comment(5)
It seems that JGraphT can do such things by java. But i don't know java. Is there any similar libraries for C++?Redbird
Graphviz can probably do what you need.Yah
just FYI, a directed graph and a digraph are two different things: en.wikipedia.org/wiki/Digraphs_and_trigraphsMindi
Graphviz can be used for automatic layout. But what i need is using mouse to manually layout like in Microsoft Visio or Dia. I wonder if there are any "out of box" widget library for doing this.Redbird
I'd like to see one lib for this, since debugging non-trivial data structures can be a real agony! Voted for Q. Graphviz can not be integrated to your program, unless you adopt the code - which can take a lot of time...Colonialism
D
3

I recently was looking in to this and came across a few other options, along with Graphviz:

http://igraph.sourceforge.net/screenshots.html

http://networkx.lanl.gov/gallery.html

http://gephi.org/screenshots/

I ended up using networkx. I'm going to be playing with Gephi shortly to see what kind of data I can load in to it.

Dilworth answered 3/6, 2011 at 19:49 Comment(0)
O
1

If you're willing to commit to using Qt code for the graphical side of things, Qanava does a decent job of it. For dealing with graphs themselves (non-graphically) Boost Graph is quite nice.

Ochlophobia answered 3/6, 2011 at 19:45 Comment(0)
G
1

Dynagraph seems to have GUI Drawing included

http://www.dynagraph.org/

Dynagraph for Windows is a complete OLE graph-drawing application, allowing you to paste graphs into other documents, and paste documents into a graph as nodes.

Gaut answered 3/6, 2011 at 19:52 Comment(0)
V
0

It looks like you will have to do it. Qt will make you able to do whatever you need. Have a look at the graphics view framework that offers a lot of already implemented features to manipulate your graph.

Valentine answered 3/6, 2011 at 19:46 Comment(0)
L
-1

It may not be what you're after, but if you want a quick and dirty way to do graphical output from your code, you can pipe to gnuplot and send it commands. If the graphs are complicated, you want something like Graphviz, but if they are just little graphs, then the most difficult piece is linking the two, and gnuplot makes that really easy.

Lyte answered 3/6, 2011 at 19:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.