-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
scattergl lines sometimes draws random lines on some hardware #3522
Comments
Thanks very much for the report! Your https://codepen.io/anon/pen/qgpbKq codepen render as on my thinkpad t450s running Ubuntu 18.04 both in Chrome 70 and FF65. Can anyone else try out https://codepen.io/anon/pen/qgpbKq ? |
Yea sometimes it renders properly for me as well - did you run it multiple times? |
I cannot reproduce - Mac OS 10.14.2, latest Chrome or FF, retina or non-retina screen, Intel Iris Graphics 6100, run a few dozen times. Only environment difference I see is Nvidia vs Intel graphics... |
Thank you @etpinard, @alexcjohnson for trying out that codepen... this is indeed turning into a fun issue to debug! :) But! We have another codepen: https://codepen.io/dsmmcken/pen/EroNrQ And this time, my coworkers on macOS can also reproduce the issue. Two others on Linux were unable to reproduce, and just see a straight line. Can anybody see the issue with the new code pen? |
Curiouser and curiouser... I cannot reproduce with the new codepen either. That said on my iPhone no traces are rendered at all in either codepen (iPhone 8, iOS 12.1). That seems like an even bigger problem... |
I cannot reproduce on a ubuntu machine, but my imac does it 100% of the time. |
Would someone here be interested in trying to reproduce the problem using just @dy's |
I can try that out, but I think I should try it in regl-line2d, as I'm not seeing the issue on scatter plots. I only see it when Is there a codepen for |
@mofojed thanks! Maybe you could try starting from https://codepen.io/etpinard/pen/EroXXd?editors=1010 |
@etpinard Thanks, I can reproduce the issue on regl-line2d (see line on the right side, thicker than the rest and in a weird direction): I couldn't use the same data set as the second example (since it had date strings for the x axis), but I could reproduce on my machine using the same random data as the first code pen. Codepen here: https://codepen.io/anon/pen/yZpXZE?editors=1010 |
@archmoj could you take 👁️ at this? |
I was not able to reproduce this using the codepen examples. |
This is a tricky one... it's only reproducible on certain hardware... so far it's only been observed on Macs, and even with the same data set/layout on Windows it's not an issue, and on different Macs sometimes the issue is more/less noticeable. What's the best way for getting you the information you need? What platform are you on? |
I develop on GNU+Ubuntu. But we could test on different operating systems. |
Okay, I've created this codepen that has 500 data points, and I'm seeing one line being drawn randomly across the chart: https://codepen.io/anon/pen/mvZjeM I tried reducing to 250 points, but the issue was no longer observed. This is a reduced version version of the one example codepen with 1000 data points, which had many lines drawn incorrectly: https://codepen.io/dsmmcken/pen/EroNrQ Issue observed in both FireFox and Chrome on my Mac, some info from Chrome:
Let me know if there's any other information I can provide. |
Actually I've figured out how to reproduce with a dataset of only 100 points: https://codepen.io/anon/pen/omrMdw If I execute that codepen, and then zoom out (using the zoom out button) 4 or 5 times, then I start getting random lines drawn: |
@mofojed Thanks for the feedback. |
(You @'ed the wrong person, I'm @mofojed, not sure who mojoaxel is :)) I am seeing the same behaviour in the new codepen with just the |
@mofojed I noticed there are duplicate data points in the codepen you provided. For example points number 2 and 3 have identical x and y values. Would you please remove them from the list and then redo the test. Thanks again. |
@archmoj I was unable to reproduce with those date tests when I removed the duplicate values - shouldn't that appear correctly anyway, even with duplicated values? I was able to still reproduce by capturing one instance of 100 data points randomly generated from my first codepen. This has no duplicate x/y values. I've put the new codepen here: https://codepen.io/anon/pen/yZdGaO |
@mofojed Excellent investigation. Thank you! |
I had tried to reproduce on ubuntu and was not able to. I even tried to get the graphical / hardware settings on a mac that could 100% reproduce to match the ubuntu machine that couldn't, and it changed nothing. Mac rendered the messed up graph 100%, ubuntu, 0%. |
Has there been any investigation into this issue? I'm still observing it, wondering if there's anything I can do to help. At this point we simply cannot use |
since this issue seems stalled, i'll plug an alternative here (benched against |
@leeoniya that would be interesting to bench that against raw components that plotly uses:
Also please consider that line chart in plotly is not limited to time series, it can render arbitrary lines. Anyways that's offtopic. |
as i mention in the uPlot intro, WebGL should still be used for realtime waveforms. i'll add these two libs as additional alternatives. that being said, i think that any shaders offering features equivalent to the style & flexibility of Canvas2D API would be extremely non-trivial. this might not matter for signal/waveform display but it matters a lot for generating charts. uPlot can do 10M points in ~400ms (i5, integrated gpu), while that's not much compared to raw webgl, it is an amount of data you'd be hard-pressed to load from a data-store into a browser. uPlot also does auto-scaling by default & data gap detection in the hot paths (which imposes a ~20% perf cost). as with everything: trade-offs. you're welcome to bench these libs against uPlot's dataset, and there's no doubt they'd be faster in raw render perf, but then you have to add in all the other features such as cursor interaction, gap detection, tick & text label generation, date formatting, timezone/dst support, axis splitting, legend rendering, etc. (much of this on the CPU side) before you're comparing apples-to-apples.
yes, technically what it does is scatter, but arbitrary lines rarely appear on scatter and are primarily a trendline / time-series thing and are x-aligned 90% of the time. i do have true scatter support in the works though [1] ;) |
I'm still seeing the same issue with this codepen even if I update the CDN to 1.54.2: https://codepen.io/mofojed/pen/GRoEjZa |
This issue has been tagged with A community PR for this feature would certainly be welcome, but our experience is deeper features like this are difficult to complete without the Plotly maintainers leading the effort. Sponsorship range: $5k-$10k What Sponsorship includes:
Please include the link to this issue when contacting us to discuss. |
@darynwhite that looks exactly like another issue raised, for which there is a workaround in Chrome: #5970 (comment) Basically OpenGL on M1 Macs has issues, but forcing Chrome to use Metal instead resolves the issue. |
Thanks @mofojed! That did solve the problem, too bad there isn't a way to disable OpenGL all together... |
@darynwhite FYI Looks like this may have been fixed with plotly 2.28: #6820 |
Thanks @darynwhite for the note. |
- v2.28 had some fixes for M1 macs, including for the scattergl issue we've fallen back to scatter for in the past - Did not resolve the range breaks issue, so that still requires `scatter` type - See plotly/plotly.js#3522 for more details - Needed to uninstall plotly, then reinstall it - until I did, line plots were not appearing correctly in `scattergl` mode - Did `npm uninstall react-plotly.js --workspace packages/chart` and `npm uninstall react-plotly.js --workspace packages/chart` followed by `npm install plotly.js --workspace packages/chart` and `npm install react-plotly.js --workspace packages/chart` - Tested on Linux desktop and M1 mac, ensured plots were appearing correctly. Will verify e2e tests as well - ScatterGL seems to render things _slightly_ differently, so snapshots needed to be updated for a couple plots
I've posted this in the forum: https://community.plot.ly/t/scattergl-causes-strange-lines-to-be-drawn/19189
After investigating a bit further, I'm filing a bug/issue here.
The issue is that when the
type
is set toscattergl
, sometime the plot will draw random lines extending across the plot. It doesn't seem to happen every time, but I can see it consistently on the example with many points: https://plot.ly/python/webgl-vs-svg/It seems to be dependent on the size of the chart, if I resize my browser window and refresh that example, sometimes the lines appear, sometimes they don't, but it's consistent for that size of my browser window.
I've added a codepen to randomly draw lines, and if I run it a few times, then I run into the issue: https://codepen.io/anon/pen/qgpbKq
For example, one time after running there was as red/blue line across the entire graph:
I would provide the exact data set, but as mentioned at the top, it seems to be dependent on the size of the window/plot being drawn (and possibly other factors?), but you should see the error if you run the code pen a few times.
Any idea what could be causing this?
scattergl
is great for the performance improvements, but looks broken when it's drawing random lines across the whole plot.Issue observed in both Chrome/FireFox, some more details:
The text was updated successfully, but these errors were encountered: