# aryx/codemap architecture

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

- Interactive diagram: https://gitdiagram.com/aryx/codemap
- Repository: https://github.com/aryx/codemap

## Overview

Codemap is a desktop source-code visualization and search tool. A user opens a project; the GTK GUI presents a zoomable treemap with code thumbnails and semantic syntax highlighting, and supports code search. The README documents these product capabilities but no source excerpts were provided, so internal call ownership and connections between parsing, visualization, and GUI modules cannot be verified; those links are omitted rather than inferred.

Main entry points: [`src/gui/view_mainmap.ml`](https://github.com/aryx/codemap/blob/master/src/gui/view_mainmap.ml) (Map rendering), [`src/gui/Controller.ml`](https://github.com/aryx/codemap/blob/master/src/gui/Controller.ml) (GUI controller), [`src/program_visual/treemap_pl.ml`](https://github.com/aryx/codemap/blob/master/src/program_visual/treemap_pl.ml) (Program map), [`src/main/Main.ml`](https://github.com/aryx/codemap/blob/master/src/main/Main.ml) (Application entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_main["Application entry<br/>[Main.ml]"]
end

subgraph group_gui["Desktop interface"]
  node_controller["GUI controller<br/>[Controller.ml]"]
  node_gui_view["GUI views<br/>[View.ml]"]
  node_search["Code search<br/>[ui_search.ml]"]
end

subgraph group_analysis["Code analysis"]
  node_parsing["Source parsing<br/>[Parsing.ml]"]
  node_highlight["Syntax highlighting<br/>[Model.ml]"]
  node_language_support["Language support"]
end

subgraph group_visualization["Code visualization"]
  node_treemap["Treemap layout<br/>[treemap.ml]"]
  node_program_map["Program map<br/>[treemap_pl.ml]"]
  node_map_layers["Visualization layers<br/>[layer_archi.ml]"]
  node_map_view["Map rendering<br/>[view_mainmap.ml]"]
  node_thumbnails["Code thumbnails<br/>[draw_microlevel.ml]"]
  node_syntax_display["Highlighted code<br/>[draw_macrolevel.ml]"]
end

node_user(("Project user"))

node_user -->|"opens project"| node_main
node_main -->|"launches GUI"| node_controller
node_controller -.->|"presents interface"| node_gui_view
node_controller -->|"supports search"| node_search
node_gui_view -->|"shows visualization"| node_map_view
node_map_view -.->|"renders code map"| node_program_map
node_program_map -.->|"uses treemap layout"| node_treemap
node_program_map -.->|"shows map layers"| node_map_layers
node_map_view -->|"reveals thumbnails"| node_thumbnails
node_map_view -->|"reveals highlighted code"| node_syntax_display
node_syntax_display -.->|"uses highlighting"| node_highlight
node_highlight -->|"supports languages"| node_language_support
node_language_support -->|"uses parsers"| node_parsing

click node_main "https://github.com/aryx/codemap/blob/master/src/main/Main.ml"
click node_controller "https://github.com/aryx/codemap/blob/master/src/gui/Controller.ml"
click node_gui_view "https://github.com/aryx/codemap/blob/master/src/gui/View.ml"
click node_search "https://github.com/aryx/codemap/blob/master/src/gui/ui_search.ml"
click node_parsing "https://github.com/aryx/codemap/blob/master/src/gui/Parsing.ml"
click node_highlight "https://github.com/aryx/codemap/blob/master/src/gui/Model.ml"
click node_language_support "https://github.com/aryx/codemap/tree/master/languages"
click node_treemap "https://github.com/aryx/codemap/blob/master/libs/treemap/treemap.ml"
click node_program_map "https://github.com/aryx/codemap/blob/master/src/program_visual/treemap_pl.ml"
click node_map_layers "https://github.com/aryx/codemap/blob/master/src/program_visual/layer_archi.ml"
click node_map_view "https://github.com/aryx/codemap/blob/master/src/gui/view_mainmap.ml"
click node_thumbnails "https://github.com/aryx/codemap/blob/master/src/gui/draw_microlevel.ml"
click node_syntax_display "https://github.com/aryx/codemap/blob/master/src/gui/draw_macrolevel.ml"

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_user toneBlue
class node_controller,node_gui_view,node_search toneAmber
class node_parsing,node_highlight,node_language_support toneMint
class node_treemap,node_program_map,node_map_layers,node_map_view,node_thumbnails,node_syntax_display toneRose
```

## Components

### Application entry

- [Application entry](https://github.com/aryx/codemap/blob/master/src/main/Main.ml): `src/main/Main.ml`

### Desktop interface

- [GUI controller](https://github.com/aryx/codemap/blob/master/src/gui/Controller.ml): `src/gui/Controller.ml`
- [GUI views](https://github.com/aryx/codemap/blob/master/src/gui/View.ml): `src/gui/View.ml`
- [Code search](https://github.com/aryx/codemap/blob/master/src/gui/ui_search.ml): `src/gui/ui_search.ml`

### Code analysis

- [Source parsing](https://github.com/aryx/codemap/blob/master/src/gui/Parsing.ml): `src/gui/Parsing.ml`
- [Syntax highlighting](https://github.com/aryx/codemap/blob/master/src/gui/Model.ml): `src/gui/Model.ml`
- [Language support](https://github.com/aryx/codemap/tree/master/languages): `languages`

### Code visualization

- [Treemap layout](https://github.com/aryx/codemap/blob/master/libs/treemap/treemap.ml): `libs/treemap/treemap.ml`
- [Program map](https://github.com/aryx/codemap/blob/master/src/program_visual/treemap_pl.ml): `src/program_visual/treemap_pl.ml`
- [Visualization layers](https://github.com/aryx/codemap/blob/master/src/program_visual/layer_archi.ml): `src/program_visual/layer_archi.ml`
- [Map rendering](https://github.com/aryx/codemap/blob/master/src/gui/view_mainmap.ml): `src/gui/view_mainmap.ml`
- [Code thumbnails](https://github.com/aryx/codemap/blob/master/src/gui/draw_microlevel.ml): `src/gui/draw_microlevel.ml`
- [Highlighted code](https://github.com/aryx/codemap/blob/master/src/gui/draw_macrolevel.ml): `src/gui/draw_macrolevel.ml`

### Other components

- **Project user**

## Connections

- Project user → Application entry: opens project (evidence: `README.md`)
- Application entry → GUI controller: launches GUI (evidence: `README.md`)
- GUI controller → GUI views: presents interface
- GUI controller → Code search: supports search (evidence: `README.md`)
- GUI views → Map rendering: shows visualization (evidence: `README.md`)
- Map rendering → Program map: renders code map
- Program map → Treemap layout: uses treemap layout
- Program map → Visualization layers: shows map layers
- Map rendering → Code thumbnails: reveals thumbnails (evidence: `README.md`)
- Map rendering → Highlighted code: reveals highlighted code (evidence: `README.md`)
- Highlighted code → Syntax highlighting: uses highlighting
- Syntax highlighting → Language support: supports languages (evidence: `README.md`)
- Language support → Source parsing: uses parsers (evidence: `README.md`)
