Tree layout of layout algorithms

Source: Internet
Author: User

In the field of data visualization, it is often necessary to distribute the data according to certain rules, so that the data display is intuitive, clear and at a glance. In the engineering practice, I encountered a problem: how to make a multi-relationship with the point-edge graph according to the tree layout?

On the basis of consulting a large number of domestic and foreign materials, the author found a paper written by Bill Mill: drawing presentable trees.

Here is a brief description of the approximate idea of the algorithm: The algorithm uses a depth-first approach to traverse the entire multi-fork tree. The first step: if it is a leaf node, its x-coordinate equals the x-coordinate of its left sibling plus the spacing distance, if the non-leaf node, its x-coordinate equals the x-coordinate of its left sibling plus the spacing distance, simultaneously recording the offset (the difference between the x-coordinate and the midpoint of the child node). Step Two: Move all child nodes at the parent node's offset. The third step: calculate the contour of the multi-fork tree, if the contour value is less than 0 indicates that there is overlap between the left and right sub-tree, and offset that contour value.

Tree layout of layout algorithms

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.