panel.config module#

The config module supplies the global config object and the extension which provides convenient support for loading and configuring panel components.

class panel.config.panel_extension(*, name)[source]#

Bases: extension

Initializes and configures Panel. You should always run pn.extension. This will

  • Initialize the pyviz notebook extension to enable bi-directional

communication and for example plotting with Bokeh. - Load .js libraries (positional arguments). - Update the global configuration pn.config (keyword arguments).

Parameters:
*argslist[str]

Positional arguments listing the extension to load. For example “plotly”, “tabulator”.

**paramsdict[str,Any]

Keyword arguments to be set on the pn.config element. See https://panel.holoviz.org/api/config.html

:Example:
>>> import panel as pn
>>> pn.extension(“plotly”, sizing_mode=”stretch_width”, template=”fast”)
This will
- Initialize the `pyviz` notebook extension.
- Enable you to use the `Plotly` pane by loading `plotly.js`.
- Set the default `sizing_mode` to `stretch_width` instead of `fixed`.
- Set the global configuration `pn.config.template` to `fast`, i.e. you
will be using the `FastListTemplate`.

Parameter Definitions