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

Update the dataframe view to use re_dataframe and egui_table #7380

Merged
merged 53 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
d2c51ab
WIP
abey79 Sep 4, 2024
78d06c9
Now latest at is also using dataframe (but is broken)
abey79 Sep 5, 2024
1a53b69
Remove dead code
abey79 Sep 5, 2024
eaf114b
Remove `max_scroll_height(f32::INFINITY)`
emilk Sep 5, 2024
d8a1b60
Fix typos
emilk Sep 5, 2024
7372f9d
Start using egui_table
emilk Sep 5, 2024
a8940c8
Handle multiple arrow types for component columns + some more clean-up
abey79 Sep 5, 2024
5fdf38a
Merge branch 'refs/heads/main' into antoine/use-re-dataframe
abey79 Sep 5, 2024
7ff2ed1
Make DisplayRecordBatch owned and add pagination
abey79 Sep 5, 2024
531a963
Merge branch 'refs/heads/main' into antoine/use-re-dataframe
abey79 Sep 5, 2024
67b9f43
remove dbg!
abey79 Sep 5, 2024
517ee61
remove moar dbg!
abey79 Sep 5, 2024
5d0977f
fix some warnings
abey79 Sep 5, 2024
edf6284
Update egui_tables
emilk Sep 5, 2024
49c3eea
minor clean up
abey79 Sep 6, 2024
3998b6e
Restore egui style when resetting viewer
emilk Sep 6, 2024
f39c74a
Better auto-sizing of table contents and other data uis
emilk Sep 6, 2024
08ad900
Update egui_table
emilk Sep 6, 2024
4399953
wip hierarchical header
abey79 Sep 6, 2024
dda52ed
Update egui_table with fix for row prefetching
emilk Sep 6, 2024
796c2f8
Update egui_table with another off-by-one fix
emilk Sep 6, 2024
2b84d1b
simplified schema wrapping management
teh-cmc Sep 6, 2024
a5c3b0d
Update egui with line-break fixes
emilk Sep 6, 2024
b8623ed
Defensive programming against prefetch bug in egui_table
emilk Sep 6, 2024
2b7b023
lints
teh-cmc Sep 6, 2024
cdb6ee3
Merge branch 'main' into antoine/use-re-dataframe
abey79 Sep 9, 2024
293935e
Merge branch 'main' into antoine/use-re-dataframe
abey79 Sep 9, 2024
5807b4f
code cleanup
abey79 Sep 9, 2024
44eb18b
Update egui_table
emilk Sep 9, 2024
8bfdb25
future truth: adapt for re_dataframe using EntityPathFilter
abey79 Sep 9, 2024
1b0259d
Merge branch 'main' into antoine/use-re-dataframe
abey79 Sep 9, 2024
5ae68b1
Minor cleanup
abey79 Sep 9, 2024
8b5a82d
Compute proper latest-at query for data_ui + fix warnings
abey79 Sep 9, 2024
e0be7c5
add docstring
abey79 Sep 9, 2024
5c468a9
toml fmt
abey79 Sep 10, 2024
183915a
fix web build
abey79 Sep 10, 2024
0a8630d
change should propagate event to false (seems to be the default)
abey79 Sep 10, 2024
bbff7dc
Merge branch 'main' into antoine/use-re-dataframe
abey79 Sep 10, 2024
9bffb2c
switch dictionary array to i32, as per #7383
abey79 Sep 10, 2024
dd4f33e
Use `..Default::default` in `WebOptions`
emilk Sep 10, 2024
91794eb
`struct BatchRef` for better self-documentation
emilk Sep 10, 2024
f09736f
Call it `query_time_column_index` for clarity
emilk Sep 10, 2024
e95bc6b
"Latest at" -> "Latest-at"
emilk Sep 10, 2024
cb5fb32
Use DesignTokens::table_header_height
emilk Sep 10, 2024
2af5395
export arrow2 from re_chunk_store
abey79 Sep 10, 2024
fd10862
show timestamp and increment on row id's tooltip
abey79 Sep 10, 2024
b627ef4
add debug assert on `get` with latest-at
abey79 Sep 10, 2024
dcb92a8
dont hard-code rowid component name
abey79 Sep 10, 2024
50f27cd
fix anyhow context use
abey79 Sep 10, 2024
f532948
more debug assert against egui_table
abey79 Sep 10, 2024
b325e7a
fight some right drift
abey79 Sep 10, 2024
a32cd87
clarify index argument
abey79 Sep 10, 2024
190f43b
improve `expect` reason strings
abey79 Sep 10, 2024
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
39 changes: 27 additions & 12 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,7 @@ checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30"
[[package]]
name = "ecolor"
version = "0.28.1"
source = "git+https://github.com/emilk/egui.git?rev=454abf705b87aba70cef582d6ce80f74aa398906#454abf705b87aba70cef582d6ce80f74aa398906"
source = "git+https://github.com/emilk/egui.git?rev=6b7f4312373a301a4cdf7d99a0d546acd34bcd66#6b7f4312373a301a4cdf7d99a0d546acd34bcd66"
dependencies = [
"bytemuck",
"emath",
Expand All @@ -1787,7 +1787,7 @@ dependencies = [
[[package]]
name = "eframe"
version = "0.28.1"
source = "git+https://github.com/emilk/egui.git?rev=454abf705b87aba70cef582d6ce80f74aa398906#454abf705b87aba70cef582d6ce80f74aa398906"
source = "git+https://github.com/emilk/egui.git?rev=6b7f4312373a301a4cdf7d99a0d546acd34bcd66#6b7f4312373a301a4cdf7d99a0d546acd34bcd66"
dependencies = [
"ahash",
"bytemuck",
Expand Down Expand Up @@ -1824,7 +1824,7 @@ dependencies = [
[[package]]
name = "egui"
version = "0.28.1"
source = "git+https://github.com/emilk/egui.git?rev=454abf705b87aba70cef582d6ce80f74aa398906#454abf705b87aba70cef582d6ce80f74aa398906"
source = "git+https://github.com/emilk/egui.git?rev=6b7f4312373a301a4cdf7d99a0d546acd34bcd66#6b7f4312373a301a4cdf7d99a0d546acd34bcd66"
dependencies = [
"accesskit",
"ahash",
Expand All @@ -1841,7 +1841,7 @@ dependencies = [
[[package]]
name = "egui-wgpu"
version = "0.28.1"
source = "git+https://github.com/emilk/egui.git?rev=454abf705b87aba70cef582d6ce80f74aa398906#454abf705b87aba70cef582d6ce80f74aa398906"
source = "git+https://github.com/emilk/egui.git?rev=6b7f4312373a301a4cdf7d99a0d546acd34bcd66#6b7f4312373a301a4cdf7d99a0d546acd34bcd66"
dependencies = [
"ahash",
"bytemuck",
Expand All @@ -1860,7 +1860,7 @@ dependencies = [
[[package]]
name = "egui-winit"
version = "0.28.1"
source = "git+https://github.com/emilk/egui.git?rev=454abf705b87aba70cef582d6ce80f74aa398906#454abf705b87aba70cef582d6ce80f74aa398906"
source = "git+https://github.com/emilk/egui.git?rev=6b7f4312373a301a4cdf7d99a0d546acd34bcd66#6b7f4312373a301a4cdf7d99a0d546acd34bcd66"
dependencies = [
"accesskit_winit",
"ahash",
Expand Down Expand Up @@ -1902,7 +1902,7 @@ dependencies = [
[[package]]
name = "egui_extras"
version = "0.28.1"
source = "git+https://github.com/emilk/egui.git?rev=454abf705b87aba70cef582d6ce80f74aa398906#454abf705b87aba70cef582d6ce80f74aa398906"
source = "git+https://github.com/emilk/egui.git?rev=6b7f4312373a301a4cdf7d99a0d546acd34bcd66#6b7f4312373a301a4cdf7d99a0d546acd34bcd66"
dependencies = [
"ahash",
"egui",
Expand All @@ -1918,7 +1918,7 @@ dependencies = [
[[package]]
name = "egui_glow"
version = "0.28.1"
source = "git+https://github.com/emilk/egui.git?rev=454abf705b87aba70cef582d6ce80f74aa398906#454abf705b87aba70cef582d6ce80f74aa398906"
source = "git+https://github.com/emilk/egui.git?rev=6b7f4312373a301a4cdf7d99a0d546acd34bcd66#6b7f4312373a301a4cdf7d99a0d546acd34bcd66"
dependencies = [
"ahash",
"bytemuck",
Expand All @@ -1944,6 +1944,16 @@ dependencies = [
"emath",
]

[[package]]
name = "egui_table"
version = "0.28.1"
source = "git+https://github.com/rerun-io/egui_table.git?rev=0f594701d528c4a9553521cb941de1886549dc70#0f594701d528c4a9553521cb941de1886549dc70"
dependencies = [
"egui",
"serde",
"vec1",
]

[[package]]
name = "egui_tiles"
version = "0.9.1"
Expand Down Expand Up @@ -1981,7 +1991,7 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
[[package]]
name = "emath"
version = "0.28.1"
source = "git+https://github.com/emilk/egui.git?rev=454abf705b87aba70cef582d6ce80f74aa398906#454abf705b87aba70cef582d6ce80f74aa398906"
source = "git+https://github.com/emilk/egui.git?rev=6b7f4312373a301a4cdf7d99a0d546acd34bcd66#6b7f4312373a301a4cdf7d99a0d546acd34bcd66"
dependencies = [
"bytemuck",
"serde",
Expand Down Expand Up @@ -2082,7 +2092,7 @@ dependencies = [
[[package]]
name = "epaint"
version = "0.28.1"
source = "git+https://github.com/emilk/egui.git?rev=454abf705b87aba70cef582d6ce80f74aa398906#454abf705b87aba70cef582d6ce80f74aa398906"
source = "git+https://github.com/emilk/egui.git?rev=6b7f4312373a301a4cdf7d99a0d546acd34bcd66#6b7f4312373a301a4cdf7d99a0d546acd34bcd66"
dependencies = [
"ab_glyph",
"ahash",
Expand All @@ -2101,7 +2111,7 @@ dependencies = [
[[package]]
name = "epaint_default_fonts"
version = "0.28.1"
source = "git+https://github.com/emilk/egui.git?rev=454abf705b87aba70cef582d6ce80f74aa398906#454abf705b87aba70cef582d6ce80f74aa398906"
source = "git+https://github.com/emilk/egui.git?rev=6b7f4312373a301a4cdf7d99a0d546acd34bcd66#6b7f4312373a301a4cdf7d99a0d546acd34bcd66"

[[package]]
name = "equivalent"
Expand Down Expand Up @@ -5047,6 +5057,7 @@ dependencies = [
"re_build_info",
"re_chunk",
"re_chunk_store",
"re_dataframe",
"re_format",
"re_int_histogram",
"re_log",
Expand Down Expand Up @@ -5448,11 +5459,14 @@ dependencies = [
name = "re_space_view_dataframe"
version = "0.19.0-alpha.1+dev"
dependencies = [
"anyhow",
"egui",
"egui_extras",
"egui_table",
"itertools 0.13.0",
"re_chunk_store",
"re_data_ui",
"re_dataframe",
"re_entity_db",
"re_log",
"re_log_types",
Expand All @@ -5464,6 +5478,7 @@ dependencies = [
"re_ui",
"re_viewer_context",
"re_viewport_blueprint",
"thiserror",
]

[[package]]
Expand Down Expand Up @@ -7488,9 +7503,9 @@ dependencies = [

[[package]]
name = "vec1"
version = "1.10.1"
version = "1.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bda7c41ca331fe9a1c278a9e7ee055f4be7f5eb1c2b72f079b4ff8b5fce9d5c"
checksum = "eab68b56840f69efb0fefbe3ab6661499217ffdc58e2eef7c3f6f69835386322"
dependencies = [
"smallvec",
]
Expand Down
13 changes: 7 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ re_chunk = { path = "crates/store/re_chunk", version = "=0.19.0-alpha.1", defaul
re_chunk_store = { path = "crates/store/re_chunk_store", version = "=0.19.0-alpha.1", default-features = false }
re_data_loader = { path = "crates/store/re_data_loader", version = "=0.19.0-alpha.1", default-features = false }
re_data_source = { path = "crates/store/re_data_source", version = "=0.19.0-alpha.1", default-features = false }
re_dataframe = { path = "crates/store/re_dataframe", version = "=0.19.0-alpha.1", default-features = false }
re_entity_db = { path = "crates/store/re_entity_db", version = "=0.19.0-alpha.1", default-features = false }
re_format_arrow = { path = "crates/store/re_format_arrow", version = "=0.19.0-alpha.1", default-features = false }
re_log_encoding = { path = "crates/store/re_log_encoding", version = "=0.19.0-alpha.1", default-features = false }
Expand Down Expand Up @@ -513,12 +514,12 @@ missing_errors_doc = "allow"
# As a last resport, patch with a commit to our own repository.
# ALWAYS document what PR the commit hash is part of, or when it was merged into the upstream trunk.

ecolor = { git = "https://github.com/emilk/egui.git", rev = "454abf705b87aba70cef582d6ce80f74aa398906" } # egui master 2024-09-03
eframe = { git = "https://github.com/emilk/egui.git", rev = "454abf705b87aba70cef582d6ce80f74aa398906" } # egui master 2024-09-03
egui = { git = "https://github.com/emilk/egui.git", rev = "454abf705b87aba70cef582d6ce80f74aa398906" } # egui master 2024-09-03
egui_extras = { git = "https://github.com/emilk/egui.git", rev = "454abf705b87aba70cef582d6ce80f74aa398906" } # egui master 2024-09-03
egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "454abf705b87aba70cef582d6ce80f74aa398906" } # egui master 2024-09-03
emath = { git = "https://github.com/emilk/egui.git", rev = "454abf705b87aba70cef582d6ce80f74aa398906" } # egui master 2024-09-03
ecolor = { git = "https://github.com/emilk/egui.git", rev = "6b7f4312373a301a4cdf7d99a0d546acd34bcd66" } # egui master 2024-09-06
eframe = { git = "https://github.com/emilk/egui.git", rev = "6b7f4312373a301a4cdf7d99a0d546acd34bcd66" } # egui master 2024-09-06
egui = { git = "https://github.com/emilk/egui.git", rev = "6b7f4312373a301a4cdf7d99a0d546acd34bcd66" } # egui master 2024-09-06
egui_extras = { git = "https://github.com/emilk/egui.git", rev = "6b7f4312373a301a4cdf7d99a0d546acd34bcd66" } # egui master 2024-09-06
egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "6b7f4312373a301a4cdf7d99a0d546acd34bcd66" } # egui master 2024-09-06
emath = { git = "https://github.com/emilk/egui.git", rev = "6b7f4312373a301a4cdf7d99a0d546acd34bcd66" } # egui master 2024-09-06

# Useful while developing:
# ecolor = { path = "../../egui/crates/ecolor" }
Expand Down
9 changes: 9 additions & 0 deletions crates/store/re_chunk/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,15 @@ impl TransportChunk {
})
}

#[inline]
pub fn all_columns(&self) -> impl Iterator<Item = (&ArrowField, &Box<dyn ArrowArray>)> + '_ {
self.schema
.fields
.iter()
.enumerate()
.filter_map(|(i, field)| self.data.columns().get(i).map(|column| (field, column)))
}

/// Iterates all control columns present in this chunk.
#[inline]
pub fn controls(&self) -> impl Iterator<Item = (&ArrowField, &Box<dyn ArrowArray>)> {
Expand Down
9 changes: 9 additions & 0 deletions crates/store/re_chunk_store/src/dataframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ impl ColumnDescriptor {
Self::Component(descr) => descr.to_arrow_field(),
}
}

#[inline]
pub fn short_name(&self) -> String {
match self {
Self::Control(descr) => descr.component_name.short_name().to_owned(),
Self::Time(descr) => descr.timeline.name().to_string(),
Self::Component(descr) => descr.component_name.short_name().to_owned(),
}
}
}

/// Describes a column used to control Rerun's behavior, such as `RowId`.
Expand Down
5 changes: 5 additions & 0 deletions crates/store/re_dataframe/src/latest_at.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ impl<'a> LatestAtQueryHandle<'a> {
}

impl LatestAtQueryHandle<'_> {
/// The query expression used to instantiate this handle.
pub fn query(&self) -> &LatestAtQueryExpression {
&self.query
}

/// All results returned by this handle will strictly follow this schema.
///
/// Columns that do not yield any data will still be present in the results, filled with null values.
Expand Down
5 changes: 5 additions & 0 deletions crates/store/re_dataframe/src/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ impl RangeQueryHandle<'_> {
})
}

/// The query used to instantiate this handle.
pub fn query(&self) -> &RangeQueryExpression {
&self.query
}

/// All results returned by this handle will strictly follow this schema.
///
/// Columns that do not yield any data will still be present in the results, filled with null values.
Expand Down
1 change: 1 addition & 0 deletions crates/store/re_entity_db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ serde = ["dep:serde", "re_log_types/serde"]
re_build_info.workspace = true
re_chunk = { workspace = true, features = ["serde"] }
re_chunk_store.workspace = true
re_dataframe.workspace = true
re_format.workspace = true
re_int_histogram.workspace = true
re_log.workspace = true
Expand Down
7 changes: 7 additions & 0 deletions crates/store/re_entity_db/src/entity_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ impl EntityDb {
&self.query_caches
}

pub fn query_engine(&self) -> re_dataframe::QueryEngine<'_> {
re_dataframe::QueryEngine {
store: self.store(),
cache: self.query_caches(),
}
}

/// Queries for the given `component_names` using latest-at semantics.
///
/// See [`re_query::LatestAtResults`] for more information about how to handle the results.
Expand Down
2 changes: 0 additions & 2 deletions crates/viewer/re_chunk_store_ui/src/chunk_store_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,6 @@ impl DatastoreUi {
)
.resizable(true)
.vscroll(true)
//TODO(ab): remove when https://github.com/emilk/egui/pull/4817 is merged/released
.max_scroll_height(f32::INFINITY)
.auto_shrink([false, false])
.striped(true);

Expand Down
2 changes: 0 additions & 2 deletions crates/viewer/re_chunk_store_ui/src/chunk_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ impl ChunkUi {
)
.resizable(true)
.vscroll(true)
//TODO(ab): remove when https://github.com/emilk/egui/pull/4817 is merged/released
.max_scroll_height(f32::INFINITY)
.auto_shrink([false, false])
.striped(true);

Expand Down
4 changes: 4 additions & 0 deletions crates/viewer/re_space_view_dataframe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ all-features = true
[dependencies]
re_chunk_store.workspace = true
re_data_ui.workspace = true
re_dataframe.workspace = true
re_entity_db.workspace = true
re_log.workspace = true
re_log_types.workspace = true
Expand All @@ -33,6 +34,9 @@ re_ui.workspace = true
re_viewer_context.workspace = true
re_viewport_blueprint.workspace = true

anyhow.workspace = true
egui_extras.workspace = true
egui_table = { git = "https://github.com/rerun-io/egui_table.git", rev = "0f594701d528c4a9553521cb941de1886549dc70" } # main as of 2024-09-09
egui.workspace = true
itertools.workspace = true
thiserror.workspace = true
Loading
Loading