# anu3ev/image-editor architecture

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

- Interactive diagram: https://gitdiagram.com/anu3ev/image-editor
- Repository: https://github.com/anu3ev/image-editor

## Overview

Fabric Image Editor is a browser-based visual editor whose host-facing workflow initializes an editor, then uses its managers to edit canvas content and export results. The map preserves the documented editing capabilities and groups related runtime managers rather than cataloguing helper files. The source excerpts show editor initialization and selected shape, text, and snapping internals; other manager relationships are included only where the README documents them.

Main entry points: [`src/editor/index.ts`](https://github.com/anu3ev/image-editor/blob/master/src/editor/index.ts) (Editor runtime), [`src/editor/shape-manager`](https://github.com/anu3ev/image-editor/tree/master/src/editor/shape-manager) (Shape editing), [`src/main.ts`](https://github.com/anu3ev/image-editor/blob/master/src/main.ts) (Init entry), [`src/editor/history-manager/index.ts`](https://github.com/anu3ev/image-editor/blob/master/src/editor/history-manager/index.ts) (History manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Editor runtime"]
  node_editor["Editor runtime<br/>[index.ts]"]
  node_canvas["Canvas manager<br/>[index.ts]"]
  node_history["History manager<br/>[index.ts]"]
end

subgraph group_canvas_ops["Canvas operations"]
  node_image["Image manager<br/>[index.ts]"]
  node_crop["Crop manager<br/>[index.ts]"]
  node_layers["Layer manager<br/>[index.ts]"]
  node_transform["Transform manager<br/>[index.ts]"]
end

subgraph group_content["Content editing"]
  node_background["Background manager<br/>[index.ts]"]
  node_text["Text editing"]
  node_shapes["Shape editing"]
  node_templates["Template restore<br/>[index.ts]"]
end

subgraph group_interaction["Interaction tools"]
  node_selection["Selection manager<br/>[index.ts]"]
  node_snapping["Snapping manager"]
  node_measurement["Live measurements<br/>[index.ts]"]
  node_geometry["Geometry utilities<br/>[geometry.ts]"]
end

subgraph group_integration["Host integration"]
  node_entry["Init entry<br/>[main.ts]"]
  node_toolbar["Toolbar manager<br/>[index.ts]"]
  node_font["Font manager<br/>[index.ts]"]
  node_clipboard["Clipboard manager<br/>[index.ts]"]
  node_deletion["Deletion manager<br/>[index.ts]"]
  node_worker["Worker manager<br/>[index.ts]"]
  node_events["Editor events<br/>[listeners.ts]"]
end

node_host(("Host application"))

node_host -->|"initializes"| node_entry
node_entry -->|"imports"| node_editor
node_editor -->|"creates"| node_history
node_editor -->|"creates"| node_toolbar
node_editor -->|"creates"| node_transform
node_editor -->|"creates"| node_canvas
node_editor -->|"creates"| node_image
node_editor -->|"creates"| node_layers
node_editor -->|"creates"| node_shapes
node_editor -->|"loads fonts"| node_font
node_host -->|"imports, exports"| node_image
node_host -->|"sets backgrounds"| node_background
node_host -->|"edits text"| node_text
node_host -->|"crops images"| node_crop
node_host -->|"manages layers"| node_layers
node_host -->|"undoes changes"| node_history
node_host -->|"restores templates"| node_templates
node_host -->|"selects objects"| node_selection
node_host -->|"aligns objects"| node_snapping
node_host -->|"views distances"| node_measurement
node_host -->|"copies objects"| node_clipboard
node_host -->|"guards deletion"| node_deletion
node_host -->|"runs operations"| node_worker
node_host -->|"subscribes events"| node_events
node_shapes -.->|"uses geometry"| node_geometry

click node_entry "https://github.com/anu3ev/image-editor/blob/master/src/main.ts"
click node_editor "https://github.com/anu3ev/image-editor/blob/master/src/editor/index.ts"
click node_canvas "https://github.com/anu3ev/image-editor/blob/master/src/editor/canvas-manager/index.ts"
click node_history "https://github.com/anu3ev/image-editor/blob/master/src/editor/history-manager/index.ts"
click node_image "https://github.com/anu3ev/image-editor/blob/master/src/editor/image-manager/index.ts"
click node_crop "https://github.com/anu3ev/image-editor/blob/master/src/editor/crop-manager/index.ts"
click node_layers "https://github.com/anu3ev/image-editor/blob/master/src/editor/layer-manager/index.ts"
click node_transform "https://github.com/anu3ev/image-editor/blob/master/src/editor/transform-manager/index.ts"
click node_background "https://github.com/anu3ev/image-editor/blob/master/src/editor/background-manager/index.ts"
click node_text "https://github.com/anu3ev/image-editor/tree/master/src/editor/text-manager"
click node_shapes "https://github.com/anu3ev/image-editor/tree/master/src/editor/shape-manager"
click node_templates "https://github.com/anu3ev/image-editor/blob/master/src/editor/template-manager/index.ts"
click node_selection "https://github.com/anu3ev/image-editor/blob/master/src/editor/selection-manager/index.ts"
click node_snapping "https://github.com/anu3ev/image-editor/tree/master/src/editor/snapping-manager"
click node_measurement "https://github.com/anu3ev/image-editor/blob/master/src/editor/measurement-manager/index.ts"
click node_toolbar "https://github.com/anu3ev/image-editor/blob/master/src/editor/ui/toolbar-manager/index.ts"
click node_font "https://github.com/anu3ev/image-editor/blob/master/src/editor/font-manager/index.ts"
click node_clipboard "https://github.com/anu3ev/image-editor/blob/master/src/editor/clipboard-manager/index.ts"
click node_deletion "https://github.com/anu3ev/image-editor/blob/master/src/editor/deletion-manager/index.ts"
click node_worker "https://github.com/anu3ev/image-editor/blob/master/src/editor/worker-manager/index.ts"
click node_events "https://github.com/anu3ev/image-editor/blob/master/src/editor/listeners.ts"
click node_geometry "https://github.com/anu3ev/image-editor/blob/master/src/editor/utils/geometry.ts"

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_editor,node_canvas,node_history toneBlue
class node_image,node_crop,node_layers,node_transform toneAmber
class node_background,node_text,node_shapes,node_templates toneMint
class node_selection,node_snapping,node_measurement,node_geometry toneRose
class node_entry,node_toolbar,node_font,node_clipboard,node_deletion,node_worker,node_events,node_host toneIndigo
```

## Components

### Editor runtime

- [Editor runtime](https://github.com/anu3ev/image-editor/blob/master/src/editor/index.ts): `src/editor/index.ts`
- [Canvas manager](https://github.com/anu3ev/image-editor/blob/master/src/editor/canvas-manager/index.ts): `src/editor/canvas-manager/index.ts`
- [History manager](https://github.com/anu3ev/image-editor/blob/master/src/editor/history-manager/index.ts): `src/editor/history-manager/index.ts`

### Canvas operations

- [Image manager](https://github.com/anu3ev/image-editor/blob/master/src/editor/image-manager/index.ts): `src/editor/image-manager/index.ts`
- [Crop manager](https://github.com/anu3ev/image-editor/blob/master/src/editor/crop-manager/index.ts): `src/editor/crop-manager/index.ts`
- [Layer manager](https://github.com/anu3ev/image-editor/blob/master/src/editor/layer-manager/index.ts): `src/editor/layer-manager/index.ts`
- [Transform manager](https://github.com/anu3ev/image-editor/blob/master/src/editor/transform-manager/index.ts): `src/editor/transform-manager/index.ts`

### Content editing

- [Background manager](https://github.com/anu3ev/image-editor/blob/master/src/editor/background-manager/index.ts): `src/editor/background-manager/index.ts`
- [Text editing](https://github.com/anu3ev/image-editor/tree/master/src/editor/text-manager): `src/editor/text-manager`
- [Shape editing](https://github.com/anu3ev/image-editor/tree/master/src/editor/shape-manager): `src/editor/shape-manager`
- [Template restore](https://github.com/anu3ev/image-editor/blob/master/src/editor/template-manager/index.ts): `src/editor/template-manager/index.ts`

### Interaction tools

- [Selection manager](https://github.com/anu3ev/image-editor/blob/master/src/editor/selection-manager/index.ts): `src/editor/selection-manager/index.ts`
- [Snapping manager](https://github.com/anu3ev/image-editor/tree/master/src/editor/snapping-manager): `src/editor/snapping-manager`
- [Live measurements](https://github.com/anu3ev/image-editor/blob/master/src/editor/measurement-manager/index.ts): `src/editor/measurement-manager/index.ts`
- [Geometry utilities](https://github.com/anu3ev/image-editor/blob/master/src/editor/utils/geometry.ts): `src/editor/utils/geometry.ts`

### Host integration

- [Init entry](https://github.com/anu3ev/image-editor/blob/master/src/main.ts): `src/main.ts`
- [Toolbar manager](https://github.com/anu3ev/image-editor/blob/master/src/editor/ui/toolbar-manager/index.ts): `src/editor/ui/toolbar-manager/index.ts`
- [Font manager](https://github.com/anu3ev/image-editor/blob/master/src/editor/font-manager/index.ts): `src/editor/font-manager/index.ts`
- [Clipboard manager](https://github.com/anu3ev/image-editor/blob/master/src/editor/clipboard-manager/index.ts): `src/editor/clipboard-manager/index.ts`
- [Deletion manager](https://github.com/anu3ev/image-editor/blob/master/src/editor/deletion-manager/index.ts): `src/editor/deletion-manager/index.ts`
- [Worker manager](https://github.com/anu3ev/image-editor/blob/master/src/editor/worker-manager/index.ts): `src/editor/worker-manager/index.ts`
- [Editor events](https://github.com/anu3ev/image-editor/blob/master/src/editor/listeners.ts): `src/editor/listeners.ts`

### Other components

- **Host application**

## Connections

- Host application → Init entry: initializes (evidence: `README.md`)
- Init entry → Editor runtime: imports (evidence: `src/main.ts`)
- Editor runtime → History manager: creates (evidence: `src/editor/index.ts`)
- Editor runtime → Toolbar manager: creates (evidence: `src/editor/index.ts`)
- Editor runtime → Transform manager: creates (evidence: `src/editor/index.ts`)
- Editor runtime → Canvas manager: creates (evidence: `src/editor/index.ts`)
- Editor runtime → Image manager: creates (evidence: `src/editor/index.ts`)
- Editor runtime → Layer manager: creates (evidence: `src/editor/index.ts`)
- Editor runtime → Shape editing: creates (evidence: `src/editor/index.ts`)
- Editor runtime → Font manager: loads fonts (evidence: `src/editor/index.ts`)
- Host application → Image manager: imports, exports (evidence: `README.md`)
- Host application → Background manager: sets backgrounds (evidence: `README.md`)
- Host application → Text editing: edits text (evidence: `README.md`)
- Host application → Crop manager: crops images (evidence: `README.md`)
- Host application → Layer manager: manages layers (evidence: `README.md`)
- Host application → History manager: undoes changes (evidence: `README.md`)
- Host application → Template restore: restores templates (evidence: `README.md`)
- Host application → Selection manager: selects objects (evidence: `README.md`)
- Host application → Snapping manager: aligns objects (evidence: `README.md`)
- Host application → Live measurements: views distances (evidence: `README.md`)
- Host application → Clipboard manager: copies objects (evidence: `README.md`)
- Host application → Deletion manager: guards deletion (evidence: `README.md`)
- Host application → Worker manager: runs operations (evidence: `README.md`)
- Host application → Editor events: subscribes events (evidence: `README.md`)
- Shape editing → Geometry utilities: uses geometry
