Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create mixin for shared code between LinearWiggleDisplay and MultiWiggleLinearDisplay #3743

Merged
merged 5 commits into from Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
77 changes: 4 additions & 73 deletions plugins/wiggle/src/LinearWiggleDisplay/models/configSchema.ts
@@ -1,13 +1,13 @@
import { ConfigurationSchema } from '@jbrowse/core/configuration'
import { baseLinearDisplayConfigSchema } from '@jbrowse/plugin-linear-genome-view'
import { types } from 'mobx-state-tree'
import PluginManager from '@jbrowse/core/PluginManager'

// locals
import sharedWiggleConfigFactory from '../../shared/configShared'

/**
* #config LinearWiggleDisplay
*/
function x() {} // eslint-disable-line @typescript-eslint/no-unused-vars

export default function WiggleConfigFactory(pluginManager: PluginManager) {
const XYPlotRendererConfigSchema =
pluginManager.getRendererType('XYPlotRenderer').configSchema
Expand All @@ -19,75 +19,6 @@ export default function WiggleConfigFactory(pluginManager: PluginManager) {
return ConfigurationSchema(
'LinearWiggleDisplay',
{
/**
* #slot
*/
autoscale: {
type: 'stringEnum',
defaultValue: 'local',
model: types.enumeration('Autoscale type', [
'global',
'local',
'globalsd',
'localsd',
'zscore',
]),
description:
'global/local using their min/max values or w/ standard deviations (globalsd/localsd)',
},

/**
* #slot
*/
minimalTicks: {
type: 'boolean',
defaultValue: false,
description: 'use the minimal amount of ticks',
},

/**
* #slot
*/
minScore: {
type: 'number',
defaultValue: Number.MIN_VALUE,
description: 'minimum value for the y-scale',
},
/**
* #slot
*/
maxScore: {
type: 'number',
description: 'maximum value for the y-scale',
defaultValue: Number.MAX_VALUE,
},
/**
* #slot
*/
numStdDev: {
type: 'number',
description:
'number of standard deviations to use for autoscale types globalsd or localsd',
defaultValue: 3,
},
/**
* #slot
*/
scaleType: {
type: 'stringEnum',
model: types.enumeration('Scale type', ['linear', 'log']), // todo zscale
description: 'The type of scale to use',
defaultValue: 'linear',
},
/**
* #slot
*/
inverted: {
type: 'boolean',
description: 'draw upside down',
defaultValue: false,
},

/**
* #slot
*/
Expand All @@ -109,7 +40,7 @@ export default function WiggleConfigFactory(pluginManager: PluginManager) {
/**
* #baseConfiguration
*/
baseConfiguration: baseLinearDisplayConfigSchema,
baseConfiguration: sharedWiggleConfigFactory(),
explicitlyTyped: true,
},
)
Expand Down