-
Notifications
You must be signed in to change notification settings - Fork 54
Introduce type parameter for plot points #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@lucasmerlin @emilk could you have a look at it? |
std::sync::Arc::new(egui::mutex::Mutex::new(std::collections::HashMap::< | ||
Id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this could use egui::IdMap
(much faster)
.collect::<Vec<_>>(); | ||
|
||
let custom_things = | ||
std::sync::Arc::new(egui::mutex::Mutex::new(std::collections::HashMap::< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some use
statements to the top of this file so this becomes easier to read
@@ -1101,6 +1107,61 @@ impl ChartsDemo { | |||
} | |||
} | |||
|
|||
#[derive(PartialEq, serde::Deserialize, serde::Serialize, Default)] | |||
struct UserdataDemo {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's soon time to break up this file into several smaller files (not in this PR though!)
@@ -409,7 +409,7 @@ impl<'a> Plot<'a> { | |||
/// ``` | |||
pub fn label_formatter( | |||
mut self, | |||
label_formatter: impl Fn(&str, &PlotPoint) -> String + 'a, | |||
label_formatter: impl Fn(&str, &PlotPoint, Option<(Id, usize)>) -> String + 'a, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring should explain what the third parameter is here
struct DemoPoint { | ||
x: f64, | ||
y: f64, | ||
custom_thing: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes it sounds like some demo points has a custom thing, other don't. I think this feature deserves a more realistic example
Reopening emilk/egui#4719