fix: correct typo nth_derviative -> nth_derivative
This commit is contained in:
parent
48fd49e386
commit
df05601e26
@ -43,7 +43,7 @@ pub struct FunctionEntry {
|
|||||||
/// If displaying derivatives are enabled (note, they are still calculated for other purposes)
|
/// If displaying derivatives are enabled (note, they are still calculated for other purposes)
|
||||||
pub derivative: bool,
|
pub derivative: bool,
|
||||||
|
|
||||||
pub nth_derviative: bool,
|
pub nth_derivative: bool,
|
||||||
|
|
||||||
pub back_data: Vec<PlotPoint>,
|
pub back_data: Vec<PlotPoint>,
|
||||||
pub integral_data: Option<(Vec<Bar>, f64)>,
|
pub integral_data: Option<(Vec<Bar>, f64)>,
|
||||||
@ -64,7 +64,7 @@ impl Hash for FunctionEntry {
|
|||||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||||
self.raw_func_str.hash(state);
|
self.raw_func_str.hash(state);
|
||||||
self.integral.hash(state);
|
self.integral.hash(state);
|
||||||
self.nth_derviative.hash(state);
|
self.nth_derivative.hash(state);
|
||||||
self.curr_nth.hash(state);
|
self.curr_nth.hash(state);
|
||||||
self.settings_opened.hash(state);
|
self.settings_opened.hash(state);
|
||||||
}
|
}
|
||||||
@ -128,7 +128,7 @@ impl Default for FunctionEntry {
|
|||||||
raw_func_str: String::new(),
|
raw_func_str: String::new(),
|
||||||
integral: false,
|
integral: false,
|
||||||
derivative: false,
|
derivative: false,
|
||||||
nth_derviative: false,
|
nth_derivative: false,
|
||||||
back_data: Vec::new(),
|
back_data: Vec::new(),
|
||||||
integral_data: None,
|
integral_data: None,
|
||||||
derivative_data: Vec::new(),
|
derivative_data: Vec::new(),
|
||||||
@ -157,7 +157,7 @@ impl FunctionEntry {
|
|||||||
.collapsible(false)
|
.collapsible(false)
|
||||||
.show(ctx, |ui| {
|
.show(ctx, |ui| {
|
||||||
ui.add(Checkbox::new(
|
ui.add(Checkbox::new(
|
||||||
&mut self.nth_derviative,
|
&mut self.nth_derivative,
|
||||||
"Display Nth Derivative",
|
"Display Nth Derivative",
|
||||||
));
|
));
|
||||||
|
|
||||||
@ -324,7 +324,7 @@ impl FunctionEntry {
|
|||||||
debug_assert_eq!(self.derivative_data.len(), settings.plot_width + 1);
|
debug_assert_eq!(self.derivative_data.len(), settings.plot_width + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.nth_derviative && self.nth_derivative_data.is_none() {
|
if self.nth_derivative && self.nth_derivative_data.is_none() {
|
||||||
let data = self.generate_plot_data(self.curr_nth, &resolution_iter);
|
let data = self.generate_plot_data(self.curr_nth, &resolution_iter);
|
||||||
debug_assert_eq!(data.len(), settings.plot_width + 1);
|
debug_assert_eq!(data.len(), settings.plot_width + 1);
|
||||||
self.nth_derivative_data = Some(data);
|
self.nth_derivative_data = Some(data);
|
||||||
@ -434,10 +434,10 @@ impl FunctionEntry {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.nth_derviative
|
if self.nth_derivative
|
||||||
&& let Some(ref nth_derviative) = self.nth_derivative_data
|
&& let Some(ref nth_derivative) = self.nth_derivative_data
|
||||||
{
|
{
|
||||||
plot_ui.line(nth_derviative.clone().to_line().color(Color32::DARK_RED));
|
plot_ui.line(nth_derivative.clone().to_line().color(Color32::DARK_RED));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Plot integral data
|
// Plot integral data
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user