Skip to content

Commit a68f332

Browse files
committed
optimization: don't interpolate same values (in particular, colors)
1 parent 8acc5b1 commit a68f332

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/plot.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ export function plot(options = {}) {
282282
}
283283
} else {
284284
for (let i = 0; i < n; ++i) {
285-
interp[k][Ii[i]] = interpolate(values[k][I0[i]], values[k][I1[i]])(timet);
285+
const past = values[k][I0[i]], future = values[k][I1[i]];
286+
interp[k][Ii[i]] = past == future ? past : interpolate(past, future)(timet);
286287
}
287288
}
288289
}

0 commit comments

Comments
 (0)