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

How to line up paths #15

Open
mattbue opened this issue Jan 20, 2023 · 5 comments
Open

How to line up paths #15

mattbue opened this issue Jan 20, 2023 · 5 comments

Comments

@mattbue
Copy link

mattbue commented Jan 20, 2023

Hi,
I'm trying to use this plugin to visualize an energy distribution beginning from feeding point going to buildings and ending on the floors. Data is coming from mariadb table:

ID Source Destination Energy
1 feeding point building 1 100
2 feeding point building 2 200
3 building 1 b1 floor 1 75
4 building 1 b1 floor 2 25
5 building 2 b2 floor 1 150
6 building 2 b2 floor 2 50

This results the following diagram:

sankey

What needs to be changed so that the 'paths' are lined up?

@zinko
Copy link

zinko commented Mar 18, 2023

How to change link color.

@KatrinaTurner
Copy link
Collaborator

KatrinaTurner commented Jun 5, 2023

Hi @mattbue ! You'll want your data arranged so that each row is a full path.... So you'll want an extra column like so:
Source -- Building -- Dest -- Energy
Feeding Point -- building 1 -- b1 floor 1 -- 75
Feeding Point -- building 1 -- b1 floor 2 -- 25

Hope this makes sense?

@KatrinaTurner
Copy link
Collaborator

Also, sorry for the late response. I haven't been getting notifications to my email for these for some reason 😢

@KatrinaTurner
Copy link
Collaborator

@zinko There is an option to change link color to a single color and then it should let you select it.

@pakerfeldt
Copy link

Hi @mattbue ! You'll want your data arranged so that each row is a full path.... So you'll want an extra column like so: Source -- Building -- Dest -- Energy Feeding Point -- building 1 -- b1 floor 1 -- 75 Feeding Point -- building 1 -- b1 floor 2 -- 25

Hope this makes sense?

Seeing that this library is using d3-sankey underneath, I don't understand why there's this requirement of an additional column?

If you add the author's data to the example page over at d3 you'll get this:
image

If you try to solve this with an extra column in this plugin, then you end up having all sources going through that hop before reaching the right side and that is not always the case. This is actually the exact problem I'm facing myself and there seems to be no way around it even to the d3 library supports that use case. I think there is somewhat of a limitation in this plugin 🤔.

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

4 participants