Skip to content

Commit b2c9dd4

Browse files
committed
Update language regarding supplyDefaults
1 parent 20adf25 commit b2c9dd4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

CONTRIBUTING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,10 @@ All traces modules set:
405405
This object is used to generate the plot-schema JSON.
406406
- `_module.supplyDefaults`: Takes in input trace settings and coerces them into "full" settings
407407
under `gd._fullData`. This one is called during the figure-wide `Plots.supplyDefaults` routine.
408-
Note that the `supplyDefaults` method performance should scale with the number of attributes (**not** the
409-
number of data points - so it should not loop over any data arrays).
408+
As a rule, `supplyDefaults` performance should scale with the number of attributes rather than
409+
the number of data points, so avoid looping over data arrays in this function. That being said,
410+
there are a few exceptions to this rule due to technical requirements (`fitbounds` on map subplots).
411+
The same guidance applies to `_module.supplyLayoutDefaults`.
410412
- `_module.calc`: Converts inputs data into "calculated" (or sanitized) data. This one is called during
411413
the figure-wide `Plots.doCalcdata` routine. The `calc` method is allowed to
412414
scale with the number of data points and is in general more costly than `supplyDefaults`.

0 commit comments

Comments
 (0)