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

Query editor for the dataframe view #7071

Merged
merged 22 commits into from
Aug 9, 2024

Conversation

abey79
Copy link
Member

@abey79 abey79 commented Aug 6, 2024

What

This PR introduce a new blueprint archetype and related bespoke UI to configure the query underlying a dataframe view. As a consequence of this new scheme, Visible Time Range is no longer shown in dataframe view selection panel.

image

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 the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!
  • If have noted any breaking changes to the log API in CHANGELOG.md and the migration guide

To run all checks from main, comment on the PR with @rerun-bot full-check.

@abey79 abey79 force-pushed the antoine/dataframe-query-property-and-ui branch 2 times, most recently from 2ae9325 to 17e321c Compare August 7, 2024 12:30
@abey79 abey79 force-pushed the antoine/dataframe-query-property-and-ui branch from 17e321c to c9fd2d3 Compare August 7, 2024 13:12
Comment on lines +5 to +12
impl Default for LatestAtQuery {
fn default() -> Self {
Self {
timeline: Utf8::from("log_time"),
time: TimeInt::MAX,
}
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This default is neither useful, nor very robust (hardcoded timeline name), but required for reflection to work.

Comment on lines +4 to +12
impl Default for TimeRangeQuery {
fn default() -> Self {
Self {
timeline: Utf8::from("log_time"),
start: TimeInt::MIN,
end: TimeInt::MAX,
}
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Again, unfortunate Default to be having.

Comment on lines +135 to +139
else {
re_log::warn_once!("Could not find timeline {:?}.", timeline_name.as_str());
//TODO(ab): we should have an error for that
return Ok(());
};
Copy link
Member Author

Choose a reason for hiding this comment

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

The SpaceViewSystemExecutionError return type is a bit rigid for the various error situation one might encounter.

Copy link
Member

Choose a reason for hiding this comment

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

We can add a SpaceViewSystemExecutionError::Custom maybe?

Comment on lines +49 to +50
// The presence (or not) of the timeline component determines if the view should follow the
// time panel timeline/latest at query, or override it.
Copy link
Member Author

Choose a reason for hiding this comment

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

How bad is that going to bite me when doing the blueprint api?

Comment on lines +1 to +17
from __future__ import annotations

from ... import datatypes


class LatestAtQueryExt:
"""Extension for [LatestAtQuery][rerun.blueprint.datatypes.LatestAtQuery]."""

# This override is required because otherwise the codegen uses `TimeInt(x)`, which is not valid with the custom
# `TimeInt.__init__` override.

@staticmethod
def time__field_converter_override(x: datatypes.TimeIntLike) -> datatypes.TimeInt:
if isinstance(x, datatypes.TimeInt):
return x
else:
return datatypes.TimeInt(seq=x)
Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks a ton to mypy because I wasn't gonna catch this one by myself 😅

@abey79 abey79 added ui concerns graphical user interface enhancement New feature or request include in changelog labels Aug 7, 2024
@abey79 abey79 marked this pull request as ready for review August 7, 2024 15:40
@abey79 abey79 requested review from Wumpf and gavrelina August 7, 2024 15:49
…and-ui

# Conflicts:
#	crates/store/re_types/definitions/rerun/blueprint/components/dataframe_view_mode.fbs
#	rerun_cpp/src/rerun/blueprint/archetypes/dataframe_view_mode.cpp
#	rerun_cpp/src/rerun/blueprint/archetypes/dataframe_view_mode.hpp
@emilk emilk self-requested a review August 9, 2024 07:22
Comment on lines +135 to +139
else {
re_log::warn_once!("Could not find timeline {:?}.", timeline_name.as_str());
//TODO(ab): we should have an error for that
return Ok(());
};
Copy link
Member

Choose a reason for hiding this comment

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

We can add a SpaceViewSystemExecutionError::Custom maybe?

@gavrelina
Copy link
Member

Have a few comments about this, however they may not belong to this particular issue. I leave that up to you!

  1. When segment select is 'Follow timeline' we shall also display what is the value of following that timeline, like what is the timeline and what is the latest at. This educates users on how this control works and creates a connection with through the familiar pattern. Also nicer because if users want to see what is the time value they don't need to gaze all the way down to the timeline. See the little video:
follow.override.mov
  1. some spacing in the list. so the inline spacing subconsciously gives us signals what belongs to what, right? (like whatever is closer to each other = related and vice versa). So see how in the screenshot the space C is much bigger than B or A. This gives an idea that selector is related only to 'view property' and a bit to the 'timeline', but 'showing' is kinda it's own thing. while actually 'showing' and 'timeline' are an entity that should be closer and then they are related to the segment, which is also related to the 'view property' with other things in the panel.
Screenshot 2024-08-09 at 10 02 24

My guess this could be a part of this issue: #6708

@abey79
Copy link
Member Author

abey79 commented Aug 9, 2024

@gavrelina

For (1), I tried and it somehow gets super ugly with the order/sort UI next to it. I will postpone to when we deal with that (we'll have to discuss the exact UI at that point anyways):

I've made some adjustment for (2).

@abey79 abey79 merged commit 27cb69f into main Aug 9, 2024
40 checks passed
@abey79 abey79 deleted the antoine/dataframe-query-property-and-ui branch August 9, 2024 15:19
abey79 added a commit that referenced this pull request Aug 11, 2024
Conflict between #7071 and #7128
@abey79 abey79 mentioned this pull request Aug 11, 2024
6 tasks
abey79 added a commit that referenced this pull request Aug 11, 2024
### What

Main broken by #7128, which missed an updated to code recently
introduced (#7071)

### 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/7139?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/7139?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/7139)
- [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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request include in changelog ui concerns graphical user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dataframe view: query view property editor
3 participants