-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dynamic configuration of graph layout forces through blueprints (#8299)
### Related * Closes #8278 <!-- Include links to any related issues/PRs in a bulleted list, for example: * Closes #1234 * Part of #1337 --> ### What Title. <!-- Make sure the PR title and labels are set to maximize their usefulness for the CHANGELOG, and our `git log`. If you have noticed any breaking changes, include them in the migration guide. We track various metrics at <https://build.rerun.io>. For maintainers: * To run all checks from `main`, comment on the PR with `@rerun-bot full-check`. * To deploy documentation changes immediately after merging this PR, add the `deploy docs` label. --> --------- Co-authored-by: Antoine Beyeler <antoine@rerun.io>
- Loading branch information
Showing
80 changed files
with
4,510 additions
and
92 deletions.
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. | ||
/// | ||
/// 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.