Skip to content

Commit

Permalink
Dataframe column visibility can now be controlled (#7453)
Browse files Browse the repository at this point in the history
### What

* Closes #7067
* Builds on #7438 

Add the possibility to control the visibility of column:
- Time columns (except the one corresponding to the query) and component
columns can be hidden by clicking on the on-hover button in their
header.
- A new button in the view title bar with a popup to show/hide any
column.

This also fixes a red warning showing up when latest-at queries return 0
rows (see #7449 for background).

Note to reviewer: the meat is in `space_view_class.rs`, which is ofc
hidden by default by GitHub.


https://github.com/user-attachments/assets/d2b55c63-53db-46dd-9339-b10af98a073b


### TODO

- [x] Fix bad sizing of the popup menu

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7453?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7453?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!
* [x] If have noted any breaking changes to the log API in
`CHANGELOG.md` and the migration guide

- [PR Build Summary](https://build.rerun.io/pr/7453)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
  • Loading branch information
abey79 authored Sep 23, 2024
1 parent 47c6e47 commit f287587
Show file tree
Hide file tree
Showing 55 changed files with 2,384 additions and 51 deletions.

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,18 @@
namespace rerun.blueprint.archetypes;


/// Which columns should be displayed by the dataframe view.
table DataframeVisibleColumns (
"attr.rerun.scope": "blueprint"
) {
// --- Optional ---

/// Are all column selected, or only those specified by the user?
selection_mode: rerun.blueprint.components.ColumnSelectionMode ("attr.rerun.component_optional", nullable, order: 100);

/// The time columns to include (if mode is set to "Selected").
time_columns: [rerun.blueprint.components.TimelineName] ("attr.rerun.component_optional", nullable, order: 200);

/// The component columns to include (if mode is set to "Selected").
component_columns: [rerun.blueprint.components.ComponentColumnSelector] ("attr.rerun.component_optional", nullable, order: 300);
}

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,16 @@
namespace rerun.blueprint.components;


/// How are columns selected in the dataframe view?
enum ColumnSelectionMode: ubyte (
"attr.rerun.scope": "blueprint"
) {
/// Invalid value. Won't show up in generated types.
Invalid = 0,

/// Show all columns returned by the query.
All = 1 (default),

/// Show only the columns specified by the user.
Selected = 2,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

namespace rerun.blueprint.components;

/// Describe a component column to be selected in the dataframe view.
//TODO(ab, jleibs): this probably needs reunification with whatever structure the data out API uses.
table ComponentColumnSelector (
"attr.arrow.transparent",
"attr.rust.derive": "Default, PartialEq, Eq, Hash",
"attr.rust.repr": "transparent",
"attr.rerun.scope": "blueprint"
) {
selector: rerun.blueprint.datatypes.ComponentColumnSelector (order: 100);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ table TimelineName (
"attr.arrow.transparent",
"attr.python.aliases": "str",
"attr.python.array_aliases": "str, Sequence[str]",
"attr.rust.derive": "PartialEq, Eq, PartialOrd, Ord",
"attr.rust.derive": "PartialEq, Eq, PartialOrd, Ord, Hash",
"attr.rust.repr": "transparent",
"attr.rerun.scope": "blueprint"
) {
Expand Down

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,20 @@
namespace rerun.blueprint.datatypes;


/// Describe a component column to be selected in the dataframe view.
//TODO(ab, jleibs): this probably needs reunification with whatever structure the data out API uses.
// Has to be a table because flatbuffer doesn't support strings in structs.
table ComponentColumnSelector (
"attr.rust.derive": "Default, PartialEq, Eq, Hash",
"attr.rerun.scope": "blueprint"
) {
/// The entity path for this component.
entity_path: rerun.datatypes.EntityPath (order: 100);

/// The name of the component.
// NOTE: this field cannot be named `component_name`, because it would then clash with
// `ComponentMixin.component_name()` in the Python API.
component: rerun.datatypes.Utf8 (order: 200);

//TODO(ab, jleibs): many more fields to come (archetype, etc.)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ table Utf8List (
"attr.arrow.transparent",
"attr.python.aliases": "Sequence[str]",
"attr.rerun.scope": "blueprint",
"attr.rust.derive": "PartialEq, Eq, PartialOrd, Ord, Default",
"attr.rust.derive": "PartialEq, Eq, PartialOrd, Ord, Default, Hash",
"attr.rust.repr": "transparent",
"attr.rust.tuple_struct",
"attr.rust.override_crate": "re_types_blueprint"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ table EntityPath (
"attr.arrow.transparent",
"attr.python.aliases": "str",
"attr.python.array_aliases": "Sequence[str]",
"attr.rust.derive": "PartialEq, Eq, PartialOrd, Ord, Default",
"attr.rust.derive": "PartialEq, Eq, PartialOrd, Ord, Default, Hash",
"attr.rust.repr": "transparent",
"attr.rust.tuple_struct",
"attr.rust.override_crate": "re_types_core"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f287587

Please sign in to comment.