1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
//! Animation export system for ruviz
//!
//! This module provides animation recording and video export capabilities,
//! modeled after Makie.jl's proven animation architecture.
//!
//! # Features
//!
//! - **Tick-based timing**: Deterministic frame timing with `Tick` struct
//! - **Macro-based recording**: `record!` for frame count, duration, and config-driven capture
//! - **Multiple formats**: GIF (default), MP4/WebM via AV1 (optional)
//! - **Observable integration**: Reactive animations with `AnimatedObservable`
//! - **Smooth transitions**: Easing functions and plot morphing
//! - **Compatibility wrappers**: Deprecated `record_*` helpers remain available for older code
//!
//! # Recommended API
//!
//! ```rust,ignore
//! use ruviz::prelude::*;
//! use ruviz::record;
//!
//! // Record with frame count and tick interpolation helpers
//! record!("bounce.gif", 60, |t| {
//! let y = t.ease_over(easing::ease_out_bounce, 100.0, 0.0, 2.0);
//! Plot::new().scatter(&[0.0], &[y])
//! })?;
//!
//! // Or use duration syntax
//! record!("wave.gif", 2 secs, |t| {
//! let x = t.lerp_over(0.0, 10.0, 2.0);
//! Plot::new().line(&[0.0, x], &[0.0, x])
//! })?;
//! ```
//!
//! # Animation Builder API
//!
//! For multi-value animations with custom easing:
//!
//! ```rust,ignore
//! use ruviz::animation::{Animation, easing};
//!
//! Animation::build()
//! .value("x", 0.0).to(100.0).duration_secs(2.0)
//! .value("y", 50.0).to(0.0).ease(easing::ease_out_bounce)
//! .record("output.gif", |values, tick| {
//! Plot::new().scatter(&[values["x"]], &[values["y"]])
//! })?;
//! ```
//!
//! # Deprecated Compatibility API
//!
//! ```rust,ignore
//! use ruviz::prelude::*;
//! use ruviz::animation::record;
//!
//! let x: Vec<f64> = (0..100).map(|i| i as f64 * 0.1).collect();
//!
//! record("wave.gif", 0..60, |frame, tick| {
//! let phase = tick.time * 2.0 * std::f64::consts::PI;
//! let y: Vec<f64> = x.iter().map(|&xi| (xi + phase).sin()).collect();
//! #[allow(deprecated)]
//! Plot::new()
//! .line(&x, &y)
//! .end_series()
//! .title(format!("t = {:.2}s", tick.time))
//! }).unwrap();
//! ```
//!
//! The `record()` and `record_simple()` helpers are deprecated in favor of `record!`
//! but remain available for older callers.
//!
//! # Feature Flags
//!
//! - `animation` - Core animation system with GIF export
//! - `animation-hq-gif` - High-quality GIF via gifski
//! - `animation-video` - MP4/WebM via pure Rust AV1 (rav1e)
// Re-export core types
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
// Animation Builder API
pub use ;
// Re-export Signal from data module for convenience
pub use crate;