-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes to the
WellAnalysis
plugin (#1184)
- Loading branch information
Showing
10 changed files
with
408 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
webviz_subsurface/plugins/_well_analysis/_views/_well_overview_view/_settings/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from ._chart_type import WellOverviewChartType | ||
from ._filters import WellOverviewFilters | ||
from ._layout_options import WellOverviewLayoutOptions | ||
from ._selections import WellOverviewSelections |
30 changes: 30 additions & 0 deletions
30
webviz_subsurface/plugins/_well_analysis/_views/_well_overview_view/_settings/_chart_type.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from typing import List | ||
|
||
import webviz_core_components as wcc | ||
from dash.development.base_component import Component | ||
from webviz_config.utils import StrEnum | ||
from webviz_config.webviz_plugin_subclasses import SettingsGroupABC | ||
|
||
from ...._types import ChartType | ||
|
||
|
||
class WellOverviewChartType(SettingsGroupABC): | ||
class Ids(StrEnum): | ||
CHARTTYPE = "charttype" | ||
|
||
def __init__(self) -> None: | ||
super().__init__("Chart Type") | ||
|
||
def layout(self) -> List[Component]: | ||
return [ | ||
wcc.RadioItems( | ||
id=self.register_component_unique_id(self.Ids.CHARTTYPE), | ||
options=[ | ||
{"label": "Bar chart", "value": ChartType.BAR}, | ||
{"label": "Pie chart", "value": ChartType.PIE}, | ||
{"label": "Stacked area chart", "value": ChartType.AREA}, | ||
], | ||
value=ChartType.BAR, | ||
vertical=True, | ||
) | ||
] |
29 changes: 29 additions & 0 deletions
29
webviz_subsurface/plugins/_well_analysis/_views/_well_overview_view/_settings/_filters.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from typing import List | ||
|
||
import webviz_core_components as wcc | ||
from dash.development.base_component import Component | ||
from webviz_config.utils import StrEnum | ||
from webviz_config.webviz_plugin_subclasses import SettingsGroupABC | ||
|
||
|
||
class WellOverviewFilters(SettingsGroupABC): | ||
class Ids(StrEnum): | ||
SELECTED_WELLS = "selected-wells" | ||
|
||
def __init__(self, wells: List[str]) -> None: | ||
super().__init__("Filters") | ||
self._wells = wells | ||
|
||
def layout(self) -> List[Component]: | ||
return [ | ||
wcc.SelectWithLabel( | ||
label="Well", | ||
size=min(10, len(self._wells)), | ||
id=self.register_component_unique_id( | ||
WellOverviewFilters.Ids.SELECTED_WELLS | ||
), | ||
options=[{"label": well, "value": well} for well in self._wells], | ||
value=self._wells, | ||
multi=True, | ||
) | ||
] |
75 changes: 75 additions & 0 deletions
75
...subsurface/plugins/_well_analysis/_views/_well_overview_view/_settings/_layout_options.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
from typing import List | ||
|
||
import webviz_core_components as wcc | ||
from dash import html | ||
from dash.development.base_component import Component | ||
from webviz_config.utils import StrEnum | ||
from webviz_config.webviz_plugin_subclasses import SettingsGroupABC | ||
|
||
from ...._types import ChartType | ||
|
||
|
||
class WellOverviewLayoutOptions(SettingsGroupABC): | ||
class Ids(StrEnum): | ||
CHARTTYPE_SETTINGS = "charttype-settings" | ||
CHARTTYPE_CHECKLIST = "charttype-checklist" | ||
|
||
def __init__(self) -> None: | ||
super().__init__("Layout Options") | ||
|
||
def layout(self) -> List[Component]: | ||
settings_id = self.register_component_unique_id(self.Ids.CHARTTYPE_SETTINGS) | ||
checklist_id = self.register_component_unique_id(self.Ids.CHARTTYPE_CHECKLIST) | ||
return [ | ||
html.Div( | ||
children=[ | ||
html.Div( | ||
id={"id": settings_id, "charttype": ChartType.BAR}, | ||
children=wcc.Checklist( | ||
id={"id": checklist_id, "charttype": ChartType.BAR}, | ||
options=[ | ||
{"label": "Show legend", "value": "legend"}, | ||
{"label": "Overlay bars", "value": "overlay_bars"}, | ||
{ | ||
"label": "Show prod as text", | ||
"value": "show_prod_text", | ||
}, | ||
{ | ||
"label": "White background", | ||
"value": "white_background", | ||
}, | ||
], | ||
value=["legend"], | ||
), | ||
), | ||
html.Div( | ||
id={"id": settings_id, "charttype": ChartType.PIE}, | ||
children=wcc.Checklist( | ||
id={"id": checklist_id, "charttype": ChartType.PIE}, | ||
options=[ | ||
{"label": "Show legend", "value": "legend"}, | ||
{ | ||
"label": "Show prod as text", | ||
"value": "show_prod_text", | ||
}, | ||
], | ||
value=[], | ||
), | ||
), | ||
html.Div( | ||
id={"id": settings_id, "charttype": ChartType.AREA}, | ||
children=wcc.Checklist( | ||
id={"id": checklist_id, "charttype": ChartType.AREA}, | ||
options=[ | ||
{"label": "Show legend", "value": "legend"}, | ||
{ | ||
"label": "White background", | ||
"value": "white_background", | ||
}, | ||
], | ||
value=["legend"], | ||
), | ||
), | ||
], | ||
), | ||
] |
68 changes: 68 additions & 0 deletions
68
webviz_subsurface/plugins/_well_analysis/_views/_well_overview_view/_settings/_selections.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import datetime | ||
from typing import List | ||
|
||
import webviz_core_components as wcc | ||
from dash.development.base_component import Component | ||
from webviz_config.utils import StrEnum | ||
from webviz_config.webviz_plugin_subclasses import SettingsGroupABC | ||
|
||
|
||
class WellOverviewSelections(SettingsGroupABC): | ||
class Ids(StrEnum): | ||
ENSEMBLES = "ensembles" | ||
RESPONSE = "response" | ||
PROD_FROM_DATE = "prod-from-date" | ||
PROD_UNTIL_DATE = "prod-until-date" | ||
|
||
def __init__(self, ensembles: List[str], dates: List[datetime.datetime]) -> None: | ||
super().__init__("Selections") | ||
|
||
self._ensembles = ensembles | ||
self._dates = dates | ||
|
||
def layout(self) -> List[Component]: | ||
return [ | ||
wcc.Dropdown( | ||
label="Ensembles", | ||
id=self.register_component_unique_id(self.Ids.ENSEMBLES), | ||
options=[{"label": col, "value": col} for col in self._ensembles], | ||
value=self._ensembles, | ||
multi=True, | ||
), | ||
wcc.Dropdown( | ||
label="Response", | ||
id=self.register_component_unique_id(self.Ids.RESPONSE), | ||
options=[ | ||
{"label": "Oil production", "value": "WOPT"}, | ||
{"label": "Gas production", "value": "WGPT"}, | ||
{"label": "Water production", "value": "WWPT"}, | ||
], | ||
value="WOPT", | ||
multi=False, | ||
clearable=False, | ||
), | ||
wcc.Dropdown( | ||
label="Production From Date", | ||
id=self.register_component_unique_id(self.Ids.PROD_FROM_DATE), | ||
options=[ | ||
{ | ||
"label": dte.strftime("%Y-%m-%d"), | ||
"value": dte.strftime("%Y-%m-%d"), | ||
} | ||
for dte in self._dates | ||
], | ||
multi=False, | ||
), | ||
wcc.Dropdown( | ||
label="Production Until Date", | ||
id=self.register_component_unique_id(self.Ids.PROD_UNTIL_DATE), | ||
options=[ | ||
{ | ||
"label": dte.strftime("%Y-%m-%d"), | ||
"value": dte.strftime("%Y-%m-%d"), | ||
} | ||
for dte in self._dates | ||
], | ||
multi=False, | ||
), | ||
] |
Oops, something went wrong.