[][src]Struct vega_lite_3::Encoding

A key-value mapping between encoding channels and definition of fields.

A shared key-value mapping between encoding channels and definition of fields in the underlying layers.

Fields

color: Option<DefWithConditionMarkPropFieldDefStringNull>

Color of the marks – either fill or stroke color based on the filled property of mark definition. By default, color represents fill color for "area", "bar", "tick", "text", "trail", "circle", and "square" / stroke color for "line" and "point".

Default value: If undefined, the default color depends on mark config's color property.

Note:

  1. For fine-grained control over both fill and stroke colors of the marks, please use the fill and stroke channels. If either fill or stroke channel is specified, color channel will be ignored.
  2. See the scale documentation for more information about customizing color scheme.
column: Option<FacetFieldDef>

A field definition for the horizontal facet of trellis plots.

detail: Option<Detail>

Additional levels of detail for grouping data in aggregate views and in line, trail, and area marks without mapping data to a specific visual channel.

facet: Option<FacetFieldDef>

A field definition for the (flexible) facet of trellis plots.

If either row or column is specified, this channel will be ignored.

fill: Option<DefWithConditionMarkPropFieldDefStringNull>

Fill color of the marks. Default value: If undefined, the default color depends on mark config's color property.

Note: When using fill channel, color channel will be ignored. To customize both fill and stroke, please use fill and stroke channels (not fill and color).

fill_opacity: Option<DefWithConditionMarkPropFieldDefNumber>

Fill opacity of the marks.

Default value: If undefined, the default opacity depends on mark config's fillOpacity property.

href: Option<HrefClass>

A URL to load upon mouse click.

key: Option<TypedFieldDef>

A data field to use as a unique key for data binding. When a visualization’s data is updated, the key value will be used to match data elements to existing mark instances. Use a key channel to enable object constancy for transitions over dynamic data.

latitude: Option<LatitudeClass>

Latitude position of geographically projected marks.

latitude2: Option<Latitude2Class>

Latitude-2 position for geographically projected ranged "area", "bar", "rect", and "rule".

longitude: Option<LatitudeClass>

Longitude position of geographically projected marks.

longitude2: Option<Latitude2Class>

Longitude-2 position for geographically projected ranged "area", "bar", "rect", and "rule".

opacity: Option<DefWithConditionMarkPropFieldDefNumber>

Opacity of the marks.

Default value: If undefined, the default opacity depends on mark config's opacity property.

order: Option<Order>

Order of the marks.

  • For stacked marks, this order channel encodes stack order.
  • For line and trail marks, this order channel encodes order of data points in the lines. This can be useful for creating a connected scatterplot. Setting order to {"value": null} makes the line marks use the original order in the data sources.
  • Otherwise, this order channel encodes layer order of the marks.

Note: In aggregate plots, order field should be aggregated to avoid creating additional aggregation grouping.

row: Option<FacetFieldDef>

A field definition for the vertical facet of trellis plots.

shape: Option<DefWithConditionMarkPropFieldDefTypeForShapeStringNull>

Shape of the mark.

  1. For point marks the 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.)
  1. For geoshape marks it should be a field definition of the geojson data

Default value: If undefined, the default shape depends on mark config's shape property. ("circle" if unset.)

size: Option<DefWithConditionMarkPropFieldDefNumber>

Size of the mark.

  • For "point", "square" and "circle", – the symbol size, or pixel area of the mark.
  • For "bar" and "tick" – the bar and tick's size.
  • For "text" – the text's font size.
  • Size is unsupported for "line", "area", and "rect". (Use "trail" instead of line with varying size)
stroke: Option<DefWithConditionMarkPropFieldDefStringNull>

Stroke color of the marks. Default value: If undefined, the default color depends on mark config's color property.

Note: When using stroke channel, color channel will be ignored. To customize both stroke and fill, please use stroke and fill channels (not stroke and color).

stroke_opacity: Option<DefWithConditionMarkPropFieldDefNumber>

Stroke opacity of the marks.

Default value: If undefined, the default opacity depends on mark config's strokeOpacity property.

stroke_width: Option<DefWithConditionMarkPropFieldDefNumber>

Stroke width of the marks.

Default value: If undefined, the default stroke width depends on mark config's strokeWidth property.

text: Option<HrefClass>

Text of the text mark.

tooltip: RemovableValue<Tooltip>

The tooltip text to show upon mouse hover.

x: Option<XClass>

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.

x2: Option<X2Class>

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.

x_error: Option<Latitude2Class>

Error value of x coordinates for error specified "errorbar" and "errorband".

x_error2: Option<Latitude2Class>

Secondary error value of x coordinates for error specified "errorbar" and "errorband".

y: Option<YClass>

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.

y2: Option<Y2Class>

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.

y_error: Option<Latitude2Class>

Error value of y coordinates for error specified "errorbar" and "errorband".

y_error2: Option<Latitude2Class>

Secondary error value of y coordinates for error specified "errorbar" and "errorband".

Trait Implementations

impl Clone for Encoding[src]

impl Debug for Encoding[src]

impl Default for Encoding[src]

impl<'de> Deserialize<'de> for Encoding[src]

impl Serialize for Encoding[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.