ggiraph

make 'ggplot' graphics interactive

https://github.com/davidgohel/ggiraph

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.3%) to scientific vocabulary

Keywords from Contributors

pandoc visualisation latex literate-programming rmarkdown tidy-data geos setup genomics
Last synced: 10 months ago · JSON representation

Repository

make 'ggplot' graphics interactive

Basic Info
Statistics
  • Stars: 844
  • Watchers: 21
  • Forks: 79
  • Open Issues: 33
  • Releases: 1
Created almost 11 years ago · Last pushed 11 months ago
Metadata Files
Readme Changelog

README.Rmd

---
output: github_document
---

```{r, echo = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-"
)
library(ggplot2)
library(ggiraph)
```

> `{ggiraph}` makes 'ggplot' graphics interactive. 

[![R build status](https://github.com/davidgohel/ggiraph/workflows/R-CMD-check/badge.svg)](https://github.com/davidgohel/ggiraph/actions)
[![version](https://www.r-pkg.org/badges/version/ggiraph)](https://CRAN.R-project.org/package=ggiraph)
![cranlogs](https://cranlogs.r-pkg.org/badges/ggiraph)
[![codecov test coverage](https://codecov.io/gh/davidgohel/ggiraph/branch/master/graph/badge.svg)](https://app.codecov.io/gh/davidgohel/ggiraph)


## Overview

ggiraph logo `{ggiraph}` is a tool that allows you to create dynamic ggplot graphs. This allows you 
to add tooltips, hover effects and JavaScript actions to the graphics. The package also 
allows the selection of graphical elements when used in shiny applications. 

Interactivity is added to ggplot **geometries, legends and theme elements**, via 
the following aesthetics:

* `tooltip`: tooltips to be displayed when mouse is over elements. 
* `onclick`: JavaScript function to be executed when elements are clicked. 
* `data_id`: id to be associated with elements (used for hover and click actions)

### Why use `{ggiraph}`

* You want to provide your readers with more information than the basic information 
available; you can display a tooltip when the user's mouse is on a graphical element, 
you can also visually animate elements with the same attribute when the mouse passes 
over a graphical element, and finally you can link a JavaScript action to the click, 
such as opening a hypertext link.
* You want to allow users of a Shiny application to select graphical elements; for 
example, you can make the points of a scatter plot selectable and available as a 
reactive value from the server part of your application. With Shiny, `{ggiraph}` allows 
interaction with graph elements, legends elements, titles and ggplot theme elements 
from the server part; each selection is available as a reactive value.

![](man/figures/image_girafe.png)


> 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.



## Usage

### With R and R Markdown

The things you need to know to create an interactive graphic :

* Instead of using `geom_point`, use `geom_point_interactive`, 
instead of using `geom_sf`, use `geom_sf_interactive`... Provide at least one 
of the aesthetics `tooltip`, `data_id` and `onclick` to create interactive elements.
* Call function `girafe` with the ggplot object so that the graphic is translated as 
a web interactive graphics.

```{r eval=FALSE}
library(ggplot2)
library(ggiraph)
data <- mtcars
data$carname <- row.names(data)

gg_point = ggplot(data = data) +
	geom_point_interactive(aes(x = wt, y = qsec, color = disp,
    tooltip = carname, data_id = carname)) + 
  theme_minimal()

girafe(ggobj = gg_point)
```

### With Shiny

* If used within a shiny application, elements associated with an id (`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 `[shiny_id]_selected`.

![](man/figures/shiny_girafe.png)


### Available interactive layers 

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: `geom_point_interactive()`, `geom_col_interactive()`,
`geom_tile_interactive()`, `scale_fill_manual_interactive()`,
`scale_discrete_manual_interactive()`, `guide_legend_interactive()`, ...

You can also make interactive annotations, titles and facets (see 
`help(interactive_parameters)`).

## Installation 

> Get development version on github

```{r eval=FALSE}
devtools::install_github('davidgohel/ggiraph')
```

> Get CRAN version

```{r eval=FALSE}
install.packages("ggiraph")
```    

## Resources

### Online documentation

The help pages are located at https://davidgohel.github.io/ggiraph/.

### Getting help

If you have questions about how to use the package, visit Stackoverflow 
and use tags `ggiraph` and `r` [Stackoverflow
link](https://stackoverflow.com/questions/tagged/ggiraph+r)\! We
usually read them and answer when possible.

## Contributing to the package

### Bug reports

When you file a [bug report](https://github.com/davidgohel/ggiraph/issues), 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.

### Contributing to the package development

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:

* the new function(s) with code and roxygen tags (with examples)
* a new section in the appropriate vignette that describes how to use the new function
* corresponding tests in directory `inst/tinytest`.

By using rhub (run `rhub::check_for_cran()`), you will see if everything is ok.
When submitted, the PR will be evaluated automatically with Github Action 
and you will be able to see if something broke.

Owner

  • Name: David Gohel
  • Login: davidgohel
  • Kind: user
  • Location: Paris
  • Company: ArData

GitHub Events

Total
  • Issues event: 31
  • Watch event: 58
  • Delete event: 1
  • Issue comment event: 44
  • Push event: 20
  • Pull request event: 6
  • Fork event: 4
  • Create event: 1
Last Year
  • Issues event: 31
  • Watch event: 58
  • Delete event: 1
  • Issue comment event: 44
  • Push event: 20
  • Pull request event: 6
  • Fork event: 4
  • Create event: 1

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 753
  • Total Committers: 18
  • Avg Commits per committer: 41.833
  • Development Distribution Score (DDS): 0.311
Past Year
  • Commits: 31
  • Committers: 4
  • Avg Commits per committer: 7.75
  • Development Distribution Score (DDS): 0.097
Top Committers
Name Email Commits
David Gohel d****l@a****r 519
Panagiotis Skintzos s****i@p****t 113
sigmapi h****/ 98
HLindsay h****y@u****h 4
nllspc n****0@g****m 3
petrbouchal p****l@g****m 3
William Lai 4****2 2
Gerhard Nachtmann k****n@g****m 1
Max Kuhn m****n@g****m 1
Salim B g****t@s****e 1
Michael Jones m****y@g****m 1
Petr Bouchal p****l 1
Pierrette Lo 3****a 1
David Gohel d****l@g****m 1
Carson c****1@g****m 1
Stanislav Horacek s****k@g****m 1
Jeroen Ooms j****s@g****m 1
Paul Murrell p****l@s****z 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 123
  • Total pull requests: 50
  • Average time to close issues: 6 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 100
  • Total pull request authors: 14
  • Average comments per issue: 2.35
  • Average comments per pull request: 1.36
  • Merged pull requests: 31
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 24
  • Pull requests: 8
  • Average time to close issues: 11 days
  • Average time to close pull requests: 3 days
  • Issue authors: 19
  • Pull request authors: 5
  • Average comments per issue: 0.79
  • Average comments per pull request: 0.75
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • sda030 (4)
  • rpruim (3)
  • neuwirthe (3)
  • brooksambrose (3)
  • dominicroye (3)
  • ssp3nc3r (3)
  • awcm0n (2)
  • udurraniAtPresage (2)
  • BriceNocenti (2)
  • knutwannheden (2)
  • davidgohel (2)
  • xtimbeau (2)
  • williamlai2 (2)
  • Ari04T (2)
  • kmcd39 (2)
Pull Request Authors
  • davidgohel (16)
  • sigmapi (16)
  • teunbrand (3)
  • pacoramon (2)
  • nilshoffmann (2)
  • lgaborini (2)
  • kalibera (2)
  • strepon (1)
  • salim-b (1)
  • williamlai2 (1)
  • rpruim (1)
  • mijon (1)
  • jeroen (1)
  • cpsievert (1)
Top Labels
Issue Labels
bug (9) question (5) enhancement (5) duplicate (2) invalid (2) documentation (1)
Pull Request Labels

Packages

  • Total packages: 3
  • Total downloads:
    • cran 12,007 last-month
  • Total docker downloads: 4,996
  • Total dependent packages: 16
    (may contain duplicates)
  • Total dependent repositories: 80
    (may contain duplicates)
  • Total versions: 47
  • Total maintainers: 1
proxy.golang.org: github.com/davidgohel/ggiraph
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.5%
Dependent repos count: 5.7%
Last synced: 11 months ago
cran.r-project.org: ggiraph

Make 'ggplot2' Graphics Interactive

  • Versions: 34
  • Dependent Packages: 16
  • Dependent Repositories: 79
  • Downloads: 12,007 Last month
  • Docker Downloads: 4,996
Rankings
Stargazers count: 0.4%
Forks count: 0.9%
Dependent repos count: 2.6%
Dependent packages count: 4.3%
Downloads: 4.6%
Average: 5.9%
Docker downloads count: 22.5%
Maintainers (1)
Last synced: 11 months ago
conda-forge.org: r-ggiraph
  • Versions: 12
  • Dependent Packages: 0
  • Dependent Repositories: 1
Rankings
Stargazers count: 15.5%
Forks count: 21.7%
Dependent repos count: 24.4%
Average: 28.3%
Dependent packages count: 51.6%
Last synced: 11 months ago

Dependencies

DESCRIPTION cran
  • Rcpp >= 1.0 imports
  • ggplot2 >= 3.3.5 imports
  • grid * imports
  • htmltools * imports
  • htmlwidgets >= 1.5 imports
  • purrr * imports
  • rlang * imports
  • stats * imports
  • systemfonts * imports
  • uuid * imports
  • dplyr * suggests
  • ggrepel >= 0.9.1 suggests
  • hexbin * suggests
  • knitr * suggests
  • maps * suggests
  • quantreg * suggests
  • rmarkdown * suggests
  • sf >= 1.0 suggests
  • shiny * suggests
  • tinytest * suggests
  • xml2 >= 1.0 suggests
tools/packagejs/package.json npm
  • @babel/core ^7.16.0 development
  • @babel/preset-env ^7.16.4 development
  • babel-loader ^8.2.3 development
  • before-build-webpack ^0.2.11 development
  • concat ^1.0.3 development
  • copy-webpack-plugin ^6.4.1 development
  • core-js ^3.19.1 development
  • css-loader ^3.6.0 development
  • eslint ^7.32.0 development
  • eslint-config-prettier ^6.15.0 development
  • eslint-loader ^4.0.2 development
  • eslint-plugin-prettier ^3.4.1 development
  • mini-css-extract-plugin ^0.9.0 development
  • optimize-css-assets-webpack-plugin ^5.0.8 development
  • prettier ^2.5.0 development
  • stylelint ^13.13.1 development
  • stylelint-config-prettier ^8.0.2 development
  • stylelint-config-standard ^20.0.0 development
  • stylelint-prettier ^1.2.0 development
  • stylelint-webpack-plugin ^2.3.1 development
  • uglify-js ^3.14.3 development
  • webpack ^4.46.0 development
  • webpack-cli ^3.3.12 development
  • yaml ^1.10.2 development
  • d3 ^5.16.0
  • d3-lasso 0.0.5
  • save-svg-as-png ^1.4.17
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite