altair.Config#

class altair.Config(arc=Undefined, area=Undefined, aria=Undefined, autosize=Undefined, axis=Undefined, axisBand=Undefined, axisBottom=Undefined, axisDiscrete=Undefined, axisLeft=Undefined, axisPoint=Undefined, axisQuantitative=Undefined, axisRight=Undefined, axisTemporal=Undefined, axisTop=Undefined, axisX=Undefined, axisXBand=Undefined, axisXDiscrete=Undefined, axisXPoint=Undefined, axisXQuantitative=Undefined, axisXTemporal=Undefined, axisY=Undefined, axisYBand=Undefined, axisYDiscrete=Undefined, axisYPoint=Undefined, axisYQuantitative=Undefined, axisYTemporal=Undefined, background=Undefined, bar=Undefined, boxplot=Undefined, circle=Undefined, concat=Undefined, countTitle=Undefined, customFormatTypes=Undefined, errorband=Undefined, errorbar=Undefined, facet=Undefined, fieldTitle=Undefined, font=Undefined, geoshape=Undefined, header=Undefined, headerColumn=Undefined, headerFacet=Undefined, headerRow=Undefined, image=Undefined, legend=Undefined, line=Undefined, lineBreak=Undefined, locale=Undefined, mark=Undefined, normalizedNumberFormat=Undefined, normalizedNumberFormatType=Undefined, numberFormat=Undefined, numberFormatType=Undefined, padding=Undefined, params=Undefined, point=Undefined, projection=Undefined, range=Undefined, rect=Undefined, rule=Undefined, scale=Undefined, selection=Undefined, square=Undefined, style=Undefined, text=Undefined, tick=Undefined, timeFormat=Undefined, timeFormatType=Undefined, title=Undefined, tooltipFormat=Undefined, trail=Undefined, view=Undefined, **kwds)#

Config 模式封装器。

参数:
arcdict, RectConfig

Arc 特定配置

areadict, AreaConfig

Area 特定配置

ariabool

一个布尔标志,指示是否应包含标记和引导线(仅限 SVG 输出)的 ARIA 默认属性。如果为 false,将为所有引导线设置 "aria-hidden" 属性,将其从 ARIA 可访问性树中移除,并且 Vega-Lite 将不会为标记生成默认描述。

默认值: true

autosizedict, AutosizeType, AutoSizeParams, Literal[‘pad’, ‘none’, ‘fit’, ‘fit-x’, ‘fit-y’]

可视化大小应如何确定。如果为字符串,则应为 "pad""fit""none" 之一。对象值还可以额外指定内容大小调整和自动调整大小的参数。

默认值: pad

axisdict, AxisConfig

轴配置,用于确定所有 x 轴和 y 的默认属性。有关完整的轴配置选项列表,请参见轴文档的相应部分

axisBanddict, AxisConfig

带有“band”比例的轴的配置。

axisBottomdict, AxisConfig

图表底部边缘沿 x 轴的配置。

axisDiscretedict, AxisConfig

带有“point”或“band”比例的轴的配置。

axisLeftdict, AxisConfig

图表左侧边缘沿 y 轴的配置。

axisPointdict, AxisConfig

带有“point”比例的轴的配置。

axisQuantitativedict, AxisConfig

定量轴的配置。

axisRightdict, AxisConfig

图表右侧边缘沿 y 轴的配置。

axisTemporaldict, AxisConfig

时间轴的配置。

axisTopdict, AxisConfig

图表顶部边缘沿 x 轴的配置。

axisXdict, AxisConfig

X 轴特定配置。

axisXBanddict, AxisConfig

带有“band”比例的 X 轴的配置。

axisXDiscretedict, AxisConfig

带有“point”或“band”比例的 X 轴的配置。

axisXPointdict, AxisConfig

带有“point”比例的 X 轴的配置。

axisXQuantitativedict, AxisConfig

定量 X 轴的配置。

axisXTemporaldict, AxisConfig

时间性 X 轴的配置。

axisYdict, AxisConfig

Y 轴特定配置。

axisYBanddict, AxisConfig

带有“band”比例的 Y 轴的配置。

axisYDiscretedict, AxisConfig

