# Vizro is an open-source toolkit for creating modular data visualization applications.
# check out https://github.com/mckinsey/vizro for more info about Vizro
# and checkout https://vizro.readthedocs.io/en/stable/ for documentation.
import vizro.plotly.express as px
from vizro import Vizro
import vizro.models as vm
from vizro.actions import export_data
df = px.data.iris()
page = vm.Page(
title="Vizro on PyCafe",
layout=vm.Flex(),
components=[
vm.Container(
title="Button Styles",
layout=vm.Flex(direction="row"),
components=[
vm.Button(text="Primary", variant="filled"),
vm.Button(text="Primary", icon="Download", variant="filled"),
vm.Button(text="", icon="Download", variant="filled"),
vm.Button(text="Secondary", variant="outlined"),
vm.Button(text="Secondary", icon="Download", variant="outlined"),
vm.Button(text="", icon="Download", variant="outlined"),
vm.Button(text="Tertiary", variant="plain"),
vm.Button(text="Tertiary", icon="Download", variant="plain"),
vm.Button(text="", icon="Download", variant="plain"),
]
),
vm.Graph(
title="Graph Title",
figure=px.histogram(df, x="sepal_width", color="species")
),
vm.Button(text="Export Data", actions=export_data())
],
controls=[vm.Filter(column="species"), vm.Filter(column="petal_length"), vm.Filter(column="sepal_width")],
)
dashboard = vm.Dashboard(pages=[page])
Vizro().build(dashboard).run()