diff --git a/setup.py b/setup.py index 44badd0ff..06f4918c1 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,6 @@ ] }, install_requires=[ - "dash<=1.10", # https://github.com/equinor/webviz-subsurface/issues/317 "fmu-ensemble>=1.2.2", "matplotlib>=3.0", "pandas>=0.24", diff --git a/tests/integration_tests/test_aggregated_data_example.py b/tests/integration_tests/test_aggregated_data_example.py index be4cb02a4..6976d932c 100644 --- a/tests/integration_tests/test_aggregated_data_example.py +++ b/tests/integration_tests/test_aggregated_data_example.py @@ -43,4 +43,4 @@ def test_basic_example(dash_duo, tmp_path): not in log["message"] ] if logs != []: - raise AssertionError(logs) + raise AssertionError(page, logs) diff --git a/tests/integration_tests/test_raw_data_example.py b/tests/integration_tests/test_raw_data_example.py index 3da18d86d..9f9f18dd6 100644 --- a/tests/integration_tests/test_raw_data_example.py +++ b/tests/integration_tests/test_raw_data_example.py @@ -41,4 +41,4 @@ def test_full_example(dash_duo, tmp_path): ] if logs != []: - raise AssertionError(logs) + raise AssertionError(page, logs) diff --git a/tests/integration_tests/test_surface_selector.py b/tests/integration_tests/test_surface_selector.py index 1ac17a16a..4c491d477 100644 --- a/tests/integration_tests/test_surface_selector.py +++ b/tests/integration_tests/test_surface_selector.py @@ -41,7 +41,7 @@ def test_surface_selector(dash_duo): app.layout = html.Div(children=[s.layout, html.Pre(id="pre", children="ok")]) - @app.callback(Output("pre", "children"), [Input(s.storage_id, "children")]) + @app.callback(Output("pre", "children"), [Input(s.storage_id, "data")]) def _test(data): return json.dumps(json.loads(data)) diff --git a/webviz_subsurface/_private_plugins/surface_selector.py b/webviz_subsurface/_private_plugins/surface_selector.py index 87e770303..0df48d86e 100644 --- a/webviz_subsurface/_private_plugins/surface_selector.py +++ b/webviz_subsurface/_private_plugins/surface_selector.py @@ -201,7 +201,7 @@ def set_callbacks(self, app): ) def _update_attr(_n_prev, _n_next, current_value): ctx = dash.callback_context.triggered - if not ctx or not current_value: + if ctx is None or not current_value: raise PreventUpdate if not ctx[0]["value"]: return current_value @@ -226,7 +226,7 @@ def _update_attr(_n_prev, _n_next, current_value): ) def _update_name(attr, _n_prev, _n_next, current_value): ctx = dash.callback_context.triggered - if not ctx: + if ctx is None: raise PreventUpdate names = self._names_in_attr(attr) if not names: @@ -258,7 +258,7 @@ def _update_name(attr, _n_prev, _n_next, current_value): def _update_date(attr, _n_prev, _n_next, current_value): ctx = dash.callback_context.triggered - if not ctx: + if ctx is None: raise PreventUpdate dates = self._dates_in_attr(attr) @@ -276,7 +276,7 @@ def _update_date(attr, _n_prev, _n_next, current_value): return options, value, {} @app.callback( - Output(self.storage_id, "children"), + Output(self.storage_id, "data"), [ Input(self.attr_id, "value"), Input(self.name_id, "value"), diff --git a/webviz_subsurface/_private_plugins/tornado_plot.py b/webviz_subsurface/_private_plugins/tornado_plot.py index fbba04935..b73995ae0 100644 --- a/webviz_subsurface/_private_plugins/tornado_plot.py +++ b/webviz_subsurface/_private_plugins/tornado_plot.py @@ -208,7 +208,7 @@ def set_callbacks(self, app): Input(self.ids("reference"), "value"), Input(self.ids("scale"), "value"), Input(self.ids("cut-by-ref"), "value"), - Input(self.ids("storage"), "children"), + Input(self.ids("storage"), "data"), ], ) def _calc_tornado(reference, scale, cutbyref, data): @@ -240,14 +240,14 @@ def _calc_tornado(reference, scale, cutbyref, data): if self.allow_click: @app.callback( - Output(self.ids("click-store"), "children"), + Output(self.ids("click-store"), "data"), [ Input(self.ids("tornado-graph"), "clickData"), Input(self.ids("reset"), "n_clicks"), ], ) def _save_click_data(data, nclicks): - if not dash.callback_context.triggered: + if dash.callback_context.triggered is None: raise PreventUpdate ctx = dash.callback_context.triggered[0]["prop_id"].split(".")[0] diff --git a/webviz_subsurface/plugins/_inplace_volumes_onebyone.py b/webviz_subsurface/plugins/_inplace_volumes_onebyone.py index 4da8f0a05..bcab4b2c4 100644 --- a/webviz_subsurface/plugins/_inplace_volumes_onebyone.py +++ b/webviz_subsurface/plugins/_inplace_volumes_onebyone.py @@ -404,7 +404,7 @@ def set_callbacks(self, app): @app.callback( [ Output(self.ids("graph-wrapper"), "children"), - Output(self.tornadoplot.storage_id, "children"), + Output(self.tornadoplot.storage_id, "data"), Output(self.ids("table"), "data"), Output(self.ids("table"), "columns"), ], @@ -517,7 +517,7 @@ def _render_vol_chart(plot_type, ensemble, response, source, *filters): @app.callback( Output(self.ids("graph"), "figure"), - [Input(self.tornadoplot.click_id, "children")], + [Input(self.tornadoplot.click_id, "data")], [State(self.ids("plot-type"), "value"), State(self.ids("graph"), "figure")], ) def _color_chart(hoverdata, plot_type, figure): diff --git a/webviz_subsurface/plugins/_parameter_distribution.py b/webviz_subsurface/plugins/_parameter_distribution.py index e2131e103..8f5db4c67 100644 --- a/webviz_subsurface/plugins/_parameter_distribution.py +++ b/webviz_subsurface/plugins/_parameter_distribution.py @@ -159,13 +159,15 @@ def set_callbacks(self, app): def _set_parameter_from_btn(_prev_click, _next_click, column): ctx = dash.callback_context.triggered - if not ctx: + if ctx is None: raise PreventUpdate callback = ctx[0]["prop_id"] if callback == f"{self.ids('prev-btn')}.n_clicks": column = prev_value(column, self.parameter_columns) elif callback == f"{self.ids('next-btn')}.n_clicks": column = next_value(column, self.parameter_columns) + else: + column = self.parameter_columns[0] return column @app.callback( diff --git a/webviz_subsurface/plugins/_reservoir_simulation_timeseries_onebyone.py b/webviz_subsurface/plugins/_reservoir_simulation_timeseries_onebyone.py index 6c71fb338..a88ad1e0e 100644 --- a/webviz_subsurface/plugins/_reservoir_simulation_timeseries_onebyone.py +++ b/webviz_subsurface/plugins/_reservoir_simulation_timeseries_onebyone.py @@ -314,7 +314,7 @@ def set_callbacks(self, app): # Output(self.ids("date-store"), "children"), Output(self.ids("table"), "data"), Output(self.ids("table"), "columns"), - Output(self.tornadoplot.storage_id, "children"), + Output(self.tornadoplot.storage_id, "data"), ], [ Input(self.ids("ensemble"), "value"), @@ -350,7 +350,7 @@ def _render_date(ensemble, clickdata, vector): @app.callback( Output(self.ids("graph"), "figure"), [ - Input(self.tornadoplot.click_id, "children"), + Input(self.tornadoplot.click_id, "data"), # Input(self.ids("date-store"), "children"), Input(self.ids("ensemble"), "value"), Input(self.ids("vector"), "value"), @@ -360,12 +360,12 @@ def _render_date(ensemble, clickdata, vector): ) def _render_tornado(tornado_click, ensemble, vector, date_click, figure): """Update graph with line coloring, vertical line and title""" - if not dash.callback_context.triggered: + if dash.callback_context.triggered is None: raise PreventUpdate ctx = dash.callback_context.triggered[0]["prop_id"].split(".")[0] - # Redraw figure if ensemble/vector hanges - if ctx == self.ids("ensemble") or ctx == self.ids("vector"): + # Draw initial figure and redraw if ensemble/vector changes + if ctx in ["", self.ids("ensemble"), self.ids("vector")]: layout = {} layout.update(self.plotly_theme["layout"]) data = filter_ensemble(self.data, ensemble, vector) diff --git a/webviz_subsurface/plugins/_running_time_analysis_fmu.py b/webviz_subsurface/plugins/_running_time_analysis_fmu.py index 18b375041..c4334c75d 100644 --- a/webviz_subsurface/plugins/_running_time_analysis_fmu.py +++ b/webviz_subsurface/plugins/_running_time_analysis_fmu.py @@ -337,8 +337,6 @@ def _update_fig(ens, mode, rel_runtime, rel_real, params, filter_short): [ Output(self.uuid("matrix_color"), "style"), Output(self.uuid("parcoords_color"), "style"), - Output(self.uuid("matrix_heatmap"), "style"), - Output(self.uuid("parcoords"), "style"), Output(self.uuid("parameter_dropdown"), "style"), Output(self.uuid("filter_short_checkbox"), "style"), ], @@ -350,15 +348,11 @@ def _update_mode(mode): style = ( {"display": "block"}, {"display": "none"}, - {"display": "block", "overflowX": "auto"}, - {"display": "none"}, {"display": "none"}, {"display": "block"}, ) else: style = ( - {"display": "none"}, - {"display": "block"}, {"display": "none"}, {"display": "block"}, {"display": "block"}, diff --git a/webviz_subsurface/plugins/_surface_viewer_fmu.py b/webviz_subsurface/plugins/_surface_viewer_fmu.py index 207c0d4fc..14d59d0dc 100644 --- a/webviz_subsurface/plugins/_surface_viewer_fmu.py +++ b/webviz_subsurface/plugins/_surface_viewer_fmu.py @@ -392,10 +392,10 @@ def set_callbacks(self, app): Output(self.uuid("map3-label"), "children"), ], [ - Input(self.selector.storage_id, "children"), + Input(self.selector.storage_id, "data"), Input(self.uuid("ensemble"), "value"), Input(self.uuid("realization"), "value"), - Input(self.selector2.storage_id, "children"), + Input(self.selector2.storage_id, "data"), Input(self.uuid("ensemble2"), "value"), Input(self.uuid("realization2"), "value"), Input(self.uuid("calculation"), "value"), diff --git a/webviz_subsurface/plugins/_well_cross_section_fmu.py b/webviz_subsurface/plugins/_well_cross_section_fmu.py index a63d416a7..77f83dddc 100644 --- a/webviz_subsurface/plugins/_well_cross_section_fmu.py +++ b/webviz_subsurface/plugins/_well_cross_section_fmu.py @@ -226,7 +226,9 @@ def seismic_layout(self): ] ), ) - return html.Div(id=self.ids("cube")) + return html.Div( + style={"visibility": "hidden"}, children=dcc.Dropdown(id=self.ids("cube")) + ) @property def marginal_log_layout(self): @@ -247,7 +249,10 @@ def marginal_log_layout(self): ] ), ) - return html.Div(id=self.ids("marginal-log")) + return html.Div( + style={"visibility": "hidden"}, + children=dcc.Dropdown(id=self.ids("marginal-log")), + ) @property def intersection_option(self):