JuliaPlots / PlotlyJS.jl

Julia library for plotting with plotly.js
Other
418 stars 77 forks source link

plotly.js version is stuck at 1.58.5 rather than 2.2.1 #394

Closed thchr closed 3 years ago

thchr commented 3 years ago

My impression from 256f8f3a615c84f8c89894c3eea7be9eb2e907e3 commit message was that PlotlyJS.jl would now be using plotly.js v2.21 - but it seems it is in fact still using v1.58.5. Specifically, looking at these two lines in /src/PlotlyJS.jl and testing them out (from the PlotlyJS.jl package directory), we see that:

using Pkg.Artifacts
_js_path = joinpath(artifact"plotly-artifacts", "plotly.min.js")
println.(readlines(_js_path )[1:2]);

gives

/**
* plotly.js v1.58.5

and similarly so for

using HTTP
 _js_cdn_path = "https://cdn.plot.ly/plotly-latest.min.js"
println.(readlines(HTTP.download(_js_cdn_path))[1:2])

Of course, this is all on v0.18.0:

(@v1.6) pkg> st PlotlyJS
      Status `C:\Users\tchr\.julia\environments\v1.6\Project.toml`
  [f0f68f2c] PlotlyJS v0.18.0 `C:\Users\tchr\.julia\dev\PlotlyJS`

So, as a practical matter, my PlotlyJS.jl still seems to be using v1.58.5 rather than 2.2.1. I'm not sure if that's because I'm somehow stuck on an old artifact (I checked that the new artifact url definitely points to v2.2.1)? If so, I thought it would've automatically updated. On the other hand, it doesn't seem right that _js_cdn_path still points to v1.58.5?

I stumbled upon this because I was hoping that the new version would include this fix from plotly.js https://github.com/plotly/plotly.js/pull/4140.

jkrimmer commented 3 years ago

Have you already tried reinstalling PlotlyJS? I noticed that you added PlotlyJS as a development package, maybe the installed artifact has not been updated correctly. On my machine, this issue does not occur for the plot shown in the Blink window. Setting up an icicle plot (which to the best of my knowledge has only been introduced with v2), we can verify that the plot in the Blink window uses the recent release:

julia> D = Dict(:type=>"icicle",
           :labels=>["Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"],
           :parents=>["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve" ],
           :values=>[10, 14, 12, 10, 2, 6, 6, 4, 4])
julia> plot(GenericTrace("icicle",D))

However, you brought two issues to my attention:

  1. Is this variable _js_cdn_path in PlotlyJS.jl still needed?
  2. PlotlyBase still defines const PLOTLYJS_VERSION = "1.58.4", so we should find a way to synchronize the versions used in PlotlyJS and PlotlyBase. Consequently, exported HTML-files still use v1.58.4.
thchr commented 3 years ago

Argh, you are right: somehow the artifact was stuck... (I had done several rm->add->up shuffles without success before reporting this - ending up settling up reporting from a deved version - which hadn't worked. Just trying that shuffle again this morning, following your advice, seemed to do it though - although I don't understand why. My dev'ed version is somehow still stuck though - I don't know how to force it to update its artifact?)

Any idea of why an artifact could get stuck like this? I thought they were content-addressed?

I'm glad there were some issues related to this that weren't just a stuck artifact. Point 2 would be especially nice to fix.

sglyon commented 3 years ago

fixed!

we are up to 2.3.0 now :tada:

jkrimmer commented 3 years ago

@thchr : Unfortunately, I do not know how to force update the artifact associated with the dev'ed package. (I do not have a lot of experience in the handling of artifacts). Anyway, I am glad that I was able to help. And sorry for replying late!