Skip to content

Conversation

@jiajic
Copy link
Member

@jiajic jiajic commented Nov 19, 2025

Summary by CodeRabbit

  • New Features

    • Previously internal plotting helper is now publicly available.
    • New show_axes option to toggle axis display across spatial plotting functions.
    • Package version bumped to 0.2.14.
  • Bug Fixes

    • Restored correct handling of coord_fix_ratio = TRUE after plotting library updates.
  • Changes

    • Minimum required R version bumped to 4.5.0.
    • Renamed a parameter in the spatial in‑situ points plotting API (breaking change).

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 19, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Bumps package to 0.2.14 and R >= 4.5.0, exports aes_string2, adds show_axes across spatial plotting APIs, centralizes axis/aspect handling via .theme_remove_axes() and .aspect_ratio(), refactors spatInSituPlotPoints into per-element helpers with ordered assembly, plus docs/formatting edits.

Changes

Cohort / File(s) Summary
Package metadata & exports
DESCRIPTION, NAMESPACE, NEWS.md
Version -> 0.2.14; R (>= 4.5.0) required; aes_string2 exported; release notes updated.
Exported helper promotion
R/aux_visuals.R, man/aes_string2.Rd
aes_string2 annotated @export; Rd internal keyword removed; implementation/signature unchanged.
Axis & aspect helpers
R/aux_visuals.R, R/gg_settings.R
Added .aspect_ratio() (treats coord_fix_ratio = TRUE as 1 then applies coord_fixed) and .theme_remove_axes() (removes axes/ticks/titles/borders).
Spatial plotting — gg-based
R/vis_spatial_gg.R, man/spatPlot.Rd, man/spatFeatPlot2D.Rd, man/spatFeatPlot2D_single.Rd, man/dot-spatPlot2D_single.Rd, ...
New show_axes parameter added to multiple spatial plotting functions; plots use centralized .theme_remove_axes() and .aspect_ratio(); docs updated.
Spatial in-situ plotting refactor
R/vis_spatial_in_situ.R, man/spatInSituPlotPoints.Rd
spatInSituPlotPoints renamed parameter spat_enr_namesspat_enr_name and added show_axes; plotting refactored to plot_order with helpers (.sissp_image, .sissp_polygon, .sissp_points); axis/aspect centralized.
Color handling change
R/gg_info_layers.R
Removed oob-squish clamping of numeric color values to gradient_limits when color_as_factor = FALSE.
Output/instructions & minor formatting
R/aux_output.R, R/aux_defaults.R, R/gg_annotation_raster.R, R/gg_param.R, R/plot_dotplot.R, R/plot_ridge.R, R/plot_sankey.R
Mostly formatting and roxygen/doc tweaks; some readGiottoInstructions(...) argument layout changes and replacements with instructions(gobject, ...) in places.
Documentation updates
many man/*.Rd (e.g., man/combine_aes.Rd, man/ridgePlot.Rd, man/spatDeconvPlot.Rd, man/spatDimPlot.Rd, man/gg_param.Rd, man/plot_params.Rd, ...)
Added/updated show_axes docs where applicable; removed spat_enr_names docs; multiple description wraps and example formatting adjustments.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant U as User
    participant API as spatInSituPlotPoints
    participant PL as Plot Assembler
    participant IMG as .sissp_image
    participant POL as .sissp_polygon
    participant PTS as .sissp_points
    participant THEME as .theme_remove_axes
    participant ASPECT as .aspect_ratio

    U->>API: call spatInSituPlotPoints(..., spat_enr_name, show_axes)
    API->>PL: compute plot_order & prepare args
    PL->>IMG: add image layer (if present)
    PL->>POL: add polygon layer (if present)
    PL->>PTS: add points layer (if present)
    PL->>THEME: if show_axes == FALSE -> remove axes
    PL->>ASPECT: apply aspect ratio handling
    PL->>API: return assembled ggplot
    API-->>U: ggplot object
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas needing extra attention:
    • R/vis_spatial_in_situ.R — ensure plotting order/refactor preserves prior visual results and the spat_enr_name rename is consistent across callers/docs.
    • R/aux_visuals.R & R/gg_settings.R — verify .aspect_ratio() and .theme_remove_axes() behavior matches previous coord/axis semantics.
    • R/gg_info_layers.R — validate removal of numeric color clamping is intentional and acceptable for edge cases.
    • NAMESPACE / man files — confirm aes_string2 export and Rd edits align.

Possibly related PRs

  • GiottoVisuals v0.2.13 #114 — Prior work touching aes_string2 implementation/visibility; closely related to this PR's promotion/export of aes_string2.

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'GiottoVisuals 0.2.14' is vague and generic, serving only as a version identifier without describing the actual changes or improvements in the pull request. Consider using a more descriptive title that highlights the main changes, such as 'Add show_axes parameter and fix coord_fix_ratio handling' or 'GiottoVisuals 0.2.14: improve axis control and coordinate fixing'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 81f12ab and 76b42cf.

📒 Files selected for processing (1)
  • R/vis_spatial_in_situ.R (10 hunks)

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
man/ridgePlot.Rd (1)

98-100: Parameter name mismatch: scale_axis vs axis_scale

The usage block defines scale_axis, but the argument section documents axis_scale. This inconsistency can confuse users and tools relying on docs. Please align the argument name in the \item{} block with the actual parameter (scale_axis) and regenerate the Rd.

R/gg_annotation_raster.R (1)

136-155: Name collision between ext argument and ext() function will cause runtime error in default case

The parameter ext = NULL shadows the ext() function from terra. When .guess_plot_extent() is called without an ext argument (the default), control reaches line 145 and attempts to call ext(gobject, ...) where ext resolves to the NULL parameter, not the global function.

Per R's scoping rules, parameter names unconditionally mask identically named objects in outer scopes, and the actual call site at R/gg_info_layers.R:1473 does not supply an ext argument, confirming this code path is exercised.

The fix is to namespace the ext() function calls explicitly:

 .guess_plot_extent <- function(
         gobject, spat_unit = NULL, spat_loc_name = NULL, ext = NULL, ...) {
-    if (!is.null(ext)) ext <- ext(ext) # normalize to `SpatExtent` class
+    if (!is.null(ext)) ext <- terra::ext(ext) # normalize to `SpatExtent` class
     # if ext already given, directly return
     if (inherits(ext, "SpatExtent")) {
         return(ext)
     }
 
     # find extent from one of poly, spatlocs, points, in that order of pref
-    e <- ext(
+    e <- terra::ext(
         gobject,
         spat_unit = spat_unit,
         all_data = FALSE,
         verbose = FALSE,
         name = list(spatlocs = spat_loc_name),
         ...
     )
man/spatInSituPlotPoints.Rd (1)

216-223: Fix example argument name

The examples still pass spat_enr_names, but the function now accepts spat_enr_name. Running this example will throw unused argument 'spat_enr_names'. Please update the example call to match the new argument name.

-    spat_enr_names = "cluster_metagene",
+    spat_enr_name = "cluster_metagene",
R/vis_spatial_in_situ.R (1)

79-87: Example still uses spat_enr_names while the argument is now spat_enr_name

The public signature of spatInSituPlotPoints() takes spat_enr_name (Line 120), but the example above still calls the function with spat_enr_names = "cluster_metagene" (Lines 79–87). That mismatch will cause an “unused argument spat_enr_names” error when running examples.

Please update the example (and any other user-facing docs) to use spat_enr_name so that examples remain runnable and consistent with the API.

Also applies to: 120-121

🧹 Nitpick comments (9)
DESCRIPTION (1)

3-3: R version bump is correct, but CI runner must be updated

Requiring R (>= 4.5.0) is consistent with the 0.2.14 bump, but the current R-CMD-check job runs R 4.4.3, so installation fails before checks run. Consider updating the Actions workflow (or Bioc config) to use an R 4.5.x image so this PR can go green without loosening the dependency.

Also applies to: 26-26

R/aux_defaults.R (1)

429-431: Refactor of gradient helpers is formatting-only

The multi-line signatures for .evaluate_color_gradient_divergent() and .evaluate_color_gradient_sequential() preserve argument order and are called with named parameters, so there’s no behavioral change—just improved readability.

Also applies to: 476-478

man/spatDeconvPlot.Rd (1)

65-66: Minor wording nit in pie_scale description

To avoid the “mapping exists” grammar hiccup, consider rephrasing as e.g. “amount to scale the pie size if no radius mapping exists”. Purely a doc polish; behavior is unaffected.

man/spatDimPlot.Rd (1)

195-196: Rd line-wrapping changes only; semantics unchanged

The new line breaks for spat_center_point_border_stroke and dim_background_color keep the same parameter meaning and just improve readability. If you touch this file again, you might consider correcting “border strike size” → “border stroke size”, but that’s purely editorial.

Also applies to: 243-244

R/aux_output.R (1)

78-107: Commented-out helper and #. marker can be cleaned up or removed

The modified plot_output_handler_read() block is entirely commented out, and the #. prefix on continuation lines (e.g., Line 100) looks like an editing artifact. It has no runtime impact but may confuse future readers.

If this helper is not going to be revived soon, consider either deleting the block or cleaning up the comments (including the #. prefix) to keep the file tidy.

NEWS.md (1)

1-11: Consider adding a release date to the 0.2.14 header for consistency

Previous sections include a date in the header (e.g., 0.2.13 (2025/09/30)), while GiottoVisuals 0.2.14 currently omits it. Adding the date would keep the NEWS format consistent and make it easier to track releases chronologically.

R/gg_settings.R (1)

29-40: Axis-removal helper looks good; ensure unit() is properly imported

.theme_remove_axes() correctly strips axes and panel border and zeros out margins, which fits the new show_axes flow.

One small thing to double-check: unit() is used without namespace. Please ensure grid::unit is imported in NAMESPACE (or call grid::unit(...)) so this helper works without relying on accidental namespace leakage.

R/vis_spatial_in_situ.R (2)

145-155: New show_axes param and per-element plotting helpers look correct; consider guarding against empty feats

The refactor that:

  • Introduces show_axes with a default of TRUE via %null% (Line 213),
  • Builds a plot_order stack based on show_image, show_polygon, plot_last, and feats (Lines 215–225) with an early return when there is nothing to plot (Lines 226–229),
  • And delegates to .sissp_image(), .sissp_polygon(), and .sissp_points() (Lines 232–303 and 343–517),

is a nice cleanup and makes the rendering order explicit. The show_axes handling and subsequent .theme_remove_axes() call also align with the new helper.

One edge case: plot_order uses !is.null(feats) as the condition for adding "points", so feats = character(0) would still trigger the points branch and run .sissp_points(). Depending on how combineFeatureData() / combineFeatureOverlapData() behave with an empty feature set, that may yield confusing warnings or errors.

If empty feats is not meaningful, consider normalizing it to NULL up front or adding a length(feats) > 0 check when constructing plot_order to avoid surprising behavior.

Also applies to: 213-229, 232-303, 343-517


305-317: Centralized aspect ratio handling via .aspect_ratio() – verify behavior for coord_fix_ratio values

spatInSituPlotPoints(), .spatInSituPlotHex_single(), and .spatInSituPlotDensity_single() now all delegate coordinate ratio handling to .aspect_ratio(plot, coord_fix_ratio) instead of managing coord_fixed directly.

This centralization is good for consistency and matches the NEWS entry about restoring coord_fix_ratio = TRUE behavior, but it does shift responsibility to .aspect_ratio. Please verify that .aspect_ratio:

  • Correctly interprets coord_fix_ratio = TRUE vs numeric ratios vs NULL,
  • Plays well with downstream theme settings and xlim/ylim,
  • And preserves previous default behavior for existing callers.

If these semantics are already covered by tests, that’s sufficient; otherwise adding a small test matrix around typical coord_fix_ratio settings would be helpful.

Also applies to: 327-328, 627-629, 897-899

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1846978 and 23cf7a5.

📒 Files selected for processing (24)
  • DESCRIPTION (2 hunks)
  • NAMESPACE (1 hunks)
  • NEWS.md (1 hunks)
  • R/aux_defaults.R (2 hunks)
  • R/aux_output.R (1 hunks)
  • R/aux_visuals.R (4 hunks)
  • R/gg_annotation_raster.R (1 hunks)
  • R/gg_info_layers.R (0 hunks)
  • R/gg_param.R (2 hunks)
  • R/gg_settings.R (1 hunks)
  • R/plot_dotplot.R (2 hunks)
  • R/plot_ridge.R (2 hunks)
  • R/plot_sankey.R (1 hunks)
  • R/vis_spatial_gg.R (16 hunks)
  • R/vis_spatial_in_situ.R (9 hunks)
  • man/aes_string2.Rd (0 hunks)
  • man/combine_aes.Rd (1 hunks)
  • man/dot-spatInSituPlotDensity_single.Rd (1 hunks)
  • man/gg_param.Rd (1 hunks)
  • man/ridgePlot.Rd (2 hunks)
  • man/spatDeconvPlot.Rd (1 hunks)
  • man/spatDimPlot.Rd (2 hunks)
  • man/spatFeatPlot2D.Rd (1 hunks)
  • man/spatInSituPlotPoints.Rd (2 hunks)
💤 Files with no reviewable changes (2)
  • man/aes_string2.Rd
  • R/gg_info_layers.R
🧰 Additional context used
🪛 GitHub Actions: R-CMD-check-bioc
man/spatDimPlot.Rd

[error] 1-1: R CMD build failed: this R is version 4.4.3, package 'GiottoVisuals' requires R >= 4.5.0. Package installation failed.

R/gg_settings.R

[error] 1-1: R CMD build failed: this R is version 4.4.3, package 'GiottoVisuals' requires R >= 4.5.0. Package installation failed.

R/gg_annotation_raster.R

[error] 1-1: R CMD build failed: this R is version 4.4.3, package 'GiottoVisuals' requires R >= 4.5.0. Package installation failed.

R/aux_defaults.R

[error] 1-1: R CMD build failed: this R is version 4.4.3, package 'GiottoVisuals' requires R >= 4.5.0. Package installation failed.

man/dot-spatInSituPlotDensity_single.Rd

[error] 1-1: R CMD build failed: this R is version 4.4.3, package 'GiottoVisuals' requires R >= 4.5.0. Package installation failed.

R/plot_dotplot.R

[error] 1-1: R CMD build failed: this R is version 4.4.3, package 'GiottoVisuals' requires R >= 4.5.0. Package installation failed.

man/gg_param.Rd

[error] 1-1: R CMD build failed: this R is version 4.4.3, package 'GiottoVisuals' requires R >= 4.5.0. Package installation failed.

man/spatInSituPlotPoints.Rd

[error] 1-1: R CMD build failed: this R is version 4.4.3, package 'GiottoVisuals' requires R >= 4.5.0. Package installation failed.

man/ridgePlot.Rd

[error] 1-1: R CMD build failed: this R is version 4.4.3, package 'GiottoVisuals' requires R >= 4.5.0. Package installation failed.

man/spatDeconvPlot.Rd

[error] 1-1: R CMD build failed: this R is version 4.4.3, package 'GiottoVisuals' requires R >= 4.5.0. Package installation failed.

R/plot_sankey.R

[error] 1-1: R CMD build failed: this R is version 4.4.3, package 'GiottoVisuals' requires R >= 4.5.0. Package installation failed.

R/vis_spatial_in_situ.R

[error] 1-1: R CMD build failed: this R is version 4.4.3, package 'GiottoVisuals' requires R >= 4.5.0. Package installation failed.

R/aux_visuals.R

[error] 1-1: R CMD build failed: this R is version 4.4.3, package 'GiottoVisuals' requires R >= 4.5.0. Package installation failed.

R/aux_output.R

[error] 1-1: R CMD build failed: this R is version 4.4.3, package 'GiottoVisuals' requires R >= 4.5.0. Package installation failed.

man/combine_aes.Rd

[error] 1-1: R CMD build failed: this R is version 4.4.3, package 'GiottoVisuals' requires R >= 4.5.0. Package installation failed.

R/gg_param.R

[error] 1-1: R CMD build failed: this R is version 4.4.3, package 'GiottoVisuals' requires R >= 4.5.0. Package installation failed.

R/vis_spatial_gg.R

[error] 1-1: R CMD build failed: this R is version 4.4.3, package 'GiottoVisuals' requires R >= 4.5.0. Package installation failed.

man/spatFeatPlot2D.Rd

[error] 1-1: R CMD build failed: this R is version 4.4.3, package 'GiottoVisuals' requires R >= 4.5.0. Package installation failed.

DESCRIPTION

[error] 1-1: R CMD build failed: this R is version 4.4.3, package 'GiottoVisuals' requires R >= 4.5.0. Package installation failed.

R/plot_ridge.R

[error] 1-1: R CMD build failed: this R is version 4.4.3, package 'GiottoVisuals' requires R >= 4.5.0. Package installation failed.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: macOS-latest (4.4)
  • GitHub Check: windows-latest (4.4)
  • GitHub Check: ubuntu-latest (4.4)
🔇 Additional comments (8)
R/plot_sankey.R (1)

249-253: No behavior change in + method; formatting only

The updated stop() line keeps the same error text and control flow; change is purely stylistic and looks fine.

man/ridgePlot.Rd (1)

56-57: Doc formatting changes look good

The wrapped ridge_alpha description and the added comma in the example keep semantics the same and improve readability; no issues here.

Also applies to: 116-116

NAMESPACE (1)

7-7: Exporting aes_string2 aligns with NEWS and docs

Adding export(aes_string2) matches the documented intent to make this helper public; namespace wiring looks consistent. Just ensure downstream packages/scripts expecting it to be internal are aware of the new public API.

man/dot-spatInSituPlotDensity_single.Rd (1)

32-33: Low-level density plot description: OK

The wrapped description for .spatInSituPlotDensity_single() keeps the meaning intact and doesn’t affect usage; looks fine.

man/spatFeatPlot2D.Rd (1)

124-125: scale_alpha_with_expression doc wrapping is fine

The updated line break for scale_alpha_with_expression keeps the description clear and consistent with the parameter’s behavior.

R/plot_ridge.R (1)

15-16: Roxygen/doc tweaks for ridge_alpha and examples look good

The clarified ridge_alpha description and minor example formatting (trailing comma on expression_values) are syntactically valid and align with the existing function defaults and behavior.

Also applies to: 38-39

man/gg_param.Rd (1)

83-85: Example formatting change is purely cosmetic

Moving the comment onto its own line above p_nest_sub improves readability without affecting the example’s behavior.

R/plot_dotplot.R (1)

253-265: Signature and data.table formatting changes preserve behavior

The .dplot_single argument list, the dsize/dcol summaries, and the cluster reordering logic are all semantically unchanged; only line breaks/indentation moved. No functional regressions detected.

Also applies to: 286-288

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
R/vis_spatial_in_situ.R (3)

213-229: Behavior change when nothing is selected to plot

The new plot_order construction and early return when length(plot_order) == 0L is a nice guard against doing unnecessary work. However, this also means the function now returns invisible(NULL) when there is nothing to draw, instead of an empty ggplot (if that was the previous behavior).

If callers expect a ggplot object even in degenerate cases (e.g. for piping or type checks), consider returning an empty ggplot2::ggplot() instead of invisible(), or documenting that NULL is returned when no elements are requested.


326-328: Centralizing coord ratio via .aspect_ratio()

Replacing any direct coord-fixed usage here with .aspect_ratio(plot, coord_fix_ratio) aligns this function with the new centralized aspect-ratio handling. Assuming .aspect_ratio() is implemented to no-op on NULL and apply the appropriate coord transform for non-NULL ratios, this is a nice normalization.

Please just confirm that .aspect_ratio() preserves the previous default behavior when coord_fix_ratio = 1.


343-371: .sissp_image: cropping behavior with partial limits

The helper correctly derives an ext only when both xlim and ylim are provided and otherwise delegates extent choice to plot_spat_image_layer_ggplot. Given that xlim/ylim are still applied later at the ggplot scale level, the behavior is coherent.

If you want image-level cropping to respect a single-sided limit (only xlim or only ylim), you might consider extending the ext construction to handle those partial cases; otherwise, the current implementation is fine and safe.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 438799c and 28c0028.

📒 Files selected for processing (2)
  • R/plot_ridge.R (2 hunks)
  • R/vis_spatial_in_situ.R (10 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • R/plot_ridge.R
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: windows-latest (4.4)
  • GitHub Check: ubuntu-latest (4.4)
  • GitHub Check: macOS-latest (4.4)
  • GitHub Check: R CMD Check
  • GitHub Check: windows-latest (4.4)
  • GitHub Check: ubuntu-latest (4.4)
  • GitHub Check: macOS-latest (4.4)
🔇 Additional comments (7)
R/vis_spatial_in_situ.R (7)

79-87: Roxygen example update matches spat_enr_name API

The example now uses spat_enr_name = "cluster_metagene", which aligns with the function signature and enrichment handling in this file. No issues here.


103-155: Public API additions (spat_enr_name, show_axes) look consistent

Adding spat_enr_name to the signature and wiring it into the polygon path, plus exposing show_axes here and using it later for theme control, is coherent with the documented behavior and examples. Assuming the shared roxygen templates (plot_spatenr_params, etc.) document these arguments, the surface looks good.


232-303: Modular per-element helpers are cleanly wired

The closures img_fun, poly_fun, and pt_fun pre-binding the relevant arguments into .sissp_image, .sissp_polygon, and .sissp_points make plot_order-based assembly straightforward and more maintainable. The element selection via switch(elem, ...) and sequential accumulation into plot is clear and idiomatic for this use case.

No functional issues stand out in this block.


305-317: show_axes handling is straightforward and backward-compatible by default

Passing axis/theme parameters via gg_theme_args and only applying .theme_remove_axes(plot) when !show_axes is a simple and clear way to gate axis removal. With show_axes normalized earlier (show_axes <- show_axes %null% TRUE), existing callers that didn’t know about this parameter will continue to see axes, while users can explicitly turn them off.

Looks good.


373-454: .sissp_polygon: enrichment wiring and polygon assembly look correct

  • Defaulting polygon_feat_type and feat_type via set_default_spat_unit() / set_default_feat_type() is consistent with the rest of the file.
  • combineCellData(..., remove_background_polygon, xlim, ylim) followed by rbindlist produces a single polygon table suitable for plotting.
  • The enrichment path where polygon_fill is not already present and you fetch via spatValues(..., spat_enr_name = spat_enr_name, ...), then merge by cell_ID and rename to poly_ID, lines up with the exposed spat_enr_name parameter and the downstream plot_cell_polygon_layer() call.

This helper is cohesive and appears functionally sound.


628-629: Hexbin aspect ratio now uses .aspect_ratio()

Switching to .aspect_ratio(plot, coord_fix_ratio) in .spatInSituPlotHex_single() matches the new pattern established above and in the density helper. This should make future aspect-ratio changes easier to maintain from a single place.

Assuming .aspect_ratio() faithfully reproduces the old coord_fixed semantics for non-NULL ratios, this looks correct.


814-815: Density helper docs and aspect ratio update are aligned

  • The roxygen description tweak for .spatInSituPlotDensity_single() is fine.
  • Using .aspect_ratio(plot, coord_fix_ratio) in place of inline coord handling brings the density path in line with the rest of the API.

Same as for hexbin, just confirm that .aspect_ratio() behaves as expected across coord_fix_ratio = NULL and non-NULL cases.

Also applies to: 898-899

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 28c0028 and 81f12ab.

📒 Files selected for processing (2)
  • man/ridgePlot.Rd (2 hunks)
  • man/spatInSituPlotPoints.Rd (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • man/ridgePlot.Rd
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: ubuntu-latest (4.4)
  • GitHub Check: windows-latest (4.4)
  • GitHub Check: macOS-latest (4.4)
  • GitHub Check: R CMD Check
  • GitHub Check: windows-latest (4.4)
  • GitHub Check: ubuntu-latest (4.4)
🔇 Additional comments (2)
man/spatInSituPlotPoints.Rd (2)

218-218: LGTM!

The example has been correctly updated to use the renamed parameter spat_enr_name, ensuring consistency with the function signature.


24-24: Verify that all references to the old parameter name have been updated.

The parameter has been renamed from spat_enr_names (plural) to spat_enr_name (singular), which is a breaking API change. Ensure that all code, documentation, and examples using the old name have been updated.

Run the following script to check for any remaining references to the old parameter name:

ylim = NULL,
remove_background_polygon = TRUE,
spat_enr_names = NULL,
spat_enr_name = NULL,
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Document the missing parameters in the arguments section.

Both spat_enr_name (line 24) and show_axes (line 49) are present in the function signature but lack corresponding \item{} entries in the arguments section (lines 62-176). All public parameters should be documented for users to understand their purpose and usage.

Add documentation entries for these parameters. For example:

+\item{spat_enr_name}{name of spatial enrichment results to use for polygon fill}
+
+\item{show_axes}{logical. Whether to display plot axes. When NULL (default), 
+axes behavior is determined by theme settings}

Also applies to: 49-49

@jiajic jiajic merged commit cb10994 into main Nov 20, 2025
0 of 8 checks passed
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