Skip to content

Commit

Permalink
Make the Base1DView have default minimumBlockWidth:0 and interRegionP…
Browse files Browse the repository at this point in the history
…addingWidth:0
  • Loading branch information
cmdcolin committed Mar 10, 2021
1 parent afdd9e4 commit 3310bb9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/core/util/Base1DViewModel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ test('Able to set bpPerPx, width and calculate widths', () => {
expect(model.totalBp).toEqual(42400)
// 40000 + (3000 - 600 = 2400) = 42400 / 1 (bpPerPx) = 42400
expect(model.displayedRegionsTotalPx).toEqual(42400)
expect(model.interRegionPaddingWidth).toEqual(2)
expect(model.minimumBlockWidth).toEqual(3)
expect(model.interRegionPaddingWidth).toEqual(0)
expect(model.minimumBlockWidth).toEqual(0)
})

test('Able to set and showAll Regions', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/util/Base1DViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const Base1DView = types
displayedRegions: types.array(Region),
bpPerPx: 0,
offsetPx: 0,
interRegionPaddingWidth: types.optional(types.number, 2),
minimumBlockWidth: types.optional(types.number, 3),
interRegionPaddingWidth: types.optional(types.number, 0),
minimumBlockWidth: types.optional(types.number, 0),
})
.volatile(() => ({
features: undefined as undefined | Feature[],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ function OverviewScaleBar({
const overview = Base1DView.create({
displayedRegions: JSON.parse(JSON.stringify(displayedRegions)),
interRegionPaddingWidth: 0,
minimumBlockWidth: model.minimumBlockWidth,
})
overview.setVolatileWidth(width)
overview.showAllRegions()
Expand Down

0 comments on commit 3310bb9

Please sign in to comment.