altair.FacetedEncoding#

class altair.FacetedEncoding(angle=Undefined, color=Undefined, column=Undefined, description=Undefined, detail=Undefined, facet=Undefined, fill=Undefined, fillOpacity=Undefined, href=Undefined, key=Undefined, latitude=Undefined, latitude2=Undefined, longitude=Undefined, longitude2=Undefined, opacity=Undefined, order=Undefined, radius=Undefined, radius2=Undefined, row=Undefined, shape=Undefined, size=Undefined, stroke=Undefined, strokeDash=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, text=Undefined, theta=Undefined, theta2=Undefined, tooltip=Undefined, url=Undefined, x=Undefined, x2=Undefined, xError=Undefined, xError2=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, yError=Undefined, yError2=Undefined, yOffset=Undefined, **kwds)#

分面编码模式包装器。

Parameters:
angledict, NumericMarkPropDef, FieldOrDatumDefWithConditionDatumDefnumber, FieldOrDatumDefWithConditionMarkPropFieldDefnumber, 带条件标记的值定义属性字段或数据定义数字

点和文本标记的旋转角度。

colordict, ColorDef, FieldOrDatumDefWithConditionDatumDefGradientstringnull, FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull, ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull

标记的颜色 - 根据标记定义中的 filled 属性,决定填充颜色或描边颜色。默认情况下,color 表示 "area""bar""tick""text""trail""circle""square" 的填充颜色 / "line""point" 的描边颜色。

默认值: 如果未定义,默认颜色取决于 mark configcolor 属性。

注意: 1) 为了精确控制标记的填充和描边颜色, 请使用 fillstroke 通道。 fillstroke 编码的优先级高于 color,因此如果指定了冲突的编码,可能会覆盖 color 编码。 2) 请参见比例文档以获取有关自定义 color scheme 的更多信息。

columndict, RowColumnEncodingFieldDef

用于网格图的横向面片的字段定义。

descriptiondict, StringFieldDefWithCondition, StringValueDefWithCondition

此标记的文本描述用于ARIA无障碍访问(仅限SVG输出)。对于SVG输出,"aria-label"属性将设置为此描述。

detaildict, FieldDefWithoutScale, Sequence[dict, FieldDefWithoutScale]

在聚合视图中以及在线条、轨迹和区域标记中对数据进行分组的额外细节层次,而无需将数据映射到特定的可视化通道。

facetdict, Facet编码字段定义

用于网格图的(灵活的)面元的字段定义。

如果指定了 rowcolumn,这个通道将会被忽略。

filldict, ColorDef, FieldOrDatumDefWithConditionDatumDefGradientstringnull, FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull, ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull

标记的填充颜色。 默认值: 如果未定义,默认颜色取决于 mark configcolor 属性。

注意: fill 编码的优先级高于 color,因此如果指定了冲突的编码,可能会覆盖 color 编码。

fillOpacitydict, NumericMarkPropDef, FieldOrDatumDefWithConditionDatumDefnumber, FieldOrDatumDefWithConditionMarkPropFieldDefnumber, 带条件标记的值定义属性字段或数据定义数字

填充标记的不透明度。

默认值: 如果未定义,默认的不透明度取决于 mark configfillOpacity 属性。

hrefdict, StringFieldDefWithCondition, StringValueDefWithCondition

鼠标点击时加载的 URL。

keydict, FieldDefWithoutScale

一个数据字段,用作数据绑定的唯一键。当可视化数据更新时,将使用键值将数据元素与现有标记实例匹配。使用键通道使动态数据的过渡保持对象一致性。

latitudedict, DatumDef, LatLongDef, LatLongFieldDef

地理投影标记的纬度位置。

latitude2dict, DatumDef, Position2Def, PositionValueDef, SecondaryFieldDef

地理投影范围的纬度-2位置 "area", "bar", "rect", 和 "rule".

longitudedict, DatumDef, LatLongDef, LatLongFieldDef

地理投影标记的经度位置。

longitude2dict, DatumDef, Position2Def, PositionValueDef, SecondaryFieldDef

