diff --git a/.env.example b/.env.example deleted file mode 100644 index a9ee153..0000000 --- a/.env.example +++ /dev/null @@ -1 +0,0 @@ -CDP_APP_TOKEN= diff --git a/README.md b/README.md index 7029dc7..975966d 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ # DataMade Code Challenge: React Map ---- + -Welcome to the DataMade code challenge! 👋 - -https://github.com/user-attachments/assets/39702bb2-0a72-45a0-91bf-2d48d990fbce +Welcome to the 2026 DataMade code challenge! 👋 ## Overview @@ -16,18 +14,6 @@ There’s no time limit, but don’t feel the need to go over the top with your We’ll be evaluating whether the code works, as well as its quality. Before submitting, make sure that your code does what you expect it to do, that it’s clean and neat enough to meet your standards, and that you’ve provided us some instructions on how to run it. -_Note: If you would prefer to keep your code challenge private, please share access with the following members of DataMade on GitHub:_ - -| Member | GitHub Account | -| --------- | -------------------------------- | -| Hannah | https://github.com/hancush | -| Derek | https://github.com/derekeder | -| Monkruman | https://github.com/antidipyramid | -| Xavier | https://github.com/xmedr | -| Hayley | https://github.com/haowens | - -Keep in mind that you cannot create a private fork of a public repository on GitHub, so you’ll need to [follow these instructions](https://gist.github.com/0xjac/85097472043b697ab57ba1b1c7530274) to create a private copy of the repo. - ## Installation Development requires a local installation of [Docker](https://docs.docker.com/get-started/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/). These are the only two system-level dependencies you should need. @@ -82,3 +68,15 @@ Start displaying some data! Use the `setAreaInteraction()` method to shade the m ### Step 5: Submit your work 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. + +_Note: If you would prefer to keep your code challenge private, please share access with the following members of DataMade on GitHub:_ + +| Member | GitHub Account | +| --------- | -------------------------------- | +| Hannah | https://github.com/hancush | +| Derek | https://github.com/derekeder | +| Monkruman | https://github.com/antidipyramid | +| Xavier | https://github.com/xmedr | +| Hayley | https://github.com/haowens | + +Keep in mind that you cannot create a private fork of a public repository on GitHub, so you’ll need to [follow these instructions](https://gist.github.com/0xjac/85097472043b697ab57ba1b1c7530274) to create a private copy of the repo. \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index c1b2c94..a743cce 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,8 +35,6 @@ services: DJANGO_MANAGEPY_MIGRATE: "on" DJANGO_DEBUG: "True" PGPASSWORD: postgres - env_file: - - .env entrypoint: /app/docker-entrypoint.sh command: python manage.py runserver 0.0.0.0:8000 @@ -55,7 +53,7 @@ services: volumes: - map-db-data:/var/lib/postgresql ports: - - 32001:5432 + - 5432:5432 volumes: map-db-data: diff --git a/map/static/images/2026-datamade-code-challenge.jpg b/map/static/images/2026-datamade-code-challenge.jpg new file mode 100644 index 0000000..10778ff Binary files /dev/null and b/map/static/images/2026-datamade-code-challenge.jpg differ diff --git a/map/static/js/RestaurantPermitMap.js b/map/static/js/RestaurantPermitMap.js index 3cbbb14..4c98b9c 100644 --- a/map/static/js/RestaurantPermitMap.js +++ b/map/static/js/RestaurantPermitMap.js @@ -37,6 +37,8 @@ function YearSelect({ setFilterVal }) { } export default function RestaurantPermitMap() { + const colors = ["#eff3ff", "#bdd7e7", "#6baed6", "#2171b5"] + const [currentYearData, setCurrentYearData] = useState([]) const [year, setYear] = useState(2026) @@ -59,17 +61,32 @@ export default function RestaurantPermitMap() { .then((data) => setCurrentYearData(data)) }, [currentUrl]) + function getColor(pcntPermits) { + if (pcntPermits > .5) + return colors[3] + else if (pcntPermits > .2) + return colors [2] + else if (pcntPermits >= .01) + return colors [1] + else + return colors[0] + } + function setAreaInteraction(feature, layer) { const thisAreaData = communityAreaDict[feature.properties.community], numPermits = thisAreaData.num_permits, pcntPermits = numPermits / maxNumPermits layer.setStyle({ - fillOpacity: pcntPermits, + color: "#000000", + weight: 1, + fillOpacity: 0.7, + fillColor: getColor(pcntPermits) }) layer.on("mouseover", () => { layer.bindPopup(` -
Restaurant permits issued during ${year}: ${thisAreaData.num_permits}
+ ${feature.properties.community}