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

Firefox still breaks LaTeX rendering #6553

Closed
moble opened this issue Apr 6, 2023 · 3 comments
Closed

Firefox still breaks LaTeX rendering #6553

moble opened this issue Apr 6, 2023 · 3 comments

Comments

@moble
Copy link

moble commented Apr 6, 2023

Using Firefox 111.0.1 — the most recent as of this writing — LaTeX rendering still fails to set the box size correctly. (I first tried this through the Julia interface, then Python, and now Javascript since that's the (descending) order in which I know those languages; the issue is the same in all.)

There seems to have been an attempted fix in this PR, but I guess it doesn't work now. In fact, that PR appears to have been incorporated into plotly-2.6.0, but even if I load that version it doesn't seem to work. That PR suggested that it would be a workaround for #5374.

Here is a codepen test of the (correctly escaped) example from the documentation, along with what the relevant part looks like in Chrome

ChromeRendering

and what it looks like in Firefox

FirefoxRendering

Note that the legend entries get cut off in Firefox. Looking at the source in Developer Tools, the full expressions are in there. In fact, I can extract the svg elements, add an xmlns, and view the expressions on their own, and they render properly in Firefox. So it evidently is a problem with the g containing the svg.

Is there at least a workaround? I tried adjusting layout.legend.entrywidth, but that didn't seem to have any effect.

@bmaranville
Copy link
Contributor

bmaranville commented Apr 7, 2023

element.getBoundingClientRect() is returning bad values in Firefox, for the outer group. It seems like there have been issues over the years with getBoundingClientRect - see e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=1350755

It seems like element.getBBox returns reasonable values in both Firefox and Chrome, though it seems like there is a preference to use getBoundingClientRect in the plotly codebase.

(I think things are going wrong here:

var testRect = testNode.getBoundingClientRect();
)

@moble
Copy link
Author

moble commented Apr 17, 2023

Maybe there could be some browser detection that computes testRect in a way that works on Firefox???

@moble
Copy link
Author

moble commented Sep 11, 2023

This appears to have been resolved.

@moble moble closed this as completed Sep 11, 2023
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