Skip to content

Commit 9fe7a50

Browse files
committed
export group node to OCIF WiP
1 parent 9597dbe commit 9fe7a50

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

libs/app-canvas/src/app/exporters/export-ocif.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,18 @@ export class OCIFExporter extends BaseExporter<OCIFFile, OCIFInfo> {
259259
id: `${ocifNode.id}-resource`,
260260
representations: [{ 'mime-type': 'text/plain', content: nodeInfo.type }],
261261
});
262+
if (node.nodeInfo?.isGroup && this.file && node.nodeInfo?.groupedNodeIds) {
263+
const relation = {
264+
id: `${ocifNode.id}-group}`,
265+
data: [
266+
{
267+
type: '@ocif/rel/group' as const,
268+
members: [...node.nodeInfo.groupedNodeIds],
269+
},
270+
],
271+
};
272+
this.file.relations.push(relation);
273+
}
262274
return ocifNode.id;
263275
}
264276
override exportThumb(

libs/app-canvas/src/app/importers/ocif-importer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ function getConnectionInfoFromOCIFNode(node: any): any | false {
9898
return {
9999
endX: node.position?.[0],
100100
endY: node.position?.[1],
101-
startNodeId: clonedNodeInfo.start.connected_to,
102-
endNodeId: clonedNodeInfo.end.connected_to,
103-
startThumbName: clonedNodeInfo.start.port_name,
104-
endThumbName: clonedNodeInfo.end.port_name,
101+
startNodeId: clonedNodeInfo.startNode.connected_to,
102+
endNodeId: clonedNodeInfo.endNode.connected_to,
103+
startThumbName: clonedNodeInfo.startNode.port_name,
104+
endThumbName: clonedNodeInfo.endNode.port_name,
105105
lineType: clonedNodeInfo.lineType ?? 'BezierCubic',
106106
layer: 1,
107107
nodeInfo: {},

0 commit comments

Comments
 (0)