Skip to content

Commit

Permalink
New Browser method "browser.getTrackURLs" => returns Set of all loade…
Browse files Browse the repository at this point in the history
…d track urls
  • Loading branch information
jrobinso committed Oct 25, 2023
1 parent 524b2e0 commit e318ae7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions dev/ucsc/slowHub.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
//igvConfig.reference.chromAliasBbURL = undefined // TODO <- chromAliasBB is slowish

const browser = await igv.createBrowser(document.getElementById('igvDiv'), igvConfig)
console.log(browser.getTrackURLs())


</script>
Expand Down
9 changes: 9 additions & 0 deletions js/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1256,6 +1256,7 @@ class Browser {
return this.trackViews.filter(tv => tv.track && tv.track.name).map(tv => tv.track.name)
}


/**
* NOTE: Public API function
*
Expand Down Expand Up @@ -1338,6 +1339,14 @@ class Browser {
return this.trackViews.map(tv => tv.track).filter(t => t !== undefined)
}


getTrackURLs() {
return new Set(this.tracks
.filter(track => track.config && StringUtils.isString(track.config.url))
.map(track => track.config.url))
}


/**
* Set the track height globally for all tracks. (Note: Its not clear why this is useful).
* @param newHeight
Expand Down

0 comments on commit e318ae7

Please sign in to comment.