-
Notifications
You must be signed in to change notification settings - Fork 24
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
Refactor D3 Map to Support Both Rate Charts and Unknowns Charts #3949
Conversation
…r isMobile property
✅ Deploy Preview for health-equity-tracker ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
# Description and Motivation <!--- bulleted, high level items. use keywords (eg "closes SatcherInstitute#144" or "fixes #4323") --> - adds feature flag - conditionally adds "Gun Deaths" as new dropdown topic - adds handling for gun deaths from CHR to AHR provider (maybe should be gun violence? Maybe we should rethink the provider structure overall) ## Has this been tested? How? e2e tests still passing. manually confirmed only working with flag enabled on county-level data ## Screenshots (if appropriate) ![image](https://github.com/user-attachments/assets/3523411e-54c5-4ef5-bd08-5dbc3a48067b) ![image](https://github.com/user-attachments/assets/6c6489cb-bc09-4bf0-b54c-b4226ffb8fd5) ## Types of changes (leave all that apply) - New content or feature ## New frontend preview link is below in the Netlify comment 😎
removed unused file fix npm security issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like there are some frontend test errors happening; maybe typescript errors?
also, the highest/lowest mode for CAWP is strange where it's assigning colors correctly to the territory bubbles, but switched for the states (yellow should be GOOD rates of women in gov, but it's showing the states with the worst rates 0% as yellow... only in highest/lowest but not in normal view)
![Screenshot 2025-02-06 at 10 21 32 PM](https://private-user-images.githubusercontent.com/41567007/410771261-0eea5e48-fad2-4566-abf1-ff190548668c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0ODA0MjcsIm5iZiI6MTczOTQ4MDEyNywicGF0aCI6Ii80MTU2NzAwNy80MTA3NzEyNjEtMGVlYTVlNDgtZmFkMi00NTY2LWFiZjEtZmYxOTA1NDg2NjhjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDIwNTUyN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAxNTNhZDZjNjVkMjg2ZmE2M2Q0ZjI1NDY0MzdjNjUxYmM3N2ZmMjM4ZTcyNmZlMThkMWExMWY4MmEzZWRlNDgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.4nKs_k8wugJI0bR1lEgENQZiWtw6-27Nm8bgYgyOfUU)
Colors aren't perfectly synced with the legend yet, when expanding into extremes mode, you can see Oklahoma should have the lightest yellow color based on its rate, but it's shown as a slightly darker orange. almost like it's recalculating the color scale from only the remaining states but keeping the legend scale across ALL data points. I think either way is fine, like if the extremes mode gets its newly calculated scale, but we need to make sure the legend will match it accurately
![Screenshot 2025-02-06 at 10 26 21 PM](https://private-user-images.githubusercontent.com/41567007/410772223-98d6a716-6f7a-470d-86fd-a9e2ef2a7a18.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0ODA0MjcsIm5iZiI6MTczOTQ4MDEyNywicGF0aCI6Ii80MTU2NzAwNy80MTA3NzIyMjMtOThkNmE3MTYtNmY3YS00NzBkLTg2ZmQtYTllMmVmMmE3YTE4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDIwNTUyN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVkNGMzNzAyMWI4ZGZiNTY4ZTA5MzRjNmFjNmQ1NDUwOTQ2ODg1YmIyNjE5YWQyYTkzNDg5OTBkNjU1NjAwNTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.WIsO5uaAj5RL7hxe8GyeFoBYnCPdJkj1kGLFeecrLWs)
![Screenshot 2025-02-06 at 10 26 24 PM](https://private-user-images.githubusercontent.com/41567007/410772226-be2a2841-64af-44e7-b82a-85e3174819ee.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0ODA0MjcsIm5iZiI6MTczOTQ4MDEyNywicGF0aCI6Ii80MTU2NzAwNy80MTA3NzIyMjYtYmUyYTI4NDEtNjRhZi00NGU3LWI4MmEtODVlMzE3NDgxOWVlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDIwNTUyN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ1ZjZjNGIzMDc4YTY3NzQxY2JiOGY0NzAxN2NhMGE2YjYwZjNiYjYwYWYxOGU5ZDBmNjZlYTE2OGI5MjQwMDImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Pc4EJu3kkEoRYxeMAoUNglHtCSAw7927gYotZZ0weKc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome work! thanks for cleaning everything up and improving the legends across the board. There are some weird things still around the color scheme typing, but I think we'll be able to clean those up and simplify once we've totally switched over to the new d3 stuff (and fully removed vega)
const mapScheme = | ||
typeof props.mapConfig.scheme === 'string' | ||
? props.mapConfig.scheme | ||
: 'darkgreen' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this feels weird; will we be able to remove this once we have fully migrated from vega to d3 ?
Description and Motivation
This PR refactors the D3 map implementation to support both rate charts and unknowns charts. Key changes include:
renderMap.tsx
to handle different chart types dynamically.getFillColor
to adjust colors based on extremesMode for better data visualization.createColorScale
to internally determine the appropriate scale type (sequentialSymlog vs. quantileSequential).Has this been tested? How?
Tested locally
Screenshots (if appropriate)
Types of changes
New frontend preview link is below in the Netlify comment 😎