Skip to content

pjt222/spiralizer

Repository files navigation

🌀 Spiralizer

Create beautiful Voronoi diagrams based on Fermat spirals.

R-CMD-check pkgdown

Live Demo: shinyapps.io | Hugging Face Space

Documentation: pjt222.github.io/spiralizer

Gallery

Start=111, End=222, Density=333 Start=0, End=107, Density=179
example1 example2
Start=0, End=666, Density=999 Start=333, End=666, Density=999
example3 example4

Features

  • Interactive controls - Real-time parameter adjustment with debounced sliders
  • Multiple color palettes - Turbo, Viridis, Plasma, Inferno, Magma, Cividis
  • Palette inversion - Flip color direction with a switch
  • Collapsible sidebar - Focus on the art, hide controls when not needed
  • Export - High-resolution PNG (3000x3000) and SVG vector formats
  • Dark zen theme - Minimalist UI with glass-morphism effects

Quick Start

# Clone and run
git clone https://github.com/pjt222/spiralizer.git
cd spiralizer

# Restore dependencies
source(".Rprofile")
renv::restore()

# Run the app
source("R/app.R")

How It Works

  1. Fermat Spiral - Points generated using x = √θ·cos(θ), y = √θ·sin(θ)
  2. Delaunay Triangulation - Optimal triangulation via tessellation package
  3. Voronoi Tessellation - Dual of Delaunay creates the cell pattern
  4. Color Mapping - Cells colored with viridisLite palettes

Tech Stack

  • R Shiny with bslib (Bootstrap 5, darkly theme)
  • tessellation for Voronoi computation
  • viridisLite for color palettes
  • renv for dependency management

Project Structure

spiralizer/
├── R/                      # All R code (flat structure)
│   ├── app.R               # Main application
│   ├── theme.R             # bslib theme
│   ├── ui_controls.R       # Control panel module
│   ├── ui_plot.R           # Plot rendering module
│   └── spiral_math.R       # Mathematical functions
├── inst/app/               # Deployment entry point
├── docs/                   # Documentation
└── tests/                  # Test suite

Documentation

Acknowledgments

License

MIT

About

Plot Voronoi Fermat Spirals

Topics

Resources

License

Stars

Watchers

Forks

Contributors