GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Scatter markers and other scatter features by kushalkolar · Pull Request #913 · fastplotlib/fastplotlib

Conversation

@kushalkolar

@kushalkolar kushalkolar commented Oct 11, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

All reactions
kushalkolar added 4 commits October 9, 2025 00:50
@kushalkolar
cleanup
930f517
@kushalkolar
start per-vertex markers
3ff7491
@kushalkolar
vectorized marker code
e455caf
@kushalkolar
more scatter stuff
4bf2e97
@kushalkolar
kushalkolar requested a review from clewis7 as a code owner October 11, 2025 00:15
@kushalkolar
kushalkolar marked this pull request as draft October 11, 2025 00:15
@kushalkolar kushalkolar mentioned this pull request Oct 11, 2025
Fastest mapping arrays of strings to int for markers pygfx/pygfx#1215
Closed
@kushalkolar
progress
48a0cea
@almarklein

almarklein commented Oct 11, 2025

Copy link
Copy Markdown
Collaborator

@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@almarklein

almarklein commented Oct 11, 2025

Copy link
Copy Markdown
Collaborator

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar

kushalkolar commented Oct 11, 2025

Copy link
Copy Markdown
Member Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar

kushalkolar commented Oct 12, 2025

Copy link
Copy Markdown
Member Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kushalkolar added 8 commits October 11, 2025 22:06
@kushalkolar
progress
1440716
@kushalkolar
GraphicFeatures.property_name is now an instance attribute instead of…
5401bd6
… a class attribute
@kushalkolar
all point features implemented, not a single thing tested yet
7464ca3
@kushalkolar
docstring
b0c7732
@kushalkolar
some reorganization of scatter and line related features
866ab0d
@kushalkolar
docstring
0e5d8c3
@kushalkolar
fix
d1120c9
@kushalkolar
update fastplotlib/layouts/_graphic_methods_mixin.py
4a63ebb
@kushalkolar

kushalkolar commented Oct 12, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

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 🤦

image

messing around with rotations 😂

bah-2025-10-12_01.26.48.mp4
almarklein reacted with laugh emoji
All reactions
  • 😄 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar
basics work
c385dcb
This was referenced Oct 12, 2025
Optical flow #908
Closed
VectorsGraphic #560
Closed
kushalkolar added 6 commits October 18, 2025 23:49
@kushalkolar
modify iris example to use markers
f37f834
@kushalkolar
scatter tests, black
8456cbb
@kushalkolar
add asterisk to test
2a0c303
@kushalkolar
sprites example
481a46d
@kushalkolar
update examples
344a5d4
@kushalkolar
add scatter validation example
480eaf1
kushalkolar added 7 commits October 19, 2025 22:54
@kushalkolar
more fixes and tests
03fe8b5
@kushalkolar
markers buffer manager tests
ed0ccd4
@kushalkolar
docstring
d57c3a6
@kushalkolar
rotation fixes and tests
304ec31
@kushalkolar
add a useful assert to positions data buffer manager test
cbd0f44
@kushalkolar
point_rotations tests
359ba9a
@kushalkolar
need float32 else all tests fail lulz
c06ae9f
@kushalkolar

kushalkolar commented Oct 20, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

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!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar
merge main
d89c649
@kushalkolar
kushalkolar marked this pull request as ready for review October 20, 2025 22:51
@kushalkolar
black
3a519c9
@kushalkolar

kushalkolar commented Oct 20, 2025

Copy link
Copy Markdown
Member Author

Need to update the garbage collection test nb because depending on the scatter mode some features can be None. 🤔

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kushalkolar added 4 commits October 20, 2025 22:55
@kushalkolar
skip graphic features that are None
3070b39
@kushalkolar
fix
2ac0af5
@kushalkolar
fix
b31a763
@kushalkolar
update scatter screenshot
a0e74fb
@kushalkolar

kushalkolar commented Oct 21, 2025

Copy link
Copy Markdown
Member Author

It's going to fail with the release version until pygfx/pygfx#1219 is in the release.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar kushalkolar mentioned this pull request Oct 21, 2025
VectorsGraphic #929
Merged
5 tasks done
kushalkolar added 5 commits October 21, 2025 05:41
@kushalkolar
update scatter API docs
4d2a059
@kushalkolar
update event tables
9cbce27
@kushalkolar
increase tolerance because of mac
bdb60f5
@kushalkolar
I guess let's keep the higher 0.2 threshold
39ae8e0
@kushalkolar
remove renamed feature docs
7f957d2
clewis7
clewis7 previously approved these changes Oct 22, 2025
View reviewed changes

@clewis7 clewis7 left a comment

Copy link
Copy Markdown
Member

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.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread examples/scatter/scatter_image_as_points.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar
finish sentence
55bb341
@kushalkolar
kushalkolar dismissed clewis7’s stale review via 55bb341 October 22, 2025 22:34
clewis7
clewis7 approved these changes Oct 23, 2025
View reviewed changes
@clewis7
clewis7 merged commit 1284981 into main Oct 23, 2025
@clewis7
clewis7 deleted the per-vertex-markers branch October 23, 2025 00:28
@kushalkolar kushalkolar mentioned this pull request Oct 23, 2025
Fix docstring #930
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@clewis7 clewis7 clewis7 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

3 participants

@kushalkolar @almarklein @clewis7
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.