Finance JavaScript Architecture¶
System Overview¶
Data Flow¶
Centralized Data Fetching¶
Module Import Pattern¶
Example: US Finances Renderer¶
Adding New Features¶
Step 1: Import Required Utilities¶
Step 2: Use Standard Pattern¶
Step 3: Load as Module¶
Debugging Guide¶
Common Issues¶
1. Module not found
type="module"
- Verify import path is correct (./ for same directory)
2. Function not exported
3. Data fetch errors
Tracing Data Flow¶
- Check browser console for initial errors
- Verify fetch succeeds - look for "Icons loaded from JSON" message
- Check data filtering - add console.log after fetchFinanceData()
- Inspect DOM - verify container exists before rendering
Last Updated: Oct 6 2025