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

Modify the context menu #20

Closed
talnagar opened this issue May 18, 2016 · 2 comments
Closed

Modify the context menu #20

talnagar opened this issue May 18, 2016 · 2 comments
Assignees

Comments

@talnagar
Copy link

Hi
I was wondering if there is a way to modify the context menu shown when clicking on nodes/edges.
Currently I managed doing it when using some naive d3 manipulation:
d3.select("#d3_layout_phylotree_context_menu").append('li').text('test').attr('id','testid')
However, in this way every time the menu is hidden the additions disappear as well and I need to re apply them every time the menu becomes available.

Help will be much appreciated.
Best
Tal

@spond
Copy link
Member

spond commented May 18, 2016

Dear @talnagar,

Please see http://bl.ocks.org/spond/30926a292ac4f49e1c6c7d900be65f94

The interface isn't the most flexible (i.e., you are not allowed to directly modify DOM objects in callbacks), but it allows the module to control when updates happen and what takes precedence.

Cheers,
Sergei

@talnagar
Copy link
Author

Thank you Sergei! this is the guidance I needed.
Best,
Tal

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

No branches or pull requests

3 participants