Panel | Tutorial 2 Overview

2023/02/15 21:01 PM posted in  Coding Notes   comments
Tags:  #Panel

Components

  1. Pane: A Pane wraps a user supplied object of almost any type and turns it into a renderable view. When the wrapped object or any parameter changes, a pane will update the view accordingly.
  2. Widget: A Widget is a control component that allows users to provide input to your app or dashboard, typically by clicking or editing objects in a browser, but also controllable from within Python.
  3. Panel: A Panel is a hierarchical container to lay out multiple components (panes, widgets, or other Panels) into an arrangement that forms an app or dashboard.

APIs

Reactive functions

Defining a reactive function using the pn.bind function or pn.depends decorator provides an explicit way to link specific inputs

Interact

  1. The interact API will be familiar to ipywidgets users; it provides a very simple API to define an interactive view of the results of a Python function.
  2. It may not be suited to more complex scenarios.

Param

Panel itself is built on the param library, which allows capturing parameters and their allowable values entirely independently of any GUI code.

Callback API

That said, it is the interface that all the other APIs are built on, so it is powerful and is a good approach for building entirely new ways of working with Panel, or when you need some specific behavior not covered by the other APIs.

Display and rendering