Skip to content

v1.0.0#42

Merged
jhollway merged 29 commits intomainfrom
develop
Apr 4, 2026
Merged

v1.0.0#42
jhollway merged 29 commits intomainfrom
develop

Conversation

@jhollway
Copy link
Copy Markdown
Contributor

@jhollway jhollway commented Mar 15, 2026

Description

Package

  • Updated startup message to declare the set theme

Graphing

Plotting

Tutorial

Checklist:

  • Documentation
    • DESCRIPTION file version is bumped by the appropriate increment (major, minor, patch)
    • Date in DESCRIPTION is correct
    • Longer functions are commented inline or broken down into helper functions to help debugging
  • PR form
    • Title indicates expected version number
    • PR description above and the NEWS.md file are aligned
    • Description above itemizes changes under subsection titles, e.g. "## Data""
    • Closed, fixed, or related issues are referenced and explained in the description above, e.g. "Fixed #0 by adding A"

Copilot AI review requested due to automatic review settings March 15, 2026 16:35
@jhollway
Copy link
Copy Markdown
Contributor Author

@copilot can you please update the NEWS.md based on changes in this PR?

Copilot AI mentioned this pull request Mar 15, 2026
7 tasks
Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 15, 2026

@jhollway I've opened a new pull request, #43, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: jhollway <5595229+jhollway@users.noreply.github.com>
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 appears to cut a v1.0.0 release by bumping package metadata and aligning plots/docs/tests with updated dependencies and theming behavior (notably moving several plotting helpers into a new analysis-focused file and updating examples to use {netrics} APIs).

Changes:

  • Bump package version/date to 1.0.0 and add {netrics} to Suggests.
  • Refactor plotting code by moving measure/membership/motif plotting methods into R/plot_analysis.R and updating related .Rd sources.
  • Improve theming/font consistency across multiple plot methods and update tutorials/examples to use the correct ggplot2 aesthetics (fill).

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/testthat/test-plot_manynet.R Update plotting tests to use {netrics} measure functions.
man/theme_set.Rd Update examples to use {netrics} and adjust theme example.
man/plot_graphr.Rd Update example to reference netrics::node_is_cutpoint().
man/plot.network_test.Rd Update roxygen “Please edit documentation in …” source pointer.
man/plot.diffusion.Rd Update roxygen “Please edit documentation in …” source pointer.
man/model_mrqap.Rd Update roxygen “Please edit documentation in …” source pointer.
man/map_motifs.Rd Update roxygen “Please edit documentation in …” source pointer.
man/map_member.Rd Update examples to use {netrics} community output.
man/map_measure.Rd Update examples to use {netrics} measure functions.
inst/tutorials/tutorial2/visualisation.Rmd Clarify that node color maps to fill; switch to scale_fill_*() examples.
R/zzz.R Adjust startup message to report stocnet_theme option.
R/theme_set.R Update examples to use {netrics} and change theme shown.
R/plot_tests.R Apply ag_font() via base_family in ggplot2 themes for test plots.
R/plot_summaries.R Remove measure/membership/motif plotting code (moved to plot_analysis).
R/plot_interp.R Standardize theme option key (stocnet_theme) and set font via theme text element.
R/plot_gof.R Adjust GOF plotting label handling and title construction; tweak messaging.
R/plot_analysis.R New file containing measure/membership/motif plot methods previously in plot_summaries.
R/grapht.R Switch isolate detection to internal helper.
R/graphr.R Add internal .node_is_isolate() helper and use it in isolate handling.
R/graph_nodes.R Add internal adoption-time helper and expand shape scale values.
R/autograph-package.R Add additional globals used by new adoption-time helper.
DESCRIPTION Bump to 1.0.0 / update date; add {netrics} to Suggests.
Comments suppressed due to low confidence (1)

R/plot_gof.R:176

  • plot.sienaGOF() references period but it is not defined in the function or derived from ..., so this will error when attr(x, "joined") is FALSE. Define a default period (e.g., 1) and/or accept period as an argument (pulled from list(...)) before using it.
  if (is.null(args$main)) {
    statName <- tolower(add_spaces(attr(x, "auxiliaryStatisticName")))
    main <- paste("Goodness of fit of", statName)
    if (!attr(x, "joined")) {
      main <- paste(main, "Period", period)
    }
  } else {
    main = args$main
  }
  if (attr(x, "joined")) {
    x <- x[[1]]
  } else {
    x <- x[[period]]
  }

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

