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
  • There was an issue when rendering in flexdashboard documents, graphs were not scaled in the boxes. To solve that, ggiraph() function gained new argument flexdashboard to make sure the graph fits available room.

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

library(ggplot2)
library(ggiraph)

gg1 <- ggplot(mtcars, aes(x = disp, y = qsec, color = wt) ) + 
  geom_point_interactive(aes(tooltip = row.names(mtcars), data_id = row.names(mtcars) ), size=3) +
  theme_minimal()

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:

gg1 <- gg1 + theme(plot.background = element_rect(fill = "#FFFFFC"))
ggiraph(ggobj = gg1, width = .5, zoom_max = 3 )

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.