plainheart commented on code in PR #18834:
URL: https://github.com/apache/echarts/pull/18834#discussion_r1248733549


##########
src/chart/sankey/SankeyView.ts:
##########
@@ -195,30 +196,32 @@ class SankeyView extends ChartView {
 
             curve.useStyle(lineStyleModel.getItemStyle());
             // Special color, use source node color or target node color
-            switch (curve.style.fill) {
-                case 'source':
-                    curve.style.fill = edge.node1.getVisual('color');
-                    curve.style.decal = edge.node1.getVisual('style').decal;
-                    break;
-                case 'target':
-                    curve.style.fill = edge.node2.getVisual('color');
-                    curve.style.decal = edge.node2.getVisual('style').decal;
-                    break;
-                case 'gradient':
-                    const sourceColor = edge.node1.getVisual('color');
-                    const targetColor = edge.node2.getVisual('color');
-                    if (isString(sourceColor) && isString(targetColor)) {
-                        curve.style.fill = new graphic.LinearGradient(
-                            0, 0, +(orient === 'horizontal'), +(orient === 
'vertical'), [{
-                                color: sourceColor,
-                                offset: 0
-                            }, {
-                                color: targetColor,
-                                offset: 1
-                            }]
-                        );
-                    }
-            }
+            applyCurveStyle(curve.style, orient, edge);
+            // switch (curve.style.fill) {
+            //     case 'source':
+            //         curve.style.fill = edge.node1.getVisual('color');
+            //         curve.style.decal = edge.node1.getVisual('style').decal;
+            //         break;
+            //     case 'target':
+            //         curve.style.fill = edge.node2.getVisual('color');
+            //         curve.style.decal = edge.node2.getVisual('style').decal;
+            //         break;
+            //     case 'gradient':
+            //         const sourceColor = edge.node1.getVisual('color');
+            //         const targetColor = edge.node2.getVisual('color');
+            //         if (isString(sourceColor) && isString(targetColor)) {
+            //             curve.style.fill = new graphic.LinearGradient(
+            //                 0, 0, +(orient === 'horizontal'), +(orient === 
'vertical'), [{
+            //                     color: sourceColor,
+            //                     offset: 0
+            //                 }, {
+            //                     color: targetColor,
+            //                     offset: 1
+            //                 }]
+            //             );
+            //         }
+            // }
+

Review Comment:
   Just please clean the commented code fragement.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to