Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic multi-hops with just two columns #24

Open
pakerfeldt opened this issue Apr 11, 2024 · 3 comments
Open

Dynamic multi-hops with just two columns #24

pakerfeldt opened this issue Apr 11, 2024 · 3 comments
Assignees

Comments

@pakerfeldt
Copy link

pakerfeldt commented Apr 11, 2024

First I want to say, there are other issues reported where the root cause is likely the same. I just want to collect my findings and try to explain the issue more concretely.

There seems to be a limitation in this plugin in that you cannot draw a graph with simply source and destination that potentially skips hops if not necessary, or where middle-hops isn't drawn on the very left side. Let me provide an example created from https://observablehq.com/@mbostock/flow-o-matic.
image

As you can see, the input data only contains source and destination. Miami, being both referenced as a source and a destination is not drawn on the left side but in the middle in the graph. Same with Frankfurt.

If you try to produce the same graph in Grafana, it will look something like this:
image

(My data source is currently BigQuery, which is why you see the SQL query to provide the data)

Given that the underlying library d3-sankey supports this more complex structure while still only providing two columns, I get the feeling that the grafana plugin is making some assumptions on data or just inputting the data into d3-sankey the wrong way.

First of all, I just wanna confirm I'm not doing something wrong but that there's actually a limitation in the plugin. Is that correct? I know it's been suggested to add extra columns but that will not solve issue since the produced graph still doesn't look like the top one as expected.

@KatrinaTurner
Copy link
Collaborator

Hi! Thanks for bringing this to my attention. I have some time slotted next week to work on this plugin and will take a look.
Its been a while since I looked at the code, but there are definitely some assumptions that had to be made to feed the data into the d3 library, but I will try to see if I can fix some of that by adding more options to the plugin.

@KatrinaTurner KatrinaTurner self-assigned this Apr 26, 2024
@pakerfeldt
Copy link
Author

I appreciate that, thank you! Fully understand this is pro-bono but hope you're able to spot the issue. If there is anything else I can provide, just let me know.

@anydef
Copy link

anydef commented Jul 14, 2024

@pakerfeldt just tried to make it make it work with dynamic links for myself.
I've looked into the source code and it seems that implementation expects "node hops" to be sourced from different columns. (Which is convenient if you want to avoid managing loops)

@KatrinaTurner is there a plan to support this behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants