Skip to content

Commit

Permalink
removes "nonsense" menu options on synteny and ensures user choice pe…
Browse files Browse the repository at this point in the history
…rsistence on refresh
  • Loading branch information
carolinebridge committed Jun 29, 2023
1 parent 2ee4b48 commit 4b8386f
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/alignments/src/LinearPileupDisplay/model.ts
Expand Up @@ -749,7 +749,7 @@ function stateModelFactory(configSchema: AnyConfigurationSchemaType) {
],
},
{
label: 'Set max height',
label: 'Set max height...',
onClick: () => {
getSession(self).queueDialog(doneCallback => [
SetMaxHeightDlg,
Expand Down
45 changes: 43 additions & 2 deletions plugins/linear-comparative-view/src/LGVSyntenyDisplay/model.ts
Expand Up @@ -166,10 +166,51 @@ function stateModelFactory(schema: AnyConfigurationSchemaType) {
},
}
})
.views(self => {
const superTrackMenuItems = self.trackMenuItems()
const toFind = [
'Show soft clipping',
'Sort by',
'Fade mismatches by quality',
'Color scheme',
]

toFind.forEach((target: string) => {
const index = superTrackMenuItems.findIndex(
(item: any) => item.label === target,

Check warning on line 180 in plugins/linear-comparative-view/src/LGVSyntenyDisplay/model.ts

View workflow job for this annotation

GitHub Actions / Lint on node 16 and ubuntu-latest

Unexpected any. Specify a different type
)
if (target === 'Color scheme') {
const toFindColor = [
'Pair orientation',
'Modifications or methylation',
'Insert size',
]
toFindColor.forEach((colorTarget: string) => {
// @ts-ignore
const tIndex = superTrackMenuItems[index].subMenu.findIndex(
(item: any) => item.label === colorTarget,

Check warning on line 191 in plugins/linear-comparative-view/src/LGVSyntenyDisplay/model.ts

View workflow job for this annotation

GitHub Actions / Lint on node 16 and ubuntu-latest

Unexpected any. Specify a different type
)
// @ts-ignore
superTrackMenuItems[index].subMenu.splice(tIndex, 1)
})
} else {
superTrackMenuItems.splice(index, 1)
}
})
return {
trackMenuItems() {
return [...superTrackMenuItems]
},
}
})
.actions(self => ({
afterCreate() {
// use color by strand to help indicate inversions better
self.setColorScheme({ type: 'strand' })
// use color by stand to help indicate inversions better on first load, otherwise use selected orientation
if (self.colorBy) {
self.setColorScheme({ ...self.colorBy })
} else {
self.setColorScheme({ type: 'strand' })
}
},
}))
}
Expand Down

0 comments on commit 4b8386f

Please sign in to comment.