Move egui_plot to its own repo (#4828)

* Part of https://github.com/emilk/egui/issues/4705

`egui_plot` can now be found at https://github.com/emilk/egui_plot
This commit is contained in:
Emil Ernerfeldt
2024-07-15 18:45:19 +02:00
committed by GitHub
parent 1384410cb4
commit cb9f30482f
36 changed files with 11 additions and 8196 deletions
@@ -248,10 +248,6 @@ impl WidgetGallery {
});
ui.end_row();
ui.add(doc_link_label_with_crate("egui_plot", "Plot", "plot"));
example_plot(ui);
ui.end_row();
ui.hyperlink_to(
"Custom widget:",
super::toggle_switch::url_to_file_source_code(),
@@ -264,25 +260,6 @@ impl WidgetGallery {
}
}
fn example_plot(ui: &mut egui::Ui) -> egui::Response {
use egui_plot::{Line, PlotPoints};
let n = 128;
let line_points: PlotPoints = (0..=n)
.map(|i| {
use std::f64::consts::TAU;
let x = egui::remap(i as f64, 0.0..=n as f64, -TAU..=TAU);
[x, x.sin()]
})
.collect();
let line = Line::new(line_points);
egui_plot::Plot::new("example_plot")
.height(32.0)
.show_axes(false)
.data_aspect(1.0)
.show(ui, |plot_ui| plot_ui.line(line))
.response
}
fn doc_link_label<'a>(title: &'a str, search_term: &'a str) -> impl egui::Widget + 'a {
doc_link_label_with_crate("egui", title, search_term)
}