# gpushpanjaligoud-source/worldlens architecture

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

- Interactive diagram: https://gitdiagram.com/gpushpanjaligoud-source/worldlens
- Repository: https://github.com/gpushpanjaligoud-source/worldlens

## Overview

WorldLens is a browser-based country-comparison app for World Bank indicators. Users choose two countries, an indicator and a time range; the app fetches both series, falls back to sample data if retrieval fails, and presents the comparison as a chart, summary values and table. Users can export the displayed rows as CSV. The runtime is concentrated in app.js. The README is empty, and the available source does not show the HTML structure or how Chart is loaded.

Main entry points: [`app.js`](https://github.com/gpushpanjaligoud-source/worldlens/blob/main/app.js) (Comparison workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Comparison interface"]
  node_controls["Comparison controls<br/>[app.js]"]
  node_compare["Comparison workflow<br/>[app.js]"]
end

subgraph group_data["Indicator data"]
  node_worldbank["World Bank API"]
  node_sample[("Sample fallback data<br/>[app.js]")]
  node_series["Country indicator series<br/>[app.js]"]
end

subgraph group_results["Results and export"]
  node_presentation["Chart, summary and table<br/>[app.js]"]
  node_csv["CSV export<br/>[app.js]"]
end

node_user(("User"))
node_browser["Browser APIs"]

node_user -->|"selects options"| node_controls
node_controls -->|"triggers comparison"| node_compare
node_compare -->|"fetches series"| node_worldbank
node_compare -->|"falls back to"| node_sample
node_compare -->|"sets series"| node_series
node_compare -->|"renders results"| node_presentation
node_user -->|"requests export"| node_csv
node_csv -->|"creates download"| node_browser
node_presentation -->|"draws chart"| node_browser

click node_controls "https://github.com/gpushpanjaligoud-source/worldlens/blob/main/app.js"
click node_compare "https://github.com/gpushpanjaligoud-source/worldlens/blob/main/app.js"
click node_sample "https://github.com/gpushpanjaligoud-source/worldlens/blob/main/app.js"
click node_series "https://github.com/gpushpanjaligoud-source/worldlens/blob/main/app.js"
click node_presentation "https://github.com/gpushpanjaligoud-source/worldlens/blob/main/app.js"
click node_csv "https://github.com/gpushpanjaligoud-source/worldlens/blob/main/app.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_controls,node_compare,node_user,node_browser toneBlue
class node_worldbank,node_sample,node_series toneAmber
class node_presentation,node_csv toneMint
```

## Components

### Comparison interface

- [Comparison controls](https://github.com/gpushpanjaligoud-source/worldlens/blob/main/app.js): `app.js`
- [Comparison workflow](https://github.com/gpushpanjaligoud-source/worldlens/blob/main/app.js): `app.js`

### Indicator data

- **World Bank API**
- [Sample fallback data](https://github.com/gpushpanjaligoud-source/worldlens/blob/main/app.js): `app.js`
- [Country indicator series](https://github.com/gpushpanjaligoud-source/worldlens/blob/main/app.js): `app.js`

### Results and export

- [Chart, summary and table](https://github.com/gpushpanjaligoud-source/worldlens/blob/main/app.js): `app.js`
- [CSV export](https://github.com/gpushpanjaligoud-source/worldlens/blob/main/app.js): `app.js`

### Other components

- **User**
- **Browser APIs**

## Connections

- User → Comparison controls: selects options (evidence: `app.js`)
- Comparison controls → Comparison workflow: triggers comparison (evidence: `app.js`)
- Comparison workflow → World Bank API: fetches series (evidence: `app.js`)
- Comparison workflow → Sample fallback data: falls back to (evidence: `app.js`)
- Comparison workflow → Country indicator series: sets series (evidence: `app.js`)
- Comparison workflow → Chart, summary and table: renders results (evidence: `app.js`)
- User → CSV export: requests export (evidence: `app.js`)
- CSV export → Browser APIs: creates download (evidence: `app.js`)
- Chart, summary and table → Browser APIs: draws chart (evidence: `app.js`)
