Skip to content

Commit 94503be

Browse files
geenakimakmorrow13
authored andcommitted
features height is not 0 (#513)
* features height is not 0 * features not in example code, height not modified in AbstractCachef * remove comment
1 parent fb29859 commit 94503be

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main/viz/FeatureTrack.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class FeatureTiledCanvas extends TiledCanvas {
4646
}
4747

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

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

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

212212
// resize height for device
213213
height = d3utils.heightForCanvas(canvas, height);

style/pileup.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
.pileup-root {
88
display: flex;
99
flex-direction: column;
10-
height: 100%;
10+
height: inherit; /* height 100% makes featureTrack too small */
1111
}
1212

1313
.pileup-root > .track {
@@ -201,6 +201,7 @@
201201

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

0 commit comments

Comments
 (0)