The goal of this document is to explain the Json serialization of the Serialization Case 1: Empty Canvas{ "id": "27", "offsetX": 0, "offsetY": 0, "zoom": 100, "gridSize": 0, "layers": [ { "id": "28", "type": "diagram-links", "isSvg": true, "transformed": true, "models": { } }, { "id": "30", "type": "diagram-nodes", "isSvg": false, "transformed": true, "models": { } } ] } Graphical display Serialization Case 2: Single out Node{ "id": "27", "offsetX": 0, "offsetY": 0, "zoom": 100, "gridSize": 0, "layers": [ { "id": "28", "type": "diagram-links", "isSvg": true, "transformed": true, "models": { } }, { "id": "30", "type": "diagram-nodes", "isSvg": false, "transformed": true, "models": { "64": { "id": "64", "type": "default", "x": 187.0056915283203, "y": 219.91477584838867, "ports": [ { "id": "65", "type": "default", "x": null, "y": null, "name": "Out", "alignment": "right", "parentNode": "64", "links": [ ], "in": false, "label": "Out" } ], "name": "Node 1", "color": "rgb(0,192,255)", "portsInOrder": [ ], "portsOutOrder": [ "65" ] } } } ] } Graphical display Serialization case 3: one in node and one out node{ "id": "27", "offsetX": 0, "offsetY": 0, "zoom": 100, "gridSize": 0, "layers": [ { "id": "28", "type": "diagram-links", "isSvg": true, "transformed": true, "models": { } }, { "id": "30", "type": "diagram-nodes", "isSvg": false, "transformed": true, "models": { "64": { "id": "64", "type": "default", "x": 187.0056915283203, "y": 219.91477584838867, "ports": [ { "id": "65", "type": "default", "x": 230.6392059326172, "y": 248.57954025268555, "name": "Out", "alignment": "right", "parentNode": "64", "links": [ ], "in": false, "label": "Out" } ], "name": "Node 1", "color": "rgb(0,192,255)", "portsInOrder": [ ], "portsOutOrder": [ "65" ] }, "69": { "id": "69", "type": "default", "x": 420.0056915283203, "y": 244.91477584838867, "ports": [ { "id": "70", "type": "default", "x": null, "y": null, "name": "In", "alignment": "left", "parentNode": "69", "links": [ ], "in": true, "label": "In" } ], "name": "Node 2", "color": "rgb(192,255,0)", "portsInOrder": [ "70" ], "portsOutOrder": [ ] } } } ] } Graphical display Serialization Example 4: in nodes, out nodes, and connections{ "id": "27", "offsetX": 0, "offsetY": 0, "zoom": 100, "gridSize": 0, "layers": [ { "id": "28", "type": "diagram-links", "isSvg": true, "transformed": true, "models": { "36": { "id": "36", "type": "default", "source": "32", "sourcePort": "33", "target": "34", "targetPort": "35", "points": [ { "id": "37", "type": "point", "x": 0, "y": 0 }, { "id": "38", "type": "point", "x": 0, "y": 0 } ], "labels": [ ], "width": 2, "color": "grey", "curvyness": 50, "selectedColor": "rgb(0,192,255)" } } }, { "id": "30", "type": "diagram-nodes", "isSvg": false, "transformed": true, "models": { "32": { "id": "32", "type": "default", "x": 100, "y": 100, "ports": [ { "id": "33", "type": "default", "x": 100, "y": 100, "name": "Out", "alignment": "right", "parentNode": "32", "links": [ "36" ], "in": false, "label": "Out" } ], "name": "Node 1", "color": "rgb(0,192,255)", "portsInOrder": [ ], "portsOutOrder": [ "33" ] }, "34": { "id": "34", "type": "default", "x": 400, "y": 100, "ports": [ { "id": "35", "type": "default", "x": 400, "y": 100, "name": "In", "alignment": "left", "parentNode": "34", "links": [ "36" ], "in": true, "label": "In" } ], "name": "Node 2", "color": "rgb(192,255,0)", "portsInOrder": [ "35" ], "portsOutOrder": [ ] } } } ] } Graphical display Speculation and analysis1. Root Directory First, the root directory has 5 parameters: 2.0 Layer[0]
2.1. models (diagram-links) 2.1.1. Point 2.2. Layer[1] 2.2.1 models (diagram-nodes)
2.2.2. ports
3. More case studies 3.1. Add output interface Just add the output port and remember to add its ID in the out position. 3.2. Add input interface The above is the details of the case analysis of react-diagram serialization Json interpretation. For more information about react-diagram serialization Json, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: Mysql cannot select non-aggregate columns
>>: Linux Domain Name Service DNS Configuration Method
Table of contents Thoughts triggered by an online...
Table of contents background Question 1 Error 2 E...
Table of contents redo log Why do we need to upda...
Swarm Cluster Management Introduction Docker Swar...
Effect Need environment vue elementUI Drag and dr...
This article shares the specific code of JavaScri...
This article shares with you a detailed tutorial ...
Big pit, don't easily delete the version of P...
1|0 Background Due to project requirements, each ...
Table of contents 1. Test environment 1.1 Hardwar...
Sometimes the theme of a project cannot satisfy e...
Preface Backup is the basis of disaster recovery....
Table of contents 1. Introduction 1. Basic layout...
Timer Effects: <div> <font id='timeC...
1. Run the .sh file You can run it directly using...