altair.Config

class altair.Config(area=Undefined, autosize=Undefined, axis=Undefined, axisBand=Undefined, axisBottom=Undefined, axisDiscrete=Undefined, axisLeft=Undefined, axisPoint=Undefined, axisQuantitative=Undefined, axisRight=Undefined, axisTemporal=Undefined, axisTop=Undefined, axisX=Undefined, axisXBand=Undefined, axisXDiscrete=Undefined, axisXPoint=Undefined, axisXQuantitative=Undefined, axisXTemporal=Undefined, axisY=Undefined, axisYBand=Undefined, axisYDiscrete=Undefined, axisYPoint=Undefined, axisYQuantitative=Undefined, axisYTemporal=Undefined, background=Undefined, bar=Undefined, boxplot=Undefined, circle=Undefined, concat=Undefined, countTitle=Undefined, errorband=Undefined, errorbar=Undefined, facet=Undefined, fieldTitle=Undefined, font=Undefined, geoshape=Undefined, header=Undefined, headerColumn=Undefined, headerFacet=Undefined, headerRow=Undefined, image=Undefined, legend=Undefined, line=Undefined, lineBreak=Undefined, mark=Undefined, numberFormat=Undefined, padding=Undefined, point=Undefined, projection=Undefined, range=Undefined, rect=Undefined, rule=Undefined, scale=Undefined, selection=Undefined, square=Undefined, style=Undefined, text=Undefined, tick=Undefined, timeFormat=Undefined, title=Undefined, trail=Undefined, view=Undefined, **kwds)

Config schema wrapper

Mapping(required=[])

Attributes
areaAreaConfig

Area-Specific Config

autosizeanyOf(AutosizeType, AutoSizeParams)

How the visualization size should be determined. If a string, should be one of "pad", "fit" or "none". Object values can additionally specify parameters for content sizing and automatic resizing.

Default value : pad

axisAxisConfig

Axis configuration, which determines default properties for all x and y axes. For a full list of axis configuration options, please see the corresponding section of the axis documentation.

axisBandAxisConfig

Config for axes with “band” scales.

axisBottomAxisConfig

Config for x-axis along the bottom edge of the chart.

axisDiscreteAxisConfig

Config for axes with “point” or “band” scales.

axisLeftAxisConfig

Config for y-axis along the left edge of the chart.

axisPointAxisConfig

Config for axes with “point” scales.

axisQuantitativeAxisConfig

Config for quantitative axes.

axisRightAxisConfig

Config for y-axis along the right edge of the chart.

axisTemporalAxisConfig

Config for temporal axes.

axisTopAxisConfig

Config for x-axis along the top edge of the chart.

axisXAxisConfig

X-axis specific config.

axisXBandAxisConfig

Config for x-axes with “band” scales.

axisXDiscreteAxisConfig

Config for x-axes with “point” or “band” scales.

axisXPointAxisConfig

Config for x-axes with “point” scales.

axisXQuantitativeAxisConfig

Config for x-quantitative axes.

axisXTemporalAxisConfig

Config for x-temporal axes.

axisYAxisConfig

Y-axis specific config.

axisYBandAxisConfig

Config for y-axes with “band” scales.

axisYDiscreteAxisConfig

Config for y-axes with “point” or “band” scales.

axisYPointAxisConfig

Config for y-axes with “point” scales.

axisYQuantitativeAxisConfig

Config for y-quantitative axes.

axisYTemporalAxisConfig

Config for y-temporal axes.

backgroundColor

CSS color property to use as the background of the entire view.

Default value: "white"

barBarConfig

Bar-Specific Config

boxplotBoxPlotConfig

Box Config

circleMarkConfig

Circle-Specific Config

concatCompositionConfig

Default configuration for all concatenation and repeat view composition operators ( concat, hconcat, vconcat, and repeat )

countTitlestring

Default axis and legend title for count fields.

Default value: 'Count of Records.

errorbandErrorBandConfig

ErrorBand Config

errorbarErrorBarConfig

ErrorBar Config

facetCompositionConfig

Default configuration for the facet view composition operator

fieldTitleenum(‘verbal’, ‘functional’, ‘plain’)

Defines how Vega-Lite generates title for fields. There are three possible styles:

  • "verbal" (Default) - displays function in a verbal style (e.g., “Sum of field”, “Year-month of date”, “field (binned)”).

  • "function" - displays function using parentheses and capitalized texts (e.g., “SUM(field)”, “YEARMONTH(date)”, “BIN(field)”).

  • "plain" - displays only the field name without functions (e.g., “field”, “date”, “field”).

fontstring

Default font for all text marks, titles, and labels.

geoshapeMarkConfig

Geoshape-Specific Config

headerHeaderConfig

Header configuration, which determines default properties for all headers.

For a full list of header configuration options, please see the corresponding section of in the header documentation.

headerColumnHeaderConfig

Header configuration, which determines default properties for column headers.

For a full list of header configuration options, please see the corresponding section of in the header documentation.

headerFacetHeaderConfig

Header configuration, which determines default properties for non-row/column facet headers.

For a full list of header configuration options, please see the corresponding section of in the header documentation.

headerRowHeaderConfig

Header configuration, which determines default properties for row headers.

For a full list of header configuration options, please see the corresponding section of in the header documentation.

imageRectConfig

Image-specific Config

legendLegendConfig

Legend configuration, which determines default properties for all legends. For a full list of legend configuration options, please see the corresponding section of in the legend documentation.

