Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/utils/chart-data-correction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export interface ChartFilterSettings {
}

/**
* Applies moving average then smoothing in sequence.
* Applies moving average, smoothing and then rounding up in sequence.
*/
export function applyDataCorrection<T extends { value: number }>(
data: T[],
Expand All @@ -92,5 +92,6 @@ export function applyDataCorrection<T extends { value: number }>(
let result = data
result = movingAverage(result, settings.averageWindow)
result = smoothing(result, settings.smoothingTau)
result = result.map(d => ({ ...d, value: Math.ceil(d.value) }))
return result
}
Loading