GLMakie: Reactive legends no longer work with ComputeGraph

I’m trying to have a textbox that the user can type in that adds a prefix to the start of legend entries. Here is a minimum working example:

using GLMakie

fig = Figure()
ax = Axis(fig[1:2, 1])
textbox = Textbox(fig[3, 1], placeholder="prefix", tellwidth=false, tellheight=false)
labels = [@lift($(textbox.displayed_string) * ": 1"), @lift($(textbox.displayed_string) * ": 2")]
series!(ax, [1, 2, 3], [2 4 8; 1 3 1]; labels)
axislegend(ax)
display(fig)

This code works as expected in GLMakie 0.12.0, but doesn’t work in the latest 0.13.6 version. I’m guessing it has something to do with the new ComputeGraph architecture but I’m not sure. Any help is greatly appreciated!

The error I get in 0.13.6 is shown below:

ERROR: LoadError: deepcopy of Modules not supported
Stacktrace:
   [1] error(s::String)
     @ Base ./error.jl:35
   [2] deepcopy_internal(x::Module, stackdict::IdDict{Any, Any})
     @ Base ./deepcopy.jl:36
   [3] deepcopy_internal(x::Any, stackdict::IdDict{Any, Any})
     @ Base ./deepcopy.jl:82

...
...
 [600] get_observable!
     @ ~/.julia/packages/ComputePipeline/03tW7/src/ComputePipeline.jl:265 [inlined]
 [601] get_observable!(c::ComputePipeline.Computed; use_deepcopy::Bool)
     @ ComputePipeline ~/.julia/packages/ComputePipeline/03tW7/src/ComputePipeline.jl:289
 [602] get_observable!
     @ ~/.julia/packages/ComputePipeline/03tW7/src/ComputePipeline.jl:286 [inlined]
 [603] #400
     @ ~/.julia/packages/Makie/4JW9B/src/scenes.jl:186 [inlined]
 [604] map
     @ ./tuple.jl:355 [inlined]
 [605] #map!#399
     @ ~/.julia/packages/Makie/4JW9B/src/scenes.jl:186 [inlined]
 [606] map!
     @ ~/.julia/packages/Makie/4JW9B/src/scenes.jl:181 [inlined]
 [607] map(::Makie.var"#2883#2891"{Int64}, ::Union{Scene, Plot}, ::ComputePipeline.Computed; ignore_equal_values::Bool, priority::Int64)
     @ Makie ~/.julia/packages/Makie/4JW9B/src/scenes.jl:201
 [608] map(::Makie.var"#2883#2891"{Int64}, ::Union{Scene, Plot}, ::ComputePipeline.Computed)
     @ Makie ~/.julia/packages/Makie/4JW9B/src/scenes.jl:195
 [609] plot!(plot::Series{Tuple{Vector{Vector{Point{2, Float64}}}}})
     @ Makie ~/.julia/packages/Makie/4JW9B/src/basic_recipes/series.jl:85
 [610] connect_plot!(parent::Scene, plot::Series{Tuple{Vector{Vector{Point{2, Float64}}}}})
     @ Makie ~/.julia/packages/Makie/4JW9B/src/compute-plots.jl:807
 [611] plot!
     @ ~/.julia/packages/Makie/4JW9B/src/interfaces.jl:211 [inlined]
 [612] plot!(ax::Axis, plot::Series{Tuple{Vector{Vector{Point{2, Float64}}}}})
     @ Makie ~/.julia/packages/Makie/4JW9B/src/figureplotting.jl:431
 [613] _create_plot!(::Function, ::Dict{Symbol, Any}, ::Axis, ::Vector{Int64}, ::Vararg{Any})
     @ Makie ~/.julia/packages/Makie/4JW9B/src/figureplotting.jl:401
 [614] series!(::Axis, ::Vararg{Any}; kw::@Kwargs{labels::Vector{Observable{String}}})
     @ Makie ~/.julia/packages/Makie/4JW9B/src/recipes.jl:521
 [615] top-level scope
     @ ~/gnc_tools/master/test3.jl:7
 [616] include(fname::String)
     @ Main ./sysimg.jl:38

Do you mind opening an issue with this so it’s tracked better?

1 Like

Yes no problem, here is the issue:

1 Like