jerosoler / Drawflow

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

getting error when importing json ? #601

Closed Co-Maheshh closed 1 year ago

Co-Maheshh commented 1 year ago

image

Co-Maheshh commented 1 year ago

when importing json position of properties is matter or not...means if i am add id at 3 rd position placing name at 1st position.and then importing that time getting error ? how to import without posotion matters?

Co-Maheshh commented 1 year ago

Sequence of parameters like name , id , posx, pos y so on. is ot required in sequencing?

jerosoler commented 1 year ago

The export json does not have to be modified. If you need another type of import, you can fork the library and modify it to your liking.

Co-Maheshh commented 1 year ago

But sequence is matter?

jerosoler commented 1 year ago

Show you json

Co-Maheshh commented 1 year ago

this is my json .

{    "drawflow": {        "Home": {            "data": {                "0": {                                   "name": "Start", "id": "0", "html": "Start",                    "class": "",                                   "typenode": false,                    "inputs": {},                    "outputs": {                        "output_1": {                            "connections": [{                                "node": 1,                                "output": "input_1"                            }]                        }                    },                    "pos_x": 40,                    "pos_y": 40                }, "1": {                    "id": "1",   "data": { },                    "name": "SFTP",                                      "class": "",                    "html": "SFTP",                    "typenode": false,                    "inputs": {                        "input_1": {                            "connections": [{                                "input": "output_1",                                "node": "0"                            }]                        }                    },                    "outputs": {                        "output_1": {                            "connections": [{                                "node": "2",                                "output": "input_1"                            }]                        }                    },                    "pos_x": 40,                    "pos_y": 220                } }}}}

jerosoler commented 1 year ago

In the nodes it is necessary to add the data.

Node 0 without data.

"data": {},
Co-Maheshh commented 1 year ago

image

getting same error again at the time of fetching data from database and i am parsing that data and then importing for initialization. that time getting this error.

jerosoler commented 1 year ago

Show new json