diff --git a/plugins/alignments/src/LinearSNPCoverageDisplay/model.ts b/plugins/alignments/src/LinearSNPCoverageDisplay/model.ts index 9229f97dee..37b802003e 100644 --- a/plugins/alignments/src/LinearSNPCoverageDisplay/model.ts +++ b/plugins/alignments/src/LinearSNPCoverageDisplay/model.ts @@ -57,7 +57,7 @@ function stateModelFactory( /** * #property */ - showIndicators: types.maybe(types.boolean), + showInterbaseIndicators: types.maybe(types.boolean), /** * #property */ @@ -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), @@ -195,10 +193,10 @@ function stateModelFactory( /** * #getter */ - get showIndicatorsSetting() { + get showInterbaseIndicatorsSetting() { return ( - self.showIndicators ?? - readConfObject(this.rendererConfig, 'showIndicators') + self.showInterbaseIndicators ?? + readConfObject(this.rendererConfig, 'showInterbaseIndicators') ) }, @@ -238,8 +236,8 @@ function stateModelFactory( /** * #action */ - setShowIndicators(arg: boolean) { - self.showIndicators = arg + setShowInterbaseIndicators(arg: boolean) { + self.showInterbaseIndicators = arg }, /** * #action @@ -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, + ) }, }, { diff --git a/plugins/variants/src/MultiLinearVariantDisplay/components/Crosshair.tsx b/plugins/variants/src/MultiLinearVariantDisplay/components/Crosshair.tsx index 3ecc23da19..fc04f5e498 100644 --- a/plugins/variants/src/MultiLinearVariantDisplay/components/Crosshair.tsx +++ b/plugins/variants/src/MultiLinearVariantDisplay/components/Crosshair.tsx @@ -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 ? (
({ diff --git a/plugins/variants/src/shared/MultiVariantBaseModel.tsx b/plugins/variants/src/shared/MultiVariantBaseModel.tsx index a016c70ce8..01de1d13fc 100644 --- a/plugins/variants/src/shared/MultiVariantBaseModel.tsx +++ b/plugins/variants/src/shared/MultiVariantBaseModel.tsx @@ -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 diff --git a/website/docs/models/BaseWebSession.md b/website/docs/models/BaseWebSession.md index d9be338671..a22ebc4b3b 100644 --- a/website/docs/models/BaseWebSession.md +++ b/website/docs/models/BaseWebSession.md @@ -165,7 +165,7 @@ renderProps: () => { ```js // type signature -getTrackActionMenuItems: (config: { [x: string]: any; } & NonEmptyObject & { setSubschema(slotName: string, data: Record): Record | ({ [x: string]: any; } & NonEmptyObject & { ...; } & IStateTreeNode<...>); } & IStateTreeNode<...>) => ({ ...; } | { ...; })[] +getTrackActionMenuItems: (config: { [x: string]: any; } & NonEmptyObject & { setSubschema(slotName: string, data: Record): Record | ({ [x: string]: any; } & NonEmptyObject & { ...; } & IStateTreeNode<...>); } & IStateTreeNode<...>) => ({ ...; } | ... 1 more ... | { ...; })[] ``` #### method: menus diff --git a/website/docs/models/DesktopSessionTrackMenuMixin.md b/website/docs/models/DesktopSessionTrackMenuMixin.md index 5183118dca..8f8f479f79 100644 --- a/website/docs/models/DesktopSessionTrackMenuMixin.md +++ b/website/docs/models/DesktopSessionTrackMenuMixin.md @@ -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): Record | ({ [x: string]: any; } & NonEmptyObject & { ...; } & IStateTreeNode<...>); } & IStateTreeNode<...>) => { ...; }[] +getTrackActionMenuItems: (trackConfig: { [x: string]: any; } & NonEmptyObject & { setSubschema(slotName: string, data: Record): Record | ({ [x: string]: any; } & NonEmptyObject & { ...; } & IStateTreeNode<...>); } & IStateTreeNode<...>) => ({ ...; } | { ...; })[] ``` diff --git a/website/docs/models/LinearSNPCoverageDisplay.md b/website/docs/models/LinearSNPCoverageDisplay.md index e8e5f7bff8..7d1f87e17f 100644 --- a/website/docs/models/LinearSNPCoverageDisplay.md +++ b/website/docs/models/LinearSNPCoverageDisplay.md @@ -35,31 +35,31 @@ ISimpleType<"LinearSNPCoverageDisplay"> type: types.literal('LinearSNPCoverageDisplay') ``` -#### property: drawInterbaseCounts +#### property: showInterbaseCounts ```js // type signature IMaybe> // code -drawInterbaseCounts: types.maybe(types.boolean) +showInterbaseCounts: types.maybe(types.boolean) ``` -#### property: drawIndicators +#### property: showIndicators ```js // type signature IMaybe> // code -drawIndicators: types.maybe(types.boolean) +showIndicators: types.maybe(types.boolean) ``` -#### property: drawArcs +#### property: showArcs ```js // type signature IMaybe> // code -drawArcs: types.maybe(types.boolean) +showArcs: types.maybe(types.boolean) ``` #### property: filterBySetting @@ -112,21 +112,21 @@ any { [x: string]: any; } & NonEmptyObject & { setSubschema(slotName: string, data: Record): Record | ({ [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 @@ -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 ``` diff --git a/website/docs/models/LinearVariantMatrixDisplay.md b/website/docs/models/LinearVariantMatrixDisplay.md index f96b918f0a..70ec197aff 100644 --- a/website/docs/models/LinearVariantMatrixDisplay.md +++ b/website/docs/models/LinearVariantMatrixDisplay.md @@ -22,7 +22,7 @@ reference the markdown files in our repo of the checked out git tag extends -- [LinearBareDisplay](../linearbaredisplay) +- [MultiVariantBaseModel](../multivariantbasemodel) ### LinearVariantMatrixDisplay - Properties @@ -35,67 +35,17 @@ ISimpleType<"LinearVariantMatrixDisplay"> type: types.literal('LinearVariantMatrixDisplay') ``` -#### property: layout - -```js -// type signature -IOptionalIType, [undefined]> -// code -layout: types.optional(types.frozen(), []) -``` - -#### property: configuration - -```js -// type signature -AnyConfigurationSchemaType -// code -configuration: ConfigurationReference(configSchema) -``` - -#### property: minorAlleleFrequencyFilter +#### property: rowHeightSetting ```js // type signature IOptionalIType, [undefined]> // code -minorAlleleFrequencyFilter: types.optional(types.number, 0.1) -``` - -#### property: showSidebarLabelsSetting - -```js -// type signature -true -// code -showSidebarLabelsSetting: true -``` - -#### property: phasedMode - -```js -// type signature -IOptionalIType, [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 @@ -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 @@ -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) => void -``` - #### action: renderSvg ```js diff --git a/website/docs/models/LinearWiggleDisplay.md b/website/docs/models/LinearWiggleDisplay.md index 7bfd196557..247515c09c 100644 --- a/website/docs/models/LinearWiggleDisplay.md +++ b/website/docs/models/LinearWiggleDisplay.md @@ -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 diff --git a/website/docs/models/MultiLinearVariantDisplay.md b/website/docs/models/MultiLinearVariantDisplay.md index d769355604..8217e48c69 100644 --- a/website/docs/models/MultiLinearVariantDisplay.md +++ b/website/docs/models/MultiLinearVariantDisplay.md @@ -22,7 +22,7 @@ reference the markdown files in our repo of the checked out git tag extends -- [LinearBareDisplay](../linearbaredisplay) +- [MultiVariantBaseModel](../linearbaredisplay) ### MultiLinearVariantDisplay - Properties @@ -35,15 +35,6 @@ ISimpleType<"MultiLinearVariantDisplay"> type: types.literal('MultiLinearVariantDisplay') ``` -#### property: layout - -```js -// type signature -IOptionalIType, [undefined]> -// code -layout: types.optional(types.frozen(), []) -``` - #### property: rowHeightSetting used only if autoHeight is false @@ -55,151 +46,26 @@ IOptionalIType, [undefined]> rowHeightSetting: types.optional(types.number, 11) ``` -#### property: autoHeight - -adjust to height of track/display - -```js -// type signature -false -// code -autoHeight: false -``` - -#### property: showSidebarLabelsSetting +#### property: minorAlleleFrequencyFilter ```js // type signature -true +IOptionalIType, [undefined]> // code -showSidebarLabelsSetting: true +minorAlleleFrequencyFilter: types.optional(types.number, 0) ``` ### MultiLinearVariantDisplay - Getters -#### getter: featureUnderMouse - -```js -// type -Feature -``` - -#### getter: TooltipComponent - -```js -// type -React.ComponentType -``` - -#### getter: sources +#### getter: rendererTypeName ```js // type -{ [x: string]: unknown; baseUri?: string; name: string; label?: string; color?: string; group?: string; HP?: number; }[] -``` - -#### getter: rowHeight - -```js -// type -number -``` - -#### getter: canDisplayLabels - -```js -// type -boolean -``` - -#### getter: totalHeight - -```js -// type -number -``` - -### MultiLinearVariantDisplay - Methods - -#### method: adapterProps - -```js -// type signature -adapterProps: () => any -``` - -#### method: renderProps - -```js -// type signature -renderProps: () => any -``` - -#### method: trackMenuItems - -```js -// type signature -trackMenuItems: () => (MenuDivider | MenuSubHeader | NormalMenuItem | CheckboxMenuItem | RadioMenuItem | SubMenuItem | { ...; })[] +string ``` ### MultiLinearVariantDisplay - Actions -#### action: setSourcesLoading - -```js -// type signature -setSourcesLoading: (str: string) => void -``` - -#### action: setLayout - -```js -// type signature -setLayout: (layout: Source[]) => void -``` - -#### action: clearLayout - -```js -// type signature -clearLayout: () => void -``` - -#### action: setSources - -```js -// type signature -setSources: (sources: Source[]) => void -``` - -#### action: setFeatureUnderMouse - -```js -// type signature -setFeatureUnderMouse: (f?: Feature) => void -``` - -#### action: setRowHeight - -```js -// type signature -setRowHeight: (arg: number) => void -``` - -#### action: setAutoHeight - -```js -// type signature -setAutoHeight: (arg: boolean) => void -``` - -#### action: setShowSidebarLabels - -```js -// type signature -setShowSidebarLabels: (arg: boolean) => void -``` - #### action: renderSvg ```js diff --git a/website/docs/models/MultiVariantBaseModel.md b/website/docs/models/MultiVariantBaseModel.md new file mode 100644 index 0000000000..a9d708392d --- /dev/null +++ b/website/docs/models/MultiVariantBaseModel.md @@ -0,0 +1,242 @@ +--- +id: multivariantbasemodel +title: MultiVariantBaseModel +--- + +Note: this document is automatically generated from mobx-state-tree objects in +our source code. See +[Core concepts and intro to pluggable elements](/docs/developer_guide/) for more +info + +Also note: this document represents the state model API for the current released +version of jbrowse. If you are not using the current version, please cross +reference the markdown files in our repo of the checked out git tag + +## Links + +[Source code](https://github.com/GMOD/jbrowse-components/blob/main/plugins/variants/src/shared/MultiVariantBaseModel.tsx) + +[GitHub page](https://github.com/GMOD/jbrowse-components/tree/main/website/docs/models/MultiVariantBaseModel.md) + +## Docs + +extends + +- [LinearBareDisplay](../linearbaredisplay) + +### MultiVariantBaseModel - Properties + +#### property: type + +```js +// type signature +ISimpleType<"LinearVariantMatrixDisplay"> +// code +type: types.literal('LinearVariantMatrixDisplay') +``` + +#### property: layout + +```js +// type signature +IOptionalIType, [undefined]> +// code +layout: types.optional(types.frozen(), []) +``` + +#### property: configuration + +```js +// type signature +AnyConfigurationSchemaType +// code +configuration: ConfigurationReference(configSchema) +``` + +#### property: minorAlleleFrequencyFilter + +```js +// type signature +IOptionalIType, [undefined]> +// code +minorAlleleFrequencyFilter: types.optional(types.number, 0.1) +``` + +#### property: showSidebarLabelsSetting + +```js +// type signature +true +// code +showSidebarLabelsSetting: true +``` + +#### property: renderingMode + +```js +// type signature +IOptionalIType, [undefined]> +// code +renderingMode: types.optional(types.string, 'alleleCount') +``` + +#### property: rowHeightSetting + +used only if autoHeight is false + +```js +// type signature +IOptionalIType, [undefined]> +// code +rowHeightSetting: types.optional(types.number, 1) +``` + +#### property: autoHeight + +used only if autoHeight is false + +```js +// type signature +true +// code +autoHeight: true +``` + +### MultiVariantBaseModel - Getters + +#### getter: preSources + +```js +// type +Source[] +``` + +#### getter: sources + +```js +// type +any[] +``` + +#### getter: rowHeight + +```js +// type +number +``` + +#### getter: totalHeight + +```js +// type +number +``` + +### MultiVariantBaseModel - Methods + +#### method: adapterProps + +```js +// type signature +adapterProps: () => any +``` + +#### method: trackMenuItems + +```js +// type signature +trackMenuItems: () => (MenuDivider | MenuSubHeader | NormalMenuItem | CheckboxMenuItem | RadioMenuItem | SubMenuItem | { ...; } | { ...; } | { ...; })[] +``` + +### MultiVariantBaseModel - Actions + +#### action: setRowHeight + +```js +// type signature +setRowHeight: (arg: number) => void +``` + +#### action: setHoveredGenotype + +```js +// type signature +setHoveredGenotype: (arg: string) => void +``` + +#### 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: setAutoHeight + +```js +// type signature +setAutoHeight: (arg: boolean) => void +``` + +#### action: setHasPhased + +```js +// type signature +setHasPhased: (arg: boolean) => void +``` + +#### action: setSampleInfo + +```js +// type signature +setSampleInfo: (arg: Record) => void +```