Spaces:
Sleeping
Sleeping
dzs commited on
Commit ·
7b70c21
1
Parent(s): 54ab346
messing with css
Browse files- assets/style.css +16 -0
- main.py +18 -21
- main_layout.py +2 -0
assets/style.css
CHANGED
|
@@ -7,3 +7,19 @@ input:disabled {
|
|
| 7 |
color: transparent !important;
|
| 8 |
}
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
color: transparent !important;
|
| 8 |
}
|
| 9 |
|
| 10 |
+
/* Hide selected value AND placeholder when the dropdown is disabled */
|
| 11 |
+
.Select.is-disabled .Select-value,
|
| 12 |
+
.Select.is-disabled .Select-value-label,
|
| 13 |
+
.Select.is-disabled .Select-placeholder {
|
| 14 |
+
color: transparent !important;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
/* Some versions keep layout space; this fully removes the text nodes */
|
| 18 |
+
.Select.is-disabled .Select-value,
|
| 19 |
+
.Select.is-disabled .Select-placeholder {
|
| 20 |
+
display: none !important;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
.Select.is-disabled .Select-control {
|
| 24 |
+
background-color: #f5f5f5 !important;
|
| 25 |
+
}
|
main.py
CHANGED
|
@@ -50,35 +50,32 @@ def route(pathname):
|
|
| 50 |
# Main callback
|
| 51 |
# --------------------------------------------------------------------
|
| 52 |
@app.callback(
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
#Output("c1_time", "disabled"),
|
| 59 |
-
Output("c1_iterations", "disabled"),
|
| 60 |
-
],
|
| 61 |
Input("condition1_mode", "value"),
|
|
|
|
| 62 |
)
|
| 63 |
-
def toggle_condition1_inputs(mode):
|
| 64 |
disable = (mode != "in_vitro")
|
| 65 |
-
|
|
|
|
| 66 |
|
| 67 |
@app.callback(
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
#Output("c2_time", "disabled"),
|
| 74 |
-
Output("c2_iterations", "disabled"),
|
| 75 |
-
],
|
| 76 |
Input("condition2_mode", "value"),
|
|
|
|
| 77 |
)
|
| 78 |
-
|
| 79 |
-
def toggle_condition2_inputs(mode):
|
| 80 |
disable = (mode != "in_vitro")
|
| 81 |
-
|
|
|
|
| 82 |
|
| 83 |
@app.callback(
|
| 84 |
Output("mm0_chart", "figure"),
|
|
|
|
| 50 |
# Main callback
|
| 51 |
# --------------------------------------------------------------------
|
| 52 |
@app.callback(
|
| 53 |
+
Output("c1_solvent", "disabled"),
|
| 54 |
+
Output("c1_volume", "disabled"),
|
| 55 |
+
Output("c1_swelling", "disabled"),
|
| 56 |
+
Output("c1_temp", "disabled"),
|
| 57 |
+
Output("c1_iterations", "disabled"),
|
|
|
|
|
|
|
|
|
|
| 58 |
Input("condition1_mode", "value"),
|
| 59 |
+
State("c1_solvent", "value"),
|
| 60 |
)
|
| 61 |
+
def toggle_condition1_inputs(mode, current_value):
|
| 62 |
disable = (mode != "in_vitro")
|
| 63 |
+
|
| 64 |
+
return disable, disable, disable, disable, disable
|
| 65 |
|
| 66 |
@app.callback(
|
| 67 |
+
Output("c2_solvent", "disabled"),
|
| 68 |
+
Output("c2_volume", "disabled"),
|
| 69 |
+
Output("c2_swelling", "disabled"),
|
| 70 |
+
Output("c2_temp", "disabled"),
|
| 71 |
+
Output("c2_iterations", "disabled"),
|
|
|
|
|
|
|
|
|
|
| 72 |
Input("condition2_mode", "value"),
|
| 73 |
+
State("c2_solvent", "value"),
|
| 74 |
)
|
| 75 |
+
def toggle_condition2_inputs(mode, current_value):
|
|
|
|
| 76 |
disable = (mode != "in_vitro")
|
| 77 |
+
|
| 78 |
+
return disable, disable, disable, disable, disable
|
| 79 |
|
| 80 |
@app.callback(
|
| 81 |
Output("mm0_chart", "figure"),
|
main_layout.py
CHANGED
|
@@ -198,6 +198,7 @@ def build_main_layout() -> html.Div:
|
|
| 198 |
options=[{"label": x, "value": x} for x in solvents],
|
| 199 |
value=solvents[9], # default selection (optional)
|
| 200 |
clearable=False,
|
|
|
|
| 201 |
disabled=True,
|
| 202 |
style={"width": "100%"}
|
| 203 |
),
|
|
@@ -313,6 +314,7 @@ def build_main_layout() -> html.Div:
|
|
| 313 |
options=[{"label": x, "value": x} for x in solvents],
|
| 314 |
value=solvents[2], # default selection (optional)
|
| 315 |
clearable=False,
|
|
|
|
| 316 |
disabled=True,
|
| 317 |
style={"width": "100%"}
|
| 318 |
),
|
|
|
|
| 198 |
options=[{"label": x, "value": x} for x in solvents],
|
| 199 |
value=solvents[9], # default selection (optional)
|
| 200 |
clearable=False,
|
| 201 |
+
placeholder="",
|
| 202 |
disabled=True,
|
| 203 |
style={"width": "100%"}
|
| 204 |
),
|
|
|
|
| 314 |
options=[{"label": x, "value": x} for x in solvents],
|
| 315 |
value=solvents[2], # default selection (optional)
|
| 316 |
clearable=False,
|
| 317 |
+
placeholder="",
|
| 318 |
disabled=True,
|
| 319 |
style={"width": "100%"}
|
| 320 |
),
|