(points, start, count, mode)
| 74 | } |
| 75 | |
| 76 | updateElements(points, start, count, mode) { |
| 77 | const reset = mode === class="st">'reset'; |
| 78 | const {iScale, vScale, _stacked, _dataset} = this._cachedMeta; |
| 79 | const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode); |
| 80 | const iAxis = iScale.axis; |
| 81 | const vAxis = vScale.axis; |
| 82 | const {spanGaps, segment} = this.options; |
| 83 | const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY; |
| 84 | const directUpdate = this.chart._animationsDisabled || reset || mode === class="st">'none'; |
| 85 | const end = start + count; |
| 86 | const pointsCount = points.length; |
| 87 | let prevParsed = start > 0 && this.getParsed(start - 1); |
| 88 | |
| 89 | for (let i = 0; i < pointsCount; ++i) { |
| 90 | const point = points[i]; |
| 91 | const properties = directUpdate ? point : {}; |
| 92 | |
| 93 | if (i < start || i >= end) { |
| 94 | properties.skip = true; |
| 95 | continue; |
| 96 | } |
| 97 | |
| 98 | const parsed = this.getParsed(i); |
| 99 | const nullData = isNullOrUndef(parsed[vAxis]); |
| 100 | const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i); |
| 101 | const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i); |
| 102 | |
| 103 | properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData; |
| 104 | properties.stop = i > 0 && (Math.abs(parsed[iAxis] - prevParsed[iAxis])) > maxGapLength; |
| 105 | if (segment) { |
| 106 | properties.parsed = parsed; |
| 107 | properties.raw = _dataset.data[i]; |
| 108 | } |
| 109 | |
| 110 | if (includeOptions) { |
| 111 | properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? class="st">'active' : mode); |
| 112 | } |
| 113 | |
| 114 | if (!directUpdate) { |
| 115 | this.updateElement(point, i, properties, mode); |
| 116 | } |
| 117 | |
| 118 | prevParsed = parsed; |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | /** |
| 123 | * @protected |
no test coverage detected