Skip to content

Commit

Permalink
Merge origin/main
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Nov 4, 2024
2 parents dc3f56f + c5ba32e commit def3bf9
Show file tree
Hide file tree
Showing 128 changed files with 2,815 additions and 2,176 deletions.
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,46 @@
yarn run v1.22.22 $ lerna-changelog --silent --silent --next-version 2.16.1

## 2.16.1 (2024-11-03)

#### :rocket: Enhancement

- `app-core`, `core`, `product-core`, `text-indexing`
- [#4624](https://github.com/GMOD/jbrowse-components/pull/4624) Add utility
links to synteny feature details to allow centering a view on a feature
([@cmdcolin](https://github.com/cmdcolin))
- Other
- [#4628](https://github.com/GMOD/jbrowse-components/pull/4628) Allow
configuring Hi-C normalization and default resolution multiplier
([@cmdcolin](https://github.com/cmdcolin))
- [#4619](https://github.com/GMOD/jbrowse-components/pull/4619) Add
resolutionMultiplier config slot to BigWigAdapter
([@cmdcolin](https://github.com/cmdcolin))

#### :bug: Bug Fix

- [#4634](https://github.com/GMOD/jbrowse-components/pull/4634) Fix opening
local files in the multi-wiggle add track selector
([@cmdcolin](https://github.com/cmdcolin))
- [#4633](https://github.com/GMOD/jbrowse-components/pull/4633) Fix "Add track"
select box not going away after selecting element
([@cmdcolin](https://github.com/cmdcolin))
- [#4632](https://github.com/GMOD/jbrowse-components/pull/4632) Standardize
modification colors between alignments track coverage and pileup subtracks
([@cmdcolin](https://github.com/cmdcolin))
- [#4631](https://github.com/GMOD/jbrowse-components/pull/4631) Fix config
description of assembly name ordering for synteny data adapters
([@cmdcolin](https://github.com/cmdcolin))
- [#4630](https://github.com/GMOD/jbrowse-components/pull/4630) Fix MM tag
modifications from particular BAM file failing to render on the negative
strand ([@cmdcolin](https://github.com/cmdcolin))
- [#4626](https://github.com/GMOD/jbrowse-components/pull/4626) Fix dark redraw
on selected features after vertical resize of the synteny canvas
([@cmdcolin](https://github.com/cmdcolin))

#### Committers: 1

- Colin Diesh ([@cmdcolin](https://github.com/cmdcolin)) Done in 1.20s.

yarn run v1.22.22 $ lerna-changelog --silent --silent --next-version 2.16.0

## 2.16.0 (2024-10-23)
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.16.0",
"version": "2.16.1",
"npmClient": "yarn",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"configdocs": "rm -rf website/docs/config && mkdir website/docs/config && yarn tsx docs/generateConfigDocs.ts",
"statedocs": "rm -rf website/docs/models && mkdir website/docs/models && yarn tsx docs/generateStateModelDocs.ts",
"autogen": "yarn statedocs && yarn configdocs && yarn prettier --write website",
"releasenotes": "npx prettier --prose-wrap never website/blog/$(ls -Art website/blog/ | tail -n 1)|sed -e '/## Downloads/,+7d'|tail -n +7"
"releasenotes": "yarn prettier --prose-wrap never website/blog/$(ls -Art website/blog/ | tail -n 1)|sed -e '/## Downloads/,+7d'|tail -n +7",
"copynotes": "yarn --silent releasenotes | xclip -selection clipboard"
},
"devDependencies": {
"@babel/core": "^7.3.4",
Expand Down Expand Up @@ -100,7 +101,7 @@
"dependency-graph": "^1.0.0",
"dotenv": "^16.3.1",
"dotenv-expand": "^11.0.3",
"electron": "32.1.0",
"electron": "33.0.2",
"electron-builder": "^25.1.6",
"electron-mock-ipc": "^0.3.8",
"eslint": "^9.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/app-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jbrowse/app-core",
"version": "2.16.0",
"version": "2.16.1",
"description": "JBrowse 2 code shared between the 'full featured' apps e.g. jbrowse-web and jbrowse-desktop",
"keywords": [
"jbrowse",
Expand Down Expand Up @@ -42,7 +42,7 @@
},
"dependencies": {
"@babel/runtime": "^7.16.3",
"@jbrowse/product-core": "^2.16.0",
"@jbrowse/product-core": "^2.16.1",
"@mui/icons-material": "^6.0.0",
"@mui/material": "^6.0.0",
"copy-to-clipboard": "^3.3.1"
Expand Down
36 changes: 22 additions & 14 deletions packages/app-core/src/ui/App/ViewMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,17 @@ const ViewMenu = observer(function ({
label: 'View order',
type: 'subMenu' as const,
subMenu: [
{
label: 'Move view to top',
icon: KeyboardDoubleArrowUpIcon,
onClick: () => {
session.moveViewToTop(model.id)
},
},
...(session.views.length > 2
? [
{
label: 'Move view to top',
icon: KeyboardDoubleArrowUpIcon,
onClick: () => {
session.moveViewToTop(model.id)
},
},
]
: []),
{
label: 'Move view up',
icon: KeyboardArrowUpIcon,
Expand All @@ -90,13 +94,17 @@ const ViewMenu = observer(function ({
session.moveViewDown(model.id)
},
},
{
label: 'Move view to bottom',
icon: KeyboardDoubleArrowDownIcon,
onClick: () => {
session.moveViewToBottom(model.id)
},
},
...(session.views.length > 2
? [
{
label: 'Move view to bottom',
icon: KeyboardDoubleArrowDownIcon,
onClick: () => {
session.moveViewToBottom(model.id)
},
},
]
: []),
],
},
]
Expand Down
41 changes: 41 additions & 0 deletions packages/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from 'react'
import {
Accordion,
AccordionDetails,
AccordionSummary,
Typography,
} from '@mui/material'
import { makeStyles } from 'tss-react/mui'

// icons
import ExpandMore from '@mui/icons-material/ExpandMore'

import { BaseCardProps } from '../types'

const useStyles = makeStyles()(theme => ({
expansionPanelDetails: {
display: 'block',
padding: theme.spacing(1),
},
icon: {
color: theme.palette.tertiary.contrastText || '#fff',
},
}))

export default function BaseCard({
children,
title,
defaultExpanded = true,
}: BaseCardProps) {
const { classes } = useStyles()
return (
<Accordion defaultExpanded={defaultExpanded}>
<AccordionSummary expandIcon={<ExpandMore className={classes.icon} />}>
<Typography variant="button">{title}</Typography>
</AccordionSummary>
<AccordionDetails className={classes.expansionPanelDetails}>
{children}
</AccordionDetails>
</Accordion>
)
}
53 changes: 53 additions & 0 deletions packages/core/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import React from 'react'
// locals
import { toLocale, SimpleFeatureSerialized } from '../../util'
import { BaseProps } from '../types'
import SimpleField from './SimpleField'
import Position from './Position'

export default function CoreDetails(props: BaseProps) {
const { feature } = props
const obj = feature as SimpleFeatureSerialized & {
start: number
end: number
assemblyName?: string
strand: number
refName: string
__jbrowsefmt: {
start?: number
assemblyName?: string
end?: number
refName?: string
name?: string
}
}

const formattedFeat = { ...obj, ...obj.__jbrowsefmt }
const { start, end } = formattedFeat

const displayedDetails: Record<string, any> = {
...formattedFeat,
length: toLocale(end - start),
}

const coreRenderedDetails = {
description: 'Description',
name: 'Name',
length: 'Length',
type: 'Type',
}
return (
<>
<SimpleField
name="Position"
value={<Position {...props} feature={formattedFeat} />}
/>
{Object.entries(coreRenderedDetails)
.map(([key, name]) => [name, displayedDetails[key]])
.filter(([, value]) => value != null)
.map(([name, value]) => (
<SimpleField key={name} name={name} value={value} />
))}
</>
)
}
111 changes: 111 additions & 0 deletions packages/core/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import React from 'react'
import { ErrorBoundary } from '@jbrowse/core/ui/ErrorBoundary'
import { Divider, Typography } from '@mui/material'
import { IAnyStateTreeNode } from 'mobx-state-tree'

// locals
import { getEnv, getSession, SimpleFeatureSerialized } from '../../util'
import { ErrorMessage } from '../../ui'
import { generateTitle } from './util'
import SequenceFeatureDetails from '../SequenceFeatureDetails'
import Attributes from './Attributes'
import BaseCard from './BaseCard'
import CoreDetails from './CoreDetails'

// coreDetails are omitted in some circumstances
const coreDetails = [
'name',
'start',
'end',
'strand',
'refName',
'description',
'type',
]

interface PanelDescriptor {
name: string
Component: React.FC<any>
}

export default function FeatureDetails(props: {
model: IAnyStateTreeNode
feature: SimpleFeatureSerialized
depth?: number
omit?: string[]
descriptions?: Record<string, React.ReactNode>
formatter?: (val: unknown, key: string) => React.ReactNode
}) {
const { omit = [], model, feature, depth = 0 } = props
const { maxDepth } = model
const { mate, name = '', id = '', type = '', subfeatures, uniqueId } = feature
const pm = getEnv(model).pluginManager
const session = getSession(model)

const ExtraPanel = pm.evaluateExtensionPoint('Core-extraFeaturePanel', null, {
session,
feature,
model,
}) as PanelDescriptor | undefined
const m = mate as { start: number; end: number; refName: string } | undefined
return (
<BaseCard title={generateTitle(name, id, type)}>
<Typography>Core details</Typography>
<CoreDetails {...props} />
{m ? (
<>
<Divider />
<Typography>Mate details</Typography>
<CoreDetails
{...props}
feature={{
...m,
start: m.start,
end: m.end,
refName: m.refName,
uniqueId: `${uniqueId}-mate`,
}}
/>
</>
) : null}

<Divider />
<Typography>Attributes</Typography>
<Attributes
attributes={feature}
{...props}
omit={omit}
omitSingleLevel={coreDetails}
/>

<ErrorBoundary FallbackComponent={e => <ErrorMessage error={e.error} />}>
<SequenceFeatureDetails {...props} />
</ErrorBoundary>

{ExtraPanel ? (
<>
<Divider />
<BaseCard title={ExtraPanel.name}>
<ExtraPanel.Component {...props} />
</BaseCard>
</>
) : null}

{depth < maxDepth && subfeatures?.length ? (
<BaseCard title="Subfeatures" defaultExpanded={depth < 1}>
{subfeatures.map((sub, idx) => (
<FeatureDetails
key={JSON.stringify(sub)}
feature={{
...sub,
uniqueId: `${uniqueId}_${idx}`,
}}
model={model}
depth={depth + 1}
/>
))}
</BaseCard>
) : null}
</BaseCard>
)
}
16 changes: 16 additions & 0 deletions packages/core/BaseFeatureWidget/BaseFeatureDetail/Position.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react'
import { assembleLocString } from '../../util'
import { BaseProps } from '../types'

export default function Position(props: BaseProps) {
const { feature } = props
const strand = feature.strand as number
const strandMap: Record<string, string> = {
'-1': '-',
'0': '',
'1': '+',
}
const str = strandMap[strand] ? `(${strandMap[strand]})` : ''
const loc = assembleLocString(feature)
return <>{`${loc} ${str}`}</>
}
Loading

0 comments on commit def3bf9

Please sign in to comment.