rstudio/ggvis — pull request #153 by saurfang (2014-05-19 01:57:47+00:00)
Title: Do not show tooltip if result of html function is NULL

This prevents showing blank tooltip and also enables a way to hide tooltip at will within the `html` function for `add_tooltip`.

For example, the following will only show tooltip for points but not for text because text doesn't have direction
```
ggvis(data = NULL, x = ~long, y = ~lat) %>%
layer_points(size = ~survivors, stroke = ~direction, data = Minard.troops) %>%
layer_text(text := ~city, dx := 5, dy := -5, data = Minard.cities) %>%
add_tooltip(function(df){df$direction})
```