altair.TimeUnitParams#
- class altair.TimeUnitParams(binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds)#
TimeUnitParams schema 包装器。
用于编码谓词的时间单位参数,可在数据已“分箱”时指定。
- 参数:
- binnedbool
数据是否已按此时间单位分箱。如果为 true,Vega-Lite 将仅格式化数据、标记和指导线,而不会再次应用 timeUnit 转换来重新分箱数据。
- maxbinsfloat
如果未指定
unit
,则使用 maxbins 来推断时间单位。- stepfloat
箱体之间的步长数量,以提供的最低有效单位表示。
- unit
TimeUnit
,MultiTimeUnit
,SingleTimeUnit
,UtcMultiTimeUnit
,UtcSingleTimeUnit
,LocalMultiTimeUnit
,LocalSingleTimeUnit
, Literal[‘utcyear’, ‘utcquarter’, ‘utcmonth’, ‘utcweek’, ‘utcday’, ‘utcdayofyear’, ‘utcdate’, ‘utchours’, ‘utcminutes’, ‘utcseconds’, ‘utcmilliseconds’, ‘year’, ‘quarter’, ‘month’, ‘week’, ‘day’, ‘dayofyear’, ‘date’, ‘hours’, ‘minutes’, ‘seconds’, ‘milliseconds’, ‘utcyearquarter’, ‘utcyearquartermonth’, ‘utcyearmonth’, ‘utcyearmonthdate’, ‘utcyearmonthdatehours’, ‘utcyearmonthdatehoursminutes’, ‘utcyearmonthdatehoursminutesseconds’, ‘utcyearweek’, ‘utcyearweekday’, ‘utcyearweekdayhours’, ‘utcyearweekdayhoursminutes’, ‘utcyearweekdayhoursminutesseconds’, ‘utcyeardayofyear’, ‘utcquartermonth’, ‘utcmonthdate’, ‘utcmonthdatehours’, ‘utcmonthdatehoursminutes’, ‘utcmonthdatehoursminutesseconds’, ‘utcweekday’, ‘utcweekdayhours’, ‘utcweekdayhoursminutes’, ‘utcweekdayhoursminutesseconds’, ‘utcdayhours’, ‘utcdayhoursminutes’, ‘utcdayhoursminutesseconds’, ‘utchoursminutes’, ‘utchoursminutesseconds’, ‘utcminutesseconds’, ‘utcsecondsmilliseconds’, ‘yearquarter’, ‘yearquartermonth’, ‘yearmonth’, ‘yearmonthdate’, ‘yearmonthdatehours’, ‘yearmonthdatehoursminutes’, ‘yearmonthdatehoursminutesseconds’, ‘yearweek’, ‘yearweekday’, ‘yearweekdayhours’, ‘yearweekdayhoursminutes’, ‘yearweekdayhoursminutesseconds’, ‘yeardayofyear’, ‘quartermonth’, ‘monthdate’, ‘monthdatehours’, ‘monthdatehoursminutes’, ‘monthdatehoursminutesseconds’, ‘weekday’, ‘weekdayhours’, ‘weekdayhoursminutes’, ‘weekdayhoursminutesseconds’, ‘dayhours’, ‘dayhoursminutes’, ‘dayhoursminutesseconds’, ‘hoursminutes’, ‘hoursminutesseconds’, ‘minutesseconds’, ‘secondsmilliseconds’] 定义日期时间值应如何分箱。
- utcbool
如果为 True,则使用 UTC 时区。等同于使用以
utc
为前缀的TimeUnit
。
- __init__(binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds)#
方法
__init__
([binned, maxbins, step, unit, utc])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 验证属性。