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 420e3c6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
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 420e3c6

Please sign in to comment.