Skip to content

Interface: Registry ​

Experimental

Holds trace modules, components and named templates for a set of charts. Keeping this an explicit object (rather than module-level state) keeps core pure and lets tests and apps run isolated registries side by side.

Extends ​

Properties ​

PropertyModifierTypeDescriptionOverrides
defaultTemplatereadonlystring | undefinedName of the template used when layout.template is unset, if any.TemplateSource.defaultTemplate
localesreadonlyLocaleStoreExperimental The registered locales.-

Methods ​

components() ​

ts
components(): readonly CoreComponentModule[];

Experimental

Returns ​

readonly CoreComponentModule[]


getLayoutSchema() ​

ts
getLayoutSchema(): ObjectNode;

Experimental

Base layout schema merged with every module's and component's layout attributes.

Returns ​

ObjectNode


getModule() ​

ts
getModule(type):
  | CoreTraceModule<Children>
  | undefined;

Experimental

Parameters ​

ParameterType
typestring

Returns ​

| CoreTraceModule<Children> | undefined


getTemplate() ​

ts
getTemplate(name): Template | undefined;

Experimental

Parameters ​

ParameterType
namestring

Returns ​

Template | undefined

Overrides ​

TemplateSource.getTemplate


getTraceSchema() ​

ts
getTraceSchema(type): ObjectNode<Children> | undefined;

Experimental

Full schema for a trace type: common attributes merged with the module's schema.

Parameters ​

ParameterType
typestring

Returns ​

ObjectNode<Children> | undefined


register() ​

ts
register(...modules): Registry;

Experimental

Register trace modules. Re-registering a type replaces it. Returns the registry.

Parameters ​

ParameterType
...modulesCoreTraceModule<Children>[]

Returns ​

Registry


registerComponent() ​

ts
registerComponent(...components): Registry;

Experimental

Register layout components. Re-registering a name replaces it. Returns the registry.

Parameters ​

ParameterType
...componentsCoreComponentModule[]

Returns ​

Registry


registerLocale() ​

ts
registerLocale(...modules): Registry;

Experimental

Register locale modules (plan E17.6), plotly.js's shape ({ moduleType: 'locale', name, … }). config.locale looks them up by name.

Parameters ​

ParameterType
...modulesLocaleModule[]

Returns ​

Registry


registerTemplate() ​

ts
registerTemplate(name, template): Registry;

Experimental

Register a named template (referenced as layout.template: 'name').

Parameters ​

ParameterType
namestring
templateTemplate

Returns ​

Registry


setDefaultTemplate() ​

ts
setDefaultTemplate(name): Registry;

Experimental

Template applied when layout.template is unset (undefined to apply none).

Parameters ​

ParameterType
namestring | undefined

Returns ​

Registry


templateNames() ​

ts
templateNames(): string[];

Experimental

Returns ​

string[]


traceTypes() ​

ts
traceTypes(): string[];

Experimental

Registered trace types in registration order.

Returns ​

string[]


warnOnce() ​

ts
warnOnce(issue): void;

Experimental

Report an issue through console.warn, at most once per path and code.

Parameters ​

ParameterType
issueIssue

Returns ​

void

Released under the MIT License.