Phase 6 - Jupyter Notebooks (15 total): - Overview tab: livability_choropleth, top_bottom_10_bar, income_safety_scatter - Housing tab: affordability_choropleth, rent_trend_line, tenure_breakdown_bar - Safety tab: crime_rate_choropleth, crime_breakdown_bar, crime_trend_line - Demographics tab: income_choropleth, age_distribution, population_density_bar - Amenities tab: amenity_index_choropleth, amenity_radar, transit_accessibility_bar Phase 7 - Documentation: - Updated CLAUDE.md with Sprint 9 completion status - Added notebooks directory to application structure - Expanded figures directory listing Closes #71, #72, #73, #74, #75, #76, #77 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2.1 KiB
2.1 KiB
Toronto Neighbourhood Dashboard - Notebooks
Documentation notebooks for the Toronto Neighbourhood Dashboard visualizations. Each notebook documents how data is queried, transformed, and visualized using the figure factory pattern.
Directory Structure
notebooks/
├── README.md # This file
├── overview/ # Overview tab visualizations
├── housing/ # Housing tab visualizations
├── safety/ # Safety tab visualizations
├── demographics/ # Demographics tab visualizations
└── amenities/ # Amenities tab visualizations
Notebook Template
Each notebook follows a standard two-section structure:
Section 1: Data Reference
Documents the data pipeline:
- Source Tables: List of dbt marts/tables used
- SQL Query: The exact query to fetch data
- Transformation Steps: Any pandas/python transformations
- Sample Output: First 10 rows of the result
Section 2: Data Visualization
Documents the figure creation:
- Figure Factory: Import from
portfolio_app.figures - Parameters: Key configuration options
- Rendered Output: The actual visualization
Available Figure Factories
| Factory | Module | Use Case |
|---|---|---|
create_choropleth |
figures.choropleth |
Map visualizations |
create_ranking_bar |
figures.bar_charts |
Top/bottom N rankings |
create_stacked_bar |
figures.bar_charts |
Category breakdowns |
create_scatter |
figures.scatter |
Correlation plots |
create_radar |
figures.radar |
Multi-metric comparisons |
create_age_pyramid |
figures.demographics |
Age distributions |
create_time_series |
figures.time_series |
Trend lines |
Usage
-
Start Jupyter from project root:
jupyter notebook notebooks/ -
Ensure database is running:
make docker-up -
Each notebook is self-contained - run all cells top to bottom.
Notebook Naming Convention
{metric}_{chart_type}.ipynb
Examples:
livability_choropleth.ipynbcrime_trend_line.ipynbage_pyramid.ipynb