# rougier/scientific-visualization-book architecture

> Architecture diagram of the GitHub repository rougier/scientific-visualization-book, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rougier/scientific-visualization-book
- Repository: https://github.com/rougier/scientific-visualization-book

## Overview

##### And group the major components
- Book Content & Chapters:
- The “rst” directory contains all chapters and supplemental text (e.g., 00-preface.rst, 00-introduction.rst, etc.). These represent the authored narrative of the book.
- The “tex” directory holds the LaTeX sources and related build files (book.tex, cover files, bibliography, etc.), which are used to compile the final PDF.
- Code Examples & Illustrations:
- The “figures” directory holds the generated PDFs, images, and even video outputs (like MP4) corresponding to those code examples.
- Design Assets:
- “cover” holds assets for cover design.
- “images” and “fonts” provide additional visual resources for both online and printed versions.
- Build Infrastructure & Automation:
- Files like “Makefile”, “scripts/build_book”, and “rst2latex.py” serve as the glue that orchestrates building the book. They tie together the chapter sources, code examples, and LaTeX compilation.
- The presence of configuration and deployment files (e.g., GitHub funding, .gitignore, and repository-level configuration) supports project management and collaboration.
- Supplementary Materials:
- “pdf” contains the compiled book outputs.
- “tex” is used by the build system to compile LaTeX, while “rst” provides the raw content for conversion.

##### Relationships and data flow
- How the “rst” content flows into the build system (via rst2latex.py, Makefile, and scripts) to generate LaTeX files in “tex” and then compile into the final PDF in “pdf”.
- That the build scripts and Makefile are central orchestration components that tie together content, code-generated artifacts, and resources.

##### Architectural patterns and design principles
- Modularity/Separation of Concerns: The clear separation into directories (content, code examples, assets, and build tools) shows a modular design where each component has a well-defined responsibility.
- Data Flow versus Control Flow: Emphasize the data flow from authored source (rst files) and dynamically generated figures (code → figures) into the final output (LaTeX → PDF).
- Reusability & Extensibility: Code examples are organized by topics showing that new materials or modules can easily be added; similarly, assets like fonts and images are maintained separately for reuse.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Authoring Components
    subgraph "Authoring"
        A["Book Content (rst)"]:::authoring
        B["LaTeX Sources (tex)"]:::authoring
    end

    %% Code Examples and Generated Figures
    subgraph "Code and Figures"
        C["Code Examples (code)"]:::execution
        D["Generated Figures (figures)"]:::execution
    end

    %% Design Assets
    subgraph "Design Assets"
        E["Cover Assets"]:::assets
        F["Images"]:::assets
        G["Fonts"]:::assets
    end

    %% Build Automation Components
    subgraph "Build Automation"
        H["Makefile"]:::build
        I["rst2latex.py"]:::build
        J["Build Scripts"]:::build
    end

    %% Final Book Output
    K["Book Output (pdf)"]:::output

    %% Relationships for Authoring
    A -->|"rst_conversion"| B
    A -->|"feed_content"| H
    B -->|"build_content"| H

    %% Relationships for Code Examples and Figures
    C -->|"visualize"| D
    D -->|"embed_figures"| H

    %% Design Assets feeding Build Automation
    E -->|"include_assets"| H
    F -->|"include_assets"| H
    G -->|"include_assets"| H

    %% Build Automation outputs
    H -->|"compile_pdf"| K
    I -->|"support_build"| K
    J -->|"support_build"| K

    %% Click Events
    click A "https://github.com/rougier/scientific-visualization-book/tree/master/rst"
    click B "https://github.com/rougier/scientific-visualization-book/tree/master/tex"
    click C "https://github.com/rougier/scientific-visualization-book/tree/master/code"
    click D "https://github.com/rougier/scientific-visualization-book/tree/master/figures"
    click E "https://github.com/rougier/scientific-visualization-book/tree/master/cover"
    click F "https://github.com/rougier/scientific-visualization-book/tree/master/images"
    click G "https://github.com/rougier/scientific-visualization-book/tree/master/fonts"
    click H "https://github.com/rougier/scientific-visualization-book/tree/master/Makefile"
    click I "https://github.com/rougier/scientific-visualization-book/blob/master/rst2latex.py"
    click J "https://github.com/rougier/scientific-visualization-book/tree/master/scripts"
    click K "https://github.com/rougier/scientific-visualization-book/tree/master/pdf"

    %% Style Definitions
    classDef authoring fill:#FFEEAD,stroke:#333,stroke-width:2px;
    classDef execution fill:#C8E6C9,stroke:#333,stroke-width:2px;
    classDef assets fill:#BBDEFB,stroke:#333,stroke-width:2px;
    classDef build fill:#FFE0B2,stroke:#333,stroke-width:2px;
    classDef output fill:#F8BBD0,stroke:#333,stroke-width:2px;
```
