diff --git a/dev/ucsc/hub.html b/dev/ucsc/hub.html
index bd33af5d3..3229eab08 100644
--- a/dev/ucsc/hub.html
+++ b/dev/ucsc/hub.html
@@ -39,20 +39,17 @@
}
const hub = await Hub.loadHub("https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/hub.txt", hubOptions)
- const ref = hub.getGenomeConfig()
const igvConfig = {
- reference: ref
+ reference: hub.getGenomeConfig()
}
- // for(let tc of hub.getTrackConfigurations()) {
- // for(let t of tc.tracks) {
- // if(t.url.endsWith("undefined")) console.log(`${tc.label} ${t.name} ${t.url}`)
- // }
- // }
-
const browser = await igv.createBrowser(document.getElementById('igvDiv'), igvConfig)
+ browser.on('genomechange', (genome) => {
+ console.log(genome.getTrackConfigurations())
+ })
+
const selector = document.getElementById("select")
selector.addEventListener("change", () => document.getElementById("hub-input").value = selector.value)
diff --git a/js/browser.js b/js/browser.js
index ea42de7e8..163df77b0 100755
--- a/js/browser.js
+++ b/js/browser.js
@@ -702,6 +702,10 @@ class Browser {
throw new Error(`Cannot set initial locus ${locus}`)
}
+ if(genomeChange) {
+ this.fireEvent('genomechange', [genome])
+ }
+
if (genomeChange && this.circularView) {
this.circularView.setAssembly({
name: this.genome.id,