# pablocfonseca/streamlit-aggrid-examples architecture

> Architecture diagram of the GitHub repository pablocfonseca/streamlit-aggrid-examples, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pablocfonseca/streamlit-aggrid-examples
- Repository: https://github.com/pablocfonseca/streamlit-aggrid-examples

## Overview

##### Project Type and Purpose
- This repository is an examples repository specifically for demonstrating how to integrate AG-Grid functionality into Streamlit applications.
- Its purpose is to showcase multiple grid configurations, customizations, and integrations (like custom CSS, tooltips, virtual columns, etc.) which serve as learning and quick-start guides for developers using streamlit-aggrid.

##### File Structure
- Top-Level Python Examples: Files named “0_Getting_started.py”, “20_cell_renderer_class_example.py”, “30_virtual_columns.py”, etc. are all example scripts. They each illustrate a specific features or configuration for AGGrid within a Streamlit context.
- Pages Directory: Contains a series of additional examples or “pages” (e.g., “10_ Setting_a_fixed_key.py”, “11_Editing_data.py”, etc.) that possibly correspond to a multi-page Streamlit demo setup. This may represent an alternate organization of examples where navigation is embedded in a multi-page UI.
- Additional Utilities/Configurations: Files such as “column_index.py”, “custom_css.py”, “forms.py”, “json_data.py”, etc., suggest reusable components or helper scripts which are used across multiple examples.
- Configuration Files: Files like “pyproject.toml”, the .devcontainer and .vscode folders indicate the project has development environment configurations which, while not directly part of the runtime architecture, support development and deployment.
- Data Files: Files like “olympic-winners.json” and “sparkline_data.json” indicate that sample data is provided to illustrate grid functionalities.

## Diagram (Mermaid)

