# billbudge/webeditorframework architecture

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

## Overview

##### Main Components

Core Framework Components:
- Geometry Engine (geometry.ts)
- Data Models (dataModels.ts)
- Collections Manager (collections.ts)

- Function Charts Module
- State Charts Module

External Dependencies:
- Canvas2SVG integration as a supporting component

##### Component Relationships

Primary Flows:
- How the Geometry Engine supports both chart types
- Demonstrate integration points with Canvas2SVG for rendering

**[Examples/Implementation Layer]**
- ↑
**[Core Framework Layer]**
- ↑
**[External Dependencies Layer]**

##### Detailed Component Breakdown

Core Framework (Blue):

- ↑                     ↑

- Geometry    |<--->|  Collections  |

- Function Charts  |  |  State Charts   |

##### Implementation Notes

- The separation between core functionality and specific implementations
- The test coverage architecture
- The relationship between source files and compiled output

Remember to:
- Keep the core framework components clearly separated from implementation examples
- Relationship between .ts source files and compiled .js output
- Test coverage relationships
- Demonstrate how the canvas2svg library integrates with the rendering pipeline

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph External
        Canvas2SVG["Canvas2SVG Integration"]:::external
    end

    subgraph Core["Core Framework Layer"]
        DataModels["Data Models"]:::core
        Geometry["Geometry Engine"]:::core
        Collections["Collections Manager"]:::core
        Diagrams["Diagram Renderer"]:::core

        DataModels <--> Diagrams
        Geometry <--> Collections
        Geometry --> Diagrams
        Collections --> Diagrams
        DataModels --> Collections
    end

    subgraph DiagramTypes["Diagram Types Layer"]
        FunctionCharts["Function Charts Module"]:::implementation
        StateCharts["State Charts Module"]:::implementation
    end

    subgraph Testing["Test Coverage Layer"]
        CoreTests["Core Tests"]:::test
        FunctionTests["Function Charts Tests"]:::test
        StateTests["State Charts Tests"]:::test
    end

    Canvas2SVG --> Diagrams
    
    Diagrams --> FunctionCharts
    Diagrams --> StateCharts
    
    FunctionCharts --> FunctionTests
    StateCharts --> StateTests
    Core --> CoreTests

    %% Click events for component mapping
    click Geometry "https://github.com/billbudge/WebEditorFramework/blob/main/src/geometry.ts"
    click DataModels "https://github.com/billbudge/WebEditorFramework/blob/main/src/dataModels.ts"
    click Collections "https://github.com/billbudge/WebEditorFramework/blob/main/src/collections.ts"
    click Diagrams "https://github.com/billbudge/WebEditorFramework/blob/main/src/diagrams.ts"
    click FunctionCharts "https://github.com/billbudge/WebEditorFramework/blob/main/examples/functioncharts/functioncharts.ts"
    click StateCharts "https://github.com/billbudge/WebEditorFramework/blob/main/examples/statecharts/statecharts.ts"
    click Canvas2SVG "https://github.com/billbudge/WebEditorFramework/blob/main/third_party/canvas2svg/canvas2svg.js"
    click CoreTests "https://github.com/billbudge/WebEditorFramework/tree/main/test"

    %% Styling
    classDef core fill:#a8d1f0,stroke:#333,stroke-width:2px
    classDef implementation fill:#90EE90,stroke:#333,stroke-width:2px
    classDef external fill:#E8E8E8,stroke:#333,stroke-width:2px
    classDef test fill:#FFE5B4,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        CoreComponent["Core Component"]:::core
        ImplementationComponent["Implementation"]:::implementation
        ExternalComponent["External Dependency"]:::external
        TestComponent["Test Coverage"]:::test
    end
```
