busi488energy/src/app/generation/_sections/generation-chart-section.tsx
Joey Eamigh 564d212148
phase 6: post-review enhancements — data, map UX, charts, navigation
Data:
- Expand datacenter inventory from 38 to 108 facilities
- Add 14 North Carolina datacenters (Apple, Google, AWS, Microsoft, etc.)
- Add missing operators (Cloudflare, Switch, Vantage, Apple, Aligned, Iron Mountain)
- Fill geographic gaps (Southeast, Northwest, Midwest)

Map UX:
- Dark mode via ColorScheme.DARK, hide all default UI controls
- Center on Chapel Hill, NC (lat 35.91, lng -79.06) at zoom 6
- New map legend component (price gradient, marker scale, pulse/glow key)
- Floating region price labels via AdvancedMarker at region centroids
- Tune breathing animation: 8s period, only stressed regions, 5 FPS
- Enhanced markers: capacity labels on 200+ MW, status-based styling

Charts:
- Fix generation chart timestamp duplication (use epoch ms dataKey)
- Fix correlation chart black-on-black axis labels
- Context-aware tick formatting (time-only for 24h, date for longer ranges)

GPU Calculator:
- Default to B200 (1,000W), add R200 Rubin (1,800W)

Navigation:
- Granular Suspense boundaries on all 5 pages
- Extract data-fetching into async Server Components per section
- Page shells render instantly, sections stream in independently
2026-02-11 14:44:46 -05:00

22 lines
711 B
TypeScript

import { fetchGenerationMix } from '@/actions/generation.js';
import { GenerationChart } from '@/components/charts/generation-chart.js';
const DEFAULT_REGION = 'PJM';
const DEFAULT_TIME_RANGE = '30d' as const;
export async function GenerationChartSection() {
const result = await fetchGenerationMix(DEFAULT_REGION, DEFAULT_TIME_RANGE);
if (!result.ok) {
return (
<div className="flex h-96 items-center justify-center rounded-lg border border-dashed border-border">
<p className="text-sm text-destructive">{result.error}</p>
</div>
);
}
return (
<GenerationChart initialData={result.data} initialRegion={DEFAULT_REGION} initialTimeRange={DEFAULT_TIME_RANGE} />
);
}