implot-rs/implot-examples/examples-shared/src/lib.rs

53 lines
1.7 KiB
Rust
Raw Normal View History

pub mod bar_plots;
pub mod heatmaps;
pub mod line_plots;
pub mod scatter_plots;
2020-11-08 18:41:51 +00:00
pub mod stairs_plots;
mod stem_plots;
pub mod text_plots;
2020-11-22 14:55:48 +00:00
use imgui::{im_str, Condition, Ui, Window};
use implot::PlotUi;
pub fn show_demos(ui: &Ui, plot_ui: &PlotUi) {
2020-11-22 14:55:48 +00:00
Window::new(im_str!("implot-rs demo"))
.size([430.0, 450.0], Condition::FirstUseEver)
.build(ui, || {
ui.text(im_str!("Hello from implot-rs!"));
ui.text_wrapped(im_str!(
"The headers here demo the plotting features of the library.\
Have a look at the example source code to see how they are implemented.\n\
Check out the demo from ImPlot itself first for instructions on how to\
interact with ImPlot plots."
));
ui.separator();
ui.text(im_str!("Bar plots:"));
bar_plots::show_demo_headers(ui, plot_ui);
ui.separator();
ui.text(im_str!("Line plots:"));
line_plots::show_demo_headers(ui, plot_ui);
ui.separator();
ui.text(im_str!("Scatter plots:"));
scatter_plots::show_demo_headers(ui, plot_ui);
ui.separator();
ui.text(im_str!("Text plots:"));
text_plots::show_demo_headers(ui, plot_ui);
ui.separator();
ui.text(im_str!("Stairs plots:"));
stairs_plots::show_demo_headers(ui, plot_ui);
ui.separator();
ui.text(im_str!("Heatmaps:"));
heatmaps::show_demo_headers(ui, plot_ui);
ui.separator();
ui.text(im_str!("Stem plots:"));
stem_plots::show_demo_headers(ui, plot_ui);
2020-11-22 14:55:48 +00:00
});
}