Skip to content

refactor: migrate resample module#1351

Merged
Azgaar merged 5 commits intoAzgaar:masterfrom
SheepFromHeaven:refactor/migrate-resample-module
Mar 18, 2026
Merged

refactor: migrate resample module#1351
Azgaar merged 5 commits intoAzgaar:masterfrom
SheepFromHeaven:refactor/migrate-resample-module

Conversation

@SheepFromHeaven
Copy link
Copy Markdown
Collaborator

Description

@SheepFromHeaven SheepFromHeaven self-assigned this Mar 10, 2026
Copilot AI review requested due to automatic review settings March 10, 2026 10:40
Copy link
Copy Markdown
Contributor

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

Migrates the legacy resample logic from public/modules/resample.js into the TypeScript module system and replaces the old lineclip browser-global dependency with an npm package import, improving type safety across related utilities.

Changes:

  • Add src/modules/resample.ts and wire it into module initialization; remove the legacy public/modules/resample.js script.
  • Replace window.polygonclip / lineclip.min.js usage with lineclip npm imports and update clipping call sites.
  • Tighten types for PackedGraph, river point data, and isLand/isWater helpers.

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/utils/graphUtils.ts Type isLand/isWater against PackedGraph for safer call sites.
src/utils/commonUtils.ts Switch polygon clipping implementation to npm lineclip import.
src/types/global.ts Add missing global declarations needed by the new TS resample module.
src/types/PackedGraph.ts Extend and adjust PackedGraph typing (typed arrays + quadtree field).
src/renderers/draw-markers.ts Rename internal pin helper while keeping window.getPin API stable.
src/modules/river-generator.ts Add optional River.points typing and adjust length calculation typing.
src/modules/resample.ts New TypeScript resample implementation (ported from legacy JS).
src/modules/ocean-layers.ts Update clipPoly call signature after clipping refactor.
src/modules/index.ts Ensure resample module is loaded/registered.
src/index.html Remove legacy resample.js and lineclip.min.js script tags.
public/modules/resample.js Removed legacy resample implementation.
public/libs/lineclip.min.js Removed legacy vendored lineclip library.
package.json Add lineclip (and its types) to npm dependencies.
package-lock.json Lockfile updates for new dependencies.

Comment thread src/modules/resample.ts
Comment thread src/modules/resample.ts
Comment thread src/modules/resample.ts
Comment thread src/modules/resample.ts
Comment thread src/utils/commonUtils.ts
Comment thread src/types/PackedGraph.ts
Comment thread package.json
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 14, 2026

Deploy Preview for afmg ready!

Name Link
🔨 Latest commit 87128fa
🔍 Latest deploy log https://app.netlify.com/projects/afmg/deploys/69b5b2e61bb171000845211d
😎 Deploy Preview https://deploy-preview-1351--afmg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@SheepFromHeaven SheepFromHeaven requested a review from Azgaar March 16, 2026 06:06
@SheepFromHeaven
Copy link
Copy Markdown
Collaborator Author

@Azgaar this is ready

@Azgaar Azgaar merged commit f2fc427 into Azgaar:master Mar 18, 2026
7 checks passed
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.

3 participants