Treemap hover/clickData

Hey, following this example for a Treemap I created a Treemap figure with scatter points indicating a “category” for each of the rectangular shapes. However, as some other posts on this forum were asking, there is currently no way to get any hover or click information on the shapes. I tried multiple approaches, from setting bigger hoverdistance to scatter (results in unpredictable closest points depending on the box size); making the scatter marker as big as the rectangle shape with 0 opacity (but there is no rectangle marker shape so it’s not really suitable); setting bigger annotations width, etc. but to no avail.

I think this post comes the most close to his problem. but I don’t quite understand how that could be implemented with the scatter. @etienne, any thoughts?

Retrieving interaction events with shapes seems like a useful feature.

Thanks in advance!

@marky, you can see an example of how to implement this idea using scatter in this example


Thanks Michael, this has actually brought me closer to the solution :wink: