feat(layers): add getPixelOffset prop to ScatterplotLayer#10178
Open
officialasishkumar wants to merge 2 commits intovisgl:masterfrom
Open
feat(layers): add getPixelOffset prop to ScatterplotLayer#10178officialasishkumar wants to merge 2 commits intovisgl:masterfrom
officialasishkumar wants to merge 2 commits intovisgl:masterfrom
Conversation
|
@officialasishkumar Can you share your use case for this feature? |
5b231ed to
352bddf
Compare
Contributor
Author
|
@missx-oai The use case is screen-space nudging for circles that share the same geographic anchor without altering the underlying coordinates. That is useful for decluttering overlapping scatterplot markers and for aligning a circle with nearby text or icon layers that already support pixel offsets. |
Pessimistress
approved these changes
Apr 7, 2026
Contributor
Author
|
Will resolve the merge conflicts |
Collaborator
|
Please update the documentation for ScatterplotLayer. |
Add a getPixelOffset accessor to ScatterplotLayer that allows shifting the rendered circle by a fixed number of screen pixels, independently of zoom level. This is useful for preventing overlap between circles and other layers (e.g. icons, text) without modifying the underlying data positions. The implementation follows the same pattern used by IconLayer and TextLayer: - New instance attribute `instancePixelOffset` (vec2, transition-enabled) - In billboard mode, the pixel offset is added to the screen-space offset before clip-space projection - In non-billboard mode, the pixel offset is converted to common space via project_pixel_size and added to the common-space offset - Both GLSL and WGSL shader variants are updated - Default value is [0, 0] for backward compatibility Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Add documentation for the new getPixelOffset accessor prop, following the same format used by IconLayer and TextLayer documentation. Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
352bddf to
b1f4e01
Compare
Contributor
Author
|
Updated the ScatterplotLayer documentation with the |
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.
Closes #10057
Change List
getPixelOffsetaccessor prop toScatterplotLayerthat shifts the rendered circle by a fixed number of screen pixels, independently of zoom levelinstancePixelOffset(vec2, transition-enabled) with a default value of[0, 0]for full backward compatibilityproject_pixel_sizeand added to the common-space offsetIconLayerandTextLayerUsage