Skip to content

Commit 0c58899

Browse files
committed
export node-type name to ocif resource
1 parent 59884f3 commit 0c58899

File tree

2 files changed

+30
-25
lines changed

2 files changed

+30
-25
lines changed

examples-test-flows/google-gemini-flash-simple-prompt.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"nodes": [
99
{
1010
"id": "1bc4104f-6c09-4bd2-9a65-9ed23137a1db",
11-
"x": 3386.346667223463,
12-
"y": 1554.3181419509813,
11+
"x": 3385.0492687695514,
12+
"y": 1552.7542880088665,
1313
"width": 111.7109375,
1414
"height": 96,
1515
"nodeType": "Shape",
@@ -22,8 +22,8 @@
2222
},
2323
{
2424
"id": "e8bad215-deb0-42d9-a3e1-156090717777",
25-
"x": 3663.063443291062,
26-
"y": 1511.6350381660247,
25+
"x": 3663.063252748667,
26+
"y": 1511.6348948004531,
2727
"width": 200,
2828
"height": 200,
2929
"nodeType": "Shape",
@@ -40,8 +40,8 @@
4040
"id": "8144d095-7110-43d4-96fb-8683bb78c353",
4141
"x": 4003.48228233086,
4242
"y": 1511.442820331771,
43-
"width": 120.00014325456367,
44-
"height": 271.99997072762085,
43+
"width": 120.00012114343782,
44+
"height": 272.00002126171097,
4545
"nodeType": "Shape",
4646
"nodeInfo": {
4747
"type": "show-input",
@@ -55,8 +55,8 @@
5555
"id": "c3a8bd9e-f4d5-46db-9384-b1de17a33c5f",
5656
"x": 4673.813291479845,
5757
"y": 1515.2823102709674,
58-
"width": 119.99971847529551,
59-
"height": 271.99997072762085,
58+
"width": 120.00024478386862,
59+
"height": 271.99985785647624,
6060
"nodeType": "Shape",
6161
"nodeInfo": {
6262
"type": "show-input",
@@ -83,8 +83,8 @@
8383
},
8484
{
8585
"id": "9f1f3e1c-787f-406f-b52b-b6db3e7b85dd",
86-
"x": 3116.814739534093,
87-
"y": 1576.3308286951303,
86+
"x": 3118.071968733307,
87+
"y": 1576.3307594505643,
8888
"width": 74.7109375,
8989
"height": 64,
9090
"nodeType": "Shape",
@@ -99,8 +99,8 @@
9999
"id": "8b7d6c8d-1806-4596-a47a-514038cffe13",
100100
"x": 3149.2124074033727,
101101
"y": 1326.8614491593612,
102-
"width": 174.4217358717848,
103-
"height": 84.00000484223884,
102+
"width": 174.42193078717077,
103+
"height": 84.00000405121487,
104104
"nodeType": "Shape",
105105
"nodeInfo": {
106106
"type": "scope-variable",
@@ -118,8 +118,8 @@
118118
"id": "342b786f-955e-4ef8-968e-60b24427b75a",
119119
"x": 3466.3939102846325,
120120
"y": 1255.3912207892486,
121-
"width": 174.421938322169,
122-
"height": 84.00000484223884,
121+
"width": 174.42193078717077,
122+
"height": 84.00000405121487,
123123
"nodeType": "Shape",
124124
"nodeInfo": {
125125
"type": "scope-variable",
@@ -135,10 +135,10 @@
135135
},
136136
{
137137
"id": "6a22f828-b47c-4123-bde9-6ebe2940cc0a",
138-
"x": 3498.057604723463,
139-
"y": 1602.3181419509813,
140-
"endX": 3663.063443291062,
141-
"endY": 1611.6350381660247,
138+
"x": 3496.7602062695514,
139+
"y": 1600.7542880088665,
140+
"endX": 3663.063252748667,
141+
"endY": 1611.6348948004531,
142142
"startNodeId": "1bc4104f-6c09-4bd2-9a65-9ed23137a1db",
143143
"endNodeId": "e8bad215-deb0-42d9-a3e1-156090717777",
144144
"startThumbName": "output",
@@ -150,8 +150,8 @@
150150
},
151151
{
152152
"id": "41770511-b5bf-4014-9b95-1dee2abd53de",
153-
"x": 3863.063443291062,
154-
"y": 1541.6350381660247,
153+
"x": 3863.063252748667,
154+
"y": 1541.6348948004531,
155155
"endX": 4003.48228233086,
156156
"endY": 1541.442820331771,
157157
"startNodeId": "e8bad215-deb0-42d9-a3e1-156090717777",
@@ -165,7 +165,7 @@
165165
},
166166
{
167167
"id": "ea98148d-52be-473c-be87-8f0fbd6e771b",
168-
"x": 4123.482425585424,
168+
"x": 4123.482403474298,
169169
"y": 1541.442820331771,
170170
"endX": 4313.803391261389,
171171
"endY": 1544.0914007909573,
@@ -195,10 +195,10 @@
195195
},
196196
{
197197
"id": "3595bb23-681a-43d1-b8c5-0a3cd2b68bfc",
198-
"x": 3191.525677034093,
199-
"y": 1608.3308286951303,
200-
"endX": 3386.346667223463,
201-
"endY": 1602.3181419509813,
198+
"x": 3192.782906233307,
199+
"y": 1608.3307594505643,
200+
"endX": 3385.0492687695514,
201+
"endY": 1600.7542880088665,
202202
"startNodeId": "9f1f3e1c-787f-406f-b52b-b6db3e7b85dd",
203203
"endNodeId": "1bc4104f-6c09-4bd2-9a65-9ed23137a1db",
204204
"startThumbName": "output",

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ export class OCIFExporter extends BaseExporter<OCIFFile, OCIFInfo> {
217217
position: [node.x, node.y],
218218
size: [node.width ?? 0, node.height ?? 0],
219219
data: [...portsNode],
220+
resource: `${node.id}-resource`,
220221
};
221222

222223
if (
@@ -254,6 +255,10 @@ export class OCIFExporter extends BaseExporter<OCIFFile, OCIFInfo> {
254255
this.file.relations.push(relation);
255256
}
256257
}
258+
this.file?.resources.push({
259+
id: `${ocifNode.id}-resource`,
260+
representations: [{ 'mime-type': 'text/plain', content: nodeInfo.type }],
261+
});
257262
return ocifNode.id;
258263
}
259264
override exportThumb(

0 commit comments

Comments
 (0)