Comment thread R/zzz.R
snet_info("You are using {.pkg autograph} version {.version {local_version}}.")
old.list <- as.data.frame(utils::old.packages())
behind_cran <- "autograph" %in% old.list$Package
curr_theme <- getOption('stocnet_theme')
Comment thread R/plot_gof.R
plot.ag_gof <- function(x, ...){
obs <- x[[1]]
sims <- x[[2]]
if(all(!is.na(suppressWarnings(as.numeric(sims$name))))){
Comment thread R/plot_analysis.R
Comment on lines +292 to +321
if (!is.null(membership))
if(!is.numeric(membership)) membership <- as.numeric(as.factor(membership))
g <- g + ggplot2::geom_vline(
xintercept = c(1 + which(diff(membership[order(membership)]) != 0)) - .5,
colour = ag_highlight()
) +
ggplot2::geom_hline(
yintercept = nrow(blocked_data) -
c(1 + which(diff(membership[order(membership)]) != 0)) + 1.5,
colour = ag_highlight()
)
} else {
group_boundaries <- diff(as.numeric(factor(membership[order(membership)])))
g <- g +
ggplot2::scale_y_discrete(expand = c(0, 0),
limits = rev(rownames(blocked_data))
) +
ggplot2::scale_x_discrete(expand = c(0, 0), position = "top",
limits = colnames(blocked_data)
) +
ggplot2::geom_vline(
xintercept =
c(1 + which(group_boundaries != 0)) - .5,
colour = ag_positive()
) +
ggplot2::geom_hline(
yintercept = nrow(blocked_data) -
c(1 + which(group_boundaries != 0)) + 1.5,
colour = ag_negative()
)
Comment thread R/plot_analysis.R
Comment on lines +9 to +10
#' These functions plot distributions for node, tie, and network measures,
#' as defined in the `{manynet}` package.
Comment thread R/graph_nodes.R
Comment on lines +182 to +185
p <- p + ggplot2::scale_shape_manual(values = c(21, 22, 24, 23, 25,
3, 4, 8,
10, 12, 9,
13, 7, 11, 14))
Comment on lines 5 to 12
test_that("plotting node measures works", {
p <- plot(manynet::node_deg(ison_dolphins))
p <- plot(netrics::node_by_deg(ison_dolphins))
expect_s3_class(p, "ggplot")
})

test_that("plotting tie measures works", {
p <- plot(manynet::tie_betweenness(ison_dolphins))
p <- plot(netrics::tie_by_betweenness(ison_dolphins))
expect_s3_class(p, "ggplot")
jhollway and others added 10 commits March 23, 2026 10:05
When both node_color and node_shape are mapped, ggplot2 creates separate
legends. The fill legend defaults to shape 19 (solid circle) which uses
the 'colour' aesthetic instead of 'fill', making all legend points black.

Adding override.aes = list(shape = 21) ensures the fill legend always
uses a fillable shape so the mapped colors are visible.

Co-authored-by: jhollway <5595229+jhollway@users.noreply.github.com>
Agent-Logs-Url: https://github.com/stocnet/autograph/sessions/6d9ee1a4-5535-480a-be4a-45aee4c7b3c7
…toring until after filtering

Co-authored-by: jhollway <5595229+jhollway@users.noreply.github.com>
Agent-Logs-Url: https://github.com/stocnet/autograph/sessions/3d6b251d-4950-4ebc-8306-38fbab33d487
Copilot AI and others added 4 commits March 31, 2026 15:40
- Return ggplot2+gganimate object instead of rendered gif (#17)
- Add print.grapht() S3 method for automatic animation
- Use fill aesthetic, same palettes, and ag_font() like graphr()
- Convert list elements to tidygraph for S4 compatibility (#40)
- Add label_dist parameter to graphr() and graph_labels() (#52)
- Improve concentric label placement with point.padding (#10)
- Update documentation for graphr, grapht, and graph_labels"

Agent-Logs-Url: https://github.com/stocnet/autograph/sessions/72251800-fba5-427c-bf1a-63b9f2c9a960

Co-authored-by: jhollway <5595229+jhollway@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 4, 2026

Codecov Report

❌ Patch coverage is 30.92105% with 210 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.30%. Comparing base (14de555) to head (d330755).
⚠️ Report is 30 commits behind head on main.

Files with missing lines Patch % Lines
R/plot_analysis.R 17.48% 151 Missing ⚠️
R/graph_nodes.R 10.52% 34 Missing ⚠️
R/plot_gof.R 53.19% 22 Missing ⚠️
R/graph_labels.R 92.30% 1 Missing ⚠️
R/graphr.R 90.90% 1 Missing ⚠️
R/plot_tests.R 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #42      +/-   ##
==========================================
- Coverage   56.86%   56.30%   -0.57%     
==========================================
  Files          23       24       +1     
  Lines        1843     1920      +77     
==========================================
+ Hits         1048     1081      +33     
- Misses        795      839      +44     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jhollway jhollway merged commit d4e9e3c into main Apr 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment