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
Behavior of y-scale zoom #343
Comments
Hi, I am not sure but do you remove the series before setting new data ? Regards, |
i'm in the process of removing the
i think it's worth figuring out exactly how auto true/false should work before attempting to fix this. one of the purposes of x auto-ranging may happen on:
y auto-ranging may happen on:
if we force y to auto-scale on init, you lose the ability to avoid that min/max scanning cost. should double-clicking also ignore i hope there's an easy and consistent solution, but i'm not sure what that is. maybe a callback signature can be added for |
Thanks for the answer. I finally solved it by invoking redraw(true/false) separately for each frame. I guess it would be possible also by changing the opts on the go (?) Agree that the minmax search could be a performance hit, however I still did not get the logic behind the different behavior of X and Y auto:true/false. Just imagine parametric graphs where X are not given in ascending order. I'd definitely vote for auto:true/false consistency between both axes and x+y autoscaling function of the doubleclick, both controllable by opts for the subsequent invoking of redraw (or is it already controllable?). Btw. default setting of X as time feels a bit arbitrary, although it does not hurt to switch it off. |
uPlot is fundamentally a timeseries plotting lib. its internals require X to be strictly ascending, and a good amount of its perf is derived from this assumption, along with x-alignment of every series' data. x is special, which is why arbitrary scatter and X/Y plots are tricky to add support for.
does it still seem arbitrary given the above explanation? |
maybe adding some variant of the default behavior for both x and y scales would be to return |
@martincheco i just pushed a commit that adds a callback signature to try it out and see if that works for you (in combo with
|
i've adjusted the API so that
|
closing this as resolved. let me know if you have any issues. |
I just tested with the y scales opts you suggested somehow it seems to work, however now zooming of the X-axis is broken, do you see the same behavior? Y-axis zoom still works fine. |
Great and blazing-fast library, indeed!
I have implemented a graph that displays real-time spectra (1024 points each), 20FPS are no problem at all!
the program uses setData(newdata) to update the graph. By using opts: scales: {x: {time: false,auto:false}, I can get the desired behavior of the X-scale, which is autoscale at graph reation and a fixed range zoom after a X zoom event, persisting over the setData call. Doubleclick autoscales the X, which is perfect.
BUT the same strategy does not work for the Y scale (y:{auto:false})
The Y scale does not autoscale on graph creation and defaults to 0..100 range, which cannot be autoscaled even by doubleclick.
Tried auto:true and setData(newdata, false), but the graph does not update at all!
Not sure if this is an issue or just my ignorance, however the documentation and the demos are rather sketchy on this one..
Thanks for any hints in advance!
The text was updated successfully, but these errors were encountered: