Styling Graphs
Node Styling
Node Styling Attributes
See the Node Attribute Reference for a list of all node styling attributes.
Nodes can be styled by adding attributes to node data. All netext attributes start with a $ sign to avoid clashes with other attributes.
If you are using the optional networkx integration and want to style the whole graph in the same way, you can call:
To render all nodes in the graph g without boxes. Alternatively you can set individual attributes:
Edge Styling
Edge Styling Attributes
See the Edge Attribute Reference for a list of all edge styling attributes.
Edges can be styled in a similar way as nodes.
If you want to style the whole graph in the same way you can call:
To set the routing mode of all edges in the graph g to straight. Alternatively you can set individual attributes:
Styling via Properties
You can also style the graph via properties. This way you can use code completion to see all available properties and their values and also benefit from type checking. The attribute based styling, however is easier to encode when storing the graph in a file.
import networkx as nx
from netext import EdgeProperties, NodeProperties, EdgeRoutingMode
...
nx.set_edge_attributes(g, EdgeProperties(routing_mode=EdgeRoutingMode.ORTHOGONAL), "$properties")
See the API Documentation for a full documentation of all possible properties.