ACE-IoT-Solutions / ace-svg-react

Grafana SVG Rendering Panel using the 7+ Plugin Framework
https://grafana.com/grafana/plugins/aceiot-svg-panel/
MIT License
40 stars 14 forks source link

How to create a clickable svg group that passes the id to javascript? #37

Closed Drex0 closed 12 months ago

Drex0 commented 1 year ago

Is there a way to create an onclick event inside an svg group and pass the id to a javascript function with this panel? I would like to know which group was clicked and then open another dashboard with the variables passed in for templating.

I have been hard coding an <a href=""><g></a> around my group and it seems to work. Just a lot of manual effort.

acedrew commented 12 months ago

If you give your group an ID, you can assign that id manually in the SVGMappings and everything will work just like any other mapped element.