Skip to content

Interface: ChartRegistry ​

Properties ​

PropertyModifierTypeDescription
corereadonlyRegistryThe core registry: schemas, templates, defaults and edit-type planning.

Methods ​

components() ​

ts
components(): readonly ComponentModule[];

Components in draw order (order, then registration order).

Returns ​

readonly ComponentModule[]


getComponent() ​

ts
getComponent(name): ComponentModule | undefined;

Parameters ​

ParameterType
namestring

Returns ​

ComponentModule | undefined


getTrace() ​

ts
getTrace(type):
  | TraceModule<unknown, Children>
  | undefined;

Parameters ​

ParameterType
typestring

Returns ​

| TraceModule<unknown, Children> | undefined


list() ​

ts
list(): RegistryListing;

Introspection: everything registered.

Returns ​

RegistryListing


register() ​

ts
register(...modules): ChartRegistry;

Register trace modules, components, templates and locales, in any mix. Registering the same object again is a no-op; registering a different module under a taken name replaces it and warns. Locales ({ moduleType: 'locale', name, dictionary, format }, plotly.js's shape) merge silently as in Plotly: a module without a dictionary or format keeps the earlier one.

Parameters ​

ParameterType
...modulesreadonly Registrable[]

Returns ​

ChartRegistry


setDefaultTemplate() ​

ts
setDefaultTemplate(name): ChartRegistry;

Set the template applied when layout.template is unset, by registered name, or undefined for none (Plotly's schema defaults). Applies from the next render of each chart (any update, react or new chart). Warns when the name is not registered.

Parameters ​

ParameterType
namestring | undefined

Returns ​

ChartRegistry

Example ​

ts
registry.setDefaultTemplate('plotly-classic'); // Plotly's look for figures without a template

Released under the MIT License.