From ded3acd8921db14806ab221b6af67b9b5b1f93db Mon Sep 17 00:00:00 2001 From: MzyzzG <124270525+MzyzzG@users.noreply.github.com> Date: Tue, 28 Apr 2026 09:25:11 +0100 Subject: [PATCH] docs: Add JSDoc documentation for register() function --- src/registry.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/registry.js b/src/registry.js index 499abf2457b..75a54028184 100644 --- a/src/registry.js +++ b/src/registry.js @@ -64,6 +64,31 @@ exports.collectableSubplotTypes = null; * - fn {function} : the api method called with Register.call(); * */ + +/** + * Register modules (traces, transforms, components, locales, or API methods) with Plotly.js + * + * This is the main registration function exposed as Plotly.register(). + * It allows adding new trace types, components, locales, transforms, or API methods + * to an existing Plotly instance. + * + * @param {Object|Array} _modules - A single module object or an array of module objects + * + * @example + * // Register a single trace module + * Plotly.register({ + * moduleType: 'trace', + * name: 'custom', + * categories: ['2dMap', 'geo'], + * meta: { description: 'Custom trace type' } + * }); + * + * @example + * // Register multiple modules at once + * Plotly.register([traceModule, localeModule, transformModule]); + * + * @throws {Error} If no argument is passed or if an invalid module type is provided + */ exports.register = function register(_modules) { exports.collectableSubplotTypes = null;