MCPcopy
hub / github.com/chartjs/Chart.js / _getActiveElements

Method _getActiveElements

src/core/core.controller.js:1249–1261  ·  view source on GitHub ↗

* @param {ChartEvent} e - The event * @param {import('../types/index.js').ActiveElement[]} lastActive - Previously active elements * @param {boolean} inChartArea - Is the event inside chartArea * @param {boolean} useFinalPosition - Should the evaluation be done with current or final (after

(e, lastActive, inChartArea, useFinalPosition)

Source from the content-addressed store, hash-verified

1247 * @pravate
1248 */
1249 _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {
1250 if (e.type === 'mouseout') {
1251 return [];
1252 }
1253
1254 if (!inChartArea) {
1255 // Let user control the active elements outside chartArea. Eg. using Legend.
1256 return lastActive;
1257 }
1258
1259 const hoverOptions = this.options.hover;
1260 return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);
1261 }
1262}
1263
1264// @ts-ignore

Callers 1

_handleEventMethod · 0.95

Calls 1

Tested by

no test coverage detected