A first dashboard
There is no setup needed for your first dashboard, thanks to the amazing Py.Cafe.
Click on the Run and edit this code in Py.Cafe link below to live-edit the dashboard.
First dashboard
import vizro.plotly.express as px
from vizro import Vizro
import vizro.models as vm
df = px.data.iris()
page = vm.Page(
title="My first dashboard",
components=[
vm.Graph(id="scatter_chart", figure=px.scatter(df, x="sepal_length", y="petal_width", color="species")),
vm.Graph(id="hist_chart", figure=px.histogram(df, x="sepal_width", color="species")),
],
controls=[
vm.Filter(column="species", selector=vm.Dropdown(value=["ALL"])),
],
)
dashboard = vm.Dashboard(pages=[page])
Vizro().build(dashboard).run()
Run and edit this code in Py.Cafe
Can I break your code?
When you click the link to "Edit live on Py.Cafe" the dashboard is running inside your browser. Any changes you make are local and you don't need to worry about breaking the code for others. Nobody else sees the changes you make unless you save a copy of the project as your own Vizro py.cafe project.
How can I make my own dashboards?
You can use Py.Cafe to experiment with your own Vizro dashboards by dropping code onto a new project.
If you need inspiration or a starting point, we make all our examples available for you to try out on Py.Cafe. Throughout our documentation, follow the "Run and edit this code in Py.Cafe" link below the code snippets to open them in Py.Cafe.
Where next?
You are now ready to explore Vizro further, by working through the "Explore Vizro" tutorial or by consulting the how-to guides.