NodeObject
src.drawpyo.diagram_types.tree.NodeObject
Bases: Object
This class defines one of the nodes on a tree graph. It inherits from Object and performs the same in most regards. It also tracks the tree-specific parameters like the tree, children, parent, etc.
Source code in src/drawpyo/diagram_types/tree.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
|
size_in_level
property
The size of the object within its level, either its width or height depending on tree orientation.
Returns:
Type | Description |
---|---|
int |
size_of_level
property
The height or the width of the level, depending on tree orientation.
Returns:
Type | Description |
---|---|
int |
tree
property
writable
The TreeDiagram that owns the NodeObject
Returns:
Type | Description |
---|---|
TreeDiagram |
tree_parent
property
writable
The parent NodeObject in the tree
Returns:
Type | Description |
---|---|
NodeObject |
__init__(tree=None, **kwargs)
The NodeObject should be instantiated with an owning tree object. A NodeObject can only have a single parent but can have any number of children.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tree |
TreeDiagram
|
The owning tree diagram. Defaults to None. |
None
|
Other Parameters:
Name | Type | Description |
---|---|---|
tree_children |
list
|
A list of other NodeObjects |
parent |
list
|
The parent NodeObject |
Source code in src/drawpyo/diagram_types/tree.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
add_child(obj)
Add a new child to the object
Source code in src/drawpyo/diagram_types/tree.py
58 59 60 61 62 63 64 65 |
|