-
-
Notifications
You must be signed in to change notification settings - Fork 386
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
improve(stepped): draw step by null-value at begin/end of dataset #694
base: master
Are you sure you want to change the base?
Conversation
hey @Leubeling thanks for the PR :)
[1] https://leeoniya.github.io/uPlot/demos/path-gap-clip.html |
Hey @leeoniya -> thank you for this project So i decided to check this funktion and interpreted: master-branchimproved-branche |
I will make an example to showing my use case.
|
Her is my use case!
master-branchimproved-branche |
definitely looks like an improvement! i'll do a more thorough review today or tomorrow. is there a reason for implementing custom normalization instead of using the existing Lines 147 to 148 in ad85ee2
|
For me there is a reason, yes! But I forgot to show you in this example! I removed this and use join like all other examples -> because it's always faster. Now the reason:
|
hey @Leubeling sorry for sitting on this PR. what i ended up doing initially (in commits pushed today) is to re-use the linear gap detection logic and extract it from the draw loop for all pathBuilders, this simplifies these loops and brings more uniformity to how gaps are rendered across i've also added your example from #694 (comment) to the gaps/align demo page, in both a "before" and "after" variant. let's take a look at the red step-after series:
the way this renders currently is consistent with how uplot renders gaps in other paths - the gap starts where the data ends, not where the Line 69 in 2d35768
the next thing is also one that is currently consistent, where any kind of interpolation is only between known datapoints within the non-null, non-undefined data range (there is never interpolation outside data points to the left an the right), the blue series follows this uniform behaviors. again, i do see the case for wanting to opt into the different behavior for stepped, so an additional option for the stepped builder might be good to add to opt into interpolating into undefined points (that can result from i know all of this may seem annoyingly pedantic, but i'd like to make sure there is as much consistency as possible. i'll try to see in the next couple weeks how reasonable it is to do what i'm proposing above. (don't feel pressured to do this yourself in this PR) |
i added the |
The new function has been simplified really well. I took a look at the code and played with it a bit. I commented what I noticed.
For me, I prefere the option |
I have some improvements to draw steps!
problem:
If there are null-values at the beginning or end -> the graph hasn't drawn correct on these points.
fix:
Do not manipulate the idx0/idx1 to draw correct
some improvement:
Draw the first and last line always vertical, because it is possible to start or end in the middle of the graph