Skip to content

Commit

Permalink
use pkgdown 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
nanxstats committed Dec 22, 2021
1 parent 8d9cf13 commit d851c80
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 80 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 27,4 @@ Suggests:
gridExtra,
reshape2
Encoding: UTF-8
RoxygenNote: 7.1.1
RoxygenNote: 7.1.2
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 18,7 @@ knitr::opts_chunk$set(
)
```

# ggsci <a href="https://nanx.me/ggsci/"><img src="man/figures/logo.png" align="right" height="180" /></a>
# ggsci <img src="man/figures/logo.png" align="right" width="120" />

<!-- badges: start -->
[![R-CMD-check](https://github.com/nanxstats/ggsci/workflows/R-CMD-check/badge.svg)](https://github.com/nanxstats/ggsci/actions)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 1,7 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# ggsci <a href="https://nanx.me/ggsci/"><img src="man/figures/logo.png" align="right" height="180" /></a>
# ggsci <img src="man/figures/logo.png" align="right" width="120" />

<!-- badges: start -->

Expand Down
5 changes: 5 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,3 1,8 @@
url: https://nanx.me/ggsci/

template:
bootstrap: 5

reference:
- title: "NPG"
contents:
Expand Down
Binary file modified man/figures/README-ggsci-futurama-1.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 modified man/figures/README-ggsci-gsea-1.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 modified man/figures/README-ggsci-jama-1.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 modified man/figures/README-ggsci-material-1.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 modified man/figures/README-ggsci-rickandmorty-1.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 modified man/figures/README-ggsci-ucscgb-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions man/ggsci-package.Rd

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

49 changes: 0 additions & 49 deletions pkgdown/extra.css

This file was deleted.

57 changes: 32 additions & 25 deletions vignettes/ggsci.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 5,22 @@ output:
toc: true
toc_float: true
toc_depth: 4
number_sections: true
number_sections: false
highlight: "textmate"
css: custom.css
vignette: >
%\VignetteEngine{knitr::rmarkdown}
%\VignetteIndexEntry{Scientific Journal and Sci-Fi Themed Color Palettes for ggplot2}
---

# Introduction
```{r, include=FALSE}
knitr::opts_chunk$set(
comment = "#>",
collapse = TRUE
)
```

## Introduction

> My eyes were finally opened and I understood nature.
>
Expand Down Expand Up @@ -107,7 114,7 @@ summarized in the table below.
| | | `"blue-grey"` | |
----------------- ------------------------------ -------------------------------- ----------------------

# Discrete Color Palettes
## Discrete Color Palettes

We will use scatterplots with smooth curves, and bar plots to demonstrate
the discrete color palettes in `ggsci`.
Expand Down Expand Up @@ -135,7 142,7 @@ p2 <- ggplot(
theme_bw()
```

## NPG
### NPG

The NPG palette is inspired by the plots in the journals published by
<emph>Nature Publishing Group</emph>:
Expand All @@ -146,7 153,7 @@ p2_npg <- p2 scale_fill_npg()
grid.arrange(p1_npg, p2_npg, ncol = 2)
```

## AAAS
### AAAS

The AAAS palette is inspired by the plots in the journals published by
<emph>American Association for the Advancement of Science</emph>:
Expand All @@ -157,7 164,7 @@ p2_aaas <- p2 scale_fill_aaas()
grid.arrange(p1_aaas, p2_aaas, ncol = 2)
```

## NEJM
### NEJM

The NEJM palette is inspired by the plots in
<emph>The New England Journal of Medicine</emph>:
Expand All @@ -168,7 175,7 @@ p2_nejm <- p2 scale_fill_nejm()
grid.arrange(p1_nejm, p2_nejm, ncol = 2)
```

## Lancet
### Lancet

The Lancet palette is inspired by the plots in <emph>Lancet</emph> journals,
such as <emph>Lancet Oncology</emph>:
Expand All @@ -179,7 186,7 @@ p2_lancet <- p2 scale_fill_lancet()
grid.arrange(p1_lancet, p2_lancet, ncol = 2)
```

## JAMA
### JAMA

The JAMA palette is inspired by the plots in
<emph>The Journal of the American Medical Association</emph>:
Expand All @@ -190,7 197,7 @@ p2_jama <- p2 scale_fill_jama()
grid.arrange(p1_jama, p2_jama, ncol = 2)
```

## JCO
### JCO

The JCO palette is inspired by the the plots in
<emph>Journal of Clinical Oncology</emph>:
Expand All @@ -201,7 208,7 @@ p2_jco <- p2 scale_fill_jco()
grid.arrange(p1_jco, p2_jco, ncol = 2)
```

## UCSCGB
### UCSCGB

