Skip to content

DataMade: Developer Position Coding Challenge by Grant Russell#12

Open
grantongrant wants to merge 3 commits intodatamade:mainfrom
grantongrant:feature/grant/permit-map-challenge
Open

DataMade: Developer Position Coding Challenge by Grant Russell#12
grantongrant wants to merge 3 commits intodatamade:mainfrom
grantongrant:feature/grant/permit-map-challenge

Conversation

@grantongrant
Copy link

@grantongrant grantongrant commented Mar 18, 2026

Branched from main

Overview

This PR completes the DataMade React Map code challenge. It implements a map of Chicago community areas shaded by the number of new restaurant permits issued in a given year, with interactive popups, a year filter, and summary stats.

Changes / Additions

  • Includes a test

Demo

Permit Map Full View Permit Map Detail View

Notes

See changed files for any notes / comments.

Testing Instructions

  • Clone the repo and check out to feature/grant/permit-map-challenge
  • Rebuild the containers (refer to README.md for instructions)
  • Visit http://localhost:8000/ and confirm:
    • Chicago community areas are displayed as shaded polygons on the map
    • Areas with more permits appear darker
    • Hovering or clicking a community area shows a popup with details
    • The year filter (2016–2026) updates the map and summary stats
    • Total permits and max permits for any one area are displayed
  • Run docker compose -f docker-compose.yml -f tests/docker-compose.yml run --rm app
    • Expected: all tests pass

class Meta:
model = CommunityArea
fields = ["name", "num_permits"]
fields = ["name", "area_id", "num_permits"]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I veered slightly from the instructions, but I took inspiration from the TODO example object in get_num_permits. I would prefer to include the area_id for use on the frontend. I checked the raw data, and while it appears clean, it's just better practice to match on an id if one is present.

Comment on lines +55 to +59
const map = data.reduce((acc, area) => {
acc[area.area_id] = area
return acc
}, {})
setAreaDataMap(map)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I veered slightly from the instructions here as well. I added a state variable to map the area data on the same fetch response as setting the current year data. I'm storing the fetched data in two shapes for convenience, as they serve two different purposes.

currentYearData is the array, used for computing totalNumPermits and maxNumPermits with .reduce()

areaDataMap is the same data keyed by area_id, used for fast lookups in setAreaInteraction where we need to find a specific area by its ID.

@grantongrant grantongrant marked this pull request as ready for review March 18, 2026 14:50
@grantongrant grantongrant changed the title Feature/grant/permit map challenge DataMade: Developer Position Coding Challenge by Grant Russell Mar 18, 2026
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