altair.BinParams#

class altair.BinParams(anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds)#

BinParams Schema 包装器。

分箱属性或布尔标志,用于确定是否对数据进行分箱。

参数:
anchorfloat

分箱域中的一个值,用于锚定分箱,如有必要,移动分箱边界以确保边界与锚定值对齐。

默认值: 最小分箱范围值

basefloat

用于自动确定分箱的数值基数(默认为基数 10)。

默认值: 10

binnedbool

设置为 true 时,Vega-Lite 将输入数据视为已分箱。

divideSequence[float]

指示允许细分的比例因子。默认值为 [5, 2],表示对于基数 10 的数字(默认基数),该方法可能会考虑将分箱大小除以 5 和/或 2。例如,对于初始步长为 10,该方法可以检查分箱大小为 2 (= 10/5)、5 (= 10/2) 或 1 (= 10/(5*2)) 是否也满足给定约束。

默认值: [5, 2]

extentdict, Sequence[float], BinExtent, ParameterExtent

一个包含两个元素([min, max])的数组,指示所需分箱值的范围。

maxbinsfloat

最大分箱数。

默认值: rowcolumnshape 通道为 6;其他通道为 10

minstepfloat

允许的最小步长(对于整数值特别有用)。

nicebool

如果为 true,则尝试使分箱边界使用易于理解的边界,例如 10 的倍数。

默认值: true

stepfloat

分箱之间使用的精确步长。

注意: 如果提供此选项,则会忽略 maxbins 等其他选项。

stepsSequence[float]

可供选择的允许步长数组。

__init__(anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds)#

方法

__init__([anchor, base, binned, divide, ...])

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])

在 rootschema 的上下文中根据类 Schema 验证实例。

validate_property(name, value[, schema])

在 rootschema 的上下文中根据属性 Schema 验证属性。