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

Method updateElements

src/controllers/controller.bubble.js:128–154  ·  view source on GitHub ↗
(points, start, count, mode)

Source from the content-addressed store, hash-verified

126 }
127
128 updateElements(points, start, count, mode) {
129 const reset = mode === 'reset';
130 const {iScale, vScale} = this._cachedMeta;
131 const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);
132 const iAxis = iScale.axis;
133 const vAxis = vScale.axis;
134
135 for (let i = start; i < start + count; i++) {
136 const point = points[i];
137 const parsed = !reset && this.getParsed(i);
138 const properties = {};
139 const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);
140 const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);
141
142 properties.skip = isNaN(iPixel) || isNaN(vPixel);
143
144 if (includeOptions) {
145 properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);
146
147 if (reset) {
148 properties.options.radius = 0;
149 }
150 }
151
152 this.updateElement(point, i, properties, mode);
153 }
154 }
155
156 /**
157 * @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