The UCSCGB palette is from the colors used by
[UCSC Genome Browser](https://genome.ucsc.edu) for
Expand All @@ -214,7 221,7 @@ p2_ucscgb <- p2 scale_fill_ucscgb()
grid.arrange(p1_ucscgb, p2_ucscgb, ncol = 2)
```

## D3
### D3

The D3 palette is from the categorical colors used by
[D3.js](https://d3js.org) (version 3.x and before).
Expand All @@ -227,7 234,7 @@ p2_d3 <- p2 scale_fill_d3()
grid.arrange(p1_d3, p2_d3, ncol = 2)
```

## LocusZoom
### LocusZoom

The LocusZoom palette is based on the colors used by
[LocusZoom](http://locuszoom.org/).
Expand All @@ -238,7 245,7 @@ p2_locuszoom <- p2 scale_fill_locuszoom()
grid.arrange(p1_locuszoom, p2_locuszoom, ncol = 2)
```

## IGV
### IGV

The IGV palette is from the colors used by
[Integrative Genomics Viewer](http://software.broadinstitute.org/software/igv/)
Expand All @@ -251,7 258,7 @@ p2_igv_default <- p2 scale_fill_igv()
grid.arrange(p1_igv_default, p2_igv_default, ncol = 2)
```

## COSMIC
### COSMIC

Color palettes inspired by the colors used in projects from the [Catalogue Of Somatic Mutations in Cancers (COSMIC)](https://cancer.sanger.ac.uk/cosmic).

Expand All @@ -273,7 280,7 @@ p2_cosmic_signature <- p2 scale_fill_cosmic("signature_substitutions")
grid.arrange(p1_cosmic_signature, p2_cosmic_signature, ncol = 2)
```

## UChicago
### UChicago

The UChicago palette is based on
[the colors](https://news.uchicago.edu/sites/default/files/attachments/_uchicago.identity.guidelines.pdf)
Expand All @@ -286,7 293,7 @@ p2_uchicago <- p2 scale_fill_uchicago()
grid.arrange(p1_uchicago, p2_uchicago, ncol = 2)
```

## Star Trek
### Star Trek

This palette is inspired by the (uniform) colors in <emph>Star Trek</emph>:

Expand All @@ -296,7 303,7 @@ p2_startrek <- p2 scale_fill_startrek()
grid.arrange(p1_startrek, p2_startrek, ncol = 2)
```

## Tron Legacy
### Tron Legacy

This palette is inspired by the colors used in <emph>Tron Legacy</emph>.
It is suitable for displaying data when using a dark theme:
Expand All @@ -314,7 321,7 @@ p2_tron <- p2 theme_dark() theme(
grid.arrange(p1_tron, p2_tron, ncol = 2)
```

## Futurama
### Futurama

This palette is inspired by the colors used in the TV show <emph>Futurama</emph>:

Expand All @@ -324,7 331,7 @@ p2_futurama <- p2 scale_fill_futurama()
grid.arrange(p1_futurama, p2_futurama, ncol = 2)
```

## Rick and Morty
### Rick and Morty

This palette is inspired by the colors used in the TV show <emph>Rick and Morty</emph>:

Expand All @@ -334,7 341,7 @@ p2_rickandmorty <- p2 scale_fill_rickandmorty()
grid.arrange(p1_rickandmorty, p2_rickandmorty, ncol = 2)
```

## The Simpsons
### The Simpsons

This palette is inspired by the colors used in the TV show
<emph>The Simpsons</emph>:
Expand All @@ -345,7 352,7 @@ p2_simpsons <- p2 scale_fill_simpsons()
grid.arrange(p1_simpsons, p2_simpsons, ncol = 2)
```

# Continuous Color Palettes
## Continuous Color Palettes

We will use a correlation matrix visualization (a special type of heatmap)
to demonstrate the continuous color palettes in `ggsci`.
Expand All @@ -369,7 376,7 @@ p3 <- ggplot(
)
```

## GSEA
### GSEA

The GSEA palette (continuous) is inspired by the heatmaps generated by
[GSEA GenePattern](https://software.broadinstitute.org/cancer/software/genepattern/).
Expand All @@ -380,7 387,7 @@ p3_gsea_inv <- p3 scale_fill_gsea(reverse = TRUE)
grid.arrange(p3_gsea, p3_gsea_inv, ncol = 2)
```

## Material Design
### Material Design

The <emph>Material Design</emph> color palettes are from the [material design
color guidelines](https://material.io/guidelines/style/color.html).
Expand Down Expand Up @@ -433,7 440,7 @@ was visualized by all plots, some palettes are more preferrable
than the others because our eyes are more sensitive to the changes
of their saturation levels.

# Non-ggplot2 Graphics
## Non-ggplot2 Graphics

To apply the color palettes in `ggsci` to other graphics systems
(such as base graphics and lattice graphics), simply use the
Expand All @@ -452,7 459,7 @@ graphics systems accordingly. The transparent level of the
entire palette is easily adjustable via the argument `"alpha"`
in every generator or scale function.

# Discussion
## Discussion

Please note some of the palettes might not be the best choice for certain
purposes, such as color-blind safe, photocopy safe, or print friendly.
Expand Down

0 comments on commit d851c80

Please sign in to comment.