projectmesa / mesa-viz-tornado

Apache License 2.0
2 stars 8 forks source link

Tooltip showing only for highest `Layer` #6

Open chathika opened 2 years ago

chathika commented 2 years ago

I noticed that the tooltip only displays for agents on the highest "Layer" in the portrayal when using mesa.visualization.CanvasGrid and mesa.visualization.ModularServer. Is there a way to enable tooltips for agents on other layers as well?

rht commented 2 years ago

Unfortunately, there is no straightforward fix for this. The lookup table used for the mousemove event is overwritten whenever there a layer is drawn. See https://github.com/projectmesa/mesa/blob/3664aa25c29e71fdb2b8486df5821324e46d4338/mesa/visualization/templates/js/GridDraw.js#L76.