-
Notifications
You must be signed in to change notification settings - Fork 124
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
[enhancement] [question] Editing edges and adding additional parameters #377
Comments
hi @bthieurmel any idea if these features are possible/easy to implement, and in the scope of what you would like to maintain in visNetwork? |
Hi, Possible : yes (everything is possible....!) Waiting for that, you can editing network as you want using shiny apps and ```visNetworkProxy`` functions... |
You're lucky, it's on progress... |
hi thanks for the response. if these features are in scope for visNetwork, and something you could maintain, then I would suggest @julianstanley try to implement these features over the summer and if that works, submit them as a PR. |
You can test the dev version You can have a look to new example. |
TO DO : can pass html input type, to treat character / number values |
This is brilliant, @bthieurmel -- thank you so much for getting to this so quickly! While working with the new features, I noticed one unexpected behavior: non-standard parameters in edges cannot be saved (unlike nodes, which work perfectly). I'll put an example below, and will be browsing around to see if I can figure out why this happens! Reprex
ProblemSo, I expect to see 'nodeParam' in nodes and 'edgeParam' in the edge. I see nodeParam, but edgeParam is undefined: If I try to edit that edgeParam to make it correct, save, and re-open the edge, my correction disappears: (Note: that event is still picked up by visNetworkProxy, though) But it works just fine if I try to edit one of the original values: Editing nodeParam works just fine, though. Debugging attemptsAfter editing an edge, if I set a breakpoint in visNetwork.js at line 3970, my new data (edgeParam: 1) was bound to the local variable 'data' successfully. This fits with visNetworkProxy picking up the change, I think. The error seems to pop up at line 2980 (or a few lines below if editEdge is true). When I set a breakpoint there, I noticed that Where does the data parameter passed to that function come from? My callstack just seems to go into vis-network.min.js |
Hi, It's fix for edges extra columns + passing html input type (for example update width, size, ...) :
|
Hello! I'll put the question and feature request up here, and then add more information below.
Feature requests
(1) Can edges be encoded so that they have a pop-up dialog when you edit them, just like nodes? And then, can I make it so that users can encode custom edge information?
If that feature would be broadly applicable to other users, then I can work on implementing it.
(2) Can there be interactivity between a visNetwork graph and a plotly graph? Similar to issue 229 but that seems to have stalled a couple years ago. Is there a solution besides crosstalk?
User-specific question
Based on the information below, do you think visNetwork is the best tool for me to use? For example, it seems like plotly can technically make directed graphs, it just isn't nearly as intuitive. Is there another alternative, and/or is my potential usecase for visNetwork reasonable? Thanks!
Specific use case information
I'm working on a project this summer (with the R Project and Google Summer of Code) that involves making a Shiny app for the gfpop package.
I would like to include an editable directed graph in that app. I think visNetwork seems like a great tool for that purpose since it (1) provides the
manipulate
option, which makes it really easy to add/edit nodes, and (2) it's easy to implement directed edges and edges that connect a node back to itself.There are two barriers that keep visNetwork from being perfectly-suited to my purposes.
The first is the most important, which is that I want to store a lot of information in the edges, and want users to be able to edit that information.
So, for example, a typical
gfpop
graph has edges that include all of this information:So, each edge needs to encode: (1) type, (2) parameter, (3) penalty, (3) K, (4) a, (5) min, and (6) max, and users will want to edit that information.
The text was updated successfully, but these errors were encountered: