JuliaPlots / PlotlyJS.jl

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

Blink Display error #170

Closed rand5 closed 6 years ago

rand5 commented 6 years ago

When I try to display a plot via ElectronPlot I am getting an error message in a pop-up window. Here is a MWE:

pl = plot(scatter(;y=rand(4)))
_p = ElectronPlot(pl)
display(_p)

image

I checked out the master of PlotlyJS and updated Rsvg.jl and Blink.jl but these had no impact.

sglyon commented 6 years ago

Hmm. That's not good.

How are you running this code? Meaning is it at the Julia real inside your command prompt, from a jupyter notebook, inside Atom/Juno, inside VS Code, etc.?

rand5 commented 6 years ago

I am running it inside a jupyter notebook. Julia 0.6.1

sglyon commented 6 years ago

Can you get your example to work from the REPL inside your command prompt?

(Sorry vicarious debugging to see where the issue might be)

rand5 commented 6 years ago

Just tried it in the command prompt and got an error after running the following:

using PlotlyJS
pl=plot(scatter(;y=rand(4)))

image

rand5 commented 6 years ago

In the command prompt I get App threw an error when running [SyntaxError: Unexpected token {]

sglyon commented 6 years ago

Can you try Pkg.build("PlotlyJS") to ensure that you are using the latest version of the plotly.js javascript?

rand5 commented 6 years ago

Just tried this:

image

and got the same pop-up with error message

sglyon commented 6 years ago

Ok, let's check versions of packages.

What does Pkg.status() return?

rand5 commented 6 years ago
21 required packages:
 - CSV                           0.2.1
 - Cascadia                      0.2.0
 - Combinatorics                 0.5.0
 - Dierckx                       0.3.0
 - Distances                     0.5.0
 - Distributions                 0.15.0
 - GeometryTypes                 0.4.4
 - Gumbo                         0.4.0
 - HypothesisTests               0.6.0
 - IJulia                        1.6.2
 - ImageMagick                   0.5.0
 - Images                        0.12.0
 - Interact                      0.6.3
 - NLopt                         0.3.6
 - PackageCompiler               0.2.0
 - PlotlyJS                      0.9.0+             master
 - Plots                         0.15.0
 - PyPlot                        2.3.2
 - Reactive                      0.6.0
 - Requests                      0.5.1
 - Rsvg                          0.2.0
122 additional packages:
 - AbstractFFTs                  0.2.1
 - AbstractNumbers               0.1.1
 - AbstractTrees                 0.1.0
 - AxisAlgorithms                0.2.0
 - AxisArrays                    0.2.0
 - BinDeps                       0.8.6
 - Blink                         0.6.0
 - BufferedStreams               0.3.3
 - Cairo                         0.4.0
 - Calculus                      0.2.2
 - CatIndices                    0.1.0
 - CategoricalArrays             0.3.3
 - CodecZlib                     0.4.2
 - Codecs                        0.4.0
 - ColorBrewer                   0.3.1
 - ColorTypes                    0.6.6
 - ColorVectorSpace              0.5.2
 - Colors                        0.8.2
 - CommonSubexpressions          0.0.1
 - Compat                        0.50.0
 - ComputationalResources        0.2.0
 - Conda                         0.7.1
 - Contour                       0.4.0
 - CoordinateTransformations     0.4.1
 - CustomUnitRanges              0.1.0
 - DataFrames                    0.11.5
 - DataStreams                   0.3.4
 - DataStructures                0.7.4
 - DiffResults                   0.0.3
 - DiffRules                     0.0.3
 - DocStringExtensions           0.4.3
 - DualNumbers                   0.3.0
 - FFTViews                      0.1.0
 - FFTW                          0.0.4
 - FileIO                        0.6.1
 - FixedPointNumbers             0.4.3
 - Fontconfig                    0.1.1
 - ForwardDiff                   0.7.3
 - FreeType                      1.3.0
 - FreeTypeAbstraction           0.1.0
 - GLAbstraction                 0.6.1              master
 - GLFW                          1.5.0
 - GLVisualize                   0.6.1+             master
 - GLWindow                      0.7.1
 - Graphics                      0.2.0
 - Gtk                           0.13.1
 - Hiccup                        0.1.1
 - HttpCommon                    0.4.0
 - HttpParser                    0.3.0
 - HttpServer                    0.2.0
 - IdentityRanges                0.1.0
 - ImageAxes                     0.4.0
 - ImageCore                     0.5.0
 - ImageFiltering                0.2.3
 - ImageMetadata                 0.4.0
 - ImageMorphology               0.0.2
 - ImageTransformations          0.4.1
 - IndirectArrays                0.3.0
 - Interpolations                0.7.3
 - IntervalSets                  0.1.1
 - IterTools                     0.2.1
 - JSON                          0.16.4
 - Juno                          0.4.0
 - LaTeXStrings                  0.3.0
 - Lazy                          0.12.0
 - LibExpat                      0.4.1
 - Libz                          0.2.4
 - MacroTools                    0.4.0
 - Makie                         0.0.0-             master (unregistered)
 - MappedArrays                  0.0.7
 - MathProgBase                  0.7.0
 - MbedTLS                       0.5.5
 - Measures                      0.1.0
 - Media                         0.3.0
 - MeshIO                        0.1.2
 - Missings                      0.2.5
 - ModernGL                      0.2.1
 - Mustache                      0.3.0
 - Mux                           0.2.3
 - NaNMath                       0.3.0
 - NamedTuples                   4.0.0
 - Nullables                     0.0.3
 - OffsetArrays                  0.4.2
 - PDMats                        0.8.0
 - Packing                       0.1.0
 - PaddedViews                   0.2.0
 - PlotThemes                    0.2.0
 - PlotUtils                     0.4.4
 - Polynomials                   0.2.1
 - PyCall                        1.15.0
 - QuadGK                        0.2.0
 - Quaternions                   0.3.0
 - RangeArrays                   0.2.0
 - Ratios                        0.2.0
 - RecipesBase                   0.2.3
 - Reexport                      0.1.0
 - Requires                      0.4.3
 - Rmath                         0.3.2
 - Roots                         0.5.0
 - Rotations                     0.6.1
 - SHA                           0.5.6
 - SIUnits                       0.1.0
 - ShowItLikeYouBuildIt          0.2.0
 - Showoff                       0.1.1
 - SignedDistanceFields          0.2.0
 - SimpleTraits                  0.5.1
 - SnoopCompile                  0.2.0
 - SortingAlgorithms             0.2.0
 - SpecialFunctions              0.3.8
 - StaticArrays                  0.6.6
 - StatsBase                     0.19.5
 - StatsFuns                     0.5.0
 - TexExtensions                 0.1.0
 - TiledIteration                0.1.0
 - TranscodingStreams            0.4.1
 - URIParser                     0.3.0
 - UnicodeFun                    0.1.0
 - WeakRefStrings                0.4.1
 - WebSockets                    0.4.0
 - WinRPM                        0.3.1
 - WoodburyMatrices              0.2.2
 - ZMQ                           0.5.1
sglyon commented 6 years ago

ahh ok, Blink 0.6 updated the underlying version of electron.

Can you run

using Blink
Blink.AtomShell.install()

And try again?

rand5 commented 6 years ago

Ok, that worked. So when I updated Blink, it didn't update electron as well? Should Blink.AtomShell.install() be called each time Blink is updated?

Thanks for the help sorting this out

sglyon commented 6 years ago

Great! glad we sorted it out.

So Blink.jl does not automatically install electron (formerly known as Atom Shell -- hence the naming inside Blink) in case some users only ever need Blink from inside Atom/Juno, in which case Blink just uses Atom's electron.

I think it might be worthwhile for me to put Blink.AtomShell.install() inside the PlotlyJS/deps/build.jl file so that the Blink display is always available and electron is always up to date.

I've hesitated doing that because some users might not use the electron display and at least on my OSX machine it takes up 121 MB, but it would resolve issues like this...

Thoughts welcome

sglyon commented 6 years ago

Actually, perhaps the best solution would be to update the Blink/deps/build.jl to check and see if electron is installed. If it is, then update the installation. Otherwise do nothing.

That still preserves the opt-in nature of downloading electron, but makes sure that if a user has ever opted in that the electron version and Blink.jl version are always in sync

cc @pfitzseb @MikeInnes