Skip to main content

LayoutConfig

Struct LayoutConfig 

Source
pub struct LayoutConfig {
Show 15 fields pub figure_width: f64, pub figure_height: f64, pub has_title: bool, pub has_xlabel: bool, pub has_ylabel: bool, pub has_legend: bool, pub title_height: f64, pub xlabel_height: f64, pub ylabel_width: f64, pub tick_label_max_width: f64, pub tick_label_height: f64, pub legend_width: f64, pub padding: f64, pub min_plot_width: f64, pub min_plot_height: f64,
}
Expand description

Configuration for layout computation.

Callers set the figure dimensions and declare which decorations are present; the layout engine then carves out non-overlapping rectangles for each element.

Fields§

§figure_width: f64

Total figure width in pixels.

§figure_height: f64

Total figure height in pixels.

§has_title: bool

Whether a title is displayed above the plot.

§has_xlabel: bool

Whether an x-axis label is displayed below the plot.

§has_ylabel: bool

Whether a y-axis label is displayed to the left of the plot.

§has_legend: bool

Whether a legend box is displayed to the right of the plot.

§title_height: f64

Height of the title text in pixels.

§xlabel_height: f64

Height of the x-axis label text in pixels.

§ylabel_width: f64

Width of the y-axis label text in pixels (measured along the rotated axis).

§tick_label_max_width: f64

Maximum width of any y-axis tick label in pixels.

§tick_label_height: f64

Height of a single tick label line in pixels.

§legend_width: f64

Width allocated for the legend box in pixels.

§padding: f64

General padding between layout elements in pixels.

§min_plot_width: f64

Minimum plot area width; layout will not shrink below this.

§min_plot_height: f64

Minimum plot area height; layout will not shrink below this.

Implementations§

Source§

impl LayoutConfig

Source

pub fn new(width: f64, height: f64) -> Self

Creates a configuration with sensible defaults for the given figure size.

All decoration flags default to false; callers should enable the ones they need before passing the config to compute_layout.

Trait Implementations§

Source§

impl Clone for LayoutConfig

Source§

fn clone(&self) -> LayoutConfig

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 LayoutConfig

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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<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> 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> 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.