jerosoler / Drawflow

Simple flow library 🖥️🖱️
https://jerosoler.github.io/Drawflow/
MIT License
4.78k stars 741 forks source link

Drag a new node or existing node over a connection and #504

Open converseKarl opened 2 years ago

converseKarl commented 2 years ago

I don't think this has been asked before

  1. Drag a node or an existing node (that has empty input or output connections)
  2. Dragging node over an existing connection turns the line style to dashes
  3. Dropping it with that line style (as it over the connection), reconfigures the connection to put to this dropped node's input and create and output connection from the new node into the existing destination node.

This would be a real real cool feature and it must be possible to do this.

jerosoler commented 2 years ago

Hello,

All this could be achieved with events. You would have to do something similar to this:

Jero

converseKarl commented 2 years ago

Hola,

Quick update, I think i have found the issue with the screen jumping, and label jumping.

It tends to happen on one Node component I have opening and closing properties window. Moving flow around screen (drag) and the opening this class of component has this adverse jumping effect. Other components don't seem to be causing the issue. Not long since I updated this particular node too with some additional properties/content.

Removing the guts of the node (so content is just empty popup) stops the issue. So my feeling is I need to carefully rebuild the content step by step.

I've also found this

https://itecnote.com/tecnote/javascript-how-to-do-snapping-drag-and-drop/

Snap check while you are dragging (not after the drop event), I might have a go myself but thought it might be worth you taking a look at it too for your opinion to see if this could work?

BTW - By The Way from the diagram I generated this speech recognition demo the flow diagram, and AI chat bot and also a multi-modal visual voice SIP driven service too. One diagram 3 variants. I've written a recursive compiler that builds the models from the diagram (was difficult!)

Let me know what you think of the snap to grid option during drag

Kind regards, Hasta Luego

 Karl

From: Jero Soler @.> Sent: 24 August 2022 18:47 To: jerosoler/Drawflow @.> Cc: Karl Roberts @.>; Author @.> Subject: Re: [jerosoler/Drawflow] Drag a new node or existing node over a connection and (Issue #504)

Hello,

All this could be achieved with events. You would have to do something similar to this:

Jero

— Reply to this email directly, view it on GitHubhttps://github.com/jerosoler/Drawflow/issues/504#issuecomment-1226045549, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AM5CES72KHUFKTH5LSXEVATV2ZN3XANCNFSM57P75TXA. You are receiving this because you authored the thread.Message ID: @.***>

jerosoler commented 2 years ago

I do not understand what it says. Do you have reference to the above?