Skip to content

Commit ded3acd

Browse files
authored
docs: Add JSDoc documentation for register() function
1 parent a405dde commit ded3acd

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

src/registry.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,31 @@ exports.collectableSubplotTypes = null;
6464
* - fn {function} : the api method called with Register.call();
6565
*
6666
*/
67+
68+
/**
69+
* Register modules (traces, transforms, components, locales, or API methods) with Plotly.js
70+
*
71+
* This is the main registration function exposed as Plotly.register().
72+
* It allows adding new trace types, components, locales, transforms, or API methods
73+
* to an existing Plotly instance.
74+
*
75+
* @param {Object|Array<Object>} _modules - A single module object or an array of module objects
76+
*
77+
* @example
78+
* // Register a single trace module
79+
* Plotly.register({
80+
* moduleType: 'trace',
81+
* name: 'custom',
82+
* categories: ['2dMap', 'geo'],
83+
* meta: { description: 'Custom trace type' }
84+
* });
85+
*
86+
* @example
87+
* // Register multiple modules at once
88+
* Plotly.register([traceModule, localeModule, transformModule]);
89+
*
90+
* @throws {Error} If no argument is passed or if an invalid module type is provided
91+
*/
6792
exports.register = function register(_modules) {
6893
exports.collectableSubplotTypes = null;
6994

0 commit comments

Comments
 (0)