Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cvzi/py_treedraw
Generate layout for drawing a tree in 2D. Based on the improved Walker Algorithm.
https://github.com/cvzi/py_treedraw
graph-algorithms graph-drawing level-based tree tree-drawing visualization
Last synced: 9 days ago
JSON representation
Generate layout for drawing a tree in 2D. Based on the improved Walker Algorithm.
- Host: GitHub
- URL: https://github.com/cvzi/py_treedraw
- Owner: cvzi
- Created: 2017-07-20T10:14:18.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-08T20:40:10.000Z (over 5 years ago)
- Last Synced: 2024-10-30T02:43:06.007Z (about 2 months ago)
- Topics: graph-algorithms, graph-drawing, level-based, tree, tree-drawing, visualization
- Language: Python
- Homepage: https://www.researchgate.net/publication/30508504_Improving_Walker%27s_Algorithm_to_Run_in_Linear_Time
- Size: 44.9 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
treedraw.py
===========![Example screenshot with pygame](https://raw.githubusercontent.com/cvzi/py_treedraw/master/pygame_treedraw_example.png)
This module implements a layout algorithm for a tree.
Each node in the tree has a layout property that contains an x and y
coordinate.The layout is calculated by calling the method "walker(distance)".
The distance property indicated the distance between nodes on the same level.
If the tree is build up using the addChild/removeChild methods, the layout
will be calculated in linear time _O(n)_.The algorithm is a python implemenation of this publication ["Improving
Walker's Algorithm to Run in Linear Time"](http://citeseer.ist.psu.edu/buchheim02improving.html) by Christoph Buchheim, Michael Jünger, Sebastian Leipert.Tested with Python 2.6, 2.7, 3.3, 3.4, 3.5, 3.6 and 3.7
The example code ([example.py](https://github.com/cvzi/py_treedraw/blob/master/example.py#L37-L92)) requires [pygame](https://www.pygame.org/wiki/GettingStarted) for the graphical interface.
[![Build Status](https://travis-ci.org/cvzi/py_treedraw.svg?branch=master)](https://travis-ci.org/cvzi/py_treedraw)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5324af341edb4e17b7ef69c78b3078ed)](https://www.codacy.com/app/cuzi/py_treedraw?utm_source=github.com&utm_medium=referral&utm_content=cvzi/py_treedraw&utm_campaign=Badge_Grade)
[![Coverage Status](https://coveralls.io/repos/github/cvzi/py_treedraw/badge.svg?branch=master)](https://coveralls.io/github/cvzi/py_treedraw?branch=master)