Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
turner committed Aug 3, 2024
1 parent 5940dc9 commit 6672d86
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8,140 deletions.
7 changes: 4 additions & 3 deletions dev/interact/svg-ellipse.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@

<script type="module">

import $ from '../../js/vendor/jquery-3.3.1.slim.js'
import igv from '../../js'
import igv from '../../js/index.js'

(async () => {

Expand Down Expand Up @@ -67,7 +66,9 @@

const browser = await igv.createBrowser(document.getElementById('igv-app-container'), config)

$('#igv-draw-svg-button').on('click', () => browser.saveSVGtoFile({ $container: $('#igv-svg-container') }))
document.getElementById('igv-draw-svg-button').addEventListener('click', function() {
browser.saveSVGtoFile({ container: document.getElementById('igv-svg-container') });
});


})()
Expand Down
6 changes: 3 additions & 3 deletions dev/misc/svg.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

<script type="module">

import $ from '../../js/vendor/jquery-3.3.1.slim.js'
import igv from '../../js/index.js'

(async () => {
Expand Down Expand Up @@ -92,8 +91,9 @@

const browser = await igv.createBrowser(document.getElementById('igv-app-container'), bedgraph_options)

// $('#igv-draw-svg-button').on('click', () => browser.renderSVG($('#igv-svg-container')))
$('#igv-draw-svg-button').on('click', () => browser.saveSVGtoFile({ $container: $('#igv-svg-container') }))
document.getElementById('igv-draw-svg-button').addEventListener('click', function() {
browser.saveSVGtoFile({ $container: document.getElementById('igv-svg-container') });
});


})()
Expand Down
15 changes: 8 additions & 7 deletions js/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,11 @@ class Browser {

let svg = this.toSVG()

// For testing
if (config.$container) {
config.$container.empty()
config.$container.append(svg)
if (config.container) {
while (config.container.firstChild) {
config.container.removeChild(config.container.firstChild);
}
config.container.appendChild(svg);
}

const path = config.filename || 'igvjs.svg'
Expand Down Expand Up @@ -2597,11 +2598,11 @@ function toggleTrackLabels(trackViews, isVisible) {

for (let {viewports} of trackViews) {
for (let viewport of viewports) {
if (viewport.trackLabel) {
if (viewport.trackLabelElement) {
if (0 === viewports.indexOf(viewport) && true === isVisible) {
viewport.trackLabel.style.display = 'block'
viewport.trackLabelElement.style.display = 'block'
} else {
viewport.trackLabel.style.display = 'none'
viewport.trackLabelElement.style.display = 'none'
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion js/ui/cursorGuide.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class CursorGuide {

if (this.browser.getRulerTrackView()) {
for (let viewport of this.browser.getRulerTrackView().viewports) {
viewport.$tooltip.hide()
viewport.tooltip.style.display = 'none'
}
}

Expand Down
Loading

0 comments on commit 6672d86

Please sign in to comment.