Commit 5aaac03
committed
fix(tokens): prevent zero spike at chart start when data covers full range
The LTTB zero-fill guard (timestamp < firstRealTimestamp → 0.0) fired unconditionally, even when the gap before the first data point was too small to warrant zero-anchoring. For the weekly chart this meant bucket 0 was set to 0 while bucket 1 held the real value, producing a visible spike at the left edge.
Tie the zero-fill to the same hasSignificantGap flag that controls zero-anchor injection so small gaps are handled by interpolation instead.
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>1 parent b2341ae commit 5aaac03
1 file changed
Lines changed: 10 additions & 5 deletions
File tree
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
70 | 73 | | |
71 | 74 | | |
72 | | - | |
| 75 | + | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
75 | | - | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
| |||
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
101 | | - | |
| 105 | + | |
| 106 | + | |
102 | 107 | | |
103 | 108 | | |
104 | 109 | | |
| |||
0 commit comments