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

Support zooming of the LineChart. #55

Closed
mum4k opened this issue Jun 22, 2018 · 8 comments
Closed

Support zooming of the LineChart. #55

mum4k opened this issue Jun 22, 2018 · 8 comments
Labels
enhancement New feature or request
Milestone

Comments

@mum4k
Copy link
Owner

mum4k commented Jun 22, 2018

Rotation of the mouse wheel or key presses could adjust the scale.

@mum4k mum4k self-assigned this Jun 22, 2018
@mum4k mum4k added this to To do in Implement the LineChart widget. via automation Jun 22, 2018
@mum4k mum4k removed this from the Feature parity with gizak/termui milestone Jan 13, 2019
@mum4k mum4k added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jan 13, 2019
@mum4k mum4k removed their assignment Jan 13, 2019
@keithknott26
Copy link

This would be very helpful!

@mum4k
Copy link
Owner Author

mum4k commented Feb 13, 2019

I haven't given this much thought yet, i.e. how this would work or which part of the linechart or which of the axes would be zoomed.

Maybe you could help me by describing your use case and how you would envision the zoom working?

@keithknott26
Copy link

I'm building a data visualization app similar to termeter where you can pipe in columned data from stdin or a flat file and have it display on linegraphs. This is for visualizing data in an application environment (client server) requests per minute, etc. It would be helpful to be able to zoom in on each graph to see the spikes and in particular which precise label the data spike maps to, I like the idea of using the mouse scroll wheel to quickly zoom in / out on a particular segment of data and have the labels also scale accordingly. I've attached a screenshot of my use case.

image

I'm not sure where to ask this question, but is there a way to anchor the maxYValue on the graph? My data Xseries continually changes (the graphs scroll from right to left) so the scale changes along with the data. I was hoping there was a way to anchor the graph at a particularl Yvalue to effectively disable the autoscaling/adaptive scaling feature. I'll continue looking over your code, in particular the value, label, and scale sections of the linegraph code.

I think what you've done so far is really impressive, nice work!

Cheers!

@mum4k
Copy link
Owner Author

mum4k commented Feb 13, 2019

Re zooming - thank you for providing the screenshot and explanation. So if I understand this correctly you are interested in zooming the X, i.e. the data axis. Not the Y, i.e. the value axis, right?

Such zoom would just change the first or the last data point that is displayed on the X axis and the scale of the Y axis would adapt to the new minimum and maximum in the visible range?

Re Y anchoring - that is a feature I was considering, I have created #121, would you mind helping me by putting your thoughts there?

@mum4k
Copy link
Owner Author

mum4k commented Feb 14, 2019

While looking for linecharts with zoom, I found this:

https://www.amcharts.com/demos/line-chart-with-scroll-and-zoom/

And I think it is a fairly interesting mechanic. Notice that the zoom isn't done using a mouse scroll, but instead by selecting an area on the linechart. I.e. left click + drag onto the linechart to highlight an area that should be zoomed into.

We should ignore the animation for now as currently the termdash infrastructure doesn't allow widgets to force a screen redraw, but I would be interested to hear your opinion on the control mechanic. Would something like this work for your use case?

@mum4k mum4k removed good first issue Good for newcomers help wanted Extra attention is needed labels Feb 15, 2019
@mum4k
Copy link
Owner Author

mum4k commented Feb 16, 2019

With the work for #123 and #21 done, this became much easier.

Going to look at this next.

@mum4k mum4k added this to the Release 0.7.0 milestone Feb 16, 2019
@keithknott26
Copy link

keithknott26 commented Feb 16, 2019

Being able to select a portion of the line graph with the mouse and dragging to the left or right to select a series of "cells" would zoom in on the graph and put the appropriately "scaled" labels underneath? This is a fantastic idea, I considered suggesting exactly that but figured it would be too difficult to implement. Thank you for taking this on, that is truly a great feature. As far as your most recent changes to the line graph - I have some time this weekend to test using your latest development branch using my app and a large dataset.

@mum4k
Copy link
Owner Author

mum4k commented Feb 18, 2019

This is now available in the devel branch.

I would appreciate if you could give it a try. If all looks good we could release what's in the devel branch, since we have accumulated a few features by now.

@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
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants