Skip to content

Error in ambplot() with Makie v0.24.8 #1191

@jmaspons

Description

@jmaspons

Describe the bug
Error on abmplot() with Makie version v0.24.8. It works with Makie v0.22.10.

ERROR: Setting an Attribute (pos) to an Observable is no longer allowed.
If you are using attributes as storage in a recipe, i.e. `plot[key] = map/lift(...)` either track the Observable as a variable `var = map/lift(...)` or consider using `register_computation!()` or the ComputePipelines `map!()` methods.
If you are trying to create a new input to a ComputeGraph use `add_input!(graph, key, obs)` explicitly.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:44
  [2] setproperty!(plot::Makie.Plot{…}, key::Symbol, val::Observables.Observable{…})
    @ Makie ~/.julia/packages/Makie/Vn16E/src/compute-plots.jl:77
  [3] plot!(p::Makie.Plot{AgentsVisualizations._abmplot, Tuple{ABMObservable{…}}})
    @ AgentsVisualizations ~/dev/julia/Agents.jl/ext/AgentsVisualizations/src/abmplot.jl:146
  [4] connect_plot!(parent::Makie.Scene, plot::Makie.Plot{AgentsVisualizations._abmplot, Tuple{ABMObservable{…}}})
    @ Makie ~/.julia/packages/Makie/Vn16E/src/compute-plots.jl:834
  [5] plot!
    @ ~/.julia/packages/Makie/Vn16E/src/interfaces.jl:211 [inlined]
  [6] plot!(ax::Makie.Axis, plot::Makie.Plot{AgentsVisualizations._abmplot, Tuple{ABMObservable{…}}})
    @ Makie ~/.julia/packages/Makie/Vn16E/src/figureplotting.jl:437
  [7] _create_plot!(::Function, ::Dict{…}, ::Makie.Axis, ::ABMObservable{…})
    @ Makie ~/.julia/packages/Makie/Vn16E/src/figureplotting.jl:407
  [8] _abmplot!(::Makie.Axis, ::Vararg{…}; kw::@Kwargs{…})
    @ AgentsVisualizations ~/.julia/packages/Makie/Vn16E/src/recipes.jl:190
  [9] abmplot!(ax::Makie.Axis, abmobs::ABMObservable{…}; params::Dict{…}, add_controls::Bool, enable_inspection::Bool, enable_space_checks::Bool, kwargs::@Kwargs{…})
    @ AgentsVisualizations ~/dev/julia/Agents.jl/ext/AgentsVisualizations/src/abmplot.jl:80
 [10] abmplot!
    @ ~/dev/julia/Agents.jl/ext/AgentsVisualizations/src/abmplot.jl:61 [inlined]
 [11] #abmplot!#3
    @ ~/dev/julia/Agents.jl/ext/AgentsVisualizations/src/abmplot.jl:38 [inlined]
 [12] abmplot!
    @ ~/dev/julia/Agents.jl/ext/AgentsVisualizations/src/abmplot.jl:22 [inlined]
 [13] abmplot(model::StandardABM{…}; figure::@NamedTuple{…}, axis::@NamedTuple{}, warn_deprecation::Bool, kwargs::@Kwargs{…})
    @ AgentsVisualizations ~/dev/julia/Agents.jl/ext/AgentsVisualizations/src/abmplot.jl:9
 [14] abmplot
    @ ~/dev/julia/Agents.jl/ext/AgentsVisualizations/src/abmplot.jl:1 [inlined]
 [15] abmexploration(model::StandardABM{…}; figure::@NamedTuple{…}, axis::@NamedTuple{}, alabels::Nothing, mlabels::Nothing, plotkwargs::@NamedTuple{}, kwargs::@Kwargs{})
    @ AgentsVisualizations ~/dev/julia/Agents.jl/ext/AgentsVisualizations/src/convenience.jl:11
 [16] abmexploration(model::StandardABM{…})
    @ AgentsVisualizations ~/dev/julia/Agents.jl/ext/AgentsVisualizations/src/convenience.jl:3
 [17] top-level scope
    @ Untitled-1:9
Some type information was truncated. Use `show(err)` to see complete types.

Minimal Working Example

using Agents, Graphs, GraphMakie, GLMakie

# Minimal GraphSpace model with no agents
g = complete_graph(4)
space = GraphSpace(g)
@agent struct A(GraphAgent) end
model = StandardABM(A, space; properties = Dict(), model_step! = dummystep)

fig, ax, abmobs = abmplot(model)
fig

Agents.jl version

  [46ada45e] Agents v6.3.1 `~/dev/julia/Agents.jl`

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedHelp from someone external is neededplotting

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions