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


##########
src/util/jitter.ts:
##########
@@ -67,21 +67,19 @@ export function fixJitter(
     }
     const axisModel = fixedAxis.model as AxisBaseModel;
     const jitter = axisModel.get('jitter');
+    if (!(jitter > 0)) {
+        return floatCoord;
+    }
     const jitterOverlap = axisModel.get('jitterOverlap');
     const jitterMargin = axisModel.get('jitterMargin') || 0;
     // Get band width to limit jitter range
     const bandWidth = fixedAxis.scale.type === 'ordinal'
         ? fixedAxis.getBandWidth()
         : null;
-    if (jitter > 0) {
-        if (jitterOverlap) {
-            return fixJitterIgnoreOverlaps(floatCoord, jitter, bandWidth, 
radius);
-        }
-        else {
-            return fixJitterAvoidOverlaps(fixedAxis, fixedCoord, floatCoord, 
radius, jitter, jitterMargin);
-        }
+    if (jitterOverlap) {
+        return fixJitterIgnoreOverlaps(floatCoord, jitter, bandWidth, radius);
     }
-    return floatCoord;
+    return fixJitterAvoidOverlaps(fixedAxis, fixedCoord, floatCoord, radius, 
jitter, jitterMargin);

Review Comment:
   No logical bug here. Just tweaked the code style.



-- 
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