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)#
配置架构包装器。
- Parameters:
- arcdict,
RectConfig 特定于弧的配置
- areadict,
AreaConfig 区域特定配置
- ariabool
一个布尔标志,指示是否应该为标记和指南包含ARIA默认属性(仅适用于SVG输出)。如果为假,
"aria-hidden"属性将被设置为所有指南,从而将它们从ARIA可访问性树中移除,Vega-Lite将不会为标记生成默认描述。默认值:
true。- autosizedict,
AutosizeType,AutoSizeParams, Literal[‘pad’, ‘none’, ‘fit’, ‘fit-x’, ‘fit-y’] 可视化大小应该如何确定。如果是字符串,则应为
"pad"、"fit"或"none"之一。对象值还可以指定内容大小和自动调整大小的参数。默认值:
pad- axisdict,
AxisConfig - axisBanddict,
AxisConfig 用于“带”刻度的轴配置。
- axisBottomdict,
AxisConfig 图表底部边缘的x轴配置。
- axisDiscretedict,
AxisConfig 用于“点”或“带”刻度的坐标轴配置。
- axisLeftdict,
AxisConfig 配置图表左边缘的y轴。
- axisPointdict,
AxisConfig 具有“点”刻度的轴配置。
- axisQuantitativedict,
AxisConfig 定量轴的配置。
- axisRightdict,
AxisConfig 图表右边缘的y轴配置。
- axisTemporaldict,
AxisConfig 时间轴的配置。
- axisTopdict,
AxisConfig 图表顶部边缘的x轴配置。
- axisXdict,
AxisConfig X轴特定配置。
- axisXBanddict,
AxisConfig 用于具有“带式”刻度的x轴的配置。
- axisXDiscretedict,
AxisConfig 用于“点”或“带”刻度的x轴配置。
- axisXPointdict,
AxisConfig 带有“点”刻度的x轴配置。
- axisXQuantitativedict,
AxisConfig x-量化轴的配置。
- axisXTemporaldict,
AxisConfig x-时间轴的配置。
- axisYdict,
AxisConfig Y轴特定配置。
- axisYBanddict,
AxisConfig “带”比例尺的y轴配置。
- axisYDiscretedict,
AxisConfig y轴的“点”或“带”比例的配置。
- axisYPointdict,
AxisConfig 用于“点”尺度的y轴配置。
- axisYQuantitativedict,
AxisConfig y-定量轴的配置。
- axisYTemporaldict,
AxisConfig y-时间轴的配置。
- backgroundstr, dict,
颜色,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 酒吧特定配置
- boxplotdict,
BoxPlotConfig 盒子配置
- circledict,
MarkConfig 特定于圆形的配置
- concatdict,
CompositionConfig 所有连接和重复视图组合操作符的默认配置 (
concat,hconcat,vconcat, 和repeat)- countTitlestr
计数字段的默认轴和图例标题。
默认值:
'Count of Records.- customFormatTypesbool
允许
formatType属性用于文本标记和指南接受自定义格式化函数 注册为Vega表达式。- errorbanddict,
ErrorBandConfig 误差带配置
- errorbardict,
ErrorBarConfig 误差条配置
- facetdict,
CompositionConfig 默认配置用于
facet视图组合操作符- fieldTitleLiteral[‘verbal’, ‘functional’, ‘plain’]
定义了Vega-Lite如何为字段生成标题。有三种可能的样式:
"verbal"(默认) - 以口头风格显示函数(例如,“字段的总和”,“日期的年-月”,“字段(分组)”)。"function"- 使用括号和大写文本显示函数 (例如, “SUM(field)”, “YEARMONTH(date)”, “BIN(field)”)."plain"- 仅显示字段名称而不包含函数(例如,“field”、“date”、“field”)。
- fontstr
所有文本标记、标题和标签的默认字体。
- geoshapedict,
MarkConfig 地理形状特定配置
- headerdict,
HeaderConfig 头部配置,决定所有 headers 的默认属性。
有关所有标题配置选项的完整列表,请参阅标题文档中相应部分。
- headerColumndict,
HeaderConfig 标题配置,决定列headers的默认属性。
有关完整的标题配置选项列表,请参阅标题文档中相应的部分。
- headerFacetdict,
HeaderConfig 标题配置,确定非行/列方面的默认属性 headers。
有关所有标题配置选项的完整列表,请参阅标题文档中相应部分。
- headerRowdict,
HeaderConfig 头部配置,决定了行headers的默认属性。
有关所有标题配置选项的完整列表,请参阅标题文档中相应部分。
- imagedict,
RectConfig 图像特定配置
- legenddict,
LegendConfig - linedict,
LineConfig 行特定配置
- lineBreakstr, dict,
ExprRef 分隔符,例如换行符,用于将文本字符串分割为多行。此属性提供文本标记的全局默认值,标记或样式配置设置以及换行标记编码通道可以覆盖该默认值。如果为信号值,则字符串或正则表达式(regexp)值均有效。
- localedict,
Locale 字符串解析和数字及日期值格式化的区域定义。区域对象应该包含
number和/或time属性,并带有 区域定义。在配置块中提供的区域定义可以被视图构造函数的区域选项覆盖。- markdict,
MarkConfig 马可配置
- normalizedNumberFormatstr
如果没有指定normalizedNumberFormatType,则使用D3数字格式用于轴标签、文本标记和标准化堆叠字段的工具提示(字段具有
stack: "normalize")。例如"s"表示SI单位。使用 D3的数字格式模式。如果
config.normalizedNumberFormatType被指定并且config.customFormatTypes为true,这个值将作为format与datum.value一起传递给config.numberFormatType函数。 默认值:%- normalizedNumberFormatTypestr
自定义格式类型 用于
config.normalizedNumberFormat.默认值:
undefined– 这相当于调用 D3-format,它在 Vega-Expression 中被暴露为 format in Vega-Expression。注意: 您还必须将customFormatTypes设置为true才能使用此功能。- numberFormatstr
如果未指定numberFormatType,则D3用于引导标签、文本标记和非规范化字段的工具提示的数字格式(字段 没有
stack: "normalize")。例如"s"表示SI单位。使用 D3的数字格式模式。如果
config.numberFormatType被指定且config.customFormatTypes为true,则此值将作为format与datum.value一起传递给config.numberFormatType函数。- numberFormatTypestr
自定义格式类型 用于
config.numberFormat.默认值:
undefined– 这相当于调用 D3-format,它在 Vega-Expression 中作为 format 暴露。 注意: 您还必须将customFormatTypes设置为true以使用此功能。- paddingdict, float,
ExprRef,填充 默认可视化填充,单位为像素,从可视化画布的边缘到数据矩形。如果是一个数字,则指定所有边的填充。如果是一个对象,值应具有格式
{"left": 5, "top": 5, "right": 5, "bottom": 5}来指定可视化每一侧的填充。默认值:
5- paramsSequence[dict,
TopLevelParameter,VariableParameter,TopLevelSelectionParameter] 动态变量或选择用于参数化可视化。
- pointdict,
MarkConfig 点特定配置
- projectiondict,
ProjectionConfig - rangedict,
RangeConfig 一个对象哈希,定义了默认的范围数组或与刻度一起使用的方案。有关刻度范围配置选项的完整列表,请参见相应的刻度文档部分。
- rectdict,
RectConfig 矩形特定配置
- ruledict,
MarkConfig 规则特定配置
- scaledict,
ScaleConfig 比例配置决定了所有 scales 的默认属性。有关比例配置选项的完整列表,请查看 corresponding section of the scale documentation。
- selectiondict,
SelectionConfig 用于定义每种选择类型的默认属性的对象哈希。
- squaredict,
MarkConfig 特定于平方的配置
- styledict,
StyleConfigIndex - textdict,
MarkConfig 文本特定配置
- tickdict,
TickConfig 特定于滴答的配置
- timeFormatstr
文本标记、图例标签和标题标签中原始时间值(没有时间单位)的默认时间格式。
默认值:
"%b %d, %Y"注意: 坐标轴会自动确定每个标签的格式,因此此配置不影响坐标轴。- timeFormatTypestr
自定义格式类型 为
config.timeFormat.默认值:
undefined– 这相当于调用 D3-time-format,暴露为 timeFormat in Vega-Expression。 注意: 您还必须将customFormatTypes设置为true,并且必须不定义timeUnit才能使用此功能。- titledict,
TitleConfig - tooltipFormatdict,
FormatConfig 为工具提示定义自定义格式配置。如果未指定,将应用默认格式配置。
- traildict,
LineConfig 特定于轨迹的配置
- viewdict,
ViewConfig 单视图图的默认属性。
- arcdict,
- __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([深度, 忽略])返回对象的副本。
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])在根架构的上下文中,根据属性架构验证一个属性。