Skip to content
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

Add support for Visible History to time series space views #4179

Merged
merged 9 commits into from Nov 10, 2023

Conversation

abey79
Copy link
Contributor

@abey79 abey79 commented Nov 8, 2023

What

  • Add support for Visible History to Timeseries space views

    • Needed to introduce DataStore::entity_min_time() to maintain the consistent "beginning of x axis" behaviour.
  • Changes the way the Visible History feature is organised:

    • Now all space view (blueprint) contain a "root entity properties" structure that is cascaded to the enclosed groups and entities.
    • The visible history part of that root entity props is editable for all supported space view classes (now 2d, 3d, and timeseries).
    • The rest is unchanged: this means that contrary to the plan it's also possible to edit the visible history on a per-entity basis in timeseries space views as well.
  • Closes Allow to set a sliding window for time series plots (aka support the Visible History feature) #2547

Follow-up TODO (before 0.11)

Known limitations

TODO

  • freeze the plot display bounds while the time cursor is dragged
  • setting must be serialised to blueprint
Export-1699438955049.mp4

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested demo.rerun.io (if applicable)
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG

@abey79 abey79 added ui concerns graphical user interface include in changelog labels Nov 8, 2023
@nikolausWest
Copy link
Member

nikolausWest commented Nov 9, 2023

I don't really get why we would have a toggle for "Visual History". Shouldn't we just pre-fill the options that correspond to the default behavior for all the views? Then we can just make it editable for the views / data that support it.

For instance if we can't support visual history, we would just set the range to 0, 0 and have it not be editable. The time series plots would default to -♾️,+♾️

Fwiw, I think renaming this to something like "Included time range" or "visible time range" would make it more clear but I won't die on that hill.

@nikolausWest
Copy link
Member

I think something like this would be easier to understand:
Frame 6
Frame 5
Frame 4

@abey79
Copy link
Contributor Author

abey79 commented Nov 9, 2023

I don't really get why we would have a toggle for "Visual History".

Two motivations I can think of:

  1. Disabling the feature would be, in general, cumbersome (2x set to "Relative" and enter "0").
  2. Make the cascading behaviour explicit. Now a child will override the parent (group, space view) if its Visible History is enabled (regardless of actual settings). If we remove that, then the cascading logic becomes much less obvious.

@abey79
Copy link
Contributor Author

abey79 commented Nov 9, 2023

I think something like this would be easier to understand

I like the reordering of controls. I'm not sure about merging the concepts of "infinite" with "absolute". "First + 10s" feels less useful than "t = 63s" (assuming the timelines first logged data would be at 53s, which could be accidental).

- keep plot bounds from changing while the time cursor is dragged
- correct min time computation
- don't draw the time cursor out of the plot area
Comment on lines 513 to 514
let positions = build_some_positions2d(3);
let colors = build_some_colors(3);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@teh-cmc I think this doesn't respect your prescription of using only stuff from re_log_types::example_components or re_types_core, but it's done all over the place in this file already 🤷🏻

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mistakes were made in the past, let's not repeat them 🙃

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍🏻

@abey79 abey79 marked this pull request as ready for review November 9, 2023 20:02
@abey79 abey79 requested a review from teh-cmc November 9, 2023 20:15
Copy link
Member

@teh-cmc teh-cmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Played around with it a bit and it works great!

Please remove the use of positions and colors from the store tests before merging.

crates/re_viewer/src/ui/selection_panel.rs Outdated Show resolved Hide resolved
crates/re_space_view_time_series/src/space_view_class.rs Outdated Show resolved Hide resolved
crates/re_space_view_time_series/src/view_part_system.rs Outdated Show resolved Hide resolved
@@ -309,13 +321,13 @@ fn blueprint_ui(
// TODO(emilk): show the values of this specific instance (e.g. point in the point cloud)!
} else {
// splat - the whole entity
let space_view_class_name = *space_view.class_name();
let space_view_class = *space_view.class_name();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why rename here? The previous one was better imo.

Copy link
Contributor Author

@abey79 abey79 Nov 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I went back and forth with these and this one clear got forgotten.

Edit: actually no, space_view_class was used everywhere in this file before, I just made this one consistent. This naming choice (which also wasn't my preferred) wins by 42 to 15 throughout the codebase, so best keep it that way for now imo.

crates/re_viewport/src/space_view.rs Outdated Show resolved Hide resolved
@abey79 abey79 merged commit a4cf644 into main Nov 10, 2023
37 checks passed
@abey79 abey79 deleted the antoine/visible-history-timeseries branch November 10, 2023 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
include in changelog ui concerns graphical user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to set a sliding window for time series plots (aka support the Visible History feature)
3 participants