* @private
(e, replay)
| 1161 | * @private |
| 1162 | */ |
| 1163 | _eventHandler(e, replay) { |
| 1164 | const args = { |
| 1165 | event: e, |
| 1166 | replay, |
| 1167 | cancelable: true, |
| 1168 | inChartArea: this.isPointInArea(e) |
| 1169 | }; |
| 1170 | const eventFilter = (plugin) => (plugin.options.events || this.options.events).includes(e.native.type); |
| 1171 | |
| 1172 | if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) { |
| 1173 | return; |
| 1174 | } |
| 1175 | |
| 1176 | const changed = this._handleEvent(e, replay, args.inChartArea); |
| 1177 | |
| 1178 | args.cancelable = false; |
| 1179 | this.notifyPlugins('afterEvent', args, eventFilter); |
| 1180 | |
| 1181 | if (changed || args.changed) { |
| 1182 | this.render(); |
| 1183 | } |
| 1184 | |
| 1185 | return this; |
| 1186 | } |
| 1187 | |
| 1188 | /** |
| 1189 | * Handle an event |
no test coverage detected