MCPcopy Create free account
hub / github.com/chartjs/Chart.js / createDescriptors

Function createDescriptors

src/core/core.plugins.ts:148–165  ·  view source on GitHub ↗
(chart: Chart, {plugins, localIds}, options, all: boolean)

Source from the content-addressed store, hash-verified

146}
147
148function createDescriptors(chart: Chart, {plugins, localIds}, options, all: boolean) {
149 const result: {plugin: any; options: any}[] = [];
150 const context = chart.getContext();
151
152 for (const plugin of plugins) {
153 const id = plugin.id;
154 const opts = getOpts(options[id], all);
155 if (opts === null) {
156 continue;
157 }
158 result.push({
159 plugin,
160 options: pluginOpts(chart.config, {plugin, local: localIds[id]}, opts, context)
161 });
162 }
163
164 return result;
165}
166
167function pluginOpts(config: Config, {plugin, local}, opts, context) {
168 const keys = config.pluginScopeKeys(plugin);

Callers 1

_createDescriptorsMethod · 0.85

Calls 3

getOptsFunction · 0.85
pluginOptsFunction · 0.85
getContextMethod · 0.45

Tested by

no test coverage detected