-
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.
- Loading branch information
1 parent
f717fa0
commit cfde875
Showing
17 changed files
with
162 additions
and
222 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
2 changes: 1 addition & 1 deletion
2
webviz_subsurface/plugins/_structural_uncertainty/controllers/__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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from .dialog_controller import open_dialogs | ||
from .intersection_controller import update_intersection | ||
from .intersection_source_controller import update_intersection_source | ||
from .map_controller import update_maps | ||
from .modal_controller import open_modals | ||
from .realization_filter_controller import update_realizations | ||
from .uncertainty_table_controller import update_uncertainty_table |
29 changes: 29 additions & 0 deletions
29
webviz_subsurface/plugins/_structural_uncertainty/controllers/dialog_controller.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 Callable, Optional | ||
|
||
from dash import MATCH, Dash, Input, Output, State | ||
from dash.exceptions import PreventUpdate | ||
|
||
|
||
def open_dialogs( | ||
app: Dash, | ||
get_uuid: Callable, | ||
) -> None: | ||
@app.callback( | ||
Output( | ||
{"id": get_uuid("dialog"), "dialog_id": MATCH, "element": "wrapper"}, | ||
"open", | ||
), | ||
Input( | ||
{"id": get_uuid("dialog"), "dialog_id": MATCH, "element": "button-open"}, | ||
"n_clicks", | ||
), | ||
State( | ||
{"id": get_uuid("dialog"), "dialog_id": MATCH, "element": "wrapper"}, | ||
"open", | ||
), | ||
) | ||
def _toggle_dialog_graph_settings(n_open: int, is_open: bool) -> Optional[bool]: | ||
"""Open or close graph settings dialog button""" | ||
if n_open: | ||
return not is_open | ||
raise PreventUpdate |
29 changes: 0 additions & 29 deletions
29
webviz_subsurface/plugins/_structural_uncertainty/controllers/modal_controller.py
This file was deleted.
Oops, something went wrong.
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
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
61 changes: 61 additions & 0 deletions
61
webviz_subsurface/plugins/_structural_uncertainty/views/dialog.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,61 @@ | ||
from typing import List | ||
|
||
import dash_bootstrap_components as dbc | ||
import webviz_core_components as wcc | ||
from dash import html | ||
|
||
|
||
def dialog_layout( | ||
uuid: str, | ||
dialog_id: str, | ||
title: str, | ||
children: List, | ||
size: str = "sm", | ||
) -> wcc.Dialog: | ||
|
||
return wcc.Dialog( | ||
# style={"marginTop": "20vh"}, | ||
children=children, | ||
id={"id": uuid, "dialog_id": dialog_id, "element": "wrapper"}, | ||
max_width=size, | ||
title=title, | ||
draggable=True, | ||
) | ||
|
||
|
||
def open_dialog_layout(uuid: str, dialog_id: str, title: str) -> dbc.Button: | ||
return html.Div( | ||
children=html.Button( | ||
title, | ||
id={"id": uuid, "dialog_id": dialog_id, "element": "button-open"}, | ||
), | ||
) | ||
|
||
|
||
def clear_all_apply_dialog_buttons( | ||
uuid: str, dialog_id: str, apply_disabled: bool = True | ||
) -> html.Div: | ||
return html.Div( | ||
children=[ | ||
dbc.Button( | ||
"Clear", | ||
style={"padding": "0 20px"}, | ||
className="mr-1", | ||
id={"id": uuid, "dialog_id": dialog_id, "element": "clear"}, | ||
), | ||
dbc.Button( | ||
"All", | ||
style={"padding": "0 20px"}, | ||
className="mr-1", | ||
id={"id": uuid, "dialog_id": dialog_id, "element": "all"}, | ||
), | ||
dbc.Button( | ||
"Apply", | ||
style={"padding": "0 20px", "visibility": "hidden"} | ||
if apply_disabled | ||
else {"padding": "0 20px"}, | ||
className="mr-1", | ||
id={"id": uuid, "dialog_id": dialog_id, "element": "apply"}, | ||
), | ||
] | ||
) |
Oops, something went wrong.