Advanced Customization of 'd2b' Tooltip
sund2bTooltip(at = NULL, followMouse = NULL, html = NULL, my = NULL)
character
which should be one of
"top left", "top center", "top right", "center left", "center center",
"center right", "bottom center", "bottom right" to specify
where the tooltip will be positioned relative to the hovered item.
logical
controlling whether the tooltip
will follow the mouse instead of being placed in a static
position relative to the hovered element
character
or htmlwidgets::JS
to customize the content
of the tooltip. To provide a function, the arguments for the 'JavaScript'
function will be 'function(nodedata, size, percent)' and the function
should return a string.
character
which should be one of "top", "left", "right", "bottom"
to control the orientation of the tooltip.
list
if(interactive()){
library(sunburstR)
# use a sample of the sequences csv data
sequences <- read.csv(
system.file("examples/visit-sequences.csv",package="sunburstR")
,header = FALSE
,stringsAsFactors = FALSE
)[1:200,]
# change the tooltip
sund2b(
sequences,
tooltip = sund2bTooltip(
html = htmlwidgets::JS("
function(nodedata, size, percent) {
return '<span style=\"font-weight: bold;\">' + nodedata.name + '</span>' + ' ' + size
}
")
)
)
}