Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

Redesign home page and refactor code #2204

Merged
merged 56 commits into from
Jul 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
6e751fd
Refactor: Move map switcher to separate component
shuklaayush Jun 13, 2020
92c7d59
Refactor: Move states' page heading to separate component
shuklaayush Jun 13, 2020
01585a0
Style: Use header from state pages for map
shuklaayush Jun 13, 2020
29bb4df
Refactor: Add map panel.
jeremyphilemon Jun 14, 2020
2a063ec
Refactor: Renamed components.
jeremyphilemon Jun 14, 2020
a73de01
Experimental: Try react's concurrent mode.
jeremyphilemon Jun 15, 2020
dd67c56
Feat: Show top 50 districts.
jeremyphilemon Jun 13, 2020
7cb18ec
Feat: Add table helper.
jeremyphilemon Jun 13, 2020
06c23a9
Feat: Use batched updates.
jeremyphilemon Jun 15, 2020
e6f71ea
Improv: Use workers to compute districts.
jeremyphilemon Jun 15, 2020
d3d972c
Refactor: Split into many functions in MapVisualizer.
jeremyphilemon Jun 16, 2020
5aac7df
Refactor: Break MapExplorer into multiple useEffect calls
shuklaayush Jun 16, 2020
ce87643
Style: Add animaitions to rest of the components.
jeremyphilemon Jun 18, 2020
eab9dab
Refactor: Rename keys in map files for consistency
shuklaayush Jun 18, 2020
3cf1b17
Perf: Use pre-projected maps
shuklaayush Jun 18, 2020
d4b74ee
Refactor: Remove Demographics and Essentials.
jeremyphilemon Jun 20, 2020
0babb8f
Refactor: Move animations properties to independent file.
jeremyphilemon Jun 20, 2020
6c15cfa
Feat: Add tested to table.
jeremyphilemon Jun 20, 2020
a1081a3
Refactor: Clean up Search.
jeremyphilemon Jun 20, 2020
1b87694
Add more helpers to table.
jeremyphilemon Jun 21, 2020
ec09df8
Feat: Add sort by delta.
jeremyphilemon Jun 21, 2020
5e8b5d1
Feat: Add exit animations to bubble map
shuklaayush Jun 22, 2020
e74307e
Fix: Support MapVisualiser to work on new UX.
jeremyphilemon Jun 24, 2020
892775d
Feat: Support district highlights.
jeremyphilemon Jun 24, 2020
281b22d
Feat: Add script for pre-projecting maps
shuklaayush Jun 27, 2020
48f4606
Improv: Use population numbers from API to calculate per million values
shuklaayush Jun 27, 2020
1719ab2
Refactor: Replace MAP_OPTIONS with MAP_VIZS for better legibility
shuklaayush Jun 27, 2020
ac0d455
Feat: Add district testing data to main table
shuklaayush Jun 27, 2020
2ce492f
Fix: Use proper dark mode purple colours
shuklaayush Jun 27, 2020
52981f4
Fix: Prevent timeline from crashing
shuklaayush Jun 27, 2020
76d830f
Style: Hide district boundaries from India bubble map
shuklaayush Jun 28, 2020
5adddbc
Refactor: Split currentMap state object into separate states
shuklaayush Jun 28, 2020
6cebffd
Improv: Persist mapStatistic between home/state pages
shuklaayush Jun 28, 2020
8db46d7
Style: Add transitions to map boundary strokes
shuklaayush Jun 28, 2020
ecc4981
Chore: Update/cleanup dependencies
shuklaayush Jun 28, 2020
1af0522
Fix: Remove unnecessary state
shuklaayush Jun 28, 2020
be76d77
Improv: Add animations to tested and map panel numbers
shuklaayush Jun 28, 2020
80f8772
Improv: Reset highlighted region to TT on clicking outside map
shuklaayush Jun 28, 2020
e9c02e5
Improv: Reset highlighted region on clicking outside map
shuklaayush Jun 28, 2020
35884b3
Fix: Unknown districts not showing in district table
shuklaayush Jun 28, 2020
e72d72f
Fix: Make regions in India map tappable
shuklaayush Jun 28, 2020
6ce98b1
Style: Make hovered over table headers opaque
shuklaayush Jun 28, 2020
bd9c3e9
Feat: Long press for delta sorting.
jeremyphilemon Jun 29, 2020
93db052
Refactor: Remove requestIdleCallback in Row.
jeremyphilemon Jun 29, 2020
d7f4d5b
Refactor: Remove requestIdleCallback everywhere.
jeremyphilemon Jun 29, 2020
27eff52
Refactor: Reduce anonymous functions.
jeremyphilemon Jun 30, 2020
6eb311c
Refactor: Remove animations from big components.
jeremyphilemon Jun 30, 2020
3fe43f6
Style: Replace table with css animation.
jeremyphilemon Jun 30, 2020
f54989b
Refactor: Convert more js animations to css.
jeremyphilemon Jul 1, 2020
151bea2
Refactor: Use spring HOC for innerText numbers.
jeremyphilemon Jul 1, 2020
6acf7f0
Style: Fix widths for DeltaBarGraph.
jeremyphilemon Jul 1, 2020
499cf6e
Fix: Make sticky column headers work on small screens
shuklaayush Jul 1, 2020
b10a7bb
Fix: District table not updating with timeline
shuklaayush Jul 2, 2020
f6bdad1
Fix: Remove debug errors.
jeremyphilemon Jul 2, 2020
7fceb77
Fix: Alignment of last updated and state page link in table
shuklaayush Jul 2, 2020
7bb823c
Test: Update tests to work with extra column
shuklaayush Jul 2, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7,457 changes: 4,518 additions & 2,939 deletions package-lock.json

