Replies: 3 comments 1 reply
-
Hi Graham, It works as designed, but we can discuss whether its good design. Click events are generated for all clicks. The datum/viewPath props indicate whether a data item was clicked or not. Only explicitly specified marks are considered here, implicit elements such as axes and background (and later, legends, grid lines, etc.) are not. Tracking the clickable, hoverable, etc. objects is based on a tecnique called "picking". There's an genome-spy/packages/core/src/view/view.js Line 493 in 81074d2 Anyway, a couple of years ago all ranged marks were double-clickable, activating a zoom transition to the mark instance with some extra padding. Thus, all cytobands, chromosomes, copy-number segments, etc. could be "focused" with dblclick. However, I did an extensive rewrite/refactor and never reimplemented it. It could be implemented again, but its behavior with user-defined handlers should be decided. Also, should it be enabled by default, how to disable/enable it, should it be disabled/enabled globally, etc. I'd like to keep it simple and not provide an excessive number of configuration options. Your thoughts are welcome! |
Beta Was this translation helpful? Give feedback.
-
Hmm. I think zooming to the data item should be the default behavior on double clicks. If someone would like to use a custom double-click handler, the default behavior could be suppressed by preventing the default. However, it seems that I have only implemented @grsr, would this "zoom to data item on dblclick" solve your problem? It should be quite easy to implement. The event handling stuff could be figured out later. |
Beta Was this translation helpful? Give feedback.
-
Hi @tuner - Thanks for getting back to me. We have already used the API to support zooming to specific data items when the user clicks on them, but default double-click support would also be useful I think, as long as it can be overridden. The request to make axes clickable is based on some testing with users and they all tried to click on the chromosome labels to no avail! Our current workaround is to have I appreciate that general support for clicking on axes might be more complicated, but I wonder if it could be supported on |
Beta Was this translation helpful? Give feedback.
-
Hi - We are using the javascript API to listen for click events on several elements of a plot. We'd like to allow the user to click on an axis label to zoom to the corresponding region (chromosome) on a genomic locus plot. I can see events are generated for clicks, but there is no information that would allow us to identify which axis label/region the user has clicked on, the events look like:
{"type":"click","viewPath":null,"datum":null}
Is there any way to add some information to this event to allow us to zoom to a specific locus as we can with other plot elements?
Thanks,
Graham
Beta Was this translation helpful? Give feedback.
All reactions