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 rerun reset command #3145

Merged
merged 9 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
38 changes: 25 additions & 13 deletions Cargo.lock

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

17 changes: 9 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ eframe = { version = "0.22.0", default-features = false, features = [
] }
egui = { version = "0.22.0", features = ["extra_debug_asserts", "log"] }
egui_extras = { version = "0.22.0", features = ["log"] }
egui_plot = { git = "https://github.com/emilk/egui", rev = "70bfc7e09f1b1f794a77064b62a4932f9e60ef15" }
egui_tiles = { version = "0.2" }
egui-wgpu = "0.22.0"
emath = "0.22.0"
Expand Down Expand Up @@ -158,14 +159,14 @@ debug = true
# ALWAYS document what PR the commit hash is part of, or when it was merged into the upstream trunk.

# Temporary patch until next egui release
ecolor = { git = "https://github.com/emilk/egui", rev = "f0addc339cd753f724253f37b37af6db1a84178b" }
eframe = { git = "https://github.com/emilk/egui", rev = "f0addc339cd753f724253f37b37af6db1a84178b" }
egui-wgpu = { git = "https://github.com/emilk/egui", rev = "f0addc339cd753f724253f37b37af6db1a84178b" }
egui-winit = { git = "https://github.com/emilk/egui", rev = "f0addc339cd753f724253f37b37af6db1a84178b" }
egui = { git = "https://github.com/emilk/egui", rev = "f0addc339cd753f724253f37b37af6db1a84178b" }
egui_extras = { git = "https://github.com/emilk/egui", rev = "f0addc339cd753f724253f37b37af6db1a84178b" }
emath = { git = "https://github.com/emilk/egui", rev = "f0addc339cd753f724253f37b37af6db1a84178b" }
epaint = { git = "https://github.com/emilk/egui", rev = "f0addc339cd753f724253f37b37af6db1a84178b" }
ecolor = { git = "https://github.com/emilk/egui", rev = "70bfc7e09f1b1f794a77064b62a4932f9e60ef15" }
eframe = { git = "https://github.com/emilk/egui", rev = "70bfc7e09f1b1f794a77064b62a4932f9e60ef15" }
egui-wgpu = { git = "https://github.com/emilk/egui", rev = "70bfc7e09f1b1f794a77064b62a4932f9e60ef15" }
egui-winit = { git = "https://github.com/emilk/egui", rev = "70bfc7e09f1b1f794a77064b62a4932f9e60ef15" }
egui = { git = "https://github.com/emilk/egui", rev = "70bfc7e09f1b1f794a77064b62a4932f9e60ef15" }
egui_extras = { git = "https://github.com/emilk/egui", rev = "70bfc7e09f1b1f794a77064b62a4932f9e60ef15" }
emath = { git = "https://github.com/emilk/egui", rev = "70bfc7e09f1b1f794a77064b62a4932f9e60ef15" }
epaint = { git = "https://github.com/emilk/egui", rev = "70bfc7e09f1b1f794a77064b62a4932f9e60ef15" }

# Temporary patch until next egui_tiles release
egui_tiles = { git = "https://github.com/rerun-io/egui_tiles", rev = "f835c4df1cc260a58122a8d37c7c3738902b9643" }
1 change: 1 addition & 0 deletions crates/re_data_ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ ahash.workspace = true
anyhow.workspace = true
bytemuck.workspace = true
egui_extras.workspace = true
egui_plot.workspace = true
egui.workspace = true
image.workspace = true
itertools.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/re_data_ui/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ fn rgb8_histogram_ui(ui: &mut egui::Ui, rgb: &[u8]) -> egui::Response {
}
}

use egui::plot::{Bar, BarChart, Legend, Plot};
use egui_plot::{Bar, BarChart, Legend, Plot};

let names = ["R", "G", "B"];
let colors = [Color32::RED, Color32::GREEN, Color32::BLUE];
Expand Down
1 change: 1 addition & 0 deletions crates/re_space_view_bar_chart/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ re_types.workspace = true
re_ui.workspace = true
re_viewer_context.workspace = true

