altair.UnitSpecWithFrame#

class altair.UnitSpecWithFrame(mark=Undefined, data=Undefined, description=Undefined, encoding=Undefined, height=Undefined, name=Undefined, params=Undefined, projection=Undefined, title=Undefined, transform=Undefined, view=Undefined, width=Undefined, **kwds)#

UnitSpecWithFrame 模式封装器。

参数:
markdict, Mark, AnyMark, BoxPlot, MarkDef, ErrorBar, ErrorBand, BoxPlotDef, ErrorBarDef, ErrorBandDef, CompositeMark, CompositeMarkDef, Literal[‘arc’, ‘area’, ‘bar’, ‘image’, ‘line’, ‘point’, ‘rect’, ‘rule’, ‘text’, ‘tick’, ‘trail’, ‘circle’, ‘square’, ‘geoshape’, ‘boxplot’, ‘errorband’, ‘errorbar’]

描述标记类型的字符串(包括"bar", "circle", "square", "tick", "line", "area", "point", "rule", "geoshape""text" 之一)或标记定义对象

datadict, Data, UrlData, Generator, NamedData, DataSource, InlineData, SphereGenerator, SequenceGenerator, GraticuleGenerator, None

描述数据源的对象。设为 null 可忽略父级的数据源。如果未设置数据,则从父级继承。

descriptionstr

此标记的描述,用于注释目的。

encodingdict, Encoding

编码通道与字段定义之间的键值映射。

heightdict, float, Step, Literal[‘container’]

可视化图表的高度。

  • 对于具有连续 Y 字段的图表,高度应为数字。

  • 对于具有离散 Y 字段或没有 Y 字段的图表,高度可以是表示固定高度的数字,也可以是形如 {step: number} 的对象,用于定义每个离散步骤的高度。(没有 Y 字段相当于只有一个离散步骤。)

  • 要启用高度的响应式调整,应将其设置为 "container"

默认值: 对于具有连续 Y 字段的图表,基于 config.view.continuousHeight;否则基于 config.view.discreteHeight

注意: 对于带有行和列通道的图表,这表示单个视图的高度,不能使用 "container" 选项。

另请参见: height 文档。

namestr

可视化的名称,用于后续引用。

paramsSequence[dict, SelectionParameter]

参数数组,可以是简单变量,也可以是将用户输入映射到数据查询的更复杂的选择。

projectiondict, Projection

定义地理投影属性的对象,将应用于 "geoshape" 标记的 shape 路径,以及其他标记的 latitude"longitude" 通道。

titlestr, dict, Text, Sequence[str], TitleParams

图表的标题。

transformSequence[dict, Transform, BinTransform, FoldTransform, LoessTransform, PivotTransform, StackTransform, ExtentTransform, FilterTransform, ImputeTransform, LookupTransform, SampleTransform, WindowTransform, DensityTransform, FlattenTransform, QuantileTransform, TimeUnitTransform, AggregateTransform, CalculateTransform, RegressionTransform, JoinAggregateTransform]

数据转换数组,例如筛选和新字段计算。

viewdict, ViewBackground

定义视图背景填充和描边属性的对象。

默认值: 无(透明)

widthdict, float, Step, Literal[‘container’]

可视化图表的宽度。

  • 对于具有连续 X 字段的图表,宽度应为数字。

  • 对于具有离散 X 字段或没有 X 字段的图表,宽度可以是表示固定宽度的数字,也可以是形如 {step: number} 的对象,用于定义每个离散步骤的宽度。(没有 X 字段相当于只有一个离散步骤。)

  • 要启用宽度的响应式调整,应将其设置为 "container"

默认值: 对于具有连续 X 字段的图表,基于 config.view.continuousWidth;否则基于 config.view.discreteWidth

注意: 对于带有行和列通道的图表,这表示单个视图的宽度,不能使用 "container" 选项。

另请参见: width 文档。

__init__(mark=Undefined, data=Undefined, description=Undefined, encoding=Undefined, height=Undefined, name=Undefined, params=Undefined, projection=Undefined, title=Undefined, transform=Undefined, view=Undefined, width=Undefined, **kwds)#

方法

__init__([mark, data, description, ...])

copy([deep, ignore])

返回对象的副本。

from_dict(dct[, validate])

从字典表示构造类。

from_json(json_string[, validate])

从有效的 JSON 字符串实例化对象。

resolve_references([schema])

在此对象模式或根模式的上下文中解析引用。

to_dict([validate, ignore, context])

返回对象的字典表示。

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

将此对象的 JSON 表示输出为字符串。

validate(instance[, schema])

在根模式的上下文中,根据类模式验证实例。

validate_property(name, value[, schema])

在根模式的上下文中,根据属性模式验证属性。