Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeseries: support panning #9345

Merged
merged 4 commits into from Jul 3, 2021
Merged

Timeseries: support panning #9345

merged 4 commits into from Jul 3, 2021

Conversation

kurkle
Copy link
Member

@kurkle kurkle commented Jul 2, 2021

Resolves #9344

This changes how the values outside the data range are positioned. Previously they would in proportion to the nearest step, including the scale min/max. Now they are positioned relative to the whole visible data-span.

Summary:

  • values outside the actual data points are not included in the interpolation table. This includes min/max when they extend the range.
  • interpolating the outliers is done relative to the whole (visible) data range, to keep the scale consistent when panning.
  • The "normalized" optimization is removed, because the data index is not relative to the scale range when min/max are outside data. This optimization would have also failed when there are timestamps from both labels and data or when the scale is zoomed, because data indices would not match the lookup table indices.

etimberg
etimberg previously approved these changes Jul 2, 2021
@kurkle
Copy link
Member Author

kurkle commented Jul 3, 2021

I did some benchmarking (chrome, uplot bench, 100 runs, average time):

normalized master pr updated pr
false 111ms 111ms 73ms
true 52ms 86ms 54ms

@kurkle
Copy link
Member Author

kurkle commented Jul 3, 2021

Filename Size Change
dist/chart.esm.js 71.2 kB +122 B (0%)
dist/chart.js 90.3 kB +123 B (0%)
dist/chart.min.js 64.4 kB +67 B (0%)

@kurkle kurkle merged commit bb2bddc into chartjs:master Jul 3, 2021
@kurkle kurkle added this to the Version 3.4.1 milestone Jul 3, 2021
@kurkle kurkle deleted the timeseries-pan branch July 20, 2021 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pan not working with scale type timeseries
2 participants