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.

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


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.

Follow us:  -  Recommanded sites: R-bloggers R weekly Twitter #rstats Jobs for R-users