phibr0 / obsidian-charts

Charts - Obsidian Plugin | Create editable, interactive and animated Charts in Obsidian via Chart.js
https://charts.phib.ro/
GNU Affero General Public License v3.0
568 stars 26 forks source link

[Bug]: Inconsistency in tension trajectories depending on start of sequence #74

Open holroy opened 1 year ago

holroy commented 1 year ago

Describe the bug

This is not a very serious bug, more of a pecularity, but I felt like I should report anyways. It's related to the tension parameter, which I tested out in the radar chart with a spiral data set. And yes, I made this for the pure fun of it, as I saw that increasing the tension made some nice effects.

With tension=20 the test data in the code section gives this image: image And with tension=0 it gives this image: image

The latter image, just proves that my test data is consistent, and correct for making a spiral. The bug is related to the image shown for tension=20. Here one can see that pattern between the axis from tuesday to friday is similar, albeit not identical, but the pattern from monday to tuesday differs, and the pattern from friday to monday goes haywire (and leaves the chart all together).

Is this a serious bug? No. Does it look strange? Yes. With consistency could it open up for beautiful patterns? Oh yes! :-D

In my head it should be a given trajectory when the data is the same, no matter where in the sequence I start and end. Currently there is a distinct difference, which depends on the starting point, and then gets askew towards the end.

Relevant errors (if available)

No response

Steps to reproduce

Just copy the test data as given in the Code section, and play around with the tension value.

Expected Behavior

In the test data the sequence is always [1, 2, 3, 4, 5], but to get the spiral effect, I shifted the start of the sequence depending on the day. And I expected that the tension calculation, since this is a looped trajectory, to be consistent and the same no matter where in the sequence I started.

Additional context

No response

Code

type: radar
labels: [Monday,Tuesday,Wednesday,Thursday,Friday]
series:
  - title: Title 1
    data: [1,2,3,4,5]
  - title: Title 2
    data: [2,3,4,5,1]
  - title: Title 3
    data: [3,4,5,1,2]
  - title: Title 4
    data: [4,5,1,2,3]
  - title: Title 5
    data: [5,1,2,3,4]
width: 60%
beginAtZero: true
tension: 20
legend: false

Operating system

macOS