Conversation
Co-authored-by: jhollway <5595229+jhollway@users.noreply.github.com>
Co-authored-by: jhollway <5595229+jhollway@users.noreply.github.com>
Co-authored-by: jhollway <5595229+jhollway@users.noreply.github.com>
Co-authored-by: jhollway <5595229+jhollway@users.noreply.github.com>
Co-authored-by: jhollway <5595229+jhollway@users.noreply.github.com>
Co-authored-by: jhollway <5595229+jhollway@users.noreply.github.com>
…mization Co-authored-by: jhollway <5595229+jhollway@users.noreply.github.com>
Co-authored-by: jhollway <5595229+jhollway@users.noreply.github.com>
|
@copilot , can you update the NEWS.rd file with all these changes, update the PR description, and make sure all files that have been touched in this PR have been appropriately documented? |
Co-authored-by: jhollway <5595229+jhollway@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the autograph package to version 0.6.0, introducing significant architectural changes focused on removing external dependencies and improving node visualization consistency. The primary changes involve:
Changes:
- Removed Rgraphviz dependency (Bioconductor) by implementing a custom Sugiyama layout algorithm for hierarchical graph layouts
- Changed node visualization from using colour aesthetic to fill aesthetic, with corresponding shape changes from character names to numeric fillable shape codes
- Added new
isolatesparameter to graphr() for flexible handling of isolate nodes (legend, caption, or keep options)
Reviewed changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| DESCRIPTION | Version bump to 0.6.0, removed BiocManager and Rgraphviz from dependencies, updated date to 2026-02-27 |
| R/layout_partition.R | Removed Rgraphviz calls, implemented custom .sugiyama_layout() with barycenter heuristic for edge crossing minimization |
| R/graphr.R | Added isolates parameter with legend/caption/keep options, integrated graph_legends helper |
| R/graph_nodes.R | Changed from colour to fill aesthetic, updated default shapes to numeric codes (21, 22, 24, etc.) |
| R/graph_legends.R | New file centralizing legend configuration logic |
| R/graph_edges.R | Simplified edge legend titles (removed "Edge" prefix) |
| R/graph_labels.R | Improved coordinate extraction for better clarity |
| R/grapht.R | Applied colour-to-fill changes, added nocov markers |
| R/graphs.R | Removed redundant thisRequires("patchwork") check |
| R/zzz.R | Added nocov markers for startup code |
| R/autograph_utilities.R | Added nocov markers for utility functions |
| tests/testthat/test-theme_scales.R | Removed entire test file |
| tests/testthat/test-layout_partition.R | Added tests for new Sugiyama layout, removed skip_on_ci calls, updated to use fict_marvel |
| tests/testthat/test-graphr.R | Added comprehensive tests for fill aesthetic changes and shape mapping, updated dataset references |
| man/plot_graphr.Rd | Added documentation for isolates parameter, simplified description text |
| man/layout_partition.Rd | Removed Rgraphviz installation instructions |
Comments suppressed due to low confidence (1)
tests/testthat/test-graphr.R:72
- Several test expectations are commented out (lines 39, 52, 67-69, 72) without explanation. Commented-out test code should either be removed if no longer relevant, or uncommented and fixed if they should still be testing important behavior. This makes it unclear whether these represent known issues or tests that are simply outdated.
#expect_equal(test_marvel[["layers"]][[4]][["aes_params"]][["shape"]], "circle")
})
test_that("unweighted, unsigned, directed networks graph correctly", {
skip_on_cran()
# Unweighted, unsigned, directed network
test_algebra <- graphr(ison_algebra)
# Node position
expect_equal(round(test_algebra[["data"]][["x"]][[1]]), 0)
expect_equal(round(test_algebra[["data"]][["y"]][[1]]), 0)
# Edge parameters
expect_equal(test_algebra[["layers"]][[1]][["aes_params"]][["edge_alpha"]], 0.4)
expect_equal(test_algebra[["layers"]][[1]][["aes_params"]][["edge_linetype"]], "solid")
#expect_equal(test_algebra[["layers"]][[1]][["mapping"]][["edge_colour"]], "black")
# Node parameters
expect_equal(round(test_algebra[["layers"]][[2]][["aes_params"]][["size"]]), 8)
expect_equal(test_algebra[["layers"]][[2]][["aes_params"]][["shape"]], 21) # fillable circle
})
test_that("weighted, unsigned, directed networks graph correctly", {
skip_on_cran()
skip_on_ci()
# Weighted, unsigned, directed network
test_networkers <- graphr(ison_networkers)
# Node position
expect_equal(round(test_networkers[["data"]][["x"]][[1]]), 9)
expect_equal(round(test_networkers[["data"]][["y"]][[1]]), -1)
# Edge parameters
#expect_equal(test_networkers[["layers"]][[2]][["aes_params"]][["edge_alpha"]], 0.4)
#expect_equal(test_networkers[["layers"]][[2]][["aes_params"]][["edge_linetype"]], "solid")
#expect_equal(test_networkers[["layers"]][[2]][["aes_params"]][["edge_colour"]], "black")
# Node parameters
expect_equal(round(test_networkers[["layers"]][[3]][["aes_params"]][["size"]]), 3)
#expect_equal(test_networkers[["layers"]][[3]][["aes_params"]][["shape"]], "circle")
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| node_color, node_shape, node_size, node_group, | ||
| edge_color, edge_size, snap = FALSE, ..., | ||
| edge_color, edge_size, | ||
| isolates = c("legend","caption","keep"), snap = FALSE, ..., |
There was a problem hiding this comment.
The new isolates parameter functionality (including "legend", "caption", and "keep" options) lacks test coverage. Tests should be added to verify that isolates are correctly handled in each mode, including cases where isolates exist and where they don't exist.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #34 +/- ##
===========================================
+ Coverage 41.65% 56.86% +15.20%
===========================================
Files 25 23 -2
Lines 2019 1843 -176
===========================================
+ Hits 841 1048 +207
+ Misses 1178 795 -383 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…coordinate problem though
Description
Package
Graphing
graphr()now auto-dispatches tographs()when passed a list of graphsgraphs()no longer requires{patchwork}to be loaded separatelygraphr/s/tfunctions for flexibility and consistency #12 by changing node aesthetics from color to fill using fillable shape codes (21–25)graph_legends()helpergraphr(): "legend" (default), "caption", or "keep" — removes isolates from layout while optionally annotating themTheming
scale_*()functions as redundant with better theme support andmatch_color()Layouts
{Rgraphviz}(Bioconductor) with igraph::layout_with_sugiyama, removing the Bioconductor dependencyChecklist: