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
- 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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+7-5
Original file line number
Diff line number
Diff line change
@@ -243,22 +243,24 @@ All traces modules set:
243
243
244
244
-`_module.name`: name of the trace module as used by the trace `type` attribute.
245
245
-`_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`).
247
247
-`_module.attributes`: JSON-serializable object of attribute declarations.
248
248
This object is used to generate the plot-schema JSON.
249
249
-`_module.supplyDefaults`: Takes in input trace settings and coerces them into "full" settings
250
250
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).
253
253
-`_module.calc`: Converts inputs data into "calculated" (or sanitized) data. This one is called during
254
254
the figure-wide `Plots.doCalcdata` routine. The `calc` method is allowed to
255
255
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).
257
258
-`_module.plot`: Draws the trace on screen. This one is called by the defined `basePlotModule`.
258
259
259
260
Other methods used by some trace modules:
260
261
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)
262
264
-`_module.layoutAttributes`: JSON-serializable object of attribute declarations
263
265
coerced in the layout (e.g. `barmode` for `bar` traces)
264
266
-`_module.supplyLayoutDefaults`: Defaults logic for layout attributes.
0 commit comments