NetworkArtist
- class compas_plotters.artists.NetworkArtist(*args, **kwargs)[source]
Bases:
PlotterArtist
,NetworkArtist
Artist for COMPAS network data structures.
- Parameters
network (
compas.datastructures.Network
) – A COMPAS network.nodes (list[int], optional) – Selection of node identifiers. Default is None, in which case all nodes are drawn.
edges (list[tuple[int, int]], optional) – Selection of edge identifiers. The default is None, in which case all edges are drawn.
nodecolor (tuple[float, float, float] or dict[int, tuple[float, float, float]], optional) – Color specification for the nodes.
edgecolor (tuple[float, float, float] or dict[tuple[int, int], tuple[float, float, float]], optional) – Color specification for the edges.
show_nodes (bool, optional) – If True, draw the nodes of the network.
show_edges (bool, optional) – If True, draw the edges of the network.
nodesize (int, optional) – The size of the nodes.
sizepolicy ({‘relative’, ‘absolute’}, optional) – The policy for sizing the nodes. If
'relative'
, the value of nodesize is scaled by the number of nodes. If'absolute'
, the value of nodesize is scaled by the resolution of the plotter (:attr:NetworkArtist.plotter.dpi).
- Attributes
node_size (dict[int, float]) – Mapping between node identifiers and node sizes.
zorder_edges (int, read-only) – The stacking order of the edges relative to the base stacking order of the network.
zorder_nodes (int, read-only) – The stacking order of the nodes relative to the base stacking order of the network.
Methods
Clear the current edges from the canvas.
Clear the current nodes from the canvas.
Draw the network.
Draw a selection of edge labels.
Draw a selection of edges.
Draw a selection of node labels.
Draw a selection of nodes.
Inherited Methods
Build an artist corresponding to the item type.
Build an artist with the given type.
Clear the nodes and the edges of the network.
Drawing method for drawing an entire collection of objects.
Redraw the view.
Register an artist type to a data type.
Update the data limits of the plotting axes using the visualization data.
Compute the bounds of the current view.