Py.Cafe

huong-li-nguyen/

qb-fair-demo

Iris Dataset Visualization Demo using Vizro

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import vizro.models as vm
import vizro.plotly.express as px
from vizro import Vizro

gapminder = px.data.gapminder()


# Page 1: Simple example with one component
page_one = vm.Page(title="Page 1", components=[vm.Card(text="# Good morning! ☕")])

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

app = Vizro().build(dashboard).dash

# Page 2: Add more components e.g. a graph or a table

'''
vm.Graph(
            figure=px.box(
                gapminder,
                x="continent",
                y="lifeExp",
                color="continent",
            )
        )
'''


# Page 3: Add a filter
'''
controls=[vm.Filter(column="continent")]
'''


# Page 4: Change the layout
'''
 layout=vm.Layout(grid=[[0, 1, 1]]),
'''


# Change navigation
'''
vm.Navigation(nav_selector=vm.NavBar())
'''

'''
items=[
                vm.NavLink(label="Group A", pages=["Page 1", "Page 2"], icon="Home"),
                vm.NavLink(label="Group B", pages=["Page 3", "Page 4"], icon="Globe"),
            ]
'''