# darenr/report_creator architecture

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

- Interactive diagram: https://gitdiagram.com/darenr/report_creator
- Repository: https://github.com/darenr/report_creator

## Overview

##### Main Components

a. Core Components:
- Report Creator Engine
- Component System
- Templating System
- Theming Engine
- Utilities Layer

b. External Integrations:
- Plotting Libraries (Plotly, Matplotlib)
- Markdown Processing
- Syntax Highlighting
- Jupyter Widgets Support

**Layer 1 (User Interface):**
- API Interface (report_creator.py)
- Component Classes

**Layer 2 (Core Processing):**
- Template Engine
- Theme Manager
- Component Renderer

**Layer 3 (Integration Layer):**
- External Libraries
- Data Processing
- Asset Management

**Layer 4 (Output):**
- HTML Generation
- Asset Bundling

##### Key Elements to Highlight

a. Component Flow:
- How user input flows through the system
- Demonstrate component composition (Block, Group, etc.)
- Rendering pipeline

b. Integration Points:
- Connections to external libraries
- Data transformation processes
- Template application flow

##### Specific Implementation Details

- Rectangles: Core components
- Rounded rectangles: External integrations
- Hexagons: Data processing units

- Blue: Core functionality
- Green: External integrations
- Orange: Data processing
- Purple: Output generation

##### Important Relationships

- How ReportCreator class orchestrates all components
- Component hierarchy (Block, Group, Text, Metric, etc.)
- Template application process
- Theme management flow
- Asset handling pipeline

##### The transformation pipeline from input to final HTML output

This system design should reflect the library's primary purpose of creating professional HTML reports while maintaining its extensible and modular nature.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "User Interface Layer"
        API[API Interface]
        COMP[Component Classes]
        DOC[Documentation]
    end

    subgraph "Core Processing Layer"
        RC[Report Creator Engine]
        TS[Templating System]
        TH[Theming Engine]
        CR[Component Renderer]
    end

    subgraph "Integration Layer"
        EL[External Libraries]
        DP[Data Processing]
        AM[Asset Management]
        
        subgraph "Visualization Tools"
            PL[Plotly]
            MT[Matplotlib]
            MJ[Mermaid JS]
        end
    end

    subgraph "Output Layer"
        HG[HTML Generation]
        AB[Asset Bundling]
        UT[Utilities]
    end

    %% Relationships
    API --> RC
    COMP --> CR
    RC --> TS
    RC --> TH
    CR --> DP
    DP --> |Data Transform| HG
    TS --> HG
    TH --> HG
    AM --> AB
    EL --> DP
    PL --> DP
    MT --> DP
    MJ --> DP
    
    %% Click Events
    click RC "https://github.com/darenr/report_creator/blob/main/report_creator/report_creator.py"
    click TS "https://github.com/darenr/report_creator/blob/main/report_creator/templates/default.html"
    click TH "https://github.com/darenr/report_creator/blob/main/report_creator/theming.py"
    click UT "https://github.com/darenr/report_creator/blob/main/report_creator/utilities.py"
    click COMP "https://github.com/darenr/report_creator/blob/main/tests/test_components.py"
    click API "https://github.com/darenr/report_creator/blob/main/report_creator/__init__.py"
    click DOC "https://github.com/darenr/report_creator/tree/main/docs/source/"

    %% Styling
    classDef core fill:#a8d1f0,stroke:#333,stroke-width:2px
    classDef integration fill:#90EE90,stroke:#333,stroke-width:2px
    classDef output fill:#FFB6C1,stroke:#333,stroke-width:2px
    classDef ui fill:#DDA0DD,stroke:#333,stroke-width:2px

    class RC,TS,TH,CR core
    class EL,DP,AM,PL,MT,MJ integration
    class HG,AB,UT output
    class API,COMP,DOC ui

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[Integration Components]:::integration
        L3[Output Components]:::output
        L4[UI Components]:::ui
    end
```
