Skip to content

Commit

Permalink
Adding page tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
JBris committed Aug 17, 2024
1 parent 480e6d5 commit 970ab09
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/pages/generate_root_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,11 @@ def layout() -> html.Div:
]
)

page_description = """
Create synthetic root data by running the root system architecture simulation.
"""
layout = build_common_layout(
"Run Simulation", PAGE_ID, input_components, output_components
"Run Simulation", PAGE_ID, input_components, output_components, page_description
)

return layout
10 changes: 9 additions & 1 deletion deeprootgen/form/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ def build_collapsible(


def build_common_layout(
title: str, page_id: str, input_components: list, output_components: list
title: str,
page_id: str,
input_components: list,
output_components: list,
layout_description: str,
) -> html.Div:
"""Build a common form layout for interacting with the root model.
Expand All @@ -153,6 +157,8 @@ def build_common_layout(
The list of input form components.
output_components (list):
The list of modelling output components.
layout_description (str):
A description of the layout to add as page tooltip.
Returns:
html.Div:
Expand Down Expand Up @@ -190,7 +196,9 @@ def build_common_layout(
html.H5(
title,
style={"margin-left": "1em", "margin-top": "0.2em", "text-align": "center"},
id=f"{page_id}-title",
),
dbc.Tooltip(layout_description, target=f"{page_id}-title", placement="right"),
input_components,
dcc.Download(id=f"{page_id}-download-content"),
dbc.Toast(
Expand Down

0 comments on commit 970ab09

Please sign in to comment.