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

🔨 rename map projection to region #4707

Merged
merged 3 commits into from
Mar 31, 2025
Merged

Conversation

sophiamersmann
Copy link
Member

@sophiamersmann sophiamersmann commented Mar 27, 2025

Renames map.projection to map.region in configs and elsewhere.


This is part 2 of 3 in a stack made with GitButler:

@github-actions github-actions bot added the staging-viz Let SVG tester fail silently in CI label Mar 27, 2025
@sophiamersmann sophiamersmann mentioned this pull request Mar 27, 2025
@sophiamersmann sophiamersmann force-pushed the rename-map-projection branch 3 times, most recently from 2f2756d to bec94e2 Compare March 28, 2025 08:24
@sophiamersmann sophiamersmann force-pushed the refactor-chloropleth-map branch from d793cc4 to d3bcd1f Compare March 28, 2025 08:48
@sophiamersmann sophiamersmann force-pushed the rename-map-projection branch 2 times, most recently from 5477a56 to 93014a8 Compare March 28, 2025 08:50
@sophiamersmann sophiamersmann requested a review from Copilot March 28, 2025 08:52
@sophiamersmann sophiamersmann marked this pull request as ready for review March 28, 2025 08:52
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR renames properties, variables, and functions related to map projection to instead use the terminology "region" throughout the codebase.

  • Renames mapConfig property from "projection" to "region"
  • Updates tests, migration scripts, and UI components to use "region"
  • Removes the MapProjectionMenu in favor of the new MapRegionDropdown

Reviewed Changes

Copilot reviewed 29 out of 32 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/@ourworldindata/grapher/src/mapCharts/MapConfig.test.ts Updated tests to use "region" instead of "projection"
packages/@ourworldindata/grapher/src/mapCharts/MapChartConstants.ts Renamed interface property and adjusted constants
packages/@ourworldindata/grapher/src/mapCharts/MapChart.tsx Updated methods and computed getters to use "region"
packages/@ourworldindata/grapher/src/mapCharts/GeoFeatures.ts Renamed cache and helper functions from Projection to Region
packages/@ourworldindata/grapher/src/mapCharts/ChoroplethMap.tsx Updated references to use region-based helpers and UI IDs
packages/@ourworldindata/grapher/src/index.ts Updated exports to reflect the new region nomenclature
packages/@ourworldindata/grapher/src/core/GrapherUrl.ts Adjusted mapping of query parameters from projection to region
packages/@ourworldindata/grapher/src/core/GrapherConstants.ts Updated configuration flags and removed projection menu flag
packages/@ourworldindata/grapher/src/core/Grapher.tsx Updated map config assignments and observables to "region"
packages/@ourworldindata/grapher/src/controls/controlsRow/ControlsRow.tsx Replaced projection menu with region dropdown
packages/@ourworldindata/grapher/src/controls/MapRegionDropdown.tsx New dropdown component for selecting map regions
db/migration/1743006325845-RenameMapProjectionToRegion.ts Migration script updating JSON keys in DB from projection to region
adminSiteClient/GrapherConfigGridEditor.tsx Updated field mappings and schema URL
adminSiteClient/EditorMapTab.tsx Updated editor functions and SelectField options to use region
adminShared/SqlFilterSExpression.test.ts Updated filter expressions to reflect the new region nomenclature
.github/workflows/check-default-grapher-config.yml Added step to enable corepack in the workflow
Files not reviewed (3)
  • devTools/schemaProcessor/columns.json: Language not supported
  • packages/@ourworldindata/grapher/src/controls/MapRegionDropdown.scss: Language not supported
  • packages/@ourworldindata/grapher/src/core/grapher.scss: Language not supported
Comments suppressed due to low confidence (3)

packages/@ourworldindata/grapher/src/mapCharts/GeoFeatures.ts:19

  • [nitpick] Consider renaming 'geoPathsForProjectionOf' to 'geoPathsForRegion' to better reflect the new nomenclature consistently.
const geoPathsForProjectionOf = (regionName: MapRegionName): string[] => {

packages/@ourworldindata/grapher/src/mapCharts/GeoFeatures.ts:39

  • [nitpick] Consider renaming 'geoBoundsForProjectionOf' to 'geoBoundsForRegion' to align with the updated terminology.
export const geoBoundsForProjectionOf = (

packages/@ourworldindata/grapher/src/mapCharts/GeoFeatures.ts:67

  • [nitpick] Consider renaming 'renderFeaturesForProjectionOf' to 'renderFeaturesForRegion' for clearer and more consistent naming.
export const renderFeaturesForProjectionOf = (

Copy link
Member

@marcelgerber marcelgerber left a comment

Choose a reason for hiding this comment

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

Wow, this really was a lot more work in a lot more places than I initially thought it would be. Thank you!

update shell
🔨 rename MapProjectionMenu
rename projection to region
@sophiamersmann sophiamersmann force-pushed the refactor-chloropleth-map branch from d3bcd1f to 7eb091c Compare March 28, 2025 16:56
@sophiamersmann sophiamersmann force-pushed the rename-map-projection branch from defb88f to 8b971ee Compare March 28, 2025 16:56
Base automatically changed from refactor-chloropleth-map to master March 31, 2025 09:07
@sophiamersmann sophiamersmann merged commit edb1744 into master Mar 31, 2025
24 of 27 checks passed
@sophiamersmann sophiamersmann deleted the rename-map-projection branch March 31, 2025 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
staging-viz Let SVG tester fail silently in CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants