# thefocusman/caluctor architecture

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

- Interactive diagram: https://gitdiagram.com/thefocusman/caluctor
- Repository: https://github.com/thefocusman/caluctor

## Overview

Caluctor is a small WPF calculator. A user enters numbers and selects basic or scientific operations in the main window; the window evaluates operations and updates the display. It also supports saved-number memory. The sampled code shows the main window discovering and invoking .NET Math and MathHelper methods, and creating memory panels. The excerpts do not show the XAML layout or application startup wiring, so those links are omitted.

Main entry points: [`MainWindow.xaml.cs`](https://github.com/thefocusman/caluctor/blob/master/MainWindow.xaml.cs) (Calculator workflow), [`MainWindow.xaml`](https://github.com/thefocusman/caluctor/blob/master/MainWindow.xaml) (Calculator window), [`MathHelper.cs`](https://github.com/thefocusman/caluctor/blob/master/MathHelper.cs) (Scientific operations), [`OutputFormatAttribute.cs`](https://github.com/thefocusman/caluctor/blob/master/OutputFormatAttribute.cs) (Operation formatting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Calculator interface"]
  node_main_ui["Calculator window<br/>[MainWindow.xaml]"]
  node_main_logic["Calculator workflow<br/>[MainWindow.xaml.cs]"]
end

subgraph group_calculation["Calculation"]
  node_math_helper["Scientific operations<br/>[MathHelper.cs]"]
  node_format_attribute["Operation formatting"]
  node_dotnet_math[".NET Math"]
end

subgraph group_memory["Memory"]
  node_memory_panel["Memory number panel"]
end

node_user(("Calculator user"))

node_user -->|"uses"| node_main_ui
node_main_logic -->|"discovers and invokes"| node_math_helper
node_main_logic -->|"reads formats"| node_format_attribute
node_main_logic -->|"discovers and invokes"| node_dotnet_math
node_main_logic -->|"creates and handles"| node_memory_panel

click node_main_ui "https://github.com/thefocusman/caluctor/blob/master/MainWindow.xaml"
click node_main_logic "https://github.com/thefocusman/caluctor/blob/master/MainWindow.xaml.cs"
click node_math_helper "https://github.com/thefocusman/caluctor/blob/master/MathHelper.cs"
click node_format_attribute "https://github.com/thefocusman/caluctor/blob/master/OutputFormatAttribute.cs"
click node_memory_panel "https://github.com/thefocusman/caluctor/blob/master/MemeryNumberPanel.xaml.cs"

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_ui,node_main_logic,node_user toneBlue
class node_math_helper,node_format_attribute,node_dotnet_math toneAmber
class node_memory_panel toneMint
```

## Components

### Calculator interface

- [Calculator window](https://github.com/thefocusman/caluctor/blob/master/MainWindow.xaml): `MainWindow.xaml`
- [Calculator workflow](https://github.com/thefocusman/caluctor/blob/master/MainWindow.xaml.cs): `MainWindow.xaml.cs`

### Calculation

- [Scientific operations](https://github.com/thefocusman/caluctor/blob/master/MathHelper.cs): `MathHelper.cs`
- [Operation formatting](https://github.com/thefocusman/caluctor/blob/master/OutputFormatAttribute.cs): `OutputFormatAttribute.cs`
- **.NET Math**

### Memory

- [Memory number panel](https://github.com/thefocusman/caluctor/blob/master/MemeryNumberPanel.xaml.cs): `MemeryNumberPanel.xaml.cs`

### Other components

- **Calculator user**

## Connections

- Calculator user → Calculator window: uses (evidence: `README.md`)
- Calculator workflow → Scientific operations: discovers and invokes (evidence: `MainWindow.xaml.cs`)
- Calculator workflow → Operation formatting: reads formats (evidence: `MainWindow.xaml.cs`)
- Calculator workflow → .NET Math: discovers and invokes (evidence: `MainWindow.xaml.cs`)
- Calculator workflow → Memory number panel: creates and handles (evidence: `MainWindow.xaml.cs`)
