From ab1d67f173b06d1d2e3a5956c57e06985d590b76 Mon Sep 17 00:00:00 2001 From: Sanjay Gopala Krishna Date: Fri, 27 Jun 2025 14:50:10 +1000 Subject: [PATCH 1/5] updated new --- .vscode/settings.json | 2 +- cli/cluster_search.py | 47 ++++++++++++++++++++++++++++++++----------- cli/html_config.py | 7 +++++++ 3 files changed, 43 insertions(+), 13 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 6f3a291..f673a71 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "liveServer.settings.port": 5501 + "liveServer.settings.port": 5502 } \ No newline at end of file diff --git a/cli/cluster_search.py b/cli/cluster_search.py index 51abff3..d7370a2 100644 --- a/cli/cluster_search.py +++ b/cli/cluster_search.py @@ -96,7 +96,7 @@ def parse_gibbs_output(self, gibbs_path: str, n_clusters: int) -> pd.DataFrame: for c_file in os.listdir(res_path): if f'{n_clusters}g.ds' in c_file: file_path = os.path.join(res_path, c_file) - df = pd.read_csv(file_path, sep='\s+') + df = pd.read_csv(file_path, sep="\s+") # output_path = f'data/sampledata_701014/res_{n_clusters}g.csv' # df.to_csv(output_path, index=False) logging.info(f"Data parsed for No clusters {n_clusters}") @@ -1540,11 +1540,26 @@ def _create_carousel_for_cluster(self, carousel_id, cluster_num, group_data): total_slides = len(group_nums) # Start building the carousel HTML + # Convert cluster_num to words for display + def number_to_words(n): + words = { + 1: "One", 2: "Two", 3: "Three", 4: "Four", 5: "Five", 6: "Six", + 7: "Seven", 8: "Eight", 9: "Nine", 10: "Ten" + } + return words.get(n, str(n)) + + cluster_num_word = number_to_words(int(cluster_num)) carousel_html = f"""
-

Cluster {cluster_num}

- + + + Previous + + + + Next + +
""" @@ -1742,6 +1757,13 @@ def generate_html_layout(self, correlation_dict, db, gibbs_out, immunolyser=Fals $(targetId).carousel(parseInt(slideIndex)); }); }); + + document.addEventListener('DOMContentLoaded', function () { + var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')); + popoverTriggerList.forEach(function (popoverTriggerEl) { + new bootstrap.Popover(popoverTriggerEl); + }); + }); """ body_end_1 = Template(""" @@ -1800,6 +1822,7 @@ def generate_html_layout(self, correlation_dict, db, gibbs_out, immunolyser=Fals noImgDivs.forEach(div => { div.innerHTML = placeholderSVG; // Add placeholder to each "no-img" div }); + }); diff --git a/cli/html_config.py b/cli/html_config.py index 9b26a1c..cd78fee 100644 --- a/cli/html_config.py +++ b/cli/html_config.py @@ -192,6 +192,7 @@