You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/08/03 06:42:01 UTC

[GitHub] [echarts] HCLacids commented on a change in pull request #15405: fix:node self pointed -add cubicBezierCurve

HCLacids commented on a change in pull request #15405:
URL: https://github.com/apache/echarts/pull/15405#discussion_r681477570



##########
File path: src/chart/graph/simpleLayoutHelper.ts
##########
@@ -49,10 +50,22 @@ export function simpleLayoutEdge(graph: Graph, seriesModel: GraphSeriesModel) {
         const p1 = vec2.clone(edge.node1.getLayout());
         const p2 = vec2.clone(edge.node2.getLayout());
         const points = [p1, p2];
-        if (+curveness) {
+        if (edge.node1 === edge.node2) {
+            const size = Number(seriesModel.get('symbolSize'));
+            const radius = getNodeGlobalScale(seriesModel) * size / 2;
             points.push([
-                (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness,
-                (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness
+                p1[0] - radius * 2,
+                p2[1] - radius * 4,
+            ]);
+            points.push([
+                p1[0] + radius * 2,
+                p2[1] - radius * 4,
+            ]);
+        }
+        else if (+curveness) {
+            points.push([
+                (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness / 2,
+                (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness / 2

Review comment:
       I fogot to get it back




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org