![]() |
Bridges-Python 3.5.1
Bridges(Python API)
|
This is the main superclass in BRIDGES for deriving a number of elements used in building data structures. More...
Public Member Functions | |
| str | get_data_structure_type (self) |
| Get the data structure representation. | |
| None | __init__ (self, **kwargs) |
| Element constructor. | |
| LinkVisualizer | get_link_visualizer (self, el) |
| Getter for the link visualizer object that links this element to another element specified by the argument. | |
| None | set_link_visualizer (self, el) |
| Setter for the link visualizer of this element. | |
| None | remove_link_visualizer (self, el) |
| Deleter function for the lik visualizer of this element. | |
| set_location (self, locX, locY) | |
| Setter for the element's location. | |
| get_locationX (self) | |
| Getter for the element's location in X. | |
| get_locationY (self) | |
| Getter for the element's location in Y. | |
| get_element_representation (self) | |
| Getter for the element's JSON representation (for internal use) | |
| get_link_representation (self, lv, src, dest) | |
| Getter for the JSON representation of the element's link (for internal use) | |
Static Public Attributes | |
| int | ids = 0 |
Protected Attributes | |
| _link_visualizer | |
| _ids | |
| _identifier | |
| _visualizer | |
| _value | |
| _label | |
Properties | |
| value = property | |
| Getter for the value this element is holding. | |
| identifier = property | |
| Getter for the element identifier. | |
| visualizer = property | |
| Getter for the element visualizer. | |
| label = property | |
| Getter for the element's label. | |
| size = property | |
| Getter for the element's size. | |
| color = property | |
| Getter for the element's color. | |
| opacity = property | |
| Getter for the element's opacity. | |
| shape = property | |
| Getter for the element's shape type. | |
| id = property | |
| Get numer of ids of element object. | |
This is the main superclass in BRIDGES for deriving a number of elements used in building data structures.
This is the main superclass in BRIDGES for deriving a number of elements used in building data structures, viz., arrays, lists, trees and graphs.
BSTElement, AVLTreeElement and KDTreeElement are all subclasses (see class hierarchy above). Element contains two visualizer objects (ElementVisualizer, LinkVisualizer) for specifying visual attributes for nodes and links respectively. It also contains a label that that can be displayed in BRIDGES visualizations.
All the tutorials under
https://bridgesuncc.github.io/tutorials/Overview.html
illustrate examples of using different types of Element objects and how to manipulate their visual attributes.
| None bridges.element.Element.__init__ | ( | self, | |
| ** | kwargs | ||
| ) |
Element constructor.
Creates an Element Visualizer and unique identifier for the current element.
(0) : "label" - the string label that is visible on the bridges Visualization
(1) : "value" - data value (or object) E used to construct Element
(2) : "original" - element object to copy (if named "original")
(3) : "color" - color of element
(4) : "opacity" - opacity of element
Reimplemented in bridges.bin_tree_element.BinTreeElement, bridges.bst_element.BSTElement, bridges.circ_dl_element.CircDLelement, bridges.circ_sl_element.CircSLelement, bridges.kd_tree_element.KDTreeElement, bridges.ml_element.MLelement, bridges.sl_element.SLelement, bridges.tree_element.TreeElement, bridges.avl_tree_element.AVLTreeElement, and bridges.dl_element.DLelement.
| str bridges.element.Element.get_data_structure_type | ( | self | ) |
Get the data structure representation.
Reimplemented in bridges.avl_tree_element.AVLTreeElement, bridges.bin_tree_element.BinTreeElement, bridges.bst_element.BSTElement, bridges.circ_dl_element.CircDLelement, bridges.circ_sl_element.CircSLelement, bridges.dl_element.DLelement, bridges.kd_tree_element.KDTreeElement, bridges.ml_element.MLelement, bridges.sl_element.SLelement, and bridges.tree_element.TreeElement.
| bridges.element.Element.get_element_representation | ( | self | ) |
Getter for the element's JSON representation (for internal use)
Reimplemented in bridges.avl_tree_element.AVLTreeElement, bridges.bst_element.BSTElement, and bridges.kd_tree_element.KDTreeElement.
| bridges.element.Element.get_link_representation | ( | self, | |
| lv, | |||
| src, | |||
| dest | |||
| ) |
Getter for the JSON representation of the element's link (for internal use)
| lv | link visualizer |
| src | source vertex of link |
| dest | destination vertex of link |
| LinkVisualizer bridges.element.Element.get_link_visualizer | ( | self, | |
| el | |||
| ) |
Getter for the link visualizer object that links this element to another element specified by the argument.
| el | the element terminating the link |
| ValueError | if an element is not passed in |
| bridges.element.Element.get_locationX | ( | self | ) |
Getter for the element's location in X.
| bridges.element.Element.get_locationY | ( | self | ) |
Getter for the element's location in Y.
| None bridges.element.Element.remove_link_visualizer | ( | self, | |
| el | |||
| ) |
Deleter function for the lik visualizer of this element.
(Element) el: the terminating element of the link; the link visualizer
for this link will be deleted
| None bridges.element.Element.set_link_visualizer | ( | self, | |
| el | |||
| ) |
Setter for the link visualizer of this element.
(Element) el: the terminating element of this link;
creates a new link visualizer for this link
| bridges.element.Element.set_location | ( | self, | |
| locX, | |||
| locY | |||
| ) |
Setter for the element's location.
| locX | the element's location in X |
| locY | the element's location in Y |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
static |
Getter for the element's color.
|
static |
Get numer of ids of element object.
|
static |
Getter for the element identifier.
|
static |
Getter for the element's label.
|
static |
Getter for the element's opacity.
|
static |
Getter for the element's shape type.
|
static |
Getter for the element's size.
|
static |
Getter for the value this element is holding.
|
static |
Getter for the element visualizer.