feat: Complete Phase 5 dashboard implementation
Implement full 5-tab Toronto Neighbourhood Dashboard with real data connectivity: Dashboard Structure: - Overview tab with livability scores and rankings - Housing tab with affordability metrics - Safety tab with crime statistics - Demographics tab with population/income data - Amenities tab with parks, schools, transit Figure Factories (portfolio_app/figures/): - bar_charts.py: ranking, stacked, horizontal bars - scatter.py: scatter plots, bubble charts - radar.py: spider/radar charts - demographics.py: donut, age pyramid, income distribution Service Layer (portfolio_app/toronto/services/): - neighbourhood_service.py: queries dbt marts for all tab data - geometry_service.py: generates GeoJSON from PostGIS - Graceful error handling when database unavailable Callbacks (portfolio_app/pages/toronto/callbacks/): - map_callbacks.py: choropleth updates, map click handling - chart_callbacks.py: supporting chart updates - selection_callbacks.py: dropdown handlers, KPI updates Data Pipeline (scripts/data/): - load_toronto_data.py: orchestration script with CLI flags Lessons Learned: - Graceful error handling in service layers - Modular callback structure for multi-tab dashboards - Figure factory pattern for reusable charts Closes: #64, #65, #66, #67, #68, #69, #70 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,27 @@
|
||||
"""Plotly figure factories for data visualization."""
|
||||
|
||||
from .bar_charts import (
|
||||
create_horizontal_bar,
|
||||
create_ranking_bar,
|
||||
create_stacked_bar,
|
||||
)
|
||||
from .choropleth import (
|
||||
create_choropleth_figure,
|
||||
create_zone_map,
|
||||
)
|
||||
from .demographics import (
|
||||
create_age_pyramid,
|
||||
create_donut_chart,
|
||||
create_income_distribution,
|
||||
)
|
||||
from .radar import (
|
||||
create_comparison_radar,
|
||||
create_radar_figure,
|
||||
)
|
||||
from .scatter import (
|
||||
create_bubble_chart,
|
||||
create_scatter_figure,
|
||||
)
|
||||
from .summary_cards import create_metric_card_figure, create_summary_metrics
|
||||
from .time_series import (
|
||||
add_policy_markers,
|
||||
@@ -26,4 +44,18 @@ __all__ = [
|
||||
# Summary
|
||||
"create_metric_card_figure",
|
||||
"create_summary_metrics",
|
||||
# Bar charts
|
||||
"create_ranking_bar",
|
||||
"create_stacked_bar",
|
||||
"create_horizontal_bar",
|
||||
# Scatter plots
|
||||
"create_scatter_figure",
|
||||
"create_bubble_chart",
|
||||
# Radar charts
|
||||
"create_radar_figure",
|
||||
"create_comparison_radar",
|
||||
# Demographics
|
||||
"create_age_pyramid",
|
||||
"create_donut_chart",
|
||||
"create_income_distribution",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user