Skip to content

Commit 7819708

Browse files
author
Caitlin Lewis
committed
doc updates
1 parent 6100f4e commit 7819708

1 file changed

Lines changed: 27 additions & 5 deletions

File tree

fastplotlib/graphics/_base.py

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,27 @@ def __init__(
6060

6161
@property
6262
def world_object(self) -> WorldObject:
63+
"""Return the underlying pygfx WorldObject."""
6364
return self._world_object
6465

6566
@property
6667
def position(self) -> Vector3:
67-
"""The position of the graphic"""
68+
"""The position of the graphic."""
6869
return self.world_object.position
6970

7071
@property
7172
def visible(self) -> bool:
73+
"""Returns the visibility of the pygfx WorldObject."""
7274
return self.world_object.visible
7375

7476
@visible.setter
7577
def visible(self, v):
76-
"""Toggle the visibility of this Graphic"""
78+
"""Toggle the visibility of this Graphic."""
7779
self.world_object.visible = v
7880

7981
@property
8082
def children(self) -> WorldObject:
83+
"""Return the children of the WorldObject."""
8184
return self.world_object.children
8285

8386
def __setattr__(self, key, value):
@@ -299,6 +302,7 @@ def __init__(self, name: str = None):
299302

300303
@property
301304
def world_object(self) -> Group:
305+
"""Returns the underling pygfx WorldObject."""
302306
return self._world_object
303307

304308
@property
@@ -383,9 +387,12 @@ def __init__(
383387
384388
Parameters
385389
----------
386-
parent
387-
selection
390+
parent: GraphicCollection
391+
the GraphicCollection object that is being indexed
392+
selection: list of Graphics
393+
a list of the selected Graphics from the parent GraphicCollection based on the ``selection_indices``
388394
selection_indices: Union[list, range]
395+
the corresponding indices from the parent GraphicCollection that were selected
389396
"""
390397
self._parent = parent
391398
self._selection = selection
@@ -407,6 +414,7 @@ def __init__(
407414

408415
@property
409416
def graphics(self) -> Tuple[Graphic]:
417+
"""Returns a tuple of the selected graphics."""
410418
return tuple(self._selection)
411419

412420
def __setattr__(self, key, value):
@@ -432,8 +440,19 @@ def __init__(
432440
self,
433441
parent: GraphicCollection,
434442
selection: List[Graphic],
435-
selection_indices, feature: str
443+
selection_indices,
444+
feature: str
436445
):
446+
"""
447+
parent: GraphicCollection
448+
GraphicCollection feature instance that is being indexed
449+
selection: list of Graphics
450+
a list of the selected Graphics from the parent GraphicCollection based on the ``selection_indices``
451+
selection_indices: Union[list, range]
452+
the corresponding indices from the parent GraphicCollection that were selected
453+
feature: str
454+
feature of Graphics in the GraphicCollection being indexed
455+
"""
437456
self._selection = selection
438457
self._selection_indices = selection_indices
439458
self._feature = feature
@@ -469,14 +488,17 @@ def __setitem__(self, key, value):
469488
fi._set(value)
470489

471490
def add_event_handler(self, handler: callable):
491+
"""Adds an event handler to each of the selected Graphics from the parent GraphicCollection"""
472492
for fi in self._feature_instances:
473493
fi.add_event_handler(handler)
474494

475495
def remove_event_handler(self, handler: callable):
496+
"""Removes an event handler from each of the selected Graphics of the parent GraphicCollection"""
476497
for fi in self._feature_instances:
477498
fi.remove_event_handler(handler)
478499

479500
def block_events(self, b: bool):
501+
"""Prevents event handling from occurring."""
480502
for fi in self._feature_instances:
481503
fi.block_events(b)
482504

0 commit comments

Comments
 (0)