You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your task is to complete the following programming exercise to show us some of your code! This exercise is based on work that DataMade does every day: pulling data from the web, debugging tricky code, and presenting information to the world.
@@ -41,8 +39,9 @@ docker compose build
41
39
```
42
40
43
41
Load in the data:
42
+
44
43
```bash
45
-
docker compose run --rm app python manage.py loaddata map/fixtures/restaurant_permits.json
44
+
docker compose run --rm app python manage.py loaddata map/fixtures/restaurant_permits.json map/fixtures/community_areas.json
46
45
```
47
46
48
47
And finally, run the app:
@@ -56,6 +55,7 @@ The app will log to the console, and you should be able to visit it at http://lo
56
55
## Completing the Challenge
57
56
58
57
Once you have the app up and running on your computer, you'll need to flesh out certain code blocks to make the map functional. You'll be using [Django](https://docs.djangoproject.com/en/6.0/) and [React-Leaflet](https://react-leaflet.js.org/docs/api-components/) to complete this task. By the end of this challenge, you should have:
58
+
59
59
- a map that displays Chicago's community areas, shaded depending on how many new restaurant permits were issued in a given year
60
60
- community area shapes that show some light details on that community area when a user interacts with them
61
61
- a filter that allows users to request permits that were issued in a given year
@@ -64,16 +64,21 @@ Once you have the app up and running on your computer, you'll need to flesh out
64
64
This way you go about completing these goals is meant to be open-ended, so tackle the following steps in whatever way you're most comfortable!
65
65
66
66
### Step 1: Supplement the community area geojson data
67
+
67
68
In `map/serializers.py`, supplement each community area with data on the amount of permits issued in each area during the currently filtered year. From here, the view will pass that data to the front end.
68
69
69
70
### Step 2: Filter results by a specific year
71
+
70
72
In `map/static/js/RestaurantPermitMap.js`, create a filter that allows users to send a request for a specific year to the backend. The options shoulds be any year between 2016 and 2026, inclusive. Then, use the fetch api in the map component to make a request and receive that data.
71
73
72
74
### Step 3: Display results on the page
75
+
73
76
In the map component, process the community area and use it to display shapes for all areas on the map. Then, display the total number of restaurant permits that year as well as the maximum number of permits in any one area.
74
77
75
78
### Step 4: Make the map dynamic
79
+
76
80
Start displaying some data! Use the `setAreaInteraction()` method to shade the map according to how many permits it has in a year, making sure that it updates automatically when a new year is selected. In this same method, have each area display a popup during some kind of user interaction. The popup should have some light details to help the user understand what they're looking at.
77
81
78
82
### Step 5: Submit your work
83
+
79
84
To submit your work, create a feature branch for your code, commit your changes, push your commits up to your fork, and open up a pull request against main. Finally, drop a link to your pull request in your application.
0 commit comments