attributes#

Utilities for clearing attributes on diagrams (nodes, endpoints, diagram-level).

These helpers work both on a single diagram and on collections (list, set, tuple) of diagrams. Attribute selection can be a single string or an iterable of strings.

Functions

clear_attributes(k)

Clear all attributes (nodes, endpoints, diagram-level).

clear_diagram_attributes(k[, attr])

Clear diagram-level attributes.

clear_endpoint_attributes(k[, attr])

Clear endpoint attributes.

clear_node_attributes(k[, attr])

Clear node attributes.

clear_temporary_attributes(k)

Clear all temporary attributes (keys starting with '_') at all levels.

clear_temporary_diagram_attributes(k[, attr])

Clear temporary diagram-level attributes (keys starting with '_').

clear_temporary_endpoint_attributes(k[, attr])

Clear temporary endpoint attributes (keys starting with '_').

clear_temporary_node_attributes(k[, attr])

Clear temporary node attributes (keys starting with '_').

clear_node_attributes(k, attr=None)#

Clear node attributes.

Parameters:
Raises:

TypeError – If any element is not a PlanarDiagram/OrientedPlanarDiagram.

Return type:

None

clear_endpoint_attributes(k, attr=None)#

Clear endpoint attributes.

Parameters:
Return type:

None

clear_diagram_attributes(k, attr=None)#

Clear diagram-level attributes.

Parameters:
Return type:

None

clear_attributes(k)#

Clear all attributes (nodes, endpoints, diagram-level).

Parameters:

k (PlanarDiagram | OrientedPlanarDiagram | list[PlanarDiagram | OrientedPlanarDiagram] | set[PlanarDiagram | OrientedPlanarDiagram] | tuple[PlanarDiagram | OrientedPlanarDiagram, ...])

Return type:

None

clear_temporary_node_attributes(k, attr=None)#

Clear temporary node attributes (keys starting with ‘_’).

Parameters:
Return type:

None

clear_temporary_endpoint_attributes(k, attr=None)#

Clear temporary endpoint attributes (keys starting with ‘_’).

Parameters:
Return type:

None

clear_temporary_diagram_attributes(k, attr=None)#

Clear temporary diagram-level attributes (keys starting with ‘_’).

Parameters:
Return type:

None

clear_temporary_attributes(k)#

Clear all temporary attributes (keys starting with ‘_’) at all levels.

Parameters:

k (PlanarDiagram | OrientedPlanarDiagram | list[PlanarDiagram | OrientedPlanarDiagram] | set[PlanarDiagram | OrientedPlanarDiagram] | tuple[PlanarDiagram | OrientedPlanarDiagram, ...])

Return type:

None