MCPcopy Create free account
hub / github.com/feiyu563/PrometheusAlert / parseVisibleItems

Function parseVisibleItems

static/plugins/chart.js/Chart.bundle.js:6731–6744  ·  view source on GitHub ↗

* Helper function to traverse all of the visible elements in the chart * @param {Chart} chart - the chart * @param {function} handler - the callback to execute for each visible item

(chart, handler)

Source from the content-addressed store, hash-verified

6729 * @param {function} handler - the callback to execute for each visible item
6730 */
6731function parseVisibleItems(chart, handler) {
6732 var metasets = chart._getSortedVisibleDatasetMetas();
6733 var metadata, i, j, ilen, jlen, element;
6734
6735 for (i = 0, ilen = metasets.length; i < ilen; ++i) {
6736 metadata = metasets[i].data;
6737 for (j = 0, jlen = metadata.length; j < jlen; ++j) {
6738 element = metadata[j];
6739 if (!element._view.skip) {
6740 handler(element);
6741 }
6742 }
6743 }
6744}
6745
6746/**
6747 * Helper function to get the items that intersect the event position

Callers 3

getIntersectItemsFunction · 0.70
getNearestItemsFunction · 0.70
Chart.bundle.jsFile · 0.70

Calls 1

handlerFunction · 0.50

Tested by

no test coverage detected