Enumerating panels from javascript

Hi!

I am developing a pair of panels that need to interchange information, and so they need to find each other’s instances at run-time.

I have been looking through the available variables passed to the panel constructor but none seem like a likely candidate to get what I want. Is there an array of instanciated panels reachable at run-time somewhere that I can look at?

Thanks

There are a couple of ways you could do this.

  1. Communicate with events - get one panel to emit an event and then the other panel can listen for it.
  2. window['grafanaBootData'].settings.panels to get the installed panels (does not mean that they are included in the dashboard though.
  3. Use dashboardSrv to get the dashboard and then find the panels like this.