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, visiblepanel.viewable.Viewable
: loadingpanel.pane.base.PaneBase
: margin, default_layout, objectdebounce = 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'])