GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: Fix scattermap selection across antimeridian by coyaSONG · Pull Request #7905 · plotly/plotly.js

Conversation

@coyaSONG

@coyaSONG coyaSONG commented Jul 14, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Overview

Fixes #7904.

Scattermap points are now projected into the world copy nearest the current map center before selection hit-testing. This keeps points on both sides of the antimeridian in the same visible coordinate frame while preserving the existing behavior when world copies are disabled.

The regression test reproduces the reported six-point example and verifies that both box and lasso selection:

  • select all six visible points;
  • report a continuous box longitude range; and
  • report a continuous lasso path across 180 degrees.

Root cause and user impact

MapLibre renders repeated world copies, but scattermap selection normalized every point to [-180, 180] before projecting it. Around the antimeridian, points from one side were therefore projected one full world away from the visible copy and failed the pixel-space selection test. Choosing the longitude copy nearest the map center aligns hit-testing with what the user sees.

Validation

  • npm run pretest
  • npm run test-jasmine -- select --nowatch (117/117 passing)
  • npm run test-syntax
  • npm run lint
  • git diff --check

The regression test was also run before the production change and failed with only 3 of 6 points selected for both box and lasso selection.

AI assistance

This contribution was prepared with OpenAI Codex assistance. Codex reviewed the repository guidelines, implementation, test coverage, and final diff; no human review is claimed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
coyaSONG added 2 commits July 15, 2026 08:13
@coyaSONG
Fix scattermap selection across antimeridian
4eed12e
@coyaSONG
Add draftlog for antimeridian selection fix
51409ce
@coyaSONG
coyaSONG marked this pull request as ready for review July 15, 2026 13:41
@camdecoster camdecoster self-assigned this Jul 15, 2026
@camdecoster

camdecoster commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR! I'll take a look and follow up with you.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

camdecoster added 4 commits July 22, 2026 14:38
@camdecoster
Refactor helper function
1f7adc3
@camdecoster
Update draftlog
5a383f2
@camdecoster
Linting/formatting
2f0c6ec
@camdecoster
Move map world size testing to select
99db750
@camdecoster

camdecoster commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Handling the world size in project ended up breaking hover, so I moved it into select.js.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

camdecoster
camdecoster approved these changes Jul 22, 2026
View reviewed changes
@camdecoster camdecoster changed the title Fix scattermap selection across antimeridian fix: Fix scattermap selection across antimeridian Jul 22, 2026
@camdecoster
camdecoster merged commit 0af79cc into plotly:master Jul 22, 2026
163 of 164 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@camdecoster camdecoster mentioned this pull request Sep 13, 2026
[BUG]: Select in scattermap doesn't work for non-primary world copies when bearing/pitch are set #8038
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@camdecoster camdecoster camdecoster approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@camdecoster camdecoster

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[BUG]: Select tools don't select all points within area when selection crosses the antimeridian

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@coyaSONG @camdecoster
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.