pub struct AlphaEncoding { /* private fields */ }Expand description
One complete explicit alpha-unit binding for a Plot paint target.
Default is Self::theme. Observation values align with all original input
slots, independently of diagnostic crate::SourceRows IDs. Series/aggregate
values are explicitly keyed; they are never reduced from observation alpha.
Each actual unit must resolve before fonts, even when its alpha is zero.
use lichtung_plot::{AlphaEncoding, AlphaValues, CategoryValues};
let strokes = AlphaEncoding::keyed(
[CategoryValues::new("series", ["control", "treated"])?],
AlphaValues::new("reliability", [128, 230])?,
)?;
assert!(!strokes.is_theme());
assert_eq!(strokes.values().unwrap().get(1), Some(230));use lichtung_plot::AlphaEncoding;
fn private(value: AlphaEncoding) { let _ = value.binding; }Implementations§
Source§impl AlphaEncoding
impl AlphaEncoding
Sourcepub const fn theme() -> Self
pub const fn theme() -> Self
Reset a target to its independently owned normal role/exact paint alpha.
Sourcepub fn observations(values: AlphaValues) -> Self
pub fn observations(values: AlphaValues) -> Self
Bind bytes to every original observation/record slot, including filtered rows.
Sourcepub fn single(values: AlphaValues) -> Result<Self>
pub fn single(values: AlphaValues) -> Result<Self>
Explicitly broadcast exactly one value to every actual target unit.
Sourcepub fn keyed(
keys: impl IntoIterator<Item = CategoryValues>,
values: AlphaValues,
) -> Result<Self>
pub fn keyed( keys: impl IntoIterator<Item = CategoryValues>, values: AlphaValues, ) -> Result<Self>
Bind explicit actual series/aggregate tuples to aligned values.
Require at least one unique named, nonnull selector column and unique complete tuples. Column order is canonicalized by raw field name. During attachment, fields must include all actual unit keys and may additionally select owning facets. Lookup is exact, without partial-key fallback; unused pooled tuples create no marks, guide text or font requirements.
Sourcepub fn bins(
bounds: Bounds,
facets: impl IntoIterator<Item = CategoryValues>,
values: AlphaValues,
) -> Result<Self>
pub fn bins( bounds: Bounds, facets: impl IntoIterator<Item = CategoryValues>, values: AlphaValues, ) -> Result<Self>
Bind exact Histogram intervals and optional owning facet keys to values.
Each pair must be finite lower < upper; bounds, facets and alpha lengths must agree. Complete interval/facet keys must be unique. Signed zero has one identity. Actual prepared edges must match exactly; no sample reduction, edge adjustment or approximate lookup is performed.
Sourcepub const fn is_theme(&self) -> bool
pub const fn is_theme(&self) -> bool
Whether this binding uses the normal role/exact alpha without mapped values.
Sourcepub const fn values(&self) -> Option<&AlphaValues>
pub const fn values(&self) -> Option<&AlphaValues>
Complete owned values, or None for Theme.
Trait Implementations§
Source§impl Clone for AlphaEncoding
impl Clone for AlphaEncoding
Source§impl Debug for AlphaEncoding
impl Debug for AlphaEncoding
Source§impl Default for AlphaEncoding
impl Default for AlphaEncoding
impl Eq for AlphaEncoding
Source§impl PartialEq for AlphaEncoding
impl PartialEq for AlphaEncoding
impl StructuralPartialEq for AlphaEncoding
Auto Trait Implementations§
impl !RefUnwindSafe for AlphaEncoding
impl !UnwindSafe for AlphaEncoding
impl Forget for AlphaEncoding
impl Freeze for AlphaEncoding
impl Move for AlphaEncoding
impl Send for AlphaEncoding
impl Sync for AlphaEncoding
impl Unpin for AlphaEncoding
impl UnsafeUnpin for AlphaEncoding
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.