michaeldmoore / michaeldmoore-multistat-panel

A smart table display panel with fixed, updating rows (or columns)
MIT License
58 stars 14 forks source link

Render bar as link #40

Closed paregupt closed 4 years ago

paregupt commented 4 years ago

First of all, this is a awesome panel. Very powerful.

Are there any plans to render bars as link? This feature will help in the overall workflow for an end-user. This panel shows 'what'. If a user clicks on the bar, the new page can provides detail of when and why via other time-series graphs.

michaeldmoore commented 4 years ago

Good idea - let me look into this.

On Mon, Apr 27, 2020 at 4:59 AM Paresh Gupta notifications@github.com wrote:

First of all, this is a awesome panel. Very powerful.

Are there any plans to render bars as link? This feature will help in the overall workflow for an end-user. This panel shows 'what'. If a user clicks on the bar, the new page can provides detail of when and why via other time-series graphs.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/michaeldmoore/michaeldmoore-multistat-panel/issues/40, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4NLLS4MVTAHC3YE5I3PZDROT7L3ANCNFSM4MRR6MKA .

paregupt commented 4 years ago

Hi Michael

Thanks for your response. I just saw the announcement from Grafana about the upcoming 7.0 release and bar graphs in table panel itself. My original request may be duplicate of this feature. We can wait and watch.

Thanks again. Cheers!

michaeldmoore commented 4 years ago

I've just released a test version for a different feature request - to make the text in the tooltip window selectable, and at the same time, added clickable url links that I think might do what you requested. It's all ready, minus updating the readme.md file to show how it should be used.

image

I've added a number of new features at the same time though, including updating the configuration screen UI to better suit the revised UI in the upcoming Grafana version 7 release.

image

The idea is pretty simple - adding an y number of bar-level links, each with a name and url, plus a flag to say whether to open the link in a new tab etc. The url supports substitution parameters, matching the names of the columns in the rendered data set surrounded by '{' and '}' characters - the links are then generated substituting the actual values the selected bar has. The example screens above have defined pretty trivial search links to show how this works.

I have a few things to do still - updating the documentation and maybe trouble shooting a recent report I had saying grafana version 7 with a SQL Server data source is not being recognized properly. For the moment, you should be able to pull the latest version from this github site. I'd appreciate it if you could check this out and give me your feedback. Probably not quite ready for production release, but it should be pretty close.

Regards, Michael Moore

paregupt commented 4 years ago

Thanks for the quick response. Much appreciated. I will try it out and share feedback.

paregupt commented 4 years ago

Tried the latest with grafana 7.0 beta. Looks great. I see a new option for Bar links. Verified absolute and relative links. Question: what is the logic behind variables? One variables works which is same as the Label col. You have two variables (region, sensor) in your example. How do I achieve that?

Thank you,

paregupt commented 4 years ago

Got it working. All set. Thank you again.

michaeldmoore commented 4 years ago

The test data set I was using contained multiple columns in this case, datetime, sensor, region and value, coming from this test csv data file. datetime,sensor,region,value 2019-11-05 18:21:07.000,AAA,West,1.234 2019-11-05 21:18:42.000,AAA,West,1.234 2019-11-05 21:21:32.000,AAA,West,1.234 2019-11-17 10:39:12.000,AAA,West,1.234 2019-11-17 10:39:12.000,DDD,South,0.51 2019-11-05 21:18:42.000,EEE,West,0.9 2018-01-01 01:01:01.000,EEE,West,0.5 2019-11-17 10:39:12.000,EEE,West,0.3 2019-11-05 21:21:32.000,FFF,Central,0.160411622524645 2019-11-17 10:39:12.000,FFF,Central,0.838865293039815

The tool tip shows these quantities - essentially, name/value pairs.

The bar link url substitution routine pulls all the strings contained within '{' and '}' characters and, if any of these match the names of the columns, it substitutes the corresponding value. This seemed like a pretty flexible and simple to explain method of whatever drill-down or other use someone might have for composing a web link off of a click on an individual bar.

Grafana 7 (I think 6 too) has a similar concept for panel links - a drop down in the top left corner of each panel that offers urls with substitution based on dashboard parameters (query start and end datetimes, dashboard variables and some other things). I might extend the bar link substitution routine to handle these too sometime before it goes to an official release. My main task now is to try to explain these things in the readme so people can figure this out without me having to explain it - that's a real challenge!

On Tue, May 5, 2020 at 6:15 AM Paresh Gupta notifications@github.com wrote:

Tried the latest with grafana 7.0 beta. Looks great. I see a new option for Bar links. Verified absolute and relative links. Question: what is the logic behind variables? One variables works which is same as the Label col. You have two variables (region, sensor) in your example. How do I achieve that?

Thank you,

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/michaeldmoore/michaeldmoore-multistat-panel/issues/40#issuecomment-623860360, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4NLLQSDVWXRXNP7STN643RP6OGTANCNFSM4MRR6MKA .

rock420 commented 4 years ago

Hi Michael, currently is there any support for dashboard variable ( eg - from & to for time range ) in the bar link? I am trying to include the time range in url but it's not working.

michaeldmoore commented 4 years ago

I do have support for variables - as substitution parameters for URL links, mostly (maybe exclusively)

If I understand it correctly, the from and to variables are automatically passed by grafana to the data source, by setting the query 'from' and 'to' parameters. So it would be up to the data source to respect, or ignore these variables, not the panel itself.

On the other hand, my understanding might be incorrect - that has happened more times than I'd like to think about.

I'm rather occupied with other things at the moment, including a notification that the latest release of Grafana (7.1) has broken the panel completely (!!!!). I have a fix for this already, but need to do a bit more work checking out all the test cases, so it might take a day or two before I can post a real working update for that. Looking at the to/from variable substitution will have to take a back seat for the next week or so.

Here's something you can do to check this for me though. Check out the Grafana built-in table panel visualization. If this respects the to/from variables using the datasource you have in place, then your right - I definitely have some work to do with Multistat in this area. If, on the other hand, the table panel doesn't filter on the to/from valiables, then it seems to confirm that the problem lies with the data source. Not all data sources respect these filters, and you might be using one that doesn't.

Good luck and let me know what you find out. If it can be made to work, I will make Multistat support it.

Cheers, Michael Moore

On Mon, Jul 20, 2020 at 8:08 PM Ayan Saha notifications@github.com wrote:

Hi Michael, currently is there any support for dashboard variable ( eg - from & to for time range ) in the bar link? I am trying to include the time range in url but it's not working.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/michaeldmoore/michaeldmoore-multistat-panel/issues/40#issuecomment-661248771, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4NLLVR6X633OJEFUPQ4B3R4SB25ANCNFSM4MRR6MKA .