altair.TopLevelSelectionParameter#

class altair.TopLevelSelectionParameter(name=Undefined, select=Undefined, bind=Undefined, value=Undefined, views=Undefined, **kwds)#

TopLevelSelectionParameter 的模式包装器。

参数:
namestr, ParameterName

必填。选择参数的唯一名称。选择名称应是有效的 JavaScript 标识符:它们只能包含字母数字字符(或“$”、“_”)且不能以数字开头。不能用作参数名称的保留关键字是“datum”、“event”、“item”和“parent”。

selectdict, SelectionType, PointSelectionConfig, IntervalSelectionConfig, Literal[‘point’, ‘interval’]

确定选择的默认事件处理和数据查询。Vega-Lite 目前支持两种选择类型

  • "point" – 选择多个离散数据值;首次点击选择第一个值,按住 Shift 键点击可切换附加值。

  • "interval" – 拖动时选择连续的数据值范围。

binddict, Binding, BindInput, BindRange, BindDirect, BindCheckbox, LegendBinding, BindRadioSelect, Literal[‘legend’, ‘scales’], LegendStreamBinding

设置后,选择将通过输入元素(也称为动态查询控件)或与相应图例交互来填充。默认情况下禁用直接操作交互;要重新启用它,请设置选择的 on 属性。

图例绑定仅限于只指定单个字段或编码的选择。

查询控件绑定采用 Vega 的 输入元素绑定定义 的形式,或者可以是投影字段/编码与绑定定义之间的映射。

另请参阅: bind 文档。

valuestr, bool, dict, float, DateTime, SelectionInit, PrimitiveValue, SelectionInitIntervalMapping, Sequence[dict, SelectionInitMapping], None

使用 投影通道或字段名 与初始值之间的映射来初始化选择。

另请参阅: init 文档。

viewsSequence[str]

默认情况下,顶级选择应用于可视化中的每个视图。如果指定此属性,选择将仅应用于具有指定名称的视图。

__init__(name=Undefined, select=Undefined, bind=Undefined, value=Undefined, views=Undefined, **kwds)#

方法

__init__([name, select, bind, value, views])

copy([deep, ignore])

Return a copy of the object.

from_dict(dct[, validate])

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([validate, ignore, context])

Return a dictionary representation of the object.

to_json([validate, indent, sort_keys, ...])

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.