File tree Expand file tree Collapse file tree
templates/pangenome_analyses/plots Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 } ,
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
You can’t perform that action at this time.
0 commit comments