Extended Objects
List
src.drawpyo.diagram.extended_objects.List
Bases: Object
Source code in src/drawpyo/diagram/extended_objects.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 | |
list_items
property
writable
A Python list of strings of the objects in the list.
Returns:
| Type | Description |
|---|---|
List[str]
|
list of strings: The list items |
width
property
writable
The width of the object. The difference between List's width and Object's width is that when the List.width is set all of the child objects will be set to the same width.
Returns:
| Type | Description |
|---|---|
Union[int, float]
|
Union[int, float]: The width of the list object |
__init__(title='List', list_items=[], **kwargs)
The List object wraps the basic Object type but allows easier managing of a list object and its members. All of the arguments and keyword arguments for Object are available here as well.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
The name in the heading of the list. Defaults to "List". |
'List'
|
list_items
|
list of strings
|
A Python list of strings denoting the items. Defaults to empty. |
[]
|
Source code in src/drawpyo/diagram/extended_objects.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
add_item(item_text)
This function creates a new Draw.io text item and adds it to the end of the list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item_text
|
string
|
The name of the item to add. |
required |
Source code in src/drawpyo/diagram/extended_objects.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
autosize()
This function resizes the parent List object to match the length of the list of items. It also restacks the list items to fill any gaps from deleted items.
Source code in src/drawpyo/diagram/extended_objects.py
70 71 72 73 74 75 76 77 | |
remove_item(item_text)
This function removes any list items matching the text passed into the function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item_text
|
string
|
The text of the list item to remove. |
required |
Source code in src/drawpyo/diagram/extended_objects.py
56 57 58 59 60 61 62 63 64 65 66 67 68 | |
Pie Slice
src.drawpyo.diagram.extended_objects.PieSlice
Bases: Object
Source code in src/drawpyo/diagram/extended_objects.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
size
property
writable
The size (width and height) of the pie slice.
Returns:
| Type | Description |
|---|---|
Union[int, float]
|
Union[int, float]: The size |
__init__(value='', slice_value=2.0, **kwargs)
The PieSlice object wraps the basic Object type but allows easier managing of a pie chart slice. All of the arguments and keyword arguments for Object are available here as well.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
The name of the pie slice. Defaults to "Slice". |
required |
slice_value
|
float
|
The numeric value of the pie slice. Defaults to 1.0. |
2.0
|
startAngle
|
float
|
The starting angle of the pie slice in degrees. Defaults to 0.0. |
required |
Source code in src/drawpyo/diagram/extended_objects.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |