TriangularLayout

class visualife.diagrams.TriangularLayout(id, viewport, min_screen_x, max_screen_x, min_screen_y, max_screen_y, **kwargs)

Bases: visualife.diagrams.TreeLayout

Draws a binary tree using a triangular layout

Parameters:id – (string) a string that is used to identify graphical elements of this tree.

ID of a node will be created as ID-idx where ID is the ID of this layout object and idx is the index of a node :param viewport: (SvgViewport) its derivative :param min_screen_x: (int) - left screen coordinate :param max_screen_x: (int) - right screen coordinate :param min_screen_y: (int) - top screen coordinate :param max_screen_y: (int) - bottom screen coordinate :param kwargs: - see below

Keyword Arguments (**kwargs)(**kwargs):
 
  • width (number) – width of each node in pixels
  • height (number) – height of each node in pixels
  • separation (number) – minimum separation between nodes in pixels

Methods Summary

draw(root_node) Draws a binary tree given by its root node :param root_node: (BTreeNode) - root of the tree

Methods Documentation

draw(root_node: visualife.diagrams.TreeNode.TreeNode)

Draws a binary tree given by its root node :param root_node: (BTreeNode) - root of the tree