Skip to content
Snippets Groups Projects
Commit 90e33067 authored by M. G. Castrellon's avatar M. G. Castrellon
Browse files

Added an option for visualization of depth-averaged values

parent 3e12b04f
No related branches found
No related tags found
No related merge requests found
......@@ -72,7 +72,7 @@ app.layout = html.Div([
),
dcc.Dropdown( # Dropdown for filtering by category 2
id='depth-dropdown',
options=['0-5', '5-15', '>15'],
options=['0-5', '5-15', '>15', 'All'],
placeholder="Select a depth group",
value='0-5', # Default value
),
......@@ -94,6 +94,19 @@ def update_markers(selected_variable, selected_period, selected_depth):
filtered_df = freq.loc[condition01 & condition02, :] \
.copy(deep=True).reset_index()
# Filter data according to dropdown menu options
## Selected period
filtered_df = freq.loc[freq['Period'] == selected_period, :].copy(deep=True)
## Selected depth
if selected_depth == 'All':
filtered_df = filtered_df.groupby(['Station_ID','Period'], observed=True) \
.mean(numeric_only=True).reset_index()
else:
filtered_df = filtered_df.loc[filtered_df['Depth_Group'] == selected_depth, :]
# Generate hexagons
hexagons = create_hexagrid(df=filtered_df, var=selected_variable)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment