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

empty plot with plotly in Firefox on Windows #1138

Closed
joa-quim opened this issue Oct 6, 2017 · 19 comments
Closed

empty plot with plotly in Firefox on Windows #1138

joa-quim opened this issue Oct 6, 2017 · 19 comments

Comments

@joa-quim
Copy link

joa-quim commented Oct 6, 2017

Just trying to reproduce the first example in tutorial (and explicitly setting plotly() backend)

using Plots

julia> x = 1:10; y = rand(10); plotly()
Plots.PlotlyBackend()
julia> plot(x,y)

opens an empty page in Firefox (my default browser). Win10 here.

@ChrisRackauckas
Copy link
Member

Chrome works for me, but when I set Firefox as the default it is empty as well.

@ChrisRackauckas
Copy link
Member

Works in Edge and IE. I'd call this Firefox-specific.

@ChrisRackauckas ChrisRackauckas changed the title empty plot with plotly empty plot with plotly in Firefox Oct 6, 2017
@joa-quim
Copy link
Author

joa-quim commented Oct 6, 2017

Sorry, my bad. I have no Plotly installed (Pkg.status() doesn't show it) but run plotly() it responds as if it was.

@ChrisRackauckas
Copy link
Member

Plots.jl doesn't use the Plotly.jl package by default. It directly downloads the Plotly Javascript and builds browser pages from that. You can say that it's the one backend that's built into Plots.jl because of that.

@mkborregaard
Copy link
Member

Works great in Firefox on Mac. It appears to be an issue with the particular combination Plots, Plotly, Firefox and Windows 10 😱

@daschw
Copy link
Member

daschw commented Oct 6, 2017

It also works on Linux and Firefox.

@daschw
Copy link
Member

daschw commented Oct 6, 2017

It does not work on Firefox and Windows 7.

@daschw daschw changed the title empty plot with plotly in Firefox empty plot with plotly in Firefox on Windows Oct 6, 2017
@tpoisot
Copy link

tpoisot commented Oct 6, 2017

Can it be an issue with the firefox version? Works on 56 (on Linux) for me. @joa-quim what version are you using?

@joa-quim
Copy link
Author

joa-quim commented Oct 6, 2017

Was 55 but is the same with the just updated 56. They are 32 bits versions though, maybe that?

@ChrisRackauckas
Copy link
Member

My Windows is 64-bit running an older version of Firefox, so I would be surprised if it's also 32-bit that's an issue.

I think the next thing to check is whether the developer console in Firefox is throwing an error.

@joa-quim
Copy link
Author

joa-quim commented Oct 7, 2017

OK, the console shows this.

Loading failed for the <script> with source “c:\j\.julia\v0.6\Plots\src\backends\..\..\deps\plotly-latest.min.js”.  jl_D12F.tmp.html:5
ReferenceError: Plotly is not defined[Learn More]  jl_D12F.tmp.html:11:5
The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.

@mkborregaard
Copy link
Member

@joa-quim would you mind trying to use Plotly.jl in the same browser? It'd be nice to know if this is an issue with our setup.

@joa-quim
Copy link
Author

joa-quim commented Oct 7, 2017

Hmm, got these errors while Pkg.add("Plotly")

LoadError: LoadError: MethodError: Cannot `convert` an object of type String to an object of type __anon__.PlotlyJSSchemaDocsGenerator.SchemaAttribute
This may have arisen from a call to the constructor __anon__.PlotlyJSSchemaDocsGenerator.SchemaAttribute(...),
since type constructors fall back to convert methods.
while loading c:\j\.julia\v0.6\PlotlyJS\deps\make_schema_docs.jl, in expression starting on line 227
while loading c:\j\.julia\v0.6\PlotlyJS\deps\build.jl, in expression starting on line 6

=============================================================================================================================================================ERROR: UndefVarError: __anon__ not defined
julia> versioninfo()
Julia Version 0.6.0
Commit 903644385b* (2017-06-19 13:05 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, haswell)

@DrBones
Copy link

DrBones commented Oct 26, 2017

Same here, Firefox shows empty window with the console outputting "ReferenceError: Plotly is not defined". Chrome works fine

Windows 10, Firefox Quantum 57.0b11 (64-bit)

P.S.: The install of Pkg.add("Plotly") fails with the same error as for @joa-quim. Otherwise identical versions.

@hessammehr
Copy link
Contributor

hessammehr commented Nov 3, 2017

Same problem here. I fixed it by prepending file:// to the plotly.js file location in the generated HTML, e.g., in @joa-quim's case above:

file://c:\j\.julia\v0.6\Plots\src\backends\..\..\deps\plotly-latest.min.js”

Then it works just fine in Firefox, IE and Chrome. If people could try this out on Mac and Linux I could have a make a PR ready to fix this soon.

@daschw
Copy link
Member

daschw commented Nov 4, 2017

@hessammehr if you show me exactly what you changed in the code, I can test it on linux. Alternatively you could just open a PR and we can test and discuss this there.

hessammehr added a commit to hessammehr/Plots.jl that referenced this issue Nov 4, 2017
@hessammehr
Copy link
Contributor

hessammehr commented Nov 4, 2017

@daschw here's how I tested the PR:

using Plots
plotly()

p = plot([1, 2, 3])
open("out.html", "w") do f
    show(f, MIME("text/html"), p)
end

Works fine on Firefox/Chrome/IE/Edge on Windows.

@hessammehr
Copy link
Contributor

Just tested this on Linux (Firefox and Chromium) and Mac (Firefox, Chrome, Safari) - seems to work fine there as well.

mkborregaard added a commit that referenced this issue Nov 13, 2017
@shahzeb1
Copy link

shahzeb1 commented Aug 23, 2018

If this helps anyone: I had to disable the HTTPS EVERYWHERE extension in Firefox to get the Plotly <script> to be loaded. This fixed it for me.

And also, I had to stop using Jupyter Lab and switch the classical Notebook mode in order to get it to work.

@t-bltg t-bltg closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2022
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

9 participants