# cyanideanion/market-sentiment-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/cyanideanion/market-sentiment-dashboard
- Repository: https://github.com/cyanideanion/market-sentiment-dashboard

## Overview

This repository builds a retrospective market-sentiment dashboard and conditional-return research appendix. The main workflow downloads market prices, validates and aligns them, computes four indicator scores and an aggregate label, then exports chart and summary JSON for a browser dashboard. The README also documents trend comparisons, co-movement and dislocation views, recovery-time analysis, and forward-return distributions. The browser loads explanatory content and renders charts on demand. The source excerpts show the build and browser wiring; chart-specific implementation details are only partially sampled.

Main entry points: [`build_dashboard.py`](https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/build_dashboard.py) (Dashboard builder), [`site/app.js`](https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/site/app.js) (Interactive dashboard), [`data_loader.py`](https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/data_loader.py) (Price downloads), [`analysis.py`](https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/analysis.py) (Indicator scores)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_market_data["Market data"]
  node_validation["Price validation<br/>[build_dashboard.py]"]
  node_downloads["Price downloads<br/>[data_loader.py]"]
end

subgraph group_analysis["Sentiment analysis"]
  node_builder["Dashboard builder<br/>[build_dashboard.py]"]
  node_indicator_scores["Indicator scores<br/>[analysis.py]"]
  node_aggregate_score["Aggregate sentiment<br/>[analysis.py]"]
end

subgraph group_research["Research outputs"]
  node_trend_charts["Market trend charts<br/>[charts.py]"]
  node_correlation["Correlation analysis<br/>[charts.py]"]
  node_recovery["Recovery analysis<br/>[charts.py]"]
  node_forward_returns["Forward returns<br/>[charts.py]"]
end

subgraph group_dashboard["Dashboard"]
  node_artifacts["Dashboard JSON"]
  node_content["Research content<br/>[content.json]"]
  node_web_app["Interactive dashboard<br/>[app.js]"]
  node_dashboard_page["Dashboard page<br/>[index.html]"]
end

node_yfinance[("Yahoo Finance")]
node_browser(("Dashboard visitor"))
node_plotly["Plotly CDN"]

node_builder -->|"requests prices"| node_downloads
node_downloads -->|"downloads data"| node_yfinance
node_builder -->|"validates prices"| node_validation
node_builder -->|"calculates scores"| node_indicator_scores
node_indicator_scores -->|"combines scores"| node_aggregate_score
node_builder -->|"builds charts"| node_trend_charts
node_builder -->|"builds analysis"| node_correlation
node_builder -->|"builds analysis"| node_recovery
node_builder -->|"builds analysis"| node_forward_returns
node_builder -->|"writes JSON"| node_artifacts
node_browser -->|"opens dashboard"| node_web_app
node_web_app -->|"fetches JSON"| node_artifacts
node_web_app -->|"loads text"| node_content
node_web_app -->|"loads library"| node_plotly
node_dashboard_page -.->|"hosts app"| node_web_app

click node_builder "https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/build_dashboard.py"
click node_validation "https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/build_dashboard.py"
click node_downloads "https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/data_loader.py"
click node_indicator_scores "https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/analysis.py"
click node_aggregate_score "https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/analysis.py"
click node_trend_charts "https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/charts.py"
click node_correlation "https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/charts.py"
click node_recovery "https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/charts.py"
click node_forward_returns "https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/charts.py"
click node_artifacts "https://github.com/cyanideanion/market-sentiment-dashboard/tree/main/site/data"
click node_content "https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/site/content.json"
click node_web_app "https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/site/app.js"
click node_dashboard_page "https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/site/index.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_validation,node_downloads toneBlue
class node_builder,node_indicator_scores,node_aggregate_score,node_yfinance toneAmber
class node_trend_charts,node_correlation,node_recovery,node_forward_returns toneMint
class node_artifacts,node_content,node_web_app,node_dashboard_page toneRose
class node_browser,node_plotly toneIndigo
```

## Components

### Market data

- [Price validation](https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/build_dashboard.py): `build_dashboard.py`
- [Price downloads](https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/data_loader.py): `data_loader.py`

### Sentiment analysis

- [Dashboard builder](https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/build_dashboard.py): `build_dashboard.py`
- [Indicator scores](https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/analysis.py): `analysis.py`
- [Aggregate sentiment](https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/analysis.py): `analysis.py`

### Research outputs

- [Market trend charts](https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/charts.py): `charts.py`
- [Correlation analysis](https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/charts.py): `charts.py`
- [Recovery analysis](https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/charts.py): `charts.py`
- [Forward returns](https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/charts.py): `charts.py`

### Dashboard

- [Dashboard JSON](https://github.com/cyanideanion/market-sentiment-dashboard/tree/main/site/data): `site/data`
- [Research content](https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/site/content.json): `site/content.json`
- [Interactive dashboard](https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/site/app.js): `site/app.js`
- [Dashboard page](https://github.com/cyanideanion/market-sentiment-dashboard/blob/main/site/index.html): `site/index.html`

### Other components

- **Yahoo Finance**
- **Dashboard visitor**
- **Plotly CDN**

## Connections

- Dashboard builder → Price downloads: requests prices (evidence: `build_dashboard.py`)
- Price downloads → Yahoo Finance: downloads data (evidence: `data_loader.py`)
- Dashboard builder → Price validation: validates prices (evidence: `build_dashboard.py`)
- Dashboard builder → Indicator scores: calculates scores (evidence: `build_dashboard.py`)
- Indicator scores → Aggregate sentiment: combines scores (evidence: `analysis.py`)
- Dashboard builder → Market trend charts: builds charts (evidence: `build_dashboard.py`)
- Dashboard builder → Correlation analysis: builds analysis (evidence: `build_dashboard.py`)
- Dashboard builder → Recovery analysis: builds analysis (evidence: `build_dashboard.py`)
- Dashboard builder → Forward returns: builds analysis (evidence: `build_dashboard.py`)
- Dashboard builder → Dashboard JSON: writes JSON (evidence: `build_dashboard.py`)
- Dashboard visitor → Interactive dashboard: opens dashboard (evidence: `README.md`)
- Interactive dashboard → Dashboard JSON: fetches JSON (evidence: `site/app.js`)
- Interactive dashboard → Research content: loads text (evidence: `site/app.js`)
- Interactive dashboard → Plotly CDN: loads library (evidence: `site/app.js`)
- Dashboard page → Interactive dashboard: hosts app
