jerosoler / Drawflow

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

How can i create node which on stretching increases number of inputs and outputs , and decreases number of inputs/outputs on shrinking a node?? #165

Closed princeyogesh closed 3 years ago

princeyogesh commented 3 years ago

also tell me how can i create resizeable node (stretchable and shrinkable) dynamically like below

  1. if user drag the corner of node and stretch down, node should grow (here number of input/output should increase as per size of node)
  2. if user drag the corner of node and shrink upside, node should become smaller (here number of input/output should decrease as per size of node)
jerosoler commented 3 years ago

Hello, @princeyogesh

To make a node draggable you can see: https://www.w3schools.com/cssref/css3_pr_resize.asp Or library: https://interactjs.io/

You will have to use the methods:

https://github.com/jerosoler/Drawflow#methods addNodeInput (id) addNodeOutput (id) removeNodeInput (id, input_class) removeNodeOutput (id, output_class)

To increase or decrease the number of inputs or outputs. Jero