Skip to content

Commit

Permalink
features height is not 0 (#513)
Browse files Browse the repository at this point in the history
* features height is not 0

* features not in example code, height not modified in AbstractCachef

* remove comment
  • Loading branch information
geenakim authored and akmorrow13 committed Jun 21, 2019
1 parent fb29859 commit 94503be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/viz/FeatureTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class FeatureTiledCanvas extends TiledCanvas {
}

heightForRef(ref: string): number {
return this.cache.pileupHeightForRef(ref) *
return Math.max(this.cache.pileupHeightForRef(ref),1) *
(style.READ_HEIGHT + style.READ_SPACING);
}

Expand Down Expand Up @@ -207,7 +207,7 @@ class FeatureTrack extends React.Component<VizProps<DataSource<Feature>>, State>
var parent = ((d3utils.findParent(canvas, "features") : any) : HTMLCanvasElement);

// Height can only be computed after the pileup has been updated.
var height = yForRow(this.cache.pileupHeightForRef(this.props.range.contig));
var height = this.tiles.heightForRef(this.props.range.contig);

// resize height for device
height = d3utils.heightForCanvas(canvas, height);
Expand Down
3 changes: 2 additions & 1 deletion style/pileup.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.pileup-root {
display: flex;
flex-direction: column;
height: 100%;
height: inherit; /* height 100% makes featureTrack too small */
}

.pileup-root > .track {
Expand Down Expand Up @@ -201,6 +201,7 @@

/* features track */
.pileup-root > .features {
flex-basis: auto; /* sets track size based on track height */
max-height: 200px; /* prevents track from becoming too large */
}

Expand Down

0 comments on commit 94503be

Please sign in to comment.