~hrbrmstr/ggchicklet

ea75042e8618a3039a8878acd0cf91d0c3c624c3 — boB Rudis 4 years ago 5f9e698
README
10 files changed, 54 insertions(+), 48 deletions(-)

M R/geom-chicklet.R
M R/ggchicklet-package.R
M README.Rmd
M README.md
D README_files/figure-gfm/unnamed-chunk-1-1.png
A man/figures/README-nyt-1.png
D man/figures/README-unnamed-chunk-1-1.png
D man/figures/chickletex.png
M man/geom_chicklet.Rd
M man/ggchicklet.Rd
M R/geom-chicklet.R => R/geom-chicklet.R +4 -4
@@ 7,13 7,13 @@
#' \if{html}{
#' A sample of the output from \code{geom_chicklet()}:
#'
#' \figure{chickletex.png}{options: width="100\%" alt="Figure: chickletex.png"}
#' \figure{README-nyt-1.png}{options: width="100\%" alt="Figure: README-nyt-1.png"}
#' }
#'
#' \if{latex}{
#' A sample of the output from \code{geom_chicklet()}:
#'
#' \figure{chickletex.png}{options: width=10cm}
#' \figure{README-nyt-1.png}{options: width=10cm}
#' }
#'
#' @section Aesthetics:


@@ 71,14 71,14 @@ geom_chicklet <- function(mapping = NULL, data = NULL,
  )
}

