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

Fix resizing pie like traces when textinfo is set to "none" #6893

Merged
merged 3 commits into from
Mar 6, 2024
Merged

Fix resizing pie like traces when textinfo is set to "none" #6893

merged 3 commits into from
Mar 6, 2024

Conversation

robbtraister
Copy link
Contributor

If textinfo==="none", the textposition coercion is skipped for both funnelarea and pie traces. However, there is a place in the plot render logic that assumes textposition is defined and is skipped iff textposition==="none" (https://github.com/plotly/plotly.js/blob/master/src/traces/pie/plot.js#L136).

Since the coercion is not enforced and textposition is undefined (not "none"), related text objects which have not been initialized are attempted to be accessed resulting in a null pointer exception (https://github.com/plotly/plotly.js/blob/master/src/traces/pie/plot.js#L511).

I am open to alternative solutions that may include a textinfo==="none" check in the plot render logic, but this approach seemed to be the most comprehensive.

Reproduction example: https://github.com/robbtraister/plotly-npe

@robbtraister robbtraister marked this pull request as ready for review February 12, 2024 17:42
@archmoj archmoj added bug something broken community community contribution status: reviewable labels Feb 14, 2024
@archmoj
Copy link
Contributor

archmoj commented Mar 6, 2024

I was not able able to replicate the bug on this codepen.
Please feel free to open a bug report or reopen this pull request, in case you hit it again.
Thank you!

@archmoj archmoj closed this Mar 6, 2024
@archmoj archmoj removed bug something broken status: reviewable labels Mar 6, 2024
@robbtraister
Copy link
Contributor Author

@archmoj as I described in the repro repo, you have to mouseover the plot first, then attempt to resize.

Kapture 2024-03-06 at 13 49 49

@robbtraister
Copy link
Contributor Author

robbtraister commented Mar 6, 2024

I do not have permission to reopen this pull request

@archmoj archmoj reopened this Mar 6, 2024
@archmoj archmoj added bug something broken status: reviewable labels Mar 6, 2024
@archmoj
Copy link
Contributor

archmoj commented Mar 6, 2024

@archmoj as I described in the repro repo, you have to mouseover the plot first, then attempt to resize.

Kapture 2024-03-06 at 13 49 49 Kapture 2024-03-06 at 13 49 49

Thanks very much for clear bug report. 🙏
Let me have a second look. I would try to include the fix in the next plotly.js minor possibly today.

@archmoj archmoj changed the title coerce textposition if textinfo is "none" Fix resizing pie like traces when textinfo is set to "none" Mar 6, 2024
@archmoj
Copy link
Contributor

archmoj commented Mar 6, 2024

Thanks very much for this PR.
💃

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

Successfully merging this pull request may close these issues.

2 participants