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.
some ideas from #85 and more
Added:
CmapFeature
which basically wrapsColorFeature
and just provides a__setitem__
that parses a user providedstr
cmap to a[n_points, rgba]
array usingn_colors
based on the sliceImageCmapFeature
ImageDataFeature
which handlesImageGraphic
data as aspygfx.Texture
PointsDataFeature
which handles data forLineGraphic
andScatterGraphic
BaseGraphic
which just parses the class name in__init_subclass__
and adds a stringtype
class attribute which is used bySubplot
to add the variousadd_<graphic_name>
methods.Graphic
has aposition
property which is basically justworld_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, updateImageWidget
accordingly.ImageGraphic
usesTextureView
to setgeometry.grid
instead ofTexture
, this allows setting thefilter
argument toTexture.get_view(filter=...)
, default is "nearest"ImageGraphic
cmap setting is now functional, it uses aImageCmapFeature
instance to manage it.Subplot.add_graphic
sets thez_position
based on the number of Graphics in the subplotutils.fix_data
andutils.to_float32
, these are now in the data features classes or module