Skip to content

Commit

Permalink
Use hasRenderings method to determine if it is toggle-able
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Jun 28, 2022
1 parent 9cd97b3 commit 3c58d72
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 90 deletions.
68 changes: 0 additions & 68 deletions plugins/wiggle/src/LinePlotRenderer/configSchema.js

This file was deleted.

30 changes: 16 additions & 14 deletions plugins/wiggle/src/LinearWiggleDisplay/models/model.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ const stateModelFactory = (
})
.views(self => {
const { trackMenuItems: superTrackMenuItems } = self
console.log(getConf(self, 'renderers'))
const hasRenderings = getConf(self, 'defaultRendering')
return {
trackMenuItems() {
return [
Expand All @@ -378,12 +378,10 @@ const stateModelFactory = (
},
{
label: 'Summary score mode',
subMenu: ['min', 'max', 'avg', 'whiskers'].map(elt => {
return {
label: elt,
onClick: () => self.setSummaryScoreMode(elt),
}
}),
subMenu: ['min', 'max', 'avg', 'whiskers'].map(elt => ({
label: elt,
onClick: () => self.setSummaryScoreMode(elt),
})),
},
]
: []),
Expand All @@ -408,13 +406,17 @@ const stateModelFactory = (
checked: self.displayCrossHatchesSetting,
onClick: () => self.toggleCrossHatches(),
},
{
label: 'Renderer type',
subMenu: ['xyplot', 'density', 'line'].map(key => ({
label: key,
onClick: () => self.setRendererType(key),
})),
},
...(hasRenderings
? [
{
label: 'Renderer type',
subMenu: ['xyplot', 'density', 'line'].map(key => ({
label: key,
onClick: () => self.setRendererType(key),
})),
},
]
: []),
{
label: 'Autoscale type',
subMenu: [
Expand Down
9 changes: 8 additions & 1 deletion plugins/wiggle/src/XYPlotRenderer/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ConfigurationSchema } from '@jbrowse/core/configuration'
import ConfigSchema from '../configSchema'

import { types } from 'mobx-state-tree'
export { default as ReactComponent } from '../WiggleRendering'
export { default } from './XYPlotRenderer'

Expand All @@ -16,6 +16,13 @@ export const configSchema = ConfigurationSchema(
description: 'choose to draw cross hatches (sideways lines)',
defaultValue: false,
},
summaryScoreMode: {
type: 'stringEnum',
model: types.enumeration('Score type', ['max', 'min', 'avg', 'whiskers']),
description:
'choose whether to use max/min/average or whiskers which combines all three into the same rendering',
defaultValue: 'whiskers',
},
},
{ baseConfiguration: ConfigSchema, explicitlyTyped: true },
)
7 changes: 0 additions & 7 deletions plugins/wiggle/src/configSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ export default ConfigurationSchema(
defaultValue: 0,
description: 'value to use for bicolor pivot',
},
summaryScoreMode: {
type: 'stringEnum',
model: types.enumeration('Score type', ['max', 'min', 'avg', 'whiskers']),
description:
'choose whether to use max/min/average or whiskers which combines all three into the same rendering',
defaultValue: 'whiskers',
},
},
{ explicitlyTyped: true },
)

0 comments on commit 3c58d72

Please sign in to comment.