Package 'shinyHeatmap'

Title: Usage Heatmap for Shiny apps
Description: Have you ever wondered how people are enjoying your Shiny app? This package leverages 'heatmap.js' to provide heatmap of usage. You can seamlessly know where users clicked and how many times. This is useful for regression testing.
Authors: David Granjon [aut, cre]
Maintainer: David Granjon <[email protected]>
License: MIT + file LICENSE
Version: 0.2.3.9000
Built: 2026-06-01 10:44:11 UTC
Source: https://github.com/RinteRface/shinyHeatmap

Help Index


Show recorded heatmap

Description

Show and download record_heatmap data.

Usage

download_heatmap(
  trigger = NULL,
  path = "www",
  filename = "heatmap.png",
  timeout = 10,
  show_ui = TRUE,
  options = NULL,
  session = shiny::getDefaultReactiveDomain(),
  ...
)

Arguments

trigger

Reactive trigger to initialized the heatmap recording. This is useful if your app contains tabs or navbar.

path

Previously saved heatmap data for persistence.

filename

Screenshot file name.

timeout

Necessary if the page needs time to load. Expressed in milliseconds.

show_ui

Whether to show the download UI. Default to TRUE.

options

Slot for heatmap options. Expect a (nested) list. See https://www.patrick-wied.at/static/heatmapjs/docs.html#heatmap-configure.

session

Shiny session object. Useful to store heatmap data.

...

Internal. Don't use.


Either record or show heatmap data

Description

By default, process_heatmap records the heatmap. However, if you browse to the app url and add ?get_heatmap query string, the function will run in display mode to see the heatmap data.

Usage

process_heatmap(...)

Arguments

...

Pass in parameters for record_heatmap and download_heatmap.

Note

Specify options("shinyHeatmap.debug" = TRUE) to get useful debugging messages, particularly when setting up your heatmap.


Record heatmap data to a file

Description

On the JS side, Shiny creates a input$heatmap_data containing the current click data to be recorded to the file

Usage

record_heatmap(
  trigger = NULL,
  path = "www",
  target = ".container-fluid",
  type = c("click", "move"),
  timeout = 10,
  session = shiny::getDefaultReactiveDomain(),
  ...
)

Arguments

trigger

Reactive trigger to initialized the heatmap recording. This is useful if your app contains tabs or navbar.

path

Previously saved heatmap data for persistence.

target

Container selector hosting the heatmap canvas. Default to Shiny fluidPage container. Be careful to change it if you use another template.

type

Event type: click or mouse move. Default to click.

timeout

Necessary if the page needs time to load. Expressed in milliseconds.

session

Shiny session object. Useful to store heatmap data.

...

Internal. Don't use.


Heatmap container for shiny app

Description

Include necessary dependencies.

Usage

with_heatmap(...)

Arguments

...

Shiny UI code.