pub struct ScatterPlotData {
pub points: Vec<(f32, f32)>,
pub gate_ids: Option<Vec<u32>>,
pub z_values: Option<Vec<f32>>,
}Expand description
Scatter plot data with optional per-point metadata for overlay and continuous coloring.
Use From to convert from Vec<(f32, f32)> for simple plots.
§Examples
Simple scatter (solid or density):
let data: ScatterPlotData = vec![(1.0, 2.0), (3.0, 4.0)].into();Scatter with discrete gate colors:
let points = vec![(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)];
let gate_ids = vec![0, 1, 0]; // gate index per point
let data = ScatterPlotData::with_gates(points, gate_ids);Scatter colored by continuous z-axis:
let points = vec![(1.0, 2.0), (3.0, 4.0)];
let z_values = vec![0.5, 1.0];
let data = ScatterPlotData::with_z(points, z_values);Fields§
§points: Vec<(f32, f32)>(x, y) coordinate pairs
gate_ids: Option<Vec<u32>>Gate index per point (for discrete overlay coloring). Indexes into gate_colors in options.
z_values: Option<Vec<f32>>Z-axis value per point (for continuous colormap coloring)
Implementations§
Source§impl ScatterPlotData
impl ScatterPlotData
Sourcepub fn with_gates(
points: Vec<(f32, f32)>,
gate_ids: Vec<u32>,
) -> Result<Self, ScatterDataError>
pub fn with_gates( points: Vec<(f32, f32)>, gate_ids: Vec<u32>, ) -> Result<Self, ScatterDataError>
Create scatter data with discrete gate IDs for overlay coloring.
§Errors
Returns Err if gate_ids.len() != points.len().
Trait Implementations§
Source§impl Clone for ScatterPlotData
impl Clone for ScatterPlotData
Source§fn clone(&self) -> ScatterPlotData
fn clone(&self) -> ScatterPlotData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScatterPlotData
impl Debug for ScatterPlotData
Auto Trait Implementations§
impl Freeze for ScatterPlotData
impl RefUnwindSafe for ScatterPlotData
impl Send for ScatterPlotData
impl Sync for ScatterPlotData
impl Unpin for ScatterPlotData
impl UnsafeUnpin for ScatterPlotData
impl UnwindSafe for ScatterPlotData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more