d3heatmap icon indicating copy to clipboard operation
d3heatmap copied to clipboard

tooltips stay visible when Shiny redraws the heatmap

Open mkuhn opened this issue 8 years ago • 2 comments

When a tooltip is shown while Shiny changes the heatmap, the old tooltip stays visible and cannot be removed by the user. In general, it seems that d3heatmap creates new tooltip divs every time it is redrawn. As a workaround, I have added this code to my Shiny app:

tags$script('
  $(document).ready(function() {
    $("#heatmap").on("shiny:recalculating", function(event) {
      $(".d3heatmap-tip").remove();
    });
  });
')

However, it would be nice if d3heatmap would remove or recycle the tooltips.

mkuhn avatar Apr 27 '16 08:04 mkuhn

@mkuhn thank you very much for sharing your code! I had the exact same problem, and it fixed it.

Tixierae avatar Nov 06 '20 21:11 Tixierae

The same issue also happens when resizing the window. Adding a snippet with shiny:visualchange instead of shiny:recalculating does the trick though.

Tixierae avatar Jan 08 '21 19:01 Tixierae