Py.Cafe

maxi.schulz/

vizro-tutorial-explore-vizro-1

Dashboard that is part of the Vizro documentation

DocsPricing
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from vizro import Vizro
import vizro.models as vm
import vizro.plotly.express as px

df = px.data.gapminder()
gapminder_data = (
        df.groupby(by=["continent", "year"]).
            agg({"lifeExp": "mean", "pop": "sum", "gdpPercap": "mean"}).reset_index()
    )

first_page = vm.Page(
    title="First Page",
    components=[
        vm.Graph(
            id="box_cont",
            figure=px.box(gapminder_data, x="continent", y="lifeExp", color="continent",
                            labels={"lifeExp": "Life Expectancy", "continent": "Continent"}),
        ),
    ],
)

dashboard = vm.Dashboard(pages=[first_page])

app = Vizro().build(dashboard).dash
requirements.txt
1
2
3
dash
vizro>=0.1.18