# northwoodssoftware/gojs architecture

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

- Interactive diagram: https://gitdiagram.com/northwoodssoftware/gojs
- Repository: https://github.com/northwoodssoftware/gojs

## Overview

##### Main Components

a. Core Library Components:
- Model Layer (data management)
- Layout Engine (various layout algorithms)
- Rendering System (Canvas/SVG)
- Event System (interaction handling)
- Tool System (user interaction tools)

b. Extension System:
- Layout Extensions
- Tool Extensions
- Custom Components

c. Integration Interfaces:
- Browser Runtime
- Node.js Runtime
- Framework Integrations (React, Angular, Vue)

**[Core Components]**
- Model Layer
- Data Binding System
- Layout Engine
- Layout Algorithms
- Rendering System
- Canvas Renderer
- SVG Renderer
- Event System
- Tool System

**[Extensions]**
- Layout Extensions
- Tool Extensions
- Custom Components

**[Integration Layer]**
- Browser Runtime
- Node.js Runtime
- Framework Bindings

##### Important Relationships

- Event propagation through the system
- Extension point connections to core components
- Runtime environment interactions

##### Implementation Details

- File organization (/release, /extensions, /samples)
- TypeScript support
- API surface (/api/symbols)
- Build artifacts

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core["Core Library System"]
        DE[Diagram Engine]:::core
        ML[Model Layer]:::core
        LE[Layout Engine]:::core
        RS[Rendering System]:::core
        ES[Event System]:::core
        TS[Tool System]:::core

        DE --> ML
        DE --> LE
        DE --> RS
        DE --> ES
        DE --> TS

        subgraph RenderingLayer["Rendering Layer"]
            CR[Canvas Renderer]:::renderer
            SR[SVG Renderer]:::renderer
            RS --> CR
            RS --> SR
        end

        subgraph DataLayer["Data Management"]
            DBS[Data Binding System]:::data
            ML --> DBS
        end

        subgraph LayoutSystem["Layout System"]
            LA[Layout Algorithms]:::layout
            LE --> LA
        end
    end

    subgraph Extensions["Extension System"]
        LEX[Layout Extensions]:::extension
        TEX[Tool Extensions]:::extension
        CC[Custom Components]:::extension

        LEX --> LE
        TEX --> TS
        CC --> DE
    end

    subgraph Integration["Integration Layer"]
        BR[Browser Runtime]:::integration
        NR[Node.js Runtime]:::integration
        FB[Framework Bindings]:::integration

        subgraph Frameworks["Framework Support"]
            React[React]:::framework
            Angular[Angular]:::framework
            Svelte[Svelte]:::framework
            
            FB --> React
            FB --> Angular
            FB --> Svelte
        end
    end

    DE --> BR
    DE --> NR
    DE --> FB

    classDef core fill:#2374ab,stroke:#2374ab,color:#fff
    classDef renderer fill:#457b9d,stroke:#457b9d,color:#fff
    classDef data fill:#1d3557,stroke:#1d3557,color:#fff
    classDef layout fill:#a8dadc,stroke:#a8dadc,color:#000
    classDef extension fill:#84a98c,stroke:#84a98c,color:#fff
    classDef integration fill:#e63946,stroke:#e63946,color:#fff
    classDef framework fill:#f1faee,stroke:#e63946,color:#000

    click DE "https://github.com/northwoodssoftware/gojs/blob/master/release/go.js"
    click ML "https://github.com/northwoodssoftware/gojs/blob/master/api/symbols/Model.html"
    click LE "https://github.com/northwoodssoftware/gojs/blob/master/api/symbols/Layout.html"
    click TS "https://github.com/northwoodssoftware/gojs/blob/master/api/symbols/Tool.html"
    click ES "https://github.com/northwoodssoftware/gojs/blob/master/api/symbols/DiagramEvent.html"
    click LEX "https://github.com/northwoodssoftware/gojs/blob/master/extensions/TreeLayout.js"
    click TEX "https://github.com/northwoodssoftware/gojs/blob/master/extensions/DragCreatingTool.js"
    click NR "https://github.com/northwoodssoftware/gojs/blob/master/test/nodescript.js"
    click BR "https://github.com/northwoodssoftware/gojs/blob/master/release/go-module.js"
    click React "https://github.com/northwoodssoftware/gojs/blob/master/intro/react.html"
    click Angular "https://github.com/northwoodssoftware/gojs/blob/master/intro/angular.html"
    click Svelte "https://github.com/northwoodssoftware/gojs/blob/master/intro/svelte.html"

    subgraph Legend["Legend"]
        L1[Core Components]:::core
        L2[Renderers]:::renderer
        L3[Data Components]:::data
        L4[Layout Components]:::layout
        L5[Extensions]:::extension
        L6[Integration Points]:::integration
        L7[Frameworks]:::framework
    end
```