带有“point”或“band”比例的 Y 轴的配置。

axisYPointdict, AxisConfig

带有“point”比例的 Y 轴的配置。

axisYQuantitativedict, AxisConfig

定量 Y 轴的配置。

axisYTemporaldict, AxisConfig

时间性 Y 轴的配置。

backgroundstr, dict, Color, ExprRef, HexColor, ColorName, Literal[‘black’, ‘silver’, ‘gray’, ‘white’, ‘maroon’, ‘red’, ‘purple’, ‘fuchsia’, ‘green’, ‘lime’, ‘olive’, ‘yellow’, ‘navy’, ‘blue’, ‘teal’, ‘aqua’, ‘orange’, ‘aliceblue’, ‘antiquewhite’, ‘aquamarine’, ‘azure’, ‘beige’, ‘bisque’, ‘blanchedalmond’, ‘blueviolet’, ‘brown’, ‘burlywood’, ‘cadetblue’, ‘chartreuse’, ‘chocolate’, ‘coral’, ‘cornflowerblue’, ‘cornsilk’, ‘crimson’, ‘cyan’, ‘darkblue’, ‘darkcyan’, ‘darkgoldenrod’, ‘darkgray’, ‘darkgreen’, ‘darkgrey’, ‘darkkhaki’, ‘darkmagenta’, ‘darkolivegreen’, ‘darkorange’, ‘darkorchid’, ‘darkred’, ‘darksalmon’, ‘darkseagreen’, ‘darkslateblue’, ‘darkslategray’, ‘darkslategrey’, ‘darkturquoise’, ‘darkviolet’, ‘deeppink’, ‘deepskyblue’, ‘dimgray’, ‘dimgrey’, ‘dodgerblue’, ‘firebrick’, ‘floralwhite’, ‘forestgreen’, ‘gainsboro’, ‘ghostwhite’, ‘gold’, ‘goldenrod’, ‘greenyellow’, ‘grey’, ‘honeydew’, ‘hotpink’, ‘indianred’, ‘indigo’, ‘ivory’, ‘khaki’, ‘lavender’, ‘lavenderblush’, ‘lawngreen’, ‘lemonchiffon’, ‘lightblue’, ‘lightcoral’, ‘lightcyan’, ‘lightgoldenrodyellow’, ‘lightgray’, ‘lightgreen’, ‘lightgrey’, ‘lightpink’, ‘lightsalmon’, ‘lightseagreen’, ‘lightskyblue’, ‘lightslategray’, ‘lightslategrey’, ‘lightsteelblue’, ‘lightyellow’, ‘limegreen’, ‘linen’, ‘magenta’, ‘mediumaquamarine’, ‘mediumblue’, ‘mediumorchid’, ‘mediumpurple’, ‘mediumseagreen’, ‘mediumslateblue’, ‘mediumspringgreen’, ‘mediumturquoise’, ‘mediumvioletred’, ‘midnightblue’, ‘mintcream’, ‘mistyrose’, ‘moccasin’, ‘navajowhite’, ‘oldlace’, ‘olivedrab’, ‘orangered’, ‘orchid’, ‘palegoldenrod’, ‘palegreen’, ‘paleturquoise’, ‘palevioletred’, ‘papayawhip’, ‘peachpuff’, ‘peru’, ‘pink’, ‘plum’, ‘powderblue’, ‘rosybrown’, ‘royalblue’, ‘saddlebrown’, ‘salmon’, ‘sandybrown’, ‘seagreen’, ‘seashell’, ‘sienna’, ‘skyblue’, ‘slateblue’, ‘slategray’, ‘slategrey’, ‘snow’, ‘springgreen’, ‘steelblue’, ‘tan’, ‘thistle’, ‘tomato’, ‘turquoise’, ‘violet’, ‘wheat’, ‘whitesmoke’, ‘yellowgreen’, ‘rebeccapurple’]

用作整个视图背景的 CSS 颜色属性。

默认值: "white"

bardict, BarConfig

Bar 特定配置

boxplotdict, BoxPlotConfig

Box 配置

circledict, MarkConfig

Circle 特定配置

concatdict, CompositionConfig

所有拼接和重复视图组合运算符(concathconcatvconcatrepeat)的默认配置

