Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,6 @@
"numpy": ("https://numpy.org/doc/stable", None),
"pygfx": ("https://docs.pygfx.org/stable", None),
"wgpu": ("https://wgpu-py.readthedocs.io/en/latest", None),
"rendercanvas": ("https://rendercanvas.readthedocs.io/stable/", None),
# "fastplotlib": ("https://www.fastplotlib.org/", None),
}
11 changes: 5 additions & 6 deletions docs/source/developer_notes/graphics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,14 @@ For example let's look at ``LineGraphic`` in ``fastplotlib/graphics/line.py``. E
``"data", "colors", "cmap", "thickness"`` in addition to properties common to all graphics, such as ``"name", "offset", "rotation", and "visible"``

Now look at the constructor for the ``LineGraphic`` base class ``PositionsGraphic``, it first creates an instance of ``VertexPositions``.
This is a class that manages vertex positions buffer. For the user, it defines the line data, and provides additional useful functionality.
It defines the line, and provides additional useful functionality.
This is a class that manages vertex positions buffer. For the user, it defines the line vertex positions, and provides additional useful functionality.
For example, every time that the ``data`` is changed, the new data will be marked for upload to the GPU before the next draw.
In addition, event handlers will be called if any event handlers are registered.

``VertexColors`` behaves similarly, but it can perform additional parsing that can create the colors buffer from different
``VertexColors`` behaves similarly, but it can perform additional parsing that can create or set the colors buffer from different
forms of user input. For example if a user runs: ``line_graphic.colors = "blue"``, then ``VertexColors.__setitem__()`` will
create a buffer that corresponds to what ``pygfx.Color`` thinks is "blue". Users can also take advantage of fancy indexing,
ex: ``line_graphics.colors[bool_array] = "red"`` 😊
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,
ex: ``line_graphics.colors[bool_array] = "red"`` 😊 to set the color of specific vertices.

``LineGraphic`` also has a ``VertexCmap``, this manages the line ``VertexColors`` instance to parse colormaps, for example:
``line_graphic.cmap = "jet"`` or even ``line_graphic.cmap[50:] = "viridis"``.
Expand All @@ -73,4 +72,4 @@ ex: ``line_graphics.colors[bool_array] = "red"`` 😊
callbacks to indicate that the graphic has been deleted (for example, removing references to a graphic from a legend).

Other graphics have properties that are relevant to them, for example ``ImageGraphic`` has ``cmap``, ``vmin``, ``vmax``,
properties unique to images.
properties unique to images.
Loading