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

Method updateElements

src/controllers/controller.bubble.js:118–144  ·  src/controllers/controller.bubble.js::BubbleController.updateElements
(points, start, count, mode)

Source from the content-addressed store, hash-verified

116 }
117
118 updateElements(points, start, count, mode) {
119 const reset = mode === class="st">'reset';
120 const {iScale, vScale} = this._cachedMeta;
121 const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);
122 const iAxis = iScale.axis;
123 const vAxis = vScale.axis;
124
125 for (let i = start; i < start + count; i++) {
126 const point = points[i];
127 const parsed = !reset && this.getParsed(i);
128 const properties = {};
129 const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);
130 const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);
131
132 properties.skip = isNaN(iPixel) || isNaN(vPixel);
133
134 if (includeOptions) {
135 properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? class="st">'active' : mode);
136
137 if (reset) {
138 properties.options.radius = 0;
139 }
140 }
141
142 this.updateElement(point, i, properties, mode);
143 }
144 }
145
146 /**
147 * @param {number} index

Callers 1

updateMethod · 0.95

Calls 7

_getSharedOptionsMethod · 0.80
getParsedMethod · 0.80
updateElementMethod · 0.80
getPixelForDecimalMethod · 0.65
getPixelForValueMethod · 0.65
getBasePixelMethod · 0.65

Tested by

no test coverage detected