use eframe::egui;
use siplot::{Plot, PlotView, install};
struct BootstrapApp {
plot: Plot,
}
impl BootstrapApp {
fn new(cc: &eframe::CreationContext<'_>) -> Self {
let render_state = cc
.wgpu_render_state
.as_ref()
.expect("eframe must use the wgpu renderer (NativeOptions.renderer = Wgpu)");
install(render_state);
Self { plot: Plot::new(0) }
}
}
impl eframe::App for BootstrapApp {
fn ui(&mut self, ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
egui::CentralPanel::default().show_inside(ui, |ui| {
PlotView::new().show(ui, &mut self.plot);
});
}
}
fn main() -> eframe::Result {
let options = eframe::NativeOptions {
renderer: eframe::Renderer::Wgpu,
..Default::default()
};
eframe::run_native(
"siplot ยท bootstrap",
options,
Box::new(|cc| Ok(Box::new(BootstrapApp::new(cc)) as Box<dyn eframe::App>)),
)
}