8000 [LANDGRIF-1685] updates typing of legend values and map data by agnlez · Pull Request #1251 · Vizzuality/landgriffon · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[LANDGRIF-1685] updates typing of legend values and map data #1251

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&rdqu 8000 o;, 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

Merged
merged 1 commit into from
May 12, 2025

Conversation

agnlez
Copy link
Member
@agnlez agnlez commented May 12, 2025

General description

https://vizzuality.atlassian.net/browse/LANDGRIF-1685

This pull request focuses on improving type safety and simplifying code in the analysis-map and h3-data modules. The changes primarily involve refining type definitions, removing unnecessary type assertions, and streamlining function implementations.

Type Safety Improvements:

  • Updated scaleByLegendType in client/src/hooks/h3-data/utils.ts to use more precise type definitions for threshold and rangeValues, replacing generic number[] and string[] with inferred types based on Legend['items']. This eliminates the need for type assertions.

Code Simplifications:

  • Simplified the getLegendScale function in client/src/containers/analysis-visualization/analysis-map/component.tsx by directly returning the result of scaleByLegendType instead of assigning it to a variable first.
  • Streamlined the responseContextualParser function in client/src/hooks/h3-data/contextual.ts by removing redundant type annotations and formatting the data.map callback for clarity.

Cleanup:

  • Removed an unused import (UseQueryResult) and the associated H3DataResponse type in client/src/hooks/h3-data/utils.ts, as they were no longer utilized in the codebase. [1] [2]

Designs

Link to the related design prototypes (if applicable)

Testing instructions

Provide minimal instructions on how to test this PR.

  • Apart from the added feature / bug fix, check overall performance, styling...

Checklist before merging

  • Branch name / PR includes the related Jira ticket Id.
  • Tests to check core implementation / bug fix added.
  • All checks in Continuous Integration workflow pass.
  • Feature functionally tested by reviewer(s).
  • Code reviewed by reviewer(s).
  • Documentation updated (README, CHANGELOG...) (if required)

@agnlez agnlez self-assigned this May 12, 2025
Copy link
vercel bot commented May 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
landgriffon-client ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 12, 2025 11:32am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
landgriffon-cookie-traceability ⬜️ Ignored (Inspect) Visit Preview 💬 Add feedback May 12, 2025 11:32am
landgriffon-marketing ⬜️ Ignored (Inspect) Visit Preview May 12, 2025 11:32am

…d and layer data

enforces number conversion to h3 values
@agnlez agnlez force-pushed the LANDGRIF-1685-layer-type-category-real-fix branch from 3b4c43d to 42ccea7 Compare May 12, 2025 11:29
@agnlez agnlez merged commit 42cffde into dev May 12, 2025
5 of 6 checks passed
@agnlez agnlez deleted the LANDGRIF-1685-layer-type-category-real-fix branch May 12, 2025 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0