Trait for examples that can be displayed in the demo gallery.
| 2 | |
| 3 | /// Trait for examples that can be displayed in the demo gallery. |
| 4 | pub trait PlotExample { |
| 5 | /// The name of the example. Should match directory name. |
| 6 | fn name(&self) -> &'static str; |
| 7 | |
| 8 | /// The title of the example. |
| 9 | fn title(&self) -> &'static str; |
| 10 | |
| 11 | /// The description of the example. |
| 12 | fn description(&self) -> &'static str; |
| 13 | |
| 14 | /// The tags of the example. |
| 15 | fn tags(&self) -> &'static [&'static str]; |
| 16 | |
| 17 | /// The thumbnail image of the example. |
| 18 | /// Should be 192x192 pixels. It is automatically generated from the |
| 19 | /// screenshot of the example. |
| 20 | fn thumbnail_bytes(&self) -> &'static [u8]; |
| 21 | |
| 22 | /// The code of the example. |
| 23 | fn code_bytes(&self) -> &'static [u8]; |
| 24 | |
| 25 | /// The UI of the example. |
| 26 | fn show_ui(&mut self, ui: &mut egui::Ui) -> egui::Response; |
| 27 | |
| 28 | /// The controls for the example. |
| 29 | fn show_controls(&mut self, ui: &mut egui::Ui) -> egui::Response; |
| 30 | } |
| 31 | |
| 32 | #[doc(hidden)] |
| 33 | #[cfg(not(target_arch = "wasm32"))] |
nothing calls this directly
no outgoing calls
no test coverage detected