cohydra.visualization.visualization¶
Visualizations to display simulation results.
Classes
The NoContext is a Null-Object and therefore does nothing. |
|
The Visualization class is the abstract super class of all visualizations. |
-
class
cohydra.visualization.visualization.
Visualization
[source]¶ Bases:
abc.ABC
The Visualization class is the abstract super class of all visualizations.
To set a new visualization or to get the current visualization object use:
from cohydra.visualization import Visualization, NoVisualization Visualization.set_visualization(NoVisualization()) Visualization.get_visualization().set_node_size(5.0)
-
static
set_visualization
(visualization)[source]¶ Sets a new visualization.
- Parameters
node (
Visualization
) – The new visualization object.
-
node_size
= None¶ The size of each node in the visualization
-
output_directory
= None¶ The output directory
-
set_node_size
(new_node_size: float)[source]¶ Sets a new node size
- Parameters
new_node_size (float) – The new node size.
-
set_output_directory
(new_output_directory: str)[source]¶ Sets a new output directory
- Parameters
new_output_directory (str) – The new output directory
-
static
-
class
cohydra.visualization.visualization.
NoVisualization
[source]¶ Bases:
cohydra.visualization.visualization.Visualization
The NoContext is a Null-Object and therefore does nothing.
There is no visualization at all and all calls to the visualization class will be ignored.
-
prepare_node
(node)[source]¶ Gives the visualization the oppertunity to prepare a node
- Parameters
node (
Node
) – The related node.
-
set_node_position
(node, x, y, z=0)[source]¶ Set the position of the node in the visualization.
- Parameters
node (
Node
) – The related node.x (float) – The x-position.
y (float) – The y-position.
z (float) – The z-position.
-
static
get_visualization
()¶ Return the current visualization. Default is no visualization
-
set_node_size
(new_node_size: float)¶ Sets a new node size
- Parameters
new_node_size (float) – The new node size.
-
set_output_directory
(new_output_directory: str)¶ Sets a new output directory
- Parameters
new_output_directory (str) – The new output directory
-
static
set_visualization
(visualization)¶ Sets a new visualization.
- Parameters
node (
Visualization
) – The new visualization object.
-
Inheritance Diagramm