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

Method _deactivateDatasetElements

src/core/core.controller.js:592–603  ·  view source on GitHub ↗

* In hover mode 'dataset', ends the active state of the dataset elements whose * items were all dropped. A dataset with an item still active keeps its hover style. * @param {Set } dropped - indices of the datasets that lost active items * @param {import('../types/index.js').ActiveEle

(dropped, active)

Source from the content-addressed store, hash-verified

590 * @private
591 */
592 _deactivateDatasetElements(dropped, active) {
593 for (const {datasetIndex} of active) {
594 dropped.delete(datasetIndex);
595 }
596 for (const datasetIndex of dropped) {
597 // A removed dataset has no meta left, and getDatasetMeta would make one.
598 const meta = this.data.datasets[datasetIndex] && this.getDatasetMeta(datasetIndex);
599 if (meta && meta.dataset) {
600 meta.dataset.active = false;
601 }
602 }
603 }
604
605 /**
606 * Replays the last event from before the update, or sets the hover styles on the active elements.

Callers 1

_deactivateHiddenMethod · 0.95

Calls 1

getDatasetMetaMethod · 0.95

Tested by

no test coverage detected