Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ runner.os }}/R/${{ matrix.config.r }}/actions

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

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

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
22 changes: 17 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
# R files
.Rproj.user
.Rhistory
.RData
.Ruserdata
*.Rcheck
..Rcheck

/doc/
xkcd_*.tar.gz
# ?
/Meta/

# OSX
.DS_Store
*.Rcheck
..Rcheck



# render
/.quarto/
**/*.quarto_ipynb
*.svg
docs/*

# pkgdown
docs/*
inst/*
!inst/_pkgdown.yml
vignettes/*.html
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Description: Provides custom geoms and themes to create charts and graphics in
The package utilizes custom layers for jittered lines, segments, circles, and
figures, and includes a theme that supports the necessary 'XKCD' font.
License: MIT + file LICENSE
URL: https://github.com/ToledoEM/xkcd
URL: https://github.com/ToledoEM/xkcd, https://toledoem.github.io/xkcd
BugReports: https://github.com/ToledoEM/xkcd/issues
Depends: R (>= 4.0), ggplot2 (>= 3.4.0)
Imports:
Expand Down
28 changes: 22 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# xkcd

[![R-CMD-check](https://github.com/ToledoEM/xkcd/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ToledoEM/xkcd/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/xkcd)](https://CRAN.R-project.org/package=xkcd)
[![CRAN downloads](https://cranlogs.r-pkg.org/badges/xkcd)](https://CRAN.R-project.org/package=xkcd)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

![](https://toledoem.github.io/img/xkcd_logo.png)
![xkcd package logo](https://toledoem.github.io/img/xkcd_logo.png)

An R package to create hand-drawn (xkcd-style) plots and elements for ggplot2.

Expand Down Expand Up @@ -92,7 +96,7 @@ try({
}, silent = TRUE)
```

![test :-) ](vignettes/font_check.png)
![Font check example plot](man/figures/font_check.png)



Expand Down Expand Up @@ -124,11 +128,15 @@ library(xkcd)

This is opt-in to avoid surprising side-effects during package attach.

## Example Images
## Figure Pose Helper

An interactive browser tool to design `xkcdman()` poses visually — drag limbs, adjust sliders, and copy the generated R code directly into your script.

**[Open the Figure Pose Helper](https://toledoem.github.io/xkcd/stickfigurehelper/index.html)**

Below are three examples from the vignette:
## Example Images

![Font availability check (font_check)](vignettes/font_check.png)
Below are two examples from the vignette:

![Mother's Day example (mommy_plot)](vignettes/mommy_plot.png)

Expand Down Expand Up @@ -160,12 +168,20 @@ devtools::build_vignettes()
devtools::install_local()
```

To render the vignette directly:
To render the vignettes directly:

```r
rmarkdown::render("vignettes/xkcd-intro.Rmd")
rmarkdown::render("vignettes/xkcd-figure.Rmd")
rmarkdown::render("vignettes/xkcd-penguins.Rmd")
```

Three vignettes are available:

- **xkcd-intro** — Introduction and basic usage
- **xkcd-figure** — Drawing xkcd-style stick figures
- **xkcd-penguins** — Example with the Palmer Penguins dataset

## Dependencies

The package requires:
Expand Down
25 changes: 0 additions & 25 deletions _pkgdown.yml

This file was deleted.

11 changes: 11 additions & 0 deletions build-site.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail

# Build pkgdown site
Rscript -e "pkgdown::build_site()"

# Copy the Figure Pose Helper into the rendered site
mkdir -p docs/stickfigurehelper
cp stickfigurehelper/index.html docs/stickfigurehelper/index.html

echo "Site built. Helper available at docs/stickfigurehelper/index.html"
7 changes: 6 additions & 1 deletion inst/_pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ template:
in_header: |
<script data-goatcounter="https://etoledo.goatcounter.com/count"
async src="//gc.zgo.at/count.js"></script>

navbar:
title: xkcd
left:
Expand All @@ -16,8 +17,12 @@ navbar:
href: reference/index.html
- text: Articles
href: articles/index.html
- text: Figure Pose Helper
href: stickfigurehelper/index.html

articles:
- title: Vignettes
contents:
- xkcd-intro

- xkcd-penguins
- xkcd-figure
Binary file added man/figures/font_check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading