[−][src]Struct vega_lite_3::ScaleBuilder
Builder for Scale
.
Methods
impl ScaleBuilder
[src]
pub fn base<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
[src]
The logarithm base of the log
scale (default 10
).
pub fn bins<VALUE: Into<Vec<f64>>>(&mut self, value: VALUE) -> &mut Self
[src]
An array of bin boundaries over the scale domain. If provided, axes and legends will use the bin boundaries to inform the choice of tick marks and text labels.
pub fn clamp<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
[src]
If true
, values that exceed the data domain are clamped to either the minimum or
maximum range value
Default value: derived from the scale
config's clamp
(true
by default).
pub fn constant<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
[src]
A constant determining the slope of the symlog function around zero. Only used for
symlog
scales.
Default value: 1
pub fn domain<VALUE: Into<DomainUnion>>(&mut self, value: VALUE) -> &mut Self
[src]
Customized domain values.
For quantitative fields, domain
can take the form of a two-element array with minimum
and maximum values. Piecewise
scales can be created by
providing a domain
with more than two entries.
If the input field is aggregated, domain
can also be a string value "unaggregated"
,
indicating that the domain should include the raw data values prior to the aggregation.
For temporal fields, domain
can be a two-element array minimum and maximum values, in
the form of either timestamps or the DateTime definition
objects.
For ordinal and nominal fields, domain
can be an array that lists valid input
values.
The selection
property can be used to interactively
determine the scale
domain.
pub fn exponent<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
[src]
The exponent of the pow
scale.
pub fn interpolate<VALUE: Into<InterpolateUnion>>(
&mut self,
value: VALUE
) -> &mut Self
[src]
&mut self,
value: VALUE
) -> &mut Self
The interpolation method for range values. By default, a general interpolator for
numbers, dates, strings and colors (in HCL space) is used. For color ranges, this
property allows interpolation in alternative color spaces. Legal values include rgb
,
hsl
, hsl-long
, lab
, hcl
, hcl-long
, cubehelix
and cubehelix-long
('-long'
variants use longer paths in polar coordinate spaces). If object-valued, this property
accepts an object with a string-valued type property and an optional numeric gamma
property applicable to rgb and cubehelix interpolators. For more, see the d3-interpolate
documentation.
- Default value:
hcl
pub fn nice<VALUE: Into<NiceUnion>>(&mut self, value: VALUE) -> &mut Self
[src]
Extending the domain so that it starts and ends on nice round values. This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. Nicing is useful if the domain is computed from data and may be irregular. For example, for a domain of [0.201479…, 0.996679…], a nice domain might be [0.2, 1.0].
For quantitative scales such as linear, nice
can be either a boolean flag or a number.
If nice
is a number, it will represent a desired tick count. This allows greater
control over the step size used to extend the bounds, guaranteeing that the returned
ticks will exactly cover the domain.
For temporal fields with time and utc scales, the nice
value can be a string indicating
the desired time interval. Legal values are "millisecond"
, "second"
, "minute"
,
"hour"
, "day"
, "week"
, "month"
, and "year"
. Alternatively, time
and utc
scales can accept an object-valued interval specifier of the form {"interval": "month", "step": 3}
, which includes a desired number of interval steps. Here, the domain would
snap to quarter (Jan, Apr, Jul, Oct) boundaries.
Default value: true
for unbinned quantitative fields; false
otherwise.
pub fn padding<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
[src]
For continuous scales,
expands the scale domain to accommodate the specified number of pixels on each of the
scale range. The scale range must represent pixels for this parameter to function as
intended. Padding adjustment is performed prior to all other adjustments, including the
effects of the zero
, nice
, domainMin
, and domainMax
properties.
For band scales, shortcut for
setting paddingInner
and paddingOuter
to the same value.
For point scales, alias for
paddingOuter
.
Default value: For continuous scales, derived from the scale
config's continuousPadding
.
For band and point scales, see paddingInner
and paddingOuter
.
pub fn padding_inner<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
[src]
The inner padding (spacing) within each band step of band scales, as a fraction of the step size. This value must lie in the range [0,1].
For point scale, this property is invalid as point scales do not have internal band widths (only step sizes between bands).
Default value: derived from the scale
config's bandPaddingInner
.
pub fn padding_outer<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
[src]
The outer padding (spacing) at the ends of the range of band and point scales, as a fraction of the step size. This value must lie in the range [0,1].
Default value: derived from the scale
config's bandPaddingOuter
for
band scales and pointPadding
for point scales.
pub fn range<VALUE: Into<ScaleRange>>(&mut self, value: VALUE) -> &mut Self
[src]
The range of the scale. One of:
-
A string indicating a pre-defined named scale range (e.g., example,
"symbol"
, or"diverging"
). -
For continuous scales, two-element array indicating minimum and maximum values, or an array with more than two entries for specifying a piecewise scale.
-
For discrete and discretizing scales, an array of desired output values.
Notes:
-
For color scales you can also specify a color
scheme
instead ofrange
. -
Any directly specified
range
forx
andy
channels will be ignored. Range can be customized via the view's corresponding size (width
andheight
) or via range steps and paddings properties for band and point scales.
pub fn range_step<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
[src]
The distance between the starts of adjacent bands or points in band and point scales.
If rangeStep
is null
or if the view contains the scale's corresponding
size (width
for x
scales and
height
for y
scales), rangeStep
will be automatically determined to fit the size of
the view.
Default value: derived the scale
config's
textXRangeStep
(90
by default) for x-scales of text
marks and rangeStep
(21
by
default) for x-scales of other marks and y-scales.
Warning: If rangeStep
is null
and the cardinality of the scale's domain is higher
than width
or height
, the rangeStep might become less than one pixel and the mark
might not appear correctly.
pub fn round<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
[src]
If true
, rounds numeric output values to integers. This can be helpful for snapping to
the pixel grid.
Default value: false
.
pub fn scheme<VALUE: Into<Scheme>>(&mut self, value: VALUE) -> &mut Self
[src]
A string indicating a color
scheme name (e.g.,
"category10"
or "blues"
) or a scheme parameter
object.
Discrete color schemes may be used with discrete or discretizing scales. Continuous color schemes are intended for use with color scales.
For the full list of supported schemes, please refer to the Vega Scheme reference.
pub fn scale_type<VALUE: Into<ScaleType>>(&mut self, value: VALUE) -> &mut Self
[src]
The type of scale. Vega-Lite supports the following categories of scale types:
-
Continuous Scales -- mapping continuous domains to continuous output ranges (
"linear"
,"pow"
,"sqrt"
,"symlog"
,"log"
,"time"
,"utc"
. -
Discrete Scales -- mapping discrete domains to discrete (
"ordinal"
) or continuous ("band"
and"point"
) output ranges. -
Discretizing Scales -- mapping continuous domains to discrete output ranges
"bin-ordinal"
,"quantile"
,"quantize"
and"threshold"
.
Default value: please see the scale type table.
pub fn zero<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
[src]
If true
, ensures that a zero baseline value is included in the scale domain.
Default value: true
for x and y channels if the quantitative field is not binned
and no custom domain
is provided; false
otherwise.
Note: Log, time, and utc scales do not support zero
.
pub fn build(&self) -> Result<Scale, String>
[src]
Trait Implementations
impl Clone for ScaleBuilder
[src]
fn clone(&self) -> ScaleBuilder
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for ScaleBuilder
[src]
fn default() -> ScaleBuilder
[src]
Auto Trait Implementations
impl Send for ScaleBuilder
impl Sync for ScaleBuilder
impl Unpin for ScaleBuilder
impl UnwindSafe for ScaleBuilder
impl RefUnwindSafe for ScaleBuilder
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,