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

Weighted Graph #1

Open
GuillaumeLeclerc opened this issue Apr 1, 2016 · 3 comments
Open

Weighted Graph #1

GuillaumeLeclerc opened this issue Apr 1, 2016 · 3 comments

Comments

@GuillaumeLeclerc
Copy link

Hello,

Is there a way to set weight on edges with this module ?

Thank you

@ZigGreen
Copy link
Owner

ZigGreen commented Apr 2, 2016

Hi!
I suppose it might be possible if you set weight property directly to edge descriptor (one that you receive when iterating over ngraph links i.e. graph.forEachLink).

Take a look at Layout.js#90 and supervisor.js#161 to better understanding of how currently layout works with the ngraph.

It's smelly and probably better to rewrite layout logic as it will look into data of a link for weight.

if you have time to implement something more convenient, please feel free to contribute!

@GuillaumeLeclerc
Copy link
Author

So if I understood well. I need to iterate over all links and set the wight on them right ?

Thank you for your help

@ZigGreen
Copy link
Owner

ZigGreen commented Apr 3, 2016

Yeap, give a try 😃

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

2 participants