Skip to content

Commit 87cacc5

Browse files
committed
Add tooltip support for ExtendedVariantDisplay
1 parent 29865db commit 87cacc5

File tree

6 files changed

+23
-0
lines changed

6 files changed

+23
-0
lines changed

jbrowse/resources/external/mGAPSession.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"type": "ExtendedVariantDisplay",
5959
"displayId": "mgap_hg38-ExtendedVariantDisplay",
6060
"maxDisplayedBpPerPx": 2000,
61+
"mouseover": "jexl:'Position: ' + formatWithCommas(get(feature,'POS'))",
6162
"renderer": {
6263
"type": "ExtendedVariantRenderer"
6364
},

jbrowse/src/client/JBrowse/Browser/components/JBrowseFooter.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ const JBrowseFooter = observer(props => {
2424
viewState.session.view.activateTrackSelector()
2525
}
2626

27+
if (!viewState) {
28+
return (
29+
<></>
30+
)
31+
}
2732
return (
2833
<>
2934
<Box padding={'5px'}>

jbrowse/src/client/JBrowse/Browser/jbrowse.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,9 @@ fieldset.MuiOutlinedInput-notchedOutline > legend {
55

66
html {
77
font-size: 16px !important;
8+
}
9+
10+
/* Increase font size for tooltips: */
11+
div[class^="makeStyles-tooltip-"] {
12+
font-size: 12px;
813
}

jbrowse/src/client/JBrowse/Browser/plugins/ExtendedVariantPlugin/ExtendedVariantDisplay/configSchema.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ export default pluginManager => {
2828
return ConfigurationSchema(
2929
'ExtendedVariantDisplay',
3030
{
31+
mouseover: {
32+
type: 'string',
33+
description: 'what to display in a given mouseover',
34+
defaultValue: `jexl:get(feature,'name')`,
35+
36+
contextVariable: ['feature'],
37+
},
3138
renderer: pluginManager.pluggableConfigSchemaType('renderer'),
3239
detailsConfig: variantDetailsConfig
3340
},

jbrowse/src/client/JBrowse/Browser/plugins/ExtendedVariantPlugin/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ export default class ExtendedVariantPlugin extends Plugin {
140140
pluginManager.jexl.addFunction('arrayMax', (array) => {
141141
return Array.isArray(array) ? Math.max(...array) : array
142142
})
143+
144+
pluginManager.jexl.addFunction('formatWithCommas', (val) => {
145+
return val ? Number(val).toLocaleString() : val
146+
})
143147
}
144148

145149
configure(pluginManager: PluginManager) {

jbrowse/src/org/labkey/jbrowse/model/JsonFile.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ private JSONObject getVcfTrack(Logger log, ExpData targetFile, ReferenceGenome r
525525
put("type", "ExtendedVariantDisplay");
526526
put("displayId", getObjectId() + "-ExtendedVariantDisplay");
527527
put("maxDisplayedBpPerPx", 2000);
528+
put("mouseover", "jexl:'Position: ' + formatWithCommas(get(feature,'POS'))");
528529
put("renderer", new JSONObject(){{
529530
put("type", "ExtendedVariantRenderer");
530531
//put("showLabels", false);

0 commit comments

Comments
 (0)