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
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4858,7 +4858,6 @@ dependencies = [
"re_log",
"re_log_types",
"re_space_view",
"re_space_view_dataframe",
"re_space_view_spatial",
"re_space_view_time_series",
"re_tracing",
Expand Down Expand Up @@ -5154,6 +5153,7 @@ dependencies = [
"re_build_tools",
"re_format",
"re_log",
"re_log_types",
"re_tracing",
"re_types_builder",
"re_types_core",
Expand Down
1 change: 1 addition & 0 deletions crates/store/re_types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ testing = []
# Rerun
re_format.workspace = true
re_log.workspace = true
re_log_types.workspace = true
re_tracing.workspace = true
re_types_core.workspace = true

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


// Rationale behind the present data modelling:
// - Avoid using `union` at all cost.
// - An explicit "mode" enum maps well with a UI toggle and API parameter, and enabled a hard disambiguation when
// settings are present for both the latest at and range modes.
// - Timestamps are hard-invalidated by a change of timeline. So we keep them on a per-timeline basis.

// TODO(#7067): add visible components (maybe in another archetype?)
// TODO(#7072): add (optional) PoV components
// Note: component list should be modelled as:
// component PovComponents {
// datatype ComponentNames {
// value: [string];
// }
// }
//
// Motivation:
// - Chances are high that the user prefers to have their pov components _not_ invalidated by a changeof timeline.
// - That is even though a component might _technically_ be soft-invalidated by a change of timeline (e.g. if it was
// not logged on that particular timeline). But we have to deal regardless with potentially invalid component, so this
// doesn't change the story much.

// --

/// The query for the dataframe view.
table DataframeQuery (
"attr.rerun.scope": "blueprint",
"attr.rust.generate_field_info"
) {
// --- Optional ---

/// The timeline for this query.
///
/// If unset, use the time panel's timeline and a latest at query, ignoring all other components of this archetype.
timeline: rerun.blueprint.components.Timeline ("attr.rerun.component_optional", nullable, order: 100);

/// Type of query: latest at or range
abey79 marked this conversation as resolved.
Show resolved Hide resolved
mode: rerun.blueprint.components.QueryKind ("attr.rerun.component_optional", nullable,order: 200);
abey79 marked this conversation as resolved.
Show resolved Hide resolved

/// Configuration for latest at queries.attribute
abey79 marked this conversation as resolved.
Show resolved Hide resolved
///
/// Note: configuration as saved on a per-timeline basis.
latest_at_queries: rerun.blueprint.components.LatestAtQueries ("attr.rerun.component_optional", nullable,order: 400);

/// Configuration for the time range queries.
///
/// Note: configuration as saved on a per-timeline basis.
time_range_queries: rerun.blueprint.components.TimeRangeQueries ("attr.rerun.component_optional", nullable,order: 500);
}

This file was deleted.

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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

namespace rerun.blueprint.components;

/// Configuration for latest at queries.
///
/// Note: configuration as saved on a per-timeline basis.
table LatestAtQueries (
"attr.arrow.transparent",
"attr.rust.derive": "Default, PartialEq, Eq",
"attr.rust.repr": "transparent",
"attr.rerun.scope": "blueprint"
) {
queries: [rerun.blueprint.datatypes.LatestAtQuery] (order: 100);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace rerun.blueprint.components;


/// The kind of query displayed by the dataframe view
enum QueryKind: ubyte (
"attr.rerun.scope": "blueprint"
) {
/// Invalid value. Won't show up in generated types.
Invalid = 0,

/// Query
LatestAt (default),

/// Time range query.
TimeRange,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

namespace rerun.blueprint.components;

/// Configuration for time range queries.
///
/// Note: configuration as saved on a per-timeline basis.
table TimeRangeQueries (
"attr.arrow.transparent",
"attr.rust.derive": "Default, PartialEq, Eq",
"attr.rust.repr": "transparent",
"attr.rerun.scope": "blueprint"
) {
queries: [rerun.blueprint.datatypes.TimeRangeQuery] (order: 100);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

namespace rerun.blueprint.components;

/// A timeline, identified by its name.
table Timeline (
abey79 marked this conversation as resolved.
Show resolved Hide resolved
"attr.arrow.transparent",
"attr.python.aliases": "str",
"attr.python.array_aliases": "str, Sequence[str]",
"attr.rust.derive": "Default, PartialEq, Eq, PartialOrd, Ord",
abey79 marked this conversation as resolved.
Show resolved Hide resolved
"attr.rust.repr": "transparent",
"attr.rerun.scope": "blueprint"
) {
value: rerun.datatypes.Utf8 (order: 100);
}

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


/// Latest at query configuration for a specific timeline.
// Has to be a table because flatbuffer doesn't support strings in structs.
table LatestAtQuery (
"attr.rust.derive": "PartialEq, Eq",
"attr.rerun.scope": "blueprint"
) {
/// Name of the timeline this applies to.
timeline: rerun.datatypes.Utf8 (order: 100);

/// Time value to use for this query.
time: rerun.datatypes.TimeInt (order: 200);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace rerun.blueprint.datatypes;


/// Time range query configuration for a specific timeline.
// Has to be a table because flatbuffer doesn't support strings in structs.
table TimeRangeQuery (
"attr.rust.derive": "PartialEq, Eq",
"attr.rerun.scope": "blueprint"
) {
/// Name of the timeline this applies to.
timeline: rerun.datatypes.Utf8 (order: 100);

/// Beginning of the time range.
start: rerun.datatypes.TimeInt (order: 200);

/// End of the time range.
abey79 marked this conversation as resolved.
Show resolved Hide resolved
end: rerun.datatypes.TimeInt (order: 300);
}

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

Loading
Loading