-
Notifications
You must be signed in to change notification settings - Fork 366
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
Dynamic configuration of graph layout forces through blueprints #8299
Merged
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
3f2f267
Add sketch of `ForcePositionX`
grtlr 916502b
Add sketch of `ForcePositionY`
grtlr 20705ed
Run `pixi run codegen`
grtlr 56de022
Add `ForceCenter` and `ForceCollideRadius`
grtlr 77c3e75
Finish initial version of forces
grtlr 71af443
Add `ForceLayoutSimulation`
grtlr 4bba076
Remove unnecessary `derives`
grtlr 891292a
Experiment with `re_component`
grtlr 89e0d37
Revert previous design
grtlr 6e885ee
Add `ForceLink`
grtlr 3e906ab
Add force-related entries to registry
grtlr 8b4214c
Remove dups
grtlr 21304c7
Minor cleanup
grtlr a2aa9bd
WIP
grtlr b8a3082
Stash
grtlr 5644d31
Fix `ForceLink` archetype
abey79 f5cbe55
Fail codegen when archetype fields don't have one of the required att…
abey79 50701ff
WIP
grtlr db56814
Helper functions
grtlr 112d8c6
Helper functions
grtlr 4c0be0c
Remove `node_index`
grtlr 428510a
Implement `zip` on positions
grtlr e9546b3
Avoid allocation
grtlr 3508f89
Merge branch 'grtlr/remove-node-index' into grtlr/force-blueprints
grtlr 15bedd4
Adaptive blueprints
grtlr 700be13
Add additional blueprints
grtlr 8398b53
Bubble charts working
grtlr c1d0700
Highlight selection on circles
grtlr 81a158f
Re-enable iterations
grtlr 1f445e4
Improve selection ui
grtlr 67a04e1
Add `singleline_edit_position2d`
grtlr ae9fd7d
Add `singleline_edit_position2d`
grtlr 23386cc
Merge branch 'main' into grtlr/force-blueprints
grtlr 78488da
Small cleanup
grtlr 2b2fb45
Trigger CI
grtlr af2db60
Merge branch 'main' into grtlr/force-blueprints
grtlr f36ef0b
Missing files
grtlr 098cb3c
Cleanup
grtlr 5651f59
Add `ForceIterations`
grtlr c2ef1d6
Merge branch 'grtlr/position2d-single-line-edit' into grtlr/force-blu…
grtlr f9fb7e0
Merge branch 'main' into grtlr/force-blueprints
grtlr 88249c1
Better documentation of forces
grtlr a780955
Merge branch 'main' into grtlr/force-blueprints
grtlr 08d3dd8
Merge branch 'main' into grtlr/force-blueprints
grtlr 319e697
Not needed anymore
grtlr 93ed4e6
Address feedback
grtlr a55181c
Merge branch 'main' into grtlr/force-blueprints
grtlr a0f1a0b
Merge remains
grtlr 927a0e4
Rerun codegen
grtlr 8dfa3da
Format
grtlr e231cb2
Typo
grtlr b79e16f
Typo again
grtlr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
crates/store/re_types/definitions/rerun/blueprint/archetypes.fbs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
crates/store/re_types/definitions/rerun/blueprint/archetypes/force_center.fbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace rerun.blueprint.archetypes; | ||
|
||
/// Tries to move the center of mass of the graph to the origin. | ||
struct ForceCenter ( | ||
"attr.rerun.scope": "blueprint" | ||
) { | ||
/// Whether the force is enabled. | ||
enabled: rerun.blueprint.components.Enabled ("attr.rerun.component_optional", nullable, order: 100); | ||
|
||
/// The strength of the force. | ||
strength: rerun.blueprint.components.ForceStrength ("attr.rerun.component_optional", nullable, order: 200); | ||
} |
17 changes: 17 additions & 0 deletions
17
crates/store/re_types/definitions/rerun/blueprint/archetypes/force_collision_radius.fbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace rerun.blueprint.archetypes; | ||
|
||
/// Resolves collisions between the bounding spheres, according to the radius of the nodes. | ||
struct ForceCollisionRadius ( | ||
"attr.rerun.scope": "blueprint" | ||
) { | ||
/// Whether the force is enabled. | ||
enabled: rerun.blueprint.components.Enabled ("attr.rerun.component_optional", nullable, order: 100); | ||
|
||
/// The strength of the force. | ||
strength: rerun.blueprint.components.ForceStrength ("attr.rerun.component_optional", nullable, order: 200); | ||
|
||
/// Specifies how often this force should be applied per iteration. | ||
/// | ||
/// Increasing this parameter can lead to better results at the cost of longer computation time. | ||
iterations: rerun.blueprint.components.ForceIterations ("attr.rerun.component_optional", nullable, order: 300); | ||
} |
17 changes: 17 additions & 0 deletions
17
crates/store/re_types/definitions/rerun/blueprint/archetypes/force_link.fbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace rerun.blueprint.archetypes; | ||
|
||
/// Aims to achieve a target distance between two nodes that are connected by an edge. | ||
struct ForceLink ( | ||
"attr.rerun.scope": "blueprint" | ||
) { | ||
/// Whether the force is enabled. | ||
enabled: rerun.blueprint.components.Enabled ("attr.rerun.component_optional", nullable, order: 100); | ||
|
||
/// The target distance between two nodes. | ||
distance: rerun.blueprint.components.ForceDistance ("attr.rerun.component_optional", nullable, order: 200); | ||
|
||
/// Specifies how often this force should be applied per iteration. | ||
/// | ||
/// Increasing this parameter can lead to better results at the cost of longer computation time. | ||
iterations: rerun.blueprint.components.ForceIterations ("attr.rerun.component_optional", nullable, order: 300); | ||
} |
16 changes: 16 additions & 0 deletions
16
crates/store/re_types/definitions/rerun/blueprint/archetypes/force_many_body.fbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace rerun.blueprint.archetypes; | ||
|
||
/// A force between each pair of nodes that ressembles an electrical charge. | ||
/// | ||
/// If `strength` is smaller than 0, it pushes nodes apart, if it is larger than 0 it pulls them together. | ||
struct ForceManyBody ( | ||
"attr.rerun.scope": "blueprint" | ||
) { | ||
/// Whether the force is enabled. | ||
enabled: rerun.blueprint.components.Enabled ("attr.rerun.component_optional", nullable, order: 100); | ||
|
||
/// The strength of the force. | ||
grtlr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/// | ||
/// If `strength` is smaller than 0, it pushes nodes apart, if it is larger than 0 it pulls them together. | ||
strength: rerun.blueprint.components.ForceStrength ("attr.rerun.component_optional", nullable, order: 200); | ||
} |
15 changes: 15 additions & 0 deletions
15
crates/store/re_types/definitions/rerun/blueprint/archetypes/force_position.fbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace rerun.blueprint.archetypes; | ||
|
||
/// Similar to gravity, this force pulls nodes towards a specific position. | ||
struct ForcePosition ( | ||
"attr.rerun.scope": "blueprint" | ||
) { | ||
/// Whether the force is enabled. | ||
enabled: rerun.blueprint.components.Enabled ("attr.rerun.component_optional", nullable, order: 100); | ||
|
||
/// The strength of the force. | ||
strength: rerun.blueprint.components.ForceStrength ("attr.rerun.component_optional", nullable, order: 200); | ||
|
||
/// The position where the nodes should be pulled towards. | ||
position: rerun.components.Position2D ("attr.rerun.component_optional", nullable, order: 300); | ||
} |
4 changes: 4 additions & 0 deletions
4
crates/store/re_types/definitions/rerun/blueprint/components.fbs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
crates/store/re_types/definitions/rerun/blueprint/components/enabled.fbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace rerun.blueprint.components; | ||
|
||
// --- | ||
|
||
/// Whether a procedure is enabled. | ||
struct Enabled ( | ||
"attr.arrow.transparent", | ||
"attr.rerun.scope": "blueprint", | ||
"attr.python.aliases": "bool", | ||
"attr.rust.derive": "Copy, Default, PartialEq, Eq, PartialOrd, Ord", | ||
"attr.rust.repr": "transparent", | ||
"attr.rust.tuple_struct" | ||
) { | ||
visible: rerun.datatypes.Bool (order: 100); | ||
} |
14 changes: 14 additions & 0 deletions
14
crates/store/re_types/definitions/rerun/blueprint/components/force_distance.fbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
namespace rerun.blueprint.components; | ||
|
||
/// The target distance between two nodes. | ||
/// | ||
/// This is helpful to scale the layout, for example if long labels are involved. | ||
struct ForceDistance ( | ||
"attr.arrow.transparent", | ||
"attr.rust.derive": "Default, Copy, PartialEq", | ||
"attr.rust.repr": "transparent", | ||
"attr.rerun.scope": "blueprint" | ||
) { | ||
distance: rerun.datatypes.Float64 (order: 100); | ||
} |
14 changes: 14 additions & 0 deletions
14
crates/store/re_types/definitions/rerun/blueprint/components/force_iterations.fbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
namespace rerun.blueprint.components; | ||
|
||
/// Specifies how often this force should be applied per iteration. | ||
/// | ||
/// Increasing this parameter can lead to better results at the cost of longer computation time. | ||
struct ForceIterations ( | ||
"attr.arrow.transparent", | ||
"attr.rust.derive": "Default, Copy, PartialEq, Eq", | ||
"attr.rust.repr": "transparent", | ||
"attr.rerun.scope": "blueprint" | ||
) { | ||
distance: rerun.datatypes.UInt64 (order: 100); | ||
} |
14 changes: 14 additions & 0 deletions
14
crates/store/re_types/definitions/rerun/blueprint/components/force_strength.fbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
namespace rerun.blueprint.components; | ||
|
||
/// The strength of a given force. | ||
/// | ||
/// Allows to assign different weights to the individual forces, prioritizing one over the other. | ||
struct ForceStrength ( | ||
"attr.arrow.transparent", | ||
"attr.rust.derive": "Default, Copy, PartialEq", | ||
"attr.rust.repr": "transparent", | ||
"attr.rerun.scope": "blueprint" | ||
) { | ||
distance: rerun.datatypes.Float64 (order: 100); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
crates/store/re_types/src/blueprint/archetypes/.gitattributes
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Shouldn't that be named
ForceEdge
then? We don't use this "link" terminology anywhere else do we?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.
I used the terminology from
d3
here (which is a bit weird), but that way we can point users to thed3
documentation, which is quite good.It also helps with reproducing some of the
d3
examples.