countTitlestr

计数字段的默认轴和图例标题。

默认值: 'Count of Records

customFormatTypesbool

允许文本标记和引导线的 formatType 属性接受注册为 Vega 表达式的自定义格式化函数。

errorbanddict, ErrorBandConfig

ErrorBand 配置

errorbardict, ErrorBarConfig

ErrorBar 配置

facetdict, CompositionConfig

facet 视图组合运算符的默认配置

fieldTitleLiteral[‘verbal’, ‘functional’, ‘plain’]

定义 Vega-Lite 如何为字段生成标题。有三种可能的样式

  • "verbal" (默认) - 以口头样式显示函数(例如,“Sum of field”,“Year-month of date”,“field (binned)”)。

  • "function" - 使用括号和大写文本显示函数(例如,“SUM(field)”,“YEARMONTH(date)”,“BIN(field)”)。

  • "plain" - 仅显示字段名称而不带函数(例如,“field”,“date”,“field”)。

fontstr

所有文本标记、标题和标签的默认字体。

geoshapedict, MarkConfig

Geoshape 特定配置

headerdict, HeaderConfig

头部配置,用于确定所有头部的默认属性。

有关完整的头部配置选项列表,请参见头部文档中的相应部分

headerColumndict, HeaderConfig

头部配置,用于确定列头部的默认属性。

有关完整的头部配置选项列表,请参见头部文档中的相应部分

headerFacetdict, HeaderConfig

头部配置,用于确定非行/列分面头部的默认属性。

有关完整的头部配置选项列表,请参见头部文档中的相应部分

headerRowdict, HeaderConfig

头部配置,用于确定行头部的默认属性。

有关完整的头部配置选项列表,请参见头部文档中的相应部分

imagedict, RectConfig

Image 特定配置

legenddict, LegendConfig

图例配置,用于确定所有图例的默认属性。有关完整的图例配置选项列表,请参见图例文档中的相应部分

linedict, LineConfig

Line 特定配置

lineBreakstr, dict, ExprRef

一个分隔符,例如换行符,用于将文本字符串分解成多行。此属性为文本标记提供了一个全局默认值,该值会被标记或样式配置设置以及 lineBreak 标记编码通道覆盖。如果值为信号值,则字符串或正则表达式 (regexp) 值均有效。

localedict, Locale

用于解析字符串和格式化数字及日期值的本地化定义。本地化对象应包含具有本地化定义number 和/或 time 属性。配置块中提供的本地化定义可能会被 View 构造函数的本地化选项覆盖。

markdict, MarkConfig

Mark 配置

normalizedNumberFormatstr

如果未指定 normalizedNumberFormatType,则为标准化堆叠字段(带有 stack: "normalize" 的字段)的轴标签、文本标记和工具提示使用 D3 数字格式。例如,"s" 表示 SI 单位。使用D3 的数字格式模式

如果指定了 config.normalizedNumberFormatType 并且 config.customFormatTypestrue,此值将作为 formatdatum.value 一起传递给 config.numberFormatType 函数。默认值: %

normalizedNumberFormatTypestr

config.normalizedNumberFormat自定义格式类型

默认值: undefined – 这等同于调用 D3-format,它在 Vega-Expression 中作为 format 公开注意: 您还必须将 customFormatTypes 设置为 true 才能使用此功能。

numberFormatstr

如果未指定 numberFormatType,则为非标准化字段(不带 stack: "normalize" 的字段)的引导线标签、文本标记和工具提示使用 D3 数字格式。例如,"s" 表示 SI 单位。使用D3 的数字格式模式

如果指定了 config.numberFormatType 并且 config.customFormatTypestrue,此值将作为 formatdatum.value 一起传递给 config.numberFormatType 函数。

numberFormatTypestr

config.numberFormat自定义格式类型

默认值: undefined – 这等同于调用 D3-format,它在 Vega-Expression 中作为 format 公开注意: 您还必须将 customFormatTypes 设置为 true 才能使用此功能。

paddingdict, float, ExprRef, Padding

