Skip to main content

Theme

Struct Theme 

Source
pub struct Theme {
Show 40 fields pub text: ElementText, pub title: ElementText, pub axis_text_x: ElementText, pub axis_text_y: ElementText, pub axis_title_x: ElementText, pub axis_title_y: ElementText, pub axis_line: ElementLine, pub axis_ticks: ElementLine, pub panel_background: ElementRect, pub panel_grid_major: ElementLine, pub panel_grid_minor: ElementLine, pub plot_background: ElementRect, pub legend_position: LegendPosition, pub plot_margin: Margin, pub subtitle: ElementText, pub caption: ElementText, pub legend_title: ElementText, pub legend_text: ElementText, pub strip_text: ElementText, pub axis_line_x: Option<ElementLine>, pub axis_line_y: Option<ElementLine>, pub axis_ticks_x: Option<ElementLine>, pub axis_ticks_y: Option<ElementLine>, pub panel_grid_major_x: Option<ElementLine>, pub panel_grid_major_y: Option<ElementLine>, pub panel_grid_minor_x: Option<ElementLine>, pub panel_grid_minor_y: Option<ElementLine>, pub panel_border: ElementLine, pub legend_background: ElementRect, pub legend_key: ElementRect, pub strip_background: ElementRect, pub axis_ticks_length: f64, pub legend_key_width: f64, pub legend_key_height: f64, pub legend_spacing: f64, pub legend_margin: Margin, pub panel_spacing: f64, pub panel_spacing_x: Option<f64>, pub panel_spacing_y: Option<f64>, pub primary: Option<(u8, u8, u8)>,
}
Expand description

Complete theme specification for a plot.

Fields§

§text: ElementText§title: ElementText§axis_text_x: ElementText§axis_text_y: ElementText§axis_title_x: ElementText§axis_title_y: ElementText§axis_line: ElementLine§axis_ticks: ElementLine§panel_background: ElementRect§panel_grid_major: ElementLine§panel_grid_minor: ElementLine§plot_background: ElementRect§legend_position: LegendPosition§plot_margin: Margin§subtitle: ElementText§caption: ElementText§legend_title: ElementText§legend_text: ElementText§strip_text: ElementText§axis_line_x: Option<ElementLine>§axis_line_y: Option<ElementLine>§axis_ticks_x: Option<ElementLine>§axis_ticks_y: Option<ElementLine>§panel_grid_major_x: Option<ElementLine>§panel_grid_major_y: Option<ElementLine>§panel_grid_minor_x: Option<ElementLine>§panel_grid_minor_y: Option<ElementLine>§panel_border: ElementLine§legend_background: ElementRect§legend_key: ElementRect§strip_background: ElementRect§axis_ticks_length: f64§legend_key_width: f64§legend_key_height: f64§legend_spacing: f64§legend_margin: Margin§panel_spacing: f64§panel_spacing_x: Option<f64>§panel_spacing_y: Option<f64>§primary: Option<(u8, u8, u8)>

Optional brand color. When set, geoms that draw a single un-mapped series (no color/fill aesthetic) use it as their default instead of the geom’s built-in color. Lets one render process serve multiple tenants’ brands.

Implementations§

Source§

impl Theme

Source

pub fn primary_or(&self, fallback: (u8, u8, u8)) -> (u8, u8, u8)

Resolve the effective series color: the theme’s brand color if set, otherwise the geom’s own default.

Source

pub fn with_primary(self, color: (u8, u8, u8)) -> Self

Set the brand/primary color (builder style).

Source

pub fn get_axis_line_x(&self) -> &ElementLine

Source

pub fn get_axis_line_y(&self) -> &ElementLine

Source

pub fn get_axis_ticks_x(&self) -> &ElementLine

Source

pub fn get_axis_ticks_y(&self) -> &ElementLine

Source

pub fn get_panel_grid_major_x(&self) -> &ElementLine

Source

pub fn get_panel_grid_major_y(&self) -> &ElementLine

Source

pub fn get_panel_grid_minor_x(&self) -> &ElementLine

Source

pub fn get_panel_grid_minor_y(&self) -> &ElementLine

Source

pub fn get_panel_spacing_x(&self) -> f64

Source

pub fn get_panel_spacing_y(&self) -> f64

Source

pub fn set_axis_text_x(self, el: ElementText) -> Self

Source

pub fn set_axis_text_y(self, el: ElementText) -> Self

Source

pub fn set_axis_title_x(self, el: ElementText) -> Self

Source

pub fn set_axis_title_y(self, el: ElementText) -> Self

Source

pub fn set_axis_line(self, el: ElementLine) -> Self

Source

pub fn set_axis_ticks(self, el: ElementLine) -> Self

Source

pub fn set_panel_background(self, el: ElementRect) -> Self

Source

pub fn set_panel_grid_major(self, el: ElementLine) -> Self

Source

pub fn set_panel_grid_minor(self, el: ElementLine) -> Self

Source

pub fn set_plot_background(self, el: ElementRect) -> Self

Source

pub fn set_legend_position(self, pos: LegendPosition) -> Self

Source

pub fn set_plot_margin(self, margin: Margin) -> Self

Source

pub fn set_title(self, el: ElementText) -> Self

Source

pub fn set_text(self, el: ElementText) -> Self

Source

pub fn set_subtitle(self, el: ElementText) -> Self

Source

pub fn set_caption(self, el: ElementText) -> Self

Source

pub fn set_legend_title(self, el: ElementText) -> Self

Source

pub fn set_legend_text(self, el: ElementText) -> Self

Source

pub fn set_strip_text(self, el: ElementText) -> Self

Source

pub fn set_axis_line_x(self, el: Option<ElementLine>) -> Self

Source

pub fn set_axis_line_y(self, el: Option<ElementLine>) -> Self

Source

pub fn set_axis_ticks_x(self, el: Option<ElementLine>) -> Self

Source

pub fn set_axis_ticks_y(self, el: Option<ElementLine>) -> Self

Source

pub fn set_panel_grid_major_x(self, el: Option<ElementLine>) -> Self

Source

pub fn set_panel_grid_major_y(self, el: Option<ElementLine>) -> Self

Source

pub fn set_panel_grid_minor_x(self, el: Option<ElementLine>) -> Self

Source

pub fn set_panel_grid_minor_y(self, el: Option<ElementLine>) -> Self

Source

pub fn set_panel_border(self, el: ElementLine) -> Self

Source

pub fn set_legend_background(self, el: ElementRect) -> Self

Source

pub fn set_legend_key(self, el: ElementRect) -> Self

Source

pub fn set_strip_background(self, el: ElementRect) -> Self

Source

pub fn set_axis_ticks_length(self, val: f64) -> Self

Source

pub fn set_legend_key_width(self, val: f64) -> Self

Source

pub fn set_legend_key_height(self, val: f64) -> Self

Source

pub fn set_legend_spacing(self, val: f64) -> Self

Source

pub fn set_legend_margin(self, margin: Margin) -> Self

Source

pub fn set_panel_spacing(self, val: f64) -> Self

Source

pub fn set_panel_spacing_x(self, val: Option<f64>) -> Self

Source

pub fn set_panel_spacing_y(self, val: Option<f64>) -> Self

Source

pub fn update(self, upd: ThemeUpdate) -> Self

Apply incremental theme modifications. Only fields that are Some in the update are applied.

Trait Implementations§

Source§

impl Clone for Theme

Source§

fn clone(&self) -> Theme

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Theme

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Theme

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V