pub struct Animator { /* private fields */ }Expand description
Animates the values of a chart’s series.
The animator keeps the values the chart showed last and the values it should show now, and interpolates between them. The chart’s layout is recomputed on every frame of the animation, so the shapes really move rather than jumping at the end.
The clock and the easing come from euv-engine: the chart’s motion
is the framework’s motion, down to the delay and the pause. The
engine’s tween counts in seconds and the chart’s API counts in
milliseconds, and the conversion happens here and nowhere else.
Implementations§
Source§impl Animator
Inherent implementation of Animator.
impl Animator
Inherent implementation of Animator.
Sourcepub fn set_duration(&mut self, duration: f64) -> &mut Self
pub fn set_duration(&mut self, duration: f64) -> &mut Self
Sourcepub fn set_easing(&mut self, easing: Easing) -> &mut Self
pub fn set_easing(&mut self, easing: Easing) -> &mut Self
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Sourcepub fn pause(&mut self) -> &mut Self
pub fn pause(&mut self) -> &mut Self
Pauses the animation.
The values stay where they are until the animation is resumed.
§Returns
&mut Self- Amut Selfvalue.
Sourcepub fn reset(&mut self) -> &mut Self
pub fn reset(&mut self) -> &mut Self
Starts the animation over.
The values go back to where the animation started, and the animation runs again from there.
§Returns
&mut Self- Amut Selfvalue.
Sourcepub fn remember_initial(&mut self, option: &ChartOption) -> &mut Self
pub fn remember_initial(&mut self, option: &ChartOption) -> &mut Self
Sourcepub fn begin(&mut self, option: &ChartOption) -> &mut Self
pub fn begin(&mut self, option: &ChartOption) -> &mut Self
Sourcepub fn apply(&self, option: &mut ChartOption)
pub fn apply(&self, option: &mut ChartOption)
Writes the animated values into the option.
The option’s series data is replaced by the animated values, so that the layout — and therefore the picture — follows the animation.
§Arguments
&mut ChartOption- Mutable reference to aChartOption(mutated in place).