You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -58,20 +58,20 @@ function calcCircleVectorLength(nodeSize, isCustomNode) {
58
58
// nodeSize equals the Diameter in the case of custome-node.
59
59
radiusLength=nodeSize/10/2;
60
60
}else{
61
-
// because this is a circle and A = pi * r^2
62
-
// we multiply by 0.95, because if we don't the link is not melting properly
61
+
// because this is a circle and A = pi * r^2.
63
62
radiusLength=Math.sqrt(nodeSize/Math.PI);
64
63
}
65
-
returnradiusLength;
64
+
// We multiply by 0.95, so that our link will melt properly to its destination component.
65
+
returnradiusLength*0.95;
66
66
}
67
67
68
68
/**
69
-
* Calculate a the vector length from the center of a square to it's perimeter.
69
+
* Calculates the vector length from the center of a square to the closest edge following a direction.
70
70
*
71
-
* @param {number} nodeSize The size of the square, when no viewGenerator is specified, else the size of an edge of the viewGenerator square.
72
-
* @param {Object.<string, number>} nodeCoords The coords of a the square node.
73
-
* @param {Object.<string, number>} directionVector a 2D vector with x and y components
74
-
* @param {boolean} isCustomNode is viewGenerator specified.
71
+
* @param {number} nodeSize - The size of the square, when no viewGenerator is specified, else the size of an edge of the viewGenerator square.
72
+
* @param {Object.<string, number>} nodeCoords - The coords of a the square node.
73
+
* @param {Object.<string, number>} directionVector - A 2D vector with x and y components.
74
+
* @param {boolean} isCustomNode - Is viewGenerator specified.
75
75
* @returns {number} The length of the vector from the center of the symbol to it's closet edge, considering the given direction vector.
76
76
*/
77
77
functioncalcSquareVectorLength(nodeSize,{ x, y },directionVector,isCustomNode){
@@ -80,11 +80,11 @@ function calcSquareVectorLength(nodeSize, { x, y }, directionVector, isCustomNod
80
80
// nodeSize equals the edgeSize in the case of custome-node.
81
81
edgeSize=nodeSize/10;
82
82
}else{
83
-
// All the edges of a square are equal, inorder to calc it's size we multplie two edges.
83
+
// All the edges of a square are equal, inorder to calc its size we multplie two edges.
84
84
edgeSize=Math.sqrt(nodeSize);
85
85
}
86
86
87
-
// The x and y coords in this library, represent the top center of the component.
87
+
// The x and y coords represent the top center of the component
88
88
constleftSquareX=x-edgeSize/2;
89
89
consttopSquareY=y-edgeSize/2;
90
90
@@ -96,11 +96,11 @@ function calcSquareVectorLength(nodeSize, { x, y }, directionVector, isCustomNod
96
96
}
97
97
98
98
/**
99
-
* Calculate a the vector length from the center of a rectangle to it's perimeter.
99
+
* Calculates the vector length from the center of a rectangle to the closest edge following a direction.
100
100
*
101
-
* @param {number} nodeSize The size of the square, when no viewGenerator is specified, else the size of an edge of the viewGenerator square.
102
-
* @param {Object.<string, number>} nodeCoords The coords of a the square node.
103
-
* @param {Object.<string, number>} directionVector a 2D vector with x and y components.
101
+
* @param {number} nodeSize - The size of the square, when no viewGenerator is specified, else the size of an edge of the viewGenerator square.
102
+
* @param {Object.<string, number>} nodeCoords - The coords of a the square node.
103
+
* @param {Object.<string, number>} directionVector - A 2D vector with x and y components.
104
104
* @returns {number} The length of the vector from the center of the symbol to it's closet edge, considering the given direction vector.
105
105
*/
106
106
functioncalcRectangleVectorLength(nodeSize,{ x, y },directionVector){
@@ -122,15 +122,15 @@ function calcRectangleVectorLength(nodeSize, { x, y }, directionVector) {
122
122
/**
123
123
* Calculate a the vector length of symbol that included in symbols with optimized positioning.
124
124
*
125
-
* @param {string} symbolType the string that specifies the symbol type (should be one of {@link #node-symbol-type|node.symbolType})
126
-
* @param {(number | Object.<string, number>)} nodeSize The size of the square, when no viewGenerator is specified, else the size of an edge of the viewGenerator square.
127
-
* @param {Object.<string, number>} nodeCoords The coords of a the square node.
128
-
* @param {Object.<string, number>} directionVector a 2D vector with x and y components.
129
-
* @param {boolean} isCustomNode is viewGenerator specified.
125
+
* @param {string} symbolType - The string that specifies the symbol type (should be one of {@link #node-symbol-type|node.symbolType}).
126
+
* @param {(number | Object.<string, number>)} nodeSize - The size of the square, when no viewGenerator is specified, else the size of an edge of the viewGenerator square.
127
+
* @param {Object.<string, number>} nodeCoords - The coords of a the square node.
128
+
* @param {Object.<string, number>} directionVector - A 2D vector with x and y components.
129
+
* @param {boolean} isCustomNode - Is viewGenerator specified.
130
130
* @returns {number} The length of the vector from the center of the symbol to it's closet edge, considering the given direction vector.
131
131
*/
132
132
functioncalcVectorLength(symbolType,nodeSize,{ x, y },directionVector,isCustomNode){
0 commit comments