# eweitz/ideogram architecture

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

## Overview

##### Main Components Architecture

- Ideogram.js                                          |

- Core    |           |Annotations| |  Bands  |             | Layouts   |

- Configure |          |- Heatmaps  | |- Parse |             |- Horizontal|
- Model     |          |- Synteny   | |- Fetch |             |- Paired    |
- Views     |          |- Tracks    | |- Show  |             |- Small     |

- Services |

- Organisms|
- eUtils   |
- Cache    |

##### Data Flow Architecture

- Input Data   |     |  Processing    |     |   Rendering     |

- Genome Data  | --> |- Parse Data    | --> |- SVG Generation |
- Annotations  |     |- Process Bands |     |- D3.js Drawing  |
- Config       |     |- Cache Data    |     |- DOM Updates    |

##### Integration Points

External framework integration capabilities:

- Ideogram   | <-> |  Angular   |
- Core      | <-> |  React     |
- <-> |  Vue       |
- <-> |  R         |
- <-> |  Jupyter   |

##### Implementation Details

- The modular architecture (src/js structure)
- The separation between core functionality and annotations
- The cache system for performance optimization
- The various layout options
- The support for multiple organisms and data formats

##### Technical Specifications

- Supported browsers
- Dependencies (D3.js)
- File formats (JSON, TSV)
- Supported genome assemblies

##### Key Features to Highlight

Create visual indicators for:
- Chromosome visualization capabilities
- Annotation support (histograms, heatmaps, etc.)
- Ploidy representation
- Comparative genomics features

The architecture emphasizes the library's modularity and extensibility while showing how different components interact to create chromosome visualizations. The design should make it clear how data flows from input through processing to final rendering, and how different features can be combined to create complex genomic visualizations.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Ideogram["Ideogram.js Library"]
        direction TB
        
        subgraph Core["Core Components"]
            Configure["Configure"]:::core
            Init["Init"]:::core
            Model["Model"]:::core
            Views["Views"]:::core
        end

        subgraph Annotations["Annotations Components"]
            Heatmaps["Heatmaps"]:::annotations
            Histograms["Histograms"]:::annotations
            Synteny["Synteny"]:::annotations
            Tracks["Tracks"]:::annotations
        end

        subgraph Bands["Bands Components"]
            Parse["Parse"]:::bands
            Draw["Draw"]:::bands
            Fetch["Fetch"]:::bands
            Show["Show"]:::bands
        end

        subgraph Layouts["Layouts Components"]
            Horizontal["Horizontal"]:::layouts
            Vertical["Vertical"]:::layouts
            Paired["Paired"]:::layouts
            Small["Small"]:::layouts
        end

        subgraph Services["Services"]
            Organisms["Organisms"]:::services
            eUtils["eUtils"]:::services
            Cache["Cache"]:::services
        end

        subgraph DataFlow["Data Flow"]
            InputData["Input Data"]:::data
            Processing["Processing"]:::processing
            Rendering["Rendering"]:::rendering
        end

        subgraph Integration["Framework Integration"]
            Angular["Angular"]:::integration
            React["React"]:::integration
            Vue["Vue"]:::integration
            R["R"]:::integration
            Jupyter["Jupyter"]:::integration
        end
    end

    %% Relationships
    Core --> Annotations
    Core --> Bands
    Core --> Layouts
    Core --> Services
    
    InputData --> Processing
    Processing --> Rendering
    
    Ideogram --- Integration

    %% Click Events
    click Configure "https://github.com/eweitz/ideogram/blob/master/src/js/init/configure.js"
    click Init "https://github.com/eweitz/ideogram/blob/master/src/js/init/init.js"
    click Model "https://github.com/eweitz/ideogram/blob/master/src/js/model-adapter.js"
    click Views "https://github.com/eweitz/ideogram/tree/master/src/js/views/"
    
    click Heatmaps "https://github.com/eweitz/ideogram/blob/master/src/js/annotations/heatmap.js"
    click Histograms "https://github.com/eweitz/ideogram/blob/master/src/js/annotations/histogram.js"
    click Synteny "https://github.com/eweitz/ideogram/blob/master/src/js/annotations/synteny.js"
    click Tracks "https://github.com/eweitz/ideogram/blob/master/src/js/annotations/track-labels.js"
    
    click Parse "https://github.com/eweitz/ideogram/blob/master/src/js/bands/parse.js"
    click Draw "https://github.com/eweitz/ideogram/blob/master/src/js/bands/draw.js"
    click Fetch "https://github.com/eweitz/ideogram/blob/master/src/js/bands/fetch.js"
    click Show "https://github.com/eweitz/ideogram/blob/master/src/js/bands/show.js"
    
    click Horizontal "https://github.com/eweitz/ideogram/blob/master/src/js/layouts/horizontal-layout.js"
    click Vertical "https://github.com/eweitz/ideogram/blob/master/src/js/layouts/vertical-layout.js"
    click Paired "https://github.com/eweitz/ideogram/blob/master/src/js/layouts/paired-layout.js"
    click Small "https://github.com/eweitz/ideogram/blob/master/src/js/layouts/small-layout.js"
    
    click Organisms "https://github.com/eweitz/ideogram/blob/master/src/js/services/organisms.js"
    click eUtils "https://github.com/eweitz/ideogram/blob/master/src/js/services/eutils-config.js"
    click Cache "https://github.com/eweitz/ideogram/blob/master/src/js/init/caches/cache.js"
    
    %% Styling
    classDef core fill:#4a90e2
    classDef annotations fill:#82ca9d
    classDef bands fill:#8884d8
    classDef layouts fill:#ff7f0e
    classDef services fill:#9467bd
    classDef data fill:#e8c3b9
    classDef processing fill:#8c564b
    classDef rendering fill:#c49c94
    classDef integration fill:#f7b6d2
```
