Simple Dynamic Graph Display for C++

前端 未结 2 1008
醉话见心
醉话见心 2021-01-03 04:32

I am looking for a simple graph layout library for C++. I want to embed the library into our visualizer based on wxWidgets. In summary, I am looking for something like graph

相关标签:
2条回答
  • 2021-01-03 05:01

    The layout that Graphviz generates is based on the global structure - any single addition can dramatically change the output (unless you're using fixed coordinates, in which case you probably wouldn't be asking this question). Basically, if you want automatic placement of elements, you need to accept one of these solutions:

    • When a new element is placed, a physics simulation is run in realtime, causing nodes to bounce around wildly until they settle into their new locations. This will be slow, but it will show "pleasing" changes.
    • When a new element is placed, the entire graph is re-drawn (physics/whatever is hidden, but the entire thing gets modified). This will be faster due to not having to redraw, but the relative locations of nodes can be completely different.
    • When a new element is placed, the existing elements are not modified. After enough dynamic updates, your graph is going to look like crap, because automatic placement is a global optimization problem.

    Sorry I can't help with your question, but maybe this helps to explain why what you're looking for may simply not exist (or be any good).

    0 讨论(0)
  • 2021-01-03 05:01

    To overcome some of the isues when using graphviz (descibed by Tom). We set the visualizer world coords to coincide with graphviz world coords.

    then. assuming each visual element has a unique identifier, build a graph using these elements. output the graph as text. realign everything based on output parsing. ?

    --

    Michael

    0 讨论(0)
提交回复
热议问题