fix(ui): Align time series line graph with actual data points#5041
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this change the time series data points would render evenly across the time series graph window, regardless of whether the data point aligned with the x-axis time value.
This PR makes sure that data points are rendered above the correct time marker tick on the x-axis.
Note
Medium Risk
Changes the timeline API contract from
number[]to timestampedPoint[], which touches query state and chart rendering and could break downstream consumers if any were missed. Adds a new test runner and CI job, which is low functional risk but may affect pipeline stability/time.Overview
Fixes the time series chart so points are positioned on the x-axis using their actual
timestampinstead of being evenly distributed across the width, updating the area/line paths accordingly.Updates
fetchTimeline/usePyroscopeQuery/TimeSeriesto pass full{ value, timestamp }points through the UI rather than mapping to just values.Introduces
vitestwith a newyarn testscript, moves time-series helper functions intocomponents/timeseries.tswith unit tests, and adds atestjob to thefrontendGitHub Actions workflow.Reviewed by Cursor Bugbot for commit 697753d. Bugbot is set up for automated code reviews on this repo. Configure here.