diff --git a/dev/wig/wigs.html b/dev/wig/wigs.html index 54bade800..4b9f13d42 100644 --- a/dev/wig/wigs.html +++ b/dev/wig/wigs.html @@ -9,6 +9,9 @@ + + +
@@ -19,6 +22,7 @@ const div = document.getElementById("myDiv"); const options = { + queryParametersSupported: true, locus: '19:49301000-49305700', genome: "hg19", tracks: [ @@ -76,6 +80,16 @@ }; igv.createBrowser(div, options).then(function (browser) { + + document.getElementById("log-state").addEventListener("click", () => console.log(browser.toJSON())) + + document.getElementById('bookmark').addEventListener('click', () => { + const path = window.location.href.slice() + const idx = path.indexOf("?") + const url = (idx > 0 ? path.substring(0, idx) : path) + "?sessionURL=blob:" + browser.compressedSession() + window.history.pushState({}, "IGV", url) + }) + }); diff --git a/js/feature/wigTrack.js b/js/feature/wigTrack.js index ed72a920a..5cf51096b 100755 --- a/js/feature/wigTrack.js +++ b/js/feature/wigTrack.js @@ -197,7 +197,7 @@ class WigTrack extends TrackBase { function clickHandler() { this.graphType = gt - this.trackView.updateViews() + this.trackView.repaintViews() } menuItems.push({object, click: clickHandler}) diff --git a/js/trackBase.js b/js/trackBase.js index deb4e0855..3de387f20 100644 --- a/js/trackBase.js +++ b/js/trackBase.js @@ -521,12 +521,12 @@ class TrackBase { const menuItems = [] - menuItems.push('
') - // Data range or color scale if ("heatmap" !== this.graphType && this.colorScale) { + menuItems.push('
') + function dialogPresentationHandler() { if (this.trackView.track.selected) { diff --git a/js/ui/components/colorScaleEditor.js b/js/ui/components/colorScaleEditor.js index e06386254..229f79e81 100644 --- a/js/ui/components/colorScaleEditor.js +++ b/js/ui/components/colorScaleEditor.js @@ -97,7 +97,7 @@ class ColorScaleEditor { label: "Max color", value: newColorScale.highColor, onchange: (v) => { - newColorScale.maxColor = v + newColorScale.highColor = v paintLegend(legend, newColorScale) } }) diff --git a/js/util/colorScale.js b/js/util/colorScale.js index a8be10120..b3ba3b21c 100644 --- a/js/util/colorScale.js +++ b/js/util/colorScale.js @@ -134,13 +134,9 @@ class GradientColorScale { class DivergingGradientScale { - constructor({lowColor, midColor, highColor, low, mid, high}) { + constructor(json) { this.type = 'diverging' - this.setProperties({lowColor, midColor, highColor, low, mid, high}) - } - - setProperties({lowColor, midColor, highColor, low, mid, high}) { - + const {lowColor, midColor, highColor, low, mid, high} = json this.lowGradientScale = new GradientColorScale({ lowColor: lowColor, highColor: midColor, @@ -221,17 +217,18 @@ class DivergingGradientScale { toJson() { return { type: this.type, - low: this.lowGradientScale.low, + low: this.low, mid: this.mid, - high: this.highGradientScale.high, - lowColor: this.lowGradientScale.lowColor, + high: this.high, + lowColor: this.lowColor, midColor: this.midColor, - highColor: this.highGradientScale.highColor + highColor: this.highColor } } clone() { - return new DivergingGradientScale(this.toJson()) + const json = this.toJson() + return new DivergingGradientScale(json) } }