diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..34cdbb0 --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,91 @@ + +# Contributor Covenant 3.0 Code of Conduct + +## Our Pledge + +We pledge to make our community welcoming, safe, and equitable for all. + +We are committed to fostering an environment that respects and promotes the dignity, rights, and contributions of all individuals, regardless of characteristics including race, ethnicity, caste, color, age, physical characteristics, neurodiversity, disability, sex or gender, gender identity or expression, sexual orientation, language, philosophy or religion, national or social origin, socio-economic position, level of education, or other status. The same privileges of participation are extended to everyone who participates in good faith and in accordance with this Covenant. + +## Encouraged Behaviors + +While acknowledging differences in social norms, we all strive to meet our community's expectations for positive behavior. We also understand that our words and actions may be interpreted differently than we intend based on culture, background, or native language. + +With these considerations in mind, we agree to behave mindfully toward each other and act in ways that center our shared values, including: + +1. Respecting the **purpose of our community**, our activities, and our ways of gathering. +2. Engaging **kindly and honestly** with others. +3. Respecting **different viewpoints** and experiences. +4. **Taking responsibility** for our actions and contributions. +5. Gracefully giving and accepting **constructive feedback**. +6. Committing to **repairing harm** when it occurs. +7. Behaving in other ways that promote and sustain the **well-being of our community**. + + +## Restricted Behaviors + +We agree to restrict the following behaviors in our community. Instances, threats, and promotion of these behaviors are violations of this Code of Conduct. + +1. **Harassment.** Violating explicitly expressed boundaries or engaging in unnecessary personal attention after any clear request to stop. +2. **Character attacks.** Making insulting, demeaning, or pejorative comments directed at a community member or group of people. +3. **Stereotyping or discrimination.** Characterizing anyone’s personality or behavior on the basis of immutable identities or traits. +4. **Sexualization.** Behaving in a way that would generally be considered inappropriately intimate in the context or purpose of the community. +5. **Violating confidentiality**. Sharing or acting on someone's personal or private information without their permission. +6. **Endangerment.** Causing, encouraging, or threatening violence or other harm toward any person or group. +7. Behaving in other ways that **threaten the well-being** of our community. + +### Other Restrictions + +1. **Misleading identity.** Impersonating someone else for any reason, or pretending to be someone else to evade enforcement actions. +2. **Failing to credit sources.** Not properly crediting the sources of content you contribute. +3. **Promotional materials**. Sharing marketing or other commercial content in a way that is outside the norms of the community. +4. **Irresponsible communication.** Failing to responsibly present content which includes, links or describes any other restricted behaviors. + + +## Reporting an Issue + +Tensions can occur between community members even when they are trying their best to collaborate. Not every conflict represents a code of conduct violation, and this Code of Conduct reinforces encouraged behaviors and norms that can help avoid conflicts and minimize harm. + +When an incident does occur, it is important to report it promptly. To report a possible violation, **please reach out to the SPIN team at RIVM via spin@rivm.nl.** + +Community Moderators take reports of violations seriously and will make every effort to respond in a timely manner. They will investigate all reports of code of conduct violations, reviewing messages, logs, and recordings, or interviewing witnesses and other participants. Community Moderators will keep investigation and enforcement actions as transparent as possible while prioritizing safety and confidentiality. In order to honor these values, enforcement actions are carried out in private with the involved parties, but communicating to the whole community may be part of a mutually agreed upon resolution. + + +## Addressing and Repairing Harm + +**** + +If an investigation by the Community Moderators finds that this Code of Conduct has been violated, the following enforcement ladder may be used to determine how best to repair harm, based on the incident's impact on the individuals involved and the community as a whole. Depending on the severity of a violation, lower rungs on the ladder may be skipped. + +1) Warning + 1) Event: A violation involving a single incident or series of incidents. + 2) Consequence: A private, written warning from the Community Moderators. + 3) Repair: Examples of repair include a private written apology, acknowledgement of responsibility, and seeking clarification on expectations. +2) Temporarily Limited Activities + 1) Event: A repeated incidence of a violation that previously resulted in a warning, or the first incidence of a more serious violation. + 2) Consequence: A private, written warning with a time-limited cooldown period designed to underscore the seriousness of the situation and give the community members involved time to process the incident. The cooldown period may be limited to particular communication channels or interactions with particular community members. + 3) Repair: Examples of repair may include making an apology, using the cooldown period to reflect on actions and impact, and being thoughtful about re-entering community spaces after the period is over. +3) Temporary Suspension + 1) Event: A pattern of repeated violation which the Community Moderators have tried to address with warnings, or a single serious violation. + 2) Consequence: A private written warning with conditions for return from suspension. In general, temporary suspensions give the person being suspended time to reflect upon their behavior and possible corrective actions. + 3) Repair: Examples of repair include respecting the spirit of the suspension, meeting the specified conditions for return, and being thoughtful about how to reintegrate with the community when the suspension is lifted. +4) Permanent Ban + 1) Event: A pattern of repeated code of conduct violations that other steps on the ladder have failed to resolve, or a violation so serious that the Community Moderators determine there is no way to keep the community safe with this person as a member. + 2) Consequence: Access to all community spaces, tools, and communication channels is removed. In general, permanent bans should be rarely used, should have strong reasoning behind them, and should only be resorted to if working through other remedies has failed to change the behavior. + 3) Repair: There is no possible repair in cases of this severity. + +This enforcement ladder is intended as a guideline. It does not limit the ability of Community Managers to use their discretion and judgment, in keeping with the best interests of our community. + + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public or other spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 3.0, permanently available at [https://www.contributor-covenant.org/version/3/0/](https://www.contributor-covenant.org/version/3/0/). + +Contributor Covenant is stewarded by the Organization for Ethical Source and licensed under CC BY-SA 4.0. To view a copy of this license, visit [https://creativecommons.org/licenses/by-sa/4.0/](https://creativecommons.org/licenses/by-sa/4.0/) + +For answers to common questions about Contributor Covenant, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are provided at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations). Additional enforcement and community guideline resources can be found at [https://www.contributor-covenant.org/resources](https://www.contributor-covenant.org/resources). The enforcement ladder was inspired by the work of [Mozilla’s code of conduct team](https://github.com/mozilla/inclusion). diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..3e35e19 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,141 @@ +# Contributing to ROvis + +Hey! 👋 Thank you for your interest in contributing to ROvis! We welcome all support and value your input. + +## About ROvis + +Before contributing, please remember that ROvis is designed specifically to implement **official Rijksoverheid (Dutch Government) design guidelines** for data visualization. The package's primary purpose is to ensure consistency in visualizations across Rijksoverheid organizations by providing tools for: + +- Applying Rijksoverheid color palettes +- Styling plots and tables according to Rijksoverheid standards +- Supporting the Rijksoverheid visual identity + +While the package was originally developed for RIVM (and was previously called DARAvis), it now serves the broader Rijksoverheid community. All contributions should align with this core mission and official Rijksoverheid design guidelines. + +## How to contribute + +### 1. Open an issue + +**Before submitting any code changes**, please open an issue on the [GitHub issue board](https://github.com/rivm-syso/ROvis.utils/issues) to: + +- Describe the bug you want to fix or the feature you want to add +- Explain why the change is needed +- Discuss your proposed approach +- Allow maintainers and other contributors to provide feedback + +This applies to both major features and small fixes. Opening an issue first helps us: + +- Avoid duplicate work +- Ensure the contribution aligns with Rijksoverheid design standards +- Discuss the best implementation approach +- Maintain focus on the package's core purpose + +### 2. Wait for discussion + +Give maintainers and other contributors time to respond to your issue. This discussion ensures that: + +- The proposed change fits within the package's scope +- The implementation approach is appropriate +- There are no conflicts with planned changes +- The change adheres to Rijksoverheid design guidelines + +### 3. Fork and create a branch + +Once your issue has been discussed and approved: + +1. Fork the repository +2. Create a feature branch from `main` +3. Name your branch descriptively (e.g., `fix-color-palette`, `add-new-theme`) + +### 4. Make your changes + +When coding: + +- **Follow our code style**: we stick to the [Tidyverse style guide](https://style.tidyverse.org) and we use [air](https://posit-dev.github.io/air) for code formatting +- **Follow existing patterns**: look at similar functions in the code base to maintain consistency +- **Keep it simple**: avoid over-engineering and only add what's necessary for the task at hand +- **Build on existing functions**: don't duplicate logic and use/extend existing functions where possible +- Write clear, self-documenting code +- Add `roxygen2` documentation for new functions +- Include examples in your documentation +- Write tests for new functionality +- Update existing tests if modifying behavior +- Run `devtools::check()` to ensure your changes don't break anything + +### 5. Test your changes + +- Run the test suite: `devtools::test()` +- For theme changes, verify visual regression tests pass (with `vdiffr`) +- Test your changes with real-world examples +- Ensure your code works with R versions as mentioned in DESCRIPTION + +### 6. Submit a pull request + +- Push your branch to your fork +- Create a pull request targeting the `main` branch +- Reference the issue number in your pull request +- Provide a clear description of what your changes do +- Include examples or screenshots if applicable + +## Code standards + +- **Single source of truth**: all color definitions live in `color()`. Build on existing functions rather than duplicating logic. +- **Maintain Rijksoverheid standards**: Verify your changes against the style guidelines. +- **Version carefully**: Use version parameters for breaking changes; never replace existing behavior +- **Document clearly**: Users across Rijksoverheid organizations may not be R experts. Provide clear examples. +- **Test visually**: Use `vdiffr` for theme changes to catch visual regressions + +## AI/LLM-Generated Contributions + +We welcome contributions assisted by AI tools (ChatGPT, Claude, GitHub Copilot, etc.), but please keep the following in mind: + +**You are responsible for your contributions.** Before submitting AI-generated code: + +- **Understand the code completely.** Don't submit code you don't fully comprehend. You should be able to explain every line and decision. +- **Test thoroughly.** AI-generated code may contain subtle bugs, incorrect assumptions, or non-standard patterns. Run all tests and verify the code works as intended. +- **Review for package consistency.** AI tools may not be aware of our specific architecture patterns, dependency chains, or design philosophy. Ensure the code follows our standards. +- **Check for quality.** AI can generate verbose, over-engineered, or redundant code. Simplify and refine before submitting. + +**Why this matters:** Reviewing AI-generated pull requests takes significant maintainer time, especially when contributors haven't verified the code themselves. Submitting untested or poorly understood code creates unnecessary burden on maintainers who must identify issues, explain problems, and request fixes. + +We appreciate AI as a helpful tool, but the responsibility for code quality, correctness, and understanding remains with the contributor. + +## What we're looking for + +We particularly welcome contributions that: + +- Fix bugs in existing functionality +- Improve documentation and examples +- Add support for new Rijksoverheid design guideline features +- Add themes for additional plotting libraries +- Add themes for additional table libraries +- Enhance error messages and user feedback +- Improve test coverage +- Extend functionality to serve other Rijksoverheid organizations + +## What to avoid + +Please avoid contributions that: + +- Deviate from official Rijksoverheid design guidelines +- Add features unrelated to Rijksoverheid visualization standards +- Introduce breaking changes without discussion +- Duplicate existing functionality +- Add unnecessary dependencies + +## Questions? + +If you have questions about contributing: + +- Open a discussion issue on [GitHub](https://github.com/rivm-syso/ROvis.utils/issues) +- Email the SPIN team: [spin@rivm.nl](mailto:spin@rivm.nl) +- Review existing code and documentation in the repository to understand patterns and conventions + +## License + +By contributing to ROvis, you agree that your contributions will be licensed under the [EUPL v.1.2](https://eupl.eu/1.2/en/) license. + +--- + +Thank you for helping us maintain and improve ROvis! + diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..9a7fd00 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,43 @@ +--- +name: "🐛 Bug Report" +about: "Report an issue and help to improve ROvis" +title: "[Bug] " +labels: bug +--- + +# **:bug: Bug Report** + +## :eyes: What's going on? + + +### :arrow_heading_down: Is this a regression? + + + +### :repeat: Steps to reproduce +Steps to reproduce the behaviour: + +1. +2. +3. +4. + +[Reprex](https://reprex.tidyverse.org/) (reproducible example): + +```r +``` + +### :thinking: What did you expect to happen? + + +### :camera_flash: Screenshots / output + + +### :computer: Your setup + +- Package version: +- R version: +- Operating system: + +## :speech_balloon: Anything else? + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..8bf082e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: "✨ Feature Request" +about: "Got an idea? Tell us about it!" +title: "" +labels: enhancement +--- + +# **:sparkles: Feature Request** + +## :thought_balloon: What are you thinking of? + + +## :face_exhaling: What problem would this solve for you? + + +## :hammer_and_wrench: How could it work? + + +## :speech_balloon: Extra notes + diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 0000000..cb56a88 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,14 @@ +--- +name: "💬 Question / Discussion" +about: "Ask anything or start a friendly discussion" +title: "" +labels: question +--- + +# **:speech_balloon: Question / Discussion** + +## :speaking_head: What would you like to discuss? + + +## :books: Additional context + diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request.md b/.github/PULL_REQUEST_TEMPLATE/pull_request.md new file mode 100644 index 0000000..ed62e5e --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request.md @@ -0,0 +1,28 @@ +--- +name: "🚀 Pull Request" +about: "Use this template to make your PR easy to review" +--- + +#*Name of PR* + + + +## :blue_book: What is this PR about? + + +## :white_check_mark: Checklist + +- [ ] I have read contributing guidelines at `CONTRIBUTING.md` +- [ ] My code follows the style guidelines of this project += [ ] I have tested these changes and added tests (if applicable) +- [ ] I have added necessary documentation / comments +- [ ] I have linked relevant issues + +## :test_tube: How to test / verify + + +```r +``` + +## :information_source: Extra info + diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md new file mode 100644 index 0000000..015a584 --- /dev/null +++ b/CONTRIBUTORS.md @@ -0,0 +1,5 @@ +# Contributors + +Thanks to everyone who contributed to this project! + +See the GitHub contributors list for the full history. diff --git a/DESCRIPTION b/DESCRIPTION index 3de08f1..dad51e8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,11 @@ Package: ROvis.utils -Title: Rijksoverheid Visualisatie - utils -Version: 0.0.0.9000 +Title: Utilities for Rijksoverheid-Styled Data Visualizations +Version: 0.1.0 Authors@R: person("ROvis team", email = "spin@rivm.nl", role = c("cre", "aut")) -Description: ROvis.utils is an R package that provides a comprehensive suite of utilities for visualizing in Rijksoverheid style. +Description: Provides shared utilities for the ROvis suite, including Rijksoverheid + color palettes, palette validation, and font-availability checks, so that themes + across the ROvis packages stay consistent with official Rijksoverheid design + guidelines. License: Apache License (>= 2) Depends: R (>= 4.5.0) @@ -27,8 +30,7 @@ Suggests: tidyr, testthat (>= 3.0.0) VignetteBuilder: quarto -Config/roxygen2/markdown: TRUE -Config/roxygen2/version: 8.1.0 Config/testthat/edition: 3 Encoding: UTF-8 -Roxygen: list(markdown = TRUE) +Config/roxygen2/markdown: TRUE +Config/roxygen2/version: 8.1.0 diff --git a/NAMESPACE b/NAMESPACE index 600c526..7cdc866 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -10,24 +10,32 @@ export(ro_get_color_palette) export(ro_group_badge) export(ro_show_colors) import(rlang) -importFrom(cli,cli_abort) -importFrom(cli,cli_inform) -importFrom(dplyr,filter) -importFrom(dplyr,mutate) -importFrom(ggplot2,aes) -importFrom(ggplot2,element_blank) -importFrom(ggplot2,element_text) -importFrom(ggplot2,geom_text) -importFrom(ggplot2,geom_tile) -importFrom(ggplot2,ggplot) -importFrom(ggplot2,labs) -importFrom(ggplot2,scale_fill_manual) -importFrom(ggplot2,scale_y_discrete) -importFrom(ggplot2,theme) +importFrom(cli, + cli_abort, + cli_inform +) +importFrom(dplyr, + filter, + mutate +) +importFrom(ggplot2, + aes, + element_blank, + element_text, + geom_text, + geom_tile, + ggplot, + labs, + scale_fill_manual, + scale_y_discrete, + theme +) importFrom(magrittr,"%>%") importFrom(plotly,ggplotly) importFrom(scales,pal_seq_gradient) importFrom(stringr,str_c) importFrom(systemfonts,system_fonts) -importFrom(tibble,rowid_to_column) -importFrom(tibble,tibble) +importFrom(tibble, + rowid_to_column, + tibble +) diff --git a/NEWS.md b/NEWS.md index 7d6e854..e8a1f9e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,7 @@ -# ROvis.utils v0.0.0.9000 +# ROvis.utils v0.1.0 + +First release since `ROvis.utils` was split out of the `ROvis` monolith into its own +package, and the repository moved from GitLab to GitHub. ### :sparkles: Added @@ -6,9 +9,15 @@ `ro_color_categorical`, `ro_color_palette`, `ro_color_seq_named`, `ro_color_seq`, `ro_color_validate`, `ro_color`, `ro_get_color_palette`, `ro_group_badge`, `ro_show_colors`. +- Added community health files: `CONTRIBUTING.md`, `CONTRIBUTORS.md`, and issue and +pull request templates. ### :hammer_and_wrench: Changed +- Migrated the repository from GitLab to GitHub (`rivm-syso/ROvis.utils`). +- Replaced GitLab CI with a GitHub Actions workflow covering lint, R CMD check, test +coverage, and pkgdown. + ### :bug: Fixed ### :coffin: Deprecated diff --git a/R/ro_color.R b/R/ro_color.R index 61e6882..edc2933 100644 --- a/R/ro_color.R +++ b/R/ro_color.R @@ -6,11 +6,11 @@ #' Returns hex code(s) of color_name. All 18 RIVM colors and their #' lighter shades can be accessed with this function. The names of #' RIVM colors are listed at the rijkshuisstijl website, or, can be viewed by -#' running another ROvis function \link[ROvis]{ro_show_colors}. +#' running another function, \link{ro_show_colors}. #' #' To access a vector of hex color codes of the categorical palette, use the ROvis #' -#' function \link[ROvis]{ro_color_categorical}. +#' function \link{ro_color_categorical}. #' #' @param color_name Character or vector of characters. Default="hemelblauw". #' Can be one of: diff --git a/R/ro_color_categorical.R b/R/ro_color_categorical.R index 3f09d68..5b6f207 100644 --- a/R/ro_color_categorical.R +++ b/R/ro_color_categorical.R @@ -5,7 +5,7 @@ #' Returns a vector of hex color codes of the categorical RIVM color palette. #' This is especially useful when you don't need to assign a specific color to #' a specific category. If you do, for example for male/female, we recommend to -#' assign the colors explicitly using the \link[ROvis]{ro_color} function. +#' assign the colors explicitly using the \link{ro_color} function. #' #' #' @return Returns a character vector of hex color codes of the categorical palette. diff --git a/R/ro_color_palette.R b/R/ro_color_palette.R index 6ab4fa3..96fd514 100644 --- a/R/ro_color_palette.R +++ b/R/ro_color_palette.R @@ -3,7 +3,7 @@ #' `r ro_group_badge(c('echarts4r', 'ggplot2', 'plotly'))` #' #' @section Dependencies: -#' * \link[ROvis]{ro_color} +#' * \link{ro_color} #' #' @param palette_name one of: #' * "full": all 18 RIVM colors (full color, 100% tint) diff --git a/R/ro_color_seq.R b/R/ro_color_seq.R index a047fbc..7280abb 100644 --- a/R/ro_color_seq.R +++ b/R/ro_color_seq.R @@ -8,7 +8,7 @@ #' This could be a transition from a light to a dark shade, or one color to a different color, #' see examples. Uses \code{pal_seq_gradient()} from the scales package under the hood. #' -#' To access the hex color code of a specific color, use the the ROvis function \link[ROvis]{ro_color}. +#' To access the hex color code of a specific color, use the \link{ro_color} function. #' #' @param low Character. The hexadecimal code (#RRGGBB) of the color for 'low' values. #' This color will be the first hex code of the sequence. diff --git a/R/ro_color_validate.R b/R/ro_color_validate.R index 7f9d316..99acca1 100644 --- a/R/ro_color_validate.R +++ b/R/ro_color_validate.R @@ -5,8 +5,8 @@ #' This function checks if each color in the provided vector is a valid hex color #' code in the format `#RRGGBB`. #' If any invalid color codes are found, an error message is triggered. -#' It is a helper function (not exported) used both in \link[ROvis]{ro_color_seq} and -#' \link[ROvis]{ro_show_colors} +#' It is a helper function (not exported) used both in \link{ro_color_seq} and +#' \link{ro_show_colors} #' #' @param colors A character vector of color codes to validate. #' diff --git a/R/ro_show_colors.R b/R/ro_show_colors.R index 0462045..f7f0ae2 100644 --- a/R/ro_show_colors.R +++ b/R/ro_show_colors.R @@ -1,6 +1,6 @@ #' Show RIVM color palette #' @section Dependencies: -#' * \link[ROvis]{ro_color_palette} +#' * \link{ro_color_palette} #' #' @description #' `r ro_group_badge(c('DT', 'echarts4r', 'ggplot2', 'gt', 'plotly'))` @@ -19,9 +19,9 @@ #' @param custom_colors Character or vector of characters. Should be hexadecimal code(s) (#RRGGBB). #' #' It is advised to use the other ROvis color functions. To access the hex color -#' code of a specific color, use the the ROvis function \link[ROvis]{ro_color}. +#' code of a specific color, use the \link{ro_color} function. #' To access a vector of hex color codes of the categorical palette, use the ROvis -#' function \link[ROvis]{ro_color_categorical}. +#' function \link{ro_color_categorical}. #' @family ggplot2 #' @examples #' \dontrun{ diff --git a/README.md b/README.md index 3524990..0f5b6e4 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# ROvis.utils - [![CI](https://img.shields.io/endpoint?url=https://rivm-syso.github.io/ROvis.utils/badges/ci.json)](https://github.com/rivm-syso/ROvis.utils/actions/workflows/ci.yaml) [![Lint](https://img.shields.io/endpoint?url=https://rivm-syso.github.io/ROvis.utils/badges/lint.json)](https://github.com/rivm-syso/ROvis.utils/actions/workflows/ci.yaml) [![Coverage](https://img.shields.io/endpoint?url=https://rivm-syso.github.io/ROvis.utils/badges/coverage.json)](https://github.com/rivm-syso/ROvis.utils/actions/workflows/ci.yaml) +# ROvis.utils + ## Rijksoverheid Visualisatie - utils ## Description @@ -20,26 +20,32 @@ ROvis.utils is an R package that provides a comprehensive suite of utilities for remotes::install_github("rivm-syso/ROvis.utils") ``` -For more information, check out the [wiki page about daratools](https://gitlab.rivm.nl/dara/wiki/-/wikis/DARAtools). +## Usage +```r +library(ROvis.utils) -## Usage -*Use examples liberally, and show the expected output if you can. It's helpful to have the smallest example of usage that you can demonstrate inline, while providing links to more sophisticated examples if they are too long to reasonably include in the README.* +# Get the hex code for a named RIVM color +ro_color("robijnrood") +#> [1] "#ca005d" + +# Get the full categorical color palette +ro_color_categorical() +``` ## Support -First point of contact for questions: ROvis team (spin@rivm.nl) +First point of contact for questions: SPIN team (spin@rivm.nl) ## Roadmap *If you have ideas for releases in the future, it is a good idea to list them in the README.* ## Contributing -*State if you are open to contributions and what your requirements are for accepting them.* +See [CONTRIBUTING.md](.github/CONTRIBUTING.md) for guidelines on how to contribute, and [CONTRIBUTORS.md](CONTRIBUTORS.md) for the list of contributors. ## Instructions for developers -Check out the [wiki page about r packages](https://gitlab.rivm.nl/dara/wiki/-/wikis/DARAtools) -for elaborate information about R package development. Below we describe the most important -guidelines and practicalities. +Below we describe the most important guidelines and practicalities for R package +development on this project. ### Requirements @@ -49,13 +55,13 @@ development to adhere to standards for R packages and make developing easier! In in your Rstudio environment: ```r -install.packages(testthat) -install.packages(lintr) -install.packages(roxygen2) -install.packages(quarto) -install.packages(pkgdown) -install.packages(devtools) -install.packages(usethis) +install.packages("testthat") +install.packages("lintr") +install.packages("roxygen2") +install.packages("quarto") +install.packages("pkgdown") +install.packages("devtools") +install.packages("usethis") ``` ### Guidelines @@ -68,11 +74,10 @@ To ensure code standardization and quality, follow these guidelines: the `min_version` argument to specify a minimum version. - Add a new function dependency to the NAMESPACE with `usethis::use_import_from()` - Add documentation to new functions by inserting a roxygen skeleton and use `devtools::document()` to -create automatic documentation in the `man` folder, for more information check out this -[wiki section](https://gitlab.rivm.nl/dara/wiki/-/wikis/Create%20your%20own%20R%20packages#documentation) +create automatic documentation in the `man` folder ## Authors and acknowledgment -This R packages was created by ROvis team (spin@rivm.nl). +This R package was created by the SPIN team (spin@rivm.nl). ## License -*For open source projects, indicate how it is licensed.* +This package is licensed under the Apache License 2.0. See [LICENSE.md](LICENSE.md) for details. diff --git a/man/ROvis.utils-package.Rd b/man/ROvis.utils-package.Rd index eeb7467..0250836 100644 --- a/man/ROvis.utils-package.Rd +++ b/man/ROvis.utils-package.Rd @@ -4,9 +4,11 @@ \name{ROvis.utils-package} \alias{ROvis.utils} \alias{ROvis.utils-package} -\title{ROvis.utils: Rijksoverheid Visualisatie - utils} +\title{ROvis.utils: Utilities for Rijksoverheid-Styled Data Visualizations} \description{ -ROvis.utils is an R package that provides a comprehensive suite of utilities for visualizing in Rijksoverheid style. +\if{html}{\figure{logo.png}{options: style='float: right' alt='logo' width='120'}} + +Provides shared utilities for the ROvis suite, including Rijksoverheid color palettes, palette validation, and font-availability checks, so that themes across the ROvis packages stay consistent with official Rijksoverheid design guidelines. } \author{ \strong{Maintainer}: ROvis team \email{spin@rivm.nl} diff --git a/man/figures/group-DT.svg b/man/figures/group-DT.svg new file mode 100644 index 0000000..3ff9324 --- /dev/null +++ b/man/figures/group-DT.svg @@ -0,0 +1,30 @@ + + ROvis: DT + + + + + + + + + + + + + + + + ROvis + + + + DT + + + + diff --git a/man/figures/group-echarts4r.svg b/man/figures/group-echarts4r.svg new file mode 100644 index 0000000..17acd78 --- /dev/null +++ b/man/figures/group-echarts4r.svg @@ -0,0 +1,30 @@ + + ROvis: echarts4r + + + + + + + + + + + + + + + + ROvis + + + + echarts4r + + + + diff --git a/man/figures/group-ggplot2.svg b/man/figures/group-ggplot2.svg new file mode 100644 index 0000000..abeeb25 --- /dev/null +++ b/man/figures/group-ggplot2.svg @@ -0,0 +1,30 @@ + + ROvis: ggplot2 + + + + + + + + + + + + + + + + ROvis + + + + ggplot2 + + + + diff --git a/man/figures/group-gt.svg b/man/figures/group-gt.svg new file mode 100644 index 0000000..58d8129 --- /dev/null +++ b/man/figures/group-gt.svg @@ -0,0 +1,30 @@ + + ROvis: gt + + + + + + + + + + + + + + + + ROvis + + + + gt + + + + diff --git a/man/figures/group-plotly.svg b/man/figures/group-plotly.svg new file mode 100644 index 0000000..fb44b86 --- /dev/null +++ b/man/figures/group-plotly.svg @@ -0,0 +1,30 @@ + + ROvis: plotly + + + + + + + + + + + + + + + + ROvis + + + + plotly + + + + diff --git a/man/ro_color.Rd b/man/ro_color.Rd index 06fbd74..0d438f8 100644 --- a/man/ro_color.Rd +++ b/man/ro_color.Rd @@ -25,11 +25,11 @@ returns the (array of) hex color code(s) Returns hex code(s) of color_name. All 18 RIVM colors and their lighter shades can be accessed with this function. The names of RIVM colors are listed at the rijkshuisstijl website, or, can be viewed by -running another ROvis function \link[ROvis]{ro_show_colors}. +running another function, \link{ro_show_colors}. To access a vector of hex color codes of the categorical palette, use the ROvis -function \link[ROvis]{ro_color_categorical}. +function \link{ro_color_categorical}. } \examples{ ro_color() diff --git a/man/ro_color_categorical.Rd b/man/ro_color_categorical.Rd index e13eb4e..0a62d0d 100644 --- a/man/ro_color_categorical.Rd +++ b/man/ro_color_categorical.Rd @@ -14,7 +14,7 @@ Returns a character vector of hex color codes of the categorical palette. Returns a vector of hex color codes of the categorical RIVM color palette. This is especially useful when you don't need to assign a specific color to a specific category. If you do, for example for male/female, we recommend to -assign the colors explicitly using the \link[ROvis]{ro_color} function. +assign the colors explicitly using the \link{ro_color} function. } \examples{ ro_color_categorical() diff --git a/man/ro_color_palette.Rd b/man/ro_color_palette.Rd index 815def0..d1814d8 100644 --- a/man/ro_color_palette.Rd +++ b/man/ro_color_palette.Rd @@ -25,7 +25,7 @@ named vector with hex color codes \section{Dependencies}{ \itemize{ -\item \link[ROvis]{ro_color} +\item \link{ro_color} } } diff --git a/man/ro_color_seq.Rd b/man/ro_color_seq.Rd index 5bf3788..659ec6b 100644 --- a/man/ro_color_seq.Rd +++ b/man/ro_color_seq.Rd @@ -26,7 +26,7 @@ length where these colors gradually fade into one another. This could be a transition from a light to a dark shade, or one color to a different color, see examples. Uses \code{pal_seq_gradient()} from the scales package under the hood. -To access the hex color code of a specific color, use the the ROvis function \link[ROvis]{ro_color}. +To access the hex color code of a specific color, use the \link{ro_color} function. } \examples{ ro_color_seq("#F7D9E7", "#CA005D", 5) diff --git a/man/ro_color_validate.Rd b/man/ro_color_validate.Rd index 96703ad..45cd88e 100644 --- a/man/ro_color_validate.Rd +++ b/man/ro_color_validate.Rd @@ -18,8 +18,8 @@ are valid. If any color code is invalid, an error is triggered. This function checks if each color in the provided vector is a valid hex color code in the format \verb{#RRGGBB}. If any invalid color codes are found, an error message is triggered. -It is a helper function (not exported) used both in \link[ROvis]{ro_color_seq} and -\link[ROvis]{ro_show_colors} +It is a helper function (not exported) used both in \link{ro_color_seq} and +\link{ro_show_colors} } \examples{ valid_colors <- c("#FF5733", "#33FF57", "#3357FF") diff --git a/man/ro_show_colors.Rd b/man/ro_show_colors.Rd index a6e51a9..a3fe21f 100644 --- a/man/ro_show_colors.Rd +++ b/man/ro_show_colors.Rd @@ -24,9 +24,9 @@ Can be one of: \item{custom_colors}{Character or vector of characters. Should be hexadecimal code(s) (#RRGGBB). It is advised to use the other ROvis color functions. To access the hex color -code of a specific color, use the the ROvis function \link[ROvis]{ro_color}. +code of a specific color, use the \link{ro_color} function. To access a vector of hex color codes of the categorical palette, use the ROvis -function \link[ROvis]{ro_color_categorical}.} +function \link{ro_color_categorical}.} } \value{ Color palette in the Viewer pane. @@ -39,7 +39,7 @@ Hoover over the palette to view the hex color codes. \section{Dependencies}{ \itemize{ -\item \link[ROvis]{ro_color_palette} +\item \link{ro_color_palette} } }