Giter Club home page Giter Club logo

Comments (6)

Ni55aN avatar Ni55aN commented on September 1, 2024 1

@henriklippke retejs/rete#633 (comment)

from vue-plugin.

Ni55aN avatar Ni55aN commented on September 1, 2024

I have to trigger a "connectionremove"

no, it's triggered by the NodeEditor's removeConnection method

Your connection class (classMyConnection extends ClassicPreset.Connection { .. ) should have a callback like onRemove and it should be called in the Vue component via a data property.

from vue-plugin.

henriklippke avatar henriklippke commented on September 1, 2024

@Ni55aN Thanks for your answer, but I still don't quite understand it.
The data property within the CustomConnection Component contains only these props: id,source,sourceOutput, target,targetInput

Could you please show me an example again?

Many thanks

from vue-plugin.

Ni55aN avatar Ni55aN commented on September 1, 2024

@henriklippke

// extend base class
class Connection<A extends Node, B extends Node> extends Classic.Connection<A, B> {
  selected?: boolean
  remove: (data: Connection<A, B>) => void

  constructor(events: { remove: (data: Connection<A, B>) => void }, source: A, target: B, public isLoop?: boolean) {
    super(source, 'default', target, 'default')
    this.remove = events.remove
  }
}



const events = { remove: (data: Schemes['Connection']) => console.log(data) }
// create connection instance and pass event handlers
const c1 = new Connection(events, ...

This way, you can forward an event handler through a connection instance

from vue-plugin.

henriklippke avatar henriklippke commented on September 1, 2024

Hi @Ni55aN
Ok, thanks that worked so far. But now I have the problem that when I don't create a connection manually but when the user pulls a connection between 2 sockets, that then my new connection class is not taken. Do you have an idea for this?
Thanks a lot!

from vue-plugin.

rete-js avatar rete-js commented on September 1, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

from vue-plugin.

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.