pub struct IterativeAnimationRecorder { /* private fields */ }Expand description
Recorder for iterative algorithm animations
Implementations§
Source§impl IterativeAnimationRecorder
impl IterativeAnimationRecorder
Sourcepub fn new(config: IterativeAnimationConfig) -> Self
pub fn new(config: IterativeAnimationConfig) -> Self
Create a new animation recorder
Sourcepub fn record_frame<F: Float + FromPrimitive + Debug>(
&mut self,
data: ArrayView2<'_, F>,
labels: &Array1<i32>,
centroids: Option<&Array2<F>>,
inertia: Option<f64>,
) -> Result<()>
pub fn record_frame<F: Float + FromPrimitive + Debug>( &mut self, data: ArrayView2<'_, F>, labels: &Array1<i32>, centroids: Option<&Array2<F>>, inertia: Option<f64>, ) -> Result<()>
Record a frame during algorithm iteration
Sourcepub fn add_annotation(&mut self, annotation: AnimationAnnotation)
pub fn add_annotation(&mut self, annotation: AnimationAnnotation)
Add custom annotation to the current frame
Sourcepub fn generate_interpolated_frames(&self) -> Vec<AnimationFrame>
pub fn generate_interpolated_frames(&self) -> Vec<AnimationFrame>
Generate interpolated frames between recorded frames
Sourcepub fn get_frames(&self) -> &[AnimationFrame]
pub fn get_frames(&self) -> &[AnimationFrame]
Get all recorded frames
Sourcepub fn export_to_json(&self) -> Result<String>
pub fn export_to_json(&self) -> Result<String>
Export animation to JSON format
Auto Trait Implementations§
impl Freeze for IterativeAnimationRecorder
impl RefUnwindSafe for IterativeAnimationRecorder
impl Send for IterativeAnimationRecorder
impl Sync for IterativeAnimationRecorder
impl Unpin for IterativeAnimationRecorder
impl UnwindSafe for IterativeAnimationRecorder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.