地理投影范围的经度-2位置 "area", "bar", "rect", 和 "rule".

opacitydict, NumericMarkPropDef, FieldOrDatumDefWithConditionDatumDefnumber, FieldOrDatumDefWithConditionMarkPropFieldDefnumber, 带条件标记的值定义属性字段或数据定义数字

标记的不透明度。

默认值: 如果未定义,默认的不透明度依赖于 标记配置opacity 属性。

orderdict, OrderOnlyDef, OrderFieldDef, OrderValueDef, Sequence[dict, OrderFieldDef]

分数的顺序。

  • 对于堆叠标记,这个 order 通道编码了 堆叠顺序

  • 对于线条和轨迹标记,这个 order 通道编码数据点在 线条中的顺序。这对于创建 a connected scatterplot 很有用。将 order 设置为 {"value": null} 会使线条标记使用数据源中的原始顺序。

  • 否则,这个 order 通道编码了标记的层次顺序。

注意: 在聚合图中, order 字段应该被 ``聚合``,以避免 创建额外的聚合分组。

radiusdict, PolarDef, PositionValueDef, 无翻译内容, PositionFieldDefBase

弧标记的外半径,以像素为单位。

radius2dict, DatumDef, Position2Def, PositionValueDef, SecondaryFieldDef

弧标记的内部半径(以像素为单位)。

rowdict, RowColumnEncodingFieldDef

一个用于网格图垂直面(facet)定义的字段。

shapedict, ShapeDef, FieldOrDatumDefWithConditionDatumDefstringnull, FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull, ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull

标记的形状。

1. 对于 point 标记,支持的值包括: - 绘制形状: "circle", "square", "cross", "diamond", "triangle-up", "triangle-down", "triangle-right", 或 "triangle-left". - 线 符号 "stroke" - 居中的方向形状 "arrow", "wedge", 或 "triangle" - 自定义 SVG 路径字符串 (为了正确的 尺寸,自定义形状路径应该在一个边界框内定义,坐标范围应在 -1 到 1 之间,沿 x 和 y 两个维度。)

  1. 对于 geoshape 标记,它应该是geojson数据的字段定义

默认值:如果未定义,默认形状取决于 mark configshape 属性。 ("circle" 如果未设置。)

sizedict, NumericMarkPropDef, FieldOrDatumDefWithConditionDatumDefnumber, FieldOrDatumDefWithConditionMarkPropFieldDefnumber, 带条件标记的值定义属性字段或数据定义数字

标记的大小。

  • 对于 "point""square""circle", - 标记的符号大小或像素区域。

  • 对于 "bar""tick" - bar 和 tick 的大小。

  • 对于 "text" - 文本的字体大小。

  • 大小不支持 "line", "area", 和 "rect".(使用 "trail" 替代具有不同大小的线)

strokedict, ColorDef, FieldOrDatumDefWithConditionDatumDefGradientstringnull, FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull, ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull

标记的笔画颜色。默认值:如果未定义,默认颜色取决于 mark configcolor 属性。

注意: stroke 编码的优先级高于 color,因此如果指定了冲突的编码,可能会覆盖 color 编码。

strokeDashdict, NumericArrayMarkPropDef, FieldOrDatumDefWithConditionDatumDefnumberArray, FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray, ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray

标记的虚线。

默认值: [1,0](没有破折号)。

strokeOpacitydict, NumericMarkPropDef, FieldOrDatumDefWithConditionDatumDefnumber, FieldOrDatumDefWithConditionMarkPropFieldDefnumber, 带条件标记的值定义属性字段或数据定义数字

标记的透明度。

默认值: 如果未定义,默认的不透明度取决于 mark configstrokeOpacity 属性。

strokeWidthdict, NumericMarkPropDef, FieldOrDatumDefWithConditionDatumDefnumber, FieldOrDatumDefWithConditionMarkPropFieldDefnumber, 带条件标记的值定义属性字段或数据定义数字

标记的笔触宽度。

默认值:如果未定义,默认的笔画宽度依赖于 mark configstrokeWidth 属性。

