Skip to content

Enhance flowchart and grob functionalities with documentation updates#70

Merged
gforge merged 30 commits into
masterfrom
develop
May 30, 2026
Merged

Enhance flowchart and grob functionalities with documentation updates#70
gforge merged 30 commits into
masterfrom
develop

Conversation

@gforge
Copy link
Copy Markdown
Owner

@gforge gforge commented May 30, 2026

This pull request introduces significant enhancements and maintenance updates to the Gmisc R package, focusing on improved flowchart and box layout features, expanded documentation and testing, and better project infrastructure. The most notable changes include the addition of new API functions for box width equalization and header boxes, deep-path support for alignment and movement helpers, new and updated documentation (including project-specific AI agent instructions), and improvements to CI/CD and code linting configuration.

Key changes:

New Features & API Enhancements

  • Added equalizeWidths() to allow selected boxes (including nested or grouped boxes) to share a common width while maintaining their center positions; includes support for deep subelement and list-of-boxes targets. (F46cb217L4R4)
  • Introduced boxHeaderGrob() for creating flowchart boxes with a distinct header and body layout, compatible with all flowchart helpers. (F46cb217L13R13, NAMESPACER62-R67)
  • Added txt_padding argument to boxGrob() and support for a global default via options(boxGrobTxtPadding = ...). (F46cb217L5R5)

Improved Alignment, Spreading, and Movement

  • Extended alignVertical, alignHorizontal, spreadVertical, spreadHorizontal, and moveBox to support deep-path and multiple-target subelement/reference arguments, enabling nested selection and assignment within box lists. (F46cb217L14R14)
  • Fixed resolution of nested targets when a list of boxes is piped into alignment or spreading helpers with a named reference argument. (F46cb217L18R18)
  • Enhanced connector strategies to automatically target the first box within container-like inputs for many-to-one connectors. (F46cb217L20R20)

Documentation, Testing, and Examples

  • Expanded the flowchart vignette with grouped CONSORT-style examples demonstrating new features. (F46cb217L7R7)
  • Added and updated tests for new behaviors, including tests/testthat/test-equalizeWidths.R and tests/testthat/test-boxGrob-padding-option.R. (F46cb217L8R8)
  • Updated package documentation and examples to reflect new APIs and behaviors. (F46cb217L9R9, F46cb217L15R15)

Project Infrastructure & Maintenance

  • Added a comprehensive .github/copilot-instructions.md with project-specific conventions, architecture, and AI agent guidance.
  • Introduced a GitHub Actions workflow (.github/workflows/ci.yaml) for automated R CMD check, linting, test coverage, and documentation site builds.
  • Updated .Rbuildignore to exclude new generated artifacts (e.g., visual test outputs, HTML/CSS in inst/extdata/). [1] [2]
  • Relaxed and adjusted code linting rules in .lintr (e.g., longer line/object lengths, disabled some linters for flexibility).

Versioning and Metadata

  • Bumped package version to 3.3.0 in DESCRIPTION and CRAN-SUBMISSION; updated maintainer info with ORCID. [1] [2]
  • Updated NAMESPACE to export new S3 methods and functions, including equalizeWidths, boxHeaderGrob, flowchart, align, append, connect, insert, move, and spread. [1] [2] [3] [4] [5] [6] [7]

These changes collectively deliver major improvements to the package's functionality, usability, and maintainability.

gforge added 28 commits January 17, 2026 15:09
- Updated .Rbuildignore to exclude docs directory.
- Added CI workflow for R-CMD-check in GitHub Actions.
- Modified DESCRIPTION file to reorder and add package dependencies.
- Improved parameter documentation in boxGrobs_align.R and boxGrobs_connect.R.
- Refactored validation logic in boxGrobs_align_pr_helpers.R for better error handling.
- Updated examples and documentation to reflect parameter name changes from .sub_position to sub_position.
- Added new tests for performance and deprecated functions.
- Enhanced vignettes with updated examples and corrected parameter usage.
… S3 method registration

- add equalizeWidths() for grouped/nested flowchart boxes
- add boxGrob txt_padding argument and global option boxGrobTxtPadding
add vignette example showing grouped width alignment and global text padding
- add tests for equalizeWidths and box padding option
update NEWS for 3.3.0
- register prCalculateConnector S3 methods to silence roxygen warnings and regenerate docs
…th corner options; update documentation and remove obsolete SVG test files
…list references; add tests for validation

Fixes issue #69
Copilot AI review requested due to automatic review settings May 30, 2026 08:12
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the Gmisc R package’s flowchart/box-layout tooling and documentation, while also expanding the test suite (including visual regression coverage) and updating release metadata.

Changes:

  • Added/expanded flowchart helpers (notably deep-path subelement support and width/box sizing behavior) and associated internal utilities.
  • Expanded automated tests, including new unit tests for helpers and optional vdiffr visual regression tests.
  • Updated vignettes and release metadata/notes with various corrections.

Reviewed changes

Copilot reviewed 145 out of 146 changed files in this pull request and generated 45 comments.

