MCPcopy
hub / github.com/1Panel-dev/MaxKB / translationEdgeData

Function translationEdgeData

ui/src/workflow/common/shortcut.ts:62–82  ·  view source on GitHub ↗
(edgeData: any, distance: any)

Source from the content-addressed store, hash-verified

60}
61
62function translationEdgeData(edgeData: any, distance: any) {
63 if (edgeData.startPoint) {
64 edgeData.startPoint.x += distance
65 edgeData.startPoint.y += distance
66 }
67 if (edgeData.endPoint) {
68 edgeData.endPoint.x += distance
69 edgeData.endPoint.y += distance
70 }
71 if (edgeData.pointsList && edgeData.pointsList.length > 0) {
72 edgeData.pointsList.forEach((point: any) => {
73 point.x += distance
74 point.y += distance
75 })
76 }
77 if (edgeData.text) {
78 edgeData.text.x += distance
79 edgeData.text.y += distance
80 }
81 return edgeData
82}
83
84const TRANSLATION_DISTANCE = 40
85let CHILDREN_TRANSLATION_DISTANCE = 40

Callers 2

copy_nodeFunction · 0.85
paste_nodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected