jerosoler / Drawflow

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

Chatbot flow #809

Open fab-auri-dev opened 5 months ago

fab-auri-dev commented 5 months ago

First of all, thank you for your work, it's a fantastic library. I would like to use it in my project as an editor to give the user the possibility to create a dialogue flow. Do you have any advice on how I could transform the flow? I thank you in advance for any help you can give me

jerosoler commented 5 months ago

Do you have any advice on how I could transform the flow?

What are you talking about?

fab-auri-dev commented 5 months ago

Do you have any advice on how I could transform the flow?

What are you talking about?

Forgive me for the unclear question. I would like to create an options node that when dragged would represent something like this

Screenshot 2024-01-14 103338

jerosoler commented 5 months ago

By dragging you can create whatever you want.

You can for example create two nodes and connect them.

Example:

const nodeA = editor.addNode('aaa', 1, 1, 100, 300, 'aaa', {}, 'aaa' );
const nodeB = editor.addNode('bbb', 1, 1, 800, 300, 'bbb', {}, 'bbb' );
editor.addConnection(nodeA, nodeB, 'output_1', 'input_1');