ggiraph 0.3.3 is out

[This article was first published on R on ArData, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.




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.

To leave a comment for the author, please follow the link and comment on their blog: R on ArData.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)