Show a summary per file
File Description
R/boxGrobs_move.R Updates moveBox() for nested/deep-path targets (but currently contains a duplicate/stub definition that must be fixed).
R/boxGrobs_distance.R Updates distance calculations (but currently assigns converter_fn via ifelse(), which breaks at runtime).
R/boxGrobs_boxPropGrob.R Adjusts label sizing/measurement logic (but currently mixes width/height conversion for label height).
R/boxGrobs_spread_npc_norm_helpers.R Adds axis default/normalization helpers (has a duplicated roxygen title line affecting generated Rd).
CRAN-SUBMISSION Updates release submission metadata (version currently mismatches DESCRIPTION).
NEWS.md Updates release notes (has a stray trailing fragment line to remove).
vignettes/transitionPlot.Rmd Minor vignette text correction.
vignettes/Transition-class.Rmd Minor vignette text updates (has a stray trailing backtick to remove).
vignettes/Descriptives.Rmd Minor vignette text updates (includes a remaining grammar issue on an edited line).
tests/visual_tests/flow-chart.R Adds a manual visual test script for flowcharts.
tests/testthat/test-yaml_hmisc_helpers.R Adds tests for YAML dump and Hmisc label/unit helpers.
tests/testthat/test-vdiffr.R Adds optional vdiffr visual regression test for boxGrob.
tests/testthat/test-vdiffr-connect.R Adds optional vdiffr visual regression test for connectors.
tests/testthat/test-transitionPlot.R Adds basic functionality/error-path tests for transitionPlot().
tests/testthat/test-spread-move-deep-path.R Adds tests for deep-path spread*/moveBox() behaviors and nested list preservation.
tests/testthat/test-spread-horiz-endpoint.R Adds regression coverage for numeric endpoints + subelement selection.
tests/testthat/test-setConnectorLabels.R Updates tests to new argument names for spreadHorizontal().
tests/testthat/test-labelConnector.R Updates tests to new argument names for spreadHorizontal().
tests/testthat/test-prLineMidpoint.R Adds tests for midpoint helper return types/values.
tests/testthat/test-prIsNestedListHelpers.R Adds tests for nested list detection helpers.
tests/testthat/test-print-Gmisc_list_of_boxes.R Adds coverage for printing nested plain lists of boxes.
tests/testthat/test-prGetNpcValue.R Adds tests for npc conversion helper behavior.
tests/testthat/test-prGetNpcSize.R Adds tests for npc size conversion helper behavior.
tests/testthat/test-prFindSubelementTarget.R Adds tests for subelement target resolution.
tests/testthat/test-prAddEmptyVals.R Adds tests for helper ordering/NA handling behavior.
tests/testthat/test-docx_document.R Updates/extends fixture-based testing (currently contains a JS typo in the fixture that should be corrected).
Comments suppressed due to low confidence (6)

NEWS.md:554

  • NEWS.md has a stray trailing line `plot2`` which looks like an accidental fragment and should be removed to keep release notes clean.
- Fixed a few bugs to the `forestplot2`
plot2`

NEWS.md:554

  • NEWS.md has a stray trailing line `plot2`` which looks like an accidental fragment and should be removed to keep release notes clean.
- Fixed a few bugs to the `forestplot2`
plot2`

NEWS.md:554

  • NEWS.md has a stray trailing line `plot2`` which looks like an accidental fragment and should be removed to keep release notes clean.
- Fixed a few bugs to the `forestplot2`
plot2`

NEWS.md:554

  • NEWS.md has a stray trailing line `plot2`` which looks like an accidental fragment and should be removed to keep release notes clean.
- Fixed a few bugs to the `forestplot2`
plot2`

NEWS.md:554

  • NEWS.md has a stray trailing line `plot2`` which looks like an accidental fragment and should be removed to keep release notes clean.
- Fixed a few bugs to the `forestplot2`
plot2`

NEWS.md:554

  • NEWS.md has a stray trailing line `plot2`` which looks like an accidental fragment and should be removed to keep release notes clean.
- Fixed a few bugs to the `forestplot2`
plot2`


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread R/boxGrobs_move.R Outdated
Comment thread R/boxGrobs_distance.R Outdated
Comment thread R/boxGrobs_boxPropGrob.R Outdated
Comment thread tests/testthat/test-docx_document.R
Comment thread CRAN-SUBMISSION Outdated
Comment thread vignettes/Transition-class.Rmd Outdated
Comment thread NEWS.md Outdated
Comment thread CRAN-SUBMISSION Outdated
Comment thread R/boxGrobs_spread_npc_norm_helpers.R Outdated
Comment thread vignettes/Descriptives.Rmd Outdated
gforge added 2 commits May 30, 2026 13:24
…ropGrob; improve distance function logic; clean up moveBox function; refine documentation and examples in vignettes
Copy link
Copy Markdown
Owner Author

@gforge gforge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@gforge gforge merged commit 5a03410 into master May 30, 2026
1 check failed
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