Results 1 to 3 of 3

Thread: 'Circular' Tree Visualization

  1. #1
    Join Date
    Feb 2018
    Posts
    2
    Thanks
    1
    Platforms
    Unix/X11

    Default 'Circular' Tree Visualization

    I was wondering if anyone has any advice on implementing a circular 'phylogenetic' type binary tree visualization using QTGraphics - the type of tree where the root is in the center and the branches circle around a set radius.

    Something like this, except with the labels replaced with dots:
    wgJDR.jpg

    I could not find any pre-made widgets that were suited for this purpose.

    I'm currently using the 'Elastic Nodes' setup as a template - which utilizes QTGraphicsScene and QTGraphicsView, and have managed to create a standard tree visualization with dynamically set distances:
    8eaMu.jpg

    But wanted to switch to a circular format like the image above, if possible.

    Many thanks in advance.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: 'Circular' Tree Visualization

    I have implemented a similar dendrogram tree visualization as you show in your second figure. The phylogenetic layout is harder and my googling for a library doesn't yield any C++ libraries. From what I have read, the algorithm to create this type of layout (like that used in Elastic Nodes) is called a "force-directed layout", where each node is assigned a repulsive force which acts on other nodes, and the goal of the layout is to minimize the total repulsion between all nodes. My guess is that it is stepwise - put the root node at the center, then progressively add nodes at locations that maintain their connectivity and approximate branching distances, but minimize the repulsion, adjusting the other nodes as needed. I'd also guess that more sophisticated algorithms allow each node to carry a weight that determines its repulsivity - not all nodes are equal, in other words.

    In the Elastic Nodes example, the nodes don't have weights, but the edges between them have spring constants. A node is in an optimum position when the sum of the forces acting on it through each connected edge is minimized. The algorithm is somewhat similar in that both ends of the edges are moveable, and moving one node affects all other nodes in the network.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. The following user says thank you to d_stranz for this useful post:

    jw72 (2nd March 2018)

  4. #3
    Join Date
    Feb 2018
    Posts
    2
    Thanks
    1
    Platforms
    Unix/X11

    Default Re: 'Circular' Tree Visualization

    Thanks, I will give this a try - perhaps setting branches at an angles and then using the 'springing' feature of Elastic Nodes to make sure nodes don't overlap.

    I appreciate the helpful advice!

Similar Threads

  1. Replies: 6
    Last Post: 28th July 2015, 19:54
  2. Adding a small tree to an existing tree in QTreeview.
    By salcin in forum Qt Programming
    Replies: 0
    Last Post: 25th September 2013, 18:27
  3. Qt Creator T Driver Visualization
    By Kumar in forum Qt Tools
    Replies: 1
    Last Post: 1st June 2011, 10:49
  4. Visualization and Threads
    By ^NyAw^ in forum Qt Programming
    Replies: 1
    Last Post: 12th October 2009, 14:13
  5. QwtPlot orthonormal visualization
    By jomarin in forum Qwt
    Replies: 2
    Last Post: 14th May 2009, 16:17

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.