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

Show percentage of interaction in lignetwork #226

Open
sperezconesa opened this issue Nov 21, 2024 · 5 comments · May be fixed by #234
Open

Show percentage of interaction in lignetwork #226

sperezconesa opened this issue Nov 21, 2024 · 5 comments · May be fixed by #234
Labels
enhancement New feature or request visualization Visualization

Comments

@sperezconesa
Copy link

Hello,

Would it be possible to add to the fp.plot_lignetwork labels to the interactions with the frequency percentage. The intensity of the color is nice but the number would be ideal. Perhaps with a button to turn it off if it is too messy.

Love the work you have done with this code!

Thanks!
Sergio

@cbouy
Copy link
Member

cbouy commented Dec 6, 2024

Should be doable, this line defines the label and there's a weight variable that contains that info so it's just a matter of changing that line to include the info e.g. f"{interaction}: {distance:.2f}Å ({weight * 100:.0f}%)"

@cbouy cbouy added enhancement New feature or request visualization Visualization labels Dec 6, 2024
@talagayev
Copy link
Collaborator

Should be doable, this line defines the label and there's a weight variable that contains that info so it's just a matter of changing that line to include the info e.g. f"{interaction}: {distance:.2f}Å ({weight * 100:.0f}%)"

I could try to implement it, since I have some free time in the next weeks if you would want to have the percentage label in there and then create a PR for it :)

@cbouy
Copy link
Member

cbouy commented Dec 11, 2024

Please do! Should be pretty quick to review on my side

@talagayev
Copy link
Collaborator

Please do! Should be pretty quick to review on my side

Perfect, will do it in the upcoming days :)

@sperezconesa
Copy link
Author

Thank you! This is very useful. I have actually tried the code.

What I was actually referring to is the number showing up in the middle of the edge all the time or that it could be toggled off with a button. This solution gives most of what I was looking for though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request visualization Visualization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants