ghostiam / vue-blocks

Vue2 dataflow graph editor
https://ghostiam.github.io/vue-blocks/index.html
MIT License
280 stars 61 forks source link

Create Label to Link Arrow #10

Closed mmanoj closed 3 years ago

mmanoj commented 3 years ago

Dear Team, Appreciate your advice regarding the below query:

1.Please, advise how we can add labels to the linking arrow between components? 2.How to save the design as XML or JSON structure. So we can load later.

ghostiam commented 3 years ago

Hello. Thank you for your interest in the project.

  1. There is no such functionality at the moment. You can do it yourself by editing the "VueLink.vue" file and adding text output to the svg generator and calculating the position you need. You will also need to transfer text, I think it is better to do this in the "Line" object. And of course, you will need to store the text somewhere on the scene, so that you can save/load the scene with the text (if the text is dynamic).

  2. When creating a "VueBlocksContainer" you pass a "scene" object. There it is possible to specify the "sync" modifier for a two-way communication, so the "scene" object will be updated every time it changes and can be saved in any format and loaded in the future (for example, using standard JSON methods).

    
    <VueBlocksContainer
    ...
    :scene.sync="scene"
    ...
    />```
mmanoj commented 3 years ago

@ghostiam

Thanks for the quick reply and support. Really appreciate it. We are studying the code and update you on the progress. Once success we can send you a pull request.