* @private
(e, replay)
| 1275 | * @private |
| 1276 | */ |
| 1277 | _eventHandler(e, replay) { |
| 1278 | const args = { |
| 1279 | event: e, |
| 1280 | replay, |
| 1281 | cancelable: true, |
| 1282 | inChartArea: this.isPointInArea(e) |
| 1283 | }; |
| 1284 | const eventFilter = (plugin) => (plugin.options.events || this.options.events).includes(e.native.type); |
| 1285 | |
| 1286 | if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) { |
| 1287 | return; |
| 1288 | } |
| 1289 | |
| 1290 | const changed = this._handleEvent(e, replay, args.inChartArea); |
| 1291 | |
| 1292 | args.cancelable = false; |
| 1293 | this.notifyPlugins('afterEvent', args, eventFilter); |
| 1294 | |
| 1295 | if (changed || args.changed) { |
| 1296 | this.render(); |
| 1297 | } |
| 1298 | |
| 1299 | return this; |
| 1300 | } |
| 1301 | |
| 1302 | /** |
| 1303 | * Handle an event |
no test coverage detected