altair.SelectionParameter#
- class altair.SelectionParameter(name=Undefined, select=Undefined, bind=Undefined, value=Undefined, **kwds)#
SelectionParameter schema 包装器。
- 参数:
- namestr,
ParameterName
必需。选择参数的唯一名称。选择名称应为有效的 JavaScript 标识符:它们应只包含字母、数字(或“$”、“_”),且不能以数字开头。不能用作参数名称的保留关键字有“datum”、“event”、“item”和“parent”。
- selectdict,
SelectionType
, Literal[‘point’, ‘interval’],PointSelectionConfig
,IntervalSelectionConfig
确定选择的默认事件处理和数据查询。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 文档。
- namestr,
- __init__(name=Undefined, select=Undefined, bind=Undefined, value=Undefined, **kwds)#
方法
__init__
([name, select, bind, value])copy
([deep, ignore])返回对象的副本。
from_dict
(dct[, validate])从字典表示构造类。
from_json
(json_string[, validate])从有效的 JSON 字符串实例化对象。
resolve_references
([schema])在此对象的 schema 或根 schema 上下文中解析引用。
to_dict
([validate, ignore, context])返回对象的字典表示。
to_json
([validate, indent, sort_keys, ...])将此对象的 JSON 表示作为字符串输出。
validate
(instance[, schema])在根 schema 上下文中,根据类 schema 验证实例。
validate_property
(name, value[, schema])在根 schema 上下文中,根据属性 schema 验证属性。