Open mpickering opened 5 years ago
@kanitw @arvind Is this expected behavior? Is there a simple to change the behavior?
The nearest transform operates by adding transparent cells generated by a voronoi decomposition. These cells necessarily capture events to drive selection processing and in #4726 we made sure that the voronoi cells persisted the tooltip for the unit spec they are defined in. One could disable tooltips for the layer in which a nearest selection is defined, but as the transparent event-capturing voronoi cells will continue to be generated and overlay the visualization, @mpickering desired behavior is still not possible.
I agree this doesn't seem like a desirable outcome but I don't have a good idea yet of how to fix it while still preserving a way to drive accelerated selections... I'm open to ideas!
I don't the implementation well enough to suggest a solution. Why does the transparent layer capture all mouse events? Should mouse events not be propagated through all layers? Then if multiple layers define a tooltip the one highest on the stack should be preferred.
Indeed, that's a great suggestion. Unfortunately, the Vega stack implements our custom scenegraph model that does not yet implement full support for event propagation (capturing/bubbling, see vega/vega#1494) ergo why I'm a little stuck for alternative workarounds currently :)
The nearest selection and tooltips interact in a surprising manner.
Example Chart
There are two layers the chart, a stacked area chart and a rule chart. The desired behaviour is that
The actual behaviour:
My understanding was that defining a selection should have no visible change to the rendering of the chart. Any effect should be configured by the user using the various conditional operations. This special(?) behaviour for tooltips violates the expectation.
I suspect there would be similar bad interactions if I defined another nearest selection for the "area" layer. In that case I would expect the selection to only scope over the area chart so that there would be no conflict between the two selections.