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

Method _removeUnreferencedMetasets

src/core/core.controller.js:412–423  ·  view source on GitHub ↗

* @private

()

Source from the content-addressed store, hash-verified

410 * @private
411 */
412 _removeUnreferencedMetasets() {
413 const {_metasets: metasets, data: {datasets}} = this;
414 if (metasets.length > datasets.length) {
415 delete this._stacks;
416 }
417 const referenced = new Set(datasets);
418 metasets.forEach((meta, index) => {
419 if (!referenced.has(meta._dataset)) {
420 this._destroyDatasetMeta(index);
421 }
422 });
423 }
424
425 buildOrUpdateControllers() {
426 const newControllers = [];

Callers 1

Calls 2

_destroyDatasetMetaMethod · 0.95
hasMethod · 0.80

Tested by

no test coverage detected