GraphEdges
ā ļø This is an experimental API! It is not fully supported, and is likely to change significantly in future versions.
A list of edges in a graph.
By default, edges are undirected.
Components components
Required: GraphEdge
Recommended: GraphType
Shown in shown-in
API reference links api-reference-links
- š C++ API docs for
GraphEdges
- š Python API docs for
GraphEdges
- š¦ Rust API docs for
GraphEdges
Examples examples
Simple undirected graph simple-undirected-graph
"""Log a simple undirected graph."""
import rerun as rr
rr.init("rerun_example_graph_undirected", spawn=True)
rr.log(
"simple",
rr.GraphNodes(
node_ids=["a", "b", "c"], positions=[(0.0, 100.0), (-100.0, 0.0), (100.0, 0.0)], labels=["A", "B", "C"]
),
)
rr.log(
"simple",
rr.GraphEdges(edges=[("a", "b"), ("b", "c"), ("c", "a")], graph_type="undirected"),
)
Simple directed graph simple-directed-graph
"""Log a simple directed graph."""
import rerun as rr
rr.init("rerun_example_graph_directed", spawn=True)
rr.log(
"simple",
rr.GraphNodes(
node_ids=["a", "b", "c"], positions=[(0.0, 100.0), (-100.0, 0.0), (100.0, 0.0)], labels=["A", "B", "C"]
),
)
rr.log(
"simple",
rr.GraphEdges(edges=[("a", "b"), ("b", "c"), ("c", "a")], graph_type="directed"),
)