(chart: Chart, {plugins, localIds}, options, all: boolean)
| 146 | } |
| 147 | |
| 148 | function 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 | |
| 167 | function pluginOpts(config: Config, {plugin, local}, opts, context) { |
| 168 | const keys = config.pluginScopeKeys(plugin); |
no test coverage detected