Skip to content

Commit 9c75f82

Browse files
Chiu PeterChiu Peter
authored andcommitted
clean up pourbaix, and formatting the item in dropdown
1 parent 360e0b0 commit 9c75f82

File tree

1 file changed

+8
-28
lines changed

1 file changed

+8
-28
lines changed

crystal_toolkit/components/pourbaix.py

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -644,37 +644,17 @@ def update_heatmap_choices(entries, mat_detials):
644644
crystal_system = mat_detials[mpid_wo_function]["crystal_system"]
645645

646646
label_text_list = [
647-
f"{formula} ({mpid_wo_function}, {functional})"
647+
f"{formula} ({mpid_wo_function}, {functional}) \n"
648648
]
649649
if structure_text:
650-
label_text_list.append("Structure: " + structure_text)
651-
if crystal_system:
652-
label_text_list.append("Crystal system: " + crystal_system)
653-
label = "; ".join(label_text_list)
654-
655-
# label = html.Pre(f"{label_text}", className="dropdown-content", style={"width": "100%"})
656-
"""
657-
label = [f"{formula} ({mpid_wo_function}, {functional}"]
658-
if structure_text:
659-
label.append(html.Br())
660-
label.append(structure_text)
650+
label_text_list.append(
651+
" - Structure: " + structure_text + "\n"
652+
)
661653
if crystal_system:
662-
label.append(html.Br())
663-
label.append(crystal_system)
664-
665-
# den = round(mat_detials[mpid_wo_function]["density"], 3)
666-
sym = mat_detials[mpid_wo_function]["symmetry_symbol"]
667-
eah = round(
668-
mat_detials[mpid_wo_function]["energy_above_hull"], 3
669-
)
670-
671-
label = (
672-
f"{formula} ({mpid});\n"
673-
f"Symmetry: {sym};"
674-
# f"Density: {den};"
675-
f" Energy above hull: {eah}"
676-
)
677-
"""
654+
label_text_list.append(
655+
" - Crystal system: " + crystal_system + "\n"
656+
)
657+
label = "".join(label_text_list)
678658

679659
option = {"label": label, "value": mpid}
680660
else:

0 commit comments

Comments
 (0)