Skip to main content

flow_plots/render/
progress.rs

1use crate::density_calc::RawPixelData;
2
3/// Information about plot rendering progress
4#[derive(Clone, Debug)]
5pub struct ProgressInfo {
6    /// Pixel data for the current progress chunk
7    pub pixels: Vec<RawPixelData>,
8    /// Progress percentage (0.0 to 100.0)
9    pub percent: f32,
10}
11
12/// Callback function type for reporting plot rendering progress
13///
14/// The callback receives progress information and returns a result.
15/// Errors from the callback are logged but do not stop rendering.
16pub type ProgressCallback =
17    Box<dyn FnMut(ProgressInfo) -> Result<(), Box<dyn std::error::Error + Send + Sync>>>;