MCPcopy Create free account
hub / github.com/chartjs/Chart.js / _updateHoverStyles

Method _updateHoverStyles

src/core/core.controller.js:1149–1162  ·  view source on GitHub ↗

* @private

(active, lastActive, replay)

Source from the content-addressed store, hash-verified

1147 * @private
1148 */
1149 _updateHoverStyles(active, lastActive, replay) {
1150 const hoverOptions = this.options.hover;
1151 const diff = (a, b) => a.filter(x => !b.some(y => x.datasetIndex === y.datasetIndex && x.index === y.index));
1152 const deactivated = diff(lastActive, active);
1153 const activated = replay ? active : diff(active, lastActive);
1154
1155 if (deactivated.length) {
1156 this.updateHoverStyle(deactivated, hoverOptions.mode, false);
1157 }
1158
1159 if (activated.length && hoverOptions.mode) {
1160 this.updateHoverStyle(activated, hoverOptions.mode, true);
1161 }
1162 }
1163
1164 /**
1165 * @private

Callers 3

updateMethod · 0.95
setActiveElementsMethod · 0.95
_handleEventMethod · 0.95

Calls 1

updateHoverStyleMethod · 0.95

Tested by

no test coverage detected