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

Method _setStyle

src/core/core.datasetController.js:919–927  ·  view source on GitHub ↗

* @private

(element, index, mode, active)

Source from the content-addressed store, hash-verified

917 * @private
918 */
919 _setStyle(element, index, mode, active) {
920 element.active = active;
921 const options = this.getStyle(index, active);
922 this._resolveAnimations(index, mode, active).update(element, {
923 // When going from active to inactive, we need to update to the shared options.
924 // This way the once hovered element will end up with the same original shared options instance, after animation.
925 options: (!active && this.getSharedOptions(options)) || options
926 });
927 }
928
929 removeHoverStyle(element, datasetIndex, index) {
930 this._setStyle(element, index, 'active', false);

Callers 4

removeHoverStyleMethod · 0.95
setHoverStyleMethod · 0.95
_setDatasetHoverStyleMethod · 0.95

Calls 4

getStyleMethod · 0.95
_resolveAnimationsMethod · 0.95
getSharedOptionsMethod · 0.95
updateMethod · 0.65

Tested by

no test coverage detected