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

DataInspector is failing with WGLMakie #1337

Closed
diegozea opened this issue Sep 23, 2021 · 2 comments
Closed

DataInspector is failing with WGLMakie #1337

diegozea opened this issue Sep 23, 2021 · 2 comments

Comments

@diegozea
Copy link

Hi!

With this code (using WGLMakie 0.4.6 and Julia 1.6.2):

using WGLMakie
x = 0:0.075:10
plt = lines(x, sin.(x), cos.(x))
DataInspector(plt.figure)

I get the following error:

MethodError: no method matching widths(::WGLMakie.WebDisplay)
Closest candidates are:
  widths(::GeometryBasics.HyperRectangle) at /home/diego/.julia/packages/GeometryBasics/WMp6v/src/primitives/rectangles.jl:162
  widths(::GeometryBasics.HyperSphere{N, T}) where {N, T} at /home/diego/.julia/packages/GeometryBasics/WMp6v/src/primitives/spheres.jl:28
  widths(::AbstractRange) at /home/diego/.julia/packages/GeometryBasics/WMp6v/src/geometry_primitives.jl:4
  ...
Stacktrace:
  [1] pick_sorted(scene::Scene, screen::WGLMakie.WebDisplay, xy::Point{2, Float32}, range::Int64)
    @ Makie ~/.julia/packages/Makie/PFSZS/src/interaction/interactive_api.jl:154
  [2] pick_sorted
    @ ~/.julia/packages/Makie/PFSZS/src/interaction/interactive_api.jl:150 [inlined]
  [3] on_hover(inspector::DataInspector)
    @ Makie ~/.julia/packages/Makie/PFSZS/src/interaction/inspector.jl:462
  [4] (::Makie.var"#875#877"{DataInspector})(#unused#::Tuple{Float64, Float64})
    @ Makie ~/.julia/packages/Makie/PFSZS/src/interaction/inspector.jl:448
  [5] #invokelatest#2
    @ ./essentials.jl:708 [inlined]
  [6] invokelatest
    @ ./essentials.jl:706 [inlined]
  [7] (::Makie.PrioCallback)(val::Tuple{Float64, Float64})
    @ Makie ~/.julia/packages/Makie/PFSZS/src/interaction/PriorityObservable.jl:17
  [8] #invokelatest#2
    @ ./essentials.jl:708 [inlined]
  [9] invokelatest
    @ ./essentials.jl:706 [inlined]
 [10] notify(observable::Makie.PriorityObservable{Tuple{Float64, Float64}})
    @ Makie ~/.julia/packages/Makie/PFSZS/src/interaction/PriorityObservable.jl:85
 [11] setindex!(observable::Makie.PriorityObservable{Tuple{Float64, Float64}}, val::Tuple{Float64, Float64})
    @ Makie ~/.julia/packages/Makie/PFSZS/src/interaction/PriorityObservable.jl:79
 [12] (::WGLMakie.var"#29#30"{Scene, Events})(msg::Dict{Any, Any})
    @ WGLMakie ~/.julia/packages/WGLMakie/WykJX/src/events.jl:56
 [13] #invokelatest#2
    @ ./essentials.jl:708 [inlined]
 [14] invokelatest
    @ ./essentials.jl:706 [inlined]
 [15] update_nocycle!(obs::Observable{Dict{String, Any}}, value::Any)
    @ JSServe ~/.julia/packages/JSServe/E7QrV/src/observables.jl:25
 [16] #invokelatest#2
    @ ./essentials.jl:708 [inlined]
 [17] invokelatest
    @ ./essentials.jl:706 [inlined]
 [18] handle_ws_message(session::JSServe.Session, message::Vector{UInt8})
    @ JSServe ~/.julia/packages/JSServe/E7QrV/src/http.jl:65
 [19] handle_ws_connection(application::JSServe.Server, session::JSServe.Session, websocket::WebSockets.WebSocket{Sockets.TCPSocket})
    @ JSServe ~/.julia/packages/JSServe/E7QrV/src/http.jl:99
 [20] websocket_handler(context::NamedTuple{(:routes, :application, :request, :match), Tuple{JSServe.Routes, JSServe.Server, HTTP.Messages.Request, RegexMatch}}, websocket::WebSockets.WebSocket{Sockets.TCPSocket})
    @ JSServe ~/.julia/packages/JSServe/E7QrV/src/http.jl:130
 [21] apply_handler(::Function, ::NamedTuple{(:routes, :application, :request, :match), Tuple{JSServe.Routes, JSServe.Server, HTTP.Messages.Request, RegexMatch}}, ::WebSockets.WebSocket{Sockets.TCPSocket})
    @ JSServe ~/.julia/packages/JSServe/E7QrV/src/server.jl:38
 [22] delegate(routes::JSServe.Routes, application::JSServe.Server, request::HTTP.Messages.Request, args::WebSockets.WebSocket{Sockets.TCPSocket})
    @ JSServe ~/.julia/packages/JSServe/E7QrV/src/server.jl:64
 [23] #14
    @ ~/.julia/packages/JSServe/E7QrV/src/server.jl:171 [inlined]
 [24] upgrade(f::JSServe.var"#14#16"{JSServe.Server}, stream::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}})
    @ WebSockets ~/.julia/packages/WebSockets/QcswW/src/HTTP.jl:201
 [25] stream_handler(application::JSServe.Server, stream::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}})
    @ JSServe ~/.julia/packages/JSServe/E7QrV/src/server.jl:170
 [26] #invokelatest#2
    @ ./essentials.jl:708 [inlined]
 [27] invokelatest
    @ ./essentials.jl:706 [inlined]
 [28] #26
    @ ~/.julia/packages/JSServe/E7QrV/src/server.jl:302 [inlined]
 [29] macro expansion
    @ ~/.julia/packages/HTTP/5e2VH/src/Servers.jl:413 [inlined]
 [30] (::HTTP.Servers.var"#13#14"{JSServe.var"#26#28"{JSServe.Server}, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}, HTTP.Servers.Server{Nothing, Sockets.TCPServer}, HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}})()
    @ HTTP.Servers ./task.jl:411┌ Warning: error in websocket handler!
└ @ JSServe ~/.julia/packages/JSServe/E7QrV/src/http.jl:84

Best,

@ffreyer
Copy link
Collaborator

ffreyer commented Sep 23, 2021

DataInspector relies on point picking which WGLMakie doesn't have yet.

@jonas-schulze
Copy link
Contributor

When working with Pluto, the same error occurs but for WGLMakie.ThreeDisplay instead of WebDisplay:

      From worker 2:	    @ HTTP.Servers ./task.jl:484MethodError: no method matching widths(::WGLMakie.ThreeDisplay)
      From worker 2:	Closest candidates are:
      From worker 2:	  widths(!Matched::GeometryBasics.HyperRectangle) at ~/.julia/packages/GeometryBasics/5Sb5M/src/primitives/rectangles.jl:162
      From worker 2:	  widths(!Matched::GeometryBasics.HyperSphere{N, T}) where {N, T} at ~/.julia/packages/GeometryBasics/5Sb5M/src/primitives/spheres.jl:28
      From worker 2:	  widths(!Matched::AbstractRange) at ~/.julia/packages/GeometryBasics/5Sb5M/src/geometry_primitives.jl:4
      From worker 2:	  ...
      From worker 2:	Stacktrace:
      From worker 2:	  [1] pick_sorted(scene::Makie.Scene, screen::WGLMakie.ThreeDisplay, xy::GeometryBasics.Point{2, Float32}, range::Int64)
      From worker 2:	    @ Makie ~/.julia/packages/Makie/Ppzqh/src/interaction/interactive_api.jl:151
      From worker 2:	  [2] pick_sorted
      From worker 2:	    @ ~/.julia/packages/Makie/Ppzqh/src/interaction/interactive_api.jl:147 [inlined]
      From worker 2:	  [3] on_hover(inspector::Makie.DataInspector)
      From worker 2:	    @ Makie ~/.julia/packages/Makie/Ppzqh/src/interaction/inspector.jl:428
      From worker 2:	  [4] (::Makie.var"#899#901"{Makie.DataInspector})(#unused#::Tuple{Float64, Float64})
      From worker 2:	    @ Makie ~/.julia/packages/Makie/Ppzqh/src/interaction/inspector.jl:412
      From worker 2:	  [5] #invokelatest#2
      From worker 2:	    @ ./essentials.jl:729 [inlined]
      From worker 2:	  [6] invokelatest
      From worker 2:	    @ ./essentials.jl:726 [inlined]
      From worker 2:	  [7] notify
      From worker 2:	    @ ~/.julia/packages/Observables/ynr7h/src/Observables.jl:143 [inlined]
      From worker 2:	  [8] setindex!(observable::Observables.Observable, val::Any)
      From worker 2:	    @ Observables ~/.julia/packages/Observables/ynr7h/src/Observables.jl:86
      From worker 2:	  [9] (::WGLMakie.var"#31#32"{Makie.Scene, Makie.Events})(msg::Dict{Any, Any})
      From worker 2:	    @ WGLMakie ~/.julia/packages/WGLMakie/NQvbl/src/events.jl:56
      From worker 2:	 [10] #invokelatest#2
      From worker 2:	    @ ./essentials.jl:729 [inlined]
      From worker 2:	 [11] invokelatest
      From worker 2:	    @ ./essentials.jl:726 [inlined]
      From worker 2:	 [12] update_nocycle!(obs::Observables.Observable{Dict{String, Any}}, value::Any)
      From worker 2:	    @ JSServe ~/.julia/packages/JSServe/09r0k/src/observables.jl:25
      From worker 2:	 [13] #invokelatest#2
      From worker 2:	    @ ./essentials.jl:729 [inlined]
      From worker 2:	 [14] invokelatest
      From worker 2:	    @ ./essentials.jl:726 [inlined]
      From worker 2:	 [15] handle_ws_message(session::JSServe.Session, message::Vector{UInt8})
      From worker 2:	    @ JSServe ~/.julia/packages/JSServe/09r0k/src/http.jl:65
      From worker 2:	 [16] handle_ws_connection(application::JSServe.Server, session::JSServe.Session, websocket::WebSockets.WebSocket{Sockets.TCPSocket})
      From worker 2:	    @ JSServe ~/.julia/packages/JSServe/09r0k/src/http.jl:99
      From worker 2:	 [17] websocket_handler(context::NamedTuple{(:routes, :application, :request, :match), Tuple{JSServe.Routes, JSServe.Server, HTTP.Messages.Request, RegexMatch}}, websocket::WebSockets.WebSocket{Sockets.TCPSocket})
      From worker 2:	    @ JSServe ~/.julia/packages/JSServe/09r0k/src/http.jl:130
      From worker 2:	 [18] apply_handler(::Function, ::NamedTuple{(:routes, :application, :request, :match), Tuple{JSServe.Routes, JSServe.Server, HTTP.Messages.Request, RegexMatch}}, ::WebSockets.WebSocket{Sockets.TCPSocket})
      From worker 2:	    @ JSServe ~/.julia/packages/JSServe/09r0k/src/server.jl:38
      From worker 2:	 [19] delegate(routes::JSServe.Routes, application::JSServe.Server, request::HTTP.Messages.Request, args::WebSockets.WebSocket{Sockets.TCPSocket})
      From worker 2:	    @ JSServe ~/.julia/packages/JSServe/09r0k/src/server.jl:64
      From worker 2:	 [20] #14
      From worker 2:	    @ ~/.julia/packages/JSServe/09r0k/src/server.jl:171 [inlined]
      From worker 2:	 [21] upgrade(f::JSServe.var"#14#16"{JSServe.Server}, stream::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}})
      From worker 2:	    @ WebSockets ~/.julia/packages/WebSockets/QcswW/src/HTTP.jl:201
      From worker 2:	 [22] stream_handler(application::JSServe.Server, stream::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}})
      From worker 2:	    @ JSServe ~/.julia/packages/JSServe/09r0k/src/server.jl:170
      From worker 2:	 [23] #invokelatest#2
      From worker 2:	    @ ./essentials.jl:729 [inlined]
      From worker 2:	 [24] invokelatest
      From worker 2:	    @ ./essentials.jl:726 [inlined]
      From worker 2:	 [25] #26
      From worker 2:	    @ ~/.julia/packages/JSServe/09r0k/src/server.jl:302 [inlined]
      From worker 2:	 [26] macro expansion
      From worker 2:	    @ ~/.julia/packages/HTTP/aTjcj/src/Servers.jl:415 [inlined]
      From worker 2:	 [27] (::HTTP.Servers.var"#13#14"{JSServe.var"#26#28"{JSServe.Server}, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}, HTTP.Servers.Server{Nothing, Sockets.TCPServer}, HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}})()
      From worker 2:	    @ HTTP.Servers ./task.jl:484

I was running Pluto v0.19.9 and the notebook contained the following packages:

# Pkg.status()
Status `/tmp/jl_OYhIdI/Project.toml`
  [cbdf2221] AlgebraOfGraphics v0.6.11
  [336ed68f] CSV v0.10.4
⌃ [a93c6f00] DataFrames v1.3.4
⌅ [91a5bcdd] Plots v1.31.7
⌃ [7f904dfe] PlutoUI v0.7.39
⌃ [0aa819cd] SQLite v1.4.1
⌃ [f3b207a7] StatsPlots v0.15.1
  [276b4fcb] WGLMakie v0.6.13
  [44cfe95a] Pkg v1.8.0

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

No branches or pull requests

4 participants