# stanko/vertigo architecture

> Architecture diagram of the GitHub repository stanko/vertigo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/stanko/vertigo
- Repository: https://github.com/stanko/vertigo

## Overview

##### Key Components

Input Section:
- Raster Image Input Component
- Image Data Parser

Processing Core (Central Focus):
Two Primary Transformation Pipelines:
##### Dot Grid Pipeline
- Image to Dots Converter (convert-image-to-dots.ts)
- Dot Pattern Generator

##### Spiral Pipeline
- Image to Spiral Converter (convert-image-to-spiral.ts)
- Spiral Pattern Generator (spiral.ts)
- Line Smoothing Module (smooth-line.ts)

Utility Components:
- Helper Functions Module (helpers.ts)
- Constants Module (constants.ts)
- Demo Helpers (demo-helpers.ts)
- Random Image Generator (generate-random-image.ts)

Output Section:
- Vector Graphics Renderer
- DOM Integration Layer

##### Specific Design Elements

- Core Image Processing Logic
- Utility Functions
- Demo/Documentation Components

##### Data Flow Representation

Following flows:
- Input Image → Image Parser → Transformation Selection
- Transformation Pipeline A (Dots) → Vector Output
- Transformation Pipeline B (Spiral) → Vector Output
- Utility Functions → Both Pipelines

##### Technical Stack Indicators

Technology badges for:
- TypeScript (based on .ts files)
- Web Technologies (DOM integration)
- Vector Graphics Output

##### Documentation Integration

Connection to:
- Documentation System (docs folder)
- Example Gallery (docs/examples)

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef input fill:#a8d1f0,stroke:#2c3e50
    classDef core fill:#b8e994,stroke:#2c3e50
    classDef output fill:#f8c291,stroke:#2c3e50
    classDef utility fill:#d1d8e0,stroke:#2c3e50
    classDef docs fill:#c7ecee,stroke:#2c3e50

    %% Input Layer
    subgraph Input
        IMG[Raster Image Input]:::input
        PARSE[Image Data Parser]:::input
    end

    %% Core Processing Layer
    subgraph Processing
        CORE[Core Vertigo Engine]:::core
        
        subgraph "Dot Grid Pipeline"
            DOTS[Image to Dots Converter]:::core
            DOTPAT[Dot Pattern Generator]:::core
        end
        
        subgraph "Spiral Pipeline"
            SPIRAL[Image to Spiral Converter]:::core
            SPIRALPAT[Spiral Pattern Generator]:::core
            SMOOTH[Line Smoothing Module]:::core
        end
    end

    %% Utility Components
    subgraph Utilities
        HELP[Helper Functions]:::utility
        CONST[Constants Module]:::utility
        DEMO[Demo Helpers]:::utility
        RAND[Random Image Generator]:::utility
    end

    %% Output Layer
    subgraph Output
        RENDER[Vector Graphics Renderer]:::output
        DOM[DOM Integration Layer]:::output
    end

    %% Documentation
    subgraph Documentation
        DOCS[Documentation System]:::docs
        GALLERY[Example Gallery]:::docs
        STYLES[Documentation Styles]:::docs
        BUILDER[Documentation Builder]:::docs
    end

    %% Relationships
    IMG --> PARSE
    PARSE --> CORE
    CORE --> DOTS
    CORE --> SPIRAL
    DOTS --> DOTPAT
    SPIRAL --> SPIRALPAT
    SPIRALPAT --> SMOOTH
    DOTPAT --> RENDER
    SMOOTH --> RENDER
    RENDER --> DOM
    HELP --> CORE
    CONST --> CORE
    DEMO --> DOM
    RAND --> IMG

    %% Click Events
    click CORE "https://github.com/Stanko/vertigo/blob/dev/src/vertigo.ts"
    click DOTS "https://github.com/Stanko/vertigo/blob/dev/src/convert-image-to-dots.ts"
    click SPIRAL "https://github.com/Stanko/vertigo/blob/dev/src/convert-image-to-spiral.ts"
    click SPIRALPAT "https://github.com/Stanko/vertigo/blob/dev/src/spiral.ts"
    click SMOOTH "https://github.com/Stanko/vertigo/blob/dev/src/smooth-line.ts"
    click HELP "https://github.com/Stanko/vertigo/blob/dev/src/helpers.ts"
    click CONST "https://github.com/Stanko/vertigo/blob/dev/src/constants.ts"
    click DEMO "https://github.com/Stanko/vertigo/blob/dev/src/demo-helpers.ts"
    click RAND "https://github.com/Stanko/vertigo/blob/dev/src/generate-random-image.ts"
    click DOCS "https://github.com/Stanko/vertigo/tree/dev/docs/src"
    click GALLERY "https://github.com/Stanko/vertigo/tree/dev/docs/examples"
    click STYLES "https://github.com/Stanko/vertigo/blob/dev/docs/styles/docs.scss"
    click BUILDER "https://github.com/Stanko/vertigo/blob/dev/docs/build/docs.js"

    %% Legend
    subgraph Legend
        L1[Input Components]:::input
        L2[Core Processing]:::core
        L3[Output Components]:::output
        L4[Utility Functions]:::utility
        L5[Documentation]:::docs
    end
```
