Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wenjie1991/ggfigdone
Manage & Modify {ggplot2} Figures Using {ggfigdone}
https://github.com/wenjie1991/ggfigdone
ggplot2 r
Last synced: 11 days ago
JSON representation
Manage & Modify {ggplot2} Figures Using {ggfigdone}
- Host: GitHub
- URL: https://github.com/wenjie1991/ggfigdone
- Owner: wenjie1991
- Created: 2024-03-13T14:44:23.000Z (8 months ago)
- Default Branch: devel
- Last Pushed: 2024-09-16T09:11:01.000Z (about 2 months ago)
- Last Synced: 2024-10-11T20:53:01.549Z (28 days ago)
- Topics: ggplot2, r
- Language: R
- Homepage: https://wenjie1991.github.io/ggfigdone/
- Size: 619 KB
- Stars: 16
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
Awesome Lists containing this project
README
# ggfigdone: Manage ggplot figures using ggfigdone
[![R](https://github.com/wenjie1991/ggfigdone/actions/workflows/r.yml/badge.svg)](https://github.com/wenjie1991/ggfigdone/actions/workflows/r.yml)## Description
When you prepare a presentation or a report, you often need to manage a large number of ggplot figures.
You need to change the figure size, modify the title, label, themes, etc.
It is inconvinient to go back to the original code to make these changes.
This package provides a simple way to manage ggplot figures.
You can easily add the figure to the database and update them later using CLI (command line interface) or GUI (graphical user interface).![ggfigdone_demo](https://github.com/user-attachments/assets/a0d4d01d-105a-4fc0-bda5-c7cc3e6dbd48)
## Installation
Install the stable version from CRAN:
```r
install.packages("ggfigdone")
```Install the development version from GitHub:
```r
# install.packages("remotes")
remotes::install_github("wenjie1991/ggfigdone")
```## Demo
### Initialize the database
First, you need to initialize the database and add figures to it.
Next time, you only need to load the database to add more figures or update the existing figures.
```r
library(ggfigdone)
library(ggplot2)## Initial ggfigdone database using `fd_init`
## The database location is `./fd_dir`
## Load existing database using `fd_load("./fd_dir")`
fo = fd_init("./fd_dir")## Draw a ggplot figure
g = ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point()## Add the figure to the database
## The last plot is added to the last initialized/loaded database
fd_add(name = "fig1")## Add the same figure with a different name
## You can specify the ggplot object and database name
fd_add(g = g, name = "fig2", fo)## The hard disk database is automatically updated, no need to save operations.
```### Manage the figures in browser
Then you can start the server and open the browser to manage the figures.
```r
## To start the server, provide the database location
fd_server("./fd_dir")## Open the browser and go to http://localhost:8080/index.html
```## Contribution
This package is being developed. Feel free to contribute to the package by sending pull requests or creating issues.
## License
GPL-3