* Filter entries to a timestamp window [minMs, maxMs], then resample.
(entries, minMs, maxMs)
| 356 | * Filter entries to a timestamp window [minMs, maxMs], then resample. |
| 357 | */ |
| 358 | function sampleEntriesWindow(entries, minMs, maxMs) { |
| 359 | const windowed = entries.filter((e) => { |
| 360 | const ms = new Date(e.timestamp).getTime(); |
| 361 | return ms >= minMs && ms <= maxMs; |
| 362 | }); |
| 363 | // Within a zoom window show all coalesced points (no further thinning) |
| 364 | // unless there are still more than MAX_POINTS |
| 365 | const coalesced = coalesceByDay(windowed); |
| 366 | return thinEvenly(coalesced, MAX_POINTS); |
| 367 | } |
| 368 | |
| 369 | /** |
| 370 | * Attach zoom/reset handlers to a chart that update its series from fullSeriesBuilder. |
nothing calls this directly
no test coverage detected