How to convert from wide to long data format?

Hello friends! I am working on a panel plugin.

Is there a programmatic way I can detect which format the incoming data is in, and convert it from one format to another based on the definitions in this link? For my implementation, I want to convert any data in wide format into long format. I can create my own algorithm if needed, but I suspect there may be something already built in to the Grafana api.

Thank you!

Data sources can add metadata on what format the data frame the query returned. Unfortunately, since I believe it’s up to each data source to set this property, I may not be able to rely on it 100%.

Other than that, I’m not aware of any APIs that let you determine the data frame format.

1 Like

Been meaning to reply to this. Thank you for your answer! Sounds like there is no way to convert from one to another but actually knowing the data frame type does help a lot.