panel.pane.vega module#

class panel.pane.vega.Vega(object=None, **params)[source]#

Bases: ModelPane

The Vega pane renders Vega-lite based plots (including those from Altair) inside a panel.

Note

  • to use the Vega pane, the Panel extension has to be

loaded with ‘vega’ as an argument to ensure that vega.js is initialized. - it supports selection events - it optimizes the plot rendering by using binary serialization for any array data found on the Vega/Altair object, providing huge speedups over the standard JSON serialization employed by Vega natively.

Reference: https://panel.holoviz.org/reference/panes/Vega.html

Example:

>>> pn.extension('vega')
>>> Vega(some_vegalite_dict_or_altair_object, height=240)

Methods

applies(obj)

Returns boolean or float indicating whether the Pane can render the object.

is_altair

Parameter Definitions


Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, css_classes, design, height, min_width, min_height, max_width, max_height, styles, stylesheets, tags, width, width_policy, height_policy, sizing_mode, visible

panel.viewable.Viewable: loading

panel.pane.base.PaneBase: margin, default_layout, object

debounce = ClassSelector(class_=(<class 'int'>, <class 'dict'>), default=20, label='Debounce')

Declares the debounce time in milliseconds either for all events or if a dictionary is provided for individual events.

selection = ClassSelector(allow_None=True, class_=<class 'param.parameterized.Parameterized'>, label='Selection')

The Selection object reflects any selections available on the supplied vega plot into Python.

show_actions = Boolean(default=False, label='Show actions')

Whether to show Vega actions.

theme = Selector(allow_None=True, label='Theme', names={}, objects=['excel', 'ggplot2', 'quartz', 'vox', 'fivethirtyeight', 'dark', 'latimes', 'urbaninstitute', 'googlecharts'])

classmethod applies(obj: Any) float | bool | None[source]#

Returns boolean or float indicating whether the Pane can render the object.

If the priority of the pane is set to None, this method may also be used to define a float priority depending on the object being rendered.

panel.pane.vega.ds_as_cds(dataset)[source]#

Converts Vega dataset into Bokeh ColumnDataSource data