Skip to content

Commit

Permalink
Add support for visible time range to the dataframe view (#6869)
Browse files Browse the repository at this point in the history
### What

- Part of #4466
- Soft-blocked by #6878

This adds support for visible time range to the dataframe. For now
(likely to be iterated on soon), this mode is enabled when _any_ of the
view entities have visible time range enabled (see note below). In that
mode, rows are indexed by (entity, time, row_id) and can be sorted with
either of the first two (asc or desc) using two new view properties.

The dataframe feature is—and remains—behind an opt-in feature flag.


#### Note on the current latest at vs. range switch

Currently A single view entity with visible time range force the entire
view into this mode. In particular, it force-opt-in *all* view entities
to visible time range, setting it to `Rel(0)-Rel(0)` when not explicitly
set. (It's as if the view's default visible time range switched to
`Rel(0)-Rel(0)` although that's not how it's implemented.)

This implicit behaviour is not ideal, and we probably should design a
better way to go about it, see #4466.

<img width="2004" alt="image"
src="https://github.com/user-attachments/assets/025694b7-9029-4ab8-bdf4-6d9954a6792c">



### Checklist

* [x] update view help text
* [x] split in multiple files
* [x] clean Chunk stuff
* [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/6869?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/6869?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/6869)
- [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`.

---------

Co-authored-by: Clement Rey <cr.rey.clement@gmail.com>
  • Loading branch information
abey79 and teh-cmc authored Jul 15, 2024
1 parent 8124967 commit b580da4
Show file tree
Hide file tree
Showing 42 changed files with 1,899 additions and 181 deletions.
4 changes: 4 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4854,6 +4854,7 @@ dependencies = [
"re_log_types",
"re_query",
"re_space_view",
"re_space_view_dataframe",
"re_space_view_spatial",
"re_space_view_time_series",
"re_tracing",
Expand Down Expand Up @@ -4927,10 +4928,13 @@ dependencies = [
"re_entity_db",
"re_log_types",
"re_renderer",
"re_space_view",
"re_tracing",
"re_types",
"re_types_core",
"re_ui",
"re_viewer_context",
"re_viewport_blueprint",
]

[[package]]
Expand Down
3 changes: 3 additions & 0 deletions crates/store/re_types/definitions/rerun/blueprint.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ include "./blueprint/components/panel_state.fbs";
include "./blueprint/components/query_expression.fbs";
include "./blueprint/components/root_container.fbs";
include "./blueprint/components/row_share.fbs";
include "./blueprint/components/sort_key.fbs";
include "./blueprint/components/sort_order.fbs";
include "./blueprint/components/space_view_class.fbs";
include "./blueprint/components/space_view_maximized.fbs";
include "./blueprint/components/space_view_origin.fbs";
Expand All @@ -41,6 +43,7 @@ include "./blueprint/archetypes/visible_time_ranges.fbs";
include "./blueprint/archetypes/visual_bounds2d.fbs";

include "./blueprint/archetypes/plot_legend.fbs";
include "./blueprint/archetypes/range_table_order.fbs";
include "./blueprint/archetypes/scalar_axis.fbs";

include "./blueprint/views/bar_chart.fbs";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
include "arrow/attributes.fbs";
include "python/attributes.fbs";
include "rust/attributes.fbs";

include "rerun/attributes.fbs";

namespace rerun.blueprint.archetypes;


/// Configuration for the sorting of the rows of a time range table.
table RangeTableOrder (
"attr.rerun.scope": "blueprint",
"attr.rust.derive": "Copy",
"attr.rust.generate_field_info"
) {
// --- Optional ---

/// The primary sort key.
sort_key: rerun.blueprint.components.SortKey ("attr.rerun.component_optional", nullable, order: 1000);

/// The sort order.
sort_order: rerun.blueprint.components.SortOrder ("attr.rerun.component_optional", nullable, order: 2000);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
include "arrow/attributes.fbs";
include "python/attributes.fbs";
include "rust/attributes.fbs";

include "rerun/datatypes.fbs";
include "rerun/attributes.fbs";

namespace rerun.blueprint.components;


/// Primary element by which to group by in a temporal data table.
enum SortKey: byte (
"attr.rerun.scope": "blueprint"
) {
/// Group by entity.
Entity (default),

/// Group by instance.
Time,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
include "arrow/attributes.fbs";
include "python/attributes.fbs";
include "rust/attributes.fbs";

include "rerun/datatypes.fbs";
include "rerun/attributes.fbs";

namespace rerun.blueprint.components;


/// Sort order for data table.
enum SortOrder: byte (
"attr.rerun.scope": "blueprint"
) {
/// Ascending
Ascending (default),

/// Descending
Descending,
}

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

2 changes: 2 additions & 0 deletions crates/store/re_types/src/blueprint/archetypes/mod.rs

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

201 changes: 201 additions & 0 deletions crates/store/re_types/src/blueprint/archetypes/range_table_order.rs

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

2 changes: 2 additions & 0 deletions crates/store/re_types/src/blueprint/components/.gitattributes

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

4 changes: 4 additions & 0 deletions crates/store/re_types/src/blueprint/components/mod.rs

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

Loading

0 comments on commit b580da4

Please sign in to comment.