You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/developer_notes/graphics.rst
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,15 +56,14 @@ For example let's look at ``LineGraphic`` in ``fastplotlib/graphics/line.py``. E
56
56
``"data", "colors", "cmap", "thickness"`` in addition to properties common to all graphics, such as ``"name", "offset", "rotation", and "visible"``
57
57
58
58
Now look at the constructor for the ``LineGraphic`` base class ``PositionsGraphic``, it first creates an instance of ``VertexPositions``.
59
-
This is a class that manages vertex positions buffer. For the user, it defines the line data, and provides additional useful functionality.
60
-
It defines the line, and provides additional useful functionality.
59
+
This is a class that manages vertex positions buffer. For the user, it defines the line vertex positions, and provides additional useful functionality.
61
60
For example, every time that the ``data`` is changed, the new data will be marked for upload to the GPU before the next draw.
62
61
In addition, event handlers will be called if any event handlers are registered.
63
62
64
-
``VertexColors`` behaves similarly, but it can perform additional parsing that can create the colors buffer from different
63
+
``VertexColors`` behaves similarly, but it can perform additional parsing that can create or set the colors buffer from different
65
64
forms of user input. For example if a user runs: ``line_graphic.colors = "blue"``, then ``VertexColors.__setitem__()`` will
66
-
create a buffer that corresponds to what ``pygfx.Color`` thinks is "blue". Users can also take advantage of fancy indexing,
set the buffer that corresponds to what ``pygfx.Color`` thinks is "blue", i.e the RGBA array `[0, 0, 1, 1]. Users can also take advantage of fancy indexing,
66
+
ex: ``line_graphics.colors[bool_array] = "red"`` 😊 to set the color of specific vertices.
68
67
69
68
``LineGraphic`` also has a ``VertexCmap``, this manages the line ``VertexColors`` instance to parse colormaps, for example:
70
69
``line_graphic.cmap = "jet"`` or even ``line_graphic.cmap[50:] = "viridis"``.
0 commit comments