# qax-os/excelize architecture

> Architecture diagram of the GitHub repository qax-os/excelize, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/qax-os/excelize
- Repository: https://github.com/qax-os/excelize

## Overview

##### Main Components

a) Core Processing Layer:
- File Operations Module (based on file.go)
- XML Processing Components (evident from multiple xml*.go files)
- Calculation Engine (calc.go, calcchain.go)
- Cell Management System (cell.go)

b) Feature Modules:
- Chart Generation (chart.go)
- Drawing Management (drawing.go)
- Style Processing (styles.go)
- Data Validation (datavalidation.go)
- Stream Processing (stream.go)
- Security/Encryption (crypt.go)

c) Data Structure Layer:
- Workbook Management (workbook.go)
- Worksheet Handling (sheet.go)
- Row/Column Operations (rows.go, col.go)

**┌─────────────────────── Application Layer ───────────────────────┐**

- Public API (excelize.go as main interface)           │

- Feature Layer ──────────────────────────┤

- Charts  │  Images  │  Tables  │  PivotTables  │  Validation  │

- Core Processing Layer ────────────────────┤

- XML Processing    │    Calculation Engine    │   Storage    │

- Data Structure Layer ─────────────────────┤

- Workbook   │   Worksheet   │   Cells   │   Styles   │       │

- I/O Layer ────────────────────────────┘

##### Important Details

- File Format Support:
- XLAM / XLSM / XLSX / XLTM / XLTX compatibility
- Excel 2007+ support

- Stream Processing Capability:
- Separate path for streaming operations
- Large data handling capability

##### Integration Points

- External interfaces:
- File system interaction
- Image processing support
- XML parsing/generation

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Application Layer"
        API["Public API"]:::api
    end

    subgraph "Feature Layer"
        Charts["Chart Generation"]:::feature
        Images["Image Processing"]:::feature
        Tables["Table Operations"]:::feature
        PivotTables["Pivot Tables"]:::feature
        Validation["Data Validation"]:::feature
        Security["Security/Encryption"]:::feature
    end

    subgraph "Core Processing Layer"
        XML["XML Processing"]:::core
        CalcEngine["Calculation Engine"]:::core
        Storage["Storage Management"]:::core
        FileOps["File Operations"]:::core
    end

    subgraph "Data Structure Layer"
        Workbook["Workbook Management"]:::data
        Worksheet["Worksheet Handling"]:::data
        Cells["Cell Management"]:::data
        Styles["Style Processing"]:::data
    end

    subgraph "I/O Layer"
        FileIO["File I/O"]:::io
        StreamIO["Stream Processing"]:::io
    end

    %% Connections
    API --> Charts & Images & Tables & PivotTables & Validation & Security
    Charts & Images & Tables & PivotTables & Validation --> XML
    XML --> CalcEngine
    CalcEngine --> Storage
    Storage --> FileOps
    FileOps --> Workbook
    Workbook --> Worksheet
    Worksheet --> Cells
    Cells --> Styles
    Styles --> FileIO
    StreamIO --> FileIO

    %% Click Events
    click API "https://github.com/qax-os/excelize/blob/master/excelize.go"
    click Charts "https://github.com/qax-os/excelize/blob/master/chart.go"
    click Tables "https://github.com/qax-os/excelize/blob/master/table.go"
    click PivotTables "https://github.com/qax-os/excelize/blob/master/pivotTable.go"
    click Validation "https://github.com/qax-os/excelize/blob/master/datavalidation.go"
    click Security "https://github.com/qax-os/excelize/blob/master/crypt.go"
    click XML "https://github.com/qax-os/excelize/blob/master/xmlWorksheet.go"
    click CalcEngine "https://github.com/qax-os/excelize/blob/master/calc.go"
    click FileOps "https://github.com/qax-os/excelize/blob/master/file.go"
    click Workbook "https://github.com/qax-os/excelize/blob/master/workbook.go"
    click Worksheet "https://github.com/qax-os/excelize/blob/master/sheet.go"
    click Cells "https://github.com/qax-os/excelize/blob/master/cell.go"
    click Styles "https://github.com/qax-os/excelize/blob/master/styles.go"
    click StreamIO "https://github.com/qax-os/excelize/blob/master/stream.go"

    %% Styles
    classDef api fill:#2374ab,stroke:#000,stroke-width:2px,color:#fff
    classDef feature fill:#57a773,stroke:#000,stroke-width:2px,color:#fff
    classDef core fill:#ff8c42,stroke:#000,stroke-width:2px,color:#fff
    classDef data fill:#ffd93d,stroke:#000,stroke-width:2px,color:#000
    classDef io fill:#95a5a6,stroke:#000,stroke-width:2px,color:#fff

    %% Legend
    subgraph Legend
        L1["Application Layer"]:::api
        L2["Feature Layer"]:::feature
        L3["Core Processing"]:::core
        L4["Data Structure"]:::data
        L5["I/O Layer"]:::io
    end
```
