JuliaGizmos / Interact.jl

Interactive widgets to play with your Julia code
Other
523 stars 76 forks source link

Caught exception while trying to render ObservableNode: Unknown DOM namespace: svg. #278

Closed mroavi closed 5 years ago

mroavi commented 5 years ago

I ran into this exception while trying to run the demo 04-Animations.ipynb.

I am using Julia v1.0.2. I updated all my installed packages before trying to run the demo.

I also got this error when trying to run the second animation in the notebook (animation using Plots)

MethodError: no method matching (::getfield(Main, Symbol("##13#15

")))(::RGB{FixedPointNumbers.Normed{UInt8,8}}, ::RGB{FixedPointNumbers.Normed{UInt8,8}}, ::Float64, ::Float64)
The applicable method may be too new: running in world age 25095, while current world is 25098.
Closest candidates are:
  #13(::Any, ::Any, ::Any, ::Any) at In[4]:8 (method too new to be called from this world context.)
piever commented 5 years ago

Thanks for reporting! Somehow with the new WebIO I can't figure out what is the correct way to draw svg, I'll ask over there

piever commented 5 years ago

Can you update to WebIO 0.6.1 and try again? The issue should be fixed now.

mroavi commented 5 years ago

I'm still having the same issue. I updated and rebuilt all packages.

I got this warning after running using Interact, Plots

┌ Info: Recompiling stale cache file /home/mroavi/.julia/compiled/v1.0/Interact/XmYW4.ji for Interact [c601a237-2ae4-5e1e-952c-7a85b0c7eef1]
└ @ Base loading.jl:1187
Loading WebIO Jupyter extension on an ad-hoc basis. Consider enabling the WebIO nbextension for a stabler experience (this should happen automatically when building WebIO).
┌ Info: Recompiling stale cache file /home/mroavi/.julia/compiled/v1.0/Plots/ld3vC.ji for Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
└ @ Base loading.jl:1187

When I run the animation script, no plot is displayed and I get the following error message: Caught exception while trying to render ObservableNode: Unknown DOM namespace: svg.

By the way, I had these animations running properly a week ago before I decided to update all packages.

piever commented 5 years ago

Could you please post the output of:

] status

It might make it easier to reproduce the issue.

mroavi commented 5 years ago

Sure:

(v1.0) pkg> status
    Status `~/.julia/environments/v1.0/Project.toml`
  [c7e460c6] ArgParse v0.6.1
  [c52e3926] Atom v0.7.10
  [ad839575] Blink v0.8.1
  [5ae59095] Colors v0.9.5
  [8f4d0f93] Conda v1.1.1
  [a93c6f00] DataFrames v0.14.1
  [31c24e10] Distributions v0.16.4
  [7876af07] Example v0.5.1+ [`~/.julia/dev/Example`]
  [9fc3f58a] ForneyLab v0.9.0+ [`~/.julia/dev/ForneyLab`]
  [28b8d3ca] GR v0.36.0
  [c91e804a] Gadfly v1.0.0
  [7073ff75] IJulia v1.14.1
  [c601a237] Interact v0.9.0
  [e5e0dc1b] Juno v0.5.3
  [b964fa9f] LaTeXStrings v1.0.3
  [9b87118b] PackageCompiler v0.5.1
  [f0f68f2c] PlotlyJS v0.12.0
  [91a5bcdd] Plots v0.21.0
  [92933f4c] ProgressMeter v0.8.0
  [438e738f] PyCall v1.18.5
  [d330b81b] PyPlot v2.6.3
  [ee283ea6] Rebugger v0.1.4
  [295af30f] Revise v0.7.12+ #teh/replinit (https://github.com/timholy/Revise.jl.git)
  [276daf66] SpecialFunctions v0.7.2
  [60ddc479] StatPlots v0.8.2
  [24249f21] SymPy v0.8.3
  [37f6aa50] TikzPictures v3.0.3
  [b8865327] UnicodePlots v0.3.1
  [8bb1440f] DelimitedFiles 
  [de0858da] Printf 

(v1.0) pkg> 
piever commented 5 years ago

My bad, status only shows the packages that you've added explicitly, not their dependencies (which are probably the issue here), could you try:

(v1.0) pkg> add WebIO@0.6.1
(v1.0) pkg> add InteractBase@0.8.1

to make sure the dependencies are also at the correct version? And then try again the:

using Colors, Interact

timer = Observable(time())
@async while true
    sleep(0.1)
    timer[] = time()
end

@manipulate for color=["yellow", "cyan", "tomato"], n=3:20, t=timer
    h, w = 100, 100
    attributes = Dict(
        "fill" => color,
        "points" => join(["$(w/2*(1+sin(θ+t))),$(h/2*(1+cos(θ+t)))" for θ in 0:2π/n:2π], ' ')
    )
    dom"svg:svg[width=$w, height=$h]"(dom"svg:polygon"(attributes=attributes))
end

And just to make sure, are you running the examples in jupyter notebook or jupyter lab?

mroavi commented 5 years ago

I ran what you suggested and now both animations are running fine! I'm using a jupyter notebook.

However, I still get the following error message when running the second animation of the notebook:

MethodError: no method matching (::getfield(Main, Symbol("##13#15

")))(::RGB{FixedPointNumbers.Normed{UInt8,8}}, ::RGB{FixedPointNumbers.Normed{UInt8,8}}, ::Float64, ::Float64)
The applicable method may be too new: running in world age 25115, while current world is 25118.
Closest candidates are:
  #13(::Any, ::Any, ::Any, ::Any) at In[4]:8 (method too new to be called from this world context.)

But like I mentioned, the animation works fine.

However, I still can't get my own animations back up an running (they were working fine before I did the package update) and I think that the reason is related to this error message. Do you have any idea what could be causing this error? Are you able to reproduce it?

mroavi commented 5 years ago

All demos seem to be working fine now. I tested on Julia 1.1.0. with all the latest packages.