Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Plot: avoid timeseries downsample if we are already below display limit #7333

Conversation

defunctzombie
Copy link
Contributor

User-Facing Changes
Fix bug where zooming into a plot would unnecessarily downsample datums extremely close together.

Description
This change updates the TimestampDatasetsBuilderImpl to avoid doing a downsample if we are already under the viewport size for the number of items we want to display. While this does technically create a dataset that could have multiple datums at the same pixel coordinate, this is a tradeoff to avoid downsample rounding errors for extremely close datums at different zoom levels.

As the user zooms in, we might resolve these datums to the same pixel or different pixels based on rounding - even though in absolute terms they are further apart (i.e. going from 0.42 to 0.477 distance apart). This tends to be most obvious once you've already zoomed to a point where data was displayed without downsampling but then zooming in again changes the rounding and the logic would think the data is downsampled. In practice, the purpose of downsampling is to avoid rendering too many datums on a plot since rendering takes time. But when the dataset is already so small that it is under our viewport size and max point threshold then there's no reason to run downsampling and we can display all the datums regardless of whether they would appear at the same pixel or not.

@defunctzombie defunctzombie merged commit ee7b595 into main Jan 17, 2024
13 of 14 checks passed
@defunctzombie defunctzombie deleted the roman/fg-6319-some-series-missing-dots-when-zooming-in-to-a-plot branch January 17, 2024 18:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants