Skip to content

fix: remove double margin offset in Pointer and HTMLTooltip#511

Merged
gka merged 1 commit intofix/tooltip-facet-positioningfrom
fix/tooltip-margin-offset
Mar 2, 2026
Merged

fix: remove double margin offset in Pointer and HTMLTooltip#511
gka merged 1 commit intofix/tooltip-facet-positioningfrom
fix/tooltip-margin-offset

Conversation

@ljodea
Copy link
Copy Markdown
Collaborator

@ljodea ljodea commented Feb 28, 2026

Summary

Stacked on #509.

  • Removed erroneous + marginLeft / + marginTop from mouse-to-SVG coordinate conversion in Pointer.svelte and HTMLTooltip.svelte
  • The quadtree already stores points in scale-range space (which includes margins via projectX/projectY), so adding margins again caused a double offset that prevented point selection when margins > 0
  • Added a regression test with margin: 20 that fails before the fix and passes after

Test plan

  • New test: selects nearest point with non-zero margins (margin=20, verifies point is found)
  • All 705 existing tests pass
  • pnpm check clean
  • pnpm lint clean

🤖 Generated with Claude Code

The quadtree already stores points in scale-range space which includes
margins, so adding marginLeft/marginTop to mouse coordinates caused a
double offset that prevented point selection with non-zero margins.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Feb 28, 2026

Deploy Preview for svelteplot ready!

Name Link
🔨 Latest commit 13d1e0a
🔍 Latest deploy log https://app.netlify.com/projects/svelteplot/deploys/69a2c9d56cb0a20008b13bce
😎 Deploy Preview https://deploy-preview-511--svelteplot.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.

@gka gka merged commit b1fd057 into fix/tooltip-facet-positioning Mar 2, 2026
4 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.

2 participants