Skip to content

Commit 66ee9cf

Browse files
pjt222claude
andcommitted
fix(ci): add missing roxygen param and guard snic chunks in Quarto
- Add @PARAM original_canvas_size to render_image_filled_pieces() roxygen and .Rd file, fixing R-CMD-check WARNING on all platforms - Add eval: !expr has_snic guards to demo-snic-ggpuzzle and demo-snic-api chunks, fixing Quarto Publish failure when snic package is unavailable - Update snic-image-usage chunk to use bundled sample_image.jpg instead of placeholder "photo.jpg", enabling live evaluation (closes #120) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c8b4358 commit 66ee9cf

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

R/image_fill_rendering.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ render_image_clip_defs <- function(pieces) {
8181
#' @param opacity Piece opacity (0.0 to 1.0)
8282
#' @param image_width Original image width in pixels
8383
#' @param image_height Original image height in pixels
84+
#' @param original_canvas_size Original canvas size before offset expansion,
85+
#' used to size the clipped image correctly. If NULL, uses canvas_size.
8486
#' @return Character vector of SVG group elements
8587
#'
8688
#' @keywords internal

man/render_image_filled_pieces.Rd

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

quarto/gallery/snic.qmd

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,23 +298,23 @@ When provided with an image, SNIC creates pieces that follow the image's visual
298298

299299
```{r}
300300
#| label: snic-image-usage
301-
#| eval: false
302-
library(jigsawR)
301+
#| eval: !expr has_snic
302+
#| fig-align: center
303+
304+
# Use the package's bundled sample image
305+
sample_image <- system.file("extdata", "sample_image.jpg", package = "jigsawR")
303306
304307
# Generate SNIC puzzle from an image
305308
result <- generate_puzzle(
306309
type = "snic",
307310
grid = c(30),
308311
size = c(300, 400),
309312
seed = 42,
310-
image_path = "photo.jpg", # Path to your image
313+
image_path = sample_image,
311314
compactness = 0.5,
312315
seed_type = "hexagonal"
313316
)
314317
315-
# Save SVG
316-
writeLines(result$svg_content, "snic_puzzle.svg")
317-
318318
# Preview
319319
render_puzzle_preview(result)
320320
```
@@ -347,6 +347,7 @@ Image-based SNIC puzzles adapt piece boundaries to follow edges and features in
347347

348348
```{r}
349349
#| label: demo-snic-ggpuzzle
350+
#| eval: !expr has_snic
350351
#| fig-align: center
351352
352353
ggplot() +
@@ -368,6 +369,7 @@ ggplot() +
368369

369370
```{r}
370371
#| label: demo-snic-api
372+
#| eval: !expr has_snic
371373
#| fig-align: center
372374
373375
# Generate puzzle

0 commit comments

Comments
 (0)