Skip to content

Commit

Permalink
Merge pull request #26 from katilingban/dev
Browse files Browse the repository at this point in the history
create africa cdc vignette
  • Loading branch information
ernestguevarra authored Mar 3, 2024
2 parents 87e3479 + 72a196a commit 1644b1e
Show file tree
Hide file tree
Showing 33 changed files with 349 additions and 107 deletions.
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
^data-raw$
^\.github$
^codecov\.yml$
^pkgdown/_pkgdown\.yml$
^docs$
^pkgdown$
^_pkgdown\.yml$
48 changes: 48 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
.Rhistory
.RData
.Ruserdata
inst/doc
docs
5 changes: 5 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ Imports:
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.1
Suggests:
knitr,
rmarkdown
VignetteBuilder: knitr
URL: http://katilingban.io/motif/
1 change: 1 addition & 0 deletions R/africa_cdc.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ acdc_palettes <- list(
#' @examples
#' acdc_fonts
#'
#' @rdname acdc_font
#' @export
#'
acdc_fonts <- list(
Expand Down
76 changes: 6 additions & 70 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@ library(ggplot2)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![R-CMD-check](https://github.com/katilingban/motif/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/katilingban/motif/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/katilingban/motif/branch/main/graph/badge.svg)](https://app.codecov.io/gh/katilingban/motif?branch=main)
[![CodeFactor](https://www.codefactor.io/repository/github/katilingban/motif/badge)](https://www.codefactor.io/repository/github/katilingban/motif)
<!-- badges: end -->

A collection of palettes, themes, and theme components based on publicly available branding guidelines of various non-governmental organisations, government agencies, and United Nations units.

## What does `motif` do?

`motif` provides or will be providing utilities for applying the various visual identity and/or branding guidlines of various non-governmental organisations, government agencies, and United Nations units.
`motif` provides or will be providing utilities for applying the visual identity and/or branding guidlines of various non-governmental organisations, government agencies, and United Nations units.

Currently, `motif` has colours, palettes, and `ggplot2` themes based on the [Africa CDC](https://africacdc.org/) [visual identity guidelines](https://africacdc.org/download/visual-identity-africa-cdc-branding-guide/).
Currently, `motif` has colours, palettes, and `ggplot2` themes based on the following organisations' branding/visual identity guidelines:

* [Africa CDC](https://africacdc.org/) [visual identity guidelines](https://africacdc.org/download/visual-identity-africa-cdc-branding-guide/).

Additional colours, palettes, and themes will be provided over time.

Expand All @@ -50,74 +53,7 @@ install.packages(

## Usage

### Africa CDC colours and palettes

```{r acdc-primary, echo = FALSE, fig.align = "center", fig.height = 1}
structure(acdc_palettes$acdc_primary, class = "palette", name = "Africa CDC Primary Colours")
```

```{r acdc-secondary, echo = FALSE, fig.align = "center", fig.height = 1}
structure(acdc_palettes$acdc_secondary, class = "palette", name = "Africa CDC Secondary Colours")
```

### Africa CDC `ggplot2` theme

```{r mtcars-bar-acdc, echo = FALSE, fig.show = "hold", fig.height = 6, out.width = "50%"}
## theme_acdc_light
ggplot(
data = mtcars,
mapping = aes(
x = factor(vs, levels = c(0, 1), labels = c("v-shaped", "straight")),
fill = factor(cyl))
) +
geom_bar() +
scale_fill_manual(name = "Cylinders", values = acdc_palettes$acdc_secondary) +
labs(
title = "Light ACDC Theme",
subtitle = "Using the Africa CDC secondary palette",
x = "Engine Shape", y = "Counts"
) +
theme_acdc_light()
## theme_acdc_dark
ggplot(
data = mtcars,
mapping = aes(
x = factor(vs, levels = c(0, 1), labels = c("v-shaped", "straight")),
fill = factor(cyl))
) +
geom_bar() +
scale_fill_manual(name = "Cylinders", values = acdc_palettes$acdc_secondary) +
labs(
title = "Dark ACDC Theme",
subtitle = "Using the Africa CDC secondary palette",
x = "Engine Shape", y = "Counts"
) +
theme_acdc_dark()
```


```{r mtcars-scatter-acdc, echo = FALSE, fig.show = "hold", fig.height = 6, out.width = "50%"}
## theme_acdc_light
ggplot(data = mtcars, mapping = aes(x = mpg, y = disp, colour = factor(cyl))) +
geom_point(size = 5) +
scale_colour_manual(
name = "Cylinders",
values = acdc_palettes$acdc_secondary
) +
labs(title = "mpg by disp grouped by cyl") +
theme_acdc_light()
## theme_acdc_dark
ggplot(data = mtcars, mapping = aes(x = mpg, y = disp, colour = factor(cyl))) +
geom_point(size = 5) +
scale_colour_manual(
name = "Cylinders",
values = acdc_palettes$acdc_secondary
) +
labs(title = "mpg by disp grouped by cyl") +
theme_acdc_dark()
```
* [Using the Africa CDC colours, palettes, and themes](https://katilingban.io/motif/articles/africa-cdc.html)

## Community guidelines

Expand Down
24 changes: 9 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](h
[![R-CMD-check](https://github.com/katilingban/motif/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/katilingban/motif/actions/workflows/R-CMD-check.yaml)
[![Codecov test
coverage](https://codecov.io/gh/katilingban/motif/branch/main/graph/badge.svg)](https://app.codecov.io/gh/katilingban/motif?branch=main)
[![CodeFactor](https://www.codefactor.io/repository/github/katilingban/motif/badge)](https://www.codefactor.io/repository/github/katilingban/motif)
<!-- badges: end -->

A collection of palettes, themes, and theme components based on publicly
Expand All @@ -21,13 +22,15 @@ government agencies, and United Nations units.

## What does `motif` do?

`motif` provides or will be providing utilities for applying the various
visual identity and/or branding guidlines of various non-governmental
`motif` provides or will be providing utilities for applying the visual
identity and/or branding guidlines of various non-governmental
organisations, government agencies, and United Nations units.

Currently, `motif` has colours, palettes, and `ggplot2` themes based on
the [Africa CDC](https://africacdc.org/) [visual identity
guidelines](https://africacdc.org/download/visual-identity-africa-cdc-branding-guide/).
the following organisations’ branding/visual identity guidelines:

- [Africa CDC](https://africacdc.org/) [visual identity
guidelines](https://africacdc.org/download/visual-identity-africa-cdc-branding-guide/).

Additional colours, palettes, and themes will be provided over time.

Expand All @@ -49,17 +52,8 @@ install.packages(

## Usage

### Africa CDC colours and palettes

<img src="man/figures/README-acdc-primary-1.png" style="display: block; margin: auto;" />

<img src="man/figures/README-acdc-secondary-1.png" style="display: block; margin: auto;" />

### Africa CDC `ggplot2` theme

<img src="man/figures/README-mtcars-bar-acdc-1.png" width="50%" /><img src="man/figures/README-mtcars-bar-acdc-2.png" width="50%" />

<img src="man/figures/README-mtcars-scatter-acdc-1.png" width="50%" /><img src="man/figures/README-mtcars-scatter-acdc-2.png" width="50%" />
- [Using the Africa CDC colours, palettes, and
themes](https://katilingban.io/motif/articles/africa-cdc.html)

## Community guidelines

Expand Down
14 changes: 12 additions & 2 deletions man/acdc_font.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 0 additions & 20 deletions man/acdc_fonts.Rd

This file was deleted.

Binary file removed man/figures/README-acdc-primary-1.png
Binary file not shown.
Binary file removed man/figures/README-acdc-secondary-1.png
Binary file not shown.
Binary file removed man/figures/README-mtcars-acdc-1.png
Binary file not shown.
Binary file removed man/figures/README-mtcars-acdc-2.png
Binary file not shown.
Binary file removed man/figures/README-mtcars-bar-acdc-1.png
Binary file not shown.
Binary file removed man/figures/README-mtcars-bar-acdc-2.png
Binary file not shown.
Binary file removed man/figures/README-mtcars-scatter-acdc-1.png
Binary file not shown.
Binary file removed man/figures/README-mtcars-scatter-acdc-2.png
Binary file not shown.
Binary file removed man/figures/README-unnamed-chunk-2-1.png
Binary file not shown.
Binary file removed man/figures/logo.png
Binary file not shown.
7 changes: 7 additions & 0 deletions man/motif.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 69 additions & 0 deletions pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
title: motif

url: https://katilingban.io/motif/

template:
bootstrap: 5
bootswatch: cerulean
#theme: haddock
ganalytics: #

home:
links:
- text: Learn more about Katilingban
href: https://katilingban.io

navbar:
bg: info
type: light
structure:
left: [home, intro, reference, articles, news]
right: [mastodon, linkedin, github]

components:
articles:
text: Articles
menu:
- text: "Introduction"
href: articles/introduction.html
- text: "Africa CDC"
href: articles/africa-cdc.html
mastodon:
icon: "fab fa-mastodon fa-lg"
href: https://fosstodon.org/@katilingban
linkedin:
icon: "fab fa-linkedin fa-lg"
href: https://www.linkedin.com/company/katilingban

reference:
- title: Description
contents:
- motif

- title: motif
contents:
- motif_colours
- motif_fonts


- title: Africa CDC
contents:
- acdc_palettes
- acdc_fonts
- acdc_green
- acdc_gold
- acdc_black
- acdc_brown
- acdc_yellow
- acdc_orange
- acdc_red
- acdc_dark_green
- theme_acdc_light
- theme_acdc_dark


- title: Utilities
contents:
- get_colour
- print.palette

Binary file added pkgdown/favicon/apple-touch-icon-120x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/apple-touch-icon-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/apple-touch-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/apple-touch-icon-60x60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/apple-touch-icon-76x76.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/favicon.ico
Binary file not shown.
2 changes: 2 additions & 0 deletions vignettes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.html
*.R
Loading

0 comments on commit 1644b1e

Please sign in to comment.