in src/dataRepresentation/dataRepresentationPointFilter.ts [40:70]
public groupPointByColor(
gradientPoints: IDataRepresentationPointGradientColor[],
point: IDataRepresentationPoint,
dataPointEndsKpiColorSegment: boolean,
): void {
if (!this.isPointValid(point) || !gradientPoints) {
return;
}
const currentGradient: IDataRepresentationPointGradientColor = gradientPoints.slice(-1)[0];
if (!currentGradient) {
gradientPoints.push({
color: point.color,
points: [point],
});
} else if (currentGradient && currentGradient.color === point.color) {
currentGradient.points.push(point);
} else if (currentGradient && currentGradient.color !== point.color) {
currentGradient.points.push(point);
if (dataPointEndsKpiColorSegment) {
currentGradient.points.reverse();
}
gradientPoints.push({
color: point.color,
points: [point],
});
}
}