This page explains the multiple layouts components and all the options to control the layout of the dashboard.
There is 3 main components of Jupyter-flex Dashboard: Cards, Sections and Pages and they have the following hirerchy: Pages > Sections > Cards. Meaning that Pages contain Sections and Sections contain Cards.
A Card is an object that holds any output components of the dashboard such as plots, text, widgets and more.
To define a new Card you use a level-3 markdown header (
###). Each card belongs in a Section and one Section can have one or more Cards.
Any output components (plots or text) will be added to the current Card until a new Card, Section or Page is defined.
The components of a Card are:
- The header will be the value of level-3 markdown header (
- One (or more) code cells that contain plots tagged with
chart, in general it's a good idea to just have one plot per card.
- One (or more) markdown cells tagged with
textthat contain some narrative for the dashboard
- Footer will be one markdown cell tagged with
For example this notebook with one Card, two plots and some text. Note that code cells get expanded to ocupy all the space in the Card while text cells get just use the space they need.
import plotly.express as px
df = px.data.iris()
### Card Header
#### This is some text
# Another plot fig = px.scatter(df, x="petal_width", y="petal_length") fig.show()