ggiraph 0.3.3 is out

David Gohel

2017/03/29

I am excited to announce the release of ggiraph version 0.3.3.

The package did not evolved that much within the last months as I was busy on other projects. I finally found time last week to work on it.

  • The new version fixes an issue with pan effect (that was not adjusted to the zoom level).
  • ggiraph() has a new agument ggobj to avoid call to print in the code argument.
  • Widget sizing has been improved

Let’s have simple examples with the following ggplot object.

library(ggplot2)
library(ggiraph)

gg1 <- ggplot(data = mtcars, 
  mapping = aes(x = wt, y = mpg, size = disp, color = as.factor(carb) ) ) +
  geom_point_interactive(aes(tooltip = row.names(mtcars), data_id = row.names(mtcars))) +
  scale_color_brewer(palette = "Set1", name = "carb") +
  scale_size(range = c(1, 15), name = "disp") +
  scale_x_continuous(limits = c(1, 6)) +
  scale_y_continuous(limits = c(7, 36)) +
  theme_minimal() +
  theme(legend.position = "bottom")

Now let’s call ggiraph:

ggiraph(ggobj = gg1 )

To activate the zoom and fix the max width to half the width of the available room:

x <- girafe(ggobj = gg1 )
girafe_options(x = x, opts_sizing(width = .5), opts_zoom(max = 4), 
  opts_hover(css = "fill:wheat;stroke:black;stroke-width:2px;") )

I am preparing a next version where lasso selection will be possible within Shiny applications. Elements can be selected but only by clicking on them… This is only OK when few points need to be selected. Lasso selection will help in the case when many elements need to be selected.