pub struct Theme { /* private fields */ }Expand description
Complete immutable appearance, independent of fonts discovered during rendering.
Built-in constructors return ordinary complete values. Customize a cloned
value with Theme::customize and attach the built result to a Plot or Canvas.
use lichtung_plot::{Color, Theme};
let base = Theme::publication();
let title = base.typography().get_root().get_title().clone()
.color(Color::hex("#194A75")?)?;
let root = base.typography().get_root().clone().title(title)?;
let typography = base.typography().clone().root(root)?;
let custom = base.customize().typography(typography).build()?;
assert_ne!(custom.typography(), base.typography());Built-ins are complete values, not closed selector variants:
let _ = lichtung_plot::Theme::Publication;Resolution is private:
let _ = lichtung_plot::Theme::publication().resolve();Implementations§
Source§impl Theme
impl Theme
Sourcepub fn surfaces(&self) -> &SurfaceTheme
pub fn surfaces(&self) -> &SurfaceTheme
Borrow the complete surfaces component.
Sourcepub fn typography(&self) -> &TypographyTheme
pub fn typography(&self) -> &TypographyTheme
Borrow the complete typography component.
Sourcepub fn legend(&self) -> &LegendTheme
pub fn legend(&self) -> &LegendTheme
Borrow the complete legend component.
Sourcepub fn composition(&self) -> &CompositionTheme
pub fn composition(&self) -> &CompositionTheme
Borrow the complete composition component.
Sourcepub fn annotations(&self) -> &AnnotationTheme
pub fn annotations(&self) -> &AnnotationTheme
Borrow the complete annotations component.
Sourcepub fn color_scales(&self) -> &ColorScales
pub fn color_scales(&self) -> &ColorScales
Borrow the complete color_scales component.
Source§impl Theme
impl Theme
Sourcepub fn new(
surfaces: SurfaceTheme,
typography: TypographyTheme,
axes: AxisTheme,
legend: LegendTheme,
composition: CompositionTheme,
marks: MarkTheme,
annotations: AnnotationTheme,
color_scales: ColorScales,
) -> Result<Self>
pub fn new( surfaces: SurfaceTheme, typography: TypographyTheme, axes: AxisTheme, legend: LegendTheme, composition: CompositionTheme, marks: MarkTheme, annotations: AnnotationTheme, color_scales: ColorScales, ) -> Result<Self>
Construct all eight complete components without discovering fonts or data domains.
Sourcepub fn publication() -> Self
pub fn publication() -> Self
Clean high-contrast publication appearance with generous whitespace.
Sourcepub fn customize(&self) -> ThemeBuilder
pub fn customize(&self) -> ThemeBuilder
Start a complete construction-only working copy, leaving this value unchanged.
Trait Implementations§
impl StructuralPartialEq for Theme
Auto Trait Implementations§
impl Forget for Theme
impl Freeze for Theme
impl Move for Theme
impl RefUnwindSafe for Theme
impl Send for Theme
impl Sync for Theme
impl Unpin for Theme
impl UnsafeUnpin for Theme
impl UnwindSafe for Theme
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.