draw_key_rrect <- function(data, params, size, ...) { # nocov start
draw_key_rrect <- function(data, params, size) { # nocov start
  grid::roundrectGrob(
    r = min(params$radius, unit(3, "pt")),
    default.units = "native",
    width = 1, height = 0.6,
    name = "lkey",
    gp = grid::gpar(
      col = params[["color"]][[1]] %l0% params[["colour"]][1] %l0% data[["colour"]][[1]] %l0% "#00000000",
      col = params$color %l0% "white",
      fill = alpha(data$fill %||% data$colour %||% "grey20", data$alpha),
      lty = data$linetype %||% 1
    )

M R/ggchicklet-package.R => R/ggchicklet-package.R +2 -2
@@ 7,13 7,13 @@
#' \if{html}{
#' A sample of the output from \code{geom_chicklet()}:
#'
#' \figure{chickletex.png}{options: width="100\%" alt="Figure: chickletex.png"}
#' \figure{README-nyt-1.png}{options: width="100\%" alt="Figure: README-nyt-1.png"}
#' }
#'
#' \if{latex}{
#' A sample of the output from \code{geom_chicklet()}:
#'
#' \figure{chickletex.png}{options: width=10cm}
#' \figure{README-nyt-1.png}{options: width=10cm}
#' }
#'
#' @md

M README.Rmd => README.Rmd +12 -23
@@ 4,16 4,12 @@ editor_options:
  chunk_output_type: console
---
```{r pkg-knitr-opts, include=FALSE}
knitr::opts_chunk$set(
  collapse=TRUE, fig.retina=2, message=FALSE, warning=FALSE,
  fig.path = "man/figures/README-"
)
options(width=120)
hrbrpkghelpr::global_opts()
```

[![Travis-CI Build Status](https://travis-ci.org/hrbrmstr/ggchicklet.svg?branch=master)](https://travis-ci.org/hrbrmstr/ggchicklet) 
[![Coverage Status](https://codecov.io/gh/hrbrmstr/ggchicklet/branch/master/graph/badge.svg)](https://codecov.io/gh/hrbrmstr/ggchicklet)
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/ggchicklet)](https://cran.r-project.org/package=ggchicklet)
```{r badges, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::stinking_badges()
```

# ggchicklet



@@ 22,27 18,20 @@ Create Chicklet (Rounded Segmented Column) Charts
## Description

Sometimes it is useful to stylize column charts a bit more
than just bland rectangles. Methods are provided to create rounded
rectangle segmented column charts (i.e. "chicklets").
than just bland rectangles. Methods are provided to create rounded rectangle segmented column charts (i.e. "chicklets").

## What's Inside The Tin

```{r ingredients, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::describe_ingredients()
```

The following functions are implemented:

## Installation

```{r install-ex, eval=FALSE}
install.packages("ggchicklet", repos = "https://cinc.rud.is")
# or 
devtools::install_git("https://git.rud.is/hrbrmstr/ggchicklet.git")
# or 
devtools::install_git("https://git.sr.ht/~hrbrmstr/ggchicklet")
# or
devtools::install_gitlab("hrbrmstr/ggchicklet")
# or
devtools::install_bitbucket("hrbrmstr/ggchicklet")
# or (if you must)
devtools::install_github("hrbrmstr/ggchicklet")
```{r install-ex, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::install_block()
```

## Usage


@@ 57,7 46,7 @@ packageVersion("ggchicklet")

### From the NYTimes

```{r fig.width=10, fig.height=9, out.width="100%"}
```{r nyt, fig.width=10, fig.height=9, out.width="100%"}
library(hrbrthemes)
library(tidyverse)


M README.md => README.md +32 -15
@@ 1,9 1,18 @@

[![Travis-CI Build
[![Project Status: Active – The project has reached a stable, usable
state and is being actively
developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Signed
by](https://img.shields.io/badge/Keybase-Verified-brightgreen.svg)](https://keybase.io/hrbrmstr)
![Signed commit
%](https://img.shields.io/badge/Signed_Commits-100%25-lightgrey.svg)
[![Linux build
Status](https://travis-ci.org/hrbrmstr/ggchicklet.svg?branch=master)](https://travis-ci.org/hrbrmstr/ggchicklet)
[![Coverage
Status](https://codecov.io/gh/hrbrmstr/ggchicklet/branch/master/graph/badge.svg)](https://codecov.io/gh/hrbrmstr/ggchicklet)
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/ggchicklet)](https://cran.r-project.org/package=ggchicklet)
![Minimal R
Version](https://img.shields.io/badge/R%3E%3D-3.2.0-blue.svg)
![License](https://img.shields.io/badge/License-MIT-blue.svg)

# ggchicklet



@@ 17,24 26,32 @@ segmented column charts (i.e. “chicklets”).

## What’s Inside The Tin

  - `debates2019`: June 2019 U.S. Democratic Debate Candidate/Topic
    Times
  - `geom_chicklet`: Chicklet (rounded segmented column) charts
  - `GeomChicklet`: ggchicklet-ggplot2-ggproto

The following functions are implemented:

## Installation

``` r
install.packages("ggchicklet", repos = "https://cinc.rud.is")
# or 
devtools::install_git("https://git.rud.is/hrbrmstr/ggchicklet.git")
# or 
devtools::install_git("https://git.sr.ht/~hrbrmstr/ggchicklet")
# or
devtools::install_gitlab("hrbrmstr/ggchicklet")
remotes::install_git("https://git.rud.is/hrbrmstr/ggchicklet.git")
# or
remotes::install_git("https://git.sr.ht/~hrbrmstr/ggchicklet")
# or
remotes::install_gitlab("hrbrmstr/ggchicklet")
# or
devtools::install_bitbucket("hrbrmstr/ggchicklet")
# or (if you must)
devtools::install_github("hrbrmstr/ggchicklet")
remotes::install_bitbucket("hrbrmstr/ggchicklet")
# or
remotes::install_github("hrbrmstr/ggchicklet")
```

NOTE: To use the ‘remotes’ install options you will need to have the
[{remotes} package](https://github.com/r-lib/remotes) installed.

## Usage

``` r


@@ 95,14 112,14 @@ debates2019 %>%
  theme(legend.position = "top")
```

<img src="man/figures/README-unnamed-chunk-1-1.png" width="100%" />
<img src="man/figures/README-nyt-1.png" width="100%" />

## ggchicklet Metrics

| Lang | \# Files |  (%) | LoC |  (%) | Blank lines |  (%) | \# Lines |  (%) |
| :--- | -------: | ---: | --: | ---: | ----------: | ---: | -------: | ---: |
| R    |        9 | 0.82 | 123 | 0.51 |          27 | 0.37 |      105 | 0.54 |
| Rmd  |        2 | 0.18 | 116 | 0.49 |          46 | 0.63 |       90 | 0.46 |
| Lang | \# Files | (%) | LoC |  (%) | Blank lines |  (%) | \# Lines |  (%) |
| :--- | -------: | --: | --: | ---: | ----------: | ---: | -------: | ---: |
| R    |        8 | 0.8 | 119 | 0.52 |          27 | 0.36 |      107 | 0.56 |
| Rmd  |        2 | 0.2 | 109 | 0.48 |          47 | 0.64 |       85 | 0.44 |

## Code of Conduct


D README_files/figure-gfm/unnamed-chunk-1-1.png => README_files/figure-gfm/unnamed-chunk-1-1.png +0 -0
A man/figures/README-nyt-1.png => man/figures/README-nyt-1.png +0 -0
D man/figures/README-unnamed-chunk-1-1.png => man/figures/README-unnamed-chunk-1-1.png +0 -0
D man/figures/chickletex.png => man/figures/chickletex.png +0 -0
M man/geom_chicklet.Rd => man/geom_chicklet.Rd +2 -2
@@ 65,13 65,13 @@ sets some sane defaults for making chicklet charts.
\if{html}{
A sample of the output from \code{geom_chicklet()}:

\figure{chickletex.png}{options: width="100\%" alt="Figure: chickletex.png"}
\figure{README-nyt-1.png}{options: width="100\%" alt="Figure: README-nyt-1.png"}
}

\if{latex}{
A sample of the output from \code{geom_chicklet()}:

\figure{chickletex.png}{options: width=10cm}
\figure{README-nyt-1.png}{options: width=10cm}
}
}
\note{

M man/ggchicklet.Rd => man/ggchicklet.Rd +2 -2
@@ 14,13 14,13 @@ rectangle segmented column charts (i.e. "chicklets").
\if{html}{
A sample of the output from \code{geom_chicklet()}:

\figure{chickletex.png}{options: width="100\%" alt="Figure: chickletex.png"}
\figure{README-nyt-1.png}{options: width="100\%" alt="Figure: README-nyt-1.png"}
}

\if{latex}{
A sample of the output from \code{geom_chicklet()}:

\figure{chickletex.png}{options: width=10cm}
\figure{README-nyt-1.png}{options: width=10cm}
}
}
\seealso{