# 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.models as vm
import vizro.plotly.express as px
from vizro import Vizro
iris = px.data.iris()
page_1 = vm.Page(
title="Buttons",
components=[
vm.Graph(figure=px.scatter(iris, x="sepal_width", y="sepal_length", color="species", size="petal_length")),
],
controls=[
vm.Filter(column="species", selector=vm.Dropdown(title="Species")),
],
)
dashboard = vm.Dashboard(pages=[page_1])
app = Vizro().build(dashboard)
# Add script to modify reset-button className
app.dash.index_string = app.dash.index_string.replace(
'</body>',
'''
<script>
document.addEventListener('DOMContentLoaded', function() {
setTimeout(function() {
var button = document.getElementById('reset-button');
if (button) {
button.className = 'btn btn-secondary';
}
}, 200);
});
</script>
</body>
'''
)
app.run()