Skip to content

Commit

Permalink
#1238 SetCanvas canvas-controller API should support styles for nodes…
Browse files Browse the repository at this point in the history
…, comments and links (#1239)
  • Loading branch information
tomlyn authored Nov 7, 2022
1 parent 5677ba6 commit 4dc9102
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ export default class CanvasInHandler {
y_pos: typeof canvasNode.y_pos !== "undefined" ? canvasNode.y_pos : canvasNode.yPos, // Handle old field name yPos
class_name: canvasNode.className,
label: canvasNode.objectData.label,
type: nodeType
type: nodeType,
style: canvasNode.style
};
if (canvasNode.objectData && canvasNode.objectData.description) {
newNode.description = canvasNode.objectData.description;
Expand Down Expand Up @@ -178,7 +179,8 @@ export default class CanvasInHandler {
x_pos: typeof canvasComment.x_pos !== "undefined" ? canvasComment.x_pos : canvasComment.xPos, // Handle old field name xPos
y_pos: typeof canvasComment.y_pos !== "undefined" ? canvasComment.y_pos : canvasComment.yPos, // Handle old field name yPos
height: canvasComment.height,
width: canvasComment.width
width: canvasComment.width,
style: canvasComment.style
})
);
}
Expand All @@ -192,7 +194,8 @@ export default class CanvasInHandler {
class_name: canvasLink.className,
srcNodeId: canvasLink.source,
trgNodeId: canvasLink.target,
type: this.getLinkType(canvasLink)
type: this.getLinkType(canvasLink),
style: canvasLink.style
};
if (canvasLink.sourcePort) {
newLink.srcNodePortId = canvasLink.sourcePort;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,12 @@
"node_ref": "id2PZSCTRPRIJ",
"class_name": "canvas-comment-link"
}
]
],
"style": {
"body": {
"default": "fill: #FFFF99"
}
}
},
{
"id": "id2MHTH4XNJ32",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,12 @@
"node_ref": "id2PZSCTRPRIJ",
"class_name": "canvas-comment-link"
}
]
],
"style": {
"body": {
"default": "fill: #FFFF99"
}
}
},
{
"id": "id2MHTH4XNJ32",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,12 @@
"node_ref": "id2PZSCTRPRIJ",
"class_name": "canvas-comment-link"
}
]
],
"style": {
"body": {
"default": "fill: #FFFF99"
}
}
},
{
"id": "id2MHTH4XNJ32",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,12 @@
"id2PZSCTRPRIJ"
]
},
"isCut": false
"isCut": false,
"style": {
"body": {
"default": "fill: #FFFF99"
}
}
},
{
"id": "id2MHTH4XNJ32",
Expand Down

0 comments on commit 4dc9102

Please sign in to comment.