Skip to content

LaTeX/MathJax broken using Firefox v82.0 #5374

Description

@MRScheid

Hi Plotly team, I just recently updated my firefox browser to version 84.0.1 and have been using plotly's (v4.14.1) subplots in Jupyter notebook (v6.0.3) with Python (v3.7.6) for a couple months now without issue. I noticed that with this new version of the browser when I call something like:

from plotly.subplots import make_subplots

fig = make_subplots(1, 3, subplot_titles=[1, 2, 3])
fig['layout'].update(width=1200, height=1200)
fig.add_trace(go.Scatter(x=[1 , 2 , 3], 
                             y=[1 , 2 , 3], 
                             name='$123$',
                            ),
                  row=1,
                  col=1
                 )

fig.add_trace(go.Scatter(x=[1 , 2 , 3], 
                         y=[1 , 2 , 3], 
                        ),
                  row=1,
                  col=2
                 )

fig.show()

The figures do not render properly and when I try to toggle the traces by clicking on the legend, all of the plots shrink and are illegible. This issue seems to be caused whenever I add Latex to the legend str using the name argument in go.Scatter while ALSO using the update command to manually set the width and height of the figure. If I do only one or the other, the behavior seems to go back to normal. It also seems to be unique to Firefox, as I did not have an issue with Chrome when I tested this with the same environment. Hoping this is enough information to create a reproducible example and solve this issue.

Activity

  1. alexcjohnson commented on Jan 6, 2021

    @alexcjohnson
    Collaborator

    Thanks @MRScheid - confirmed with FF84 on my Mac, at for example https://plotly.github.io/LaTeX-basics/

    It looks like the LaTeX renders, but has some sort of bounding box error.

  2. changed the title [-]Subplots not rendering correctly with latex in legend string using Firefox v84.0.1[/-] [+]LaTeX/MathJax broken using Firefox v84.0.1[/+] on Jan 11, 2021
  3. jaladh-singhal commented on Jan 28, 2021

    @jaladh-singhal

    @alexcjohnson when can we expect this to be fixed?

  4. nicolaskruchten commented on Jan 28, 2021

    @nicolaskruchten
    Contributor

    We'll try to fix it in the coming weeks but we'd sure appreciate some help!

  5. self-assigned this
    on Jan 29, 2021
  6. antoinerg commented on Jan 29, 2021

    @antoinerg
    Contributor

    On Firefox 84.0.2, I noticed that the latest version of MathJax 2.x (2.7.9) behaves very differently from the one checked into our repo (2.3). Based on this, I'm not sure there will be one solution that will work for both MathJax versions.

    For example, using my tentative fix, I get this on 2.7.9:
    newplot(4)

    But on 2.3 I get:
    newplot(3)

    On the other hand, Chromium renders the correct result for both MathJax versions.

    Would a fix only targeting MathJax 2.7.9 be good enough @alexcjohnson ?

  7. antoinerg commented on Jan 29, 2021

    @antoinerg
    Contributor

    For reference, this is what the very same mock looks like in Firefox 84.0.2 on Linux on master branch:
    newplot(2)

  8. alexcjohnson commented on Jan 29, 2021

    @alexcjohnson
    Collaborator

    We can certainly upgrade to 2.7.9 and drop 2.3, especially if we can get this into our v2 release. In fact in a perfect world we'd upgrade to MathJax v3 in plotly.js v2, but I assume that'll be more than a one-afternoon change, so not something we can do right now.

  9. antoinerg commented on Feb 9, 2021

    @antoinerg
    Contributor

    Ok, so I'll try to come up with a patch to fix the issue in MathJax 2.7.x!

  10. maresb commented on May 21, 2021

    @maresb

    Is there any known workaround, or is LaTeX in Plotly just plain broken for all recent Firefox versions?

  11. vvch commented on Jul 18, 2021

    @vvch

    Jan 28> We'll try to fix it in the coming weeks

    Is there any progress in half a year? Did there some serious difficulties appear?
    I think this bug deserves high priority since it makes many existing services based on Plotly unusable.

  12. nicolaskruchten commented on Jul 18, 2021

    @nicolaskruchten
    Contributor

    We did spend some time on this in February but ran into problems around MathJax versions so we put this aside until 2.0 was released (done last month!) wherein we committed to supporting MathJax 2.7.5 moving forward, and we also upgraded our testing infrastructure. Unfortunately, no one on our staff is available to fix this issue for the next couple of months at least, so we'd really appreciate some assistance if someone from the community wanted to step in an help out :)

  13. changed the title [-]LaTeX/MathJax broken using Firefox v84.0.1[/-] [+]LaTeX/MathJax broken using Firefox v82.0[/+] on Sep 30, 2021
  14. archmoj commented on Sep 30, 2021

    @archmoj
    Contributor

    It appears the first version of Firefox causing this issue was v82.0 therefore I renamed the title.

  15. archmoj commented on Sep 30, 2021

    @archmoj
    Contributor

    Firefox releases are here.

  16. archmoj commented on Oct 9, 2021

    @archmoj
    Contributor

    I was able to replicate the bug on Ubuntu using 82.0 <= Firefox <= 93.0.

  17. archmoj commented on Oct 9, 2021

    @archmoj
    Contributor

    Something strange is going on with overflow here:

    .style({overflow: 'visible', 'pointer-events': 'none'});

  18. LunarLanding commented on Oct 18, 2021

    @LunarLanding

    Edge works, firefox does not:

    import plotly.graph_objects as go
    f=go.Figure()
    
    f.update_yaxes(title=dict(text="$log_{10}(D)$", font_size=16))
    
    f.show()

    JupyterLab: 3.2.0
    MathJax: 2.7.9
    Plotly: 5.3.1
    Firefox: 93.0
    Edge: 94.0.992.50

  19. archmoj commented on Oct 19, 2021

    @archmoj
    Contributor

    It is likely related to this Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1709251

  20. removed their assignment
    on Oct 19, 2021
  21. gvwilson commented on Jun 26, 2024

    @gvwilson
    Contributor

    Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions