This website is for version 5. You can find the documentation for version 4 here.

altair.param#

altair.param(name=None, value=Undefined, bind=Undefined, empty=Undefined, expr=Undefined, **kwds)#

Create a named parameter. See https://altair-viz.github.io/user_guide/interactions.html for examples. Although both variable parameters and selection parameters can be created using this ‘param’ function, to create a selection parameter, it is recommended to use either ‘selection_point’ or ‘selection_interval’ instead.

Parameters:
namestring (optional)

The name of the parameter. If not specified, a unique name will be created.

valueany (optional)

The default value of the parameter. If not specified, the parameter will be created without a default value.

bindBinding (optional)

Binds the parameter to an external input element such as a slider, selection list or radio button group.

emptyboolean (optional)

For selection parameters, the predicate of empty selections returns True by default. Override this behavior, by setting this property ‘empty=False’.

exprstr, Expression (optional)

An expression for the value of the parameter. This expression may include other parameters, in which case the parameter will automatically update in response to upstream parameter changes.

**kwds

additional keywords will be used to construct a parameter. If ‘select’ is among the keywords, then a selection parameter will be created. Otherwise, a variable parameter will be created.

Returns:
parameter: Parameter

The parameter object that can be used in chart creation.