-
Notifications
You must be signed in to change notification settings - Fork 50
add size_space
to pygfx.PointsMaterial
scatter kwargs
#689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add size_space
to pygfx.PointsMaterial
scatter kwargs
#689
Conversation
I'm not immediately seeing the need for a |
All aspects of a graphic are managed by a Lines also have a |
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.
A good start!
This doesn't need to be specific to scatters, pygfx line material also uses a thickness_space
property that takes the same args and does an analogous thing so this can be in the PositionsGraphic
base class.
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.
Will also need a simple test when you're done, see this for an outline:
fastplotlib/tests/test_positions_graphics.py
Lines 419 to 445 in f204f55
@pytest.mark.parametrize("thickness", [None, 0.5, 5.0]) | |
def test_thickness(thickness): | |
fig = fpl.Figure() | |
kwargs = dict() | |
for kwarg in ["thickness"]: | |
if locals()[kwarg] is not None: | |
# add to dict of arguments that will be passed | |
kwargs[kwarg] = locals()[kwarg] | |
data = generate_positions_spiral_data("xy") | |
graphic = fig[0, 0].add_line(data=data, **kwargs) | |
if thickness is None: | |
thickness = 2.0 # default thickness | |
assert isinstance(graphic._thickness, Thickness) | |
assert graphic.thickness == thickness | |
assert graphic.world_object.material.thickness == thickness | |
if thickness == 0.5: | |
assert isinstance(graphic.world_object.material, pygfx.LineThinMaterial) | |
else: | |
assert isinstance(graphic.world_object.material, pygfx.LineMaterial) |
Eye test looks like everything checks out. will work on a test case next |
Since you've added/changed the API you will need to regenerate the API docs: in delete the with the env activated, run:
add and commit |
black is still unhappy, just do only black format the |
@kushalkolar I don't even have a guess for why the docs failed
|
I think it's trying to access the credentials which are repo secrets and it won't since you're on a fork, we'll figure out later how to make docs upload from forks. Anyways the docs built without issues so that's fine and everything else LGTM. |
The
size_space
property of PointsMaterial controls which coordinate space to use for the sizing of each point. Default isscreen
, which using logical pixel values mapped to the screen. Zooming into a plot causes the thickness of circles to remain the same thickness. see hereThis aims to allow the other options of CoordSpace Enum to be used instead (world, model, screen).