A graphical library for visualizing a binary search tree

My task is to visualize a binary search tree using C++ and the graphics libraries supported by the language.

The size of the input data is unknown in advance (it can be a tree of 4-5 nodes, or a couple of hundred or more), respectively, the idea comes to mind that first the tree is drawn in such a size that it fits on the screen, and after that, if desired, the user can zoom in/out the image to view the necessary ones nodes.

The tree itself is already implemented, only the visualization remains. I want to get something like this (at least partially - at first just drawing a tree of any size, and the rest of the features after that).

Actually, the question is-what is the best library to use for this kind of tasks, and maybe there are some simple examples?

Author: kekyc, 2016-11-05

1 answers

You can recommend using the Qt framework. In the examples, there is a project, as it seems to me, exactly on the topic. Called Elastic Nodes Example:

Elastic Nodes Example

The principle of operation is simple: first, for each node (ball), the force of repulsion from all other nodes is calculated, and then vice versa - the force of attraction, depending on the number of connections of the node with others. All this is already animated and automatically spreads, giving out sometimes quite intricate paintings:

Example of a graph

 2
Author: alexis031182, 2016-11-25 19:53:22