Struct vega_lite::MarkDef

source ·
pub struct MarkDef {
Show 48 fields pub align: Option<HorizontalAlign>, pub angle: Option<f64>, pub baseline: Option<VerticalAlign>, pub bin_spacing: Option<f64>, pub clip: Option<bool>, pub color: Option<String>, pub corner_radius: Option<f64>, pub cursor: Option<Cursor>, pub dir: Option<Dir>, pub dx: Option<f64>, pub dy: Option<f64>, pub ellipsis: Option<String>, pub fill: Option<String>, pub filled: Option<bool>, pub fill_opacity: Option<f64>, pub font: Option<String>, pub font_size: Option<f64>, pub font_style: Option<FontStyle>, pub font_weight: Option<FontWeight>, pub href: Option<String>, pub interpolate: Option<Interpolate>, pub limit: Option<f64>, pub line: Option<Line>, pub opacity: Option<f64>, pub orient: Option<Orient>, pub point: Option<PointUnion>, pub radius: Option<f64>, pub shape: Option<String>, pub size: Option<f64>, pub stroke: Option<String>, pub stroke_cap: Option<StrokeCap>, pub stroke_dash: Option<Vec<f64>>, pub stroke_dash_offset: Option<f64>, pub stroke_join: Option<StrokeJoin>, pub stroke_miter_limit: Option<f64>, pub stroke_opacity: Option<f64>, pub stroke_width: Option<f64>, pub style: Option<Style>, pub tension: Option<f64>, pub text: Option<String>, pub theta: Option<f64>, pub thickness: Option<f64>, pub tooltip: Option<Value>, pub mark_def_type: Mark, pub x2_offset: Option<f64>, pub x_offset: Option<f64>, pub y2_offset: Option<f64>, pub y_offset: Option<f64>,
}

Fields§

§align: Option<HorizontalAlign>

The horizontal alignment of the text. One of "left", "right", "center".

§angle: Option<f64>

The rotation angle of the text, in degrees.

§baseline: Option<VerticalAlign>

The vertical alignment of the text. One of "top", "middle", "bottom".

Default value: "middle"

§bin_spacing: Option<f64>

Offset between bars for binned field. Ideal value for this is either 0 (Preferred by statisticians) or 1 (Vega-Lite Default, D3 example style).

Default value: 1

§clip: Option<bool>

Whether a mark be clipped to the enclosing group’s width and height.

§color: Option<String>

Default color. Note that fill and stroke have higher precedence than color and will override color.

Default value: "#4682b4"

Note: This property cannot be used in a style config.

§corner_radius: Option<f64>

The radius in pixels of rounded rectangle corners.

Default value: 0

§cursor: Option<Cursor>

The mouse cursor used over the mark. Any valid CSS cursor type can be used.

§dir: Option<Dir>

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"

§dx: Option<f64>

The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the angle property.

§dy: Option<f64>

The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the angle property.

§ellipsis: Option<String>

The ellipsis string for text truncated in response to the limit parameter.

Default value: "…"

§fill: Option<String>

Default Fill Color. This has higher precedence than config.color

Default value: (None)

§filled: Option<bool>

Whether the mark’s color should be used as fill color instead of stroke color.

Default value: true for all marks except point and false for point.

Applicable for: bar, point, circle, square, and area marks.

Note: This property cannot be used in a style config.

§fill_opacity: Option<f64>

The fill opacity (value between [0,1]).

Default value: 1

§font: Option<String>

The typeface to set the text in (e.g., "Helvetica Neue").

§font_size: Option<f64>

The font size, in pixels.

§font_style: Option<FontStyle>

The font style (e.g., "italic").

§font_weight: Option<FontWeight>

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).

§href: Option<String>

A URL to load upon mouse click. If defined, the mark acts as a hyperlink.

§interpolate: Option<Interpolate>

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.
§limit: Option<f64>

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

§line: Option<Line>

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 ({}) or true, lines with default properties will be used.

  • If this value is false, no lines would be automatically added to area marks.

Default value: false.

§opacity: Option<f64>

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.

§orient: Option<Orient>

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.
§point: Option<PointUnion>

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 ({}) or true, 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.

§radius: Option<f64>

Polar coordinate radial offset, in pixels, of the text label from the origin determined by the x and y properties.

§shape: Option<String>

The default symbol shape to use. One of: "circle" (default), "square", "cross", "diamond", "triangle-up", or "triangle-down", or a custom SVG path.

Default value: "circle"

§size: Option<f64>

The pixel area each the point/circle/square. For example: in the case of circles, the radius is determined in part by the square root of the size value.

Default value: 30

§stroke: Option<String>

Default Stroke Color. This has higher precedence than config.color

Default value: (None)

§stroke_cap: Option<StrokeCap>

The stroke cap for line ending style. One of "butt", "round", or "square".

Default value: "square"

§stroke_dash: Option<Vec<f64>>

An array of alternating stroke, space lengths for creating dashed or dotted lines.

§stroke_dash_offset: Option<f64>

The offset (in pixels) into which to begin drawing with the stroke dash array.

§stroke_join: Option<StrokeJoin>

The stroke line join method. One of "miter", "round" or "bevel".

Default value: "miter"

§stroke_miter_limit: Option<f64>

The miter limit at which to bevel a line join.

§stroke_opacity: Option<f64>

The stroke opacity (value between [0,1]).

Default value: 1

§stroke_width: Option<f64>

The stroke width, in pixels.

§style: Option<Style>

A string or array of strings indicating the name of custom styles to apply to the mark. A style is a named collection of mark property defaults defined within the style configuration. If style is an array, later styles will override earlier styles. Any mark properties explicitly defined within the encoding will override a style default.

Default value: The mark’s name. For example, a bar mark will have style "bar" by default. Note: Any specified style will augment the default style. For example, a bar mark with "style": "foo" will receive from config.style.bar and config.style.foo (the specified style "foo" has higher precedence).

§tension: Option<f64>

Depending on the interpolation type, sets the tension parameter (for line and area marks).

§text: Option<String>

Placeholder text if the text channel is not specified

§theta: Option<f64>

Polar coordinate angle, in radians, of the text label from the origin determined by the x and y properties. Values for theta follow the same convention of arc mark startAngle and endAngle properties: angles are measured in radians, with 0 indicating “north”.

§thickness: Option<f64>

Thickness of the tick mark.

Default value: 1

§tooltip: Option<Value>

The tooltip text to show upon mouse hover.

§mark_def_type: Mark

The mark type. One of "bar", "circle", "square", "tick", "line", "area", "point", "geoshape", "rule", and "text".

§x2_offset: Option<f64>

Offset for x2-position.

§x_offset: Option<f64>

Offset for x-position.

§y2_offset: Option<f64>

Offset for y2-position.

§y_offset: Option<f64>

Offset for y-position.

Trait Implementations§

Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.