diff --git a/webviz_subsurface/plugins/_well_analysis/_plugin.py b/webviz_subsurface/plugins/_well_analysis/_plugin.py index c36c776e19..1f3303e2c9 100644 --- a/webviz_subsurface/plugins/_well_analysis/_plugin.py +++ b/webviz_subsurface/plugins/_well_analysis/_plugin.py @@ -122,7 +122,7 @@ def tour_steps(self) -> List[dict]: { "id": self.view(self.Ids.WELL_OVERVIEW) .view_element(WellOverviewView.Ids.VIEW_ELEMENT) - .component_unique_id(WellOverviewViewElement.Ids.CHART), + .component_unique_id(WellOverviewViewElement.Ids.GRAPH), "content": "Shows production split on well for the various chart types", }, { diff --git a/webviz_subsurface/plugins/_well_analysis/_views/_well_overview_view/_view.py b/webviz_subsurface/plugins/_well_analysis/_views/_well_overview_view/_view.py index 7f79e731f0..deb929a47d 100644 --- a/webviz_subsurface/plugins/_well_analysis/_views/_well_overview_view/_view.py +++ b/webviz_subsurface/plugins/_well_analysis/_views/_well_overview_view/_view.py @@ -247,9 +247,9 @@ def set_callbacks(self) -> None: @callback( Output( self.view_element(self.Ids.VIEW_ELEMENT) - .component_unique_id(WellOverviewViewElement.Ids.CHART) + .component_unique_id(WellOverviewViewElement.Ids.GRAPH) .to_string(), - "children", + "figure", ), Input( self.settings_group(self.Ids.SETTINGS) @@ -303,7 +303,7 @@ def set_callbacks(self) -> None: ), State( self.view_element(self.Ids.VIEW_ELEMENT) - .component_unique_id(WellOverviewViewElement.Ids.CHART) + .component_unique_id(WellOverviewViewElement.Ids.GRAPH) .to_string(), "figure", ), @@ -356,7 +356,7 @@ def _update_graph( datetime.datetime.strptime(prod_after_date, "%Y-%m-%d") if prod_after_date is not None else None, - ChartType[charttype_selected], + ChartType(charttype_selected), wells_selected, self._theme, ) @@ -369,9 +369,4 @@ def _update_graph( prod_after_date, ) - return [ - wcc.Graph( - style={"height": "87vh"}, - figure=fig_dict, - ), - ] + return fig_dict diff --git a/webviz_subsurface/plugins/_well_analysis/_views/_well_overview_view/_view_element.py b/webviz_subsurface/plugins/_well_analysis/_views/_well_overview_view/_view_element.py index a512388882..bccf42ed11 100644 --- a/webviz_subsurface/plugins/_well_analysis/_views/_well_overview_view/_view_element.py +++ b/webviz_subsurface/plugins/_well_analysis/_views/_well_overview_view/_view_element.py @@ -1,3 +1,4 @@ +import webviz_core_components as wcc from dash import html from webviz_config.utils import StrEnum from webviz_config.webviz_plugin_subclasses import ViewElementABC @@ -5,12 +6,15 @@ class WellOverviewViewElement(ViewElementABC): class Ids(StrEnum): - CHART = "chart" + GRAPH = "graph" def __init__(self) -> None: super().__init__() def inner_layout(self) -> html.Div: return html.Div( - id=self.register_component_unique_id(WellOverviewViewElement.Ids.CHART) + children=wcc.Graph( + id=self.register_component_unique_id(WellOverviewViewElement.Ids.GRAPH), + style={"height": "87vh"}, + ), )