Skip to content

Aesthetics: update plots look and feel for consistency#132

Merged
martinctc merged 59 commits into
mainfrom
feature/visual-improvements
May 11, 2021
Merged

Aesthetics: update plots look and feel for consistency#132
martinctc merged 59 commits into
mainfrom
feature/visual-improvements

Conversation

@moralec

@moralec moralec commented Apr 15, 2021

Copy link
Copy Markdown
Contributor

Summary

This branch updates functions create_bar(), create_stacked(), and create_dist() to improve consistent look and feel and behaviours. This version is the last pull request to the main branch before submission to CRAN for v1.5.0.

Changes

The changes made in this PR are:

  1. Refactored create_bar() to depend on create_stacked().
  2. Changes to create_bar() and create_stacked()
    • Added a rank argument that enables bars to be ranked in descending, ascending, or 'free' order.
    • Added a percent argument to enable the display of data labels and axis labels in percentages.
    • Added xlim as an argument to set the maximum value in the horizontal axis.
  3. Better handling of minimum and maximum bounds for create_dist(). Also solves issue mentioned in Bug: update one to one frequency distribution buckets #114 for one2one_freq().
  4. Update check_query() to print single-value HR attributes as a string (previously this depends only on the Domain variable being present in the dataset.
  5. Updated pull request template to update NEWS.md.
  6. Added a link to the Microsoft Learn module to README.md and the Additional resources section of the Analyst Guide.
  7. A new function hrvar_trend() is added which shows a heatmapped view of the number of employees grouped by HR attribute. A new argument legend_title is added to the underlying function create_trend().
  8. New abbreviated groups are added to the outputs of workingpatterns_classify().

Some documentation clean-up and spellchecks have also been conducted in preparation for the CRAN submission.

Highlights

  • Same format for axis
  • Same format for titles and subtitles
  • Same size of side panel for number of observations per row
  • Option to modify titles in create_bar, as it was was possible in create_stacked
  • Legends always present

Examples

New consistent formats

image

Ordering functionality

create_bar(
  sq_data,
  metric = "Email_hours",
  rank = "ascending"
)

image

create_bar(
  sq_data,
  metric = "Email_hours",
  rank = "descending"
)

image

create_bar(
  sq_data,
  metric = "Email_hours",
  rank = NULL
)

image

Checks

  • All R CMD checks pass
  • roxygen2::roxygenise() has been run prior to merging to ensure that .Rd and NAMESPACE files are up to date.
  • NEWS.md has been updated.

@moralec moralec requested a review from martinctc April 15, 2021 13:43
@martinctc martinctc changed the title Updated plots look and feel for consistency Aesthetics: update plots look and feel for consistency Apr 16, 2021
@martinctc martinctc added the aesthetics Stylistic changes that do not affect logic label Apr 16, 2021
martinctc and others added 24 commits April 16, 2021 11:24
Implemented for both `create_bar()` and `create_stacked()`
Previously, `cut_hour()` could accept inputs in `cut` where it equals 0 or 100. Now, a `lbound` and `ubound` solution is added to address these corner cases.
Works for both plots and tables
Accepts both character and function
Now combined "Never" with "Quarterly or less", and uses arbitrary large number for defining "Never"
Fixed validation report so that the Attributes Available table also shows those attributes with a single item
Added text to show unique identifiers of the query
@martinctc martinctc linked an issue May 10, 2021 that may be closed by this pull request
@martinctc martinctc added the enhancement New feature or request label May 10, 2021
@martinctc martinctc merged commit 4e316d4 into main May 11, 2021
@martinctc martinctc deleted the feature/visual-improvements branch May 11, 2021 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aesthetics Stylistic changes that do not affect logic bug Something isn't working enhancement New feature or request refactor Code that neither fixes a bug nor changes feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: update one to one frequency distribution buckets

2 participants