Skip to main content

Config

Struct Config 

Source
pub struct Config {
    pub chart_area: ChartArea,
    pub top_x: AxisOptions,
    pub bottom_x: AxisOptions,
    pub left_y: AxisOptions,
    pub right_y: AxisOptions,
    pub chart_title: ChartTitleOptions,
    pub grid: GridOptions,
    pub legend: Legend,
    pub picked_points: Option<PickedPointsConfig>,
    pub picked_data: Option<DataSelectionsConfig>,
    pub colorbar: Option<ColorBarOptions>,
    pub draw_style: DrawStyle,
}

Fields§

§chart_area: ChartArea§top_x: AxisOptions§bottom_x: AxisOptions§left_y: AxisOptions§right_y: AxisOptions§chart_title: ChartTitleOptions§grid: GridOptions§legend: Legend§picked_points: Option<PickedPointsConfig>§picked_data: Option<DataSelectionsConfig>

Typed point/bin/cell/contour selections. Additive to the legacy picked_points field so existing documents and hosts keep their exact point-only contract.

§colorbar: Option<ColorBarOptions>

The colourbar and, with it, the chart’s z scale. None (key absent in JSON) is a chart with no z dimension — the shape of every document written before field series existed.

§draw_style: DrawStyle

Chart-global render style. Precise (default, key absent in JSON) is identical to current rendering; every other variant is an opt-in stylized mode. No per-series mixing.

Implementations§

Source§

impl Config

Source

pub fn scaled(&self, scale: f32) -> Self

Multiply every pixel-based visual dim by scale. Data ranges, colors, and scale enums are untouched. For resolution-invariant high-DPI export.

Source

pub fn scale_in_place(&mut self, s: f32)

Source§

impl Config

Source§

impl Config

Source

pub fn fit_to_data_area( &mut self, target: DataArea, strategy: FitStrategy, ) -> Result<(), LayoutError>

Source

pub fn resize_chart_area( &mut self, new_area: ChartArea, ) -> Result<(), LayoutError>

Source

pub fn resize_chart_area_scaled( &mut self, new_area: ChartArea, ) -> Result<(), LayoutError>

Source

pub fn set_side_margin( &mut self, side: Side, value: f32, ) -> Result<(), LayoutError>

Source

pub fn set_margins( &mut self, margins: Margins, strategy: FitStrategy, ) -> Result<(), LayoutError>

Source§

impl Config

Source

pub fn nudge(&mut self, element: Element, dx: f32, dy: f32) -> NudgeResult

Apply a measurement-free approximate containment policy. Text-bearing elements use representative anchors here; exact glyph bounds are kept in the Selectable path and no text measurer is required by nudge.

Source

pub fn nudge_x(&mut self, element: Element, dx: f32) -> NudgeResult

Source

pub fn nudge_y(&mut self, element: Element, dy: f32) -> NudgeResult

Source§

impl Config

Source

pub fn margins(&self) -> Margins

Source

pub fn data_area(&self) -> Result<DataArea, LayoutError>

Source

pub fn colorbar_band(&self, side: &Side) -> f32

How far this side’s axis band is pushed in from the chart-area edge by the colourbar band. Zero on the three sides the bar is not on, and when it is hidden.

Public because everything that positions chrome against the chart edge — the axis title’s placement, its hit box, its nudge anchor — needs the same number, and computing it separately in each is how they drift apart.

Source

pub fn validate(&self) -> Result<(), LayoutError>

Source§

impl Config

Source

pub fn apply_axis_preset(&mut self, preset: AxisPreset)

Apply preset to all four axes at once. See AxisPreset for what is (and is not) touched.

Source§

impl Config

Source

pub fn auto_ticks_all( &mut self, top_x: (f64, f64), bottom_x: (f64, f64), left_y: (f64, f64), right_y: (f64, f64), target_count: usize, ) -> Result<(), TickError>

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Self

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 Config

Source§

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

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

impl<'de> Deserialize<'de> for Config

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl DragConfig for Config

Source§

type Element = Element

Source§

fn nudge(&mut self, element: Element, dx: f32, dy: f32) -> NudgeResult

Source§

impl PartialEq for Config

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Config

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Config

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.