legumeinfo / gcv

Federating genomes with love (and synteny derived from functional annotations)
https://gcv.legumeinfo.org/
Apache License 2.0
38 stars 12 forks source link

Robust tooltips #25

Closed alancleary closed 5 years ago

alancleary commented 6 years ago

Currently, tooltips are tightly coupled with the D3 visualizations. This makes them hard to extend and prevents their use outside of the visualizations. Encapsulate tooltips in their own module independent of the visualization code. Additionally, make the tips robust so they can handle arbitrary content, such as meta data.

alancleary commented 5 years ago

Commit 0aa544c384df3d12bbdb40a442caf394653ea276 replaced the D3 based micro-synteny tooltips with Tippy.js tooltips.This is a proof of concept so the tooltips are hardcoded into the micro-synteny code, rather than being added via meta-programming.

To achieve a meta-programming implementation, additional optional attributes need to be added (mixed in) to the genes in the MicroTracks data sent to the micro-synteny viewer. Doing so with the code in its current state will exacerbate the mixin problem described in issue #199. For this reason issue #199 is considered a blocking issue.

alancleary commented 5 years ago

Commit 357538e3ba1c2de87c06b2f14f040b2b8624952d gives the new micro-synteny tooltips the same hover delay as the micro-synteny viewer's default hover delay so that the tooltips appear at the same time the hover effect occurs.

alancleary commented 5 years ago

Commit 6d61d3eb1638e488402c5e4e51024669da7060ae abstracted the tooltips out of the micro-synteny viewer into a mixin for adding HTML attributes to objects. All D3 visualizations can now parse these HTML attributes, and therefore tooltips, via a custom D3 selection function.