Skip to content

Wrong tooltips in interactive plot for graph space #1196

@jmaspons

Description

@jmaspons

Describe the bug
Tooltips for interactive plots for models with graph space don't show the expected info. Looking at the code, I would expect to see the node position and the number of agents:

function Agents.agent2string(model::ABM{<:GraphSpace}, pos)
ids = Agents.ids_in_position(pos, model)
return """▶ Node $pos
# of agents: $(length(ids))
"""
end

But instead I see x, y and z (always 0)

Image

I want to create a custom tooltip (adding a custom method for Agents.agent2string(model::ABM{<:GraphSpace}, pos)) but it seems that this is not properly hooked.

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, abmobs = abmexploration(model)
fig

Agents.jl version

Agents v6.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions