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

Cannot read property 'wgl_camera' of undefined #1546

Closed
jtrakk opened this issue Jan 7, 2022 · 3 comments · Fixed by #2566
Closed

Cannot read property 'wgl_camera' of undefined #1546

jtrakk opened this issue Jan 7, 2022 · 3 comments · Fixed by #2566

Comments

@jtrakk
Copy link

jtrakk commented Jan 7, 2022

I cannot view a plot

Stack trace:
    TypeError: Cannot read property 'wgl_camera' of undefined
        at add_plot (/home/user/.julia/packages/WGLMakie/0tzNl/src/wglmakie.js:65)
        at /home/user/.julia/packages/WGLMakie/0tzNl/src/wglmakie.js:50
        at Array.forEach (<anonymous>)
        at Object.insert_plot (/home/user/.julia/packages/WGLMakie/0tzNl/src/wglmakie.js:49)
        at eval (eval at deserialize_js (/home/user/.julia/packages/JSServe/E7QrV/js_dependencies/JSServe.js:162), <anonymous>:3:14)
        at /home/user/.julia/packages/JSServe/E7QrV/js_dependencies/JSServe.js:168
        at process_message (/home/user/.julia/packages/JSServe/E7QrV/js_dependencies/JSServe.js:365)
        at WebSocket.websocket.onmessage (/home/user/.julia/packages/JSServe/E7QrV/js_dependencies/JSServe.js:451)
An exception was thrown in JS: TypeError: Cannot read property 'wgl_camera' of undefined

WGLMakie 0.4.7
VSCode Julia v1.5.8
VSCode 1.60.2
Julia 1.7.0

@SimonDanisch
Copy link
Member

MWE?

@jtrakk
Copy link
Author

jtrakk commented Jan 7, 2022

It was happening for any plot yesterday so I switched to CairoMakie. Today I can't reproduce it. Following the code from the line it mentions https://github.com/JuliaPlots/Makie.jl/blob/master/WGLMakie/src/wglmakie.js#L65 I guess it tried to get a scene from the scene_cache but got undefined and it doesn't know how to handle that.

@anandijain
Copy link
Contributor

on [276b4fcb] WGLMakie v0.7.1

julia> versioninfo()
Julia Version 1.8.2
Commit 36034abf260 (2022-09-29 15:21 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin21.3.0)
  CPU: 8 × Apple M1
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, apple-m1)
  Threads: 4 on 4 virtual cores
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 4

ERROR: TypeError: Cannot read properties of undefined (reading 'wgl_camera')
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] evaljs_value(session::JSServe.Session, js::JSServe.JSCode; error_on_closed::Bool, time_out::Float64)
    @ JSServe ~/.julia/packages/JSServe/kIK9q/src/session.jl:238
  [3] evaljs_value
    @ ~/.julia/packages/JSServe/kIK9q/src/session.jl:206 [inlined]
  [4] insert!(td::WGLMakie.ThreeDisplay, scene::Scene, plot::Poly{Tuple{GeometryBasics.HyperRectangle{2, Int64}}})
    @ WGLMakie ~/.julia/packages/WGLMakie/hmFSW/src/three_plot.jl:20
  [5] insert!(td::WGLMakie.Screen, scene::Scene, plot::Poly{Tuple{GeometryBasics.HyperRectangle{2, Int64}}})
    @ WGLMakie ~/.julia/packages/WGLMakie/hmFSW/src/display.jl:149
  [6] push!(scene::Scene, plot::Poly{Tuple{GeometryBasics.HyperRectangle{2, Int64}}})
    @ Makie ~/.julia/packages/Makie/fyg5R/src/scenes.jl:409
  [7] plot!(scene::Scene, P::Type{Poly{Tuple{GeometryBasics.HyperRectangle{2, Int64}}}}, attributes::Attributes, input::Tuple{Observable{GeometryBasics.HyperRectangle{2, Int64}}}, args::Observable{Tuple{GeometryBasics.HyperRectangle{2, Int64}}})
    @ Makie ~/.julia/packages/Makie/fyg5R/src/interfaces.jl:418
  [8] plot!(scene::Scene, P::Type{Poly}, attributes::Attributes, args::Observable{GeometryBasics.HyperRectangle{2, Int64}}; kw_attributes::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie ~/.julia/packages/Makie/fyg5R/src/interfaces.jl:335
  [9] plot!
    @ ~/.julia/packages/Makie/fyg5R/src/interfaces.jl:302 [inlined]
 [10] #plot!#171
    @ ~/.julia/packages/Makie/fyg5R/src/interfaces.jl:286 [inlined]
 [11] #poly!#56
    @ ~/.julia/packages/MakieCore/msnkR/src/recipes.jl:38 [inlined]
 [12] initialize_block!(ax::Axis; palette::Nothing)
    @ Makie ~/.julia/packages/Makie/fyg5R/src/makielayout/blocks/axis.jl:212
 [13] initialize_block!(ax::Axis)
    @ Makie ~/.julia/packages/Makie/fyg5R/src/makielayout/blocks/axis.jl:169
 [14] _block(::Type{Axis}, ::Figure; bbox::Nothing, kwargs::Base.Pairs{Symbol, Tuple{UnitRange{Int64}, Vector{String}}, Tuple{Symbol}, NamedTuple{(:xticks,), Tuple{Tuple{UnitRange{Int64}, Vector{String}}}}})
    @ Makie ~/.julia/packages/Makie/fyg5R/src/makielayout/blocks.jl:403
 [15] _block(::Type{Axis}, ::GridPosition; kwargs::Base.Pairs{Symbol, Tuple{UnitRange{Int64}, Vector{String}}, Tuple{Symbol}, NamedTuple{(:xticks,), Tuple{Tuple{UnitRange{Int64}, Vector{String}}}}})
    @ Makie ~/.julia/packages/Makie/fyg5R/src/makielayout/blocks.jl:294
 [16] #_#1072
    @ ~/.julia/packages/Makie/fyg5R/src/makielayout/blocks.jl:279 [inlined]
...

this is a mwe for me

using WGLMakie, DataFrames
WGLMakie.activate!()
categories = string.(1:9)
df = DataFrame(rand(100, 9), categories)
df2 = DataFrame(rand(100, 9), categories)

n = nrow(df)
for (i, f) in enumerate(categories)
    fig = Figure(resolution=(600, 400))
    ax = Axis(fig[1, 1], xticks=(1:length(categories), categories))
    a = fill(i, length(n))
    violin!(ax, a, df[:, f]; side=:left)
    violin!(ax, a, df2[:, f]; side=:right)
    display(fig)
end


fig = Figure(resolution=(600, 400))
ax = Axis(fig[1, 1], xticks=(1:length(categories), categories))

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

Successfully merging a pull request may close this issue.

3 participants