Create additional figure factories for dashboard charts #67

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

Summary

Extend the figures module with additional chart types needed for the 5-tab dashboard. Currently we have choropleth, time_series, and summary_cards. Need bar charts, scatter plots, radar charts, and specialized visualizations.

Files to Create/Modify

File Charts
portfolio_app/figures/bar_charts.py Horizontal bar (rankings), Stacked bar (breakdown)
portfolio_app/figures/scatter.py Scatter plot (correlation views)
portfolio_app/figures/radar.py Radar/spider chart (multi-metric comparison)
portfolio_app/figures/demographics.py Age pyramid, Language distribution
portfolio_app/figures/__init__.py Export new factories

Chart Specifications

Bar Charts

  • create_ranking_bar() - Top/Bottom 10 neighbourhoods
  • create_stacked_bar() - Crime type breakdown, Dwelling types

Scatter Plot

  • create_scatter_figure() - Income vs Crime, Rent vs Income

Radar Chart

  • create_radar_figure() - Multi-axis comparison (amenity scores)

Demographics

  • create_age_pyramid() - Age distribution by gender
  • create_language_bar() - Top languages spoken

Acceptance Criteria

  • All charts support dark mode (transparent backgrounds, light text)
  • Consistent color palette across all charts
  • Hover tooltips with meaningful data
  • Charts are responsive (resize properly)
  • Each factory has clear docstring with parameters
  • Unit tests for each factory

Technical Notes

  • Use Plotly Express where possible for simplicity
  • Follow existing pattern in choropleth.py
  • Color scales: Blues for housing, Reds for crime, Greens for amenities
  • All charts should accept title parameter

Labels: type:feature, component:frontend, priority:high, tech:python, tech:plotly

## Summary Extend the figures module with additional chart types needed for the 5-tab dashboard. Currently we have choropleth, time_series, and summary_cards. Need bar charts, scatter plots, radar charts, and specialized visualizations. ## Files to Create/Modify | File | Charts | |------|--------| | `portfolio_app/figures/bar_charts.py` | Horizontal bar (rankings), Stacked bar (breakdown) | | `portfolio_app/figures/scatter.py` | Scatter plot (correlation views) | | `portfolio_app/figures/radar.py` | Radar/spider chart (multi-metric comparison) | | `portfolio_app/figures/demographics.py` | Age pyramid, Language distribution | | `portfolio_app/figures/__init__.py` | Export new factories | ## Chart Specifications ### Bar Charts - `create_ranking_bar()` - Top/Bottom 10 neighbourhoods - `create_stacked_bar()` - Crime type breakdown, Dwelling types ### Scatter Plot - `create_scatter_figure()` - Income vs Crime, Rent vs Income ### Radar Chart - `create_radar_figure()` - Multi-axis comparison (amenity scores) ### Demographics - `create_age_pyramid()` - Age distribution by gender - `create_language_bar()` - Top languages spoken ## Acceptance Criteria - [ ] All charts support dark mode (transparent backgrounds, light text) - [ ] Consistent color palette across all charts - [ ] Hover tooltips with meaningful data - [ ] Charts are responsive (resize properly) - [ ] Each factory has clear docstring with parameters - [ ] Unit tests for each factory ## Technical Notes - Use Plotly Express where possible for simplicity - Follow existing pattern in `choropleth.py` - Color scales: Blues for housing, Reds for crime, Greens for amenities - All charts should accept `title` parameter **Labels:** type:feature, component:frontend, priority:high, tech:python, tech:plotly
Sign in to join this conversation.