Skip to content

Commit

Permalink
Fix the set feature height ability
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Nov 17, 2021
1 parent 8d7d05e commit 180b1d2
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class LayoutSession implements LayoutSessionProps {
maxHeight: readConfObject(this.config, 'maxHeight'),
displayMode: readConfObject(this.config, 'displayMode'),
pitchX: this.bpPerPx,
spacing: readConfObject(this.config, 'noSpacing') ? 0 : 2,
pitchY: readConfObject(this.config, 'noSpacing') ? 1 : 3,
})
}

Expand Down
15 changes: 6 additions & 9 deletions packages/core/util/layouts/GranularRectLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ export default class GranularRectLayout<T> implements BaseLayout<T> {
pitchX = 10,
pitchY = 10,
maxHeight = 10000,
hardRowLimit = 3000,
hardRowLimit = 10000,
displayMode = 'normal',
}: {
pitchX?: number
Expand Down Expand Up @@ -428,9 +428,7 @@ export default class GranularRectLayout<T> implements BaseLayout<T> {

collides(rect: Rectangle<T>, top: number): boolean {
const { bitmap } = this
// var mY = top + rect.h/2; // Y midpoint: ( top+height + top ) / 2

// test exhaustively
const maxY = top + rect.h
for (let y = top; y < maxY; y += 1) {
const row = bitmap[y]
Expand Down Expand Up @@ -470,12 +468,11 @@ export default class GranularRectLayout<T> implements BaseLayout<T> {
const { bitmap } = this
const yEnd = rect.top + rect.h
if (rect.r - rect.l > maxFeaturePitchWidth) {
// the rect is very big in relation to the view size, just
// pretend, for the purposes of layout, that it extends
// infinitely. this will cause weird layout if a user
// scrolls manually for a very, very long time along the
// genome at the same zoom level. but most users will not
// do that. hopefully.
// the rect is very big in relation to the view size, just pretend, for
// the purposes of layout, that it extends infinitely. this will cause
// weird layout if a user scrolls manually for a very, very long time
// along the genome at the same zoom level. but most users will not do
// that. hopefully.
for (let y = rect.top; y < yEnd; y += 1) {
this.autovivifyRow(bitmap, y).setAllFilled(data)
}
Expand Down
65 changes: 65 additions & 0 deletions products/jbrowse-web/src/__snapshots__/jbrowseModel.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2836,6 +2836,71 @@ Object {
"trackId": "volvox.inv.vcf",
"type": "VariantTrack",
},
Object {
"adapter": Object {
"craiLocation": Object {
"internetAccountId": undefined,
"internetAccountPreAuthorization": undefined,
"locationType": "UriLocation",
"uri": "deep_sequencing.cram.crai",
},
"cramLocation": Object {
"internetAccountId": undefined,
"internetAccountPreAuthorization": undefined,
"locationType": "UriLocation",
"uri": "deep_sequencing.cram",
},
"sequenceAdapter": Object {
"chromSizesLocation": Object {
"internetAccountId": undefined,
"internetAccountPreAuthorization": undefined,
"locationType": "UriLocation",
"uri": "/path/to/default.chrom.sizes",
},
"twoBitLocation": Object {
"internetAccountId": undefined,
"internetAccountPreAuthorization": undefined,
"locationType": "UriLocation",
"uri": "volvox.2bit",
},
"type": "TwoBitAdapter",
},
"type": "CramAdapter",
},
"assemblyNames": Array [
"volvox",
],
"category": Array [
"Alignments",
],
"displays": Array [
Object {
"displayId": "deep_seq_alignments",
"pileupDisplay": Object {
"displayId": "deep_seq_pileup",
"renderers": Object {
"PileupRenderer": Object {
"maxHeight": 10000,
"type": "PileupRenderer",
},
},
"type": "LinearPileupDisplay",
},
"type": "LinearAlignmentsDisplay",
},
Object {
"displayId": "Deep sequencing-LinearPileupDisplay",
"type": "LinearPileupDisplay",
},
Object {
"displayId": "Deep sequencing-LinearSNPCoverageDisplay",
"type": "LinearSNPCoverageDisplay",
},
],
"name": "deep_sequencing",
"trackId": "Deep sequencing",
"type": "AlignmentsTrack",
},
],
}
`;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ exports[`breakpoint split view open a split view 1`] = `
stroke="#333"
>
<path
d="M 410.99312656000257 80.5 C 610.9931265600026 80.5 203.41868021525443 89.5 403.4186802152544 89.5"
d="M 407.99312656000257 143.5 C 607.9931265600026 143.5 203.41868021525443 173.5 403.4186802152544 173.5"
data-testid="r1"
stroke-width="1"
/>
<path
d="M 660.4186802152544 89.5 C 860.4186802152544 89.5 206.99312656000257 53.5 406.99312656000257 53.5"
d="M 660.4186802152544 173.5 C 860.4186802152544 173.5 206.99312656000257 53.5 406.99312656000257 53.5"
data-testid="r1"
stroke-width="1"
/>
Expand All @@ -27,7 +27,7 @@ exports[`breakpoint split view open a split view 2`] = `
stroke-width="5"
>
<path
d="M 388.99312656000257 20 L 408.99312656000257 20 L 403.4186802152544 20 L 423.4186802152544 20"
d="M 387.99312656000257 20 L 407.99312656000257 20 L 403.4186802152544 20 L 423.4186802152544 20"
stroke-width="5"
/>
</g>
Expand Down

0 comments on commit 180b1d2

Please sign in to comment.