# joaovitoramaral27/basestats-table architecture

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

- Interactive diagram: https://gitdiagram.com/joaovitoramaral27/basestats-table
- Repository: https://github.com/joaovitoramaral27/basestats-table

## Overview

This is a small browser-based stats table: users adjust numeric stats, see clamped values reflected in colored bars and a total, and can export the stats display as a PNG. The sampled JavaScript shows the calculation and export behavior, but the HTML and CSS were not sampled, so their structure and styling are represented only at a high level; no event wiring from the page to the export function is asserted.

Main entry points: [`script.js`](https://github.com/joaovitoramaral27/basestats-table/blob/master/script.js) (Stat updates), [`index.html`](https://github.com/joaovitoramaral27/basestats-table/blob/master/index.html) (Stats page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Stats interface"]
  node_page["Stats page<br/>[index.html]"]
  node_styles["Page styles<br/>[style.css]"]
end

subgraph group_behavior["Stats behavior"]
  node_stats["Stat updates<br/>[script.js]"]
  node_colors["Color mapping<br/>[script.js]"]
  node_export["PNG export<br/>[script.js]"]
end

node_user(("User"))
node_html2canvas["html2canvas"]

node_user -.->|"uses"| node_page
node_stats -->|"updates controls"| node_page
node_stats -->|"gets colors"| node_colors
node_export -->|"renders capture"| node_html2canvas

click node_page "https://github.com/joaovitoramaral27/basestats-table/blob/master/index.html"
click node_styles "https://github.com/joaovitoramaral27/basestats-table/blob/master/style.css"
click node_stats "https://github.com/joaovitoramaral27/basestats-table/blob/master/script.js"
click node_colors "https://github.com/joaovitoramaral27/basestats-table/blob/master/script.js"
click node_export "https://github.com/joaovitoramaral27/basestats-table/blob/master/script.js"

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_user toneBlue
class node_stats,node_colors,node_export toneAmber
class node_html2canvas toneIndigo
```

## Components

### Stats interface

- [Stats page](https://github.com/joaovitoramaral27/basestats-table/blob/master/index.html): `index.html`
- [Page styles](https://github.com/joaovitoramaral27/basestats-table/blob/master/style.css): `style.css`

### Stats behavior

- [Stat updates](https://github.com/joaovitoramaral27/basestats-table/blob/master/script.js): `script.js`
- [Color mapping](https://github.com/joaovitoramaral27/basestats-table/blob/master/script.js): `script.js`
- [PNG export](https://github.com/joaovitoramaral27/basestats-table/blob/master/script.js): `script.js`

### Other components

- **User**
- **html2canvas**

## Connections

- User → Stats page: uses
- Stat updates → Stats page: updates controls (evidence: `script.js`)
- Stat updates → Color mapping: gets colors (evidence: `script.js`)
- PNG export → html2canvas: renders capture (evidence: `script.js`)
