Skip to content

Commit

Permalink
fix bug #1474
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso committed Mar 14, 2022
1 parent 2543cb0 commit f50104d
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
54 changes: 54 additions & 0 deletions dev/issues/git_1474.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>igv.js</title>
</head>

<body>

Bed file contents:
<pre>
chr1 121605200 124938900 High Signal Region
chr1 125067600 125086000 High Signal Region
chr1 125130200 143562200 High Signal Region
</pre>

<div id="igvDiv" style="padding-top: 10px;padding-bottom: 10px; border:1px solid lightgray"></div>

<script type="module">

import igv from "../../js/index.js";

var options =
{
genome: "hg38",
locus: "chr1:124,410,585-125,635,544",
tracks:
[
// chr1 121605200 124938900 High Signal Region
// chr1 125067600 125086000 High Signal Region
// chr1 125130200 143562200 High Signal Region
{
type: "annotation",
features: [
{chr: "chr1", start: 121605200, end: 124938900, name: "High Signal Region"},
{chr: "chr1", start: 125067600 ,end: 125086000, name: "High Signal Region"},
{chr: "chr1", start: 125130200, end: 143562200, name: "High Signal Region"}
]
}
]
};

var igvDiv = document.getElementById("igvDiv");

igv.createBrowser(igvDiv, options)
.then(function (browser) {
console.log("Created IGV browser");
})


</script>

</body>

</html>
2 changes: 1 addition & 1 deletion js/feature/render/renderFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function renderFeature(feature, bpStart, xScale, pixelHeight, ctx, option
// single-exon transcript
const xLeft = Math.max(0, coord.px)
const xRight = Math.min(pixelWidth, coord.px1)
const width = Math.max(coord.pw, xRight - xLeft)
const width = xRight - xLeft
ctx.fillRect(xLeft, py, width, h)

// Arrows
Expand Down

0 comments on commit f50104d

Please sign in to comment.