# adamerose/pandasgui architecture

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

- Interactive diagram: https://gitdiagram.com/adamerose/pandasgui
- Repository: https://github.com/adamerose/pandasgui

## Overview

##### Main Components

a. Core Application Layer:
- Store component (store.py) which likely manages application state
- Utility services (utility.py, constants.py)

b. Widget Layer (Most Critical Component):
- Widgets from the /widgets directory into logical categories:
- Data Viewing (dataframe_viewer.py, column_viewer.py)
- Analysis Tools (stats_viewer.py, filter_viewer.py)
- Visualization (figure_viewer.py, grapher.py)
- Navigation/UI (navigator.py, dock_widget.py)

c. Data Processing Layer:
- Automatic_profiling.py
- Datasets.py for sample data handling
- Data transformation components

##### Component Relationships

- User Input → GUI Interface
- GUI Interface → Store (State Management)
- Store → Widget Layer
- Widget Layer → Data Processing Layer
- Data Processing Layer → Pandas Integration (External)

**┌─────────────────────────────────────────┐**
- User Interface             │
- ┘
- ↕
**┌─────────────────────────────────────────┐**
- Store (State Management)        │
- ┘
- ↕
**┌─────────────────────────────────────────┐**
- Widget Layer                 │
- ┬─────────┬─────────┬──────────┤
- Viewing │Analysis │  Plots  │   UI     │
- ┴─────────┴─────────┴──────────┘
- ↕
**┌─────────────────────────────────────────┐**
- Data Processing Layer           │
- ┘
- ↕
**┌─────────────────────────────────────────┐**
- Pandas Integration           │
- ┘

##### Important Details

- Data flow for importing CSV files (drag & drop feature)
- Interaction between the plotting components and data viewers
- Demonstrate how the filtering system connects to the main data store
- Statistics and analysis pipeline

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "User Interface"
        GUI["Main GUI Application"]:::core
        click GUI "https://github.com/adamerose/pandasgui/blob/master/pandasgui/gui.py"
    end

    subgraph "State Management"
        Store["Store"]:::core
        Utils["Utility Services"]:::core
        click Store "https://github.com/adamerose/pandasgui/blob/master/pandasgui/store.py"
        click Utils "https://github.com/adamerose/pandasgui/blob/master/pandasgui/utility.py"
    end

    subgraph "Widget Layer"
        direction TB
        subgraph "Data Viewing"
            DFViewer["DataFrame Viewer"]:::widget
            ColViewer["Column Viewer"]:::widget
            DFExplorer["DataFrame Explorer"]:::widget
            click DFViewer "https://github.com/adamerose/pandasgui/blob/master/pandasgui/widgets/dataframe_viewer.py"
            click ColViewer "https://github.com/adamerose/pandasgui/blob/master/pandasgui/widgets/column_viewer.py"
            click DFExplorer "https://github.com/adamerose/pandasgui/blob/master/pandasgui/widgets/dataframe_explorer.py"
        end

        subgraph "Analysis Tools"
            StatsViewer["Stats Viewer"]:::widget
            FilterViewer["Filter Viewer"]:::widget
            Reshaper["Reshaper"]:::widget
            click StatsViewer "https://github.com/adamerose/pandasgui/blob/master/pandasgui/widgets/stats_viewer.py"
            click FilterViewer "https://github.com/adamerose/pandasgui/blob/master/pandasgui/widgets/filter_viewer.py"
            click Reshaper "https://github.com/adamerose/pandasgui/blob/master/pandasgui/widgets/reshaper.py"
        end

        subgraph "Visualization"
            FigViewer["Figure Viewer"]:::widget
            Grapher["Grapher"]:::widget
            click FigViewer "https://github.com/adamerose/pandasgui/blob/master/pandasgui/widgets/figure_viewer.py"
            click Grapher "https://github.com/adamerose/pandasgui/blob/master/pandasgui/widgets/grapher.py"
        end

        subgraph "Navigation/UI"
            Navigator["Navigator"]:::widget
            DockWidget["Dock Widget"]:::widget
            DetachableTab["Detachable Tab"]:::widget
            BaseWidgets["Base Widgets"]:::widget
            click Navigator "https://github.com/adamerose/pandasgui/blob/master/pandasgui/widgets/navigator.py"
            click DockWidget "https://github.com/adamerose/pandasgui/blob/master/pandasgui/widgets/dock_widget.py"
            click DetachableTab "https://github.com/adamerose/pandasgui/blob/master/pandasgui/widgets/detachable_tab_widget.py"
            click BaseWidgets "https://github.com/adamerose/pandasgui/blob/master/pandasgui/widgets/base_widgets.py"
        end

        subgraph "Code & Search"
            CodeHistory["Code History Viewer"]:::widget
            PythonHighlighter["Python Highlighter"]:::widget
            SearchCombo["Searchable Combobox"]:::widget
            SearchList["Searchable List"]:::widget
            FindToolbar["Find Toolbar"]:::widget
            click CodeHistory "https://github.com/adamerose/pandasgui/blob/master/pandasgui/widgets/code_history_viewer.py"
            click PythonHighlighter "https://github.com/adamerose/pandasgui/blob/master/pandasgui/widgets/python_highlighter.py"
            click SearchCombo "https://github.com/adamerose/pandasgui/blob/master/pandasgui/widgets/searchable_combobox.py"
            click SearchList "https://github.com/adamerose/pandasgui/blob/master/pandasgui/widgets/searchable_list.py"
            click FindToolbar "https://github.com/adamerose/pandasgui/blob/master/pandasgui/widgets/find_toolbar.py"
        end
    end

    subgraph "Data Processing Layer"
        AutoProfile["Automatic Profiling"]:::data
        Datasets["Datasets"]:::data
        click AutoProfile "https://github.com/adamerose/pandasgui/blob/master/pandasgui/automatic_profiling.py"
        click Datasets "https://github.com/adamerose/pandasgui/blob/master/pandasgui/datasets.py"
    end

    subgraph "External Dependencies"
        Pandas["Pandas Library"]:::external
    end

    %% Connections
    GUI --> Store
    Store --> Utils
    Store --> DFViewer & ColViewer & DFExplorer
    Store --> StatsViewer & FilterViewer & Reshaper
    Store --> FigViewer & Grapher
    Store --> Navigator & DockWidget & DetachableTab & BaseWidgets
    Store --> CodeHistory & PythonHighlighter & SearchCombo & SearchList & FindToolbar
    DFViewer & ColViewer & DFExplorer --> AutoProfile
    StatsViewer & FilterViewer & Reshaper --> AutoProfile
    FigViewer & Grapher --> AutoProfile
    AutoProfile --> Datasets
    Datasets --> Pandas

    %% Styles
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef widget fill:#4CAF50,stroke:#2E7D32,color:white
    classDef data fill:#FFC107,stroke:#FFA000,color:black
    classDef external fill:#9E9E9E,stroke:#616161,color:white

    %% Legend
    subgraph Legend
        CoreComp["Core Component"]:::core
        WidgetComp["Widget Component"]:::widget
        DataComp["Data Processing"]:::data
        ExtComp["External Component"]:::external
    end
```
