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

Start drawing an edge after clicking an option in a context menu on a node in a network #769

Open
m0squito opened this issue Jun 3, 2020 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@m0squito
Copy link

m0squito commented Jun 3, 2020

I've been trying to get some help with a particular functionality of vis.js + Angular 9 via this quesiton on Stack Overflow, but to no avail - not a single answer and very little interest. I'm not sure if this amounts to a feature request and I hate to disrespect the rules of posting issues, but I have searched repositories, documentation, source code, etc. and I'm still stuck. If anyone here could point me to a place where I can find some hints, I would greatly appreciate it.

Here's the problem, reposted from Stack:
I am using the network widget of vis.js via ngx-vis in an Angular 9 application. My goal is to trigger drawing an edge from a specific node by selecting an option from a context menu. Thus, one would right-click on Node A, select "Add edge", after which the edge has one end already connected to Node A and all the user needs to do is to click the target node. I am using ngx-contextmenu to get the node-specific context menu. This action triggers a method with the following code:
this.visNetworkService.addEdgeMode(this.visNetwork);
which allows the user to add one edge, but they have to select both the start and end node, which defeats the purpose of having this action triggered from a context menu on a specific node. Is there a way to programmatically "click" on the node (I can get its position) and get the desired behavior?

@Thomaash Thomaash added enhancement New feature or request help wanted Extra attention is needed labels Jun 4, 2020
@Instinct408
Copy link

@m0squito Im curious, how did you get the context menu to appear when you right click a node?

@nikhil-varma
Copy link

nikhil-varma commented Mar 3, 2023

Currently tackling the same use-case in React. Any help here would be appreciated. Able to show a context menu but just unable to set the controlEdge object for the edge to start automatically. Any workarounds for this? Or any other approaches?

@nikhil-varma
Copy link

@Thomaash Any help here is appreciated: #1922

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants