Skip to content

Instantly share code, notes, and snippets.

@WalkerHarrison
Last active August 19, 2019 14:15
Show Gist options
  • Save WalkerHarrison/c5dfa03c5a9f1249f501573ed6290ed0 to your computer and use it in GitHub Desktop.
Save WalkerHarrison/c5dfa03c5a9f1249f501573ed6290ed0 to your computer and use it in GitHub Desktop.
library(tidyverse)
library(ggvis)
## this column needs to be unique for each row (primary key)!
mtcars$url <- paste0("https://en.wikipedia.org/wiki/", 1:nrow(mtcars))
mtcars %>%
ggvis(~mpg, ~hp) %>%
layer_points(size := 50, size.hover := 200,
fillOpacity := 0.4, fillOpacity.hover := 0.7,
key := ~url) %>%
add_tooltip(html=function(point)
paste0('<a href=', point$url, '>LINK</a>'), on = "click")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment