ggiraph makes ‘ggplot’ graphics interactive.
Interactivity is added to ggplot geometries, legends and theme elements, via the following aesthetics:
tooltip: tooltips to be displayed when mouse is over elements.
data_id: id to be associated with elements (used for hover and click actions)
Under the hood, ggiraph is an htmlwidget and a ggplot2 extension. It allows graphics to be interactive, by exporting them as SVG documents and using special attributes on the various elements.
The things you need to know to create an interactive graphic :
geom_point_interactive, instead of using
geom_sf_interactive… Provide at least one of the aesthetics
onclickto create interactive elements.
girafewith the ggplot object so that the graphic is translated as a web interactive graphics.
data_id) can be selected and manipulated on client and server sides. The list of selected values will be stored in in a reactive value named
They are several available interactive geometries, scales and other ggplot elements. Almost all ggplot2 elements can be made interactive with ggiraph. They are all based on their ggplot version, same goes for scales and the few guides:
You can also make interactive annotations, titles and facets (see
Get development version on github
Get CRAN version
The help pages are located at https://davidgohel.github.io/ggiraph.
If you have questions about how to use the package, visit Stackoverflow and use tags
r Stackoverflow link! We usually read them and answer when possible.
When you file a bug report, please spend some time making it easy for me to follow and reproduce. The more time you spend on making the bug report coherent, the more time I can dedicate to investigate the bug as opposed to the bug report.
A great way to start is to contribute an example or improve the documentation.
If you want to submit a Pull Request to integrate functions of yours, provide if possible:
By using rhub (run
rhub::check_for_cran()), you will see if everything is ok. When submitted, the PR will be evaluated automatically on travis and appveyor and you will be able to see if something broke.