Path: blob/main/doc/how_to/custom_components/examples/plot_viewer.md
2012 views
Plot Viewer
This example demonstrates the use of a Viewer
class to build a reactive app. It uses the iris dataset which is a standard example used to illustrate machine-learning and visualization techniques.
We will start by using the dataframe with these five features and then create a Selector
parameter to develop menu options for different input features. Later we will define the core plotting function in a plot
method and define the layout in the __panel__
method of the IrisDashboard
class.
The plot
method watches the X_variable
and Y_variable
using the param.depends
decorator. The plot
method plots the features selected for X_variable
and Y_variable
and colors them using the species
column.