默认可视化填充,以像素为单位,从可视化画布边缘到数据矩形。如果为数字,则指定所有边的填充。如果为对象,则值应具有 {"left": 5, "top": 5, "right": 5, "bottom": 5} 的格式,以指定可视化的每一侧的填充。

默认值: 5

paramsSequence[dict, TopLevelParameter, VariableParameter, TopLevelSelectionParameter]

动态变量或选择,用于参数化可视化。

pointdict, MarkConfig

Point 特定配置

projectiondict, ProjectionConfig

投影配置,用于确定所有投影的默认属性。有关完整的投影配置选项列表,请参见投影文档的相应部分

rangedict, RangeConfig

一个对象哈希,定义了用于比例尺的默认范围数组或方案。有关完整的比例尺范围配置选项列表,请参见比例尺文档的相应部分

rectdict, RectConfig

Rect 特定配置

ruledict, MarkConfig

Rule 特定配置

scaledict, ScaleConfig

比例尺配置确定所有比例尺的默认属性。有关完整的比例尺配置选项列表,请参见比例尺文档的相应部分

selectiondict, SelectionConfig

一个对象哈希,用于定义每种选择类型的默认属性。

squaredict, MarkConfig

Square 特定配置

styledict, StyleConfigIndex

一个对象哈希,定义了键值映射,用于确定具有给定样式的标记的默认属性。键表示样式名称;值必须是有效的标记配置对象

textdict, MarkConfig

Text 特定配置

tickdict, TickConfig

Tick 特定配置

timeFormatstr

文本标记、图例标签和头部标签中原始时间值(不带时间单位)的默认时间格式。

默认值: "%b %d, %Y" 注意: 轴会自动确定每个标签的格式,因此此配置不会影响轴。

timeFormatTypestr

config.timeFormat自定义格式类型

默认值: undefined – 这等同于调用 D3-time-format,它在 Vega-Expression 中作为 timeFormat 公开注意: 您还必须将 customFormatTypes 设置为 true,并且不得定义 timeUnit 才能使用此功能。

titledict, TitleConfig

标题配置,用于确定所有标题的默认属性。有关完整的标题配置选项列表,请参见标题文档的相应部分

tooltipFormatdict, FormatConfig

定义工具提示的自定义格式配置。如果未指定,将应用默认格式配置。

traildict, LineConfig

Trail 特定配置

viewdict, ViewConfig

单视图图表的默认属性。

__init__(arc=Undefined, area=Undefined, aria=Undefined, autosize=Undefined, axis=Undefined, axisBand=Undefined, axisBottom=Undefined, axisDiscrete=Undefined, axisLeft=Undefined, axisPoint=Undefined, axisQuantitative=Undefined, axisRight=Undefined, axisTemporal=Undefined, axisTop=Undefined, axisX=Undefined, axisXBand=Undefined, axisXDiscrete=Undefined, axisXPoint=Undefined, axisXQuantitative=Undefined, axisXTemporal=Undefined, axisY=Undefined, axisYBand=Undefined, axisYDiscrete=Undefined, axisYPoint=Undefined, axisYQuantitative=Undefined, axisYTemporal=Undefined, background=Undefined, bar=Undefined, boxplot=Undefined, circle=Undefined, concat=Undefined, countTitle=Undefined, customFormatTypes=Undefined, errorband=Undefined, errorbar=Undefined, facet=Undefined, fieldTitle=Undefined, font=Undefined, geoshape=Undefined, header=Undefined, headerColumn=Undefined, headerFacet=Undefined, headerRow=Undefined, image=Undefined, legend=Undefined, line=Undefined, lineBreak=Undefined, locale=Undefined, mark=Undefined, normalizedNumberFormat=Undefined, normalizedNumberFormatType=Undefined, numberFormat=Undefined, numberFormatType=Undefined, padding=Undefined, params=Undefined, point=Undefined, projection=Undefined, range=Undefined, rect=Undefined, rule=Undefined, scale=Undefined, selection=Undefined, square=Undefined, style=Undefined, text=Undefined, tick=Undefined, timeFormat=Undefined, timeFormatType=Undefined, title=Undefined, tooltipFormat=Undefined, trail=Undefined, view=Undefined, **kwds)#

方法

__init__([arc, area, aria, autosize, axis, ...])

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

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