Add zoom-responsive styling for direct scatter points#100
Open
FarhanAliRaza wants to merge 3 commits into
Open
Add zoom-responsive styling for direct scatter points#100FarhanAliRaza wants to merge 3 commits into
FarhanAliRaza wants to merge 3 commits into
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
Alek99
reviewed
Jul 20, 2026
Alek99
left a comment
Member
There was a problem hiding this comment.
Review findings:
- [P2]
js/src/50_chartview.js:2261: y-only zoom never activates responsive styling because a finite x zoom of 1 wins the nullish-coalescing chain. Combine the applicable axis zoom factors instead. - [P2]
js/src/50_chartview.js:2432: hover emphasis uses scalarg.size, not the point's encoded size. Large size-channel points therefore get a smaller hover overlay than the rendered point. - [P2]
js/src/50_chartview.js:2311:zoom_opacityis applied to the fill but explicit point strokes retain base opacity. Apply the zoom-adjusted opacity to the outline while preservingstroke_opacity.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
Description
zoom_size_factor,zoom_opacity, andzoom_emphasisparameters to the fluentFigure.scatterAPI and the Reflex-stylecomponents.scatterfactory and serialized them into tracestylewith sensible, fixed-style-compatible defaults._pointZoomStylewas implemented injs/src/50_chartview.jsto compute a logarithmic interpolation (from the initial view) for size and opacity, clamped at the configuredzoom_emphasis.sizeFactorand adjusted opacity are applied consistently across rendering paths including the full points shader, the simple points shader, hover emphasis, and the pick/detection path so rendering, hover, and picking stay aligned.python/xy/marks.pyandpython/xy/components.py, tests were added/updated to cover serialization and validation, and static JS bundles were rebuilt and committed.Testing
PYTHONPATH=python python -m pytest tests/test_scatter.py tests/test_components.py -q, all tests passed (156 passed).node js/build.mjsandmake js-check, which succeeded and reported fresh static bundles.PYTHONPATH=python ruff check python/xy/marks.py python/xy/components.py tests/test_scatter.pyandgit diff --check, both succeeded.Codex Task
Closes #88