Struct vega_lite_4::StyleValueBuilder
source · pub struct StyleValueBuilder { /* private fields */ }
Expand description
Builder for StyleValue
.
Implementations§
source§impl StyleValueBuilder
impl StyleValueBuilder
sourcepub fn align<VALUE: Into<TitleAlignUnion>>(&mut self, value: VALUE) -> &mut Self
pub fn align<VALUE: Into<TitleAlignUnion>>(&mut self, value: VALUE) -> &mut Self
The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One
of "left"
, "right"
, "center"
.
Note: Expression reference is not supported for range marks.
sourcepub fn angle<VALUE: Into<Angle>>(&mut self, value: VALUE) -> &mut Self
pub fn angle<VALUE: Into<Angle>>(&mut self, value: VALUE) -> &mut Self
The rotation angle of the text, in degrees.
sourcepub fn aria<VALUE: Into<Aria>>(&mut self, value: VALUE) -> &mut Self
pub fn aria<VALUE: Into<Aria>>(&mut self, value: VALUE) -> &mut Self
A boolean flag indicating if ARIA
attributes should be
included (SVG output only). If false
, the “aria-hidden” attribute will be set on the
output SVG element, removing the mark item from the ARIA accessibility tree.
sourcepub fn aria_role<VALUE: Into<Box<Color>>>(&mut self, value: VALUE) -> &mut Self
pub fn aria_role<VALUE: Into<Box<Color>>>(&mut self, value: VALUE) -> &mut Self
Sets the type of user interface element of the mark item for ARIA accessibility (SVG output only). If specified, this property determines the “role” attribute. Warning: this property is experimental and may be changed in the future.
sourcepub fn aria_role_description<VALUE: Into<Box<Color>>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn aria_role_description<VALUE: Into<Box<Color>>>( &mut self, value: VALUE ) -> &mut Self
A human-readable, author-localized description for the role of the mark item for ARIA accessibility (SVG output only). If specified, this property determines the “aria-roledescription” attribute. Warning: this property is experimental and may be changed in the future.
sourcepub fn aspect<VALUE: Into<Aria>>(&mut self, value: VALUE) -> &mut Self
pub fn aspect<VALUE: Into<Aria>>(&mut self, value: VALUE) -> &mut Self
Whether to keep aspect ratio of image marks.
sourcepub fn baseline<VALUE: Into<TextBaseline>>(&mut self, value: VALUE) -> &mut Self
pub fn baseline<VALUE: Into<TextBaseline>>(&mut self, value: VALUE) -> &mut Self
For text marks, the vertical text baseline. One of "alphabetic"
(default), "top"
,
"middle"
, "bottom"
, "line-top"
, "line-bottom"
, or an expression reference that
provides one of the valid values. The "line-top"
and "line-bottom"
values operate
similarly to "top"
and "bottom"
, but are calculated relative to the lineHeight
rather than fontSize
alone.
For range marks, the vertical alignment of the marks. One of "top"
, "middle"
,
"bottom"
.
Note: Expression reference is not supported for range marks.
sourcepub fn bin_spacing<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
pub fn bin_spacing<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
Offset between bars for binned field. The ideal value for this is either 0 (preferred by statisticians) or 1 (Vega-Lite default, D3 example style).
Default value: 1
sourcepub fn blend<VALUE: Into<BlendUnion>>(&mut self, value: VALUE) -> &mut Self
pub fn blend<VALUE: Into<BlendUnion>>(&mut self, value: VALUE) -> &mut Self
The color blend mode for drawing an item on its current background. Any valid CSS mix-blend-mode value can be used.
__Default value: "source-over"
sourcepub fn color<VALUE: Into<StyleColor>>(&mut self, value: VALUE) -> &mut Self
pub fn color<VALUE: Into<StyleColor>>(&mut self, value: VALUE) -> &mut Self
Default color.
Default value: ■ "#4682b4"
Note: - This property cannot be used in a style
config. - The fill
and
stroke
properties have higher precedence than color
and will override color
.
sourcepub fn continuous_band_size<VALUE: Into<f64>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn continuous_band_size<VALUE: Into<f64>>( &mut self, value: VALUE ) -> &mut Self
The default size of the bars on continuous scales.
Default value: 5
sourcepub fn corner_radius<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn corner_radius<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
The radius in pixels of rounded rectangles or arcs’ corners.
Default value: 0
sourcepub fn corner_radius_bottom_left<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn corner_radius_bottom_left<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
The radius in pixels of rounded rectangles’ bottom left corner.
Default value: 0
sourcepub fn corner_radius_bottom_right<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn corner_radius_bottom_right<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
The radius in pixels of rounded rectangles’ bottom right corner.
Default value: 0
sourcepub fn corner_radius_top_left<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn corner_radius_top_left<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
The radius in pixels of rounded rectangles’ top right corner.
Default value: 0
sourcepub fn corner_radius_top_right<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn corner_radius_top_right<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
The radius in pixels of rounded rectangles’ top left corner.
Default value: 0
sourcepub fn cursor<VALUE: Into<CursorUnion>>(&mut self, value: VALUE) -> &mut Self
pub fn cursor<VALUE: Into<CursorUnion>>(&mut self, value: VALUE) -> &mut Self
The mouse cursor used over the mark. Any valid CSS cursor type can be used.
sourcepub fn description<VALUE: Into<Box<Color>>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn description<VALUE: Into<Box<Color>>>( &mut self, value: VALUE ) -> &mut Self
A text description of the mark item for ARIA accessibility (SVG output only). If specified, this property determines the “aria-label” attribute.
sourcepub fn dir<VALUE: Into<Dir>>(&mut self, value: VALUE) -> &mut Self
pub fn dir<VALUE: Into<Dir>>(&mut self, value: VALUE) -> &mut Self
The direction of the text. One of "ltr"
(left-to-right) or "rtl"
(right-to-left).
This property determines on which side is truncated in response to the limit parameter.
Default value: "ltr"
sourcepub fn discrete_band_size<VALUE: Into<f64>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn discrete_band_size<VALUE: Into<f64>>( &mut self, value: VALUE ) -> &mut Self
The default size of the bars with discrete dimensions. If unspecified, the default size
is step-2
, which provides 2 pixel offset between bars.
sourcepub fn dx<VALUE: Into<CornerRadiusUnion>>(&mut self, value: VALUE) -> &mut Self
pub fn dx<VALUE: Into<CornerRadiusUnion>>(&mut self, value: VALUE) -> &mut Self
The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the angle property.
sourcepub fn dy<VALUE: Into<CornerRadiusUnion>>(&mut self, value: VALUE) -> &mut Self
pub fn dy<VALUE: Into<CornerRadiusUnion>>(&mut self, value: VALUE) -> &mut Self
The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the angle property.
sourcepub fn ellipsis<VALUE: Into<Box<Color>>>(&mut self, value: VALUE) -> &mut Self
pub fn ellipsis<VALUE: Into<Box<Color>>>(&mut self, value: VALUE) -> &mut Self
The ellipsis string for text truncated in response to the limit parameter.
Default value: "…"
sourcepub fn end_angle<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn end_angle<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
The end angle in radians for arc marks. A value of 0
indicates up (north), increasing
values proceed clockwise.
sourcepub fn fill<VALUE: Into<StyleFill>>(&mut self, value: VALUE) -> &mut Self
pub fn fill<VALUE: Into<StyleFill>>(&mut self, value: VALUE) -> &mut Self
Default fill color. This property has higher precedence than config.color
. Set to
null
to remove fill.
Default value: (None)
sourcepub fn filled<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn filled<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Whether the mark’s color should be used as fill color instead of stroke color.
Default value: false
for all point
, line
, and rule
marks as well as
geoshape
marks for
graticule
data sources;
otherwise, true
.
Note: This property cannot be used in a style config.
sourcepub fn fill_opacity<VALUE: Into<Opacity>>(&mut self, value: VALUE) -> &mut Self
pub fn fill_opacity<VALUE: Into<Opacity>>(&mut self, value: VALUE) -> &mut Self
The fill opacity (value between [0,1]).
Default value: 1
sourcepub fn font<VALUE: Into<Box<Color>>>(&mut self, value: VALUE) -> &mut Self
pub fn font<VALUE: Into<Box<Color>>>(&mut self, value: VALUE) -> &mut Self
The typeface to set the text in (e.g., "Helvetica Neue"
).
sourcepub fn font_size<VALUE: Into<FontSize>>(&mut self, value: VALUE) -> &mut Self
pub fn font_size<VALUE: Into<FontSize>>(&mut self, value: VALUE) -> &mut Self
The font size, in pixels.
Default value: 11
sourcepub fn font_style<VALUE: Into<Box<Color>>>(&mut self, value: VALUE) -> &mut Self
pub fn font_style<VALUE: Into<Box<Color>>>(&mut self, value: VALUE) -> &mut Self
The font style (e.g., "italic"
).
sourcepub fn font_weight<VALUE: Into<FontWeightUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn font_weight<VALUE: Into<FontWeightUnion>>( &mut self, value: VALUE ) -> &mut Self
The font weight. This can be either a string (e.g "bold"
, "normal"
) or a number
(100
, 200
, 300
, …, 900
where "normal"
= 400
and "bold"
= 700
).
sourcepub fn height<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn height<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
Height of the marks.
sourcepub fn href<VALUE: Into<Box<Color>>>(&mut self, value: VALUE) -> &mut Self
pub fn href<VALUE: Into<Box<Color>>>(&mut self, value: VALUE) -> &mut Self
A URL to load upon mouse click. If defined, the mark acts as a hyperlink.
sourcepub fn inner_radius<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn inner_radius<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
The inner radius in pixels of arc marks. innerRadius
is an alias for radius2
.
sourcepub fn interpolate<VALUE: Into<MarkConfigExprOrSignalRefInterpolate>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn interpolate<VALUE: Into<MarkConfigExprOrSignalRefInterpolate>>( &mut self, value: VALUE ) -> &mut Self
The line interpolation method to use for line and area marks. One of the following: -
"linear"
: piecewise linear segments, as in a polyline. - "linear-closed"
: close the
linear segments to form a polygon. - "step"
: alternate between horizontal and vertical
segments, as in a step function. - "step-before"
: alternate between vertical and
horizontal segments, as in a step function. - "step-after"
: alternate between
horizontal and vertical segments, as in a step function. - "basis"
: a B-spline, with
control point duplication on the ends. - "basis-open"
: an open B-spline; may not
intersect the start or end. - "basis-closed"
: a closed B-spline, as in a loop. -
"cardinal"
: a Cardinal spline, with control point duplication on the ends. -
"cardinal-open"
: an open Cardinal spline; may not intersect the start or end, but will
intersect other control points. - "cardinal-closed"
: a closed Cardinal spline, as in a
loop. - "bundle"
: equivalent to basis, except the tension parameter is used to
straighten the spline. - "monotone"
: cubic interpolation that preserves monotonicity in
y.
sourcepub fn invalid<VALUE: Into<RemovableValue<Invalid>>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn invalid<VALUE: Into<RemovableValue<Invalid>>>( &mut self, value: VALUE ) -> &mut Self
Defines how Vega-Lite should handle marks for invalid values (null
and NaN
). - If set
to "filter"
(default), all data items with null values will be skipped (for line,
trail, and area marks) or filtered (for other marks). - If null
, all data items are
included. In this case, invalid values will be interpreted as zeroes.
sourcepub fn limit<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn limit<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.
Default value: 0
– indicating no limit
sourcepub fn line_break<VALUE: Into<Box<Color>>>(&mut self, value: VALUE) -> &mut Self
pub fn line_break<VALUE: Into<Box<Color>>>(&mut self, value: VALUE) -> &mut Self
A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued.
sourcepub fn line_height<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn line_height<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.
sourcepub fn opacity<VALUE: Into<Opacity>>(&mut self, value: VALUE) -> &mut Self
pub fn opacity<VALUE: Into<Opacity>>(&mut self, value: VALUE) -> &mut Self
The overall opacity (value between [0,1]).
Default value: 0.7
for non-aggregate plots with point
, tick
, circle
, or
square
marks or layered bar
charts and 1
otherwise.
sourcepub fn order<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn order<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
For line and trail marks, this order
property can be set to null
or false
to make
the lines use the original order in the data sources.
sourcepub fn orient<VALUE: Into<StyleOrient>>(&mut self, value: VALUE) -> &mut Self
pub fn orient<VALUE: Into<StyleOrient>>(&mut self, value: VALUE) -> &mut Self
The orientation of a non-stacked bar, tick, area, and line charts. The value is either
horizontal (default) or vertical. - For bar, rule and tick, this determines whether the
size of the bar and tick should be applied to x or y dimension. - For area, this property
determines the orient property of the Vega output. - For line and trail marks, this
property determines the sort order of the points in the line if config.sortLineBy
is
not specified. For stacked charts, this is always determined by the orientation of the
stack; therefore explicitly specified value will be ignored.
The orientation of the axis. One of "top"
, "bottom"
, "left"
or "right"
. The
orientation can be used to further specialize the axis type (e.g., a y-axis oriented
towards the right edge of the chart).
Default value: "bottom"
for x-axes and "left"
for y-axes.
sourcepub fn outer_radius<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn outer_radius<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
The outer radius in pixels of arc marks. outerRadius
is an alias for radius
.
sourcepub fn pad_angle<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn pad_angle<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
The angular padding applied to sides of the arc, in radians.
sourcepub fn radius<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn radius<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
For arc mark, the primary (outer) radius in pixels.
For text marks, polar coordinate radial offset, in pixels, of the text from the origin
determined by the x
and y
properties.
sourcepub fn radius2<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn radius2<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
The secondary (inner) radius in pixels of arc marks.
sourcepub fn shape<VALUE: Into<Box<Color>>>(&mut self, value: VALUE) -> &mut Self
pub fn shape<VALUE: Into<Box<Color>>>(&mut self, value: VALUE) -> &mut Self
Shape of the point marks. Supported values include: - plotting shapes: "circle"
,
"square"
, "cross"
, "diamond"
, "triangle-up"
, "triangle-down"
,
"triangle-right"
, or "triangle-left"
. - the line symbol "stroke"
- centered
directional shapes "arrow"
, "wedge"
, or "triangle"
- a custom SVG path
string (For correct
sizing, custom shape paths should be defined within a square bounding box with
coordinates ranging from -1 to 1 along both the x and y dimensions.)
Default value: "circle"
sourcepub fn size<VALUE: Into<FontSize>>(&mut self, value: VALUE) -> &mut Self
pub fn size<VALUE: Into<FontSize>>(&mut self, value: VALUE) -> &mut Self
Default size for marks. - For point
/circle
/square
, this represents the pixel area
of the marks. Note that this value sets the area of the symbol; the side lengths will
increase with the square root of this value. - For bar
, this represents the band size
of the bar, in pixels. - For text
, this represents the font size, in pixels.
Default value: - 30
for point, circle, square marks; width/height’s step
- 2
for bar marks with discrete dimensions; - 5
for bar marks with continuous dimensions; -
11
for text marks.
sourcepub fn smooth<VALUE: Into<Aria>>(&mut self, value: VALUE) -> &mut Self
pub fn smooth<VALUE: Into<Aria>>(&mut self, value: VALUE) -> &mut Self
A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization.
sourcepub fn start_angle<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn start_angle<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
The start angle in radians for arc marks. A value of 0
indicates up (north), increasing
values proceed clockwise.
sourcepub fn stroke<VALUE: Into<StyleFill>>(&mut self, value: VALUE) -> &mut Self
pub fn stroke<VALUE: Into<StyleFill>>(&mut self, value: VALUE) -> &mut Self
Default stroke color. This property has higher precedence than config.color
. Set to
null
to remove stroke.
Default value: (None)
sourcepub fn stroke_cap<VALUE: Into<Cap>>(&mut self, value: VALUE) -> &mut Self
pub fn stroke_cap<VALUE: Into<Cap>>(&mut self, value: VALUE) -> &mut Self
The stroke cap for line ending style. One of "butt"
, "round"
, or "square"
.
Default value: "butt"
sourcepub fn stroke_dash<VALUE: Into<StrokeDashUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn stroke_dash<VALUE: Into<StrokeDashUnion>>( &mut self, value: VALUE ) -> &mut Self
An array of alternating stroke, space lengths for creating dashed or dotted lines.
sourcepub fn stroke_dash_offset<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn stroke_dash_offset<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
The offset (in pixels) into which to begin drawing with the stroke dash array.
sourcepub fn stroke_join<VALUE: Into<StrokeJoinUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn stroke_join<VALUE: Into<StrokeJoinUnion>>( &mut self, value: VALUE ) -> &mut Self
The stroke line join method. One of "miter"
, "round"
or "bevel"
.
Default value: "miter"
sourcepub fn stroke_miter_limit<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn stroke_miter_limit<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
The miter limit at which to bevel a line join.
sourcepub fn stroke_offset<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn stroke_offset<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid.
sourcepub fn stroke_opacity<VALUE: Into<Opacity>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn stroke_opacity<VALUE: Into<Opacity>>( &mut self, value: VALUE ) -> &mut Self
The stroke opacity (value between [0,1]).
Default value: 1
sourcepub fn stroke_width<VALUE: Into<FontSize>>(&mut self, value: VALUE) -> &mut Self
pub fn stroke_width<VALUE: Into<FontSize>>(&mut self, value: VALUE) -> &mut Self
The stroke width, in pixels.
sourcepub fn tension<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn tension<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
Depending on the interpolation type, sets the tension parameter (for line and area marks).
sourcepub fn text<VALUE: Into<ConditionalPredicateValueDefTextExprRefText>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn text<VALUE: Into<ConditionalPredicateValueDefTextExprRefText>>( &mut self, value: VALUE ) -> &mut Self
Text-Specific Config
Placeholder text if the text
channel is not specified
sourcepub fn theta<VALUE: Into<Angle>>(&mut self, value: VALUE) -> &mut Self
pub fn theta<VALUE: Into<Angle>>(&mut self, value: VALUE) -> &mut Self
-
For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)
-
For text marks, polar coordinate angle in radians.
sourcepub fn theta2<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn theta2<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise.
sourcepub fn time_unit_band<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
pub fn time_unit_band<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
Default relative band size for a time unit. If set to 1
, the bandwidth of the marks
will be equal to the time unit band step. If set to 0.5
, bandwidth of the marks will be
half of the time unit band step.
sourcepub fn time_unit_band_position<VALUE: Into<f64>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn time_unit_band_position<VALUE: Into<f64>>( &mut self, value: VALUE ) -> &mut Self
Default relative band position for a time unit. If set to 0
, the marks will be
positioned at the beginning of the time unit band step. If set to 0.5
, the marks will
be positioned in the middle of the time unit band step.
sourcepub fn tooltip<VALUE: Into<StyleTooltip>>(&mut self, value: VALUE) -> &mut Self
pub fn tooltip<VALUE: Into<StyleTooltip>>(&mut self, value: VALUE) -> &mut Self
The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.
- If
tooltip
istrue
or{"content": "encoding"}
, then all fields fromencoding
will be used. - Iftooltip
is{"content": "data"}
, then all fields that appear in the highlighted data point will be used. - If set tonull
orfalse
, then no tooltip will be used.
See the tooltip
documentation for
a detailed discussion about tooltip in Vega-Lite.
Default value: null
sourcepub fn url<VALUE: Into<Box<Color>>>(&mut self, value: VALUE) -> &mut Self
pub fn url<VALUE: Into<Box<Color>>>(&mut self, value: VALUE) -> &mut Self
The URL of the image file for image marks.
sourcepub fn width<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn width<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
Width of the marks.
sourcepub fn x<VALUE: Into<XUnion>>(&mut self, value: VALUE) -> &mut Self
pub fn x<VALUE: Into<XUnion>>(&mut self, value: VALUE) -> &mut Self
X coordinates of the marks, or width of horizontal "bar"
and "area"
without specified
x2
or width
.
The value
of this channel can be a number or a string "width"
for the width of the
plot.
sourcepub fn x2<VALUE: Into<XUnion>>(&mut self, value: VALUE) -> &mut Self
pub fn x2<VALUE: Into<XUnion>>(&mut self, value: VALUE) -> &mut Self
X2 coordinates for ranged "area"
, "bar"
, "rect"
, and "rule"
.
The value
of this channel can be a number or a string "width"
for the width of the
plot.
sourcepub fn y<VALUE: Into<YUnion>>(&mut self, value: VALUE) -> &mut Self
pub fn y<VALUE: Into<YUnion>>(&mut self, value: VALUE) -> &mut Self
Y coordinates of the marks, or height of vertical "bar"
and "area"
without specified
y2
or height
.
The value
of this channel can be a number or a string "height"
for the height of the
plot.
sourcepub fn y2<VALUE: Into<YUnion>>(&mut self, value: VALUE) -> &mut Self
pub fn y2<VALUE: Into<YUnion>>(&mut self, value: VALUE) -> &mut Self
Y2 coordinates for ranged "area"
, "bar"
, "rect"
, and "rule"
.
The value
of this channel can be a number or a string "height"
for the height of the
plot.
sourcepub fn line<VALUE: Into<Line>>(&mut self, value: VALUE) -> &mut Self
pub fn line<VALUE: Into<Line>>(&mut self, value: VALUE) -> &mut Self
A flag for overlaying line on top of area marks, or an object defining the properties of the overlayed lines.
-
If this value is an empty object (
{}
) ortrue
, lines with default properties will be used. -
If this value is
false
, no lines would be automatically added to area marks.
Default value: false
.
Line-Specific Config
sourcepub fn point<VALUE: Into<PointUnion>>(&mut self, value: VALUE) -> &mut Self
pub fn point<VALUE: Into<PointUnion>>(&mut self, value: VALUE) -> &mut Self
A flag for overlaying points on top of line or area marks, or an object defining the properties of the overlayed points.
-
If this property is
"transparent"
, transparent points will be used (for enhancing tooltips and selections). -
If this property is an empty object (
{}
) ortrue
, filled points with default properties will be used. -
If this property is
false
, no points would be automatically added to line or area marks.
Default value: false
.
Point-Specific Config
sourcepub fn corner_radius_end<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn corner_radius_end<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
- For vertical bars, top-left and top-right corner radius. - For horizontal bars, top-right and bottom-right corner radius.
sourcepub fn band_size<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
pub fn band_size<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
The width of the ticks.
Default value: 3/4 of step (width step for horizontal ticks and height step for vertical ticks).
sourcepub fn thickness<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
pub fn thickness<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
Thickness of the tick mark.
Default value: 1
pub fn band_position<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn domain<VALUE: Into<Aria>>(&mut self, value: VALUE) -> &mut Self
pub fn domain_cap<VALUE: Into<Cap>>(&mut self, value: VALUE) -> &mut Self
pub fn domain_color<VALUE: Into<Box<Color>>>( &mut self, value: VALUE ) -> &mut Self
pub fn domain_dash<VALUE: Into<StrokeDashUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn domain_dash_offset<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn domain_opacity<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn domain_width<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
sourcepub fn format<VALUE: Into<Format>>(&mut self, value: VALUE) -> &mut Self
pub fn format<VALUE: Into<Format>>(&mut self, value: VALUE) -> &mut Self
When used with the default "number"
and "time"
format type, the text formatting
pattern for labels of guides (axes, legends, headers) and text marks.
- If the format type is
"number"
(e.g., for quantitative fields), this is D3’s number format pattern. - If the format type is"time"
(e.g., for temporal fields), this is D3’s time format pattern.
See the format documentation for more examples.
When used with a custom
formatType
, this
value will be passed as format
alongside datum.value
to the registered function.
Default value: Derived from numberFormat config for number format and from timeFormat config for time format.
sourcepub fn format_type<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn format_type<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
The format type for labels. One of "number"
, "time"
, or a registered custom format
type.
Default value: - "time"
for temporal fields and ordinal and nominal fields with
timeUnit
. - "number"
for quantitative fields as well as ordinal and nominal fields
without timeUnit
.
sourcepub fn grid<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn grid<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
A boolean flag indicating if grid lines should be included as part of the axis
Default value: true
for continuous
scales that are not binned;
otherwise, false
.
pub fn grid_cap<VALUE: Into<Cap>>(&mut self, value: VALUE) -> &mut Self
pub fn grid_color<VALUE: Into<GridColorUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn grid_dash<VALUE: Into<AxisGridDash>>( &mut self, value: VALUE ) -> &mut Self
pub fn grid_dash_offset<VALUE: Into<GridDashOffsetUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn grid_opacity<VALUE: Into<GridOpacityUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn grid_width<VALUE: Into<GridWidthUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn label_align<VALUE: Into<ConditionalAxisPropertyAlignNull>>( &mut self, value: VALUE ) -> &mut Self
pub fn label_angle<VALUE: Into<LabelAngle>>( &mut self, value: VALUE ) -> &mut Self
pub fn label_baseline<VALUE: Into<PurpleTextBaseline>>( &mut self, value: VALUE ) -> &mut Self
pub fn label_bound<VALUE: Into<Label>>(&mut self, value: VALUE) -> &mut Self
pub fn label_color<VALUE: Into<GridColorUnion>>( &mut self, value: VALUE ) -> &mut Self
sourcepub fn label_expr<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn label_expr<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
Vega expression for customizing labels.
Note: The label text and value can be assessed via the label
and value
properties
of the axis’s backing datum
object.
sourcepub fn label_flush<VALUE: Into<LabelFlush>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn label_flush<VALUE: Into<LabelFlush>>( &mut self, value: VALUE ) -> &mut Self
Indicates if the first and last axis labels should be aligned flush with the scale range. Flush alignment for a horizontal axis will left-align the first label and right-align the last label. For vertical axes, bottom and top text baselines are applied instead. If this property is a number, it also indicates the number of pixels by which to offset the first and last labels; for example, a value of 2 will flush-align the first and last labels and also push them 2 pixels outward from the center of the axis. The additional adjustment can sometimes help the labels better visually group with corresponding axis ticks.
Default value: true
for axis of a continuous x-scale. Otherwise, false
.
pub fn label_flush_offset<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn label_font<VALUE: Into<ConditionalAxisPropertyStringNull>>( &mut self, value: VALUE ) -> &mut Self
pub fn label_font_size<VALUE: Into<GridWidthUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn label_font_style<VALUE: Into<ConditionalAxisPropertyFontStyleNull>>( &mut self, value: VALUE ) -> &mut Self
pub fn label_font_weight<VALUE: Into<FontWeight>>( &mut self, value: VALUE ) -> &mut Self
pub fn label_limit<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn label_line_height<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn label_offset<VALUE: Into<GridDashOffsetUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn label_opacity<VALUE: Into<GridDashOffsetUnion>>( &mut self, value: VALUE ) -> &mut Self
sourcepub fn label_overlap<VALUE: Into<LabelOverlapUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn label_overlap<VALUE: Into<LabelOverlapUnion>>( &mut self, value: VALUE ) -> &mut Self
The strategy to use for resolving overlap of axis labels. If false
(the default), no
overlap reduction is attempted. If set to true
or "parity"
, a strategy of removing
every other label is used (this works well for standard linear axes). If set to
"greedy"
, a linear scan of the labels is performed, removing any labels that overlaps
with the last visible label (this often works better for log-scaled axes).
Default value: true
for non-nominal fields with non-log scales; "greedy"
for log
scales; otherwise false
.
pub fn label_padding<VALUE: Into<GridDashOffsetUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn labels<VALUE: Into<Aria>>(&mut self, value: VALUE) -> &mut Self
pub fn label_separation<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn max_extent<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn min_extent<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
sourcepub fn offset<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
pub fn offset<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
The offset, in pixels, by which to displace the axis from the edge of the enclosing group or data rectangle.
Default value: derived from the axis
config’s offset
(0
by default)
sourcepub fn position<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn position<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
The anchor position of the axis in pixels. For x-axes with top or bottom orientation, this sets the axis group x coordinate. For y-axes with left or right orientation, this sets the axis group y coordinate.
Default value: 0
sourcepub fn style<VALUE: Into<LegendText>>(&mut self, value: VALUE) -> &mut Self
pub fn style<VALUE: Into<LegendText>>(&mut self, value: VALUE) -> &mut Self
A string or array of strings indicating the name of custom styles to apply to the axis. A style is a named collection of axis property defined within the style configuration. If style is an array, later styles will override earlier styles.
Default value: (none) Note: Any specified style will augment the default style.
For example, an x-axis mark with "style": "foo"
will use config.axisX
and
config.style.foo
(the specified style "foo"
has higher precedence).
pub fn tick_band<VALUE: Into<TickBandUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn tick_cap<VALUE: Into<Cap>>(&mut self, value: VALUE) -> &mut Self
pub fn tick_color<VALUE: Into<GridColorUnion>>( &mut self, value: VALUE ) -> &mut Self
sourcepub fn tick_count<VALUE: Into<TickCount>>(&mut self, value: VALUE) -> &mut Self
pub fn tick_count<VALUE: Into<TickCount>>(&mut self, value: VALUE) -> &mut Self
A desired number of ticks, for axes visualizing quantitative scales. The resulting number may be different so that values are “nice” (multiples of 2, 5, 10) and lie within the underlying scale’s range.
For scales of type "time"
or "utc"
, the tick count can instead be a time interval
specifier. Legal string values are "millisecond"
, "second"
, "minute"
, "hour"
,
"day"
, "week"
, "month"
, and "year"
. Alternatively, an object-valued interval
specifier of the form {"interval": "month", "step": 3}
includes a desired number of
interval steps. Here, ticks are generated for each quarter (Jan, Apr, Jul, Oct)
boundary.
Default value: Determine using a formula ceil(width/40)
for x and ceil(height/40)
for y.
pub fn tick_dash<VALUE: Into<AxisTickDash>>( &mut self, value: VALUE ) -> &mut Self
pub fn tick_dash_offset<VALUE: Into<GridDashOffsetUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn tick_extra<VALUE: Into<Aria>>(&mut self, value: VALUE) -> &mut Self
sourcepub fn tick_min_step<VALUE: Into<CornerRadiusUnion>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn tick_min_step<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
The minimum desired step between axis ticks, in terms of scale domain values. For
example, a value of 1
indicates that ticks should not be less than 1 unit apart. If
tickMinStep
is specified, the tickCount
value will be adjusted, if necessary, to
enforce the minimum step value.
pub fn tick_offset<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn tick_opacity<VALUE: Into<GridDashOffsetUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn tick_round<VALUE: Into<Aria>>(&mut self, value: VALUE) -> &mut Self
pub fn ticks<VALUE: Into<Aria>>(&mut self, value: VALUE) -> &mut Self
pub fn tick_size<VALUE: Into<GridWidthUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn tick_width<VALUE: Into<GridWidthUnion>>( &mut self, value: VALUE ) -> &mut Self
sourcepub fn title<VALUE: Into<RemovableValue<LegendText>>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn title<VALUE: Into<RemovableValue<LegendText>>>( &mut self, value: VALUE ) -> &mut Self
A title for the field. If null
, the title will be removed.
Default value: derived from the field’s name and transformation function
(aggregate
, bin
and timeUnit
). If the field has an aggregate function, the function
is displayed as part of the title (e.g., "Sum of Profit"
). If the field is binned or
has a time unit applied, the applied function is shown in parentheses (e.g., "Profit (binned)"
, "Transaction Date (year-month)"
). Otherwise, the title is simply the field
name.
Notes:
-
You can customize the default field title format by providing the
fieldTitle
property in the config orfieldTitle
function via thecompile
function’s options. -
If both field definition’s
title
and axis, header, or legendtitle
are defined, axis/header/legend title will be used.
pub fn title_align<VALUE: Into<TitleAlignUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn title_anchor<VALUE: Into<TitleAnchorUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn title_angle<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn title_baseline<VALUE: Into<TextBaseline>>( &mut self, value: VALUE ) -> &mut Self
pub fn title_color<VALUE: Into<Box<Color>>>( &mut self, value: VALUE ) -> &mut Self
pub fn title_font<VALUE: Into<Box<Color>>>(&mut self, value: VALUE) -> &mut Self
pub fn title_font_size<VALUE: Into<FontSize>>( &mut self, value: VALUE ) -> &mut Self
pub fn title_font_style<VALUE: Into<Box<Color>>>( &mut self, value: VALUE ) -> &mut Self
pub fn title_font_weight<VALUE: Into<FontWeightUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn title_limit<VALUE: Into<FontSize>>(&mut self, value: VALUE) -> &mut Self
pub fn title_line_height<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn title_opacity<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn title_padding<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn title_x<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn title_y<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
pub fn translate<VALUE: Into<CornerRadiusUnion>>( &mut self, value: VALUE ) -> &mut Self
sourcepub fn values<VALUE: Into<Values>>(&mut self, value: VALUE) -> &mut Self
pub fn values<VALUE: Into<Values>>(&mut self, value: VALUE) -> &mut Self
Explicitly set the visible axis tick values.
sourcepub fn zindex<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
pub fn zindex<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
A non-negative integer indicating the z-index of the axis. If zindex is 0, axes should be
drawn behind all chart elements. To put them in front, set zindex
to 1
or more.
Default value: 0
(behind the marks).
sourcepub fn build(&self) -> Result<StyleValue, StyleValueBuilderError>
pub fn build(&self) -> Result<StyleValue, StyleValueBuilderError>
Trait Implementations§
source§impl Clone for StyleValueBuilder
impl Clone for StyleValueBuilder
source§fn clone(&self) -> StyleValueBuilder
fn clone(&self) -> StyleValueBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more