pub type Precision = f32;Expand description
Represents the floating-point precision used specifically for the rendering stage.
While data processing and coordinate transformations should be performed in f64
to maintain computational accuracy and prevent rounding errors, we convert to
Precision (f32) during the final draw calls for the following reasons:
-
GPU Hardware Native: Modern Graphics APIs (WGPU, Metal) are optimized for
f32. Usingf32for rendering structures allows direct GPU memory mapping. -
Memory Efficiency: Halves the memory footprint for large point sets (e.g., in scatter plots) when passing data to the rendering backends.
-
SVG Size Reduction:
f32provides sufficient precision for screen-space while keeping the generated XML string lengths shorter.