Skip to content

Commit

Permalink
better documentation on colour palettes, fixes #19
Browse files Browse the repository at this point in the history
  • Loading branch information
giocomai committed Apr 20, 2023
1 parent 76c7d0b commit a3030de
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion R/ganttrify.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @param by_date Logical, defaults to FALSE If FALSE, the the start and end columns in the data frame should correspond to month numbers from the beginning of the project. If TRUE, dates in the format ("2020-10" or "2020-10-01") should be given.
#' @param exact_date Logical, defaults to FALSE. If FALSE, then periods are always understood to include full months. If FALSE, then exact dates can be given.
#' @param project_start_date The date when the project starts. It can be a date, or a string in the format "2020-03" or "2020-03-01". Ignored if `month_number_date` is set to FALSE.
#' @param colour_palette A character vector of colours or a colour palette.
#' @param colour_palette A character vector of colours or a colour palette. If necessary, colours are recycled as needed. Defaults to `wesanderson::wes_palette("Darjeeling1")`. For more palettes, consider also the `MetBrewer` package, e.g. `colour_palette = MetBrewer::met.brewer("Lakota")`. Colours can be passed as a vector of hex codes (e.g. `colour_palette = c("#6ACCEA", "#00FFB8", "#B90000", "#6C919C")`)
#' @param font_family A character vector of length 1, defaults to "sans". It is recommended to use a narrow/condensed font such as Roboto Condensed for more efficient use of text space.
#' @param mark_quarters Logical, defaults to FALSE. If TRUE, vertical lines are added in correspondence of change of quarter (end of March, end of June, end of September, end of December).
#' @param mark_years Logical, defaults to FALSE. If TRUE, vertical lines are added in correspondence of change of year (1 January).
Expand Down
9 changes: 7 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ ganttrify(project = test_36,
```

If you have many working packages, you may want to adjust the size of the output, and choose palettes with more colours. You can always pass a custom palette, but if you're looking for some inspiration, the package [`MetBrewer`](https://github.com/BlakeRMills/MetBrewer) with palettes inspired by works at the Metropolitan Museum of Art in New York has some options that may make your gantt chart even fancier.
If you have many working packages, you may want to adjust the size of the output, and choose palettes with more colours. You can always pass a custom palette (e.g. by setting `colour_palette = c("#6ACCEA", "#00FFB8", "#B90000", "#6C919C")`), but if you're looking for some inspiration, the package [`MetBrewer`](https://github.com/BlakeRMills/MetBrewer) with palettes inspired by works at the Metropolitan Museum of Art in New York has some options that may make your gantt chart even fancier.

```{r lakota, fig.width=7, fig.height=7}
Expand All @@ -192,10 +192,15 @@ ganttrify(project = test_project_df,
month_breaks = 2,
project_start_date = "2023-01",
font_family = "Roboto Condensed",
colour_palette = MetBrewer::met.brewer("Lakota"))
colour_palette = MetBrewer::met.brewer("Lakota")) # or e.g. colour_palette = c("#6ACCEA", "#00FFB8", "#B90000", "#6C919C")
```


```{r}
```

Does right-aligned text bother you?

```{r gantt_left_aligned}
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ ganttrify(project = test_36,

If you have many working packages, you may want to adjust the size of
the output, and choose palettes with more colours. You can always pass a
custom palette, but if you’re looking for some inspiration, the package
custom palette (e.g. by setting
`colour_palette = c("#6ACCEA", "#00FFB8", "#B90000", "#6C919C")`), but
if you’re looking for some inspiration, the package
[`MetBrewer`](https://github.com/BlakeRMills/MetBrewer) with palettes
inspired by works at the Metropolitan Museum of Art in New York has some
options that may make your gantt chart even fancier.
Expand All @@ -256,7 +258,7 @@ ganttrify(project = test_project_df,
month_breaks = 2,
project_start_date = "2023-01",
font_family = "Roboto Condensed",
colour_palette = MetBrewer::met.brewer("Lakota"))
colour_palette = MetBrewer::met.brewer("Lakota")) # or e.g. colour_palette = c("#6ACCEA", "#00FFB8", "#B90000", "#6C919C")
#> Registered S3 method overwritten by 'MetBrewer':
#> method from
#> print.palette wesanderson
Expand Down
Binary file added man/figures/README-lakota-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion man/ganttrify.Rd

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

0 comments on commit a3030de

Please sign in to comment.