# lyesprojet/veliboptim architecture

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

- Interactive diagram: https://gitdiagram.com/lyesprojet/veliboptim
- Repository: https://github.com/lyesprojet/veliboptim

## Overview

This is a Python command-line generator for an interactive map of Vélib’ stations and their Delaunay neighborhood network. The workflow loads the station snapshot, computes graph links and station-spacing metrics, then generates an HTML map for a browser. The README documents clustering and selectable map backgrounds; the excerpts show map-layer, popup, and interface code, but omit some implementation details, so uncertain internal wiring is left out.

Main entry points: [`carte.py`](https://github.com/lyesprojet/veliboptim/blob/main/carte.py) (Generation workflow), [`maCarte.html`](https://github.com/lyesprojet/veliboptim/blob/main/maCarte.html) (Generated map), [`station_information.json`](https://github.com/lyesprojet/veliboptim/blob/main/station_information.json) (Station snapshot)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Network analysis"]
  node_main["Generation workflow<br/>[carte.py]"]
  node_station_data["Station snapshot"]
  node_loader["Station loader<br/>[carte.py]"]
  node_scipy{{"SciPy Delaunay"}}
  node_adjacency["Adjacency graph<br/>[carte.py]"]
  node_edge_metrics["Link distances<br/>[carte.py]"]
  node_distribution["Spacing index<br/>[carte.py]"]
end

subgraph group_presentation["Map presentation"]
  node_map_builder["Map assembly<br/>[carte.py]"]
  node_links_layer["Colored links<br/>[carte.py]"]
  node_station_layer["Clustered stations<br/>[carte.py]"]
  node_popups["Station popups<br/>[carte.py]"]
  node_map_controls["Map backgrounds<br/>[carte.py]"]
  node_map_panel["Legend and panel<br/>[carte.py]"]
end

subgraph group_artifacts["Map output"]
  node_html_file["Generated map<br/>[maCarte.html]"]
end

node_operator(("Script operator"))
node_esri{{"Esri map tiles"}}
node_browser(("Map viewer"))

node_operator -->|"runs"| node_main
node_main -->|"calls"| node_loader
node_loader -->|"reads"| node_station_data
node_loader -->|"returns stations"| node_main
node_main -->|"triangulates"| node_scipy
node_main -->|"builds"| node_adjacency
node_adjacency -->|"returns neighbors"| node_main
node_main -->|"calculates links"| node_edge_metrics
node_main -->|"calculates indices"| node_distribution
node_main -->|"creates map"| node_map_builder
node_map_builder -->|"adds links"| node_links_layer
node_map_builder -->|"adds stations"| node_station_layer
node_station_layer -->|"creates popup content"| node_popups
node_map_builder -->|"adds backgrounds"| node_map_controls
node_map_controls -->|"requests tiles"| node_esri
node_map_builder -->|"adds interface"| node_map_panel
node_map_builder -->|"generates"| node_html_file
node_html_file -->|"opens in"| node_browser

click node_main "https://github.com/lyesprojet/veliboptim/blob/main/carte.py"
click node_station_data "https://github.com/lyesprojet/veliboptim/blob/main/station_information.json"
click node_loader "https://github.com/lyesprojet/veliboptim/blob/main/carte.py"
click node_adjacency "https://github.com/lyesprojet/veliboptim/blob/main/carte.py"
click node_edge_metrics "https://github.com/lyesprojet/veliboptim/blob/main/carte.py"
click node_distribution "https://github.com/lyesprojet/veliboptim/blob/main/carte.py"
click node_map_builder "https://github.com/lyesprojet/veliboptim/blob/main/carte.py"
click node_links_layer "https://github.com/lyesprojet/veliboptim/blob/main/carte.py"
click node_station_layer "https://github.com/lyesprojet/veliboptim/blob/main/carte.py"
click node_popups "https://github.com/lyesprojet/veliboptim/blob/main/carte.py"
click node_map_controls "https://github.com/lyesprojet/veliboptim/blob/main/carte.py"
click node_map_panel "https://github.com/lyesprojet/veliboptim/blob/main/carte.py"
click node_html_file "https://github.com/lyesprojet/veliboptim/blob/main/maCarte.html"

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_main,node_station_data,node_loader,node_scipy,node_adjacency,node_edge_metrics,node_distribution,node_browser toneBlue
class node_map_builder,node_links_layer,node_station_layer,node_popups,node_map_controls,node_map_panel toneAmber
class node_html_file toneMint
class node_operator,node_esri toneIndigo
```

## Components

### Network analysis

- [Generation workflow](https://github.com/lyesprojet/veliboptim/blob/main/carte.py): `carte.py`
- [Station snapshot](https://github.com/lyesprojet/veliboptim/blob/main/station_information.json): `station_information.json`
- [Station loader](https://github.com/lyesprojet/veliboptim/blob/main/carte.py): `carte.py`
- **SciPy Delaunay**
- [Adjacency graph](https://github.com/lyesprojet/veliboptim/blob/main/carte.py): `carte.py`
- [Link distances](https://github.com/lyesprojet/veliboptim/blob/main/carte.py): `carte.py`
- [Spacing index](https://github.com/lyesprojet/veliboptim/blob/main/carte.py): `carte.py`

### Map presentation

- [Map assembly](https://github.com/lyesprojet/veliboptim/blob/main/carte.py): `carte.py`
- [Colored links](https://github.com/lyesprojet/veliboptim/blob/main/carte.py): `carte.py`
- [Clustered stations](https://github.com/lyesprojet/veliboptim/blob/main/carte.py): `carte.py`
- [Station popups](https://github.com/lyesprojet/veliboptim/blob/main/carte.py): `carte.py`
- [Map backgrounds](https://github.com/lyesprojet/veliboptim/blob/main/carte.py): `carte.py`
- [Legend and panel](https://github.com/lyesprojet/veliboptim/blob/main/carte.py): `carte.py`

### Map output

- [Generated map](https://github.com/lyesprojet/veliboptim/blob/main/maCarte.html): `maCarte.html`

### Other components

- **Script operator**
- **Esri map tiles**
- **Map viewer**

## Connections

- Script operator → Generation workflow: runs
- Generation workflow → Station loader: calls
- Station loader → Station snapshot: reads
- Station loader → Generation workflow: returns stations
- Generation workflow → SciPy Delaunay: triangulates
- Generation workflow → Adjacency graph: builds
- Adjacency graph → Generation workflow: returns neighbors
- Generation workflow → Link distances: calculates links
- Generation workflow → Spacing index: calculates indices
- Generation workflow → Map assembly: creates map
- Map assembly → Colored links: adds links
- Map assembly → Clustered stations: adds stations
- Clustered stations → Station popups: creates popup content
- Map assembly → Map backgrounds: adds backgrounds
- Map backgrounds → Esri map tiles: requests tiles
- Map assembly → Legend and panel: adds interface
- Map assembly → Generated map: generates
- Generated map → Map viewer: opens in
