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

New smooth curve causes time to warp for sparse data #4063

Closed
Tankenstein opened this issue Oct 13, 2023 · 3 comments
Closed

New smooth curve causes time to warp for sparse data #4063

Tankenstein opened this issue Oct 13, 2023 · 3 comments

Comments

@Tankenstein
Copy link

Tankenstein commented Oct 13, 2023

Description

The latest release (3.43.0) changed the "smooth" curve. This is an improvement and looks great for evenly spaced data, but when data is sparse and moves around a lot, it can cause the chart to temporarily flow backwards in time, or completely reverse and do a loop.

Steps to Reproduce

  1. Make a line or area chart with sparse erratic data (for example, [{ x: 0, y: 11 }, { x: 1, y: 10 }, { x: 2, y: 18 }, { x: 13, y: 5 }, { x: 20, y: 100 }])
  2. Set stroke.curve to 'smooth'
  3. Enjoy the show

Expected Behavior

Line and area chart lines move relatively smoothly from one point to the next, but never going backwards in time.

Actual Behavior

Line and area chart lines can go backwards in time.

Screenshots

image

image

Reproduction Link

https://codepen.io/Tankenstein/pen/ZEVZXeq

Related issue, closed because it was missing a repro link: #4044

@Tankenstein Tankenstein added the bug Something isn't working label Oct 13, 2023
@Tankenstein Tankenstein changed the title New smooth curve causes time to warp in certain cases New smooth curve causes time to warp for sparse data Oct 13, 2023
@cedricvoinnet
Copy link

Version 3.44 doesn't fix the problem.

See the codepen linked in the issue: https://codepen.io/Tankenstein/pen/ZEVZXeq

@DamienGdn
Copy link

+1

@junedchhipa
Copy link
Contributor

The previous smooth logic is re-added since v3.45.2

So, from now on, you have 4 curve options for stroke

stroke: {
  curve: "smooth" // straight, smooth, monotoneCubic, stepline
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants