GMOD / jbrowse-components

Source code for JBrowse 2, a modern React-based genome browser
https://jbrowse.org/jb2
Apache License 2.0
199 stars 61 forks source link

Add ability to get mouseover tooltips on FeatureTrack feature details #3918

Open cmdcolin opened 10 months ago

cmdcolin commented 10 months ago

The VariantTrack feature details fields are specialized so you can mouseover a field and it will tell you what it is in a tooltip. This helps with understanding unfamiliar field names

VCF has a header that provides this metadata, but BigBed files also commonly have this via the autoSql feature descriptions

A similar thing could be added to BaseFeatureDetails potentially since BigBed files are often regular FeatureTracks

Note that in JBrowse 1, the way this was done is every feature could have an extra metadata field attached to it describing the metadata, but in JBrowse 2, it is calling a "getMetadata" on the adapter, and using the returned results to generate the tooltips

image

cmdcolin commented 10 months ago

code for the implementation on VariantTrack https://github.com/GMOD/jbrowse-components/blob/ae6b70ef53241be215d2488902acc24751bea9e2/plugins/variants/src/LinearVariantDisplay/model.ts#L43-L69