Giter Site home page Giter Site logo

Double click on nodes about vis HOT 13 CLOSED

kostasgrevenitis avatar kostasgrevenitis commented on July 26, 2024
Double click on nodes

from vis.

Comments (13)

AlexDM0 avatar AlexDM0 commented on July 26, 2024

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.

kostasgrevenitis avatar kostasgrevenitis commented on July 26, 2024

Yes exactly. You understood correctly.

from vis.

AlexDM0 avatar AlexDM0 commented on July 26, 2024

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.

kostasgrevenitis avatar kostasgrevenitis commented on July 26, 2024

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.

AlexDM0 avatar AlexDM0 commented on July 26, 2024

what kind of properties would be useful in your case?

from vis.

kostasgrevenitis avatar kostasgrevenitis commented on July 26, 2024

Please can you be more specific? What do you mean by the word properties? May you set an example?

from vis.

AlexDM0 avatar AlexDM0 commented on July 26, 2024

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.

kostasgrevenitis avatar kostasgrevenitis commented on July 26, 2024

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.

AlexDM0 avatar AlexDM0 commented on July 26, 2024

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.

kostasgrevenitis avatar kostasgrevenitis commented on July 26, 2024

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.

AlexDM0 avatar AlexDM0 commented on July 26, 2024

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.

kostasgrevenitis avatar kostasgrevenitis commented on July 26, 2024

I am happy and satisfied. Thank you very much. Have a nice day! πŸ‘

from vis.

AlexDM0 avatar AlexDM0 commented on July 26, 2024

The release containing the feature you referenced will be somewhere tomorrow. Enjoy :)

from vis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.