struct PlotDisplay { circles: Vec, circle_length: usize, } impl PlotDisplay { fn new(circles: Vec, circle_length: usize) -> Self { Self { circles, circle_length, } } } impl eframe::App for PlotDisplay { //TODO: Define axis ranges fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { egui::CentralPanel::default().show(ctx, |ui| { crate::plot(ui, &mut self.circles, &self.circle_length); }); } } pub fn display_plot(circles: Vec) -> Result<(), eframe::Error> { let options = eframe::NativeOptions::default(); eframe::run_native("Encoded Message", options, Box::new(|_cc| Ok(Box::::new( PlotDisplay::new(circles, 1000) )))) }