jerosoler / Drawflow

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

how i Can write extra info to node data #73

Closed linpan closed 3 years ago

linpan commented 3 years ago

i want save some data in node before export nodes.

linpan commented 3 years ago

data attr in this object.

{
    "drawflow": {
        "Home": {
            "data": {}
        },
        "Other": {
            "data": {
                "16": {
                    "id": 16,
                    "name": "facebook",
                    "data": {},
                    "class": "facebook",
                    "html": "\n        
\n          
 Facebook Message
\n        
\n        ",
                    "inputs": {},
                    "outputs": {
                        "output_1": {
                            "connections": [
                                {
                                    "node": "17",
                                    "output": "input_1"
                                }
                            ]
                        }
                    },
                    "pos_x": 226,
                    "pos_y": 138
                },
                "17": {
                    "id": 17,
                    "name": "log",
                    "data": {},
                    "class": "log",
                    "html": "\n      
jerosoler commented 3 years ago

Hi

You could use something like this:

editor.drawflow.drawflow[editor.module].data[IDOFMODULE].data = 'Hey Drawflow!!';

Or any other place on the object

linpan commented 3 years ago

thks

At 2020-11-20 23:47:53, "Jero Soler" notifications@github.com wrote:

Hi

You could use something like this:

editor.drawflow.drawflow[editor.module].data[IDOFMODULE].data='Hey Drawflow!!';

Or any other place on the object

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

linpan commented 3 years ago

Recently, I use your Drawflow for my project. I have an idea, Actor Model for yours . node is computing unit. node can commiute each other.