JuliaPlots / PlotlyJS.jl

Julia library for plotting with plotly.js
Other
424 stars 78 forks source link

plotly-latest.min.js from artifact not working #369

Closed dralletje closed 3 years ago

dralletje commented 3 years ago

Describe the bug When rendering a plotlyJS plot in html, it will fetch plotly-latest.min.js, which has nonsensical content (see image) This is also what I see when I download and expand the artifact manually. It might be that it is GZIP'ed, and the server that serves it is supposed to figure that out? I'm implementing WebIO in Pluto.jl, didn't test it on Jupyter or anything, but my code worked perfectly before yesterdays release (and switching to v0.14.0 now solves it)

image (This image is more huge than I intended it to be)

versioninfo()

Julia Version 1.6.0-rc1
Commit a58bdd9010 (2021-02-06 15:49 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake-avx512)
Environment:
  JULIA_PATH = /usr/local/julia
  JULIA_GPG = 3673DF529D9049477F76B37566E3C7DC03D6E495
  JULIA_VERSION = 1.6.0-rc1
  JULIA_REVISE_WORKER_ONLY = 1

pkg"status"

[97c1335a] JSExpr v0.5.2
[f0f68f2c] PlotlyJS v0.14.1
[0f1e0344] WebIO v0.8.15
kobussch commented 3 years ago

This comment can maybe point somebody in the right direction and provide a temporary workaround for Windows 10 Home users who cannot get PlotlyJS 0.14.1 working at the moment. I did a fresh install of literally everything after re-installing Windows, but then ran into this blank Electron window issue. If I go back one version to 0.14.0, I get errors when Kaleido is called up, so I am stuck in the middle. I tried out the pull request of #372 but it did not work for me (both Julia 1.5.x and Julia 1.6.0). While playing around with #372 in shared development mode, I stumbled on a temporary workaround. If you revert back to 0.14.0 using git tools in the development repo, followed by a rebuild of PlotlyJS, everything works again. This is a temporary fix though, because it is not advisable to keep the package in development mode indefinitely. For those not familiar with development mode, switch to pkg mode in the REPL and enter ?develop. I can add that on my company laptop with Windows 10 Pro, I also get the blank window problem, but here I had success by just stipulating 0.14.0 when I added PlotlyJS in pkg mode. The develop trick was not necessary in Windows 10 Pro

dralletje commented 3 years ago

For me it always works if I do

] add PlotlyJS@0.14.0
andreasnoack commented 3 years ago

I have a problem that might be similar to this one. With 0.14.1, the plots don't show up in the Electron window. I'm able to save the plots to files, though.

sglyon commented 3 years ago

Thanks everyone for reporting

I’m going to be unable to work on a fix for this for a week or two. I’d be thankful if anyone was able to make a pass at this and would gladly review a pull request.

Thanks!

kobussch commented 3 years ago

My previous comment on the pull request #372 not working was a bit vague. I think the pull request might actually work. From the error messages it looks like the artifact url given in the suggested artifacts.toml is simply not accessible to me. This url is probably something that only the author of the package can set up successfully. The suggested generate_artifacts file looks to be in better shape than the old one. I will try and build my a local artifact using this file and see how it goes from there. This can save Spencer a bit of testing time on the Windows platform.

kobussch commented 3 years ago

I can confirm that #372 works as advertised when used to build a local artifact on a Windows 10 Home PC and probably on all other platforms as well. The artifact url is still broken and must be fixed. Three small issues to point out:

  1. A KDiff check shows every single file changed. That probably means that line-end coding is different.
  2. Artifacts is now available directly from Main and also from inside Pkg. This causes a conflict warning. It should probably stay that way because may users will still be on Julia 1.5.x
  3. In addition to the artifact generation fix, #372 also modified the way that schema information is extracted. I am not familiar with this part of the process, but I can confirm that the generated html is still the same except for one spelling correction.

So thumbs-up from me for #372 and thanks to the contributor. If you want to use this as a temporary fix, be warned that the process of linking to a local artifact as generated from a floating pull request is non-trivial for a casual user, so here is an abbreviated list of steps. Let me know if there is a simpler way:

Keep an eye on the github repo from time to time and when a new version is released, do `Pkg.free("PlotlyJS") to revert back to the mainstream.

sglyon commented 3 years ago

Hi @kobussch thank you for taking a look and writing a great report.

Let's see what we can do to get #372 merged!

el-oso commented 3 years ago

Has this fix been merged to current version? I think that I have the same problem.

ndgnuh commented 3 years ago

Everyone with this problem can just download plotly.min.js from their cdn, replace the plotly.min.js file in the artifact folder with the downloaded one, and it will be just fine.

dhanak commented 3 years ago

@dralletje:

For me it always works if I do

] add PlotlyJS@0.14.0

Sadly, this also stopped working with Julia 1.6 (fresh install or at least fresh depot), because this Julia version builds the dependencies in a separate scratchspace, and PlotlyJS@0.14.0 relies on having an empty build.log file in its deps folder after a successful build. If it is not there, it won't load. A workaround is to touch it manually, but I'm really not happy about either this or the workaround for 0.14.1.