jigsawR
  • Get Started
  • Gallery
    • Rectangular
    • Hexagonal
    • Concentric
    • Voronoi
    • Random
    • SNIC
  • API
    • generate_puzzle()
    • ggpuzzle Extension
    • PILES Notation
  • Tutorials
    • Basic Usage
    • Customization
    • Aspect Ratios
    • Fusion Groups
  • Reference
    • Architecture

On this page

  • jigsawR
  • Installation
  • Quick Start
  • Gallery Preview
  • ggplot2 Integration
  • PILES Notation
  • Edit this page
  • Report an issue

jigsawR

Generate Beautiful Jigsaw Puzzles in R

jigsawR

Generate stunning, mathematically precise jigsaw puzzles with ease. Six puzzle types, infinite possibilities.

Installation

# Install from GitHub
devtools::install_github("pjt222/jigsawR")

🧩

6 Puzzle Types

Rectangular, Hexagonal, Concentric, Voronoi, Random, and SNIC shapes

🎨

Beautiful Palettes

Full viridis color palette support with gradient fills

📊

ggplot2 Integration

Native geom_puzzle_*() functions for data visualization

🔗

Fusion Groups

Merge pieces using PILES notation for custom layouts

âš¡

High Performance

C++ backend with Rcpp for fast puzzle generation

📱

Shiny App

Interactive web app for puzzle creation and download

Quick Start

# Generate a 3x4 rectangular puzzle
result <- generate_puzzle(
  type = "rectangular",
  grid = c(3, 4),
  size = c(300, 400),
  seed = 42,
  fill_palette = "viridis"
)

render_puzzle_preview(result)

Gallery Preview

Explore the Gallery →

ggplot2 Integration

Map data to puzzle pieces for creative data visualization:

# Create data
data <- data.frame(
  region = 1:7,
  value = c(23, 45, 12, 67, 34, 89, 56)
)

# Visualize with puzzle pieces
ggplot(data) +
  geom_puzzle_hex(
    aes(fill = value),
    rings = 2,
    seed = 123
  ) +
  scale_fill_viridis_c(
    name = "Value",
    option = "plasma"
  ) +
  coord_fixed() +
  theme_minimal() +
  labs(title = "Data as Puzzle Pieces")

Learn More About ggpuzzle →

PILES Notation

Powerful piece fusion with intuitive syntax:

# Merge center with ring 1
result <- generate_puzzle(
  type = "hexagonal",
  grid = c(3),
  size = c(200),
  fusion_groups = "center-ring1"
)

# Custom fusion groups
result <- generate_puzzle(
  type = "rectangular",
  grid = c(3, 4),
  size = c(300, 400),
  fusion_groups = "1-2-3,7-8-9,10-11-12"
)

PILES Notation Guide →


Ready to create puzzles?

Get Started View on GitHub

jigsawR is developed by Philipp Thoss

 
  • Edit this page
  • Report an issue

Built with Quarto