Adding a badge to each Agent node in a diagram.

It is clickable, opens the events page, and the color indicates the status of the Agent. (working/not working/disabled)
Would it be possible to put this in one of the scripts in assets/javascripts, or does it have to be embedded in the SVG?