Skip to content

Commit cacaed9

Browse files
committed
added vline for loss and params plots
1 parent 2b7207b commit cacaed9

4 files changed

Lines changed: 70 additions & 183 deletions

File tree

Cargo.lock

Lines changed: 16 additions & 182 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ use web_time::Instant;
88

99
use eframe::egui;
1010
use egui_plot::{
11-
Legend, Line, Plot, PlotBounds, PlotPoint, PlotPoints, PlotResponse, Points as PlotPointsItem,
11+
Legend, Line, LineStyle, Plot, PlotBounds, PlotPoint, PlotPoints, PlotResponse,
12+
Points as PlotPointsItem, VLine,
1213
};
1314

1415
mod diagnostics;

src/app/tests.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,26 @@ fn replay_upsert_replaces_duplicate_iteration() {
301301
}
302302
}
303303

304+
#[test]
305+
fn replay_selected_iteration_matches_selected_replay_frame() {
306+
let mut app = CurveFitApp::default();
307+
app.upsert_parametric_replay_frame(2, CurveParams::Linear { a: 1.0, b: 0.0 });
308+
app.upsert_parametric_replay_frame(9, CurveParams::Linear { a: 3.0, b: -1.0 });
309+
310+
app.set_replay_selected_index(1);
311+
312+
assert_eq!(app.replay_selected_iteration(), Some(9));
313+
}
314+
315+
#[test]
316+
fn replay_selected_iteration_returns_none_without_selection() {
317+
let mut app = CurveFitApp::default();
318+
app.upsert_parametric_replay_frame(2, CurveParams::Linear { a: 1.0, b: 0.0 });
319+
app.upsert_parametric_replay_frame(9, CurveParams::Linear { a: 3.0, b: -1.0 });
320+
321+
assert_eq!(app.replay_selected_iteration(), None);
322+
}
323+
304324
#[test]
305325
fn replay_start_from_beginning_selects_first_frame_and_enables_autoplay() {
306326
let mut app = CurveFitApp::default();

0 commit comments

Comments
 (0)