@@ -60,22 +60,23 @@ def __init__(
6060
6161 @property
6262 def world_object (self ) -> WorldObject :
63- """Return the underlying pygfx WorldObject."""
63+ """Associated pygfx WorldObject."""
6464 return self ._world_object
6565
6666 @property
6767 def position (self ) -> Vector3 :
68- """The position of the graphic."""
68+ """The position of the graphic. You can access or change
69+ using position.x, position.y, etc."""
6970 return self .world_object .position
7071
7172 @property
7273 def visible (self ) -> bool :
73- """Returns the visibility of the pygfx WorldObject ."""
74+ """Access or change the visibility ."""
7475 return self .world_object .visible
7576
7677 @visible .setter
77- def visible (self , v ):
78- """Toggle the visibility of this Graphic ."""
78+ def visible (self , v ) -> bool :
79+ """Access or change the visibility ."""
7980 self .world_object .visible = v
8081
8182 @property
@@ -156,36 +157,6 @@ def link(
156157 -------
157158 None
158159
159- Examples
160- --------
161- .. code-block:: python
162-
163- from fastplotlib import Plot
164- import numpy as np
165- # generate data for cosine and sine wave
166- xs = np.linspace(-10, 10, 100)
167- # sine wave
168- ys = np.sin(xs)
169- sine = np.dstack([xs, ys])[0]
170- # cosine wave
171- ys = np.cos(xs) + 5
172- cosine = np.dstack([xs, ys])[0]
173- # instantiate a plot
174- plot = Plot()
175- # create graphics and add them to the plot
176- sine_graphic = plot.add_line(data=sine, thickness=5, colors="magenta")
177- cosine_graphic = plot.add_line(data=cosine, thickness=12, cmap="autumn")
178- # show plot
179- plot.show()
180- # link color change of sine graphic to cosine graphic
181- sine_graphic.link(event_type="colors",
182- target=cosine_graphic,
183- feature="colors",
184- new_data="w",
185- bidirectional=False)
186- # changing colors of sine graphic at indexes 1-3 to red
187- # changes cosine graphic to white
188- sine_graphic.colors[1:3] = "r"
189160 """
190161 if event_type in PYGFX_EVENTS :
191162 self .world_object .add_event_handler (self .event_handler , event_type )
@@ -498,7 +469,7 @@ def remove_event_handler(self, handler: callable):
498469 fi .remove_event_handler (handler )
499470
500471 def block_events (self , b : bool ):
501- """Prevents event handling from occurring."""
472+ """Blocks event handling from occurring."""
502473 for fi in self ._feature_instances :
503474 fi .block_events (b )
504475
0 commit comments