diff --git a/strkit/viz/server.py b/strkit/viz/server.py index 82ae6e0..92c9c69 100644 --- a/strkit/viz/server.py +++ b/strkit/viz/server.py @@ -42,7 +42,13 @@ def get_loci(): return { "results": list(map( - lambda x: {"i": x[0], "contig": x[1]["contig"], "start": x[1]["start"], "end": x[1]["end"]}, + lambda x: { + "i": x[0], + "contig": x[1]["contig"], + "start": x[1]["start"], + "end": x[1]["end"], + "disabled": x[1]["call"] is None, + }, res)), } diff --git a/strkit/viz/templates/browser.html b/strkit/viz/templates/browser.html index 401b528..248ee07 100644 --- a/strkit/viz/templates/browser.html +++ b/strkit/viz/templates/browser.html @@ -229,7 +229,8 @@ searchResponses = sr.results; // noinspection JSUnresolvedVariable const res = sr.results.map(r => - `
  • ${r.contig}:${r.start}-${r.end}`).join(""); + `
  • ${r.contig}:${r.start}-${r.end}`).join(""); searchResponseList.innerHTML = res || "No results found."; }; @@ -288,7 +289,7 @@ console.debug("call data", callData); /** @type number[] */ - const cns = Object.values(callData.reads).map(read => read.cn); + const cns = Object.values(callData.reads ?? {}).map(read => read.cn); const thresholds = Math.min(100, Math.max(...cns) - Math.min(...cns)); // Add histogram @@ -669,6 +670,7 @@ position: absolute; top: 18px; right: 0; + z-index: 100; padding: 8px 0; list-style: none; min-width: 14em; @@ -685,6 +687,11 @@ cursor: pointer; padding: 4px 8px; } + #search-responses li.disabled { + cursor: not-allowed; + padding: 4px 8px; + color: #999; + } #search-responses li:hover { background-color: #F0F0F0; }