-
Notifications
You must be signed in to change notification settings - Fork 184
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
Edge length? #197
Comments
The underlying library for the html vis is d3 force graph, and no, you
can't specify edge length.
…On Mon, Sep 14, 2020, 8:04 AM jordansaethre ***@***.***> wrote:
Is there a way to dictate how long the edges are based on the nodes that
are being connected? I have been using this tool to visualize a simplicial
complex that is the result of my own algorithm (not the mapper algorithm)
and I want edge length to have meaning. If this is not already a feature
would anyone be able to point me to the section of code that I would need
to modify to make this happen? I have messed around with quite a few
things, but haven't had any luck.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#197>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAI6Y7O4LNYNR7XY5OFRJR3SFYPINANCNFSM4RLUSCSQ>
.
|
If you're okay with static graphs, the plotly visualization functionality should let you specify edge lengths. The entry point is here: kepler-mapper/kmapper/plotlyviz.py Lines 61 to 86 in 956b8c9
Right now, it does not support supplying some sort of distance matrix, but I believe you should be able to thread a parameter all the way down to the point the You might also try the |
In addition to @sauln 's, suggestions, I also misspoke -- d3 force graphs do let you specify link distance, see https://github.com/d3/d3-force#link_distance . I have a PR in the works that upgrades d3 to the latest version which use the linked docs |
It might be possible to overwrite the d3 force layout also.. kepler-mapper/kmapper/static/kmapper.js Lines 127 to 131 in 956b8c9
You can supply a function to the
Maybe instead you could do something like
and then turn gravity (and probably other parameters) to 0 so the link length doesn't change? |
@jordansaethre If you can get it to work, it'd be awesome to have this as a contribution to the library! |
@sauln I think the more recent versions of d3-force respect the link distance more than the current version does, so gravity wouldn't have to be messed with. Also, I think the concept of gravity has been replaced by |
To emphasize, if any work is going to be done on this, the changes between the d3-force version used in my WIP and the version on master are so drastic, that any changes to the d3 code should hold off a bit. See 79ec3bd |
Is there a way to dictate how long the edges are based on the nodes that are being connected? I have been using this tool to visualize a simplicial complex that is the result of my own algorithm (not the mapper algorithm) and I want edge length to have meaning. If this is not already a feature would anyone be able to point me to the section of code that I would need to modify to make this happen? I have messed around with quite a few things, but haven't had any luck.
The text was updated successfully, but these errors were encountered: