Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 47cecfa

Browse files
committed
update CONTRIBUTING
1 parent af6ab4f commit 47cecfa

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

CONTRIBUTING.md

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -77,35 +77,37 @@ keeps a *private* global dictionary of all `WorldObject` instances and users are
7777
This is due to garbage collection. This may be quite complicated for beginners, for more details see this PR: https://github.com/fastplotlib/fastplotlib/pull/160 .
7878
If you are curious or have more questions on garbage collection in fastplotlib you're welcome to post an issue :D.
7979

80-
#### Graphic Features
80+
#### Graphic properties
8181

82-
There is one important thing that `fastplotlib` uses which we call "graphic features".
82+
Graphic properties are all evented, and internally we called these "graphic features". They are the various
83+
aspects of a graphic that the user can change.
8384
The "graphic features" subpackage can be found at `fastplotlib/graphics/_features`. As we can see this
84-
is a private subpackage and never meant to be accessible to users. In `fastplotlib` "graphic features" are the various
85-
aspects of a graphic that the user can change. Users can also run callbacks whenever a graphic feature changes.
85+
is a private subpackage and never meant to be accessible to users..
8686

8787
##### LineGraphic
8888

8989
For example let's look at `LineGraphic` in `fastplotlib/graphics/line.py`. Every graphic has a class variable called
90-
`feature_events` which is a set of all graphic features. It has the following graphic features: "data", "colors", "cmap", "thickness", "present".
90+
`_features` which is a set of all graphic properties that are evented. It has the following evented properties:
91+
`"data", "colors", "cmap", "thickness"` in addition to properties common to all graphics, such as `"name", "offset", "rotation", and "visible"`
9192

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

96-
`ColorFeature`behaves similarly, but it can perform additional parsing that can create the colors buffer from different forms of user input. For example if a user runs:
97-
`line_graphic.colors = "blue"`, then `ColorFeature.__setitem__()` will create a buffer that corresponds to what `pygfx.Color` thinks is "blue".
98-
Users can also take advantage of fancy indexing, ex: `line_graphics.colors[bool_array] = "red"` :smile:
98+
`VertexColors`behaves similarly, but it can perform additional parsing that can create the colors buffer from different
99+
forms of user input. For example if a user runs: `line_graphic.colors = "blue"`, then `VertexColors.__setitem__()` will
100+
create a buffer that corresponds to what `pygfx.Color` thinks is "blue". Users can also take advantage of fancy indexing,
101+
ex: `line_graphics.colors[bool_array] = "red"` :smile:
99102

100-
`LineGraphic` also has a `CmapFeature`, this is a subclass of `ColorFeature` which can parse colormaps, for example:
103+
`LineGraphic` also has a `VertexCmap`, this manages the line `VertexColors` instance to parse colormaps, for example:
101104
`line_graphic.cmap = "jet"` or even `line_graphic.cmap[50:] = "viridis"`.
102105

103-
`LineGraphic` also has `ThicknessFeature` which is pretty simple, `PresentFeature` which indicates if a graphic is
104-
currently in the scene, and `DeletedFeature` which is useful if you need callbacks to indicate that the graphic has been
105-
deleted (for example, removing references to a graphic from a legend).
106+
`LineGraphic` also has a `thickness` property which is pretty simple, and `DeletedFeature` which is useful if you need
107+
callbacks to indicate that the graphic has been deleted (for example, removing references to a graphic from a legend).
106108

107-
Other graphics have graphic features that are relevant to them, for example `ImageGraphic` has a `cmap` feature which is
108-
unique to images or heatmaps.
109+
Other graphics have properties that are relevant to them, for example `ImageGraphic` has `cmap`, `vmin`, `vmax`,
110+
properties unique to images.
109111

110112
#### Selectors
111113

@@ -192,9 +194,10 @@ the subplots. All subplots within a `Figure` share the same canvas and use diffe
192194

193195
## Tests in detail
194196

195-
The CI pipeline for a plotting library that is supposed to produce things that "look visually correct". Each example
196-
within the `examples` dir is run and an image of the canvas is taken and compared with a ground-truth
197-
screenshot that we have manually inspected. Ground-truth image are stored using `git-lfs`.
197+
Backend tests are in `tests/`, in addition as a plotting library CI pipeline produces things that
198+
"look visually correct". Each example within the `examples` dir is run and an image of the canvas
199+
is taken and compared with a ground-truth screenshot that we have manually inspected.
200+
Ground-truth image are stored using `git-lfs`.
198201

199202
The ground-truth images are in:
200203

0 commit comments

Comments
 (0)