* Set active (hovered) elements * @param {array} activeElements New active data points
(activeElements)
| 1094 | * @param {array} activeElements New active data points |
| 1095 | */ |
| 1096 | setActiveElements(activeElements) { |
| 1097 | const lastActive = this._active || []; |
| 1098 | const active = activeElements.map(({datasetIndex, index}) => { |
| 1099 | const meta = this.getDatasetMeta(datasetIndex); |
| 1100 | if (!meta) { |
| 1101 | throw new Error(class="st">'No dataset found at index ' + datasetIndex); |
| 1102 | } |
| 1103 | |
| 1104 | return { |
| 1105 | datasetIndex, |
| 1106 | element: meta.data[index], |
| 1107 | index, |
| 1108 | }; |
| 1109 | }); |
| 1110 | const changed = !_elementsEqual(active, lastActive); |
| 1111 | |
| 1112 | if (changed) { |
| 1113 | this._active = active; |
| 1114 | class="cm">// Make sure we don't use the previous mouse event to override the active elements in update. |
| 1115 | this._lastEvent = null; |
| 1116 | this._updateHoverStyles(active, lastActive); |
| 1117 | } |
| 1118 | } |
| 1119 | |
| 1120 | /** |
| 1121 | * Calls enabled plugins on the specified hook and with the given args. |
nothing calls this directly
no test coverage detected