Skip to content

Commit

Permalink
Add concept of highlights
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Apr 13, 2023
1 parent 8f6ea59 commit 9c21b6d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useMemo, useState } from 'react'
import React, { useEffect, useState } from 'react'
import { makeStyles } from 'tss-react/mui'
import {
Button,
Expand Down
21 changes: 20 additions & 1 deletion plugins/linear-genome-view/src/LinearGenomeView/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ export function stateModelFactory(pluginManager: PluginManager) {

/**
* #property
* how to display the track labels, can be "overlapping", "offset", or "hidden"
* how to display the track labels, can be "overlapping", "offset", or
* "hidden"
*/
trackLabels: types.optional(
types.string,
Expand Down Expand Up @@ -230,6 +231,12 @@ export function stateModelFactory(pluginManager: PluginManager) {
* show the "gridlines" in the track area
*/
showGridlines: true,

/**
* #property
* show the "gridlines" in the track area
*/
highlights: types.array(MUIRegion),
}),
)
.volatile(() => ({
Expand Down Expand Up @@ -525,6 +532,18 @@ export function stateModelFactory(pluginManager: PluginManager) {
},
}))
.actions(self => ({
/**
* #action
*/
clearHighlights() {
self.highlights = cast([])
},
/**
* #action
*/
setHighlights(regions: Region[]) {
self.highlights = cast(regions)
},
/**
* #action
*/
Expand Down
2 changes: 1 addition & 1 deletion products/jbrowse-web/src/ShareButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function LinkField({ url }: { url: string }) {
target.select()
}}
/>
<Link href={url}>Right click to bookmark</Link>
<Link href={url}>Link for bookmarking</Link>
</>
)
}
Expand Down

0 comments on commit 9c21b6d

Please sign in to comment.