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

axes range not working. Range is +-1, data is 0->1.6e10

Open 28raining opened this issue 1 year ago • 3 comments

codepen

there should be 2 points visible in that plot, but there are none. Comment out the range to see the 3 points

28raining avatar Feb 14 '24 16:02 28raining

Thanks @28raining - I see 2 points, for you it's just blank? Screenshot 2024-02-14 at 21 33 46 What browser/version/OS are you on? @archmoj what does it look like for you?

alexcjohnson avatar Feb 15 '24 02:02 alexcjohnson

ha, you are right! It only doesn't work in Safari.

Chrome: image

Safari: image

Safari Version 17.3 (19617.2.4.11.8), Intel MacOs 14.3

28raining avatar Feb 15 '24 18:02 28raining

Ah! Yep, missing for me too in Safari. Even weirder, when I start dragging one of the ends of the axis, very often the points appear, then they disappear again on mouseup, until I get to a range of ~500 then they stay visible.

So feels to me like this is a bug in Safari's SVG rendering engine, some optimization when the total coordinate range on the plot is very large (the off-screen point is translated up 2159999999865 pixels!) that it stops doing when things get more complicated (in this case, while dragging the end of the axis we apply a scale transform to the points).

We could try to work around this bug by restricting the number of pixels we'll try to shift; that should be fine for markers, but we'll have to be careful if we do this for lines, so that they keep the correct angle while shooting off-screen, so we'd need to constrain x and y together in a smart way.

alexcjohnson avatar Feb 15 '24 20:02 alexcjohnson