netsage-project / netsage-sankey-panel

Apache License 2.0
12 stars 5 forks source link

Multi Level Sankey Diagram option not working #6

Open mikerc19 opened 2 years ago

mikerc19 commented 2 years ago

Hello, first of all, thank you @KatrinaTurner for your contribution and work on this. Really appreciated!.

I'm trying to display a multilevel sankey diagram (just like the one shown in the Grafana download page for this panel) but I'm unable to, at first I thought this was related to the data types, then I changed the labels for the source and destinations but it didn't work either. The names of the source and destination do match exactly too.

Is there an specific way to do this? Such as specific labels that I need to use? or data type I need to cast these columns to?

Thanks for your time.

Sankey panel

The result I'm trying to achieve is something like this:

image

Using the latest Grafana version [v8.4.4 (fcfb01faeb)]()]

KatrinaTurner commented 2 years ago

Hi! Sorry for the late reply, I just returned from maternity leave. The data type of the metric should be a number because that's what the plugin uses to determine the widths of the links, but the types of labels shouldn't matter. To get the multiple levels, you need to do a "Group by" for each level, not just the source and target. In the example you showed, the query was: Metric: Sum Group By: Source Org Then by: Science Discipline Then by: Project

I hope this helps!

marten-wirelab commented 2 years ago

It would be really nice if it would be possible to render datasets where you don't necessarily know the complete flow. For instance, I want to visualize my power consumption. I have my net usage, my PV and circuit power consumption statistics. I can easily produce a dataset combining and splitting data based on "from -> to" relations but I can't know if (for example) my car is being charged from the PV panels or from the net.

mikerc19 commented 2 years ago

Hi! Sorry for the late reply, I just returned from maternity leave. The data type of the metric should be a number because that's what the plugin uses to determine the widths of the links, but the types of labels shouldn't matter. To get the multiple levels, you need to do a "Group by" for each level, not just the source and target. In the example you showed, the query was: Metric: Sum Group By: Source Org Then by: Science Discipline Then by: Project

I hope this helps!

Hello @KatrinaTurner, Thank you so much for your response. I was also on paternity leave until recently.

I'm trying your recommendation, and by the looks it sounds to me that your data set has more than 3 columns (Source, Target, Value). Is this the case?

It sounds to me that you have up to four columns ("Source Org", "Science Discipline", "Project", "metric")

Is it possible to only have 3 columns (Source, Destination, Value) and still get multi-level as shown below? NOTE: I'm using the Sum for the "metric", and the "group by" for the Source and Destination columns

Grafana Attempt The only way I was able to achieve the desired result in Grafana was by formatting the table purposely with a column for each level. (see below)

image

image

But I'm trying to achieve this with only 3 columns (as shown below) my data is already produced in this way. If this is beyond the capability for this panel, What can I do to help in contributing to achieve this?

PowerBI Attempt Table Format out put (with the Sum and Group by) image

Sankey Diagram in "PowerBI" image

The 3 columns (Source, Destination, Value) format is usually enough for multi level. (some samples below)

  1. Google Charts image

  2. PowerBI image image

  3. Gephi