# mishratanya2311/living-ascii-portrait architecture

> Architecture diagram of the GitHub repository mishratanya2311/living-ascii-portrait, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mishratanya2311/living-ascii-portrait
- Repository: https://github.com/mishratanya2311/living-ascii-portrait

## Overview

Living ASCII Portrait is a browser-based animated artwork. The user opens the page, where the JavaScript engine uses generated portrait data to render and animate ASCII characters on a canvas; pointer movement adds interactive effects. The README documents the feature stages and optional Python data regeneration. Source excerpts show portions of the animation and interaction logic, but omit initialization and rendering sections, so some wiring is supported only by README statements.

Main entry points: [`wallpaper.js`](https://github.com/mishratanya2311/living-ascii-portrait/blob/main/wallpaper.js) (Animation engine), [`index.html`](https://github.com/mishratanya2311/living-ascii-portrait/blob/main/index.html) (Portrait page), [`portrait-data.js`](https://github.com/mishratanya2311/living-ascii-portrait/blob/main/portrait-data.js) (Portrait grid data), [`tools/build_portrait_data.py`](https://github.com/mishratanya2311/living-ascii-portrait/blob/main/tools/build_portrait_data.py) (Data generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Page and presentation"]
  node_page["Portrait page<br/>[index.html]"]
  node_styles["Responsive styling<br/>[styles.css]"]
  node_canvas["Canvas surface<br/>[index.html]"]
end

subgraph group_portrait["Portrait runtime"]
  node_engine["Animation engine<br/>[wallpaper.js]"]
  node_ascii["ASCII renderer<br/>[wallpaper.js]"]
  node_reveal["Reveal and zoom<br/>[wallpaper.js]"]
  node_hair["Hair animation<br/>[wallpaper.js]"]
  node_eyes["Eye animation<br/>[wallpaper.js]"]
  node_interaction["Pointer effects<br/>[wallpaper.js]"]
end

subgraph group_generation["Data generation"]
  node_portraitdata["Portrait grid data<br/>[portrait-data.js]"]
  node_generator["Data generator"]
end

node_visitor(("Viewer"))

node_visitor -->|"opens"| node_page
node_page -->|"runs"| node_engine
node_engine -->|"uses data"| node_portraitdata
node_engine -->|"renders"| node_ascii
node_ascii -->|"draws on"| node_canvas
node_page -->|"styled by"| node_styles
node_engine -->|"animates"| node_reveal
node_engine -->|"animates"| node_hair
node_engine -->|"animates"| node_eyes
node_visitor -->|"moves pointer"| node_interaction
node_engine -->|"handles input"| node_interaction
node_generator -.->|"generates"| node_portraitdata

click node_page "https://github.com/mishratanya2311/living-ascii-portrait/blob/main/index.html"
click node_styles "https://github.com/mishratanya2311/living-ascii-portrait/blob/main/styles.css"
click node_canvas "https://github.com/mishratanya2311/living-ascii-portrait/blob/main/index.html"
click node_engine "https://github.com/mishratanya2311/living-ascii-portrait/blob/main/wallpaper.js"
click node_ascii "https://github.com/mishratanya2311/living-ascii-portrait/blob/main/wallpaper.js"
click node_reveal "https://github.com/mishratanya2311/living-ascii-portrait/blob/main/wallpaper.js"
click node_hair "https://github.com/mishratanya2311/living-ascii-portrait/blob/main/wallpaper.js"
click node_eyes "https://github.com/mishratanya2311/living-ascii-portrait/blob/main/wallpaper.js"
click node_interaction "https://github.com/mishratanya2311/living-ascii-portrait/blob/main/wallpaper.js"
click node_portraitdata "https://github.com/mishratanya2311/living-ascii-portrait/blob/main/portrait-data.js"
click node_generator "https://github.com/mishratanya2311/living-ascii-portrait/blob/main/tools/build_portrait_data.py"

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_page,node_styles,node_canvas,node_visitor toneBlue
class node_engine,node_ascii,node_reveal,node_hair,node_eyes,node_interaction toneAmber
class node_portraitdata,node_generator toneMint
```

## Components

### Page and presentation

- [Portrait page](https://github.com/mishratanya2311/living-ascii-portrait/blob/main/index.html): `index.html`
- [Responsive styling](https://github.com/mishratanya2311/living-ascii-portrait/blob/main/styles.css): `styles.css`
- [Canvas surface](https://github.com/mishratanya2311/living-ascii-portrait/blob/main/index.html): `index.html`

### Portrait runtime

- [Animation engine](https://github.com/mishratanya2311/living-ascii-portrait/blob/main/wallpaper.js): `wallpaper.js`
- [ASCII renderer](https://github.com/mishratanya2311/living-ascii-portrait/blob/main/wallpaper.js): `wallpaper.js`
- [Reveal and zoom](https://github.com/mishratanya2311/living-ascii-portrait/blob/main/wallpaper.js): `wallpaper.js`
- [Hair animation](https://github.com/mishratanya2311/living-ascii-portrait/blob/main/wallpaper.js): `wallpaper.js`
- [Eye animation](https://github.com/mishratanya2311/living-ascii-portrait/blob/main/wallpaper.js): `wallpaper.js`
- [Pointer effects](https://github.com/mishratanya2311/living-ascii-portrait/blob/main/wallpaper.js): `wallpaper.js`

### Data generation

- [Portrait grid data](https://github.com/mishratanya2311/living-ascii-portrait/blob/main/portrait-data.js): `portrait-data.js`
- [Data generator](https://github.com/mishratanya2311/living-ascii-portrait/blob/main/tools/build_portrait_data.py): `tools/build_portrait_data.py`

### Other components

- **Viewer**

## Connections

- Viewer → Portrait page: opens (evidence: `README.md`)
- Portrait page → Animation engine: runs (evidence: `README.md`)
- Animation engine → Portrait grid data: uses data (evidence: `README.md`)
- Animation engine → ASCII renderer: renders (evidence: `README.md`)
- ASCII renderer → Canvas surface: draws on (evidence: `README.md`)
- Portrait page → Responsive styling: styled by (evidence: `README.md`)
- Animation engine → Reveal and zoom: animates (evidence: `README.md`)
- Animation engine → Hair animation: animates (evidence: `README.md`)
- Animation engine → Eye animation: animates (evidence: `README.md`)
- Viewer → Pointer effects: moves pointer (evidence: `README.md`)
- Animation engine → Pointer effects: handles input (evidence: `wallpaper.js`)
- Data generator → Portrait grid data: generates (evidence: `README.md`)
