plotly.js icon indicating copy to clipboard operation
plotly.js copied to clipboard

scattergl markers rendering incorrectly with time series data

Open nickmzero opened this issue 4 years ago • 6 comments

Noticing some unexpected behavior with time series data using scattergl. The markers are rendering off the lines at seemingly regular intervals: (this example has ~800k points) Screen Shot 2021-10-04 at 1 55 48 PM

Reproducible example shows scatter and scattergl side-by-side with the same date values: https://codepen.io/nickmzero/pen/KKqLOGv Screen Shot 2021-10-04 at 2 10 18 PM

After briefly playing around with the dates in the codepen, it seems like the markers fail to correctly render on the line unless there's a day between points.

nickmzero avatar Oct 04 '21 19:10 nickmzero

We have started to see this same behaviour on all browsers for certain MacBooks using the M1 chip. A particular setup we have that exhibits this behaviour is a MacBook Air, OS Monterey 12.3.1, M1 chip. It has also been seen on OS 12.3.2 and 12.4.

The scatter plots render fine, but the markers in scattergl plots render vertically.

This appears to be the same issue reported in the community forums:

  • https://community.plotly.com/t/webgl-scatter-plots-not-rendering-on-new-m1-mac-in-chrome-or-safari/61397
  • https://community.plotly.com/t/plotly-fails-when-using-scattergl-and-value-greater-than-2-24-only-on-m1-chip/61927

The issue presents itself for scattergl plots with x-axis values greater than 2^24 (e.g. date values) And can be confirmed by the following example: https://codepen.io/alanjmac/pen/jOzbMVw

Scattergl_Issue_MacM1

(Edit: I noticed that https://cdn.plot.ly/plotly-latest.js currently points to "plotly.js v1.58.5" so I have updated the codepen to use https://cdn.plot.ly/plotly-2.12.1.js instead - issue is still seen).

AlanJMac avatar Jul 04 '22 15:07 AlanJMac

Has this been resolved? Is there any plan to address it?

chipkent avatar Apr 24 '23 14:04 chipkent

For me this is also a quite big problem. Is there any idea how to fix this or maybe a workaround ?

jklimke avatar May 15 '23 15:05 jklimke

I'm not sure if there is a fix (I tried but it was beyond me) however the following workaround works for me in Chrome:

  • in Chrome browser, navigate to chrome://flags/ and search for "ANGLE graphics backend". From the dropdown box select "Metal". (Apparently Open GL has been deprecated in Mac and may contain driver bugs). image

  • in Chrome versions >= 109.0.5414.xx, ensure hardware acceleration is enabled: Go to Settings => System and toggle on "Use hardware acceleration when available". In earlier versions, an alternative workaround was to toggle this to off.

I was unable to find a similar workaround for Firefox.

AlanJMac avatar May 17 '23 08:05 AlanJMac

has anybody got a workaround for this? seems like plotly doesn't plan to fix this.. do I need to refactor with a different library to handle users on newer macs?

sqlAlchemyNoob2004 avatar Oct 05 '23 21:10 sqlAlchemyNoob2004

I can confirm this issue appears to be fixed with the latest plotly.js 2.28.0 release! Many thanks for the solution!

Fix scattergl rendering bug on M1 mac devices [https://github.com/plotly/plotly.js/pull/6830], with thanks to @justinjhendrick for the contribution!

Details of the problem + fix can be found in the similar reported issue: https://github.com/plotly/plotly.js/issues/6820

AlanJMac avatar Jan 08 '24 09:01 AlanJMac