-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Application hangs when plotting lots of NULL values on 2nd Y axis with Line type 'Impulse' #1977
Comments
A workaround for me is to replace NULL values with 0 in a query using |
0 is a valid data point in many curves. |
@sky5walk |
@sky5walk I think you misunderstood my bug report. I've updated the title and I will elaborate. I have essential 3 columns
I wish to see plots for both |
null is not really an appropriate value for any entry. |
I just gave this a quick try and couldn't reproduce it. Is there maybe something else I have to do to make it hang, like sort order, data types, etc.? I do see however how NULL values are rendered in a weird way, it just doesn't seem to affect the performance for me. To make it render correctly we would have to decide what to do with NULL values? Skip them or treat them as 0, make it configurable, or something else altogether? |
We are in fact using NULL in a way expected by our plot library: https://www.qcustomplot.com/documentation/classQCPGraph.html
I think inserting gaps is also the best way to handle those NULL values.
That doesn't match with the expectation. It should produce a gap in the curve. Can you provide a screenshot? Regarding the performance problem, does it help decreasing the "Prefecht block size" in "Preferences > Database", @wrenoud? What is the value of "lots" in "lots of NULL values" 😄 ? Shouldn't matter if replacing them with zeros solve the problem, anyway. Maybe treating those gaps is costly for the plot library. Just guessing. |
With those values, I get this plot (some zoom out applied): Isn't the same for you? |
@mgrojo I get the same plot. However, for another test case with ~2000 rows and about one third of them NULL I get this (there is definitely no value < 10000, so the extra thin line is going nowhere): |
Gaps are requested to QCustomPlot when one of the coordinates of a point is NaN. We were using that feature for the y axis, but not for the x axis where null values where being converted to 0, which makes less sense than making a gap, at least for consistency. See issue #1977
Maybe the problems are with NULL values in X? We are not checking for NULL in that axis and they seem to be translated to 0, probably by toDouble(). I've committed a change that also applies that logic to the x axis. I think both axes should be treated equally, independently of whether we should make the logic configurable, which I'm not sure it would be useful. @MKleusberg and @wrenoud, could you confirm if it gives the expected result with your data, using tomorrow's nightly build? |
Here is an example table that reliably causes the hang for me: https://dbhub.io/wrenoud/asfd.db I select datetime for the X axis, then selecting either count1 or count2 for Y axis is OK, but selection the other column as the second Y axis the app hangs. I also downloaded and installed the nightly and I still experience this. |
That's giving a "doesn't exist" error. It's probably still set to private. If you go into the settings for the database you can set it to public. 😄 |
@mgrojo I saw your comment after posting my comment. I downloaded the 3.11.99 (Aug 27 2019) build, is that the "tomorrow" you're referening to? |
@justinclift, sorry, I thought I had made it public. Should be fixed now. |
Thanks @wrenoud. Yep, it can be grabbed by people now. 😄 |
I just realized the thing I wasn't reporting in the case. My line type was set to |
Thanks, this is critical for scatter plots of any X or Y column. |
Ok, I see now the plot drawing problem setting the Impulse line type. I don't know if we can do something. It seems that in this case the NULL/NaN feature is not implemented in the same way as in the other cases. It's true that a "gap" does not make sense with those line types, so maybe the plot library is not expecting them in those cases.
I don't appreciate the slowness, but it is another hint about not expecting the gaps in this case. We'll have to think what we want to do for this combination. |
Details for the issue
What did you do?
Tried to plot 2 columns on the Y axis, with line type "Impulse", one of which has mostly NULL values. About 300 rows in total
What did you expect to see?
A plot
What did you see instead?
The application hangs for a long time. It ultimately plots, but NULL values appear to be infinite vertical lines and any redraw (zoom/pan) hangs again.
Useful extra information
The info below often helps, please fill it out if you're able to. :)
What operating system are you using?
What is your DB4S version?
Did you also
The text was updated successfully, but these errors were encountered: