feat: score-history chart on the regime tab
Plots the index, early-warning, and combined scores over time beneath the live gauges, with a 1M/3M/6M/All range toggle and band reference lines — so the trend and any divergence between the scores is visible, not just today's snapshot. - Backend: GET /regime/history + get_regime_history (the three scores per snapshot date from regime_snapshots). - Frontend: recharts line chart, lazy-loaded so recharts ships in its own regime-tab chunk instead of nearly doubling the main bundle. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -4,12 +4,19 @@ import type {
|
||||
RegimeConfig,
|
||||
RegimeFundamentals,
|
||||
EventStudyReport,
|
||||
RegimeHistoryPoint,
|
||||
} from '../lib/types';
|
||||
|
||||
export function getRegimeMonitor() {
|
||||
return apiClient.get<RegimeMonitor>('regime/monitor').then((r) => r.data);
|
||||
}
|
||||
|
||||
export function getRegimeHistory(days = 400) {
|
||||
return apiClient
|
||||
.get<RegimeHistoryPoint[]>('regime/history', { params: { days } })
|
||||
.then((r) => r.data);
|
||||
}
|
||||
|
||||
export function getEventStudy() {
|
||||
return apiClient.get<EventStudyReport | null>('regime/event-study').then((r) => r.data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user