Rebuild dashboard.py with 5-tab structure #66

Closed
opened 2026-01-17 16:08:00 +00:00 by lmiranda · 0 comments
Owner

Summary

Replace the current legacy dashboard layout (TRREB-style with purchase/rental sections) with a modern 5-tab structure aligned to the neighbourhood dashboard vision.

Current State

pages/toronto/dashboard.py has:

  • Purchase Market section (legacy TRREB)
  • Rental Market section
  • Time series charts
  • No tab navigation

Target State

New tabbed layout:

  1. Overview - Composite livability score
  2. Housing - Affordability metrics
  3. Safety - Crime statistics
  4. Demographics - Population/income
  5. Amenities - Parks, schools, transit

Files to Modify

File Changes
portfolio_app/pages/toronto/dashboard.py Complete rewrite with tab navigation

Files to Create

File Purpose
portfolio_app/pages/toronto/tabs/__init__.py Package init
portfolio_app/pages/toronto/tabs/overview.py Overview tab layout
portfolio_app/pages/toronto/tabs/housing.py Housing tab layout
portfolio_app/pages/toronto/tabs/safety.py Safety tab layout
portfolio_app/pages/toronto/tabs/demographics.py Demographics tab layout
portfolio_app/pages/toronto/tabs/amenities.py Amenities tab layout

Layout Pattern (All Tabs)

Each tab follows:

  1. Choropleth Map (left, ~60% width) - 158 neighbourhoods
  2. KPI Cards (right, ~40% width) - 3-4 contextual metrics
  3. Supporting Charts (bottom) - Trend + comparison visualizations
  4. Details Panel (collapsible) - All metrics for selected neighbourhood

Acceptance Criteria

  • Tab navigation using dmc.Tabs
  • Each tab loads its own layout module
  • Shared header with year selector
  • URL hash updates with tab selection (/toronto#housing)
  • Responsive layout (mobile-friendly)
  • Dark mode compatible

Technical Notes

  • Use dash-mantine-components v0.14+ Tabs API
  • Tab content should lazy-load for performance
  • Store selected neighbourhood in dcc.Store

Labels: type:feature, component:frontend, priority:critical, tech:python, tech:dash

## Summary Replace the current legacy dashboard layout (TRREB-style with purchase/rental sections) with a modern 5-tab structure aligned to the neighbourhood dashboard vision. ## Current State `pages/toronto/dashboard.py` has: - Purchase Market section (legacy TRREB) - Rental Market section - Time series charts - No tab navigation ## Target State New tabbed layout: 1. **Overview** - Composite livability score 2. **Housing** - Affordability metrics 3. **Safety** - Crime statistics 4. **Demographics** - Population/income 5. **Amenities** - Parks, schools, transit ## Files to Modify | File | Changes | |------|---------| | `portfolio_app/pages/toronto/dashboard.py` | Complete rewrite with tab navigation | ## Files to Create | File | Purpose | |------|---------| | `portfolio_app/pages/toronto/tabs/__init__.py` | Package init | | `portfolio_app/pages/toronto/tabs/overview.py` | Overview tab layout | | `portfolio_app/pages/toronto/tabs/housing.py` | Housing tab layout | | `portfolio_app/pages/toronto/tabs/safety.py` | Safety tab layout | | `portfolio_app/pages/toronto/tabs/demographics.py` | Demographics tab layout | | `portfolio_app/pages/toronto/tabs/amenities.py` | Amenities tab layout | ## Layout Pattern (All Tabs) Each tab follows: 1. **Choropleth Map** (left, ~60% width) - 158 neighbourhoods 2. **KPI Cards** (right, ~40% width) - 3-4 contextual metrics 3. **Supporting Charts** (bottom) - Trend + comparison visualizations 4. **Details Panel** (collapsible) - All metrics for selected neighbourhood ## Acceptance Criteria - [ ] Tab navigation using `dmc.Tabs` - [ ] Each tab loads its own layout module - [ ] Shared header with year selector - [ ] URL hash updates with tab selection (`/toronto#housing`) - [ ] Responsive layout (mobile-friendly) - [ ] Dark mode compatible ## Technical Notes - Use dash-mantine-components v0.14+ Tabs API - Tab content should lazy-load for performance - Store selected neighbourhood in `dcc.Store` **Labels:** type:feature, component:frontend, priority:critical, tech:python, tech:dash
Sign in to join this conversation.