View source: R/l_currenttags.R
l_currentindex | R Documentation |
Checks if there is a visual item below the mouse cursor and if there is, it returns the index of the visual item's position in the corresponding variable dimension of its layer.
l_currentindex(widget)
widget |
widget path as a string or as an object handle |
For more details see l_help("learn_R_bind.html#item-bindings")
index of the visual item's position in the corresponding variable dimension of its layer
l_bind_item
, l_currenttags
if(interactive()){
p <- l_plot(iris[,1:2], color=iris$Species)
printEntered <- function(W) {
cat(paste('Entered point ', l_currentindex(W), '\n'))
}
printLeave <- function(W) {
cat(paste('Left point ', l_currentindex(W), '\n'))
}
l_bind_item(p, tags='model&&point', event='<Enter>',
callback=function(W) {printEntered(W)})
l_bind_item(p, tags='model&&point', event='<Leave>',
callback=function(W) {printLeave(W)})
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.