Skip to content

Commit

Permalink
Rename some variables
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Jan 28, 2025
1 parent 33330c9 commit 085d5d1
Show file tree
Hide file tree
Showing 11 changed files with 289 additions and 311 deletions.
28 changes: 14 additions & 14 deletions plugins/alignments/src/LinearSNPCoverageDisplay/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function stateModelFactory(
/**
* #property
*/
showIndicators: types.maybe(types.boolean),
showInterbaseIndicators: types.maybe(types.boolean),
/**
* #property
*/
Expand Down Expand Up @@ -159,17 +159,15 @@ function stateModelFactory(
const configBlob =
getConf(self, ['renderers', self.rendererTypeName]) || {}

const {
showArcs: showArcs,
showInterbaseCounts,
showIndicators: showIndicators,
} = self
const { showArcs, showInterbaseCounts, showInterbaseIndicators } =
self
return self.rendererType.configSchema.create(
{
...configBlob,
showInterbaseCounts:
showInterbaseCounts ?? configBlob.showInterbaseCounts,
showIndicators: showIndicators ?? configBlob.showIndicators,
showInterbaseIndicators:
showInterbaseIndicators ?? configBlob.showInterbaseIndicators,
showArcs: showArcs ?? configBlob.showArcs,
},
getEnv(self),
Expand All @@ -195,10 +193,10 @@ function stateModelFactory(
/**
* #getter
*/
get showIndicatorsSetting() {
get showInterbaseIndicatorsSetting() {
return (
self.showIndicators ??
readConfObject(this.rendererConfig, 'showIndicators')
self.showInterbaseIndicators ??
readConfObject(this.rendererConfig, 'showInterbaseIndicators')
)
},

Expand Down Expand Up @@ -238,8 +236,8 @@ function stateModelFactory(
/**
* #action
*/
setShowIndicators(arg: boolean) {
self.showIndicators = arg
setShowInterbaseIndicators(arg: boolean) {
self.showInterbaseIndicators = arg
},
/**
* #action
Expand Down Expand Up @@ -368,9 +366,11 @@ function stateModelFactory(
label: 'Show insertion/clipping indicators',
icon: VisibilityIcon,
type: 'checkbox',
checked: self.showIndicatorsSetting,
checked: self.showInterbaseIndicatorsSetting,
onClick: () => {
self.setShowIndicators(!self.showIndicatorsSetting)
self.setShowInterbaseIndicators(
!self.showInterbaseIndicatorsSetting,
)
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Crosshair = observer(function ({
const { hoveredGenotype, height, scrollTop, rowHeight, sources } = model
const { width } = getContainingView(model) as LinearGenomeViewModel
const source = sources?.[Math.floor(mouseY / rowHeight)]
const y = mouseY - lineZoneHeight - scrollTop
const y = mouseY - scrollTop
return source ? (
<div className={classes.rel}>
<svg
Expand Down
4 changes: 4 additions & 0 deletions plugins/variants/src/MultiLinearVariantDisplay/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export function stateModelFactory(configSchema: AnyConfigurationSchemaType) {
* #property
*/
minorAlleleFrequencyFilter: types.optional(types.number, 0),
/**
* #property
*/
autoHeight: false,
}),
)
.views(() => ({
Expand Down
2 changes: 1 addition & 1 deletion plugins/variants/src/shared/MultiVariantBaseModel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default function MultiVariantBaseModelF(
* #property
* used only if autoHeight is false
*/
rowHeightSetting: types.optional(types.number, 1),
rowHeightSetting: types.optional(types.number, 8),

/**
* #property
Expand Down
2 changes: 1 addition & 1 deletion website/docs/models/BaseWebSession.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ renderProps: () => {
```js
// type signature
getTrackActionMenuItems: (config: { [x: string]: any; } & NonEmptyObject & { setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({ [x: string]: any; } & NonEmptyObject & { ...; } & IStateTreeNode<...>); } & IStateTreeNode<...>) => ({ ...; } | { ...; })[]
getTrackActionMenuItems: (config: { [x: string]: any; } & NonEmptyObject & { setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({ [x: string]: any; } & NonEmptyObject & { ...; } & IStateTreeNode<...>); } & IStateTreeNode<...>) => ({ ...; } | ... 1 more ... | { ...; })[]
```
#### method: menus
Expand Down
2 changes: 1 addition & 1 deletion website/docs/models/DesktopSessionTrackMenuMixin.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ reference the markdown files in our repo of the checked out git tag

```js
// type signature
getTrackActionMenuItems: (trackConfig: { [x: string]: any; } & NonEmptyObject & { setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({ [x: string]: any; } & NonEmptyObject & { ...; } & IStateTreeNode<...>); } & IStateTreeNode<...>) => { ...; }[]
getTrackActionMenuItems: (trackConfig: { [x: string]: any; } & NonEmptyObject & { setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({ [x: string]: any; } & NonEmptyObject & { ...; } & IStateTreeNode<...>); } & IStateTreeNode<...>) => ({ ...; } | { ...; })[]
```
30 changes: 15 additions & 15 deletions website/docs/models/LinearSNPCoverageDisplay.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,31 @@ ISimpleType<"LinearSNPCoverageDisplay">
type: types.literal('LinearSNPCoverageDisplay')
```

#### property: drawInterbaseCounts
#### property: showInterbaseCounts

```js
// type signature
IMaybe<ISimpleType<boolean>>
// code
drawInterbaseCounts: types.maybe(types.boolean)
showInterbaseCounts: types.maybe(types.boolean)
```

#### property: drawIndicators
#### property: showIndicators

```js
// type signature
IMaybe<ISimpleType<boolean>>
// code
drawIndicators: types.maybe(types.boolean)
showIndicators: types.maybe(types.boolean)
```

#### property: drawArcs
#### property: showArcs

```js
// type signature
IMaybe<ISimpleType<boolean>>
// code
drawArcs: types.maybe(types.boolean)
showArcs: types.maybe(types.boolean)
```

#### property: filterBySetting
Expand Down Expand Up @@ -112,21 +112,21 @@ any
{ [x: string]: any; } & NonEmptyObject & { setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({ [x: string]: any; } & NonEmptyObject & ... & IStateTreeNode<...>); } & IStateTreeNode<...>
```

#### getter: drawArcsSetting
#### getter: showArcsSetting

```js
// type
any
```

#### getter: drawInterbaseCountsSetting
#### getter: showInterbaseCountsSetting

```js
// type
any
```

#### getter: drawIndicatorsSetting
#### getter: showIndicatorsSetting

```js
// type
Expand Down Expand Up @@ -266,23 +266,23 @@ updateVisibleModifications: (uniqueModifications: ModificationType[]) => void
setModificationsReady: (flag: boolean) => void
```

#### action: toggleDrawIndicators
#### action: setShowIndicators

```js
// type signature
toggleDrawIndicators: () => void
setShowIndicators: (arg: boolean) => void
```

#### action: toggleDrawInterbaseCounts
#### action: setShowInterbaseCounts

```js
// type signature
toggleDrawInterbaseCounts: () => void
setShowInterbaseCounts: (arg: boolean) => void
```

#### action: toggleDrawArcs
#### action: setShowArcs

```js
// type signature
toggleDrawArcs: () => void
setShowArcs: (arg: boolean) => void
```
140 changes: 3 additions & 137 deletions website/docs/models/LinearVariantMatrixDisplay.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ reference the markdown files in our repo of the checked out git tag

extends

- [LinearBareDisplay](../linearbaredisplay)
- [MultiVariantBaseModel](../multivariantbasemodel)

### LinearVariantMatrixDisplay - Properties

Expand All @@ -35,67 +35,17 @@ ISimpleType<"LinearVariantMatrixDisplay">
type: types.literal('LinearVariantMatrixDisplay')
```

#### property: layout

```js
// type signature
IOptionalIType<IType<Source[], Source[], Source[]>, [undefined]>
// code
layout: types.optional(types.frozen<Source[]>(), [])
```

#### property: configuration

```js
// type signature
AnyConfigurationSchemaType
// code
configuration: ConfigurationReference(configSchema)
```

#### property: minorAlleleFrequencyFilter
#### property: rowHeightSetting

```js
// type signature
IOptionalIType<ISimpleType<number>, [undefined]>
// code
minorAlleleFrequencyFilter: types.optional(types.number, 0.1)
```

#### property: showSidebarLabelsSetting

```js
// type signature
true
// code
showSidebarLabelsSetting: true
```

#### property: phasedMode

```js
// type signature
IOptionalIType<ISimpleType<string>, [undefined]>
// code
phasedMode: types.optional(types.string, 'none')
rowHeightSetting: types.optional(types.number, 1)
```

### LinearVariantMatrixDisplay - Getters

#### getter: preSources

```js
// type
Source[]
```

#### getter: sources

```js
// type
any[]
```

#### getter: blockType

```js
Expand Down Expand Up @@ -126,20 +76,6 @@ boolean

### LinearVariantMatrixDisplay - Methods

#### method: adapterProps

```js
// type signature
adapterProps: () => any
```

#### method: trackMenuItems

```js
// type signature
trackMenuItems: () => (MenuDivider | MenuSubHeader | NormalMenuItem | CheckboxMenuItem | RadioMenuItem | SubMenuItem | { ...; } | { ...; })[]
```

#### method: renderProps

```js
Expand All @@ -149,76 +85,6 @@ renderProps: () => any

### LinearVariantMatrixDisplay - Actions

#### action: setFeatures

```js
// type signature
setFeatures: (f: Feature[]) => void
```

#### action: setLayout

```js
// type signature
setLayout: (layout: Source[]) => void
```

#### action: clearLayout

```js
// type signature
clearLayout: () => void
```

#### action: setSourcesLoading

```js
// type signature
setSourcesLoading: (str: string) => void
```

#### action: setSources

```js
// type signature
setSources: (sources: Source[]) => void
```

#### action: setMafFilter

```js
// type signature
setMafFilter: (arg: number) => void
```

#### action: setShowSidebarLabels

```js
// type signature
setShowSidebarLabels: (arg: boolean) => void
```

#### action: setPhasedMode

```js
// type signature
setPhasedMode: (arg: string) => void
```

#### action: setHasPhased

```js
// type signature
setHasPhased: (arg: boolean) => void
```

#### action: setSamplePloidy

```js
// type signature
setSamplePloidy: (arg: Record<string, number>) => void
```

#### action: renderSvg

```js
Expand Down
2 changes: 1 addition & 1 deletion website/docs/models/LinearWiggleDisplay.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ renderProps: () => any

```js
// type signature
trackMenuItems: () => (MenuDivider | MenuSubHeader | NormalMenuItem | CheckboxMenuItem | RadioMenuItem | SubMenuItem | { ...; } | { ...; } | { ...; })[]
trackMenuItems: () => (MenuDivider | MenuSubHeader | NormalMenuItem | CheckboxMenuItem | RadioMenuItem | SubMenuItem | ... 4 more ... | { ...; })[]
```

### LinearWiggleDisplay - Actions
Expand Down
Loading

0 comments on commit 085d5d1

Please sign in to comment.