Skip to content

Commit

Permalink
Inplace volumetrics: Initialize with boxplot if multiple ensembles ar…
Browse files Browse the repository at this point in the history
…e present (#294)
  • Loading branch information
Hans Kallekleiv authored Apr 1, 2020
1 parent d1af1a9 commit b4e3de4
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions webviz_subsurface/plugins/_inplace_volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ def __init__(
self.uid = uuid4()
self.selectors_id = {x: str(uuid4()) for x in self.selectors}
self.plotly_theme = app.webviz_settings["theme"].plotly_theme
if len(self.volumes["ENSEMBLE"].unique()) > 1:
self.initial_plot = "Box plot"
self.initial_group = "ENSEMBLE"
else:
self.initial_plot = "Per realization"
self.initial_group = None
self.set_callbacks(app)

def ids(self, element):
Expand Down Expand Up @@ -287,7 +293,7 @@ def plot_options_layout(self):
dcc.Dropdown(
id=self.ids("response"),
options=[
{"label": volume_description(i), "value": i,}
{"label": volume_description(i), "value": i}
for i in self.responses
],
value=self.initial_response
Expand All @@ -307,7 +313,7 @@ def plot_options_layout(self):
options=[
{"label": i, "value": i} for i in self.plot_types
],
value="Per realization",
value=self.initial_plot,
clearable=False,
),
]
Expand All @@ -323,7 +329,7 @@ def plot_options_layout(self):
{"label": i.lower().capitalize(), "value": i}
for i in self.selectors
],
value=None,
value=self.initial_group,
placeholder="Not grouped",
),
]
Expand All @@ -348,7 +354,7 @@ def layout(self):
style={"height": 400},
children=wcc.Graph(id=self.ids("graph")),
),
html.Div(dash_table.DataTable(id=self.ids("table"),)),
html.Div(dash_table.DataTable(id=self.ids("table"))),
]
),
html.Div(
Expand Down Expand Up @@ -501,10 +507,7 @@ def table_columns(response):
]
for col in columns:
try:
col["format"]["locale"]["symbol"] = [
"",
f"{volume_unit(response)}",
]
col["format"]["locale"]["symbol"] = ["", f"{volume_unit(response)}"]
except KeyError:
pass
return columns
Expand Down

0 comments on commit b4e3de4

Please sign in to comment.