# igoethal/eendraadschema architecture

> Architecture diagram of the GitHub repository igoethal/eendraadschema, 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/igoethal/eendraadschema
- Repository: https://github.com/igoethal/eendraadschema

## Overview

Eendraadschema Community is a browser-based editor for Belgian AREI-compliant one-line electrical diagrams. Users create and edit a hierarchical diagram from electrical-symbol items, can edit a related situation plan, and can save, reopen, import, or export their work; printing and SVG output are also documented in the interface and source. The graph preserves these major product areas. Several connections are documented by the source index or README rather than shown in excerpts, so those edges are dashed and unverified.

Main entry points: [`src/Hierarchical_List.ts`](https://github.com/igoethal/eendraadschema/blob/master/src/Hierarchical_List.ts) (Diagram editor), [`src/main.ts`](https://github.com/igoethal/eendraadschema/blob/master/src/main.ts) (Application startup), [`src/print/print.ts`](https://github.com/igoethal/eendraadschema/blob/master/src/print/print.ts) (Print workflow), [`src/importExport/importExport.ts`](https://github.com/igoethal/eendraadschema/blob/master/src/importExport/importExport.ts) (Import and export)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_editor["Diagram editor"]
  node_app["Application startup<br/>[main.ts]"]
  node_menu["Top menu<br/>[TopMenu.ts]"]
  node_hierarchy["Diagram editor"]
end

subgraph group_model["Diagram model"]
  node_diagram_items["Electrical items<br/>[Electro_Item.ts]"]
  node_switches["Switch groups<br/>[Schakelaars.ts]"]
  node_circuit["Circuit item<br/>[Kring.ts]"]
  node_board["Distribution board<br/>[Bord.ts]"]
  node_switch_symbol["Switch symbols<br/>[Schakelaar.ts]"]
  node_svg_symbols["SVG symbols<br/>[SVGSymbols.ts]"]
  node_svg_element["SVG element<br/>[SVGelement.ts]"]
end

subgraph group_situation["Situation plan"]
  node_situation_view["Plan editor"]
  node_situation_model["Plan model<br/>[SituationPlan.ts]"]
  node_situation_element["Plan elements"]
  node_plan_properties["Plan properties"]
end

subgraph group_files["Files and persistence"]
  node_autosave["Automatic saving<br/>[AutoSaver.ts]"]
  node_storage[("Browser storage")]
  node_storage_levels["Storage selection"]
  node_file_io["Import and export<br/>[importExport.ts]"]
end

subgraph group_output["Print and export"]
  node_print["Print workflow<br/>[print.ts]"]
  node_print_table["Print layout<br/>[Print_Table.ts]"]
  node_pdf["PDF output<br/>[printToJsPDF.ts]"]
end

node_user(("Diagram user"))
node_browser_files["Local files"]
node_browser_print["Browser print or download"]

node_user -.->|"opens editor"| node_app
node_app -->|"creates diagram"| node_hierarchy
node_app -.->|"initializes menu"| node_menu
node_hierarchy -.->|"creates item types"| node_diagram_items
node_hierarchy -->|"builds SVG"| node_svg_element
node_diagram_items -.->|"uses symbols"| node_svg_symbols
node_diagram_items -.->|"renders as SVG"| node_svg_element
node_switches -->|"builds symbol chain"| node_switch_symbol
node_hierarchy -.->|"opens plan editor"| node_situation_view
node_situation_view -.->|"edits plan"| node_situation_model
node_situation_view -.->|"manages elements"| node_situation_element
node_plan_properties -.->|"edits properties"| node_situation_element
node_app -.->|"initializes autosave"| node_autosave
node_autosave -.->|"reads diagram"| node_hierarchy
node_autosave -.->|"persists data"| node_storage
node_app -.->|"configures storage"| node_storage_levels
node_storage_levels -.->|"uses backend"| node_storage
node_user -.->|"imports or exports"| node_file_io
node_browser_files -->|"provides import"| node_file_io
node_file_io -->|"reconstructs diagram"| node_hierarchy
node_file_io -->|"reconstructs plan"| node_situation_model
node_app -.->|"offers printing"| node_print
node_print -.->|"reads diagram"| node_hierarchy
node_print -.->|"formats pages"| node_print_table
node_print -->|"generates PDF"| node_pdf
node_print -.->|"prints or downloads"| node_browser_print

click node_app "https://github.com/igoethal/eendraadschema/blob/master/src/main.ts"
click node_menu "https://github.com/igoethal/eendraadschema/blob/master/src/TopMenu.ts"
click node_hierarchy "https://github.com/igoethal/eendraadschema/blob/master/src/Hierarchical_List.ts"
click node_diagram_items "https://github.com/igoethal/eendraadschema/blob/master/src/List_Item/Electro_Item.ts"
click node_switches "https://github.com/igoethal/eendraadschema/blob/master/src/List_Item/Schakelaars/Schakelaars.ts"
click node_circuit "https://github.com/igoethal/eendraadschema/blob/master/src/List_Item/Kring.ts"
click node_board "https://github.com/igoethal/eendraadschema/blob/master/src/List_Item/Bord.ts"
click node_switch_symbol "https://github.com/igoethal/eendraadschema/blob/master/src/List_Item/Schakelaars/Schakelaar.ts"
click node_svg_symbols "https://github.com/igoethal/eendraadschema/blob/master/src/SVGSymbols.ts"
click node_svg_element "https://github.com/igoethal/eendraadschema/blob/master/src/SVGelement.ts"
click node_situation_view "https://github.com/igoethal/eendraadschema/blob/master/src/sitplan/SituationPlanView.ts"
click node_situation_model "https://github.com/igoethal/eendraadschema/blob/master/src/sitplan/SituationPlan.ts"
click node_situation_element "https://github.com/igoethal/eendraadschema/blob/master/src/sitplan/SituationPlanElement.ts"
click node_plan_properties "https://github.com/igoethal/eendraadschema/blob/master/src/sitplan/SituationPlanView_ElementPropertiesPopup.ts"
click node_autosave "https://github.com/igoethal/eendraadschema/blob/master/src/importExport/AutoSaver.ts"
click node_storage "https://github.com/igoethal/eendraadschema/blob/master/src/storage/IndexedDBStorage.ts"
click node_storage_levels "https://github.com/igoethal/eendraadschema/blob/master/src/storage/MultiLevelStorage.ts"
click node_file_io "https://github.com/igoethal/eendraadschema/blob/master/src/importExport/importExport.ts"
click node_print "https://github.com/igoethal/eendraadschema/blob/master/src/print/print.ts"
click node_print_table "https://github.com/igoethal/eendraadschema/blob/master/src/print/Print_Table.ts"
click node_pdf "https://github.com/igoethal/eendraadschema/blob/master/src/print/printToJsPDF.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_app,node_menu,node_hierarchy,node_user,node_browser_print toneBlue
class node_diagram_items,node_switches,node_circuit,node_board,node_switch_symbol,node_svg_symbols,node_svg_element toneAmber
class node_situation_view,node_situation_model,node_situation_element,node_plan_properties toneMint
class node_autosave,node_storage,node_storage_levels,node_file_io toneRose
class node_print,node_print_table,node_pdf,node_browser_files toneIndigo
```

## Components

### Diagram editor

- [Application startup](https://github.com/igoethal/eendraadschema/blob/master/src/main.ts): `src/main.ts`
- [Top menu](https://github.com/igoethal/eendraadschema/blob/master/src/TopMenu.ts): `src/TopMenu.ts`
- [Diagram editor](https://github.com/igoethal/eendraadschema/blob/master/src/Hierarchical_List.ts): `src/Hierarchical_List.ts`

### Diagram model

- [Electrical items](https://github.com/igoethal/eendraadschema/blob/master/src/List_Item/Electro_Item.ts): `src/List_Item/Electro_Item.ts`
- [Switch groups](https://github.com/igoethal/eendraadschema/blob/master/src/List_Item/Schakelaars/Schakelaars.ts): `src/List_Item/Schakelaars/Schakelaars.ts`
- [Circuit item](https://github.com/igoethal/eendraadschema/blob/master/src/List_Item/Kring.ts): `src/List_Item/Kring.ts`
- [Distribution board](https://github.com/igoethal/eendraadschema/blob/master/src/List_Item/Bord.ts): `src/List_Item/Bord.ts`
- [Switch symbols](https://github.com/igoethal/eendraadschema/blob/master/src/List_Item/Schakelaars/Schakelaar.ts): `src/List_Item/Schakelaars/Schakelaar.ts`
- [SVG symbols](https://github.com/igoethal/eendraadschema/blob/master/src/SVGSymbols.ts): `src/SVGSymbols.ts`
- [SVG element](https://github.com/igoethal/eendraadschema/blob/master/src/SVGelement.ts): `src/SVGelement.ts`

### Situation plan

- [Plan editor](https://github.com/igoethal/eendraadschema/blob/master/src/sitplan/SituationPlanView.ts): `src/sitplan/SituationPlanView.ts`
- [Plan model](https://github.com/igoethal/eendraadschema/blob/master/src/sitplan/SituationPlan.ts): `src/sitplan/SituationPlan.ts`
- [Plan elements](https://github.com/igoethal/eendraadschema/blob/master/src/sitplan/SituationPlanElement.ts): `src/sitplan/SituationPlanElement.ts`
- [Plan properties](https://github.com/igoethal/eendraadschema/blob/master/src/sitplan/SituationPlanView_ElementPropertiesPopup.ts): `src/sitplan/SituationPlanView_ElementPropertiesPopup.ts`

### Files and persistence

- [Automatic saving](https://github.com/igoethal/eendraadschema/blob/master/src/importExport/AutoSaver.ts): `src/importExport/AutoSaver.ts`
- [Browser storage](https://github.com/igoethal/eendraadschema/blob/master/src/storage/IndexedDBStorage.ts): `src/storage/IndexedDBStorage.ts`
- [Storage selection](https://github.com/igoethal/eendraadschema/blob/master/src/storage/MultiLevelStorage.ts): `src/storage/MultiLevelStorage.ts`
- [Import and export](https://github.com/igoethal/eendraadschema/blob/master/src/importExport/importExport.ts): `src/importExport/importExport.ts`

### Print and export

- [Print workflow](https://github.com/igoethal/eendraadschema/blob/master/src/print/print.ts): `src/print/print.ts`
- [Print layout](https://github.com/igoethal/eendraadschema/blob/master/src/print/Print_Table.ts): `src/print/Print_Table.ts`
- [PDF output](https://github.com/igoethal/eendraadschema/blob/master/src/print/printToJsPDF.ts): `src/print/printToJsPDF.ts`

### Other components

- **Diagram user**
- **Local files**
- **Browser print or download**

## Connections

- Diagram user → Application startup: opens editor
- Application startup → Diagram editor: creates diagram (evidence: `src/main.ts`)
- Application startup → Top menu: initializes menu (evidence: `src/main.ts`)
- Diagram editor → Electrical items: creates item types (evidence: `src/Hierarchical_List.ts`)
- Diagram editor → SVG element: builds SVG (evidence: `src/Hierarchical_List.ts`)
- Electrical items → SVG symbols: uses symbols (evidence: `src/List_Item/Electro_Item.ts`)
- Electrical items → SVG element: renders as SVG (evidence: `src/List_Item/Electro_Item.ts`)
- Switch groups → Switch symbols: builds symbol chain (evidence: `src/List_Item/Schakelaars/Schakelaars.ts`)
- Diagram editor → Plan editor: opens plan editor
- Plan editor → Plan model: edits plan (evidence: `src/sitplan/SituationPlanView.ts`)
- Plan editor → Plan elements: manages elements (evidence: `src/sitplan/SituationPlanView.ts`)
- Plan properties → Plan elements: edits properties (evidence: `src/sitplan/SituationPlanView_ElementPropertiesPopup.ts`)
- Application startup → Automatic saving: initializes autosave (evidence: `src/main.ts`)
- Automatic saving → Diagram editor: reads diagram (evidence: `src/importExport/AutoSaver.ts`)
- Automatic saving → Browser storage: persists data (evidence: `src/importExport/AutoSaver.ts`)
- Application startup → Storage selection: configures storage (evidence: `src/main.ts`)
- Storage selection → Browser storage: uses backend
- Diagram user → Import and export: imports or exports
- Local files → Import and export: provides import (evidence: `src/importExport/importExport.ts`)
- Import and export → Diagram editor: reconstructs diagram (evidence: `src/importExport/importExport.ts`)
- Import and export → Plan model: reconstructs plan (evidence: `src/importExport/importExport.ts`)
- Application startup → Print workflow: offers printing (evidence: `src/main.ts`)
- Print workflow → Diagram editor: reads diagram
- Print workflow → Print layout: formats pages
- Print workflow → PDF output: generates PDF (evidence: `src/print/print.ts`)
- Print workflow → Browser print or download: prints or downloads
