# fluo6/ifc-viewer architecture

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

## Overview

IFC Viewer is a local IFC model inspection app, also usable as a browser app on a trusted LAN. The main workflow is to open or drop an IFC file, load and render it in the viewer, then inspect element parameters or use visibility, clipping, edge, and measurement controls. Attribute export builds a workbook from extracted parameters, using browser download or the Electron file-writing bridge. The README documents LAN operation and raw-IFC parameter extraction; unsampled implementation details are represented only where the README or source index supports them.

Main entry points: [`src/viewer.ts`](https://github.com/fluo6/ifc-viewer/blob/master/src/viewer.ts) (IFC viewer), [`src/ui/export.ts`](https://github.com/fluo6/ifc-viewer/blob/master/src/ui/export.ts) (Export controls), [`src/ui/properties.ts`](https://github.com/fluo6/ifc-viewer/blob/master/src/ui/properties.ts) (Properties panel), [`src/ui/toolbar.ts`](https://github.com/fluo6/ifc-viewer/blob/master/src/ui/toolbar.ts) (File opening)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Opening and rendering"]
  node_file_open["File opening<br/>[toolbar.ts]"]
  node_dropzone["Drag and drop<br/>[dropzone.ts]"]
  node_viewer["IFC viewer<br/>[viewer.ts]"]
end

subgraph group_inspect["Model inspection"]
  node_raw_reader["Raw IFC reader<br/>[ifc-parameters.ts]"]
  node_property_sets["IFC set extraction<br/>[ifc-sets.ts]"]
  node_properties["Properties panel<br/>[properties.ts]"]
  node_categories["Class visibility<br/>[categories.ts]"]
  node_clipping["Horizontal clipping<br/>[clipper.ts]"]
  node_edges["Edge display<br/>[edges.ts]"]
  node_measurement["Ruler measurement<br/>[ruler.ts]"]
  node_keybindings["Keyboard controls<br/>[keybindings.ts]"]
  node_format["Value formatting<br/>[format.ts]"]
end

subgraph group_export["Attribute export"]
  node_export_ui["Export controls<br/>[export.ts]"]
  node_report["Workbook model<br/>[report.ts]"]
  node_browser_download["Browser download<br/>[export.ts]"]
end

subgraph group_desktop["Desktop integration"]
  node_electron_main["Electron host<br/>[main.ts]"]
  node_xlsx_writer["XLSX file writer<br/>[xlsx-writer.ts]"]
end

node_user(("User"))

node_user -->|"chooses file"| node_file_open
node_user -->|"drops file"| node_dropzone
node_file_open -->|"loads IFC"| node_viewer
node_dropzone -->|"loads IFC"| node_viewer
node_viewer -->|"reads parameters"| node_raw_reader
node_viewer -->|"collects sets"| node_property_sets
node_properties -->|"requests selection data"| node_viewer
node_properties -->|"formats values"| node_format
node_categories -->|"toggles classes"| node_viewer
node_clipping -->|"sets clipping"| node_viewer
node_edges -->|"toggles edges"| node_viewer
node_measurement -->|"places points"| node_viewer
node_keybindings -->|"controls viewer"| node_viewer
node_export_ui -->|"collects attributes"| node_viewer
node_export_ui -->|"builds workbook"| node_report
node_export_ui -->|"downloads workbook"| node_browser_download
node_export_ui -->|"requests file save"| node_electron_main
node_electron_main -->|"writes workbook"| node_xlsx_writer

click node_file_open "https://github.com/fluo6/ifc-viewer/blob/master/src/ui/toolbar.ts"
click node_dropzone "https://github.com/fluo6/ifc-viewer/blob/master/src/ui/dropzone.ts"
click node_viewer "https://github.com/fluo6/ifc-viewer/blob/master/src/viewer.ts"
click node_raw_reader "https://github.com/fluo6/ifc-viewer/blob/master/src/ifc-parameters.ts"
click node_property_sets "https://github.com/fluo6/ifc-viewer/blob/master/src/ifc-sets.ts"
click node_properties "https://github.com/fluo6/ifc-viewer/blob/master/src/ui/properties.ts"
click node_categories "https://github.com/fluo6/ifc-viewer/blob/master/src/ui/categories.ts"
click node_clipping "https://github.com/fluo6/ifc-viewer/blob/master/src/ui/clipper.ts"
click node_edges "https://github.com/fluo6/ifc-viewer/blob/master/src/ui/edges.ts"
click node_measurement "https://github.com/fluo6/ifc-viewer/blob/master/src/ui/ruler.ts"
click node_keybindings "https://github.com/fluo6/ifc-viewer/blob/master/src/ui/keybindings.ts"
click node_format "https://github.com/fluo6/ifc-viewer/blob/master/src/format.ts"
click node_export_ui "https://github.com/fluo6/ifc-viewer/blob/master/src/ui/export.ts"
click node_report "https://github.com/fluo6/ifc-viewer/blob/master/src/report.ts"
click node_browser_download "https://github.com/fluo6/ifc-viewer/blob/master/src/ui/export.ts"
click node_electron_main "https://github.com/fluo6/ifc-viewer/blob/master/electron/main.ts"
click node_xlsx_writer "https://github.com/fluo6/ifc-viewer/blob/master/electron/xlsx-writer.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_file_open,node_dropzone,node_viewer,node_user toneBlue
class node_raw_reader,node_property_sets,node_properties,node_categories,node_clipping,node_edges,node_measurement,node_keybindings,node_format toneAmber
class node_export_ui,node_report,node_browser_download toneMint
class node_electron_main,node_xlsx_writer toneRose
```

## Components

### Opening and rendering

- [File opening](https://github.com/fluo6/ifc-viewer/blob/master/src/ui/toolbar.ts): `src/ui/toolbar.ts`
- [Drag and drop](https://github.com/fluo6/ifc-viewer/blob/master/src/ui/dropzone.ts): `src/ui/dropzone.ts`
- [IFC viewer](https://github.com/fluo6/ifc-viewer/blob/master/src/viewer.ts): `src/viewer.ts`

### Model inspection

- [Raw IFC reader](https://github.com/fluo6/ifc-viewer/blob/master/src/ifc-parameters.ts): `src/ifc-parameters.ts`
- [IFC set extraction](https://github.com/fluo6/ifc-viewer/blob/master/src/ifc-sets.ts): `src/ifc-sets.ts`
- [Properties panel](https://github.com/fluo6/ifc-viewer/blob/master/src/ui/properties.ts): `src/ui/properties.ts`
- [Class visibility](https://github.com/fluo6/ifc-viewer/blob/master/src/ui/categories.ts): `src/ui/categories.ts`
- [Horizontal clipping](https://github.com/fluo6/ifc-viewer/blob/master/src/ui/clipper.ts): `src/ui/clipper.ts`
- [Edge display](https://github.com/fluo6/ifc-viewer/blob/master/src/ui/edges.ts): `src/ui/edges.ts`
- [Ruler measurement](https://github.com/fluo6/ifc-viewer/blob/master/src/ui/ruler.ts): `src/ui/ruler.ts`
- [Keyboard controls](https://github.com/fluo6/ifc-viewer/blob/master/src/ui/keybindings.ts): `src/ui/keybindings.ts`
- [Value formatting](https://github.com/fluo6/ifc-viewer/blob/master/src/format.ts): `src/format.ts`

### Attribute export

- [Export controls](https://github.com/fluo6/ifc-viewer/blob/master/src/ui/export.ts): `src/ui/export.ts`
- [Workbook model](https://github.com/fluo6/ifc-viewer/blob/master/src/report.ts): `src/report.ts`
- [Browser download](https://github.com/fluo6/ifc-viewer/blob/master/src/ui/export.ts): `src/ui/export.ts`

### Desktop integration

- [Electron host](https://github.com/fluo6/ifc-viewer/blob/master/electron/main.ts): `electron/main.ts`
- [XLSX file writer](https://github.com/fluo6/ifc-viewer/blob/master/electron/xlsx-writer.ts): `electron/xlsx-writer.ts`

### Other components

- **User**

## Connections

- User → File opening: chooses file (evidence: `README.md`)
- User → Drag and drop: drops file (evidence: `README.md`)
- File opening → IFC viewer: loads IFC (evidence: `src/ui/toolbar.ts`)
- Drag and drop → IFC viewer: loads IFC (evidence: `src/ui/dropzone.ts`)
- IFC viewer → Raw IFC reader: reads parameters (evidence: `src/viewer.ts`)
- IFC viewer → IFC set extraction: collects sets (evidence: `src/viewer.ts`)
- Properties panel → IFC viewer: requests selection data (evidence: `src/ui/properties.ts`)
- Properties panel → Value formatting: formats values (evidence: `src/ui/properties.ts`)
- Class visibility → IFC viewer: toggles classes (evidence: `src/ui/categories.ts`)
- Horizontal clipping → IFC viewer: sets clipping (evidence: `src/ui/clipper.ts`)
- Edge display → IFC viewer: toggles edges (evidence: `src/ui/edges.ts`)
- Ruler measurement → IFC viewer: places points (evidence: `src/ui/ruler.ts`)
- Keyboard controls → IFC viewer: controls viewer (evidence: `src/ui/keybindings.ts`)
- Export controls → IFC viewer: collects attributes (evidence: `src/ui/export.ts`)
- Export controls → Workbook model: builds workbook (evidence: `src/ui/export.ts`)
- Export controls → Browser download: downloads workbook (evidence: `src/ui/export.ts`)
- Export controls → Electron host: requests file save (evidence: `src/ui/export.ts`)
- Electron host → XLSX file writer: writes workbook (evidence: `electron/main.ts`)
