Update app.py
Browse files
app.py
CHANGED
|
@@ -32,14 +32,14 @@ empty_figure = go.Figure(
|
|
| 32 |
Output("output_chart", "figure", allow_duplicate=True),
|
| 33 |
Input("__input_editing-grid2", "cellValueChanged"),
|
| 34 |
Input("__input_editing-grid2", "rowData"),
|
| 35 |
-
Input("
|
| 36 |
prevent_initial_call=True
|
| 37 |
)
|
| 38 |
def update(_, rows,theme_selector):
|
| 39 |
dff = pd.DataFrame(rows)
|
| 40 |
if dff.empty:
|
| 41 |
return empty_figure
|
| 42 |
-
fig = px.line(dff,
|
| 43 |
fig.update_layout(template="vizro_light" if theme_selector else "vizro_dark") #to get the theme right
|
| 44 |
return fig
|
| 45 |
|
|
@@ -85,7 +85,7 @@ page = vm.Page(
|
|
| 85 |
dashGridOptions={"rowSelection": "multiple", "suppressRowClickSelection": True},
|
| 86 |
),
|
| 87 |
),
|
| 88 |
-
vm.Graph(id = "output_chart",figure = px.line(df,x="date", y="value")),
|
| 89 |
vm.Button(
|
| 90 |
id="delete-row-btn",
|
| 91 |
text="Delete row",
|
|
|
|
| 32 |
Output("output_chart", "figure", allow_duplicate=True),
|
| 33 |
Input("__input_editing-grid2", "cellValueChanged"),
|
| 34 |
Input("__input_editing-grid2", "rowData"),
|
| 35 |
+
Input("theme-selector", "checked"),
|
| 36 |
prevent_initial_call=True
|
| 37 |
)
|
| 38 |
def update(_, rows,theme_selector):
|
| 39 |
dff = pd.DataFrame(rows)
|
| 40 |
if dff.empty:
|
| 41 |
return empty_figure
|
| 42 |
+
fig = px.line(dff, x="date", y="value")
|
| 43 |
fig.update_layout(template="vizro_light" if theme_selector else "vizro_dark") #to get the theme right
|
| 44 |
return fig
|
| 45 |
|
|
|
|
| 85 |
dashGridOptions={"rowSelection": "multiple", "suppressRowClickSelection": True},
|
| 86 |
),
|
| 87 |
),
|
| 88 |
+
vm.Graph(id = "output_chart",figure = px.line(df,x="date", y="value"),title="See the results of editable table here"),
|
| 89 |
vm.Button(
|
| 90 |
id="delete-row-btn",
|
| 91 |
text="Delete row",
|