mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* move charts to toolkit * refactor imports * fix tests * change the behavior of the color mode hook and add the noWatermark prop * fix gas tracker test and fix toolkit build
20 lines
555 B
TypeScript
20 lines
555 B
TypeScript
import type { TimeChartItem } from '../types';
|
|
|
|
export const getIncompleteDataLineSource = (data: Array<TimeChartItem>): Array<TimeChartItem> => {
|
|
const result: Array<TimeChartItem> = [];
|
|
|
|
for (let index = 0; index < data.length; index++) {
|
|
const current = data[index];
|
|
if (current.isApproximate) {
|
|
const prev = data[index - 1];
|
|
const next = data[index + 1];
|
|
|
|
prev && !prev.isApproximate && result.push(prev);
|
|
result.push(current);
|
|
next && !next.isApproximate && result.push(next);
|
|
}
|
|
}
|
|
|
|
return result;
|
|
};
|