-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement graph components and archetypes #7500
Changes from all commits
b39c35a
74f1aeb
8102a95
10339c1
6c6519b
c2a2d4e
b2c9a73
0f78d8b
8823513
c0900c9
34032eb
aaa8733
30ec59d
36d4c8f
5c0284f
aeb518e
58328fb
e41c0fe
7558ee3
e1965bf
d8b16c8
803ef60
b786845
dff3358
f644118
ef3da62
8e4c69d
c50a508
eac1765
761d817
4aaac83
95bbb99
ff950e0
5e1cdcb
ebf5a66
63f9baa
44cd7d2
c5104be
0c5d6b9
8f99d6f
6465092
511543d
3c3e65f
0df93fd
d42c899
002c7b0
8fea1fc
80ad5b1
6463f23
32b9f9c
4654d3e
a1d9dc7
61203fb
435a646
9c86e37
fc40c49
69d225e
58e2267
8fd9263
6fddce8
c64678e
933a712
25022b7
760d8d4
f32e299
69e55fc
db1dc1d
c96ac2e
da1c85a
c73f2e5
009482c
adad111
37562a3
85ccfed
8fa2c63
600b812
e5d70f6
898afc6
e60b06f
6c9f327
8685be0
b919f17
9c7e021
eb09bfb
748740c
c2edffd
229e6b6
dda3947
b63f0ed
b4c5ce3
812a5d1
85b5963
fb44b7a
1408bad
a40390c
49e8277
3aa50ac
181d6a4
68e9435
111b0f5
64c09f1
cdae279
adb3ec9
b694ac3
eb4ae25
c36e011
b1ae62a
d524516
558b98b
f1d9f21
2bf7079
59acc6b
10cf7f0
5613a07
d9d4a02
729682c
e04b6e5
2fa2815
007e8d1
f3ff5f6
59049fe
b3d7b4c
9ef47be
0674ef0
81d556d
50a11a9
24b3ed7
82f190c
ec64a20
36f6670
9140ee6
5375384
9f6d989
a80192c
954844c
3b7608e
b636bc3
ead179f
1023394
bc4580d
c790ef4
d1d144a
08eff6e
91e9385
ebcbe4c
9b55b72
539ad0a
0284625
c7de2bf
d295b43
29e4a53
47c20a5
ebf8fa2
89232ad
83cb218
636a7c5
5a7cb20
a242daa
9d14402
9585b16
c100d50
a3ce5f7
a8a1c01
7a592c0
854c215
e1b8a59
41448c3
c9d09ab
5ea8067
8d0533e
4f597d9
0aaa219
dd743b8
4838aec
88572d6
91d8c29
74c301f
7b4b1f6
4ab3024
f602414
2018c1a
552d3c5
efa710b
2658d5e
d22f19b
e6f1637
f8e9eda
2e54352
0ccef12
f900aa8
d05e266
9fc8dd3
f1db8f8
bf49647
ff522e1
e530ba3
476c395
456795f
3facb25
7adad6b
8e5ab19
3e4327d
52e1d24
d8549a3
f80b054
b7d296c
1bc7345
f7b2cc6
b2a1f14
8ebd1d9
4a1282a
93d0e7f
e77d326
1e554f1
3d5bf65
4cc6521
b5b2ce1
b196c65
c32f6a7
3ed721d
9df6392
d1e29f8
33ecd67
e590008
7538159
dfec841
5237b48
6b00b47
1d1996e
b7704bc
969afde
1e60820
daa200d
f5b0033
5b8684e
e4bb6fa
13c16a9
fc6446c
8bc8b18
27f5e6a
a31f84d
5d0b3bb
f85a21e
97c84b7
a5a0382
9026a8d
9c40b4b
e4a6596
44ff86c
10b672a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
namespace rerun.archetypes; | ||
|
||
// --- | ||
|
||
// TODO(ab): Add images to snippets. | ||
|
||
/// A list of edges in a graph. | ||
/// | ||
/// By default, edges are undirected. | ||
/// | ||
/// \example archetypes/graph_undirected !api title="Simple undirected graph" image="" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add screenshot
|
||
/// \example archetypes/graph_directed !api title="Simple directed graph" image="" | ||
table GraphEdges ( | ||
"attr.docs.category": "Graph", | ||
"attr.docs.unreleased", | ||
"attr.docs.view_types": "GraphView", | ||
"attr.rust.derive": "PartialEq, Eq", | ||
"attr.rerun.experimental" | ||
) { | ||
// --- Required --- | ||
|
||
/// A list of node tuples. | ||
edges: [rerun.components.GraphEdge] ("attr.rerun.component_required", order: 1000); | ||
|
||
|
||
// --- Recommended --- | ||
|
||
/// Specifies if the graph is directed or undirected. | ||
grtlr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/// | ||
/// If no `GraphType` is provided, the graph is assumed to be undirected. | ||
graph_type: rerun.components.GraphType ("attr.rerun.component_recommended", nullable, order: 2000); | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
namespace rerun.archetypes; | ||
|
||
// --- | ||
|
||
// TODO(ab): Add images to snippets. | ||
|
||
/// A list of nodes in a graph with optional labels, colors, etc. | ||
/// | ||
/// \example archetypes/graph_undirected !api title="Simple undirected graph" image="" | ||
/// \example archetypes/graph_directed !api title="Simple directed graph" image="" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add screenshot |
||
table GraphNodes ( | ||
"attr.docs.category": "Graph", | ||
"attr.docs.unreleased", | ||
"attr.docs.view_types": "GraphView", | ||
"attr.rust.derive": "PartialEq", | ||
"attr.rerun.experimental" | ||
) { | ||
// --- Required --- | ||
|
||
/// A list of node IDs. | ||
node_ids: [rerun.components.GraphNode] ("attr.rerun.component_required", order: 1000); | ||
|
||
// --- Optional --- | ||
|
||
/// Optional center positions of the nodes. | ||
positions: [rerun.components.Position2D] ("attr.rerun.component_optional", nullable, order: 3000); | ||
|
||
/// Optional colors for the boxes. | ||
colors: [rerun.components.Color] ("attr.rerun.component_optional", nullable, order: 3100); | ||
|
||
/// Optional text labels for the node. | ||
labels: [rerun.components.Text] ("attr.rerun.component_optional", nullable, order: 3200); | ||
|
||
/// Optional choice of whether the text labels should be shown by default. | ||
show_labels: rerun.components.ShowLabels ("attr.rerun.component_optional", nullable, order: 3250); | ||
|
||
/// Optional radii for nodes. | ||
radii: [rerun.components.Radius] ("attr.rerun.component_optional", nullable, order: 3300); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace rerun.blueprint.views; | ||
|
||
/// A graph view to display time-variying, directed or undirected graph visualization. | ||
/// | ||
/// \example views/graph title="Use a blueprint to create a graph view." image="https://static.rerun.io/graph_lattice/f9169da9c3f35b7260c9d74cd5be5fe710aec6a8/1200w.png" | ||
table GraphView ( | ||
"attr.rerun.view_identifier": "Graph", | ||
"attr.docs.unreleased" | ||
) { | ||
/// Everything within these bounds is guaranteed to be visible. | ||
/// | ||
/// Somethings outside of these bounds may also be visible due to letterboxing. | ||
visual_bounds: rerun.blueprint.archetypes.VisualBounds2D (order: 1000); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace rerun.components; | ||
|
||
// --- | ||
|
||
/// An edge in a graph connecting two nodes. | ||
table GraphEdge ( | ||
"attr.docs.unreleased", | ||
"attr.rust.derive": "Default, PartialEq, Eq, PartialOrd, Ord", | ||
"attr.rust.repr": "transparent" | ||
) { | ||
edge: rerun.datatypes.Utf8Pair (order: 100); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace rerun.components; | ||
|
||
// --- | ||
|
||
/// A string-based ID representing a node in a graph. | ||
table GraphNode ( | ||
"attr.docs.unreleased", | ||
"attr.python.aliases": "str", | ||
"attr.python.array_aliases": "str, Sequence[str]", | ||
"attr.rust.derive": "Default, PartialEq, Eq, PartialOrd, Ord, Hash", | ||
"attr.rust.repr": "transparent" | ||
) { | ||
id: rerun.datatypes.Utf8 (order: 100); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace rerun.components; | ||
|
||
// -- | ||
|
||
/// Specifies if a graph has directed or undirected edges. | ||
enum GraphType: ubyte ( | ||
"attr.docs.unreleased", | ||
"attr.rust.derive": "Default, PartialEq, Eq" | ||
) { | ||
/// Invalid value. Won't show up in generated types. | ||
Invalid = 0, | ||
|
||
/// The graph has undirected edges. | ||
Undirected (default), | ||
|
||
/// The graph has directed edges. | ||
Directed, | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace rerun.datatypes; | ||
|
||
/// Stores a tuple of UTF-8 strings. | ||
table Utf8Pair ( | ||
"attr.docs.unreleased", | ||
"attr.python.aliases": "Tuple[datatypes.Utf8Like, datatypes.Utf8Like]", | ||
"attr.python.array_aliases": "npt.NDArray[np.str_]", | ||
"attr.rust.derive": "Default, PartialEq, Eq, PartialOrd, Ord" | ||
) { | ||
/// The first string. | ||
first: rerun.datatypes.Utf8 (order: 100); | ||
|
||
/// The second string. | ||
second: rerun.datatypes.Utf8 (order: 200); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: update the crate diagram
edit: turns out I dont need to do it myself :D 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: