GithubHelp home page GithubHelp logo

Comments (7)

Nelarius avatar Nelarius commented on August 22, 2024 1

Yeah, we can keep it open for now.

It'd be great to have a new example submission if you have some code lying around 👍

from imnodes.

beddueimpossibile avatar beddueimpossibile commented on August 22, 2024

I found out, by studying the imnodes source code, that I can use
imnodes::PushAttributeFlag(imnodes::AttributeFlags_EnableLinkDetachWithDragClick);
to enable the deletion of a link by dragging it away from a pin, but I still don't understand what's the default interaction expected to trigger a link deletion.

from imnodes.

Nelarius avatar Nelarius commented on August 22, 2024

Hi @beddueimpossibile !

Indeed, figuring out how user interaction is supposed to work isn't the easiest thing at the moment 😞

By default, the user is responsible for deleting links. The idea is that you can delete a link by simply removing the link from your internal data structures. Nothing else needs to be done, since by default, the link is fixed in place.

IsLinkDestroyed, like you discovered, is for situations where the user enables detach via click and drag. In this case,imnodes signals to the user code that a link needs to be deleted through IsLinkDestroyed. The function doesn't do anything else, since the assumption is that the link lives in the user code's data structures.

Hope this helped! And I'll try to get around to writing a bigger tutorial covering all the user interaction modes available currently.

from imnodes.

beddueimpossibile avatar beddueimpossibile commented on August 22, 2024

Now it's clear, thank you for the prompt reply and the explanation!
Probably I can close this issue, or leave it open to remember us about the example code covering this.
I can write an example myself and send a PR after I got a little more confident with the extension, if you wish!

from imnodes.

stuaxo avatar stuaxo commented on August 22, 2024

I wonder if making using user supplied unique ids, instead of grabbing them from the pointer would help (along with other things) ?

As suggested here by @sonoro1234
rokups/ImNodes#21 (comment)

from imnodes.

sonoro1234 avatar sonoro1234 commented on August 22, 2024

I wonder if making using user supplied unique ids, instead of grabbing them from the pointer would help (along with other things) ?

This was a suggestion for rokups implementation as Nelarius already takes user supplied unique ids.

from imnodes.

stuaxo avatar stuaxo commented on August 22, 2024

Oops, the names are so similar I got confused about which one I was reading, apologies for the noise !

from imnodes.

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.