Py.Cafe

ashishsahu13/

vizro-styled-containers-iris

Styled Containers with Iris Dataset

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
import vizro.models as vm
import vizro.plotly.express as px
from vizro import Vizro

iris = px.data.iris()

page = vm.Page(
    title="Containers with different styles",
    layout=vm.Grid(grid=[[0, 1]]),
    components=[
        vm.Container(
            title="Container with background color",
            components=[vm.Graph(figure=px.scatter(iris, x="sepal_width", y="sepal_length", color="species"))],
            variant="filled"
        ),
        vm.Container(
            title="Container with borders",
            components=[vm.Graph(figure=px.box(iris, x="species", y="sepal_length", color="species"))],
            variant="outlined"
        )
    ],
)

dashboard = vm.Dashboard(pages=[page])
Vizro().build(dashboard).run()