# edcheyjr/sigularity architecture

> Architecture diagram of the GitHub repository edcheyjr/sigularity, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/edcheyjr/sigularity
- Repository: https://github.com/edcheyjr/sigularity

## Overview

Stable Singularity is a single-file interactive WebGL visualization. A viewer selects a black-hole preset in the HUD; the preset system animates scene parameters, camera and orbit settings, and status labels, while the render loop updates the scene. The visualization combines Three.js objects, custom GLSL effects, and instanced orbital particles. The README documents these responsibilities and relationships; source excerpts were unavailable, so the graph stays at that documented level.

Main entry points: [`index.html`](https://github.com/edcheyjr/sigularity/blob/master/index.html) (Scene setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_controls["Controls and presets"]
  node_hud["Preset HUD<br/>[index.html]"]
  node_presets["Preset transitions<br/>[index.html]"]
  node_status["Status labels<br/>[index.html]"]
end

subgraph group_rendering["Scene and rendering"]
  node_scene["Scene setup<br/>[index.html]"]
  node_effects["GLSL effects<br/>[index.html]"]
  node_particles["Orbital particles<br/>[index.html]"]
  node_controls3d["Orbit controls<br/>[index.html]"]
  node_loop["Animation loop<br/>[index.html]"]
end

subgraph group_dependencies["External libraries"]
  node_three["Three.js"]
  node_orbit["OrbitControls"]
  node_gsap["GSAP"]
end

node_viewer(("Viewer"))

node_viewer -->|"selects preset"| node_hud
node_hud -->|"dispatches selection"| node_presets
node_presets -->|"animates transitions"| node_gsap
node_presets -->|"updates parameters"| node_scene
node_presets -->|"sets orbit speed"| node_controls3d
node_presets -->|"updates labels"| node_status
node_scene -->|"creates scene"| node_three
node_scene -->|"uses shaders"| node_effects
node_scene -->|"creates instances"| node_particles
node_scene -->|"configures controls"| node_controls3d
node_controls3d -->|"uses controls"| node_orbit
node_loop -->|"renders scene"| node_scene
node_loop -->|"updates camera"| node_controls3d
node_loop -->|"uses renderer"| node_three

click node_hud "https://github.com/edcheyjr/sigularity/blob/master/index.html"
click node_presets "https://github.com/edcheyjr/sigularity/blob/master/index.html"
click node_status "https://github.com/edcheyjr/sigularity/blob/master/index.html"
click node_scene "https://github.com/edcheyjr/sigularity/blob/master/index.html"
click node_effects "https://github.com/edcheyjr/sigularity/blob/master/index.html"
click node_particles "https://github.com/edcheyjr/sigularity/blob/master/index.html"
click node_controls3d "https://github.com/edcheyjr/sigularity/blob/master/index.html"
click node_loop "https://github.com/edcheyjr/sigularity/blob/master/index.html"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_hud,node_presets,node_status,node_viewer toneBlue
class node_scene,node_effects,node_particles,node_controls3d,node_loop toneAmber
class node_three,node_orbit,node_gsap toneMint
```

## Components

### Controls and presets

- [Preset HUD](https://github.com/edcheyjr/sigularity/blob/master/index.html): `index.html`
- [Preset transitions](https://github.com/edcheyjr/sigularity/blob/master/index.html): `index.html`
- [Status labels](https://github.com/edcheyjr/sigularity/blob/master/index.html): `index.html`

### Scene and rendering

- [Scene setup](https://github.com/edcheyjr/sigularity/blob/master/index.html): `index.html`
- [GLSL effects](https://github.com/edcheyjr/sigularity/blob/master/index.html): `index.html`
- [Orbital particles](https://github.com/edcheyjr/sigularity/blob/master/index.html): `index.html`
- [Orbit controls](https://github.com/edcheyjr/sigularity/blob/master/index.html): `index.html`
- [Animation loop](https://github.com/edcheyjr/sigularity/blob/master/index.html): `index.html`

### External libraries

- **Three.js**
- **OrbitControls**
- **GSAP**

### Other components

- **Viewer**

## Connections

- Viewer → Preset HUD: selects preset
- Preset HUD → Preset transitions: dispatches selection
- Preset transitions → GSAP: animates transitions
- Preset transitions → Scene setup: updates parameters
- Preset transitions → Orbit controls: sets orbit speed
- Preset transitions → Status labels: updates labels
- Scene setup → Three.js: creates scene
- Scene setup → GLSL effects: uses shaders
- Scene setup → Orbital particles: creates instances
- Scene setup → Orbit controls: configures controls
- Orbit controls → OrbitControls: uses controls
- Animation loop → Scene setup: renders scene
- Animation loop → Orbit controls: updates camera
- Animation loop → Three.js: uses renderer
