Skip to content

completed coding challenge#25

Open
hollowred wants to merge 1 commit intodatamade:mainfrom
hollowred:main
Open

completed coding challenge#25
hollowred wants to merge 1 commit intodatamade:mainfrom
hollowred:main

Conversation

@hollowred
Copy link
Copy Markdown

Summary

This PR adds interactive year filtering to the restaurant permit map, allowing users to visualize permit distribution across Chicago community areas from 2016-2026.

Changes Implemented

  • Backend: Modified CommunityAreaSerializer to accept year parameter and count permits
  • API Endpoint: /map-data/?year=YYYY now returns permit counts per community area
  • Frontend: Added year selector dropdown to React map component
  • Visualization: Dynamic coloring of community areas based on permit density
  • Interactivity: Hover popups display detailed permit statistics
  • Statistics: Display total permits and maximum permits per year
  • Testing: Added unit tests for year filtering functionality

Technical Details

  • Created get_num_permits() method in serializer with year from context
  • Implemented fetch API call on year change in React component
  • Added color gradient mapping based on percentage of max permits
  • Popups show area name, permit count, and percentage of maximum

Testing

  • Unit tests pass for year filtering
  • Map displays correctly for all years 2016-2026
  • Hover popups show correct data
  • Colors update dynamically when year changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant