Skip to content

Commit eafffee

Browse files
authored
Fixed integration using the wrong side of the y value (#214)
1 parent abcbc0c commit eafffee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/filters/filters.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ const filters = {
166166
let last = {
167167
x: NaN,
168168
laps: 0,
169+
y: 0,
169170
};
170171
return {
171172
meta: {
@@ -186,7 +187,8 @@ const filters = {
186187
const isFirst = isNaN(last.x);
187188
last.x = x;
188189
if (isFirst) return NaN;
189-
yAcc += y * dateDelta;
190+
yAcc += last.y * dateDelta;
191+
last.y = y;
190192
return yAcc;
191193
}),
192194
};

0 commit comments

Comments
 (0)