```mermaid
flowchart TD

    %% Examples Collection Subgraphs
    subgraph "Examples Collection"
        subgraph "Standalone Examples"
            s0("0_Getting_started.py"):::example
            s20("20_cell_renderer_class_example.py"):::example
            s30("30_virtual_columns.py"):::example
            s40("40_example_highlight_change.py"):::example
            s60("60_rich_cell_editor.py"):::example
            s70("70_nested_grids.py"):::example
            s80("80_saving_columns_state.py"):::example
            s81("81_Tooltips.py"):::example
            s82("82_Handling_Grid_events.py"):::example
            s83("83_fetching_real_time_data.py"):::example
            s90("90_main_example.py"):::example
            s99("99_one_billion_row.py"):::example
        end
        subgraph "Multi-Page Examples"
            f10("10_ Setting_a_fixed_key.py"):::example
            f11("11_Editing_data.py"):::example
            f15("15_ Streamlit_Rerun_Triggers.py"):::example
            f21("21_Getting AgGrid data.py"):::example
            f22("22_Selecting_data.py"):::example
            f30("30_Basic_config_and_GridOptionsBuilder.py"):::example
            f40("40_Advanced_config_and JsCode.py"):::example
            f50("50_Themes.py"):::example
            f60("60_Licensing.py"):::example
            f99("99_Cookbook.py"):::example
            fstream("streamlit_demo.js"):::example
        end
    end

    %% Streamlit UI Layer
    streamlitUI("Streamlit UI Layer"):::ui

    %% AG-Grid Integration Module Subgraph
    subgraph "AG-Grid Integration Module"
        agGridOptions("GridOptions Playground"):::integration
        agCustomTooltip("Custom Tooltip (Integration)"):::integration
    end

    %% Reusable Utility Modules Subgraph
    subgraph "Reusable Utility Modules"
        r_column("Column Index"):::utility
        r_css("Custom CSS"):::utility
        r_tooltip("Custom Tooltip"):::utility
        r_forms("Forms"):::utility
        r_json("JSON Data Loader"):::utility
    end

    %% Data Sources Subgraph
    subgraph "Data Sources"
        d_olympic("olympic-winners.json"):::data
        d_sparkline("sparkline_data.json"):::data
        d_json("json_data.json"):::data
        d_gridOptions("json_data_gridOptions.json"):::data
    end

    %% Development/Env Configurations Subgraph
    subgraph "Development/Env Configurations"
        dev_devcontainer("devcontainer"):::config
        dev_pyproject("pyproject.toml"):::config
        dev_vscode("vscode"):::config
        dev_readme("README.md"):::config
    end

    %% Connections
    %% Examples Collection to Streamlit UI Layer (using representative nodes)
    s0 -->|"renders"| streamlitUI
    f10 -->|"renders"| streamlitUI

    %% Streamlit UI Layer to AG-Grid Integration Module
    streamlitUI -->|"applies grid config"| agGridOptions

    %% Reusable Utility Modules support AG-Grid Integration
    r_column ---|"provides utilities"| agGridOptions

    %% Data Sources provide data to AG-Grid
    d_olympic ---|"data feeds"| agGridOptions

    %% Development Configurations support Streamlit UI
    dev_pyproject ---|"dev support"| streamlitUI

    %% Additional link within AG-Grid Integration: integration module components
    agGridOptions --- agCustomTooltip

    %% Styling Classes
    classDef example fill:#ffe6e6,stroke:#cc0000,stroke-width:2px;
    classDef ui fill:#e6f7ff,stroke:#005c99,stroke-width:2px;
    classDef integration fill:#e6ffe6,stroke:#009933,stroke-width:2px;
    classDef utility fill:#fff7e6,stroke:#cc7a00,stroke-width:2px;
    classDef data fill:#fff0f5,stroke:#ff1493,stroke-width:2px;
    classDef config fill:#f0f8ff,stroke:#1e90ff,stroke-width:2px;

    %% Click Events for Standalone Examples
    click s0 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//0_Getting_started.py"
    click s20 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//20_cell_renderer_class_example.py"
    click s30 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//30_virtual_columns.py"
    click s40 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//40_example_highlight_change.py"
    click s60 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//60_rich_cell_editor.py"
    click s70 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//70_nested_grids.py"
    click s80 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//80_saving_columns_state.py"
    click s81 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//81_Tooltips.py"
    click s82 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//82_Handling_Grid_events.py"
    click s83 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//83_fetching_real_time_data.py"
    click s90 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//90_main_example.py"
    click s99 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//99_one_billion_row.py"

    %% Click Events for Multi-Page Examples
    click f10 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//pages/10_ Setting_a_fixed_key.py"
    click f11 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//pages/11_Editing_data.py"
    click f15 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//pages/15_ Streamlit_Rerun_Triggers.py"
    click f21 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//pages/21_Getting AgGrid data.py"
    click f22 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//pages/22_Selecting_data.py"
    click f30 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//pages/30_Basic_config_and_GridOptionsBuilder.py"
    click f40 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//pages/40_Advanced_config_and JsCode.py"
    click f50 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//pages/50_Themes.py"
    click f60 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//pages/60_Licensing.py"
    click f99 "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//pages/99_Cookbook.py"
    click fstream "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//pages/streamlit_demo.js"

    %% Click Events for AG-Grid Integration Module
    click agGridOptions "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//gridOptions_playground.py"
    click agCustomTooltip "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//custom_tooltip.py"

    %% Click Events for Reusable Utility Modules
    click r_column "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//column_index.py"
    click r_css "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//custom_css.py"
    click r_tooltip "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//custom_tooltip.py"
    click r_forms "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//forms.py"
    click r_json "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//json_data.py"

    %% Click Events for Data Sources
    click d_olympic "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//olympic-winners.json"
    click d_sparkline "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//sparkline_data.json"
    click d_json "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//json_data.json"
    click d_gridOptions "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//json_data_gridOptions.json"

    %% Click Events for Development/Env Configurations
    click dev_devcontainer "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//.devcontainer"
    click dev_pyproject "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//pyproject.toml"
    click dev_vscode "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main//.vscode"
    click dev_readme "https://github.com/pablocfonseca/streamlit-aggrid-examples/blob/main/README.md"
```
