diff --git a/src/main/viz/FeatureTrack.js b/src/main/viz/FeatureTrack.js index bb72ae19..dde69d91 100644 --- a/src/main/viz/FeatureTrack.js +++ b/src/main/viz/FeatureTrack.js @@ -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); } @@ -207,7 +207,7 @@ class FeatureTrack extends React.Component>, 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); diff --git a/style/pileup.css b/style/pileup.css index e06e4181..93149fb1 100644 --- a/style/pileup.css +++ b/style/pileup.css @@ -7,7 +7,7 @@ .pileup-root { display: flex; flex-direction: column; - height: 100%; + height: inherit; /* height 100% makes featureTrack too small */ } .pileup-root > .track { @@ -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 */ }