Module chart

Module chart 

Source
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.
CatmullRom
Catmull-Rom spline interpolation.
CubicBezier
Bezier curve segment.
CubicSpline
Cubic spline interpolation (natural spline).
DataNormalizer
Data normalization for chart rendering.
DrawBatch
Draw call batching for GPU efficiency.
HistogramBins
Histogram binning configuration.
LinearInterpolator
Linear interpolation between points.
PathTessellator
Path tessellation for GPU rendering.
Point2D
2D point for chart calculations.

Traits§

Interpolator
Interpolation trait for different curve types.