textdict, TextDef, ValueDefWithConditionStringFieldDefText, FieldOrDatumDefWithConditionStringDatumDefText, 字段或数据定义带条件字符串字段定义文本

文本的 text 标记。

thetadict, PolarDef, PositionValueDef, 无翻译内容, PositionFieldDefBase
  • 对于弧标记,如果未指定theta2,则为弧长(以弧度表示),否则为起始弧角度。(值为0表示向上或“北”,增加的值按顺时针方向进行。)

  • 对于文本标记,极坐标角度以弧度表示。

theta2dict, DatumDef, Position2Def, PositionValueDef, SecondaryFieldDef

弧形标记的结束角度,以弧度为单位。值为0表示向上或“北”,值增加顺时针方向进行。

tooltipdict, StringFieldDefWithCondition, StringValueDefWithCondition, Sequence[dict, StringFieldDef], None

鼠标悬停时显示的工具提示文本。指定 tooltip 编码将覆盖 标记定义中的工具提示属性

请参见tooltip文档,以获取有关Vega-Lite中tooltip的详细讨论。

urldict, StringFieldDefWithCondition, StringValueDefWithCondition

图像标记的URL。

xdict, PositionDef, PositionDatumDef, PositionFieldDef, PositionValueDef

标记的X坐标,或水平"bar""area"的宽度,未指定x2width

这个通道的 value 可以是一个数字或者字符串 "width",用于图表的宽度。

x2dict, DatumDef, Position2Def, PositionValueDef, SecondaryFieldDef

用于范围的 X2 坐标 "area", "bar", "rect", 和 "rule"

这个通道的 value 可以是一个数字或者字符串 "width",用于图表的宽度。

xErrordict, ValueDefnumber, SecondaryFieldDef

指定的 "errorbar""errorband" 的 x 坐标的错误值。

xError2dict, ValueDefnumber, SecondaryFieldDef

指定的错误的 x 坐标的次要错误值 "errorbar""errorband"

xOffsetdict, OffsetDef, ScaleDatumDef, ScaleFieldDef, ValueDefnumber

标记的x位置偏移

ydict, PositionDef, PositionDatumDef, PositionFieldDef, PositionValueDef

标记的Y坐标,或垂直 "bar""area" 的高度,没有指定 y2height

这个通道的 value 可以是一个数字或字符串 "height",用于绘图的高度。

y2dict, DatumDef, Position2Def, PositionValueDef, SecondaryFieldDef

范围内的 Y2 坐标 "area", "bar", "rect", 和 "rule".

这个通道的 value 可以是一个数字或字符串 "height",用于绘图的高度。

yErrordict, ValueDefnumber, SecondaryFieldDef

指定的 "errorbar""errorband" 的 y 坐标错误值。

yError2dict, ValueDefnumber, SecondaryFieldDef

为指定的"errorbar""errorband"的y坐标的次要错误值。

yOffsetdict, OffsetDef, ScaleDatumDef, ScaleFieldDef, ValueDefnumber

标记的y-position偏移量

__init__(angle=Undefined, color=Undefined, column=Undefined, description=Undefined, detail=Undefined, facet=Undefined, fill=Undefined, fillOpacity=Undefined, href=Undefined, key=Undefined, latitude=Undefined, latitude2=Undefined, longitude=Undefined, longitude2=Undefined, opacity=Undefined, order=Undefined, radius=Undefined, radius2=Undefined, row=Undefined, shape=Undefined, size=Undefined, stroke=Undefined, strokeDash=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, text=Undefined, theta=Undefined, theta2=Undefined, tooltip=Undefined, url=Undefined, x=Undefined, x2=Undefined, xError=Undefined, xError2=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, yError=Undefined, yError2=Undefined, yOffset=Undefined, **kwds)#

方法

__init__([角度, 颜色, 列, ...])

copy([深度, 忽略])

返回对象的副本。

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

在rootschema的上下文中验证实例是否符合类模式。

validate_property(name, value[, schema])

在根架构的上下文中,根据属性架构验证一个属性。