Skip to content

Commit 3bfbec6

Browse files
committed
hided phylons from phylotree page's tooltip
1 parent bd4eaf1 commit 3bfbec6

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

templates/pangenome_analyses/plots/phylotree_plot.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,8 +1193,11 @@
11931193
const genome_id = reference.getAttribute('data-genome-id');
11941194
const data = metadata[genome_id] || {};
11951195
let tooltipHTML = `<strong>Genome ID:</strong> ${genome_id}<br>`;
1196-
Object.keys(data).forEach(key => {
1197-
tooltipHTML += `<strong>${key}:</strong> ${data[key]}<br>`;
1196+
// Only show categories defined in the categories array
1197+
categories.forEach(key => {
1198+
if (data[key]) {
1199+
tooltipHTML += `<strong>${key}:</strong> ${data[key]}<br>`;
1200+
}
11981201
});
11991202
return tooltipHTML;
12001203
},
@@ -1379,8 +1382,11 @@
13791382
if (data) {
13801383
// If identifier is a genome_id, show detailed metadata
13811384
tooltipHTML = `<strong>Genome ID:</strong> ${identifier}<br>`;
1382-
Object.keys(data).forEach(key => {
1383-
tooltipHTML += `<strong>${key}:</strong> ${data[key]}<br>`;
1385+
// Only show categories defined in the categories array
1386+
categories.forEach(key => {
1387+
if (data[key]) {
1388+
tooltipHTML += `<strong>${key}:</strong> ${data[key]}<br>`;
1389+
}
13841390
});
13851391
} else {
13861392
// Otherwise, treat identifier as a simple tag

0 commit comments

Comments
 (0)