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

XAxisUnscaled doesn't play well with zoom making unzoom impossible #136

Closed
mum4k opened this issue Feb 18, 2019 · 3 comments
Closed

XAxisUnscaled doesn't play well with zoom making unzoom impossible #136

mum4k opened this issue Feb 18, 2019 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@mum4k
Copy link
Owner

mum4k commented Feb 18, 2019

When data are continuously coming in, it is impossible to fully unzoom when XAxisUnscaled.

We should return the zoom tracker back to unzoomed state once we hit the "baseX" view.

@mum4k mum4k added the bug Something isn't working label Feb 18, 2019
@mum4k mum4k added this to the Release 0.7.0 milestone Feb 18, 2019
@mum4k
Copy link
Owner Author

mum4k commented Feb 18, 2019

Secondly when we zoom in and out while the baseX is allowed to scroll, there is a scenario where min > max. Needs investigation:


panic: container.Draw => error: unable to draw widget *linechart.LineChart: failed to create zoomed X axis: invalid min:316, max:311, must be min <= max

goroutine 1 [running]:
main.main()
/Users/mum4k/go/src/github.com/mum4k/termdash/widgets/linechart/linechartdemo/linechartdemo.go:122 +0x6b6
exit status 2

@mum4k
Copy link
Owner Author

mum4k commented Feb 18, 2019

These are two separate issues:

  1. The FSM of the zoom tracker never gets back to the fully unzoomed state.
  2. We have a very basic race - LineChart.Mouse isn't protected by mutex. This causes a race between a mouse event and a redraw.

mum4k added a commit that referenced this issue Feb 18, 2019
- stay unzoomed when we hit the largest view.
- correctly normalize zoom values when the base axis is in motion.
- test coverage for the edge cases.

Fixes #136
@mum4k
Copy link
Owner Author

mum4k commented Feb 18, 2019

Fixed in the devel branch.

@mum4k mum4k closed this as completed Feb 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant