Commit Graph

8 Commits

Author SHA1 Message Date
Simon Brunel
3187a788e1 Add support for local plugins and plugin options
Plugins can now be declared in the chart `config.plugins` array and will only be applied to the associated chart(s), after the globally registered plugins. Plugin specific options are now scoped under the `config.options.plugins` options. Hooks now receive the chart instance as first argument and the plugin options as last argument.
2016-12-18 08:46:15 -05:00
Zach Panzarino
766ca49cd0 Extend eslint to test files (#3473)
* Add eslint to test files

* Fix mockContext for tests

* Make formatting look better for nested objects
2016-10-16 17:34:59 -04:00
Simon Brunel
dfdbd4465c Allow to register/unregister an array of plugins
The plugins service now accepts an array of plugin instances to register or unregister (for consistency, renamed `Chart.plugins.remove` to `unregister`). Also added a few methods to manipulate registered plugins, such as `count`, `getAll` and `clear` (mainly used by our unit tests).
2016-06-11 00:17:44 +02:00
Simon Brunel
a55c17d73f Enhance plugin notification system
Change the plugin notification behavior: this method now returns false as soon as a plugin *explicitly* returns false, else returns true. Also, plugins are now called in their own scope (so remove the never used `scope` parameter).
2016-06-10 22:26:55 +02:00
Simon Brunel
7a419af4c2 Rename plugin service and notification method
Rename `Chart.pluginService` to `Chart.plugins` (so move the old Chart.plugins array as a private member of the service), and rename `notifyPlugins` to `notify` for consistency with other service methods.
2016-06-10 22:26:35 +02:00
Evert Timberg
ae01f1726c Fix tests 2016-05-26 19:22:11 -04:00
Evert Timberg
d131e7d07a Use apply instead of call so that the animation easing can be passed to the draw callbacks 2016-04-17 12:25:47 -04:00
Evert Timberg
16570b0c0c Plugin system + tests 2016-04-17 12:02:33 -04:00