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

[Timeline] Fix display of unit above #140

Closed
luciob opened this issue Oct 26, 2023 · 2 comments · Fixed by #142
Closed

[Timeline] Fix display of unit above #140

luciob opened this issue Oct 26, 2023 · 2 comments · Fixed by #142
Assignees
Labels

Comments

@luciob
Copy link
Member

luciob commented Oct 26, 2023

Unit above gets displayed in the wrong way, not starting from its beginning (this applies from weeks and above, not for days below => hours / mins).

@luciob
Copy link
Member Author

luciob commented Oct 26, 2023

Looks like the issue has been found in a wrong calculation of the intervals (the division of the range in equal parts of resolution) and of the "above" timeBlocks.

For what concerns the intervals this looks solved acting in this way: function getIntervalFromInternalTimeRange inside src/utils/time.ts now uses resolution.unit (e.g. week) instead of resolution.unitAbove (e.g. month).

Instead for what concerns the aboveTimeBlocks the calculation has been partially changed calculating the effective portions of the unitAbove considering when the interval starts. If the interval starts on 5th of October, the first month of data will be 5th October to 31st October, and then starts to sum up 1 month every time. Same concept for month end (see aboveTimeBlocks memo in TimelineContext).

The final place to look for is the CellGroup component which is responsible of printing the unitAbove ticks on the chart.
Hope this clears the situation a bit 😬

CrisGrud added a commit that referenced this issue Oct 31, 2023
@CrisGrud CrisGrud linked a pull request Oct 31, 2023 that will close this issue
CrisGrud added a commit that referenced this issue Oct 31, 2023
CrisGrud added a commit that referenced this issue Nov 6, 2023
CrisGrud added a commit that referenced this issue Nov 6, 2023
CrisGrud added a commit that referenced this issue Nov 6, 2023
CrisGrud added a commit that referenced this issue Nov 6, 2023
luciob pushed a commit that referenced this issue Nov 6, 2023
## [1.16.2](v1.16.1...v1.16.2) (2023-11-06)

### Bug Fixes

* 🐛 [Timeline] Fixed display for month unit ([a551ddf](a551ddf))
* 🐛 [TimeLine] Fixed display of unit above ([f67d077](f67d077)), closes [#140](#140)
* 🐛 [TimeLine] Fixed display of visibleTimeBlock with Tz ([d6f31e5](d6f31e5)), closes [#140](#140)
* 🐛 [TimeLine] fixed display unitAbove when TZ change ([6f7b7b0](6f7b7b0)), closes [#140](#140)
* 🐛 [timeLine] fixed start interval for week unit ([02c81d9](02c81d9)), closes [#140](#140)
* 🐛 [Timeline] Print unit above of length = rowHeight ([ea9a047](ea9a047))
@luciob
Copy link
Member Author

luciob commented Nov 6, 2023

🎉 This issue has been resolved in version 1.16.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@luciob luciob added the released label Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants