statgen / locuszoom

A Javascript/d3 embeddable plugin for interactively visualizing statistical genetic data from customizable sources.
https://statgen.github.io/locuszoom/
MIT License
154 stars 29 forks source link

[request] "Highlight region" datalayer #175

Closed abought closed 3 years ago

abought commented 4 years ago

From @welchr: for publication purposes, we would like to add a highlight rectangle datalayer to draw attention to features of interest.

Screen Shot 2019-12-19 at 3 49 28 PM

"Notice the shaded region on the gene track. For locuszoom.js, it wouldn’t have to necessarily be the gene track. We could highlight the association plot, the bed track plot, or all of them at the same time potentially. There could be handlebars that allow the user to drag the region wider or smaller. "

Other configurable options: color, opacity, etc. This was a fairly commonly used feature in the command line version.

abought commented 3 years ago

Ideally this region would be mouse-interactable (user could adjust the highlighted area interactively). There would be a mechanism for the region view to broadcast to other panels what region was brushed/selected.

(Example use case: sync region highlight, or alter color/render behavior inside the region)

abought commented 3 years ago

Additional ideas: click once for a line, click twice for a rectangle

Align across one layer or many

Broadcast the selected region as an outside-plot event, so that highlighting a region can uodate a table ("all points nearby")

Allow the broadcast region to be used for x-scale in other layers

Highlight widget: update position rendering whenever another widget on a different track is updated (eg, highlight on one track = highlight on all)

abought commented 3 years ago

Implemented and will be merged in #229 . We'll keep the selection behaviors part of a separate brush widget.