Replace the current card-based react-grid-layout reports dashboard with a tab-based, fuel-driven reporting interface.
Key Changes:
- Remove draggable cards โ single canvas per tab
- Fuel selector becomes primary control
- Add 6 semantic tabs
- Light uniform surface (no dark cards)
V1 Scope Note:
- V1 is building-level reporting only.
- We are deferring tenant-scoped reporting (i.e., a global "show me only Tenant X" mode) until later.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HEADER โ
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ CONTROL PLANE (sticky) โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ SIDEBAR โ โ Fuel: [Electricity โผ] โ โ
โ โ โ Period: [Last 12M โผ] Compare: [None โผ] โ โ
โ Dashboard โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ Buildings โ โ
โ Readings โ TABS โ
โ Recharges โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ Bills โ โ [Summary] [Trends] [Comparison] [Tenants] [SPC] [Data] โ โ
โ Reports โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ Users โ โ
โ Activity โ MAIN CONTENT AREA โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ โ โ
โ โ โ Tab content renders here โ โ
โ โ โ (single canvas, no cards) โ โ
โ โ โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ KPI STRIP (inline row, no cards) โ
โ โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ โ
โ โ Total kWh โ Total ยฃ โ Avg ยฃ/kWh โ % Recharged โ โ
โ โ 145,230 โ ยฃ14,523 โ ยฃ0.10 โ 87% โ โ
โ โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโดโโโโโโโโโโโโโโดโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ PRIMARY TREND CHART โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โญโโโฎ โ โ
โ โ โฑ โฒ โญโโโฎ โ โ
โ โ โโโฑ โฒโโโฑ โฒโโโโโโ 12-month consumption โ โ
โ โ Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ SECONDARY CHART (Charges / Recharge % / Baseload) โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โโโโ โโโ โโโโ โโ โโโโ โโโ โโโโ โโโ โโโโ โโโ โโโโ โโโ โ โ
โ โ Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ CONTROLS โ
โ Metric: [Consumption โผ] Aggregation: [Monthly โผ] [โ Normalise per mยฒ] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ FULL-WIDTH TIME SERIES โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โโ Tenant A โ โ
โ โ โโ Tenant B โญโโโฎ โญโโโฎ โ โ
โ โ โโ Tenant C โฑ โฒ โญโโโฎโฑ โฒ โ โ
โ โ โโโฑ โฒโโฑ โฒ โฒโโ โ โ
โ โ Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ SUPPORTING CHART (rolling average / seasonality) โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Rolling 3-month average: โโโโโโโโโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PERIOD SELECTORS โ
โ Period A: [Jan-Dec 2025 โผ] vs Period B: [Jan-Dec 2024 โผ] โ
โ Mode: (โ) YoY ( ) MoM ( ) Custom โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ OVERLAID TREND CHART โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โโ 2025 (solid) โ โ
โ โ -- 2024 (dashed) โญโโโฎ โ โ
โ โ โฑ โฒ - - - - โ โ
โ โ โโโโฑ โฒโโโฑ โ โ
โ โ Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ DELTA KPIS โ
โ โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโ โ
โ โ ฮ kWh: +12,450 โ ฮ ยฃ: +ยฃ1,245 โ ฮ %: +8.6% โ โ
โ โ โฒ vs last year โ โฒ vs last year โ โฒ vs last year โ โ
โ โโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ DELTA BARS (monthly deviation) โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โฒ โฒ โฒ โ โ
โ โ โโโโ โโโโ โโโโ โโโโ โผโผโผโผ โโโโ โโโโ โโโโ โผโผโผโผ โโโโ โ โ
โ โ +5% +8% -3% +12% -2% โ โ
โ โ Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ CONTROLS โ
โ Sort by: [Consumption โผ] Metric: [kWh โผ] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ RANKING TABLE โ
โ โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโ โ
โ โ Tenant โ kWh โ ยฃ โ % Total โ Trend โ โ
โ โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค โ
โ โ โถ Tenant A โ 45,230 โ ยฃ4,523 โ 31% โ โโโโโ
โโโโโโ
โ โ
โ โ Tenant B โ 32,100 โ ยฃ3,210 โ 22% โ โโโโโโโโโ
โ
โโ โ
โ โ Tenant C โ 28,450 โ ยฃ2,845 โ 20% โ โโ
โโโโโโโโโ
โ โ
โ โ Tenant D โ 21,200 โ ยฃ2,120 โ 15% โ โโโโโโโโโโโโโ
โ โ Tenant E โ 18,250 โ ยฃ1,825 โ 12% โ โโโโโ
โโโโ
โโโ โ โ
โ โโโโโโโโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ DRILLDOWN PANEL (expanded for Tenant A) โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Tenant A - Meter Breakdown โ โ
โ โ โโโโโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโ โญโโโฎ โ โ
โ โ โ Meter โ kWh โ % โ โฑ โฒ Mini trend โ โ
โ โ โ Floor 1 โ 22,000 โ 49% โโฑ โฒโโ โ โ
โ โ โ Floor 2 โ 23,230 โ 51% โ โ โ
โ โ โโโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SPC CONTROLS โ
โ Metric: [Consumption โผ] Aggregation: [Daily โผ] Baseline: [Rolling 12M โผ]โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ SPC CONTROL CHART โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ UCL (+3ฯ) โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ
โ โ โ โ
โ โ โ โ โ Out of control (red) โ โ
โ โ โ โ โ โ โ โ โ โ โ
โ โ Mean โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ โ โ โ โ โ โ โ โ โ โ โ
โ โ โ โ
โ โ LCL (-3ฯ) โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ANOMALY LOG โ
โ โโโโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ Date โ Value โ Deviation โ Severity โ Notes โโ
โ โโโโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโคโ
โ โ 2025-12-15 โ 1,450kWh โ +2.8ฯ โ โ High โ Above UCL โโ
โ โ 2025-11-03 โ 1,380kWh โ +2.1ฯ โ โ Medium โ Approaching UCL โโ
โ โ 2025-09-22 โ 890kWh โ -2.4ฯ โ โ Medium โ Below normal โโ
โ โโโโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ EXPORT CONTROLS โ
โ [๐ฅ CSV] [๐ฅ Excel] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ RAW DATA TABLE โ
โ โโโโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโ โ
โ โ Timestamp โ Meter โ Tenant โ kWh โ ยฃ โ Rate โSourceโ โ
โ โโโโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโค โ
โ โ 2025-12-01 โ M-001 โ Tenant A โ 1,245 โ ยฃ124.50โ ยฃ0.10 โ API โ โ
โ โ 2025-12-01 โ M-002 โ Tenant A โ 987 โ ยฃ98.70 โ ยฃ0.10 โ API โ โ
โ โ 2025-12-01 โ M-003 โ Tenant B โ 1,102 โ ยฃ110.20โ ยฃ0.10 โ API โ โ
โ โ 2025-12-01 โ M-004 โ Tenant C โ 856 โ ยฃ85.60 โ ยฃ0.10 โ API โ โ
โ โ ... โ ... โ ... โ ... โ ... โ ... โ ... โ โ
โ โโโโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ PAGINATION โ
โ Showing 1-100 of 1,245 records [< Prev] Page 1 of 13 [Next >] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
src/views/pages/reports_v2/
โโโ index.js # Route entry, loads ReportsDashboard
โโโ ReportsDashboard.jsx # Main container with control plane + tabs
โโโ components/
โ โโโ ControlPlane.jsx # Sticky filter bar (Fuel/Period/Compare)
โ โโโ ReportTabs.jsx # Tab navigation component
โ โโโ tabs/
โ โ โโโ SummaryTab.jsx # KPI strip + primary/secondary charts
โ โ โโโ TrendsTab.jsx # Time series with controls
โ โ โโโ ComparisonTab.jsx # Period A vs B comparison
โ โ โโโ TenantsTab.jsx # Ranking table with drilldown
โ โ โโโ SpcTab.jsx # Statistical Process Control
โ โ โโโ DataTab.jsx # Raw data table + export
โ โโโ charts/
โ โ โโโ TrendChart.jsx # Reusable line chart
โ โ โโโ SpcChart.jsx # Control chart with limits
โ โ โโโ DeltaChart.jsx # Comparison delta bars
โ โ โโโ Sparkline.jsx # Mini inline chart
โ โโโ shared/
โ โโโ KpiStrip.jsx # Inline KPI display
โ โโโ EmptyState.jsx # No data placeholder
โ โโโ ExportButtons.jsx # CSV/Excel export
โโโ hooks/
โ โโโ useReportData.js # Data fetching hook
โ โโโ useSpcCalculations.js # SPC math (mean, UCL, LCL)
โ โโโ useUrlState.js # Sync filters to URL params
โโโ constants.js # Fuel configs, period options
โโโ styles.module.scss # Component styles
Sticky bar at top of report area.
Props: {
fuel: string, // 'electricity' | 'gas' | 'water'
onFuelChange: fn,
period: string, // '1m' | '3m' | '6m' | '12m'
onPeriodChange: fn,
comparePeriod: string?, // optional comparison period
onComparePeriodChange: fn,
availableFuels: string[], // from API - which fuels have data
}Layout:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Fuel: [Electricity โผ] โ
โ Period: [Last 12 Months โผ] Compare: [None โผ] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Behaviour:
- Fuel change may hide/show tabs (e.g., SPC not available for all fuels)
- Persist all selections to URL query params
Tab navigation below control plane.
Props: {
activeTab: string,
onTabChange: fn,
fuel: string, // to conditionally show/hide tabs
}Tabs:
| Key | Label | Always Visible |
|---|---|---|
summary |
Summary | Yes |
trends |
Trends | Yes |
comparison |
Comparison | Yes |
tenants |
Tenants | Yes |
spc |
SPC | Yes |
data |
Data | Yes |
Styling:
- Horizontal tabs, underline active
- No icons needed
- Use ARIA roles:
role="tablist",role="tab",aria-selected
Executive overview.
Props: {
fuel: string,
period: string,
buildingId: string,
}Sections:
-
KPI Strip (inline, not cards)
- Total consumption (kWh/mยณ)
- Total charges (ยฃ)
- Average rate (ยฃ/kWh or ยฃ/mยณ)
- % Recharged
-
Primary Chart
- 12-month consumption trend line
-
Secondary Chart
- Charges trend OR Recharge % OR Baseload (fuel-dependent)
API Calls:
reportGetConsumptionSeries(buildingId, params)reportGetChargesSeries(buildingId, params)reportGetRechargedPercentSeries(buildingId, params)
Detailed time series analysis.
Props: {
fuel: string,
period: string,
buildingId: string,
}Local Controls:
- Metric dropdown: Consumption | Charges | Rate | CO2
- Aggregation: Daily | Weekly | Monthly
- Normalise checkbox (per mยฒ)
Charts:
- Full-width time series (multi-line if multiple tenants selected)
- Optional: rolling average overlay
Period-over-period comparison.
Props: {
fuel: string,
periodA: string,
periodB: string,
buildingId: string,
}Local Controls:
- Period A selector
- Period B selector
- Mode: YoY | MoM | Custom
Sections:
- Overlaid Chart - Two lines (Period A vs B)
- Delta KPIs - +/- kWh, +/- ยฃ, +/- %
- Delta Bars - Monthly deviation (green/red)
Building-level tenant/meter ranking (no tenant-scoped dashboard in V1).
Props: {
fuel: string,
period: string,
buildingId: string,
}Local Controls:
- Sort by: Consumption | Charges | % of Total
- Metric: kWh | ยฃ
Table Columns:
| Name | kWh | ยฃ | % Total | Trend |
|---|---|---|---|---|
| Tenant A | 12,450 | ยฃ1,245 | 32% | [sparkline] |
Interaction:
- Click row โ expand inline drilldown panel
- Drilldown shows: mini trend chart + meter breakdown
Statistical Process Control.
Props: {
fuel: string,
period: string,
buildingId: string,
}Local Controls:
- Metric: Consumption | Baseload | Rate
- Aggregation: Daily | Weekly | Monthly
- Baseline: Rolling 12M | Fixed Period
SPC Chart:
- Center line (mean)
- UCL (Upper Control Limit) = mean + 3ฯ
- LCL (Lower Control Limit) = mean - 3ฯ
- Data points with out-of-control flags (red dots)
Anomaly Log Table:
| Date | Value | Deviation | Severity | Notes |
|---|---|---|---|---|
| 2025-12-15 | 1,450 kWh | +2.3ฯ | Warning | - |
SPC Calculation (useSpcCalculations.js):
function calculateSpc(data) {
const values = data.map(d => d.value);
const mean = values.reduce((a, b) => a + b, 0) / values.length;
const stdDev = Math.sqrt(
values.reduce((sum, v) => sum + Math.pow(v - mean, 2), 0) / values.length
);
const ucl = mean + 3 * stdDev;
const lcl = mean - 3 * stdDev;
return {
mean,
ucl,
lcl,
points: data.map(d => ({
...d,
deviation: (d.value - mean) / stdDev,
outOfControl: d.value > ucl || d.value < lcl,
})),
};
}Raw data export.
Props: {
fuel: string,
period: string,
buildingId: string,
}Export Buttons:
- CSV download
- Excel download
Table Columns:
| Timestamp | Meter | Tenant | Value | ยฃ | Rate | Source |
|---|
Pagination: Server-side, 100 rows per page
DO:
- Single light background (
#f8f9faor similar) - Subtle borders between sections
- Consistent spacing (16px/24px grid)
- Use existing CoreUI components where possible
DON'T:
- No card shadows
- No dark panels
- No gradient backgrounds
- No floating elements
CSS Variables to Define:
$report-bg: #f8f9fa;
$report-border: #e9ecef;
$report-text: #212529;
$report-muted: #6c757d;
$report-accent: #0d6efd;Sync all filters to URL for bookmarking/sharing:
/reports/:buildingId?fuel=electricity&period=12m&compare=&tab=summary
Hook: useUrlState.js
function useUrlState() {
const history = useHistory();
const location = useLocation();
const params = new URLSearchParams(location.search);
const setParam = (key, value) => {
params.set(key, value);
history.replace({ search: params.toString() });
};
return {
fuel: params.get('fuel') || 'electricity',
period: params.get('period') || '12m',
compare: params.get('compare') || '',
tab: params.get('tab') || 'summary',
setParam,
};
}All endpoints are in newreportService.js:
| Endpoint | Used By |
|---|---|
reportGetConsumptionSeries |
Summary, Trends |
reportGetChargesSeries |
Summary, Trends |
reportGetCo2Series |
Trends |
reportGetRechargedPercentSeries |
Summary |
reportGetMonthlyProgress |
Summary |
reportGetPerformanceMonthly |
Trends, Data |
reportGetMatrix |
Tenants |
reportGetTenants |
Tenants (for ranking labels / drilldown) |
reportGetAvailableUtilities |
Control Plane |
- Keep existing
report_new/folder untouched for rollback - Create new
reports_v2/folder - Add route in router:
/reports_v2/:idโReportsDashboard - Feature flag (optional): toggle between old/new in settings
- Fuel selector changes all data across tabs
- Tabs switch without page reload
- URL reflects current state (bookmarkable)
- SPC chart shows control limits and flags anomalies
- Data tab exports to CSV
- Empty states shown when no data
- Mobile: control plane collapses to filter button
- No visual cards - single surface design