Skip to content

Commit

Permalink
Make bookmark table more compact
Browse files Browse the repository at this point in the history
  • Loading branch information
elliothershberg committed Jul 9, 2021
1 parent c736f73 commit 0cbadd6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,14 @@ function GridBookmarkWidget({ model }: { model: GridBookmarkModel }) {
const bookmarkRows = bookmarkedRegions.toJS().map((region: Region) => ({
...region,
id: `${region.refName}:${region.start}..${region.end}`,
chrom: region.refName,
delete: `${region.refName}:${region.start}..${region.end}`,
}))

const columns = [
{ field: 'chrom', headerName: 'chrom', width: 100 },
{ field: 'start', headerName: 'start', width: 100 },
{ field: 'end', headerName: 'end', width: 100 },
{ field: 'assemblyName', headerName: 'assembly', width: 100 },
{
field: 'id',
headerName: 'link',
width: 100,
headerName: 'bookmark link',
width: 300,
renderCell: (params: GridCellParams) => {
const { value } = params
return (
Expand Down
23 changes: 7 additions & 16 deletions plugins/data-management/src/GridBookmarkWidget/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,15 @@ import { types, Instance } from 'mobx-state-tree'

import PluginManager from '@jbrowse/core/PluginManager'
import { ElementId } from '@jbrowse/core/util/types/mst'
import { getSession } from '@jbrowse/core/util'

export default function f(pluginManager: PluginManager) {
return types
.model('GridBookmarkModel', {
id: ElementId,
type: types.literal('GridBookmarkWidget'),
view: types.safeReference(
pluginManager.pluggableMstType('view', 'stateModel'),
),
})
.actions(self => ({
async afterCreate() {
const session = getSession(self)
// @ts-ignore
session.updateDrawerWidth(575)
},
}))
return types.model('GridBookmarkModel', {
id: ElementId,
type: types.literal('GridBookmarkWidget'),
view: types.safeReference(
pluginManager.pluggableMstType('view', 'stateModel'),
),
})
}

export type GridBookmarkStateModel = ReturnType<typeof f>
Expand Down

0 comments on commit 0cbadd6

Please sign in to comment.