File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
src/main/resources/static/js Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,13 @@ function longestListLength(listoflists) {
184184 return maxLength ;
185185}
186186
187+ //split by / for SBOL identity
188+ //this may not work well with other import formats
189+ export function splitElementID ( elementID ) {
190+ let splitArr = elementID . split ( '/' ) ;
191+ return splitArr . length > 1 ? splitArr [ splitArr . length - 2 ] : elementID ;
192+ }
193+
187194export function getSBOLImage ( role ) {
188195 const sbolpath = "./img/sbol/" ;
189196 switch ( role ) {
@@ -353,7 +360,8 @@ $('#enumerate-designs-tooltip').click(() => {
353360 para . appendChild ( document . createTextNode ( "[" ) ) ;
354361 const length = list . length ;
355362 list . map ( ( element , i ) => {
356- para . appendChild ( document . createTextNode ( element . id ) ) ;
363+ para . appendChild ( document . createTextNode ( splitElementID ( element . id ) ) ) ;
364+ //append comma if there are more elements
357365 if ( length !== i + 1 ) {
358366 para . appendChild ( document . createTextNode ( "," ) ) ;
359367 }
Original file line number Diff line number Diff line change 11
2- import { knoxClass , getSBOLImage } from "./knox.js" ;
2+ import { knoxClass , getSBOLImage , splitElementID } from "./knox.js" ;
33
44// The target class observes an SVG element on the page, and
55// provides methods for setting and clearing graph data. A variable
@@ -92,7 +92,16 @@ export default class Target{
9292 . attr ( "class" , "sboltip" )
9393 . attr ( "title" , ( d ) => {
9494 if ( d . hasOwnProperty ( "componentIDs" ) ) {
95- return d [ "componentIDs" ] . toString ( ) ;
95+ let titleStr = "" ;
96+ const length = d [ "componentIDs" ] . length ;
97+ for ( let i = 0 ; i < d [ "componentIDs" ] . length ; i ++ ) {
98+ titleStr += splitElementID ( d [ "componentIDs" ] [ i ] ) ;
99+ if ( length !== i + 1 ) {
100+ titleStr += "," ;
101+ }
102+ }
103+
104+ return titleStr ;
96105 }
97106 } )
98107 . attr ( "xlink:href" , ( d ) => {
You can’t perform that action at this time.
0 commit comments