# giraphne/sqlvis architecture

> Architecture diagram of the GitHub repository giraphne/sqlvis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/giraphne/sqlvis
- Repository: https://github.com/giraphne/sqlvis

## Overview

SQLvis is a Python library for turning SQL queries and database schemas into interactive graph visualizations in Jupyter notebooks. Its main workflow is: a notebook user obtains a schema from a SQLite connection, then supplies the query and schema to the visualization API, which embeds the JavaScript renderer and styles in the notebook. The README also describes table joins, column and condition highlighting, nested queries, and SQLVis+ error visualizations; these are represented by the renderer, though its implementation was not sampled. Edges are limited to relationships shown in the README or vis.py excerpt.

Main entry points: [`sqlvis/vis.py`](https://github.com/giraphne/sqlvis/blob/main/sqlvis/vis.py) (Schema Introspection), [`sqlvis/visualize.js`](https://github.com/giraphne/sqlvis/blob/main/sqlvis/visualize.js) (Query Renderer), [`sqlvis/styles.css.html`](https://github.com/giraphne/sqlvis/blob/main/sqlvis/styles.css.html) (Visualization Styles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Python API"]
  node_api["SQLvis API<br/>[vis.py]"]
  node_schema["Schema Introspection<br/>[vis.py]"]
end

subgraph group_notebook["Notebook Output"]
  node_display["Notebook Display<br/>[vis.py]"]
  node_styles["Visualization Styles<br/>[styles.css.html]"]
end

subgraph group_rendering["Query Rendering"]
  node_renderer["Query Renderer<br/>[visualize.js]"]
end

node_user(("Notebook User"))
node_sqlite[("SQLite Database")]
node_pandas["Pandas"]
node_d3["D3"]

node_user -->|"requests schema"| node_schema
node_schema -->|"reads schema"| node_sqlite
node_schema -->|"queries through"| node_pandas
node_schema -->|"returns schema"| node_user
node_user -->|"submits query"| node_api
node_api -->|"displays output"| node_display
node_display -->|"loads styles"| node_styles
node_display -->|"loads renderer"| node_renderer
node_api -->|"passes query and schema"| node_renderer
node_renderer -.->|"renders with"| node_d3

click node_api "https://github.com/giraphne/sqlvis/blob/main/sqlvis/vis.py"
click node_schema "https://github.com/giraphne/sqlvis/blob/main/sqlvis/vis.py"
click node_display "https://github.com/giraphne/sqlvis/blob/main/sqlvis/vis.py"
click node_styles "https://github.com/giraphne/sqlvis/blob/main/sqlvis/styles.css.html"
click node_renderer "https://github.com/giraphne/sqlvis/blob/main/sqlvis/visualize.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api,node_schema,node_user toneBlue
class node_display,node_styles,node_sqlite toneAmber
class node_renderer toneMint
class node_pandas,node_d3 toneIndigo
```

## Components

### Python API

- [SQLvis API](https://github.com/giraphne/sqlvis/blob/main/sqlvis/vis.py): `sqlvis/vis.py`
- [Schema Introspection](https://github.com/giraphne/sqlvis/blob/main/sqlvis/vis.py): `sqlvis/vis.py`

### Notebook Output

- [Notebook Display](https://github.com/giraphne/sqlvis/blob/main/sqlvis/vis.py): `sqlvis/vis.py`
- [Visualization Styles](https://github.com/giraphne/sqlvis/blob/main/sqlvis/styles.css.html): `sqlvis/styles.css.html`

### Query Rendering

- [Query Renderer](https://github.com/giraphne/sqlvis/blob/main/sqlvis/visualize.js): `sqlvis/visualize.js`

### Other components

- **Notebook User**
- **SQLite Database**
- **Pandas**
- **D3**

## Connections

- Notebook User → Schema Introspection: requests schema (evidence: `README.md`)
- Schema Introspection → SQLite Database: reads schema (evidence: `sqlvis/vis.py`)
- Schema Introspection → Pandas: queries through (evidence: `sqlvis/vis.py`)
- Schema Introspection → Notebook User: returns schema (evidence: `sqlvis/vis.py`)
- Notebook User → SQLvis API: submits query (evidence: `README.md`)
- SQLvis API → Notebook Display: displays output (evidence: `sqlvis/vis.py`)
- Notebook Display → Visualization Styles: loads styles (evidence: `sqlvis/vis.py`)
- Notebook Display → Query Renderer: loads renderer (evidence: `sqlvis/vis.py`)
- SQLvis API → Query Renderer: passes query and schema (evidence: `sqlvis/vis.py`)
- Query Renderer → D3: renders with