egui_plot.workspace = true
egui.workspace = true
vec1.workspace = true
4 changes: 2 additions & 2 deletions crates/re_space_view_bar_chart/src/space_view_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl SpaceViewClass for BarChartSpaceView {
_query: &ViewQuery<'_>,
_draw_data: Vec<re_renderer::QueueableDrawData>,
) -> Result<(), SpaceViewSystemExecutionError> {
use egui::plot::{Bar, BarChart, Legend, Plot};
use egui_plot::{Bar, BarChart, Legend, Plot};

let charts = &parts.get::<BarChartViewPartSystem>()?.charts;

Expand All @@ -94,7 +94,7 @@ impl SpaceViewClass for BarChartSpaceView {
Plot::new("bar_chart_plot")
.legend(Legend::default())
.clamp_grid(true)
.allow_zoom(egui::plot::AxisBools {
.allow_zoom(egui_plot::AxisBools {
x: true,
y: zoom_both_axis,
})
Expand Down
1 change: 1 addition & 0 deletions crates/re_space_view_time_series/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ re_viewer_context.workspace = true
re_query.workspace = true
re_format.workspace = true

egui_plot.workspace = true
egui.workspace = true
vec1.workspace = true
14 changes: 7 additions & 7 deletions crates/re_space_view_time_series/src/space_view_class.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use egui::plot::{Legend, Line, Plot, Points};
use egui_plot::{Legend, Line, Plot, Points};

use re_arrow_store::TimeType;
use re_format::next_grid_tick_magnitude_ns;
Expand Down Expand Up @@ -125,12 +125,12 @@ impl SpaceViewClass for TimeSeriesSpaceView {
let zoom_both_axis = !ui.input(|i| i.modifiers.contains(controls::ASPECT_SCROLL_MODIFIER));

let mut plot = Plot::new(plot_id_src)
.allow_zoom(egui::plot::AxisBools {
.allow_zoom(egui_plot::AxisBools {
x: true,
y: zoom_both_axis,
})
.legend(Legend {
position: egui::plot::Corner::RightBottom,
position: egui_plot::Corner::RightBottom,
..Default::default()
})
.x_axis_formatter(move |time, _, _| format_time(time_type, time as i64 + time_offset))
Expand All @@ -151,7 +151,7 @@ impl SpaceViewClass for TimeSeriesSpaceView {
plot = plot.x_grid_spacer(move |spacer| ns_grid_spacer(canvas_size, &spacer));
}

let egui::plot::PlotResponse {
let egui_plot::PlotResponse {
inner: time_x,
response,
transform,
Expand Down Expand Up @@ -242,8 +242,8 @@ fn format_time(time_type: TimeType, time_int: i64) -> String {

fn ns_grid_spacer(
canvas_size: egui::Vec2,
input: &egui::plot::GridInput,
) -> Vec<egui::plot::GridMark> {
input: &egui_plot::GridInput,
) -> Vec<egui_plot::GridMark> {
let minimum_medium_line_spacing = 150.0; // ≈min size of a label
let max_medium_lines = canvas_size.x as f64 / minimum_medium_line_spacing;

Expand Down Expand Up @@ -272,7 +272,7 @@ fn ns_grid_spacer(
small_spacing_ns
};

marks.push(egui::plot::GridMark {
marks.push(egui_plot::GridMark {
value: current_ns as f64,
step_size: step_size as f64,
});
Expand Down
3 changes: 2 additions & 1 deletion crates/re_viewer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ eframe = { workspace = true, default-features = false, features = [
"puffin",
"wgpu",
] }
egui.workspace = true
egui_plot.workspace = true
egui-wgpu.workspace = true
egui.workspace = true
image = { workspace = true, default-features = false, features = ["png"] }
itertools = { workspace = true }
once_cell = { workspace = true }
Expand Down
5 changes: 4 additions & 1 deletion crates/re_viewer/src/native.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use re_log_types::LogMsg;

/// Used by `eframe` to decide where to store the app state.
pub const APP_ID: &str = "rerun";

type AppCreator =
Box<dyn FnOnce(&eframe::CreationContext<'_>, re_ui::ReUi) -> Box<dyn eframe::App>>;

Expand All @@ -21,7 +24,7 @@ pub fn run_native_app(app_creator: AppCreator) -> eframe::Result<()> {
pub fn eframe_options() -> eframe::NativeOptions {
eframe::NativeOptions {
// Controls where on disk the app state is persisted.
app_id: Some("rerun_example_rerun".to_owned()),
app_id: Some(APP_ID.to_owned()),

initial_window_size: Some([1600.0, 1200.0].into()),
min_window_size: Some([320.0, 450.0].into()), // Should be high enough to fit the rerun menu
Expand Down
4 changes: 1 addition & 3 deletions crates/re_viewer/src/saving.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ pub fn default_blueprint_path(app_id: &ApplicationId) -> anyhow::Result<std::pat

use anyhow::Context;

// TODO(jleibs) is there a better way to get this folder from egui?
if let Some(proj_dirs) = directories_next::ProjectDirs::from("", "", "rerun") {
let data_dir = proj_dirs.data_dir().join("blueprints");
emilk marked this conversation as resolved.
Show resolved Hide resolved
if let Some(data_dir) = eframe::storage_dir(crate::native::APP_ID) {
std::fs::create_dir_all(&data_dir).context("Could not create blueprint save directory.")?;

// We want a unique filename (not a directory) for each app-id.
Expand Down
12 changes: 6 additions & 6 deletions crates/re_viewer/src/ui/memory_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,36 +370,36 @@ impl MemoryPanel {

use itertools::Itertools as _;

fn to_line(history: &egui::util::History<i64>) -> egui::plot::Line {
egui::plot::Line::new(
fn to_line(history: &egui::util::History<i64>) -> egui_plot::Line {
egui_plot::Line::new(
history
.iter()
.map(|(time, bytes)| [time, bytes as f64])
.collect_vec(),
)
}

egui::plot::Plot::new("mem_history_plot")
egui_plot::Plot::new("mem_history_plot")
.min_size(egui::Vec2::splat(200.0))
.label_formatter(|name, value| format!("{name}: {}", format_bytes(value.y)))
.x_axis_formatter(|time, _, _| format!("{time} s"))
.y_axis_formatter(|bytes, _, _| format_bytes(bytes))
.show_x(false)
.legend(egui::plot::Legend::default().position(egui::plot::Corner::LeftTop))
.legend(egui_plot::Legend::default().position(egui_plot::Corner::LeftTop))
.include_y(0.0)
// TODO(emilk): turn off plot interaction, and always do auto-sizing
.show(ui, |plot_ui| {
if let Some(counted_limit) = limit.limit {
plot_ui.hline(
egui::plot::HLine::new(counted_limit as f64)
egui_plot::HLine::new(counted_limit as f64)
.name("Limit (counted)")
.width(2.0),
);
}

for &time in &self.memory_purge_times {
plot_ui.vline(
egui::plot::VLine::new(time)
egui_plot::VLine::new(time)
.name("RAM purge")
.color(egui::Color32::from_rgb(252, 161, 3))
.width(2.0),
Expand Down
Loading