@@ -5,14 +5,10 @@ import {clone} from '../helpers/helpers.core';
55
66/**
77 * @typedef { import("./core.controller").default } Chart
8- */
9-
10- /**
118 * @typedef { import("../platform/platform.base").IEvent } IEvent
12- */
13-
14- /**
159 * @typedef { import("../plugins/plugin.tooltip").default } Tooltip
10+ * IPlugin interface defined for documentation in /types/IPlugin.d.ts
11+ * @typedef {object } IPlugin
1612 */
1713
1814defaults . set ( 'plugins' , { } ) ;
@@ -186,215 +182,3 @@ class PluginService {
186182
187183// singleton instance
188184export default new PluginService ( ) ;
189-
190- /**
191- * Plugin extension hooks.
192- * @interface IPlugin
193- * @typedef {object } IPlugin
194- * @since 2.1.0
195- */
196- /**
197- * @method IPlugin#beforeInit
198- * @desc Called before initializing `chart`.
199- * @param {Chart } chart - The chart instance.
200- * @param {object } options - The plugin options.
201- */
202- /**
203- * @method IPlugin#afterInit
204- * @desc Called after `chart` has been initialized and before the first update.
205- * @param {Chart } chart - The chart instance.
206- * @param {object } options - The plugin options.
207- */
208- /**
209- * @method IPlugin#beforeUpdate
210- * @desc Called before updating `chart`. If any plugin returns `false`, the update
211- * is cancelled (and thus subsequent render(s)) until another `update` is triggered.
212- * @param {Chart } chart - The chart instance.
213- * @param {object } options - The plugin options.
214- * @returns {boolean } `false` to cancel the chart update.
215- */
216- /**
217- * @method IPlugin#afterUpdate
218- * @desc Called after `chart` has been updated and before rendering. Note that this
219- * hook will not be called if the chart update has been previously cancelled.
220- * @param {Chart } chart - The chart instance.
221- * @param {object } options - The plugin options.
222- */
223- /**
224- * @method IPlugin#reset
225- * @desc Called during chart reset
226- * @param {Chart } chart - The chart instance.
227- * @param {object } options - The plugin options.
228- * @since version 3.0.0
229- */
230- /**
231- * @method IPlugin#beforeDatasetsUpdate
232- * @desc Called before updating the `chart` datasets. If any plugin returns `false`,
233- * the datasets update is cancelled until another `update` is triggered.
234- * @param {Chart } chart - The chart instance.
235- * @param {object } options - The plugin options.
236- * @returns {boolean } false to cancel the datasets update.
237- * @since version 2.1.5
238- */
239- /**
240- * @method IPlugin#afterDatasetsUpdate
241- * @desc Called after the `chart` datasets have been updated. Note that this hook
242- * will not be called if the datasets update has been previously cancelled.
243- * @param {Chart } chart - The chart instance.
244- * @param {object } options - The plugin options.
245- * @since version 2.1.5
246- */
247- /**
248- * @method IPlugin#beforeDatasetUpdate
249- * @desc Called before updating the `chart` dataset at the given `args.index`. If any plugin
250- * returns `false`, the datasets update is cancelled until another `update` is triggered.
251- * @param {Chart } chart - The chart instance.
252- * @param {object } args - The call arguments.
253- * @param {number } args.index - The dataset index.
254- * @param {object } args.meta - The dataset metadata.
255- * @param {object } options - The plugin options.
256- * @returns {boolean } `false` to cancel the chart datasets drawing.
257- */
258- /**
259- * @method IPlugin#afterDatasetUpdate
260- * @desc Called after the `chart` datasets at the given `args.index` has been updated. Note
261- * that this hook will not be called if the datasets update has been previously cancelled.
262- * @param {Chart } chart - The chart instance.
263- * @param {object } args - The call arguments.
264- * @param {number } args.index - The dataset index.
265- * @param {object } args.meta - The dataset metadata.
266- * @param {object } options - The plugin options.
267- */
268- /**
269- * @method IPlugin#beforeLayout
270- * @desc Called before laying out `chart`. If any plugin returns `false`,
271- * the layout update is cancelled until another `update` is triggered.
272- * @param {Chart } chart - The chart instance.
273- * @param {object } options - The plugin options.
274- * @returns {boolean } `false` to cancel the chart layout.
275- */
276- /**
277- * @method IPlugin#afterLayout
278- * @desc Called after the `chart` has been layed out. Note that this hook will not
279- * be called if the layout update has been previously cancelled.
280- * @param {Chart } chart - The chart instance.
281- * @param {object } options - The plugin options.
282- */
283- /**
284- * @method IPlugin#beforeRender
285- * @desc Called before rendering `chart`. If any plugin returns `false`,
286- * the rendering is cancelled until another `render` is triggered.
287- * @param {Chart } chart - The chart instance.
288- * @param {object } options - The plugin options.
289- * @returns {boolean } `false` to cancel the chart rendering.
290- */
291- /**
292- * @method IPlugin#afterRender
293- * @desc Called after the `chart` has been fully rendered (and animation completed). Note
294- * that this hook will not be called if the rendering has been previously cancelled.
295- * @param {Chart } chart - The chart instance.
296- * @param {object } options - The plugin options.
297- */
298- /**
299- * @method IPlugin#beforeDraw
300- * @desc Called before drawing `chart` at every animation frame. If any plugin returns `false`,
301- * the frame drawing is cancelled untilanother `render` is triggered.
302- * @param {Chart } chart - The chart instance.
303- * @param {object } options - The plugin options.
304- * @returns {boolean } `false` to cancel the chart drawing.
305- */
306- /**
307- * @method IPlugin#afterDraw
308- * @desc Called after the `chart` has been drawn. Note that this hook will not be called
309- * if the drawing has been previously cancelled.
310- * @param {Chart } chart - The chart instance.
311- * @param {object } options - The plugin options.
312- */
313- /**
314- * @method IPlugin#beforeDatasetsDraw
315- * @desc Called before drawing the `chart` datasets. If any plugin returns `false`,
316- * the datasets drawing is cancelled until another `render` is triggered.
317- * @param {Chart } chart - The chart instance.
318- * @param {object } options - The plugin options.
319- * @returns {boolean } `false` to cancel the chart datasets drawing.
320- */
321- /**
322- * @method IPlugin#afterDatasetsDraw
323- * @desc Called after the `chart` datasets have been drawn. Note that this hook
324- * will not be called if the datasets drawing has been previously cancelled.
325- * @param {Chart } chart - The chart instance.
326- * @param {object } options - The plugin options.
327- */
328- /**
329- * @method IPlugin#beforeDatasetDraw
330- * @desc Called before drawing the `chart` dataset at the given `args.index` (datasets
331- * are drawn in the reverse order). If any plugin returns `false`, the datasets drawing
332- * is cancelled until another `render` is triggered.
333- * @param {Chart } chart - The chart instance.
334- * @param {object } args - The call arguments.
335- * @param {number } args.index - The dataset index.
336- * @param {object } args.meta - The dataset metadata.
337- * @param {object } options - The plugin options.
338- * @returns {boolean } `false` to cancel the chart datasets drawing.
339- */
340- /**
341- * @method IPlugin#afterDatasetDraw
342- * @desc Called after the `chart` datasets at the given `args.index` have been drawn
343- * (datasets are drawn in the reverse order). Note that this hook will not be called
344- * if the datasets drawing has been previously cancelled.
345- * @param {Chart } chart - The chart instance.
346- * @param {object } args - The call arguments.
347- * @param {number } args.index - The dataset index.
348- * @param {object } args.meta - The dataset metadata.
349- * @param {object } options - The plugin options.
350- */
351- /**
352- * @method IPlugin#beforeTooltipDraw
353- * @desc Called before drawing the `tooltip`. If any plugin returns `false`,
354- * the tooltip drawing is cancelled until another `render` is triggered.
355- * @param {Chart } chart - The chart instance.
356- * @param {object } args - The call arguments.
357- * @param {Tooltip } args.tooltip - The tooltip.
358- * @param {object } options - The plugin options.
359- * @returns {boolean } `false` to cancel the chart tooltip drawing.
360- */
361- /**
362- * @method IPlugin#afterTooltipDraw
363- * @desc Called after drawing the `tooltip`. Note that this hook will not
364- * be called if the tooltip drawing has been previously cancelled.
365- * @param {Chart } chart - The chart instance.
366- * @param {object } args - The call arguments.
367- * @param {Tooltip } args.tooltip - The tooltip.
368- * @param {object } options - The plugin options.
369- */
370- /**
371- * @method IPlugin#beforeEvent
372- * @desc Called before processing the specified `event`. If any plugin returns `false`,
373- * the event will be discarded.
374- * @param {Chart } chart - The chart instance.
375- * @param {IEvent } event - The event object.
376- * @param {object } options - The plugin options.
377- * @param {boolean } replay - True if this event is replayed from `Chart.update`
378- */
379- /**
380- * @method IPlugin#afterEvent
381- * @desc Called after the `event` has been consumed. Note that this hook
382- * will not be called if the `event` has been previously discarded.
383- * @param {Chart } chart - The chart instance.
384- * @param {IEvent } event - The event object.
385- * @param {object } options - The plugin options.
386- * @param {boolean } replay - True if this event is replayed from `Chart.update`
387- */
388- /**
389- * @method IPlugin#resize
390- * @desc Called after the chart as been resized.
391- * @param {Chart } chart - The chart instance.
392- * @param {number } size - The new canvas display size (eq. canvas.style width & height).
393- * @param {object } options - The plugin options.
394- */
395- /**
396- * @method IPlugin#destroy
397- * @desc Called after the chart as been destroyed.
398- * @param {Chart } chart - The chart instance.
399- * @param {object } options - The plugin options.
400- */
0 commit comments