-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
select multiple nodes with rectangle/lasso -- suggested feature #21
Comments
Thank you for your suggestion! The ability to select multiple nodes by dragging is a feature that I have been thinking about since the beginning of development, but haven't gotten around to it yet. The ability to group nodes was also an idea, but it was not the target yet, because I was focusing on simplicity and extendibility first. What you have suggested is interesting. I might break it down into several small features and implement them little by little. If you are in a hurry, please refer to the following:
|
Great @dash14, thanks. I look forward to the changes. I'm sure you are familiar with vis.js, which writes to a HTML canvas rather than SVG. (In my case, an SVG is preferred.) As you add features, vis.js might offer some inspiration. In particular, it has:
|
Hi @John-Boik, |
Hi @dash14, I am willing to add a selection by rectangle feature but have a few questions regarding which functions to add/modify.
There're too many functions in the source code so I could have omitted some important functions. I would really appreciate it if you could kindly correct me if I should look for other functions to accomplish the above steps! |
Hi @happylilem, Release: v0.6.0 The implementation is briefly described below.
Thank you very much for the detailed look inside! |
Hi @dash14 , And just a little suggestion: I noticed some other network libraries have selection by rectangle function by holding the ctrl/cmd key; while releasing the key allows normal pan. This might be more convenient than using one or more buttons when there are already bunch of buttons on the page. But the current feature is good enough for me. The using experience of your network library so far is great, love the appearance of the graphs and the smoothness of the operations. Please keep up the good work! |
Hi @happylilem, I have added the feature you suggested in v0.6.1. Thank you for your positive feedback! |
Hi @dash14 , I just tried this new feature on the example, and discovered a little issue there -- it works perfectly fine when I release the mouse before releasing the cmd key after the selection; but if the cmd key is released before the mouse, the selection box would remain on the graph, and clicking on the background would not eliminate the rectangle. Meanwhile I can pan the graph, so the network can be moved freely around regardless of the rectangle. To eliminate the rectangle I'll have to press the key again and start a new selection. |
Hi @happylilem, |
This might be beyond the aims of v-network-graph, but I am attempting to use v-network-graph to create a graph editor for Neo4j. It would allow a user to create/edit graphs in the browser, and these would be saved in Neo4j on the backend. Likewise, a graph stored in Neo4j could be converted to v-network-graph on the frontend for viewing and additional editing.
This project suggests some potential new features for v-network-graph. One would be the ability to select multiple nodes by dragging a rectangle or lasso around existing nodes. Once selected, the nodes could be removed from the graph, if that is the intent. Or, more interesting, the selected nodes could be included into a group by writing a node property on each.
In the latter case, there could be an option to keep the rectangle or other boundary visible, to denote the group. It could even have an optional visible text label somewhere in the boundary, (e.g., "Group 1"). Finally, the nodes within the boundary could be arranged by some force method, and the group could be treated as a whole when using a force method to arrange all other nodes. I imagine all this would involve creating a subgroup within the SVG that includes the rectangle as a border.
Is the ability to select multiple nodes in this way of interest to the developers? If you do not foresee adding this as a feature, could you provide a short description as to how this might be best accomplished in the existing v-network-graph framework?
The text was updated successfully, but these errors were encountered: