使用graph.toJSON导出数据后, 用该数据作为model, 将报错。
可能是节点上有连接桩的话不支持布局?
model数据结构
{"nodes":[{"position":{"x":210,"y":210},"size":{"width":40,"height":40},"attrs":{"text":{"fontSize":12,"fill":"#fff","text":"开始"}},"shape":"custom-start","data":{"content":""},"ports":{"groups":{"out":{"position":"right","label":{"position":"bottom"},"attrs":{"circle":{"r":6,"magnet":true,"stroke":"#1d92ff","strokeWidth":1,"fill":"#fff","style":{"visibility":"hidden"}}}}},"items":[{"group":"out","id":"54296695-fcc4-4416-a97f-2a38844b2e1d"}]},"id":"9c9675d9-3db9-4439-b89b-532397042d46","zIndex":1},{"position":{"x":367,"y":213},"size":{"width":70,"height":34},"attrs":{"text":{"fill":"white","text":"提问"}},"shape":"custom-question","data":{"content":""},"ports":{"groups":{"in":{"position":"left","label":{"position":"top"},"attrs":{"circle":{"r":6,"refX":-4,"magnet":true,"stroke":"#1d92ff","strokeWidth":1,"fill":"#fff","style":{"visibility":"hidden"}}}},"out":{"position":"right","label":{"position":"bottom"},"attrs":{"circle":{"r":6,"refX":4,"magnet":true,"stroke":"#1d92ff","strokeWidth":1,"fill":"#fff","style":{"visibility":"hidden"}}}}},"items":[{"group":"in","id":"15622c39-3528-4abd-9c8f-efc12e1aa162"},{"group":"out","id":"c794c5f5-528b-4e42-942e-1fd833989e6a"}]},"id":"8364a6e7-f777-4381-820d-85c58af4ee92","zIndex":2},{"position":{"x":582,"y":213},"size":{"width":70,"height":34},"attrs":{"text":{"fill":"white","text":"引导"}},"shape":"custom-guide","data":{"content":""},"ports":{"groups":{"in":{"zIndex":999,"position":"left","label":{"position":"top"},"attrs":{"circle":{"r":8,"magnet":true,"stroke":"#1d92ff","strokeWidth":1,"fill":"#fff","style":{"visibility":"hidden"}}}},"out":{"position":"right","label":{"position":"bottom"},"attrs":{"circle":{"r":8,"magnet":true,"stroke":"#1d92ff","strokeWidth":1,"fill":"#fff","style":{"visibility":"hidden"}}}}},"items":[{"group":"in","id":"33b014b9-ef11-433e-a3dc-e7844cb9d404"},{"group":"out","id":"7c67f94a-fd9b-4433-93b4-32207b257367"}]},"id":"a17ffe75-00a6-4a4c-9c90-5adf44a18011","zIndex":3},{"position":{"x":790,"y":80},"size":{"width":70,"height":34},"attrs":{"text":{"fill":"white","text":"回答"}},"shape":"custom-answer","data":{"content":""},"ports":{"groups":{"in":{"position":"left","label":{"position":"top"},"attrs":{"circle":{"r":6,"magnet":true,"stroke":"#1d92ff","strokeWidth":1,"fill":"#fff","style":{"visibility":"hidden"}}}},"out":{"position":"right","label":{"position":"bottom"},"attrs":{"circle":{"r":6,"magnet":true,"stroke":"#1d92ff","strokeWidth":1,"fill":"#fff","style":{"visibility":"hidden"}}}}},"items":[{"group":"in","id":"b9ad93b0-cb2f-4e3e-8b54-ac0f18bff2d4"},{"group":"out","id":"c11955c4-c8fb-4b6d-b6db-b7b97fd05e4d"}]},"id":"a0ffca88-29d8-4718-a982-70f06aa1b091","zIndex":4},{"position":{"x":790,"y":370},"size":{"width":70,"height":34},"attrs":{"text":{"fill":"white","text":"回答"}},"shape":"custom-answer","data":{"content":""},"ports":{"groups":{"in":{"position":"left","label":{"position":"top"},"attrs":{"circle":{"r":6,"magnet":true,"stroke":"#1d92ff","strokeWidth":1,"fill":"#fff","style":{"visibility":"hidden"}}}},"out":{"position":"right","label":{"position":"bottom"},"attrs":{"circle":{"r":6,"magnet":true,"stroke":"#1d92ff","strokeWidth":1,"fill":"#fff","style":{"visibility":"hidden"}}}}},"items":[{"group":"in","id":"b9ad93b0-cb2f-4e3e-8b54-ac0f18bff2d4"},{"group":"out","id":"c11955c4-c8fb-4b6d-b6db-b7b97fd05e4d"}]},"id":"06338735-68f4-41aa-80c4-dcb8c1604414","zIndex":5},{"position":{"x":980,"y":210},"size":{"width":40,"height":40},"attrs":{"text":{"fontSize":12,"fill":"white","text":"结束"}},"shape":"custom-end","data":{"content":""},"ports":{"groups":{"in":{"position":"left","label":{"position":"bottom"},"attrs":{"circle":{"r":6,"magnet":true,"stroke":"#1d92ff","strokeWidth":1,"fill":"#fff","style":{"visibility":"hidden"}}}}},"items":[{"group":"in","id":"13f3b0b5-6849-4c49-9f60-fabf1bd2fccb"}]},"id":"a904b5f2-041f-46e9-8007-adc7e837fd5d","zIndex":6}],"edges":[{"shape":"edge","attrs":{"line":{"stroke":"#a0a0a0","targetMarker":{"name":"classic","size":7}}},"id":"2d8d8213-0e85-4974-b490-62cbd8bef795","zIndex":7,"data":{"content":""},"labels":[""],"source":{"cell":"9c9675d9-3db9-4439-b89b-532397042d46","port":"54296695-fcc4-4416-a97f-2a38844b2e1d"},"target":{"cell":"8364a6e7-f777-4381-820d-85c58af4ee92","port":"15622c39-3528-4abd-9c8f-efc12e1aa162"}},{"shape":"edge","attrs":{"line":{"stroke":"#a0a0a0","targetMarker":{"name":"classic","size":7}}},"id":"de8df879-feb1-458e-9b91-f03850e32bdc","zIndex":8,"data":{"content":""},"labels":[""],"source":{"cell":"a0ffca88-29d8-4718-a982-70f06aa1b091","port":"c11955c4-c8fb-4b6d-b6db-b7b97fd05e4d"},"target":{"cell":"a904b5f2-041f-46e9-8007-adc7e837fd5d","port":"13f3b0b5-6849-4c49-9f60-fabf1bd2fccb"}},{"shape":"edge","attrs":{"line":{"stroke":"#a0a0a0","targetMarker":{"name":"classic","size":7}}},"id":"4bb6471e-9c41-4b81-8766-81558af52448","zIndex":9,"data":{"content":""},"labels":[""],"source":{"cell":"06338735-68f4-41aa-80c4-dcb8c1604414","port":"c11955c4-c8fb-4b6d-b6db-b7b97fd05e4d"},"target":{"cell":"a904b5f2-041f-46e9-8007-adc7e837fd5d","port":"13f3b0b5-6849-4c49-9f60-fabf1bd2fccb"}},{"shape":"edge","attrs":{"line":{"stroke":"#a0a0a0","targetMarker":{"name":"classic","size":7}}},"id":"8a3505c7-7c5c-4f1b-94f7-e76261c82ac8","zIndex":10,"data":{"content":""},"labels":[""],"source":{"cell":"a17ffe75-00a6-4a4c-9c90-5adf44a18011","port":"7c67f94a-fd9b-4433-93b4-32207b257367"},"target":{"cell":"06338735-68f4-41aa-80c4-dcb8c1604414","port":"b9ad93b0-cb2f-4e3e-8b54-ac0f18bff2d4"}},{"shape":"edge","attrs":{"line":{"stroke":"#a0a0a0","targetMarker":{"name":"classic","size":7}}},"id":"6d6d6ead-2aed-45d6-879d-0ca0c4f71a14","zIndex":11,"data":{"content":""},"labels":[""],"source":{"cell":"a17ffe75-00a6-4a4c-9c90-5adf44a18011","port":"7c67f94a-fd9b-4433-93b4-32207b257367"},"target":{"cell":"a0ffca88-29d8-4718-a982-70f06aa1b091","port":"b9ad93b0-cb2f-4e3e-8b54-ac0f18bff2d4"}},{"shape":"edge","attrs":{"line":{"stroke":"#a0a0a0","targetMarker":{"name":"classic","size":7}}},"id":"21c00165-c757-4c1c-afb6-9de56ef9312c","zIndex":12,"data":{"content":""},"labels":[""],"source":{"cell":"8364a6e7-f777-4381-820d-85c58af4ee92","port":"c794c5f5-528b-4e42-942e-1fd833989e6a"},"target":{"cell":"a17ffe75-00a6-4a4c-9c90-5adf44a18011","port":"33b014b9-ef11-433e-a3dc-e7844cb9d404"}}]}
> vue.esm.js?a026:1897 Error: Not possible to find intersection inside of the rectangle
at Object.intersectRect (util.js?b50e:108)
at eval (layout.js?7a9c:271)
at arrayEach (_arrayEach.js?8057:15)
at Object.forEach (forEach.js?6cd4:38)
at assignNodeIntersects (layout.js?7a9c:258)
at eval (layout.js?7a9c:55)
at notime (util.js?b50e:237)
at runLayout (layout.js?7a9c:55)
at eval (layout.js?7a9c:25)
at notime (util.js?b50e:237)