Classes
Members
CSV_SOURCES
CSV data source definitions - maps to real PostgreSQL view exports
- Source:
Methods
(async) loadAll() → {Promise.<Object>}
Load all data in parallel
- Source:
Returns:
- Object with all data
- Type
- Promise.<Object>
(async) loadCSV(localPath, fallbackPathopt) → {Promise.<Array.<Object>>}
Load CSV with local-first fallback
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
localPath |
string | Path relative to csvBaseURL |
|
fallbackPath |
string |
<optional> |
Optional fallback path |
- Source:
Returns:
- Parsed CSV rows
- Type
- Promise.<Array.<Object>>
(async) loadCommitteeNetwork()
Build committee network from CSV sources Replaces committee-network.json
- Source:
(async) loadElectionAnalysis()
Load election analysis - kept as JSON (model-generated predictions)
- Source:
(async) loadJSON(filename) → {Promise.<Object>}
Load JSON with fallback (for election predictions only)
Parameters:
| Name | Type | Description |
|---|---|---|
filename |
string | JSON filename |
- Source:
Returns:
- Parsed JSON
- Type
- Promise.<Object>
(async) loadOverviewDashboard()
Build overview dashboard from CSV sources Replaces overview-dashboard.json
- Source:
(async) loadPartyPerformance()
Build party performance from CSV sources Replaces party-performance.json
- Source:
(async) loadTop10Influential()
Build top 10 influential MPs from CSV sources Replaces top10-influential-mps.json
- Source:
(async) loadVotingPatterns()
Build voting patterns from CSV sources Replaces voting-patterns.json Uses party effectiveness trends since coalition_alignment CSV is empty
- Source:
parseCSV(csvText) → {Array.<Object>}
Parse CSV text into array of objects using header row as keys
Parameters:
| Name | Type | Description |
|---|---|---|
csvText |
string | Raw CSV text |
- Source:
Returns:
- Parsed rows
- Type
- Array.<Object>