Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/fourc_webviewer/fourc_webserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import numpy as np
import pyvista as pv
from fourcipp import CONFIG
from trame.app import get_server
from trame.decorators import TrameApp, change, controller

Expand Down Expand Up @@ -295,6 +296,8 @@ def init_general_sections_state_and_server_vars(self):
approach to add them up to the main section SOLVERS.
"""

self.state.json_schema = CONFIG["json_schema"]

# define substrings of section names to exclude
substr_to_exclude = ["DESIGN", "TOPOLOGY", "ELEMENTS", "NODE", "FUNCT"]
# define full section names to exclude
Expand Down
43 changes: 40 additions & 3 deletions src/fourc_webviewer/gui_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,19 @@ def _prop_value_table():
),
key="item_key",
):
html.Td(v_text=("item_key",), classes="text-center")
with html.Td(classes="text-center"):
with vuetify.VTooltip(location="bottom"):
with html.Template(v_slot_activator="{ props }"):
html.P(v_text=("item_key",), v_bind="props")
html.P(
v_text=(
"json_schema['properties']?.[selected_section_name]?.['properties']?.[item_key]?.['description'] || 'no description'",
),
v_if=(
"json_schema['properties']?.[selected_section_name]?.['properties']?.[item_key]?.['description']",
),
style="max-width: 450px;",
)
html.Td(
v_if="edit_mode == all_edit_modes['view_mode']",
v_text=("item_val",),
Expand Down Expand Up @@ -490,7 +502,7 @@ def _materials_panel():
items=("Object.keys(materials_section)",),
)
# show material type
with html.Div(classes="d-flex align-center ga-3 mb-5 pl-5 w-full"):
with html.Div(classes="d-flex align-center ga-3 mb-1 pl-5 w-full"):
html.Span("TYPE: ", classes="text-h6")
# view mode: text
html.Span(
Expand All @@ -510,8 +522,20 @@ def _materials_panel():
dense=True,
hide_details=True,
)
html.P(
classes="ga-3 mb-5 pl-5 pr-5 w-full",
v_if=("edit_mode == all_edit_modes['view_mode']",),
v_text=(
"json_schema?.properties?.MATERIALS?.items?.oneOf?"
".find(v => v.properties?.[materials_section[selected_material]?.TYPE])?.properties?"
".[materials_section[selected_material]?.TYPE]?.description || 'Error on material description'",
),
style="color: #999;",
)

# show relationships to other materials (linked materials
# and master material) -> only in view mode

with html.Div(
v_if=("edit_mode == all_edit_modes['view_mode']",),
):
Expand Down Expand Up @@ -552,6 +576,7 @@ def _materials_panel():
html.Th(
"Value",
classes="text-center font-weight-bold",
style="width: 50%;",
)
with html.Tbody():
with html.Tr(
Expand All @@ -560,7 +585,19 @@ def _materials_panel():
),
classes="text-center",
):
html.Td(v_text=("param_key",))
with html.Td(classes="text-center"):
with vuetify.VTooltip(location="bottom"):
with html.Template(v_slot_activator="{ props }"):
html.P(v_text=("param_key",), v_bind="props")
html.P(
v_text=(
"json_schema?.properties?.MATERIALS?.items?.oneOf?"
".find(v => v.properties?.[materials_section[selected_material]?.TYPE])?"
".properties?.[materials_section[selected_material]?.TYPE]?.properties?"
".[param_key]?.description || 'Error on parameter description'",
),
style="max-width: 450px;",
)
html.Td(
v_text=("param_val",),
)
Expand Down