altair.theme.HeaderConfigKwds#
- class altair.theme.HeaderConfigKwds#
altair.HeaderConfig
TypedDict
wrapper.- Parameters:
- format
When used with the default
"number"
and"time"
format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.If the format type is
"number"
(e.g., for quantitative fields), this is D3’s number format pattern.If the format type is
"time"
(e.g., for temporal fields), this is D3’s time format pattern.
See the format documentation for more examples.
When used with a custom formatType, this value will be passed as
format
alongsidedatum.value
to the registered function.Default value: Derived from numberFormat config for number format and from timeFormat config for time format.
- formatType
The format type for labels. One of
"number"
,"time"
, or a registered custom format type.Default value:
"time"
for temporal fields and ordinal and nominal fields withtimeUnit
."number"
for quantitative fields as well as ordinal and nominal fields withouttimeUnit
.
- labelAlign
Horizontal text alignment of header labels. One of
"left"
,"center"
, or"right"
.- labelAnchor
The anchor position for placing the labels. One of
"start"
,"middle"
, or"end"
. For example, with a label orientation of top these anchor positions map to a left-, center-, or right-aligned label.- labelAngle
The rotation angle of the header labels.
Default value:
0
for column header,-90
for row header.- labelBaseline
The vertical text baseline for the header labels. One of
"alphabetic"
(default),"top"
,"middle"
,"bottom"
,"line-top"
, or"line-bottom"
. The"line-top"
and"line-bottom"
values operate similarly to"top"
and"bottom"
, but are calculated relative to thetitleLineHeight
rather thantitleFontSize
alone.- labelColor
The color of the header label, can be in hex color code or regular color name.
- labelExpr
Vega expression for customizing labels.
Note: The label text and value can be assessed via the
label
andvalue
properties of the header’s backingdatum
object.- labelFont
The font of the header label.
- labelFontSize
The font size of the header label, in pixels.
- labelFontStyle
The font style of the header label.
- labelFontWeight
The font weight of the header label.
- labelLimit
The maximum length of the header label in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.
Default value:
0
, indicating no limit- labelLineHeight
Line height in pixels for multi-line header labels or title text with
"line-top"
or"line-bottom"
baseline.- labelOrient
The orientation of the header label. One of
"top"
,"bottom"
,"left"
or"right"
.- labelPadding
The padding, in pixel, between facet header’s label and the plot.
Default value:
10
- labels
A boolean flag indicating if labels should be included as part of the header.
Default value:
true
.- orient
Shortcut for setting both labelOrient and titleOrient.
- title
Set to null to disable title for the axis, legend, or header.
- titleAlign
Horizontal text alignment (to the anchor) of header titles.
- titleAnchor
The anchor position for placing the title. One of
"start"
,"middle"
, or"end"
. For example, with an orientation of top these anchor positions map to a left-, center-, or right-aligned title.- titleAngle
The rotation angle of the header title.
Default value:
0
.- titleBaseline
The vertical text baseline for the header title. One of
"alphabetic"
(default),"top"
,"middle"
,"bottom"
,"line-top"
, or"line-bottom"
. The"line-top"
and"line-bottom"
values operate similarly to"top"
and"bottom"
, but are calculated relative to thetitleLineHeight
rather thantitleFontSize
alone.Default value:
"middle"
- titleColor
Color of the header title, can be in hex color code or regular color name.
- titleFont
Font of the header title. (e.g.,
"Helvetica Neue"
).- titleFontSize
Font size of the header title.
- titleFontStyle
The font style of the header title.
- titleFontWeight
Font weight of the header title. This can be either a string (e.g
"bold"
,"normal"
) or a number (100
,200
,300
, …,900
where"normal"
=400
and"bold"
=700
).- titleLimit
The maximum length of the header title in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.
Default value:
0
, indicating no limit- titleLineHeight
Line height in pixels for multi-line header title text or title text with
"line-top"
or"line-bottom"
baseline.- titleOrient
The orientation of the header title. One of
"top"
,"bottom"
,"left"
or"right"
.- titlePadding
The padding, in pixel, between facet header’s title and the label.
Default value:
10
- __init__(*args, **kwargs)#
Methods
__init__
(*args, **kwargs)clear
()copy
()fromkeys
(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get
(key[, default])Return the value for key if key is in the dictionary, else default.
items
()keys
()pop
(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem
(/)Remove and return a (key, value) pair as a 2-tuple.
setdefault
(key[, default])Insert key with a value of default if key is not in the dictionary.
update
([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values
()Attributes
format
formatType
labelAlign
labelAnchor
labelAngle
labelBaseline
labelColor
labelExpr
labelFont
labelFontSize
labelFontStyle
labelFontWeight
labelLimit
labelLineHeight
labelOrient
labelPadding
labels
orient
title
titleAlign
titleAnchor
titleAngle
titleBaseline
titleColor
titleFont
titleFontSize
titleFontStyle
titleFontWeight
titleLimit
titleLineHeight
titleOrient
titlePadding