Make 'ggplot2' Graphics Interactive

Create interactive 'ggplot2' graphics using 'htmlwidgets'.


ggiraph is an htmlwidget and a ggplot2 extension. It allows ggplot graphics to be animated.

Animation is made with ggplot geometries that can understand three arguments:

  • tooltip: column of dataset that contains tooltips to be displayed when mouse is over elements.
  • onclick: column of dataset that contains javascript function to be executed when elements are clicked.
  • data_id: column of dataset that contains id to be associated with elements.

If used within a shiny application, elements associated with an id (data_id) can be selected and manipulated on client and server sides.

Installation

Get development version on github
devtools::install_github('davidgohel/ggiraph')
Get CRAN version
install.packages("ggiraph")

News

ggiraph 0.6.1

Enhancement

  • new annotate_interactive function.

Changes

  • improving sizing with shiny.

ggiraph 0.6.0

Changes

  • The package is no more importing rvg and now need a compiler to install the package from source. The dsvg function will be then removed from rvg.

ggiraph 0.5.0

Changes

  • the package offers now new functions girafe() and girafe_options() to be used instead of function ggiraph(). It is more convenient to use when customization is needed.

Enhancement

  • add a 'download as png' button
  • usage of d3 version 5.7.0

Bug fixes

  • responsive behaviour when rendered in IE <= 12 is now fixed

ggiraph 0.4.4

Enhancement

  • new functions geom_sf_interactive

ggiraph 0.4.3

Enhancement

  • new functions geom_hline_interactive and geom_vline_interactive implemented by Eric Book.
  • all element with the same data_id are highlighted when mouse is over one of these elements.
  • ggproto GeomInteractive are exported.

ggiraph 0.4.2

Changes

  • ggiraph has a new argument dep_dir that controls the location of the output files.
  • deprecation of argument use_widget_size and flexdashboard. I hope this is the last mention to theses in the NEWS file.

ggiraph 0.4.1

Changes

  • argument flexdashboard and width are no more deprecated...
  • ggiraph gains a new argument use_widget_size that force usage of htmlwidget size and block the responsive behavior.

ggiraph 0.4.0

Enhancement

  • lasso selection has been implemented in Shiny context
  • a toolbar for zooming and selecting elements has been implemented.

Changes

  • zoom is disabled by default and can be activated via a button in the toolbar. It prevents scrooling issue (mouse over a zoomable svg steals scroll ability within the document).
  • ggiraph arguments flexdashboard and width are now deprecated and have no effects

ggiraph 0.3.3

Enhancement

  • widget sizing has been improved and ggiraph function gains new argument flexdashboard to make sure the graph fits available room.

Bug fixes

  • warnings did occur because some default_aes of ggproto were missing
  • slow zoom pan effect is now solved

ggiraph 0.3.2

New features

  • new geometry: geom_tile_interactive

Bug fixes

  • fix for element selection: svg elements with same id were not all selected but the only element that was clicked
  • fix css issues that occured when several ggiraph were on the same page and their tooltip did not share the same css attributes.

Enhancement

  • link to the online documentation.
  • usage of d3.js V4

ggiraph 0.3.1

New features

  • size management has been improved
  • there are 3 new geometries: geom_boxplot_interactive, geom_line_interactive and geom_bar_interactive.

Bug fixes

  • addCustomMessageHandler has to be called once to avoid a javascript exception
  • fix display issue in RStudio viewer for Windows

ggiraph 0.3.0

Enhancement

  • Allow zooming & panning to be turned off
  • clicked elements can now be tracked from shiny

ggiraph 0.2.0

Enhancement

  • Migration to d3.js
  • Update to htmlwidgets 0.6

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("ggiraph")

0.6.1 by David Gohel, 5 months ago


https://davidgohel.github.io/ggiraph


Report a bug at https://github.com/davidgohel/ggiraph/issues


Browse source code at https://github.com/cran/ggiraph


Authors: David Gohel [aut, cre] , Panagiotis Skintzos [ctb] , Mike Bostock [cph] (d3.js) , Speros Kokenes [cph] (d3-lasso) , Eric Shull [cph] (saveSvgAsPng js library) , Eric Book [ctb] (hline and vline geoms)


Documentation:   PDF Manual  


GPL-3 license


Imports grid, ggplot2, htmlwidgets, stats, xml2, htmltools, Rcpp, gdtools

Suggests knitr, testthat, rmarkdown, maps, shiny, sf, dplyr

Linking to Rcpp, gdtools


Imported by ggiraphExtra.

Suggested by ceterisParibus, eq5d, packcircles.


See at CRAN