jerosoler / Drawflow

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

Data transfer issue in drawflow canvas #508

Open mayankdixit029 opened 2 years ago

mayankdixit029 commented 2 years ago

Hi JeroSoler, Our requirement is to load the json in the form of relationship between 2..N entities but we are failing to do so, we are facing a lot of issues in the method of this.$df.registerNode() for registering the nodes coming from api.So, Can we connect using any medium as per your comfort to resolve this issue. Hence, waiting for your affirmative response.

jerosoler commented 2 years ago

I just don't understand what the problem is.

Register all available nodes. Node registration is for vue or HTML.

If you are using html, you can load the html node directly into the json without register.

mayankdixit029 commented 2 years ago

I am using Vue js , we are making relation successfully but when we save it in json and then load it in our project ,it destructured it's shape and functionality also

mayankdixit029 commented 2 years ago

Also , Can you please tell about how to load data of relation in vue js ?

jerosoler commented 2 years ago

Load data with import methods. editor.import()

View repo with vue3

https://github.com/jerosoler/drawflow-vue3-example And demo: https://jerosoler.github.io/drawflow-vue3-example/

mayankdixit029 commented 2 years ago

Thank you for your valuable response and time.We are using editor.import() for loading the data but we still have some complex issues to discuss -

1 - Currently I am using eventbus for sending the data between the nodes of drawflow js in vue-2 version. So, Can it be possible through the props and emit. 2 - Can we pass data in nodes through props or emit by just calling it like a normal component anytime because currently I can do this only at the time of registering nodes. 3 - Is it possible to remove drawflow canvas with our own canvas and if yes then please provide suggestion ?

Waiting for your valuable response.

jerosoler commented 2 years ago
  1. and 2. View this pull request to pass data in props.
  2. with our own canvas??? What do you mean?
mayankdixit029 commented 2 years ago

Thanks for your reply ....The query is that we have our own canvas and want to implement all functionality of this drawflow in our own canvas, can we do that ?

jerosoler commented 2 years ago

I don't know how it will behave with your canvas.

If it is a canvas based on "canvas" it will not work since this is based on html.

If it's in html, try it.