-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
63 lines (50 loc) · 2.21 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# gghdx <a href='https://github.com/OCHA-DAP/gghdx'><img src='man/figures/logo.png' align="right" height="139">
<!-- badges: start -->
[![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)
<!-- badges: end -->
## 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"}
```