Expand description
Chart rendering algorithms for Presentar.
This module provides mathematical algorithms for chart rendering:
- Interpolation (linear, cubic spline, Catmull-Rom, Bezier)
- Path tessellation for GPU rendering
- Histogram binning
- Arc geometry computation
- Data normalization and scaling
§Example
use presentar_core::chart::{Interpolator, CubicSpline, Point2D};
// Create a spline from control points
let points = vec![
Point2D::new(0.0, 0.0),
Point2D::new(1.0, 2.0),
Point2D::new(2.0, 1.5),
Point2D::new(3.0, 3.0),
];
let spline = CubicSpline::from_points(&points);
// Interpolate at any x value
let y = spline.interpolate(1.5);Structs§
- ArcGeometry
- Arc geometry for pie charts.
- Catmull
Rom - Catmull-Rom spline interpolation.
- Cubic
Bezier - Bezier curve segment.
- Cubic
Spline - Cubic spline interpolation (natural spline).
- Data
Normalizer - Data normalization for chart rendering.
- Draw
Batch - Draw call batching for GPU efficiency.
- Histogram
Bins - Histogram binning configuration.
- Linear
Interpolator - Linear interpolation between points.
- Path
Tessellator - Path tessellation for GPU rendering.
- Point2D
- 2D point for chart calculations.
Traits§
- Interpolator
- Interpolation trait for different curve types.