Large diffs are not rendered by default.

51 changes: 25 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"dependencies": {
"@juggle/resize-observer": "^3.2.0",
"@primer/octicons-v2-react": "0.0.0-53e900d",
"@testing-library/jest-dom": "^5.9.0",
"@testing-library/react": "^10.0.6",
"@testing-library/jest-dom": "^5.11.0",
"@testing-library/react": "^10.4.3",
"classnames": "^2.2.6",
"corejs-typeahead": "^1.3.1",
"d3-array": "^2.4.0",
Expand All @@ -24,47 +24,46 @@
"d3-transition": "^1.3.2",
"date-fns": "^2.14.0",
"date-fns-tz": "^1.0.10",
"fast-deep-equal": "^3.1.1",
"i18next": "^19.4.5",
"i18next-browser-languagedetector": "^4.2.0",
"fast-deep-equal": "^3.1.3",
"i18next": "^19.5.1",
"i18next-browser-languagedetector": "^5.0.0",
"i18next-http-backend": "^1.0.15",
"immer": "^6.0.9",
"leaflet": "^1.6.0",
"leaflet-knn": "^0.1.0",
"immer": "^7.0.5",
"lodash": "^4.17.15",
"react": "^16.13.1",
"react-content-loader": "^5.0.4",
"react-date-picker": "^8.0.1",
"react-content-loader": "^5.1.0",
"react-dom": "^16.13.1",
"react-feather": "^2.0.8",
"react-helmet": "^6.0.0",
"react-i18next": "^11.5.0",
"react-is-visible": "^1.1.0",
"react-helmet": "^6.1.0",
"react-i18next": "^11.7.0",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1",
"react-spring": "^8.0.27",
"react-use": "^15.1.1",
"react-use": "^15.3.0",
"react-use-gesture": "^7.0.15",
"requestidlecallback": "^0.3.0",
"source-map-explorer": "^2.4.2",
"swr": "^0.2.2",
"swr": "^0.2.3",
"topojson": "^3.0.2",
"use-dark-mode": "^2.3.1"
"use-dark-mode": "^2.3.1",
"workerize-loader": "^1.3.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build && npm run compress_maps && cp build/index.html build/404.html && npm run build-sw",
"map_test": "react-scripts test src/__tests__/mapAndApiStateNames.test.js",
"build": "react-scripts build",
"postbuild": "npm run compress_maps && cp build/index.html build/404.html && npm run build:sw",
"compress_maps": "rollup -c",
"test": "react-scripts test --testPathIgnorePatterns=src/__tests__/mapAndApiStateNames.test.js",
"eject": "react-scripts eject",
"test": "react-scripts test --testPathIgnorePatterns=src/tests/mapAndApiStateNames.test.js",
"test:map": "react-scripts test src/tests/mapAndApiStateNames.test.js",
"eslint": "eslint .",
"eslint:fix": "eslint --fix --max-warnings=0",
"format": "prettier --write \"**/*.+(js|jsx|json|yml|yaml|md|html)\"",
"scss-lint": "sass-lint 'src/**/*.scss' -v -f table --max-warnings 0",
"scss-lint:fix": "sass-lint-auto-fix 'src/**/*.scss' -d -h -c '.sass-lint-auto-fix.yml'",
"analyze": "source-map-explorer 'build/static/js/*.js'",
"build-sw": "node ./src/sw-build.js",
"start-sw": "http-server ./build -c 0"
"build:sw": "node ./src/swBuild.js",
"start:sw": "http-server ./build -c 0",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
Expand Down Expand Up @@ -93,15 +92,15 @@
"enzyme-adapter-react-16": "^1.15.2",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.0",
"http-server": "^0.12.3",
"husky": "^4.2.5",
"lint-staged": "^10.2.7",
"lint-staged": "^10.2.11",
"node-sass": "^4.14.1",
"prettier": "^2.0.5",
"rollup": "^2.12.1",
"rollup": "^2.18.1",
"rollup-plugin-copy": "^3.3.0",
"sass-lint": "^1.13.1",
"sass-lint-auto-fix": "^0.21.0",
Expand Down
3 changes: 0 additions & 3 deletions placeholder.js

This file was deleted.

84 changes: 0 additions & 84 deletions public/essentials.svg

This file was deleted.

3 changes: 0 additions & 3 deletions public/essentials_1.svg

This file was deleted.

83 changes: 0 additions & 83 deletions public/essentials_2.svg

This file was deleted.

8 changes: 8 additions & 0 deletions public/icons/bubble.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file removed public/icons/history.svg
Empty file.
2 changes: 1 addition & 1 deletion public/maps/andamannicobarislands.json
Original file line number Diff line number Diff line change
Expand Up @@ -2322,7 +2322,7 @@
"translate": [92.20386, 6.754368]
},
"objects": {
"andamannicobarislands_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/andhrapradesh.json
Original file line number Diff line number Diff line change
Expand Up @@ -2894,7 +2894,7 @@
"translate": [76.760595, 12.624077]
},
"objects": {
"andhrapradesh_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/arunachalpradesh.json
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,7 @@
"translate": [91.546459, 26.650844]
},
"objects": {
"arunachalpradesh_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/assam.json
Original file line number Diff line number Diff line change
Expand Up @@ -2987,7 +2987,7 @@
"translate": [89.69860199999998, 24.136603267634122]
},
"objects": {
"assam_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/bihar.json
Original file line number Diff line number Diff line change
Expand Up @@ -3379,7 +3379,7 @@
"translate": [83.320238, 24.286327]
},
"objects": {
"bihar_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/chandigarh.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"translate": [76.705152, 30.667443491919514]
},
"objects": {
"chandigarh_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/chhattisgarh.json
Original file line number Diff line number Diff line change
Expand Up @@ -2971,7 +2971,7 @@
"translate": [80.24647199671277, 17.78769199194691]
},
"objects": {
"chhattisgarh_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/delhi.json
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
"translate": [76.839559, 28.40471312524036]
},
"objects": {
"delhi_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/dnh-and-dd.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
"translate": [70.876053, 19.459169]
},
"objects": {
"dnh-and-dd": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/goa.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
"translate": [73.676874, 14.900642000000001]
},
"objects": {
"goa_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/gujarat.json
Original file line number Diff line number Diff line change
Expand Up @@ -4191,7 +4191,7 @@
"translate": [68.094952, 20.120452]
},
"objects": {
"gujarat_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/haryana.json
Original file line number Diff line number Diff line change
Expand Up @@ -2002,7 +2002,7 @@
"translate": [74.47485342176886, 27.654136819668228]
},
"objects": {
"haryana_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/himachalpradesh.json
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,7 @@
"translate": [75.594723, 30.377701000000002]
},
"objects": {
"himachalpradesh_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
4 changes: 2 additions & 2 deletions public/maps/india.json
Original file line number Diff line number Diff line change
Expand Up @@ -16699,7 +16699,7 @@
"translate": [68.10055226476403, 6.766373153037801]
},
"objects": {
"india-districts-2019-734": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down Expand Up @@ -24940,7 +24940,7 @@
}
]
},
"india-states": {
"states": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/jammukashmir.json
Original file line number Diff line number Diff line change
Expand Up @@ -2284,7 +2284,7 @@
"translate": [73.390075, 32.276216]
},
"objects": {
"jammukashmir_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/jharkhand.json
Original file line number Diff line number Diff line change
Expand Up @@ -2450,7 +2450,7 @@
"translate": [83.3301316194849, 21.974665795660215]
},
"objects": {
"jharkhand_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/karnataka.json
Original file line number Diff line number Diff line change
Expand Up @@ -3861,7 +3861,7 @@
"translate": [74.085688, 11.594585]
},
"objects": {
"karnataka_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/kerala.json
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@
"translate": [74.867656, 8.292489]
},
"objects": {
"kerala_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/ladakh.json
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@
"translate": [72.530394, 32.337631]
},
"objects": {
"ladakh_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/lakshadweep.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
"translate": [72.164852, 8.264004]
},
"objects": {
"lakshadweep_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/madhyapradesh.json
Original file line number Diff line number Diff line change
Expand Up @@ -7129,7 +7129,7 @@
"translate": [74.03468857438199, 21.069907]
},
"objects": {
"madhyapradesh_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/maharashtra.json
Original file line number Diff line number Diff line change
Expand Up @@ -5250,7 +5250,7 @@
"translate": [72.654608, 15.606125]
},
"objects": {
"maharashtra_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/manipur.json
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@
"translate": [92.97284500000002, 23.833016]
},
"objects": {
"manipur_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/meghalaya.json
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@
"translate": [89.815752, 25.030005400110966]
},
"objects": {
"meghalaya_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/mizoram.json
Original file line number Diff line number Diff line change
Expand Up @@ -3338,7 +3338,7 @@
"translate": [92.25672383937811, 21.944190125242905]
},
"objects": {
"mizoram_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/nagaland.json
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@
"translate": [93.32899095285474, 25.199075200465085]
},
"objects": {
"nagaland_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/odisha.json
Original file line number Diff line number Diff line change
Expand Up @@ -3373,7 +3373,7 @@
"translate": [81.389054, 17.812726]
},
"objects": {
"odisha_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/puducherry.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@
"translate": [75.526636, 10.827445]
},
"objects": {
"puducherry_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/punjab.json
Original file line number Diff line number Diff line change
Expand Up @@ -2015,7 +2015,7 @@
"translate": [73.879848, 29.54208]
},
"objects": {
"punjab_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
2 changes: 1 addition & 1 deletion public/maps/rajasthan.json
Original file line number Diff line number Diff line change
Expand Up @@ -4826,7 +4826,7 @@
"translate": [69.484227, 23.059220531669062]
},
"objects": {
"rajasthan_district": {
"districts": {
"type": "GeometryCollection",
"geometries": [
{
Expand Down
Loading