Comments (13)
What would you like it to do? Currently, double click would open a cluster if a node is a cluster. Do I understand correctly that you would like a onDoubleClick event like the onSelect event?
Regards,
Alex
from vis.
Yes exactly. You understood correctly.
from vis.
We are currently undecided on what kind of interactions we would like to bind events to. This will be raised in the next project meeting. I do think it could be a useful supplement, the broader question is: what else do we want to bind events to. We will look for a consistent events model and implement it then. The implementation itself is rather easy so I would expect we can release a new version with new events around next week.
It would be very useful for us if you could provide the use case you have in mind. This might show us ways users wish to interact with the graph that we have not thought of.
from vis.
In my case I have a graph that nodes are companies and shareholders.
The requirement I have from my company right now is the following:
One click on the node : Show some menu, info window etc
Double click on the node : The graph gets refreshed and the double clicked node becomes the central one, loading the appropriate data.
I managed to fake it somehow, but I would prefer something like
graph.on('dblclick', function(event, properties)
{
//do what ever you want
});
from vis.
what kind of properties would be useful in your case?
from vis.
Please can you be more specific? What do you mean by the word properties? May you set an example?
from vis.
the select event returns an object:
graph.on('select', function(properties) {
// properties = {nodes: [], edges:[]}
});
On a doubleClick event, what kind of properties would be useful for you to be returned?
from vis.
For sure the node object that I doubled clicked. No only its id. This will satisfy my current requirement.
Besides that, I can't think of something else right now. But everything would be welcomed π
from vis.
As I mentioned in #28, Edge and node objects are part of the dataset. To correctly manipulate these objects, an update to the Dataset object is required. This will trigger all listeners you may have on the data. That is why the select event returns the ids. If we would include the doubleClick event, I would imagine this would also return the id. Could you explain why this may not be sufficient?
from vis.
I am not saying that it is not sufficient, but for my current case I would prefer the whole object. But if the double click returns the id it is fine for me. I am satisfied.
from vis.
This will be added in the next release. The release will be somewhere around next week. Further events are still under discussion but this one will be included. It will return the same ID object as the 'select' event due to the reasons I stated above.
from vis.
I am happy and satisfied. Thank you very much. Have a nice day! π
from vis.
The release containing the feature you referenced will be somewhere tomorrow. Enjoy :)
from vis.
Related Issues (20)
- Overlapping Edges in Vis.js 4.20.0 and later HOT 1
- Timeline - how to dynamically change options value? HOT 3
- timeline - update tooltip on onMoving callback is not working HOT 2
- Cross-Site Scripting DOM Input Validation and Representation HOT 1
- how to change X-Axis data format in Vis.js
- Suggestion for showcase - museum-digital
- Select option list is not clickable in groups section
- Flicking a timeline element off of screen unable to drag other element
- Is it possible to have a single line be drawn with multiple colors based on the data?
- Timeline bug with safari βmoveToβ HOT 1
- Github Pages site for visjs.org down HOT 3
- Update items or remove
- Shorthand option for edge color being ignored
- Every time you update the "network" shape always changes, how can you make the shape unchanged? HOT 2
- Connector title disappears when (re-)opening a cluster HOT 2
- Looking for a plugin to draw such this graph online HOT 1
- Edge label at 0,0 HOT 1
- can we have items on either side of timeline(up and down)
- Showcase suggestion: libcolgraph
- Mark Original Start in Timeline Bar
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vis.