altair.OverlayMarkDef

class altair.OverlayMarkDef(align=Undefined, angle=Undefined, baseline=Undefined, clip=Undefined, color=Undefined, cornerRadius=Undefined, cursor=Undefined, dir=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, href=Undefined, interpolate=Undefined, limit=Undefined, opacity=Undefined, orient=Undefined, radius=Undefined, shape=Undefined, size=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, tension=Undefined, text=Undefined, theta=Undefined, tooltip=Undefined, x2Offset=Undefined, xOffset=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds)

OverlayMarkDef schema wrapper

Mapping(required=[])

Attributes:
align : HorizontalAlign

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

angle : float

The rotation angle of the text, in degrees.

baseline : VerticalAlign

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

Default value: "middle"

clip : boolean

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

color : 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.

cornerRadius : float

The radius in pixels of rounded rectangle corners.

Default value: 0

cursor : Cursor

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

dir : 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 : float

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

dy : float

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

ellipsis : string

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

Default value: "…"

fill : string

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

Default value: (None)

fillOpacity : float

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

Default value: 1

filled : boolean

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.

font : string

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

fontSize : float

The font size, in pixels.

fontStyle : FontStyle

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

fontWeight : 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 : string

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

interpolate : 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 : float

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

opacity : float

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

radius : float

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

shape : 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 : float

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 : string

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

Default value: (None)

strokeCap : StrokeCap

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

Default value: "square"

strokeDash : List(float)

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

strokeDashOffset : float

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

strokeJoin : StrokeJoin

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

Default value: "miter"

strokeMiterLimit : float

The miter limit at which to bevel a line join.

strokeOpacity : float

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

Default value: 1

strokeWidth : float

The stroke width, in pixels.

style : anyOf(string, List(string))

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 : float

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

text : string

Placeholder text if the text channel is not specified

theta : float

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

tooltip : Mapping(required=[])

The tooltip text to show upon mouse hover.

x2Offset : float

Offset for x2-position.

xOffset : float

Offset for x-position.

y2Offset : float

Offset for y2-position.

yOffset : float

Offset for y-position.

__init__(align=Undefined, angle=Undefined, baseline=Undefined, clip=Undefined, color=Undefined, cornerRadius=Undefined, cursor=Undefined, dir=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, href=Undefined, interpolate=Undefined, limit=Undefined, opacity=Undefined, orient=Undefined, radius=Undefined, shape=Undefined, size=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, tension=Undefined, text=Undefined, theta=Undefined, tooltip=Undefined, x2Offset=Undefined, xOffset=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds)

Methods

__init__([align, angle, baseline, clip, …])
copy([deep, ignore]) Return a copy of the object
from_dict(dct[, validate, _wrapper_classes]) Construct class from a dictionary representation
from_json(json_string[, validate]) Instantiate the object from a valid JSON string
resolve_references(schema) Resolve references of the schema the context of this object’s schema
to_dict([validate, ignore, context]) Return a dictionary representation of the object
to_json([validate, ignore, context, indent, …]) Emit the JSON representation for this object as a string.
validate(instance[, schema]) Validate the instance against the class schema in the context of the rootschema.
copy(deep=True, ignore=())

Return a copy of the object

Parameters:
deep : boolean, optional

if True (default) then return a deep copy of all dict, list, and SchemaBase objects within the object structure

ignore : list, optional

A list of keys for which the contents should not be copied, but only stored by reference.

from_dict(dct, validate=True, _wrapper_classes=None)

Construct class from a dictionary representation

Parameters:
dct : dictionary

The dict from which to construct the class

validate : boolean

If True (default), then validate the input against the schema.

_wrapper_classes : list (optional)

The set of SchemaBase classes to use when constructing wrappers of the dict inputs. If not specified, the result of cls._default_wrapper_classes will be used.

Returns:
obj : Schema object

The wrapped schema

Raises:
jsonschema.ValidationError :

if validate=True and dct does not conform to the schema

from_json(json_string, validate=True, **kwargs)

Instantiate the object from a valid JSON string

Parameters:
json_string : string

The string containing a valid JSON chart specification.

validate : boolean

If True (default), then validate the input against the schema.

**kwargs :

Additional keyword arguments are passed to json.loads

Returns:
chart : Chart object

The altair Chart object built from the specification.

resolve_references(schema)

Resolve references of the schema the context of this object’s schema

to_dict(validate=True, ignore=[], context={})

Return a dictionary representation of the object

Parameters:
validate : boolean or string

If True (default), then validate the output dictionary against the schema. If “deep” then recursively validate all objects in the spec. This takes much more time, but it results in friendlier tracebacks for large objects.

ignore : list

A list of keys to ignore. This will not passed to child to_dict function calls.

context : dict (optional)

A context dictionary that will be passed to all child to_dict function calls

Returns:
dct : dictionary

The dictionary representation of this object

Raises:
jsonschema.ValidationError :

if validate=True and the dict does not conform to the schema

to_json(validate=True, ignore=[], context={}, indent=2, sort_keys=True, **kwargs)

Emit the JSON representation for this object as a string.

Parameters:
validate : boolean or string

If True (default), then validate the output dictionary against the schema. If “deep” then recursively validate all objects in the spec. This takes much more time, but it results in friendlier tracebacks for large objects.

ignore : list

A list of keys to ignore. This will not passed to child to_dict function calls.

context : dict (optional)

A context dictionary that will be passed to all child to_dict function calls

indent : integer, default 2

the number of spaces of indentation to use

sort_keys : boolean, default True

if True, sort keys in the output

**kwargs

Additional keyword arguments are passed to json.dumps()

Returns:
spec : string

The JSON specification of the chart object.

validate(instance, schema=None)

Validate the instance against the class schema in the context of the rootschema.