Fix scatter collapse after repeated box zoom#101
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
masenf
left a comment
There was a problem hiding this comment.
when zooming out, if the zoom level is already at 100%, the pan is reset as well. when this happens, it leaves the previous selection in place including the dot and tooltip.
Screen.Recording.2026-07-20.at.2.54.03.PM.mov
probably a task for another PR, but i'm wondering if we should let the outer page scroll when the chart is already zoomed out to mitigate ENG-10492 which is a bit annoying when browsing the docs. idk if it would be more jarring for a user actively zooming out to hit 100% and then suddenly scroll down the page.
Motivation
Repeated anisotropic box zoom followed by Zoom Out could collapse a scatter plot into a horizontal band.
A box zoom can narrow X and Y by very different factors. Zoom Out previously expanded both axes geometrically without respecting each axis's original range, so the less-zoomed axis could grow far beyond its home span while the other axis was still zoomed in. That extreme aspect-ratio mismatch visually flattened the point cloud.
Description
js/src/53_interaction.js)examples/demo-advance.ipynb.tests/test_zoom_precision.py)python/xy/static/index.js,python/xy/static/standalone.js)The earlier GPU-coordinate precision workaround was removed because it was not needed for this failure.
Testing
node js/build.mjs --check— generated static bundles are fresh.uv run ruff check tests/test_zoom_precision.py— passed.uv run ruff format --check tests/test_zoom_precision.py— passed.uv run pytest tests/test_zoom_precision.py tests/test_static_client_security.py tests/test_scatter.py tests/test_components.py -q— 187 passed.125×, Y1.953×7.8125×, Y1×0.122×—eight times wider than its home spanCloses #87