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