Skip to content

Commit

Permalink
LGV ticks
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Feb 17, 2023
1 parent b1b8a85 commit 2a34f97
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const useStyles = makeStyles()(theme => ({
position: 'absolute',
top: 0,
height: HEADER_OVERVIEW_HEIGHT,
overflow: 'hidden',
},
scalebarContigForward: {
backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 9'%3E%3Cpath d='M-.1 0L6 4.5L-.1 9' fill='none' stroke='${theme.palette.divider}'/%3E%3C/svg%3E")`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exports[`renders one track, one region 1`] = `
style="width: 800px; left: 0px; background: rgba(66, 165, 245, 0.3); border-color: #42a5f5;"
/>
<div
class="css-osn2dd-scalebarContig"
class="css-2jeg0a-scalebarContig"
style="width: 0px; left: 0px; background-color: rgb(153, 153, 153);"
/>
<div>
Expand All @@ -32,7 +32,7 @@ exports[`renders one track, one region 1`] = `
ctgA
</p>
<div
class="css-1npsllo-scalebarContig-scalebarContigForward-scalebarBorder"
class="css-rtx9ov-scalebarContig-scalebarContigForward-scalebarBorder"
style="left: 0px; width: 800px; border-color: rgb(153, 102, 0);"
>
<p
Expand Down Expand Up @@ -68,7 +68,7 @@ exports[`renders one track, one region 1`] = `
</div>
</div>
<div
class="css-osn2dd-scalebarContig"
class="css-2jeg0a-scalebarContig"
style="width: 0px; left: 800px; background-color: rgb(153, 153, 153);"
/>
</div>
Expand Down Expand Up @@ -346,6 +346,10 @@ exports[`renders one track, one region 1`] = `
class="css-1dmfa10-contentBlock"
style="width: 100px;"
>
<div
class="css-i794sq-tick-minorTick"
style="left: -21px;"
/>
<div
class="css-1qcgmte-tick-majorTick"
style="left: -1px;"
Expand Down Expand Up @@ -374,6 +378,10 @@ exports[`renders one track, one region 1`] = `
class="css-i794sq-tick-minorTick"
style="left: 119px;"
/>
<div
class="css-i794sq-tick-minorTick"
style="left: 139px;"
/>
</div>
<div
class="css-a9ifge-boundaryPaddingBlock"
Expand Down Expand Up @@ -573,7 +581,7 @@ exports[`renders two tracks, two regions 1`] = `
style="width: 580px; left: 0px; background: rgba(66, 165, 245, 0.3); border-color: #42a5f5;"
/>
<div
class="css-osn2dd-scalebarContig"
class="css-2jeg0a-scalebarContig"
style="width: 0px; left: 0px; background-color: rgb(153, 153, 153);"
/>
<div>
Expand All @@ -584,12 +592,12 @@ exports[`renders two tracks, two regions 1`] = `
ctgA
</p>
<div
class="css-1npsllo-scalebarContig-scalebarContigForward-scalebarBorder"
class="css-rtx9ov-scalebarContig-scalebarContigForward-scalebarBorder"
style="left: 0px; width: 72.72727272727273px; border-color: rgb(153, 102, 0);"
/>
</div>
<div
class="css-osn2dd-scalebarContig"
class="css-2jeg0a-scalebarContig"
style="width: 0px; left: 72.72727272727273px; background-color: rgb(153, 153, 153);"
/>
<div>
Expand All @@ -600,7 +608,7 @@ exports[`renders two tracks, two regions 1`] = `
ctgB
</p>
<div
class="css-1npsllo-scalebarContig-scalebarContigForward-scalebarBorder"
class="css-rtx9ov-scalebarContig-scalebarContigForward-scalebarBorder"
style="left: 72.72727272727273px; width: 727.2727272727273px;"
>
<p
Expand Down Expand Up @@ -636,7 +644,7 @@ exports[`renders two tracks, two regions 1`] = `
</div>
</div>
<div
class="css-osn2dd-scalebarContig"
class="css-2jeg0a-scalebarContig"
style="width: 0px; left: 800px; background-color: rgb(153, 153, 153);"
/>
</div>
Expand Down Expand Up @@ -916,6 +924,10 @@ exports[`renders two tracks, two regions 1`] = `
class="css-1dmfa10-contentBlock"
style="width: 100px;"
>
<div
class="css-i794sq-tick-minorTick"
style="left: -21px;"
/>
<div
class="css-1qcgmte-tick-majorTick"
style="left: -1px;"
Expand Down Expand Up @@ -944,6 +956,10 @@ exports[`renders two tracks, two regions 1`] = `
class="css-i794sq-tick-minorTick"
style="left: 119px;"
/>
<div
class="css-i794sq-tick-minorTick"
style="left: 139px;"
/>
</div>
<div
class="css-1b6zgog-interRegionPaddingBlock"
Expand All @@ -953,6 +969,10 @@ exports[`renders two tracks, two regions 1`] = `
class="css-1dmfa10-contentBlock"
style="width: 800px;"
>
<div
class="css-i794sq-tick-minorTick"
style="left: -21px;"
/>
<div
class="css-1qcgmte-tick-majorTick"
style="left: -1px;"
Expand Down Expand Up @@ -1121,6 +1141,10 @@ exports[`renders two tracks, two regions 1`] = `
class="css-i794sq-tick-minorTick"
style="left: 819px;"
/>
<div
class="css-i794sq-tick-minorTick"
style="left: 839px;"
/>
</div>
</div>
</div>
Expand Down
11 changes: 7 additions & 4 deletions plugins/linear-genome-view/src/LinearGenomeView/util.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,18 @@ describe('tick calculation', () => {
{ type: 'minor', base: 8, index: 9 },
{ type: 'major', base: 9, index: 10 },
{ type: 'minor', base: 10, index: 11 },
{ type: 'minor', base: 11, index: 12 },
])
})
test('two', () => {
const result = Array.from(makeTicks(0, 50, 1))
expect(result).toEqual([
{ type: 'major', base: -1, index: 0 },
{ type: 'minor', base: 19, index: 1 },
{ type: 'minor', base: 39, index: 2 },
{ type: 'minor', base: 59, index: 3 },
{ type: 'minor', base: -21, index: 0 },
{ type: 'major', base: -1, index: 1 },
{ type: 'minor', base: 19, index: 2 },
{ type: 'minor', base: 39, index: 3 },
{ type: 'minor', base: 59, index: 4 },
{ type: 'minor', base: 79, index: 5 },
])
})
})
4 changes: 2 additions & 2 deletions plugins/linear-genome-view/src/LinearGenomeView/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ export function makeTicks(
let index = 0
const ticks = []
for (
let base = Math.ceil(minBase / iterPitch) * iterPitch;
base < maxBase;
let base = Math.floor(minBase / iterPitch) * iterPitch;
base < Math.ceil(maxBase / iterPitch) * iterPitch + 1;
base += iterPitch
) {
if (emitMinor && base % (gridPitch.majorPitch * 2)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ exports[`<JBrowseLinearGenomeView /> renders successfully 1`] = `
style="width: 267px; left: 0px; background: rgba(66, 119, 127, 0.3); border-color: rgb(66, 119, 127);"
/>
<div
class="css-osn2dd-scalebarContig"
class="css-2jeg0a-scalebarContig"
style="width: 0px; left: 0px; background-color: rgb(153, 153, 153);"
/>
<div>
Expand All @@ -115,7 +115,7 @@ exports[`<JBrowseLinearGenomeView /> renders successfully 1`] = `
ctgA
</p>
<div
class="css-1npsllo-scalebarContig-scalebarContigForward-scalebarBorder"
class="css-rtx9ov-scalebarContig-scalebarContigForward-scalebarBorder"
style="left: 0px; width: 800px; border-color: rgb(153, 102, 0);"
>
<p
Expand Down Expand Up @@ -157,7 +157,7 @@ exports[`<JBrowseLinearGenomeView /> renders successfully 1`] = `
</div>
</div>
<div
class="css-osn2dd-scalebarContig"
class="css-2jeg0a-scalebarContig"
style="width: 0px; left: 800px; background-color: rgb(153, 153, 153);"
/>
</div>
Expand Down Expand Up @@ -605,6 +605,10 @@ exports[`<JBrowseLinearGenomeView /> renders successfully 1`] = `
class="css-i794sq-tick-minorTick"
style="left: 800px;"
/>
<div
class="css-i794sq-tick-minorTick"
style="left: 820px;"
/>
</div>
<div
class="css-1dmfa10-contentBlock"
Expand Down Expand Up @@ -778,6 +782,10 @@ exports[`<JBrowseLinearGenomeView /> renders successfully 1`] = `
class="css-i794sq-tick-minorTick"
style="left: 800px;"
/>
<div
class="css-i794sq-tick-minorTick"
style="left: 820px;"
/>
</div>
</div>
</div>
Expand Down
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.

Large diffs are not rendered by default.

0 comments on commit 2a34f97

Please sign in to comment.