crisol-plot 1.15.0

Crisol plot: interactive 2D charts and a 3D sibling with SVG, PNG, and PDF export.
Documentation
//! Screen-space line runs shared by the CPU and GPU data layers.

use egui::{Color32, Pos2};

/// One line or marker run for the GPU data layer, in screen coordinates.
#[derive(Clone, Debug)]
pub(crate) struct GpuLine {
    pub points: Vec<Pos2>,
    pub color: Color32,
    pub width: f32,
    pub closed: bool,
}

impl GpuLine {
    pub fn new(points: Vec<Pos2>, color: Color32, width: f32) -> Self {
        Self {
            points,
            color,
            width,
            closed: false,
        }
    }

    pub fn closed(mut self) -> Self {
        self.closed = true;
        self
    }
}

/// One filled triangle in screen space for the GPU 3D layer.
#[derive(Clone, Copy, Debug)]
pub(super) struct GpuTriangle {
    pub points: [Pos2; 3],
    pub color: Color32,
}