Skip to content

Commit

Permalink
Theme selector
Browse files Browse the repository at this point in the history
  • Loading branch information
maxschulz-COL committed Jul 5, 2024
1 parent 137ad02 commit 2f0acdb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vizro-core/examples/_dev/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@
Output("output_chart", "figure", allow_duplicate=True),
Input("__input_editing-grid2", "cellValueChanged"),
Input("__input_editing-grid2", "rowData"),
Input("theme_selector", "checked"),
prevent_initial_call=True
)
def update(_, rows):
def update(_, rows,theme_selector):
dff = pd.DataFrame(rows)
if dff.empty:
return empty_figure
fig = px.line(dff,title = "Timeline of input data", x="date", y="value")
fig.update_layout(template="vizro_light" if theme_selector else "vizro_dark") #to get the theme right
return fig

# add or delete rows of table
Expand Down

0 comments on commit 2f0acdb

Please sign in to comment.