Perspective#
This component is also available in the classic reference.
The Perspective pane provides an interactive visualization component for large, real-time datasets built on the Perspective project.
Use pn.ui.Perspective to create this component.
API#
.. py:class:: Perspective(object=None, **params) :module: panel.pane.perspective
The Perspective pane provides an interactive visualization component for
large, real-time datasets built on the Perspective project.
Reference: https://panel.holoviz.org/reference/panes/Perspective.html
:Example:
Perspective(df, plugin=’hypergrid’, theme=’pro-dark’)
:Attributes:
**aggregates**
..
**columns**
..
**columns_config**
..
**expressions**
..
**filters**
..
**group_by**
..
**object**
..
**priority**
..
**sort**
..
**split_by**
..
**title**
..
.. rubric:: Methods
.. autosummary::
applies
on_click
.. !! processed by numpydoc !!
Parameter Definitions
Parameters inherited from:
:class:`panel.viewable.Layoutable`: align, aspect_ratio, css_classes, design, height, min_height, max_width, max_height, styles, stylesheets, tags, width, width_policy, height_policy, sizing_mode, visible
:class:`panel.viewable.Viewable`: loading
:class:`panel.reactive.SyncableData`: selection
:class:`panel.pane.base.PaneBase`: margin, default_layout
min_width = Integer(allow_None=True, bounds=(0, None), default=420, inclusive_bounds=(True, True), label='Min width')
Minimal width of the component (in pixels) if width is adjustable.
object = Parameter(allow_None=True, allow_refs=True, label='Object')
The plot data declared as a dictionary of arrays or a DataFrame.
aggregates = Dict(allow_None=True, class_=<class 'dict'>, label='Aggregates', nested_refs=True)
How to aggregate. For example {"x": "distinct count"}
columns = List(allow_None=True, bounds=(0, None), item_type=(<class 'str'>, <class 'int'>), label='Columns', nested_refs=True)
A list of source columns to show as columns. For example ["x", "y"]
columns_config = Dict(allow_None=True, class_=<class 'dict'>, label='Columns config', nested_refs=True)
Column configuration allowing specification of formatters, coloring
and a variety of other attributes for each column.
editable = Boolean(allow_None=True, default=True, label='Editable')
Whether items are editable.
expressions = ClassSelector(allow_None=True, class_=(<class 'dict'>, <class 'list'>), label='Expressions', nested_refs=True)
A list of expressions computing new columns from existing columns.
For example [""x"+"index""]
split_by = List(allow_None=True, bounds=(0, None), item_type=(<class 'str'>, <class 'int'>), label='Split by', nested_refs=True)
A list of source columns to pivot by. For example ["x", "y"]
filters = List(allow_None=True, bounds=(0, None), item_type=(<class 'tuple'>, <class 'list'>), label='Filters', nested_refs=True)
How to filter. For example [["x", "<", 3],["y", "contains", "abc"]]
group_by = List(allow_None=True, bounds=(0, None), item_type=(<class 'str'>, <class 'int'>), label='Group by')
A list of source columns to group by. For example ["x", "y"]
selectable = Boolean(allow_None=True, default=True, label='Selectable')
Whether items are selectable.
sort = List(allow_None=True, bounds=(0, None), item_type=(<class 'str'>, <class 'int'>, <class 'tuple'>, <class 'list'>), label='Sort')
How to sort. For example[["x","desc"]]
plugin = Selector(default='datagrid', label='Plugin', names={}, objects=['hypergrid', 'datagrid', 'd3_y_bar', 'd3_x_bar', 'd3_xy_line', 'd3_y_line', 'd3_y_area', 'd3_y_scatter', 'd3_xy_scatter', 'd3_treemap', 'd3_sunburst', 'd3_heatmap', 'd3_candlestick', 'd3_ohlc'])
The name of a plugin to display the data. For example hypergrid or d3_xy_scatter.
plugin_config = Dict(class_=<class 'dict'>, default={}, label='Plugin config', nested_refs=True)
Configuration for the PerspectiveViewerPlugin.
settings = Boolean(default=True, label='Settings')
Whether to show the settings menu.
theme = Selector(default='pro', label='Theme', names={}, objects=['material', 'material-dark', 'monokai', 'solarized', 'solarized-dark', 'vaporwave', 'pro', 'pro-dark'])
The style of the PerspectiveViewer. For example pro-dark
title = String(allow_None=True, label='Title')
Title for the Perspective viewer.
.. py:method:: Perspective.applies(object) :module: panel.pane.perspective :classmethod:
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.
..
!! processed by numpydoc !!
.. py:method:: Perspective.on_click(callback: Callable[[PerspectiveClickEvent], None]) :module: panel.pane.perspective
Register a callback to be executed when any row is clicked.
The callback is given a PerspectiveClickEvent declaring the
config, column names, and row values of the row that was
clicked.
:Parameters:
**callback: (callable)**
The callback to run on edit events.
..
!! processed by numpydoc !!
.. py:attribute:: Perspective.priority :module: panel.pane.perspective :type: t.ClassVar[float | bool | None] :value: None