如何打印 Altair 默认配置的字典

How to print a dict of Altair's default configuration

我正在尝试打印 Altair 默认配置的字典(或列表)。 在模块文档中,我发现了一个名为 altair.Config() 的对象,我认为它包含 Altair 的默认配置。我尝试了以下方法:

import altair as alt
conf = alt.Config()
print(conf.to_dict())

但它只打印一个空字典。

如何打印 Altair 的默认配置?具体来说,我想知道默认字体的名称(我在文档中也找不到)。

Altair 中没有定义默认字体。 Altair 的默认设置位于其默认主题中:

>>> import altair as alt
>>> theme = alt.themes.get()
>>> theme()
{'config': {'view': {'continuousHeight': 300, 'continuousWidth': 400}}}

其他所有内容均由 Vega-Lite 或 Vega 在呈现图表时定义。​​