GeezerVison is showing github.com — Scatter markers and other scatter features by kushalkolar · Pull Request #913 · fastplotlib/fastplotlib
Conversation
kushalkolar
commented
Oct 11, 2025
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
After pygfx/pygfx#1208 we can have per-vertex scatter markers 🎉 . After this PR I think we cover the full space of the pygfx points API.
-
VertexMarkers buffer manager for fancy indexing of markers
-
UniformMarker graphic feature
-
PointsRotations buffer manager
-
UniformEdgeColor
-
EdgeWidth
-
UniformRotations
- sprites implementing by passing an array to
ScatterGraphic(image=...)
- gaussian and basic material
- tests
- scatter point features
-
VertexMarkers buffer manager
-
PointsRotations buffer manager
- examples
I think search sorted can be used to map user marker -> "standard" marker string, not just the ints which is already done, let's skip this until we hit performance issues for a use case.
This PR also makes a few other changes to graphic features that aren't specific to scatters:
property_name is now an instance attribute instead of a class attribute. And the value of the type field of the emitted event dict comes from the property_name instance attribute. This let's us use the VertexColors buffer manager for both per-point vertex face colors AND edge colors and keep their property_name different when used within the same graphic. Similar thing for TextureArray
@almarklein the only usecase of per-vertex rotations is for points right, I don't see how that would make sense for any other type of object (ex: lines).
The PointsMaterial that is chosen depends on the marker mode (basic, marker shapes, image (sprites), or gaussian). By default it will use PointsMarkerMaterial because distinct markers are the most common scientific use case. Once an object has been instantiated you can't switch between the materials. I think let's keep it that way unless someone has a usecase, I can't think of one @almarklein @clewis7 .
I wonder what the purpose of the basic PointsMaterial is when we have markers. @almarklein have you benchmarked performance?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
@almarklein the only usecase of per-vertex rotations is for points right, I don't see how that would make sense for any other type of object (ex: lines).
Yes it's purpose if to rotate the marker; the little image that we draw at the position of the point. So very specific to the PointsMarkerMaterial even.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Once an object has been instantiated you can't switch between the materials. I think let's keep it that way unless someone has a usecase, I can't think of one
Someday, a user will come by with a use-case 😉 But I agree that in this context its fine to select at instantiation. And ppl can always modify the graphic.world_object, right?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Once an object has been instantiated you can't switch between the materials. I think let's keep it that way unless someone has a usecase, I can't think of one
Someday, a user will come by with a use-case 😉 But I agree that in this context its fine to select at instantiation. And ppl can always modify the graphic.world_object, right?
Yea I could implement it but I don't want to do it now. For example if you go from markers to sprites, you have to clear the geometry markers buffer and anything related to markers and then create a new texture. Lots of things to keep track of.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
OK I need to change GraphicFeature.property_name from a class attribute to an instance attribute so we can VertexColors buffer manager can be used for scatter point edge colors too.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
kushalkolar
commented
Oct 12, 2025
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
basics work, but I just realized a str is also a Sequence so I need to undo a lot of what I thought was cleanup 🤦
messing around with rotations 😂
bah-2025-10-12_01.26.48.mp4
|
almarklein reacted with laugh emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 12, 2025
kushalkolar
commented
Oct 20, 2025
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
Added all scatter tests (I think) and all scatter backend tests passing 🥳 .
@clewis7 r4r, and I can make the ground truth screenshots for this PR after rebasing on main oncee #919 is reviewed and merged!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Need to update the garbage collection test nb because depending on the scatter mode some features can be None. 🤔
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
It's going to fail with the release version until pygfx/pygfx#1219 is in the release.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
clewis7
clewis7 approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|