Skip to content

Commit 8daa1f1

Browse files
committed
aj-proof improvements
- fix a couple typos - make `supplyDefaults` not looping over data arrays more clear - mention `editType` in comment about `Plots.doCalcdata` getting skipped - mention `Registry.traceIs` in item about module categories
1 parent 7487dc3 commit 8daa1f1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

CONTRIBUTING.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -243,22 +243,24 @@ All traces modules set:
243243

244244
- `_module.name`: name of the trace module as used by the trace `type` attribute.
245245
- `_module.basePlotModule`: base plot (or subplot) module corresponding to the
246-
trace type (e.g. `scatter` links up the `Cartesian` base plot module, `scatter3d` links up `gl3d`).
246+
trace type (e.g. `scatter` links to the `Cartesian` base plot module, `scatter3d` links to `gl3d`).
247247
- `_module.attributes`: JSON-serializable object of attribute declarations.
248248
This object is used to generate the plot-schema JSON.
249249
- `_module.supplyDefaults`: Takes in input trace settings and coerces them into "full" settings
250250
under `gd._fullData`. This one is called during the figure-wide `Plots.supplyDefaults` routine.
251-
Note that the `suppyDefaults` method performance should scale with the number of attributes (**not** the
252-
number of data points).
251+
Note that the `supplyDefaults` method performance should scale with the number of attributes (**not** the
252+
number of data points - so it should not loop over any data arrays).
253253
- `_module.calc`: Converts inputs data into "calculated" (or sanitized) data. This one is called during
254254
the figure-wide `Plots.doCalcdata` routine. The `calc` method is allowed to
255255
scale with the number of data points and is in general more costly than `supplyDefaults`.
256-
Please note that some edit pathways skip `Plots.doCalcdata`.
256+
Please note that some edit pathways skip `Plots.doCalcdata` (as determined by the
257+
`editType` flags in the attributes files).
257258
- `_module.plot`: Draws the trace on screen. This one is called by the defined `basePlotModule`.
258259

259260
Other methods used by some trace modules:
260261

261-
- `_module.categories`: list of string identifiers used to group traces by behavior
262+
- `_module.categories`: list of string identifiers used to group traces by behavior. Traces that
263+
have a given category can then be detected using [`Registry.traceIs`](https://github.com/plotly/plotly.js/blob/8f049fddbac0ca0382816984b8526857e9714fe6/src/registry.js#L129-L155)
262264
- `_module.layoutAttributes`: JSON-serializable object of attribute declarations
263265
coerced in the layout (e.g. `barmode` for `bar` traces)
264266
- `_module.supplyLayoutDefaults`: Defaults logic for layout attributes.

0 commit comments

Comments
 (0)