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: f64Total figure width in pixels.
figure_height: f64Total figure height in pixels.
has_title: boolWhether a title is displayed above the plot.
has_xlabel: boolWhether an x-axis label is displayed below the plot.
has_ylabel: boolWhether a y-axis label is displayed to the left of the plot.
has_legend: boolWhether a legend box is displayed to the right of the plot.
title_height: f64Height of the title text in pixels.
xlabel_height: f64Height of the x-axis label text in pixels.
ylabel_width: f64Width of the y-axis label text in pixels (measured along the rotated axis).
tick_label_max_width: f64Maximum width of any y-axis tick label in pixels.
tick_label_height: f64Height of a single tick label line in pixels.
legend_width: f64Width allocated for the legend box in pixels.
padding: f64General padding between layout elements in pixels.
min_plot_width: f64Minimum plot area width; layout will not shrink below this.
min_plot_height: f64Minimum plot area height; layout will not shrink below this.
Implementations§
Source§impl LayoutConfig
impl LayoutConfig
Sourcepub fn new(width: f64, height: f64) -> Self
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
impl Clone for LayoutConfig
Source§fn clone(&self) -> LayoutConfig
fn clone(&self) -> LayoutConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more