Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constituency Map - Competitiveness #6

Merged
merged 36 commits into from
Apr 18, 2024
Merged

Constituency Map - Competitiveness #6

merged 36 commits into from
Apr 18, 2024

Conversation

vaeyias
Copy link
Contributor

@vaeyias vaeyias commented Apr 17, 2024

image

Main Changes:

  • Backend:

    • India Constituency Geojson
    • load in Lok Sahba data for margin percentage/winners
    • added two files (competitivenessColor.json containing the colors corresponding to each map entry and competitivenessData.json containing data from the dataset) that contain data for the competitiveness map (to reduce loading time)
  • new page for the competitiveness map

  • Changes to the Example leaflet map:

    • currently, CompetitivenessMap.js loads in the geojson and fetches the competitiveness data from two files in the backend. Then, it fetches new data everytime the election year changes
    • removed previous Legend showing that allows you to select which layers to display from MapBase.js
    • added a gradient legend
    • added a legend displaying information about a constituency on hover
    • added a timeline slider to change election year
    • adjustments to center and boundaries
  • Other changes

    • new dependency: MUI for the discrete timeline slider

To-Dos

  • add functions to generate initial colors data to backend
  • nav bar button leading to the page (I believe another group is working on this)
  • move Example.scss code to a diff file (I couldn't find where the Example.scss file was being imported so I couldn't change the file name)
  • stylistic improvements to map/information displayed
    • the information being displayed at the side of the map
    • potentially add labels directly on constituencies
    • remove background map
  • style the "loading..." text that appears before the map appears
  • make new components, such as DiscreteSlider and GradientLegend more reusable with props
  • minor organizational changes to files/code, like moving the new json files out of the geojson folder

@vaeyias vaeyias requested a review from JusticeV452 April 17, 2024 02:37
@vaeyias vaeyias self-assigned this Apr 17, 2024
Copy link
Member

@JusticeV452 JusticeV452 left a comment

Choose a reason for hiding this comment

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

Thanks for getting this in quickly, and nice job reducing the map's load time! Also, thanks for making the changes and TODOs clear in the PR, including an image, and ensuring all the checks passed. I made a few comments regarding the comment blocks intended for future use and renaming a function, but overall, everything looks great.

frontend/components/CompetitivenessMap.js Outdated Show resolved Hide resolved
frontend/components/CompetitivenessMap.js Outdated Show resolved Hide resolved
frontend/components/CompetitivenessMap.js Outdated Show resolved Hide resolved
frontend/scss/example.scss Outdated Show resolved Hide resolved
frontend/scss/mapLegends.scss Outdated Show resolved Hide resolved
backend/app/api_views.py Outdated Show resolved Hide resolved
backend/app/management/commands/load_loksabha.py Outdated Show resolved Hide resolved
backend/app/management/commands/load_loksabha.py Outdated Show resolved Hide resolved
backend/config/urls.py Outdated Show resolved Hide resolved
.vscode/settings.json Outdated Show resolved Hide resolved
vaeyias added 5 commits April 17, 2024 22:46
changed get_competiveness_colors to get_competitiveness_data
-edited comments from pylint:disable=R0801 to pylint:disable=duplicate-code

-used parenthesis instead of \ to break lines in code
- removed large comment blocks
- removed some comments in scss files
- used white and black instead of the variable $color-white and $color-black
@vaeyias vaeyias requested a review from JusticeV452 April 18, 2024 03:24
@JusticeV452 JusticeV452 merged commit c96927a into main Apr 18, 2024
4 checks passed
@JusticeV452 JusticeV452 deleted the constituency-map branch April 18, 2024 03:30
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.

4 participants