# deephaven/deephaven-plugins architecture

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

## Overview

##### Main Components

a. Core Framework Layer:
- Plugin Registry/Manager
- Build System
- Development Tools
- Testing Infrastructure

b. Plugin Types Layer:
- Python Plugins
- JavaScript Plugins
- Hybrid Plugins (containing both Python and JS)

c. Integration Layer:
- Docker Container Support
- Deephaven Core Integration
- Development Environment

**┌─ Plugin System Architecture ──────────────────────────────────────┐**

- ┌─ Development Tools ─────┐   ┌─ Build System ──────────────┐   │
- plugin_builder.py     │   │ - Python Build Pipeline     │   │
- Pre-commit Hooks      │   │ - JavaScript Build Pipeline │   │
- E2E Testing          │   │ - Docker Build Support      │   │
- ┘   └────────────────────────────┘   │

- ┌─ Plugin Types ───────────────────────────────────────────┐    │

- ┌─ Python Plugins ─┐  ┌─ JavaScript Plugins ─┐         │    │
- JSON           │  │ - UI Components      │         │    │
- Matplotlib     │  │ - Dashboard Widgets  │         │    │
- Plotly Express │  │ - Themes            │         │    │
- ┘  └───────────────────────┘         │    │

- ┘    │

- ┌─ Integration Layer ────────────────────────────────────────┐  │

- ┌─ Deephaven Core ─┐   ┌─ Docker Environment ─┐          │  │
- Plugin Loading │   │ - Container Config    │          │  │
- API Interface  │   │ - Volume Mapping      │          │  │
- ┘   └────────────────────────┘          │  │

- ┘  │

- ┘

##### Key Elements to Highlight

a. Plugin Structure:
- Standard layout (pyproject.toml, setup.cfg, src/js structure)
- Versioning independence
- Build artifact flow

b. Development Workflow:
- Pre-commit hook process
- Testing pipeline (E2E, Python tests)
- Demonstrate the build and watch modes

c. Integration Points:
- How plugins connect to Deephaven Core
- Docker container integration
- Development server connections

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Core["Core Framework Layer"]
        Registry["Plugin Registry/Manager"]
        BuildSys["Build System"]
        DevTools["Development Tools"]
        Testing["Testing Infrastructure"]
    end

    subgraph Plugins["Plugin Types Layer"]
        subgraph PythonPlugins["Python Plugins"]
            JSON["JSON Plugin"]
            MPL["Matplotlib Plugin"]
            Plotly["Plotly Express Plugin"]
        end

        subgraph JSPlugins["JavaScript Plugins"]
            Dashboard["Dashboard Object Viewer"]
            Theme["Example Theme"]
            Table["Table Example"]
            UI["UI Components"]
        end
    end

    subgraph Integration["Integration Layer"]
        Docker["Docker Container Support"]
        DevEnv["Development Environment"]
        Templates["Plugin Templates"]
    end

    Registry --> PythonPlugins
    Registry --> JSPlugins
    BuildSys --> PythonPlugins
    BuildSys --> JSPlugins
    DevTools --> Integration
    Testing --> PythonPlugins
    Testing --> JSPlugins
    Docker --> DevEnv
    Templates --> PythonPlugins
    Templates --> JSPlugins

    %% Click events for components
    click Registry "https://github.com/deephaven/deephaven-plugins/blob/main/plugins/manifest.json"
    click BuildSys "https://github.com/deephaven/deephaven-plugins/blob/main/tools/plugin_builder.py"
    click DevTools "https://github.com/deephaven/deephaven-plugins/blob/main/tools/plugin_builder.py"
    click Testing "https://github.com/deephaven/deephaven-plugins/tree/main/tests/"
    click JSON "https://github.com/deephaven/deephaven-plugins/tree/main/plugins/json/"
    click MPL "https://github.com/deephaven/deephaven-plugins/tree/main/plugins/matplotlib/"
    click Plotly "https://github.com/deephaven/deephaven-plugins/tree/main/plugins/plotly-express/"
    click Dashboard "https://github.com/deephaven/deephaven-plugins/tree/main/plugins/dashboard-object-viewer/"
    click Theme "https://github.com/deephaven/deephaven-plugins/tree/main/plugins/example-theme/"
    click Table "https://github.com/deephaven/deephaven-plugins/tree/main/plugins/table-example/"
    click UI "https://github.com/deephaven/deephaven-plugins/tree/main/plugins/ui/"
    click Docker "https://github.com/deephaven/deephaven-plugins/tree/main/docker/"
    click DevEnv "https://github.com/deephaven/deephaven-plugins/blob/main/.pre-commit-config.yaml"
    click Templates "https://github.com/deephaven/deephaven-plugins/tree/main/templates/widget/"

    %% Styling
    classDef core fill:#f9f,stroke:#333,stroke-width:2px
    classDef python fill:#69c,stroke:#333
    classDef javascript fill:#fc3,stroke:#333
    classDef integration fill:#9c6,stroke:#333

    class Registry,BuildSys,DevTools,Testing core
    class JSON,MPL,Plotly python
    class Dashboard,Theme,Table,UI javascript
    class Docker,DevEnv,Templates integration

    %% Legend
    subgraph Legend
        CoreComp["Core Components"]:::core
        PythonComp["Python Components"]:::python
        JSComp["JavaScript Components"]:::javascript
        IntComp["Integration Components"]:::integration
    end
```
