Skip to content

Commit

Permalink
Make regionNumber optional for centerAt
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Mar 15, 2024
1 parent 9fd3949 commit 42442fe
Show file tree
Hide file tree
Showing 3 changed files with 975 additions and 974 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import React from 'react'
import { observer } from 'mobx-react'
import { IconButton, Paper, alpha } from '@mui/material'
import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton'
import { makeStyles } from 'tss-react/mui'
import { getSession } from '@jbrowse/core/util'

// icons
import ZoomIn from '@mui/icons-material/ZoomIn'
Expand All @@ -9,9 +12,6 @@ import ArrowDown from '@mui/icons-material/KeyboardArrowDown'

// locals
import { LinearGenomeViewModel } from '..'
import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton'
import { makeStyles } from 'tss-react/mui'
import { getSession } from '@jbrowse/core/util'

const useStyles = makeStyles()(theme => ({
background: {
Expand Down
7 changes: 4 additions & 3 deletions plugins/linear-genome-view/src/LinearGenomeView/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1557,13 +1557,14 @@ export function stateModelFactory(pluginManager: PluginManager) {

/**
* #method
* scrolls the view to center on the given bp. if that is not in any
* of the displayed regions, does nothing
* scrolls the view to center on the given bp. if that is not in any of
* the displayed regions, does nothing
*
* @param coord - basepair at which you want to center the view
* @param refName - refName of the displayedRegion you are centering at
* @param regionNumber - index of the displayedRegion
*/
centerAt(coord: number, refName: string, regionNumber: number) {
centerAt(coord: number, refName: string, regionNumber?: number) {
const centerPx = this.bpToPx({
refName,
coord,
Expand Down
Loading

0 comments on commit 42442fe

Please sign in to comment.