pub struct ScaleConfig {
Show 22 fields pub band_padding_inner: Option<CornerRadiusUnion>, pub band_padding_outer: Option<CornerRadiusUnion>, pub bar_band_padding_inner: Option<CornerRadiusUnion>, pub clamp: Option<Aria>, pub continuous_padding: Option<CornerRadiusUnion>, pub max_band_size: Option<f64>, pub max_font_size: Option<f64>, pub max_opacity: Option<f64>, pub max_size: Option<f64>, pub max_stroke_width: Option<f64>, pub min_band_size: Option<f64>, pub min_font_size: Option<f64>, pub min_opacity: Option<f64>, pub min_size: Option<f64>, pub min_stroke_width: Option<f64>, pub point_padding: Option<CornerRadiusUnion>, pub quantile_count: Option<f64>, pub quantize_count: Option<f64>, pub rect_band_padding_inner: Option<CornerRadiusUnion>, pub round: Option<Aria>, pub use_unaggregated_domain: Option<bool>, pub x_reverse: Option<Aria>,
}
Expand description

Scale configuration determines default properties for all scales. For a full list of scale configuration options, please see the corresponding section of the scale documentation.

Fields§

§band_padding_inner: Option<CornerRadiusUnion>

Default inner padding for x and y band-ordinal scales.

Default value: - barBandPaddingInner for bar marks (0.1 by default) - rectBandPaddingInner for rect and other marks (0 by default)

§band_padding_outer: Option<CornerRadiusUnion>

Default outer padding for x and y band-ordinal scales.

Default value: paddingInner/2 (which makes _width/height = number of unique values

  • step_)
§bar_band_padding_inner: Option<CornerRadiusUnion>

Default inner padding for x and y band-ordinal scales of "bar" marks.

Default value: 0.1

§clamp: Option<Aria>

If true, values that exceed the data domain are clamped to either the minimum or maximum range value

§continuous_padding: Option<CornerRadiusUnion>

Default padding for continuous scales.

Default: 5 for continuous x-scale of a vertical bar and continuous y-scale of a horizontal bar.; 0 otherwise.

§max_band_size: Option<f64>

The default max value for mapping quantitative fields to bar’s size/bandSize.

If undefined (default), we will use the axis’s size (width or height) - 1.

§max_font_size: Option<f64>

The default max value for mapping quantitative fields to text’s size/fontSize.

Default value: 40

§max_opacity: Option<f64>

Default max opacity for mapping a field to opacity.

Default value: 0.8

§max_size: Option<f64>

Default max value for point size scale.

§max_stroke_width: Option<f64>

Default max strokeWidth for the scale of strokeWidth for rule and line marks and of size for trail marks.

Default value: 4

§min_band_size: Option<f64>

The default min value for mapping quantitative fields to bar and tick’s size/bandSize scale with zero=false.

Default value: 2

§min_font_size: Option<f64>

The default min value for mapping quantitative fields to tick’s size/fontSize scale with zero=false

Default value: 8

§min_opacity: Option<f64>

Default minimum opacity for mapping a field to opacity.

Default value: 0.3

§min_size: Option<f64>

Default minimum value for point size scale with zero=false.

Default value: 9

§min_stroke_width: Option<f64>

Default minimum strokeWidth for the scale of strokeWidth for rule and line marks and of size for trail marks with zero=false.

Default value: 1

§point_padding: Option<CornerRadiusUnion>

Default outer padding for x and y point-ordinal scales.

Default value: 0.5 (which makes width/height = number of unique values * step)

§quantile_count: Option<f64>

Default range cardinality for quantile scale.

Default value: 4

§quantize_count: Option<f64>

Default range cardinality for quantize scale.

Default value: 4

§rect_band_padding_inner: Option<CornerRadiusUnion>

Default inner padding for x and y band-ordinal scales of "rect" marks.

Default value: 0

§round: Option<Aria>

If true, rounds numeric output values to integers. This can be helpful for snapping to the pixel grid. (Only available for x, y, and size scales.)

§use_unaggregated_domain: Option<bool>

Use the source data range before aggregation as scale domain instead of aggregated data for aggregate axis.

This is equivalent to setting domain to "unaggregate" for aggregated quantitative fields by default.

This property only works with aggregate functions that produce values within the raw data domain ("mean", "average", "median", "q1", "q3", "min", "max"). For other aggregations that produce values outside of the raw data domain (e.g. "count", "sum"), this property is ignored.

Default value: false

§x_reverse: Option<Aria>

Reverse x-scale by default (useful for right-to-left charts).

Trait Implementations§

source§

impl Clone for ScaleConfig

source§

fn clone(&self) -> ScaleConfig

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for ScaleConfig

source§

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

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

impl Default for ScaleConfig

source§

fn default() -> ScaleConfig

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

impl<'de> Deserialize<'de> for ScaleConfig

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 Serialize for ScaleConfig

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

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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