lineLineConfig

Line-Specific Config

lineBreakstring

A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property provides a global default for text marks, which is overridden by mark or style config settings, and by the lineBreak mark encoding channel. If signal-valued, either string or regular expression (regexp) values are valid.

markMarkConfig

Mark Config

numberFormatstring

D3 Number format for guide labels and text marks. For example "s" for SI units. Use D3’s number format pattern.

paddingPadding

The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format {"left": 5, "top": 5, "right": 5, "bottom": 5} to specify padding for each side of the visualization.

Default value : 5

pointMarkConfig

Point-Specific Config

projectionProjectionConfig

Projection configuration, which determines default properties for all projections. For a full list of projection configuration options, please see the corresponding section of the projection documentation.

rangeRangeConfig

An object hash that defines default range arrays or schemes for using with scales. For a full list of scale range configuration options, please see the corresponding section of the scale documentation.

rectRectConfig

Rect-Specific Config

ruleMarkConfig

Rule-Specific Config

scaleScaleConfig

Scale configuration determines default properties for all scales. For a full list of scale configuration options, please see the corresponding section of the scale documentation.

selectionSelectionConfig

An object hash for defining default properties for each type of selections.

squareMarkConfig

Square-Specific Config

styleStyleConfigIndex

An object hash that defines key-value mappings to determine default properties for marks with a given style. The keys represent styles names; the values have to be valid mark configuration objects.

textMarkConfig

Text-Specific Config

tickTickConfig

Tick-Specific Config

timeFormatstring

Default time format for raw time values (without time units) in text marks, legend labels and header labels.

Default value: "%b %d, %Y" Note: Axes automatically determine the format for each label automatically so this config does not affect axes.

titleTitleConfig

Title configuration, which determines default properties for all titles. For a full list of title configuration options, please see the corresponding section of the title documentation.

trailLineConfig

Trail-Specific Config

viewViewConfig

Default properties for single view plots.

__init__(self, area=Undefined, autosize=Undefined, axis=Undefined, axisBand=Undefined, axisBottom=Undefined, axisDiscrete=Undefined, axisLeft=Undefined, axisPoint=Undefined, axisQuantitative=Undefined, axisRight=Undefined, axisTemporal=Undefined, axisTop=Undefined, axisX=Undefined, axisXBand=Undefined, axisXDiscrete=Undefined, axisXPoint=Undefined, axisXQuantitative=Undefined, axisXTemporal=Undefined, axisY=Undefined, axisYBand=Undefined, axisYDiscrete=Undefined, axisYPoint=Undefined, axisYQuantitative=Undefined, axisYTemporal=Undefined, background=Undefined, bar=Undefined, boxplot=Undefined, circle=Undefined, concat=Undefined, countTitle=Undefined, errorband=Undefined, errorbar=Undefined, facet=Undefined, fieldTitle=Undefined, font=Undefined, geoshape=Undefined, header=Undefined, headerColumn=Undefined, headerFacet=Undefined, headerRow=Undefined, image=Undefined, legend=Undefined, line=Undefined, lineBreak=Undefined, mark=Undefined, numberFormat=Undefined, padding=Undefined, point=Undefined, projection=Undefined, range=Undefined, rect=Undefined, rule=Undefined, scale=Undefined, selection=Undefined, square=Undefined, style=Undefined, text=Undefined, tick=Undefined, timeFormat=Undefined, title=Undefined, trail=Undefined, view=Undefined, **kwds)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(self[, area, autosize, axis, …])

Initialize self.

copy(self[, 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 in the context of this object’s schema or root schema.

to_dict(self[, validate, ignore, context])

Return a dictionary representation of the object

to_json(self[, validate, ignore, context, …])

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.

validate_property(name, value[, schema])

Validate a property against property schema in the context of the rootschema

copy(self, deep=True, ignore=())

Return a copy of the object

Parameters
deepboolean or list, optional

If True (default) then return a deep copy of all dict, list, and SchemaBase objects within the object structure. If False, then only copy the top object. If a list or iterable, then only copy the listed attributes.

ignorelist, optional

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

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

Construct class from a dictionary representation

Parameters
dctdictionary

The dict from which to construct the class

validateboolean

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

_wrapper_classeslist (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
objSchema object

The wrapped schema

Raises
jsonschema.ValidationError :

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

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

Instantiate the object from a valid JSON string

Parameters
json_stringstring

The string containing a valid JSON chart specification.

validateboolean

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

**kwargs :

Additional keyword arguments are passed to json.loads

Returns
chartChart object

The altair Chart object built from the specification.

classmethod resolve_references(schema=None)

Resolve references in the context of this object’s schema or root schema.

to_dict(self, validate=True, ignore=None, context=None)

Return a dictionary representation of the object

Parameters
validateboolean 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.

ignorelist

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

contextdict (optional)

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

Returns
dctdictionary

The dictionary representation of this object

Raises
jsonschema.ValidationError :

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

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

Emit the JSON representation for this object as a string.

Parameters
validateboolean 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.

ignorelist

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

contextdict (optional)

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

indentinteger, default 2

the number of spaces of indentation to use

sort_keysboolean, default True

if True, sort keys in the output

**kwargs

Additional keyword arguments are passed to json.dumps()

Returns
specstring

The JSON specification of the chart object.

classmethod validate(instance, schema=None)

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

classmethod validate_property(name, value, schema=None)

Validate a property against property schema in the context of the rootschema