Skip to content

Commit

Permalink
Misc
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Nov 4, 2024
1 parent b71c4a6 commit 3ab8c07
Show file tree
Hide file tree
Showing 12 changed files with 841 additions and 918 deletions.
2 changes: 2 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export default tseslint.config(
'unicorn/prefer-at': 'off',
'unicorn/prefer-string-replace-all': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/prefer-global-this': 'off',

'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
Expand All @@ -138,6 +139,7 @@ export default tseslint.config(
'@typescript-eslint/no-extraneous-class': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-dynamic-delete': 'off',
'@typescript-eslint/no-deprecated': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
Expand Down
86 changes: 68 additions & 18 deletions lib/apidocs/MsaView.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ width of columns, px
// type signature
number
// code
colWidth: 16
colWidth: 14
```

#### property: contrastLettering
Expand Down Expand Up @@ -89,7 +89,11 @@ autorun
// type signature
IOptionalIType<IModelType<{ tree: IMaybe<ISimpleType<string>>; msa: IMaybe<ISimpleType<string>>; treeMetadata: IMaybe<ISimpleType<string>>; }, { ...; }, _NotCustomized, { ...; }>, [...]>
// code
data: types.optional(DataModelF(), { tree: '', msa: '' })
data: types.optional(DataModelF(), {
tree: '',
msa: '',
treeMetadata: '',
})
```

#### property: drawMsaLetters
Expand Down Expand Up @@ -134,9 +138,9 @@ height: types.optional(types.number, 550)

```js
// type signature
true
false
// code
hideGaps: true
hideGaps: false
```

#### property: id
Expand All @@ -162,6 +166,15 @@ IMaybe<ISnapshotProcessor<ITypeUnion<ModelCreationType<ExtractCFromProps<{ locat
msaFilehandle: types.maybe(FileLocation)
```
#### property: relativeTo
```js
// type signature
IMaybe<ISimpleType<string>>
// code
relativeTo: types.maybe(types.string)
```
#### property: rowHeight
height of each row, px
Expand All @@ -170,7 +183,7 @@ height of each row, px
// type signature
number
// code
rowHeight: 20
rowHeight: 18
```
#### property: scrollX
Expand Down Expand Up @@ -437,7 +450,7 @@ number
```js
// type
any[]
() => any[]
```
#### getter: mouseOverRowName
Expand All @@ -451,7 +464,7 @@ any
```js
// type
;ClustalMSA | StockholmMSA | FastaMSA
;ClustalMSA | EmfMSA | StockholmMSA | FastaMSA
```
#### getter: msaAreaHeight
Expand Down Expand Up @@ -493,20 +506,41 @@ boolean
number
```
#### getter: realAllowedGappyness
```js
// type
number
```
#### getter: root
```js
// type
HierarchyNode<any>
```
#### getter: rowMap
```js
// type
Map<unknown, unknown>
```
#### getter: rowNames
```js
// type
string[]
```
#### getter: rowNamesSet
```js
// type
Map<string, number>
```
#### getter: rows
```js
Expand Down Expand Up @@ -563,25 +597,25 @@ boolean
{ [k: string]: string; }
```
#### getter: tidyInterProAnnotations
#### getter: tidyFilteredGatheredInterProAnnotations
```js
// type
any[]
Record<string, unknown[]>
```
#### getter: tidyFilteredAnnotations
#### getter: tidyFilteredInterProAnnotations
```js
// type
any
```
#### getter: tidyFilteredGatheredAnnotations
#### getter: tidyInterProAnnotations
```js
// type
Record<string, unknown[]>
any[]
```
#### getter: tidyInterProAnnotationTypes
Expand Down Expand Up @@ -685,17 +719,26 @@ extraViewMenuItems: () => any[]
```js
// type signature
getRowData: (name: string) => { data: any; }
getRowData: (name: string) => { data: any; treeMetadata: any; }
```
#### method: globalCoordToRowSpecificSeqCoord
#### method: mouseOverCoordToGapRemovedRowCoord
return a row-specific sequence coordinate, skipping gaps, given a global
coordinate
return a row-specific sequence coordinate, skipping gaps, given a
global coordinate
```js
// type signature
globalCoordToRowSpecificSeqCoord: (rowName: string, position: number) => number
mouseOverCoordToGapRemovedRowCoord: (rowName: string, position: number) => number
```
#### method: mouseOverCoordToRowLetter
return a row-specific letter, or undefined if gap
```js
// type signature
mouseOverCoordToRowLetter: (rowName: string, position: number) => any
```
#### method: seqCoordToRowSpecificGlobalCoord
Expand Down Expand Up @@ -724,6 +767,13 @@ doScrollX: (deltaX: number) => void
doScrollY: (deltaY: number) => void
```
#### action: drawRelativeTo
```js
// type signature
drawRelativeTo: (id: string) => void
```
#### action: exportSVG
```js
Expand Down Expand Up @@ -788,7 +838,7 @@ setCurrentAlignment: (n: number) => void
```js
// type signature
setData: (data: { msa?: string; tree?: string; }) => void
setData: (data: { msa?: string; tree?: string; treeMetadata?: string; }) => void
```
#### action: setDrawMsaLetters
Expand Down
1 change: 0 additions & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"file-saver": "^2.0.5",
"pako": "^2.1.0",
"rbush": "^3.0.1",
"react-error-boundary": "^4.0.13",
"stockholm-js": "^1.0.10",
"svgcanvas": "^2.5.0"
}
Expand Down
4 changes: 2 additions & 2 deletions lib/src/components/Loading.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { observer } from 'mobx-react'
import { Button, Typography } from '@mui/material'
import { ErrorBoundary } from 'react-error-boundary'
import { ErrorBoundary } from '@jbrowse/core/ui/ErrorBoundary'
import { ErrorMessage } from '@jbrowse/core/ui'

// locals
Expand Down Expand Up @@ -38,7 +38,7 @@ const Loading = observer(function ({ model }: { model: MsaViewModel }) {
return (
<div>
<ErrorBoundary
fallbackRender={props => <Reset model={model} error={props.error} />}
FallbackComponent={e => <Reset model={model} error={e.error} />}
>
{dataInitialized ? (
isLoading ? (
Expand Down
7 changes: 3 additions & 4 deletions lib/src/components/dialogs/MetadataDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import React from 'react'
import { DialogContent } from '@mui/material'
import { observer } from 'mobx-react'
import { Dialog } from '@jbrowse/core/ui'
import {
Attributes,
BaseCard,
} from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail'

import Attributes from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/Attributes'
import BaseCard from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard'

// locals
import type { MsaViewModel } from '../../model'
Expand Down
32 changes: 17 additions & 15 deletions lib/src/components/dialogs/SettingsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,50 +59,50 @@ const TreeSettings = observer(function TreeSettings({
<h1>Tree options</h1>
<Checkbox2
checked={showBranchLen}
label="Show branch length?"
onChange={() => {
model.setShowBranchLen(!showBranchLen)
}}
label="Show branch length?"
/>

<Checkbox2
checked={drawNodeBubbles}
label="Draw clickable bubbles on tree branches?"
onChange={() => {
model.setDrawNodeBubbles(!drawNodeBubbles)
}}
label="Draw clickable bubbles on tree branches?"
/>
<Checkbox2
checked={drawTree}
label="Show tree?"
onChange={() => {
model.setDrawTree(!drawTree)
}}
label="Show tree?"
/>

<Checkbox2
checked={labelsAlignRight}
label="Tree labels align right?"
onChange={() => {
model.setLabelsAlignRight(!labelsAlignRight)
}}
label="Tree labels align right?"
/>

<Checkbox2
checked={drawLabels}
label="Draw labels"
onChange={() => {
model.setDrawLabels(!drawLabels)
}}
label="Draw labels"
/>
{noTree ? null : (
<div>
<Checkbox2
checked={treeWidthMatchesArea}
label="Make tree width fit to tree area?"
onChange={() => {
model.setTreeWidthMatchesArea(!treeWidthMatchesArea)
}}
label="Make tree width fit to tree area?"
/>
{treeWidthMatchesArea ? null : (
<div className={classes.flex}>
Expand Down Expand Up @@ -146,35 +146,37 @@ const MSASettings = observer(function MSASettings({
<h1>MSA options</h1>
<Checkbox2
checked={drawMsaLetters}
label="Draw letters"
onChange={() => {
model.setDrawMsaLetters(!drawMsaLetters)
}}
label="Draw letters"
/>
<Checkbox2
checked={bgColor}
label="Color background tiles of MSA?"
onChange={() => {
model.setBgColor(!bgColor)
}}
label="Color background tiles of MSA?"
/>
<Checkbox2
checked={contrastLettering}
label="Use contrast lettering"
onChange={() => {
model.setContrastLettering(!contrastLettering)
}}
label="Use contrast lettering"
/>
<Checkbox2
checked={hideGaps}
label="Enable hiding gappy columns?"
onChange={() => {
model.setHideGaps(!hideGaps)
}}
label={`Hide columns that are ${allowedGappyness}% gaps`}
/>
{hideGaps ? (
<div className={classes.flex}>
<Typography>Allowed gappyness ({100 - allowedGappyness}%)</Typography>
<Typography>
Hide columns with more than {allowedGappyness}% gaps
</Typography>
<Slider
className={classes.field}
min={1}
Expand Down Expand Up @@ -240,21 +242,21 @@ const SettingsDialog = observer(function ({
return (
<Dialog
open
title="Settings"
maxWidth="xl"
onClose={() => {
onClose()
}}
title="Settings"
maxWidth="xl"
>
<DialogContent className={classes.minw}>
<SettingsContent model={model} />
<DialogActions>
<Button
variant="contained"
color="primary"
onClick={() => {
onClose()
}}
variant="contained"
color="primary"
>
Submit
</Button>
Expand Down
Loading

0 comments on commit 3ab8c07

Please sign in to comment.