Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/OCHA-DAP/gghdx
HDX Theme, Scales, and Other Conveniences for 'ggplot2'
https://github.com/OCHA-DAP/gghdx
Last synced: 3 days ago
JSON representation
HDX Theme, Scales, and Other Conveniences for 'ggplot2'
- Host: GitHub
- URL: https://github.com/OCHA-DAP/gghdx
- Owner: OCHA-DAP
- License: gpl-3.0
- Created: 2022-07-20T13:06:22.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-16T18:52:37.000Z (6 months ago)
- Last Synced: 2024-05-17T03:10:30.802Z (6 months ago)
- Language: R
- Size: 8.97 MB
- Stars: 3
- Watchers: 5
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE.md
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```[![R-CMD-check](https://github.com/OCHA-DAP/gghdx/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/OCHA-DAP/gghdx/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/OCHA-DAP/gghdx/branch/main/graph/badge.svg)](https://app.codecov.io/gh/OCHA-DAP/gghdx?branch=main)## Overview
The goal of gghdx is to make it as simple as possible to follow the HDX visual
guidelines when creating graphs using ggplot2. While most of the functionality
is in allowing easy application of the HDX color ramps, the package also
streamlines some of the other recommendations and best practices regarding
plotted text, axis gridlines, and other visual features. The key functionalities
are:* `theme_hdx()` is the general package theme.
* `scale_color_hdx_...()` and `scale_fill_hdx_...()` applies the HDX color scale to
the relevant aesthetics.
* `hdx_colors()`, `hdx_hex()`, and `hdx_pal_...()` provide easy user access to the
HDX color template. You can view the colors
* `geom_text_hdx()` and `geom_label_hdx()` wrap the respective base functions
to plot text using HDX fonts and aesthetics.
* `scale_y_continuous_hdx()` wraps `scale_y_continuous()` to plot data directly
starting from the y-axis.
* `gghdx()` ensures plot for the session use HDX defaults for color and fill
scales, uses `theme_hdx()` for all plots, and applies `scale_color_hdx_...()` and
`scale_fill_hdx_...()`
* `label_number_hdx()` and `format_number_hdx()` supplement the `scales::label_...()` series of functions
to format and create labels for numbers in the HDX style.## Installation
You can install gghdx directly from CRAN:
```r
install.packages("gghdx")
```You can install the development version from GitHub:
```r
## install.packages("remotes")
remotes::install_github("OCHA-DAP/gghdx")
``````{r child="vignettes/gghdx.Rmd"}
```