File tree Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -4,22 +4,24 @@ const MetadataTip = require('../tooltips/');
44const  bindShowTooltip  =  ( cy , showTooltipsOnEdges )  =>  { 
55  const  selector =  'node' + ( showTooltipsOnEdges  ?',edge' :'' ) ; 
66  cy . on ( 'showTooltip' ,  selector ,  function  ( evt )  { 
7+ 
8+     
79    const  node  =  evt . target ; 
810
911    const  data  =  node . data ( ) ; 
1012    const  name  =  data . label ; 
1113    const  cy  =  evt . cy ; 
1214
13-     //Create or get tooltip HTML object 
14-     let  html  =  node . scratch ( '_tooltip' ) ; 
15-     if  ( ! ( html ) )  { 
16-       html  =  new  MetadataTip ( name ,  data ,  node ) ; 
17-       node . scratch ( '_tooltip' ,  html ) ; 
18-     } 
19- 
2015    //if the selection is a compartment, do not display a tooltip 
21-     if ( data . class  !==  "compartment" ) 
16+     if ( data . class  !==  "compartment" ) { 
17+       //Create or get tooltip HTML object 
18+       let  html  =  node . scratch ( '_tooltip' ) ; 
19+       if  ( ! ( html ) )  { 
20+         html  =  new  MetadataTip ( name ,  data ,  node ) ; 
21+         node . scratch ( '_tooltip' ,  html ) ; 
22+       } 
2223      html . show ( cy ) ; 
24+     } 
2325  } ) ; 
2426} ; 
2527
Original file line number Diff line number Diff line change @@ -15,8 +15,14 @@ class MetadataTip {
1515    this . name  =  name ; 
1616    this . data  =  data . parsedMetadata ; 
1717    //Add an extra piece of metadata for proteins 
18-     if ( data . class  ===  "macromolecule" ) 
19-       this . data . push ( [ "Search Link" , data . label ] ) ; 
18+       if ( data . class  ===  "process" ) { 
19+         for ( let  i  in  this . data ) { 
20+           if ( this . data [ i ] [ 0 ] === "Display Name" ) 
21+             this . data . push ( [ "Search Link" , this . data [ i ] [ 1 ] ] ) ; 
22+         } 
23+       } else { 
24+         this . data . push ( [ "Search Link" , this . name ] ) ; 
25+       } 
2026    this . cyElement  =  cyElement ; 
2127    this . db  =  config . databases ; 
2228    this . viewStatus  =  { } ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments