Skip to content
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

Duplicated incorrect lines in html and svg output #6404

Closed
ghost opened this issue Dec 16, 2022 · 5 comments
Closed

Duplicated incorrect lines in html and svg output #6404

ghost opened this issue Dec 16, 2022 · 5 comments

Comments

@ghost
Copy link

ghost commented Dec 16, 2022

We noticed a big problem with svg rendering that happens on rare occasions.

Sometimes when writing a chart with many nan values to html, it will create phantom lines. They will be lines that exist in the chart but duplicated and placed in the wrong place. This doesn't happen if you .show() the chart in a jupyter notebook, only when you write to html (and I guess by extension also effects static chart export).

I have attached two charts. One shows the phantom lines in the middle of the chart (the line being a duplicate of a line that is just to the left of it). The other shows the correct chart.

image

The correct one. The only difference between this chart and the one above is that this one uses Scattergl instead of Scatter, so likely a problem with how svg rendering works.

AB Industrivärden (publ) Per Share Fundamentals

This is kind of a terrifying error because you never know when it might strike!

I am unable to give a min. reproducible example, except to say its a Scatter(mode='lines') with many np.nan values that seem to split the line into many svg line segments (which it somehow gets wrong). we 'fixed' it by using Scattergl (in case anyone else on here runs across it in the future).

@alexcjohnson
Copy link
Contributor

Terrifying indeed! But even if you can’t give a minimal example, are you able to share the code for this exact chart?

@alexcjohnson
Copy link
Contributor

@vp-walter shared the figure JSON with me off-thread, as it's a large file (thank you!). I see the problem even in the original interactive view, particularly if I pan:
phantom_segments
@archmoj I'll move this issue to plotly.js and share the figure with you separately - not for the upcoming release, but let's try and tackle this soon after in the new year.

@alexcjohnson alexcjohnson transferred this issue from plotly/plotly.py Dec 16, 2022
@dbuezas
Copy link

dbuezas commented Dec 20, 2022

This looks related to #6407
I left a minimalistic way of reproducing it there.

@alexcjohnson
Copy link
Contributor

@vp-walter does this problem go away if you downgrade to v2.14.0? If so it's probably indeed the same problem as #6407.

@alexcjohnson
Copy link
Contributor

I'm going to assume #6429 fixes this one as well, if you're still seeing this problem with plotly.js v2.18 please reopen or make a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants