Bridges-Python 3.5.1
Bridges(Python API)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Attributes | Properties | List of all members
bridges.element.Element Class Reference

This is the main superclass in BRIDGES for deriving a number of elements used in building data structures. More...

Inheritance diagram for bridges.element.Element:
bridges.sl_element.SLelement bridges.tree_element.TreeElement bridges.circ_sl_element.CircSLelement bridges.dl_element.DLelement bridges.ml_element.MLelement bridges.bin_tree_element.BinTreeElement bridges.circ_dl_element.CircDLelement bridges.bst_element.BSTElement bridges.avl_tree_element.AVLTreeElement bridges.kd_tree_element.KDTreeElement

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.
 

Detailed Description

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.

SLelement, DLelement, CircSLelement, CircDLelement, MLelement, TreeElement, BinTreeElement,

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.

Author
Matthew Mcquaigue, Kalpathi Subramanian
2017, 2018, 6/24/19, 2020, 2021

Constructor & Destructor Documentation

◆ __init__()

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
Returns
None

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.

Member Function Documentation

◆ get_data_structure_type()

str bridges.element.Element.get_data_structure_type (   self)

◆ get_element_representation()

bridges.element.Element.get_element_representation (   self)

Getter for the element's JSON representation (for internal use)

Returns
str JSON of element

Reimplemented in bridges.avl_tree_element.AVLTreeElement, bridges.bst_element.BSTElement, and bridges.kd_tree_element.KDTreeElement.

◆ get_link_representation()

bridges.element.Element.get_link_representation (   self,
  lv,
  src,
  dest 
)

Getter for the JSON representation of the element's link (for internal use)

Parameters
lvlink visualizer
srcsource vertex of link
destdestination vertex of link
Returns
str JSON of element's link from src to dest

◆ get_link_visualizer()

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.

Parameters
elthe element terminating the link
Returns
LinkVisualizer of this element
Exceptions
ValueErrorif an element is not passed in

◆ get_locationX()

bridges.element.Element.get_locationX (   self)

Getter for the element's location in X.

Returns
float X coordinate of element's location

◆ get_locationY()

bridges.element.Element.get_locationY (   self)

Getter for the element's location in Y.

Returns
float Y coordinate of element's location

◆ remove_link_visualizer()

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
Returns
None

◆ set_link_visualizer()

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
Returns
None

◆ set_location()

bridges.element.Element.set_location (   self,
  locX,
  locY 
)

Setter for the element's location.

Parameters
locXthe element's location in X
locYthe element's location in Y
Returns
None

Member Data Documentation

◆ _identifier

bridges.element.Element._identifier
protected

◆ _ids

bridges.element.Element._ids
protected

◆ _label

bridges.element.Element._label
protected

◆ _link_visualizer

bridges.element.Element._link_visualizer
protected

◆ _value

bridges.element.Element._value
protected

◆ _visualizer

bridges.element.Element._visualizer
protected

◆ ids

int bridges.element.Element.ids = 0
static

Property Documentation

◆ color

bridges.element.Element.color = property
static

Getter for the element's color.

Returns
Color element's color

◆ id

bridges.element.Element.id = property
static

Get numer of ids of element object.

Returns
(int) number of ids of element

◆ identifier

bridges.element.Element.identifier = property
static

Getter for the element identifier.

Return
str element identifier (for internal use)

◆ label

bridges.element.Element.label = property
static

Getter for the element's label.

Returns
str the element's label

◆ opacity

bridges.element.Element.opacity = property
static

Getter for the element's opacity.

Returns
float element size (0-1.0)

◆ shape

bridges.element.Element.shape = property
static

Getter for the element's shape type.

Returns
element shape

◆ size

bridges.element.Element.size = property
static

Getter for the element's size.

Returns
float element size (0-50)

◆ value

bridges.element.Element.value = property
static

Getter for the value this element is holding.

Returns
generic object (application specific)

◆ visualizer

bridges.element.Element.visualizer = property
static

Getter for the element visualizer.

Returns
ElementVisualizer

The documentation for this class was generated from the following file: