Skip to content

Switch Interactive Plot Updates from Hover to Click to Improve Performance #23

Description

@charleschuang1993

Description:
Currently, the interactive plots update immediately when the user hovers over a data point. This behavior leads to noticeable cursor lag and can consume excessive resources, especially with large datasets. These performance issues result in a less responsive user experience.

Proposed Fix:

  • Remove any observeEvent calls that listen to hover events (e.g., input$volcanoPlot_hovered and input$scatterPlot_hovered).
  • Instead, add listeners for click events by using input$volcanoPlot_selected and input$scatterPlot_selected.
  • Update the girafe() options to enable selection using:
    opts_selection(type = "single", only_shiny = FALSE)
  • Ensure that the module’s logic only uses these "selected" events to update the reactive variable that drives the linked scatter and violin plots.

Rationale:
This modification is necessary because the current hover-based updates cause significant cursor lag and high resource usage. By switching to click events, we ensure that updates occur only when explicitly intended by the user, thereby improving responsiveness and overall performance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions