NetworkArtist
- class compas.artists.NetworkArtist(*args, **kwargs)[source]
Bases:
Artist
Artist for drawing network data structures.
- Parameters
network (
compas.datastructures.Network
) – A COMPAS network.- Attributes
network (
compas.datastructures.Network
) – The COMPAS network associated with the artist.nodes (list[hashable]) – The list of nodes to draw. Defaults to all nodes.
edges (list[tuple[hashable, hashable]]) – The list of edges to draw. Default is a list of all edges of the network.
node_xyz (dict[hashable, list[float]]) – Mapping between nodes and their view coordinates. The default view coordinates are the actual coordinates of the nodes of the network.
node_color (dict[hashable, tuple[float, float, float]]) – Mapping between nodes and RGB color values. Missing nodes get the default node color
default_nodecolor
.edge_color (dict[tuple[hashable, hashable], tuple[float, float, float]]) – Mapping between edges and colors. Missing edges get the default edge color
default_edgecolor
.node_text (dict[hashable, str]) – Mapping between nodes and text labels.
edge_text (dict[tuple[hashable, hashable], str]) – Mapping between edges and text labels.
node_size (dict[hashable, float]) – Mapping between nodes and sizes. Missing nodes get assigned the default node size
default_nodesize
.edge_width (dict[tuple[hashable, hashable], float]) – Mapping between edges and line widths. Missing edges get assigned the default edge width
default_edgewidth
.
- Class Attributes
default_nodecolor (tuple[float, float, float]) – The default color for nodes that do not have a specified color.
default_edgecolor (tuple[float, float, float]) – The default color for edges that do not have a specified color.
default_nodesize (float) – The default size for nodes that do not have a specified size.
default_edgewidth (float) – The default width for edges that do not have a specified width.
Methods
Clear the nodes and the edges of the network.
Clear the edges of the network.
Clear the nodes of the network.
Draw the edges of the network.
Draw the nodes of the network.
Inherited Methods
Build an artist corresponding to the item type.
Build an artist with the given type.
The main drawing method.
Drawing method for drawing an entire collection of objects.
Redraw the view.
Register an artist type to a data type.