@@ -34,7 +34,6 @@ export default class Target{
3434
3535 setGraph ( graph ) {
3636 condenseVisualization ( graph ) ;
37- console . log ( graph ) ;
3837
3938 var zoom = d3 . behavior . zoom ( )
4039 . scaleExtent ( [ 1 , 10 ] )
@@ -104,7 +103,12 @@ export default class Target{
104103 let images = linksEnter . append ( "svg:image" )
105104 . attr ( "height" , sbolImgSize )
106105 . attr ( "width" , sbolImgSize )
107- . attr ( "class" , "sboltip" )
106+ . attr ( "class" , ( d ) => {
107+ if ( d . hasOwnProperty ( "componentRoles" ) && d [ "componentRoles" ] . length > 0 ) {
108+ return "sboltip" ;
109+ }
110+ return null ;
111+ } )
108112 . attr ( "title" , ( d ) => {
109113 if ( d . hasOwnProperty ( "componentIDs" ) ) {
110114 let titleStr = "" ;
@@ -120,29 +124,22 @@ export default class Target{
120124 }
121125 } )
122126 . attr ( "href" , ( d ) => {
123- if ( d . hasOwnProperty ( "componentRoles" ) ) {
124- if ( d [ "componentRoles" ] . length > 0 ) {
125- return getSBOLImage ( d [ "componentRoles" ] [ 0 ] ) ;
126- }
127+ if ( d . hasOwnProperty ( "componentRoles" ) && d [ "componentRoles" ] . length > 0 ) {
128+ return getSBOLImage ( d [ "componentRoles" ] [ 0 ] ) ;
127129 }
128- return "" ;
130+ return null ;
129131 } ) ;
130132
131- // Add images for inline & reverse complements
132- let linksEnter2 = svg . selectAll ( ".link" )
133- . data ( graph . links . filter ( link => link . hasReverseOrient ) )
134- . enter ( ) ;
135-
136- let reverseImgs = linksEnter2 . append ( "svg:image" )
133+ let reverseImgs = linksEnter . append ( "svg:image" )
137134 . attr ( "height" , sbolImgSize )
138135 . attr ( "width" , sbolImgSize )
139136 . attr ( "href" , ( d ) => {
140137 if ( d . hasOwnProperty ( "componentRoles" ) ) {
141- if ( d [ "componentRoles" ] . length > 0 ) {
138+ if ( d [ "componentRoles" ] . length > 0 && d . hasReverseOrient ) {
142139 return getSBOLImage ( d [ "componentRoles" ] [ 0 ] ) ;
143140 }
144141 }
145- return "" ;
142+ return null ;
146143 } ) ;
147144
148145 //place tooltip on the SVG images
0 commit comments