2 ms·
Looks like editor.toJSON() exports the current graph. I tried it in the dev consolve, on this page: https://rete.js.org/#/components https://rete.js.org/#/comp
by lioeters 7y ago
Looks like editor.toJSON() exports the current graph.
I tried it in the dev consolve, on this page: https://rete.js.org/#/components https://rete.js.org/#/components
The exported object has properties id (string) and nodes (array). Each node is shaped like:
{
"id": 1,
"data": {
"name": "rete",
"importance": 1
},
"inputs": {
"pkg": {
"connections": [
{
"node": 2,
"output": "pkg",
"data": {
"pins": []
}
}
]
}
},
"outputs": {
"pkg": {
"connections": [
{
"node": 3,
"input": "pkg",
"data": {
"pins": [
{
"x": 306.4013957327592,
"y": -1661.933328730452
}
]
}
}
]
}
},
"position": [
-509.99078981156725,
-241.02053426307492
],
"name": "Package"
}