Skip to content

Improve autoplot for when dealing with many unique keys + heatmap#693

Open
JavierMtzRdz wants to merge 92 commits intodevfrom
jmr/mult-plot
Open

Improve autoplot for when dealing with many unique keys + heatmap#693
JavierMtzRdz wants to merge 92 commits intodevfrom
jmr/mult-plot

Conversation

@JavierMtzRdz
Copy link
Copy Markdown
Contributor

@JavierMtzRdz JavierMtzRdz commented Mar 3, 2026

Checklist

Please:

  • Make sure this PR is against "dev", not "main" (unless this is a release
    PR).
  • Request a review from one of the current main reviewers:
    brookslogan, nmdefries.
  • Makes sure to bump the version number in DESCRIPTION. Always increment
    the patch version number (the third number), unless you are making a
    release PR from dev to main, in which case increment the minor version
    number (the second number).
  • Describe changes made in NEWS.md, making sure breaking changes
    (backwards-incompatible changes to the documented interface) are noted.
    Collect the changes under the next release number (e.g. if you are on
    1.7.2, then write your changes under the 1.8 heading).
  • Styling and documentation checks. Make a PR comment with:
    • /style to check the style and fix any issues.
    • /document to check the package documentation and fix any issues.
    • /preview-docs to preview the docs.
    • See Actions GitHub tab to track progress of these commands.
  • See DEVELOPMENT.md for more information on the development
    process.

Improve autoplot for when dealing with many unique keys

This PR improves the usability and performance of autoplot() when handling many distinct key combinations. It introduces automatic subsampling for static plots and an interactive dropdown interface for easier exploration.

Static plots for epi_df with many keys now automatically subsample to 10 unique keys by default. This prevents the plot from becoming unreadable. When subsampling occurs, a warning is issued with suggestions for .max_keys = Inf, interactive = TRUE, or .facet_filter.

Added the interactive parameter to support plotly plots. In this scenario, faceted epi_df and epi_archive plots use dropdown menus.

I also included the heatmap function we previously discussed.

Some examples below.
reprex_pr_explanation.html

Magic GitHub syntax to mark associated Issue(s) as resolved when this is merged into the default branch

  • Resolves #{issue number}

@JavierMtzRdz JavierMtzRdz requested a review from brookslogan March 3, 2026 00:00
@JavierMtzRdz JavierMtzRdz marked this pull request as ready for review March 3, 2026 00:52
@JavierMtzRdz JavierMtzRdz changed the title Improve autoplot for when dealing with many unique keys Improve autoplot for when dealing with many unique keys + heatmap Mar 4, 2026
@JavierMtzRdz
Copy link
Copy Markdown
Contributor Author

Before reviewing this PR, it would be helpful to review #694. That PR automated pivoting for long-format data with as_epi_* and improved response selection in autoplot. I directed #694 to this branch to avoid issues when merging into dev.

It seems useful/common enough that we should not have a hiccup
requiring user to go back and install plotly.
And add lines in examples so that paragraph-chunk-eval will actually
let user look at each one.
…ot all numeric columns by default, and standardize values in `plot_heatmap` for multiple variables.
… create specific pivot functions for epi_df and epi_archive
…d create specific pivot functions for epi_df and epi_archive
JavierMtzRdz and others added 4 commits March 30, 2026 13:40
The results were still probably valid and converting is slower, but we
don't want any surprises.
Automated pivoting for long-format data with `as_epi_*` and enhanced response selection in `autoplot`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants