# alicewhatnot/a-level_cs_nea architecture

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

- Interactive diagram: https://gitdiagram.com/alicewhatnot/a-level_cs_nea
- Repository: https://github.com/alicewhatnot/a-level_cs_nea

## Overview

Transformation Animator is a desktop graphing application: a user enters a function, the app parses and models it, plots it, then animates selected graph transformations or differentiation. The graph distinguishes the UI entry point, expression processing, transformation/differentiation, and rendering. Relationships are limited to calls or imports documented in the supplied excerpts and SOURCE INDEX; several modules are indexed but not excerpted, so their internal behavior and some links are omitted.

Main entry points: [`main/main.py`](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/main.py) (App loop), [`main/core/ast.py`](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/ast.py) (Expression AST), [`main/core/animation_controller.py`](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/animation_controller.py) (Animation controller), [`main/core/modify_function.py`](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/modify_function.py) (Function modifiers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop app"]
  node_main["App loop<br/>[main.py]"]
  node_ui["Input controls<br/>[ui_elements.py]"]
  node_settings["Display settings<br/>[settings.py]"]
end

subgraph group_expression["Expression engine"]
  node_entry["Function entry<br/>[function_entry.py]"]
  node_parser["Expression parser<br/>[parser.py]"]
  node_ast["Expression AST<br/>[ast.py]"]
  node_stack["Operator stack<br/>[stack.py]"]
  node_queue["Work queues<br/>[queue.py]"]
  node_function["Function model<br/>[function.py]"]
end

subgraph group_operations["Graph operations"]
  node_transformentry["Transform selection"]
  node_transformclass["Transformation data"]
  node_manager["Transform manager"]
  node_modifier["Function modifiers<br/>[modify_function.py]"]
  node_transforms["AST transformations<br/>[transformations.py]"]
  node_differentiate["Differentiation rules<br/>[differentiation.py]"]
  node_animation["Animation controller"]
end

subgraph group_rendering["Graph rendering"]
  node_plotter["Graph plotter<br/>[graph_plotter.py]"]
  node_graphui["Graph canvas<br/>[graph_ui.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_main
node_main -->|"handles input"| node_ui
node_main -->|"submits function"| node_entry
node_entry -->|"parses expression"| node_parser
node_entry -->|"builds tree"| node_ast
node_ast -->|"uses"| node_queue
node_ast -->|"uses"| node_stack
node_main -->|"creates function"| node_function
node_main -->|"configures transforms"| node_manager
node_manager -->|"enqueues choices"| node_transformentry
node_transformentry -->|"creates entries"| node_transformclass
node_transformentry -->|"queues entries"| node_queue
node_manager -->|"applies modifications"| node_modifier
node_modifier -->|"rewrites AST"| node_transforms
node_modifier -->|"differentiates AST"| node_differentiate
node_differentiate -->|"uses AST"| node_ast
node_transforms -->|"rewrites AST"| node_ast
node_main -->|"updates animation"| node_animation
node_animation -->|"queues animations"| node_queue
node_animation -->|"builds derivatives"| node_modifier
node_animation -->|"draws animation"| node_plotter
node_main -->|"plots function"| node_plotter
node_plotter -->|"evaluates tree"| node_ast
node_main -->|"draws graph area"| node_graphui
node_graphui -->|"reads display settings"| node_settings
node_ui -->|"reads UI settings"| node_settings
node_plotter -->|"reads plot settings"| node_settings

click node_main "https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/main.py"
click node_ui "https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/ui_elements.py"
click node_settings "https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/settings.py"
click node_entry "https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/function_entry.py"
click node_parser "https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/parser.py"
click node_ast "https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/ast.py"
click node_stack "https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/stack.py"
click node_queue "https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/queue.py"
click node_function "https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/function.py"
click node_transformentry "https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/transformations_entry.py"
click node_transformclass "https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/transformation_class.py"
click node_manager "https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/transform_manager.py"
click node_modifier "https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/modify_function.py"
click node_transforms "https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/transformations.py"
click node_differentiate "https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/differentiation.py"
click node_animation "https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/animation_controller.py"
click node_plotter "https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/graph_plotter.py"
click node_graphui "https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/graph_ui.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_main,node_ui,node_settings,node_user toneBlue
class node_entry,node_parser,node_ast,node_stack,node_queue,node_function toneAmber
class node_transformentry,node_transformclass,node_manager,node_modifier,node_transforms,node_differentiate,node_animation toneMint
class node_plotter,node_graphui toneRose
```

## Components

### Desktop app

- [App loop](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/main.py): `main/main.py`
- [Input controls](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/ui_elements.py): `main/ui_elements.py`
- [Display settings](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/settings.py): `main/settings.py`

### Expression engine

- [Function entry](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/function_entry.py): `main/core/function_entry.py`
- [Expression parser](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/parser.py): `main/core/parser.py`
- [Expression AST](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/ast.py): `main/core/ast.py`
- [Operator stack](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/stack.py): `main/core/stack.py`
- [Work queues](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/queue.py): `main/core/queue.py`
- [Function model](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/function.py): `main/core/function.py`

### Graph operations

- [Transform selection](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/transformations_entry.py): `main/core/transformations_entry.py`
- [Transformation data](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/transformation_class.py): `main/core/transformation_class.py`
- [Transform manager](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/transform_manager.py): `main/core/transform_manager.py`
- [Function modifiers](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/modify_function.py): `main/core/modify_function.py`
- [AST transformations](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/transformations.py): `main/core/transformations.py`
- [Differentiation rules](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/differentiation.py): `main/core/differentiation.py`
- [Animation controller](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/animation_controller.py): `main/core/animation_controller.py`

### Graph rendering

- [Graph plotter](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/core/graph_plotter.py): `main/core/graph_plotter.py`
- [Graph canvas](https://github.com/alicewhatnot/a-level_cs_nea/blob/main/main/graph_ui.py): `main/graph_ui.py`

### Other components

- **User**

## Connections

- User → App loop: uses (evidence: `main/main.py`)
- App loop → Input controls: handles input (evidence: `main/main.py`)
- App loop → Function entry: submits function (evidence: `main/main.py`)
- Function entry → Expression parser: parses expression (evidence: `main/core/function_entry.py`)
- Function entry → Expression AST: builds tree (evidence: `main/core/function_entry.py`)
- Expression AST → Work queues: uses (evidence: `main/core/ast.py`)
- Expression AST → Operator stack: uses (evidence: `main/core/ast.py`)
- App loop → Function model: creates function (evidence: `main/main.py`)
- App loop → Transform manager: configures transforms (evidence: `main/main.py`)
- Transform manager → Transform selection: enqueues choices (evidence: `main/core/transform_manager.py`)
- Transform selection → Transformation data: creates entries (evidence: `main/core/transformations_entry.py`)
- Transform selection → Work queues: queues entries (evidence: `main/core/transformations_entry.py`)
- Transform manager → Function modifiers: applies modifications (evidence: `main/core/transform_manager.py`)
- Function modifiers → AST transformations: rewrites AST (evidence: `main/core/modify_function.py`)
- Function modifiers → Differentiation rules: differentiates AST (evidence: `main/core/modify_function.py`)
- Differentiation rules → Expression AST: uses AST (evidence: `main/core/differentiation.py`)
- AST transformations → Expression AST: rewrites AST (evidence: `main/core/transformations.py`)
- App loop → Animation controller: updates animation (evidence: `main/main.py`)
- Animation controller → Work queues: queues animations (evidence: `main/core/animation_controller.py`)
- Animation controller → Function modifiers: builds derivatives (evidence: `main/core/animation_controller.py`)
- Animation controller → Graph plotter: draws animation (evidence: `main/core/animation_controller.py`)
- App loop → Graph plotter: plots function (evidence: `main/main.py`)
- Graph plotter → Expression AST: evaluates tree (evidence: `main/core/graph_plotter.py`)
- App loop → Graph canvas: draws graph area (evidence: `main/main.py`)
- Graph canvas → Display settings: reads display settings (evidence: `main/graph_ui.py`)
- Input controls → Display settings: reads UI settings (evidence: `main/ui_elements.py`)
- Graph plotter → Display settings: reads plot settings (evidence: `main/core/graph_plotter.py`)
