← 返回首页
graphics refactor, again by kushalkolar · Pull Request #88 · fastplotlib/fastplotlib · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

graphics refactor, again #88

Merged
kushalkolar merged 1 commit into
masterfrom
graphic-refactor
Dec 25, 2022
Merged

graphics refactor, again #88
kushalkolar merged 1 commit into
masterfrom
graphic-refactor

Conversation

kushalkolar commented Dec 25, 2022
edited
Loading

Copy link
Copy Markdown
Member

some ideas from #85 and more

Added:

  • added CmapFeature which basically wraps ColorFeature and just provides a __setitem__ that parses a user provided str cmap to a [n_points, rgba] array using n_colors based on the slice
  • added ImageCmapFeature
  • ImageDataFeature which handles ImageGraphic data as as pygfx.Texture
  • PointsDataFeature which handles data for LineGraphic and ScatterGraphic
  • BaseGraphic which just parses the class name in __init_subclass__ and adds a string type class attribute which is used by Subplot to add the various add_<graphic_name> methods.
  • Graphic has a position property which is basically just world_object.position

Modified:

  • Graphic doesn't instantiate any of the graphic features now, it just handles name and a few other thing and some methods. The individual graphics now handle their features like data, colors, cmap, etc.
  • ImageGraphic uses vmin, vmax now instead of clim, update ImageWidget accordingly.
  • ImageGraphic uses TextureView to set geometry.grid instead of Texture, this allows setting the filter argument to Texture.get_view(filter=...), default is "nearest"
  • ImageGraphic cmap setting is now functional, it uses a ImageCmapFeature instance to manage it.
  • Subplot.add_graphic sets the z_position based on the number of Graphics in the subplot
  • removed utils.fix_data and utils.to_float32, these are now in the data features classes or module

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Footer

© 2026 GitHub, Inc.