Skip to content

Commit

Permalink
Added hack as temporary fix for bug: loading share URL does not rende…
Browse files Browse the repository at this point in the history
…r Hi-C maps (#298)
  • Loading branch information
turner authored Oct 26, 2024
1 parent c16b364 commit 074a284
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import TraceNavigator from './traceNavigator.js'
import IGVPanel from "./IGVPanel.js";
import JuiceboxPanel from "./juicebox/juiceboxPanel.js";
import { appleCrayonColorRGB255, appleCrayonColorThreeJS, highlightColor } from "./utils/colorUtils.js";
import {getUrlParams, loadSessionURL, toJSON, loadSession, uncompressSession} from "./spacewalkSession.js"
import {getUrlParams, loadSpacewalkSessionURL, toJSON, loadSession, uncompressSession} from "./spacewalkSession.js"
import { initializeMaterialLibrary } from "./utils/materialLibrary.js";
import RenderContainerController from "./renderContainerController.js";
import {createSpacewalkFileLoaders} from './spacewalkFileLoad.js'
Expand Down Expand Up @@ -151,7 +151,13 @@ const initializationHelper = async container => {
const settingsButton = document.querySelector('#spacewalk-threejs-settings-button-container')
guiManager = new GUIManager({ settingsButton, $panel: $('#spacewalk_ui_manager_panel') });

await loadSessionURL(spacewalkSessionURL)
await loadSpacewalkSessionURL(spacewalkSessionURL)

// TODO: HACK HACK to ensure Hi-C map renders properly when loading a share URL
// Fix by refactoring entire session URL loading scheme
if (juiceboxPanel.browser.dataset){
await juiceboxPanel.browser.contactMatrixView.repaint()
}

document.querySelector('.navbar').style.display = 'flex'

Expand All @@ -163,11 +169,6 @@ const initializationHelper = async container => {

async function createButtonsPanelsModals(container, igvSessionURL, juiceboxSessionURL, distanceThreshold, locusString) {

// $('.checkbox-menu').on("change", "input[type='checkbox']", () => $(this).closest("li").toggleClass("active", this.checked))

// to support Viewers navbar item. Checkbox settings.
// $(document).on('click', '.allow-focus', e => e.stopPropagation())

traceSelect = new TraceSelect()

traceNavigator = new TraceNavigator(document.querySelector('#spacewalk-trace-navigator-container'))
Expand Down
4 changes: 2 additions & 2 deletions js/spacewalkSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import SpacewalkEventBus from './spacewalkEventBus.js'
import {defaultDistanceThreshold} from './juicebox/liveContactMapService.js'
import { shortenURL } from "./share/shareHelper.js"

const loadSessionURL = async spacewalkSessionURL => {
async function loadSpacewalkSessionURL(spacewalkSessionURL){

if (spacewalkSessionURL) {
const spacewalk = JSON.parse( uncompressSession(spacewalkSessionURL) )
Expand Down Expand Up @@ -232,4 +232,4 @@ function uncompressSession(url) {
}
}

export { getShareURL, getUrlParams, loadSessionURL, toJSON, loadSession, uncompressSession };
export { getShareURL, getUrlParams, loadSpacewalkSessionURL, toJSON, loadSession, uncompressSession };

0 comments on commit 074a284

Please sign in to comment.