NetworkObject

class compas.scene.NetworkObject[source]

Bases: SceneObject

Scene object for drawing network data structures.

Parameters:
networkcompas.datastructures.Network

A COMPAS network.

Attributes:
networkcompas.datastructures.Network

The COMPAS network associated with the scene object.

node_xyzdict[hashable, list[float]]

Mapping between nodes and their view coordinates. The default view coordinates are the actual coordinates of the nodes of the network.

nodecolorcompas.colors.ColorDict

Mapping between nodes and RGB color values.

edgecolorcompas.colors.ColorDict

Mapping between edges and colors.

nodesizefloat

The size of the nodes. Default is 1.0.

edgewidthfloat

The width of the edges. Default is 1.0.

show_nodesbool

Flag for showing or hiding the nodes. Default is True.

show_edgesbool

Flag for showing or hiding the edges. Default is True.

Methods

clear

Clear the nodes and the edges of the network.

clear_edges

Clear the edges of the network.

clear_nodes

Clear the nodes of the network.

draw_edges

Draw the edges of the network.

draw_nodes

Draw the nodes of the network.

Inherited Methods

add

Add a child item to the scene object.

draw

The main drawing method.